[Xfce4-commits] r25276 - in squeeze/trunk: libsqueeze src

Stephan Arts stephan at xfce.org
Sat Mar 24 00:06:40 CET 2007


Author: stephan
Date: 2007-03-23 23:06:40 +0000 (Fri, 23 Mar 2007)
New Revision: 25276

Modified:
   squeeze/trunk/libsqueeze/vfs-mime.h
   squeeze/trunk/src/main_window.c
Log:
implemented error dialog in main_window

Modified: squeeze/trunk/libsqueeze/vfs-mime.h
===================================================================
--- squeeze/trunk/libsqueeze/vfs-mime.h	2007-03-23 21:38:16 UTC (rev 25275)
+++ squeeze/trunk/libsqueeze/vfs-mime.h	2007-03-23 23:06:40 UTC (rev 25276)
@@ -20,7 +20,7 @@
 struct _LSQArchiveMimeInfo
 {
 	ThunarVfsMimeInfo *mime_info;
-	GSList           *command_builders;
+	GSList            *command_builders;
 };
 
 typedef struct _LSQArchiveMimeInfo LSQArchiveMimeInfo;

Modified: squeeze/trunk/src/main_window.c
===================================================================
--- squeeze/trunk/src/main_window.c	2007-03-23 21:38:16 UTC (rev 25275)
+++ squeeze/trunk/src/main_window.c	2007-03-23 23:06:40 UTC (rev 25276)
@@ -93,6 +93,7 @@
 
 static void cb_sq_main_close_window(GtkWidget *widget, gpointer userdata);
 
+static void cb_sq_main_window_archive_command_terminated(LSQArchive *archive, GError *error, gpointer userdata);
 /*static void cb_sq_main_properties(GtkWidget *widget, gpointer userdata);*/
 /*static void cb_sq_main_preferences(GtkWidget *widget, gpointer userdata);*/
 
@@ -1096,6 +1097,7 @@
 		gtk_widget_set_sensitive(window->menubar.menu_item_remove, TRUE);
 		gtk_widget_set_sensitive(window->menubar.menu_item_refresh, TRUE);
 		/*gtk_widget_set_sensitive(window->menubar.menu_item_properties, TRUE);*/
+		g_signal_connect(G_OBJECT(archive), "command-terminated", G_CALLBACK(cb_sq_main_window_archive_command_terminated), window);
 		return 0;
 	}
 	else
@@ -1155,6 +1157,19 @@
 	}	
 }
 
+static void
+cb_sq_main_window_archive_command_terminated(LSQArchive *archive, GError *error, gpointer userdata)
+{
+	SQMainWindow *window = userdata;
+
+	if(error)
+	{
+		GtkWidget *error_dialog = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, error->message);
+		gtk_dialog_run(GTK_DIALOG(error_dialog));
+		gtk_widget_destroy(error_dialog);
+	}
+}
+
 /*
 static void
 cb_sq_main_window_notebook_status_changed(SQNotebook *notebook, LSQArchive *archive, gpointer userdata)



More information about the Xfce4-commits mailing list