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

« back to all changes in this revision

Viewing changes to src/widgets/desktop-widget.cpp

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

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
#include <extension/db.h>
42
42
#include "file.h"
43
43
#include "helper/units.h"
44
 
#include "helper/unit-tracker.h"
45
44
#include "inkscape-private.h"
46
45
#include "interface.h"
47
46
#include "macros.h"
70
69
using Inkscape::round;
71
70
#endif
72
71
 
73
 
using Inkscape::UnitTracker;
 
72
 
74
73
using Inkscape::UI::UXManager;
75
74
using Inkscape::UI::ToolboxFactory;
76
75
 
326
325
    dtw->hbox = gtk_hbox_new(FALSE, 0);
327
326
    gtk_box_pack_end( GTK_BOX (dtw->vbox), dtw->hbox, TRUE, TRUE, 0 );
328
327
    gtk_widget_show(dtw->hbox);
329
 
 
 
328
 
330
329
    dtw->aux_toolbox = ToolboxFactory::createAuxToolbox();
331
330
    gtk_box_pack_end (GTK_BOX (dtw->vbox), dtw->aux_toolbox, FALSE, TRUE, 0);
332
331
 
1511
1510
        sp_ruler_set_metric(GTK_RULER (this->vruler), nv->getDefaultMetric());
1512
1511
        sp_ruler_set_metric(GTK_RULER (this->hruler), nv->getDefaultMetric());
1513
1512
 
1514
 
        /* This loops through all the grandchildren of aux toolbox,
1515
 
         * and for each that it finds, it performs an sp_search_by_data_recursive(),
1516
 
         * looking for widgets that hold some "tracker" data (this is used by
1517
 
         * all toolboxes to refer to the unit selector). The default document units 
1518
 
         * is then selected within these unit selectors.
1519
 
         *
1520
 
         * Of course it would be nice to be able to refer to the toolbox and the
1521
 
         * unit selector directly by name, but I don't yet see a way to do that.
1522
 
         * 
1523
 
         * This should solve: https://bugs.launchpad.net/inkscape/+bug/362995
1524
 
         */
1525
 
        if (GTK_IS_CONTAINER(aux_toolbox)) {
1526
 
            GList *ch = gtk_container_get_children (GTK_CONTAINER(aux_toolbox));
1527
 
            for (GList *i = ch; i != NULL; i = i->next) {
1528
 
                if (GTK_IS_CONTAINER(i->data)) {
1529
 
                    GList *grch = gtk_container_get_children (GTK_CONTAINER(i->data));
1530
 
                    for (GList *j = grch; j != NULL; j = j->next) {                        
1531
 
                        if (!GTK_IS_WIDGET(j->data)) // wasn't a widget
1532
 
                            continue;
1533
 
 
1534
 
                        gpointer t = sp_search_by_data_recursive(GTK_WIDGET(j->data), (gpointer) "tracker");
1535
 
                        if (t == NULL) // didn't find any tracker data
1536
 
                            continue;
1537
 
 
1538
 
                        UnitTracker *tracker = reinterpret_cast<UnitTracker*>( t );
1539
 
                        if (tracker == NULL) // it's null when inkscape is first opened
1540
 
                            continue;
1541
 
 
1542
 
                        tracker->setActiveUnit( nv->doc_units );
1543
 
                    } // grandchildren
1544
 
                } // if child is a container
1545
 
            } // children
1546
 
        } // if aux_toolbox is a container
1547
 
 
1548
1513
        gtk_tooltips_set_tip(this->tt, this->hruler_box, gettext(sp_unit_get_plural (nv->doc_units)), NULL);
1549
1514
        gtk_tooltips_set_tip(this->tt, this->vruler_box, gettext(sp_unit_get_plural (nv->doc_units)), NULL);
1550
1515