[Xfce4-commits] [apps/xfburn] 02/03: Cancel button in adding progress dialog

noreply at xfce.org noreply at xfce.org
Sat Apr 5 08:30:12 CEST 2014


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

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

commit 52faf526d24ca86676f6b14e446ddaa2913f5594
Author: David Mohr <david at mcbf.net>
Date:   Sat Apr 5 00:07:51 2014 -0600

    Cancel button in adding progress dialog
---
 xfburn/xfburn-adding-progress.c |   18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/xfburn/xfburn-adding-progress.c b/xfburn/xfburn-adding-progress.c
index fd24b96..793c313 100644
--- a/xfburn/xfburn-adding-progress.c
+++ b/xfburn/xfburn-adding-progress.c
@@ -46,6 +46,7 @@ static void xfburn_adding_progress_class_init (XfburnAddingProgressClass *);
 static void xfburn_adding_progress_init (XfburnAddingProgress *);
 static void xfburn_adding_progress_finalize (GObject * object);
 static gboolean cb_delete (GtkWidget *widget, GdkEvent *event, gpointer data);
+static gboolean cb_cancel (GtkWidget *widget, GdkEvent *event, gpointer data);
 
 /* globals */
 static GtkWindowClass *parent_class = NULL;
@@ -102,7 +103,7 @@ static void
 xfburn_adding_progress_init (XfburnAddingProgress * win)
 {
   XfburnAddingProgressPrivate *priv = XFBURN_ADDING_PROGRESS_GET_PRIVATE (win);
-  GtkWidget *vbox;
+  GtkWidget *vbox, *cancel_btn;
   
   gtk_window_set_resizable (GTK_WINDOW (win), FALSE);
 
@@ -121,8 +122,14 @@ xfburn_adding_progress_init (XfburnAddingProgress * win)
 
   gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (priv->progress_bar), 0.5);  
 
+  cancel_btn = gtk_button_new_with_label (_("Cancel"));
+  gtk_box_pack_start (GTK_BOX (vbox), cancel_btn, TRUE, TRUE, BORDER);
+  gtk_widget_show (cancel_btn);
+
+
   priv->aborted = FALSE;
   g_signal_connect (G_OBJECT (win), "delete-event", G_CALLBACK (cb_delete), NULL);
+  g_signal_connect (G_OBJECT (cancel_btn), "clicked", G_CALLBACK (cb_cancel), G_OBJECT(win));
 }
 
 static void
@@ -143,6 +150,15 @@ cb_delete (GtkWidget *widget, GdkEvent *event, gpointer data)
   return TRUE;
 }
 
+static gboolean
+cb_cancel (GtkWidget *widget, GdkEvent *event, gpointer data)
+{
+  XfburnAddingProgressPrivate *priv = XFBURN_ADDING_PROGRESS_GET_PRIVATE (data);
+  priv->aborted = TRUE;
+
+  return TRUE;
+}
+
 /******************/
 /* public methods */
 /******************/

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


More information about the Xfce4-commits mailing list