gnoemoe/widgets/gm-world-view.c: use gm_world_status

gnoemoe/widgets/gm-world-input-view.c: fixed size after activate
gnoemoe/widgets/gm-editor-view.c: custom style scheme
gnoemoe/widgets/gm-app-view.c: fix ctrl cycle
This commit is contained in:
Jesse van den Kieboom 2006-04-07 16:25:12 +00:00
parent 107209cdb7
commit b230a75fce
4 changed files with 25 additions and 19 deletions

View File

@ -1116,10 +1116,10 @@ on_gm_app_view_accel_switch_page(GtkAccelGroup * accelgroup, GObject * arg1,
void void
on_gm_app_view_accel_switch_edit(GtkAccelGroup * accelgroup, GObject * arg1, on_gm_app_view_accel_switch_edit(GtkAccelGroup * accelgroup, GObject * arg1,
guint arg2, GdkModifierType arg3, AccelInfo *info) { guint arg2, GdkModifierType arg3, AccelInfo *info) {
GmWorld *world = gm_app_view_active_world(info->view); GmWorldView *view = gm_app_view_active_world_view(info->view);
if (world) { if (view) {
gtk_notebook_set_current_page(info->view->priv->notebook, info->num); gtk_notebook_set_current_page(GTK_NOTEBOOK(view), info->num);
} }
} }

View File

@ -42,7 +42,6 @@ struct _GmEditorViewPrivate {
}; };
static GtkSourceLanguage *language = NULL; static GtkSourceLanguage *language = NULL;
static GtkSourceLanguagesManager *language_manager = NULL;
/* Signals */ /* Signals */
@ -111,13 +110,17 @@ gm_editor_view_finalize(GObject *object) {
void void
gm_editor_view_init_language() { gm_editor_view_init_language() {
if (language_manager == NULL) { GtkSourceLanguagesManager *manager;
language_manager = gtk_source_languages_manager_new();
language = gtk_source_languages_manager_get_language_from_mime_type( if (language == NULL) {
language_manager, "text/x-moo"); manager = gtk_source_languages_manager_new();
language = g_object_ref(gtk_source_languages_manager_get_language_from_mime_type(
manager, "text/x-moo"));
gtk_source_language_set_style_scheme(language, gtk_source_language_set_style_scheme(language,
gm_source_style_scheme_get_default()); gm_source_style_scheme_get_default());
g_object_unref(manager);
} }
} }
@ -245,6 +248,8 @@ gm_editor_view_message_area_style_set(GtkWidget *widget, GtkStyle *prev,
return; return;
} }
widget = view->priv->message_area;
tooltips = gtk_tooltips_new(); tooltips = gtk_tooltips_new();
g_object_ref(G_OBJECT(tooltips)); g_object_ref(G_OBJECT(tooltips));
gtk_object_sink(GTK_OBJECT(tooltips)); gtk_object_sink(GTK_OBJECT(tooltips));
@ -631,7 +636,7 @@ on_gm_editor_view_changed(GtkTextBuffer *buffer,
if (gm_options_get_int(gm_app_options(gm_app_instance()), if (gm_options_get_int(gm_app_options(gm_app_instance()),
"auto_check_syntax")) { "auto_check_syntax")) {
view->priv->timeout_handler = g_timeout_add(500, view->priv->timeout_handler = g_timeout_add(1000,
(GSourceFunc)gm_editor_view_timeout, view); (GSourceFunc)gm_editor_view_timeout, view);
} }
} }

View File

@ -221,6 +221,7 @@ gm_world_input_view_key_press_event(GtkWidget *widget, GdkEventKey *event) {
// Set textview text to an empty string // Set textview text to an empty string
gm_world_input_view_set_text(view, "", 0); gm_world_input_view_set_text(view, "", 0);
on_gm_world_input_view_changed(buf, view);
g_free(text); g_free(text);
result = TRUE; result = TRUE;
} }

View File

@ -840,17 +840,17 @@ on_gm_world_view_world_error(GmWorld *world, gchar *text, gint code,
switch (code) { switch (code) {
case GM_NET_ERROR_CONNECTING: case GM_NET_ERROR_CONNECTING:
line = g_strdup_printf(_("# Connect failed: %s"), text); line = g_strdup_printf(_("Connect failed: %s"), text);
break; break;
case GM_NET_ERROR_DISCONNECTED: case GM_NET_ERROR_DISCONNECTED:
line = g_strdup_printf(_("# Connection lost... (%s)"), text); line = g_strdup_printf(_("Connection lost... (%s)"), text);
break; break;
default: default:
line = g_strdup_printf(_("# Error: %s"), text); line = g_strdup_printf(_("Error: %s"), text);
break; break;
} }
gm_world_writeln(world, line); gm_world_status(world, line);
g_free(line); g_free(line);
} }
@ -862,32 +862,32 @@ on_gm_world_view_world_state_changing(GmWorld *world, guint state,
switch (state) { switch (state) {
case GM_NET_STATE_TRY_ADDRESS: case GM_NET_STATE_TRY_ADDRESS:
line = g_strdup_printf(_("# Trying %s port %s"), line = g_strdup_printf(_("Trying %s port %s"),
gm_world_current_host(world), gm_world_current_port(world)); gm_world_current_host(world), gm_world_current_port(world));
break; break;
case GM_NET_STATE_CONNECTING: case GM_NET_STATE_CONNECTING:
line = g_strdup_printf(_("# Connecting to %s port %s"), line = g_strdup_printf(_("Connecting to %s port %s"),
gm_world_current_host(world), gm_world_current_port(world)); gm_world_current_host(world), gm_world_current_port(world));
break; break;
case GM_NET_STATE_CONNECTED: case GM_NET_STATE_CONNECTED:
line = g_strdup(_("# Connected")); line = g_strdup(_("Connected"));
break; break;
case GM_NET_STATE_DISCONNECTED: case GM_NET_STATE_DISCONNECTED:
if (pstate == GM_NET_STATE_CONNECTED || if (pstate == GM_NET_STATE_CONNECTED ||
pstate == GM_NET_STATE_DISCONNECTING) { pstate == GM_NET_STATE_DISCONNECTING) {
line = g_strdup(_("# Disconnected")); line = g_strdup(_("Disconnected"));
} }
gm_world_view_update_status(view, NULL); gm_world_view_update_status(view, NULL);
break; break;
case GM_NET_STATE_DISCONNECTING: case GM_NET_STATE_DISCONNECTING:
line = g_strdup(_("# Disconnecting")); line = g_strdup(_("Disconnecting"));
break; break;
default: default:
break; break;
} }
if (line) { if (line) {
gm_world_writeln(world, line); gm_world_status(world, line);
g_free(line); g_free(line);
} }
} }