Revision: 1560 http://svn.sourceforge.net/geany/?rev=1560&view=rev Author: eht16 Date: 2007-05-23 06:40:57 -0700 (Wed, 23 May 2007)
Log Message: ----------- Added popup menu item: Change current working directory.
Modified Paths: -------------- trunk/ChangeLog trunk/src/vte.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-05-23 12:47:46 UTC (rev 1559) +++ trunk/ChangeLog 2007-05-23 13:40:57 UTC (rev 1560) @@ -1,3 +1,8 @@ +2007-05-23 Enrico Tröger enrico.troeger@uvena.de + + * src/vte.c: Added popup menu item: Change current working directory. + + 2007-05-23 Nick Treleaven nick.treleaven@btinternet.com
* src/filetypes.c, src/symbols.c, tagmanager/parsers.h,
Modified: trunk/src/vte.c =================================================================== --- trunk/src/vte.c 2007-05-23 12:47:46 UTC (rev 1559) +++ trunk/src/vte.c 2007-05-23 13:40:57 UTC (rev 1560) @@ -39,6 +39,7 @@ #include "prefs.h" #include "ui_utils.h" #include "utils.h" +#include "document.h"
VteInfo vte_info; @@ -66,6 +67,14 @@ static GtkWidget *vte_create_popup_menu(void);
+enum +{ + POPUP_COPY, + POPUP_PASTE, + POPUP_CHANGEPATH, + POPUP_PREFERENCES +}; + /* taken from anjuta, thanks */ static gchar **vte_get_child_environment(void) { @@ -334,19 +343,26 @@ { switch (GPOINTER_TO_INT(user_data)) { - case 0: + case POPUP_COPY: { if (vf->vte_terminal_get_has_selection(VTE_TERMINAL(vc->vte))) vf->vte_terminal_copy_clipboard(VTE_TERMINAL(vc->vte)); break; } - case 1: + case POPUP_PASTE: { vf->vte_terminal_paste_clipboard(VTE_TERMINAL(vc->vte)); break; } - case 2: + case POPUP_CHANGEPATH: { + gint idx = document_get_cur_idx(); + if (DOC_IDX_VALID(idx)) + vte_cwd(doc_list[idx].file_name, TRUE); + break; + } + case POPUP_PREFERENCES: + { GtkWidget *notebook;
prefs_show_dialog(); @@ -369,13 +385,18 @@ item = gtk_image_menu_item_new_from_stock("gtk-copy", NULL); gtk_widget_show(item); gtk_container_add(GTK_CONTAINER(menu), item); - g_signal_connect((gpointer)item, "activate", G_CALLBACK(vte_popup_menu_clicked), GINT_TO_POINTER(0)); + g_signal_connect((gpointer)item, "activate", G_CALLBACK(vte_popup_menu_clicked), GINT_TO_POINTER(POPUP_COPY));
item = gtk_image_menu_item_new_from_stock("gtk-paste", NULL); gtk_widget_show(item); gtk_container_add(GTK_CONTAINER(menu), item); - g_signal_connect((gpointer)item, "activate", G_CALLBACK(vte_popup_menu_clicked), GINT_TO_POINTER(1)); + g_signal_connect((gpointer)item, "activate", G_CALLBACK(vte_popup_menu_clicked), GINT_TO_POINTER(POPUP_PASTE));
+ item = gtk_image_menu_item_new_with_label("Change current working directory"); + gtk_widget_show(item); + gtk_container_add(GTK_CONTAINER(menu), item); + g_signal_connect((gpointer)item, "activate", G_CALLBACK(vte_popup_menu_clicked), GINT_TO_POINTER(POPUP_CHANGEPATH)); + item = gtk_separator_menu_item_new(); gtk_widget_show(item); gtk_container_add(GTK_CONTAINER(menu), item); @@ -383,7 +404,7 @@ item = gtk_image_menu_item_new_from_stock("gtk-preferences", NULL); gtk_widget_show(item); gtk_container_add(GTK_CONTAINER(menu), item); - g_signal_connect((gpointer)item, "activate", G_CALLBACK(vte_popup_menu_clicked), GINT_TO_POINTER(2)); + g_signal_connect((gpointer)item, "activate", G_CALLBACK(vte_popup_menu_clicked), GINT_TO_POINTER(POPUP_PREFERENCES));
item = gtk_separator_menu_item_new(); gtk_widget_show(item);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.