anjuta r4141 - in trunk: . plugins/sourceview
- From: jhs svn gnome org
- To: svn-commits-list gnome org
- Subject: anjuta r4141 - in trunk: . plugins/sourceview
- Date: Fri, 15 Aug 2008 10:38:34 +0000 (UTC)
Author: jhs
Date: Fri Aug 15 10:38:34 2008
New Revision: 4141
URL: http://svn.gnome.org/viewvc/anjuta?rev=4141&view=rev
Log:
2008-08-15 Johannes Schmid <jhs gnome org>
* configure.in:
* plugins/sourceview/sourceview.c (on_open_failed),
(on_save_failed):
Use a fallback dialog if the document was not added to the document-manager
yet (#545557 â Crash pressing on message view)
Modified:
trunk/ChangeLog
trunk/configure.in
trunk/plugins/sourceview/sourceview.c
Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in (original)
+++ trunk/configure.in Fri Aug 15 10:38:34 2008
@@ -436,17 +436,6 @@
AM_CONDITIONAL(HAVE_PLUGIN_SYMBOL_DB, [test x$symboldb = xyes])
-dnl Check for Vala
-dnl -------------------------------------------------------------
-PKG_CHECK_MODULES(VALA, vala-1.0, [have_vala="yes"], [have_vala="no"])
-
-if test x$have_vala = xyes; then
- vapidir=`pkg-config --variable=vapidir vala-1.0`
- AC_SUBST(vapidir)
-fi
-
-AM_CONDITIONAL(HAVE_VALA, [test x$have_vala = xyes])
-
dnl Valgrind plugin
dnl check for libbfd
dnl -------------------------------------------------------------
Modified: trunk/plugins/sourceview/sourceview.c
==============================================================================
--- trunk/plugins/sourceview/sourceview.c (original)
+++ trunk/plugins/sourceview/sourceview.c Fri Aug 15 10:38:34 2008
@@ -339,26 +339,37 @@
AnjutaShell* shell = ANJUTA_PLUGIN (sv->priv->plugin)->shell;
IAnjutaDocumentManager *docman =
anjuta_shell_get_interface (shell, IAnjutaDocumentManager, NULL);
- GtkWidget* message_area;
g_return_if_fail (docman != NULL);
+ GList* documents = ianjuta_document_manager_get_doc_widgets (docman, NULL);
+ GtkWidget* message_area;
/* Could not open <filename>: <error message> */
gchar* message = g_strdup_printf (_("Could not open %s: %s"),
sourceview_io_get_filename (sv->priv->io),
err->message);
- message_area = anjuta_message_area_new (message, GTK_STOCK_DIALOG_WARNING);
- anjuta_message_area_add_button (ANJUTA_MESSAGE_AREA (message_area),
- GTK_STOCK_OK,
- GTK_RESPONSE_OK);
- g_free (message);
-
- g_signal_connect (message_area, "response", G_CALLBACK(gtk_widget_destroy), NULL);
-
- ianjuta_document_manager_set_message_area (docman, IANJUTA_DOCUMENT(sv),
- message_area, NULL);
+ if (g_list_find (documents, sv))
+ {
+ message_area = anjuta_message_area_new (message, GTK_STOCK_DIALOG_ERROR);
+ anjuta_message_area_add_button (ANJUTA_MESSAGE_AREA (message_area),
+ GTK_STOCK_OK,
+ GTK_RESPONSE_OK);
+ g_signal_connect (message_area, "response", G_CALLBACK(gtk_widget_destroy), NULL);
+
+ ianjuta_document_manager_set_message_area (docman, IANJUTA_DOCUMENT(sv),
+ message_area, NULL);
+ }
+ else
+ {
+ GtkWidget* dialog = gtk_message_dialog_new (NULL, 0,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_OK,
+ message);
+ g_signal_connect (dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ }
+ g_free (message);
sv->priv->loading = FALSE;
-
gtk_text_view_set_editable (GTK_TEXT_VIEW (sv->priv->view), TRUE);
/* Get rid of reference from ifile_open */
@@ -448,23 +459,36 @@
AnjutaShell* shell = ANJUTA_PLUGIN (sv->priv->plugin)->shell;
IAnjutaDocumentManager *docman =
anjuta_shell_get_interface (shell, IAnjutaDocumentManager, NULL);
- GtkWidget* message_area;
g_return_if_fail (docman != NULL);
+ GList* documents = ianjuta_document_manager_get_doc_widgets (docman, NULL);
+ GtkWidget* message_area;
- /* Could not save <filename>: <error message> */
+ /* Could not open <filename>: <error message> */
gchar* message = g_strdup_printf (_("Could not save %s: %s"),
- sourceview_io_get_filename (sio),
+ sourceview_io_get_filename (sv->priv->io),
err->message);
- message_area = anjuta_message_area_new (message, GTK_STOCK_DIALOG_WARNING);
- anjuta_message_area_add_button (ANJUTA_MESSAGE_AREA (message_area),
- GTK_STOCK_OK,
- GTK_RESPONSE_OK);
- g_free (message);
-
- g_signal_connect (message_area, "response", G_CALLBACK(gtk_widget_destroy), NULL);
- ianjuta_document_manager_set_message_area (docman, IANJUTA_DOCUMENT(sv),
- message_area, NULL);
+ if (g_list_find (documents, sv))
+ {
+ message_area = anjuta_message_area_new (message, GTK_STOCK_DIALOG_ERROR);
+ anjuta_message_area_add_button (ANJUTA_MESSAGE_AREA (message_area),
+ GTK_STOCK_OK,
+ GTK_RESPONSE_OK);
+ g_signal_connect (message_area, "response", G_CALLBACK(gtk_widget_destroy), NULL);
+
+ ianjuta_document_manager_set_message_area (docman, IANJUTA_DOCUMENT(sv),
+ message_area, NULL);
+ }
+ else
+ {
+ GtkWidget* dialog = gtk_message_dialog_new (NULL, 0,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_OK,
+ message);
+ g_signal_connect (dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ }
+ g_free (message);
g_object_unref (sv);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]