326
class MyModelColumns : public Gtk::TreeModel::ColumnRecord
331
class DeviceModelColumns : public Gtk::TreeModel::ColumnRecord
329
Gtk::TreeModelColumn<Glib::ustring> filename;
330
334
Gtk::TreeModelColumn<Glib::ustring> description;
331
335
Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > thumbnail;
332
Gtk::TreeModelColumn<InputDevice const *> device;
336
Gtk::TreeModelColumn<Glib::RefPtr<InputDevice const> > device;
337
Gtk::TreeModelColumn<Gdk::InputMode> mode;
334
MyModelColumns() { add(filename); add(description); add(thumbnail); add(device); }
339
DeviceModelColumns() { add(description); add(thumbnail); add(device); add(mode); }
342
static std::map<Gdk::InputMode, Glib::ustring> &getModeToString()
344
static std::map<Gdk::InputMode, Glib::ustring> mapping;
345
if (mapping.empty()) {
346
mapping[Gdk::MODE_DISABLED] = _("Disabled");
347
mapping[Gdk::MODE_SCREEN] = _("Screen");
348
mapping[Gdk::MODE_WINDOW] = _("Window");
354
static std::map<Glib::ustring, Gdk::InputMode> &getStringToMode()
356
static std::map<Glib::ustring, Gdk::InputMode> mapping;
357
if (mapping.empty()) {
358
mapping[_("Disabled")] = Gdk::MODE_DISABLED;
359
mapping[_("Screen")] = Gdk::MODE_SCREEN;
360
mapping[_("Window")] = Gdk::MODE_WINDOW;
337
368
class InputDialogImpl : public InputDialog {
339
370
InputDialogImpl();
340
371
virtual ~InputDialogImpl() {}
343
Glib::RefPtr<Gdk::Pixbuf> corePix;
344
Glib::RefPtr<Gdk::Pixbuf> penPix;
345
Glib::RefPtr<Gdk::Pixbuf> mousePix;
346
Glib::RefPtr<Gdk::Pixbuf> tipPix;
347
Glib::RefPtr<Gdk::Pixbuf> tabletPix;
348
Glib::RefPtr<Gdk::Pixbuf> eraserPix;
349
Glib::RefPtr<Gdk::Pixbuf> sidebuttonsPix;
351
Glib::RefPtr<Gdk::Pixbuf> buttonsNonePix;
352
Glib::RefPtr<Gdk::Pixbuf> buttonsOnPix;
353
Glib::RefPtr<Gdk::Pixbuf> buttonsOffPix;
355
Glib::RefPtr<Gdk::Pixbuf> axisNonePix;
356
Glib::RefPtr<Gdk::Pixbuf> axisOnPix;
357
Glib::RefPtr<Gdk::Pixbuf> axisOffPix;
374
class ConfPanel : public Gtk::VBox
380
class Blink : public Preferences::Observer
383
Blink(ConfPanel &parent);
385
virtual void notify(Preferences::Entry const &new_val);
390
static void commitCellModeChange(Glib::ustring const &path, Glib::ustring const &newText, Glib::RefPtr<Gtk::TreeStore> store);
391
static void setModeCellString(Gtk::CellRenderer *rndr, Gtk::TreeIter const &iter);
394
void useExtToggled();
396
Glib::RefPtr<Gtk::TreeStore> store;
397
Gtk::TreeIter tabletIter;
399
Gtk::ScrolledWindow treeScroller;
401
Gtk::CheckButton useExt;
405
static DeviceModelColumns &getCols();
407
enum PixId {PIX_CORE, PIX_PEN, PIX_MOUSE, PIX_TIP, PIX_TABLET, PIX_ERASER, PIX_SIDEBUTTONS,
408
PIX_BUTTONS_NONE, PIX_BUTTONS_ON, PIX_BUTTONS_OFF,
409
PIX_AXIS_NONE, PIX_AXIS_ON, PIX_AXIS_OFF};
411
static Glib::RefPtr<Gdk::Pixbuf> getPix(PixId id);
359
413
std::map<Glib::ustring, std::set<guint> > buttonMap;
360
414
std::map<Glib::ustring, std::map<guint, std::pair<guint, gdouble> > > axesMap;
399
454
bool eventSnoop(GdkEvent* event);
400
455
void linkComboChanged();
401
456
void resyncToSelection();
402
void handleDeviceChange(const Glib::RefPtr<InputDevice>& device);
403
void updateDeviceAxes(const Glib::RefPtr<InputDevice>& device);
404
void updateDeviceButtons(const Glib::RefPtr<InputDevice>& device);
405
void updateDeviceLinks(const Glib::RefPtr<InputDevice>& device);
407
bool findDevice(const Gtk::TreeModel::iterator& iter,
409
Gtk::TreeModel::iterator* result);
410
bool findDeviceByLink(const Gtk::TreeModel::iterator& iter,
412
Gtk::TreeModel::iterator* result);
457
void handleDeviceChange(Glib::RefPtr<InputDevice const> device);
458
void updateDeviceAxes(Glib::RefPtr<InputDevice const> device);
459
void updateDeviceButtons(Glib::RefPtr<InputDevice const> device);
460
static void updateDeviceLinks(Glib::RefPtr<InputDevice const> device, Gtk::TreeIter tabletIter, Glib::RefPtr<Gtk::TreeView> tree);
462
static bool findDevice(const Gtk::TreeModel::iterator& iter,
464
Gtk::TreeModel::iterator* result);
465
static bool findDeviceByLink(const Gtk::TreeModel::iterator& iter,
467
Gtk::TreeModel::iterator* result);
469
}; // class InputDialogImpl
472
DeviceModelColumns &InputDialogImpl::getCols()
474
static DeviceModelColumns cols;
478
Glib::RefPtr<Gdk::Pixbuf> InputDialogImpl::getPix(PixId id)
480
static std::map<PixId, Glib::RefPtr<Gdk::Pixbuf> > mappings;
482
mappings[PIX_CORE] = Gdk::Pixbuf::create_from_xpm_data(core_xpm);
483
mappings[PIX_PEN] = Gdk::Pixbuf::create_from_xpm_data(pen);
484
mappings[PIX_MOUSE] = Gdk::Pixbuf::create_from_xpm_data(mouse);
485
mappings[PIX_TIP] = Gdk::Pixbuf::create_from_xpm_data(tip);
486
mappings[PIX_TABLET] = Gdk::Pixbuf::create_from_xpm_data(tablet);
487
mappings[PIX_ERASER] = Gdk::Pixbuf::create_from_xpm_data(eraser);
488
mappings[PIX_SIDEBUTTONS] = Gdk::Pixbuf::create_from_xpm_data(sidebuttons);
490
mappings[PIX_BUTTONS_NONE] = Gdk::Pixbuf::create_from_xpm_data(button_none);
491
mappings[PIX_BUTTONS_ON] = Gdk::Pixbuf::create_from_xpm_data(button_on);
492
mappings[PIX_BUTTONS_OFF] = Gdk::Pixbuf::create_from_xpm_data(button_off);
494
mappings[PIX_AXIS_NONE] = Gdk::Pixbuf::create_from_xpm_data(axis_none_xpm);
495
mappings[PIX_AXIS_ON] = Gdk::Pixbuf::create_from_xpm_data(axis_on_xpm);
496
mappings[PIX_AXIS_OFF] = Gdk::Pixbuf::create_from_xpm_data(axis_off_xpm);
498
Glib::RefPtr<Gdk::Pixbuf> pix;
499
if (mappings.find(id) != mappings.end()) {
416
507
// Now that we've defined the *Impl class, we can do the method to aquire one.
424
515
InputDialogImpl::InputDialogImpl() :
427
corePix(Gdk::Pixbuf::create_from_xpm_data(core_xpm)),
428
penPix(Gdk::Pixbuf::create_from_xpm_data(pen)),
429
mousePix(Gdk::Pixbuf::create_from_xpm_data(mouse)),
430
tipPix(Gdk::Pixbuf::create_from_xpm_data(tip)),
431
tabletPix(Gdk::Pixbuf::create_from_xpm_data(tablet)),
432
eraserPix(Gdk::Pixbuf::create_from_xpm_data(eraser)),
433
sidebuttonsPix(Gdk::Pixbuf::create_from_xpm_data(sidebuttons)),
435
buttonsNonePix(Gdk::Pixbuf::create_from_xpm_data(button_none)),
436
buttonsOnPix(Gdk::Pixbuf::create_from_xpm_data(button_on)),
437
buttonsOffPix(Gdk::Pixbuf::create_from_xpm_data(button_off)),
439
axisNonePix(Gdk::Pixbuf::create_from_xpm_data(axis_none_xpm)),
440
axisOnPix(Gdk::Pixbuf::create_from_xpm_data(axis_on_xpm)),
441
axisOffPix(Gdk::Pixbuf::create_from_xpm_data(axis_off_xpm)),
443
518
lastSourceSeen((GdkInputSource)-1),
444
519
lastDevnameSeen(""),
446
store(Gtk::TreeStore::create(cols)),
520
store(Gtk::TreeStore::create(getCols())),
449
testFrame("Test Area"),
524
testFrame(_("Test Area")),
451
526
detailScroller(),
455
530
devDetails(12, 2),
460
536
Gtk::Box *contents = _getContents();
628
Gtk::TreeModel::Row row;
629
Gtk::TreeModel::Row childrow;
630
Gtk::TreeModel::Row deviceRow;
633
702
//Add the TreeView's view columns:
634
tree.append_column("I", cols.thumbnail);
635
tree.append_column("Bar", cols.description);
703
tree.append_column("I", getCols().thumbnail);
704
tree.append_column("Bar", getCols().description);
637
706
tree.set_enable_tree_lines();
638
707
tree.set_headers_visible(false);
639
708
tree.get_selection()->signal_changed().connect(sigc::mem_fun(*this, &InputDialogImpl::resyncToSelection));
643
std::list<InputDevice const *> devList = Inkscape::DeviceManager::getManager().getDevices();
711
setupTree( store, tabletIter );
713
Inkscape::DeviceManager::getManager().signalDeviceChanged().connect(sigc::mem_fun(*this, &InputDialogImpl::handleDeviceChange));
714
Inkscape::DeviceManager::getManager().signalAxesChanged().connect(sigc::mem_fun(*this, &InputDialogImpl::updateDeviceAxes));
715
Inkscape::DeviceManager::getManager().signalButtonsChanged().connect(sigc::mem_fun(*this, &InputDialogImpl::updateDeviceButtons));
716
Glib::RefPtr<Gtk::TreeView> treePtr(&tree);
717
Inkscape::DeviceManager::getManager().signalLinkChanged().connect(sigc::bind(sigc::ptr_fun(&InputDialogImpl::updateDeviceLinks), tabletIter, treePtr));
723
void InputDialogImpl::setupTree( Glib::RefPtr<Gtk::TreeStore> store, Gtk::TreeIter &tablet )
725
std::list<Glib::RefPtr<InputDevice const> > devList = Inkscape::DeviceManager::getManager().getDevices();
644
726
if ( !devList.empty() ) {
645
row = *(store->append());
646
row[cols.description] = "Hardware";
648
tabletIter = store->append(row.children());
649
childrow = *tabletIter;
650
childrow[cols.description] = "Tablet";
651
childrow[cols.thumbnail] = tabletPix;
653
for ( std::list<InputDevice const *>::iterator it = devList.begin(); it != devList.end(); ++it ) {
654
InputDevice const* dev = *it;
727
Gtk::TreeModel::Row row = *(store->append());
728
row[getCols().description] = _("Hardware");
730
tablet = store->append(row.children());
731
Gtk::TreeModel::Row childrow = *tablet;
732
childrow[getCols().description] = _("Tablet");
733
childrow[getCols().thumbnail] = getPix(PIX_TABLET);
735
for ( std::list<Glib::RefPtr<InputDevice const> >::iterator it = devList.begin(); it != devList.end(); ++it ) {
736
Glib::RefPtr<InputDevice const> dev = *it;
656
738
// g_message("device: name[%s] source[0x%x] mode[0x%x] cursor[%s] axis count[%d] key count[%d]", dev->getName().c_str(), dev->getSource(), dev->getMode(),
657
739
// dev->hasCursor() ? "Yes":"no", dev->getNumAxes(), dev->getNumKeys());
659
741
// if ( dev->getSource() != Gdk::SOURCE_MOUSE ) {
661
deviceRow = *(store->append(childrow.children()));
662
deviceRow[cols.description] = dev->getName();
663
deviceRow[cols.device] = dev;
743
Gtk::TreeModel::Row deviceRow = *(store->append(childrow.children()));
744
deviceRow[getCols().description] = dev->getName();
745
deviceRow[getCols().device] = dev;
746
deviceRow[getCols().mode] = dev->getMode();
664
747
switch ( dev->getSource() ) {
665
748
case GDK_SOURCE_MOUSE:
666
deviceRow[cols.thumbnail] = corePix;
749
deviceRow[getCols().thumbnail] = getPix(PIX_CORE);
668
751
case GDK_SOURCE_PEN:
669
if (deviceRow[cols.description] == "pad") {
670
deviceRow[cols.thumbnail] = sidebuttonsPix;
752
if (deviceRow[getCols().description] == _("pad")) {
753
deviceRow[getCols().thumbnail] = getPix(PIX_SIDEBUTTONS);
672
deviceRow[cols.thumbnail] = tipPix;
755
deviceRow[getCols().thumbnail] = getPix(PIX_TIP);
675
758
case GDK_SOURCE_CURSOR:
676
deviceRow[cols.thumbnail] = mousePix;
759
deviceRow[getCols().thumbnail] = getPix(PIX_MOUSE);
678
761
case GDK_SOURCE_ERASER:
679
deviceRow[cols.thumbnail] = eraserPix;
762
deviceRow[getCols().thumbnail] = getPix(PIX_ERASER);
690
773
g_warning("No devices found");
692
Inkscape::DeviceManager::getManager().signalDeviceChanged().connect(sigc::mem_fun(*this, &InputDialogImpl::handleDeviceChange));
693
Inkscape::DeviceManager::getManager().signalAxesChanged().connect(sigc::mem_fun(*this, &InputDialogImpl::updateDeviceAxes));
694
Inkscape::DeviceManager::getManager().signalButtonsChanged().connect(sigc::mem_fun(*this, &InputDialogImpl::updateDeviceButtons));
695
Inkscape::DeviceManager::getManager().signalLinkChanged().connect(sigc::mem_fun(*this, &InputDialogImpl::updateDeviceLinks));
778
InputDialogImpl::ConfPanel::ConfPanel() :
780
store(Gtk::TreeStore::create(getCols())),
785
useExt(_("Use pressure-sensitive tablet (requires restart)")),
788
pack_start(treeScroller);
790
treeScroller.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
791
treeScroller.add(tree);
793
class Foo : public Gtk::TreeModel::ColumnRecord {
795
Gtk::TreeModelColumn<Glib::ustring> one;
799
Glib::RefPtr<Gtk::ListStore> poppers = Gtk::ListStore::create(foo);
800
poppers->reference();
802
Gtk::TreeModel::Row row = *(poppers->append());
803
row[foo.one] = getModeToString()[Gdk::MODE_DISABLED];
804
row = *(poppers->append());
805
row[foo.one] = getModeToString()[Gdk::MODE_SCREEN];
806
row = *(poppers->append());
807
row[foo.one] = getModeToString()[Gdk::MODE_WINDOW];
809
Gtk::CellRendererCombo *rendr = new Gtk::CellRendererCombo();
810
rendr->property_model().set_value(poppers);
811
rendr->property_text_column().set_value(0);
812
rendr->property_has_entry() = false;
814
//Add the TreeView's view columns:
815
tree.append_column("I", getCols().thumbnail);
816
tree.append_column("Bar", getCols().description);
817
Gtk::TreeViewColumn *col = new Gtk::TreeViewColumn("X", *rendr);
819
tree.append_column(*col);
820
col->set_cell_data_func(*rendr, sigc::ptr_fun(setModeCellString));
821
rendr->signal_edited().connect(sigc::bind(sigc::ptr_fun(commitCellModeChange), store));
822
rendr->property_editable() = true;
825
tree.set_enable_tree_lines();
826
tree.set_headers_visible(false);
828
setupTree( store, tabletIter );
830
Glib::RefPtr<Gtk::TreeView> treePtr(&tree);
831
Inkscape::DeviceManager::getManager().signalLinkChanged().connect(sigc::bind(sigc::ptr_fun(&InputDialogImpl::updateDeviceLinks), tabletIter, treePtr));
697
833
tree.expand_all();
701
void InputDialogImpl::handleDeviceChange(const Glib::RefPtr<InputDevice>& /*device*/)
835
useExt.set_active(Preferences::get()->getBool("/options/useextinput/value"));
836
useExt.signal_toggled().connect(sigc::mem_fun(*this, &InputDialogImpl::ConfPanel::useExtToggled));
837
pack_start(useExt, Gtk::PACK_SHRINK);
839
save.signal_clicked().connect(sigc::mem_fun(*this, &InputDialogImpl::ConfPanel::saveSettings));
840
Gtk::Alignment *align = new Gtk::Alignment(Gtk::ALIGN_RIGHT, Gtk::ALIGN_TOP, 0, 0);
842
pack_start(*Gtk::manage(align), Gtk::PACK_SHRINK);
845
InputDialogImpl::ConfPanel::~ConfPanel()
849
void InputDialogImpl::ConfPanel::setModeCellString(Gtk::CellRenderer *rndr, Gtk::TreeIter const &iter)
852
Gtk::CellRendererCombo *combo = dynamic_cast<Gtk::CellRendererCombo *>(rndr);
854
Glib::RefPtr<InputDevice const> dev = (*iter)[getCols().device];
855
Gdk::InputMode mode = (*iter)[getCols().mode];
856
if (dev && (getModeToString().find(mode) != getModeToString().end())) {
857
combo->property_text() = getModeToString()[mode];
859
combo->property_text() = "";
865
void InputDialogImpl::ConfPanel::commitCellModeChange(Glib::ustring const &path, Glib::ustring const &newText, Glib::RefPtr<Gtk::TreeStore> store)
867
Gtk::TreeIter iter = store->get_iter(path);
869
Glib::RefPtr<InputDevice const> dev = (*iter)[getCols().device];
870
if (dev && (getStringToMode().find(newText) != getStringToMode().end())) {
871
Gdk::InputMode mode = getStringToMode()[newText];
872
Inkscape::DeviceManager::getManager().setMode( dev->getId(), mode );
877
void InputDialogImpl::ConfPanel::saveSettings()
879
Inkscape::DeviceManager::getManager().saveConfig();
882
void InputDialogImpl::ConfPanel::useExtToggled()
884
bool active = useExt.get_active();
885
if (active != Preferences::get()->getBool("/options/useextinput/value")) {
886
Preferences::get()->setBool("/options/useextinput/value", active);
888
// As a work-around for a common problem, enable tablet toggles on the calligraphic tool.
889
// Covered in Launchpad bug #196195.
890
Preferences::get()->setBool("/tools/tweak/usepressure", true);
891
Preferences::get()->setBool("/tools/calligraphic/usepressure", true);
892
Preferences::get()->setBool("/tools/calligraphic/usetilt", true);
897
InputDialogImpl::ConfPanel::Blink::Blink(ConfPanel &parent) :
898
Preferences::Observer("/options/useextinput/value"),
901
Preferences::get()->addObserver(*this);
904
InputDialogImpl::ConfPanel::Blink::~Blink()
906
Preferences::get()->removeObserver(*this);
909
void InputDialogImpl::ConfPanel::Blink::notify(Preferences::Entry const &new_val)
911
parent.useExt.set_active(new_val.getBool());
914
void InputDialogImpl::handleDeviceChange(Glib::RefPtr<InputDevice const> device)
703
916
// g_message("OUCH!!!! for %p hits %s", &device, device->getId().c_str());
917
std::vector<Glib::RefPtr<Gtk::TreeStore> > stores;
918
stores.push_back(store);
919
stores.push_back(cfgPanel.store);
921
for (std::vector<Glib::RefPtr<Gtk::TreeStore> >::iterator it = stores.begin(); it != stores.end(); ++it) {
922
Gtk::TreeModel::iterator deviceIter;
923
(*it)->foreach_iter( sigc::bind<Glib::ustring, Gtk::TreeModel::iterator*>(
924
sigc::ptr_fun(&InputDialogImpl::findDevice),
928
Gdk::InputMode mode = device->getMode();
929
Gtk::TreeModel::Row row = *deviceIter;
930
if (row[getCols().mode] != mode) {
931
row[getCols().mode] = mode;
706
void InputDialogImpl::updateDeviceAxes(const Glib::RefPtr<InputDevice>& device)
937
void InputDialogImpl::updateDeviceAxes(Glib::RefPtr<InputDevice const> device)
708
939
gint live = device->getLiveAxes();
783
1016
// g_message("Item %s is unlinked", device->getId().c_str());
784
1017
if ( deviceIter->parent() != tabletIter ) {
785
1018
// Not the child of the tablet. move on up
787
InputDevice const *dev = (*deviceIter)[cols.device];
788
Glib::ustring descr = (*deviceIter)[cols.description];
789
Glib::RefPtr<Gdk::Pixbuf> thumb = (*deviceIter)[cols.thumbnail];
1020
Glib::RefPtr<InputDevice const> dev = (*deviceIter)[getCols().device];
1021
Glib::ustring descr = (*deviceIter)[getCols().description];
1022
Glib::RefPtr<Gdk::Pixbuf> thumb = (*deviceIter)[getCols().thumbnail];
791
1024
Gtk::TreeModel::Row deviceRow = *store->append(tabletIter->children());
792
deviceRow[cols.description] = descr;
793
deviceRow[cols.thumbnail] = thumb;
794
deviceRow[cols.device] = dev;
1025
deviceRow[getCols().description] = descr;
1026
deviceRow[getCols().thumbnail] = thumb;
1027
deviceRow[getCols().device] = dev;
1028
deviceRow[getCols().mode] = dev->getMode();
796
1030
Gtk::TreeModel::iterator oldParent = deviceIter->parent();
797
1031
store->erase(deviceIter);
805
1039
// Simple case. Not already linked
807
1041
Gtk::TreeIter newGroup = store->append(tabletIter->children());
808
(*newGroup)[cols.description] = "Pen";
809
(*newGroup)[cols.thumbnail] = penPix;
1042
(*newGroup)[getCols().description] = _("Pen");
1043
(*newGroup)[getCols().thumbnail] = getPix(PIX_PEN);
811
InputDevice const *dev = (*deviceIter)[cols.device];
812
Glib::ustring descr = (*deviceIter)[cols.description];
813
Glib::RefPtr<Gdk::Pixbuf> thumb = (*deviceIter)[cols.thumbnail];
1045
Glib::RefPtr<InputDevice const> dev = (*deviceIter)[getCols().device];
1046
Glib::ustring descr = (*deviceIter)[getCols().description];
1047
Glib::RefPtr<Gdk::Pixbuf> thumb = (*deviceIter)[getCols().thumbnail];
815
1049
Gtk::TreeModel::Row deviceRow = *store->append(newGroup->children());
816
deviceRow[cols.description] = descr;
817
deviceRow[cols.thumbnail] = thumb;
818
deviceRow[cols.device] = dev;
1050
deviceRow[getCols().description] = descr;
1051
deviceRow[getCols().thumbnail] = thumb;
1052
deviceRow[getCols().device] = dev;
1053
deviceRow[getCols().mode] = dev->getMode();
821
1056
Gtk::TreeModel::iterator linkIter;
822
1057
store->foreach_iter( sigc::bind<Glib::ustring, Gtk::TreeModel::iterator*>(
823
sigc::mem_fun(*this, &InputDialogImpl::findDeviceByLink),
1058
sigc::ptr_fun(&InputDialogImpl::findDeviceByLink),
824
1059
device->getId(),
826
1061
if ( linkIter ) {
827
dev = (*linkIter)[cols.device];
828
descr = (*linkIter)[cols.description];
829
thumb = (*linkIter)[cols.thumbnail];
1062
dev = (*linkIter)[getCols().device];
1063
descr = (*linkIter)[getCols().description];
1064
thumb = (*linkIter)[getCols().thumbnail];
831
1066
deviceRow = *store->append(newGroup->children());
832
deviceRow[cols.description] = descr;
833
deviceRow[cols.thumbnail] = thumb;
834
deviceRow[cols.device] = dev;
1067
deviceRow[getCols().description] = descr;
1068
deviceRow[getCols().thumbnail] = thumb;
1069
deviceRow[getCols().device] = dev;
1070
deviceRow[getCols().mode] = dev->getMode();
835
1071
Gtk::TreeModel::iterator oldParent = linkIter->parent();
836
1072
store->erase(linkIter);
837
1073
if ( oldParent->children().empty() ) {
881
1117
Gtk::TreeModel::iterator iter = treeSel->get_selected();
883
1119
Gtk::TreeModel::Row row = *iter;
884
Glib::ustring val = row[cols.description];
885
InputDevice const * dev = row[cols.device];
1120
Glib::ustring val = row[getCols().description];
1121
Glib::RefPtr<InputDevice const> dev = row[getCols().device];
887
1123
devDetails.set_sensitive(true);
889
1125
linkConnection.block();
890
1126
linkCombo.clear_items();
891
linkCombo.append_text("None");
1127
linkCombo.append_text(_("None"));
892
1128
linkCombo.set_active(0);
893
1129
if ( dev->getSource() != Gdk::SOURCE_MOUSE ) {
894
1130
Glib::ustring linked = dev->getLink();
895
std::list<InputDevice const *> devList = Inkscape::DeviceManager::getManager().getDevices();
896
for ( std::list<InputDevice const *>::const_iterator it = devList.begin(); it != devList.end(); ++it ) {
1131
std::list<Glib::RefPtr<InputDevice const> > devList = Inkscape::DeviceManager::getManager().getDevices();
1132
for ( std::list<Glib::RefPtr<InputDevice const> >::const_iterator it = devList.begin(); it != devList.end(); ++it ) {
897
1133
if ( ((*it)->getSource() != Gdk::SOURCE_MOUSE) && ((*it) != dev) ) {
898
1134
linkCombo.append_text((*it)->getName().c_str());
899
1135
if ( (linked.length() > 0) && (linked == (*it)->getId()) ) {