brasero r1070 - in trunk: . src



Author: philippr
Date: Wed Aug 13 19:03:43 2008
New Revision: 1070
URL: http://svn.gnome.org/viewvc/brasero?rev=1070&view=rev

Log:
	Improved messaging and reset cursor when cancelling project loading

	* src/brasero-data-disc.c (brasero_data_disc_clear),
	(brasero_data_disc_reset), (brasero_data_disc_message_response_cb):
	* src/brasero-disc-message.c (brasero_disc_message_timeout),
	(brasero_disc_message_button_clicked_cb),
	(brasero_disc_message_destroy):
	* src/brasero-disc-message.h:
	* src/brasero-notify.c (brasero_notify_remove_all_messages),
	(brasero_notify_message_remove):

Modified:
   trunk/ChangeLog
   trunk/src/brasero-data-disc.c
   trunk/src/brasero-disc-message.c
   trunk/src/brasero-disc-message.h
   trunk/src/brasero-notify.c

Modified: trunk/src/brasero-data-disc.c
==============================================================================
--- trunk/src/brasero-data-disc.c	(original)
+++ trunk/src/brasero-data-disc.c	Wed Aug 13 19:03:43 2008
@@ -1077,12 +1077,15 @@
 	priv->G2_files = FALSE;
 	priv->deep_directory = FALSE;
 
+ 	brasero_notify_message_remove (BRASERO_NOTIFY (priv->message), BRASERO_NOTIFY_CONTEXT_SIZE);
 	brasero_notify_message_remove (BRASERO_NOTIFY (priv->message), BRASERO_NOTIFY_CONTEXT_LOADING);
 	brasero_notify_message_remove (BRASERO_NOTIFY (priv->message), BRASERO_NOTIFY_CONTEXT_MULTISESSION);
 
 	brasero_data_project_reset (priv->project);
 	brasero_file_filtered_clear (BRASERO_FILE_FILTERED (priv->filter));
 	brasero_disc_size_changed (disc, 0);
+
+	gdk_window_set_cursor (GTK_WIDGET (disc)->window, NULL);
 }
 
 static void
@@ -1113,8 +1116,9 @@
 	priv->deep_directory = FALSE;
 
 	brasero_file_filtered_clear (BRASERO_FILE_FILTERED (priv->filter));
-
 	brasero_disc_size_changed (disc, 0);
+
+	gdk_window_set_cursor (GTK_WIDGET (disc)->window, NULL);
 	gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), 0);
 }
 
@@ -1333,8 +1337,8 @@
 	if (response != GTK_RESPONSE_CANCEL)
 		return;
 
-	brasero_data_disc_reset (BRASERO_DISC (self));
 	priv->loading = FALSE;
+	brasero_data_disc_clear (BRASERO_DISC (self));
 }
 
 static BraseroDiscResult

Modified: trunk/src/brasero-disc-message.c
==============================================================================
--- trunk/src/brasero-disc-message.c	(original)
+++ trunk/src/brasero-disc-message.c	Wed Aug 13 19:03:43 2008
@@ -80,6 +80,7 @@
 	guint timeout;
 
 	guint changing_style:1;
+	guint prevent_destruction:1;
 };
 
 #define BRASERO_DISC_MESSAGE_PRIVATE(o)  (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_DISC_MESSAGE, BraseroDiscMessagePrivate))
@@ -87,7 +88,6 @@
 enum
 {
 	RESPONSE,
-
 	LAST_SIGNAL
 };
 
@@ -111,10 +111,12 @@
 	priv = BRASERO_DISC_MESSAGE_PRIVATE (data);
 	priv->timeout = 0;
 
+	priv->prevent_destruction = TRUE;
 	g_signal_emit (data,
 		       disc_message_signals [RESPONSE],
 		       0,
 		       GTK_RESPONSE_DELETE_EVENT);
+	priv->prevent_destruction = FALSE;
 
 	gtk_widget_destroy (GTK_WIDGET (data));
 	return FALSE;
@@ -247,10 +249,29 @@
 brasero_disc_message_button_clicked_cb (GtkButton *button,
 					BraseroDiscMessage *self)
 {
+	BraseroDiscMessagePrivate *priv;
+
+	priv = BRASERO_DISC_MESSAGE_PRIVATE (self);
+
+	priv->prevent_destruction = TRUE;
 	g_signal_emit (self,
 		       disc_message_signals [RESPONSE],
-		       0, 
+		       0,
 		       GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), RESPONSE_TYPE)));
+	priv->prevent_destruction = FALSE;
+
+	gtk_widget_destroy (GTK_WIDGET (self));
+}
+
+void
+brasero_disc_message_destroy (BraseroDiscMessage *self)
+{
+	BraseroDiscMessagePrivate *priv;
+
+	priv = BRASERO_DISC_MESSAGE_PRIVATE (self);
+
+	if (priv->prevent_destruction)
+		return;
 
 	gtk_widget_destroy (GTK_WIDGET (self));
 }

Modified: trunk/src/brasero-disc-message.h
==============================================================================
--- trunk/src/brasero-disc-message.h	(original)
+++ trunk/src/brasero-disc-message.h	Wed Aug 13 19:03:43 2008
@@ -60,6 +60,9 @@
 brasero_disc_message_new (void);
 
 void
+brasero_disc_message_destroy (BraseroDiscMessage *message);
+
+void
 brasero_disc_message_set_primary (BraseroDiscMessage *message,
 				  const gchar *text);
 void

Modified: trunk/src/brasero-notify.c
==============================================================================
--- trunk/src/brasero-notify.c	(original)
+++ trunk/src/brasero-notify.c	Wed Aug 13 19:03:43 2008
@@ -53,7 +53,7 @@
 		GtkWidget *widget;
 
 		widget = iter->data;
-		gtk_widget_destroy (widget);
+		brasero_disc_message_destroy (BRASERO_DISC_MESSAGE (widget));
 	}
 	g_list_free (children);
 
@@ -105,7 +105,7 @@
 
 		widget = iter->data;
 		if (brasero_disc_message_get_context (BRASERO_DISC_MESSAGE (widget)) == context_id) {
-			gtk_widget_destroy (widget);
+			brasero_disc_message_destroy (BRASERO_DISC_MESSAGE (widget));
 			break;
 		}
 	}



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