[Xfce4-commits] [apps/xfburn] 01/01: Bugfix: the icon for the burn button comes from stock

noreply at xfce.org noreply at xfce.org
Sun May 10 22:06:16 CEST 2015


This is an automated email from the git hooks/post-receive script.

squisher pushed a commit to branch master
in repository apps/xfburn.

commit f018aa8ade6ee4691f2587edd77afa4c96dc799f
Author: David Mohr <david at mcbf.net>
Date:   Sun May 10 14:04:40 2015 -0600

    Bugfix: the icon for the burn button comes from stock
    
    This probably broke in b6ff70b2e0b9c9786ec8b21f4c727de50f29808e while
    porting to libxfce4ui.
---
 xfburn/xfburn-blank-dialog.c                      |    2 +-
 xfburn/xfburn-burn-audio-cd-composition-dialog.c  |    2 +-
 xfburn/xfburn-burn-data-composition-base-dialog.c |    2 +-
 xfburn/xfburn-burn-image-dialog.c                 |    2 +-
 xfburn/xfburn-disc-usage.c                        |    2 +-
 xfburn/xfburn-utils.c                             |   21 +++++++++++++++++++++
 xfburn/xfburn-utils.h                             |    1 +
 7 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/xfburn/xfburn-blank-dialog.c b/xfburn/xfburn-blank-dialog.c
index ed3ded6..c2e699e 100644
--- a/xfburn/xfburn-blank-dialog.c
+++ b/xfburn/xfburn-blank-dialog.c
@@ -241,7 +241,7 @@ xfburn_blank_dialog_init (XfburnBlankDialog * obj)
   gtk_widget_show (button);
   gtk_dialog_add_action_widget (GTK_DIALOG (obj), button, GTK_RESPONSE_CANCEL);
 
-  button = xfce_gtk_button_new_mixed ("xfburn-blank-cdrw", _("_Blank"));
+  button = xfburn_gtk_button_new_mixed (XFBURN_STOCK_BLANK_CDRW, _("_Blank"));
   gtk_widget_show (button);
   gtk_dialog_add_action_widget (GTK_DIALOG (obj), button, GTK_RESPONSE_OK);
   GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
diff --git a/xfburn/xfburn-burn-audio-cd-composition-dialog.c b/xfburn/xfburn-burn-audio-cd-composition-dialog.c
index 8cd6581..07cb4ac 100644
--- a/xfburn/xfburn-burn-audio-cd-composition-dialog.c
+++ b/xfburn/xfburn-burn-audio-cd-composition-dialog.c
@@ -219,7 +219,7 @@ xfburn_burn_audio_cd_composition_dialog_constructor (GType type, guint n_constru
   gtk_widget_show (button);
   gtk_dialog_add_action_widget (GTK_DIALOG (obj), button, GTK_RESPONSE_CANCEL);
 
-  priv->button_proceed = button = xfce_gtk_button_new_mixed ("xfburn-burn-cd", _("_Burn Composition"));
+  priv->button_proceed = button = xfburn_gtk_button_new_mixed (XFBURN_STOCK_BURN_CD, _("_Burn Composition"));
 
   gtk_widget_show (button);
   gtk_dialog_add_action_widget (GTK_DIALOG (obj), button, GTK_RESPONSE_OK);
diff --git a/xfburn/xfburn-burn-data-composition-base-dialog.c b/xfburn/xfburn-burn-data-composition-base-dialog.c
index ecdd18b..950a647 100644
--- a/xfburn/xfburn-burn-data-composition-base-dialog.c
+++ b/xfburn/xfburn-burn-data-composition-base-dialog.c
@@ -286,7 +286,7 @@ xfburn_burn_data_composition_base_dialog_constructor (GType type, guint n_constr
   gtk_widget_show (button);
   gtk_dialog_add_action_widget (GTK_DIALOG (obj), button, GTK_RESPONSE_CANCEL);
 
-  priv->button_proceed = button = xfce_gtk_button_new_mixed ("xfburn-burn-cd", _("_Burn Composition"));
+  priv->button_proceed = button = xfburn_gtk_button_new_mixed (XFBURN_STOCK_BURN_CD, _("_Burn Composition"));
   /*
    * Disabled: change button_proceed functionality
   button = create_proceed_button (obj, "xfburn-burn-cd", "");
diff --git a/xfburn/xfburn-burn-image-dialog.c b/xfburn/xfburn-burn-image-dialog.c
index afa9d88..fcf4caf 100644
--- a/xfburn/xfburn-burn-image-dialog.c
+++ b/xfburn/xfburn-burn-image-dialog.c
@@ -240,7 +240,7 @@ xfburn_burn_image_dialog_init (XfburnBurnImageDialog * obj)
   gtk_widget_show (button);
   gtk_dialog_add_action_widget (GTK_DIALOG (obj), button, GTK_RESPONSE_CANCEL);
 
-  priv->burn_button = xfce_gtk_button_new_mixed ("xfburn-burn-cd", _("_Burn image"));
+  priv->burn_button = xfburn_gtk_button_new_mixed (XFBURN_STOCK_BURN_CD, _("_Burn image"));
   gtk_widget_show (priv->burn_button);
   g_signal_connect (G_OBJECT (priv->burn_button), "clicked", G_CALLBACK (cb_clicked_ok), obj);
   gtk_container_add (GTK_CONTAINER( GTK_DIALOG(obj)->action_area), priv->burn_button);
diff --git a/xfburn/xfburn-disc-usage.c b/xfburn/xfburn-disc-usage.c
index 9610209..386df21 100644
--- a/xfburn/xfburn-disc-usage.c
+++ b/xfburn/xfburn-disc-usage.c
@@ -160,7 +160,7 @@ xfburn_disc_usage_constructor (GType type, guint n_construct_properties, GObject
   gtk_box_pack_start (GTK_BOX (disc_usage), disc_usage->combo, FALSE, FALSE, BORDER);
   gtk_widget_show (disc_usage->combo);
 
-  disc_usage->button = xfce_gtk_button_new_mixed (XFBURN_STOCK, _("Proceed to Burn"));
+  disc_usage->button = xfburn_gtk_button_new_mixed (XFBURN_STOCK, _("Proceed to Burn"));
   gtk_box_pack_start (GTK_BOX (disc_usage), disc_usage->button, FALSE, FALSE, BORDER);
   gtk_widget_set_sensitive (disc_usage->button, FALSE);
   gtk_widget_show (disc_usage->button);
diff --git a/xfburn/xfburn-utils.c b/xfburn/xfburn-utils.c
index 746a980..f6462ab 100644
--- a/xfburn/xfburn-utils.c
+++ b/xfburn/xfburn-utils.c
@@ -174,6 +174,27 @@ xfburn_ask_yes_no (GtkMessageType type, const gchar *primary_text, const gchar *
   return ok;
 }
 
+/* Based on xfce_gtk_Button_new_mixed, but always use a stock icon */
+GtkWidget *
+xfburn_gtk_button_new_mixed (const gchar *stock_id, const gchar *label)
+{
+    GtkWidget *button;
+    GtkWidget *image;
+    g_return_val_if_fail (stock_id != NULL || label != NULL, NULL);
+    if (label != NULL) {
+        button = gtk_button_new_with_mnemonic (label);
+        if (stock_id != NULL) {
+            /* create image widget */
+            image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON);
+            gtk_button_set_image (GTK_BUTTON (button), image);
+        }
+    } else {
+        /* fall back to a stock button */
+        button = gtk_button_new_from_stock (stock_id);
+    }
+    return button;
+}
+
 
 /*******************/
 /* libburn helpers */
diff --git a/xfburn/xfburn-utils.h b/xfburn/xfburn-utils.h
index 32069fb..3eeff45 100644
--- a/xfburn/xfburn-utils.h
+++ b/xfburn/xfburn-utils.h
@@ -42,6 +42,7 @@ GSList * xfburn_make_abosulet_file_list (gint count, gchar *filenames[]);
 void xfburn_browse_for_file (GtkEntry *entry, GtkWindow *parent);
 
 gboolean xfburn_ask_yes_no (GtkMessageType type, const gchar *primary_text, const gchar *secondary_text);
+GtkWidget * xfburn_gtk_button_new_mixed (const gchar *stock_id, const gchar *label);
 
 void xfburn_capture_libburn_messages (void);
 void xfburn_console_libburn_messages (void);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list