After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 700034 - gnome-clocks could store the user defined settings for window size
gnome-clocks could store the user defined settings for window size
Status: RESOLVED FIXED
Product: gnome-clocks
Classification: Applications
Component: general
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: Clocks maintainer(s)
Clocks maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-05-09 21:08 UTC by Evgeny Bobkin
Modified: 2013-05-14 19:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
a patch proposal, which enhances the current window size situation. (3.62 KB, patch)
2013-05-09 21:08 UTC, Evgeny Bobkin
none Details | Review
a patch proposal, which enhances the current window size situation. (9.25 KB, patch)
2013-05-13 14:26 UTC, Evgeny Bobkin
none Details | Review
change panel-id gschema type from int to enum (2.19 KB, patch)
2013-05-14 10:25 UTC, Evgeny Bobkin
none Details | Review
change panel-id gschema type from int to enum (2.19 KB, patch)
2013-05-14 10:26 UTC, Evgeny Bobkin
none Details | Review
Store window size and panel state with gsettings (9.32 KB, patch)
2013-05-14 13:11 UTC, Evgeny Bobkin
none Details | Review
move panels to an array and eliminate switch block (3.09 KB, patch)
2013-05-14 13:40 UTC, Evgeny Bobkin
none Details | Review
Store window size and panel state with gsettings (10.54 KB, patch)
2013-05-14 14:05 UTC, Evgeny Bobkin
committed Details | Review

Description Evgeny Bobkin 2013-05-09 21:08:37 UTC
Created attachment 243736 [details] [review]
a patch proposal, which enhances the current window size situation.

It would be greate if gnome-clocks could store the window width and height with gsettings instead of  fixed sizes!! 

The sized size approach claims that:
// Default size is enough for two rows of three clocks

but on my laptop I either have one row of tree clocks, which turns into two rows of two clocks once I add one more)))
Comment 1 Paolo Borelli 2013-05-09 22:33:35 UTC
Review of attachment 243736 [details] [review]:

The patch looks good (though I have not tested it yet)

A couple of very minor nitpicks below.


I guess since you did this, you could also make a follow up patch and store in state.panel the current "page" (world, alarm, timer, stopwatch) :)

::: src/window.vala
@@ -47,3 +44,3 @@
         add_action_entries (action_entries, this);
 
-        set_size_request (DEFAULT_WIDTH, DEFAULT_HEIGHT);
+        settings = new Settings("org.gnome.clocks.state.window");

maybe we should still have a min size request to prevent shrinking the window too much...

@@ -118,2 +125,4 @@
     }
 
+    protected override bool configure_event (Gdk.EventConfigure event) {
+        if (this.get_realized () && !(Gdk.WindowState.MAXIMIZED in get_window ().get_state ())) {

do we need "this."?

@@ -120,0 +127,6 @@
+    protected override bool configure_event (Gdk.EventConfigure event) {
+        if (this.get_realized () && !(Gdk.WindowState.MAXIMIZED in get_window ().get_state ())) {
+            settings.set ("size", "(ii)", event.width, event.height);
... 3 more ...

space before (

@@ -120,0 +127,12 @@
+    protected override bool configure_event (Gdk.EventConfigure event) {
+        if (this.get_realized () && !(Gdk.WindowState.MAXIMIZED in get_window ().get_state ())) {
+            settings.set ("size", "(ii)", event.width, event.height);
... 9 more ...

small tabs vs spaces issue
Comment 2 Evgeny Bobkin 2013-05-13 14:26:47 UTC
Created attachment 244008 [details] [review]
a patch proposal, which enhances the current window size situation.
Comment 3 Evgeny Bobkin 2013-05-14 10:25:48 UTC
Created attachment 244143 [details] [review]
change panel-id gschema type from int to enum

this is the follow up patch [2]
Comment 4 Evgeny Bobkin 2013-05-14 10:26:40 UTC
Created attachment 244144 [details] [review]
change panel-id gschema type from int to enum

this is the follow up patch [2]
Comment 5 Evgeny Bobkin 2013-05-14 13:11:23 UTC
Created attachment 244171 [details] [review]
Store window size and panel state with gsettings
Comment 6 Evgeny Bobkin 2013-05-14 13:40:56 UTC
Created attachment 244177 [details] [review]
move panels to an array and eliminate switch block
Comment 7 Evgeny Bobkin 2013-05-14 14:05:21 UTC
Created attachment 244182 [details] [review]
Store window size and panel state with gsettings
Comment 8 Paolo Borelli 2013-05-14 19:48:42 UTC
Comment on attachment 244182 [details] [review]
Store window size and panel state with gsettings

Works great! Thanks a lot for the patch and for the patience with my review.