[gnome-pilot-conduits] Port to gtk3.
- From: Matthew Charles Davey <mcdavey src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-pilot-conduits] Port to gtk3.
- Date: Sat, 10 Sep 2011 22:20:01 +0000 (UTC)
commit 7932d520501cf787556145fa2354a65a797f58c2
Author: Matt Davey <mcdavey mrao cam ac uk>
Date: Sat Sep 10 22:23:17 2011 +0100
Port to gtk3.
2011-09-10 Matt Davey <mcdavey mrao cam ac uk>
* configure.in: Port to gtk3. #654209
* email/email_conduit.c: ditto
* expense/expense_conduit.c: ditto
* memo_file/memo_file_conduit.c: ditto
* memo_file/memo_file_conduit.h: ditto
* time/time-conduit.c: ditto
* time/time-conduit.h: ditto
ChangeLog | 10 ++++++++++
configure.in | 6 +++---
email/email_conduit.c | 22 +++++++++++-----------
expense/expense_conduit.c | 24 ++++++++++++------------
memo_file/memo_file_conduit.c | 20 +++++++++++---------
memo_file/memo_file_conduit.h | 4 ++--
time/time-conduit.c | 6 +++---
time/time-conduit.h | 2 +-
8 files changed, 53 insertions(+), 41 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4bb1029..b587d29 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-09-10 Matt Davey <mcdavey mrao cam ac uk>
+ * configure.in: Port to gtk3. #654209
+ * email/email_conduit.c: ditto
+ * expense/expense_conduit.c: ditto
+ * memo_file/memo_file_conduit.c: ditto
+ * memo_file/memo_file_conduit.h: ditto
+ * time/time-conduit.c: ditto
+ * time/time-conduit.h: ditto
+
+
2010-10-21 Matt Davey <mcdavey mrao cam ac uk>
* configure.in: Add missing intltool config, so we ship
with the translations! #632025
diff --git a/configure.in b/configure.in
index 4415262..5d2e8b8 100644
--- a/configure.in
+++ b/configure.in
@@ -23,8 +23,8 @@ PKG_PROG_PKG_CONFIG
dnl ******************************
dnl Library Checks
dnl ******************************
-LIBGTK_REQUIRED="gtk+-2.0 >= 2.13.0"
-GNOME_PILOT_REQUIRED="gnome-pilot-2.0 >= 2.32.0"
+LIBGTK_REQUIRED="gtk+-3.0 >= 3.0.0"
+GNOME_PILOT_REQUIRED="gnome-pilot-3.0 >= 2.91.0"
LIBXML_REQUIRED="libxml-2.0"
PKG_CHECK_MODULES(GNOME_PILOT_CONDUITS,
@@ -39,7 +39,7 @@ AC_SUBST(GNOME_PILOT_CONDUITS_LIBS)
dnl ******************************
dnl Pilot Link Version Check
dnl ******************************
-plversion=`$PKG_CONFIG --variable=gnomepilot_plversion gnome-pilot-2.0`
+plversion=`$PKG_CONFIG --variable=gnomepilot_plversion gnome-pilot-3.0`
pl_mi=`echo $plversion|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\2/'`
if test $pl_mi -ge 12; then
diff --git a/email/email_conduit.c b/email/email_conduit.c
index 2e8b7b5..1b4f78e 100644
--- a/email/email_conduit.c
+++ b/email/email_conduit.c
@@ -22,8 +22,8 @@
#include <pwd.h>
#include <signal.h>
-#include <gpilotd/gnome-pilot-conduit.h>
-#include <gpilotd/gnome-pilot-conduit-standard.h>
+#include <gnome-pilot-conduit.h>
+#include <gnome-pilot-conduit-standard.h>
#include "email_conduit.h"
#define CONDUIT_VERSION "0.10"
@@ -809,10 +809,10 @@ static GtkWidget
/* send_action option menu */
label = gtk_label_new(_("Send Action:"));
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
- widget = gtk_combo_box_new_text ();
- gtk_combo_box_append_text(GTK_COMBO_BOX(widget), (_("Delete from PDA")));
+ widget = gtk_combo_box_text_new ();
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widget), (_("Delete from PDA")));
g_object_set_data(G_OBJECT(widget), EC_SEND_ACTION[0], GINT_TO_POINTER(0));
- gtk_combo_box_append_text(GTK_COMBO_BOX(widget), _("File on PDA"));
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widget), _("File on PDA"));
g_object_set_data(G_OBJECT(widget), EC_SEND_ACTION[1], GINT_TO_POINTER(1));
gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 0, 1);
gtk_table_attach_defaults(GTK_TABLE(table), widget, 1, 2, 0, 1);
@@ -840,12 +840,12 @@ static GtkWidget
/* receive_action option menu */
label = gtk_label_new (_("Receive Action:"));
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
- widget = gtk_combo_box_new_text ();
- gtk_combo_box_append_text(GTK_COMBO_BOX(widget), _("Copy from Inbox"));
+ widget = gtk_combo_box_text_new ();
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widget), _("Copy from Inbox"));
g_object_set_data(G_OBJECT(widget), EC_RECV_ACTION[0], GINT_TO_POINTER(0));
- gtk_combo_box_append_text(GTK_COMBO_BOX(widget), _("Delete from Inbox"));
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widget), _("Delete from Inbox"));
g_object_set_data(G_OBJECT(widget), EC_RECV_ACTION[1], GINT_TO_POINTER(1));
- gtk_combo_box_append_text(GTK_COMBO_BOX(widget), _("Mirror Inbox"));
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widget), _("Mirror Inbox"));
g_object_set_data(G_OBJECT(widget), EC_RECV_ACTION[2], GINT_TO_POINTER(2));
gtk_table_attach_defaults (GTK_TABLE(table), label, 0, 1, 3, 4);
gtk_table_attach_defaults(GTK_TABLE(table), widget, 1, 2, 3, 4);
@@ -997,7 +997,7 @@ revert_settings (GnomePilotConduit *conduit, gpointer data)
GnomePilotConduit *conduit_get_gpilot_conduit( guint32 pilotId )
{
- GtkObject *retval;
+ GObject *retval;
ConduitCfg *cfg1, *cfg2;
retval = gnome_pilot_conduit_standard_new("MailDB",0x6d61696c, NULL);
@@ -1044,7 +1044,7 @@ void conduit_destroy_gpilot_conduit( GnomePilotConduit *c )
g_list_free(inbox_list);
inbox_list = NULL;
- gtk_object_destroy(GTK_OBJECT(c));
+ g_object_unref (G_OBJECT (c));
}
#define OLD_PREFIX ".gnome2/gnome-pilot.d"
diff --git a/expense/expense_conduit.c b/expense/expense_conduit.c
index e7fb972..b021967 100644
--- a/expense/expense_conduit.c
+++ b/expense/expense_conduit.c
@@ -25,8 +25,8 @@
#include <signal.h>
#include <time.h>
-#include <gpilotd/gnome-pilot-conduit.h>
-#include <gpilotd/gnome-pilot-conduit-standard.h>
+#include <gnome-pilot-conduit.h>
+#include <gnome-pilot-conduit-standard.h>
#include "expense_conduit.h"
#define CONDUIT_VERSION "0.3"
@@ -449,13 +449,13 @@ insert_ignore_space_cb (GtkEditable *editable, const gchar *text,
curname = gtk_entry_get_text(GTK_ENTRY(editable));
if (*curname == '\0' && len > 0) {
if (isspace(text[0])) {
- g_signal_stop_emission_by_name(GTK_OBJECT(editable), "insert_text");
+ g_signal_stop_emission_by_name(G_OBJECT(editable), "insert_text");
return;
}
} else {
for (i=0; i<len; i++) {
if (isspace(text[i])) {
- g_signal_stop_emission_by_name(GTK_OBJECT(editable),
+ g_signal_stop_emission_by_name(G_OBJECT(editable),
"insert_text");
return;
}
@@ -471,7 +471,7 @@ insert_numeric_cb(GtkEditable *editable, const gchar *text,
for (i=0; i<len; i++) {
if (!isdigit(text[i])) {
- g_signal_stop_emission_by_name(GTK_OBJECT(editable), "insert_text");
+ g_signal_stop_emission_by_name(G_OBJECT(editable), "insert_text");
return;
}
}
@@ -536,9 +536,9 @@ static GtkWidget
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2);
- optionMenu = gtk_combo_box_new_text();
+ optionMenu = gtk_combo_box_text_new();
for (i = 0; i < DATE_OPTIONS_COUNT; i++) {
- gtk_combo_box_append_text(GTK_COMBO_BOX(optionMenu),
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(optionMenu),
_(date_options[i].name));
}
@@ -551,9 +551,9 @@ static GtkWidget
gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 2, 3);
- optionMenu = gtk_combo_box_new_text();
+ optionMenu = gtk_combo_box_text_new();
for (i = 0; i < WRITEOUT_OPTIONS_COUNT; i++) {
- gtk_combo_box_append_text(GTK_COMBO_BOX (optionMenu),
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT (optionMenu),
_(writeout_options[i].name));
}
@@ -582,7 +582,7 @@ static GtkWidget
g_object_set_data(G_OBJECT(vbox), fields[i].obj_data, entry);
gtk_table_attach(GTK_TABLE(table), entry, 1, 2,
widget_offset+i, widget_offset+i+1, 0,0,0,0);
- g_signal_connect(GTK_OBJECT(entry), "insert_text",
+ g_signal_connect(G_OBJECT(entry), "insert_text",
G_CALLBACK(fields[i].insert_func),
NULL);
}
@@ -691,7 +691,7 @@ revert_settings (GnomePilotConduit *conduit, gpointer data)
GnomePilotConduit *conduit_get_gpilot_conduit( guint32 pilotId )
{
- GtkObject *retval;
+ GObject *retval;
ConduitCfg *cfg, *cfg2;
ConduitData *cd = g_new0(ConduitData, 1);
@@ -728,7 +728,7 @@ void conduit_destroy_gpilot_conduit( GnomePilotConduit *c )
cd = GET_CONDUIT_DATA(c);
destroy_configuration( &cc );
- gtk_object_destroy(GTK_OBJECT(c));
+ g_object_unref (G_OBJECT (c));
}
#define OLD_PREFIX ".gnome2/gnome-pilot.d"
diff --git a/memo_file/memo_file_conduit.c b/memo_file/memo_file_conduit.c
index 62304c6..1ed6c81 100644
--- a/memo_file/memo_file_conduit.c
+++ b/memo_file/memo_file_conduit.c
@@ -44,8 +44,8 @@
#include <errno.h>
#include <ctype.h>
#include <dirent.h>
-#include <gpilotd/gnome-pilot-conduit.h>
-#include <gpilotd/gnome-pilot-conduit-standard-abs.h>
+#include <gnome-pilot-conduit.h>
+#include <gnome-pilot-conduit-standard-abs.h>
#include "memo_file_conduit.h"
@@ -1262,13 +1262,13 @@ insert_ignore_space (GtkEditable *editable, const gchar *text,
curname = gtk_entry_get_text (GTK_ENTRY (editable));
if (*curname == '\0' && len > 0) {
if (isspace (text[0])) {
- g_signal_stop_emission_by_name (GTK_OBJECT (editable), "insert_text");
+ g_signal_stop_emission_by_name (G_OBJECT (editable), "insert_text");
return;
}
} else {
for (i=0; i<len; i++) {
if (isspace (text[i])) {
- g_signal_stop_emission_by_name (GTK_OBJECT (editable),"insert_text");
+ g_signal_stop_emission_by_name (G_OBJECT (editable),"insert_text");
return;
}
}
@@ -1284,7 +1284,7 @@ insert_numeric_callback (GtkEditable *editable, const gchar *text,
for (i=0; i<len; i++) {
if (!isdigit (text[i])) {
- g_signal_stop_emission_by_name (GTK_OBJECT (editable), "insert_text");
+ g_signal_stop_emission_by_name (G_OBJECT (editable), "insert_text");
return;
}
}
@@ -1307,7 +1307,7 @@ secret_toggled_cb (GtkWidget *widget, gpointer data)
GnomePilotConduit *conduit = (GnomePilotConduit*)data;
ConduitCfg * curState = GET_CONDUIT_CFG (conduit);
GtkWidget * main_widget = GET_CONDUIT_WINDOW (conduit);
- curState->open_secret = GTK_TOGGLE_BUTTON (widget)->active;
+ curState->open_secret = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
gtk_widget_set_sensitive (g_object_get_data (G_OBJECT (main_widget),"secret_mode"), curState->open_secret);
gtk_widget_set_sensitive (g_object_get_data (G_OBJECT (main_widget),"secret_label"), curState->open_secret);
}
@@ -1342,7 +1342,7 @@ static GtkWidget
gtk_entry_set_max_length (GTK_ENTRY(entry), 128);
g_object_set_data (G_OBJECT (vbox), fields[i].obj_data, entry);
gtk_table_attach (GTK_TABLE (table), entry, 2, 3, i, i+1, 0, 0, 0, 0);
- g_signal_connect (GTK_OBJECT (entry), "insert_text",
+ g_signal_connect (G_OBJECT (entry), "insert_text",
G_CALLBACK (fields[i].insert_func),
NULL);
}
@@ -1350,7 +1350,7 @@ static GtkWidget
button = gtk_check_button_new ();
g_object_set_data (G_OBJECT (vbox),"secret_on", button);
- g_signal_connect (GTK_OBJECT (button), "toggled",
+ g_signal_connect (G_OBJECT (button), "toggled",
G_CALLBACK (secret_toggled_cb),
conduit);
gtk_table_attach (GTK_TABLE (table), button, 0, 1, 5, 6, 0, 0, 0, 0); /* 5, 6 is badly hard-coded here. */
@@ -1468,7 +1468,7 @@ revert_settings (GnomePilotConduit *conduit, gpointer data)
GnomePilotConduit *
conduit_get_gpilot_conduit (guint32 pilotId)
{
- GtkObject *retval;
+ GObject *retval;
ConduitData *cd = g_new0 (ConduitData, 1);
ConduitCfg *cfg, *cfg2;
@@ -1541,6 +1541,8 @@ conduit_destroy_gpilot_conduit (GnomePilotConduit *conduit)
if (cfg2) {
destroy_configuration (&cfg2);
}
+
+ g_object_unref (G_OBJECT (conduit));
}
diff --git a/memo_file/memo_file_conduit.h b/memo_file/memo_file_conduit.h
index c2458b5..5720380 100644
--- a/memo_file/memo_file_conduit.h
+++ b/memo_file/memo_file_conduit.h
@@ -32,8 +32,8 @@
#include <gtk/gtk.h>
#include <errno.h>
-#include <gpilotd/gnome-pilot-conduit.h>
-#include <gpilotd/gnome-pilot-conduit-standard-abs.h>
+#include <gnome-pilot-conduit.h>
+#include <gnome-pilot-conduit-standard-abs.h>
#define OBJ_DATA_CONDUIT "conduit_data"
#define OBJ_DATA_CONFIG "conduit_config"
diff --git a/time/time-conduit.c b/time/time-conduit.c
index d5579dd..cf6de03 100644
--- a/time/time-conduit.c
+++ b/time/time-conduit.c
@@ -30,7 +30,7 @@
#include <pi-dlp.h>
#include <pi-version.h>
-#include <gpilotd/gnome-pilot-conduit-standard.h>
+#include <gnome-pilot-conduit-standard.h>
#include "time-conduit.h"
@@ -189,7 +189,7 @@ synchronize (GnomePilotConduit *c,
GnomePilotConduit *
conduit_load_gpilot_conduit (GPilotPilot *pilot)
{
- GtkObject *retval;
+ GObject *retval;
ConduitCfg *cfg, *cfg2;
retval = gnome_pilot_conduit_standard_new ("Unsaved Preferences", (guint32)0x70737973, pilot);
@@ -221,7 +221,7 @@ conduit_destroy_gpilot_conduit (GnomePilotConduit *conduit)
destroy_configuration(&cfg);
if(cfg2) destroy_configuration(&cfg2);
- gtk_object_destroy (GTK_OBJECT (conduit));
+ g_object_unref (G_OBJECT (conduit));
}
diff --git a/time/time-conduit.h b/time/time-conduit.h
index 3de8437..14a606c 100644
--- a/time/time-conduit.h
+++ b/time/time-conduit.h
@@ -23,7 +23,7 @@
#define __TIME_CONDUIT_H__
#include <time.h>
-#include <gpilotd/gnome-pilot-conduit-standard.h>
+#include <gnome-pilot-conduit-standard.h>
#define OBJ_DATA_CONDUIT "conduit_data"
#define OBJ_DATA_CONFIG "conduit_config"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]