[network-manager-applet] connection-editor: don't ellipsize unauthenticated CEPolkitButtons



commit 0fd8afcf3c2cf1675cddb4edbc73943b8234105f
Author: Dan Winship <danw gnome org>
Date:   Fri Jan 3 15:50:15 2014 -0500

    connection-editor: don't ellipsize unauthenticated CEPolkitButtons
    
    Having CEPolkitButtons be sometimes ellipsized and sometimes not
    causes the window width to change under some localizations.
    
    After some discussion, it was decided that having to deal with an
    authentication dialog does not really constitute the kind of
    "additional input" that ellipses are meant to indicate, so just remove
    them.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=642688

 src/connection-editor/ce-polkit-button.c     |   10 +---------
 src/connection-editor/ce-polkit-button.h     |    1 -
 src/connection-editor/nm-connection-editor.c |    1 -
 src/connection-editor/nm-connection-list.c   |    2 --
 4 files changed, 1 insertions(+), 13 deletions(-)
---
diff --git a/src/connection-editor/ce-polkit-button.c b/src/connection-editor/ce-polkit-button.c
index 5bd806a..e2701f3 100644
--- a/src/connection-editor/ce-polkit-button.c
+++ b/src/connection-editor/ce-polkit-button.c
@@ -34,9 +34,7 @@ G_DEFINE_TYPE (CEPolkitButton, ce_polkit_button, GTK_TYPE_BUTTON)
 typedef struct {
        gboolean disposed;
 
-       char *label;
        char *tooltip;
-       char *auth_label;
        char *auth_tooltip;
        gboolean master_sensitive;
 
@@ -70,11 +68,9 @@ update_button (CEPolkitButton *self, gboolean actionable)
        gtk_widget_set_sensitive (GTK_WIDGET (self), actionable);
 
        if (priv->authorized) {
-               gtk_button_set_label (GTK_BUTTON (self), priv->auth_label);
                gtk_widget_set_tooltip_text (GTK_WIDGET (self), priv->auth_tooltip);
                gtk_button_set_image (GTK_BUTTON (self), priv->auth);
        } else {
-               gtk_button_set_label (GTK_BUTTON (self), priv->label);
                gtk_widget_set_tooltip_text (GTK_WIDGET (self), priv->tooltip);
                gtk_button_set_image (GTK_BUTTON (self), priv->stock);
        }
@@ -148,7 +144,6 @@ permission_changed_cb (NMClient *client,
 GtkWidget *
 ce_polkit_button_new (const char *label,
                       const char *tooltip,
-                      const char *auth_label,
                       const char *auth_tooltip,
                       const char *stock_icon,
                       NMClient *client,
@@ -163,9 +158,7 @@ ce_polkit_button_new (const char *label,
 
        priv = CE_POLKIT_BUTTON_GET_PRIVATE (object);
 
-       priv->label = g_strdup (label);
        priv->tooltip = g_strdup (tooltip);
-       priv->auth_label = g_strdup (auth_label);
        priv->auth_tooltip = g_strdup (auth_tooltip);
        priv->permission = permission;
 
@@ -180,6 +173,7 @@ ce_polkit_button_new (const char *label,
        priv->auth = gtk_image_new_from_stock (GTK_STOCK_DIALOG_AUTHENTICATION, GTK_ICON_SIZE_BUTTON);
        g_object_ref_sink (priv->auth);
 
+       gtk_button_set_label (GTK_BUTTON (object), label);
        update_button (CE_POLKIT_BUTTON (object),
                       ce_polkit_button_get_actionable (CE_POLKIT_BUTTON (object)));
 
@@ -215,8 +209,6 @@ finalize (GObject *object)
 {
        CEPolkitButtonPrivate *priv = CE_POLKIT_BUTTON_GET_PRIVATE (object);
 
-       g_free (priv->label);
-       g_free (priv->auth_label);
        g_free (priv->tooltip);
        g_free (priv->auth_tooltip);
 
diff --git a/src/connection-editor/ce-polkit-button.h b/src/connection-editor/ce-polkit-button.h
index c8c803f..86496fd 100644
--- a/src/connection-editor/ce-polkit-button.h
+++ b/src/connection-editor/ce-polkit-button.h
@@ -51,7 +51,6 @@ GType ce_polkit_button_get_type (void);
 
 GtkWidget *ce_polkit_button_new (const char *label,
                                  const char *tooltip,
-                                 const char *auth_label,
                                  const char *auth_tooltip,
                                  const char *stock_icon,
                                  NMClient *client,
diff --git a/src/connection-editor/nm-connection-editor.c b/src/connection-editor/nm-connection-editor.c
index 98bccee..b3a3772 100644
--- a/src/connection-editor/nm-connection-editor.c
+++ b/src/connection-editor/nm-connection-editor.c
@@ -417,7 +417,6 @@ nm_connection_editor_new (GtkWindow *parent_window,
 
        editor->ok_button = ce_polkit_button_new (_("_Save"),
                                                  _("Save any changes made to this connection."),
-                                                 _("_Save..."),
                                                  _("Authenticate to save this connection for all users of 
this machine."),
                                                  GTK_STOCK_APPLY,
                                                  client,
diff --git a/src/connection-editor/nm-connection-list.c b/src/connection-editor/nm-connection-list.c
index cee5bb5..ceb7432 100644
--- a/src/connection-editor/nm-connection-list.c
+++ b/src/connection-editor/nm-connection-list.c
@@ -685,7 +685,6 @@ add_connection_buttons (NMConnectionList *self)
        /* Edit */
        button = ce_polkit_button_new (_("_Edit"),
                                       _("Edit the selected connection"),
-                                      _("_Edit..."),
                                       _("Authenticate to edit the selected connection"),
                                       GTK_STOCK_EDIT,
                                       self->nm_client,
@@ -702,7 +701,6 @@ add_connection_buttons (NMConnectionList *self)
        /* Delete */
        button = ce_polkit_button_new (_("_Delete"),
                                       _("Delete the selected connection"),
-                                      _("_Delete..."),
                                       _("Authenticate to delete the selected connection"),
                                       GTK_STOCK_DELETE,
                                       self->nm_client,


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