SF.net SVN: geany: [759] trunk
eht16 at users.sourceforge.net
eht16 at xxxxx
Wed Aug 23 16:37:13 UTC 2006
Revision: 759
Author: eht16
Date: 2006-08-23 09:37:05 -0700 (Wed, 23 Aug 2006)
ViewCVS: http://svn.sourceforge.net/geany/?rev=759&view=rev
Log Message:
-----------
Added new VTE settings to the preferences dialog.
Improved ignore menu bar accelerator settings.
Keep current working directory when restarting the VTE (happens when hitting Ctrl+C).
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/prefs.c
trunk/src/vte.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-08-23 14:30:15 UTC (rev 758)
+++ trunk/ChangeLog 2006-08-23 16:37:05 UTC (rev 759)
@@ -1,8 +1,17 @@
+2006-08-23 Enrico Tröger <enrico.troeger at uvena.de>
+
+ * src/prefs.c, src/vte.c:
+ Added new VTE settings to the preferences dialog.
+ Improved ignore menu bar accelerator settings.
+ Keep current working directory when restarting the VTE
+ (happens when hitting Ctrl+C).
+
+
2006-08-23 Frank Lanitz <frank at frank.uvena.de>
* src/highlighting.c, data/pascal.tags:
- Added auto completion for PASCAL
- * data/latex.tags: Update of catalog
+ Added auto completion for PASCAL.
+ * data/latex.tags: Update of catalog.
2006-08-22 Nick Treleaven <nick.treleaven at btinternet.com>
@@ -18,6 +27,7 @@
Added new settings: ignore menu bar accelerator and define the shell
which is started within the VTE.
(Code not yet complete, might be buggy, GUI stuff is missing)
+ * tagmanager/pascal.c: Added recognition for keyword "type".
2006-08-21 Enrico Tröger <enrico.troeger at uvena.de>
Modified: trunk/src/prefs.c
===================================================================
--- trunk/src/prefs.c 2006-08-23 14:30:15 UTC (rev 758)
+++ trunk/src/prefs.c 2006-08-23 16:37:05 UTC (rev 759)
@@ -342,12 +342,18 @@
widget = lookup_widget(app->prefs_dialog, "entry_emulation");
gtk_entry_set_text(GTK_ENTRY(widget), vc->emulation);
+ widget = lookup_widget(app->prefs_dialog, "entry_shell");
+ gtk_entry_set_text(GTK_ENTRY(widget), vc->shell);
+
widget = lookup_widget(app->prefs_dialog, "check_scroll_key");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), vc->scroll_on_key);
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_ignore_menu_key");
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), vc->ignore_menu_bar_accel);
+
widget = lookup_widget(app->prefs_dialog, "check_follow_path");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), vc->follow_path);
}
@@ -580,12 +586,19 @@
g_free(vc->emulation);
vc->emulation = g_strdup(gtk_entry_get_text(GTK_ENTRY(widget)));
+ widget = lookup_widget(app->prefs_dialog, "entry_shell");
+ g_free(vc->shell);
+ vc->shell = g_strdup(gtk_entry_get_text(GTK_ENTRY(widget)));
+
widget = lookup_widget(app->prefs_dialog, "check_scroll_key");
vc->scroll_on_key = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
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_ignore_menu_key");
+ vc->ignore_menu_bar_accel = 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));
@@ -891,13 +904,6 @@
{
if (app->prefs_dialog == NULL)
{
-#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, *check_follow_path;
- GtkTooltips *tooltips;
- GtkObject *spin_scrollback_adj;
-#endif
GtkWidget *combo;
guint i;
gchar *encoding_string;
@@ -922,6 +928,13 @@
#ifdef HAVE_VTE
if (vte_info.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, *check_follow_path, *check_ignore_menu_key;
+ GtkWidget *entry_shell, *button_shell, *image_shell;
+ GtkTooltips *tooltips;
+ GtkObject *spin_scrollback_adj;
+
tooltips = GTK_TOOLTIPS(lookup_widget(app->prefs_dialog, "tooltips"));
notebook = lookup_widget(app->prefs_dialog, "notebook2");
vbox = gtk_vbox_new(FALSE, 0);
@@ -938,10 +951,10 @@
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(8, 2, FALSE);
+ table = gtk_table_new(10, 3, 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);
+ gtk_table_set_col_spacings(GTK_TABLE(table), 10);
label = gtk_label_new(_("Terminal font"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1,
@@ -1008,22 +1021,51 @@
(GtkAttachOptions) (0), 0, 0);
gtk_tooltips_set_tip(tooltips, entry_emulation, _("Controls how the terminal emulator should behave. xterm is a good start."), NULL);
+ label = gtk_label_new(_("Shell"));
+ gtk_table_attach(GTK_TABLE(table), label, 0, 1, 5, 6,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+
+ entry_shell = gtk_entry_new();
+ gtk_table_attach(GTK_TABLE(table), entry_shell, 1, 2, 5, 6,
+ (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_tooltips_set_tip(tooltips, entry_shell, _("Sets the path to the shell which should be started inside the terminal emulation."), NULL);
+
+ button_shell = gtk_button_new();
+ gtk_widget_show(button_shell);
+ gtk_table_attach(GTK_TABLE(table), button_shell, 2, 3, 5, 6,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ image_shell = gtk_image_new_from_stock("gtk-open", GTK_ICON_SIZE_BUTTON);
+ gtk_widget_show(image_shell);
+ gtk_container_add(GTK_CONTAINER(button_shell), image_shell);
+
check_scroll_key = gtk_check_button_new_with_mnemonic(_("Scroll on keystroke"));
- gtk_table_attach(GTK_TABLE(table), check_scroll_key, 1, 2, 5, 6,
+ gtk_table_attach(GTK_TABLE(table), check_scroll_key, 1, 2, 6, 7,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_tooltips_set_tip(tooltips, check_scroll_key, _("Whether to scroll to the bottom if a key was pressed."), NULL);
gtk_button_set_focus_on_click(GTK_BUTTON(check_scroll_key), FALSE);
check_scroll_out = gtk_check_button_new_with_mnemonic(_("Scroll on output"));
- gtk_table_attach(GTK_TABLE(table), check_scroll_out, 1, 2, 6, 7,
+ gtk_table_attach(GTK_TABLE(table), check_scroll_out, 1, 2, 7, 8,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
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_ignore_menu_key = gtk_check_button_new_with_mnemonic(_("Disable menu shortcut key (F10 by default)"));
+ gtk_table_attach(GTK_TABLE(table), check_ignore_menu_key, 1, 2, 8, 9,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_tooltips_set_tip(tooltips, check_ignore_menu_key, _("This option disables the keybinding to popup the menu bar(default is F10). Disabling it can be useful if you use for example the Midnight Commander within the VTE."), NULL);
+ gtk_button_set_focus_on_click(GTK_BUTTON(check_ignore_menu_key), 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,
+ gtk_table_attach(GTK_TABLE(table), check_follow_path, 1, 2, 9, 10,
(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);
@@ -1043,21 +1085,27 @@
gtk_widget_ref(spin_scrollback), (GDestroyNotify) gtk_widget_unref);
g_object_set_data_full(G_OBJECT(app->prefs_dialog), "entry_emulation",
gtk_widget_ref(entry_emulation), (GDestroyNotify) gtk_widget_unref);
+ g_object_set_data_full(G_OBJECT(app->prefs_dialog), "entry_shell",
+ gtk_widget_ref(entry_shell), (GDestroyNotify) gtk_widget_unref);
g_object_set_data_full(G_OBJECT(app->prefs_dialog), "check_scroll_key",
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_ignore_menu_key",
+ gtk_widget_ref(check_ignore_menu_key), (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);
- g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "font_term"),
- "font-set", G_CALLBACK(on_prefs_font_choosed), GINT_TO_POINTER(4));
- g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "color_fore"),
- "color-set", G_CALLBACK(on_prefs_color_choosed), GINT_TO_POINTER(2));
- g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "color_back"),
- "color-set", G_CALLBACK(on_prefs_color_choosed), GINT_TO_POINTER(3));
+ g_signal_connect((gpointer) font_term, "font-set", G_CALLBACK(on_prefs_font_choosed),
+ GINT_TO_POINTER(4));
+ g_signal_connect((gpointer) color_fore, "color-set", G_CALLBACK(on_prefs_color_choosed),
+ GINT_TO_POINTER(2));
+ g_signal_connect((gpointer) color_back, "color-set", G_CALLBACK(on_prefs_color_choosed),
+ GINT_TO_POINTER(3));
+ g_signal_connect((gpointer) button_shell, "clicked",
+ G_CALLBACK(on_pref_tools_button_clicked), entry_shell);
}
#endif
g_signal_connect((gpointer) app->prefs_dialog, "response", G_CALLBACK(on_prefs_button_clicked), NULL);
Modified: trunk/src/vte.c
===================================================================
--- trunk/src/vte.c 2006-08-23 14:30:15 UTC (rev 758)
+++ trunk/src/vte.c 2006-08-23 16:37:05 UTC (rev 759)
@@ -43,6 +43,7 @@
static GModule *module = NULL;
static struct VteFunctions *vf;
static gboolean popup_menu_created = FALSE;
+static gchar *gtk_menu_key_accel = NULL;
#define VTE_TERMINAL(obj) (GTK_CHECK_CAST((obj), VTE_TYPE_TERMINAL, VteTerminal))
@@ -184,6 +185,7 @@
g_free(vc->colour_back);
g_free(vc->colour_fore);
g_free(vc);
+ g_free(gtk_menu_key_accel);
g_module_close(module);
}
@@ -199,10 +201,13 @@
event->keyval == GDK_D) &&
event->state & GDK_CONTROL_MASK)
{
+ vte_get_working_directory(); // try to keep the working directory when restarting the VTE
+
kill(pid, SIGINT);
pid = 0;
vf->vte_terminal_reset(VTE_TERMINAL(widget), TRUE, TRUE);
vte_start(widget);
+
return TRUE;
}
@@ -289,9 +294,16 @@
vf->vte_terminal_set_color_foreground(VTE_TERMINAL(vc->vte), vc->colour_fore);
vf->vte_terminal_set_color_background(VTE_TERMINAL(vc->vte), vc->colour_back);
+ if (gtk_menu_key_accel == NULL) // for restoring the default value
+ g_object_get(G_OBJECT(gtk_settings_get_default()), "gtk-menu-bar-accel",
+ >k_menu_key_accel, NULL);
+
if (vc->ignore_menu_bar_accel)
- gtk_settings_set_string_property(gtk_settings_get_default(), "gtk-menu-bar-accel",
- "<Shift><Control><Mod1><Mod2><Mod3><Mod4><Mod5>F10", "Geany");
+ gtk_settings_set_string_property(gtk_settings_get_default(), "gtk-menu-bar-accel",
+ "<Shift><Control><Mod1><Mod2><Mod3><Mod4><Mod5>F10", "Geany");
+ else
+ gtk_settings_set_string_property(gtk_settings_get_default(),
+ "gtk-menu-bar-accel", gtk_menu_key_accel, "Geany");
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list