[anjuta-extras] bgo#585529 - Replace AnjutaMessageArea with GtkInfoBar
- From: Johannes Schmid <jhs src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [anjuta-extras] bgo#585529 - Replace AnjutaMessageArea with GtkInfoBar
- Date: Mon, 23 Nov 2009 21:20:18 +0000 (UTC)
commit 72878787a6bd6f9bda6d06d274a20cb7f4a30f17
Author: Johannes Schmid <jhs gnome org>
Date: Mon Nov 23 22:18:19 2009 +0100
bgo#585529 - Replace AnjutaMessageArea with GtkInfoBar
configure.ac | 2 +-
plugins/scintilla/text_editor.c | 34 +++++++++++++++++++++++++++-------
2 files changed, 28 insertions(+), 8 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 3c6bf9b..8f53b4f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,7 +28,7 @@ AC_LANG_C
BINUTILS_REQUIRED=2.15.92
LIBGRAPHVIZ_REQUIRED=1.0
-GTK_REQUIRED=2.14.0
+GTK_REQUIRED=2.17.1
GLIB_REQUIRED=2.16.0
GCONF_REQUIRED=2.12.0
GNOME_REQUIRED=2.12.0
diff --git a/plugins/scintilla/text_editor.c b/plugins/scintilla/text_editor.c
index a46c535..dd3593c 100644
--- a/plugins/scintilla/text_editor.c
+++ b/plugins/scintilla/text_editor.c
@@ -38,7 +38,6 @@
#include <libanjuta/anjuta-encodings.h>
#include <libanjuta/anjuta-convert.h>
#include <libanjuta/anjuta-debug.h>
-#include <libanjuta/anjuta-message-area.h>
#include <libanjuta/anjuta-shell.h>
#include <libanjuta/interfaces/ianjuta-document-manager.h>
#include <libanjuta/interfaces/ianjuta-editor.h>
@@ -142,6 +141,27 @@ text_editor_instance_init (TextEditor *te)
te->message_area = NULL;
}
+GtkWidget *
+anjuta_message_area_new (const gchar *text,
+ GtkMessageType type)
+{
+ GtkInfoBar *message_area;
+ GtkWidget *content_area;
+ GtkWidget *message_label = gtk_label_new ("");
+
+ message_area = GTK_INFO_BAR (gtk_info_bar_new ());
+ gtk_info_bar_set_message_type (message_area, type);
+ content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (message_area));
+ gtk_widget_show (message_label);
+ gtk_container_add (GTK_CONTAINER (content_area), message_label);
+
+ gchar *markup = g_strdup_printf ("<b>%s</b>", text);
+ gtk_label_set_markup (GTK_LABEL (message_label), markup);
+ g_free (markup);
+
+ return GTK_WIDGET (message_area);
+}
+
static void
text_editor_class_init (TextEditorClass *klass)
{
@@ -420,12 +440,12 @@ on_text_editor_uri_changed (GFileMonitor *monitor,
"Do you want to loose your changes and reload it ?"),
te->filename);
}
- message_area = anjuta_message_area_new (buff, GTK_STOCK_DIALOG_WARNING);
+ message_area = anjuta_message_area_new (buff, GTK_MESSAGE_WARNING);
g_free (buff);
- anjuta_message_area_add_button (ANJUTA_MESSAGE_AREA (message_area),
+ gtk_info_bar_add_button (GTK_INFO_BAR (message_area),
GTK_STOCK_REFRESH,
GTK_RESPONSE_YES);
- anjuta_message_area_add_button (ANJUTA_MESSAGE_AREA (message_area),
+ gtk_info_bar_add_button (GTK_INFO_BAR (message_area),
GTK_STOCK_CANCEL,
GTK_RESPONSE_NO);
g_signal_connect (G_OBJECT(message_area), "response",
@@ -447,12 +467,12 @@ on_text_editor_uri_changed (GFileMonitor *monitor,
"Do you want to loose your changes and close it ?"),
te->filename);
}
- message_area = anjuta_message_area_new (buff, GTK_STOCK_DIALOG_WARNING);
+ message_area = anjuta_message_area_new (buff, GTK_MESSAGE_WARNING);
g_free (buff);
- anjuta_message_area_add_button (ANJUTA_MESSAGE_AREA (message_area),
+ gtk_info_bar_add_button (GTK_INFO_BAR (message_area),
GTK_STOCK_DELETE,
GTK_RESPONSE_YES);
- anjuta_message_area_add_button (ANJUTA_MESSAGE_AREA (message_area),
+ gtk_info_bar_add_button (GTK_INFO_BAR (message_area),
GTK_STOCK_CANCEL,
GTK_RESPONSE_NO);
g_signal_connect (G_OBJECT(message_area), "response",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]