Commit 676d80ce authored by Anton Leontiev's avatar Anton Leontiev
Browse files

export-to-folder: Use file-set signal to change target directory

Currently changing target directory from GUI doesn't always work. If
user chooses directory from drop-down list of GtkFileChooserButton,
'current-folder-changed' signal isn't emitted and configuration isn't
updated.

Instead of using 'current-folder-changed' signal from GtkFileChooser
interface, use 'file-set' signal from GtkFileChooserButton.

Furthermore get_currect_folder() doesn't correspond to the selected
folder, but to the folder containing selected folder. Therefore it is
changed to get_filename(). For more info see manual for
gtk_file_chooser_get_current_folder().
parent f11f00ef
......@@ -125,7 +125,7 @@ class ExportConfigurable(GObject.Object, PeasGtk.Configurable):
def do_create_configure_widget(self):
# Create preference dialog
signals = {'current_folder_changed_cb': self.current_folder_changed_cb}
signals = {'file_set_cb': self.file_set_cb}
builder = Gtk.Builder()
builder.set_translation_domain('eog-plugins')
builder.add_from_file(os.path.join(self.plugin_info.get_data_dir(),
......@@ -137,9 +137,9 @@ class ExportConfigurable(GObject.Object, PeasGtk.Configurable):
target_dir = self.settings.get_string('target-folder')
if target_dir == "":
target_dir = EXPORT_DIR
self.export_dir_button.set_current_folder(target_dir)
self.export_dir_button.set_filename(target_dir)
return self.preferences_dialog
def current_folder_changed_cb(self, button):
self.settings.set_string('target-folder', button.get_current_folder())
def file_set_cb(self, button):
self.settings.set_string('target-folder', button.get_filename())
......@@ -29,7 +29,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="action">select-folder</property>
<signal name="current-folder-changed" handler="current_folder_changed_cb" swapped="no"/>
<signal name="file-set" handler="file_set_cb" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment