[balsa/gtk3] Make Balsa a GtkApplication instead of a GApplication



commit 10f695a418cb497400392bc7b3cba60c7df14b6e
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sat Jul 20 11:12:44 2013 -0400

    Make Balsa a GtkApplication instead of a GApplication
    
        * src/main.c (command_line_cb), (main): make Balsa a
        GtkApplication instead of a GApplication.
        * src/balsa-app.h: add the GtkApplication to BalsaApplication.

 src/balsa-app.h |    2 ++
 src/main.c      |   15 +++++++++------
 2 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/src/balsa-app.h b/src/balsa-app.h
index cb63219..782644b 100644
--- a/src/balsa-app.h
+++ b/src/balsa-app.h
@@ -136,6 +136,8 @@ enum _MwActionAfterMove {
 
 /* global balsa application structure */
 extern struct BalsaApplication {
+    GtkApplication *application;
+
     /* personal information */
     GList* identities;
     LibBalsaIdentity* current_ident;
diff --git a/src/main.c b/src/main.c
index ed611de..ee768c2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -834,8 +834,9 @@ handle_remote(int argc, char **argv,
 }
 
 static int
-command_line_cb(GApplication * application,
-                GApplicationCommandLine * command_line)
+command_line_cb(GApplication            * application,
+                GApplicationCommandLine * command_line,
+                gpointer                  user_data)
 {
     gchar **args, **argv;
     gint argc;
@@ -867,15 +868,17 @@ command_line_cb(GApplication * application,
 int
 main(int argc, char **argv)
 {
-    GApplication *application;
+    GtkApplication *application;
     int status;
 
-    application = g_application_new("org.desktop.Balsa",
-                                    G_APPLICATION_HANDLES_COMMAND_LINE);
+    balsa_app.application = application =
+        gtk_application_new("org.desktop.Balsa",
+                            G_APPLICATION_HANDLES_COMMAND_LINE);
     g_signal_connect(application, "command-line",
                      G_CALLBACK(command_line_cb), NULL);
+    g_object_set(application, "register-session", TRUE, NULL);
 
-    status = g_application_run(application, argc, argv);
+    status = g_application_run(G_APPLICATION(application), argc, argv);
 
     g_object_unref(application);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]