diff --git a/geany.glade b/geany.glade
index 0fc314cc..23b66c8c 100644
--- a/geany.glade
+++ b/geany.glade
@@ -57,7 +57,7 @@
True
-
+
True
gtk-new
1
@@ -128,10 +128,9 @@
Save all
True
-
-
+
True
gtk-save
1
@@ -190,10 +189,9 @@
Close all
True
-
-
+
True
gtk-close
1
@@ -335,7 +333,7 @@
True
-
+
True
gtk-add
1
@@ -367,7 +365,7 @@
True
-
+
True
gtk-add
1
@@ -503,10 +501,9 @@
Find _next
True
-
-
+
True
gtk-find
1
@@ -527,7 +524,7 @@
-
+
True
gtk-find-and-replace
1
@@ -577,7 +574,7 @@
-
+
True
gtk-select-font
1
@@ -599,7 +596,7 @@
-
+
True
gtk-select-color
1
@@ -625,7 +622,6 @@
True
False
-
@@ -3716,36 +3712,16 @@
True
- 8
+ 3
3
False
7
5
-
- Path and options for the C compiler
- True
- True
- True
- 0
-
- True
- *
- False
-
-
- 1
- 2
- 0
- 1
-
-
-
-
-
-
- C Compiler
+
+ True
+ Make
False
False
GTK_JUSTIFY_LEFT
@@ -3770,102 +3746,6 @@
-
-
- C++ Compiler
- False
- False
- GTK_JUSTIFY_LEFT
- False
- False
- 0
- 0.5
- 0
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 0
- 1
- 1
- 2
- fill
-
-
-
-
-
-
- Java Compiler
- False
- False
- GTK_JUSTIFY_LEFT
- False
- False
- 0
- 0.5
- 0
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 0
- 1
- 2
- 3
- fill
-
-
-
-
-
-
- Path and options for the Java compiler
- True
- True
- True
- 0
-
- True
- *
- False
-
-
- 1
- 2
- 2
- 3
-
-
-
-
-
-
- Path and options for the C++ compiler
- True
- True
- True
- 0
-
- True
- *
- False
-
-
- 1
- 2
- 1
- 2
-
-
-
-
True
@@ -3887,181 +3767,13 @@
0
1
- 6
- 7
+ 1
+ 2
fill
-
-
- True
- A terminal emulator like xterm, gnome-terminal or konsole (should accept the -e argument)
- True
- True
- True
- 0
-
- True
- *
- False
-
-
- 1
- 2
- 6
- 7
-
-
-
-
-
-
- True
- Make
- False
- False
- GTK_JUSTIFY_LEFT
- False
- False
- 0
- 0.5
- 0
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 0
- 1
- 5
- 6
- fill
-
-
-
-
-
-
- Pascal Compiler
- False
- False
- GTK_JUSTIFY_LEFT
- False
- False
- 0
- 0.5
- 0
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 0
- 1
- 4
- 5
- fill
-
-
-
-
-
-
- True
- Path and options for the make tool
- True
- True
- True
- 0
-
- True
- *
- False
-
-
- 1
- 2
- 5
- 6
-
-
-
-
-
-
- Path and options for the Pascal compiler
- True
- True
- True
- 0
-
- True
- *
- False
-
-
- 1
- 2
- 4
- 5
-
-
-
-
-
-
- Java executable
- False
- False
- GTK_JUSTIFY_LEFT
- False
- False
- 0
- 0.5
- 0
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 0
- 1
- 3
- 4
- fill
-
-
-
-
-
-
- Path and options for the java executable, to run java bytecode files(compiled java source files)
- True
- True
- True
- 0
-
- True
- *
- False
-
-
- 1
- 2
- 3
- 4
-
-
-
-
True
@@ -4083,13 +3795,57 @@
0
1
- 7
- 8
+ 2
+ 3
fill
+
+
+ True
+ Path and options for the make tool
+ True
+ True
+ True
+ 0
+
+ True
+ *
+ False
+
+
+ 1
+ 2
+ 0
+ 1
+
+
+
+
+
+
+ True
+ A terminal emulator like xterm, gnome-terminal or konsole (should accept the -e argument)
+ True
+ True
+ True
+ 0
+
+ True
+ *
+ False
+
+
+ 1
+ 2
+ 1
+ 2
+
+
+
+
True
@@ -4106,120 +3862,8 @@
1
2
- 7
- 8
-
-
-
-
-
-
- True
- GTK_RELIEF_NORMAL
- True
-
-
-
- True
- gtk-open
- 4
- 0.5
- 0.5
- 0
- 0
-
-
-
-
- 2
- 3
- 0
- 1
- fill
-
-
-
-
-
-
- True
- GTK_RELIEF_NORMAL
- True
-
-
-
- True
- gtk-open
- 4
- 0.5
- 0.5
- 0
- 0
-
-
-
-
- 2
- 3
- 1
- 2
- fill
-
-
-
-
-
-
- True
- GTK_RELIEF_NORMAL
- True
-
-
-
- True
- gtk-open
- 4
- 0.5
- 0.5
- 0
- 0
-
-
-
-
- 2
- 3
- 3
- 4
- fill
-
-
-
-
-
-
- True
- GTK_RELIEF_NORMAL
- True
-
-
-
- True
- gtk-open
- 4
- 0.5
- 0.5
- 0
- 0
-
-
-
-
- 2
- 3
- 4
- 5
- fill
+ 2
+ 3
@@ -4246,8 +3890,8 @@
2
3
- 5
- 6
+ 0
+ 1
fill
@@ -4275,8 +3919,8 @@
2
3
- 6
- 7
+ 1
+ 2
fill
@@ -4301,34 +3945,6 @@
-
- 2
- 3
- 7
- 8
- fill
-
-
-
-
-
-
- True
- GTK_RELIEF_NORMAL
- True
-
-
-
- True
- gtk-open
- 4
- 0.5
- 0.5
- 0
- 0
-
-
-
2
3
@@ -4727,6 +4343,126 @@ you need to restart Geany to take effect.
tab
+
+
+
+ True
+ False
+ 5
+
+
+
+ True
+ Here you can change keyboard shortcuts for various actions. Just double click on a action or select one and press the Change button to enter a new shortcut. You can also edit the string representation of the shortcut directly.
+ False
+ False
+ GTK_JUSTIFY_FILL
+ True
+ False
+ 0.10000000149
+ 0
+ 0
+ 5
+ PANGO_ELLIPSIZE_NONE
+ -1
+ False
+ 0
+
+
+ 0
+ False
+ True
+
+
+
+
+
+ True
+ True
+ GTK_POLICY_ALWAYS
+ GTK_POLICY_ALWAYS
+ GTK_SHADOW_IN
+ GTK_CORNER_TOP_LEFT
+
+
+
+ True
+ True
+ True
+ False
+ False
+ False
+ False
+ False
+ False
+
+
+
+
+ 0
+ True
+ True
+
+
+
+
+
+ True
+ 0.5
+ 0.5
+ 0.300000011921
+ 1
+ 0
+ 5
+ 0
+ 0
+
+
+
+ True
+ True
+ Change
+ True
+ GTK_RELIEF_NORMAL
+ True
+
+
+
+
+ 0
+ False
+ False
+
+
+
+
+ False
+ True
+
+
+
+
+
+ True
+ Keybindings
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+ PANGO_ELLIPSIZE_NONE
+ -1
+ False
+ 0
+
+
+ tab
+
+
0
diff --git a/po/POTFILES.in b/po/POTFILES.in
index eea726c6..49011f87 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -23,3 +23,4 @@ src/templates.c
src/encodings.c
src/treeviews.c
src/vte.c
+src/keybindings.c
diff --git a/src/Makefile.am b/src/Makefile.am
index d8157840..24f7366c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -14,6 +14,7 @@ bin_PROGRAMS = geany
geany_SOURCES = \
main.c geany.h \
+ keybindings.c keybindings.h \
templates.c templates.h \
treeviews.c treeviews.h \
about.c about.h \
@@ -35,6 +36,6 @@ geany_SOURCES = \
callbacks.c callbacks.h
#AM_CFLAGS = -Wall -pipe
-AM_CFLAGS = -DGEANY_DEBUG -Wall -pipe
-#AM_CFLAGS = -DGEANY_DEBUG -g -Wall -pipe
+#AM_CFLAGS = -DGEANY_DEBUG -Wall -pipe
+AM_CFLAGS = -DGEANY_DEBUG -g -Wall -pipe
geany_LDADD = @PACKAGE_LIBS@ -lstdc++ ../scintilla/libscintilla.a ../tagmanager/libtagmanager.a $(INTLLIBS)
diff --git a/src/callbacks.c b/src/callbacks.c
index b5043d30..b8698a33 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -105,6 +105,7 @@ gint destroyapp(GtkWidget *widget, gpointer gdata)
}
#endif
+ keybindings_free();
filetypes_free_types();
styleset_free_styles();
templates_free_templates();
@@ -930,276 +931,7 @@ on_window_key_press_event (GtkWidget *widget,
GdkEventKey *event,
gpointer user_data)
{
- if (event->keyval == GDK_F12)
- {
- gtk_notebook_set_current_page(GTK_NOTEBOOK(msgwindow.notebook), MSG_SCRATCH);
- gtk_widget_grab_focus(lookup_widget(app->window, "textview_scribble"));
- return TRUE;
- }
-#ifdef HAVE_VTE
- if (event->keyval == GDK_F6 && app->have_vte)
- {
- gtk_notebook_set_current_page(GTK_NOTEBOOK(msgwindow.notebook), MSG_VTE);
- gtk_widget_grab_focus(vc->vte);
- return TRUE;
- }
-#endif
- return FALSE;
-}
-
-
-gboolean
-on_editor_key_press_event (GtkWidget *widget,
- GdkEventKey *event,
- gpointer user_data)
-{
- gboolean ret = TRUE;
- gint idx = GPOINTER_TO_INT(user_data);
- gint pos = sci_get_current_position(doc_list[idx].sci);
-
-
- switch(event->keyval)
- {
- // show userlist with macros and variables on strg+space
- case 'g':
- {
- if (event->state & GDK_CONTROL_MASK)
- {
- sci_line_duplicate(doc_list[idx].sci);
- }
- else
- ret = FALSE;
- break;
- }
- // show userlist with macros and variables on strg+space
- case ' ':
- {
- if (event->state & GDK_CONTROL_MASK)
- {
- sci_cb_start_auto_complete(
- doc_list[GPOINTER_TO_INT(user_data)].sci,
- sci_get_current_position(doc_list[idx].sci));
- }
- else if (event->state & GDK_MOD1_MASK)
- { // ALT+Space
- sci_cb_show_calltip(doc_list[idx].sci, -1);
- }
- else if (event->state & GDK_SHIFT_MASK)
- { // Shift+Space, catch this explicitly to suppress sci_cb_auto_forif() ;-)
- sci_add_text(doc_list[idx].sci, " ");
- }
- else
- ret = FALSE;
- break;
- }
- // refreshs the tag lists
- case 'R':
- {
- if (event->state & GDK_CONTROL_MASK)
- document_update_tag_list(idx, TRUE);
- else
- ret = FALSE;
- break;
- }
- // reloads the document
- case 'r':
- {
- if (event->state & GDK_CONTROL_MASK)
- {
- gchar *basename = g_path_get_basename(doc_list[idx].file_name);
-
- if (dialogs_show_question(_
- ("Are you sure you want to reload '%s'?\nAny unsaved changes will be lost."),
- basename))
- {
- document_open_file(idx, NULL, 0, doc_list[idx].readonly, doc_list[idx].file_type);
- }
-
- g_free(basename);
- }
- else
- ret = FALSE;
- break;
- }
- // comment the current line or selected lines
- case 'd':
- {
- if (event->state & GDK_CONTROL_MASK)
- sci_cb_do_comment(idx);
- else
- ret = FALSE;
- break;
- }
- // uri handling testing
- case '^':
- {
- if (event->state & GDK_CONTROL_MASK)
- sci_cb_handle_uri(doc_list[idx].sci, pos);
- else
- ret = FALSE;
- break;
- }
- // zoom in the text
- case '+':
- {
- if (event->state & GDK_CONTROL_MASK)
- sci_zoom_in(doc_list[idx].sci);
- else
- ret = FALSE;
- break;
- }
- // zoom out the text
- case '-':
- {
- if (event->state & GDK_CONTROL_MASK)
- sci_zoom_out(doc_list[idx].sci);
- else
- ret = FALSE;
-
- break;
- }
- // open the preferences dialog
- case 'p':
- {
- if (event->state & GDK_CONTROL_MASK)
- on_preferences1_activate(NULL, NULL);
- else
- ret = FALSE;
- break;
- }
- // switch to the next open notebook tab to the right
- case GDK_Right:
- {
- if (event->state & GDK_MOD1_MASK)
- utils_switch_document(RIGHT);
- else
- ret = FALSE;
- break;
- }
- // switch to the next open notebook tab to the right
- case GDK_Left:
- {
- if (event->state & GDK_MOD1_MASK)
- {
- utils_switch_document(LEFT);
- }
- else
- ret = FALSE;
- break;
- }
- // show macro list
- case GDK_Return:
- {
- if (event->state & GDK_CONTROL_MASK)
- {
- sci_cb_show_macro_list(doc_list[idx].sci);
- }
- else
- ret = FALSE;
- break;
- }
- case GDK_Insert:
- {
- if (! (event->state & GDK_SHIFT_MASK))
- doc_list[idx].do_overwrite = (doc_list[idx].do_overwrite) ? FALSE : TRUE;
- else
- ret = FALSE;
- break;
- }
- case GDK_F12:
- {
- gtk_notebook_set_current_page(GTK_NOTEBOOK(msgwindow.notebook), MSG_SCRATCH);
- gtk_widget_grab_focus(lookup_widget(app->window, "textview_scribble"));
- break;
- }
-#ifdef HAVE_VTE
- case GDK_F6:
- {
- if (app->have_vte)
- {
- gtk_notebook_set_current_page(GTK_NOTEBOOK(msgwindow.notebook), MSG_VTE);
- gtk_widget_grab_focus(vc->vte);
- break;
- }
- break;
- }
-#endif
- // build menu shortcuts temporarily defined here, until new keyboard shortcuts management is
- // implemented, hope this fixes at least for the moment the shortcut problem
- case GDK_F8:
- {
- if (doc_list[idx].file_type->menu_items->can_compile &&
- doc_list[idx].file_name != NULL)
- {
- on_build_compile_activate(NULL, NULL);
- }
- break;
- }
- case GDK_F9:
- {
- if (event->state & GDK_SHIFT_MASK)
- {
- if (doc_list[idx].file_name != NULL) on_build_make_activate(NULL, NULL);
- }
- else if (doc_list[idx].file_type->menu_items->can_link &&
- doc_list[idx].file_name != NULL)
- {
- on_build_build_activate(NULL, NULL);
- }
- break;
- }
- case GDK_F5:
- {
- if (doc_list[idx].file_type->menu_items->can_exec &&
- doc_list[idx].file_name != NULL)
- {
- on_build_execute_activate(NULL, NULL);
- }
- break;
- }
- default: ret = FALSE;
-
-/* following code is unusable unless I get a signal for a line changed, don't want to do this with
- * updateUI(), additional problem: at line changes the column isn't kept
- case GDK_End:
- { // extending HOME and END default behaviour, for details look at the start of this function
- if (cursor_pos_end == -1 || current_line != sci_get_current_line(doc_list[idx].sci, pos))
- {
- cursor_pos_end = pos;
- sci_cmd(doc_list[idx].sci, SCI_LINEEND);
- current_line = sci_get_current_line(doc_list[idx].sci, pos);
- }
- else if (current_line == sci_get_current_line(doc_list[idx].sci, pos))
- {
- sci_set_current_position(doc_list[idx].sci, cursor_pos_end);
- cursor_pos_end = -1;
- }
- break;
- }
- case GDK_Home:
- {
- if (cursor_pos_home_state == 0 || current_line != sci_get_current_line(doc_list[idx].sci, pos))
- {
- cursor_pos_home = sci_get_current_position(doc_list[idx].sci);
- sci_cmd(doc_list[idx].sci, SCI_VCHOME);
- cursor_pos_home_state = 1;
- current_line = sci_get_current_line(doc_list[idx].sci, pos);
- }
- else if (cursor_pos_home_state == 1 && current_line == sci_get_current_line(doc_list[idx].sci, pos))
- {
- sci_cmd(doc_list[idx].sci, SCI_HOME);
- cursor_pos_home_state = 2;
- cursor_pos_home_state = 0;
- }
- else// if (current_line == sci_get_current_line(doc_list[idx].sci, pos))
- {
- sci_set_current_position(doc_list[idx].sci, cursor_pos_home);
- cursor_pos_home_state = 0;
- }
- break;
- }
-*/ }
- return ret;
+ return keybindings_got_event(widget, event, user_data);
}
@@ -1866,9 +1598,9 @@ on_build_execute_activate (GtkMenuItem *menuitem,
{
gint idx = document_get_cur_idx();
- if (doc_list[idx].file_type->id == GEANY_FILETYPES_LATEX)
+ if (doc_list[idx].file_type->id == GEANY_FILETYPES_LATEX && user_data != NULL)
{
- if (build_view_tex_file(idx, 0) == (GPid) 0)
+ if (build_view_tex_file(idx, GPOINTER_TO_INT(user_data)) == (GPid) 0)
{
msgwin_status_add(_("Failed to execute the view program"));
}
diff --git a/src/callbacks.h b/src/callbacks.h
index d41e4e90..13928158 100644
--- a/src/callbacks.h
+++ b/src/callbacks.h
@@ -115,7 +115,7 @@ on_color_cancel_button_clicked (GtkButton *button,
gpointer user_data);
void
-on_font_cancel_button_clicked (GtkButton *button,
+on_font_cancel_button_clicked (GtkButton *button,
gpointer user_data);
void
@@ -135,15 +135,9 @@ on_font_apply_button_clicked (GtkButton *button,
gpointer user_data);
gboolean
-on_close_all1_activate (GtkMenuItem *menuitem,
+on_close_all1_activate (GtkMenuItem *menuitem,
gpointer user_data);
-gboolean
-on_editor_key_press_event (GtkWidget *widget,
- GdkEventKey *event,
- gpointer user_data);
-
-
gboolean
on_editor_button_press_event (GtkWidget *widget,
GdkEventButton *event,
@@ -179,7 +173,7 @@ on_entry1_activate (GtkEntry *entry,
gpointer user_data);
gboolean
-toolbar_popup_menu (GtkWidget *widget,
+toolbar_popup_menu (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
diff --git a/src/dialogs.c b/src/dialogs.c
index 3864a433..d564f5b0 100644
--- a/src/dialogs.c
+++ b/src/dialogs.c
@@ -224,6 +224,7 @@ void dialogs_show_file_open_error(void)
}
+/// TODO is there a difference to dialogs_show_question? if not, remove this one
gboolean dialogs_show_not_found(const gchar *text)
{
GtkWidget *dialog;
@@ -274,6 +275,7 @@ void dialogs_show_info(const gchar *text, ...)
}
+/// TODO is there a difference to dialogs_show_question? if not, remove this one
gboolean dialogs_show_fifo_error(const gchar *text, ...)
{
GtkWidget *dialog;
@@ -452,7 +454,7 @@ void dialogs_show_about(void)
info = about_info_new(PACKAGE, VERSION, _("A fast and lightweight IDE"),
ABOUT_COPYRIGHT_TEXT("2006", "Enrico Troeger"), GEANY_HOMEPAGE, GEANY_CODENAME);
about_info_add_credit(info, "Enrico Troeger", "enrico.troeger@uvena.de", _("Maintainer"));
- about_info_add_credit(info, "Nick Treleaven", "nick.treleaven@btinternet.com", _("Contributor"));
+ about_info_add_credit(info, "Nick Treleaven", "nick.treleaven@btinternet.com", _("Developer"));
for (n = 0; translators[n].name != NULL; ++n)
{
@@ -557,9 +559,10 @@ GtkWidget *dialogs_create_build_menu_gen(gint idx)
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(menu), item);
gtk_tooltips_set_tip(tooltips, item, _("Compiles the current file"), NULL);
-/* gtk_widget_add_accelerator(item, "activate", accel_group, GDK_F8,
- (GdkModifierType) 0, GTK_ACCEL_VISIBLE);
-*/ image = gtk_image_new_from_stock("gtk-convert", GTK_ICON_SIZE_MENU);
+ if (keys[GEANY_KEYS_BUILD_COMPILE]->key)
+ gtk_widget_add_accelerator(item, "activate", accel_group, keys[GEANY_KEYS_BUILD_COMPILE]->key,
+ keys[GEANY_KEYS_BUILD_COMPILE]->mods, GTK_ACCEL_VISIBLE);
+ image = gtk_image_new_from_stock("gtk-convert", GTK_ICON_SIZE_MENU);
gtk_widget_show(image);
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
g_signal_connect((gpointer) item, "activate", G_CALLBACK(on_build_compile_activate), NULL);
@@ -573,8 +576,9 @@ GtkWidget *dialogs_create_build_menu_gen(gint idx)
gtk_container_add(GTK_CONTAINER(menu), item);
gtk_tooltips_set_tip(tooltips, item,
_("Builds the current file (generate an executable file)"), NULL);
- gtk_widget_add_accelerator(item, "activate", accel_group, GDK_F9,
- (GdkModifierType) 0, GTK_ACCEL_VISIBLE);
+ if (keys[GEANY_KEYS_BUILD_LINK]->key)
+ gtk_widget_add_accelerator(item, "activate", accel_group, keys[GEANY_KEYS_BUILD_LINK]->key,
+ keys[GEANY_KEYS_BUILD_LINK]->mods, GTK_ACCEL_VISIBLE);
g_signal_connect((gpointer) item, "activate", G_CALLBACK(on_build_build_activate), NULL);
ft->menu_items->item_link = item;
}
@@ -585,13 +589,17 @@ GtkWidget *dialogs_create_build_menu_gen(gint idx)
gtk_container_add(GTK_CONTAINER(menu), item);
gtk_tooltips_set_tip(tooltips, item, _("Builds the current file with the "
"make tool and the default target"), NULL);
- gtk_widget_add_accelerator(item, "activate", accel_group, GDK_F9,
- (GdkModifierType) GDK_SHIFT_MASK, GTK_ACCEL_VISIBLE);
+ if (keys[GEANY_KEYS_BUILD_MAKE]->key)
+ gtk_widget_add_accelerator(item, "activate", accel_group, keys[GEANY_KEYS_BUILD_MAKE]->key,
+ keys[GEANY_KEYS_BUILD_MAKE]->mods, GTK_ACCEL_VISIBLE);
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)"));
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,
+ keys[GEANY_KEYS_BUILD_MAKEOWNTARGET]->mods, GTK_ACCEL_VISIBLE);
gtk_container_add(GTK_CONTAINER(menu), item);
gtk_tooltips_set_tip(tooltips, item, _("Builds the current file with the "
"make tool and the specified target"), NULL);
@@ -603,8 +611,9 @@ GtkWidget *dialogs_create_build_menu_gen(gint idx)
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(menu), item);
gtk_tooltips_set_tip(tooltips, item, _("Run or view the current file"), NULL);
- gtk_widget_add_accelerator(item, "activate", accel_group, GDK_F5,
- (GdkModifierType) 0, GTK_ACCEL_VISIBLE);
+ if (keys[GEANY_KEYS_BUILD_RUN]->key)
+ gtk_widget_add_accelerator(item, "activate", accel_group, keys[GEANY_KEYS_BUILD_RUN]->key,
+ keys[GEANY_KEYS_BUILD_RUN]->mods, GTK_ACCEL_VISIBLE);
g_signal_connect((gpointer) item, "activate", G_CALLBACK(on_build_execute_activate), NULL);
ft->menu_items->item_exec = item;
}
@@ -620,6 +629,9 @@ GtkWidget *dialogs_create_build_menu_gen(gint idx)
item = gtk_image_menu_item_new_with_mnemonic(_("Set Includes and Arguments"));
gtk_widget_show(item);
+ if (keys[GEANY_KEYS_BUILD_OPTIONS]->key)
+ gtk_widget_add_accelerator(item, "activate", accel_group, keys[GEANY_KEYS_BUILD_OPTIONS]->key,
+ keys[GEANY_KEYS_BUILD_OPTIONS]->mods, GTK_ACCEL_VISIBLE);
gtk_container_add(GTK_CONTAINER (menu), item);
gtk_tooltips_set_tip(tooltips, item,
_("Sets the includes and library paths for the compiler and "
@@ -630,9 +642,6 @@ GtkWidget *dialogs_create_build_menu_gen(gint idx)
g_signal_connect((gpointer) item, "activate", G_CALLBACK(on_build_arguments_activate), NULL);
}
- // temporarily moved to on_editor_key_press_event() until new keyboard shortcut management is available
- //gtk_window_add_accel_group(GTK_WINDOW(app->window), accel_group);
-
return menu;
}
@@ -650,7 +659,9 @@ GtkWidget *dialogs_create_build_menu_tex(gint idx)
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(menu), item);
gtk_tooltips_set_tip(tooltips, item, _("Compiles the current file into a DVI file"), NULL);
-// gtk_widget_add_accelerator(item, "activate", accel_group, GDK_F8, (GdkModifierType) 0, GTK_ACCEL_VISIBLE);
+ if (keys[GEANY_KEYS_BUILD_COMPILE]->key)
+ gtk_widget_add_accelerator(item, "activate", accel_group, keys[GEANY_KEYS_BUILD_COMPILE]->key,
+ keys[GEANY_KEYS_BUILD_COMPILE]->mods, GTK_ACCEL_VISIBLE);
image = gtk_image_new_from_stock("gtk-convert", GTK_ICON_SIZE_MENU);
gtk_widget_show(image);
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
@@ -661,7 +672,9 @@ GtkWidget *dialogs_create_build_menu_tex(gint idx)
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(menu), item);
gtk_tooltips_set_tip(tooltips, item, _("Compiles the current file into a PDF file"), NULL);
-// gtk_widget_add_accelerator(item, "activate", accel_group, GDK_F9, (GdkModifierType) 0, GTK_ACCEL_VISIBLE);
+ if (keys[GEANY_KEYS_BUILD_LINK]->key)
+ gtk_widget_add_accelerator(item, "activate", accel_group, keys[GEANY_KEYS_BUILD_LINK]->key,
+ keys[GEANY_KEYS_BUILD_LINK]->mods, GTK_ACCEL_VISIBLE);
image = gtk_image_new_from_stock("gtk-convert", GTK_ICON_SIZE_MENU);
gtk_widget_show(image);
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
@@ -673,13 +686,17 @@ GtkWidget *dialogs_create_build_menu_tex(gint idx)
gtk_container_add(GTK_CONTAINER(menu), item);
gtk_tooltips_set_tip(tooltips, item, _("Builds the current file with the "
"make tool and the default target"), NULL);
-/* gtk_widget_add_accelerator(item, "activate", accel_group, GDK_F9,
- (GdkModifierType) GDK_SHIFT_MASK, GTK_ACCEL_VISIBLE);
-*/ g_signal_connect((gpointer) item, "activate", G_CALLBACK(on_build_make_activate), GINT_TO_POINTER(0));
+ if (keys[GEANY_KEYS_BUILD_MAKE]->key)
+ gtk_widget_add_accelerator(item, "activate", accel_group, keys[GEANY_KEYS_BUILD_MAKE]->key,
+ keys[GEANY_KEYS_BUILD_MAKE]->mods, GTK_ACCEL_VISIBLE);
+ 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)"));
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,
+ keys[GEANY_KEYS_BUILD_MAKEOWNTARGET]->mods, GTK_ACCEL_VISIBLE);
gtk_container_add(GTK_CONTAINER(menu), item);
gtk_tooltips_set_tip(tooltips, item, _("Builds the current file with the "
"make tool and the specified target"), NULL);
@@ -689,7 +706,9 @@ GtkWidget *dialogs_create_build_menu_tex(gint idx)
item = gtk_image_menu_item_new_with_mnemonic(_("View DVI file"));
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(menu), item);
-// gtk_widget_add_accelerator(item, "activate", accel_group, GDK_F5, (GdkModifierType) 0, GTK_ACCEL_VISIBLE);
+ if (keys[GEANY_KEYS_BUILD_RUN]->key)
+ gtk_widget_add_accelerator(item, "activate", accel_group, keys[GEANY_KEYS_BUILD_RUN]->key,
+ keys[GEANY_KEYS_BUILD_RUN]->mods, GTK_ACCEL_VISIBLE);
gtk_tooltips_set_tip(tooltips, item, _("Compiles and view the current file"), NULL);
image = gtk_image_new_from_stock("gtk-find", GTK_ICON_SIZE_MENU);
gtk_widget_show(image);
@@ -700,9 +719,10 @@ GtkWidget *dialogs_create_build_menu_tex(gint idx)
item = gtk_image_menu_item_new_with_mnemonic(_("View PDF file"));
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(menu), item);
-/* gtk_widget_add_accelerator(item, "activate", accel_group, GDK_F5,
- (GdkModifierType) GDK_SHIFT_MASK, GTK_ACCEL_VISIBLE);
-*/ gtk_tooltips_set_tip(tooltips, item, _("Compiles and view the current file"), NULL);
+ if (keys[GEANY_KEYS_BUILD_RUN2]->key)
+ gtk_widget_add_accelerator(item, "activate", accel_group, keys[GEANY_KEYS_BUILD_RUN2]->key,
+ keys[GEANY_KEYS_BUILD_RUN2]->mods, GTK_ACCEL_VISIBLE);
+ gtk_tooltips_set_tip(tooltips, item, _("Compiles and view the current file"), NULL);
image = gtk_image_new_from_stock("gtk-find", GTK_ICON_SIZE_MENU);
gtk_widget_show(image);
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
@@ -717,6 +737,9 @@ GtkWidget *dialogs_create_build_menu_tex(gint idx)
// arguments
item = gtk_image_menu_item_new_with_mnemonic(_("Set Arguments"));
gtk_widget_show(item);
+ if (keys[GEANY_KEYS_BUILD_OPTIONS]->key)
+ gtk_widget_add_accelerator(item, "activate", accel_group, keys[GEANY_KEYS_BUILD_OPTIONS]->key,
+ keys[GEANY_KEYS_BUILD_OPTIONS]->mods, GTK_ACCEL_VISIBLE);
gtk_container_add(GTK_CONTAINER (menu), item);
gtk_tooltips_set_tip(tooltips, item,
_("Sets the program paths and arguments"), NULL);
@@ -772,6 +795,7 @@ void dialogs_show_make_target(void)
g_signal_connect((gpointer) entry, "activate", G_CALLBACK (on_make_target_entry_activate), dialog);
g_signal_connect((gpointer) dialog, "response", G_CALLBACK (on_make_target_dialog_response), entry);
+ g_signal_connect((gpointer) dialog, "delete_event", G_CALLBACK(gtk_widget_destroy), NULL);
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), label);
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), entry);
@@ -1768,7 +1792,7 @@ void dialogs_show_prefs_dialog(void)
label = gtk_label_new(_("Terminal"));
gtk_notebook_set_tab_label(GTK_NOTEBOOK(notebook), gtk_notebook_get_nth_page(
- GTK_NOTEBOOK(notebook), 4), label);
+ GTK_NOTEBOOK(notebook), 5), label);
g_object_set_data_full(G_OBJECT(app->prefs_dialog), "font_term",
gtk_widget_ref(font_term), (GDestroyNotify) gtk_widget_unref);
@@ -1805,14 +1829,6 @@ void dialogs_show_prefs_dialog(void)
g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "long_line_color"),
"color-set", G_CALLBACK(on_prefs_color_choosed), GINT_TO_POINTER(1));
// file chooser buttons in the tools tab
- g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "button_gcc"),
- "clicked", G_CALLBACK(on_pref_tools_button_clicked), lookup_widget(app->prefs_dialog, "entry_com_c"));
- g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "button_gpp"),
- "clicked", G_CALLBACK(on_pref_tools_button_clicked), lookup_widget(app->prefs_dialog, "entry_com_cpp"));
- g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "button_javac"),
- "clicked", G_CALLBACK(on_pref_tools_button_clicked), lookup_widget(app->prefs_dialog, "entry_com_javac"));
- g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "button_java"),
- "clicked", G_CALLBACK(on_pref_tools_button_clicked), lookup_widget(app->prefs_dialog, "entry_com_java"));
g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "button_make"),
"clicked", G_CALLBACK(on_pref_tools_button_clicked), lookup_widget(app->prefs_dialog, "entry_com_make"));
g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "button_term"),
diff --git a/src/document.c b/src/document.c
index 3f727737..d55a5a3b 100644
--- a/src/document.c
+++ b/src/document.c
@@ -36,9 +36,6 @@
#ifdef HAVE_SYS_TYPES_H
# include
#endif
-#ifdef HAVE_MMAP
-# include
-#endif
#ifdef HAVE_FCNTL_H
# include
#endif
@@ -282,9 +279,9 @@ gint document_create_new_sci(const gchar *filename)
g_signal_connect((GtkWidget*) sci, "sci-notify",
G_CALLBACK(on_editor_notification), GINT_TO_POINTER(new_idx));
// signal for insert-key(works without too, but to update the right status bar)
- g_signal_connect((GtkWidget*) sci, "key-press-event",
- G_CALLBACK(on_editor_key_press_event), GINT_TO_POINTER(new_idx));
- // signal for the popup menu
+/* g_signal_connect((GtkWidget*) sci, "key-press-event",
+ G_CALLBACK(keybindings_got_event), GINT_TO_POINTER(new_idx));
+*/ // signal for the popup menu
g_signal_connect((GtkWidget*) sci, "button-press-event",
G_CALLBACK(on_editor_button_press_event), GINT_TO_POINTER(new_idx));
// signal for clicking the tab-close button
diff --git a/src/geany.h b/src/geany.h
index 611cfd90..628b1f4c 100644
--- a/src/geany.h
+++ b/src/geany.h
@@ -40,6 +40,7 @@
#include "tm_tagmanager.h"
#include "filetypes.h"
+#include "keybindings.h"
#define SSM(s, m, w, l) scintilla_send_message(s, m, w, l)
@@ -57,6 +58,7 @@
// for detailed description look in the documentation, things are not
// listed in the documentation should not be changed ;-)
#define GEANY_HOME_DIR g_get_home_dir()
+#define GEANY_FILEDEFS_SUBDIR "filedefs"
#define GEANY_FIFO_NAME "geany_fifo.0"
#define GEANY_CODENAME "Ravik"
#define GEANY_HOMEPAGE "http://geany.uvena.de/"
@@ -214,9 +216,10 @@ typedef struct MyApp
MyApp *app;
-
+/// TODO remove me
gboolean alternative_scrolling;
+
// small struct to track tag name and type together
typedef struct GeanySymbol
{
diff --git a/src/interface.c b/src/interface.c
index ee58f04c..8b2818d6 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -37,7 +37,7 @@ create_window1 (void)
GtkWidget *menuitem1_menu;
GtkWidget *menu_new1;
GtkWidget *menu_new_with_template1;
- GtkWidget *image586;
+ GtkWidget *image602;
GtkWidget *menu_new_with_template1_menu;
GtkWidget *invisible2;
GtkWidget *separator12;
@@ -46,14 +46,14 @@ create_window1 (void)
GtkWidget *menu_save1;
GtkWidget *menu_save_as1;
GtkWidget *menu_save_all1;
- GtkWidget *image587;
+ GtkWidget *image603;
GtkWidget *revert1;
GtkWidget *separator21;
GtkWidget *preferences2;
GtkWidget *separator14;
GtkWidget *menu_close1;
GtkWidget *menu_close_all1;
- GtkWidget *image588;
+ GtkWidget *image604;
GtkWidget *menu_separatormenuitem1;
GtkWidget *recent_files1;
GtkWidget *recent_files1_menu;
@@ -71,11 +71,11 @@ create_window1 (void)
GtkWidget *menu_delete1;
GtkWidget *menu_seperator2;
GtkWidget *insert_include2;
- GtkWidget *image589;
+ GtkWidget *image605;
GtkWidget *insert_include2_menu;
GtkWidget *invisible4;
GtkWidget *add_comments1;
- GtkWidget *image590;
+ GtkWidget *image606;
GtkWidget *add_comments1_menu;
GtkWidget *menu_add_changelog_entry1;
GtkWidget *insert_file_header1;
@@ -91,17 +91,17 @@ create_window1 (void)
GtkWidget *separator9;
GtkWidget *find1;
GtkWidget *find_next1;
- GtkWidget *image591;
+ GtkWidget *image607;
GtkWidget *replace1;
- GtkWidget *image592;
+ GtkWidget *image608;
GtkWidget *separator11;
GtkWidget *preferences1;
GtkWidget *menuitem3;
GtkWidget *menuitem3_menu;
GtkWidget *menu_change_font1;
- GtkWidget *image593;
+ GtkWidget *image609;
GtkWidget *menu_choose_color1;
- GtkWidget *image594;
+ GtkWidget *image610;
GtkWidget *menu_separator4;
GtkWidget *menu_fullscreen1;
GtkWidget *menu_show_messages_window1;
@@ -228,9 +228,9 @@ create_window1 (void)
gtk_widget_show (menu_new_with_template1);
gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_new_with_template1);
- image586 = gtk_image_new_from_stock ("gtk-new", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image586);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_new_with_template1), image586);
+ image602 = gtk_image_new_from_stock ("gtk-new", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image602);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_new_with_template1), image602);
menu_new_with_template1_menu = gtk_menu_new ();
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_new_with_template1), menu_new_with_template1_menu);
@@ -264,13 +264,10 @@ create_window1 (void)
gtk_widget_show (menu_save_all1);
gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_save_all1);
gtk_tooltips_set_tip (tooltips, menu_save_all1, _("Saves all open files"), NULL);
- gtk_widget_add_accelerator (menu_save_all1, "activate", accel_group,
- GDK_s, (GdkModifierType) GDK_CONTROL_MASK | GDK_SHIFT_MASK,
- GTK_ACCEL_VISIBLE);
- image587 = gtk_image_new_from_stock ("gtk-save", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image587);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_save_all1), image587);
+ image603 = gtk_image_new_from_stock ("gtk-save", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image603);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_save_all1), image603);
revert1 = gtk_image_menu_item_new_from_stock ("gtk-revert-to-saved", accel_group);
gtk_widget_show (revert1);
@@ -298,13 +295,10 @@ create_window1 (void)
gtk_widget_show (menu_close_all1);
gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_close_all1);
gtk_tooltips_set_tip (tooltips, menu_close_all1, _("Closes all open files"), NULL);
- gtk_widget_add_accelerator (menu_close_all1, "activate", accel_group,
- GDK_d, (GdkModifierType) GDK_MOD1_MASK,
- GTK_ACCEL_VISIBLE);
- image588 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image588);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_close_all1), image588);
+ image604 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image604);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_close_all1), image604);
menu_separatormenuitem1 = gtk_separator_menu_item_new ();
gtk_widget_show (menu_separatormenuitem1);
@@ -376,9 +370,9 @@ create_window1 (void)
gtk_widget_show (insert_include2);
gtk_container_add (GTK_CONTAINER (edit1_menu), insert_include2);
- image589 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image589);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_include2), image589);
+ image605 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image605);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_include2), image605);
insert_include2_menu = gtk_menu_new ();
gtk_menu_item_set_submenu (GTK_MENU_ITEM (insert_include2), insert_include2_menu);
@@ -390,9 +384,9 @@ create_window1 (void)
gtk_widget_show (add_comments1);
gtk_container_add (GTK_CONTAINER (edit1_menu), add_comments1);
- image590 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image590);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_comments1), image590);
+ image606 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image606);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_comments1), image606);
add_comments1_menu = gtk_menu_new ();
gtk_menu_item_set_submenu (GTK_MENU_ITEM (add_comments1), add_comments1_menu);
@@ -459,21 +453,18 @@ create_window1 (void)
find_next1 = gtk_image_menu_item_new_with_mnemonic (_("Find _next"));
gtk_widget_show (find_next1);
gtk_container_add (GTK_CONTAINER (edit1_menu), find_next1);
- gtk_widget_add_accelerator (find_next1, "activate", accel_group,
- GDK_F3, (GdkModifierType) 0,
- GTK_ACCEL_VISIBLE);
- image591 = gtk_image_new_from_stock ("gtk-find", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image591);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (find_next1), image591);
+ image607 = gtk_image_new_from_stock ("gtk-find", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image607);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (find_next1), image607);
replace1 = gtk_image_menu_item_new_with_mnemonic (_("_Replace"));
gtk_widget_show (replace1);
gtk_container_add (GTK_CONTAINER (edit1_menu), replace1);
- image592 = gtk_image_new_from_stock ("gtk-find-and-replace", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image592);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (replace1), image592);
+ image608 = gtk_image_new_from_stock ("gtk-find-and-replace", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image608);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (replace1), image608);
separator11 = gtk_separator_menu_item_new ();
gtk_widget_show (separator11);
@@ -496,18 +487,18 @@ create_window1 (void)
gtk_container_add (GTK_CONTAINER (menuitem3_menu), menu_change_font1);
gtk_tooltips_set_tip (tooltips, menu_change_font1, _("Change the default font"), NULL);
- image593 = gtk_image_new_from_stock ("gtk-select-font", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image593);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_change_font1), image593);
+ image609 = gtk_image_new_from_stock ("gtk-select-font", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image609);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_change_font1), image609);
menu_choose_color1 = gtk_image_menu_item_new_with_mnemonic (_("Show Color Chooser"));
gtk_widget_show (menu_choose_color1);
gtk_container_add (GTK_CONTAINER (menuitem3_menu), menu_choose_color1);
gtk_tooltips_set_tip (tooltips, menu_choose_color1, _("Open a color chooser dialog, to interactively pick colors from a palette."), NULL);
- image594 = gtk_image_new_from_stock ("gtk-select-color", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image594);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_choose_color1), image594);
+ image610 = gtk_image_new_from_stock ("gtk-select-color", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image610);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_choose_color1), image610);
menu_separator4 = gtk_separator_menu_item_new ();
gtk_widget_show (menu_separator4);
@@ -517,9 +508,6 @@ create_window1 (void)
menu_fullscreen1 = gtk_check_menu_item_new_with_mnemonic (_("Fullscreen"));
gtk_widget_show (menu_fullscreen1);
gtk_container_add (GTK_CONTAINER (menuitem3_menu), menu_fullscreen1);
- gtk_widget_add_accelerator (menu_fullscreen1, "activate", accel_group,
- GDK_F11, (GdkModifierType) 0,
- GTK_ACCEL_VISIBLE);
menu_show_messages_window1 = gtk_check_menu_item_new_with_mnemonic (_("Show messages window"));
gtk_widget_show (menu_show_messages_window1);
@@ -1163,7 +1151,7 @@ create_window1 (void)
GLADE_HOOKUP_OBJECT (window1, menuitem1_menu, "menuitem1_menu");
GLADE_HOOKUP_OBJECT (window1, menu_new1, "menu_new1");
GLADE_HOOKUP_OBJECT (window1, menu_new_with_template1, "menu_new_with_template1");
- GLADE_HOOKUP_OBJECT (window1, image586, "image586");
+ GLADE_HOOKUP_OBJECT (window1, image602, "image602");
GLADE_HOOKUP_OBJECT (window1, menu_new_with_template1_menu, "menu_new_with_template1_menu");
GLADE_HOOKUP_OBJECT (window1, invisible2, "invisible2");
GLADE_HOOKUP_OBJECT (window1, separator12, "separator12");
@@ -1172,14 +1160,14 @@ create_window1 (void)
GLADE_HOOKUP_OBJECT (window1, menu_save1, "menu_save1");
GLADE_HOOKUP_OBJECT (window1, menu_save_as1, "menu_save_as1");
GLADE_HOOKUP_OBJECT (window1, menu_save_all1, "menu_save_all1");
- GLADE_HOOKUP_OBJECT (window1, image587, "image587");
+ GLADE_HOOKUP_OBJECT (window1, image603, "image603");
GLADE_HOOKUP_OBJECT (window1, revert1, "revert1");
GLADE_HOOKUP_OBJECT (window1, separator21, "separator21");
GLADE_HOOKUP_OBJECT (window1, preferences2, "preferences2");
GLADE_HOOKUP_OBJECT (window1, separator14, "separator14");
GLADE_HOOKUP_OBJECT (window1, menu_close1, "menu_close1");
GLADE_HOOKUP_OBJECT (window1, menu_close_all1, "menu_close_all1");
- GLADE_HOOKUP_OBJECT (window1, image588, "image588");
+ GLADE_HOOKUP_OBJECT (window1, image604, "image604");
GLADE_HOOKUP_OBJECT (window1, menu_separatormenuitem1, "menu_separatormenuitem1");
GLADE_HOOKUP_OBJECT (window1, recent_files1, "recent_files1");
GLADE_HOOKUP_OBJECT (window1, recent_files1_menu, "recent_files1_menu");
@@ -1197,11 +1185,11 @@ create_window1 (void)
GLADE_HOOKUP_OBJECT (window1, menu_delete1, "menu_delete1");
GLADE_HOOKUP_OBJECT (window1, menu_seperator2, "menu_seperator2");
GLADE_HOOKUP_OBJECT (window1, insert_include2, "insert_include2");
- GLADE_HOOKUP_OBJECT (window1, image589, "image589");
+ GLADE_HOOKUP_OBJECT (window1, image605, "image605");
GLADE_HOOKUP_OBJECT (window1, insert_include2_menu, "insert_include2_menu");
GLADE_HOOKUP_OBJECT (window1, invisible4, "invisible4");
GLADE_HOOKUP_OBJECT (window1, add_comments1, "add_comments1");
- GLADE_HOOKUP_OBJECT (window1, image590, "image590");
+ GLADE_HOOKUP_OBJECT (window1, image606, "image606");
GLADE_HOOKUP_OBJECT (window1, add_comments1_menu, "add_comments1_menu");
GLADE_HOOKUP_OBJECT (window1, menu_add_changelog_entry1, "menu_add_changelog_entry1");
GLADE_HOOKUP_OBJECT (window1, insert_file_header1, "insert_file_header1");
@@ -1217,17 +1205,17 @@ create_window1 (void)
GLADE_HOOKUP_OBJECT (window1, separator9, "separator9");
GLADE_HOOKUP_OBJECT (window1, find1, "find1");
GLADE_HOOKUP_OBJECT (window1, find_next1, "find_next1");
- GLADE_HOOKUP_OBJECT (window1, image591, "image591");
+ GLADE_HOOKUP_OBJECT (window1, image607, "image607");
GLADE_HOOKUP_OBJECT (window1, replace1, "replace1");
- GLADE_HOOKUP_OBJECT (window1, image592, "image592");
+ GLADE_HOOKUP_OBJECT (window1, image608, "image608");
GLADE_HOOKUP_OBJECT (window1, separator11, "separator11");
GLADE_HOOKUP_OBJECT (window1, preferences1, "preferences1");
GLADE_HOOKUP_OBJECT (window1, menuitem3, "menuitem3");
GLADE_HOOKUP_OBJECT (window1, menuitem3_menu, "menuitem3_menu");
GLADE_HOOKUP_OBJECT (window1, menu_change_font1, "menu_change_font1");
- GLADE_HOOKUP_OBJECT (window1, image593, "image593");
+ GLADE_HOOKUP_OBJECT (window1, image609, "image609");
GLADE_HOOKUP_OBJECT (window1, menu_choose_color1, "menu_choose_color1");
- GLADE_HOOKUP_OBJECT (window1, image594, "image594");
+ GLADE_HOOKUP_OBJECT (window1, image610, "image610");
GLADE_HOOKUP_OBJECT (window1, menu_separator4, "menu_separator4");
GLADE_HOOKUP_OBJECT (window1, menu_fullscreen1, "menu_fullscreen1");
GLADE_HOOKUP_OBJECT (window1, menu_show_messages_window1, "menu_show_messages_window1");
@@ -1822,38 +1810,18 @@ create_prefs_dialog (void)
GtkWidget *vbox2;
GtkWidget *label17;
GtkWidget *table1;
- GtkWidget *entry_com_c;
- GtkWidget *label12;
- GtkWidget *label13;
- GtkWidget *label114;
- GtkWidget *entry_com_javac;
- GtkWidget *entry_com_cpp;
- GtkWidget *label97;
- GtkWidget *entry_com_term;
GtkWidget *label11;
- GtkWidget *label113;
- GtkWidget *entry_com_make;
- GtkWidget *entry_com_pascal;
- GtkWidget *label115;
- GtkWidget *entry_com_java;
+ GtkWidget *label97;
GtkWidget *label117;
+ GtkWidget *entry_com_make;
+ GtkWidget *entry_com_term;
GtkWidget *entry_browser;
- GtkWidget *button_gcc;
- GtkWidget *image280;
- GtkWidget *button_gpp;
- GtkWidget *bu;
- GtkWidget *button_java;
- GtkWidget *image283;
- GtkWidget *button_fpc;
- GtkWidget *image284;
GtkWidget *button_make;
GtkWidget *image285;
GtkWidget *button_term;
GtkWidget *image286;
GtkWidget *button_browser;
GtkWidget *image287;
- GtkWidget *button_javac;
- GtkWidget *image288;
GtkWidget *label96;
GtkWidget *vbox9;
GtkWidget *label120;
@@ -1870,6 +1838,13 @@ create_prefs_dialog (void)
GtkWidget *entry_template_developer;
GtkWidget *label132;
GtkWidget *label119;
+ GtkWidget *vbox13;
+ GtkWidget *label152;
+ GtkWidget *scrolledwindow8;
+ GtkWidget *treeview7;
+ GtkWidget *alignment10;
+ GtkWidget *button2;
+ GtkWidget *label151;
GtkWidget *dialog_action_area3;
GtkWidget *cancelbutton1;
GtkWidget *okbutton1;
@@ -2329,153 +2304,57 @@ create_prefs_dialog (void)
gtk_box_pack_start (GTK_BOX (vbox2), label17, FALSE, FALSE, 0);
gtk_misc_set_padding (GTK_MISC (label17), 0, 6);
- table1 = gtk_table_new (8, 3, FALSE);
+ table1 = gtk_table_new (3, 3, FALSE);
gtk_widget_show (table1);
gtk_box_pack_start (GTK_BOX (vbox2), table1, TRUE, TRUE, 0);
gtk_table_set_row_spacings (GTK_TABLE (table1), 7);
gtk_table_set_col_spacings (GTK_TABLE (table1), 5);
- entry_com_c = gtk_entry_new ();
- gtk_table_attach (GTK_TABLE (table1), entry_com_c, 1, 2, 0, 1,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_tooltips_set_tip (tooltips, entry_com_c, _("Path and options for the C compiler"), NULL);
-
- label12 = gtk_label_new (_("C Compiler"));
- gtk_table_attach (GTK_TABLE (table1), label12, 0, 1, 0, 1,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_misc_set_alignment (GTK_MISC (label12), 0, 0.5);
-
- label13 = gtk_label_new (_("C++ Compiler"));
- gtk_table_attach (GTK_TABLE (table1), label13, 0, 1, 1, 2,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_misc_set_alignment (GTK_MISC (label13), 0, 0.5);
-
- label114 = gtk_label_new (_("Java Compiler"));
- gtk_table_attach (GTK_TABLE (table1), label114, 0, 1, 2, 3,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_misc_set_alignment (GTK_MISC (label114), 0, 0.5);
-
- entry_com_javac = gtk_entry_new ();
- gtk_table_attach (GTK_TABLE (table1), entry_com_javac, 1, 2, 2, 3,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_tooltips_set_tip (tooltips, entry_com_javac, _("Path and options for the Java compiler"), NULL);
-
- entry_com_cpp = gtk_entry_new ();
- gtk_table_attach (GTK_TABLE (table1), entry_com_cpp, 1, 2, 1, 2,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_tooltips_set_tip (tooltips, entry_com_cpp, _("Path and options for the C++ compiler"), NULL);
-
- label97 = gtk_label_new (_("Terminal"));
- gtk_widget_show (label97);
- gtk_table_attach (GTK_TABLE (table1), label97, 0, 1, 6, 7,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_misc_set_alignment (GTK_MISC (label97), 0, 0.5);
-
- entry_com_term = gtk_entry_new ();
- gtk_widget_show (entry_com_term);
- gtk_table_attach (GTK_TABLE (table1), entry_com_term, 1, 2, 6, 7,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_tooltips_set_tip (tooltips, entry_com_term, _("A terminal emulator like xterm, gnome-terminal or konsole (should accept the -e argument)"), NULL);
-
label11 = gtk_label_new (_("Make"));
gtk_widget_show (label11);
- gtk_table_attach (GTK_TABLE (table1), label11, 0, 1, 5, 6,
+ gtk_table_attach (GTK_TABLE (table1), label11, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label11), 0, 0.5);
- label113 = gtk_label_new (_("Pascal Compiler"));
- gtk_table_attach (GTK_TABLE (table1), label113, 0, 1, 4, 5,
+ label97 = gtk_label_new (_("Terminal"));
+ gtk_widget_show (label97);
+ gtk_table_attach (GTK_TABLE (table1), label97, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
- gtk_misc_set_alignment (GTK_MISC (label113), 0, 0.5);
-
- entry_com_make = gtk_entry_new ();
- gtk_widget_show (entry_com_make);
- gtk_table_attach (GTK_TABLE (table1), entry_com_make, 1, 2, 5, 6,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_tooltips_set_tip (tooltips, entry_com_make, _("Path and options for the make tool"), NULL);
-
- entry_com_pascal = gtk_entry_new ();
- gtk_table_attach (GTK_TABLE (table1), entry_com_pascal, 1, 2, 4, 5,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_tooltips_set_tip (tooltips, entry_com_pascal, _("Path and options for the Pascal compiler"), NULL);
-
- label115 = gtk_label_new (_("Java executable"));
- gtk_table_attach (GTK_TABLE (table1), label115, 0, 1, 3, 4,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_misc_set_alignment (GTK_MISC (label115), 0, 0.5);
-
- entry_com_java = gtk_entry_new ();
- gtk_table_attach (GTK_TABLE (table1), entry_com_java, 1, 2, 3, 4,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_tooltips_set_tip (tooltips, entry_com_java, _("Path and options for the java executable, to run java bytecode files(compiled java source files)"), NULL);
+ gtk_misc_set_alignment (GTK_MISC (label97), 0, 0.5);
label117 = gtk_label_new (_("Browser"));
gtk_widget_show (label117);
- gtk_table_attach (GTK_TABLE (table1), label117, 0, 1, 7, 8,
+ gtk_table_attach (GTK_TABLE (table1), label117, 0, 1, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label117), 0, 0.5);
+ entry_com_make = gtk_entry_new ();
+ gtk_widget_show (entry_com_make);
+ gtk_table_attach (GTK_TABLE (table1), entry_com_make, 1, 2, 0, 1,
+ (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_tooltips_set_tip (tooltips, entry_com_make, _("Path and options for the make tool"), NULL);
+
+ entry_com_term = gtk_entry_new ();
+ gtk_widget_show (entry_com_term);
+ gtk_table_attach (GTK_TABLE (table1), entry_com_term, 1, 2, 1, 2,
+ (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_tooltips_set_tip (tooltips, entry_com_term, _("A terminal emulator like xterm, gnome-terminal or konsole (should accept the -e argument)"), NULL);
+
entry_browser = gtk_entry_new ();
gtk_widget_show (entry_browser);
- gtk_table_attach (GTK_TABLE (table1), entry_browser, 1, 2, 7, 8,
+ gtk_table_attach (GTK_TABLE (table1), entry_browser, 1, 2, 2, 3,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_tooltips_set_tip (tooltips, entry_browser, _("Path (and possibly additional arguments) to your favorite browser"), NULL);
- button_gcc = gtk_button_new ();
- gtk_table_attach (GTK_TABLE (table1), button_gcc, 2, 3, 0, 1,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-
- image280 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_BUTTON);
- gtk_widget_show (image280);
- gtk_container_add (GTK_CONTAINER (button_gcc), image280);
-
- button_gpp = gtk_button_new ();
- gtk_table_attach (GTK_TABLE (table1), button_gpp, 2, 3, 1, 2,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-
- bu = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_BUTTON);
- gtk_widget_show (bu);
- gtk_container_add (GTK_CONTAINER (button_gpp), bu);
-
- button_java = gtk_button_new ();
- gtk_table_attach (GTK_TABLE (table1), button_java, 2, 3, 3, 4,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-
- image283 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_BUTTON);
- gtk_widget_show (image283);
- gtk_container_add (GTK_CONTAINER (button_java), image283);
-
- button_fpc = gtk_button_new ();
- gtk_table_attach (GTK_TABLE (table1), button_fpc, 2, 3, 4, 5,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-
- image284 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_BUTTON);
- gtk_widget_show (image284);
- gtk_container_add (GTK_CONTAINER (button_fpc), image284);
-
button_make = gtk_button_new ();
gtk_widget_show (button_make);
- gtk_table_attach (GTK_TABLE (table1), button_make, 2, 3, 5, 6,
+ gtk_table_attach (GTK_TABLE (table1), button_make, 2, 3, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
@@ -2485,7 +2364,7 @@ create_prefs_dialog (void)
button_term = gtk_button_new ();
gtk_widget_show (button_term);
- gtk_table_attach (GTK_TABLE (table1), button_term, 2, 3, 6, 7,
+ gtk_table_attach (GTK_TABLE (table1), button_term, 2, 3, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
@@ -2495,7 +2374,7 @@ create_prefs_dialog (void)
button_browser = gtk_button_new ();
gtk_widget_show (button_browser);
- gtk_table_attach (GTK_TABLE (table1), button_browser, 2, 3, 7, 8,
+ gtk_table_attach (GTK_TABLE (table1), button_browser, 2, 3, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
@@ -2503,15 +2382,6 @@ create_prefs_dialog (void)
gtk_widget_show (image287);
gtk_container_add (GTK_CONTAINER (button_browser), image287);
- button_javac = gtk_button_new ();
- gtk_table_attach (GTK_TABLE (table1), button_javac, 2, 3, 2, 3,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-
- image288 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_BUTTON);
- gtk_widget_show (image288);
- gtk_container_add (GTK_CONTAINER (button_javac), image288);
-
label96 = gtk_label_new (_("Tools"));
gtk_widget_show (label96);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook2), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook2), 2), label96);
@@ -2609,6 +2479,41 @@ create_prefs_dialog (void)
gtk_widget_show (label119);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook2), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook2), 3), label119);
+ vbox13 = gtk_vbox_new (FALSE, 5);
+ gtk_widget_show (vbox13);
+ gtk_container_add (GTK_CONTAINER (notebook2), vbox13);
+
+ label152 = gtk_label_new (_("Here you can change keyboard shortcuts for various actions. Just double click on a action or select one and press the Change button to enter a new shortcut. You can also edit the string representation of the shortcut directly."));
+ gtk_widget_show (label152);
+ gtk_box_pack_start (GTK_BOX (vbox13), label152, FALSE, TRUE, 0);
+ gtk_label_set_justify (GTK_LABEL (label152), GTK_JUSTIFY_FILL);
+ gtk_label_set_line_wrap (GTK_LABEL (label152), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (label152), 0.1, 0);
+ gtk_misc_set_padding (GTK_MISC (label152), 0, 5);
+
+ scrolledwindow8 = gtk_scrolled_window_new (NULL, NULL);
+ gtk_widget_show (scrolledwindow8);
+ gtk_box_pack_start (GTK_BOX (vbox13), scrolledwindow8, TRUE, TRUE, 0);
+ gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow8), GTK_SHADOW_IN);
+
+ treeview7 = gtk_tree_view_new ();
+ gtk_widget_show (treeview7);
+ gtk_container_add (GTK_CONTAINER (scrolledwindow8), treeview7);
+ gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview7), FALSE);
+
+ alignment10 = gtk_alignment_new (0.5, 0.5, 0.3, 1);
+ gtk_widget_show (alignment10);
+ gtk_box_pack_start (GTK_BOX (vbox13), alignment10, FALSE, FALSE, 0);
+ gtk_alignment_set_padding (GTK_ALIGNMENT (alignment10), 0, 5, 0, 0);
+
+ button2 = gtk_button_new_with_mnemonic (_("Change"));
+ gtk_widget_show (button2);
+ gtk_container_add (GTK_CONTAINER (alignment10), button2);
+
+ label151 = gtk_label_new (_("Keybindings"));
+ gtk_widget_show (label151);
+ gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook2), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook2), 4), label151);
+
dialog_action_area3 = GTK_DIALOG (prefs_dialog)->action_area;
gtk_widget_show (dialog_action_area3);
gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area3), GTK_BUTTONBOX_END);
@@ -2705,38 +2610,18 @@ create_prefs_dialog (void)
GLADE_HOOKUP_OBJECT (prefs_dialog, vbox2, "vbox2");
GLADE_HOOKUP_OBJECT (prefs_dialog, label17, "label17");
GLADE_HOOKUP_OBJECT (prefs_dialog, table1, "table1");
- GLADE_HOOKUP_OBJECT (prefs_dialog, entry_com_c, "entry_com_c");
- GLADE_HOOKUP_OBJECT (prefs_dialog, label12, "label12");
- GLADE_HOOKUP_OBJECT (prefs_dialog, label13, "label13");
- GLADE_HOOKUP_OBJECT (prefs_dialog, label114, "label114");
- GLADE_HOOKUP_OBJECT (prefs_dialog, entry_com_javac, "entry_com_javac");
- GLADE_HOOKUP_OBJECT (prefs_dialog, entry_com_cpp, "entry_com_cpp");
- GLADE_HOOKUP_OBJECT (prefs_dialog, label97, "label97");
- GLADE_HOOKUP_OBJECT (prefs_dialog, entry_com_term, "entry_com_term");
GLADE_HOOKUP_OBJECT (prefs_dialog, label11, "label11");
- GLADE_HOOKUP_OBJECT (prefs_dialog, label113, "label113");
- GLADE_HOOKUP_OBJECT (prefs_dialog, entry_com_make, "entry_com_make");
- GLADE_HOOKUP_OBJECT (prefs_dialog, entry_com_pascal, "entry_com_pascal");
- GLADE_HOOKUP_OBJECT (prefs_dialog, label115, "label115");
- GLADE_HOOKUP_OBJECT (prefs_dialog, entry_com_java, "entry_com_java");
+ GLADE_HOOKUP_OBJECT (prefs_dialog, label97, "label97");
GLADE_HOOKUP_OBJECT (prefs_dialog, label117, "label117");
+ GLADE_HOOKUP_OBJECT (prefs_dialog, entry_com_make, "entry_com_make");
+ GLADE_HOOKUP_OBJECT (prefs_dialog, entry_com_term, "entry_com_term");
GLADE_HOOKUP_OBJECT (prefs_dialog, entry_browser, "entry_browser");
- GLADE_HOOKUP_OBJECT (prefs_dialog, button_gcc, "button_gcc");
- GLADE_HOOKUP_OBJECT (prefs_dialog, image280, "image280");
- GLADE_HOOKUP_OBJECT (prefs_dialog, button_gpp, "button_gpp");
- GLADE_HOOKUP_OBJECT (prefs_dialog, bu, "bu");
- GLADE_HOOKUP_OBJECT (prefs_dialog, button_java, "button_java");
- GLADE_HOOKUP_OBJECT (prefs_dialog, image283, "image283");
- GLADE_HOOKUP_OBJECT (prefs_dialog, button_fpc, "button_fpc");
- GLADE_HOOKUP_OBJECT (prefs_dialog, image284, "image284");
GLADE_HOOKUP_OBJECT (prefs_dialog, button_make, "button_make");
GLADE_HOOKUP_OBJECT (prefs_dialog, image285, "image285");
GLADE_HOOKUP_OBJECT (prefs_dialog, button_term, "button_term");
GLADE_HOOKUP_OBJECT (prefs_dialog, image286, "image286");
GLADE_HOOKUP_OBJECT (prefs_dialog, button_browser, "button_browser");
GLADE_HOOKUP_OBJECT (prefs_dialog, image287, "image287");
- GLADE_HOOKUP_OBJECT (prefs_dialog, button_javac, "button_javac");
- GLADE_HOOKUP_OBJECT (prefs_dialog, image288, "image288");
GLADE_HOOKUP_OBJECT (prefs_dialog, label96, "label96");
GLADE_HOOKUP_OBJECT (prefs_dialog, vbox9, "vbox9");
GLADE_HOOKUP_OBJECT (prefs_dialog, label120, "label120");
@@ -2753,6 +2638,13 @@ create_prefs_dialog (void)
GLADE_HOOKUP_OBJECT (prefs_dialog, entry_template_developer, "entry_template_developer");
GLADE_HOOKUP_OBJECT (prefs_dialog, label132, "label132");
GLADE_HOOKUP_OBJECT (prefs_dialog, label119, "label119");
+ GLADE_HOOKUP_OBJECT (prefs_dialog, vbox13, "vbox13");
+ GLADE_HOOKUP_OBJECT (prefs_dialog, label152, "label152");
+ GLADE_HOOKUP_OBJECT (prefs_dialog, scrolledwindow8, "scrolledwindow8");
+ GLADE_HOOKUP_OBJECT (prefs_dialog, treeview7, "treeview7");
+ GLADE_HOOKUP_OBJECT (prefs_dialog, alignment10, "alignment10");
+ GLADE_HOOKUP_OBJECT (prefs_dialog, button2, "button2");
+ GLADE_HOOKUP_OBJECT (prefs_dialog, label151, "label151");
GLADE_HOOKUP_OBJECT_NO_REF (prefs_dialog, dialog_action_area3, "dialog_action_area3");
GLADE_HOOKUP_OBJECT (prefs_dialog, cancelbutton1, "cancelbutton1");
GLADE_HOOKUP_OBJECT (prefs_dialog, okbutton1, "okbutton1");
diff --git a/src/keybindings.c b/src/keybindings.c
new file mode 100644
index 00000000..b90f9128
--- /dev/null
+++ b/src/keybindings.c
@@ -0,0 +1,505 @@
+/*
+ * keybindings.c - this file is part of Geany, a fast and lightweight IDE
+ *
+ * Copyright 2006 Enrico Troeger
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $Id$
+ */
+
+
+#include
+
+#include "geany.h"
+#include "keybindings.h"
+#include "support.h"
+#include "utils.h"
+#include "document.h"
+#include "callbacks.h"
+#include "dialogs.h"
+#include "msgwindow.h"
+#include "sci_cb.h"
+#include "sciwrappers.h"
+// include vte.h on non-Win32 systems, else define fake vte_init
+#ifdef HAVE_VTE
+# include "vte.h"
+#endif
+
+
+
+/* simple convenience function to allocate and fill the struct */
+static binding *fill(void (*func) (void), guint key, GdkModifierType mod, const gchar *name);
+
+static void cb_func_menu_new(void);
+static void cb_func_menu_open(void);
+static void cb_func_menu_save(void);
+static void cb_func_menu_saveall(void);
+static void cb_func_menu_closeall(void);
+static void cb_func_menu_reloadfile(void);
+static void cb_func_menu_undo(void);
+static void cb_func_menu_redo(void);
+static void cb_func_menu_findnext(void);
+static void cb_func_menu_replace(void);
+static void cb_func_menu_preferences(void);
+static void cb_func_menu_opencolorchooser(void);
+static void cb_func_menu_fullscreen(void);
+static void cb_func_menu_zoomin(void);
+static void cb_func_menu_zoomout(void);
+static void cb_func_menu_foldall(void);
+static void cb_func_menu_unfoldall(void);
+static void cb_func_build_compile(void);
+static void cb_func_build_link(void);
+static void cb_func_build_make(void);
+static void cb_func_build_makeowntarget(void);
+static void cb_func_build_run(void);
+static void cb_func_build_run2(void);
+static void cb_func_build_options(void);
+static void cb_func_reloadtaglist(void);
+static void cb_func_switch_editor(void);
+static void cb_func_switch_scribble(void);
+static void cb_func_switch_vte(void);
+static void cb_func_switch_tableft(void);
+static void cb_func_switch_tabright(void);
+static void cb_func_edit_duplicateline(void);
+static void cb_func_edit_commentline(void);
+static void cb_func_edit_autocomplete(void);
+static void cb_func_edit_calltip(void);
+static void cb_func_edit_macrolist(void);
+static void cb_func_edit_suppresscompletion(void);
+
+
+void keybindings_init(void)
+{
+ gchar *configfile = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "keybindings.conf", NULL);
+ gchar *val;
+ guint i;
+ guint key;
+ GdkModifierType mods;
+ GKeyFile *config = g_key_file_new();
+ GtkAccelGroup *accel_group = gtk_accel_group_new();
+
+ // init all fields of keys with default values
+ keys[GEANY_KEYS_MENU_NEW] = fill(cb_func_menu_new, 0, 0, "menu_new");
+ keys[GEANY_KEYS_MENU_OPEN] = fill(cb_func_menu_open, 0, 0, "menu_open");
+ keys[GEANY_KEYS_MENU_SAVE] = fill(cb_func_menu_save, 0, 0, "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_FIND_NEXT] = fill(cb_func_menu_findnext, GDK_F3, 0, "menu_findnext");
+ keys[GEANY_KEYS_MENU_REPLACE] = fill(cb_func_menu_replace, 0, 0, "menu_replace");
+ keys[GEANY_KEYS_MENU_PREFERENCES] = fill(cb_func_menu_preferences, GDK_p, GDK_CONTROL_MASK, "menu_preferences");
+ 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_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_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_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");
+
+ // now load user defined keys
+ if (g_key_file_load_from_file(config, configfile, G_KEY_FILE_KEEP_COMMENTS, NULL))
+ {
+ for (i = 0; i < GEANY_MAX_KEYS; i++)
+ {
+ val = g_key_file_get_string(config, "Bindings", keys[i]->name, NULL);
+ if (val != NULL)
+ {
+ gtk_accelerator_parse(val, &key, &mods);
+ keys[i]->key = key;
+ keys[i]->mods = mods;
+ }
+ g_free(val);
+ }
+ }
+
+
+ // apply the settings
+ if (keys[GEANY_KEYS_MENU_SAVEALL]->key != 0)
+ gtk_widget_add_accelerator(lookup_widget(app->window, "menu_save_all1"), "activate", accel_group,
+ keys[GEANY_KEYS_MENU_SAVEALL]->key, keys[GEANY_KEYS_MENU_SAVEALL]->mods, GTK_ACCEL_VISIBLE);
+
+ if (keys[GEANY_KEYS_MENU_CLOSEALL]->key != 0)
+ gtk_widget_add_accelerator(lookup_widget(app->window, "menu_close_all1"), "activate", accel_group,
+ keys[GEANY_KEYS_MENU_CLOSEALL]->key, keys[GEANY_KEYS_MENU_CLOSEALL]->mods, GTK_ACCEL_VISIBLE);
+
+ if (keys[GEANY_KEYS_MENU_RELOADFILE]->key != 0)
+ gtk_widget_add_accelerator(lookup_widget(app->window, "revert1"), "activate", accel_group,
+ keys[GEANY_KEYS_MENU_RELOADFILE]->key, keys[GEANY_KEYS_MENU_RELOADFILE]->mods, GTK_ACCEL_VISIBLE);
+
+ if (keys[GEANY_KEYS_MENU_PREFERENCES]->key != 0)
+ gtk_widget_add_accelerator(lookup_widget(app->window, "preferences1"), "activate", accel_group,
+ keys[GEANY_KEYS_MENU_PREFERENCES]->key, keys[GEANY_KEYS_MENU_PREFERENCES]->mods, GTK_ACCEL_VISIBLE);
+
+ if (keys[GEANY_KEYS_MENU_FIND_NEXT]->key != 0)
+ gtk_widget_add_accelerator(lookup_widget(app->window, "find_next1"), "activate", accel_group,
+ keys[GEANY_KEYS_MENU_FIND_NEXT]->key, keys[GEANY_KEYS_MENU_FIND_NEXT]->mods, GTK_ACCEL_VISIBLE);
+
+ if (keys[GEANY_KEYS_MENU_FULLSCREEN]->key != 0)
+ gtk_widget_add_accelerator(lookup_widget(app->window, "menu_fullscreen1"), "activate", accel_group,
+ keys[GEANY_KEYS_MENU_FULLSCREEN]->key, keys[GEANY_KEYS_MENU_FULLSCREEN]->mods, GTK_ACCEL_VISIBLE);
+
+ if (keys[GEANY_KEYS_MENU_OPENCOLORCHOOSER]->key != 0)
+ gtk_widget_add_accelerator(lookup_widget(app->window, "menu_choose_color1"), "activate", accel_group,
+ keys[GEANY_KEYS_MENU_OPENCOLORCHOOSER]->key, keys[GEANY_KEYS_MENU_OPENCOLORCHOOSER]->mods, GTK_ACCEL_VISIBLE);
+
+ if (keys[GEANY_KEYS_MENU_ZOOMIN]->key != 0)
+ gtk_widget_add_accelerator(lookup_widget(app->window, "menu_zoom_in1"), "activate", accel_group,
+ keys[GEANY_KEYS_MENU_ZOOMIN]->key, keys[GEANY_KEYS_MENU_ZOOMIN]->mods, GTK_ACCEL_VISIBLE);
+
+ if (keys[GEANY_KEYS_MENU_ZOOMOUT]->key != 0)
+ gtk_widget_add_accelerator(lookup_widget(app->window, "menu_zoom_out1"), "activate", accel_group,
+ keys[GEANY_KEYS_MENU_ZOOMOUT]->key, keys[GEANY_KEYS_MENU_ZOOMOUT]->mods, GTK_ACCEL_VISIBLE);
+
+ if (keys[GEANY_KEYS_MENU_FOLDALL]->key != 0)
+ gtk_widget_add_accelerator(lookup_widget(app->window, "menu_fold_all1"), "activate", accel_group,
+ keys[GEANY_KEYS_MENU_FOLDALL]->key, keys[GEANY_KEYS_MENU_FOLDALL]->mods, GTK_ACCEL_VISIBLE);
+
+ if (keys[GEANY_KEYS_MENU_UNFOLDALL]->key != 0)
+ gtk_widget_add_accelerator(lookup_widget(app->window, "menu_unfold_all1"), "activate", accel_group,
+ keys[GEANY_KEYS_MENU_UNFOLDALL]->key, keys[GEANY_KEYS_MENU_UNFOLDALL]->mods, GTK_ACCEL_VISIBLE);
+
+ // the build menu items are set if the build menus are created
+
+ gtk_window_add_accel_group(GTK_WINDOW(app->window), accel_group);
+
+ g_free(configfile);
+ g_key_file_free(config);
+}
+
+
+/* just write the content of the keys array to the config file */
+void keybindings_write_to_file(void)
+{
+ gchar *configfile = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "keybindings.conf", NULL);
+ gchar *val, *data;
+ guint i;
+ GKeyFile *config = g_key_file_new();
+
+ // add comment if the file is newly created
+ if (! g_key_file_load_from_file(config, configfile, G_KEY_FILE_KEEP_COMMENTS, NULL))
+ {
+ g_key_file_set_comment(config, NULL, NULL, "Keybindings for Geany\nThe format looks like \"a\" or \"F1\".\nBut you can also change the keys in Geany's preferences dialog.", NULL);
+ }
+
+ for (i = 0; i < GEANY_MAX_KEYS; i++)
+ {
+ val = gtk_accelerator_name(keys[i]->key, keys[i]->mods);
+ g_key_file_set_string(config, "Bindings", keys[i]->name, val);
+ g_free(val);
+ }
+
+ // write the file
+ data = g_key_file_to_data(config, NULL, NULL);
+ utils_write_file(configfile, data);
+
+ g_free(data);
+ g_free(configfile);
+ g_key_file_free(config);
+}
+
+
+void keybindings_free(void)
+{
+ guint i;
+
+ for (i = 0; i < GEANY_MAX_KEYS; i++)
+ {
+ g_free(keys[i]);
+ }
+}
+
+
+/* central keypress event handler, almost all keypress events go to this function */
+gboolean keybindings_got_event(GtkWidget *widget, GdkEventKey *event, gpointer user_data)
+{
+ guint i, k;
+
+ for (i = 0; i < GEANY_MAX_KEYS; i++)
+ {
+ // ugly hack to get around that CTRL+Shift+r results in 'R' not 'r'
+ k = keys[i]->key;
+ if (event->state & GDK_SHIFT_MASK)
+ {
+ // skip entries which don't include SHIFT
+ if (! (keys[i]->mods & GDK_SHIFT_MASK)) continue;
+ // raise the keyval
+ if (keys[i]->key >= GDK_a && keys[i]->key <= GDK_z) k = keys[i]->key - 32;
+ }
+
+ // ignore numlock key, not necessary but nice
+ if (event->state & GDK_MOD2_MASK) event->state -= GDK_MOD2_MASK;
+
+ if (event->keyval == k && event->state == keys[i]->mods)
+ {
+ // call the corresponding callback function for this shortcut
+ if (keys[i]->cb_func != NULL) keys[i]->cb_func();
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+
+/* simple convenience function to allocate and fill the struct */
+static binding *fill(void (*func) (void), guint key, GdkModifierType mod, const gchar *name)
+{
+ binding *result;
+
+ result = g_new0(binding, 1);
+ result->name = name;
+ result->key = key;
+ result->mods = mod;
+ result->cb_func = func;
+
+ return result;
+}
+
+
+/* these are the callback functions, each shortcut has its own function, this is only for clear code */
+static void cb_func_menu_new(void)
+{
+ document_new_file(NULL);
+}
+
+static void cb_func_menu_open(void)
+{
+ dialogs_show_open_file();
+}
+
+static void cb_func_menu_save(void)
+{
+ on_save1_activate(NULL, NULL);
+}
+
+static void cb_func_menu_saveall(void)
+{
+ on_save_all1_activate(NULL, NULL);
+}
+
+static void cb_func_menu_closeall(void)
+{
+ on_close_all1_activate(NULL, NULL);
+}
+
+static void cb_func_menu_reloadfile(void)
+{
+ on_toolbutton23_clicked(NULL, NULL);
+}
+
+static void cb_func_menu_undo(void)
+{
+ on_undo1_activate(NULL, NULL);
+}
+
+static void cb_func_menu_redo(void)
+{
+ on_redo1_activate(NULL, NULL);
+}
+
+static void cb_func_menu_findnext(void)
+{
+ on_find_next1_activate(NULL, NULL);
+}
+
+static void cb_func_menu_replace(void)
+{
+ dialogs_show_replace();
+}
+
+static void cb_func_menu_preferences(void)
+{
+ dialogs_show_prefs_dialog();
+}
+
+static void cb_func_menu_opencolorchooser(void)
+{
+ dialogs_show_color();
+}
+
+static void cb_func_menu_fullscreen(void)
+{
+ GtkCheckMenuItem *c = GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "menu_fullscreen1"));
+
+ gtk_check_menu_item_set_active(c, ! gtk_check_menu_item_get_active(c));
+}
+
+static void cb_func_menu_zoomin(void)
+{
+ on_zoom_in1_activate(NULL, NULL);
+}
+
+static void cb_func_menu_zoomout(void)
+{
+ on_zoom_out1_activate(NULL, NULL);
+}
+
+static void cb_func_menu_foldall(void)
+{
+ gint idx = document_get_cur_idx();
+ document_fold_all(idx);
+}
+
+static void cb_func_menu_unfoldall(void)
+{
+ gint idx = document_get_cur_idx();
+ document_unfold_all(idx);
+}
+
+static void cb_func_build_compile(void)
+{
+ gint idx = document_get_cur_idx();
+ if (doc_list[idx].file_type->menu_items->can_compile && doc_list[idx].file_name != NULL)
+ on_build_compile_activate(NULL, NULL);
+}
+
+static void cb_func_build_link(void)
+{
+ gint idx = document_get_cur_idx();
+ if (doc_list[idx].file_type->menu_items->can_link && doc_list[idx].file_name != NULL)
+ on_build_build_activate(NULL, NULL);
+}
+
+static void cb_func_build_make(void)
+{
+ gint idx = document_get_cur_idx();
+ if (doc_list[idx].file_name != NULL)
+ on_build_make_activate(NULL, GINT_TO_POINTER(0));
+}
+
+static void cb_func_build_makeowntarget(void)
+{
+ gint idx = document_get_cur_idx();
+ if (doc_list[idx].file_name != NULL)
+ on_build_make_activate(NULL, GINT_TO_POINTER(1));
+}
+
+static void cb_func_build_run(void)
+{
+ gint idx = document_get_cur_idx();
+ if (doc_list[idx].file_type->menu_items->can_exec && doc_list[idx].file_name != NULL)
+ on_build_execute_activate(NULL, GINT_TO_POINTER(0));
+}
+
+static void cb_func_build_run2(void)
+{
+ gint idx = document_get_cur_idx();
+ if (doc_list[idx].file_type->menu_items->can_exec && doc_list[idx].file_name != NULL)
+ on_build_execute_activate(NULL, GINT_TO_POINTER(1));
+}
+
+static void cb_func_build_options(void)
+{
+ gint idx = document_get_cur_idx();
+ if ((doc_list[idx].file_type->menu_items->can_compile ||
+ doc_list[idx].file_type->menu_items->can_link ||
+ doc_list[idx].file_type->menu_items->can_exec) &&
+ doc_list[idx].file_name != NULL)
+ on_build_arguments_activate(NULL, NULL);
+}
+
+static void cb_func_reloadtaglist(void)
+{
+ gint idx = document_get_cur_idx();
+ document_update_tag_list(idx, TRUE);
+}
+
+static void cb_func_switch_editor(void)
+{
+ gint idx = document_get_cur_idx();
+ gtk_widget_grab_focus(GTK_WIDGET(doc_list[idx].sci));
+}
+
+static void cb_func_switch_scribble(void)
+{
+ gtk_notebook_set_current_page(GTK_NOTEBOOK(msgwindow.notebook), MSG_SCRATCH);
+ gtk_widget_grab_focus(lookup_widget(app->window, "textview_scribble"));
+}
+
+static void cb_func_switch_vte(void)
+{
+#ifdef HAVE_VTE
+ gtk_notebook_set_current_page(GTK_NOTEBOOK(msgwindow.notebook), MSG_VTE);
+ gtk_widget_grab_focus(vc->vte);
+#endif
+}
+
+static void cb_func_switch_tableft(void)
+{
+ utils_switch_document(LEFT);
+}
+
+static void cb_func_switch_tabright(void)
+{
+ utils_switch_document(RIGHT);
+}
+
+static void cb_func_edit_duplicateline(void)
+{
+ gint idx = document_get_cur_idx();
+ sci_line_duplicate(doc_list[idx].sci);
+}
+
+static void cb_func_edit_commentline(void)
+{
+ gint idx = document_get_cur_idx();
+ sci_cb_do_comment(idx);
+}
+
+static void cb_func_edit_autocomplete(void)
+{
+ gint idx = document_get_cur_idx();
+ sci_cb_start_auto_complete(doc_list[idx].sci, sci_get_current_position(doc_list[idx].sci));
+}
+
+static void cb_func_edit_calltip(void)
+{
+ gint idx = document_get_cur_idx();
+ sci_cb_show_calltip(doc_list[idx].sci, -1);
+}
+
+static void cb_func_edit_macrolist(void)
+{
+ gint idx = document_get_cur_idx();
+ sci_cb_show_macro_list(doc_list[idx].sci);
+}
+
+static void cb_func_edit_suppresscompletion(void)
+{
+ gint idx = document_get_cur_idx();
+ sci_add_text(doc_list[idx].sci, " ");
+}
+
diff --git a/src/keybindings.h b/src/keybindings.h
new file mode 100644
index 00000000..5cf0173c
--- /dev/null
+++ b/src/keybindings.h
@@ -0,0 +1,95 @@
+/*
+ * keybindings.h - this file is part of Geany, a fast and lightweight IDE
+ *
+ * Copyright 2006 Enrico Troeger
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $Id$
+ */
+
+
+#ifndef GEANY_KEYBINDINGS_H
+#define GEANY_KEYBINDINGS_H 1
+
+// holds all user-definable key bindings
+typedef struct binding
+{
+ guint key;
+ GdkModifierType mods;
+ const gchar *name;
+ // function pointer to a callback function, just to keep the code in keypress event
+ // callback function clear
+ void (*cb_func) (void);
+} binding;
+
+
+enum
+{
+ GEANY_KEYS_MENU_NEW = 0,
+ GEANY_KEYS_MENU_OPEN,
+ GEANY_KEYS_MENU_SAVE,
+ GEANY_KEYS_MENU_SAVEALL,
+ GEANY_KEYS_MENU_CLOSEALL,
+ GEANY_KEYS_MENU_RELOADFILE,
+ GEANY_KEYS_MENU_UNDO,
+ GEANY_KEYS_MENU_REDO,
+ GEANY_KEYS_MENU_FIND_NEXT,
+ GEANY_KEYS_MENU_REPLACE,
+ GEANY_KEYS_MENU_PREFERENCES,
+ GEANY_KEYS_MENU_OPENCOLORCHOOSER,
+ GEANY_KEYS_MENU_FULLSCREEN,
+ GEANY_KEYS_MENU_ZOOMIN,
+ GEANY_KEYS_MENU_ZOOMOUT,
+ GEANY_KEYS_MENU_FOLDALL,
+ GEANY_KEYS_MENU_UNFOLDALL,
+ GEANY_KEYS_BUILD_COMPILE,
+ GEANY_KEYS_BUILD_LINK,
+ GEANY_KEYS_BUILD_MAKE,
+ GEANY_KEYS_BUILD_MAKEOWNTARGET,
+ GEANY_KEYS_BUILD_RUN,
+ GEANY_KEYS_BUILD_RUN2,
+ GEANY_KEYS_BUILD_OPTIONS,
+ GEANY_KEYS_RELOADTAGLIST,
+ GEANY_KEYS_SWITCH_EDITOR,
+ GEANY_KEYS_SWITCH_SCRIBBLE,
+ GEANY_KEYS_SWITCH_VTE,
+ GEANY_KEYS_SWITCH_TABLEFT,
+ GEANY_KEYS_SWITCH_TABRIGHT,
+ GEANY_KEYS_EDIT_DUPLICATELINE,
+ GEANY_KEYS_EDIT_COMMENTLINE,
+ GEANY_KEYS_EDIT_AUTOCOMPLETE,
+ GEANY_KEYS_EDIT_CALLTIP,
+ GEANY_KEYS_EDIT_MACROLIST,
+ GEANY_KEYS_EDIT_SUPPRESSCOMPLETION,
+ GEANY_MAX_KEYS
+};
+
+binding *keys[GEANY_MAX_KEYS];
+
+
+
+void keybindings_init(void);
+
+void keybindings_free(void);
+
+/* just write the content of the keys array to the config file */
+void keybindings_write_to_file(void);
+
+/* central keypress event handler, almost all keypress events go to this function */
+gboolean keybindings_got_event(GtkWidget *widget, GdkEventKey *event, gpointer user_data);
+
+#endif
+
diff --git a/src/main.c b/src/main.c
index 60dbcb64..3f1cab8d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -470,6 +470,7 @@ gint main(gint argc, gchar **argv)
gtk_widget_set_size_request(app->window, GEANY_WINDOW_MINIMAL_WIDTH, GEANY_WINDOW_MINIMAL_HEIGHT);
gtk_window_set_default_size(GTK_WINDOW(app->window), GEANY_WINDOW_DEFAULT_WIDTH, GEANY_WINDOW_DEFAULT_HEIGHT);
configuration_load();
+ keybindings_init();
templates_init();
encodings_init();
document_init_doclist();
@@ -500,7 +501,7 @@ gint main(gint argc, gchar **argv)
dialogs_create_recent_menu();
utils_create_insert_menu_items();
- msgwin_status_add(_("This is %s %s by Enrico Troeger."), PACKAGE, VERSION);
+ msgwin_status_add(_("This is Geany %s."), VERSION);
if (mkdir_result != 0)
msgwin_status_add(_("Configuration directory could not be created (%s)."), g_strerror(mkdir_result));
diff --git a/src/prefs.c b/src/prefs.c
index c171bf0e..1f5b9b3b 100644
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -38,12 +38,26 @@
gint old_tab_width;
gint old_long_line_column;
gchar *old_long_line_color;
+gchar *dialog_key_name;
+static GtkListStore *store = NULL;
+static GtkTreeView *tree = NULL;
+GtkWidget *dialog_label;
+static gboolean edited = FALSE;
+
+static gboolean on_prefs_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);
void prefs_init_dialog(void)
{
GtkWidget *widget;
GdkColor *color;
+ GtkTreeIter iter;
+ guint i;
+ gchar *key_string;
// General settings
widget = lookup_widget(app->prefs_dialog, "spin_mru");
@@ -134,21 +148,6 @@ void prefs_init_dialog(void)
g_free(color);
// Tools Settings
-/* if (app->build_c_cmd)
- gtk_entry_set_text(GTK_ENTRY(lookup_widget(app->prefs_dialog, "entry_com_c")), app->build_c_cmd);
-
- if (app->build_cpp_cmd)
- gtk_entry_set_text(GTK_ENTRY(lookup_widget(app->prefs_dialog, "entry_com_cpp")), app->build_cpp_cmd);
-
- if (app->build_java_cmd)
- gtk_entry_set_text(GTK_ENTRY(lookup_widget(app->prefs_dialog, "entry_com_java")), app->build_java_cmd);
-
- if (app->build_javac_cmd)
- gtk_entry_set_text(GTK_ENTRY(lookup_widget(app->prefs_dialog, "entry_com_javac")), app->build_javac_cmd);
-
- if (app->build_fpc_cmd)
- gtk_entry_set_text(GTK_ENTRY(lookup_widget(app->prefs_dialog, "entry_com_pascal")), app->build_fpc_cmd);
-*/
if (app->build_make_cmd)
gtk_entry_set_text(GTK_ENTRY(lookup_widget(app->prefs_dialog, "entry_com_make")), app->build_make_cmd);
@@ -176,6 +175,43 @@ void prefs_init_dialog(void)
gtk_entry_set_text(GTK_ENTRY(widget), app->pref_template_version);
+ // Keybindings
+ if (store == NULL)
+ {
+ GtkCellRenderer *renderer;
+ GtkTreeViewColumn *column;
+
+ tree = GTK_TREE_VIEW(lookup_widget(app->prefs_dialog, "treeview7"));
+ //g_object_set(tree, "vertical-separator", 6, NULL);
+
+ store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING);
+ gtk_tree_view_set_model(GTK_TREE_VIEW(tree), GTK_TREE_MODEL(store));
+
+ renderer = gtk_cell_renderer_text_new();
+ column = gtk_tree_view_column_new_with_attributes(_("Action"), renderer, "text", 0, NULL);
+ gtk_tree_view_append_column(GTK_TREE_VIEW(tree), column);
+
+ renderer = gtk_cell_renderer_text_new();
+ g_object_set(renderer, "editable", TRUE, NULL);
+ column = gtk_tree_view_column_new_with_attributes(_("Shortcut"), renderer, "text", 1, NULL);
+ gtk_tree_view_append_column(GTK_TREE_VIEW(tree), column);
+
+ 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_signal_connect(G_OBJECT(lookup_widget(app->prefs_dialog, "button2")), "button-press-event",
+ G_CALLBACK(on_prefs_tree_view_button_press_event), NULL);
+ }
+
+ for (i = 0; i < GEANY_MAX_KEYS; i++)
+ {
+ 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);
+ g_free(key_string);
+ }
+
+
#ifdef HAVE_VTE
// VTE settings
if (app->have_vte)
@@ -257,7 +293,7 @@ void on_prefs_button_clicked(GtkDialog *dialog, gint response, gpointer user_dat
widget = lookup_widget(app->prefs_dialog, "radio_tab_right");
app->tab_order_ltr = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
-
+
// Editor settings
widget = lookup_widget(app->prefs_dialog, "spin_tab_width");
@@ -293,26 +329,6 @@ void on_prefs_button_clicked(GtkDialog *dialog, gint response, gpointer user_dat
// Tools Settings
-/* widget = lookup_widget(app->prefs_dialog, "entry_com_c");
- g_free(app->build_c_cmd);
- app->build_c_cmd = g_strdup(gtk_entry_get_text(GTK_ENTRY(widget)));
-
- widget = lookup_widget(app->prefs_dialog, "entry_com_cpp");
- g_free(app->build_cpp_cmd);
- app->build_cpp_cmd = g_strdup(gtk_entry_get_text(GTK_ENTRY(widget)));
-
- widget = lookup_widget(app->prefs_dialog, "entry_com_java");
- g_free(app->build_java_cmd);
- app->build_java_cmd = g_strdup(gtk_entry_get_text(GTK_ENTRY(widget)));
-
- widget = lookup_widget(app->prefs_dialog, "entry_com_javac");
- g_free(app->build_javac_cmd);
- app->build_javac_cmd = g_strdup(gtk_entry_get_text(GTK_ENTRY(widget)));
-
- widget = lookup_widget(app->prefs_dialog, "entry_com_pascal");
- g_free(app->build_fpc_cmd);
- app->build_fpc_cmd = g_strdup(gtk_entry_get_text(GTK_ENTRY(widget)));
-*/
widget = lookup_widget(app->prefs_dialog, "entry_com_make");
g_free(app->build_make_cmd);
app->build_make_cmd = g_strdup(gtk_entry_get_text(GTK_ENTRY(widget)));
@@ -347,6 +363,9 @@ void on_prefs_button_clicked(GtkDialog *dialog, gint response, gpointer user_dat
app->pref_template_version = g_strdup(gtk_entry_get_text(GTK_ENTRY(widget)));
+ // Keybindings
+ if (edited) keybindings_write_to_file();
+
#ifdef HAVE_VTE
// VTE settings
if (app->have_vte)
@@ -430,6 +449,7 @@ void on_prefs_button_clicked(GtkDialog *dialog, gint response, gpointer user_dat
// store all settings
configuration_save();
}
+ gtk_list_store_clear(store);
gtk_widget_hide(GTK_WIDGET(dialog));
}
@@ -508,3 +528,119 @@ void on_prefs_font_choosed(GtkFontButton *widget, gpointer user_data)
}
}
+
+
+static gboolean on_prefs_tree_view_button_press_event(
+ GtkWidget *widget, GdkEventButton *event, gpointer user_data)
+{
+ GtkTreeIter iter;
+ GtkTreeModel *model;
+ GtkTreeSelection *selection;
+ gchar *name;
+
+ // discard click events in the tree unless it is a double click
+ if (widget == (GtkWidget*)tree && event->type != GDK_2BUTTON_PRESS) return FALSE;
+
+ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree));
+ if (gtk_tree_selection_get_selected(selection, &model, &iter))
+ {
+ gtk_tree_model_get(model, &iter, 0, &name, -1);
+ if (name != NULL)
+ {
+ GtkWidget *dialog;
+ GtkWidget *label;
+ gchar *str;
+
+ dialog = gtk_dialog_new_with_buttons(_("Grab key"), GTK_WINDOW(app->prefs_dialog),
+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL);
+
+ str = g_strdup_printf(_("Type the combination of the keys you want to use for \"%s\""), name);
+ label = gtk_label_new(str);
+ gtk_misc_set_padding(GTK_MISC(label), 5, 10);
+ gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), label);
+
+ dialog_label = gtk_label_new("");
+ gtk_misc_set_padding(GTK_MISC(dialog_label), 5, 10);
+ gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), dialog_label);
+
+ g_signal_connect(G_OBJECT(dialog), "key-press-event", G_CALLBACK(on_keytype_dialog_response), NULL);
+ g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(on_dialog_response), NULL);
+ g_signal_connect(G_OBJECT(dialog), "close", G_CALLBACK(gtk_widget_destroy), NULL);
+
+ // copy name to global variable to hold it, will be freed in on_dialog_response()
+ dialog_key_name = g_strdup(name);
+
+ gtk_widget_show_all(dialog);
+ g_free(str);
+ g_free(name);
+ }
+ }
+ return TRUE;
+}
+
+
+static void on_cell_edited(GtkCellRendererText *cellrenderertext, gchar *path, gchar *new_text, gpointer user_data)
+{
+ if (path != NULL && new_text != NULL)
+ {
+ guint idx;
+ gchar *test;
+ GtkTreeIter iter;
+
+ // get the index of the shortcut
+ idx = strtol(path, &test, 10);
+ if (test == path) return;
+
+ gtk_accelerator_parse(new_text, &(keys[idx]->key), &(keys[idx]->mods));
+
+ gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(store), &iter, path);
+ gtk_list_store_set(store, &iter, 1, new_text, -1);
+
+ edited = TRUE;
+ }
+}
+
+
+
+static gboolean on_keytype_dialog_response(GtkWidget *dialog, GdkEventKey *event, gpointer user_data)
+{
+ gchar *str;
+
+ // ignore numlock key, not necessary but nice
+ if (event->state & GDK_MOD2_MASK) event->state -= GDK_MOD2_MASK;
+
+ str = gtk_accelerator_name(event->keyval, event->state);
+
+ gtk_label_set_text(GTK_LABEL(dialog_label), str);
+ g_free(str);
+
+ return TRUE;
+}
+
+
+static void on_dialog_response(GtkWidget *dialog, gint response, gpointer user_data)
+{
+ if (response == GTK_RESPONSE_ACCEPT)
+ {
+ GtkTreeIter iter;
+ guint idx;
+ gchar path[3];
+
+ for (idx = 0; idx < GEANY_MAX_KEYS; idx++)
+ {
+ if (utils_strcmp(dialog_key_name, keys[idx]->name)) break;
+ }
+
+ gtk_accelerator_parse(gtk_label_get_text(GTK_LABEL(dialog_label)), &(keys[idx]->key), &(keys[idx]->mods));
+
+ // generate the path, it is exactly the index
+ g_snprintf(path, 3, "%d", idx);
+ gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(store), &iter, path);
+ gtk_list_store_set(store, &iter, 1, gtk_label_get_text(GTK_LABEL(dialog_label)), -1);
+ g_free(dialog_key_name);
+
+ edited = TRUE;
+ }
+ gtk_widget_destroy(dialog);
+}