coding standards

This commit is contained in:
Yann Leboulanger 2008-08-07 22:08:08 +00:00
parent 90a4a348ca
commit 9d48c69709

View file

@ -1476,8 +1476,6 @@ class CommonInputDialog:
label.set_markup(label_str) label.set_markup(label_str)
self.cancel_handler = cancel_handler self.cancel_handler = cancel_handler
self.is_modal = is_modal
self.ok_handler = ok_handler self.ok_handler = ok_handler
okbutton = self.xml.get_widget('okbutton') okbutton = self.xml.get_widget('okbutton')
okbutton.connect('clicked', self.on_okbutton_clicked) okbutton.connect('clicked', self.on_okbutton_clicked)
@ -1539,8 +1537,7 @@ class InputTextDialog(CommonInputDialog):
class DubbleInputDialog: class DubbleInputDialog:
'''Class for Dubble Input dialog''' '''Class for Dubble Input dialog'''
def __init__(self, title, label_str1, label_str2, input_str1=None, def __init__(self, title, label_str1, label_str2, input_str1=None,
input_str2 = None, is_modal = True, ok_handler = None, input_str2=None, is_modal=True, ok_handler=None, cancel_handler=None):
cancel_handler = None):
# if modal is True you also need to call get_response() # if modal is True you also need to call get_response()
# and ok_handler won't be used # and ok_handler won't be used
self.xml = gtkgui_helpers.get_glade('dubbleinput_dialog.glade') self.xml = gtkgui_helpers.get_glade('dubbleinput_dialog.glade')
@ -2089,7 +2086,8 @@ class PopupNotificationWindow:
pos_x = gtk.gdk.screen_width() - window_width + pos_x + 1 pos_x = gtk.gdk.screen_width() - window_width + pos_x + 1
pos_y = gajim.config.get('notification_position_y') pos_y = gajim.config.get('notification_position_y')
if pos_y < 0: if pos_y < 0:
pos_y = gtk.gdk.screen_height() - gajim.interface.roster.popups_notification_height + pos_y + 1 pos_y = gtk.gdk.screen_height() - \
gajim.interface.roster.popups_notification_height + pos_y + 1
self.window.move(pos_x, pos_y) self.window.move(pos_x, pos_y)
xml.signal_autoconnect(self) xml.signal_autoconnect(self)
@ -2110,7 +2108,7 @@ class PopupNotificationWindow:
if len(gajim.interface.roster.popup_notification_windows) > 0: if len(gajim.interface.roster.popup_notification_windows) > 0:
# we want to remove the first window added in the list # we want to remove the first window added in the list
gajim.interface.roster.popup_notification_windows.pop(0) # remove 1st item gajim.interface.roster.popup_notification_windows.pop(0)
# move the rest of popup windows # move the rest of popup windows
gajim.interface.roster.popups_notification_height = 0 gajim.interface.roster.popups_notification_height = 0
@ -2118,7 +2116,8 @@ class PopupNotificationWindow:
window_width, window_height = window_instance.window.get_size() window_width, window_height = window_instance.window.get_size()
gajim.interface.roster.popups_notification_height += window_height gajim.interface.roster.popups_notification_height += window_height
window_instance.window.move(gtk.gdk.screen_width() - window_width, window_instance.window.move(gtk.gdk.screen_width() - window_width,
gtk.gdk.screen_height() - gajim.interface.roster.popups_notification_height) gtk.gdk.screen_height() - \
gajim.interface.roster.popups_notification_height)
def on_popup_notification_window_button_press_event(self, widget, event): def on_popup_notification_window_button_press_event(self, widget, event):
if event.button != 1: if event.button != 1:
@ -2169,14 +2168,16 @@ class SingleMessageWindow:
self.conversation_textview.tv) self.conversation_textview.tv)
self.form_widget = None self.form_widget = None
parent_box = self.xml.get_widget('conversation_scrolledwindow').get_parent() parent_box = self.xml.get_widget('conversation_scrolledwindow').\
get_parent()
if form_node: if form_node:
dataform = dataforms.ExtendForm(node = form_node) dataform = dataforms.ExtendForm(node = form_node)
self.form_widget = dataforms_widget.DataFormWidget(dataform) self.form_widget = dataforms_widget.DataFormWidget(dataform)
self.form_widget.show_all() self.form_widget.show_all()
parent_box.add(self.form_widget) parent_box.add(self.form_widget)
parent_box.child_set_property(self.form_widget, 'position', parent_box.child_set_property(self.form_widget, 'position',
parent_box.child_get_property(self.xml.get_widget('conversation_scrolledwindow'), 'position')) parent_box.child_get_property(self.xml.get_widget(
'conversation_scrolledwindow'), 'position'))
self.action = 'form' self.action = 'form'
self.send_button = self.xml.get_widget('send_button') self.send_button = self.xml.get_widget('send_button')
@ -2362,7 +2363,8 @@ class SingleMessageWindow:
if self.session: if self.session:
session = self.session session = self.session
else: else:
session = gajim.connections[self.account].make_new_session(to_whom_jid) session = gajim.connections[self.account].make_new_session(
to_whom_jid)
if self.form_widget: if self.form_widget:
form_node = self.form_widget.data_form form_node = self.form_widget.data_form
@ -2484,7 +2486,8 @@ class XMLConsoleWindow:
_('Please make sure you are connected with "%s".') % self.account) _('Please make sure you are connected with "%s".') % self.account)
return return
begin_iter, end_iter = self.input_tv_buffer.get_bounds() begin_iter, end_iter = self.input_tv_buffer.get_bounds()
stanza = self.input_tv_buffer.get_text(begin_iter, end_iter).decode('utf-8') stanza = self.input_tv_buffer.get_text(begin_iter, end_iter).decode(
'utf-8')
if stanza: if stanza:
gajim.connections[self.account].send_stanza(stanza) gajim.connections[self.account].send_stanza(stanza)
self.input_tv_buffer.set_text('') # we sent ok, clear the textview self.input_tv_buffer.set_text('') # we sent ok, clear the textview
@ -3776,7 +3779,8 @@ class TransformChatToMUC:
def unique_room_id_error(self, server): def unique_room_id_error(self, server):
self.unique_room_id_supported(server, self.unique_room_id_supported(server,
gajim.nicks[self.account].lower().replace(' ','') + str(randrange(9999999))) gajim.nicks[self.account].lower().replace(' ','') + str(randrange(
9999999)))
class DataFormWindow(Dialog): class DataFormWindow(Dialog):
def __init__(self, form, on_response_ok): def __init__(self, form, on_response_ok):