Commit f731cb66 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

skip actions if their name starts with '<' (menu actions created by

2005-09-17  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpactionview.c (gimp_action_view_new): skip
	actions if their name starts with '<' (menu actions created by
	plug-ins have names like "<Image>/Foo/Bar"). Scroll the
	pre-selected action to the center of the view, not to the top.

	* app/widgets/gimpcontrollereditor.c
	(gimp_controller_editor_edit_clicked): make the action editor
	transient to the controller editor. Show the edited event's name
	in the controller editor's header.

	* app/widgets/gimpcontrollerwheel.c: use gimp_get_mod_string()
	instead of hardcoding the modifiers in tons of translatable
	strings. Don't call gettext() in GimpController::get_blurb(),
	the strings are already translated.

	* app/widgets/gimpcontrollerkeyboard.c: removed call to gettext()
	here too.
parent bc4afa6c
2005-09-17 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpactionview.c (gimp_action_view_new): skip
actions if their name starts with '<' (menu actions created by
plug-ins have names like "<Image>/Foo/Bar"). Scroll the
pre-selected action to the center of the view, not to the top.
* app/widgets/gimpcontrollereditor.c
(gimp_controller_editor_edit_clicked): make the action editor
transient to the controller editor. Show the edited event's name
in the controller editor's header.
* app/widgets/gimpcontrollerwheel.c: use gimp_get_mod_string()
instead of hardcoding the modifiers in tons of translatable
strings. Don't call gettext() in GimpController::get_blurb(),
the strings are already translated.
* app/widgets/gimpcontrollerkeyboard.c: removed call to gettext()
here too.
2005-09-16 Sven Neumann <sven@gimp.org>
* app/tools/gimpimagemaptool.c (gimp_image_map_tool_initialize):
......
......@@ -256,7 +256,9 @@ gimp_action_view_new (GimpUIManager *manager,
GClosure *accel_closure = NULL;
GtkTreeIter action_iter;
if (strstr (name, "-menu") || strstr (name, "-popup"))
if (strstr (name, "-menu") ||
strstr (name, "-popup") ||
name[0] == '<')
continue;
g_object_get (action,
......@@ -403,7 +405,7 @@ gimp_action_view_new (GimpUIManager *manager,
gtk_tree_selection_select_path (sel, select_path);
gtk_tree_view_scroll_to_cell (view, select_path, NULL,
FALSE, 0.0, 0.0);
TRUE, 0.5, 0.0);
gtk_tree_path_free (select_path);
gtk_tree_path_free (expand);
......
......@@ -665,6 +665,7 @@ gimp_controller_editor_edit_clicked (GtkWidget *button,
GtkTreeModel *model;
GtkTreeIter iter;
gchar *event_name = NULL;
gchar *event_blurb = NULL;
gchar *action_name = NULL;
gimp_controller_info_set_event_snooper (editor->info, NULL, NULL);
......@@ -672,6 +673,7 @@ gimp_controller_editor_edit_clicked (GtkWidget *button,
if (gtk_tree_selection_get_selected (editor->sel, &model, &iter))
gtk_tree_model_get (model, &iter,
COLUMN_EVENT, &event_name,
COLUMN_BLURB, &event_blurb,
COLUMN_ACTION, &action_name,
-1);
......@@ -679,14 +681,18 @@ gimp_controller_editor_edit_clicked (GtkWidget *button,
{
GtkWidget *scrolled_window;
GtkWidget *view;
gchar *title;
title = g_strdup_printf (_("Select Action for Event '%s'"),
event_blurb);
editor->edit_dialog =
gimp_viewable_dialog_new (GIMP_VIEWABLE (editor->info),
_("Select Controller Event Action"),
"gimp-controller-action-dialog",
GIMP_STOCK_EDIT,
_("Select Controller Event Action"),
GTK_WIDGET (editor),
title,
gtk_widget_get_toplevel (GTK_WIDGET (editor)),
gimp_standard_help_func,
GIMP_HELP_PREFS_INPUT_CONTROLLERS,
......@@ -695,6 +701,8 @@ gimp_controller_editor_edit_clicked (GtkWidget *button,
NULL);
g_free (title);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (editor->edit_dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
......
......@@ -278,7 +278,7 @@ gimp_controller_keyboard_get_event_blurb (GimpController *controller,
if (event_id < 0 || event_id >= G_N_ELEMENTS (keyboard_events))
return NULL;
return gettext (keyboard_events[event_id].blurb);
return keyboard_events[event_id].blurb;
}
gboolean
......
......@@ -30,6 +30,7 @@
#include "gimpcontrollerwheel.h"
#include "gimphelp-ids.h"
#include "gimpwidgets-utils.h"
#include "gimp-intl.h"
......@@ -41,7 +42,7 @@ struct _WheelEvent
GdkScrollDirection direction;
GdkModifierType modifiers;
const gchar *name;
const gchar *blurb;
gchar *blurb;
};
......@@ -61,104 +62,104 @@ static const gchar * gimp_controller_wheel_get_event_blurb (GimpController *cont
static GimpControllerClass *parent_class = NULL;
static const WheelEvent wheel_events[] =
static WheelEvent wheel_events[] =
{
{ GDK_SCROLL_UP, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-up-shift-control-alt",
N_("Scroll Up (Shift + Control + Alt)") },
N_("Scroll Up") },
{ GDK_SCROLL_UP, GDK_MOD1_MASK | GDK_CONTROL_MASK,
"scroll-up-control-alt",
N_("Scroll Up (Control + Alt)") },
N_("Scroll Up") },
{ GDK_SCROLL_UP, GDK_MOD1_MASK | GDK_SHIFT_MASK,
"scroll-up-shift-alt",
N_("Scroll Up (Shift + Alt)") },
N_("Scroll Up") },
{ GDK_SCROLL_UP, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-up-shift-control",
N_("Scroll Up (Shift + Control)") },
N_("Scroll Up") },
{ GDK_SCROLL_UP, GDK_MOD1_MASK,
"scroll-up-alt",
N_("Scroll Up (Alt)") },
N_("Scroll Up") },
{ GDK_SCROLL_UP, GDK_CONTROL_MASK,
"scroll-up-control",
N_("Scroll Up (Control)") },
N_("Scroll Up") },
{ GDK_SCROLL_UP, GDK_SHIFT_MASK,
"scroll-up-shift",
N_("Scroll Up (Shift)") },
N_("Scroll Up") },
{ GDK_SCROLL_UP, 0,
"scroll-up",
N_("Scroll Up") },
{ GDK_SCROLL_DOWN, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-down-shift-control-alt",
N_("Scroll Down (Shift + Control + Alt)") },
N_("Scroll Down") },
{ GDK_SCROLL_DOWN, GDK_MOD1_MASK | GDK_CONTROL_MASK,
"scroll-down-control-alt",
N_("Scroll Down (Control + Alt)") },
N_("Scroll Down") },
{ GDK_SCROLL_DOWN, GDK_MOD1_MASK | GDK_SHIFT_MASK,
"scroll-down-shift-alt",
N_("Scroll Down (Shift + Alt)") },
N_("Scroll Down") },
{ GDK_SCROLL_DOWN, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-down-shift-control",
N_("Scroll Down (Shift + Control)") },
N_("Scroll Down") },
{ GDK_SCROLL_DOWN, GDK_MOD1_MASK,
"scroll-down-alt",
N_("Scroll Down (Alt)") },
N_("Scroll Down") },
{ GDK_SCROLL_DOWN, GDK_CONTROL_MASK,
"scroll-down-control",
N_("Scroll Down (Control)") },
N_("Scroll Down") },
{ GDK_SCROLL_DOWN, GDK_SHIFT_MASK,
"scroll-down-shift",
N_("Scroll Down (Shift)") },
N_("Scroll Down") },
{ GDK_SCROLL_DOWN, 0,
"scroll-down",
N_("Scroll Down") },
{ GDK_SCROLL_LEFT, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-left-shift-control-alt",
N_("Scroll Left (Shift + Control + Alt)") },
N_("Scroll Left") },
{ GDK_SCROLL_LEFT, GDK_MOD1_MASK | GDK_CONTROL_MASK,
"scroll-left-control-alt",
N_("Scroll Left (Control + Alt)") },
N_("Scroll Left") },
{ GDK_SCROLL_LEFT, GDK_MOD1_MASK | GDK_SHIFT_MASK,
"scroll-left-shift-alt",
N_("Scroll Left (Shift + Alt)") },
N_("Scroll Left") },
{ GDK_SCROLL_LEFT, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-left-shift-control",
N_("Scroll Left (Shift + Control)") },
N_("Scroll Left") },
{ GDK_SCROLL_LEFT, GDK_MOD1_MASK,
"scroll-left-alt",
N_("Scroll Left (Alt)") },
N_("Scroll Left") },
{ GDK_SCROLL_LEFT, GDK_CONTROL_MASK,
"scroll-left-control",
N_("Scroll Left (Control)") },
N_("Scroll Left") },
{ GDK_SCROLL_LEFT, GDK_SHIFT_MASK,
"scroll-left-shift",
N_("Scroll Left (Shift)") },
N_("Scroll Left") },
{ GDK_SCROLL_LEFT, 0,
"scroll-left",
N_("Scroll Left") },
{ GDK_SCROLL_RIGHT, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-right-shift-control-alt",
N_("Scroll Right (Shift + Control + Alt)") },
N_("Scroll Right") },
{ GDK_SCROLL_RIGHT, GDK_MOD1_MASK | GDK_CONTROL_MASK,
"scroll-right-control-alt",
N_("Scroll Right (Control + Alt)") },
N_("Scroll Right") },
{ GDK_SCROLL_RIGHT, GDK_MOD1_MASK | GDK_SHIFT_MASK,
"scroll-right-shift-alt",
N_("Scroll Right (Shift + Alt)") },
N_("Scroll Right") },
{ GDK_SCROLL_RIGHT, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"scroll-right-shift-control",
N_("Scroll Right (Shift + Control)") },
N_("Scroll Right") },
{ GDK_SCROLL_RIGHT, GDK_MOD1_MASK,
"scroll-right-alt",
N_("Scroll Right (Alt)") },
N_("Scroll Right") },
{ GDK_SCROLL_RIGHT, GDK_CONTROL_MASK,
"scroll-right-control",
N_("Scroll Right (Control)") },
N_("Scroll Right") },
{ GDK_SCROLL_RIGHT, GDK_SHIFT_MASK,
"scroll-right-shift",
N_("Scroll Right (Shift)") },
N_("Scroll Right") },
{ GDK_SCROLL_RIGHT, 0,
"scroll-right",
N_("Scroll Right") }
......@@ -214,6 +215,26 @@ gimp_controller_wheel_class_init (GimpControllerWheelClass *klass)
static void
gimp_controller_wheel_init (GimpControllerWheel *wheel)
{
static gboolean event_names_initialized = FALSE;
if (! event_names_initialized)
{
gint i;
for (i = 0; i < G_N_ELEMENTS (wheel_events); i++)
{
WheelEvent *wevent = &wheel_events[i];
if (wevent->modifiers != 0)
{
wevent->blurb =
g_strdup_printf ("%s (%s)", gettext (wevent->blurb),
gimp_get_mod_string (wevent->modifiers));
}
}
event_names_initialized = TRUE;
}
}
static GObject *
......@@ -256,7 +277,7 @@ gimp_controller_wheel_get_event_blurb (GimpController *controller,
if (event_id < 0 || event_id >= G_N_ELEMENTS (wheel_events))
return NULL;
return gettext (wheel_events[event_id].blurb);
return wheel_events[event_id].blurb;
}
gboolean
......
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