[network-manager-applet/lr/ui-improvements: 8/9] all: get rid of all GtkStock



commit a7f9c9e4eadbb4dfa02785764c1b5bfc1fbe82da
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Mon Jun 26 14:12:42 2017 +0200

    all: get rid of all GtkStock
    
    It's deprecated, discouraged and even doesn't work anymore in some cases
    (GTK_STOCK_NETWORK).

 src/applet-device-ethernet.c                 |    4 ++--
 src/applet-dialogs.c                         |    6 +++---
 src/applet.c                                 |    2 +-
 src/connection-editor/ce-polkit-button.c     |   14 +++++++-------
 src/connection-editor/ce-polkit-button.h     |    2 +-
 src/connection-editor/connection-helpers.c   |    8 ++++----
 src/connection-editor/nm-connection-editor.c |    2 +-
 src/connection-editor/nm-connection-list.c   |    4 ++--
 src/connection-editor/page-bluetooth.c       |    4 ++--
 src/connection-editor/page-mobile.c          |    4 ++--
 src/connection-editor/page-proxy.c           |    4 ++--
 src/connection-editor/page-team-port.c       |    4 ++--
 src/connection-editor/page-team.c            |    4 ++--
 src/connection-editor/vpn-helpers.c          |    4 ++--
 src/libnm-gtk/nm-mobile-wizard.c             |    2 +-
 src/libnm-gtk/nm-vpn-password-dialog.c       |   19 ++++++-------------
 src/libnm-gtk/nm-wifi-dialog.c               |   17 +++--------------
 src/libnma/nma-mobile-wizard.c               |    2 +-
 src/libnma/nma-vpn-password-dialog.c         |   19 ++++++-------------
 src/libnma/nma-wifi-dialog.c                 |   17 +++--------------
 src/mobile-helpers.c                         |    4 ++--
 21 files changed, 55 insertions(+), 91 deletions(-)
---
diff --git a/src/applet-device-ethernet.c b/src/applet-device-ethernet.c
index da2a89f..1ba6d83 100644
--- a/src/applet-device-ethernet.c
+++ b/src/applet-device-ethernet.c
@@ -346,8 +346,8 @@ pppoe_get_secrets (SecretsRequest *req, GError **error)
        gtk_window_set_title (GTK_WINDOW (info->dialog), _("DSL authentication"));
        gtk_window_set_modal (GTK_WINDOW (info->dialog), TRUE);
 
-       gtk_dialog_add_button (GTK_DIALOG (info->dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT);
-       w = gtk_dialog_add_button (GTK_DIALOG (info->dialog), GTK_STOCK_OK, GTK_RESPONSE_OK);
+       gtk_dialog_add_button (GTK_DIALOG (info->dialog), _("_Cancel"), GTK_RESPONSE_REJECT);
+       w = gtk_dialog_add_button (GTK_DIALOG (info->dialog), _("_OK"), GTK_RESPONSE_OK);
        info->ok_button = w;
 
        gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (info->dialog))),
diff --git a/src/applet-dialogs.c b/src/applet-dialogs.c
index a49b7bb..cf5b76c 100644
--- a/src/applet-dialogs.c
+++ b/src/applet-dialogs.c
@@ -1025,7 +1025,7 @@ applet_missing_ui_warning_dialog_show (void)
 
        /* Bash focus-stealing prevention in the face */
        gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ALWAYS);
-       gtk_window_set_icon_name (GTK_WINDOW (dialog), GTK_STOCK_DIALOG_ERROR);
+       gtk_window_set_icon_name (GTK_WINDOW (dialog), "dialog-error");
        gtk_window_set_title (GTK_WINDOW (dialog), _("Missing resources"));
        gtk_widget_realize (dialog);
        gtk_widget_show (dialog);
@@ -1053,8 +1053,8 @@ applet_mobile_password_dialog_new (NMConnection *connection,
        gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
        gtk_window_set_title (GTK_WINDOW (dialog), _("Mobile broadband network password"));
 
-       gtk_dialog_add_button (dialog, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT);
-       w = gtk_dialog_add_button (dialog, GTK_STOCK_OK, GTK_RESPONSE_OK);
+       gtk_dialog_add_button (dialog, _("_Cancel"), GTK_RESPONSE_REJECT);
+       w = gtk_dialog_add_button (dialog, _("_OK"), GTK_RESPONSE_OK);
        gtk_window_set_default (GTK_WINDOW (dialog), w);
 
        s_con = nm_connection_get_setting_connection (connection);
diff --git a/src/applet.c b/src/applet.c
index 0607961..e860770 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -742,7 +742,7 @@ applet_do_notify (NMApplet *applet,
        escaped = utils_escape_notify_message (message);
        notify = notify_notification_new (summary,
                                          escaped,
-                                         icon ? icon : GTK_STOCK_NETWORK
+                                         icon ? icon : "network-workgroup"
 #if HAVE_LIBNOTIFY_07
                                          );
 #else
diff --git a/src/connection-editor/ce-polkit-button.c b/src/connection-editor/ce-polkit-button.c
index 677cffe..d97cf1c 100644
--- a/src/connection-editor/ce-polkit-button.c
+++ b/src/connection-editor/ce-polkit-button.c
@@ -35,7 +35,7 @@ typedef struct {
        char *auth_tooltip;
        char *validation_error;
 
-       GtkWidget *stock;
+       GtkWidget *icon;
        GtkWidget *auth;
 
        NMClient *client;
@@ -74,7 +74,7 @@ update_button (CEPolkitButton *self)
                gtk_widget_set_tooltip_text (GTK_WIDGET (self), _("No polkit authorization to perform the 
action"));
 
        if (priv->permission_result == NM_CLIENT_PERMISSION_RESULT_YES)
-               gtk_button_set_image (GTK_BUTTON (self), priv->stock);
+               gtk_button_set_image (GTK_BUTTON (self), priv->icon);
        else
                gtk_button_set_image (GTK_BUTTON (self), priv->auth);
 }
@@ -162,7 +162,7 @@ GtkWidget *
 ce_polkit_button_new (const char *label,
                       const char *tooltip,
                       const char *auth_tooltip,
-                      const char *stock_icon,
+                      const char *icon_name,
                       NMClient *client,
                       NMClientPermission permission)
 {
@@ -185,9 +185,9 @@ ce_polkit_button_new (const char *label,
                                          G_CALLBACK (permission_changed_cb),
                                          object);
 
-       priv->stock = gtk_image_new_from_stock (stock_icon, GTK_ICON_SIZE_BUTTON);
-       g_object_ref_sink (priv->stock);
-       priv->auth = gtk_image_new_from_stock (GTK_STOCK_DIALOG_AUTHENTICATION, GTK_ICON_SIZE_BUTTON);
+       priv->icon = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON);
+       g_object_ref_sink (priv->icon);
+       priv->auth = gtk_image_new_from_icon_name ("dialog-password", GTK_ICON_SIZE_BUTTON);
        g_object_ref_sink (priv->auth);
 
        gtk_button_set_label (GTK_BUTTON (object), label);
@@ -213,7 +213,7 @@ dispose (GObject *object)
 
        g_clear_object (&priv->client);
        g_clear_object (&priv->auth);
-       g_clear_object (&priv->stock);
+       g_clear_object (&priv->icon);
 
        G_OBJECT_CLASS (ce_polkit_button_parent_class)->dispose (object);
 }
diff --git a/src/connection-editor/ce-polkit-button.h b/src/connection-editor/ce-polkit-button.h
index a81963b..6a016f0 100644
--- a/src/connection-editor/ce-polkit-button.h
+++ b/src/connection-editor/ce-polkit-button.h
@@ -52,7 +52,7 @@ GType ce_polkit_button_get_type (void);
 GtkWidget *ce_polkit_button_new (const char *label,
                                  const char *tooltip,
                                  const char *auth_tooltip,
-                                 const char *stock_icon,
+                                 const char *icon_name,
                                  NMClient *client,
                                  NMClientPermission permission);
 
diff --git a/src/connection-editor/connection-helpers.c b/src/connection-editor/connection-helpers.c
index 5ec4d04..1a65cb6 100644
--- a/src/connection-editor/connection-helpers.c
+++ b/src/connection-editor/connection-helpers.c
@@ -305,8 +305,8 @@ vpn_connection_import (FUNC_TAG_PAGE_NEW_CONNECTION_IMPL,
        dialog = gtk_file_chooser_dialog_new (_("Select file to import"),
                                              NULL,
                                              GTK_FILE_CHOOSER_ACTION_OPEN,
-                                             GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-                                             GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+                                             _("_Cancel"), GTK_RESPONSE_CANCEL,
+                                             _("_Open"), GTK_RESPONSE_ACCEPT,
                                              NULL);
        home_folder = g_get_home_dir ();
        gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), home_folder);
@@ -768,8 +768,8 @@ delete_connection (GtkWindow *parent_window,
                                         _("Are you sure you wish to delete the connection %s?"),
                                         id);
        gtk_dialog_add_buttons (GTK_DIALOG (dialog),
-                               GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-                               GTK_STOCK_DELETE, GTK_RESPONSE_YES,
+                               _("_Cancel"), GTK_RESPONSE_CANCEL,
+                               _("_Delete"), GTK_RESPONSE_YES,
                                NULL);
 
        result = gtk_dialog_run (GTK_DIALOG (dialog));
diff --git a/src/connection-editor/nm-connection-editor.c b/src/connection-editor/nm-connection-editor.c
index 7d101e2..4193246 100644
--- a/src/connection-editor/nm-connection-editor.c
+++ b/src/connection-editor/nm-connection-editor.c
@@ -578,7 +578,7 @@ nm_connection_editor_new (GtkWindow *parent_window,
        editor->ok_button = ce_polkit_button_new (_("_Save"),
                                                  _("Save any changes made to this connection."),
                                                  _("Authenticate to save this connection for all users of 
this machine."),
-                                                 GTK_STOCK_APPLY,
+                                                 "emblem-ok-symbolic",
                                                  client,
                                                  NM_CLIENT_PERMISSION_SETTINGS_MODIFY_SYSTEM);
        gtk_button_set_use_underline (GTK_BUTTON (editor->ok_button), TRUE);
diff --git a/src/connection-editor/nm-connection-list.c b/src/connection-editor/nm-connection-list.c
index 3ef6f18..993df9a 100644
--- a/src/connection-editor/nm-connection-list.c
+++ b/src/connection-editor/nm-connection-list.c
@@ -695,7 +695,7 @@ add_connection_buttons (NMConnectionList *self)
        button = ce_polkit_button_new (_("_Edit"),
                                       _("Edit the selected connection"),
                                       _("Authenticate to edit the selected connection"),
-                                      GTK_STOCK_EDIT,
+                                      "emblem-system-symbolic",
                                       self->client,
                                       NM_CLIENT_PERMISSION_SETTINGS_MODIFY_SYSTEM);
        g_object_set_data (G_OBJECT (button), "NMConnectionList", self);
@@ -711,7 +711,7 @@ add_connection_buttons (NMConnectionList *self)
        button = ce_polkit_button_new (_("_Delete"),
                                       _("Delete the selected connection"),
                                       _("Authenticate to delete the selected connection"),
-                                      GTK_STOCK_DELETE,
+                                      "edit-delete-symbolic",
                                       self->client,
                                       NM_CLIENT_PERMISSION_SETTINGS_MODIFY_SYSTEM);
        g_object_set_data (G_OBJECT (button), "NMConnectionList", self);
diff --git a/src/connection-editor/page-bluetooth.c b/src/connection-editor/page-bluetooth.c
index 17d23b1..9eb16a6 100644
--- a/src/connection-editor/page-bluetooth.c
+++ b/src/connection-editor/page-bluetooth.c
@@ -308,9 +308,9 @@ bluetooth_connection_new (FUNC_TAG_PAGE_NEW_CONNECTION_IMPL,
        dialog = gtk_dialog_new_with_buttons (_("Bluetooth Type"),
                                              parent,
                                              GTK_DIALOG_MODAL,
-                                             GTK_STOCK_CANCEL,
+                                             _("_Cancel"),
                                              GTK_RESPONSE_CANCEL,
-                                             GTK_STOCK_OK,
+                                             _("_OK"),
                                              GTK_RESPONSE_OK,
                                              NULL);
 
diff --git a/src/connection-editor/page-mobile.c b/src/connection-editor/page-mobile.c
index f95c26b..517f2a1 100644
--- a/src/connection-editor/page-mobile.c
+++ b/src/connection-editor/page-mobile.c
@@ -540,9 +540,9 @@ mobile_connection_new (FUNC_TAG_PAGE_NEW_CONNECTION_IMPL,
        dialog = gtk_dialog_new_with_buttons (_("Select Mobile Broadband Provider Type"),
                                              parent,
                                              GTK_DIALOG_MODAL,
-                                             GTK_STOCK_CANCEL,
+                                             _("_Cancel"),
                                              GTK_RESPONSE_CANCEL,
-                                             GTK_STOCK_OK,
+                                             _("_OK"),
                                              GTK_RESPONSE_OK,
                                              NULL);
        g_signal_connect (dialog, "delete-event", G_CALLBACK (cancel_dialog), NULL);
diff --git a/src/connection-editor/page-proxy.c b/src/connection-editor/page-proxy.c
index 7c1a6e8..1c2feba 100644
--- a/src/connection-editor/page-proxy.c
+++ b/src/connection-editor/page-proxy.c
@@ -118,8 +118,8 @@ import_button_clicked_cb (GtkWidget *widget, CEPageProxy *self)
        dialog = gtk_file_chooser_dialog_new (_("Select file to import"),
                                              GTK_WINDOW (toplevel),
                                              GTK_FILE_CHOOSER_ACTION_OPEN,
-                                             GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-                                             GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+                                             _("_Cancel"), GTK_RESPONSE_CANCEL,
+                                             _("_Open"), GTK_RESPONSE_ACCEPT,
                                              NULL);
        gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
 
diff --git a/src/connection-editor/page-team-port.c b/src/connection-editor/page-team-port.c
index e9d0c01..572db94 100644
--- a/src/connection-editor/page-team-port.c
+++ b/src/connection-editor/page-team-port.c
@@ -203,8 +203,8 @@ import_button_clicked_cb (GtkWidget *widget, CEPageTeamPort *self)
        dialog = gtk_file_chooser_dialog_new (_("Select file to import"),
                                              GTK_WINDOW (toplevel),
                                              GTK_FILE_CHOOSER_ACTION_OPEN,
-                                             GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-                                             GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+                                             _("_Cancel"), GTK_RESPONSE_CANCEL,
+                                             _("_Open"), GTK_RESPONSE_ACCEPT,
                                              NULL);
        gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
 
diff --git a/src/connection-editor/page-team.c b/src/connection-editor/page-team.c
index cef8607..0127e63 100644
--- a/src/connection-editor/page-team.c
+++ b/src/connection-editor/page-team.c
@@ -341,8 +341,8 @@ import_button_clicked_cb (GtkWidget *widget, CEPageTeam *self)
        dialog = gtk_file_chooser_dialog_new (_("Select file to import"),
                                              GTK_WINDOW (toplevel),
                                              GTK_FILE_CHOOSER_ACTION_OPEN,
-                                             GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-                                             GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+                                             _("_Cancel"), GTK_RESPONSE_CANCEL,
+                                             _("_Open"), GTK_RESPONSE_ACCEPT,
                                              NULL);
        gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
 
diff --git a/src/connection-editor/vpn-helpers.c b/src/connection-editor/vpn-helpers.c
index 02bb068..7f2db2f 100644
--- a/src/connection-editor/vpn-helpers.c
+++ b/src/connection-editor/vpn-helpers.c
@@ -209,8 +209,8 @@ vpn_export (NMConnection *connection)
        dialog = gtk_file_chooser_dialog_new (_("Export VPN connection…"),
                                              NULL,
                                              GTK_FILE_CHOOSER_ACTION_SAVE,
-                                             GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-                                             GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
+                                             _("_Cancel"), GTK_RESPONSE_CANCEL,
+                                             _("_Save"), GTK_RESPONSE_ACCEPT,
                                              NULL);
        home_folder = g_get_home_dir ();
        gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), home_folder);
diff --git a/src/libnm-gtk/nm-mobile-wizard.c b/src/libnm-gtk/nm-mobile-wizard.c
index f490bd6..77983c6 100644
--- a/src/libnm-gtk/nm-mobile-wizard.c
+++ b/src/libnm-gtk/nm-mobile-wizard.c
@@ -494,7 +494,7 @@ plan_setup (NMAMobileWizard *self)
        gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0);
 
        hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-       image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG);
+       image = gtk_image_new_from_icon_name ("dialog-warning", GTK_ICON_SIZE_DIALOG);
        gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
        gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
 
diff --git a/src/libnm-gtk/nm-vpn-password-dialog.c b/src/libnm-gtk/nm-vpn-password-dialog.c
index a603d98..1c190e0 100644
--- a/src/libnm-gtk/nm-vpn-password-dialog.c
+++ b/src/libnm-gtk/nm-vpn-password-dialog.c
@@ -195,7 +195,7 @@ nma_vpn_password_dialog_new (const char *title,
        GtkWidget *vbox;
        GtkWidget *main_vbox;
        GtkWidget *dialog_icon;
-       GtkBox *content, *action_area;
+       GtkBox *content;
 
        dialog = gtk_widget_new (NMA_VPN_TYPE_PASSWORD_DIALOG, NULL);
        if (!dialog)
@@ -206,20 +206,11 @@ nma_vpn_password_dialog_new (const char *title,
        gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
 
        gtk_dialog_add_buttons (GTK_DIALOG (dialog),
-                               GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-                               GTK_STOCK_OK, GTK_RESPONSE_OK,
+                               _("_Cancel"), GTK_RESPONSE_CANCEL,
+                               _("_OK"), GTK_RESPONSE_OK,
                                NULL);
        gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
 
-       content = GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog)));
-       action_area = GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (dialog)));
-
-       /* Set up the dialog */
-       gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
-       gtk_box_set_spacing (content, 2); /* 2 * 5 + 2 = 12 */
-       gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
-       gtk_box_set_spacing (action_area, 6);
-
        gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
        gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
 
@@ -275,7 +266,7 @@ nma_vpn_password_dialog_new (const char *title,
        /* Adds some eye-candy to the dialog */
        hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
        gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
-       dialog_icon = gtk_image_new_from_stock (GTK_STOCK_DIALOG_AUTHENTICATION, GTK_ICON_SIZE_DIALOG);
+       dialog_icon = gtk_image_new_from_icon_name ("dialog-password", GTK_ICON_SIZE_DIALOG);
        gtk_misc_set_alignment (GTK_MISC (dialog_icon), 0.5, 0.0);
        gtk_box_pack_start (GTK_BOX (hbox), dialog_icon, FALSE, FALSE, 0);
 
@@ -296,6 +287,8 @@ nma_vpn_password_dialog_new (const char *title,
        gtk_box_pack_start (GTK_BOX (main_vbox), vbox, FALSE, FALSE, 0);
        gtk_box_pack_start (GTK_BOX (vbox), priv->grid_alignment, FALSE, FALSE, 0);
        gtk_box_pack_start (GTK_BOX (hbox), main_vbox, FALSE, FALSE, 0);
+
+       content = GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog)));
        gtk_box_pack_start (content, hbox, FALSE, FALSE, 0);
        gtk_widget_show_all (GTK_WIDGET (content));
 
diff --git a/src/libnm-gtk/nm-wifi-dialog.c b/src/libnm-gtk/nm-wifi-dialog.c
index 0e5e8cc..ca753e6 100644
--- a/src/libnm-gtk/nm-wifi-dialog.c
+++ b/src/libnm-gtk/nm-wifi-dialog.c
@@ -1064,27 +1064,16 @@ internal_init (NMAWifiDialog *self,
 
        gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (self))), 2);
 
-       widget = gtk_dialog_add_button (GTK_DIALOG (self), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
-       gtk_box_set_child_packing (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (self))), widget,
-                                  FALSE, TRUE, 0, GTK_PACK_END);
+       widget = gtk_dialog_add_button (GTK_DIALOG (self), _("_Cancel"), GTK_RESPONSE_CANCEL);
 
        /* Connect/Create button */
        if (priv->operation == OP_CREATE_ADHOC) {
-               GtkWidget *image;
-
-               widget = gtk_button_new_with_mnemonic (_("C_reate"));
-               image = gtk_image_new_from_stock (GTK_STOCK_CONNECT, GTK_ICON_SIZE_BUTTON);
-               gtk_button_set_image (GTK_BUTTON (widget), image);
-
-               gtk_widget_show (widget);
-               gtk_dialog_add_action_widget (GTK_DIALOG (self), widget, GTK_RESPONSE_OK);
+               widget = gtk_dialog_add_button (GTK_DIALOG (self), _("C_reate"), GTK_RESPONSE_OK);
        } else {
-               widget = gtk_dialog_add_button (GTK_DIALOG (self), GTK_STOCK_CONNECT, GTK_RESPONSE_OK);
+               widget = gtk_dialog_add_button (GTK_DIALOG (self), _("C_onnect"), GTK_RESPONSE_OK);
                priv->ok_response_button = widget;
        }
 
-       gtk_box_set_child_packing (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (self))), widget,
-                                  FALSE, TRUE, 0, GTK_PACK_END);
        g_object_set (G_OBJECT (widget), "can-default", TRUE, NULL);
        gtk_widget_grab_default (widget);
 
diff --git a/src/libnma/nma-mobile-wizard.c b/src/libnma/nma-mobile-wizard.c
index f103c24..524d5a1 100644
--- a/src/libnma/nma-mobile-wizard.c
+++ b/src/libnma/nma-mobile-wizard.c
@@ -493,7 +493,7 @@ plan_setup (NMAMobileWizard *self)
        gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0);
 
        hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-       image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG);
+       image = gtk_image_new_from_icon_name ("dialog-warning", GTK_ICON_SIZE_DIALOG);
        gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
        gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
 
diff --git a/src/libnma/nma-vpn-password-dialog.c b/src/libnma/nma-vpn-password-dialog.c
index 40ab860..a5f4d79 100644
--- a/src/libnma/nma-vpn-password-dialog.c
+++ b/src/libnma/nma-vpn-password-dialog.c
@@ -195,7 +195,7 @@ nma_vpn_password_dialog_new (const char *title,
        GtkWidget *vbox;
        GtkWidget *main_vbox;
        GtkWidget *dialog_icon;
-       GtkBox *content, *action_area;
+       GtkBox *content;
 
        dialog = gtk_widget_new (NMA_VPN_TYPE_PASSWORD_DIALOG, NULL);
        if (!dialog)
@@ -206,20 +206,11 @@ nma_vpn_password_dialog_new (const char *title,
        gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
 
        gtk_dialog_add_buttons (GTK_DIALOG (dialog),
-                               GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-                               GTK_STOCK_OK, GTK_RESPONSE_OK,
+                               _("_Cancel"), GTK_RESPONSE_CANCEL,
+                               _("_OK"), GTK_RESPONSE_OK,
                                NULL);
        gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
 
-       content = GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog)));
-       action_area = GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (dialog)));
-
-       /* Set up the dialog */
-       gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
-       gtk_box_set_spacing (content, 2); /* 2 * 5 + 2 = 12 */
-       gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
-       gtk_box_set_spacing (action_area, 6);
-
        gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
        gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
 
@@ -275,7 +266,7 @@ nma_vpn_password_dialog_new (const char *title,
        /* Adds some eye-candy to the dialog */
        hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
        gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
-       dialog_icon = gtk_image_new_from_stock (GTK_STOCK_DIALOG_AUTHENTICATION, GTK_ICON_SIZE_DIALOG);
+       dialog_icon = gtk_image_new_from_icon_name ("dialog-password", GTK_ICON_SIZE_DIALOG);
        gtk_misc_set_alignment (GTK_MISC (dialog_icon), 0.5, 0.0);
        gtk_box_pack_start (GTK_BOX (hbox), dialog_icon, FALSE, FALSE, 0);
 
@@ -296,6 +287,8 @@ nma_vpn_password_dialog_new (const char *title,
        gtk_box_pack_start (GTK_BOX (main_vbox), vbox, FALSE, FALSE, 0);
        gtk_box_pack_start (GTK_BOX (vbox), priv->grid_alignment, FALSE, FALSE, 0);
        gtk_box_pack_start (GTK_BOX (hbox), main_vbox, FALSE, FALSE, 0);
+
+       content = GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog)));
        gtk_box_pack_start (content, hbox, FALSE, FALSE, 0);
        gtk_widget_show_all (GTK_WIDGET (content));
 
diff --git a/src/libnma/nma-wifi-dialog.c b/src/libnma/nma-wifi-dialog.c
index bc965ec..7675411 100644
--- a/src/libnma/nma-wifi-dialog.c
+++ b/src/libnma/nma-wifi-dialog.c
@@ -1063,27 +1063,16 @@ internal_init (NMAWifiDialog *self,
 
        gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (self))), 2);
 
-       widget = gtk_dialog_add_button (GTK_DIALOG (self), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
-       gtk_box_set_child_packing (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (self))), widget,
-                                  FALSE, TRUE, 0, GTK_PACK_END);
+       widget = gtk_dialog_add_button (GTK_DIALOG (self), _("_Cancel"), GTK_RESPONSE_CANCEL);
 
        /* Connect/Create button */
        if (priv->operation == OP_CREATE_ADHOC) {
-               GtkWidget *image;
-
-               widget = gtk_button_new_with_mnemonic (_("C_reate"));
-               image = gtk_image_new_from_stock (GTK_STOCK_CONNECT, GTK_ICON_SIZE_BUTTON);
-               gtk_button_set_image (GTK_BUTTON (widget), image);
-
-               gtk_widget_show (widget);
-               gtk_dialog_add_action_widget (GTK_DIALOG (self), widget, GTK_RESPONSE_OK);
+               widget = gtk_dialog_add_button (GTK_DIALOG (self), _("C_reate"), GTK_RESPONSE_OK);
        } else {
-               widget = gtk_dialog_add_button (GTK_DIALOG (self), GTK_STOCK_CONNECT, GTK_RESPONSE_OK);
+               widget = gtk_dialog_add_button (GTK_DIALOG (self), _("C_onnect"), GTK_RESPONSE_OK);
                priv->ok_response_button = widget;
        }
 
-       gtk_box_set_child_packing (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (self))), widget,
-                                  FALSE, TRUE, 0, GTK_PACK_END);
        g_object_set (G_OBJECT (widget), "can-default", TRUE, NULL);
        gtk_widget_grab_default (widget);
 
diff --git a/src/mobile-helpers.c b/src/mobile-helpers.c
index 65a56a3..7856a7a 100644
--- a/src/mobile-helpers.c
+++ b/src/mobile-helpers.c
@@ -462,8 +462,8 @@ ask_for_pin (GtkEntry **out_secret_entry)
        gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
        gtk_window_set_title (GTK_WINDOW (dialog), _("PIN code required"));
 
-       gtk_dialog_add_button (dialog, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT);
-       ok_button = gtk_dialog_add_button (dialog, GTK_STOCK_OK, GTK_RESPONSE_OK);
+       gtk_dialog_add_button (dialog, _("_Cancel"), GTK_RESPONSE_REJECT);
+       ok_button = gtk_dialog_add_button (dialog, _("_OK"), GTK_RESPONSE_OK);
        gtk_window_set_default (GTK_WINDOW (dialog), ok_button);
 
        vbox = GTK_BOX (gtk_dialog_get_content_area (dialog));


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