we can now invite a contact to a room in roster context menu

This commit is contained in:
Yann Leboulanger 2006-07-24 21:44:59 +00:00
parent 87e1a89173
commit af371f02ef
2 changed files with 53 additions and 13 deletions

View File

@ -12,7 +12,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1447">
<widget class="GtkImage" id="image1485">
<property name="visible">True</property>
<property name="stock">gtk-jump-to</property>
<property name="icon_size">1</property>
@ -32,7 +32,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1448">
<widget class="GtkImage" id="image1486">
<property name="visible">True</property>
<property name="stock">gtk-new</property>
<property name="icon_size">1</property>
@ -45,13 +45,33 @@
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="invite_menuitem">
<property name="visible">True</property>
<property name="label" translatable="yes">_Invite to</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1487">
<property name="visible">True</property>
<property name="stock">gtk-go-back</property>
<property name="icon_size">1</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="rename_menuitem">
<property name="label" translatable="yes">_Rename</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1449">
<widget class="GtkImage" id="image1488">
<property name="visible">True</property>
<property name="stock">gtk-refresh</property>
<property name="icon_size">1</property>
@ -84,7 +104,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1450">
<widget class="GtkImage" id="image1489">
<property name="visible">True</property>
<property name="stock">gtk-file</property>
<property name="icon_size">1</property>
@ -104,7 +124,7 @@
<signal name="activate" handler="on_assign_openpgp_key_menuitem_activate" last_modification_time="Thu, 30 Jun 2005 22:57:59 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1451">
<widget class="GtkImage" id="image1490">
<property name="visible">True</property>
<property name="stock">gtk-dialog-authentication</property>
<property name="icon_size">1</property>
@ -124,7 +144,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1452">
<widget class="GtkImage" id="image1491">
<property name="visible">True</property>
<property name="stock">gtk-info</property>
<property name="icon_size">1</property>
@ -149,7 +169,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1453">
<widget class="GtkImage" id="image1492">
<property name="visible">True</property>
<property name="stock">gtk-dialog-question</property>
<property name="icon_size">1</property>
@ -170,7 +190,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1454">
<widget class="GtkImage" id="image1493">
<property name="visible">True</property>
<property name="stock">gtk-go-up</property>
<property name="icon_size">1</property>
@ -190,7 +210,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1455">
<widget class="GtkImage" id="image1494">
<property name="visible">True</property>
<property name="stock">gtk-go-down</property>
<property name="icon_size">1</property>
@ -210,7 +230,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1456">
<widget class="GtkImage" id="image1495">
<property name="visible">True</property>
<property name="stock">gtk-stop</property>
<property name="icon_size">1</property>
@ -233,7 +253,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1457">
<widget class="GtkImage" id="image1496">
<property name="visible">True</property>
<property name="stock">gtk-add</property>
<property name="icon_size">1</property>
@ -252,7 +272,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1458">
<widget class="GtkImage" id="image1497">
<property name="visible">True</property>
<property name="stock">gtk-remove</property>
<property name="icon_size">1</property>
@ -284,7 +304,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1459">
<widget class="GtkImage" id="image1498">
<property name="visible">True</property>
<property name="stock">gtk-justify-fill</property>
<property name="icon_size">1</property>

View File

@ -1324,6 +1324,7 @@ class RosterWindow:
start_chat_menuitem = xml.get_widget('start_chat_menuitem')
send_single_message_menuitem = xml.get_widget(
'send_single_message_menuitem')
invite_menuitem = xml.get_widget('invite_menuitem')
rename_menuitem = xml.get_widget('rename_menuitem')
edit_groups_menuitem = xml.get_widget('edit_groups_menuitem')
# separator has with send file, assign_openpgp_key_menuitem, etc..
@ -1391,6 +1392,25 @@ class RosterWindow:
send_single_message_menuitem.connect('activate',
self.on_send_single_message_menuitem_activate, account, contact)
rooms = [] # a list of (room_jid, account) tuple
for gc_control in gajim.interface.msg_win_mgr.get_controls(
message_control.TYPE_GC):
acct = gc_control.account
room_jid = gc_control.room_jid
if gajim.gc_connected[acct].has_key(room_jid) and \
gajim.gc_connected[acct][room_jid]:
rooms.append((room_jid, acct))
if len(rooms):
submenu = gtk.Menu()
invite_menuitem.set_submenu(submenu)
for (room_jid, acct) in rooms:
menuitem = gtk.MenuItem(room_jid.split('@')[0])
menuitem.connect('activate', self.on_invite_to_room,
[(contact, account)], room_jid, acct)
submenu.append(menuitem)
else:
invite_menuitem.set_sensitive(False)
rename_menuitem.connect('activate', self.on_rename, iter, path)
remove_from_roster_menuitem.connect('activate', self.on_req_usub,
[(contact, account)])