gnome-mud r827 - in trunk: . src ui
- From: lharris svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-mud r827 - in trunk: . src ui
- Date: Sun, 22 Mar 2009 04:26:45 +0000 (UTC)
Author: lharris
Date: Sun Mar 22 04:26:45 2009
New Revision: 827
URL: http://svn.gnome.org/viewvc/gnome-mud?rev=827&view=rev
Log:
MudLog now logs input by default.
Modified:
trunk/ChangeLog
trunk/src/mud-connection-view.c
trunk/src/mud-log.c
trunk/ui/main.glade
Modified: trunk/src/mud-connection-view.c
==============================================================================
--- trunk/src/mud-connection-view.c (original)
+++ trunk/src/mud-connection-view.c Sun Mar 22 04:26:45 2009
@@ -1825,6 +1825,8 @@
view->priv->download_queue = NULL;
#endif
+ mud_connection_view_stop_logging(view);
+
view->priv->processed = NULL;
gnet_conn_disconnect(view->connection);
@@ -1869,6 +1871,8 @@
view->priv->download_queue = NULL;
#endif
+ mud_connection_view_stop_logging(view);
+
view->priv->processed = NULL;
gnet_conn_disconnect(view->connection);
@@ -2056,6 +2060,22 @@
mud_connection_view_add_text(view, "\r\n", Sent);
}
+ if(view->local_echo)
+ {
+ gboolean log_input;
+
+ if(mud_log_islogging(view->log))
+ {
+ g_object_get(view->log, "log-input", &log_input, NULL);
+
+ if(log_input)
+ {
+ mud_log_write_hook(view->log, text, strlen(text));
+ mud_log_write_hook(view->log, "\r\n", 2);
+ }
+ }
+ }
+
if(conv_text != NULL)
g_free(conv_text);
g_free(text);
Modified: trunk/src/mud-log.c
==============================================================================
--- trunk/src/mud-log.c (original)
+++ trunk/src/mud-log.c Sun Mar 22 04:26:45 2009
@@ -47,6 +47,7 @@
GtkWidget *check_log_prev;
GtkWidget *check_append;
GtkWidget *check_buffer;
+ GtkWidget *check_input;
GtkWidget *check_color;
GtkWidget *entry_file;
GtkWidget *btn_select;
@@ -57,6 +58,7 @@
gboolean buffer;
gboolean include_next;
gboolean include_prev;
+ gboolean input;
gboolean done;
gboolean finalizing;
@@ -89,7 +91,8 @@
PROP_MUD_LOG_0,
PROP_MUD_NAME,
PROP_PARENT,
- PROP_WINDOW
+ PROP_WINDOW,
+ PROP_INPUT
};
/* Define the Type */
@@ -116,6 +119,7 @@
static void mud_log_prev_toggled_cb(GtkToggleButton *button, MudLog *self);
static void mud_log_append_toggled_cb(GtkToggleButton *button, MudLog *self);
static void mud_log_buffer_toggled_cb(GtkToggleButton *button, MudLog *self);
+static void mud_log_input_toggled_cb(GtkToggleButton *button, MudLog *self);
static void mud_log_color_toggled_cb(GtkToggleButton *button, MudLog *self);
static void mud_log_select_clicked_cb(GtkWidget *widget, MudLog *self);
static void mud_log_next_spin_changed_cb(GtkSpinButton *button, MudLog *self);
@@ -191,6 +195,14 @@
"Parent MudConnectionView",
MUD_TYPE_CONNECTION_VIEW,
G_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY));
+
+ g_object_class_install_property(object_class,
+ PROP_INPUT,
+ g_param_spec_boolean("log-input",
+ "Log Input",
+ "The log should log the input as well.",
+ TRUE,
+ G_PARAM_READABLE));
}
static void
@@ -207,6 +219,7 @@
log->priv->parent_window = NULL;
log->priv->parent = NULL;
log->priv->filename = NULL;
+ log->priv->input = TRUE;
log->priv->append = TRUE;
log->priv->buffer = FALSE;
@@ -354,6 +367,10 @@
g_value_take_object(value, self->priv->parent);
break;
+ case PROP_INPUT:
+ g_value_set_boolean(value, self->priv->input);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
@@ -483,6 +500,21 @@
g_object_get(button, "active", &active, NULL);
self->priv->append = active;
+
+ if(self->priv->append)
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(self->priv->check_color),
+ FALSE);
+}
+
+static void
+mud_log_input_toggled_cb(GtkToggleButton *button,
+ MudLog *self)
+{
+ gboolean active;
+
+ g_object_get(button, "active", &active, NULL);
+
+ self->priv->input = active;
}
static void
@@ -509,6 +541,10 @@
g_object_get(button, "active", &active, NULL);
self->priv->color = active;
+
+ if(self->priv->color)
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(self->priv->check_append),
+ FALSE);
}
static gboolean
@@ -582,7 +618,6 @@
GladeXML *glade;
GtkWidget *main_window;
gchar buf[1024];
- gchar nameBuf[1024];
time_t t;
gint result;
@@ -597,6 +632,7 @@
self->priv->check_log_prev = glade_xml_get_widget(glade, "inc_prev_check_btn");
self->priv->spin_log_prev = glade_xml_get_widget(glade, "prev_spin_btn");
self->priv->check_append = glade_xml_get_widget(glade, "append_check_btn");
+ self->priv->check_input = glade_xml_get_widget(glade, "input_check_btn");
self->priv->check_buffer = glade_xml_get_widget(glade, "buffer_check_btn");
self->priv->check_color = glade_xml_get_widget(glade, "color_check_btn");
self->priv->btn_select = glade_xml_get_widget(glade, "select_btn");
@@ -642,6 +678,11 @@
G_CALLBACK(mud_log_append_toggled_cb),
self);
+ g_signal_connect(self->priv->check_input,
+ "toggled",
+ G_CALLBACK(mud_log_input_toggled_cb),
+ self);
+
g_signal_connect(self->priv->check_buffer,
"toggled",
G_CALLBACK(mud_log_buffer_toggled_cb),
@@ -654,6 +695,17 @@
g_object_unref(glade);
+ if(self->priv->filename)
+ g_free(self->priv->filename);
+
+ self->priv->filename = g_strdup_printf("%s%c%s.log",
+ g_get_home_dir(),
+ G_DIR_SEPARATOR,
+ self->mud_name);
+
+ gtk_entry_set_text(GTK_ENTRY(self->priv->entry_file),
+ self->priv->filename);
+
result = gtk_dialog_run(GTK_DIALOG(self->priv->window));
if(result == GTK_RESPONSE_OK)
Modified: trunk/ui/main.glade
==============================================================================
--- trunk/ui/main.glade (original)
+++ trunk/ui/main.glade Sun Mar 22 04:26:45 2009
@@ -558,6 +558,7 @@
<property name="label" translatable="yes"><b>_Log to File:</b></property>
<property name="use_markup">True</property>
<property name="use_underline">True</property>
+ <property name="mnemonic_widget">file_entry</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -840,6 +841,41 @@
</packing>
</child>
<child>
+ <widget class="GtkHBox" id="hbox8">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkLabel" id="label14">
+ <property name="visible">True</property>
+ <property name="width_chars">5</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="input_check_btn">
+ <property name="label" translatable="yes">Log Inp_ut</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">5</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="padding">2</property>
+ <property name="position">8</property>
+ </packing>
+ </child>
+ <child>
<widget class="GtkHBox" id="hbox5">
<property name="visible">True</property>
<child>
@@ -869,8 +905,8 @@
</widget>
<packing>
<property name="expand">False</property>
- <property name="padding">5</property>
- <property name="position">8</property>
+ <property name="padding">2</property>
+ <property name="position">9</property>
</packing>
</child>
<child>
@@ -903,7 +939,7 @@
</widget>
<packing>
<property name="expand">False</property>
- <property name="position">9</property>
+ <property name="position">10</property>
</packing>
</child>
<child>
@@ -913,7 +949,7 @@
<packing>
<property name="expand">False</property>
<property name="padding">5</property>
- <property name="position">10</property>
+ <property name="position">11</property>
</packing>
</child>
</widget>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]