gnome-mud r778 - in trunk: . src ui
- From: lharris svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-mud r778 - in trunk: . src ui
- Date: Sun, 1 Mar 2009 12:01:55 +0000 (UTC)
Author: lharris
Date: Sun Mar 1 12:01:55 2009
New Revision: 778
URL: http://svn.gnome.org/viewvc/gnome-mud?rev=778&view=rev
Log:
Added Clear button to Logger.
Modified:
trunk/ChangeLog
trunk/src/debug-logger.c
trunk/ui/main.glade
Modified: trunk/src/debug-logger.c
==============================================================================
--- trunk/src/debug-logger.c (original)
+++ trunk/src/debug-logger.c Sun Mar 1 12:01:55 2009
@@ -40,6 +40,7 @@
GtkWidget *toolbar_save;
GtkWidget *toolbar_copy;
GtkWidget *toolbar_select;
+ GtkWidget *toolbar_clear;
GSList *domains;
};
@@ -105,6 +106,7 @@
static void debug_logger_save_clicked(GtkWidget *widget, DebugLogger *logger);
static void debug_logger_copy_clicked(GtkWidget *widget, DebugLogger *logger);
static void debug_logger_select_clicked(GtkWidget *widget, DebugLogger *logger);
+static void debug_logger_clear_clicked(GtkWidget *widget, DebugLogger *logger);
/* Class Functions */
static void
@@ -127,9 +129,11 @@
self->priv->window = GTK_WINDOW(glade_xml_get_widget(glade, "log_window"));
self->priv->vbox = GTK_VBOX(glade_xml_get_widget(glade, "vbox"));
+
self->priv->toolbar_save = glade_xml_get_widget(glade, "toolbar_save");
self->priv->toolbar_copy = glade_xml_get_widget(glade, "toolbar_copy");
self->priv->toolbar_select = glade_xml_get_widget(glade, "toolbar_selectall");
+ self->priv->toolbar_clear = glade_xml_get_widget(glade, "toolbar_clear");
self->priv->notebook = GTK_NOTEBOOK(gtk_notebook_new());
@@ -153,6 +157,10 @@
G_CALLBACK(debug_logger_select_clicked),
self);
+ g_signal_connect(self->priv->toolbar_clear, "clicked",
+ G_CALLBACK(debug_logger_clear_clicked),
+ self);
+
gtk_widget_show_all(GTK_WIDGET(self->priv->window));
g_object_unref(glade);
@@ -607,6 +615,31 @@
gtk_tree_selection_select_all(selection);
}
+static void
+debug_logger_clear_clicked(GtkWidget *widget, DebugLogger *logger)
+{
+ GtkTreeView *view;
+ GtkListStore *store;
+ gint current_page;
+
+ g_return_if_fail(IS_DEBUG_LOGGER(logger));
+
+ if(gtk_notebook_get_n_pages(logger->priv->notebook) == 0)
+ return;
+
+ current_page = gtk_notebook_get_current_page(logger->priv->notebook);
+
+ view =
+ GTK_TREE_VIEW(gtk_bin_get_child(
+ GTK_BIN(gtk_notebook_get_nth_page(
+ GTK_NOTEBOOK(logger->priv->notebook),
+ current_page))));
+
+ store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
+
+ gtk_list_store_clear(store);
+}
+
/* Private Methods */
static void
debug_logger_log_func (const gchar *log_domain,
Modified: trunk/ui/main.glade
==============================================================================
--- trunk/ui/main.glade (original)
+++ trunk/ui/main.glade Sun Mar 1 12:01:55 2009
@@ -486,6 +486,15 @@
</packing>
</child>
<child>
+ <widget class="GtkSeparatorToolItem" id="toolbutton1">
+ <property name="visible">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
<widget class="GtkToolButton" id="toolbar_copy">
<property name="visible">True</property>
<property name="sensitive">False</property>
@@ -511,6 +520,26 @@
<property name="homogeneous">True</property>
</packing>
</child>
+ <child>
+ <widget class="GtkSeparatorToolItem" id="toolbutton2">
+ <property name="visible">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkToolButton" id="toolbar_clear">
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="stock_id">gtk-clear</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]