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 735806 - [PATCHes] Clean gnome-sudoku.vala file.
[PATCHes] Clean gnome-sudoku.vala file.
Status: RESOLVED FIXED
Product: gnome-sudoku
Classification: Applications
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gnome-sudoku-maint
gnome-sudoku-maint
Depends on:
Blocks:
 
 
Reported: 2014-09-01 12:40 UTC by Arnaud B.
Modified: 2014-09-05 13:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use GResource for loading appmenu. (4.34 KB, patch)
2014-09-01 12:40 UTC, Arnaud B.
accepted-commit_now Details | Review
Use set_accels_for_action(). (1.51 KB, patch)
2014-09-01 12:40 UTC, Arnaud B.
reviewed Details | Review
Reorder calls to ensure window uniqueness. (2.10 KB, patch)
2014-09-01 12:41 UTC, Arnaud B.
reviewed Details | Review
Remove unused namespaces. (1.60 KB, patch)
2014-09-01 12:42 UTC, Arnaud B.
reviewed Details | Review
Clean the grid saving when quitting application. (1.88 KB, patch)
2014-09-01 12:42 UTC, Arnaud B.
reviewed Details | Review
Bump Gtk+ required version to 3.13.4. (651 bytes, patch)
2014-09-04 22:37 UTC, Arnaud B.
committed Details | Review
Use GResource for loading appmenu. (4.34 KB, patch)
2014-09-04 22:38 UTC, Arnaud B.
committed Details | Review
Use set_accels_for_action(). (1.51 KB, patch)
2014-09-04 22:39 UTC, Arnaud B.
committed Details | Review
Reorder calls to ensure window uniqueness. (2.17 KB, patch)
2014-09-04 22:42 UTC, Arnaud B.
committed Details | Review
Remove unused namespaces. (1.61 KB, patch)
2014-09-04 22:43 UTC, Arnaud B.
committed Details | Review
Clean the grid saving when quitting application. (1.88 KB, patch)
2014-09-04 22:46 UTC, Arnaud B.
committed Details | Review

Description Arnaud B. 2014-09-01 12:40:07 UTC
Created attachment 285000 [details] [review]
Use GResource for loading appmenu.

Here are five cleaning patches:
* the first one uses the GResource organisation to automatically load the app’menu, and cleans the GtkBuilders creation, not using try {} but Builder.from_resource();
* the second uses set_accels_for_action() as add_accelerator() is deprecated;
* the third makes the creation of the window in startup() instead of in activate(), so that re-launching the app’ from command-line doesn’t finish with two buggy windows;
* the next one cleans gnome-sudoku.vala namespaces;
* the last cleans the grid saving when quitting application (what works when using the close button of the window didn’t work with the quit app’menu entry).
Comment 1 Arnaud B. 2014-09-01 12:40:46 UTC
Created attachment 285001 [details] [review]
Use set_accels_for_action().
Comment 2 Arnaud B. 2014-09-01 12:41:36 UTC
Created attachment 285002 [details] [review]
Reorder calls to ensure window uniqueness.
Comment 3 Arnaud B. 2014-09-01 12:42:07 UTC
Created attachment 285003 [details] [review]
Remove unused namespaces.
Comment 4 Arnaud B. 2014-09-01 12:42:52 UTC
Created attachment 285004 [details] [review]
Clean the grid saving when quitting application.
Comment 5 Michael Catanzaro 2014-09-04 21:30:25 UTC
Review of attachment 285000 [details] [review]:

Can you please rebase this whole patch series?  I can't apply any except this first one.

Looks good, but I bet we need to bump our GTK+ requirement in configure.ac for this (which is best done in a separate patch, so that it's more likely to appear in the changelogs). If you check the news file https://git.gnome.org/browse/gtk+/tree/NEWS it looks like this was added in 3.13.4.
Comment 6 Michael Catanzaro 2014-09-04 21:30:34 UTC
Review of attachment 285001 [details] [review]:

Looks good...
Comment 7 Michael Catanzaro 2014-09-04 21:31:35 UTC
Review of attachment 285002 [details] [review]:

Why did you move the intltool initialization?  startup() should be called first, and main() should do nothing except call run().
Comment 8 Michael Catanzaro 2014-09-04 21:32:47 UTC
Review of attachment 285003 [details] [review]:

Looks good.
Comment 9 Michael Catanzaro 2014-09-04 21:36:36 UTC
Review of attachment 285004 [details] [review]:

This looks important.

::: src/gnome-sudoku.vala
@@ +47,3 @@
         {"help", help_cb                                            },
         {"about", about_cb                                          },
+        {"quit", quit                                               }

How does this work? I couldn't find quit in any of the parent classes?
Comment 10 Arnaud B. 2014-09-04 22:37:59 UTC
Created attachment 285432 [details] [review]
Bump Gtk+ required version to 3.13.4.
Comment 11 Arnaud B. 2014-09-04 22:38:30 UTC
Created attachment 285433 [details] [review]
Use GResource for loading appmenu.
Comment 12 Arnaud B. 2014-09-04 22:39:05 UTC
Created attachment 285434 [details] [review]
Use set_accels_for_action().
Comment 13 Arnaud B. 2014-09-04 22:42:27 UTC
Created attachment 285435 [details] [review]
Reorder calls to ensure window uniqueness.

(In reply to comment #7)
> Why did you move the intltool initialization?  startup() should be called
> first, and main() should do nothing except call run().

The intltool initialization should be done before the call of handle_local_options(). So either at the beginning at Sudoku() like in this patch, or in main() like in the previous.
Comment 14 Arnaud B. 2014-09-04 22:43:22 UTC
Created attachment 285436 [details] [review]
Remove unused namespaces.
Comment 15 Arnaud B. 2014-09-04 22:46:48 UTC
Created attachment 285437 [details] [review]
Clean the grid saving when quitting application.

(In reply to comment #9)
> This looks important.

Yes, it is. =)

> ::: src/gnome-sudoku.vala
> @@ +47,3 @@
>          {"help", help_cb                                            },
>          {"about", about_cb                                          },
> +        {"quit", quit                                               }
> 
> How does this work? I couldn't find quit in any of the parent classes?

It’s the GApplication function to quit. No complete magic here. ^^
Comment 16 Michael Catanzaro 2014-09-05 13:56:01 UTC
OK, thanks!

Attachment 285432 [details] pushed as cc977f6 - Bump Gtk+ required version to 3.13.4.
Attachment 285433 [details] pushed as f946bd6 - Use GResource for loading appmenu.
Attachment 285434 [details] pushed as 9347b89 - Use set_accels_for_action().
Attachment 285435 [details] pushed as 01fca22 - Reorder calls to ensure window uniqueness.
Attachment 285436 [details] pushed as b9c4bd6 - Remove unused namespaces.
Attachment 285437 [details] pushed as 847d9e2 - Clean the grid saving when quitting application.