* gnoemoe/gm-world.c: added static to functions, added flushing
history to disk * gnoemoe/dialogs/gm-world-paste-dialog.c: fixed sending with empty 'to' field * gnoemoe/widgets/gm-world-text-view.c: fixed blinking
This commit is contained in:
parent
b3b456d5f1
commit
62b7cbc8cb
|
@ -1,3 +1,10 @@
|
||||||
|
2006-18-06 Jesse van den Kieboom <jesse@icecrew.nl>
|
||||||
|
* gnoemoe/gm-world.c: added static to functions, added flushing history
|
||||||
|
to disk
|
||||||
|
* gnoemoe/dialogs/gm-world-paste-dialog.c: fixed sending with empty
|
||||||
|
'to' field
|
||||||
|
* gnoemoe/widgets/gm-world-text-view.c: fixed blinking
|
||||||
|
|
||||||
2006-23-04 Jesse van den Kieboom <jesse@icecrew.nl>
|
2006-23-04 Jesse van den Kieboom <jesse@icecrew.nl>
|
||||||
* VERSION CHANGED TO 2.0.10
|
* VERSION CHANGED TO 2.0.10
|
||||||
* gnoemoe/mcp/gm-cell-renderer-text.c: fixed font sizes for smaller
|
* gnoemoe/mcp/gm-cell-renderer-text.c: fixed font sizes for smaller
|
||||||
|
|
|
@ -271,7 +271,7 @@ gm_world_paste_dialog_do_paste() {
|
||||||
gm_error_dialog(_("Please specify a command to be send"),
|
gm_error_dialog(_("Please specify a command to be send"),
|
||||||
GTK_WINDOW(gm_world_paste_dialog_instance->dialog));
|
GTK_WINDOW(gm_world_paste_dialog_instance->dialog));
|
||||||
} else {
|
} else {
|
||||||
if (to) {
|
if (to && *to != '\0') {
|
||||||
cmd = g_strconcat(command, " ", to, NULL);
|
cmd = g_strconcat(command, " ", to, NULL);
|
||||||
} else {
|
} else {
|
||||||
cmd = g_strdup(command);
|
cmd = g_strdup(command);
|
||||||
|
|
|
@ -17,21 +17,21 @@
|
||||||
#define GM_WORLD_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), \
|
#define GM_WORLD_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), \
|
||||||
GM_TYPE_WORLD, GmWorldPrivate))
|
GM_TYPE_WORLD, GmWorldPrivate))
|
||||||
|
|
||||||
void gm_world_save_input_history(GmWorld *world);
|
static void gm_world_save_input_history(GmWorld *world);
|
||||||
void gm_world_load_input_history(GmWorld *world);
|
static void gm_world_load_input_history(GmWorld *world);
|
||||||
void gm_world_load_triggers(GmWorld *world);
|
static void gm_world_load_triggers(GmWorld *world);
|
||||||
|
|
||||||
void on_gm_world_net_state_changing(GmNet *net, GmNetState state,
|
static void on_gm_world_net_state_changing(GmNet *net, GmNetState state,
|
||||||
GmWorld *world);
|
GmWorld *world);
|
||||||
void on_gm_world_net_state_changed(GmNet *net, GmNetState state,
|
static void on_gm_world_net_state_changed(GmNet *net, GmNetState state,
|
||||||
GmWorld *world);
|
GmWorld *world);
|
||||||
void on_gm_world_net_net_error(GmNet *net, gchar *error, gint code,
|
static void on_gm_world_net_net_error(GmNet *net, gchar *error, gint code,
|
||||||
GmWorld *world);
|
GmWorld *world);
|
||||||
void on_gm_world_net_bytes_recv(GmNet *net, gchar *text, gint len,
|
static void on_gm_world_net_bytes_recv(GmNet *net, gchar *text, gint len,
|
||||||
GmWorld *world);
|
GmWorld *world);
|
||||||
void on_gm_world_options_option_changed(GmOptions *options, gchar *key,
|
static void on_gm_world_options_option_changed(GmOptions *options, gchar *key,
|
||||||
GmWorld *world);
|
GmWorld *world);
|
||||||
void on_gm_world_editor_save(GmEditor *editor, GmWorld *world);
|
static void on_gm_world_editor_save(GmEditor *editor, GmWorld *world);
|
||||||
|
|
||||||
struct _GmWorldPrivate {
|
struct _GmWorldPrivate {
|
||||||
gchar *path;
|
gchar *path;
|
||||||
|
@ -42,6 +42,7 @@ struct _GmWorldPrivate {
|
||||||
gboolean manual_disconnect;
|
gboolean manual_disconnect;
|
||||||
time_t manual_disconnect_timeout;
|
time_t manual_disconnect_timeout;
|
||||||
guint reconnect_id;
|
guint reconnect_id;
|
||||||
|
guint flush_history_id;
|
||||||
time_t last_command;
|
time_t last_command;
|
||||||
|
|
||||||
GmOptions *options;
|
GmOptions *options;
|
||||||
|
@ -86,6 +87,8 @@ enum {
|
||||||
NUM_SIGNALS
|
NUM_SIGNALS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define HISTORY_FLUSH_INTERVAL (10 * 60000)
|
||||||
|
|
||||||
static guint world_signals[NUM_SIGNALS] = {0};
|
static guint world_signals[NUM_SIGNALS] = {0};
|
||||||
|
|
||||||
G_DEFINE_TYPE(GmWorld, gm_world, G_TYPE_OBJECT)
|
G_DEFINE_TYPE(GmWorld, gm_world, G_TYPE_OBJECT)
|
||||||
|
@ -107,6 +110,10 @@ gm_world_finalize(GObject *object) {
|
||||||
if (world->priv->reconnect_id) {
|
if (world->priv->reconnect_id) {
|
||||||
g_source_remove(world->priv->reconnect_id);
|
g_source_remove(world->priv->reconnect_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (world->priv->flush_history_id) {
|
||||||
|
g_source_remove(world->priv->flush_history_id);
|
||||||
|
}
|
||||||
|
|
||||||
gm_g_list_free_simple(world->priv->history);
|
gm_g_list_free_simple(world->priv->history);
|
||||||
|
|
||||||
|
@ -320,7 +327,7 @@ gm_world_class_init(GmWorldClass *klass) {
|
||||||
g_type_class_add_private(object_class, sizeof(GmWorldPrivate));
|
g_type_class_add_private(object_class, sizeof(GmWorldPrivate));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
gm_world_create_default_settings(GmWorld *world) {
|
gm_world_create_default_settings(GmWorld *world) {
|
||||||
const gchar *loc = gm_default_charset();
|
const gchar *loc = gm_default_charset();
|
||||||
|
|
||||||
|
@ -368,7 +375,7 @@ gm_world_init(GmWorld *world) {
|
||||||
G_CALLBACK(on_gm_world_options_option_changed), world);
|
G_CALLBACK(on_gm_world_options_option_changed), world);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
gm_world_load_input_history(GmWorld *world) {
|
gm_world_load_input_history(GmWorld *world) {
|
||||||
FILE *f;
|
FILE *f;
|
||||||
gchar line[1024], *filename;
|
gchar line[1024], *filename;
|
||||||
|
@ -405,7 +412,7 @@ gm_world_load_input_history(GmWorld *world) {
|
||||||
g_free(filename);
|
g_free(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
gm_world_save_input_history(GmWorld *world) {
|
gm_world_save_input_history(GmWorld *world) {
|
||||||
FILE *f;
|
FILE *f;
|
||||||
gchar *filename;
|
gchar *filename;
|
||||||
|
@ -438,7 +445,17 @@ gm_world_save_input_history(GmWorld *world) {
|
||||||
g_free(filename);
|
g_free(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static gboolean
|
||||||
|
flush_history_cb(gpointer data) {
|
||||||
|
GmWorld *world = GM_WORLD(data);
|
||||||
|
|
||||||
|
gm_world_save_input_history(world);
|
||||||
|
world->priv->flush_history_id = 0;
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
gm_world_load_triggers(GmWorld *world) {
|
gm_world_load_triggers(GmWorld *world) {
|
||||||
gchar *path;
|
gchar *path;
|
||||||
gchar *oldpath;
|
gchar *oldpath;
|
||||||
|
@ -576,6 +593,11 @@ gm_world_unload(GmWorld *world) {
|
||||||
}
|
}
|
||||||
|
|
||||||
g_signal_emit(world, world_signals[UNLOAD], 0);
|
g_signal_emit(world, world_signals[UNLOAD], 0);
|
||||||
|
|
||||||
|
if (world->priv->flush_history_id) {
|
||||||
|
g_source_remove(world->priv->flush_history_id);
|
||||||
|
flush_history_cb(world);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1156,6 +1178,12 @@ gm_world_sendln_log(GmWorld *world, gchar const *text, GmLogType logtype) {
|
||||||
|
|
||||||
gm_net_send_line(world->priv->net, normal);
|
gm_net_send_line(world->priv->net, normal);
|
||||||
g_free(normal);
|
g_free(normal);
|
||||||
|
|
||||||
|
if (world->priv->flush_history_id != 0)
|
||||||
|
g_source_remove(world->priv->flush_history_id);
|
||||||
|
|
||||||
|
world->priv->flush_history_id = g_timeout_add(HISTORY_FLUSH_INTERVAL,
|
||||||
|
flush_history_cb, world);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1253,7 +1281,7 @@ gm_world_auto_login(GmWorld *world) {
|
||||||
|
|
||||||
/* Callbacks */
|
/* Callbacks */
|
||||||
|
|
||||||
void
|
static void
|
||||||
on_gm_world_editor_save(GmEditor *editor, GmWorld *world) {
|
on_gm_world_editor_save(GmEditor *editor, GmWorld *world) {
|
||||||
GList *line;
|
GList *line;
|
||||||
|
|
||||||
|
@ -1272,7 +1300,7 @@ on_gm_world_editor_save(GmEditor *editor, GmWorld *world) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
on_gm_world_net_state_changing(GmNet *net, GmNetState state, GmWorld *world) {
|
on_gm_world_net_state_changing(GmNet *net, GmNetState state, GmWorld *world) {
|
||||||
GmNetState prev_state = gm_net_state(net);
|
GmNetState prev_state = gm_net_state(net);
|
||||||
|
|
||||||
|
@ -1309,7 +1337,7 @@ on_gm_world_net_state_changing(GmNet *net, GmNetState state, GmWorld *world) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
on_gm_world_net_state_changed(GmNet *net, GmNetState state, GmWorld *world) {
|
on_gm_world_net_state_changed(GmNet *net, GmNetState state, GmWorld *world) {
|
||||||
if (state == GM_NET_STATE_CONNECTED) {
|
if (state == GM_NET_STATE_CONNECTED) {
|
||||||
world->priv->manual_disconnect = FALSE;
|
world->priv->manual_disconnect = FALSE;
|
||||||
|
@ -1322,14 +1350,14 @@ on_gm_world_net_state_changed(GmNet *net, GmNetState state, GmWorld *world) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
on_gm_world_net_net_error(GmNet *net, gchar *error, gint code,
|
on_gm_world_net_net_error(GmNet *net, gchar *error, gint code,
|
||||||
GmWorld *world) {
|
GmWorld *world) {
|
||||||
g_signal_emit(world, world_signals[WORLD_ERROR], 0, error, code);
|
g_signal_emit(world, world_signals[WORLD_ERROR], 0, error, code);
|
||||||
gm_world_log(world, LOG_STATUS, error);
|
gm_world_log(world, LOG_STATUS, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
on_gm_world_net_bytes_recv(GmNet *net, gchar *text, gint len,
|
on_gm_world_net_bytes_recv(GmNet *net, gchar *text, gint len,
|
||||||
GmWorld *world) {
|
GmWorld *world) {
|
||||||
gchar *all, *utext, *ptr, *start;
|
gchar *all, *utext, *ptr, *start;
|
||||||
|
@ -1380,7 +1408,7 @@ on_gm_world_net_bytes_recv(GmNet *net, gchar *text, gint len,
|
||||||
g_free(all);
|
g_free(all);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
on_gm_world_options_option_changed(GmOptions *options, gchar *key,
|
on_gm_world_options_option_changed(GmOptions *options, gchar *key,
|
||||||
GmWorld *world) {
|
GmWorld *world) {
|
||||||
if (strcmp(key, "name") == 0) {
|
if (strcmp(key, "name") == 0) {
|
||||||
|
|
|
@ -698,10 +698,7 @@ gm_world_text_view_blinker_iters(BlinkInfo *info, GtkTextIter *start,
|
||||||
|
|
||||||
if (end != NULL) {
|
if (end != NULL) {
|
||||||
*end = *start;
|
*end = *start;
|
||||||
|
gtk_text_iter_forward_chars(end, g_utf8_strlen(info->fill, -1));
|
||||||
if (!gtk_text_iter_forward_to_tag_toggle(end, tag)) {
|
|
||||||
*end = *start;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tag_blink != NULL) {
|
if (tag_blink != NULL) {
|
||||||
|
|
Reference in New Issue