HIG to adhod glade file; TODO-> FIXME and better header for the corresponding py
This commit is contained in:
parent
23fe716527
commit
708977f0c0
|
@ -4,6 +4,7 @@
|
||||||
<glade-interface>
|
<glade-interface>
|
||||||
|
|
||||||
<widget class="GtkWindow" id="adhoc_commands_window">
|
<widget class="GtkWindow" id="adhoc_commands_window">
|
||||||
|
<property name="border_width">6</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="title" translatable="yes">Ad-hoc Commands - Gajim</property>
|
<property name="title" translatable="yes">Ad-hoc Commands - Gajim</property>
|
||||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||||
|
@ -17,15 +18,13 @@
|
||||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
|
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
|
||||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
||||||
<property name="focus_on_map">True</property>
|
<property name="focus_on_map">True</property>
|
||||||
<property name="urgency_hint">False</property>
|
|
||||||
<signal name="destroy" handler="on_adhoc_commands_window_destroy" last_modification_time="Thu, 22 Jun 2006 22:50:45 GMT"/>
|
<signal name="destroy" handler="on_adhoc_commands_window_destroy" last_modification_time="Thu, 22 Jun 2006 22:50:45 GMT"/>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkVBox" id="vbox1">
|
<widget class="GtkVBox" id="vbox1">
|
||||||
<property name="border_width">6</property>
|
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="homogeneous">False</property>
|
<property name="homogeneous">False</property>
|
||||||
<property name="spacing">0</property>
|
<property name="spacing">6</property>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkNotebook" id="stages_notebook">
|
<widget class="GtkNotebook" id="stages_notebook">
|
||||||
|
@ -652,22 +651,11 @@
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkHSeparator" id="hseparator1">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">3</property>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">False</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkHButtonBox" id="hbuttonbox1">
|
<widget class="GtkHButtonBox" id="hbuttonbox1">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
||||||
<property name="spacing">0</property>
|
<property name="spacing">12</property>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkButton" id="back_button">
|
<widget class="GtkButton" id="back_button">
|
||||||
|
|
|
@ -1,14 +1,8 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
## config.py
|
## adhoc_commands.py
|
||||||
##
|
##
|
||||||
## Copyright (C) 2003-2004 Yann Le Boulanger <asterix@lagaule.org>
|
## Copyright (C) 2006 Yann Le Boulanger <asterix@lagaule.org>
|
||||||
## Vincent Hanquez <tab@snarc.org>
|
|
||||||
## Copyright (C) 2005 Yann Le Boulanger <asterix@lagaule.org>
|
|
||||||
## Vincent Hanquez <tab@snarc.org>
|
|
||||||
## Nikos Kouremenos <nkour@jabber.org>
|
## Nikos Kouremenos <nkour@jabber.org>
|
||||||
## Dimitur Kirov <dkirov@gmail.com>
|
|
||||||
## Travis Shirk <travis@pobox.com>
|
|
||||||
## Norman Rasmussen <norman@rasmussen.co.za>
|
|
||||||
##
|
##
|
||||||
## This program is free software; you can redistribute it and/or modify
|
## This program is free software; you can redistribute it and/or modify
|
||||||
## it under the terms of the GNU General Public License as published
|
## it under the terms of the GNU General Public License as published
|
||||||
|
@ -19,9 +13,8 @@
|
||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
## GNU General Public License for more details.
|
## GNU General Public License for more details.
|
||||||
|
|
||||||
# TODO: think if we need caching command list. it may be wrong if there will
|
# FIXME: think if we need caching command list. it may be wrong if there will
|
||||||
# TODO: be entities that often change the list, it may be slow to fetch it
|
# be entities that often change the list, it may be slow to fetch it every time
|
||||||
# TODO: every time
|
|
||||||
|
|
||||||
import gobject
|
import gobject
|
||||||
import gtk
|
import gtk
|
||||||
|
@ -157,7 +150,7 @@ class CommandWindow:
|
||||||
# stage 2: choosing the command to execute
|
# stage 2: choosing the command to execute
|
||||||
def stage2(self):
|
def stage2(self):
|
||||||
'''Populate the command list vbox with radiobuttons
|
'''Populate the command list vbox with radiobuttons
|
||||||
(TODO: if there is more commands, maybe some kind of list?),
|
(FIXME: if there is more commands, maybe some kind of list?),
|
||||||
set widgets' state.'''
|
set widgets' state.'''
|
||||||
# close old stage
|
# close old stage
|
||||||
self.stage_finish()
|
self.stage_finish()
|
||||||
|
@ -301,7 +294,7 @@ class CommandWindow:
|
||||||
try:
|
try:
|
||||||
self.data_form_widget.data_form=self.dataform
|
self.data_form_widget.data_form=self.dataform
|
||||||
except dataforms.Error:
|
except dataforms.Error:
|
||||||
# TODO: translate
|
# FIXME: translate
|
||||||
self.stage5(error='Service sent malformed data', senderror=True)
|
self.stage5(error='Service sent malformed data', senderror=True)
|
||||||
self.data_form_widget.show()
|
self.data_form_widget.show()
|
||||||
else:
|
else:
|
||||||
|
@ -365,7 +358,7 @@ class CommandWindow:
|
||||||
# stage 5: an error has occured
|
# stage 5: an error has occured
|
||||||
def stage5(self, error=None, errorid=None, senderror=False):
|
def stage5(self, error=None, errorid=None, senderror=False):
|
||||||
'''Display the error message. Wait for user to close the window'''
|
'''Display the error message. Wait for user to close the window'''
|
||||||
# TODO: sending error to responder
|
# FIXME: sending error to responder
|
||||||
# close old stage
|
# close old stage
|
||||||
self.stage_finish()
|
self.stage_finish()
|
||||||
|
|
||||||
|
@ -433,7 +426,7 @@ class CommandWindow:
|
||||||
|
|
||||||
def callback(response):
|
def callback(response):
|
||||||
'''Called on response to query.'''
|
'''Called on response to query.'''
|
||||||
# TODO: move to connection_handlers.py
|
# FIXME: move to connection_handlers.py
|
||||||
# is error => error stage
|
# is error => error stage
|
||||||
error = response.getError()
|
error = response.getError()
|
||||||
if error is not None:
|
if error is not None:
|
||||||
|
@ -471,11 +464,11 @@ class CommandWindow:
|
||||||
|
|
||||||
if self.data_form_widget.data_form is not None:
|
if self.data_form_widget.data_form is not None:
|
||||||
# cmdnode.addChild(node=dataforms.DataForm(tofill=self.data_form_widget.data_form))
|
# cmdnode.addChild(node=dataforms.DataForm(tofill=self.data_form_widget.data_form))
|
||||||
# TODO: simplified form to send
|
# FIXME: simplified form to send
|
||||||
cmdnode.addChild(node=self.data_form_widget.data_form)
|
cmdnode.addChild(node=self.data_form_widget.data_form)
|
||||||
|
|
||||||
def callback(response):
|
def callback(response):
|
||||||
# TODO: move to connection_handlers.py
|
# FIXME: move to connection_handlers.py
|
||||||
err = response.getError()
|
err = response.getError()
|
||||||
if err is not None:
|
if err is not None:
|
||||||
self.stage5(errorid = err)
|
self.stage5(errorid = err)
|
||||||
|
@ -499,6 +492,6 @@ class CommandWindow:
|
||||||
|
|
||||||
self.account.connection.send(stanza)
|
self.account.connection.send(stanza)
|
||||||
else:
|
else:
|
||||||
# we did not received any reply from service; TODO: we should wait and
|
# we did not received any reply from service; FIXME: we should wait and
|
||||||
# then send cancel; for now we do nothing
|
# then send cancel; for now we do nothing
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in New Issue