diff --git a/src/config.py b/src/config.py index 6f8e82307..1b7a3e419 100644 --- a/src/config.py +++ b/src/config.py @@ -2333,31 +2333,24 @@ _('Without a connection, you can not browse available services')).get_response() self.browse(server_address) self.plugin.save_config() -#---------- GroupchatConfigWindow class -------------# -class GroupchatConfigWindow: - '''GroupchatConfigWindow class''' - def __init__(self, plugin, account, room_jid, config): +class DataFormWindow: + def __init__(self, plugin, account, config): self.plugin = plugin self.account = account - self.room_jid = room_jid self.config = config - self.xml = gtk.glade.XML(GTKGUI_GLADE, 'groupchat_config_window', APP) - self.window = self.xml.get_widget('groupchat_config_window') + self.xml = gtk.glade.XML(GTKGUI_GLADE, 'data_form_window', APP) + self.window = self.xml.get_widget('data_form_window') self.config_table = self.xml.get_widget('config_table') self.fill_table() self.xml.signal_autoconnect(self) self.window.show_all() - def on_groupchat_config_window_destroy(self, widget): - del self.plugin.windows[self.account]['gc_config'][self.room_jid] + def on_data_form_window_destroy(self, widget): + pass def on_close_button_clicked(self, widget): self.window.destroy() - def on_change_button_clicked(self, widget): - gajim.connections[self.account].send_gc_config(self.room_jid, self.config) - self.window.destroy() - def on_checkbutton_toggled(self, widget, index): self.config[index]['values'][0] = widget.get_active() @@ -2459,6 +2452,20 @@ class GroupchatConfigWindow: nbrows, nbrows + 1) self.config_table.show_all() +#---------- GroupchatConfigWindow class -------------# +class GroupchatConfigWindow(DataFormWindow): + '''GroupchatConfigWindow class''' + def __init__(self, plugin, account, room_jid, config): + DataFormWindow.__init__(self, plugin, account, config) + self.room_jid = room_jid + + def on_data_form_window_destroy(self, widget): + del self.plugin.windows[self.account]['gc_config'][self.room_jid] + + def on_apply_button_clicked(self, widget): + gajim.connections[self.account].send_gc_config(self.room_jid, self.config) + self.window.destroy() + #---------- RemoveAccountWindow class -------------# class RemoveAccountWindow: '''ask for removing from gajim only or from gajim and server too diff --git a/src/gtkgui.glade b/src/gtkgui.glade index 16e80677a..962e95fd1 100644 --- a/src/gtkgui.glade +++ b/src/gtkgui.glade @@ -12366,7 +12366,7 @@ Status message - + 6 Room Configuration GTK_WINDOW_TOPLEVEL @@ -12382,7 +12382,7 @@ Status message GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True - + @@ -12487,77 +12487,15 @@ Status message - + True True True + gtk-apply + True GTK_RELIEF_NORMAL True - - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-apply - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - Chan_ge - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - +