Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim-plugins.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Fomin <fominde@gmail.com>2010-10-28 13:19:37 +0400
committerDenis Fomin <fominde@gmail.com>2010-10-28 13:19:37 +0400
commit80c42099f2a2fad88dadd20351e1d58e018566d7 (patch)
tree00d785aecb5e8fdfc268a81e06dbe9f50724341c /roster_tweaks
parentf42004817c6b516f93e11ce59b7a86e0ecfccc96 (diff)
roster_tweaks. Added ability to quickly change the status message to all connected accounts.
Diffstat (limited to 'roster_tweaks')
-rw-r--r--roster_tweaks/config_dialog.ui14
-rw-r--r--roster_tweaks/manifest.ini4
-rw-r--r--roster_tweaks/roster_tweaks.py38
3 files changed, 49 insertions, 7 deletions
diff --git a/roster_tweaks/config_dialog.ui b/roster_tweaks/config_dialog.ui
index 33f840d..1d4673f 100644
--- a/roster_tweaks/config_dialog.ui
+++ b/roster_tweaks/config_dialog.ui
@@ -39,6 +39,20 @@
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkCheckButton" id="quick_status">
+ <property name="label" translatable="yes">Show quick-change status field</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_quick_status_toggled"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
</child>
</object>
diff --git a/roster_tweaks/manifest.ini b/roster_tweaks/manifest.ini
index 99fbe9c..2a20e34 100644
--- a/roster_tweaks/manifest.ini
+++ b/roster_tweaks/manifest.ini
@@ -1,10 +1,10 @@
[info]
name: Roster Tweaks
short_name: roster_tweaks
-version: 0.2
+version: 0.3
description: Allows user to tweak roster window appearance (eg. make it compact).
Based on ticket #3340:
http://trac.gajim.org/ticket/3340.
+ Added ability to quickly change the status message to all connected accounts.
authors = Denis Fomin <fominde@gmail.com>
homepage = http://trac-plugins.gajim.org/wiki
-
diff --git a/roster_tweaks/roster_tweaks.py b/roster_tweaks/roster_tweaks.py
index 460519b..4331853 100644
--- a/roster_tweaks/roster_tweaks.py
+++ b/roster_tweaks/roster_tweaks.py
@@ -16,13 +16,23 @@ class RosterTweaksPlugin(GajimPlugin):
self.config_default_values = {'hide_status_combo': (False,''),
'use_ctr_m': (False,''),
- 'menu_visible': (True,'')}
+ 'menu_visible': (True,''),
+ 'quick_status': (False, '')}
@log_calls('RosterTweaksPlugin')
def activate(self):
gajim.interface.roster.status_combobox.set_property('visible',
not self.config['hide_status_combo'])
gajim.interface.roster.status_combobox.set_no_show_all(True)
+ self.enable_ctrl_m()
+
+ vbox = gajim.interface.roster.xml.get_object('roster_vbox2')
+ self.status_widget = gtk.Entry(max=0)
+ self.status_widget.set_property('visible', self.config['quick_status'])
+ self.status_widget.connect('key-press-event', self.status_changed)
+ vbox.pack_start(self.status_widget, False)
+
+ def enable_ctrl_m(self):
if self.config['use_ctr_m']:
window = gajim.interface.roster.window
self.accel_group = gtk.accel_groups_from_object(window)[0]
@@ -48,6 +58,18 @@ class RosterTweaksPlugin(GajimPlugin):
self.config['menu_visible'] = not self.config['menu_visible']
return True
+ def status_changed(self, widget, event):
+ if event.keyval == gtk.keysyms.Return or \
+ event.keyval == gtk.keysyms.KP_Enter:
+ accounts = gajim.connections.keys()
+ message = widget.get_text()
+ for account in accounts:
+ current_show = gajim.SHOW_LIST[
+ gajim.connections[account].connected]
+ gajim.interface.roster.send_status(account, current_show,
+ message)
+ widget.set_text('')
+
class RosterTweaksPluginConfigDialog(GajimPluginConfigDialog):
def init(self):
self.GTK_BUILDER_FILE_PATH = self.plugin.local_file_path(
@@ -67,17 +89,23 @@ class RosterTweaksPluginConfigDialog(GajimPluginConfigDialog):
def on_run(self):
self.hide_combo.set_active(self.plugin.config['hide_status_combo'])
self.use_ctr_m.set_active(self.plugin.config['use_ctr_m'])
+ status_widget = self.xml.get_object('quick_status')
+ status_widget.set_active(self.plugin.config['quick_status'])
def on_hide_combo_toggled(self, button):
self.plugin.config['hide_status_combo'] = button.get_active()
gajim.interface.roster.status_combobox.set_property('visible',
not self.plugin.config['hide_status_combo'])
+ def on_quick_status_toggled(self, button):
+ self.plugin.config['quick_status'] = button.get_active()
+ self.plugin.status_widget.set_property('visible', button.get_active())
+
def on_use_ctr_m_toggled(self, button):
- use_ = button.get_active()
- self.plugin.config['use_ctr_m'] = use_
- if use_:
- self.plugin.activate()
+ is_ctr_m_enabled = button.get_active()
+ self.plugin.config['use_ctr_m'] = is_ctr_m_enabled
+ if is_ctr_m_enabled:
+ self.plugin.enable_ctrl_m()
else:
self.plugin.accel_group.disconnect_key(gtk.keysyms.m,
gtk.gdk.CONTROL_MASK)