code for advanced_notifications_window: config is now saved in config file

This commit is contained in:
Yann Leboulanger 2006-07-17 10:07:26 +00:00
parent 95bdf480b4
commit 0614f534bb
3 changed files with 1338 additions and 1148 deletions

View File

@ -17,6 +17,7 @@
<property name="skip_pager_hint">False</property> <property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property> <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="focus_on_map">True</property>
<child> <child>
<widget class="GtkVBox" id="vbox95"> <widget class="GtkVBox" id="vbox95">
@ -44,6 +45,10 @@
<property name="yalign">0.5</property> <property name="yalign">0.5</property>
<property name="xpad">0</property> <property name="xpad">0</property>
<property name="ypad">0</property> <property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
@ -63,46 +68,19 @@
</packing> </packing>
</child> </child>
<child>
<widget class="GtkLabel" id="label391">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Conditions&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkExpander" id="list_expander">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="expanded">True</property>
<property name="spacing">0</property>
<child> <child>
<widget class="GtkVBox" id="vbox100"> <widget class="GtkVBox" id="vbox100">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">5</property>
<child> <child>
<widget class="GtkScrolledWindow" id="scrolledwindow23"> <widget class="GtkScrolledWindow" id="scrolledwindow23">
<property name="height_request">90</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property> <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
<property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_IN</property> <property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property> <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
@ -114,6 +92,10 @@
<property name="rules_hint">False</property> <property name="rules_hint">False</property>
<property name="reorderable">False</property> <property name="reorderable">False</property>
<property name="enable_search">True</property> <property name="enable_search">True</property>
<property name="fixed_height_mode">False</property>
<property name="hover_selection">False</property>
<property name="hover_expand">False</property>
<signal name="cursor_changed" handler="on_conditions_treeview_cursor_changed" last_modification_time="Sun, 09 Jul 2006 20:23:26 GMT"/>
</widget> </widget>
</child> </child>
</widget> </widget>
@ -127,13 +109,13 @@
<child> <child>
<widget class="GtkAlignment" id="alignment99"> <widget class="GtkAlignment" id="alignment99">
<property name="visible">True</property> <property name="visible">True</property>
<property name="xalign">0.5</property> <property name="xalign">1</property>
<property name="yalign">0.5</property> <property name="yalign">0.5</property>
<property name="xscale">1</property> <property name="xscale">1</property>
<property name="yscale">1</property> <property name="yscale">1</property>
<property name="top_padding">0</property> <property name="top_padding">0</property>
<property name="bottom_padding">0</property> <property name="bottom_padding">0</property>
<property name="left_padding">328</property> <property name="left_padding">212</property>
<property name="right_padding">0</property> <property name="right_padding">0</property>
<child> <child>
@ -146,145 +128,57 @@
<widget class="GtkHButtonBox" id="hbuttonbox2"> <widget class="GtkHButtonBox" id="hbuttonbox2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_DEFAULT_STYLE</property> <property name="layout_style">GTK_BUTTONBOX_DEFAULT_STYLE</property>
<property name="spacing">0</property> <property name="spacing">10</property>
<child> <child>
<widget class="GtkButton" id="button12"> <widget class="GtkButton" id="new_button">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_default">True</property> <property name="can_default">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="label">gtk-new</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property> <property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property> <property name="focus_on_click">True</property>
<signal name="clicked" handler="on_new_button_clicked" last_modification_time="Sat, 08 Jul 2006 20:15:42 GMT"/>
<child>
<widget class="GtkAlignment" id="alignment100">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox3046">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child>
<widget class="GtkImage" id="image1376">
<property name="visible">True</property>
<property name="stock">gtk-go-up</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label405">
<property name="visible">True</property>
<property name="label" translatable="yes">Up</property>
<property name="use_underline">True</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.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget> </widget>
</child> </child>
<child> <child>
<widget class="GtkButton" id="button13"> <widget class="GtkButton" id="up_button">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_default">True</property> <property name="can_default">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="label">gtk-go-up</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property> <property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property> <property name="focus_on_click">True</property>
<signal name="clicked" handler="on_up_button_clicked" last_modification_time="Sun, 09 Jul 2006 22:33:12 GMT"/>
<child>
<widget class="GtkAlignment" id="alignment101">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox3047">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child>
<widget class="GtkImage" id="image1377">
<property name="visible">True</property>
<property name="stock">gtk-go-down</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget> </widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label406"> <widget class="GtkButton" id="down_button">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Down</property> <property name="can_default">True</property>
<property name="use_underline">True</property> <property name="can_focus">True</property>
<property name="use_markup">False</property> <property name="label">gtk-go-down</property>
<property name="justify">GTK_JUSTIFY_LEFT</property> <property name="use_stock">True</property>
<property name="wrap">False</property> <property name="relief">GTK_RELIEF_NORMAL</property>
<property name="selectable">False</property> <property name="focus_on_click">True</property>
<property name="xalign">0.5</property> <signal name="clicked" handler="on_down_button_clicked" last_modification_time="Wed, 12 Jul 2006 01:18:01 GMT"/>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget> </widget>
</child> </child>
<child>
<widget class="GtkButton" id="delete_button">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-delete</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_delete_button_clicked" last_modification_time="Wed, 12 Jul 2006 01:58:19 GMT"/>
</widget> </widget>
</child> </child>
</widget> </widget>
@ -304,27 +198,6 @@
</packing> </packing>
</child> </child>
</widget> </widget>
</child>
<child>
<widget class="GtkLabel" id="label404">
<property name="visible">True</property>
<property name="label" translatable="yes">List of special notifications settings</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.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">True</property> <property name="expand">True</property>
@ -332,17 +205,48 @@
</packing> </packing>
</child> </child>
<child>
<widget class="GtkVBox" id="config_vbox">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">5</property>
<child>
<widget class="GtkLabel" id="label391">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Conditions&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child> <child>
<widget class="GtkVBox" id="vbox101"> <widget class="GtkVBox" id="vbox101">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">5</property>
<child> <child>
<widget class="GtkHBox" id="hbox3042"> <widget class="GtkHBox" id="hbox3042">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">5</property>
<child> <child>
<widget class="GtkLabel" id="label401"> <widget class="GtkLabel" id="label401">
@ -357,6 +261,10 @@
<property name="yalign">0.5</property> <property name="yalign">0.5</property>
<property name="xpad">0</property> <property name="xpad">0</property>
<property name="ypad">0</property> <property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
@ -366,7 +274,7 @@
</child> </child>
<child> <child>
<widget class="GtkComboBox" id="combobox5"> <widget class="GtkComboBox" id="event_combobox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="items" translatable="yes">Receive a Message <property name="items" translatable="yes">Receive a Message
Contact Connected Contact Connected
@ -377,6 +285,9 @@ Group Chat Message Received
File Transfert Resquest File Transfert Resquest
File Transfert Started File Transfert Started
File Transfert Finished</property> File Transfert Finished</property>
<property name="add_tearoffs">False</property>
<property name="focus_on_click">True</property>
<signal name="changed" handler="on_event_combobox_changed" last_modification_time="Sun, 09 Jul 2006 01:54:11 GMT"/>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
@ -396,7 +307,7 @@ File Transfert Finished</property>
<widget class="GtkHBox" id="hbox3048"> <widget class="GtkHBox" id="hbox3048">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">5</property>
<child> <child>
<widget class="GtkLabel" id="label400"> <widget class="GtkLabel" id="label400">
@ -411,6 +322,10 @@ File Transfert Finished</property>
<property name="yalign">0.5</property> <property name="yalign">0.5</property>
<property name="xpad">0</property> <property name="xpad">0</property>
<property name="ypad">0</property> <property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
@ -425,17 +340,19 @@ File Transfert Finished</property>
<property name="items" translatable="yes">contact(s) <property name="items" translatable="yes">contact(s)
group(s) group(s)
everybody</property> everybody</property>
<property name="add_tearoffs">False</property>
<property name="focus_on_click">True</property>
<signal name="changed" handler="on_recipient_type_combobox_changed" last_modification_time="Mon, 08 May 2006 20:54:22 GMT"/> <signal name="changed" handler="on_recipient_type_combobox_changed" last_modification_time="Mon, 08 May 2006 20:54:22 GMT"/>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">True</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkEntry" id="recipient_list"> <widget class="GtkEntry" id="recipient_list_entry">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="editable">True</property> <property name="editable">True</property>
@ -445,6 +362,7 @@ everybody</property>
<property name="has_frame">True</property> <property name="has_frame">True</property>
<property name="invisible_char">*</property> <property name="invisible_char">*</property>
<property name="activates_default">False</property> <property name="activates_default">False</property>
<signal name="changed" handler="on_recipient_list_entry_changed" last_modification_time="Sun, 09 Jul 2006 02:21:36 GMT"/>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
@ -479,6 +397,10 @@ everybody</property>
<property name="yalign">0.5</property> <property name="yalign">0.5</property>
<property name="xpad">0</property> <property name="xpad">0</property>
<property name="ypad">0</property> <property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
@ -491,7 +413,7 @@ everybody</property>
<widget class="GtkHBox" id="status_hbox"> <widget class="GtkHBox" id="status_hbox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">3</property>
<child> <child>
<widget class="GtkRadioButton" id="all_status_rb"> <widget class="GtkRadioButton" id="all_status_rb">
@ -544,6 +466,7 @@ everybody</property>
<property name="active">False</property> <property name="active">False</property>
<property name="inconsistent">False</property> <property name="inconsistent">False</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<signal name="toggled" handler="on_status_cb_toggled" last_modification_time="Sun, 09 Jul 2006 02:40:38 GMT"/>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
@ -563,6 +486,7 @@ everybody</property>
<property name="active">False</property> <property name="active">False</property>
<property name="inconsistent">False</property> <property name="inconsistent">False</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<signal name="toggled" handler="on_status_cb_toggled" last_modification_time="Sun, 09 Jul 2006 02:43:25 GMT"/>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
@ -572,7 +496,7 @@ everybody</property>
</child> </child>
<child> <child>
<widget class="GtkCheckButton" id="not_available_cb"> <widget class="GtkCheckButton" id="xa_cb">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="label" translatable="yes">Not Available</property> <property name="label" translatable="yes">Not Available</property>
@ -582,6 +506,7 @@ everybody</property>
<property name="active">False</property> <property name="active">False</property>
<property name="inconsistent">False</property> <property name="inconsistent">False</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<signal name="toggled" handler="on_status_cb_toggled" last_modification_time="Sun, 09 Jul 2006 02:43:14 GMT"/>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
@ -591,7 +516,7 @@ everybody</property>
</child> </child>
<child> <child>
<widget class="GtkCheckButton" id="busy_cb"> <widget class="GtkCheckButton" id="dnd_cb">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="label" translatable="yes">Busy </property> <property name="label" translatable="yes">Busy </property>
@ -601,6 +526,7 @@ everybody</property>
<property name="active">False</property> <property name="active">False</property>
<property name="inconsistent">False</property> <property name="inconsistent">False</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<signal name="toggled" handler="on_status_cb_toggled" last_modification_time="Sun, 09 Jul 2006 02:43:45 GMT"/>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
@ -620,6 +546,7 @@ everybody</property>
<property name="active">False</property> <property name="active">False</property>
<property name="inconsistent">False</property> <property name="inconsistent">False</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<signal name="toggled" handler="on_status_cb_toggled" last_modification_time="Sun, 09 Jul 2006 02:44:48 GMT"/>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
@ -651,7 +578,7 @@ everybody</property>
<child> <child>
<widget class="GtkLabel" id="label408"> <widget class="GtkLabel" id="label408">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">And I </property> <property name="label" translatable="yes">and I </property>
<property name="use_underline">False</property> <property name="use_underline">False</property>
<property name="use_markup">True</property> <property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property> <property name="justify">GTK_JUSTIFY_LEFT</property>
@ -661,6 +588,10 @@ everybody</property>
<property name="yalign">0.5</property> <property name="yalign">0.5</property>
<property name="xpad">0</property> <property name="xpad">0</property>
<property name="ypad">0</property> <property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
@ -722,6 +653,10 @@ everybody</property>
<property name="yalign">0.5</property> <property name="yalign">0.5</property>
<property name="xpad">0</property> <property name="xpad">0</property>
<property name="ypad">0</property> <property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
@ -757,6 +692,10 @@ everybody</property>
<property name="yalign">0.5</property> <property name="yalign">0.5</property>
<property name="xpad">0</property> <property name="xpad">0</property>
<property name="ypad">0</property> <property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
@ -776,7 +715,7 @@ everybody</property>
<widget class="GtkHBox" id="hbox3027"> <widget class="GtkHBox" id="hbox3027">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">6</property>
<child> <child>
<widget class="GtkCheckButton" id="use_popup_cb"> <widget class="GtkCheckButton" id="use_popup_cb">
@ -873,13 +812,14 @@ everybody</property>
</child> </child>
<child> <child>
<widget class="GtkHBox" id="hbox3030"> <widget class="GtkHBox" id="sound_file_hbox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="sensitive">False</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
<widget class="GtkEntry" id="entry4"> <widget class="GtkEntry" id="sound_entry">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="editable">True</property> <property name="editable">True</property>
@ -889,7 +829,7 @@ everybody</property>
<property name="has_frame">True</property> <property name="has_frame">True</property>
<property name="invisible_char">*</property> <property name="invisible_char">*</property>
<property name="activates_default">False</property> <property name="activates_default">False</property>
<signal name="changed" handler="on_sounds_entry_changed" last_modification_time="Mon, 06 Jun 2005 19:59:41 GMT"/> <signal name="changed" handler="on_sound_entry_changed" last_modification_time="Sun, 09 Jul 2006 17:40:01 GMT"/>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
@ -916,7 +856,7 @@ everybody</property>
</child> </child>
<child> <child>
<widget class="GtkButton" id="button5"> <widget class="GtkButton" id="play_button">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property> <property name="relief">GTK_RELIEF_NORMAL</property>
@ -993,6 +933,10 @@ everybody</property>
<property name="yalign">0.5</property> <property name="yalign">0.5</property>
<property name="xpad">0</property> <property name="xpad">0</property>
<property name="ypad">0</property> <property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget> </widget>
<packing> <packing>
<property name="type">label_item</property> <property name="type">label_item</property>
@ -1006,8 +950,8 @@ everybody</property>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">False</property> <property name="expand">True</property>
<property name="fill">False</property> <property name="fill">True</property>
</packing> </packing>
</child> </child>
@ -1015,7 +959,7 @@ everybody</property>
<widget class="GtkHBox" id="hbox3032"> <widget class="GtkHBox" id="hbox3032">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">6</property>
<child> <child>
<widget class="GtkCheckButton" id="use_auto_open_cb"> <widget class="GtkCheckButton" id="use_auto_open_cb">
@ -1068,23 +1012,23 @@ everybody</property>
<widget class="GtkExpander" id="expander1"> <widget class="GtkExpander" id="expander1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="expanded">False</property> <property name="expanded">True</property>
<property name="spacing">0</property> <property name="spacing">0</property>
<child> <child>
<widget class="GtkVBox" id="vbox99"> <widget class="GtkVBox" id="vbox99">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">5</property>
<child> <child>
<widget class="GtkHBox" id="hbox3033"> <widget class="GtkHBox" id="hbox3033">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">True</property> <property name="homogeneous">False</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
<widget class="GtkCheckButton" id="checkbutton15"> <widget class="GtkCheckButton" id="run_command_cb">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="label" translatable="yes">Launch a command</property> <property name="label" translatable="yes">Launch a command</property>
@ -1094,24 +1038,19 @@ everybody</property>
<property name="active">False</property> <property name="active">False</property>
<property name="inconsistent">False</property> <property name="inconsistent">False</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<signal name="toggled" handler="on_play_sounds_checkbutton_toggled" last_modification_time="Wed, 06 Apr 2005 19:05:21 GMT"/> <signal name="toggled" handler="on_run_command_cb_toggled" last_modification_time="Tue, 11 Jul 2006 22:58:49 GMT"/>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">True</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkHBox" id="hbox3034"> <widget class="GtkEntry" id="command_entry">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<widget class="GtkEntry" id="entry5">
<property name="visible">True</property> <property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="editable">True</property> <property name="editable">True</property>
<property name="visibility">True</property> <property name="visibility">True</property>
@ -1120,14 +1059,7 @@ everybody</property>
<property name="has_frame">True</property> <property name="has_frame">True</property>
<property name="invisible_char">*</property> <property name="invisible_char">*</property>
<property name="activates_default">False</property> <property name="activates_default">False</property>
<signal name="changed" handler="on_sounds_entry_changed" last_modification_time="Mon, 06 Jun 2005 19:59:41 GMT"/> <signal name="changed" handler="on_command_entry_changed" last_modification_time="Sun, 09 Jul 2006 20:17:58 GMT"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
@ -1147,7 +1079,7 @@ everybody</property>
<widget class="GtkHBox" id="hbox3035"> <widget class="GtkHBox" id="hbox3035">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">6</property>
<child> <child>
<widget class="GtkCheckButton" id="use_systray_cb"> <widget class="GtkCheckButton" id="use_systray_cb">
@ -1200,7 +1132,7 @@ everybody</property>
<widget class="GtkHBox" id="hbox3052"> <widget class="GtkHBox" id="hbox3052">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">6</property>
<child> <child>
<widget class="GtkCheckButton" id="use_roster_cb"> <widget class="GtkCheckButton" id="use_roster_cb">
@ -1250,7 +1182,7 @@ everybody</property>
</child> </child>
<child> <child>
<widget class="GtkCheckButton" id="checkbutton14"> <widget class="GtkCheckButton" id="urgency_hint_cb">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="label" translatable="yes">_Activate Windows manager UrgencyHint to make chat taskbar to flash</property> <property name="label" translatable="yes">_Activate Windows manager UrgencyHint to make chat taskbar to flash</property>
@ -1260,6 +1192,7 @@ everybody</property>
<property name="active">False</property> <property name="active">False</property>
<property name="inconsistent">False</property> <property name="inconsistent">False</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<signal name="toggled" handler="on_urgency_hint_checkbutton_toggled" last_modification_time="Sun, 09 Jul 2006 20:19:58 GMT"/>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
@ -1283,6 +1216,10 @@ everybody</property>
<property name="yalign">0.5</property> <property name="yalign">0.5</property>
<property name="xpad">0</property> <property name="xpad">0</property>
<property name="ypad">0</property> <property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget> </widget>
<packing> <packing>
<property name="type">label_item</property> <property name="type">label_item</property>
@ -1291,82 +1228,15 @@ everybody</property>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">False</property> <property name="expand">True</property>
<property name="fill">False</property> <property name="fill">True</property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkButton" id="button14">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<child>
<widget class="GtkAlignment" id="alignment102">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox3051">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child>
<widget class="GtkImage" id="image1378">
<property name="visible">True</property>
<property name="stock">gtk-add</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label407">
<property name="visible">True</property>
<property name="label" translatable="yes">Add</property>
<property name="use_underline">True</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.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">False</property> <property name="expand">True</property>
<property name="fill">False</property> <property name="fill">True</property>
</packing> </packing>
</child> </child>
@ -1382,12 +1252,6 @@ everybody</property>
<property name="left_padding">413</property> <property name="left_padding">413</property>
<property name="right_padding">0</property> <property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox3036">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child> <child>
<widget class="GtkButton" id="close_button"> <widget class="GtkButton" id="close_button">
<property name="visible">True</property> <property name="visible">True</property>
@ -1399,14 +1263,6 @@ everybody</property>
<property name="focus_on_click">True</property> <property name="focus_on_click">True</property>
<signal name="clicked" handler="on_close_window" last_modification_time="Mon, 08 May 2006 20:57:06 GMT"/> <signal name="clicked" handler="on_close_window" last_modification_time="Mon, 08 May 2006 20:57:06 GMT"/>
</widget> </widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
</widget>
</child> </child>
</widget> </widget>
<packing> <packing>

View File

@ -291,6 +291,22 @@ class Config:
'contacts': ({ 'contacts': ({
'gpg_enabled': [ opt_bool, True ], 'gpg_enabled': [ opt_bool, True ],
}, {}), }, {}),
'notifications': ({
'event': [opt_str, ''],
'recipient_type': [opt_str, 'all'],
'recipients': [opt_str, ''],
'status': [opt_str, 'all', _('all or space separated status')],
'tab_opened': [opt_str, 'both', _("'yes', 'no', or 'both'")],
'sound': [opt_str, '', _("'yes', 'no' or ''")],
'sound_file': [opt_str, ''],
'popup': [opt_str, '', _("'yes', 'no' or ''")],
'auto_open': [opt_str, '', _("'yes', 'no' or ''")],
'run_command': [opt_bool, False],
'command': [opt_str, ''],
'systray': [opt_str, '', _("'yes', 'no' or ''")],
'roster': [opt_str, '', _("'yes', 'no' or ''")],
'urgency_hint': [opt_bool, False],
}, {}),
} }
statusmsg_default = { statusmsg_default = {

View File

@ -2190,16 +2190,26 @@ class AddSpecialNotificationDialog:
print listen_sound_model[active_iter][0] print listen_sound_model[active_iter][0]
class AdvancedNotificationsWindow: class AdvancedNotificationsWindow:
events_list = ['message_received', 'contact_connected',
'contact_disconnected', 'contact_change_status', 'gc_msg_highlight',
'gc_msg', 'ft_request', 'ft_started', 'ft_finished']
recipient_types_list = ['contact', 'group', 'all']
config_options = ['event', 'recipient_type', 'recipients', 'status',
'tab_opened', 'sound', 'sound_file', 'popup', 'auto_open',
'run_command', 'command', 'systray', 'roster', 'urgency_hint']
def __init__(self): def __init__(self):
self.xml = gtkgui_helpers.get_glade('advanced_notifications_window.glade') self.xml = gtkgui_helpers.get_glade('advanced_notifications_window.glade')
self.window = self.xml.get_widget('advanced_notifications_window') self.window = self.xml.get_widget('advanced_notifications_window')
self.xml.signal_autoconnect(self) for w in ('conditions_treeview', 'config_vbox', 'event_combobox',
self.conditions_treeview = self.xml.get_widget('conditions_treeview') 'recipient_type_combobox', 'recipient_list_entry', 'delete_button',
self.recipient_type_combobox = self.xml.get_widget('recipient_type_combobox') 'status_hbox', 'use_sound_cb', 'disable_sound_cb', 'use_popup_cb',
self.recipient_list = self.xml.get_widget('recipient_list') 'disable_popup_cb', 'use_auto_open_cb', 'disable_auto_open_cb',
self.list_expander = self.xml.get_widget('list_expander') 'use_systray_cb', 'disable_systray_cb', 'use_roster_cb',
'disable_roster_cb', 'tab_opened_cb', 'not_tab_opened_cb',
'sound_entry', 'sound_file_hbox', 'up_button', 'down_button',
'run_command_cb', 'command_entry', 'urgency_hint_cb'):
self.__dict__[w] = self.xml.get_widget(w)
self.status_hbox = self.xml.get_widget('status_hbox')
# Contains status checkboxes # Contains status checkboxes
childs = self.status_hbox.get_children() childs = self.status_hbox.get_children()
@ -2207,130 +2217,438 @@ class AdvancedNotificationsWindow:
self.special_status_rb = childs[1] self.special_status_rb = childs[1]
self.online_cb = childs[2] self.online_cb = childs[2]
self.away_cb = childs[3] self.away_cb = childs[3]
self.not_available_cb = childs[4] self.xa_cb = childs[4]
self.busy_cb = childs[5] self.dnd_cb = childs[5]
self.invisible_cb = childs[6] self.invisible_cb = childs[6]
self.use_sound_cb = self.xml.get_widget('use_sound_cb') model = gtk.ListStore(int, str)
self.disable_sound_cb = self.xml.get_widget('disable_sound_cb') model.set_sort_column_id(0, gtk.SORT_ASCENDING)
self.use_popup_cb = self.xml.get_widget('use_popup_cb')
self.disable_popup_cb = self.xml.get_widget('disable_popup_cb')
self.use_auto_open_cb = self.xml.get_widget('use_auto_open_cb')
self.disable_auto_open_cb = self.xml.get_widget('disable_auto_open_cb')
self.use_systray_cb = self.xml.get_widget('use_systray_cb')
self.disable_systray_cb = self.xml.get_widget('disable_systray_cb')
self.use_roster_cb = self.xml.get_widget('use_roster_cb')
self.disable_roster_cb = self.xml.get_widget('disable_roster_cb')
self.tab_opened_cb = self.xml.get_widget('tab_opened_cb')
self.not_tab_opened_cb = self.xml.get_widget('not_tab_opened_cb')
model = gtk.ListStore(str)
model.clear() model.clear()
self.conditions_treeview.set_model(model) self.conditions_treeview.set_model(model)
## means number
col = gtk.TreeViewColumn(_('#'))
self.conditions_treeview.append_column(col)
renderer = gtk.CellRendererText()
col.pack_start(renderer, expand = False)
col.set_attributes(renderer, text = 0)
col = gtk.TreeViewColumn(_('Condition')) col = gtk.TreeViewColumn(_('Condition'))
self.conditions_treeview.append_column(col) self.conditions_treeview.append_column(col)
renderer = gtk.CellRendererText() renderer = gtk.CellRendererText()
col.pack_start(renderer, expand = True) col.pack_start(renderer, expand = True)
col.set_attributes(renderer, text = 0) col.set_attributes(renderer, text = 1)
if (0==0): # No rule set yet self.xml.signal_autoconnect(self)
self.list_expander.set_expanded(False)
if (0==1): # We have existing rule(s) # Fill conditions_treeview
#temporary example num = 0
model.append(("When Contact Connected for contact Asterix when I am Available",)) while gajim.config.get_per('notifications', str(num)):
iter = model.append((num, ''))
path = model.get_path(iter)
self.conditions_treeview.set_cursor(path)
self.active_num = num
self.initiate_rule_state()
self.set_treeview_string()
num += 1
# TODO : add a "New rule" line # No rule selected at init time
self.conditions_treeview.get_selection().unselect_all()
#TODO
# self.conditions_treeview.set_cursor(None)
self.active_num = -1
self.config_vbox.set_sensitive(False)
self.delete_button.set_sensitive(False)
self.down_button.set_sensitive(False)
self.up_button.set_sensitive(False)
self.recipient_list_entry.set_no_show_all(True)
for st in ['online', 'away', 'xa', 'dnd', 'invisible']:
self.__dict__[st + '_cb'].set_no_show_all(True)
self.window.show_all() self.window.show_all()
# No rule selected at init time def initiate_rule_state(self):
self.initiate_new_rule_state() '''Set values for all widgets'''
if self.active_num < 0:
def initiate_new_rule_state(self): return
'''Set default value to all widgets''' # event
# Deal with status line value = gajim.config.get_per('notifications', str(self.active_num),
'event')
if value:
self.event_combobox.set_active(self.events_list.index(value))
else:
#TODO: unselect all
pass
# recipient_type
value = gajim.config.get_per('notifications', str(self.active_num),
'recipient_type')
if value:
self.recipient_type_combobox.set_active(
self.recipient_types_list.index(value))
else:
#TODO: unselect all
pass
# recipient
value = gajim.config.get_per('notifications', str(self.active_num),
'recipients')
if not value:
value = ''
self.recipient_list_entry.set_text(value)
# status
value = gajim.config.get_per('notifications', str(self.active_num),
'status')
if value == 'all':
self.all_status_rb.set_active(True) self.all_status_rb.set_active(True)
else:
self.special_status_rb.set_active(True)
values = value.split()
for v in ['online', 'away', 'xa', 'dnd', 'invisible']:
if v in values:
self.__dict__[v + '_cb'].set_active(True)
else:
self.__dict__[v + '_cb'].set_active(False)
self.on_status_radiobutton_toggled(self.all_status_rb) self.on_status_radiobutton_toggled(self.all_status_rb)
# tab_opened
self.recipient_type_combobox.set_active(0) # 'Contact(s)' value = gajim.config.get_per('notifications', str(self.active_num),
self.not_tab_opened_cb.set_active(True) 'tab_opened')
self.tab_opened_cb.set_active(True) self.tab_opened_cb.set_active(True)
self.not_tab_opened_cb.set_active(True)
if value == 'no':
self.tab_opened_cb.set_active(False)
elif value == 'yes':
self.not_tab_opened_cb.set_active(False)
# sound_file
value = gajim.config.get_per('notifications', str(self.active_num),
'sound_file')
self.sound_entry.set_text(value)
# sound, popup, auto_open, systray, roster
for option in ['sound', 'popup', 'auto_open', 'systray', 'roster']:
value = gajim.config.get_per('notifications', str(self.active_num),
option)
if value == 'yes':
self.__dict__['use_' + option + '_cb'].set_active(True)
else:
self.__dict__['use_' + option + '_cb'].set_active(False)
if value == 'no':
self.__dict__['disable_' + option + '_cb'].set_active(True)
else:
self.__dict__['disable_' + option + '_cb'].set_active(False)
# run_command
value = gajim.config.get_per('notifications', str(self.active_num),
'run_command')
self.run_command_cb.set_active(value)
# command
value = gajim.config.get_per('notifications', str(self.active_num),
'command')
self.command_entry.set_text(value)
# urgency_hint
value = gajim.config.get_per('notifications', str(self.active_num),
'urgency_hint')
self.urgency_hint_cb.set_active(value)
def set_treeview_string(self):
(model, iter) = self.conditions_treeview.get_selection().get_selected()
if not iter:
return
event = self.event_combobox.get_active_text()
recipient_type = self.recipient_type_combobox.get_active_text()
recipient = ''
if recipient_type != 'everybody':
recipient = self.recipient_list_entry.get_text()
if self.all_status_rb.get_active():
status = ''
else:
status = _('when I am ')
for st in ['online', 'away', 'xa', 'dnd', 'invisible']:
if self.__dict__[st + '_cb'].get_active():
status += helpers.get_uf_show(st) + ' '
model[iter][1] = "When %s for %s %s %s" % (event, recipient_type,
recipient, status)
def on_conditions_treeview_cursor_changed(self, widget):
(model, iter) = widget.get_selection().get_selected()
if not iter:
self.active_num = -1
return
self.active_num = model[iter][0]
if self.active_num == 0:
self.up_button.set_sensitive(False)
else:
self.up_button.set_sensitive(True)
max = self.conditions_treeview.get_model().iter_n_children(None)
if self.active_num == max - 1:
self.down_button.set_sensitive(False)
else:
self.down_button.set_sensitive(True)
self.initiate_rule_state()
self.config_vbox.set_sensitive(True)
self.delete_button.set_sensitive(True)
def on_new_button_clicked(self, widget):
model = self.conditions_treeview.get_model()
num = self.conditions_treeview.get_model().iter_n_children(None)
gajim.config.add_per('notifications', str(num))
iter = model.append((num, ''))
path = model.get_path(iter)
self.conditions_treeview.set_cursor(path)
self.active_num = num
self.set_treeview_string()
self.config_vbox.set_sensitive(True)
def on_delete_button_clicked(self, widget):
(model, iter) = self.conditions_treeview.get_selection().get_selected()
if not iter:
return
# up all others
iter2 = model.iter_next(iter)
num = self.active_num
while iter2:
num = model[iter2][0]
model[iter2][0] = num - 1
for opt in self.config_options:
val = gajim.config.get_per('notifications', str(num), opt)
gajim.config.set_per('notifications', str(num - 1), opt, val)
iter2 = model.iter_next(iter2)
model.remove(iter)
gajim.config.del_per('notifications', str(num)) # delete latest
self.active_num = -1
self.config_vbox.set_sensitive(False)
self.delete_button.set_sensitive(False)
self.up_button.set_sensitive(False)
self.down_button.set_sensitive(False)
def on_up_button_clicked(self, widget):
(model, iter) = self.conditions_treeview.get_selection().\
get_selected()
if not iter:
return
for opt in self.config_options:
val = gajim.config.get_per('notifications', str(self.active_num), opt)
val2 = gajim.config.get_per('notifications', str(self.active_num - 1),
opt)
gajim.config.set_per('notifications', str(self.active_num), opt, val2)
gajim.config.set_per('notifications', str(self.active_num - 1), opt,
val)
model[iter][0] = self.active_num - 1
# get previous iter
path = model.get_path(iter)
iter = model.get_iter((path[0] - 1,))
model[iter][0] = self.active_num
self.on_conditions_treeview_cursor_changed(self.conditions_treeview)
def on_down_button_clicked(self, widget):
(model, iter) = self.conditions_treeview.get_selection().get_selected()
if not iter:
return
for opt in self.config_options:
val = gajim.config.get_per('notifications', str(self.active_num), opt)
val2 = gajim.config.get_per('notifications', str(self.active_num + 1),
opt)
gajim.config.set_per('notifications', str(self.active_num), opt, val2)
gajim.config.set_per('notifications', str(self.active_num + 1), opt,
val)
model[iter][0] = self.active_num + 1
iter = model.iter_next(iter)
model[iter][0] = self.active_num
self.on_conditions_treeview_cursor_changed(self.conditions_treeview)
def on_event_combobox_changed(self, widget):
if self.active_num < 0:
return
event = self.events_list[self.event_combobox.get_active()]
gajim.config.set_per('notifications', str(self.active_num), 'event',
event)
self.set_treeview_string()
def on_recipient_type_combobox_changed(self, widget):
if self.active_num < 0:
return
recipient_type = self.recipient_types_list[self.recipient_type_combobox.\
get_active()]
gajim.config.set_per('notifications', str(self.active_num),
'recipient_type', recipient_type)
if recipient_type == 'all':
self.recipient_list_entry.hide()
else:
self.recipient_list_entry.show()
self.set_treeview_string()
def on_recipient_list_entry_changed(self, widget):
if self.active_num < 0:
return
recipients = widget.get_text().decode('utf-8')
#TODO: do some check
gajim.config.set_per('notifications', str(self.active_num),
'recipients', recipients)
self.set_treeview_string()
def set_status_config(self):
if self.active_num < 0:
return
status = ''
for st in ['online', 'away', 'xa', 'dnd', 'invisible']:
if self.__dict__[st + '_cb'].get_active():
status += st + ' '
if status:
status = status[:-1]
gajim.config.set_per('notifications', str(self.active_num), 'status',
status)
self.set_treeview_string()
def on_status_radiobutton_toggled(self, widget): def on_status_radiobutton_toggled(self, widget):
if self.active_num < 0:
return
if self.all_status_rb.get_active(): if self.all_status_rb.get_active():
gajim.config.set_per('notifications', str(self.active_num), 'status',
'all')
# 'All status' clicked # 'All status' clicked
self.online_cb.hide() for st in ['online', 'away', 'xa', 'dnd', 'invisible']:
self.away_cb.hide() self.__dict__[st + '_cb'].hide()
self.not_available_cb.hide()
self.busy_cb.hide()
self.invisible_cb.hide()
self.online_cb.set_active(False)
self.away_cb.set_active(False)
self.not_available_cb.set_active(False)
self.busy_cb.set_active(False)
self.invisible_cb.set_active(False)
self.special_status_rb.show() self.special_status_rb.show()
else: else:
self.set_status_config()
# 'special status' clicked # 'special status' clicked
self.online_cb.show() for st in ['online', 'away', 'xa', 'dnd', 'invisible']:
self.away_cb.show() self.__dict__[st + '_cb'].show()
self.not_available_cb.show()
self.busy_cb.show()
self.invisible_cb.show()
self.special_status_rb.hide() self.special_status_rb.hide()
def on_recipient_type_combobox_changed(self, widget): self.set_treeview_string()
if (self.recipient_type_combobox.get_active()==2 ):
self.recipient_list.hide() def on_status_cb_toggled(self, widget):
else: if self.active_num < 0:
self.recipient_list.show() return
self.set_status_config()
# tab_opened OR (not xor) not_tab_opened must be active # tab_opened OR (not xor) not_tab_opened must be active
def on_tab_opened_cb_toggled(self, widget): def on_tab_opened_cb_toggled(self, widget):
if not self.tab_opened_cb.get_active() and not self.not_tab_opened_cb.get_active(): if self.active_num < 0:
return
if self.tab_opened_cb.get_active():
if self.not_tab_opened_cb.get_active():
gajim.config.set_per('notifications', str(self.active_num),
'tab_opened', 'both')
else:
gajim.config.set_per('notifications', str(self.active_num),
'tab_opened', 'yes')
elif not self.not_tab_opened_cb.get_active():
self.not_tab_opened_cb.set_active(True) self.not_tab_opened_cb.set_active(True)
def on_not_tab_opened_cb_toggled(self, widget): gajim.config.set_per('notifications', str(self.active_num),
if not self.tab_opened_cb.get_active() and not self.not_tab_opened_cb.get_active(): 'tab_opened', 'no')
self.tab_opened_cb.set_active(True)
def on_not_tab_opened_cb_toggled(self, widget):
if self.active_num < 0:
return
if self.not_tab_opened_cb.get_active():
if self.tab_opened_cb.get_active():
gajim.config.set_per('notifications', str(self.active_num),
'tab_opened', 'both')
else:
gajim.config.set_per('notifications', str(self.active_num),
'tab_opened', 'no')
elif not self.tab_opened_cb.get_active():
self.tab_opened_cb.set_active(True)
gajim.config.set_per('notifications', str(self.active_num),
'tab_opened', 'yes')
def on_use_it_toggled(self, widget, oposite_widget, option):
if widget.get_active():
if oposite_widget.get_active():
oposite_widget.set_active(False)
gajim.config.set_per('notifications', str(self.active_num), option,
'yes')
elif oposite_widget.get_active():
gajim.config.set_per('notifications', str(self.active_num), option,
'no')
else:
gajim.config.set_per('notifications', str(self.active_num), option, '')
def on_disable_it_toggled(self, widget, oposite_widget, option):
if widget.get_active():
if oposite_widget.get_active():
oposite_widget.set_active(False)
gajim.config.set_per('notifications', str(self.active_num), option,
'no')
elif oposite_widget.get_active():
gajim.config.set_per('notifications', str(self.active_num), option,
'yes')
else:
gajim.config.set_per('notifications', str(self.active_num), option, '')
# 10 next functions : Forbid two incompatible actions to be checked together
def on_use_sound_cb_toggled(self, widget): def on_use_sound_cb_toggled(self, widget):
if self.use_sound_cb.get_active() and self.disable_sound_cb.get_active(): self.on_use_it_toggled(widget, self.disable_sound_cb, 'sound')
self.disable_sound_cb.set_active(False) if widget.get_active():
self.sound_file_hbox.set_sensitive(True)
else:
self.sound_file_hbox.set_sensitive(False)
def on_browse_for_sounds_button_clicked(self, widget, data = None):
if self.active_num < 0:
return
def on_ok(widget, path_to_snd_file):
dialog.destroy()
if not path_to_snd_file:
path_to_snd_file = ''
gajim.config.set_per('notifications', str(self.active_num),
'sound_file', path_to_snd_file)
self.sound_entry.set_text(path_to_snd_file)
path_to_snd_file = self.sound_entry.get_text().decode('utf-8')
path_to_snd_file = os.path.join(os.getcwd(), path_to_snd_file)
dialog = SoundChooserDialog(path_to_snd_file, on_ok)
def on_play_button_clicked(self, widget):
helpers.play_sound_file(self.sound_entry.get_text().decode('utf-8'))
def on_disable_sound_cb_toggled(self, widget): def on_disable_sound_cb_toggled(self, widget):
if self.use_sound_cb.get_active() and self.disable_sound_cb.get_active(): self.on_disable_it_toggled(widget, self.use_sound_cb, 'sound')
self.use_sound_cb.set_active(False)
def on_sound_entry_changed(self, widget):
gajim.config.set_per('notifications', str(self.active_num),
'sound_file', widget.get_text().decode('utf-8'))
def on_use_popup_cb_toggled(self, widget): def on_use_popup_cb_toggled(self, widget):
if self.use_popup_cb.get_active() and self.disable_popup_cb.get_active(): self.on_use_it_toggled(widget, self.disable_popup_cb, 'popup')
self.disable_popup_cb.set_active(False)
def on_disable_popup_cb_toggled(self, widget): def on_disable_popup_cb_toggled(self, widget):
if self.use_popup_cb.get_active() and self.disable_popup_cb.get_active(): self.on_disable_it_toggled(widget, self.use_popup_cb, 'popup')
self.use_popup_cb.set_active(False)
def on_use_auto_open_cb_toggled(self, widget): def on_use_auto_open_cb_toggled(self, widget):
if self.use_auto_open_cb.get_active() and\ self.on_use_it_toggled(widget, self.disable_auto_open_cb, 'auto_open')
self.disable_auto_open_cb.get_active():
self.disable_auto_open_cb.set_active(False)
def on_disable_auto_open_cb_toggled(self, widget): def on_disable_auto_open_cb_toggled(self, widget):
if self.use_auto_open_cb.get_active() and\ self.on_disable_it_toggled(widget, self.use_auto_open_cb, 'auto_open')
self.disable_auto_open_cb.get_active():
self.use_auto_open_cb.set_active(False) def on_run_command_cb_toggled(self, widget):
gajim.config.set_per('notifications', str(self.active_num), 'run_command',
widget.get_active())
if widget.get_active():
self.command_entry.set_sensitive(True)
else:
self.command_entry.set_sensitive(False)
def on_command_entry_changed(self, widget):
gajim.config.set_per('notifications', str(self.active_num), 'command',
widget.get_text().decode('utf-8'))
def on_use_systray_cb_toggled(self, widget): def on_use_systray_cb_toggled(self, widget):
if self.use_systray_cb.get_active() and self.disable_systray_cb.get_active(): self.on_use_it_toggled(widget, self.disable_systray_cb, 'systray')
self.disable_systray_cb.set_active(False)
def on_disable_systray_cb_toggled(self, widget): def on_disable_systray_cb_toggled(self, widget):
if self.use_systray_cb.get_active() and self.disable_systray_cb.get_active(): self.on_disable_it_toggled(widget, self.use_systray_cb, 'systray')
self.use_systray_cb.set_active(False)
def on_use_roster_cb_toggled(self, widget): def on_use_roster_cb_toggled(self, widget):
if self.use_roster_cb.get_active() and self.disable_roster_cb.get_active(): self.on_use_it_toggled(widget, self.disable_roster_cb, 'roster')
self.disable_roster_cb.set_active(False)
def on_disable_roster_cb_toggled(self, widget): def on_disable_roster_cb_toggled(self, widget):
if self.use_roster_cb.get_active() and self.disable_roster_cb.get_active(): self.on_disable_it_toggled(widget, self.use_roster_cb, 'roster')
self.use_roster_cb.set_active(False)
def on_urgency_hint_cb_toggled(self, widget):
gajim.config.set_per('notifications', str(self.active_num),
'uregency_hint', widget.get_active())
def on_close_window(self, widget): def on_close_window(self, widget):
self.window.destroy() self.window.destroy()