[balsa] Fix deprecation issues in gtk 3.22



commit 1a894f5f0e2776d6ad963bf5a6b4d2aa708ee8e8
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Fri Oct 21 23:37:54 2016 -0400

    Fix deprecation issues in gtk 3.22
    
        Replace gtk_window_set_wmclass, which is deprecated in gtk 3.22,
        with gtk_window_set_role.
    
        * libbalsa/libbalsa.c (ask_cert_real), (ask_timeout_real):
        * libbalsa/send.c (ensure_send_progress_dialog):
        * libbalsa/source-viewer.c (libbalsa_show_message_source):
        * src/ab-window.c (balsa_ab_window_init):
        * src/filter-edit-dialog.c (filters_edit_dialog):
        * src/filter-export-dialog.c (filters_export_dialog):
        * src/filter-run-dialog.c (balsa_filter_run_dialog_new):
        * src/folder-conf.c (folder_conf_imap_node),
        (folder_conf_imap_sub_node):
        * src/information-dialog.c (balsa_information_list):
        * src/main-window.c (ensure_check_mail_dialog),
        (bw_display_new_mail_notification):
        * src/message-window.c (message_window_new):
        * src/sendmsg-window.c (sendmsg_window_new):
        * src/toolbar-prefs.c (customize_dialog_cb):

 ChangeLog                  |   23 +++++++++++++++++++++++
 libbalsa/libbalsa.c        |    4 ++--
 libbalsa/send.c            |    2 +-
 libbalsa/source-viewer.c   |    2 +-
 src/ab-window.c            |    2 +-
 src/filter-edit-dialog.c   |    2 +-
 src/filter-export-dialog.c |    3 +--
 src/filter-run-dialog.c    |    2 +-
 src/folder-conf.c          |    6 ++----
 src/information-dialog.c   |    3 +--
 src/main-window.c          |    9 +++------
 src/message-window.c       |    2 +-
 src/sendmsg-window.c       |    2 +-
 src/toolbar-prefs.c        |    3 +--
 14 files changed, 40 insertions(+), 25 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7568551..a1eb709 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,29 @@
 2016-10-21  Peter Bloomfield  <pbloomfield bellsouth net>
 
        Fix deprecation issues in gtk 3.22
+       
+       Replace gtk_window_set_wmclass, which is deprecated in gtk 3.22,
+       with gtk_window_set_role.
+
+       * libbalsa/libbalsa.c (ask_cert_real), (ask_timeout_real):
+       * libbalsa/send.c (ensure_send_progress_dialog):
+       * libbalsa/source-viewer.c (libbalsa_show_message_source):
+       * src/ab-window.c (balsa_ab_window_init):
+       * src/filter-edit-dialog.c (filters_edit_dialog):
+       * src/filter-export-dialog.c (filters_export_dialog):
+       * src/filter-run-dialog.c (balsa_filter_run_dialog_new):
+       * src/folder-conf.c (folder_conf_imap_node),
+       (folder_conf_imap_sub_node):
+       * src/information-dialog.c (balsa_information_list):
+       * src/main-window.c (ensure_check_mail_dialog),
+       (bw_display_new_mail_notification):
+       * src/message-window.c (message_window_new):
+       * src/sendmsg-window.c (sendmsg_window_new):
+       * src/toolbar-prefs.c (customize_dialog_cb):
+
+2016-10-21  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       Fix deprecation issues in gtk 3.22
 
        The Gtk+ API for popping up context menus has changed in 3.22;
        gtk_menu_popup is deprecated.
diff --git a/libbalsa/libbalsa.c b/libbalsa/libbalsa.c
index c6f8ea5..ad92f80 100644
--- a/libbalsa/libbalsa.c
+++ b/libbalsa/libbalsa.c
@@ -559,7 +559,7 @@ ask_cert_real(void *data)
                                          _("Accept&_Save"), 1,
                                          _("_Reject"), GTK_RESPONSE_CANCEL, 
                                          NULL);
-    gtk_window_set_wmclass(GTK_WINDOW(dialog), "tls_cert_dialog", "Balsa");
+    gtk_window_set_role(GTK_WINDOW(dialog), "tls_cert_dialog");
     label = gtk_label_new(str->str);
     g_string_free(str, TRUE);
     gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
@@ -606,7 +606,7 @@ ask_timeout_real(void *data)
                                     GTK_BUTTONS_YES_NO,
                                     _("Connection to %s timed out. Abort?"),
                                     host);
-    gtk_window_set_wmclass(GTK_WINDOW(dialog), "timeout_dialog", "Balsa");
+    gtk_window_set_role(GTK_WINDOW(dialog), "timeout_dialog");
     switch(gtk_dialog_run(GTK_DIALOG(dialog))) {
     case GTK_RESPONSE_YES: i = 1; break;
     case GTK_RESPONSE_NO: i = 0; break;
diff --git a/libbalsa/send.c b/libbalsa/send.c
index 4d67ab4..98ee40d 100644
--- a/libbalsa/send.c
+++ b/libbalsa/send.c
@@ -249,7 +249,7 @@ ensure_send_progress_dialog(GtkWindow * parent)
                                               libbalsa_dialog_flags(),
                                               _("_Hide"), GTK_RESPONSE_CLOSE,
                                               NULL);
-    gtk_window_set_wmclass(GTK_WINDOW(send_dialog), "send_dialog", "Balsa");
+    gtk_window_set_role(GTK_WINDOW(send_dialog), "send_dialog");
     label = gtk_label_new(_("Sending Mail..."));
     content_box =
         GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(send_dialog)));
diff --git a/libbalsa/source-viewer.c b/libbalsa/source-viewer.c
index 2c9fb7f..8ab3f9c 100644
--- a/libbalsa/source-viewer.c
+++ b/libbalsa/source-viewer.c
@@ -231,7 +231,7 @@ libbalsa_show_message_source(GtkApplication  * application,
 
     window = gtk_application_window_new(application);
     gtk_window_set_title(GTK_WINDOW(window), _("Message Source"));
-    gtk_window_set_wmclass(GTK_WINDOW(window), "message-source", "Balsa");
+    gtk_window_set_role(GTK_WINDOW(window), "message-source");
     gtk_window_set_default_size(GTK_WINDOW(window), *width, *height);
 
     ui_file = g_build_filename(BALSA_DATA_PREFIX, "ui", "source-viewer.ui",
diff --git a/src/ab-window.c b/src/ab-window.c
index cf877ac..80ff2b1 100644
--- a/src/ab-window.c
+++ b/src/ab-window.c
@@ -237,7 +237,7 @@ balsa_ab_window_init(BalsaAbWindow *ab)
 
     vbox = gtk_dialog_get_content_area(GTK_DIALOG(ab));
 
-    gtk_window_set_wmclass(GTK_WINDOW(ab), "addressbook", "Balsa");
+    gtk_window_set_role(GTK_WINDOW(ab), "addressbook");
 
     /* hig defaults */
     gtk_container_set_border_width(GTK_CONTAINER(ab), 6);
diff --git a/src/filter-edit-dialog.c b/src/filter-edit-dialog.c
index 048b4fe..ac31d96 100644
--- a/src/filter-edit-dialog.c
+++ b/src/filter-edit-dialog.c
@@ -577,7 +577,7 @@ filters_edit_dialog(GtkWindow * parent)
     g_signal_connect(G_OBJECT(fe_window), "destroy",
                     G_CALLBACK(fe_destroy_window_cb), NULL);
 
-    gtk_window_set_wmclass(GTK_WINDOW (fe_window), "filter-edit", "Balsa");
+    gtk_window_set_role(GTK_WINDOW (fe_window), "filter-edit");
     gtk_dialog_set_response_sensitive(GTK_DIALOG(fe_window),
                                       GTK_RESPONSE_OK, FALSE);
 
diff --git a/src/filter-export-dialog.c b/src/filter-export-dialog.c
index 4274404..807b309 100644
--- a/src/filter-export-dialog.c
+++ b/src/filter-export-dialog.c
@@ -79,8 +79,7 @@ filters_export_dialog(GtkWindow * parent)
                                     _("_Cancel"), GTK_RESPONSE_CANCEL,
                                     _("_Help"), GTK_RESPONSE_HELP,
                                     NULL);
-    gtk_window_set_wmclass(GTK_WINDOW(fex_window), "filter-export",
-                           "Balsa");
+    gtk_window_set_role(GTK_WINDOW(fex_window), "filter-export");
 
     sw = gtk_scrolled_window_new(NULL, NULL);
     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
diff --git a/src/filter-run-dialog.c b/src/filter-run-dialog.c
index 9b337fd..d2746c2 100644
--- a/src/filter-run-dialog.c
+++ b/src/filter-run-dialog.c
@@ -192,7 +192,7 @@ balsa_filter_run_dialog_new(LibBalsaMailbox * mbox, GtkWindow * parent)
     dialog_title=g_strconcat(_("Filters of Mailbox: "),
                              p->mbox->name,NULL);
     gtk_window_set_title(GTK_WINDOW(p),dialog_title);
-    gtk_window_set_wmclass(GTK_WINDOW(p), "filter-run", "Balsa");
+    gtk_window_set_role(GTK_WINDOW(p), "filter-run");
     g_free(dialog_title);
 
     /* Load associated filters if needed */
diff --git a/src/folder-conf.c b/src/folder-conf.c
index f381282..fe801b5 100644
--- a/src/folder-conf.c
+++ b/src/folder-conf.c
@@ -309,8 +309,7 @@ folder_conf_imap_node(BalsaMailboxNode *mn)
 #endif
     g_object_add_weak_pointer(G_OBJECT(fcw->dialog),
                               (gpointer) &fcw->dialog);
-    gtk_window_set_wmclass(GTK_WINDOW(fcw->dialog), 
-                          "folder_config_dialog", "Balsa");
+    gtk_window_set_role(GTK_WINDOW(fcw->dialog), "folder_config_dialog");
     if (mn) {
         g_object_set_data_full(G_OBJECT(mn),
                                BALSA_FOLDER_CONF_IMAP_KEY, fcw, 
@@ -807,8 +806,7 @@ folder_conf_imap_sub_node(BalsaMailboxNode * mn)
                               (gpointer) &sdd->dialog);
     /* `Enter' key => Create: */
     gtk_dialog_set_default_response(GTK_DIALOG(sdd->dialog), GTK_RESPONSE_OK);
-    gtk_window_set_wmclass(GTK_WINDOW(sdd->dialog), 
-                          "subfolder_config_dialog", "Balsa");
+    gtk_window_set_role(GTK_WINDOW(sdd->dialog), "subfolder_config_dialog");
 
     if (sdd->mbnode) {
         g_object_set_data_full(G_OBJECT(sdd->mbnode),
diff --git a/src/information-dialog.c b/src/information-dialog.c
index b1384d7..d04da44 100644
--- a/src/information-dialog.c
+++ b/src/information-dialog.c
@@ -245,8 +245,7 @@ balsa_information_list(GtkWindow *parent, LibBalsaInformationType type,
        /* Reset the policy gtk_dialog_new makes itself non-resizable */
        gtk_window_set_resizable(GTK_WINDOW(information_dialog), TRUE);
        gtk_window_set_default_size(GTK_WINDOW(information_dialog), 350, 200);
-       gtk_window_set_wmclass(GTK_WINDOW(information_dialog),
-                              "Information", "Balsa");
+       gtk_window_set_role(GTK_WINDOW(information_dialog), "Information");
 
         g_object_add_weak_pointer(G_OBJECT(information_dialog),
                                   (gpointer) &information_list);
diff --git a/src/main-window.c b/src/main-window.c
index 026fc82..9c815e1 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -3259,8 +3259,7 @@ ensure_check_mail_dialog(BalsaWindow * window)
 #if HAVE_MACOSX_DESKTOP
     libbalsa_macosx_menu_for_parent(progress_dialog, GTK_WINDOW(window));
 #endif
-    gtk_window_set_wmclass(GTK_WINDOW(progress_dialog),
-                          "progress_dialog", "Balsa");
+    gtk_window_set_role(GTK_WINDOW(progress_dialog), "progress_dialog");
 
     g_signal_connect(G_OBJECT(progress_dialog), "destroy",
                     G_CALLBACK(bw_progress_dialog_destroy_cb), NULL);
@@ -3778,8 +3777,7 @@ bw_display_new_mail_notification(int num_new, int has_new)
                     GTK_MESSAGE_INFO,
                     GTK_BUTTONS_OK, "%s", msg);
             gtk_window_set_title(GTK_WINDOW(dlg), _("Balsa: New mail"));
-            gtk_window_set_wmclass(GTK_WINDOW(dlg), "new_mail_dialog",
-                    "Balsa");
+            gtk_window_set_role(GTK_WINDOW(dlg), "new_mail_dialog");
             gtk_window_set_type_hint(GTK_WINDOW(dlg),
                     GDK_WINDOW_TYPE_HINT_NORMAL);
             g_signal_connect(G_OBJECT(dlg), "response",
@@ -3814,8 +3812,7 @@ bw_display_new_mail_notification(int num_new, int has_new)
                                      GTK_MESSAGE_INFO,
                                      GTK_BUTTONS_OK, "%s", msg);
         gtk_window_set_title(GTK_WINDOW(dlg), _("Balsa: New mail"));
-        gtk_window_set_wmclass(GTK_WINDOW(dlg), "new_mail_dialog",
-                               "Balsa");
+        gtk_window_set_role(GTK_WINDOW(dlg), "new_mail_dialog");
         gtk_window_set_type_hint(GTK_WINDOW(dlg),
                                  GDK_WINDOW_TYPE_HINT_NORMAL);
         g_signal_connect(G_OBJECT(dlg), "response",
diff --git a/src/message-window.c b/src/message-window.c
index db9bfa0..3e7b56f 100644
--- a/src/message-window.c
+++ b/src/message-window.c
@@ -864,7 +864,7 @@ message_window_new(LibBalsaMailbox * mailbox, guint msgno)
     mw->toolbar = balsa_toolbar_new(model, G_ACTION_MAP(window));
     gtk_box_pack_start(GTK_BOX(vbox), mw->toolbar, FALSE, FALSE, 0);
 
-    gtk_window_set_wmclass(GTK_WINDOW(window), "message", "Balsa");
+    gtk_window_set_role(GTK_WINDOW(window), "message");
 
     g_signal_connect(G_OBJECT(window), "destroy",
                     G_CALLBACK(destroy_message_window), mw);
diff --git a/src/sendmsg-window.c b/src/sendmsg-window.c
index 3a31a7e..55d18ae 100644
--- a/src/sendmsg-window.c
+++ b/src/sendmsg-window.c
@@ -6606,7 +6606,7 @@ sendmsg_window_new()
     if (balsa_app.sw_maximized)
         gtk_window_maximize(GTK_WINDOW(window));
 
-    gtk_window_set_wmclass(GTK_WINDOW(window), "compose", "Balsa");
+    gtk_window_set_role(GTK_WINDOW(window), "compose");
 
     gtk_container_add(GTK_CONTAINER(window), main_box);
     gtk_widget_show_all(window);
diff --git a/src/toolbar-prefs.c b/src/toolbar-prefs.c
index 6177d53..f8b1a7a 100644
--- a/src/toolbar-prefs.c
+++ b/src/toolbar-prefs.c
@@ -153,8 +153,7 @@ customize_dialog_cb(GtkWidget * widget, gpointer data)
         gtk_dialog_get_content_area(GTK_DIALOG(customize_widget));
     gtk_box_pack_start(GTK_BOX(content_area), notebook, TRUE, TRUE, 0);
 
-    gtk_window_set_wmclass(GTK_WINDOW(customize_widget), "customize",
-                           "Balsa");
+    gtk_window_set_role(GTK_WINDOW(customize_widget), "customize");
     gtk_window_set_default_size(GTK_WINDOW(customize_widget), 600, 440);
 
     /* The order of pages must be consistent with the BalsaToolbarType


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]