fixes in glade, and some other stuff

This commit is contained in:
Nikos Kouremenos 2005-03-23 13:25:48 +00:00
parent baa8aab741
commit a425908513
5 changed files with 117 additions and 78 deletions

View File

@ -9,7 +9,7 @@ url="http://www.gajim.org"
license="GPL"
depends=(pygtk)
source=($url/downloads/$pkgname-$pkgver.tar.bz2)
md5sums=(217c5e7f2f1523a5fde4219d238698a6)
md5sums=(8175a3ccf93093f23865baebe4fa82f8)
build() {
cd $startdir/src/$pkgname-$pkgver

View File

@ -3,8 +3,8 @@
## Gajim Team:
## - Yann Le Boulanger <asterix@lagaule.org>
## - Vincent Hanquez <tab@snarc.org>
## - Nikos Kouremenos <nkour@jabber.org>
## - Alex Podaras <bigpod@jabber.org>
## - Nikos Kouremenos <kourem@gmail.com>
## - Alex Podaras <bigpod@gmail.com>
##
## Copyright (C) 2003-2005 Gajim Team
##
@ -1483,8 +1483,8 @@ class agent_registration_window:
self.xml.signal_autoconnect(self)
class agent_browser_window:
"""Class for bowser agent window :
class Service_discovery_window:
"""Class for Service Discovery Window :
to know the agents on the selected server"""
def on_agent_browser_window_destroy(self, widget):
"""close window"""
@ -1595,8 +1595,8 @@ class agent_browser_window:
if plugin.connected[account] < 2:
Error_dialog(_("You must be connected to view Agents"))
return
xml = gtk.glade.XML(GTKGUI_GLADE, 'agent_browser_window', APP)
self.window = xml.get_widget('agent_browser_window')
xml = gtk.glade.XML(GTKGUI_GLADE, 'service_discovery_window', APP)
self.window = xml.get_widget('service_discovery_window')
self.agents_treeview = xml.get_widget('agents_treeview')
self.plugin = plugin
self.account = account

View File

@ -429,9 +429,9 @@ class Add_contact_window:
widget.get_toplevel().destroy()
def fill_jid(self):
agent_combobox = self.xml.get_widget('agent_combobox')
model = agent_combobox.get_model()
index = agent_combobox.get_active()
protocol_combobox = self.xml.get_widget('protocol_combobox')
model = protocol_combobox.get_model()
index = protocol_combobox.get_active()
jid = self.xml.get_widget('uid_entry').get_text()
if index > 0:
jid = jid.replace('@', '%')
@ -440,13 +440,13 @@ class Add_contact_window:
jid += '@' + agent
self.xml.get_widget('jid_entry').set_text(jid)
def on_agent_combobox_changed(self, widget):
def on_protocol_combobox_changed(self, widget):
self.fill_jid()
def guess_agent(self):
uid = self.xml.get_widget('uid_entry').get_text()
agent_combobox = self.xml.get_widget('agent_combobox')
model = agent_combobox.get_model()
protocol_combobox = self.xml.get_widget('protocol_combobox')
model = protocol_combobox.get_model()
#If login contains only numbers, it's probably an ICQ number
try:
@ -455,9 +455,9 @@ class Add_contact_window:
pass
else:
if 'ICQ' in self.agents:
agent_combobox.set_active(self.agents.index('ICQ'))
protocol_combobox.set_active(self.agents.index('ICQ'))
return
agent_combobox.set_active(0)
protocol_combobox.set_active(0)
def set_nickname(self):
uid = self.xml.get_widget('uid_entry').get_text()
@ -502,16 +502,16 @@ class Add_contact_window:
name = a
iter = liststore.append([name, a])
self.agents.append(name)
agent_combobox = self.xml.get_widget('agent_combobox')
agent_combobox.set_model(liststore)
agent_combobox.set_active(0)
protocol_combobox = self.xml.get_widget('protocol_combobox')
protocol_combobox.set_model(liststore)
protocol_combobox.set_active(0)
self.fill_jid()
if jid:
self.xml.get_widget('jid_entry').set_text(jid)
jid_splited = jid.split('@')
self.xml.get_widget('uid_entry').set_text(jid_splited[0])
if jid_splited[1] in jid_agents:
agent_combobox.set_active(jid_agents.index(jid_splited[1])+1)
protocol_combobox.set_active(jid_agents.index(jid_splited[1])+1)
self.xml.signal_autoconnect(self)
class About_dialog:

View File

@ -47,7 +47,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image464">
<widget class="GtkImage" id="image481">
<property name="visible">True</property>
<property name="stock">gtk-new</property>
<property name="icon_size">1</property>
@ -67,7 +67,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image465">
<widget class="GtkImage" id="image482">
<property name="visible">True</property>
<property name="stock">gtk-connect</property>
<property name="icon_size">1</property>
@ -93,7 +93,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image466">
<widget class="GtkImage" id="image483">
<property name="visible">True</property>
<property name="stock">gtk-add</property>
<property name="icon_size">1</property>
@ -131,7 +131,7 @@
<signal name="activate" handler="on_about_menuitem_activate" last_modification_time="Tue, 01 Mar 2005 22:56:45 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image467">
<widget class="GtkImage" id="image484">
<property name="visible">True</property>
<property name="stock">gtk-about</property>
<property name="icon_size">1</property>
@ -159,7 +159,7 @@
<accelerator key="Q" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image468">
<widget class="GtkImage" id="image485">
<property name="visible">True</property>
<property name="stock">gtk-quit</property>
<property name="icon_size">1</property>
@ -194,7 +194,7 @@
<accelerator key="A" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image469">
<widget class="GtkImage" id="image486">
<property name="visible">True</property>
<property name="stock">gtk-select-color</property>
<property name="icon_size">1</property>
@ -208,13 +208,13 @@
</child>
<child>
<widget class="GtkImageMenuItem" id="browse_agents_menuitem">
<widget class="GtkImageMenuItem" id="service_disco_menuitem">
<property name="visible">True</property>
<property name="label" translatable="yes">_Browse Agents</property>
<property name="label" translatable="yes">_Service Discovery</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image470">
<widget class="GtkImage" id="image487">
<property name="visible">True</property>
<property name="stock">gtk-find</property>
<property name="icon_size">1</property>
@ -242,7 +242,7 @@
<accelerator key="P" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image471">
<widget class="GtkImage" id="image488">
<property name="visible">True</property>
<property name="stock">gtk-preferences</property>
<property name="icon_size">1</property>
@ -561,7 +561,7 @@
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
@ -1580,7 +1580,7 @@
<widget class="GtkWindow" id="add_contact_window">
<property name="border_width">4</property>
<property name="width_request">317</property>
<property name="height_request">260</property>
<property name="height_request">277</property>
<property name="visible">True</property>
<property name="title" translatable="yes">Add New Contact</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
@ -1603,7 +1603,7 @@
<child>
<widget class="GtkTable" id="table21">
<property name="visible">True</property>
<property name="n_rows">5</property>
<property name="n_rows">6</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">5</property>
@ -1636,7 +1636,7 @@
<child>
<widget class="GtkLabel" id="label186">
<property name="visible">True</property>
<property name="label" translatable="yes">Agent:</property>
<property name="label" translatable="yes">Protocol:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@ -1728,10 +1728,10 @@
</child>
<child>
<widget class="GtkComboBox" id="agent_combobox">
<widget class="GtkComboBox" id="protocol_combobox">
<property name="visible">True</property>
<property name="items" translatable="yes"></property>
<signal name="changed" handler="on_agent_combobox_changed" last_modification_time="Mon, 28 Feb 2005 22:56:52 GMT"/>
<signal name="changed" handler="on_protocol_combobox_changed" last_modification_time="Wed, 23 Mar 2005 13:13:12 GMT"/>
</widget>
<packing>
<property name="left_attach">1</property>
@ -1743,27 +1743,6 @@
</packing>
</child>
<child>
<widget class="GtkEntry" id="jid_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char">*</property>
<property name="activates_default">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="nickname_entry">
<property name="visible">True</property>
@ -1785,6 +1764,27 @@
</packing>
</child>
<child>
<widget class="GtkEntry" id="jid_entry">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="editable">False</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char">*</property>
<property name="activates_default">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="auto_authorize_checkbutton">
<property name="visible">True</property>
@ -1800,12 +1800,51 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label223">
<property name="visible">True</property>
<property name="label" translatable="yes">Group:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkComboBoxEntry" id="comboboxentry1">
<property name="visible">True</property>
<property name="items" translatable="yes"></property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">10</property>
@ -2206,12 +2245,12 @@
</child>
</widget>
<widget class="GtkWindow" id="agent_browser_window">
<widget class="GtkWindow" id="service_discovery_window">
<property name="border_width">4</property>
<property name="width_request">400</property>
<property name="height_request">250</property>
<property name="visible">True</property>
<property name="title" translatable="yes">Agents browser</property>
<property name="title" translatable="yes">Service Discovery</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>

View File

@ -207,19 +207,19 @@ class roster_window:
model.set_value(iter, 1, name)
def make_menu(self):
"""create the browse agents, add contact & join groupchat sub menus"""
"""create the main_window's menus"""
# try to avoid WIDGET_REALIZED_FOR_EVENT failed which freezes gajim
new_message_menuitem = self.xml.get_widget('new_message_menuitem')
join_gc_menuitem = self.xml.get_widget('join_gc_menuitem')
add_contact_menuitem = self.xml.get_widget('add_contact_menuitem')
browse_agents_menuitem = self.xml.get_widget('browse_agents_menuitem')
service_disco_menuitem = self.xml.get_widget('service_disco_menuitem')
if self.add_contact_handler_id:
add_contact_menuitem.handler_disconnect(self.add_contact_handler_id)
self.add_contact_handler_id = None
if self.browse_agents_handler_id:
browse_agents_menuitem.handler_disconnect(\
self.browse_agents_handler_id)
self.browse_agents_handler_id = None
if self.service_disco_handler_id:
service_disco_menuitem.handler_disconnect(\
self.service_disco_handler_id)
self.service_disco_handler_id = None
if self.join_gc_handler_id:
join_gc_menuitem.handler_disconnect(self.join_gc_handler_id)
self.join_gc_handler_id = None
@ -230,8 +230,8 @@ class roster_window:
#remove the existing submenus
if add_contact_menuitem.get_submenu():
add_contact_menuitem.remove_submenu()
if browse_agents_menuitem.get_submenu():
browse_agents_menuitem.remove_submenu()
if service_disco_menuitem.get_submenu():
service_disco_menuitem.remove_submenu()
if join_gc_menuitem.get_submenu():
join_gc_menuitem.remove_submenu()
if new_message_menuitem.get_submenu():
@ -240,12 +240,12 @@ class roster_window:
new_message_menuitem.set_sensitive(True)
join_gc_menuitem.set_sensitive(True)
add_contact_menuitem.set_sensitive(True)
browse_agents_menuitem.set_sensitive(True)
service_disco_menuitem.set_sensitive(True)
else:
new_message_menuitem.set_sensitive(False)
join_gc_menuitem.set_sensitive(False)
add_contact_menuitem.set_sensitive(False)
browse_agents_menuitem.set_sensitive(False)
service_disco_menuitem.set_sensitive(False)
if len(self.plugin.accounts.keys()) >= 2: # 2 or more accounts? make submenus
#add
sub_menu = gtk.Menu()
@ -257,11 +257,11 @@ class roster_window:
sub_menu.show_all()
#agents
sub_menu = gtk.Menu()
browse_agents_menuitem.set_submenu(sub_menu)
service_disco_menuitem.set_submenu(sub_menu)
for account in self.plugin.accounts.keys():
item = gtk.MenuItem(_('using ') + account + _(' account'))
sub_menu.append(item)
item.connect('activate', self.on_browse_agents, account)
item.connect('activate', self.on_service_disco_menuitem_activate, account)
sub_menu.show_all()
#join gc
sub_menu = gtk.Menu()
@ -285,9 +285,9 @@ class roster_window:
self.add_contact_handler_id = add_contact_menuitem.connect(\
'activate', self.on_add_contact, self.plugin.accounts.keys()[0])
#agents
if not self.browse_agents_handler_id:
self.browse_agents_handler_id = browse_agents_menuitem.connect(\
'activate', self.on_browse_agents, self.plugin.accounts.keys()[0])
if not self.service_disco_handler_id:
self.service_disco_handler_id = service_disco_menuitem.connect(\
'activate', self.on_service_disco_menuitem_activate, self.plugin.accounts.keys()[0])
#join_gc
if not self.join_gc_handler_id:
self.join_gc_handler_id = join_gc_menuitem.connect(\
@ -565,7 +565,7 @@ class roster_window:
item.connect("activate", self.on_edit_account, account)
item = gtk.MenuItem(_("_Browse agents"))
menu.append(item)
item.connect("activate", self.on_browse_agents, account)
item.connect("activate", self.on_service_disco_menuitem_activate, account)
item = gtk.MenuItem(_("_Add contact"))
menu.append(item)
item.connect("activate", self.on_add_contact, account)
@ -1083,12 +1083,12 @@ class roster_window:
user.groups))
model.set_value(iter, 5, False)
def on_browse_agents(self, widget, account):
"""When browse agent is selected :
def on_service_disco_menuitem_activate(self, widget, account):
"""When Service Discovery is selected:
Call browse class"""
if not self.plugin.windows[account].has_key('browser'):
self.plugin.windows[account]['browser'] = \
agent_browser_window(self.plugin, account)
Service_discovery_window(self.plugin, account)
def mkpixbufs(self):
"""initialise pixbufs array"""
@ -1254,7 +1254,7 @@ class roster_window:
self.plugin = plugin
self.nb_unread = 0
self.add_contact_handler_id = False
self.browse_agents_handler_id = False
self.service_disco_handler_id = False
self.join_gc_handler_id = False
self.new_message_menuitem_handler_id = False
self.regroup = 0