From be519f62404daf6dff2449a2eb5280d998298868 Mon Sep 17 00:00:00 2001 From: Jasper van de Gronde Date: Mon, 6 Sep 2010 19:32:05 +0200 Subject: Automatically add shortcuts to tooltips (bzr r9745) --- src/widgets/toolbox.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/widgets/toolbox.cpp') diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index bdf1e6ff2..f6a6735e9 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -827,14 +827,14 @@ GtkWidget * sp_toolbox_button_new_from_verb_with_doubleclick(GtkWidget *t, Inksc unsigned int shortcut = sp_shortcut_get_primary(verb); - if (shortcut) { - gchar key[256]; - sp_ui_shortcut_string(shortcut, key); + if (shortcut!=GDK_VoidSymbol) { + gchar* key = sp_shortcut_get_label(shortcut); gchar *tip = g_strdup_printf ("%s (%s)", action->tip, key); if ( t ) { gtk_toolbar_append_widget( GTK_TOOLBAR(t), b, tip, 0 ); } g_free(tip); + g_free(key); } else { if ( t ) { gtk_toolbar_append_widget( GTK_TOOLBAR(t), b, action->tip, 0 ); -- cgit v1.2.3 From 7f08f1569225671ff9c4ef4dc04edc405bf0d5bf Mon Sep 17 00:00:00 2001 From: Jasper van de Gronde Date: Tue, 7 Sep 2010 10:35:34 +0200 Subject: Connected two toolbar buttons with the associated verbs (bzr r9747) --- src/widgets/toolbox.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/widgets/toolbox.cpp') diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index f6a6735e9..f6af1ca55 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -303,7 +303,7 @@ static gchar const * ui_descr = " " " " " " - " " + " " " " " " " " @@ -1500,9 +1500,10 @@ static void sp_node_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions } { - InkAction* inky = ink_action_new( "EditNextLPEParameterAction", - _("Next path effect parameter"), - _("Show next editable path effect parameter"), + Inkscape::Verb* verb = Inkscape::Verb::get(SP_VERB_EDIT_NEXT_PATHEFFECT_PARAMETER); + InkAction* inky = ink_action_new( verb->get_id(), + verb->get_name(), + verb->get_tip(), INKSCAPE_ICON_PATH_EFFECT_PARAMETER_NEXT, secondarySize ); g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_node_path_edit_nextLPEparam), desktop ); @@ -2175,8 +2176,13 @@ void setup_snap_toolbox(GtkWidget *toolbox, SPDesktop *desktop) Inkscape::IconSize secondarySize = ToolboxFactory::prefToSize("/toolbox/secondary", 1); { - InkToggleAction* act = ink_toggle_action_new("ToggleSnapGlobal", - _("Snap"), _("Enable snapping"), INKSCAPE_ICON_SNAP, secondarySize, + // TODO: This is a cludge. On the one hand we have verbs+actions, + // on the other we have all these explicit callbacks specified here. + // We should really unify these (should save some lines of code as well). + // For example, this action could be based on the verb(+action) + PrefsPusher. + Inkscape::Verb* verb = Inkscape::Verb::get(SP_VERB_TOGGLE_SNAPPING); + InkToggleAction* act = ink_toggle_action_new(verb->get_id(), + verb->get_name(), verb->get_tip(), INKSCAPE_ICON_SNAP, secondarySize, SP_ATTR_INKSCAPE_SNAP_GLOBAL); gtk_action_group_add_action( mainActions->gobj(), GTK_ACTION( act ) ); -- cgit v1.2.3 From 43910107bd13f3968d48d955a81bb787942af865 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Fri, 29 Oct 2010 00:49:37 -0700 Subject: Cleanups from backports. (bzr r9863) --- src/widgets/toolbox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/widgets/toolbox.cpp') diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index f6af1ca55..f7c493915 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -827,8 +827,8 @@ GtkWidget * sp_toolbox_button_new_from_verb_with_doubleclick(GtkWidget *t, Inksc unsigned int shortcut = sp_shortcut_get_primary(verb); - if (shortcut!=GDK_VoidSymbol) { - gchar* key = sp_shortcut_get_label(shortcut); + if (shortcut != GDK_VoidSymbol) { + gchar *key = sp_shortcut_get_label(shortcut); gchar *tip = g_strdup_printf ("%s (%s)", action->tip, key); if ( t ) { gtk_toolbar_append_widget( GTK_TOOLBAR(t), b, tip, 0 ); -- cgit v1.2.3 From 144819c918dc761641c3cb5a490205fb73194ee3 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Wed, 17 Nov 2010 13:12:56 +1100 Subject: Super duper mega (fun!) commit: replaced encoding=utf-8 with fileencoding=utf-8 in all 1074 Vim modelines. The reason for this is that (a) setting the encoding isn't nice, and (b) Vim 7.3 (with modeline enabled) disallows it and pops up an error whenever you open any file with it ("invalid modeline"). Also corrected five deviant modestrings: * src/ui/widget/dock.cpp and src/ui/widget/dock.h: missing colon at the end * src/ui/dialog/tile.cpp: removed gratuitous second colon at the end * src/helper/units-test.h: removed gratuitous space before a colon * share/extensions/export_gimp_palette.py: missing textwidth=99 That's my geekiest commit yet. (bzr r9900) --- src/widgets/toolbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets/toolbox.cpp') diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index f7c493915..9a2fc8dd2 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -8467,4 +8467,4 @@ static void sp_paintbucket_toolbox_prep(SPDesktop *desktop, GtkActionGroup* main fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : -- cgit v1.2.3