Rename a function

This commit is contained in:
Hugo Posnic 2023-03-27 12:11:11 +02:00
parent 5e62681f90
commit f234dbce9e
2 changed files with 6 additions and 6 deletions

View File

@ -112,7 +112,7 @@ class CurtailPrefsWindow(Adw.PreferencesWindow):
self._settings.set_boolean(key, switch.get_active())
# Additional actions
if key == 'new-file':
self.parent.change_save_info_label()
self.parent.set_saving_subtitle()
self.enable_suffix_section()
def on_string_changed(self, entry, key):
@ -120,7 +120,7 @@ class CurtailPrefsWindow(Adw.PreferencesWindow):
if key == 'suffix':
if not self._settings.get_string('suffix'):
self._settings.reset('suffix')
self.parent.change_save_info_label()
self.parent.set_saving_subtitle()
def on_int_changed(self, spin, key):
self._settings.set_int(key, spin.get_value())

View File

@ -69,6 +69,9 @@ class CurtailWindow(Gtk.ApplicationWindow):
window_menu = builder.get_object('window-menu')
self.menu_button.set_menu_model(window_menu)
# Saving subtitle
self.set_saving_subtitle()
# Mainbox - drag&drop
drop_target_main = Gtk.DropTarget.new(type=Gdk.FileList, actions=Gdk.DragAction.COPY)
drop_target_main.connect('drop', self.on_dnd_drop)
@ -78,9 +81,6 @@ class CurtailWindow(Gtk.ApplicationWindow):
self.toggle_lossy.set_active(self._settings.get_boolean('lossy'))
self.toggle_lossy.connect('notify::active', self.on_lossy_changed)
# Info label
self.change_save_info_label()
# Results
self.adjustment = self.scrolled_window.get_vadjustment()
@ -149,7 +149,7 @@ class CurtailWindow(Gtk.ApplicationWindow):
self.sync_ui()
def change_save_info_label(self):
def set_saving_subtitle(self):
label = ''
if self._settings.get_boolean('new-file'):
label = _("Images are saved with '{}' suffix.")\