~ubuntu-branches/ubuntu/utopic/inkscape/utopic-proposed

« back to all changes in this revision

Viewing changes to src/verbs.cpp

Tags: upstream-0.48.0
ImportĀ upstreamĀ versionĀ 0.48.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
#include "selection-chemistry.h"
64
64
#include "seltrans.h"
65
65
#include "shape-editor.h"
66
 
#include "shortcuts.h"
67
66
#include "sp-flowtext.h"
68
67
#include "sp-guide.h"
69
68
#include "splivarot.h"
335
334
    in the \c _verbs hashtable which is indexed by the \c code.
336
335
*/
337
336
Verb::Verb(gchar const *id, gchar const *name, gchar const *tip, gchar const *image) :
338
 
    _actions(0),
339
 
    _id(id),
340
 
    _name(name),
341
 
    _tip(tip),
342
 
    _full_tip(0),
343
 
    _image(image),
344
 
    _code(0),
345
 
    _default_sensitive(false)
 
337
    _actions(NULL), _id(id), _name(name), _tip(tip), _image(image)
346
338
{
347
339
    static int count = SP_VERB_LAST;
348
340
 
350
342
    _code = count;
351
343
    _verbs.insert(VerbTable::value_type(count, this));
352
344
    _verb_ids.insert(VerbIDTable::value_type(_id, this));
 
345
 
 
346
    return;
353
347
}
354
348
 
355
349
/** \brief  Destroy a verb.
363
357
    if (_actions != NULL) {
364
358
        delete _actions;
365
359
    }
366
 
    if (_full_tip) {
367
 
        g_free(_full_tip);
368
 
        _full_tip = 0;
369
 
    }
370
360
 
 
361
    return;
371
362
}
372
363
 
373
364
/** \brief  Verbs are no good without actions.  This is a place holder
637
628
}
638
629
 
639
630
/** \brief Accessor to get the tooltip for verb as localised string */
640
 
gchar const *Verb::get_tip(void)
 
631
gchar const *
 
632
Verb::get_tip (void)
641
633
{
642
 
    gchar const *result = 0;
643
 
    if (_tip) {
644
 
        unsigned int shortcut = sp_shortcut_get_primary(this);
645
 
        if ( (shortcut != _shortcut) || !_full_tip) {
646
 
            if (_full_tip) {
647
 
                g_free(_full_tip);
648
 
                _full_tip = 0;
649
 
            }
650
 
            _shortcut = shortcut;
651
 
            gchar* shortcutString = sp_shortcut_get_label(shortcut);
652
 
            if (shortcutString) {
653
 
                _full_tip = g_strdup_printf("%s (%s)", _(_tip), shortcutString);
654
 
                g_free(shortcutString);
655
 
                shortcutString = 0;
656
 
            } else {
657
 
                _full_tip = g_strdup(_(_tip));
658
 
            }
659
 
        }
660
 
        result = _full_tip;
661
 
    }
662
 
 
663
 
    return result;
 
634
        return _(_tip);
664
635
}
665
636
 
666
637
void
2325
2296
                 N_("Deselect any selected objects or nodes"), INKSCAPE_ICON_EDIT_SELECT_NONE),
2326
2297
    new EditVerb(SP_VERB_EDIT_GUIDES_AROUND_PAGE, "EditGuidesAroundPage", N_("_Guides Around Page"),
2327
2298
                 N_("Create four guides aligned with the page borders"), NULL),
2328
 
    new EditVerb(SP_VERB_EDIT_NEXT_PATHEFFECT_PARAMETER, "EditNextPathEffectParameter", N_("Next path effect parameter"),
2329
 
                 N_("Show next editable path effect parameter"), INKSCAPE_ICON_PATH_EFFECT_PARAMETER_NEXT),
 
2299
    new EditVerb(SP_VERB_EDIT_NEXT_PATHEFFECT_PARAMETER, "EditNextPathEffectParameter", N_("Next Path Effect Parameter"),
 
2300
                 N_("Show next Path Effect parameter for editing"), INKSCAPE_ICON_PATH_EFFECT_PARAMETER_NEXT),
2330
2301
 
2331
2302
    /* Selection */
2332
2303
    new SelectionVerb(SP_VERB_SELECTION_TO_FRONT, "SelectionToFront", N_("Raise to _Top"),
2570
2541
    new ZoomVerb(SP_VERB_TOGGLE_SCROLLBARS, "ToggleScrollbars", N_("Scroll_bars"), N_("Show or hide the canvas scrollbars"), NULL),
2571
2542
    new ZoomVerb(SP_VERB_TOGGLE_GRID, "ToggleGrid", N_("_Grid"), N_("Show or hide the grid"), INKSCAPE_ICON_SHOW_GRID),
2572
2543
    new ZoomVerb(SP_VERB_TOGGLE_GUIDES, "ToggleGuides", N_("G_uides"), N_("Show or hide guides (drag from a ruler to create a guide)"), INKSCAPE_ICON_SHOW_GUIDES),
2573
 
    new ZoomVerb(SP_VERB_TOGGLE_SNAPPING, "ToggleSnapGlobal", N_("Snap"), N_("Enable snapping"), INKSCAPE_ICON_SNAP),
 
2544
    new ZoomVerb(SP_VERB_TOGGLE_SNAPPING, "ToggleSnapGlobal", N_("Snap"), N_("Toggle snapping on or off"), INKSCAPE_ICON_SNAP),
2574
2545
    new ZoomVerb(SP_VERB_ZOOM_NEXT, "ZoomNext", N_("Nex_t Zoom"), N_("Next zoom (from the history of zooms)"),
2575
2546
                 INKSCAPE_ICON_ZOOM_NEXT),
2576
2547
    new ZoomVerb(SP_VERB_ZOOM_PREV, "ZoomPrev", N_("Pre_vious Zoom"), N_("Previous zoom (from the history of zooms)"),