Revision: 527 Author: eht16 Date: 2006-07-02 11:34:03 -0700 (Sun, 02 Jul 2006) ViewCVS: http://svn.sourceforge.net/geany/?rev=527&view=rev
Log Message: ----------- Added option to disable the VTE follows path feature.
Modified Paths: -------------- trunk/ChangeLog trunk/src/callbacks.c trunk/src/dialogs.c trunk/src/geany.h trunk/src/keyfile.c trunk/src/prefs.c trunk/src/vte.c trunk/src/vte.h Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-07-02 18:12:34 UTC (rev 526) +++ trunk/ChangeLog 2006-07-02 18:34:03 UTC (rev 527) @@ -8,6 +8,8 @@ Little redesign of the preferences dialog. New options for setting the placement of notebook tabs. * doc/Makefile.am: Minor improvements. + * src/keyfile.c, src/geany.h, src/prefs.c, src/vte.c, src/callbacks.c, + src/dialogs.c: Added option to disable the VTE follows path feature.
2006-07-02 Nick Treleaven nick.treleaven@btinternet.com
Modified: trunk/src/callbacks.c =================================================================== --- trunk/src/callbacks.c 2006-07-02 18:12:34 UTC (rev 526) +++ trunk/src/callbacks.c 2006-07-02 18:34:03 UTC (rev 527) @@ -766,19 +766,18 @@ }
#ifdef HAVE_VTE + if (app->have_vte && vc->follow_path && doc_list[idx].file_name != NULL) + { gchar *path; gchar *cmd;
- if (app->have_vte && doc_list[idx].file_name != NULL) - { - path = g_path_get_dirname(doc_list[idx].file_name); - cmd = g_strconcat("cd ", path, "\n", "clear\n", NULL); - vte_send_cmd(cmd); - g_free(path); - g_free(cmd); - } + path = g_path_get_dirname(doc_list[idx].file_name); + cmd = g_strconcat("cd ", path, "\n", NULL); + vte_send_cmd(cmd); + g_free(path); + g_free(cmd); + } #endif - }
Modified: trunk/src/dialogs.c =================================================================== --- trunk/src/dialogs.c 2006-07-02 18:12:34 UTC (rev 526) +++ trunk/src/dialogs.c 2006-07-02 18:34:03 UTC (rev 527) @@ -1646,7 +1646,7 @@ #ifdef HAVE_VTE GtkWidget *notebook, *vbox, *label, *alignment, *table; GtkWidget *font_term, *color_fore, *color_back, *spin_scrollback, *entry_emulation; - GtkWidget *check_scroll_key, *check_scroll_out; + GtkWidget *check_scroll_key, *check_scroll_out, *check_follow_path; GtkTooltips *tooltips; GtkObject *spin_scrollback_adj; #endif @@ -1686,7 +1686,7 @@ gtk_box_pack_start(GTK_BOX(vbox), alignment, FALSE, FALSE, 0); gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 0, 12, 6);
- table = gtk_table_new(7, 2, FALSE); + table = gtk_table_new(8, 2, FALSE); gtk_container_add(GTK_CONTAINER(alignment), table); gtk_table_set_row_spacings(GTK_TABLE(table), 3); gtk_table_set_col_spacings(GTK_TABLE(table), 25); @@ -1770,6 +1770,13 @@ gtk_tooltips_set_tip(tooltips, check_scroll_out, _("Whether to scroll to the bottom if an output was generated."), NULL); gtk_button_set_focus_on_click(GTK_BUTTON(check_scroll_out), FALSE);
+ check_follow_path = gtk_check_button_new_with_mnemonic(_("Follow the path of the current file")); + gtk_table_attach(GTK_TABLE(table), check_follow_path, 1, 2, 7, 8, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_tooltips_set_tip(tooltips, check_follow_path, _("Whether to execute "cd $path" when you switch between opened files."), NULL); + gtk_button_set_focus_on_click(GTK_BUTTON(check_follow_path), FALSE); + label = gtk_label_new(_("Terminal")); gtk_notebook_set_tab_label(GTK_NOTEBOOK(notebook), gtk_notebook_get_nth_page( GTK_NOTEBOOK(notebook), 6), label); @@ -1788,6 +1795,8 @@ gtk_widget_ref(check_scroll_key), (GDestroyNotify) gtk_widget_unref); g_object_set_data_full(G_OBJECT(app->prefs_dialog), "check_scroll_out", gtk_widget_ref(check_scroll_out), (GDestroyNotify) gtk_widget_unref); + g_object_set_data_full(G_OBJECT(app->prefs_dialog), "check_follow_path", + gtk_widget_ref(check_follow_path), (GDestroyNotify) gtk_widget_unref);
gtk_widget_show_all(vbox);
Modified: trunk/src/geany.h =================================================================== --- trunk/src/geany.h 2006-07-02 18:12:34 UTC (rev 526) +++ trunk/src/geany.h 2006-07-02 18:34:03 UTC (rev 527) @@ -180,6 +180,7 @@ gboolean load_vte; gboolean have_vte; gchar *lib_vte; + gchar *terminal_settings; #endif gchar *long_line_color; gchar *pref_template_developer; @@ -192,7 +193,6 @@ gchar *msgwin_font; gchar *configdir; gchar *search_text; - gchar *terminal_settings; gchar build_make_custopt[256]; gchar *tools_browser_cmd; gchar *tools_make_cmd;
Modified: trunk/src/keyfile.c =================================================================== --- trunk/src/keyfile.c 2006-07-02 18:12:34 UTC (rev 526) +++ trunk/src/keyfile.c 2006-07-02 18:34:03 UTC (rev 527) @@ -106,7 +106,7 @@ #ifdef HAVE_VTE g_key_file_set_boolean(config, PACKAGE, "load_vte", app->load_vte); g_key_file_set_comment(config, PACKAGE, "terminal_settings", - _(" VTE settings: FONT;FOREGROUND;BACKGROUND;scrollback;type;scroll on keystroke;scroll on output"), NULL); + _(" VTE settings: FONT;FOREGROUND;BACKGROUND;scrollback;type;scroll on keystroke;scroll on output;follow path of file"), NULL); g_key_file_set_string(config, PACKAGE, "terminal_settings", app->terminal_settings); #endif g_key_file_set_string(config, PACKAGE, "editor_font", app->editor_font);
Modified: trunk/src/prefs.c =================================================================== --- trunk/src/prefs.c 2006-07-02 18:12:34 UTC (rev 526) +++ trunk/src/prefs.c 2006-07-02 18:34:03 UTC (rev 527) @@ -298,6 +298,9 @@
widget = lookup_widget(app->prefs_dialog, "check_scroll_out"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), vc->scroll_on_out); + + widget = lookup_widget(app->prefs_dialog, "check_follow_path"); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), vc->follow_path); } #endif } @@ -480,6 +483,9 @@ widget = lookup_widget(app->prefs_dialog, "check_scroll_out"); vc->scroll_on_out = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
+ widget = lookup_widget(app->prefs_dialog, "check_follow_path"); + vc->follow_path = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); + g_free(app->terminal_settings); hex_color_fore = utils_get_hex_from_color(vc->color_fore); hex_color_back = utils_get_hex_from_color(vc->color_back);
Modified: trunk/src/vte.c =================================================================== --- trunk/src/vte.c 2006-07-02 18:12:34 UTC (rev 526) +++ trunk/src/vte.c 2006-07-02 18:34:03 UTC (rev 527) @@ -287,12 +287,12 @@
static void vte_get_settings(void) { - gchar **values = g_strsplit(app->terminal_settings, ";", 7); + gchar **values = g_strsplit(app->terminal_settings, ";", 8);
- if (g_strv_length(values) != 7) + if (g_strv_length(values) != 8) { - app->terminal_settings = g_strdup_printf("Monospace 10;#FFFFFF;#000000;500;xterm;true;true"); - values = g_strsplit(app->terminal_settings, ";", 7); + app->terminal_settings = g_strdup_printf("Monospace 10;#FFFFFF;#000000;500;xterm;true;true;false"); + values = g_strsplit(app->terminal_settings, ";", 8); } vc->font = g_strdup(values[0]); vc->color_fore = g_new0(GdkColor, 1); @@ -307,6 +307,7 @@
vc->scroll_on_key = utils_atob(values[5]); vc->scroll_on_out = utils_atob(values[6]); + vc->follow_path = utils_atob(values[7]);
g_strfreev(values); } @@ -330,7 +331,7 @@ case 2: { on_preferences1_activate(menuitem, NULL); - gtk_notebook_set_current_page(GTK_NOTEBOOK(lookup_widget(app->prefs_dialog, "notebook2")), 5); + gtk_notebook_set_current_page(GTK_NOTEBOOK(lookup_widget(app->prefs_dialog, "notebook2")), 6); break; } }
Modified: trunk/src/vte.h =================================================================== --- trunk/src/vte.h 2006-07-02 18:12:34 UTC (rev 526) +++ trunk/src/vte.h 2006-07-02 18:34:03 UTC (rev 527) @@ -70,6 +70,7 @@ GtkWidget *menu; gboolean scroll_on_key; gboolean scroll_on_out; + gboolean follow_path; gint scrollback_lines; gchar *emulation; gchar *font;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.