[balsa/gtk3] Deprecation cleanup
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/gtk3] Deprecation cleanup
- Date: Tue, 27 Jan 2015 17:38:09 +0000 (UTC)
commit 9e8c98ff809a00f2fef0b3f55c2ce7617c17831a
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Tue Jan 27 12:36:39 2015 -0500
Deprecation cleanup
* .gitignore: add "compile"
* configure.ac: use webkit2gtk-4.0
* libbalsa/address.c (libbalsa_address_get_edit_widget)
* libbalsa/html.c (lbh_navigation_policy_decision),
(lbh_new_window_policy_decision)
* libbalsa/imap/imap-handle.c
* libbalsa/libbalsa-gpgme-cb.c (lb_gpgme_select_key)
* libbalsa/send.c
* libbalsa/url.c
* src/address-book-config.c (add_radio_buttons),
(create_externq_dialog)
* src/balsa-app.c (balsa_stock_button_with_label)
* src/balsa-icons.c (load_balsa_pixmap)
* src/balsa-message.c (bm_find_bar_new), (balsa_message_init)
* src/balsa-mime-widget-crypto.c
(balsa_mime_widget_signature_widget)
* src/balsa-mime-widget-message.c (add_header_gchar),
(add_header_sigstate)
* src/balsa-mime-widget-vcalendar.c
(balsa_mime_widget_new_vcalendar)
* src/filter-edit-dialog.c (build_action_page)
* src/main-window.c (bw_window_state_event_cb),
(bw_is_active_notify), (bw_notebook_label_new),
(bw_display_new_mail_notification)
* src/main-window.h
* src/pref-manager.c (attach_label), (checking_group),
(quoted_group), (mdn_group), (main_window_group), (add_pref_menu),
(deleting_messages_group), (folder_scanning_group), (pm_group_new)
* src/print-gtk.c (message_prefs_widget)
* src/sendmsg-window.c (create_email_or_string_entry),
(sw_attachment_list), (quote_parts_select_dlg),
(subject_not_empty), (check_suggest_encryption)
.gitignore | 1 +
ChangeLog | 37 +++++++++++++++++++++++++
configure.ac | 2 +-
libbalsa/address.c | 2 +-
libbalsa/html.c | 53 +++++++++++++++++++++++--------------
libbalsa/imap/imap-handle.c | 2 +-
libbalsa/libbalsa-gpgme-cb.c | 2 +-
libbalsa/send.c | 2 +-
libbalsa/url.c | 2 +-
src/address-book-config.c | 6 ++--
src/balsa-app.c | 17 ++++++-----
src/balsa-icons.c | 5 +++
src/balsa-message.c | 12 +++-----
src/balsa-mime-widget-crypto.c | 2 +-
src/balsa-mime-widget-message.c | 6 ++--
src/balsa-mime-widget-vcalendar.c | 3 +-
src/filter-edit-dialog.c | 3 --
src/main-window.c | 50 ++++++++++++-----------------------
src/main-window.h | 2 -
src/pref-manager.c | 26 ++++++++++--------
src/print-gtk.c | 6 ++--
src/sendmsg-window.c | 49 +++++++++++++---------------------
22 files changed, 158 insertions(+), 132 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 1d3341b..6567f51 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,6 +22,7 @@ balsa.1
balsa.desktop
balsa.desktop.in
balsa.spec
+compile
config.guess
config.h
config.h.in
diff --git a/ChangeLog b/ChangeLog
index 9ab942c..0e3d470 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,42 @@
2015-01-27 Peter Bloomfield <pbloomfield bellsouth net>
+ Deprecation cleanup
+
+ * .gitignore: add "compile"
+ * configure.ac: use webkit2gtk-4.0
+ * libbalsa/address.c (libbalsa_address_get_edit_widget):
+ * libbalsa/html.c (lbh_navigation_policy_decision),
+ (lbh_new_window_policy_decision):
+ * libbalsa/imap/imap-handle.c:
+ * libbalsa/libbalsa-gpgme-cb.c (lb_gpgme_select_key):
+ * libbalsa/send.c:
+ * libbalsa/url.c:
+ * src/address-book-config.c (add_radio_buttons),
+ (create_externq_dialog):
+ * src/balsa-app.c (balsa_stock_button_with_label):
+ * src/balsa-icons.c (load_balsa_pixmap):
+ * src/balsa-message.c (bm_find_bar_new), (balsa_message_init):
+ * src/balsa-mime-widget-crypto.c
+ (balsa_mime_widget_signature_widget):
+ * src/balsa-mime-widget-message.c (add_header_gchar),
+ (add_header_sigstate):
+ * src/balsa-mime-widget-vcalendar.c
+ (balsa_mime_widget_new_vcalendar):
+ * src/filter-edit-dialog.c (build_action_page):
+ * src/main-window.c (bw_window_state_event_cb),
+ (bw_is_active_notify), (bw_notebook_label_new),
+ (bw_display_new_mail_notification):
+ * src/main-window.h:
+ * src/pref-manager.c (attach_label), (checking_group),
+ (quoted_group), (mdn_group), (main_window_group), (add_pref_menu),
+ (deleting_messages_group), (folder_scanning_group), (pm_group_new):
+ * src/print-gtk.c (message_prefs_widget):
+ * src/sendmsg-window.c (create_email_or_string_entry),
+ (sw_attachment_list), (quote_parts_select_dlg),
+ (subject_not_empty), (check_suggest_encryption):
+
+2015-01-27 Peter Bloomfield <pbloomfield bellsouth net>
+
* src/ab-main.c (bab_load_cb), (bab_set_address_book),
(address_book_change_state), (set_address_book_menu_items),
(address_book_change), (file_new_vcard_activated),
diff --git a/configure.ac b/configure.ac
index b9ae71a..ec84ab4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -410,7 +410,7 @@ case "$use_html_widget" in
fi
fi
if test $use_html_widget = webkit2 ; then
- PKG_CHECK_MODULES(HTML, [webkit2gtk-3.0 >= 1.11.92 ])
+ PKG_CHECK_MODULES(HTML, [ webkit2gtk-4.0 ])
AC_DEFINE(USE_WEBKIT2,1,[Defined when WebKit2 is requested.])
else
if $PKG_CONFIG --atleast-version=1.5.1 webkitgtk-3.0 ; then
diff --git a/libbalsa/address.c b/libbalsa/address.c
index 977cd45..344e426 100644
--- a/libbalsa/address.c
+++ b/libbalsa/address.c
@@ -972,7 +972,7 @@ libbalsa_address_get_edit_widget(const LibBalsaAddress *address,
if (!labels[cnt])
continue;
label = gtk_label_new_with_mnemonic(_(labels[cnt]));
- gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.0);
+ gtk_widget_set_halign(label, GTK_ALIGN_END);
if (cnt == EMAIL_ADDRESS) {
GtkWidget *box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
GtkWidget *but = gtk_button_new_with_mnemonic(_("A_dd"));
diff --git a/libbalsa/html.c b/libbalsa/html.c
index 89a0477..c1b1174 100644
--- a/libbalsa/html.c
+++ b/libbalsa/html.c
@@ -92,7 +92,16 @@ lbh_get_body_content(LibBalsaMessageBody * body, gchar ** buf)
#define d(x)
#endif
+/* WebKitContextMenuItem uses GtkAction, which is deprecated.
+ * We don't use it, but it breaks the git-tree build, so we just mangle
+ * it: */
+#if defined(GTK_DISABLE_DEPRECATED)
+#define GtkAction GAction
#include <webkit2/webkit2.h>
+#undef GtkAction
+#else /* defined(GTK_DISABLE_DEPRECATED) */
+#include <webkit2/webkit2.h>
+#endif /* defined(GTK_DISABLE_DEPRECATED) */
typedef struct {
LibBalsaMessageBody *body;
@@ -198,31 +207,33 @@ static void
lbh_navigation_policy_decision(WebKitPolicyDecision * decision,
gpointer data)
{
- WebKitNavigationPolicyDecision *navigation_decision =
- WEBKIT_NAVIGATION_POLICY_DECISION(decision);
+ WebKitNavigationPolicyDecision *navigation_decision;
+ WebKitNavigationAction *navigation_action;
LibBalsaWebKitInfo *info = data;
WebKitURIRequest *request;
- switch (webkit_navigation_policy_decision_get_navigation_type
- (navigation_decision)) {
+ navigation_decision = WEBKIT_NAVIGATION_POLICY_DECISION(decision);
+ navigation_action =
+ webkit_navigation_policy_decision_get_navigation_action
+ (navigation_decision);
+ switch (webkit_navigation_action_get_navigation_type
+ (navigation_action)) {
case WEBKIT_NAVIGATION_TYPE_OTHER:
case WEBKIT_NAVIGATION_TYPE_RELOAD:
d(g_print("%s type %d, used\n", __func__,
- webkit_navigation_policy_decision_get_navigation_type
- (navigation_decision)));
+ webkit_navigation_action_get_navigation_type
+ (navigation_action)));
webkit_policy_decision_use(decision);
break;
case WEBKIT_NAVIGATION_TYPE_LINK_CLICKED:
- request =
- webkit_navigation_policy_decision_get_request
- (navigation_decision);
+ request = webkit_navigation_action_get_request(navigation_action);
d(g_print("%s clicked %s\n", __func__,
webkit_uri_request_get_uri(request)));
(*info->clicked_cb) (webkit_uri_request_get_uri(request));
default:
d(g_print("%s type %d, ignored\n", __func__,
- webkit_navigation_policy_decision_get_navigation_type
- (navigation_decision)));
+ webkit_navigation_action_get_navigation_type
+ (navigation_action)));
webkit_policy_decision_ignore(decision);
}
}
@@ -231,24 +242,26 @@ static void
lbh_new_window_policy_decision(WebKitPolicyDecision * decision,
gpointer data)
{
- WebKitNavigationPolicyDecision *navigation_decision =
- WEBKIT_NAVIGATION_POLICY_DECISION(decision);
+ WebKitNavigationPolicyDecision *navigation_decision;
+ WebKitNavigationAction *navigation_action;
LibBalsaWebKitInfo *info = data;
WebKitURIRequest *request;
- switch (webkit_navigation_policy_decision_get_navigation_type
- (navigation_decision)) {
- case WEBKIT_NAVIGATION_TYPE_LINK_CLICKED:
- request =
- webkit_navigation_policy_decision_get_request
+ navigation_decision = WEBKIT_NAVIGATION_POLICY_DECISION(decision);
+ navigation_action =
+ webkit_navigation_policy_decision_get_navigation_action
(navigation_decision);
+ switch (webkit_navigation_action_get_navigation_type
+ (navigation_action)) {
+ case WEBKIT_NAVIGATION_TYPE_LINK_CLICKED:
+ request = webkit_navigation_action_get_request(navigation_action);
d(g_print("%s clicked %s\n", __func__,
webkit_uri_request_get_uri(request)));
(*info->clicked_cb) (webkit_uri_request_get_uri(request));
default:
d(g_print("%s type %d, ignored\n", __func__,
- webkit_navigation_policy_decision_get_navigation_type
- (navigation_decision)));
+ webkit_navigation_action_get_navigation_type
+ (navigation_action)));
webkit_policy_decision_ignore(decision);
}
diff --git a/libbalsa/imap/imap-handle.c b/libbalsa/imap/imap-handle.c
index e3069dc..f636818 100644
--- a/libbalsa/imap/imap-handle.c
+++ b/libbalsa/imap/imap-handle.c
@@ -20,7 +20,7 @@
#define _POSIX_C_SOURCE 199506L
#define _XOPEN_SOURCE 500
-#define _BSD_SOURCE 1
+#define _DEFAULT_SOURCE 1
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/libbalsa/libbalsa-gpgme-cb.c b/libbalsa/libbalsa-gpgme-cb.c
index 4a22e02..0c72723 100644
--- a/libbalsa/libbalsa-gpgme-cb.c
+++ b/libbalsa/libbalsa-gpgme-cb.c
@@ -181,7 +181,7 @@ lb_gpgme_select_key(const gchar * user_name, gboolean secret, GList * keys,
("Select the public key for the recipient %s"),
user_name);
label = gtk_label_new(prompt);
- gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+ gtk_widget_set_halign(label, GTK_ALIGN_START);
g_free(prompt);
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, TRUE, 0);
diff --git a/libbalsa/send.c b/libbalsa/send.c
index b62ca2b..9a1fb0f 100644
--- a/libbalsa/send.c
+++ b/libbalsa/send.c
@@ -24,7 +24,7 @@
# include "config.h"
#endif /* HAVE_CONFIG_H */
-#define _BSD_SOURCE 1
+#define _DEFAULT_SOURCE 1
#define _POSIX_C_SOURCE 199309L
#include "send.h"
diff --git a/libbalsa/url.c b/libbalsa/url.c
index e0d2115..cdc564c 100644
--- a/libbalsa/url.c
+++ b/libbalsa/url.c
@@ -20,7 +20,7 @@
* A simple URL parser.
*/
-#define _BSD_SOURCE 1
+#define _DEFAULT_SOURCE 1
#include <stdio.h>
#include <ctype.h>
diff --git a/src/address-book-config.c b/src/address-book-config.c
index 4c07c24..9eccb11 100644
--- a/src/address-book-config.c
+++ b/src/address-book-config.c
@@ -175,7 +175,7 @@ add_radio_buttons(GtkWidget * grid, gint row, AddressBookConfig * abc)
GtkWidget *button;
label = gtk_label_new(_("Suggest complete addresses:"));
- gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ gtk_widget_set_halign(label, GTK_ALIGN_START);
gtk_grid_attach(GTK_GRID(grid), label, 0, row, 2, 1);
abc->as_i_type =
@@ -370,7 +370,7 @@ create_externq_dialog(AddressBookConfig * abc)
label);
label = gtk_label_new(_("Load program location:"));
- gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
+ gtk_widget_set_halign(label, GTK_ALIGN_END);
gtk_grid_attach(GTK_GRID(grid), label, 0, 1, 1, 1);
abc->ab_specific.externq.load =
gtk_file_chooser_button_new
@@ -383,7 +383,7 @@ create_externq_dialog(AddressBookConfig * abc)
abc->ab_specific.externq.load);
label = gtk_label_new(_("Save program location:"));
- gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ gtk_widget_set_halign(label, GTK_ALIGN_START);
gtk_grid_attach(GTK_GRID(grid), label, 0, 2, 1, 1);
abc->ab_specific.externq.save =
gtk_file_chooser_button_new
diff --git a/src/balsa-app.c b/src/balsa-app.c
index b38a202..0dcf38c 100644
--- a/src/balsa-app.c
+++ b/src/balsa-app.c
@@ -582,19 +582,20 @@ balsa_add_open_mailbox_urls(GPtrArray * url_array)
}
GtkWidget *
-balsa_stock_button_with_label(const char *icon, const char *text)
+balsa_stock_button_with_label(const gchar * icon, const gchar * text)
{
GtkWidget *button;
- GtkWidget *pixmap =
- gtk_image_new_from_icon_name(balsa_icon_id(icon),
- GTK_ICON_SIZE_BUTTON);
- GtkWidget *align = gtk_alignment_new(0.5, 0.5, 0, 0);
- GtkWidget *hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+ GtkWidget *hbox;
+ GtkWidget *pixmap;
+
+ hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+ gtk_widget_set_halign(hbox, GTK_ALIGN_CENTER);
+ gtk_widget_set_valign(hbox, GTK_ALIGN_CENTER);
button = gtk_button_new();
- gtk_container_add(GTK_CONTAINER(button), align);
- gtk_container_add(GTK_CONTAINER(align), hbox);
+ gtk_container_add(GTK_CONTAINER(button), hbox);
+ pixmap = gtk_image_new_from_icon_name(balsa_icon_id(icon), GTK_ICON_SIZE_BUTTON);
gtk_box_pack_start(GTK_BOX(hbox), pixmap, FALSE, FALSE, 0);
if (text && *text) {
GtkWidget *label = gtk_label_new_with_mnemonic(text);
diff --git a/src/balsa-icons.c b/src/balsa-icons.c
index acabf7c..c7a0e2c 100644
--- a/src/balsa-icons.c
+++ b/src/balsa-icons.c
@@ -130,8 +130,13 @@ load_balsa_pixmap(GtkIconTheme *icon_theme, const balsa_pixmap_t *bpixmap)
g_clear_error(&error);
} else {
BICONS_LOG("\tloaded with size %d", width);
+#if 0
gtk_icon_theme_add_builtin_icon(bpixmap->name, width,
pixbuf);
+#else
+ g_print("DEPRECATION: could not load %s with size %d\n",
+ bpixmap->name, width);
+#endif
g_object_unref(pixbuf);
}
} else
diff --git a/src/balsa-message.c b/src/balsa-message.c
index 253eaeb..4aed993 100644
--- a/src/balsa-message.c
+++ b/src/balsa-message.c
@@ -589,6 +589,7 @@ bm_find_bar_new(BalsaMessage * bm)
GtkWidget *toolbar;
GtkWidget *hbox;
GtkToolItem *tool_item;
+ GtkWidget *image;
toolbar = gtk_toolbar_new();
gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_BOTH_HORIZ);
@@ -605,17 +606,15 @@ bm_find_bar_new(BalsaMessage * bm)
gtk_container_add(GTK_CONTAINER(tool_item), hbox);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tool_item, -1);
- tool_item =
- gtk_tool_button_new(gtk_arrow_new(GTK_ARROW_LEFT, GTK_SHADOW_NONE),
- _("Previous"));
+ image = gtk_image_new_from_icon_name("pan_up_symbolic", GTK_ICON_SIZE_BUTTON);
+ tool_item = gtk_tool_button_new(image, _("Previous"));
bm->find_prev = GTK_WIDGET(tool_item);
gtk_tool_item_set_is_important(tool_item, TRUE);
g_signal_connect(tool_item, "clicked", G_CALLBACK(bm_find_prev_cb), bm);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tool_item, -1);
- tool_item =
- gtk_tool_button_new(gtk_arrow_new(GTK_ARROW_RIGHT, GTK_SHADOW_NONE),
- _("Next"));
+ image = gtk_image_new_from_icon_name("pan_down_symbolic", GTK_ICON_SIZE_BUTTON);
+ tool_item = gtk_tool_button_new(image, _("Next"));
bm->find_next = GTK_WIDGET(tool_item);
gtk_tool_item_set_is_important(tool_item, TRUE);
g_signal_connect(tool_item, "clicked", G_CALLBACK(bm_find_next_cb), bm);
@@ -741,7 +740,6 @@ balsa_message_init(BalsaMessage * bm)
g_signal_connect(bm->treeview, "popup-menu",
G_CALLBACK(tree_menu_popup_key_cb), bm);
g_object_unref (G_OBJECT (model));
- gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (bm->treeview), TRUE);
gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (bm->treeview), FALSE);
diff --git a/src/balsa-mime-widget-crypto.c b/src/balsa-mime-widget-crypto.c
index 59bc8d0..719ca63 100644
--- a/src/balsa-mime-widget-crypto.c
+++ b/src/balsa-mime-widget-crypto.c
@@ -85,7 +85,7 @@ balsa_mime_widget_signature_widget(LibBalsaMessageBody * mime_body,
gtk_container_set_border_width(GTK_CONTAINER(vbox), BMW_CONTAINER_BORDER);
label = gtk_label_new(infostr);
gtk_label_set_selectable(GTK_LABEL(label), TRUE);
- gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+ gtk_widget_set_halign(label, GTK_ALIGN_START);
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
g_free(infostr);
#ifdef HAVE_GPG
diff --git a/src/balsa-mime-widget-message.c b/src/balsa-mime-widget-message.c
index 49da4e6..62e4058 100644
--- a/src/balsa-mime-widget-message.c
+++ b/src/balsa-mime-widget-message.c
@@ -573,7 +573,7 @@ add_header_gchar(BalsaMessage * bm, GtkGrid * grid,
gtk_widget_override_font(lab, font_desc);
gtk_grid_attach(grid, lab, 0, row, 1, 1);
gtk_label_set_selectable(GTK_LABEL(lab), TRUE);
- gtk_misc_set_alignment(GTK_MISC(lab), 0, 0);
+ gtk_widget_set_halign(lab, GTK_ALIGN_START);
gtk_widget_show(lab);
if (value && *value != '\0') {
@@ -590,7 +590,7 @@ add_header_gchar(BalsaMessage * bm, GtkGrid * grid,
gtk_widget_override_font(lab, font_desc);
gtk_label_set_line_wrap_mode(GTK_LABEL(lab), PANGO_WRAP_WORD_CHAR);
gtk_label_set_selectable(GTK_LABEL(lab), TRUE);
- gtk_misc_set_alignment(GTK_MISC(lab), 0, 0);
+ gtk_widget_set_halign(lab, GTK_ALIGN_START);
gtk_widget_set_hexpand(lab, TRUE);
expander = gtk_expander_new(NULL);
@@ -790,7 +790,7 @@ add_header_sigstate(GtkGrid * grid, GMimeGpgmeSigstat * siginfo)
label = gtk_label_new(NULL);
gtk_label_set_markup(GTK_LABEL(label), msg);
g_free(msg);
- gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+ gtk_widget_set_halign(label, GTK_ALIGN_START);
gtk_widget_show(label);
row = 0;
diff --git a/src/balsa-mime-widget-vcalendar.c b/src/balsa-mime-widget-vcalendar.c
index a117152..32c3fae 100644
--- a/src/balsa-mime-widget-vcalendar.c
+++ b/src/balsa-mime-widget-vcalendar.c
@@ -68,7 +68,8 @@ balsa_mime_widget_new_vcalendar(BalsaMessage * bm,
libbalsa_vcal_method_to_str(vcal_obj->method));
label = gtk_label_new(text);
g_free(text);
- gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
+ gtk_widget_set_halign(label, GTK_ALIGN_START);
+ gtk_widget_set_valign(label, GTK_ALIGN_START);
gtk_container_add(GTK_CONTAINER(mw->widget), label);
/* a reply may be created only for unread requests */
diff --git a/src/filter-edit-dialog.c b/src/filter-edit-dialog.c
index e3c7fa3..5189acf 100644
--- a/src/filter-edit-dialog.c
+++ b/src/filter-edit-dialog.c
@@ -407,9 +407,6 @@ build_action_page(GtkWindow * window)
NULL);
gtk_dialog_set_default_response(GTK_DIALOG(dialog),
GTK_RESPONSE_ACCEPT);
- gtk_dialog_set_alternative_button_order(GTK_DIALOG(dialog),
- GTK_RESPONSE_ACCEPT,
- GTK_RESPONSE_CANCEL, -1);
fe_sound_entry = gtk_file_chooser_button_new_with_dialog(dialog);
gtk_widget_set_hexpand(fe_sound_entry, TRUE);
gtk_grid_attach(GTK_GRID(grid), fe_sound_entry, 1, 0, 1, 1);
diff --git a/src/main-window.c b/src/main-window.c
index 3c66c42..2b2402d 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -703,9 +703,6 @@ bw_window_state_event_cb(BalsaWindow * window,
balsa_app.mw_maximized =
event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED;
- gtk_window_set_has_resize_grip(GTK_WINDOW(window),
- !balsa_app.mw_maximized);
-
return FALSE;
}
@@ -722,8 +719,6 @@ bw_is_active_notify(GObject * gobject, GParamSpec * pspec,
if (window->new_mail_note)
notify_notification_close(window->new_mail_note, NULL);
#endif /* HAVE_NOTIFY */
- if (window->new_mail_tray)
- gtk_status_icon_set_visible(window->new_mail_tray, FALSE);
gtk_window_set_urgency_hint(gtk_window, FALSE);
}
}
@@ -2778,6 +2773,23 @@ bw_notebook_label_new(BalsaMailboxNode * mbnode)
box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
lab = gtk_label_new(mbnode->mailbox->name);
+ gtk_widget_set_name(lab, "balsa-notebook-tab-label");
+
+ /* Try to make text not bold: */
+ css_provider = gtk_css_provider_new();
+ if (!gtk_css_provider_load_from_data(css_provider,
+ "#balsa-notebook-tab-label"
+ "{"
+ "font-weight:normal;"
+ "}",
+ -1, NULL))
+ g_print("Could not load label CSS data.\n");
+
+ gtk_style_context_add_provider(gtk_widget_get_style_context(lab) ,
+ GTK_STYLE_PROVIDER(css_provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_object_unref(css_provider);
+
bw_notebook_label_style(GTK_LABEL(lab),
libbalsa_mailbox_get_unread(mbnode->mailbox) > 0);
g_signal_connect(mbnode->mailbox, "changed",
@@ -3825,34 +3837,6 @@ bw_display_new_mail_notification(int num_new, int has_new)
if (!gtk_window_is_active(window))
gtk_window_set_urgency_hint(window, TRUE);
- if (balsa_app.notify_new_mail_icon) {
- /* set up the sys tray icon when it is not yet present */
- if (!gtk_window_is_active(window)) {
- if (!balsa_app.main_window->new_mail_tray) {
- balsa_app.main_window->new_mail_tray =
- gtk_status_icon_new_from_icon_name("mail-message-new");
- g_signal_connect_swapped(balsa_app.main_window->
- new_mail_tray, "activate",
- G_CALLBACK(gtk_window_present),
- balsa_app.main_window);
- }
- /* show sys tray icon if we don't have the focus */
- if (num_new > 0)
- msg = g_strdup_printf
- (ngettext
- ("Balsa: you have received %d new message.",
- "Balsa: you have received %d new messages.",
- num_new + num_total), num_new + num_total);
- else
- msg = g_strdup(_("Balsa: you have new mail."));
- gtk_status_icon_set_tooltip_text(balsa_app.main_window->
- new_mail_tray, msg);
- gtk_status_icon_set_visible(balsa_app.main_window->
- new_mail_tray, TRUE);
- g_free(msg);
- }
- }
-
if (!balsa_app.notify_new_mail_dialog)
return;
diff --git a/src/main-window.h b/src/main-window.h
index 7119bf4..46a7e0b 100644
--- a/src/main-window.h
+++ b/src/main-window.h
@@ -84,8 +84,6 @@ struct _BalsaWindow {
guint activity_counter;
GSList *activity_messages;
- /* New mail notification: */
- GtkStatusIcon *new_mail_tray;
#ifdef HAVE_NOTIFY
NotifyNotification *new_mail_note;
#endif /* HAVE_NOTIFY */
diff --git a/src/pref-manager.c b/src/pref-manager.c
index db0d517..7daf7a5 100644
--- a/src/pref-manager.c
+++ b/src/pref-manager.c
@@ -1563,7 +1563,7 @@ attach_label(const gchar * text, GtkGrid * grid, gint row,
label = gtk_label_new(text);
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
- gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ gtk_widget_set_halign(label, GTK_ALIGN_START);
gtk_grid_attach(grid, label, 0, row, 1, 1);
if (page)
pm_page_add_to_size_group(page, label);
@@ -1855,7 +1855,7 @@ checking_group(GtkWidget * page)
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, COL_SPACING);
label = gtk_label_new(_("When mail arrives:"));
- gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ gtk_widget_set_halign(label, GTK_ALIGN_START);
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
pui->notify_new_mail_dialog =
@@ -1933,7 +1933,6 @@ quoted_group(GtkWidget * page)
gtk_widget_set_hexpand(pui->browse_wrap_length, TRUE);
gtk_grid_attach(grid, pui->browse_wrap_length, 1, row, 1, 1);
label = gtk_label_new(_("characters"));
- gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
gtk_widget_set_halign(label, GTK_ALIGN_START);
gtk_grid_attach(grid, label, 2, row, 1, 1);
@@ -2017,7 +2016,7 @@ mdn_group(GtkWidget * page)
"send it if:"));
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
- gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ gtk_widget_set_halign(label, GTK_ALIGN_START);
pm_group_add(group, label, FALSE);
grid = create_grid(page);
@@ -2195,7 +2194,7 @@ main_window_group(GtkWidget * page)
gtk_widget_set_hexpand(pui->pgdown_percent, TRUE);
gtk_grid_attach(grid, pui->pgdown_percent, 1, 0, 1, 1);
label = gtk_label_new(_("percent"));
- gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ gtk_widget_set_halign(label, GTK_ALIGN_START);
gtk_grid_attach(grid, label, 2, 0, 1, 1);
return group;
@@ -2524,7 +2523,7 @@ add_pref_menu(const gchar* label, const gchar *names[], gint size,
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, padding);
lbw = gtk_label_new(label);
- gtk_misc_set_alignment(GTK_MISC(lbw), 0, 0.5);
+ gtk_widget_set_halign(lbw, GTK_ALIGN_START);
pm_page_add_to_size_group(page, lbw);
gtk_box_pack_start(GTK_BOX(hbox), lbw, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox), omenu, TRUE, TRUE, 0);
@@ -2641,7 +2640,8 @@ deleting_messages_group(GtkWidget * page)
g_free(text);
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
- gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+ gtk_widget_set_halign(label, GTK_ALIGN_START);
+ gtk_widget_set_valign(label, GTK_ALIGN_START);
pm_group_add(group, label, FALSE);
pui->hide_deleted =
pm_group_add_check(group, _("Hide messages marked as deleted"));
@@ -2649,7 +2649,8 @@ deleting_messages_group(GtkWidget * page)
label = gtk_label_new(_("The following settings are global:"));
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
- gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+ gtk_widget_set_halign(label, GTK_ALIGN_START);
+ gtk_widget_set_valign(label, GTK_ALIGN_START);
pm_group_add(group, label, FALSE);
pui->expunge_on_close =
pm_group_add_check(group, _("Expunge deleted messages "
@@ -2744,13 +2745,14 @@ folder_scanning_group(GtkWidget * page)
"choose a greater depth."));
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
- gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+ gtk_widget_set_halign(label, GTK_ALIGN_START);
+ gtk_widget_set_valign(label, GTK_ALIGN_START);
pm_group_add(group, label, FALSE);
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, COL_SPACING);
pm_group_add(group, hbox, FALSE);
label = gtk_label_new(_("Scan local folders to depth"));
- gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ gtk_widget_set_halign(label, GTK_ALIGN_START);
pm_page_add_to_size_group(page, label);
gtk_box_pack_start(GTK_BOX(hbox), label,
FALSE, FALSE, 0);
@@ -2762,7 +2764,7 @@ folder_scanning_group(GtkWidget * page)
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, COL_SPACING);
pm_group_add(group, hbox, FALSE);
label = gtk_label_new(_("Scan IMAP folders to depth"));
- gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ gtk_widget_set_halign(label, GTK_ALIGN_START);
pm_page_add_to_size_group(page, label);
gtk_box_pack_start(GTK_BOX(hbox), label,
FALSE, FALSE, 0);
@@ -3610,7 +3612,7 @@ pm_group_new(const gchar * text)
gtk_label_set_markup(GTK_LABEL(label), markup);
g_free(markup);
gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
- gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ gtk_widget_set_halign(label, GTK_ALIGN_START);
gtk_box_pack_start(GTK_BOX(group), label, FALSE, FALSE, 0);
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
diff --git a/src/print-gtk.c b/src/print-gtk.c
index 5625e07..c946afc 100644
--- a/src/print-gtk.c
+++ b/src/print-gtk.c
@@ -509,7 +509,7 @@ message_prefs_widget(GtkPrintOperation * operation,
gtk_label_set_markup(GTK_LABEL(label), markup);
g_free(markup);
gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
- gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ gtk_widget_set_halign(label, GTK_ALIGN_START);
gtk_box_pack_start(GTK_BOX(group), label, FALSE, FALSE, 0);
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
@@ -543,7 +543,7 @@ message_prefs_widget(GtkPrintOperation * operation,
gtk_label_set_markup(GTK_LABEL(label), markup);
g_free(markup);
gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
- gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ gtk_widget_set_halign(label, GTK_ALIGN_START);
gtk_box_pack_start(GTK_BOX(group), label, FALSE, FALSE, 0);
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
@@ -578,7 +578,7 @@ message_prefs_widget(GtkPrintOperation * operation,
gtk_label_set_markup(GTK_LABEL(label), markup);
g_free(markup);
gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
- gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ gtk_widget_set_halign(label, GTK_ALIGN_START);
gtk_box_pack_start(GTK_BOX(group), label, FALSE, FALSE, 0);
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
diff --git a/src/sendmsg-window.c b/src/sendmsg-window.c
index d46ea03..58aa5fa 100644
--- a/src/sendmsg-window.c
+++ b/src/sendmsg-window.c
@@ -2303,9 +2303,8 @@ create_email_or_string_entry(BalsaSendmsg * bsmsg,
arr[0] = gtk_label_new_with_mnemonic(label);
gtk_size_group_add_widget(bsmsg->size_group, arr[0]);
gtk_label_set_mnemonic_widget(GTK_LABEL(arr[0]), mnemonic_widget);
- gtk_misc_set_alignment(GTK_MISC(arr[0]), 0.0, 0.5);
- gtk_misc_set_padding(GTK_MISC(arr[0]), GNOME_PAD_SMALL,
- GNOME_PAD_SMALL);
+ gtk_widget_set_halign(arr[0], GTK_ALIGN_START);
+ g_object_set(arr[0], "margin", GNOME_PAD_SMALL, NULL);
gtk_grid_attach(GTK_GRID(grid), arr[0], 0, y_pos, 1, 1);
if (!balsa_app.use_system_fonts) {
@@ -2664,9 +2663,8 @@ sw_attachment_list(BalsaSendmsg *bsmsg)
/* Attachment list */
label = gtk_label_new_with_mnemonic(_("_Attachments:"));
gtk_size_group_add_widget(bsmsg->size_group, label);
- gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
- gtk_misc_set_padding(GTK_MISC(label), GNOME_PAD_SMALL,
- GNOME_PAD_SMALL);
+ gtk_widget_set_halign(label, GTK_ALIGN_START);
+ g_object_set(label, "margin", GNOME_PAD_SMALL, NULL);
gtk_grid_attach(GTK_GRID(grid), label, 0, 0, 1, 1);
sw = gtk_scrolled_window_new(NULL, NULL);
@@ -2687,7 +2685,6 @@ sw_attachment_list(BalsaSendmsg *bsmsg)
gtk_widget_set_vexpand(tree_view, TRUE);
view = GTK_TREE_VIEW(tree_view);
gtk_tree_view_set_headers_visible(view, TRUE);
- gtk_tree_view_set_rules_hint(view, TRUE);
g_object_unref(store);
/* column for type icon */
@@ -3356,11 +3353,12 @@ quote_parts_select_dlg(GtkTreeStore *tree_store, GtkWindow * parent)
" which shall be quoted in the reply"));
gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
gtk_label_set_selectable(GTK_LABEL(label), TRUE);
- gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
+ gtk_widget_set_halign(label, GTK_ALIGN_START);
+ gtk_widget_set_valign(label, GTK_ALIGN_START);
image = gtk_image_new_from_icon_name("dialog-question",
GTK_ICON_SIZE_DIALOG);
- gtk_misc_set_alignment(GTK_MISC(image), 0.5, 0.0);
+ gtk_widget_set_valign(image, GTK_ALIGN_START);
/* stolen form gtk/gtkmessagedialog.c */
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
@@ -4990,10 +4988,8 @@ subject_not_empty(BalsaSendmsg * bsmsg)
gchar *text_str;
GtkWidget *label;
GtkWidget *subj_entry;
- GtkWidget *dialog_action_area;
GtkWidget *cnclbutton;
GtkWidget *okbutton;
- GtkWidget *alignment;
gint response;
/* read the subject widget and verify that it is contains something else
@@ -5024,7 +5020,7 @@ subject_not_empty(BalsaSendmsg * bsmsg)
image = gtk_image_new_from_icon_name("dialog-question",
GTK_ICON_SIZE_DIALOG);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
- gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0);
+ gtk_widget_set_valign(image, GTK_ALIGN_START);
vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12);
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
@@ -5037,7 +5033,8 @@ subject_not_empty(BalsaSendmsg * bsmsg)
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (label), 0, 0);
+ gtk_widget_set_halign(label, GTK_ALIGN_START);
+ gtk_widget_set_valign(label, GTK_ALIGN_START);
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
@@ -5050,9 +5047,6 @@ subject_not_empty(BalsaSendmsg * bsmsg)
gtk_box_pack_start (GTK_BOX (hbox), subj_entry, TRUE, TRUE, 0);
gtk_entry_set_activates_default (GTK_ENTRY (subj_entry), TRUE);
- dialog_action_area =
- gtk_dialog_get_action_area(GTK_DIALOG(no_subj_dialog));
- gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area), GTK_BUTTONBOX_END);
cnclbutton = gtk_button_new_with_mnemonic(_("_Cancel"));
gtk_dialog_add_action_widget (GTK_DIALOG (no_subj_dialog), cnclbutton, GTK_RESPONSE_CANCEL);
@@ -5064,11 +5058,10 @@ subject_not_empty(BalsaSendmsg * bsmsg)
gtk_dialog_set_default_response(GTK_DIALOG (no_subj_dialog),
GTK_RESPONSE_OK);
- alignment = gtk_alignment_new (0.5, 0.5, 0, 0);
- gtk_container_add (GTK_CONTAINER (okbutton), alignment);
-
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
- gtk_container_add (GTK_CONTAINER (alignment), hbox);
+ gtk_widget_set_halign(hbox, GTK_ALIGN_CENTER);
+ gtk_widget_set_valign(hbox, GTK_ALIGN_CENTER);
+ gtk_container_add (GTK_CONTAINER (okbutton), hbox);
image = gtk_image_new_from_icon_name(BALSA_PIXMAP_SEND,
GTK_ICON_SIZE_BUTTON);
@@ -5140,9 +5133,7 @@ check_suggest_encryption(BalsaSendmsg * bsmsg)
if (can_encrypt) {
GtkWidget *dialog;
gint choice;
- GtkWidget *dialog_action_area;
GtkWidget *button;
- GtkWidget *alignment;
GtkWidget *hbox;
GtkWidget *image;
GtkWidget *label;
@@ -5161,18 +5152,16 @@ check_suggest_encryption(BalsaSendmsg * bsmsg)
libbalsa_macosx_menu_for_parent(dialog, GTK_WINDOW(bsmsg->window));
#endif
- dialog_action_area = gtk_dialog_get_action_area(GTK_DIALOG(dialog));
- gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog_action_area), GTK_BUTTONBOX_END);
button = gtk_button_new();
gtk_dialog_add_action_widget(GTK_DIALOG(dialog), button, GTK_RESPONSE_YES);
gtk_widget_set_can_default(button, TRUE);
gtk_widget_grab_focus(button);
- alignment = gtk_alignment_new (0.5, 0.5, 0, 0);
- gtk_container_add(GTK_CONTAINER(button), alignment);
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
- gtk_container_add(GTK_CONTAINER(alignment), hbox);
+ gtk_widget_set_halign(hbox, GTK_ALIGN_CENTER);
+ gtk_widget_set_valign(hbox, GTK_ALIGN_CENTER);
+ gtk_container_add(GTK_CONTAINER(button), hbox);
image = gtk_image_new_from_icon_name(BALSA_PIXMAP_GPG_ENCRYPT,
GTK_ICON_SIZE_BUTTON);
gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0);
@@ -5183,11 +5172,11 @@ check_suggest_encryption(BalsaSendmsg * bsmsg)
button = gtk_button_new();
gtk_dialog_add_action_widget(GTK_DIALOG(dialog), button, GTK_RESPONSE_NO);
gtk_widget_set_can_default(button, TRUE);
- alignment = gtk_alignment_new (0.5, 0.5, 0, 0);
- gtk_container_add(GTK_CONTAINER(button), alignment);
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
- gtk_container_add(GTK_CONTAINER(alignment), hbox);
+ gtk_widget_set_halign(hbox, GTK_ALIGN_CENTER);
+ gtk_widget_set_valign(hbox, GTK_ALIGN_CENTER);
+ gtk_container_add(GTK_CONTAINER(button), hbox);
image = gtk_image_new_from_icon_name(BALSA_PIXMAP_SEND,
GTK_ICON_SIZE_BUTTON);
gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]