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-09-22 10:39:55 +0400
committerDenis Fomin <fominde@gmail.com>2010-09-22 10:39:55 +0400
commit9240230c60650e45805b6f6e0ecd18bc5f22c48a (patch)
tree960581e8c48025857d261ed524e3be490ef22cb1 /set_location
parent9c714206d8c3c6b7fa208f63a7ede3888a82bb87 (diff)
Removed 'apply' button. Changes are applied when closing the Options window.
Diffstat (limited to 'set_location')
-rw-r--r--set_location/config_dialog.ui70
-rw-r--r--set_location/set_location.py12
2 files changed, 7 insertions, 75 deletions
diff --git a/set_location/config_dialog.ui b/set_location/config_dialog.ui
index 4f71c45..06b22e0 100644
--- a/set_location/config_dialog.ui
+++ b/set_location/config_dialog.ui
@@ -7,7 +7,7 @@
<object class="GtkTable" id="config_table">
<property name="visible">True</property>
<property name="border_width">6</property>
- <property name="n_rows">17</property>
+ <property name="n_rows">16</property>
<property name="n_columns">2</property>
<property name="column_spacing">7</property>
<property name="row_spacing">5</property>
@@ -197,7 +197,6 @@
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Altitude in meters above or below sea level</property>
<property name="invisible_char">&#x25CF;</property>
- <signal name="changed" handler="changed"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -210,7 +209,6 @@
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">A named area such as a campus or neighborhood</property>
<property name="invisible_char">&#x25CF;</property>
- <signal name="changed" handler="changed"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -225,7 +223,6 @@
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">A specific building on a street or in an area</property>
<property name="invisible_char">&#x25CF;</property>
- <signal name="changed" handler="changed"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -240,7 +237,6 @@
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">The nation where the user is located</property>
<property name="invisible_char">&#x25CF;</property>
- <signal name="changed" handler="changed"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -255,7 +251,6 @@
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">The ISO 3166 two-letter country code</property>
<property name="invisible_char">&#x25CF;</property>
- <signal name="changed" handler="changed"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -270,7 +265,6 @@
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">A natural-language name for or description of the location</property>
<property name="invisible_char">&#x25CF;</property>
- <signal name="changed" handler="changed"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -285,7 +279,6 @@
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">A particular floor in a building</property>
<property name="invisible_char">&#x25CF;</property>
- <signal name="changed" handler="changed"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -300,7 +293,6 @@
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">A locality within the administrative region, such as a town or city</property>
<property name="invisible_char">&#x25CF;</property>
- <signal name="changed" handler="changed"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -315,7 +307,6 @@
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Latitude in decimal degrees North</property>
<property name="invisible_char">&#x25CF;</property>
- <signal name="changed" handler="changed"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -330,7 +321,6 @@
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Longitude in decimal degrees East</property>
<property name="invisible_char">&#x25CF;</property>
- <signal name="changed" handler="changed"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -345,7 +335,6 @@
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">A code used for postal delivery</property>
<property name="invisible_char">&#x25CF;</property>
- <signal name="changed" handler="changed"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -360,7 +349,6 @@
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">An administrative region of the nation, such as a state or province</property>
<property name="invisible_char">&#x25CF;</property>
- <signal name="changed" handler="changed"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -375,7 +363,6 @@
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">A particular room in a building</property>
<property name="invisible_char">&#x25CF;</property>
- <signal name="changed" handler="changed"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -390,7 +377,6 @@
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">A thoroughfare within the locality, or a crossing of two thoroughfares</property>
<property name="invisible_char">&#x25CF;</property>
- <signal name="changed" handler="changed"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -405,7 +391,6 @@
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">A catch-all element that captures any other information about the location</property>
<property name="invisible_char">&#x25CF;</property>
- <signal name="changed" handler="changed"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -420,7 +405,6 @@
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">A URI or URL pointing to information about the location</property>
<property name="invisible_char">&#x25CF;</property>
- <signal name="changed" handler="changed"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -429,58 +413,6 @@
<property name="bottom_attach">16</property>
</packing>
</child>
- <child>
- <object class="GtkAspectFrame" id="aspectframe2">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
- <property name="xalign">1</property>
- <child>
- <object class="GtkButton" id="apply">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="focus_on_click">False</property>
- <property name="xalign">1</property>
- <signal name="clicked" handler="on_apply_clicked"/>
- <child>
- <object class="GtkHBox" id="hbox1">
- <property name="visible">True</property>
- <child>
- <object class="GtkImage" id="image1">
- <property name="visible">True</property>
- <property name="stock">gtk-apply</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label17">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Apply</property>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">16</property>
- <property name="bottom_attach">17</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
</object>
</child>
</object>
diff --git a/set_location/set_location.py b/set_location/set_location.py
index ca12e49..32fb0df 100644
--- a/set_location/set_location.py
+++ b/set_location/set_location.py
@@ -76,15 +76,15 @@ class SetLocationPluginConfigDialog(GajimPluginConfigDialog):
config_table = self.xml.get_object('config_table')
self.child.pack_start(config_table)
self.xml.connect_signals(self)
+ self.connect('hide', self.on_hide)
def on_run(self):
for name in self.plugin.config_default_values:
widget = self.xml.get_object(name)
widget.set_text(str(self.plugin.config[name]))
- def changed(self, entry):
- name = gtk.Buildable.get_name(entry)
- self.plugin.config[name] = entry.get_text()
-
- def on_apply_clicked(self, widget):
- self.plugin.activate()
+ def on_hide(self, widget):
+ for name in self.plugin.config_default_values:
+ widget = self.xml.get_object(name)
+ self.plugin.config[name] = widget.get_text()
+ self.plugin.activate()