do gc and tabbedchat menus via glade; and various other fixes
This commit is contained in:
parent
414abe3687
commit
4fef38de93
5 changed files with 175 additions and 162 deletions
116
src/chat.py
116
src/chat.py
|
@ -68,7 +68,9 @@ class Chat:
|
|||
self.sent_history_pos = {}
|
||||
self.typing_new = {}
|
||||
self.orig_msg = {}
|
||||
self.compact_view = gajim.config.get('compact_view')
|
||||
|
||||
# we check that on opening new windows
|
||||
self.always_compact_view = gajim.config.get('always_compact_view')
|
||||
|
||||
def update_tags(self):
|
||||
for jid in self.tagIn:
|
||||
|
@ -187,41 +189,63 @@ class Chat:
|
|||
self.show_title()
|
||||
if self.plugin.systray_enabled:
|
||||
self.plugin.systray.remove_jid(jid, self.account)
|
||||
|
||||
def populate_popup_menu(self, menu):
|
||||
'''To be overwritten in child class'''
|
||||
pass
|
||||
|
||||
def on_compact_view_menuitem_activate(self, widget):
|
||||
isactive = widget.get_active()
|
||||
self.set_compact_view(isactive)
|
||||
|
||||
def remove_possible_switch_to_menuitems(self, menu):
|
||||
''' remove duplicate 'Switch to' if they exist and return clean menu'''
|
||||
childs = menu.get_children()
|
||||
childs_no = len(childs)
|
||||
if self.widget_name == 'groupchat_window':
|
||||
no_more_than = 6
|
||||
elif self.widget_name == 'tabbed_chat_window':
|
||||
no_more_than = 4
|
||||
|
||||
if childs_no > no_more_than:
|
||||
# we have switch to which we should remove
|
||||
how_many = childs_no - no_more_than # how many to remove
|
||||
for child_cnt in range(how_many):
|
||||
real_pos = child_cnt + no_more_than
|
||||
menu.remove(childs[real_pos])
|
||||
|
||||
return menu
|
||||
|
||||
def on_chat_window_button_press_event(self, widget, event):
|
||||
'''If right-clicked, show popup'''
|
||||
if event.button == 3: # right click
|
||||
# menu creation
|
||||
menu = gtk.Menu()
|
||||
|
||||
if self.widget_name == 'groupchat_window':
|
||||
menu = self.gc_popup_menu
|
||||
childs = menu.get_children()
|
||||
childs[0].show() # history_menuitem
|
||||
# compact_view_menuitem
|
||||
childs[5].set_active(self.compact_view_current_state)
|
||||
elif self.widget_name == 'tabbed_chat_window':
|
||||
menu = self.tabbed_chat_popup_menu
|
||||
childs = menu.get_children()
|
||||
# compact_view_menuitem
|
||||
childs[3].set_active(self.compact_view_current_state)
|
||||
menu = self.remove_possible_switch_to_menuitems(menu)
|
||||
|
||||
# common menuitems (tab switches)
|
||||
if len(self.xmls) > 1: # if there is more than one tab
|
||||
menu.append(gtk.MenuItem()) # seperator
|
||||
for jid in self.xmls:
|
||||
if jid != self.get_active_jid():
|
||||
# FIXME: do me via glade
|
||||
item = gtk.MenuItem(_('Switch to %s') % self.names[jid])
|
||||
#FIXME: do me via glade
|
||||
icon = gtk.image_new_from_stock(gtk.STOCK_JUMP_TO,
|
||||
gtk.ICON_SIZE_MENU)
|
||||
label = gtk.Label(_('Switch to %s') % self.names[jid])
|
||||
hbox = gtk.HBox(False, 3)
|
||||
hbox.pack_start(icon, False, False)
|
||||
hbox.pack_start(label, True, True)
|
||||
item = gtk.MenuItem()
|
||||
item.add(hbox)
|
||||
item.connect('activate', lambda obj,jid:self.set_active_tab(
|
||||
jid), jid)
|
||||
menu.append(item)
|
||||
|
||||
menu.append(gtk.MenuItem())
|
||||
|
||||
# menuitems specific to type of chat
|
||||
self.populate_popup_menu(menu)
|
||||
|
||||
item = gtk.CheckMenuItem(_('_Compact View'))
|
||||
#FIXME: The accelerator is not used, do me via glade
|
||||
ag = gtk.AccelGroup()
|
||||
item.add_accelerator('activate', ag, ord('c'), gtk.gdk.MOD1_MASK, gtk.ACCEL_VISIBLE)
|
||||
item.set_active(self.get_compact_view())
|
||||
item.connect('activate', lambda obj:self.set_compact_view(
|
||||
not self.get_compact_view()))
|
||||
menu.append(item)
|
||||
|
||||
# show the menu
|
||||
menu.popup(None, None, None, event.button, event.time)
|
||||
menu.show_all()
|
||||
|
@ -283,6 +307,7 @@ class Chat:
|
|||
self.show_title()
|
||||
|
||||
def new_tab(self, jid):
|
||||
self.set_compact_view(self.always_compact_view)
|
||||
self.nb_unread[jid] = 0
|
||||
self.last_message_time[jid] = 0
|
||||
self.last_time_printout[jid] = float(0.0)
|
||||
|
@ -395,7 +420,8 @@ class Chat:
|
|||
elif event.keyval == gtk.keysyms.Page_Up: # CTRL + PAGE UP
|
||||
self.notebook.emit('key_press_event', event)
|
||||
elif event.keyval == gtk.keysyms.l or \
|
||||
event.keyval == gtk.keysyms.L: # CTRL + L
|
||||
event.keyval == gtk.keysyms.L: # CTRL + L
|
||||
message_textview = self.xmls[jid].get_widget('message_textview')
|
||||
conversation_textview.get_buffer().set_text('')
|
||||
elif event.keyval == gtk.keysyms.v: # CTRL + V
|
||||
jid = self.get_active_jid()
|
||||
|
@ -417,8 +443,8 @@ class Chat:
|
|||
(event.state & gtk.gdk.MOD1_MASK): # alt + 1,2,3..
|
||||
self.notebook.set_current_page(st.index(event.string))
|
||||
elif event.keyval == gtk.keysyms.c and \
|
||||
(event.state & gtk.gdk.MOD1_MASK): # alt + C
|
||||
self.set_compact_view(not self.get_compact_view())
|
||||
(event.state & gtk.gdk.MOD1_MASK): # alt + C toggles compact view
|
||||
self.set_compact_view(not self.compact_view_current_state)
|
||||
elif event.keyval == gtk.keysyms.Page_Down:
|
||||
if event.state & gtk.gdk.SHIFT_MASK: # SHIFT + PAGE DOWN
|
||||
conversation_textview = self.xmls[jid].\
|
||||
|
@ -542,7 +568,8 @@ class Chat:
|
|||
menu.prepend(item)
|
||||
submenu = gtk.Menu()
|
||||
item.set_submenu(submenu)
|
||||
|
||||
|
||||
#FIXME: via expert allow non using $LANG
|
||||
item = gtk.MenuItem(_('Read _Wikipedia article'))
|
||||
link = 'http://%s.wikipedia.org/wiki/%s'\
|
||||
%(gajim.LANG, self.selected_phrase)
|
||||
|
@ -556,7 +583,6 @@ class Chat:
|
|||
submenu.append(item)
|
||||
|
||||
item = gtk.MenuItem(_('Web _search for it'))
|
||||
#FIXME: via expert allow other engine
|
||||
gajim.config.get('search_engine')
|
||||
link = gajim.config.get('search_engine') + self.selected_phrase +\
|
||||
'&sourceid=gajim'
|
||||
|
@ -867,7 +893,6 @@ class Chat:
|
|||
self.sent_history[jid][i] = self.sent_history[jid][i+1]
|
||||
self.sent_history[jid][max_size - 1] = message
|
||||
else:
|
||||
message += ' ' # append message with a space
|
||||
self.sent_history[jid].append(message)
|
||||
|
||||
self.sent_history_pos[jid] = size + 1
|
||||
|
@ -905,10 +930,8 @@ class Chat:
|
|||
theme = gajim.config.get('roster_theme')
|
||||
bgcolor = gajim.config.get_per('themes', theme, 'bannerbgcolor')
|
||||
textcolor = gajim.config.get_per('themes', theme, 'bannertextcolor')
|
||||
# the backgrounds are colored by using eventboxes and
|
||||
# setting the bg color of the eventboxes. There is a
|
||||
# separate event box for each component (name label and
|
||||
# status icon). The avatar has one too in the glade file.
|
||||
# the backgrounds are colored by using an eventbox by
|
||||
# setting the bg color of the eventbox and the fg of the name_label
|
||||
self.xmls[jid].get_widget('banner_eventbox').modify_bg(
|
||||
gtk.STATE_NORMAL, gtk.gdk.color_parse(bgcolor))
|
||||
banner_name_label = self.xmls[jid].get_widget('banner_name_label')
|
||||
|
@ -921,20 +944,21 @@ class Chat:
|
|||
for jid in self.xmls:
|
||||
self.paint_banner(jid)
|
||||
|
||||
def get_compact_view(self):
|
||||
"""Is compact view turned on?"""
|
||||
return self.compact_view
|
||||
|
||||
def set_compact_view(self,state):
|
||||
'''Toggle compact view
|
||||
To be overwritten in child class if we want to toggle more
|
||||
widgets'''
|
||||
self.compact_view = state
|
||||
def set_compact_view(self, state):
|
||||
'''Toggle compact view'''
|
||||
self.compact_view_current_state = state
|
||||
|
||||
for jid in self.xmls:
|
||||
widgets = [self.xmls[jid].get_widget('banner_eventbox'),
|
||||
self.xmls[jid].get_widget('actions_hbox'),
|
||||
]
|
||||
if self.widget_name == 'tabbed_chat_window':
|
||||
widgets = [
|
||||
self.xmls[jid].get_widget('banner_eventbox'),
|
||||
self.xmls[jid].get_widget('actions_hbox'),
|
||||
]
|
||||
elif self.widget_name == 'groupchat_window':
|
||||
widgets = [self.xmls[jid].get_widget('banner_eventbox'),
|
||||
self.xmls[jid].get_widget('gc_actions_hbox'),
|
||||
self.xmls[jid].get_widget('list_scrolledwindow'),
|
||||
]
|
||||
|
||||
for widget in widgets:
|
||||
if state:
|
||||
|
|
|
@ -106,7 +106,7 @@ class Config:
|
|||
'show_roster_on_startup': [opt_bool, True],
|
||||
'key_up_lines': [opt_int, 25], # how many lines to store for key up
|
||||
'version': [ None, '0.8' ],
|
||||
'compact_view': [opt_bool, False], # initial compact view state
|
||||
'always_compact_view': [opt_bool, False], # initial compact view state
|
||||
'search_engine': [opt_str, 'http://www.google.com/search?&q='],
|
||||
}
|
||||
|
||||
|
|
|
@ -518,7 +518,8 @@ class GroupchatWindow(chat.Chat):
|
|||
return
|
||||
|
||||
elif message in ('/compact', '/compact '):
|
||||
self.set_compact_view(not self.get_compact_view())
|
||||
# toggle compact
|
||||
self.set_compact_view(not self.compact_view_current_state)
|
||||
self.on_clear(None, message_textview)
|
||||
return
|
||||
|
||||
|
@ -766,70 +767,6 @@ class GroupchatWindow(chat.Chat):
|
|||
menu.popup(None, None, None, event.button, event.time)
|
||||
menu.show_all()
|
||||
menu.reposition()
|
||||
|
||||
def populate_popup_menu(self, menu):
|
||||
"""Add menuitems do popup menu"""
|
||||
|
||||
# FIXME: add icons / use ItemFactory
|
||||
item = gtk.MenuItem()
|
||||
icon = gtk.Image()
|
||||
icon.set_from_stock(gtk.STOCK_JUSTIFY_FILL, gtk.ICON_SIZE_BUTTON)
|
||||
label = gtk.Label(_('_History'))
|
||||
label.set_use_underline(True)
|
||||
hbox = gtk.HBox(False, 3)
|
||||
hbox.pack_start(icon, False, False)
|
||||
hbox.pack_start(label, False, False)
|
||||
item.add(hbox)
|
||||
item.connect('activate', self.on_history_button_clicked)
|
||||
menu.append(item)
|
||||
|
||||
item = gtk.MenuItem()
|
||||
icon = gtk.Image()
|
||||
icon.set_from_stock(gtk.STOCK_PROPERTIES, gtk.ICON_SIZE_BUTTON)
|
||||
label = gtk.Label(_('Configure _Room'))
|
||||
label.set_use_underline(True)
|
||||
hbox = gtk.HBox(False, 3)
|
||||
hbox.pack_start(icon, False, False)
|
||||
hbox.pack_start(label, False, False)
|
||||
item.add(hbox)
|
||||
item.connect('activate', self.on_configure_room_menuitem_activate)
|
||||
menu.append(item)
|
||||
|
||||
item = gtk.MenuItem()
|
||||
icon = gtk.Image()
|
||||
icon.set_from_stock(gtk.STOCK_EDIT, gtk.ICON_SIZE_BUTTON)
|
||||
label = gtk.Label(_('Change _Subject'))
|
||||
label.set_use_underline(True)
|
||||
hbox = gtk.HBox(False, 3)
|
||||
hbox.pack_start(icon, False, False)
|
||||
hbox.pack_start(label, False, False)
|
||||
item.add(hbox)
|
||||
item.connect('activate', self.on_change_subject_menuitem_activate)
|
||||
menu.append(item)
|
||||
|
||||
item = gtk.MenuItem()
|
||||
icon = gtk.Image()
|
||||
icon.set_from_stock(gtk.STOCK_REDO, gtk.ICON_SIZE_BUTTON)
|
||||
label = gtk.Label(_('Change _Nickname'))
|
||||
label.set_use_underline(True)
|
||||
hbox = gtk.HBox(False, 3)
|
||||
hbox.pack_start(icon, False, False)
|
||||
hbox.pack_start(label, False, False)
|
||||
item.add(hbox)
|
||||
item.connect('activate', self.on_change_nick_menuitem_activate)
|
||||
menu.append(item)
|
||||
|
||||
item = gtk.MenuItem()
|
||||
icon = gtk.Image()
|
||||
icon.set_from_stock(gtk.STOCK_ADD, gtk.ICON_SIZE_BUTTON)
|
||||
label = gtk.Label(_('_Bookmark This Room'))
|
||||
label.set_use_underline(True)
|
||||
hbox = gtk.HBox(False, 3)
|
||||
hbox.pack_start(icon, False, False)
|
||||
hbox.pack_start(label, False, False)
|
||||
item.add(hbox)
|
||||
item.connect('activate', self.on_bookmark_room_menuitem_activate)
|
||||
menu.append(item)
|
||||
|
||||
def remove_tab(self, room_jid):
|
||||
if time.time() - self.last_message_time[room_jid] < 2:
|
||||
|
@ -855,7 +792,6 @@ class GroupchatWindow(chat.Chat):
|
|||
self.names[room_jid] = room_jid.split('@')[0]
|
||||
self.xmls[room_jid] = gtk.glade.XML(GTKGUI_GLADE, 'gc_vbox', APP)
|
||||
self.childs[room_jid] = self.xmls[room_jid].get_widget('gc_vbox')
|
||||
self.set_compact_view(self.get_compact_view())
|
||||
chat.Chat.new_tab(self, room_jid)
|
||||
self.nicks[room_jid] = nick
|
||||
self.contacts[room_jid] = {}
|
||||
|
@ -883,9 +819,11 @@ class GroupchatWindow(chat.Chat):
|
|||
self.name_labels[room_jid].set_ellipsize(pango.ELLIPSIZE_END)
|
||||
|
||||
# connect the menuitems to their respective functions
|
||||
xm = gtk.glade.XML(GTKGUI_GLADE, 'gc_actions_menu', APP)
|
||||
xm = gtk.glade.XML(GTKGUI_GLADE, 'gc_popup_menu', APP)
|
||||
xm.signal_autoconnect(self)
|
||||
self.gc_actions_menu = xm.get_widget('gc_actions_menu')
|
||||
self.gc_popup_menu = xm.get_widget('gc_popup_menu')
|
||||
# don't show history_menuitem on show_all()
|
||||
self.gc_popup_menu.get_children()[0].set_no_show_all(True)
|
||||
|
||||
#status_image, nickname, shown_nick
|
||||
store = gtk.TreeStore(gtk.Image, str, str)
|
||||
|
@ -939,8 +877,11 @@ class GroupchatWindow(chat.Chat):
|
|||
|
||||
def on_actions_button_clicked(self, button):
|
||||
"""popup action menu"""
|
||||
self.gc_actions_menu.popup(None, None, None, 1, 0)
|
||||
self.gc_actions_menu.show_all()
|
||||
menu = self.gc_popup_menu
|
||||
menu.get_children()[0].hide() # hide history_menuitem
|
||||
menu = self.remove_possible_switch_to_menuitems(menu)
|
||||
menu.popup(None, None, None, event.button, event.time)
|
||||
menu.show_all()
|
||||
|
||||
def on_list_treeview_button_press_event(self, widget, event):
|
||||
"""popup user's group's or agent menu"""
|
||||
|
@ -1036,22 +977,3 @@ class GroupchatWindow(chat.Chat):
|
|||
model = widget.get_model()
|
||||
image = self.plugin.roster.jabber_state_images['closed']
|
||||
model.set_value(iter, 0, image)
|
||||
|
||||
def set_compact_view(self,state):
|
||||
'''Toggle compact view'''
|
||||
|
||||
self.compact_view = state
|
||||
|
||||
for jid in self.xmls:
|
||||
widgets = [self.xmls[jid].get_widget('banner_eventbox'),
|
||||
self.xmls[jid].get_widget('gc_actions_hbox'),
|
||||
self.xmls[jid].get_widget('list_scrolledwindow'),
|
||||
]
|
||||
|
||||
for widget in widgets:
|
||||
if state:
|
||||
widget.set_no_show_all(True)
|
||||
widget.hide()
|
||||
else:
|
||||
widget.set_no_show_all(False)
|
||||
widget.show()
|
||||
|
|
|
@ -14944,19 +14944,38 @@ the Jabber network.</property>
|
|||
</child>
|
||||
</widget>
|
||||
|
||||
<widget class="GtkMenu" id="gc_actions_menu">
|
||||
<widget class="GtkMenu" id="gc_popup_menu">
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="history_menuitem">
|
||||
<property name="label" translatable="yes">_History</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_history_menuitem_activate" last_modification_time="Mon, 27 Jun 2005 16:58:29 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image732">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-justify-fill</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="configure_room_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Configure _Room</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_configure_room_menuitem_activate" last_modification_time="Mon, 13 Jun 2005 11:04:55 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image694">
|
||||
<widget class="GtkImage" id="image733">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-properties</property>
|
||||
<property name="stock">gtk-preferences</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
|
@ -14969,13 +14988,12 @@ the Jabber network.</property>
|
|||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="change_subject_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Change _Subject</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_change_subject_menuitem_activate" last_modification_time="Mon, 13 Jun 2005 11:05:10 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image695">
|
||||
<widget class="GtkImage" id="image734">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-edit</property>
|
||||
<property name="icon_size">1</property>
|
||||
|
@ -14990,13 +15008,12 @@ the Jabber network.</property>
|
|||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="change_nick_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Change _Nickname</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_change_nick_menuitem_activate" last_modification_time="Sat, 18 Jun 2005 20:23:46 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image696">
|
||||
<widget class="GtkImage" id="image735">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-redo</property>
|
||||
<property name="icon_size">1</property>
|
||||
|
@ -15011,13 +15028,12 @@ the Jabber network.</property>
|
|||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="bookmark_room_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Bookmark This Room</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_bookmark_room_menuitem_activate" last_modification_time="Mon, 13 Jun 2005 12:43:29 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image697">
|
||||
<widget class="GtkImage" id="image736">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-add</property>
|
||||
<property name="icon_size">1</property>
|
||||
|
@ -15029,6 +15045,68 @@ the Jabber network.</property>
|
|||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckMenuItem" id="compact_view_menuitem">
|
||||
<property name="label" translatable="yes">_Compact View</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="active">False</property>
|
||||
<signal name="activate" handler="on_compact_view_menuitem_activate" last_modification_time="Thu, 30 Jun 2005 13:07:23 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
<widget class="GtkMenu" id="tabbed_chat_popup_menu">
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="history_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_History</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_history_button_clicked" last_modification_time="Thu, 30 Jun 2005 10:23:04 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image731">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-justify-fill</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="information_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label">gtk-dialog-info</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="activate" handler="on_contact_button_clicked" last_modification_time="Thu, 30 Jun 2005 10:23:04 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckMenuItem" id="toggle_gpg_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Toggle _GPG Encryption</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="active">False</property>
|
||||
<signal name="activate" handler="on_toggle_gpg_menuitem_activate" last_modification_time="Thu, 30 Jun 2005 10:43:11 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckMenuItem" id="compact_view_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Compact View</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="active">False</property>
|
||||
<signal name="activate" handler="on_compact_view_menuitem_activate" last_modification_time="Thu, 30 Jun 2005 13:07:17 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
</glade-interface>
|
||||
|
|
|
@ -237,10 +237,13 @@ class TabbedChatWindow(chat.Chat):
|
|||
self.names[user.jid] = user.name
|
||||
self.xmls[user.jid] = gtk.glade.XML(GTKGUI_GLADE, 'chats_vbox', APP)
|
||||
self.childs[user.jid] = self.xmls[user.jid].get_widget('chats_vbox')
|
||||
self.set_compact_view(self.get_compact_view())
|
||||
self.users[user.jid] = user
|
||||
self.encrypted[user.jid] = False
|
||||
|
||||
xm = gtk.glade.XML(GTKGUI_GLADE, 'tabbed_chat_popup_menu', APP)
|
||||
xm.signal_autoconnect(self)
|
||||
self.tabbed_chat_popup_menu = xm.get_widget('tabbed_chat_popup_menu')
|
||||
|
||||
chat.Chat.new_tab(self, user.jid)
|
||||
self.redraw_tab(user.jid)
|
||||
self.draw_widgets(user)
|
||||
|
@ -327,7 +330,7 @@ class TabbedChatWindow(chat.Chat):
|
|||
self.on_clear(None, message_textview) # clear message textview too
|
||||
return True
|
||||
elif message == '/compact':
|
||||
self.set_compact_view(not self.get_compact_view())
|
||||
self.set_compact_view(not self.compact_view_current_state)
|
||||
self.on_clear(None, message_textview)
|
||||
return True
|
||||
keyID = ''
|
||||
|
@ -453,17 +456,3 @@ class TabbedChatWindow(chat.Chat):
|
|||
|
||||
if len(lines):
|
||||
self.print_empty_line(jid)
|
||||
|
||||
def populate_popup_menu(self, menu):
|
||||
"""Add menuitems do popup menu"""
|
||||
|
||||
# FIXME: add icons / use ItemFactory
|
||||
item = gtk.MenuItem(_('_History'))
|
||||
item.connect('activate', self.on_history_button_clicked)
|
||||
menu.append(item)
|
||||
|
||||
item = gtk.MenuItem(_('_Information'))
|
||||
item.connect('activate', self.on_contact_button_clicked)
|
||||
menu.append(item)
|
||||
|
||||
# FIXME: GPG stuff
|
||||
|
|
Loading…
Add table
Reference in a new issue