Create Application class
authorPete Fotheringham <pete.fotheringham@codethink.co.uk>
Thu, 8 Dec 2011 15:48:59 +0000 (15:48 +0000)
committerPete Fotheringham <pete.fotheringham@codethink.co.uk>
Thu, 8 Dec 2011 15:48:59 +0000 (15:48 +0000)
Makefile.am
src/moonshot-identity-manager-app.vala [new file with mode: 0644]
src/moonshot-window.vala

index c53f413..4750fa8 100644 (file)
@@ -34,6 +34,7 @@ include_HEADERS = libmoonshot/libmoonshot.h
 noinst_HEADERS = libmoonshot/libmoonshot-common.h
 
 src_moonshot_SOURCES = \
+        src/moonshot-identity-manager-app.vala \
         src/moonshot-local-flat-file-store.vala \
         src/moonshot-idcard-store.vala \
         src/moonshot-id.vala \
diff --git a/src/moonshot-identity-manager-app.vala b/src/moonshot-identity-manager-app.vala
new file mode 100644 (file)
index 0000000..d366e97
--- /dev/null
@@ -0,0 +1,38 @@
+using Gtk;
+
+class IdentityManagerApp : Window {
+    private MainWindow main_window;
+    
+    public IdentityManagerApp () {
+        main_window = new MainWindow();
+        main_window.show();
+    }
+    
+/*    public int run(string[] args){
+        GLib.Application.run(args);
+     }*/
+    public static int main(string[] args)
+    {
+        Gtk.init(ref args);
+
+#if OS_WIN32
+        // Force specific theme settings on Windows without requiring a gtkrc file
+        Gtk.Settings settings = Gtk.Settings.get_default ();
+        settings.set_string_property ("gtk-theme-name", "ms-windows", "moonshot");
+        settings.set_long_property ("gtk-menu-images", 0, "moonshot");
+#endif
+
+        Intl.bindtextdomain (Config.GETTEXT_PACKAGE, Config.LOCALEDIR);
+        Intl.bind_textdomain_codeset (Config.GETTEXT_PACKAGE, "UTF-8");
+        Intl.textdomain (Config.GETTEXT_PACKAGE);
+        
+        var app = new IdentityManagerApp();
+        
+//        app.show();
+        Gtk.main();
+
+        return 0;
+    }
+}
+
index f1be90a..63beb49 100644 (file)
@@ -1005,26 +1005,4 @@ SUCH DAMAGE.
     }
 #endif
 
-    public static int main(string[] args)
-    {
-        Gtk.init(ref args);
-
-#if OS_WIN32
-        // Force specific theme settings on Windows without requiring a gtkrc file
-        Gtk.Settings settings = Gtk.Settings.get_default ();
-        settings.set_string_property ("gtk-theme-name", "ms-windows", "moonshot");
-        settings.set_long_property ("gtk-menu-images", 0, "moonshot");
-#endif
-
-        Intl.bindtextdomain (Config.GETTEXT_PACKAGE, Config.LOCALEDIR);
-        Intl.bind_textdomain_codeset (Config.GETTEXT_PACKAGE, "UTF-8");
-        Intl.textdomain (Config.GETTEXT_PACKAGE);
-
-        var window = new MainWindow();
-        window.show ();
-
-        Gtk.main();
-
-        return 0;
-    }
 }