Revision: 1232 http://svn.sourceforge.net/geany/?rev=1232&view=rev Author: eht16 Date: 2007-01-26 02:43:25 -0800 (Fri, 26 Jan 2007)
Log Message: ----------- Added an option to disable auto completion of known symbols while typing (still can be forced by pressing the keybinding).
Modified Paths: -------------- trunk/ChangeLog trunk/THANKS trunk/geany.glade trunk/src/geany.h trunk/src/interface.c trunk/src/keyfile.c trunk/src/prefs.c trunk/src/sci_cb.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-01-26 09:52:24 UTC (rev 1231) +++ trunk/ChangeLog 2007-01-26 10:43:25 UTC (rev 1232) @@ -2,6 +2,10 @@
* src/document.c: Applied patch from Jeff Pohlmeyer to clear the line marker when clearing the compile error markers. + * geany.glade, src/geany.h, src/interface.c, src/keyfile.c, + src/prefs.c, src/sci_cb.c: + Added an option to disable auto completion of known symbols while + typing (still can be forced by pressing the keybinding).
2007-01-25 Enrico Tröger enrico.troeger@uvena.de
Modified: trunk/THANKS =================================================================== --- trunk/THANKS 2007-01-26 09:52:24 UTC (rev 1231) +++ trunk/THANKS 2007-01-26 10:43:25 UTC (rev 1232) @@ -21,7 +21,7 @@ Bob Doan <bdoan(at)sicom(dot)com> - some patches Rob van der Linde <robvdl(at)paradise(dot)net(dot)nz> - fixed wrong vte height on some systems Josef Whiter <josef(at)toxicpanda(dot)com> - parse 'Entering directory' build messages. -Jeff Pohlmeyer <yetanothergeek(at)gmail(dot)com> - "Allow DnD" and "Use tabs" patches +Jeff Pohlmeyer <yetanothergeek(at)gmail(dot)com> - "Allow DnD", "Use tabs" and other great patches
Translators: ----------------------------------
Modified: trunk/geany.glade =================================================================== --- trunk/geany.glade 2007-01-26 09:52:24 UTC (rev 1231) +++ trunk/geany.glade 2007-01-26 10:43:25 UTC (rev 1232) @@ -5465,12 +5465,57 @@ </child>
<child> + <widget class="GtkCheckButton" id="check_symbol_auto_completion"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Automatic completion of known symbols in open source file(s) (function, global variables, ...)</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Symbol autocompletion</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">False</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> <widget class="GtkHBox" id="hbox6"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">20</property>
<child> + <widget class="GtkLabel" id="label182"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> <widget class="GtkLabel" id="label173"> <property name="visible">True</property> <property name="label" translatable="yes">Rows of autocompletion list:</property> @@ -5510,7 +5555,7 @@ </widget> <packing> <property name="padding">0</property> - <property name="expand">False</property> + <property name="expand">True</property> <property name="fill">True</property> </packing> </child> @@ -5518,7 +5563,7 @@ <packing> <property name="padding">0</property> <property name="expand">False</property> - <property name="fill">True</property> + <property name="fill">False</property> </packing> </child> </widget>
Modified: trunk/src/geany.h =================================================================== --- trunk/src/geany.h 2007-01-26 09:52:24 UTC (rev 1231) +++ trunk/src/geany.h 2007-01-26 10:43:25 UTC (rev 1232) @@ -110,6 +110,7 @@ gboolean pref_editor_show_white_space; gboolean pref_editor_show_indent_guide; gboolean pref_editor_show_line_endings; + gboolean pref_editor_auto_complete_symbols; gboolean pref_editor_auto_close_xml_tags; gboolean pref_editor_auto_complete_constructs; gboolean pref_editor_folding;
Modified: trunk/src/interface.c =================================================================== --- trunk/src/interface.c 2007-01-26 09:52:24 UTC (rev 1231) +++ trunk/src/interface.c 2007-01-26 10:43:25 UTC (rev 1232) @@ -2402,7 +2402,9 @@ GtkWidget *vbox19; GtkWidget *check_auto_complete; GtkWidget *check_xmltag; + GtkWidget *check_symbol_auto_completion; GtkWidget *hbox6; + GtkWidget *label182; GtkWidget *label173; GtkObject *spin_autocheight_adj; GtkWidget *spin_autocheight; @@ -3331,10 +3333,20 @@ gtk_tooltips_set_tip (tooltips, check_xmltag, _("Automatic completion of open XML tags (includes HTML tags)"), NULL); gtk_button_set_focus_on_click (GTK_BUTTON (check_xmltag), FALSE);
+ check_symbol_auto_completion = gtk_check_button_new_with_mnemonic (_("Symbol autocompletion")); + gtk_widget_show (check_symbol_auto_completion); + gtk_box_pack_start (GTK_BOX (vbox19), check_symbol_auto_completion, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, check_symbol_auto_completion, _("Automatic completion of known symbols in open source file(s) (function, global variables, ...)"), NULL); + gtk_button_set_focus_on_click (GTK_BUTTON (check_symbol_auto_completion), FALSE); + hbox6 = gtk_hbox_new (FALSE, 20); gtk_widget_show (hbox6); - gtk_box_pack_start (GTK_BOX (vbox19), hbox6, FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (vbox19), hbox6, FALSE, FALSE, 0);
+ label182 = gtk_label_new (""); + gtk_widget_show (label182); + gtk_box_pack_start (GTK_BOX (hbox6), label182, FALSE, FALSE, 0); + label173 = gtk_label_new (_("Rows of autocompletion list:")); gtk_widget_show (label173); gtk_box_pack_start (GTK_BOX (hbox6), label173, FALSE, FALSE, 0); @@ -3343,7 +3355,7 @@ spin_autocheight_adj = gtk_adjustment_new (10, 1, 99, 1, 10, 10); spin_autocheight = gtk_spin_button_new (GTK_ADJUSTMENT (spin_autocheight_adj), 1, 0); gtk_widget_show (spin_autocheight); - gtk_box_pack_start (GTK_BOX (hbox6), spin_autocheight, FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (hbox6), spin_autocheight, TRUE, TRUE, 0); gtk_tooltips_set_tip (tooltips, spin_autocheight, _("Number of rows to display in the autocompletion list."), NULL); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spin_autocheight), TRUE);
@@ -3838,7 +3850,9 @@ GLADE_HOOKUP_OBJECT (prefs_dialog, vbox19, "vbox19"); GLADE_HOOKUP_OBJECT (prefs_dialog, check_auto_complete, "check_auto_complete"); GLADE_HOOKUP_OBJECT (prefs_dialog, check_xmltag, "check_xmltag"); + GLADE_HOOKUP_OBJECT (prefs_dialog, check_symbol_auto_completion, "check_symbol_auto_completion"); GLADE_HOOKUP_OBJECT (prefs_dialog, hbox6, "hbox6"); + GLADE_HOOKUP_OBJECT (prefs_dialog, label182, "label182"); GLADE_HOOKUP_OBJECT (prefs_dialog, label173, "label173"); GLADE_HOOKUP_OBJECT (prefs_dialog, spin_autocheight, "spin_autocheight"); GLADE_HOOKUP_OBJECT (prefs_dialog, label177, "label177");
Modified: trunk/src/keyfile.c =================================================================== --- trunk/src/keyfile.c 2007-01-26 09:52:24 UTC (rev 1231) +++ trunk/src/keyfile.c 2007-01-26 10:43:25 UTC (rev 1232) @@ -118,6 +118,7 @@ g_key_file_set_boolean(config, PACKAGE, "switch_msgwin_pages", app->switch_msgwin_pages); g_key_file_set_boolean(config, PACKAGE, "auto_close_xml_tags", app->pref_editor_auto_close_xml_tags); g_key_file_set_boolean(config, PACKAGE, "auto_complete_constructs", app->pref_editor_auto_complete_constructs); + g_key_file_set_boolean(config, PACKAGE, "auto_complete_symbols", app->pref_editor_auto_complete_symbols); #ifdef HAVE_VTE g_key_file_set_boolean(config, "VTE", "load_vte", vte_info.load_vte); if (vte_info.load_vte && vc != NULL) @@ -319,6 +320,7 @@ app->pref_editor_show_line_endings = utils_get_setting_boolean(config, PACKAGE, "show_line_endings", FALSE); app->pref_editor_auto_close_xml_tags = utils_get_setting_boolean(config, PACKAGE, "auto_close_xml_tags", TRUE); app->pref_editor_auto_complete_constructs = utils_get_setting_boolean(config, PACKAGE, "auto_complete_constructs", TRUE); + app->pref_editor_auto_complete_symbols = utils_get_setting_boolean(config, PACKAGE, "auto_complete_symbols", TRUE); app->pref_editor_folding = utils_get_setting_boolean(config, PACKAGE, "use_folding", TRUE); app->pref_editor_unfold_all_children = utils_get_setting_boolean(config, PACKAGE, "unfold_all_children", FALSE); app->show_markers_margin = utils_get_setting_boolean(config, PACKAGE, "show_markers_margin", TRUE);
Modified: trunk/src/prefs.c =================================================================== --- trunk/src/prefs.c 2007-01-26 09:52:24 UTC (rev 1231) +++ trunk/src/prefs.c 2007-01-26 10:43:25 UTC (rev 1232) @@ -55,15 +55,16 @@ GtkWidget *dialog_label; static gboolean edited = FALSE;
-static gboolean on_prefs_tree_view_button_press_event( +static gboolean on_tree_view_button_press_event( GtkWidget *widget, GdkEventButton *event, gpointer user_data); static void on_cell_edited(GtkCellRendererText *cellrenderertext, gchar *path, gchar *new_text, gpointer user_data); static gboolean on_keytype_dialog_response(GtkWidget *dialog, GdkEventKey *event, gpointer user_data); static void on_dialog_response(GtkWidget *dialog, gint response, gpointer user_data); static gboolean find_duplicate(guint idx, guint key, GdkModifierType mods, const gchar *action); -static void on_pref_toolbar_show_toggled(GtkToggleButton *togglebutton, gpointer user_data); -static void on_pref_show_notebook_tabs_toggled(GtkToggleButton *togglebutton, gpointer user_data); -static void on_pref_use_folding_toggled(GtkToggleButton *togglebutton, gpointer user_data); +static void on_toolbar_show_toggled(GtkToggleButton *togglebutton, gpointer user_data); +static void on_show_notebook_tabs_toggled(GtkToggleButton *togglebutton, gpointer user_data); +static void on_use_folding_toggled(GtkToggleButton *togglebutton, gpointer user_data); +static void on_symbol_auto_completion_toggled(GtkToggleButton *togglebutton, gpointer user_data);
void prefs_init_dialog(void) @@ -99,7 +100,7 @@ widget = lookup_widget(app->prefs_dialog, "check_show_notebook_tabs"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->show_notebook_tabs); // disable following setting if notebook tabs are hidden - on_pref_show_notebook_tabs_toggled(GTK_TOGGLE_BUTTON( + on_show_notebook_tabs_toggled(GTK_TOGGLE_BUTTON( lookup_widget(app->prefs_dialog, "check_show_notebook_tabs")), NULL);
if (app->tab_order_ltr) @@ -198,7 +199,7 @@ } gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE); // disable elements if toolbar is hidden - on_pref_toolbar_show_toggled(GTK_TOGGLE_BUTTON( + on_toolbar_show_toggled(GTK_TOGGLE_BUTTON( lookup_widget(app->prefs_dialog, "check_toolbar_show")), NULL);
@@ -245,7 +246,7 @@
widget = lookup_widget(app->prefs_dialog, "check_unfold_children"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_editor_unfold_all_children); - on_pref_use_folding_toggled(GTK_TOGGLE_BUTTON( + on_use_folding_toggled(GTK_TOGGLE_BUTTON( lookup_widget(app->prefs_dialog, "check_folding")), NULL);
widget = lookup_widget(app->prefs_dialog, "check_disable_dnd"); @@ -257,6 +258,10 @@ widget = lookup_widget(app->prefs_dialog, "check_indicators"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_editor_use_indicators);
+ widget = lookup_widget(app->prefs_dialog, "check_symbol_auto_completion"); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_editor_auto_complete_symbols); + on_symbol_auto_completion_toggled(GTK_TOGGLE_BUTTON(widget), NULL); + widget = lookup_widget(app->prefs_dialog, "spin_autocheight"); gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget), app->autocompletion_max_height);
@@ -330,9 +335,9 @@
g_signal_connect(G_OBJECT(renderer), "edited", G_CALLBACK(on_cell_edited), NULL); g_signal_connect(G_OBJECT(tree), "button-press-event", - G_CALLBACK(on_prefs_tree_view_button_press_event), NULL); + G_CALLBACK(on_tree_view_button_press_event), NULL); g_signal_connect(G_OBJECT(lookup_widget(app->prefs_dialog, "button2")), "button-press-event", - G_CALLBACK(on_prefs_tree_view_button_press_event), NULL); + G_CALLBACK(on_tree_view_button_press_event), NULL); }
for (i = 0; i < GEANY_MAX_KEYS; i++) @@ -563,6 +568,9 @@ widget = lookup_widget(app->prefs_dialog, "check_use_tabs"); app->pref_editor_use_tabs = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
+ widget = lookup_widget(app->prefs_dialog, "check_symbol_auto_completion"); + app->pref_editor_auto_complete_symbols = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); + widget = lookup_widget(app->prefs_dialog, "spin_autocheight"); app->autocompletion_max_height = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
@@ -770,7 +778,7 @@ }
-static gboolean on_prefs_tree_view_button_press_event( +static gboolean on_tree_view_button_press_event( GtkWidget *widget, GdkEventButton *event, gpointer user_data) { GtkTreeIter iter; @@ -928,7 +936,7 @@ }
-static void on_pref_toolbar_show_toggled(GtkToggleButton *togglebutton, gpointer user_data) +static void on_toolbar_show_toggled(GtkToggleButton *togglebutton, gpointer user_data) { gboolean sens = gtk_toggle_button_get_active(togglebutton);
@@ -937,7 +945,7 @@ }
-static void on_pref_show_notebook_tabs_toggled(GtkToggleButton *togglebutton, gpointer user_data) +static void on_show_notebook_tabs_toggled(GtkToggleButton *togglebutton, gpointer user_data) { gboolean sens = gtk_toggle_button_get_active(togglebutton);
@@ -946,7 +954,7 @@ }
-static void on_pref_use_folding_toggled(GtkToggleButton *togglebutton, gpointer user_data) +static void on_use_folding_toggled(GtkToggleButton *togglebutton, gpointer user_data) { gboolean sens = gtk_toggle_button_get_active(togglebutton);
@@ -954,6 +962,14 @@ }
+static void on_symbol_auto_completion_toggled(GtkToggleButton *togglebutton, gpointer user_data) +{ + gboolean sens = gtk_toggle_button_get_active(togglebutton); + + gtk_widget_set_sensitive(lookup_widget(app->prefs_dialog, "hbox6"), sens); +} + + void dialogs_show_prefs_dialog(void) { if (app->prefs_dialog == NULL) @@ -1004,11 +1020,13 @@ "clicked", G_CALLBACK(on_prefs_tools_button_clicked), lookup_widget(app->prefs_dialog, "entry_grep"));
g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "check_toolbar_show"), - "toggled", G_CALLBACK(on_pref_toolbar_show_toggled), NULL); + "toggled", G_CALLBACK(on_toolbar_show_toggled), NULL); g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "check_show_notebook_tabs"), - "toggled", G_CALLBACK(on_pref_show_notebook_tabs_toggled), NULL); + "toggled", G_CALLBACK(on_show_notebook_tabs_toggled), NULL); g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "check_folding"), - "toggled", G_CALLBACK(on_pref_use_folding_toggled), NULL); + "toggled", G_CALLBACK(on_use_folding_toggled), NULL); + g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "check_symbol_auto_completion"), + "toggled", G_CALLBACK(on_symbol_auto_completion_toggled), NULL); }
prefs_init_dialog();
Modified: trunk/src/sci_cb.c =================================================================== --- trunk/src/sci_cb.c 2007-01-26 09:52:24 UTC (rev 1231) +++ trunk/src/sci_cb.c 2007-01-26 10:43:25 UTC (rev 1232) @@ -765,7 +765,10 @@ gchar *wordchars; filetype *ft;
- if (! DOC_IDX_VALID(idx) || doc_list[idx].file_type == NULL) return FALSE; + if ((! app->pref_editor_auto_complete_symbols && ! force) || + ! DOC_IDX_VALID(idx) || doc_list[idx].file_type == NULL) + return FALSE; + sci = doc_list[idx].sci; ft = doc_list[idx].file_type;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.