Code

Changed how tooltips for verbs are fetched to display translated versions correctly...
authormfloryan <mfloryan@users.sourceforge.net>
Fri, 22 Feb 2008 13:37:48 +0000 (13:37 +0000)
committermfloryan <mfloryan@users.sourceforge.net>
Fri, 22 Feb 2008 13:37:48 +0000 (13:37 +0000)
src/ink-action.cpp
src/verbs.cpp
src/verbs.h
src/widgets/toolbox.cpp

index 418a9ce4f914b304bbfdf1f037d89f2564416088..c09cade057cb121da51bbd9eff0a6fbad2262e2b 100644 (file)
@@ -116,6 +116,7 @@ static void ink_action_finalize( GObject* obj )
 
 }
 
+//Any strings passed in should already be localised
 InkAction* ink_action_new( const gchar *name,
                            const gchar *label,
                            const gchar *tooltip,
index 95d44483e1eb9988a9eae801f4b550fd1f9d2964..2902a4a2f9c89136384501b753862c5684ce6851 100644 (file)
@@ -625,6 +625,12 @@ Verb::sensitive(SPDocument *in_doc, bool in_sensitive)
     return;
 }
 
+/** \brief Accessor to get the tooltip for verb as localised string */ 
+gchar const *
+Verb::get_tip (void) 
+{
+       return _(_tip); 
+}
 
 void
 Verb::name(SPDocument *in_doc, Glib::ustring in_name)
index 52f69e54e94d2722ecb84b2dccc4b34fc49b1b6f..b754d3807d440d21a6e6811be97027ce8a1c779b 100644 (file)
@@ -341,7 +341,7 @@ public:
     /** \brief Accessor to get the internal variable. */
     gchar const * get_name (void) { return _name; }
     /** \brief Accessor to get the internal variable. */
-    gchar const * get_tip (void) { return _tip; }
+    gchar const * get_tip (void) ;
     /** \brief Accessor to get the internal variable. */
     gchar const * get_image (void) { return _image; }
 
index 1063ce2a19b0e250245e25785113d60f8a681177..8cdf0a07fcee4869fb4a1fe4cddb09f19670a4cc 100644 (file)
@@ -507,7 +507,7 @@ static GtkAction* create_action_for_verb( Inkscape::Verb* verb, Inkscape::UI::Vi
     GtkAction* act = 0;
 
     SPAction* targetAction = verb->get_action(view);
-    InkAction* inky = ink_action_new( verb->get_id(), verb->get_name(), _(verb->get_tip()), verb->get_image(), size  );
+    InkAction* inky = ink_action_new( verb->get_id(), _(verb->get_name()), verb->get_tip(), verb->get_image(), size  );
     act = GTK_ACTION(inky);
     gtk_action_set_sensitive( act, targetAction->sensitive );