[gnome-sudoku] Reorder calls to ensure window uniqueness.
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-sudoku] Reorder calls to ensure window uniqueness.
- Date: Fri, 5 Sep 2014 13:56:05 +0000 (UTC)
commit 01fca22da24039971306d72e34031e12fed68037
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Fri Sep 5 00:26:57 2014 +0200
Reorder calls to ensure window uniqueness.
https://bugzilla.gnome.org/show_bug.cgi?id=735806
src/gnome-sudoku.vala | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/src/gnome-sudoku.vala b/src/gnome-sudoku.vala
index 96aa114..9a73c3f 100644
--- a/src/gnome-sudoku.vala
+++ b/src/gnome-sudoku.vala
@@ -66,6 +66,11 @@ public class Sudoku : Gtk.Application
public Sudoku ()
{
+ Intl.setlocale (LocaleCategory.ALL, "");
+ Intl.bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+ Intl.bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ Intl.textdomain (GETTEXT_PACKAGE);
+
Object (application_id: "org.gnome.sudoku", flags: ApplicationFlags.FLAGS_NONE);
add_main_option_entries (option_entries);
}
@@ -89,11 +94,6 @@ public class Sudoku : Gtk.Application
{
base.startup ();
- Intl.setlocale (LocaleCategory.ALL, "");
- Intl.bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
- Intl.bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- Intl.textdomain (GETTEXT_PACKAGE);
-
add_action_entries (action_entries, this);
settings = new GLib.Settings ("org.gnome.sudoku");
@@ -111,9 +111,7 @@ public class Sudoku : Gtk.Application
set_accels_for_action ("app.help", {"F1"});
Gtk.Window.set_default_icon_name ("gnome-sudoku");
- }
- protected override void activate () {
var css_provider = new Gtk.CssProvider ();
try
{
@@ -158,8 +156,6 @@ public class Sudoku : Gtk.Application
else
show_new_game_screen ();
- window.show ();
-
window.delete_event.connect ((event) => {
if (game != null && !game.board.is_empty () && !game.board.complete)
saver.save_game (game);
@@ -168,6 +164,11 @@ public class Sudoku : Gtk.Application
});
}
+ protected override void activate ()
+ {
+ window.present ();
+ }
+
protected override void shutdown ()
{
base.shutdown ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]