Kaydet (Commit) a0da812c authored tarafından Nick Treleaven's avatar Nick Treleaven

Add keybindings for Next Message and Next Error commands.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1077 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 0dfb4736
......@@ -7,6 +7,8 @@
Windows it can be later than expected (closes #1611530).
* src/keybindings.c:
Show the Message window when switching to the vte.
* src/build.c, src/keybindings.c, src/keybindings.h:
Add keybindings for Next Message and Next Error commands.
2006-12-08 Nick Treleaven <nick.treleaven@btinternet.com>
......
......@@ -883,6 +883,7 @@ static void create_build_menu_gen(BuildMenuItems *menu_items)
// next error
item = gtk_image_menu_item_new_with_mnemonic(_("_Next Error"));
gtk_widget_show(item);
GEANY_ADD_WIDGET_ACCEL(GEANY_KEYS_BUILD_NEXTERROR, item);
gtk_container_add(GTK_CONTAINER(menu), item);
g_signal_connect((gpointer) item, "activate", G_CALLBACK(on_build_next_error), NULL);
menu_items->item_next_error = item;
......@@ -938,9 +939,7 @@ static void create_build_menu_tex(BuildMenuItems *menu_items)
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);
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);
GEANY_ADD_WIDGET_ACCEL(GEANY_KEYS_BUILD_COMPILE, item);
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);
......@@ -953,9 +952,7 @@ static void create_build_menu_tex(BuildMenuItems *menu_items)
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);
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);
GEANY_ADD_WIDGET_ACCEL(GEANY_KEYS_BUILD_LINK, item);
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);
......@@ -997,6 +994,7 @@ static void create_build_menu_tex(BuildMenuItems *menu_items)
// next error
item = gtk_image_menu_item_new_with_mnemonic(_("_Next Error"));
gtk_widget_show(item);
GEANY_ADD_WIDGET_ACCEL(GEANY_KEYS_BUILD_NEXTERROR, item);
gtk_container_add(GTK_CONTAINER(menu), item);
g_signal_connect((gpointer) item, "activate", G_CALLBACK(on_build_next_error), NULL);
menu_items->item_next_error = item;
......@@ -1010,9 +1008,7 @@ static void create_build_menu_tex(BuildMenuItems *menu_items)
item = gtk_image_menu_item_new_with_mnemonic(LATEX_VIEW_DVI_LABEL);
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(menu), item);
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);
GEANY_ADD_WIDGET_ACCEL(GEANY_KEYS_BUILD_RUN, item);
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);
......@@ -1025,9 +1021,7 @@ static void create_build_menu_tex(BuildMenuItems *menu_items)
item = gtk_image_menu_item_new_with_mnemonic(_("View PDF file"));
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(menu), item);
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);
GEANY_ADD_WIDGET_ACCEL(GEANY_KEYS_BUILD_RUN2, item);
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);
......@@ -1045,9 +1039,7 @@ static void create_build_menu_tex(BuildMenuItems *menu_items)
// 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);
GEANY_ADD_WIDGET_ACCEL(GEANY_KEYS_BUILD_OPTIONS, item);
gtk_container_add(GTK_CONTAINER(menu), item);
gtk_tooltips_set_tip(tooltips, item,
_("Sets the program paths and arguments"), NULL);
......
......@@ -65,6 +65,7 @@ static void cb_func_menu_findnext(guint key_id);
static void cb_func_menu_findprevious(guint key_id);
static void cb_func_menu_replace(guint key_id);
static void cb_func_menu_findinfiles(guint key_id);
static void cb_func_menu_nextmessage(guint key_id);
static void cb_func_menu_gotoline(guint key_id);
static void cb_func_menu_opencolorchooser(guint key_id);
static void cb_func_menu_fullscreen(guint key_id);
......@@ -136,6 +137,8 @@ void keybindings_init(void)
GDK_e, GDK_CONTROL_MASK, "menu_replace", _("Replace"));
keys[GEANY_KEYS_MENU_FINDINFILES] = fill(cb_func_menu_findinfiles, GDK_f,
GDK_CONTROL_MASK | GDK_SHIFT_MASK, "menu_findinfiles", _("Find in files"));
keys[GEANY_KEYS_MENU_NEXTMESSAGE] = fill(cb_func_menu_nextmessage,
0, 0, "menu_nextmessage", _("Next Message"));
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,
......@@ -167,6 +170,8 @@ void keybindings_init(void)
_("Make custom target"));
keys[GEANY_KEYS_BUILD_MAKEOBJECT] = fill(cb_func_build_action,
0, 0, "build_makeobject", _("Make object"));
keys[GEANY_KEYS_BUILD_NEXTERROR] = fill(cb_func_build_action,
0, 0, "build_nexterror", _("Next error"));
keys[GEANY_KEYS_BUILD_RUN] = fill(cb_func_build_action,
GDK_F5, 0, "build_run", _("Run"));
keys[GEANY_KEYS_BUILD_RUN2] = fill(cb_func_build_action,
......@@ -283,6 +288,7 @@ static void keybindings_add_accels()
GEANY_ADD_ACCEL(GEANY_KEYS_MENU_FINDPREVIOUS, find_previous1);
GEANY_ADD_ACCEL(GEANY_KEYS_MENU_REPLACE, replace1);
GEANY_ADD_ACCEL(GEANY_KEYS_MENU_FINDINFILES, find_in_files1);
GEANY_ADD_ACCEL(GEANY_KEYS_MENU_NEXTMESSAGE, next_message1);
GEANY_ADD_ACCEL(GEANY_KEYS_MENU_GOTOLINE, go_to_line1);
GEANY_ADD_ACCEL(GEANY_KEYS_MENU_FULLSCREEN, menu_fullscreen1);
GEANY_ADD_ACCEL(GEANY_KEYS_MENU_MESSAGEWINDOW, menu_show_messages_window1);
......@@ -516,6 +522,11 @@ static void cb_func_menu_findinfiles(G_GNUC_UNUSED guint key_id)
on_find_in_files1_activate(NULL, NULL);
}
static void cb_func_menu_nextmessage(guint key_id)
{
on_next_message1_activate(NULL, NULL);
}
static void cb_func_menu_gotoline(G_GNUC_UNUSED guint key_id)
{
on_go_to_line1_activate(NULL, NULL);
......@@ -599,6 +610,10 @@ static void cb_func_build_action(guint key_id)
item = menu_items->item_make_object;
break;
case GEANY_KEYS_BUILD_NEXTERROR:
item = menu_items->item_next_error;
break;
case GEANY_KEYS_BUILD_RUN:
item = menu_items->item_exec;
break;
......
......@@ -60,6 +60,7 @@ enum
GEANY_KEYS_MENU_FINDPREVIOUS,
GEANY_KEYS_MENU_REPLACE,
GEANY_KEYS_MENU_FINDINFILES,
GEANY_KEYS_MENU_NEXTMESSAGE,
GEANY_KEYS_MENU_GOTOLINE,
GEANY_KEYS_MENU_OPENCOLORCHOOSER,
GEANY_KEYS_MENU_FULLSCREEN,
......@@ -75,6 +76,7 @@ enum
GEANY_KEYS_BUILD_MAKE,
GEANY_KEYS_BUILD_MAKEOWNTARGET,
GEANY_KEYS_BUILD_MAKEOBJECT,
GEANY_KEYS_BUILD_NEXTERROR,
GEANY_KEYS_BUILD_RUN,
GEANY_KEYS_BUILD_RUN2,
GEANY_KEYS_BUILD_OPTIONS,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment