1 # -*- coding: utf-8 -*-
3 ## This file is part of Gajim.
5 ## Gajim is free software; you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published
7 ## by the Free Software Foundation; version 3 only.
9 ## Gajim is distributed in the hope that it will be useful,
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ## GNU General Public License for more details.
14 ## You should have received a copy of the GNU General Public License
15 ## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
19 Roster buttons plug-in.
21 :author: Mateusz Biliński <mateusz@bilinski.it>
22 :since: 14th June 2008
23 :copyright: Copyright (2008) Mateusz Biliński <mateusz@bilinski.it>
30 from common
import i18n
31 from common
import gajim
33 from plugins
import GajimPlugin
34 from plugins
.helpers
import log
, log_calls
36 class RosterButtonsPlugin(GajimPlugin
):
38 @log_calls('RosterButtonsPlugin')
40 self
.GTK_BUILDER_FILE_PATH
= self
.local_file_path('roster_buttons.ui')
41 self
.roster_vbox
= gajim
.interface
.roster
.xml
.get_object('roster_vbox2')
42 self
.show_offline_contacts_menuitem
= gajim
.interface
.roster
.xml
.get_object('show_offline_contacts_menuitem')
44 self
.config_dialog
= None
46 @log_calls('RosterButtonsPlugin')
48 self
.xml
= gtk
.Builder()
49 self
.xml
.set_translation_domain(i18n
.APP
)
50 self
.xml
.add_objects_from_file(self
.GTK_BUILDER_FILE_PATH
,
51 ['roster_buttons_buttonbox'])
52 self
.buttonbox
= self
.xml
.get_object('roster_buttons_buttonbox')
54 self
.roster_vbox
.pack_start(self
.buttonbox
, expand
=False)
55 self
.roster_vbox
.reorder_child(self
.buttonbox
, 0)
56 self
.xml
.connect_signals(self
)
58 @log_calls('RosterButtonsPlugin')
60 self
.roster_vbox
.remove(self
.buttonbox
)
65 @log_calls('RosterButtonsPlugin')
66 def on_roster_button_1_clicked(self
, button
):
67 #gajim.interface.roster.on_show_offline_contacts_menuitem_activate(None)
68 self
.show_offline_contacts_menuitem
.set_active(not self
.show_offline_contacts_menuitem
.get_active())
70 @log_calls('RosterButtonsPlugin')
71 def on_roster_button_2_clicked(self
, button
):
74 @log_calls('RosterButtonsPlugin')
75 def on_roster_button_3_clicked(self
, button
):
78 @log_calls('RosterButtonsPlugin')
79 def on_roster_button_4_clicked(self
, button
):