Revision: 425 Author: eht16 Date: 2006-06-08 08:12:55 -0700 (Thu, 08 Jun 2006) ViewCVS: http://svn.sourceforge.net/geany/?rev=425&view=rev
Log Message: ----------- Added labels for each defined shortcut to have a nicer representation in the dialogs. Hide make and terminal settings in the preferences dialog under Windows.
Modified Paths: -------------- trunk/ChangeLog trunk/src/dialogs.c trunk/src/keybindings.c trunk/src/keybindings.h trunk/src/prefs.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-06-08 14:59:23 UTC (rev 424) +++ trunk/ChangeLog 2006-06-08 15:12:55 UTC (rev 425) @@ -1,3 +1,21 @@ +2006-06-08 Enrico Troeger enrico.troeger@uvena.de + + * src/keybindings.c, src/prefs.c, src/dialogs.c: + Added labels for each defined shortcut to have a nicer + representation in the dialogs. + * geany.desktop.in: Removed duplicate entry for Encoding, now + desktop-file-validate processes with no errors. + * configure.in, doc/geany.1.in: + Renamed geany.1 to geany.1.in to let it be processed by configure. + Added GEANY_DATA_DIR to configure.in. + * doc/Makefile.am, doc/geany.xsl: + Removed unneeded code for generating geany.1. Added man_MANS to get + installed the manpage. Changed build command for HTML documentation. + Added new file doc/geany.xsl. + * geany.spec.in: Some improvements, corrected download URL. + * src/prefs.c: Hide make and terminal settings under Windows. + + 2006-06-07 Nick Treleaven nick.treleaven@btinternet.com
* src/callbacks.c: Fixed segfault when inserting comments and no @@ -12,9 +30,9 @@
2006-06-06 Enrico Troeger enrico.troeger@uvena.de
- * src/highlighting.c: enabled folding for markup filetypes - (HTML, XML, PHP, DocBook) - * src/treeviews.c: replaced "Members" by "Methods" to make it clearer + * src/highlighting.c: Enabled folding for markup filetypes + (HTML, XML, PHP, DocBook). + * src/treeviews.c: Replaced "Members" by "Methods" to make it clearer.
2006-06-05 Nick Treleaven nick.treleaven@btinternet.com
Modified: trunk/src/dialogs.c =================================================================== --- trunk/src/dialogs.c 2006-06-08 14:59:23 UTC (rev 424) +++ trunk/src/dialogs.c 2006-06-08 15:12:55 UTC (rev 425) @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * $Id$ */ @@ -502,7 +502,7 @@ if (ft->menu_items->can_compile) { // compile the code - item = gtk_image_menu_item_new_with_mnemonic(_("Compile")); + item = gtk_image_menu_item_new_with_mnemonic(_("_Compile")); gtk_widget_show(item); gtk_container_add(GTK_CONTAINER(menu), item); gtk_tooltips_set_tip(tooltips, item, _("Compiles the current file"), NULL); @@ -518,7 +518,7 @@
if (ft->menu_items->can_link) { // build the code - item = gtk_image_menu_item_new_with_mnemonic(_("Build")); + item = gtk_image_menu_item_new_with_mnemonic(_("_Build")); gtk_widget_show(item); gtk_container_add(GTK_CONTAINER(menu), item); gtk_tooltips_set_tip(tooltips, item, @@ -542,7 +542,7 @@ g_signal_connect((gpointer) item, "activate", G_CALLBACK(on_build_make_activate), GINT_TO_POINTER(0));
// build the code with make - item = gtk_image_menu_item_new_with_mnemonic(_("Build with make (custom target)")); + item = gtk_image_menu_item_new_with_mnemonic(_("Build with "_make" (custom _target)")); gtk_widget_show(item); if (keys[GEANY_KEYS_BUILD_MAKEOWNTARGET]->key) gtk_widget_add_accelerator(item, "activate", accel_group, keys[GEANY_KEYS_BUILD_MAKEOWNTARGET]->key, @@ -1863,7 +1863,7 @@ for (i = 0; i < GEANY_MAX_KEYS; i++) { shortcut = gtk_accelerator_get_label(keys[i]->key, keys[i]->mods); - g_string_append(text_names, keys[i]->name); + g_string_append(text_names, keys[i]->label); g_string_append(text_names, "\n"); g_string_append(text_keys, shortcut); g_string_append(text_keys, "\n");
Modified: trunk/src/keybindings.c =================================================================== --- trunk/src/keybindings.c 2006-06-08 14:59:23 UTC (rev 424) +++ trunk/src/keybindings.c 2006-06-08 15:12:55 UTC (rev 425) @@ -41,7 +41,7 @@
/* simple convenience function to allocate and fill the struct */ -static binding *fill(void (*func) (void), guint key, GdkModifierType mod, const gchar *name); +static binding *fill(void (*func) (void), guint key, GdkModifierType mod, const gchar *name, const gchar *label);
static void cb_func_menu_new(void); static void cb_func_menu_open(void); @@ -98,47 +98,47 @@ GKeyFile *config = g_key_file_new();
// init all fields of keys with default values - keys[GEANY_KEYS_MENU_NEW] = fill(cb_func_menu_new, GDK_n, GDK_CONTROL_MASK, "menu_new"); - keys[GEANY_KEYS_MENU_OPEN] = fill(cb_func_menu_open, GDK_o, GDK_CONTROL_MASK, "menu_open"); - keys[GEANY_KEYS_MENU_SAVE] = fill(cb_func_menu_save, GDK_s, GDK_CONTROL_MASK, "menu_save"); - keys[GEANY_KEYS_MENU_SAVEALL] = fill(cb_func_menu_saveall, GDK_S, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "menu_saveall"); - keys[GEANY_KEYS_MENU_CLOSEALL] = fill(cb_func_menu_closeall, GDK_d, GDK_MOD1_MASK, "menu_closeall"); - keys[GEANY_KEYS_MENU_RELOADFILE] = fill(cb_func_menu_reloadfile, GDK_r, GDK_CONTROL_MASK, "menu_reloadfile"); - keys[GEANY_KEYS_MENU_UNDO] = fill(cb_func_menu_undo, GDK_z, GDK_CONTROL_MASK, "menu_undo"); - keys[GEANY_KEYS_MENU_REDO] = fill(cb_func_menu_redo, GDK_y, GDK_CONTROL_MASK, "menu_redo"); - keys[GEANY_KEYS_MENU_PREFERENCES] = fill(cb_func_menu_preferences, GDK_p, GDK_CONTROL_MASK, "menu_preferences"); - keys[GEANY_KEYS_MENU_FIND_NEXT] = fill(cb_func_menu_findnext, GDK_F3, 0, "menu_findnext"); - keys[GEANY_KEYS_MENU_FINDPREVIOUS] = fill(cb_func_menu_findprevious, GDK_F3, GDK_SHIFT_MASK, "menu_findprevious"); - keys[GEANY_KEYS_MENU_REPLACE] = fill(cb_func_menu_replace, GDK_e, GDK_CONTROL_MASK, "menu_replace"); - keys[GEANY_KEYS_MENU_GOTOLINE] = fill(cb_func_menu_gotoline, GDK_l, GDK_CONTROL_MASK, "menu_gotoline"); - keys[GEANY_KEYS_MENU_OPENCOLORCHOOSER] = fill(cb_func_menu_opencolorchooser, 0, 0, "menu_opencolorchooser"); - keys[GEANY_KEYS_MENU_FULLSCREEN] = fill(cb_func_menu_fullscreen, GDK_F11, 0, "menu_fullscreen"); - keys[GEANY_KEYS_MENU_MESSAGEWINDOW] = fill(cb_func_menu_messagewindow, 0, 0, "menu_messagewindow"); - keys[GEANY_KEYS_MENU_ZOOMIN] = fill(cb_func_menu_zoomin, GDK_plus, GDK_CONTROL_MASK, "menu_zoomin"); - keys[GEANY_KEYS_MENU_ZOOMOUT] = fill(cb_func_menu_zoomout, GDK_minus, GDK_CONTROL_MASK, "menu_zoomout"); - keys[GEANY_KEYS_MENU_REPLACETABS] = fill(cb_func_menu_replacetabs, 0, 0, "menu_replacetabs"); - keys[GEANY_KEYS_MENU_FOLDALL] = fill(cb_func_menu_foldall, 0, 0, "menu_foldall"); - keys[GEANY_KEYS_MENU_UNFOLDALL] = fill(cb_func_menu_unfoldall, 0, 0, "menu_unfoldall"); - keys[GEANY_KEYS_BUILD_COMPILE] = fill(cb_func_build_compile, GDK_F8, 0, "build_compile"); - keys[GEANY_KEYS_BUILD_LINK] = fill(cb_func_build_link, GDK_F9, 0, "build_link"); - keys[GEANY_KEYS_BUILD_MAKE] = fill(cb_func_build_make, GDK_F9, GDK_SHIFT_MASK, "build_make"); - keys[GEANY_KEYS_BUILD_MAKEOWNTARGET] = fill(cb_func_build_makeowntarget, GDK_F9, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "build_makeowntarget"); - keys[GEANY_KEYS_BUILD_RUN] = fill(cb_func_build_run, GDK_F5, 0, "build_run"); - keys[GEANY_KEYS_BUILD_RUN2] = fill(cb_func_build_run2, 0, 0, "build_run2"); - keys[GEANY_KEYS_BUILD_OPTIONS] = fill(cb_func_build_options, 0, 0, "build_options"); - keys[GEANY_KEYS_RELOADTAGLIST] = fill(cb_func_reloadtaglist, GDK_r, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "reloadtaglist"); - keys[GEANY_KEYS_SWITCH_EDITOR] = fill(cb_func_switch_editor, GDK_F2, 0, "switch_editor"); - keys[GEANY_KEYS_SWITCH_SCRIBBLE] = fill(cb_func_switch_scribble, GDK_F6, 0, "switch_scribble"); - keys[GEANY_KEYS_SWITCH_VTE] = fill(cb_func_switch_vte, GDK_F4, 0, "switch_vte"); - keys[GEANY_KEYS_SWITCH_TABLEFT] = fill(cb_func_switch_tableft, 0, 0, "switch_tableft"); - keys[GEANY_KEYS_SWITCH_TABRIGHT] = fill(cb_func_switch_tabright, 0, 0, "switch_tabright"); - keys[GEANY_KEYS_TOOGLE_SIDEBAR] = fill(cb_func_toggle_sidebar, 0, 0, "toggle_sidebar"); - keys[GEANY_KEYS_EDIT_DUPLICATELINE] = fill(cb_func_edit_duplicateline, GDK_g, GDK_CONTROL_MASK, "edit_duplicateline"); - keys[GEANY_KEYS_EDIT_COMMENTLINE] = fill(cb_func_edit_commentline, GDK_d, GDK_CONTROL_MASK, "edit_commentline"); - keys[GEANY_KEYS_EDIT_AUTOCOMPLETE] = fill(cb_func_edit_autocomplete, GDK_space, GDK_CONTROL_MASK, "edit_autocomplete"); - keys[GEANY_KEYS_EDIT_CALLTIP] = fill(cb_func_edit_calltip, GDK_space, GDK_MOD1_MASK, "edit_calltip"); - keys[GEANY_KEYS_EDIT_MACROLIST] = fill(cb_func_edit_macrolist, GDK_Return, GDK_CONTROL_MASK, "edit_macrolist"); - keys[GEANY_KEYS_EDIT_SUPPRESSCOMPLETION] = fill(cb_func_edit_suppresscompletion, GDK_space, GDK_SHIFT_MASK, "edit_suppresscompletion"); + keys[GEANY_KEYS_MENU_NEW] = fill(cb_func_menu_new, GDK_n, GDK_CONTROL_MASK, "menu_new", _("New")); + keys[GEANY_KEYS_MENU_OPEN] = fill(cb_func_menu_open, GDK_o, GDK_CONTROL_MASK, "menu_open", _("Open")); + keys[GEANY_KEYS_MENU_SAVE] = fill(cb_func_menu_save, GDK_s, GDK_CONTROL_MASK, "menu_save", _("Save")); + keys[GEANY_KEYS_MENU_SAVEALL] = fill(cb_func_menu_saveall, GDK_S, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "menu_saveall", _("Save all")); + keys[GEANY_KEYS_MENU_CLOSEALL] = fill(cb_func_menu_closeall, GDK_d, GDK_MOD1_MASK, "menu_closeall", _("Close all")); + keys[GEANY_KEYS_MENU_RELOADFILE] = fill(cb_func_menu_reloadfile, GDK_r, GDK_CONTROL_MASK, "menu_reloadfile", _("Reload file")); + keys[GEANY_KEYS_MENU_UNDO] = fill(cb_func_menu_undo, GDK_z, GDK_CONTROL_MASK, "menu_undo", _("Undo")); + keys[GEANY_KEYS_MENU_REDO] = fill(cb_func_menu_redo, GDK_y, GDK_CONTROL_MASK, "menu_redo", _("Redo")); + keys[GEANY_KEYS_MENU_PREFERENCES] = fill(cb_func_menu_preferences, GDK_p, GDK_CONTROL_MASK, "menu_preferences", _("Preferences")); + keys[GEANY_KEYS_MENU_FIND_NEXT] = fill(cb_func_menu_findnext, GDK_F3, 0, "menu_findnext", _("Find Next")); + keys[GEANY_KEYS_MENU_FINDPREVIOUS] = fill(cb_func_menu_findprevious, GDK_F3, GDK_SHIFT_MASK, "menu_findprevious", _("Find Previous")); + keys[GEANY_KEYS_MENU_REPLACE] = fill(cb_func_menu_replace, GDK_e, GDK_CONTROL_MASK, "menu_replace", _("Replace")); + keys[GEANY_KEYS_MENU_GOTOLINE] = fill(cb_func_menu_gotoline, GDK_l, GDK_CONTROL_MASK, "menu_gotoline", _("Go to line")); + keys[GEANY_KEYS_MENU_OPENCOLORCHOOSER] = fill(cb_func_menu_opencolorchooser, 0, 0, "menu_opencolorchooser", _("Show Colour Chooser")); + keys[GEANY_KEYS_MENU_FULLSCREEN] = fill(cb_func_menu_fullscreen, GDK_F11, 0, "menu_fullscreen", _("Fullscreen")); + keys[GEANY_KEYS_MENU_MESSAGEWINDOW] = fill(cb_func_menu_messagewindow, 0, 0, "menu_messagewindow", _("Toggle Messages Window")); + keys[GEANY_KEYS_MENU_ZOOMIN] = fill(cb_func_menu_zoomin, GDK_plus, GDK_CONTROL_MASK, "menu_zoomin", _("Zoom In")); + keys[GEANY_KEYS_MENU_ZOOMOUT] = fill(cb_func_menu_zoomout, GDK_minus, GDK_CONTROL_MASK, "menu_zoomout", _("Zoom Out")); + keys[GEANY_KEYS_MENU_REPLACETABS] = fill(cb_func_menu_replacetabs, 0, 0, "menu_replacetabs", _("Replace tabs by space")); + keys[GEANY_KEYS_MENU_FOLDALL] = fill(cb_func_menu_foldall, 0, 0, "menu_foldall", _("Fold all")); + keys[GEANY_KEYS_MENU_UNFOLDALL] = fill(cb_func_menu_unfoldall, 0, 0, "menu_unfoldall", _("Unfold all")); + keys[GEANY_KEYS_BUILD_COMPILE] = fill(cb_func_build_compile, GDK_F8, 0, "build_compile", _("Compile")); + keys[GEANY_KEYS_BUILD_LINK] = fill(cb_func_build_link, GDK_F9, 0, "build_link", _("Build")); + keys[GEANY_KEYS_BUILD_MAKE] = fill(cb_func_build_make, GDK_F9, GDK_SHIFT_MASK, "build_make", _("Build with "make"")); + keys[GEANY_KEYS_BUILD_MAKEOWNTARGET] = fill(cb_func_build_makeowntarget, GDK_F9, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "build_makeowntarget", _("Build with "make" (custom target)")); + keys[GEANY_KEYS_BUILD_RUN] = fill(cb_func_build_run, GDK_F5, 0, "build_run", _("Run")); + keys[GEANY_KEYS_BUILD_RUN2] = fill(cb_func_build_run2, 0, 0, "build_run2", _("Run (alternative command)")); + keys[GEANY_KEYS_BUILD_OPTIONS] = fill(cb_func_build_options, 0, 0, "build_options", _("Build options")); + keys[GEANY_KEYS_RELOADTAGLIST] = fill(cb_func_reloadtaglist, GDK_r, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "reloadtaglist", _("Reload symbol list")); + keys[GEANY_KEYS_SWITCH_EDITOR] = fill(cb_func_switch_editor, GDK_F2, 0, "switch_editor", _("Switch to Editor")); + keys[GEANY_KEYS_SWITCH_SCRIBBLE] = fill(cb_func_switch_scribble, GDK_F6, 0, "switch_scribble", _("Switch to Scribble")); + keys[GEANY_KEYS_SWITCH_VTE] = fill(cb_func_switch_vte, GDK_F4, 0, "switch_vte", _("Switch to VTE")); + keys[GEANY_KEYS_SWITCH_TABLEFT] = fill(cb_func_switch_tableft, 0, 0, "switch_tableft", _("Switch to left document")); + keys[GEANY_KEYS_SWITCH_TABRIGHT] = fill(cb_func_switch_tabright, 0, 0, "switch_tabright", _("Switch to right document")); + keys[GEANY_KEYS_TOOGLE_SIDEBAR] = fill(cb_func_toggle_sidebar, 0, 0, "toggle_sidebar", _("Toggle sidebar")); + keys[GEANY_KEYS_EDIT_DUPLICATELINE] = fill(cb_func_edit_duplicateline, GDK_g, GDK_CONTROL_MASK, "edit_duplicateline", _("Duplicate line")); + keys[GEANY_KEYS_EDIT_COMMENTLINE] = fill(cb_func_edit_commentline, GDK_d, GDK_CONTROL_MASK, "edit_commentline", _("Comment line")); + keys[GEANY_KEYS_EDIT_AUTOCOMPLETE] = fill(cb_func_edit_autocomplete, GDK_space, GDK_CONTROL_MASK, "edit_autocomplete", _("Complete word")); + keys[GEANY_KEYS_EDIT_CALLTIP] = fill(cb_func_edit_calltip, GDK_space, GDK_MOD1_MASK, "edit_calltip", _("Show calltip")); + keys[GEANY_KEYS_EDIT_MACROLIST] = fill(cb_func_edit_macrolist, GDK_Return, GDK_CONTROL_MASK, "edit_macrolist", _("Show macro list")); + keys[GEANY_KEYS_EDIT_SUPPRESSCOMPLETION] = fill(cb_func_edit_suppresscompletion, GDK_space, GDK_SHIFT_MASK, "edit_suppresscompletion", _("Suppress auto completion"));
// now load user defined keys if (g_key_file_load_from_file(config, configfile, G_KEY_FILE_KEEP_COMMENTS, NULL)) @@ -273,12 +273,13 @@
/* simple convenience function to allocate and fill the struct */ -static binding *fill(void (*func) (void), guint key, GdkModifierType mod, const gchar *name) +static binding *fill(void (*func) (void), guint key, GdkModifierType mod, const gchar *name, const gchar *label) { binding *result;
result = g_new0(binding, 1); result->name = name; + result->label = label; result->key = key; result->mods = mod; result->cb_func = func;
Modified: trunk/src/keybindings.h =================================================================== --- trunk/src/keybindings.h 2006-06-08 14:59:23 UTC (rev 424) +++ trunk/src/keybindings.h 2006-06-08 15:12:55 UTC (rev 425) @@ -29,7 +29,10 @@ { guint key; GdkModifierType mods; + // at the moment only needed as keys for the configuration file because indices or tranlatable + // strings as keys are not very useful const gchar *name; + const gchar *label; // function pointer to a callback function, just to keep the code in keypress event // callback function clear void (*cb_func) (void);
Modified: trunk/src/prefs.c =================================================================== --- trunk/src/prefs.c 2006-06-08 14:59:23 UTC (rev 424) +++ trunk/src/prefs.c 2006-06-08 15:12:55 UTC (rev 425) @@ -15,13 +15,14 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * $Id$ */
#include <stdlib.h> +#include <string.h>
#include "geany.h"
@@ -152,12 +153,23 @@ g_free(color);
// Tools Settings - if (app->build_make_cmd) - gtk_entry_set_text(GTK_ENTRY(lookup_widget(app->prefs_dialog, "entry_com_make")), app->build_make_cmd); +#ifdef GEANY_WIN32 + // hide related Terminal path setting + gtk_widget_set_sensitive(lookup_widget(app->prefs_dialog, "label11"), FALSE); + gtk_widget_set_sensitive(lookup_widget(app->prefs_dialog, "entry_com_make"), FALSE); + gtk_widget_set_sensitive(lookup_widget(app->prefs_dialog, "button_make"), FALSE);
- if (app->build_term_cmd) - gtk_entry_set_text(GTK_ENTRY(lookup_widget(app->prefs_dialog, "entry_com_term")), app->build_term_cmd); + // hide related Terminal path setting + gtk_widget_set_sensitive(lookup_widget(app->prefs_dialog, "label97"), FALSE); + gtk_widget_set_sensitive(lookup_widget(app->prefs_dialog, "entry_com_term"), FALSE); + gtk_widget_set_sensitive(lookup_widget(app->prefs_dialog, "button_term"), FALSE); +#else + if (app->build_make_cmd) + gtk_entry_set_text(GTK_ENTRY(lookup_widget(app->prefs_dialog, "entry_com_make")), app->build_make_cmd);
+ if (app->build_term_cmd) + gtk_entry_set_text(GTK_ENTRY(lookup_widget(app->prefs_dialog, "entry_com_term")), app->build_term_cmd); +#endif if (app->build_browser_cmd) gtk_entry_set_text(GTK_ENTRY(lookup_widget(app->prefs_dialog, "entry_browser")), app->build_browser_cmd);
@@ -204,7 +216,7 @@ // doesn't keep the settings gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(lookup_widget(app->prefs_dialog, "scrolledwindow8")), - GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
g_signal_connect(G_OBJECT(renderer), "edited", G_CALLBACK(on_cell_edited), NULL); g_signal_connect(G_OBJECT(tree), "button-press-event", @@ -217,7 +229,7 @@ { key_string = gtk_accelerator_name(keys[i]->key, keys[i]->mods); gtk_list_store_append(store, &iter); - gtk_list_store_set(store, &iter, 0, keys[i]->name, 1, key_string, -1); + gtk_list_store_set(store, &iter, 0, keys[i]->label, 1, key_string, -1); g_free(key_string); }
@@ -649,7 +661,7 @@
for (idx = 0; idx < GEANY_MAX_KEYS; idx++) { - if (utils_strcmp(dialog_key_name, keys[idx]->name)) break; + if (utils_strcmp(dialog_key_name, keys[idx]->label)) break; }
gtk_accelerator_parse(gtk_label_get_text(GTK_LABEL(dialog_label)), &lkey, &lmods); @@ -690,7 +702,7 @@ { dialogs_show_error( _("The combination '%s' is already used for "%s". Please choose another one."), - action, keys[i]->name); + action, keys[i]->label); return TRUE; } }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.