[anjuta] bgo#585529 - Replace AnjutaMessageArea with GtkInfoBar
- From: Johannes Schmid <jhs src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [anjuta] bgo#585529 - Replace AnjutaMessageArea with GtkInfoBar
- Date: Mon, 23 Nov 2009 21:15:51 +0000 (UTC)
commit da6108100ae6c6ec7bb2aa3745b7a967f07d9e3e
Author: Johannes Schmid <jhs gnome org>
Date: Mon Nov 23 22:15:32 2009 +0100
bgo#585529 - Replace AnjutaMessageArea with GtkInfoBar
libanjuta/Makefile.am | 3 -
libanjuta/anjuta-message-area.c | 440 ------------------------------
libanjuta/anjuta-message-area.h | 111 --------
libanjuta/libanjuta.h | 1 -
plugins/document-manager/anjuta-docman.c | 1 -
plugins/gtodo/mcategory.c | 2 +-
plugins/sourceview/sourceview.c | 48 +++-
7 files changed, 35 insertions(+), 571 deletions(-)
---
diff --git a/libanjuta/Makefile.am b/libanjuta/Makefile.am
index 5251aee..a3f7d2d 100644
--- a/libanjuta/Makefile.am
+++ b/libanjuta/Makefile.am
@@ -35,7 +35,6 @@ libanjuta_la_SOURCES= \
anjuta-status.c \
anjuta-encodings.c \
anjuta-convert.c \
- anjuta-message-area.c \
anjuta-preferences-dialog.c \
anjuta-preferences.c \
anjuta-plugin.c \
@@ -75,7 +74,6 @@ libanjuta_la_SOURCES= \
anjuta-sync-command.h \
anjuta-async-notify.h \
anjuta-async-notify.c \
- anjuta-message-area.h \
anjuta-debug.c \
anjuta-debug.h \
gbf-project.c \
@@ -114,7 +112,6 @@ libanjuta_include = \
anjuta-status.h \
anjuta-encodings.h \
anjuta-convert.h \
- anjuta-message-area.h \
anjuta-plugin.h \
anjuta-plugin-description.h \
anjuta-plugin-manager.h \
diff --git a/libanjuta/libanjuta.h b/libanjuta/libanjuta.h
index ae341e8..fd0b75b 100644
--- a/libanjuta/libanjuta.h
+++ b/libanjuta/libanjuta.h
@@ -27,7 +27,6 @@
#include <libanjuta/anjuta-enum-types.h>
#include <libanjuta/anjuta-launcher.h>
#include <libanjuta/anjuta-marshal.h>
-#include <libanjuta/anjuta-message-area.h>
#include <libanjuta/anjuta-plugin-description.h>
#include <libanjuta/anjuta-plugin.h>
#include <libanjuta/anjuta-plugin-manager.h>
diff --git a/plugins/document-manager/anjuta-docman.c b/plugins/document-manager/anjuta-docman.c
index 97a7f2a..79ab99f 100644
--- a/plugins/document-manager/anjuta-docman.c
+++ b/plugins/document-manager/anjuta-docman.c
@@ -22,7 +22,6 @@
#include <libanjuta/anjuta-utils.h>
#include <libanjuta/anjuta-preferences.h>
#include <libanjuta/anjuta-debug.h>
-#include <libanjuta/anjuta-message-area.h>
#include <libanjuta/interfaces/ianjuta-file.h>
#include <libanjuta/interfaces/ianjuta-markable.h>
#include <libanjuta/interfaces/ianjuta-file-savable.h>
diff --git a/plugins/gtodo/mcategory.c b/plugins/gtodo/mcategory.c
index 8b27729..e08fc8d 100644
--- a/plugins/gtodo/mcategory.c
+++ b/plugins/gtodo/mcategory.c
@@ -23,7 +23,7 @@ void category_manager(void)
NULL);
hbox = gtk_hbox_new(FALSE,12);
- gtk_container_add(GTK_CONTAINER(gtk_container_get_content_area(GTK_DIALOG(dialog))), hbox);
+ gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), hbox);
gtk_container_set_border_width(GTK_CONTAINER(hbox), 6);
/* the list */
diff --git a/plugins/sourceview/sourceview.c b/plugins/sourceview/sourceview.c
index cc7c644..00890d5 100644
--- a/plugins/sourceview/sourceview.c
+++ b/plugins/sourceview/sourceview.c
@@ -26,7 +26,6 @@
#include <libanjuta/anjuta-debug.h>
#include <libanjuta/anjuta-preferences.h>
#include <libanjuta/anjuta-encodings.h>
-#include <libanjuta/anjuta-message-area.h>
#include <libanjuta/anjuta-shell.h>
#include <libanjuta/interfaces/ianjuta-file.h>
#include <libanjuta/interfaces/ianjuta-file-savable.h>
@@ -114,6 +113,27 @@ static const gchar* marker_types [] =
#define WARNING_INDIC "warning_indic"
#define CRITICAL_INDIC "critical_indic"
+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);
+}
+
/* Create pixmaps for the markers */
static void sourceview_create_markers(Sourceview* sv)
{
@@ -351,11 +371,11 @@ on_file_changed (SourceviewIO* sio, Sourceview* sv)
doc = IANJUTA_DOCUMENT (sv);
- message_area = anjuta_message_area_new (buff, GTK_STOCK_DIALOG_WARNING);
- anjuta_message_area_add_button (ANJUTA_MESSAGE_AREA (message_area),
+ message_area = anjuta_message_area_new (buff, GTK_MESSAGE_WARNING);
+ 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_free (buff);
@@ -388,11 +408,11 @@ on_file_deleted (SourceviewIO* sio, Sourceview* sv)
doc = IANJUTA_DOCUMENT (sv);
- message_area = anjuta_message_area_new (buff, GTK_STOCK_DIALOG_WARNING);
- anjuta_message_area_add_button (ANJUTA_MESSAGE_AREA (message_area),
+ message_area = anjuta_message_area_new (buff, GTK_MESSAGE_WARNING);
+ 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_free (buff);
@@ -423,8 +443,8 @@ on_open_failed (SourceviewIO* io, GError* err, Sourceview* sv)
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),
+ message_area = anjuta_message_area_new (message, GTK_MESSAGE_WARNING);
+ gtk_info_bar_add_button (GTK_INFO_BAR (message_area),
GTK_STOCK_OK,
GTK_RESPONSE_OK);
g_signal_connect (message_area, "response", G_CALLBACK(gtk_widget_destroy), NULL);
@@ -476,11 +496,11 @@ on_open_finish(SourceviewIO* io, Sourceview* sv)
GtkWidget* message_area;
g_free (filename);
- message_area = anjuta_message_area_new (buff, GTK_STOCK_DIALOG_WARNING);
- anjuta_message_area_add_button (ANJUTA_MESSAGE_AREA (message_area),
+ message_area = anjuta_message_area_new (buff, GTK_MESSAGE_WARNING);
+ gtk_info_bar_add_button (GTK_INFO_BAR (message_area),
GTK_STOCK_YES,
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_NO,
GTK_RESPONSE_NO);
g_free (buff);
@@ -536,8 +556,8 @@ static void on_save_failed (SourceviewIO* sio, GError* err, Sourceview* sv)
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),
+ message_area = anjuta_message_area_new (message, GTK_MESSAGE_ERROR);
+ gtk_info_bar_add_button (GTK_INFO_BAR (message_area),
GTK_STOCK_OK,
GTK_RESPONSE_OK);
g_signal_connect (message_area, "response", G_CALLBACK(gtk_widget_destroy), NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]