Show
Ignore:
Timestamp:
08/31/07 10:59:52 (15 months ago)
Author:
asterix
Message:

use new dataform widget in groupchat config window

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/gajim_0.11.1/src/config.py

    r8663 r8668  
    2929import message_control 
    3030import chat_control 
     31import dataforms_widget 
    3132 
    3233try: 
     
    4243from common import zeroconf 
    4344from common import dbus_support 
     45from common import dataforms 
    4446 
    4547from common.exceptions import GajimGeneralException 
     
    21682170                self.window.destroy() 
    21692171 
    2170 class GroupchatConfigWindow(DataFormWindow): 
     2172class GroupchatConfigWindow: 
    21712173        '''GroupchatConfigWindow class''' 
    2172         def __init__(self, account, room_jid, config = None): 
    2173                 DataFormWindow.__init__(self, account, config) 
     2174        def __init__(self, account, room_jid, form = None): 
     2175                self.account = account 
    21742176                self.room_jid = room_jid 
     2177                self.form = form 
    21752178                self.remove_button = {} 
    21762179                self.affiliation_treeview = {} 
     
    21812184                        'admin':_('Administrator List')} 
    21822185 
    2183                 # Draw the edit affiliation list things          
     2186                self.xml = gtkgui_helpers.get_glade('data_form_window.glade', 'data_form_window') 
     2187                self.window = self.xml.get_widget('data_form_window') 
     2188                self.window.set_transient_for(gajim.interface.roster.window) 
     2189 
     2190                if self.form: 
     2191                        config_vbox = self.xml.get_widget('config_vbox') 
     2192                        dataform = dataforms.ExtendForm(node = self.form) 
     2193                        self.data_form_widget = dataforms_widget.DataFormWidget(dataform) 
     2194                        # hide scrollbar of this data_form_widget, we already have in this 
     2195                        # widget 
     2196                        sw = self.data_form_widget.xml.get_widget('single_form_scrolledwindow') 
     2197                        sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_NEVER) 
     2198 
     2199                        self.data_form_widget.show() 
     2200                        config_vbox.pack_start(self.data_form_widget) 
     2201 
     2202                # Draw the edit affiliation list things 
    21842203                add_on_vbox = self.xml.get_widget('add_on_vbox') 
    2185                  
     2204 
    21862205                for affiliation in ('outcast', 'member', 'owner', 'admin'): 
    21872206                        self.list_init[affiliation] = {} 
     
    22402259                                affiliation) 
    22412260 
    2242                 add_on_vbox.show_all()  
     2261                self.xml.signal_autoconnect(self) 
     2262                self.window.show_all() 
     2263 
     2264        def on_cancel_button_clicked(self, widget): 
     2265                self.window.destroy() 
    22432266 
    22442267        def on_cell_edited(self, cell, path, new_text): 
     
    23192342        def on_ok_button_clicked(self, widget): 
    23202343                # We pressed OK button of the DataFormWindow 
    2321                 if self.config: 
    2322                         gajim.connections[self.account].send_gc_config(self.room_jid, 
    2323                                 self.config) 
     2344                if self.form: 
     2345                        form = self.data_form_widget.data_form 
     2346                        gajim.connections[self.account].send_gc_config(self.room_jid, form) 
    23242347                for affiliation in ('outcast', 'member', 'owner', 'admin'): 
    23252348                        list = {}