[balsa/gtk3] Initial commit for gtk3 development branch
- From: Peter Bloomfield <PeterB src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/gtk3] Initial commit for gtk3 development branch
- Date: Wed, 29 Dec 2010 01:19:52 +0000 (UTC)
commit 1592fe78b0c811adcc925ca6480780918d23d620
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Tue Dec 28 20:19:21 2010 -0500
Initial commit for gtk3 development branch
ChangeLog | 67 +++++++++++++++++++++++++++++++
configure.in | 66 +++++++++++++-----------------
libbalsa/address-view.c | 2 +-
libbalsa/body.c | 4 +-
libbalsa/cell-renderer-button.c | 4 +-
libbalsa/html.c | 40 +++----------------
libbalsa/identity.c | 8 ++--
libbalsa/misc.c | 4 +-
libbalsa/smtp-server.c | 13 ++++--
libinit_balsa/assistant_helper.c | 4 +-
src/ab-main.c | 2 +-
src/ab-window.c | 4 +-
src/address-book-config.c | 3 +-
src/balsa-app.c | 9 ----
src/balsa-app.h | 4 --
src/balsa-cite-bar.c | 79 +++++++++++++++++++------------------
src/balsa-index.c | 24 ++++++-----
src/balsa-mblist.c | 16 +++----
src/balsa-message.c | 56 +++++++++++---------------
src/balsa-mime-widget-callbacks.c | 20 ++++-----
src/balsa-mime-widget-crypto.c | 9 ++++-
src/balsa-mime-widget-image.c | 13 +-----
src/balsa-mime-widget-text.c | 14 ++----
src/balsa-mime-widget.c | 16 +++++--
src/filter-edit-callbacks.c | 13 +++---
src/filter-edit-dialog.c | 6 +-
src/folder-conf.c | 2 +-
src/mailbox-conf.c | 16 ++++----
src/mailbox-node.c | 2 +-
src/main-window.c | 56 +++++++++-----------------
src/message-window.c | 2 +-
src/pref-manager.c | 62 ++++++++++-------------------
src/quote-color.c | 2 +
src/sendmsg-window.c | 25 ++++++++----
src/spell-check.c | 32 +++++++--------
src/store-address.c | 6 +-
src/toolbar-factory.c | 4 +-
37 files changed, 350 insertions(+), 359 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4fc4635..2d7efa1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,70 @@
+2010-12-28 Peter Bloomfield
+
+ Initial commit for gtk3 development branch
+
+ * configure.in:
+ * libbalsa/address-view.c (lbav_key_pressed_cb):
+ * libbalsa/body.c (libbalsa_message_body_get_pixbuf):
+ * libbalsa/cell-renderer-button.c
+ (libbalsa_cell_renderer_button_activate):
+ * libbalsa/html.c (lbh_resource_request_starting_cb),
+ (lbh_info_bar_widget), (libbalsa_html_new):
+ * libbalsa/identity.c (ident_dialog_add_gpg_menu), (add_show_menu),
+ (ident_dialog_add_smtp_menu):
+ * libbalsa/misc.c (libbalsa_charset_button_new):
+ * libbalsa/smtp-server.c (smtp_server_tls_widget):
+ * libinit_balsa/assistant_helper.c (balsa_init_add_table_option):
+ * src/ab-main.c (ew_key_pressed):
+ * src/ab-window.c (balsa_ab_window_load_books),
+ (balsa_ab_window_init):
+ * src/address-book-config.c (create_generic_dialog):
+ * src/balsa-app.c (balsa_app_init), (balsa_app_destroy):
+ * src/balsa-app.h:
+ * src/balsa-cite-bar.c (balsa_cite_bar_class_init),
+ (balsa_cite_bar_init), (balsa_cite_bar_get_preferred_width),
+ (balsa_cite_bar_get_preferred_height), (balsa_cite_bar_draw):
+ * src/balsa-index.c (bndx_class_init), (bndx_destroy),
+ (bndx_popup_position_func), (bndx_pipe_response),
+ (balsa_index_pipe):
+ * src/balsa-mblist.c (bmbl_class_init), (bmbl_mru_show_tree):
+ * src/balsa-message.c (balsa_message_class_init),
+ (bm_find_scroll_to_rectangle), (bm_find_pass_to_entry),
+ (balsa_message_destroy), (select_part):
+ * src/balsa-mime-widget-callbacks.c
+ (balsa_mime_widget_key_press_event):
+ * src/balsa-mime-widget-crypto.c
+ (balsa_mime_widget_signature_widget),
+ (balsa_mime_widget_crypto_frame):
+ * src/balsa-mime-widget-image.c (balsa_mime_widget_new_image),
+ (img_check_size):
+ * src/balsa-mime-widget-text.c (gtk_widget_destroy_insensitive),
+ (text_view_populate_popup), (fill_text_buf_cited):
+ * src/balsa-mime-widget.c (balsa_mime_widget_new),
+ (balsa_mime_widget_new_unknown):
+ * src/filter-edit-callbacks.c (fe_user_header_add),
+ (get_field_frame):
+ * src/filter-edit-dialog.c (fe_build_option_menu):
+ * src/folder-conf.c (browse_button_cb):
+ * src/mailbox-conf.c (mailbox_conf_combo_box_make),
+ (balsa_server_conf_get_advanced_widget),
+ (mailbox_conf_view_new_full):
+ * src/mailbox-node.c (balsa_mailbox_node_get_context_menu):
+ * src/main-window.c:
+ * src/message-window.c (message_window_new):
+ * src/pref-manager.c (apply_prefs), (checking_group),
+ (quoted_group), (word_wrap_group), (main_window_group),
+ (pspell_settings_group), (misc_group), (deleting_messages_group),
+ (folder_scanning_group), (option_menu_cb), (add_show_menu),
+ (pm_combo_box_new):
+ * src/quote-color.c (allocate_quote_colors):
+ * src/sendmsg-window.c (sw_get_user_codeset),
+ (sw_scroll_size_request), (create_email_entry), (create_info_pane),
+ (create_text_area):
+ * src/spell-check.c (balsa_spell_check_class_init),
+ (balsa_spell_check_destroy):
+ * src/store-address.c (store_address_book_frame):
+ * src/toolbar-factory.c (tm_popup_position_func):
+
2010-12-09 Peter Bloomfield
* balsa.1.in: do not use macro URL; fixes gnome bz #636801.
diff --git a/configure.in b/configure.in
index fd4ff96..43d08c2 100644
--- a/configure.in
+++ b/configure.in
@@ -100,7 +100,7 @@ AC_ARG_WITH([gpg-app],
AC_ARG_WITH(canberra,
AC_HELP_STRING([--with-canberra],
- [Use libcanberra-gtk2 for filter sounds (default=no)]),
+ [Use libcanberra-gtk3 for filter sounds (default=no)]),
[with_canberra=$withval],[with_canberra=no])
AC_ARG_WITH(compface,
@@ -282,26 +282,27 @@ dnl GNOME libs
dnl #####################################################################
if test x$with_gnome != xno; then
gnome_extras="libgnome-2.0 libgnomeui-2.0 libbonobo-2.0 gconf-2.0"
- AC_MSG_CHECKING([whether we have gnome-keyring])
- if $PKG_CONFIG --atleast-version=1.0 gnome-keyring-1; then
- gnome_extras="$gnome_extras gnome-keyring-1"
- AC_DEFINE(HAVE_GNOME_KEYRING,1,[Defined when gnome-keyring is there.])
- # Work around http://bugzilla.gnome.org/show_bug.cgi?id=556530
- if $PKG_CONFIG --atleast-version=2.24.1 gnome-keyring-1; then
- AC_DEFINE(HAVE_GNOME_KEYRING_24,1,
- [Defined with gnome-keyring-2.24 or newer.])
- fi
- with_gnome_keyring=yes
- else
- with_gnome_keyring=no
- fi
- AC_MSG_RESULT($with_gnome_keyring)
AC_DEFINE(HAVE_GNOME,1,[Defined when gnome libs are available.])
else
gnome_extras=""
fi
AM_CONDITIONAL([BUILD_WITH_GNOME], [test $with_gnome = "yes"])
+AC_MSG_CHECKING([whether we have gnome-keyring])
+if $PKG_CONFIG --atleast-version=1.0 gnome-keyring-1; then
+ gnome_extras="$gnome_extras gnome-keyring-1"
+ AC_DEFINE(HAVE_GNOME_KEYRING,1,[Defined when gnome-keyring is there.])
+ # Work around http://bugzilla.gnome.org/show_bug.cgi?id=556530
+ if $PKG_CONFIG --atleast-version=2.24.1 gnome-keyring-1; then
+ AC_DEFINE(HAVE_GNOME_KEYRING_24,1,
+ [Defined with gnome-keyring-2.24 or newer.])
+ fi
+ with_gnome_keyring=yes
+else
+ with_gnome_keyring=no
+fi
+AC_MSG_RESULT($with_gnome_keyring)
+
# GMime configuration
#
if test "$with_gmime" = detect; then
@@ -333,18 +334,18 @@ dnl Make sure ld finds zlib:
LIBS="$LIBS -lz"
PKG_CHECK_MODULES(BALSA, [
-glib-2.0 >= 2.16.0
-gtk+-2.0 >= 2.14.0
+glib-2.0 >= 2.27.0
+gtk+-3.0
gmime-$with_gmime
-gio-2.0
+gio-2.0 >= 2.27.0
gthread-2.0
gnome-icon-theme
$gnome_extras
])
PKG_CHECK_MODULES(BALSA_AB, [
- glib-2.0 >= 2.6.0
- gtk+-2.0 >= 2.6.0
+ glib-2.0 >= 2.27.0
+ gtk+-3.0
gmime-$with_gmime
$gnome_extras
])
@@ -408,13 +409,10 @@ case "$use_html_widget" in
;;
webkit)
AC_MSG_RESULT([$use_html_widget])
- if ! $PKG_CONFIG --atleast-version=1.1.14 webkit-1.0; then
- AC_MSG_ERROR([WebKitGTK+ version 1.1.14 or newer is required.])
- fi
if test x"$use_threads" = xno ; then
AC_MSG_ERROR([WebKit cannot be used with threads disabled.])
fi
- PKG_CHECK_MODULES(HTML, [webkit-1.0])
+ PKG_CHECK_MODULES(HTML, [webkitgtk-3.0])
AC_DEFINE(HAVE_WEBKIT,1,[Defined when WebKit can be used.])
;;
no)
@@ -774,27 +772,21 @@ fi
# GtkSourceView configuration
#
if test x$with_gtksourceview != xno; then
- if test x$with_gtksourceview = x1 || ! $PKG_CONFIG --exists gtksourceview-2.0 ; then
- PKG_CHECK_MODULES(GTKSOURCEVIEW, [ gtksourceview-1.0 ])
- AC_DEFINE(HAVE_GTKSOURCEVIEW,1,[Defined when GtkSourceView can be used.])
- AC_MSG_NOTICE([Note: using GtkSourceview Version 1])
- else
- PKG_CHECK_MODULES(GTKSOURCEVIEW, [ gtksourceview-2.0 ])
- AC_DEFINE(HAVE_GTKSOURCEVIEW,2,[Defined when GtkSourceView can be used.])
- AC_MSG_NOTICE([Note: using GtkSourceview Version 2])
- with_gtksourceview=2
- fi
+ PKG_CHECK_MODULES(GTKSOURCEVIEW, [ gtksourceview-3.0 ])
+ AC_DEFINE(HAVE_GTKSOURCEVIEW,3,[Defined when GtkSourceView can be used.])
+ AC_MSG_NOTICE([Note: using GtkSourceview Version 3])
+ with_gtksourceview=3
BALSA_CFLAGS="$BALSA_CFLAGS $GTKSOURCEVIEW_CFLAGS"
BALSA_LIBS="$BALSA_LIBS $GTKSOURCEVIEW_LIBS"
fi
-AM_CONDITIONAL([BUILD_WITH_GTKSOURCEVIEW2], [test x$with_gtksourceview = x2 ])
+AM_CONDITIONAL([BUILD_WITH_GTKSOURCEVIEW2], [test x$with_gtksourceview = x3 ])
# libUnique configuration
#
AC_MSG_CHECKING([whether to build with libUnique])
if test x$with_unique != xno; then
AC_MSG_RESULT([yes])
- PKG_CHECK_MODULES(UNIQUE, [ unique-1.0 ])
+ PKG_CHECK_MODULES(UNIQUE, [ unique-3.0 ])
AC_DEFINE(HAVE_UNIQUE,1,[Defined when libUnique can be used.])
BALSA_CFLAGS="$BALSA_CFLAGS $UNIQUE_CFLAGS"
BALSA_LIBS="$BALSA_LIBS $UNIQUE_LIBS"
@@ -808,7 +800,7 @@ AM_CONDITIONAL([BUILD_WITH_UNIQUE], [test $with_unique = "yes" ])
AC_MSG_CHECKING([whether to build with canberra])
if test x$with_canberra != xno; then
AC_MSG_RESULT([yes])
- PKG_CHECK_MODULES(CANBERRA, [ libcanberra-gtk ])
+ PKG_CHECK_MODULES(CANBERRA, [ libcanberra-gtk3 ])
AC_DEFINE(HAVE_CANBERRA,1,[Defined when canberra can be used.])
BALSA_CFLAGS="$BALSA_CFLAGS $CANBERRA_CFLAGS"
BALSA_LIBS="$BALSA_LIBS $CANBERRA_LIBS"
diff --git a/libbalsa/address-view.c b/libbalsa/address-view.c
index 1054147..545f654 100644
--- a/libbalsa/address-view.c
+++ b/libbalsa/address-view.c
@@ -581,7 +581,7 @@ lbav_key_pressed_cb(GtkEntry * entry,
{
GtkEntryCompletion *completion;
- if (event->keyval != GDK_Escape)
+ if (event->keyval != GDK_KEY_Escape)
return FALSE;
if (address_view->last_was_escape) {
diff --git a/libbalsa/body.c b/libbalsa/body.c
index b872a9d..ada52bf 100644
--- a/libbalsa/body.c
+++ b/libbalsa/body.c
@@ -646,7 +646,9 @@ libbalsa_message_body_get_pixbuf(LibBalsaMessageBody * body, GError ** err)
#define ENABLE_WORKAROUND_FOR_IE_NON_IANA_MIME_TYPE TRUE
#if ENABLE_WORKAROUND_FOR_IE_NON_IANA_MIME_TYPE
- if (!loader && g_ascii_strcasecmp(mime_type, "image/pjpeg") == 0) {
+ if (!loader
+ && (!g_ascii_strcasecmp(mime_type, "image/pjpeg")
+ || !g_ascii_strcasecmp(mime_type, "image/jpg"))) {
g_clear_error(err);
loader = gdk_pixbuf_loader_new_with_mime_type("image/jpeg", err);
}
diff --git a/libbalsa/cell-renderer-button.c b/libbalsa/cell-renderer-button.c
index 2f67e6d..f9d14e9 100644
--- a/libbalsa/cell-renderer-button.c
+++ b/libbalsa/cell-renderer-button.c
@@ -42,8 +42,8 @@ libbalsa_cell_renderer_button_activate(GtkCellRenderer * cell,
GdkEvent * event,
GtkWidget * widget,
const gchar * path,
- GdkRectangle * background_area,
- GdkRectangle * cell_area,
+ const GdkRectangle * background_area,
+ const GdkRectangle * cell_area,
GtkCellRendererState flags)
{
g_signal_emit(cell, cell_button_signals[ACTIVATED], 0, path);
diff --git a/libbalsa/html.c b/libbalsa/html.c
index a027e92..dacdfd2 100644
--- a/libbalsa/html.c
+++ b/libbalsa/html.c
@@ -92,10 +92,8 @@ typedef struct {
LibBalsaHtmlCallback hover_cb;
LibBalsaHtmlCallback clicked_cb;
WebKitWebFrame *frame;
-#if GTK_CHECK_VERSION(2, 18, 0)
gboolean download_images;
GtkWidget *info_bar_widget;
-#endif /* GTK_CHECK_VERSION(2, 18, 0) */
WebKitWebView *web_view;
} LibBalsaWebKitInfo;
@@ -181,7 +179,6 @@ lbh_resource_request_starting_cb(WebKitWebView * web_view,
if (g_ascii_strncasecmp(uri, "cid:", 4)) {
/* Not a "cid:" request: disable loading. */
-#if GTK_CHECK_VERSION(2, 18, 0)
static GHashTable *cache = NULL;
if (!cache)
@@ -200,9 +197,6 @@ lbh_resource_request_starting_cb(WebKitWebView * web_view,
GTK_RESPONSE_CLOSE);
}
}
-#else /* GTK_CHECK_VERSION(2, 18, 0) */
- webkit_network_request_set_uri(request, "about:blank");
-#endif /* GTK_CHECK_VERSION(2, 18, 0) */
} else {
LibBalsaMessageBody *body;
@@ -290,7 +284,6 @@ lbh_create_web_view_cb(WebKitWebView * web_view,
return WEBKIT_WEB_VIEW(widget);
}
-#if GTK_CHECK_VERSION(2, 18, 0)
/*
* Make the GtkInfoBar for asking about downloading images
*/
@@ -317,25 +310,12 @@ lbh_info_bar_response_cb(GtkInfoBar * info_bar,
gtk_widget_destroy(GTK_WIDGET(info_bar));
}
-static void
-lbh_info_bar_realize_cb(GtkWidget * info_bar,
- GtkWidget * text_view)
-{
- GtkStyle *style = gtk_style_copy(gtk_widget_get_style(info_bar));
-
- style->base[GTK_STATE_NORMAL] = style->bg[GTK_STATE_NORMAL];
- gtk_widget_set_style(text_view, style);
- g_object_unref(style);
- gtk_widget_hide(info_bar);
-}
-
static GtkWidget *
lbh_info_bar_widget(GtkWidget * widget, LibBalsaWebKitInfo * info)
{
GtkWidget *info_bar_widget;
GtkInfoBar *info_bar;
- GtkWidget *text_view_widget;
- GtkTextView *text_view;
+ GtkWidget *label;
GtkWidget *content_area;
gchar *text = _("This message part contains images "
"from a remote server. "
@@ -354,22 +334,14 @@ lbh_info_bar_widget(GtkWidget * widget, LibBalsaWebKitInfo * info)
g_signal_connect(info_bar, "response",
G_CALLBACK(lbh_info_bar_response_cb), info);
- text_view_widget = gtk_text_view_new();
- g_signal_connect(info_bar_widget, "realize",
- G_CALLBACK(lbh_info_bar_realize_cb), text_view_widget);
+ label = gtk_label_new(text);
+ gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
content_area = gtk_info_bar_get_content_area(info_bar);
- gtk_container_add(GTK_CONTAINER(content_area), text_view_widget);
-
- text_view = GTK_TEXT_VIEW(text_view_widget);
- gtk_text_view_set_wrap_mode(text_view, GTK_WRAP_WORD_CHAR);
- gtk_text_view_set_editable(text_view, FALSE);
- gtk_text_buffer_set_text(gtk_text_view_get_buffer(text_view),
- text, -1);
+ gtk_container_add(GTK_CONTAINER(content_area), label);
return info_bar_widget;
}
-#endif /* GTK_CHECK_VERSION(2, 18, 0) */
/* Create a new WebKitWebView widget:
* text the HTML source;
@@ -406,13 +378,11 @@ libbalsa_html_new(LibBalsaMessageBody * body,
info->hover_cb = hover_cb;
info->clicked_cb = clicked_cb;
info->frame = NULL;
-#if GTK_CHECK_VERSION(2, 18, 0)
info->download_images = FALSE;
info->info_bar_widget = lbh_info_bar_widget(widget, info);
gtk_box_pack_start(GTK_BOX(vbox), info->info_bar_widget,
FALSE, FALSE, 0);
-#endif /* GTK_CHECK_VERSION(2, 18, 0) */
gtk_box_pack_start(GTK_BOX(vbox), widget, TRUE, TRUE, 0);
info->web_view = web_view = WEBKIT_WEB_VIEW(widget);
@@ -445,6 +415,8 @@ libbalsa_html_new(LibBalsaMessageBody * body,
libbalsa_message_body_charset(body), NULL);
g_free(text);
+ gtk_widget_show(widget);
+
return vbox;
}
diff --git a/libbalsa/identity.c b/libbalsa/identity.c
index 99dca2d..59c9c18 100644
--- a/libbalsa/identity.c
+++ b/libbalsa/identity.c
@@ -44,7 +44,7 @@
* The class.
*/
-static GtkObjectClass* parent_class;
+static GObjectClass* parent_class;
/* Forward references. */
static void libbalsa_identity_class_init(LibBalsaIdentityClass* klass);
@@ -2103,7 +2103,7 @@ ident_dialog_add_gpg_menu(GtkWidget * table, gint row, GtkDialog * dialog,
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, row, row + 1);
- opt_menu = gtk_combo_box_new_text();
+ opt_menu = gtk_combo_box_text_new();
values = g_ptr_array_sized_new(3);
g_object_set_data_full(G_OBJECT(opt_menu), "identity-value", values,
(GDestroyNotify) ident_dialog_free_values);
@@ -2127,7 +2127,7 @@ add_show_menu(const char *label, gpointer data, GtkWidget * menu)
GPtrArray *values =
g_object_get_data(G_OBJECT(menu), "identity-value");
- gtk_combo_box_append_text(GTK_COMBO_BOX(menu), label);
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(menu), label);
g_ptr_array_add(values, data);
}
@@ -2153,7 +2153,7 @@ ident_dialog_add_smtp_menu(GtkWidget * table, gint row, GtkDialog * dialog,
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, row, row + 1);
- combo_box = gtk_combo_box_new_text();
+ combo_box = gtk_combo_box_text_new();
gtk_label_set_mnemonic_widget(GTK_LABEL(label), combo_box);
values = g_ptr_array_sized_new(g_slist_length(smtp_servers));
g_object_set_data_full(G_OBJECT(combo_box), "identity-value", values,
diff --git a/libbalsa/misc.c b/libbalsa/misc.c
index a884e34..24088d6 100644
--- a/libbalsa/misc.c
+++ b/libbalsa/misc.c
@@ -673,13 +673,13 @@ libbalsa_charset_button_new(void)
LibBalsaCodeset n, active = WEST_EUROPE;
const gchar *locale_charset;
- combo_box = gtk_combo_box_new_text();
+ combo_box = gtk_combo_box_text_new();
locale_charset = g_mime_locale_charset();
for (n = 0; n < LIBBALSA_NUM_CODESETS; n++) {
LibBalsaCodesetInfo *info = &libbalsa_codeset_info[n];
gchar *tmp = g_strdup_printf("%s (%s)", _(info->label), info->std);
- gtk_combo_box_append_text(GTK_COMBO_BOX(combo_box), tmp);
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo_box), tmp);
g_free(tmp);
if (!g_ascii_strcasecmp(info->std, locale_charset))
diff --git a/libbalsa/smtp-server.c b/libbalsa/smtp-server.c
index 7ef1406..64b2053 100644
--- a/libbalsa/smtp-server.c
+++ b/libbalsa/smtp-server.c
@@ -383,11 +383,14 @@ GtkWidget *
smtp_server_tls_widget(LibBalsaSmtpServer * smtp_server)
{
LibBalsaServer *server = LIBBALSA_SERVER(smtp_server);
- GtkWidget *combo_box = gtk_combo_box_new_text();
-
- gtk_combo_box_append_text(GTK_COMBO_BOX(combo_box), _("Never"));
- gtk_combo_box_append_text(GTK_COMBO_BOX(combo_box), _("If Possible"));
- gtk_combo_box_append_text(GTK_COMBO_BOX(combo_box), _("Required"));
+ GtkWidget *combo_box = gtk_combo_box_text_new();
+
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo_box),
+ _("Never"));
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo_box),
+ _("If Possible"));
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo_box),
+ _("Required"));
switch (server->tls_mode) {
case Starttls_DISABLED:
diff --git a/libinit_balsa/assistant_helper.c b/libinit_balsa/assistant_helper.c
index b04f100..51e5a0b 100644
--- a/libinit_balsa/assistant_helper.c
+++ b/libinit_balsa/assistant_helper.c
@@ -152,9 +152,9 @@ balsa_init_add_table_option(GtkTable *table, guint num,
gtk_table_attach(table, l, 0, 1, num + 1, num + 2,
GTK_FILL, GTK_FILL, 5, 2);
- *dest = om = gtk_combo_box_new_text();
+ *dest = om = gtk_combo_box_text_new();
for(i=0; optns[i]; i++)
- gtk_combo_box_append_text(GTK_COMBO_BOX(om), _(optns[i]));
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(om), _(optns[i]));
gtk_label_set_mnemonic_widget(GTK_LABEL(l), om);
gtk_combo_box_set_active(GTK_COMBO_BOX(om), 0);
gtk_table_attach(table, om, 1, 2, num + 1, num + 2,
diff --git a/src/ab-main.c b/src/ab-main.c
index ad372e3..b2bd49a 100644
--- a/src/ab-main.c
+++ b/src/ab-main.c
@@ -984,7 +984,7 @@ bab_get_filter_box(void)
static gboolean
ew_key_pressed(GtkEntry * entry, GdkEventKey * event, struct ABMainWindow *abmw)
{
- if (event->keyval != GDK_Escape)
+ if (event->keyval != GDK_KEY_Escape)
return FALSE;
gtk_button_clicked(GTK_BUTTON(abmw->cancel_button));
return TRUE;
diff --git a/src/ab-window.c b/src/ab-window.c
index 77ad125..5c25141 100644
--- a/src/ab-window.c
+++ b/src/ab-window.c
@@ -203,7 +203,7 @@ balsa_ab_window_load_books(BalsaAbWindow * ab)
ab_list = ab_list->next, ++offset) {
LibBalsaAddressBook *address_book = ab_list->data;
- gtk_combo_box_append_text(GTK_COMBO_BOX(ab->combo_box),
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(ab->combo_box),
address_book->name);
if (ab->current_address_book == NULL)
@@ -258,7 +258,7 @@ balsa_ab_window_init(BalsaAbWindow *ab)
(balsa_ab_window_select_recipient));
/* The address book selection menu */
- ab->combo_box = gtk_combo_box_new_text();
+ ab->combo_box = gtk_combo_box_text_new();
ab->current_address_book = balsa_app.default_address_book;
diff --git a/src/address-book-config.c b/src/address-book-config.c
index aab3e78..0c28822 100644
--- a/src/address-book-config.c
+++ b/src/address-book-config.c
@@ -338,8 +338,7 @@ create_generic_dialog(AddressBookConfig * abc, const gchar * type)
}
dialog =
- gtk_dialog_new_with_buttons(title, abc->parent,
- GTK_DIALOG_NO_SEPARATOR,
+ gtk_dialog_new_with_buttons(title, abc->parent, 0,
GTK_STOCK_HELP, GTK_RESPONSE_HELP,
action, GTK_RESPONSE_APPLY,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
diff --git a/src/balsa-app.c b/src/balsa-app.c
index 50dcabb..0ae9396 100644
--- a/src/balsa-app.c
+++ b/src/balsa-app.c
@@ -361,14 +361,6 @@ balsa_app_init(void)
balsa_app.mblist_newmsg_width = NEWMSGCOUNT_DEFAULT_WIDTH;
balsa_app.mblist_totalmsg_width = TOTALMSGCOUNT_DEFAULT_WIDTH;
- /* Allocate the best colormap we can get */
- balsa_app.visual = gdk_visual_get_best();
- if (!(balsa_app.colormap = gdk_colormap_new(balsa_app.visual, TRUE))) {
- balsa_app.visual = gdk_visual_get_system();
- balsa_app.colormap = gdk_colormap_get_system();
- }
- g_assert(balsa_app.colormap);
-
/* arp */
balsa_app.quote_str = NULL;
@@ -473,7 +465,6 @@ balsa_app_destroy(void)
balsa_app.identities = NULL;
- g_object_unref(balsa_app.colormap);
if(balsa_app.debug) g_print("balsa_app: Finished cleaning up.\n");
}
diff --git a/src/balsa-app.h b/src/balsa-app.h
index 2a95e81..1430692 100644
--- a/src/balsa-app.h
+++ b/src/balsa-app.h
@@ -265,10 +265,6 @@ extern struct BalsaApplication {
gint mblist_newmsg_width;
gint mblist_totalmsg_width;
- /* Colour of mailboxes with unread messages in mailbox list */
- GdkVisual *visual;
- GdkColormap *colormap;
-
/* Colour of quoted text. */
gboolean mark_quoted;
gchar *quote_regex;
diff --git a/src/balsa-cite-bar.c b/src/balsa-cite-bar.c
index 35476e9..a0e0050 100644
--- a/src/balsa-cite-bar.c
+++ b/src/balsa-cite-bar.c
@@ -37,10 +37,14 @@ struct _BalsaCiteBarClass {
GtkWidgetClass parent_class;
};
-static void balsa_cite_bar_size_request(GtkWidget * widget,
- GtkRequisition * requisition);
-static gboolean balsa_cite_bar_expose (GtkWidget * widget,
- GdkEventExpose * event);
+static void balsa_cite_bar_get_preferred_width (GtkWidget * widget,
+ gint * minimum_width,
+ gint * natural_width);
+static void balsa_cite_bar_get_preferred_height(GtkWidget * widget,
+ gint * minimum_height,
+ gint * natural_height);
+static gboolean balsa_cite_bar_draw (GtkWidget * widget,
+ cairo_t * cr);
G_DEFINE_TYPE(BalsaCiteBar, balsa_cite_bar, GTK_TYPE_WIDGET)
@@ -55,18 +59,15 @@ balsa_cite_bar_class_init(BalsaCiteBarClass * class)
parent_class = g_type_class_peek_parent(class);
- widget_class->expose_event = balsa_cite_bar_expose;
- widget_class->size_request = balsa_cite_bar_size_request;
+ widget_class->get_preferred_width = balsa_cite_bar_get_preferred_width;
+ widget_class->get_preferred_height = balsa_cite_bar_get_preferred_height;
+ widget_class->draw = balsa_cite_bar_draw;
}
static void
balsa_cite_bar_init(BalsaCiteBar * cite_bar)
{
-#if GTK_CHECK_VERSION(2, 18, 0)
gtk_widget_set_has_window(GTK_WIDGET(cite_bar), FALSE);
-#else /* GTK_CHECK_VERSION(2, 18, 0) */
- GTK_WIDGET_SET_FLAGS(GTK_WIDGET(cite_bar), GTK_NO_WINDOW);
-#endif /* GTK_CHECK_VERSION(2, 18, 0) */
}
GtkWidget *
@@ -101,42 +102,44 @@ balsa_cite_bar_resize(BalsaCiteBar * cite_bar, gint height)
}
static void
-balsa_cite_bar_size_request(GtkWidget * widget,
- GtkRequisition * requisition)
+balsa_cite_bar_get_preferred_width(GtkWidget * widget,
+ gint * minimum_width,
+ gint * natural_width)
{
- BalsaCiteBar *cite_bar = BALSA_CITE_BAR(widget);
+ BalsaCiteBar *cite_bar;
- requisition->width =
+ cite_bar = BALSA_CITE_BAR(widget);
+ *minimum_width = *natural_width =
cite_bar->bars * (cite_bar->width + cite_bar->space) -
cite_bar->space;
- requisition->height = cite_bar->height;
+}
+
+static void
+balsa_cite_bar_get_preferred_height(GtkWidget * widget,
+ gint * minimum_height,
+ gint * natural_height)
+{
+ BalsaCiteBar *cite_bar;
+
+ cite_bar = BALSA_CITE_BAR(widget);
+ *minimum_height = *natural_height = cite_bar->height;
}
static gboolean
-balsa_cite_bar_expose(GtkWidget * widget, GdkEventExpose * event)
+balsa_cite_bar_draw(GtkWidget * widget, cairo_t * cr)
{
- if (!event->count) {
- BalsaCiteBar *cite_bar = BALSA_CITE_BAR(widget);
- GdkWindow *window = gtk_widget_get_window(widget);
- cairo_t *cr = gdk_cairo_create(window);
- GtkStyle *style = gtk_widget_get_style(widget);
- GtkAllocation allocation;
- int n;
-
-#if GTK_CHECK_VERSION(2, 18, 0)
- gtk_widget_get_allocation(widget, &allocation);
-#else /* GTK_CHECK_VERSION(2, 18, 0) */
- allocation.x = widget->allocation.x;
- allocation.y = widget->allocation.y;
-#endif /* GTK_CHECK_VERSION(2, 18, 0) */
- gdk_cairo_set_source_color(cr, &style->fg[GTK_STATE_NORMAL]);
- for (n = 0; n < cite_bar->bars; n++) {
- cairo_rectangle(cr, allocation.x, allocation.y,
- cite_bar->width, cite_bar->height);
- cairo_fill(cr);
- allocation.x += cite_bar->width + cite_bar->space;
- }
- cairo_destroy(cr);
+ GtkStyle *style;
+ BalsaCiteBar *cite_bar;
+ int n, x;
+
+ style = gtk_widget_get_style(widget);
+ gdk_cairo_set_source_color(cr, &style->fg[GTK_STATE_NORMAL]);
+
+ cite_bar = BALSA_CITE_BAR(widget);
+ for (n = x = 0; n < cite_bar->bars; n++) {
+ cairo_rectangle(cr, x, 0, cite_bar->width, cite_bar->height);
+ cairo_fill(cr);
+ x += cite_bar->width + cite_bar->space;
}
return FALSE;
diff --git a/src/balsa-index.c b/src/balsa-index.c
index efb8ef1..0618d2c 100644
--- a/src/balsa-index.c
+++ b/src/balsa-index.c
@@ -64,7 +64,7 @@
/* gtk widget */
static void bndx_class_init(BalsaIndexClass * klass);
static void bndx_instance_init(BalsaIndex * index);
-static void bndx_destroy(GtkObject * obj);
+static void bndx_destroy(GObject * obj);
static gboolean bndx_popup_menu(GtkWidget * widget);
/* statics */
@@ -177,10 +177,10 @@ balsa_index_get_type(void)
static void
bndx_class_init(BalsaIndexClass * klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
GtkWidgetClass *widget_class;
- object_class = (GtkObjectClass *) klass;
+ object_class = (GObjectClass *) klass;
widget_class = (GtkWidgetClass *) klass;
parent_class = g_type_class_peek_parent(klass);
@@ -195,7 +195,7 @@ bndx_class_init(BalsaIndexClass * klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- object_class->destroy = bndx_destroy;
+ object_class->dispose = bndx_destroy;
widget_class->popup_menu = bndx_popup_menu;
klass->index_changed = NULL;
}
@@ -210,7 +210,7 @@ bndx_mbnode_weak_notify(gpointer data, GObject *where_the_object_was)
}
static void
-bndx_destroy(GtkObject * obj)
+bndx_destroy(GObject * obj)
{
BalsaIndex *index;
@@ -250,8 +250,8 @@ bndx_destroy(GtkObject * obj)
g_free(index->filter_string); index->filter_string = NULL;
- if (GTK_OBJECT_CLASS(parent_class)->destroy)
- (*GTK_OBJECT_CLASS(parent_class)->destroy) (obj);
+ if (G_OBJECT_CLASS(parent_class)->dispose)
+ (*G_OBJECT_CLASS(parent_class)->dispose) (obj);
}
/* Widget class popup menu method. */
@@ -1978,7 +1978,7 @@ bndx_popup_position_func(GtkMenu * menu, gint * x, gint * y,
gdk_window_get_origin(gtk_tree_view_get_bin_window
(GTK_TREE_VIEW(bindex)), x, y);
- gtk_widget_size_request(GTK_WIDGET(menu), &req);
+ gtk_widget_get_preferred_size(GTK_WIDGET(menu), NULL, &req);
#if GTK_CHECK_VERSION(2, 18, 0)
gtk_widget_get_allocation(bindex, &allocation);
@@ -2657,7 +2657,8 @@ bndx_pipe_response(GtkWidget * dialog, gint response,
GList *active_cmd;
pipe_cmd =
- gtk_combo_box_get_active_text(GTK_COMBO_BOX(info->entry));
+ gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT
+ (info->entry));
active_cmd =
g_list_find_custom(balsa_app.pipe_cmds, pipe_cmd,
(GCompareFunc) strcmp);
@@ -2734,9 +2735,10 @@ balsa_index_pipe(BalsaIndex * index)
gtk_container_add(GTK_CONTAINER(vbox), label =
gtk_label_new(_("Specify the program to run:")));
- info->entry = entry = gtk_combo_box_entry_new_text();
+ info->entry = entry = gtk_combo_box_text_new_with_entry();
for (list = balsa_app.pipe_cmds; list; list = list->next)
- gtk_combo_box_append_text(GTK_COMBO_BOX(entry), list->data);
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(entry),
+ list->data);
gtk_combo_box_set_active(GTK_COMBO_BOX(entry), 0);
gtk_container_add(GTK_CONTAINER(vbox), entry);
diff --git a/src/balsa-mblist.c b/src/balsa-mblist.c
index 37c682c..541eedc 100644
--- a/src/balsa-mblist.c
+++ b/src/balsa-mblist.c
@@ -174,14 +174,12 @@ balsa_mblist_get_type(void)
static void
bmbl_class_init(BalsaMBListClass * klass)
{
- GObjectClass *o_class;
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
GtkWidgetClass *widget_class;
parent_class = g_type_class_peek_parent(klass);
- o_class = (GObjectClass *) klass;
- object_class = (GtkObjectClass *) klass;
+ object_class = (GObjectClass *) klass;
widget_class = (GtkWidgetClass *) klass;
/* HAS_UNREAD_MAILBOX is emitted when the number of mailboxes with
@@ -197,8 +195,8 @@ bmbl_class_init(BalsaMBListClass * klass)
1, G_TYPE_INT);
/* GObject signals */
- o_class->set_property = bmbl_set_property;
- o_class->get_property = bmbl_get_property;
+ object_class->set_property = bmbl_set_property;
+ object_class->get_property = bmbl_get_property;
/* GtkWidget signals */
widget_class->drag_motion = bmbl_drag_motion;
@@ -208,7 +206,7 @@ bmbl_class_init(BalsaMBListClass * klass)
klass->has_unread_mailbox = NULL;
/* Properties */
- g_object_class_install_property(o_class, PROP_SHOW_CONTENT_INFO,
+ g_object_class_install_property(object_class, PROP_SHOW_CONTENT_INFO,
g_param_spec_boolean
("show_content_info", NULL, NULL,
FALSE, G_PARAM_READWRITE));
@@ -1871,7 +1869,7 @@ bmbl_mru_show_tree(GtkWidget * widget, gpointer data)
G_CALLBACK(bmbl_mru_activated_cb), data);
/* Force the mailbox list to be a reasonable size. */
- gtk_widget_size_request(mblist, &req);
+ gtk_widget_get_preferred_size(mblist, NULL, &req);
if (req.height > balsa_app.mw_height)
req.height = balsa_app.mw_height;
/* For the mailbox list width, we use the one used on the main
@@ -1879,7 +1877,7 @@ bmbl_mru_show_tree(GtkWidget * widget, gpointer data)
* because the mblist widget saves the size in
* balsa_app.mblist_width */
req.width = balsa_app.mblist_width> 200 ? balsa_app.mblist_width : 200;
- gtk_widget_set_size_request(GTK_WIDGET(mblist), req.width, req.height);
+ if (FALSE) gtk_widget_set_size_request(GTK_WIDGET(mblist), req.width, req.height);
gtk_container_add(GTK_CONTAINER(scroll), mblist);
gtk_container_add(GTK_CONTAINER
diff --git a/src/balsa-message.c b/src/balsa-message.c
index d4ce194..71bedb8 100644
--- a/src/balsa-message.c
+++ b/src/balsa-message.c
@@ -59,23 +59,12 @@
# include "gmime-part-rfc2440.h"
#endif
-#if HAVE_GTKSOURCEVIEW
-/* Use GtkSourceIter's case-insensitive search functions. */
-# include <gtksourceview/gtksourceiter.h>
-# define FORWARD_SEARCH(iter, text, match_begin, match_end) \
- gtk_source_iter_forward_search((iter), (text), \
- GTK_SOURCE_SEARCH_CASE_INSENSITIVE, (match_begin), (match_end), NULL)
-# define BACKWARD_SEARCH(iter, text, match_begin, match_end) \
- gtk_source_iter_backward_search((iter), (text), \
- GTK_SOURCE_SEARCH_CASE_INSENSITIVE, (match_begin), (match_end), NULL)
-#else /* HAVE_GTKSOURCEVIEW */
# define FORWARD_SEARCH(iter, text, match_begin, match_end) \
gtk_text_iter_forward_search((iter), (text), \
- 0, (match_begin), (match_end), NULL)
+ GTK_TEXT_SEARCH_CASE_INSENSITIVE, (match_begin), (match_end), NULL)
# define BACKWARD_SEARCH(iter, text, match_begin, match_end) \
gtk_text_iter_backward_search((iter), (text), \
- 0, (match_begin), (match_end), NULL)
-#endif /* HAVE_GTKSOURCEVIEW */
+ GTK_TEXT_SEARCH_CASE_INSENSITIVE, (match_begin), (match_end), NULL)
enum {
SELECT_PART,
@@ -126,7 +115,7 @@ static gint balsa_message_signals[LAST_SIGNAL];
static void balsa_message_class_init(BalsaMessageClass * klass);
static void balsa_message_init(BalsaMessage * bm);
-static void balsa_message_destroy(GtkObject * object);
+static void balsa_message_destroy(GObject * object);
static void display_headers(BalsaMessage * bm);
static void display_content(BalsaMessage * bm);
@@ -239,9 +228,9 @@ balsa_message_get_type()
static void
balsa_message_class_init(BalsaMessageClass * klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
- object_class = GTK_OBJECT_CLASS(klass);
+ object_class = G_OBJECT_CLASS(klass);
balsa_message_signals[SELECT_PART] =
g_signal_new("select-part",
@@ -252,7 +241,7 @@ balsa_message_class_init(BalsaMessageClass * klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- object_class->destroy = balsa_message_destroy;
+ object_class->dispose = balsa_message_destroy;
parent_class = g_type_class_peek_parent(klass);
@@ -429,17 +418,16 @@ bm_find_scroll_to_rectangle(BalsaMessage * bm,
GdkRectangle * rectangle)
{
gint x, y;
- GtkAdjustment *adj;
+ GtkAdjustment *hadj, *vadj;
gtk_widget_translate_coordinates(widget, bm->bm_widget->widget,
rectangle->x, rectangle->y,
&x, &y);
- adj = gtk_viewport_get_hadjustment(GTK_VIEWPORT(bm->cont_viewport));
- gtk_adjustment_clamp_page(adj, x, x + rectangle->width);
-
- adj = gtk_viewport_get_vadjustment(GTK_VIEWPORT(bm->cont_viewport));
- gtk_adjustment_clamp_page(adj, y, y + rectangle->height);
+ g_object_get(G_OBJECT(bm->cont_viewport), "hadjustment", &hadj,
+ "vadjustment", &vadj, NULL);
+ gtk_adjustment_clamp_page(hadj, x, x + rectangle->width);
+ gtk_adjustment_clamp_page(vadj, y, y + rectangle->height);
}
static void
@@ -649,12 +637,12 @@ bm_find_pass_to_entry(BalsaMessage * bm, GdkEventKey * event)
gboolean res = TRUE;
switch (event->keyval) {
- case GDK_Escape:
- case GDK_Return:
- case GDK_KP_Enter:
+ case GDK_KEY_Escape:
+ case GDK_KEY_Return:
+ case GDK_KEY_KP_Enter:
bm_disable_find_entry(bm);
return res;
- case GDK_g:
+ case GDK_KEY_g:
#if GTK_CHECK_VERSION(2, 18, 0)
if ((event->state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK)) ==
GDK_CONTROL_MASK && gtk_widget_get_sensitive(bm->find_next)) {
@@ -825,7 +813,7 @@ balsa_message_init(BalsaMessage * bm)
}
static void
-balsa_message_destroy(GtkObject * object)
+balsa_message_destroy(GObject * object)
{
BalsaMessage* bm = BALSA_MESSAGE(object);
@@ -848,8 +836,8 @@ balsa_message_destroy(GtkObject * object)
bm->parts_popup = NULL;
}
- if (GTK_OBJECT_CLASS(parent_class)->destroy)
- (*GTK_OBJECT_CLASS(parent_class)->destroy) (GTK_OBJECT(object));
+ if (G_OBJECT_CLASS(parent_class)->dispose)
+ (*G_OBJECT_CLASS(parent_class)->dispose) (object);
}
GtkWidget *
@@ -2276,7 +2264,7 @@ static void
select_part(BalsaMessage * bm, BalsaPartInfo *info)
{
LibBalsaMessageBody *body;
- GtkViewport *viewport = GTK_VIEWPORT(bm->cont_viewport);
+ GtkAdjustment *hadj, *vadj;
hide_all_parts(bm);
@@ -2288,8 +2276,10 @@ select_part(BalsaMessage * bm, BalsaPartInfo *info)
g_signal_emit(G_OBJECT(bm), balsa_message_signals[SELECT_PART], 0);
- gtk_adjustment_set_value(gtk_viewport_get_hadjustment(viewport), 0);
- gtk_adjustment_set_value(gtk_viewport_get_vadjustment(viewport), 0);
+ g_object_get(G_OBJECT(bm->cont_viewport), "hadjustment", &hadj,
+ "vadjustment", &vadj, NULL);
+ gtk_adjustment_set_value(hadj, 0);
+ gtk_adjustment_set_value(vadj, 0);
}
GtkWidget *
diff --git a/src/balsa-mime-widget-callbacks.c b/src/balsa-mime-widget-callbacks.c
index 47438eb..37defb6 100644
--- a/src/balsa-mime-widget-callbacks.c
+++ b/src/balsa-mime-widget-callbacks.c
@@ -198,43 +198,41 @@ gint
balsa_mime_widget_key_press_event(GtkWidget * widget, GdkEventKey * event,
BalsaMessage * bm)
{
- GtkViewport *viewport;
GtkAdjustment *adj;
int page_adjust;
- viewport = GTK_VIEWPORT(bm->cont_viewport);
- adj = gtk_viewport_get_vadjustment(viewport);
+ g_object_get(G_OBJECT(bm->cont_viewport), "vadjustment", &adj, NULL);
page_adjust = balsa_app.pgdownmod ?
(gtk_adjustment_get_page_size(adj) * balsa_app.pgdown_percent) /
100 : gtk_adjustment_get_page_increment(adj);
switch (event->keyval) {
- case GDK_Up:
+ case GDK_KEY_Up:
scroll_change(adj, -gtk_adjustment_get_step_increment(adj), NULL);
break;
- case GDK_Down:
+ case GDK_KEY_Down:
scroll_change(adj, gtk_adjustment_get_step_increment(adj), NULL);
break;
- case GDK_Page_Up:
+ case GDK_KEY_Page_Up:
scroll_change(adj, -page_adjust, NULL);
break;
- case GDK_Page_Down:
+ case GDK_KEY_Page_Down:
scroll_change(adj, page_adjust, NULL);
break;
- case GDK_Home:
+ case GDK_KEY_Home:
if (event->state & GDK_CONTROL_MASK)
scroll_change(adj, -gtk_adjustment_get_value(adj), NULL);
else
return FALSE;
break;
- case GDK_End:
+ case GDK_KEY_End:
if (event->state & GDK_CONTROL_MASK)
scroll_change(adj, gtk_adjustment_get_upper(adj), NULL);
else
return FALSE;
break;
- case GDK_F10:
+ case GDK_KEY_F10:
if (event->state & GDK_SHIFT_MASK) {
GtkWidget *current_widget = balsa_message_current_part_widget(bm);
@@ -249,7 +247,7 @@ balsa_mime_widget_key_press_event(GtkWidget * widget, GdkEventKey * event,
} else
return FALSE;
break;
- case GDK_space:
+ case GDK_KEY_space:
scroll_change(adj, page_adjust, bm);
break;
diff --git a/src/balsa-mime-widget-crypto.c b/src/balsa-mime-widget-crypto.c
index 8d2aa34..7b54183 100644
--- a/src/balsa-mime-widget-crypto.c
+++ b/src/balsa-mime-widget-crypto.c
@@ -104,6 +104,8 @@ balsa_mime_widget_signature_widget(LibBalsaMessageBody * mime_body,
}
#endif /* HAVE_GPG */
+ gtk_widget_show_all(vbox);
+
return vbox;
}
@@ -134,10 +136,15 @@ balsa_mime_widget_crypto_frame(LibBalsaMessageBody * mime_body, GtkWidget * chil
FALSE, FALSE, 0);
gtk_frame_set_label_widget(GTK_FRAME(frame), icon_box);
gtk_container_set_border_width(GTK_CONTAINER(vbox), BMW_MESSAGE_PADDING);
+ gtk_widget_show_all(frame);
+
gtk_box_pack_start(GTK_BOX(vbox), child, FALSE, FALSE, 0);
+ gtk_widget_show(child);
- if (signature)
+ if (signature) {
gtk_box_pack_end(GTK_BOX(vbox), signature, FALSE, FALSE, 0);
+ gtk_widget_show(signature);
+ }
return frame;
}
diff --git a/src/balsa-mime-widget-image.c b/src/balsa-mime-widget-image.c
index 7e2dea3..088c3f8 100644
--- a/src/balsa-mime-widget-image.c
+++ b/src/balsa-mime-widget-image.c
@@ -74,6 +74,8 @@ balsa_mime_widget_new_image(BalsaMessage * bm, LibBalsaMessageBody * mime_body,
g_signal_connect(G_OBJECT(mw->widget), "button-press-event",
G_CALLBACK(balsa_image_button_press_cb), data);
+ gtk_widget_show(image);
+
return mw;
}
@@ -119,9 +121,7 @@ img_check_size(GtkImage ** widget_p)
gint orig_width;
LibBalsaMessageBody * mime_body;
gint curr_w, dst_w;
-#if GTK_CHECK_VERSION(2, 18, 0)
GtkAllocation allocation;
-#endif /* GTK_CHECK_VERSION(2, 18, 0) */
gdk_threads_enter();
@@ -147,7 +147,6 @@ img_check_size(GtkImage ** widget_p)
curr_w = gdk_pixbuf_get_width(gtk_image_get_pixbuf(widget));
else
curr_w = 0;
-#if GTK_CHECK_VERSION(2, 18, 0)
gtk_widget_get_allocation(viewport, &allocation);
dst_w = allocation.width;
gtk_widget_get_allocation(gtk_bin_get_child(GTK_BIN(viewport)),
@@ -156,12 +155,7 @@ img_check_size(GtkImage ** widget_p)
gtk_widget_get_allocation(gtk_widget_get_parent(GTK_WIDGET(widget)),
&allocation);
dst_w += allocation.width;
- dst_w -= 4;
-#else /* GTK_CHECK_VERSION(2, 18, 0) */
- dst_w = viewport->allocation.width -
- (gtk_bin_get_child(GTK_BIN(viewport))->allocation.width -
- GTK_WIDGET(widget)->parent->allocation.width) - 4;
-#endif /* GTK_CHECK_VERSION(2, 18, 0) */
+ dst_w -= 16; /* Magic number? */
if (dst_w < 32)
dst_w = 32;
if (dst_w > orig_width)
@@ -189,7 +183,6 @@ img_check_size(GtkImage ** widget_p)
g_object_unref(pixbuf);
gtk_image_set_from_pixbuf(widget, scaled_pixbuf);
g_object_unref(scaled_pixbuf);
-
}
gdk_threads_leave();
diff --git a/src/balsa-mime-widget-text.c b/src/balsa-mime-widget-text.c
index ee54ce3..fe28abd 100644
--- a/src/balsa-mime-widget-text.c
+++ b/src/balsa-mime-widget-text.c
@@ -419,15 +419,9 @@ fix_text_widget(GtkWidget *widget, gpointer data)
static void
gtk_widget_destroy_insensitive(GtkWidget * widget)
{
-#if GTK_CHECK_VERSION(2, 18, 0)
if (!gtk_widget_get_sensitive(widget) ||
GTK_IS_SEPARATOR_MENU_ITEM(widget))
gtk_widget_destroy(widget);
-#else /* GTK_CHECK_VERSION(2, 18, 0) */
- if (!GTK_WIDGET_SENSITIVE(widget) ||
- GTK_IS_SEPARATOR_MENU_ITEM(widget))
- gtk_widget_destroy(widget);
-#endif /* GTK_CHECK_VERSION(2, 18, 0) */
}
static void
@@ -539,7 +533,9 @@ text_view_populate_popup(GtkTextView *textview, GtkMenu *menu,
GtkWidget *menu_item;
gint phrase_hl;
- gtk_widget_hide_all(GTK_WIDGET(menu));
+ gtk_widget_hide(GTK_WIDGET(menu));
+ gtk_container_foreach(GTK_CONTAINER(menu),
+ (GtkCallback) gtk_widget_hide, NULL);
if (text_view_url_popup(textview, menu))
return;
@@ -1099,7 +1095,7 @@ bmwt_populate_popup_cb(GtkWidget * widget, GtkMenu * menu, gpointer data)
gtk_widget_show_all(GTK_WIDGET(menu));
}
-BalsaMimeWidget *
+static BalsaMimeWidget *
bm_widget_new_html(BalsaMessage * bm, LibBalsaMessageBody * mime_body)
{
BalsaMimeWidget *mw = g_object_new(BALSA_TYPE_MIME_WIDGET, NULL);
@@ -1372,7 +1368,7 @@ fill_text_buf_cited(GtkWidget *widget, const gchar *text_body,
g_object_set_data_full(G_OBJECT(widget), "cite-bars", cite_bars_list,
(GDestroyNotify) destroy_cite_bars);
g_object_set_data(G_OBJECT(widget), "cite-margin", GINT_TO_POINTER(margin));
- g_signal_connect_after(G_OBJECT(widget), "expose-event",
+ g_signal_connect_after(G_OBJECT(widget), "draw",
G_CALLBACK(draw_cite_bars), cite_bars_list);
}
diff --git a/src/balsa-mime-widget.c b/src/balsa-mime-widget.c
index 5f20b95..96f6e39 100644
--- a/src/balsa-mime-widget.c
+++ b/src/balsa-mime-widget.c
@@ -178,16 +178,20 @@ balsa_mime_widget_new(BalsaMessage * bm, LibBalsaMessageBody * mime_body, gpoint
#endif
g_object_ref_sink(mw->widget);
- if (GTK_IS_LAYOUT(mw->widget))
- g_signal_connect(G_OBJECT(gtk_layout_get_vadjustment(GTK_LAYOUT(mw->widget))),
- "changed",
+ if (GTK_IS_LAYOUT(mw->widget)) {
+ GtkAdjustment *vadj;
+
+ g_object_get(G_OBJECT(mw->widget), "vadjustment", &vadj,
+ NULL);
+ g_signal_connect(vadj, "changed",
G_CALLBACK(vadj_change_cb), mw->widget);
+ }
+
+ gtk_widget_show(mw->widget);
}
}
g_free(content_type);
- gtk_widget_show_all(mw->widget);
-
return mw;
}
@@ -303,6 +307,8 @@ balsa_mime_widget_new_unknown(BalsaMessage * bm,
gtk_box_pack_start(GTK_BOX(mw->widget), hbox, FALSE, FALSE, 0);
+ gtk_widget_show_all(mw->widget);
+
return mw;
}
diff --git a/src/filter-edit-callbacks.c b/src/filter-edit-callbacks.c
index b64c522..983740b 100644
--- a/src/filter-edit-callbacks.c
+++ b/src/filter-edit-callbacks.c
@@ -478,14 +478,15 @@ fe_user_header_add(const gchar * user_header)
/* First clear the combo box... */
for (lst = fe_user_headers_list; lst; lst = lst->next)
- gtk_combo_box_remove_text(GTK_COMBO_BOX(fe_user_header), 0);
+ gtk_combo_box_text_remove(GTK_COMBO_BOX_TEXT(fe_user_header),
+ 0);
fe_add_new_user_header(user_header);
/* ...then remake it with the new string... */
for (lst = fe_user_headers_list; lst; lst = lst->next)
- gtk_combo_box_append_text(GTK_COMBO_BOX(fe_user_header),
- lst->data);
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT
+ (fe_user_header), lst->data);
fe_user_header_set_active(user_header);
}
@@ -961,10 +962,10 @@ get_field_frame(void)
g_signal_connect(G_OBJECT(fe_matching_fields_us_head), "toggled",
G_CALLBACK(fe_match_field_user_header_cb), NULL);
- fe_user_header = gtk_combo_box_entry_new_text();
+ fe_user_header = gtk_combo_box_text_new_with_entry();
for (list = fe_user_headers_list; list; list = list->next)
- gtk_combo_box_append_text(GTK_COMBO_BOX(fe_user_header),
- list->data);
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(fe_user_header),
+ list->data);
g_signal_connect(G_OBJECT(fe_user_header), "changed",
G_CALLBACK(fe_condition_changed_cb), NULL);
gtk_table_attach(GTK_TABLE(table),
diff --git a/src/filter-edit-dialog.c b/src/filter-edit-dialog.c
index 24e8433..0ee9d16 100644
--- a/src/filter-edit-dialog.c
+++ b/src/filter-edit-dialog.c
@@ -154,13 +154,13 @@ fe_build_option_menu(option_list options[], gint num, GCallback func,
if (num < 1)
return (NULL);
- combo_box = gtk_combo_box_new_text();
+ combo_box = gtk_combo_box_text_new();
info = g_new(struct fe_combo_box_info, 1);
info->values = NULL;
for (i = 0; i < num; i++) {
- gtk_combo_box_append_text(GTK_COMBO_BOX(combo_box),
- _(options[i].text));
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo_box),
+ _(options[i].text));
info->values =
g_slist_append(info->values, GINT_TO_POINTER(options[i].value));
}
diff --git a/src/folder-conf.c b/src/folder-conf.c
index 6de6307..93046d8 100644
--- a/src/folder-conf.c
+++ b/src/folder-conf.c
@@ -586,7 +586,7 @@ browse_button_cb(GtkWidget * widget, SubfolderDialogData * sdd)
G_CALLBACK(browse_button_row_activated), bbd);
/* Force the mailbox list to be a reasonable size. */
- gtk_widget_size_request(tree_view, &req);
+ gtk_widget_get_preferred_size(tree_view, NULL, &req);
/* don't mess with the width, it gets saved! */
if (req.height > balsa_app.mw_height)
req.height = balsa_app.mw_height;
diff --git a/src/mailbox-conf.c b/src/mailbox-conf.c
index 9b4db59..68fdf41 100644
--- a/src/mailbox-conf.c
+++ b/src/mailbox-conf.c
@@ -156,7 +156,7 @@ mailbox_conf_combo_box_info_free(struct mailbox_conf_combo_box_info *info)
}
static void
-mailbox_conf_combo_box_make(GtkComboBox * combo_box, unsigned cnt,
+mailbox_conf_combo_box_make(GtkComboBoxText * combo_box, unsigned cnt,
const struct menu_data *data)
{
struct mailbox_conf_combo_box_info *info =
@@ -165,7 +165,7 @@ mailbox_conf_combo_box_make(GtkComboBox * combo_box, unsigned cnt,
info->tags = NULL;
for (i = cnt; --i >= 0;) {
- gtk_combo_box_prepend_text(combo_box, _(data[i].label));
+ gtk_combo_box_text_prepend_text(combo_box, _(data[i].label));
info->tags =
g_slist_prepend(info->tags, GINT_TO_POINTER(data[i].tag));
}
@@ -236,8 +236,8 @@ balsa_server_conf_get_advanced_widget(BalsaServerConf *bsc, LibBalsaServer *s,
label = libbalsa_create_label(_("Use _TLS:"), GTK_WIDGET(bsc->table), 1);
- bsc->tls_option = gtk_combo_box_new_text();
- mailbox_conf_combo_box_make(GTK_COMBO_BOX(bsc->tls_option),
+ bsc->tls_option = gtk_combo_box_text_new();
+ mailbox_conf_combo_box_make(GTK_COMBO_BOX_TEXT(bsc->tls_option),
ELEMENTS(tls_menu), tls_menu);
gtk_combo_box_set_active(GTK_COMBO_BOX(bsc->tls_option),
s ? s->tls_mode : LIBBALSA_TLS_ENABLED);
@@ -1462,7 +1462,7 @@ mailbox_conf_view_new_full(LibBalsaMailbox * mailbox,
if (size_group)
gtk_size_group_add_widget(size_group, label);
- view_info->identity_combo_box = widget = gtk_combo_box_new_text();
+ view_info->identity_combo_box = widget = gtk_combo_box_text_new();
if (mcw)
g_signal_connect(view_info->identity_combo_box, "changed",
G_CALLBACK(check_for_blank_fields), mcw);
@@ -1474,7 +1474,7 @@ mailbox_conf_view_new_full(LibBalsaMailbox * mailbox,
gchar *name;
name = internet_address_to_string(ident->ia, FALSE);
- gtk_combo_box_append_text(GTK_COMBO_BOX(widget), name);
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widget), name);
g_free(name);
if (identity_name
&& strcmp(identity_name, ident->identity_name) == 0)
@@ -1501,9 +1501,9 @@ mailbox_conf_view_new_full(LibBalsaMailbox * mailbox,
if (size_group)
gtk_size_group_add_widget(size_group, label);
- view_info->chk_crypt = gtk_combo_box_new_text();
+ view_info->chk_crypt = gtk_combo_box_text_new();
gtk_label_set_mnemonic_widget(GTK_LABEL(label), view_info->chk_crypt);
- mailbox_conf_combo_box_make(GTK_COMBO_BOX(view_info->chk_crypt),
+ mailbox_conf_combo_box_make(GTK_COMBO_BOX_TEXT(view_info->chk_crypt),
ELEMENTS(chk_crypt_menu),
chk_crypt_menu);
gtk_combo_box_set_active(GTK_COMBO_BOX(view_info->chk_crypt),
diff --git a/src/mailbox-node.c b/src/mailbox-node.c
index 9178e66..eb1c7c4 100644
--- a/src/mailbox-node.c
+++ b/src/mailbox-node.c
@@ -1040,7 +1040,7 @@ balsa_mailbox_node_get_context_menu(BalsaMailboxNode * mbnode)
menu = gtk_menu_new();
/* it's a single-use menu, so we must destroy it when we're done */
g_signal_connect(G_OBJECT(menu), "selection-done",
- G_CALLBACK(gtk_object_destroy), NULL);
+ G_CALLBACK(gtk_widget_destroy), NULL);
submenu = gtk_menu_new();
add_menu_entry(submenu, _("Local _mbox mailbox..."),
diff --git a/src/main-window.c b/src/main-window.c
index 4406742..3f29d7d 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -68,10 +68,6 @@
#include "toolbar-prefs.h"
#include "toolbar-factory.h"
-#if HAVE_GNOME
-#include <gnome.h> /* for gnome_triggers_do() */
-#endif
-
#ifdef BALSA_USE_THREADS
#include "threads.h"
#endif
@@ -134,7 +130,7 @@ static void balsa_window_real_open_mbnode(BalsaWindow *window,
gboolean set_current);
static void balsa_window_real_close_mbnode(BalsaWindow *window,
BalsaMailboxNode *mbnode);
-static void balsa_window_destroy(GtkObject * object);
+static void balsa_window_destroy(GObject * object);
static gboolean bw_close_mailbox_on_timer(void);
@@ -950,7 +946,7 @@ static guint window_signals[LAST_SIGNAL] = { 0 };
static void
balsa_window_class_init(BalsaWindowClass * klass)
{
- GtkObjectClass *object_class = (GtkObjectClass *) klass;
+ GObjectClass *object_class = (GObjectClass *) klass;
gtk_rc_parse_string("style \"balsa-notebook-tab-button-style\"\n"
"{\n"
@@ -987,7 +983,7 @@ balsa_window_class_init(BalsaWindowClass * klass)
NULL, NULL,
g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
- object_class->destroy = balsa_window_destroy;
+ object_class->dispose = balsa_window_destroy;
klass->open_mbnode = balsa_window_real_open_mbnode;
klass->close_mbnode = balsa_window_real_close_mbnode;
@@ -1222,12 +1218,12 @@ bw_create_index_widget(BalsaWindow *bw)
bw->sos_bar = gtk_hbox_new(FALSE, 5);
- bw->filter_choice = gtk_combo_box_new_text();
+ bw->filter_choice = gtk_combo_box_text_new();
gtk_box_pack_start(GTK_BOX(bw->sos_bar), bw->filter_choice,
FALSE, FALSE, 0);
for(i=0; i<ELEMENTS(view_filters); i++)
- gtk_combo_box_insert_text(GTK_COMBO_BOX(bw->filter_choice),
- i, view_filters[i].str);
+ gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(bw->filter_choice),
+ i, view_filters[i].str);
gtk_combo_box_set_active(GTK_COMBO_BOX(bw->filter_choice), 0);
gtk_widget_show(bw->filter_choice);
bw->sos_entry = gtk_entry_new();
@@ -1604,7 +1600,8 @@ bw_window_state_event_cb(BalsaWindow * window,
balsa_app.mw_maximized =
event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED;
- gtk_statusbar_set_has_resize_grip(statusbar, !balsa_app.mw_maximized);
+ gtk_window_set_has_resize_grip(GTK_WINDOW(window),
+ !balsa_app.mw_maximized);
return FALSE;
}
@@ -1648,6 +1645,7 @@ balsa_window_new()
IgeMacMenuGroup *group;
#endif
guint i;
+ GtkAdjustment *hadj, *vadj;
/* Call to register custom balsa pixmaps with GNOME_STOCK_PIXMAPS
* - allows for grey out */
@@ -1761,11 +1759,11 @@ balsa_window_new()
/* XXX */
balsa_app.mblist = BALSA_MBLIST(balsa_mblist_new());
- window->mblist =
- gtk_scrolled_window_new(gtk_tree_view_get_hadjustment
- (GTK_TREE_VIEW(balsa_app.mblist)),
- gtk_tree_view_get_vadjustment
- (GTK_TREE_VIEW(balsa_app.mblist)));
+
+ g_object_get(G_OBJECT(balsa_app.mblist), "hadjustment", &hadj,
+ "vadjustment", &vadj, NULL);
+ window->mblist = gtk_scrolled_window_new(hadj, vadj);
+
gtk_container_add(GTK_CONTAINER(window->mblist),
GTK_WIDGET(balsa_app.mblist));
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(window->mblist),
@@ -2579,13 +2577,13 @@ bw_close_mailbox_on_timer(void)
}
static void
-balsa_window_destroy(GtkObject * object)
+balsa_window_destroy(GObject * object)
{
bw_idle_remove(BALSA_WINDOW(object));
- if (GTK_OBJECT_CLASS(balsa_window_parent_class)->destroy)
- GTK_OBJECT_CLASS(balsa_window_parent_class)->
- destroy(GTK_OBJECT(object));
+ if (G_OBJECT_CLASS(balsa_window_parent_class)->dispose)
+ G_OBJECT_CLASS(balsa_window_parent_class)->dispose(object);
+
balsa_unregister_pixmaps();
}
@@ -2677,21 +2675,6 @@ bw_contents_cb(void)
* show the about box for Balsa
*/
static void
-bw_show_about_box_url_hook(GtkAboutDialog * about, const gchar * link,
- gpointer data)
-{
- GError *err = NULL;
-
- gtk_show_uri(NULL, link, gtk_get_current_event_time(), &err);
-
- if (err) {
- balsa_information(LIBBALSA_INFORMATION_WARNING,
- _("Error showing %s: %s\n"), link, err->message);
- g_error_free(err);
- }
-}
-
-static void
bw_show_about_box(GtkAction * action, gpointer user_data)
{
const gchar *authors[] = {
@@ -2714,7 +2697,6 @@ bw_show_about_box(GtkAction * action, gpointer user_data)
gdk_pixbuf_new_from_file(BALSA_DATA_PREFIX
"/pixmaps/balsa_logo.png", NULL);
- gtk_about_dialog_set_url_hook(bw_show_about_box_url_hook, NULL, NULL);
gtk_show_about_dialog(GTK_WINDOW(user_data),
"version", BALSA_VERSION,
"copyright",
@@ -3345,11 +3327,13 @@ bw_display_new_mail_notification(int num_new, int has_new)
if (num_new <= 0 && has_new <= 0)
return;
+#if 0
#if HAVE_GNOME
if (balsa_app.notify_new_mail_sound)
gnome_triggers_do("New mail has arrived", "email",
"balsa", "newmail", NULL);
#endif
+#endif
if (!gtk_window_is_active(window))
gtk_window_set_urgency_hint(window, TRUE);
diff --git a/src/message-window.c b/src/message-window.c
index 199ee9b..651ecae 100644
--- a/src/message-window.c
+++ b/src/message-window.c
@@ -652,7 +652,7 @@ message_window_new(LibBalsaMailbox * mailbox, guint msgno)
close_widget =
gtk_ui_manager_get_widget(ui_manager, "/MainMenu/FileMenu/Close");
gtk_widget_add_accelerator(close_widget, "activate", accel_group,
- GDK_Escape, (GdkModifierType) 0,
+ GDK_KEY_Escape, (GdkModifierType) 0,
(GtkAccelFlags) 0);
}
diff --git a/src/pref-manager.c b/src/pref-manager.c
index bdd636a..1b76dc2 100644
--- a/src/pref-manager.c
+++ b/src/pref-manager.c
@@ -383,7 +383,7 @@ static void default_font_size_cb(GtkWidget * widget, GtkWidget * pbox);
static void pgdown_modified_cb(GtkWidget * widget, GtkWidget * pbox);
-static void option_menu_cb(GtkItem * menuitem, gpointer data);
+static void option_menu_cb(GtkMenuItem * menuitem, gpointer data);
static void imap_toggled_cb(GtkWidget * widget, GtkWidget * pbox);
static void convert_8bit_cb(GtkWidget * widget, GtkWidget * pbox);
@@ -1070,24 +1070,15 @@ apply_prefs(GtkDialog * pbox)
/* quoted text color */
for (i = 0; i < MAX_QUOTED_COLOR; i++) {
- gdk_colormap_free_colors(gdk_drawable_get_colormap
- (gtk_widget_get_window(GTK_WIDGET(pbox))),
- &balsa_app.quoted_color[i], 1);
gtk_color_button_get_color(GTK_COLOR_BUTTON(pui->quoted_color[i]),
&balsa_app.quoted_color[i]);
}
/* url color */
- gdk_colormap_free_colors(gdk_drawable_get_colormap
- (gtk_widget_get_window(GTK_WIDGET(pbox))),
- &balsa_app.url_color, 1);
gtk_color_button_get_color(GTK_COLOR_BUTTON(pui->url_color),
&balsa_app.url_color);
/* bad address color */
- gdk_colormap_free_colors(gdk_drawable_get_colormap
- (gtk_widget_get_window(GTK_WIDGET(pbox))),
- &balsa_app.bad_address_color, 1);
gtk_color_button_get_color(GTK_COLOR_BUTTON(pui->bad_address_color),
&balsa_app.bad_address_color);
@@ -1837,7 +1828,7 @@ checking_group(GtkWidget * page)
GtkWidget *group;
GtkWidget *table;
guint row;
- GtkObject *spinbutton_adj;
+ GtkAdjustment *spinbutton_adj;
GtkWidget *label;
GtkWidget *hbox;
@@ -1853,8 +1844,7 @@ checking_group(GtkWidget * page)
pm_page_add_to_size_group(page, pui->check_mail_auto);
spinbutton_adj = gtk_adjustment_new(10, 1, 100, 1, 10, 0);
- pui->check_mail_minutes =
- gtk_spin_button_new(GTK_ADJUSTMENT(spinbutton_adj), 1, 0);
+ pui->check_mail_minutes = gtk_spin_button_new(spinbutton_adj, 1, 0);
gtk_table_attach(GTK_TABLE(table), pui->check_mail_minutes,
1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, 0, 0, 0);
@@ -1928,7 +1918,7 @@ quoted_group(GtkWidget * page)
{
GtkWidget *group;
GtkWidget *table;
- GtkObject *spinbutton_adj;
+ GtkAdjustment *spinbutton_adj;
GtkWidget *label;
guint row = 0;
@@ -1960,8 +1950,7 @@ quoted_group(GtkWidget * page)
pm_page_add_to_size_group(page, pui->browse_wrap);
spinbutton_adj = gtk_adjustment_new(1.0, 40.0, 200.0, 1.0, 5.0, 0.0);
- pui->browse_wrap_length =
- gtk_spin_button_new(GTK_ADJUSTMENT(spinbutton_adj), 1, 0);
+ pui->browse_wrap_length = gtk_spin_button_new(spinbutton_adj, 1, 0);
gtk_table_attach(GTK_TABLE(table), pui->browse_wrap_length,
1, 2, row, row + 1,
GTK_EXPAND | GTK_FILL, 0, 0, 0);
@@ -2110,7 +2099,7 @@ word_wrap_group(GtkWidget * page)
{
GtkWidget *group;
GtkWidget *table;
- GtkObject *spinbutton_adj;
+ GtkAdjustment *spinbutton_adj;
GtkWidget *label;
group = pm_group_new(_("Word wrap"));
@@ -2124,10 +2113,8 @@ word_wrap_group(GtkWidget * page)
(GtkAttachOptions) (0), 0, 0);
pm_page_add_to_size_group(page, pui->wordwrap);
- spinbutton_adj =
- gtk_adjustment_new(1.0, 40.0, 998.0, 1.0, 5.0, 0.0);
- pui->wraplength =
- gtk_spin_button_new(GTK_ADJUSTMENT(spinbutton_adj), 1, 0);
+ spinbutton_adj = gtk_adjustment_new(1.0, 40.0, 998.0, 1.0, 5.0, 0.0);
+ pui->wraplength = gtk_spin_button_new(spinbutton_adj, 1, 0);
gtk_table_attach(GTK_TABLE(table), pui->wraplength, 1, 2, 0, 1,
GTK_EXPAND | GTK_FILL, (GtkAttachOptions) (0), 0, 0);
gtk_widget_set_sensitive(pui->wraplength, FALSE);
@@ -2216,7 +2203,7 @@ main_window_group(GtkWidget * page)
{
GtkWidget *group;
GtkWidget *table;
- GtkObject *scroll_adj;
+ GtkAdjustment *scroll_adj;
GtkWidget *label;
group = pm_group_new(_("Main window"));
@@ -2243,8 +2230,7 @@ main_window_group(GtkWidget * page)
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
scroll_adj = gtk_adjustment_new(50.0, 10.0, 100.0, 5.0, 10.0, 0.0);
- pui->pgdown_percent =
- gtk_spin_button_new(GTK_ADJUSTMENT(scroll_adj), 1, 0);
+ pui->pgdown_percent = gtk_spin_button_new(scroll_adj, 1, 0);
gtk_widget_set_sensitive(pui->pgdown_percent, FALSE);
gtk_table_attach(GTK_TABLE(table), pui->pgdown_percent, 1, 2, 0, 1,
GTK_EXPAND | GTK_FILL, (GtkAttachOptions) (0), 0, 0);
@@ -2627,7 +2613,7 @@ static GtkWidget *
pspell_settings_group(GtkWidget * page)
{
GtkWidget *group;
- GtkObject *ignore_adj;
+ GtkAdjustment *ignore_adj;
GtkWidget *table;
GtkWidget *hbox;
@@ -2650,8 +2636,7 @@ pspell_settings_group(GtkWidget * page)
/* do the ignore length */
attach_label(_("Ignore words shorter than"), table, 2, NULL);
ignore_adj = gtk_adjustment_new(0.0, 0.0, 99.0, 1.0, 5.0, 0.0);
- pui->ignore_length =
- gtk_spin_button_new(GTK_ADJUSTMENT(ignore_adj), 1, 0);
+ pui->ignore_length = gtk_spin_button_new(ignore_adj, 1, 0);
hbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox), pui->ignore_length, FALSE, FALSE, 0);
@@ -2692,7 +2677,7 @@ misc_group(GtkWidget * page)
GtkWidget *group;
GtkWidget *label;
GtkWidget *hbox;
- GtkObject *close_spinbutton_adj;
+ GtkAdjustment *close_spinbutton_adj;
group = pm_group_new(_("Miscellaneous"));
@@ -2711,7 +2696,7 @@ misc_group(GtkWidget * page)
close_spinbutton_adj = gtk_adjustment_new(10, 1, 100, 1, 10, 0);
pui->close_mailbox_minutes =
- gtk_spin_button_new(GTK_ADJUSTMENT(close_spinbutton_adj), 1, 0);
+ gtk_spin_button_new(close_spinbutton_adj, 1, 0);
gtk_widget_show(pui->close_mailbox_minutes);
gtk_widget_set_sensitive(pui->close_mailbox_minutes, FALSE);
gtk_box_pack_start(GTK_BOX(hbox), pui->close_mailbox_minutes,
@@ -2730,7 +2715,7 @@ deleting_messages_group(GtkWidget * page)
gchar *text;
GtkWidget *label;
GtkWidget *hbox;
- GtkObject *expunge_spinbutton_adj;
+ GtkAdjustment *expunge_spinbutton_adj;
group = pm_group_new(_("Deleting messages"));
@@ -2770,8 +2755,7 @@ deleting_messages_group(GtkWidget * page)
pm_page_add_to_size_group(page, pui->expunge_auto);
expunge_spinbutton_adj = gtk_adjustment_new(120, 1, 1440, 1, 10, 0);
- pui->expunge_minutes =
- gtk_spin_button_new(GTK_ADJUSTMENT(expunge_spinbutton_adj), 1, 0);
+ pui->expunge_minutes = gtk_spin_button_new(expunge_spinbutton_adj, 1, 0);
gtk_widget_show(pui->expunge_minutes);
gtk_widget_set_sensitive(pui->expunge_minutes, FALSE);
gtk_box_pack_start(GTK_BOX(hbox), pui->expunge_minutes,
@@ -2842,7 +2826,7 @@ folder_scanning_group(GtkWidget * page)
GtkWidget *group;
GtkWidget *label;
GtkWidget *hbox;
- GtkObject *scan_adj;
+ GtkAdjustment *scan_adj;
group = pm_group_new(_("Folder scanning"));
@@ -2863,8 +2847,7 @@ folder_scanning_group(GtkWidget * page)
gtk_box_pack_start(GTK_BOX(hbox), label,
FALSE, FALSE, 0);
scan_adj = gtk_adjustment_new(1.0, 1.0, 99.0, 1.0, 5.0, 0.0);
- pui->local_scan_depth =
- gtk_spin_button_new(GTK_ADJUSTMENT(scan_adj), 1, 0);
+ pui->local_scan_depth = gtk_spin_button_new(scan_adj, 1, 0);
gtk_box_pack_start(GTK_BOX(hbox), pui->local_scan_depth,
TRUE, TRUE, 0);
@@ -2876,8 +2859,7 @@ folder_scanning_group(GtkWidget * page)
gtk_box_pack_start(GTK_BOX(hbox), label,
FALSE, FALSE, 0);
scan_adj = gtk_adjustment_new(1.0, 1.0, 99.0, 1.0, 5.0, 0.0);
- pui->imap_scan_depth =
- gtk_spin_button_new(GTK_ADJUSTMENT(scan_adj), 1, 0);
+ pui->imap_scan_depth = gtk_spin_button_new(scan_adj, 1, 0);
gtk_box_pack_start(GTK_BOX(hbox), pui->imap_scan_depth,
TRUE, TRUE, 0);
@@ -3366,7 +3348,7 @@ pgdown_modified_cb(GtkWidget * widget, GtkWidget * pbox)
}
static void
-option_menu_cb(GtkItem * widget, gpointer data)
+option_menu_cb(GtkMenuItem * widget, gpointer data)
{
/* update the index number */
gint *index = (gint *) data;
@@ -3396,7 +3378,7 @@ add_show_menu(const char* label, gint level, GtkWidget* menu)
struct pm_combo_box_info *info =
g_object_get_data(G_OBJECT(menu), PM_COMBO_BOX_INFO);
- gtk_combo_box_append_text(GTK_COMBO_BOX(menu), label);
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(menu), label);
info->levels = g_slist_append(info->levels, GINT_TO_POINTER(level));
}
@@ -3730,7 +3712,7 @@ pm_combo_box_info_free(struct pm_combo_box_info * info)
static GtkWidget *
pm_combo_box_new(void)
{
- GtkWidget *combo_box = gtk_combo_box_new_text();
+ GtkWidget *combo_box = gtk_combo_box_text_new();
struct pm_combo_box_info *info = g_new0(struct pm_combo_box_info, 1);
g_object_set_data_full(G_OBJECT(combo_box), PM_COMBO_BOX_INFO, info,
diff --git a/src/quote-color.c b/src/quote-color.c
index 3569655..5dcac00 100644
--- a/src/quote-color.c
+++ b/src/quote-color.c
@@ -95,6 +95,7 @@ allocate_quote_colors(GtkWidget * widget, GdkColor color[],
gint i;
for (i = first; i <= last; i++) {
+#if 0
if (!gdk_colormap_alloc_color(balsa_app.colormap,
&color[i], FALSE, TRUE)) {
/* Use black instead: */
@@ -102,6 +103,7 @@ allocate_quote_colors(GtkWidget * widget, GdkColor color[],
gdk_colormap_alloc_color(balsa_app.colormap, &color[i], FALSE,
TRUE);
}
+#endif
}
}
diff --git a/src/sendmsg-window.c b/src/sendmsg-window.c
index e75d63b..09511f9 100644
--- a/src/sendmsg-window.c
+++ b/src/sendmsg-window.c
@@ -1885,13 +1885,14 @@ sw_get_user_codeset(BalsaSendmsg * bsmsg, gboolean * change_type,
if (change_type) {
GtkWidget *label = gtk_label_new(_("Attach as MIME type:"));
GtkWidget *hbox = gtk_hbox_new(FALSE, 5);
- combo_box = gtk_combo_box_new_text();
+ combo_box = gtk_combo_box_text_new();
gtk_box_pack_start(content_box, hbox, TRUE, TRUE, 5);
gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0);
- gtk_combo_box_append_text(GTK_COMBO_BOX(combo_box), mime_type);
- gtk_combo_box_append_text(GTK_COMBO_BOX(combo_box),
- "application/octet-stream");
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo_box),
+ mime_type);
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo_box),
+ "application/octet-stream");
gtk_combo_box_set_active(GTK_COMBO_BOX(combo_box), 0);
g_signal_connect(G_OBJECT(combo_box), "changed",
G_CALLBACK(sw_charset_combo_box_changed),
@@ -2637,6 +2638,7 @@ create_string_entry(GtkWidget * table, const gchar * label, int y_pos,
* On return, bsmsg->address_view and bsmsg->addresses[1] have been set.
*/
+#if 0
static void
sw_scroll_size_request(GtkWidget * widget, GtkRequisition * requisition)
{
@@ -2645,8 +2647,8 @@ sw_scroll_size_request(GtkWidget * widget, GtkRequisition * requisition)
gint border_width;
GtkPolicyType type = GTK_POLICY_NEVER;
- gtk_widget_size_request(gtk_bin_get_child(GTK_BIN(widget)),
- requisition);
+ gtk_widget_get_preferred_size(gtk_bin_get_child(GTK_BIN(widget)),
+ NULL, requisition);
gtk_widget_style_get(widget, "focus-line-width", &focus_width,
"focus-padding", &focus_pad, NULL);
@@ -2667,6 +2669,7 @@ sw_scroll_size_request(GtkWidget * widget, GtkRequisition * requisition)
}
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(widget), type, type);
}
+#endif
static void
create_email_entry(GtkWidget * table, int y_pos, BalsaSendmsg * bsmsg,
@@ -2684,8 +2687,10 @@ create_email_entry(GtkWidget * table, int y_pos, BalsaSendmsg * bsmsg,
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
+#if 0
g_signal_connect(scroll, "size-request",
G_CALLBACK(sw_scroll_size_request), NULL);
+#endif
gtk_container_add(GTK_CONTAINER(scroll), GTK_WIDGET(*view));
widget[1] = gtk_frame_new(NULL);
@@ -2945,8 +2950,10 @@ create_info_pane(BalsaSendmsg * bsmsg)
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
+#if 0
g_signal_connect(sw, "size-request",
G_CALLBACK(sw_scroll_size_request), NULL);
+#endif
store = gtk_list_store_new(ATTACH_NUM_COLUMNS,
TYPE_BALSA_ATTACH_INFO,
@@ -3156,7 +3163,7 @@ sw_can_redo_cb(GtkSourceBuffer * source_buffer, gboolean can_redo,
sw_set_sensitive(bsmsg, "Redo", can_redo);
}
-#elif (HAVE_GTKSOURCEVIEW == 2)
+#elif (HAVE_GTKSOURCEVIEW >= 2)
static void
sw_can_undo_cb(GtkSourceBuffer * source_buffer, GParamSpec *arg1,
@@ -3190,6 +3197,8 @@ create_text_area(BalsaSendmsg * bsmsg)
#if HAVE_GTKSOURCEVIEW
bsmsg->text = libbalsa_source_view_new(TRUE, balsa_app.quoted_color);
+ gtk_source_view_set_show_line_numbers(GTK_SOURCE_VIEW(bsmsg->text),
+ FALSE);
#else /* HAVE_GTKSOURCEVIEW */
bsmsg->text = gtk_text_view_new();
#endif /* HAVE_GTKSOURCEVIEW */
@@ -3208,7 +3217,7 @@ create_text_area(BalsaSendmsg * bsmsg)
G_CALLBACK(sw_can_undo_cb), bsmsg);
g_signal_connect(buffer, "can-redo",
G_CALLBACK(sw_can_redo_cb), bsmsg);
-#elif (HAVE_GTKSOURCEVIEW == 2)
+#elif (HAVE_GTKSOURCEVIEW)
g_signal_connect(G_OBJECT(buffer), "notify::can-undo",
G_CALLBACK(sw_can_undo_cb), bsmsg);
g_signal_connect(G_OBJECT(buffer), "notify::can-redo",
diff --git a/src/spell-check.c b/src/spell-check.c
index 6a3c4fa..fa065db 100644
--- a/src/spell-check.c
+++ b/src/spell-check.c
@@ -121,7 +121,7 @@ static void spch_set_property(GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void spch_get_property(GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
-static void balsa_spell_check_destroy(GtkObject * object);
+static void balsa_spell_check_destroy(GObject * object);
/* signal callbacks */
@@ -191,49 +191,47 @@ balsa_spell_check_get_type()
static void
balsa_spell_check_class_init(BalsaSpellCheckClass * klass)
{
- GtkObjectClass *object_class;
- GObjectClass *o_class;
+ GObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkContainerClass *container_class;
- object_class = (GtkObjectClass *) klass;
- o_class = (GObjectClass *) klass;
+ object_class = (GObjectClass *) klass;
widget_class = (GtkWidgetClass *) klass;
container_class = (GtkContainerClass *) klass;
parent_class = g_type_class_peek_parent(klass);
/* GObject signals */
- o_class->set_property = spch_set_property;
- o_class->get_property = spch_get_property;
+ object_class->set_property = spch_set_property;
+ object_class->get_property = spch_get_property;
- g_object_class_install_property(o_class, PROP_MODULE,
+ g_object_class_install_property(object_class, PROP_MODULE,
g_param_spec_string("spell-module",
NULL, NULL,
NULL,
G_PARAM_READWRITE));
- g_object_class_install_property(o_class, PROP_SUGGEST,
+ g_object_class_install_property(object_class, PROP_SUGGEST,
g_param_spec_string("suggest-mode",
NULL, NULL,
NULL,
G_PARAM_READWRITE));
- g_object_class_install_property(o_class, PROP_IGNORE,
+ g_object_class_install_property(object_class, PROP_IGNORE,
g_param_spec_uint("ignore-length",
NULL, NULL,
0, -1, 0,
G_PARAM_READWRITE));
- g_object_class_install_property(o_class, PROP_LANGUAGE,
+ g_object_class_install_property(object_class, PROP_LANGUAGE,
g_param_spec_string("language-tag",
NULL, NULL,
NULL,
G_PARAM_READWRITE));
- g_object_class_install_property(o_class, PROP_CHARSET,
+ g_object_class_install_property(object_class, PROP_CHARSET,
g_param_spec_string("character-set",
NULL, NULL,
NULL,
G_PARAM_READWRITE));
- object_class->destroy = balsa_spell_check_destroy;
+ object_class->dispose = balsa_spell_check_destroy;
klass->done_spell_check = NULL;
}
@@ -1069,11 +1067,11 @@ balsa_spell_check_fix(BalsaSpellCheck * spell_check, gboolean fix_all)
/* balsa_spell_check_destroy ()
- *
+ *
* Clean up variables if the widget is destroyed.
* */
static void
-balsa_spell_check_destroy(GtkObject * object)
+balsa_spell_check_destroy(GObject * object)
{
BalsaSpellCheck *spell_check;
@@ -1111,8 +1109,8 @@ balsa_spell_check_destroy(GtkObject * object)
quoted_rex_compiled = FALSE;
}
- if (GTK_OBJECT_CLASS(parent_class)->destroy)
- (*GTK_OBJECT_CLASS(parent_class)->destroy) (object);
+ if (G_OBJECT_CLASS(parent_class)->dispose)
+ (*G_OBJECT_CLASS(parent_class)->dispose) (object);
}
diff --git a/src/store-address.c b/src/store-address.c
index 1c0b93b..769a8f1 100644
--- a/src/store-address.c
+++ b/src/store-address.c
@@ -282,7 +282,7 @@ store_address_book_frame(StoreAddressInfo * info)
LibBalsaAddressBook *address_book;
guint default_ab_offset = 0, off;
- combo_box = gtk_combo_box_new_text();
+ combo_box = gtk_combo_box_text_new();
g_signal_connect(combo_box, "changed",
G_CALLBACK(store_address_book_menu_cb), info);
if (balsa_app.address_book_list) {
@@ -298,8 +298,8 @@ store_address_book_frame(StoreAddressInfo * info)
if (info->current_address_book == NULL)
info->current_address_book = address_book;
- gtk_combo_box_append_text(GTK_COMBO_BOX(combo_box),
- address_book->name);
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo_box),
+ address_book->name);
if (address_book == balsa_app.default_address_book)
default_ab_offset = off;
}
diff --git a/src/toolbar-factory.c b/src/toolbar-factory.c
index d4a700a..adbd6ee 100644
--- a/src/toolbar-factory.c
+++ b/src/toolbar-factory.c
@@ -63,7 +63,7 @@ enum {
LAST_SIGNAL
};
-static GtkObjectClass* parent_class;
+static GObjectClass* parent_class;
static guint model_signals[LAST_SIGNAL] = { 0 };
static void
@@ -672,7 +672,7 @@ tm_popup_position_func(GtkMenu * menu, gint * x, gint * y,
gdk_window_get_origin(gtk_widget_get_window(toolbar), x, y);
- gtk_widget_size_request(GTK_WIDGET(menu), &req);
+ gtk_widget_get_preferred_size(GTK_WIDGET(menu), NULL, &req);
#if GTK_CHECK_VERSION(2, 18, 0)
gtk_widget_get_allocation(toolbar, &allocation);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]