[libgda] Windows: corrections to enable launching the control center from the login widget
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] Windows: corrections to enable launching the control center from the login widget
- Date: Sat, 25 Aug 2012 15:56:45 +0000 (UTC)
commit 6e950920208443bd402c29d3e5f93302f4485af3
Author: Vivien Malerba <malerba gnome-db org>
Date: Sat Aug 25 15:15:52 2012 +0200
Windows: corrections to enable launching the control center from the login widget
libgda-ui/gdaui-login.c | 31 +++++++++++++++++++++----------
1 files changed, 21 insertions(+), 10 deletions(-)
---
diff --git a/libgda-ui/gdaui-login.c b/libgda-ui/gdaui-login.c
index 2123e6d..e2a8e07 100644
--- a/libgda-ui/gdaui-login.c
+++ b/libgda-ui/gdaui-login.c
@@ -390,25 +390,30 @@ radio_button_use_dsn_toggled_cb (GtkToggleButton *button, GdauiLogin *login)
static void
run_cc_cb (G_GNUC_UNUSED GtkButton *button, GdauiLogin *login)
{
- GAppInfo *appinfo;
- GdkAppLaunchContext *context;
- GdkScreen *screen;
- gboolean sresult;
+ gboolean sresult = FALSE;
GError *lerror = NULL;
gchar *cmd;
-
+
+ /* run gda-control-center tool */
#ifdef G_OS_WIN32
#define EXENAME "gda-control-center-" GDA_ABI_VERSION ".exe"
+ gchar *argv[] = {EXENAME, NULL};
+ cmd = gda_gbr_get_file_path (GDA_BIN_DIR, NULL);
+ sresult = g_spawn_async (cmd, argv, NULL, 0, NULL, NULL, NULL, &lerror);
+ g_free (cmd);
#else
#define EXENAME "gda-control-center-" GDA_ABI_VERSION
-#endif
- /* run gnome-database-properties tool */
+ GAppInfo *appinfo;
+ GdkAppLaunchContext *context;
+ GdkScreen *screen;
cmd = gda_gbr_get_file_path (GDA_BIN_DIR, (char *) EXENAME, NULL);
appinfo = g_app_info_create_from_commandline (cmd,
- "Gda Control center",
+ NULL,
G_APP_INFO_CREATE_NONE,
- NULL);
+ &lerror);
g_free (cmd);
+ if (!appinfo)
+ goto checkerror;
screen = gtk_widget_get_screen (GTK_WIDGET (login));
context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
@@ -417,14 +422,20 @@ run_cc_cb (G_GNUC_UNUSED GtkButton *button, GdauiLogin *login)
if (! sresult) {
g_object_unref (appinfo);
appinfo = g_app_info_create_from_commandline (EXENAME,
- "Gda Control center",
+ NULL,
G_APP_INFO_CREATE_NONE,
NULL);
+ if (!appinfo) {
+ g_object_unref (context);
+ goto checkerror;
+ }
sresult = g_app_info_launch (appinfo, NULL, G_APP_LAUNCH_CONTEXT (context), &lerror);
}
g_object_unref (context);
g_object_unref (appinfo);
+#endif /* G_OS_WIN32 */
+ checkerror:
if (!sresult) {
GtkWidget *msgdialog;
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (login));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]