[Commits] progressdialog.c 1.1.4.31 1.1.4.32

wwp at claws-mail.org wwp at claws-mail.org
Sat Jun 2 11:29:30 CEST 2012


Update of /home/claws-mail/claws/src/gtk
In directory srv:/tmp/cvs-serv3001/src/gtk

Modified Files:
      Tag: gtk2
	progressdialog.c 
Log Message:
2012-06-02 [wwp]	3.8.0cvs53

	* src/gtk/progressdialog.c
		Add a hide button to the retrieve/send progress dialogs. WM's close button
		now hides (as well as pressing Esc) instead of doing nothing.

Index: progressdialog.c
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/progressdialog.c,v
retrieving revision 1.1.4.31
retrieving revision 1.1.4.32
diff -u -d -r1.1.4.31 -r1.1.4.32
--- progressdialog.c	27 May 2012 17:31:06 -0000	1.1.4.31
+++ progressdialog.c	2 Jun 2012 09:29:28 -0000	1.1.4.32
@@ -43,6 +43,9 @@
 					   const gchar	  *status,
 					   GdkPixbuf	  *image);
 
+static void progress_dialog_hide_btn_cb(GtkWidget *widget, gpointer data);
+static void progress_dialog_delete_event_btn_cb(GtkWidget *widget, gpointer data);
+
 ProgressDialog *progress_dialog_create(void)
 {
 	ProgressDialog *progress;
@@ -50,6 +53,7 @@
 	GtkWidget *hbox;
 	GtkWidget *vbox;
 	GtkWidget *label;
+	GtkWidget *hide_btn;
 	GtkWidget *showlog_btn;
 	GtkWidget *cancel_btn;
 	GtkWidget *progressbar;
@@ -82,6 +86,9 @@
 	gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 8);
 	gtk_widget_show(label);
 
+	hide_btn = gtk_dialog_add_button(GTK_DIALOG(dialog),
+					   _("_Hide"),
+					   GTK_RESPONSE_NONE);
 	showlog_btn = gtk_dialog_add_button(GTK_DIALOG(dialog),
 					   _("_View log"),
 					   GTK_RESPONSE_NONE);
@@ -142,7 +149,13 @@
 	gtk_tree_view_column_set_resizable(column, TRUE);
 	gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
 	gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
-	
+
+	/* the WM close and hide buttons are handled internally and not published to caller */
+	g_signal_connect(G_OBJECT(dialog), "delete_event",
+				G_CALLBACK(progress_dialog_delete_event_btn_cb), NULL);
+	g_signal_connect(G_OBJECT(hide_btn), "clicked",
+				G_CALLBACK(progress_dialog_hide_btn_cb), dialog);
+
 	progress->window      = dialog;
 	progress->label       = label;
 	progress->showlog_btn  = showlog_btn;
@@ -260,3 +273,13 @@
 
 	return result;
 }
+
+static void progress_dialog_hide_btn_cb(GtkWidget *widget, gpointer data)
+{
+		gtk_widget_hide(GTK_WIDGET(data));
+}
+
+static void progress_dialog_delete_event_btn_cb(GtkWidget *widget, gpointer data)
+{
+		gtk_widget_hide(widget);
+}



More information about the Commits mailing list