[Xfce4-commits] [apps/catfish] 01/01: Remember window size (bug #14504)
noreply at xfce.org
noreply at xfce.org
Sat Jun 30 13:38:40 CEST 2018
This is an automated email from the git hooks/post-receive script.
b l u e s a b r e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository apps/catfish.
commit ccf170233fb9fb013e8c4f93efd5a6710b5ed6e5
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Sat Jun 30 07:38:34 2018 -0400
Remember window size (bug #14504)
---
catfish/CatfishWindow.py | 4 +++
catfish_lib/CatfishSettings.py | 6 +++-
catfish_lib/Window.py | 9 ++++++
data/ui/CatfishWindow.ui | 14 +++++----
po/catfish.pot | 70 +++++++++++++++++++++---------------------
5 files changed, 61 insertions(+), 42 deletions(-)
diff --git a/catfish/CatfishWindow.py b/catfish/CatfishWindow.py
index a218a84..aa50b33 100644
--- a/catfish/CatfishWindow.py
+++ b/catfish/CatfishWindow.py
@@ -261,6 +261,10 @@ class CatfishWindow(Window):
self.rows = []
self.settings = CatfishSettings.CatfishSettings()
+ paned = builder.get_named_object("window.paned")
+ paned.set_property('height_request', self.settings.get_setting('window-height'))
+ paned.set_property('width_request', self.settings.get_setting('window-width'))
+
self.refresh_search_entry()
filetype_filters = builder.get_object("filetype_options")
diff --git a/catfish_lib/CatfishSettings.py b/catfish_lib/CatfishSettings.py
index 597c929..0528be8 100644
--- a/catfish_lib/CatfishSettings.py
+++ b/catfish_lib/CatfishSettings.py
@@ -23,7 +23,9 @@ default_settings_file = os.path.join(os.getenv('HOME'),
default_settings = {
'use-headerbar': True,
'show-hidden-files': False,
- 'show-sidebar': False
+ 'show-sidebar': False,
+ 'window-width': 760,
+ 'window-height': 520
}
@@ -45,6 +47,8 @@ class CatfishSettings:
def get_setting(self, key):
"""Return current setting for specified key."""
if key in self.settings:
+ if (key in ['window-height', 'window-width']):
+ return int(self.settings[key])
return self.settings[key]
else:
return None
diff --git a/catfish_lib/Window.py b/catfish_lib/Window.py
index f5d17b5..1b7ef02 100644
--- a/catfish_lib/Window.py
+++ b/catfish_lib/Window.py
@@ -33,6 +33,7 @@ __builder__ = {
"window": {
"main": "Catfish",
"sidebar": "catfish_window_sidebar",
+ "paned": "catfish_window_paned"
},
# Toolbar
@@ -335,3 +336,11 @@ class Window(Gtk.Window):
keys = self.get_keys_from_event(event)
self.remove_keys(keys)
return False
+
+ def on_catfish_window_size_allocate(self, widget, allocation):
+ paned =self.builder.get_named_object("window.paned")
+ allocation = paned.get_allocation()
+ self.settings.set_setting('window-height', allocation.height)
+ self.settings.set_setting('window-width', allocation.width)
+ paned.set_property('height_request', -1)
+ paned.set_property('width_request', -1)
\ No newline at end of file
diff --git a/data/ui/CatfishWindow.ui b/data/ui/CatfishWindow.ui
index 79e8417..4b5f940 100644
--- a/data/ui/CatfishWindow.ui
+++ b/data/ui/CatfishWindow.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.12"/>
<requires lib="catfish_window" version="1.0"/>
@@ -467,13 +467,15 @@
<property name="can_focus">False</property>
<property name="title" translatable="yes">Catfish</property>
<property name="window_position">center</property>
- <property name="default_width">760</property>
- <property name="default_height">520</property>
<property name="icon_name">catfish</property>
<signal name="key-press-event" handler="on_catfish_window_key_press_event" swapped="no"/>
<signal name="key-release-event" handler="on_catfish_window_key_press_event" swapped="no"/>
+ <signal name="size-allocate" handler="on_catfish_window_size_allocate" swapped="no"/>
<signal name="window-state-event" handler="on_catfish_window_window_state_event" swapped="no"/>
<child>
+ <placeholder/>
+ </child>
+ <child>
<object class="GtkBox" id="catfish_window_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -510,9 +512,6 @@
<property name="position">0</property>
</packing>
</child>
- <action-widgets>
- <action-widget response="-5">infobar_update</action-widget>
- </action-widgets>
<child internal-child="content_area">
<object class="GtkBox" id="infobar-content_area1">
<property name="can_focus">False</property>
@@ -1318,6 +1317,9 @@
<property name="type_hint">dialog</property>
<property name="transient_for">Catfish</property>
<signal name="delete-event" handler="on_update_index_dialog_close" swapped="no"/>
+ <child>
+ <placeholder/>
+ </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog_vbox3">
<property name="can_focus">False</property>
diff --git a/po/catfish.pot b/po/catfish.pot
index be51d44..6a03759 100644
--- a/po/catfish.pot
+++ b/po/catfish.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2018-06-29 23:08-0400\n"
+"POT-Creation-Date: 2018-06-30 07:36-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
"Language-Team: LANGUAGE <LL at li.org>\n"
@@ -18,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
#: ../catfish.desktop.in.h:1 ../data/ui/CatfishWindow.ui.h:28
-#: ../catfish/CatfishWindow.py:632
+#: ../catfish/CatfishWindow.py:636
msgid "Catfish File Search"
msgstr ""
@@ -121,7 +121,7 @@ msgstr ""
msgid "<b>End Date</b>"
msgstr ""
-#: ../data/ui/CatfishWindow.ui.h:23 ../catfish_lib/Window.py:216
+#: ../data/ui/CatfishWindow.ui.h:23 ../catfish_lib/Window.py:217
msgid "Catfish"
msgstr ""
@@ -137,7 +137,7 @@ msgstr ""
msgid "File Type"
msgstr ""
-#: ../data/ui/CatfishWindow.ui.h:27 ../catfish/CatfishWindow.py:1096
+#: ../data/ui/CatfishWindow.ui.h:27 ../catfish/CatfishWindow.py:1100
msgid "Modified"
msgstr ""
@@ -277,144 +277,144 @@ msgstr ""
msgid "Never"
msgstr ""
-#: ../catfish/CatfishWindow.py:600
+#: ../catfish/CatfishWindow.py:604
msgid "An error occurred while updating the database."
msgstr ""
-#: ../catfish/CatfishWindow.py:602
+#: ../catfish/CatfishWindow.py:606
msgid "Authentication failed."
msgstr ""
-#: ../catfish/CatfishWindow.py:608
+#: ../catfish/CatfishWindow.py:612
msgid "Authentication cancelled."
msgstr ""
-#: ../catfish/CatfishWindow.py:614
+#: ../catfish/CatfishWindow.py:618
msgid "Search database updated successfully."
msgstr ""
#. Set the dialog status to running.
-#: ../catfish/CatfishWindow.py:689
+#: ../catfish/CatfishWindow.py:693
msgid "Updating..."
msgstr ""
-#: ../catfish/CatfishWindow.py:723
+#: ../catfish/CatfishWindow.py:727
msgid "Stop Search"
msgstr ""
-#: ../catfish/CatfishWindow.py:724
+#: ../catfish/CatfishWindow.py:728
msgid ""
"Search is in progress...\n"
"Press the cancel button or the Escape key to stop."
msgstr ""
-#: ../catfish/CatfishWindow.py:733
+#: ../catfish/CatfishWindow.py:737
msgid "Begin Search"
msgstr ""
-#: ../catfish/CatfishWindow.py:922
+#: ../catfish/CatfishWindow.py:926
#, python-format
msgid "\"%s\" could not be opened."
msgstr ""
-#: ../catfish/CatfishWindow.py:968
+#: ../catfish/CatfishWindow.py:972
#, python-format
msgid "\"%s\" could not be saved."
msgstr ""
-#: ../catfish/CatfishWindow.py:985
+#: ../catfish/CatfishWindow.py:989
#, python-format
msgid "\"%s\" could not be deleted."
msgstr ""
-#: ../catfish/CatfishWindow.py:1025
+#: ../catfish/CatfishWindow.py:1029
#, python-format
msgid "Save \"%s\" as…"
msgstr ""
-#: ../catfish/CatfishWindow.py:1060
+#: ../catfish/CatfishWindow.py:1064
#, python-format
msgid ""
"Are you sure that you want to \n"
"permanently delete \"%s\"?"
msgstr ""
-#: ../catfish/CatfishWindow.py:1064
+#: ../catfish/CatfishWindow.py:1068
#, python-format
msgid ""
"Are you sure that you want to \n"
"permanently delete the %i selected files?"
msgstr ""
-#: ../catfish/CatfishWindow.py:1067
+#: ../catfish/CatfishWindow.py:1071
msgid "If you delete a file, it is permanently lost."
msgstr ""
-#: ../catfish/CatfishWindow.py:1090
+#: ../catfish/CatfishWindow.py:1094
msgid "Filename"
msgstr ""
-#: ../catfish/CatfishWindow.py:1092
+#: ../catfish/CatfishWindow.py:1096
msgid "Size"
msgstr ""
-#: ../catfish/CatfishWindow.py:1094
+#: ../catfish/CatfishWindow.py:1098
msgid "Location"
msgstr ""
-#: ../catfish/CatfishWindow.py:1106
+#: ../catfish/CatfishWindow.py:1110
msgid "Preview"
msgstr ""
-#: ../catfish/CatfishWindow.py:1114
+#: ../catfish/CatfishWindow.py:1118
msgid "Details"
msgstr ""
-#: ../catfish/CatfishWindow.py:1333
+#: ../catfish/CatfishWindow.py:1337
msgid "Today"
msgstr ""
-#: ../catfish/CatfishWindow.py:1335
+#: ../catfish/CatfishWindow.py:1339
msgid "Yesterday"
msgstr ""
-#: ../catfish/CatfishWindow.py:1416
+#: ../catfish/CatfishWindow.py:1420
msgid "No files found."
msgstr ""
-#: ../catfish/CatfishWindow.py:1418
+#: ../catfish/CatfishWindow.py:1422
msgid ""
"Try making your search less specific\n"
"or try another directory."
msgstr ""
-#: ../catfish/CatfishWindow.py:1424
+#: ../catfish/CatfishWindow.py:1428
msgid "1 file found."
msgstr ""
-#: ../catfish/CatfishWindow.py:1426
+#: ../catfish/CatfishWindow.py:1430
#, python-format
msgid "%i files found."
msgstr ""
-#: ../catfish/CatfishWindow.py:1432
+#: ../catfish/CatfishWindow.py:1436
msgid "bytes"
msgstr ""
-#: ../catfish/CatfishWindow.py:1540 ../catfish/CatfishWindow.py:1549
+#: ../catfish/CatfishWindow.py:1544 ../catfish/CatfishWindow.py:1553
msgid "Searching…"
msgstr ""
-#: ../catfish/CatfishWindow.py:1542
+#: ../catfish/CatfishWindow.py:1546
msgid "Results will be displayed as soon as they are found."
msgstr ""
-#: ../catfish/CatfishWindow.py:1547
+#: ../catfish/CatfishWindow.py:1551
#, python-format
msgid "Searching for \"%s\""
msgstr ""
-#: ../catfish/CatfishWindow.py:1636
+#: ../catfish/CatfishWindow.py:1640
#, python-format
msgid "Search results for \"%s\""
msgstr ""
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list