[libgda/gtk3] Misc corrections due to GTK+ API changes
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda/gtk3] Misc corrections due to GTK+ API changes
- Date: Thu, 23 Dec 2010 14:28:18 +0000 (UTC)
commit 4ba5a26bd52811e715da59a55c4c7dc8cba67b30
Author: Vivien Malerba <malerba gnome-db org>
Date: Thu Dec 23 15:10:53 2010 +0100
Misc corrections due to GTK+ API changes
libgda-ui/data-entries/gdaui-entry.h | 4 +-
libgda-ui/gdaui-login.c | 43 ++++++++++++++++++++-------------
libgda/gda-data-model.c | 5 +--
testing/gdaui-test-data-entries.c | 7 ++++-
4 files changed, 36 insertions(+), 23 deletions(-)
---
diff --git a/libgda-ui/data-entries/gdaui-entry.h b/libgda-ui/data-entries/gdaui-entry.h
index 52937ac..c7216a5 100644
--- a/libgda-ui/data-entries/gdaui-entry.h
+++ b/libgda-ui/data-entries/gdaui-entry.h
@@ -38,13 +38,13 @@ typedef struct _GdauiEntryPrivate GdauiEntryPrivate;
struct _GdauiEntry
{
- GtkEntry entry;
+ GtkEntry entry;
GdauiEntryPrivate *priv;
};
struct _GdauiEntryClass
{
- GtkEntryClass parent_class;
+ GtkEntryClass parent_class;
/* virtual methods */
/**
diff --git a/libgda-ui/gdaui-login.c b/libgda-ui/gdaui-login.c
index 9c3e69b..113235b 100644
--- a/libgda-ui/gdaui-login.c
+++ b/libgda-ui/gdaui-login.c
@@ -380,32 +380,41 @@ radio_button_use_dsn_toggled_cb (GtkToggleButton *button, GdauiLogin *login)
static void
run_cc_cb (G_GNUC_UNUSED GtkButton *button, GdauiLogin *login)
{
- char *argv[2];
+ GAppInfo *appinfo;
+ GdkAppLaunchContext *context;
+ GdkScreen *screen;
gboolean sresult;
GError *lerror = NULL;
+ gchar *cmd;
#ifdef G_OS_WIN32
#define EXENAME "gda-control-center-" GDA_ABI_VERSION ".exe"
#else
#define EXENAME "gda-control-center-" GDA_ABI_VERSION
#endif
- /* run gnome-database-properties dictig tool */
- argv[0] = gda_gbr_get_file_path (GDA_BIN_DIR, (char *) EXENAME, NULL);
- argv[1] = NULL;
-
- sresult = gdk_spawn_on_screen (gtk_widget_get_screen (GTK_WIDGET (login)),
- NULL, argv, NULL, 0,
- NULL, NULL, NULL, &lerror);
- if (!sresult && lerror && (lerror->domain == G_SPAWN_ERROR) && (lerror->code == G_SPAWN_ERROR_NOENT)) {
- g_error_free (lerror);
- lerror = NULL;
- g_free (argv [0]);
- argv[0] = g_strdup ((char *) EXENAME);
- sresult = gdk_spawn_on_screen (gtk_widget_get_screen (GTK_WIDGET (login)),
- NULL, argv, NULL, G_SPAWN_SEARCH_PATH,
- NULL, NULL, NULL, &lerror);
+ /* run gnome-database-properties tool */
+ cmd = gda_gbr_get_file_path (GDA_BIN_DIR, (char *) EXENAME, NULL);
+ appinfo = g_app_info_create_from_commandline (cmd,
+ "Gda Control center",
+ G_APP_INFO_CREATE_NONE,
+ NULL);
+ g_free (cmd);
+
+ screen = gtk_widget_get_screen (GTK_WIDGET (login));
+ context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
+ gdk_app_launch_context_set_screen (context, screen);
+ sresult = g_app_info_launch (appinfo, NULL, G_APP_LAUNCH_CONTEXT (context), NULL);
+ if (! sresult) {
+ g_object_unref (appinfo);
+ appinfo = g_app_info_create_from_commandline (EXENAME,
+ "Gda Control center",
+ G_APP_INFO_CREATE_NONE,
+ NULL);
+ sresult = g_app_info_launch (appinfo, NULL, G_APP_LAUNCH_CONTEXT (context), &lerror);
}
- g_free (argv [0]);
+ g_object_unref (context);
+ g_object_unref (appinfo);
+
if (!sresult) {
GtkWidget *msgdialog;
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (login));
diff --git a/libgda/gda-data-model.c b/libgda/gda-data-model.c
index eeae63f..0baba3b 100644
--- a/libgda/gda-data-model.c
+++ b/libgda/gda-data-model.c
@@ -2199,14 +2199,13 @@ real_gda_data_model_dump_as_string (GdaDataModel *model, gboolean dump_attribute
#ifndef G_OS_WIN32
char *current_locale;
int utf8_mode;
- current_locale = setlocale (LC_ALL, "");
- utf8_mode = (strcmp (nl_langinfo(CODESET), "UTF-8") == 0);
+ current_locale = setlocale (LC_ALL, NULL);
+ utf8_mode = (strcmp (nl_langinfo (CODESET), "UTF-8") == 0);
if (utf8_mode) {
sep_col = " â?? ";
sep_fill = "â??";
sep_row = "â??â?¼â??";
}
- setlocale (LC_ALL, current_locale);
#endif
#endif
diff --git a/testing/gdaui-test-data-entries.c b/testing/gdaui-test-data-entries.c
index 2079dba..dc7ab0b 100644
--- a/testing/gdaui-test-data-entries.c
+++ b/testing/gdaui-test-data-entries.c
@@ -2,6 +2,9 @@
#include <libgda-ui/libgda-ui.h>
#include <libgda-ui/gdaui-plugin.h>
#include <gtk/gtk.h>
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
typedef enum {
TESTED_BASIC,
@@ -104,8 +107,10 @@ main (int argc, char **argv)
GOptionContext *context;
GError *error = NULL;
+#ifdef HAVE_LOCALE_H
/* Initialize i18n support */
- gtk_set_locale ();
+ setlocale (LC_ALL,"");
+#endif
/* command line parsing */
context = g_option_context_new ("Gdaui entry widgets and cell renderers testing");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]