Revision: 484 Author: ntrel Date: 2006-06-25 12:57:07 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/geany/?rev=484&view=rev
Log Message: ----------- Add clipboard functionality for find and go to line widgets
Modified Paths: -------------- trunk/ChangeLog trunk/src/callbacks.c trunk/src/utils.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-06-25 17:50:34 UTC (rev 483) +++ trunk/ChangeLog 2006-06-25 19:57:07 UTC (rev 484) @@ -17,6 +17,8 @@ Add notebook_new_tab and update document_create_new_sci to use it; also remove on_tab_close_clicked. * src/notebook.c: Fix close tab button bug introduced in last commit. + * src/callbacks.c, src/utils.c: + Add clipboard functionality for find and go to line widgets.
2006-06-24 Enrico Troeger enrico.troeger@uvena.de
Modified: trunk/src/callbacks.c =================================================================== --- trunk/src/callbacks.c 2006-06-25 17:50:34 UTC (rev 483) +++ trunk/src/callbacks.c 2006-06-25 19:57:07 UTC (rev 484) @@ -376,8 +376,12 @@ gpointer user_data) { gint idx = document_get_cur_idx(); + GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(app->window));
- if (idx >= 0) + if (GTK_IS_EDITABLE(focusw)) + gtk_editable_cut_clipboard(GTK_EDITABLE(focusw)); + else + if (IS_SCINTILLA(focusw) && idx >= 0) sci_cut(doc_list[idx].sci); }
@@ -387,8 +391,12 @@ gpointer user_data) { gint idx = document_get_cur_idx(); + GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(app->window));
- if (idx >= 0) + if (GTK_IS_EDITABLE(focusw)) + gtk_editable_copy_clipboard(GTK_EDITABLE(focusw)); + else + if (IS_SCINTILLA(focusw) && idx >= 0) sci_copy(doc_list[idx].sci); }
@@ -398,8 +406,12 @@ gpointer user_data) { gint idx = document_get_cur_idx(); + GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(app->window));
- if (idx >= 0) + if (GTK_IS_EDITABLE(focusw)) + gtk_editable_paste_clipboard(GTK_EDITABLE(focusw)); + else + if (IS_SCINTILLA(focusw) && idx >= 0) sci_paste(doc_list[idx].sci); }
@@ -409,8 +421,12 @@ gpointer user_data) { gint idx = document_get_cur_idx(); + GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(app->window));
- if (idx >= 0) + if (GTK_IS_EDITABLE(focusw)) + gtk_editable_delete_selection(GTK_EDITABLE(focusw)); + else + if (IS_SCINTILLA(focusw) && idx >= 0) sci_clear(doc_list[idx].sci); }
Modified: trunk/src/utils.c =================================================================== --- trunk/src/utils.c 2006-06-25 17:50:34 UTC (rev 483) +++ trunk/src/utils.c 2006-06-25 19:57:07 UTC (rev 484) @@ -172,11 +172,15 @@
void utils_update_menu_copy_items(gint idx) { - gboolean enable; + gboolean enable = FALSE; guint i; + GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(app->window));
- if (idx == -1) enable = FALSE; - else enable = sci_can_copy(doc_list[idx].sci); + if (IS_SCINTILLA(focusw)) + enable = (idx == -1) ? FALSE : sci_can_copy(doc_list[idx].sci); + else + if (GTK_IS_EDITABLE(focusw)) + enable = gtk_editable_get_selection_bounds(GTK_EDITABLE(focusw), NULL, NULL);
for(i = 0; i < (sizeof(app->menu_copy_items)/sizeof(GtkWidget*)); i++) gtk_widget_set_sensitive(app->menu_copy_items[i], enable);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.