Git commit 22f6ea68f792beba8a78cfa1b99cf7fc7bc40649 by Ed Rogalsky.
Committed on 28/02/2014 at 22:08.
Pushed by rogalsky into branch 'master'.
jogshuttle: make shuttle device selection more straightforward
M +10 -0 src/kdenlivesettings.kcfg
M +52 -23 src/kdenlivesettingsdialog.cpp
M +1 -0 src/kdenlivesettingsdialog.h
M +244 -98 src/ui/configjogshuttle_ui.ui
http://commits.kde.org/kdenlive/22f6ea68f792beba8a78cfa1b99cf7fc7bc40649
diff --git a/src/kdenlivesettings.kcfg b/src/kdenlivesettings.kcfg
index 40c0909..59c0334 100644
--- a/src/kdenlivesettings.kcfg
+++ b/src/kdenlivesettings.kcfg
@@ -523,6 +523,16 @@
+ =
+
+
+
+
+ =
+
+
+
+
=
diff --git a/src/kdenlivesettingsdialog.cpp b/src/kdenlivesettingsdialog.cpp
index 8e97b33..b298e8c 100644
--- a/src/kdenlivesettingsdialog.cpp
+++ b/src/kdenlivesettingsdialog.cpp
@@ -133,9 +133,12 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const Q=
Map& map
=
QWidget *p5 =3D new QWidget;
m_configShuttle.setupUi(p5);
+ m_configShuttle.toolBtnReload->setIcon(KIcon("view-refresh"));
#ifdef USE_JOGSHUTTLE
connect(m_configShuttle.kcfg_enableshuttle, SIGNAL(stateChanged(int)),=
this, SLOT(slotCheckShuttle(int)));
connect(m_configShuttle.shuttledevicelist, SIGNAL(activated(int)), thi=
s, SLOT(slotUpdateShuttleDevice(int)));
+ connect(m_configShuttle.toolBtnReload, SIGNAL(clicked(bool)), this, SL=
OT(slotReloadShuttleDevices()));
+
slotCheckShuttle(KdenliveSettings::enableshuttle());
m_configShuttle.shuttledisabled->hide();
=
@@ -523,31 +526,17 @@ void KdenliveSettingsDialog::slotCheckShuttle(int sta=
te)
{
#ifdef USE_JOGSHUTTLE
m_configShuttle.config_group->setEnabled(state);
- if (m_configShuttle.shuttledevicelist->count() =3D=3D 0) {
- QString devDirStr =3D "/dev/input/by-id";
- QDir devDir(devDirStr);
- if (!devDir.exists()) {
- devDirStr =3D "/dev/input";
- }
+ m_configShuttle.shuttledevicelist->clear();
=
- DeviceMap devMap =3D JogShuttle::enumerateDevices(devDirStr);
-#if 0
- if (!devMap.isEmpty()) {
- m_configShuttle.shuttledevicelist->clear();
- }
-#endif
- DeviceMapIter iter =3D devMap.begin();
- while (iter !=3D devMap.end()) {
- kDebug() << iter.key() << ": " << iter.value();
- m_configShuttle.shuttledevicelist->addItem(
- iter.key(),
- iter.value());
- ++iter;
- }
+ QStringList devNames =3D KdenliveSettings::shuttledevicenames();
+ QStringList devPaths =3D KdenliveSettings::shuttledevicepaths();
=
- if (KdenliveSettings::shuttledevice().isEmpty()) {
- QTimer::singleShot(1500, this, SLOT(slotUpdateShuttleDevice())=
);
- }
+ if (devNames.count() !=3D devPaths.count()) {
+ return;
+ }
+ for (int i =3D 0; i < devNames.count(); i++) {
+ m_configShuttle.shuttledevicelist->addItem(
+ devNames.at(i), devPaths.at(i));
}
#endif /* USE_JOGSHUTTLE */
}
@@ -1133,6 +1122,46 @@ void KdenliveSettingsDialog::slotReloadBlackMagic()
}
m_configSdl.kcfg_external_display->setEnabled(KdenliveSettings::deckli=
nk_device_found());
}
+
+void KdenliveSettingsDialog::slotReloadShuttleDevices()
+{
+#ifdef USE_JOGSHUTTLE
+ QString devDirStr =3D "/dev/input/by-id";
+ QDir devDir(devDirStr);
+ if (!devDir.exists()) {
+ devDirStr =3D "/dev/input";
+ }
+
+ DeviceMap devMap =3D JogShuttle::enumerateDevices(devDirStr);
+ if (!devMap.isEmpty()) {
+ m_configShuttle.shuttledevicelist->clear();
+ }
+
+ QStringList devNamesList;
+ QStringList devPathList;
+ DeviceMapIter iter =3D devMap.begin();
+ if (iter =3D=3D devMap.end()) {
+ KdenliveSettings::shuttledevicenames().clear();
+ KdenliveSettings::shuttledevicepaths().clear();
+ m_configShuttle.shuttledevicelist->clear();
+ }
+ while (iter !=3D devMap.end()) {
+ kDebug() << iter.key() << ": " << iter.value();
+ m_configShuttle.shuttledevicelist->addItem(iter.key(), iter.value(=
));
+ devNamesList << iter.key();
+ devPathList << iter.value();
+ ++iter;
+ }
+
+ KdenliveSettings::setShuttledevicenames(devNamesList);
+ KdenliveSettings::setShuttledevicepaths(devPathList);
+ QTimer::singleShot(200, this, SLOT(slotUpdateShuttleDevice()));
+
+ kDebug() << "Devices reloded";
+
+#endif //USE_JOGSHUTTLE
+}
+
#include "kdenlivesettingsdialog.moc"
=
=
diff --git a/src/kdenlivesettingsdialog.h b/src/kdenlivesettingsdialog.h
index f00a32f..3a9c1c7 100644
--- a/src/kdenlivesettingsdialog.h
+++ b/src/kdenlivesettingsdialog.h
@@ -79,6 +79,7 @@ private slots:
void slotUpdateGrabProfile(int ix =3D 0);
void slotEditVideo4LinuxProfile();
void slotReloadBlackMagic();
+ void slotReloadShuttleDevices();
=
private:
KPageWidgetItem *m_page1;
diff --git a/src/ui/configjogshuttle_ui.ui b/src/ui/configjogshuttle_ui.ui
index 2b69f8c..49a1513 100644
--- a/src/ui/configjogshuttle_ui.ui
+++ b/src/ui/configjogshuttle_ui.ui
@@ -6,8 +6,8 @@
0
0
- 299
- 548
+ 455
+ 749
@@ -31,6 +31,19 @@
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 56
+
+
+
+
-
@@ -39,190 +52,323 @@
Device configuration
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
+
-
-
-
+
-
+
+
+
+ 0
+ 0
+
+
- Button 12
+
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
+
+
+ false
- -
-
+
-
+
- Button 14
+ ...
- -
-
+
-
+
- Button 13
+ Button 1
- -
-
+
-
+
+
+
+ 0
+ 0
+
+
- Button 11
+ Device
- -
-
+
-
+
+
+
+ 0
+ 0
+
+
- Button 7
+ Button 15
- -
-
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ -
+
+
+ -
+
+
+
+ 0
+ 0
+
+
- Button 8
+ Button 13
-
-
+
+
+
+ 0
+ 0
+
+
- Button 9
+ Button 8
- -
-
+
-
+
+
+ -
+
+
+
+ 0
+ 0
+
+
- Button 6
+ Button 4
-
+
+
+ 0
+ 0
+
+
- Device
+ Device name
- -
-
-
- -
-
+
-
+
+
+
+ 0
+ 0
+
+
-
+ Button 5
- -
-
+
-
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+ 0
+ 0
+
+
- Button 1
+ Button 7
+
+
+
+ -
+
+
+
+ 0
+ 0
+
- -
-
+
-
+
- -
-
+
-
+
+
+ -
+
+
+
+ 0
+ 0
+
+
- Button 2
+ Button 9
- -
-
-
-
-
+
+
+
+ 0
+ 0
+
+
- Button 3
+ Button 2
- -
+
-
- -
-
-
- -
-
+
-
+
+
+
+ 0
+ 0
+
+
- Button 4
+ Button 10
- -
-
+
-
+
+
+
+ 0
+ 0
+
+
- Button 5
+ Button 11
- -
-
+
-
+
+
+
+ 0
+ 0
+
+
+
- -
-
+
-
+
+
+
+ 0
+ 0
+
+
- Button 10
+ Button 6
- -
-
-
- -
+
-
- -
-
+
-
+
- -
-
+
-
+
- -
-
+
-
+
+
+ -
+
-
-
+
+
+
+ 0
+ 0
+
+
- Button 15
+ Button 14
- -
-
-
- -
-
-
- -
-
-
- -
-
+
-
+
+
+
+ 0
+ 0
+
+
+
+ Button 3
+
+
- -
-
+
-
+
+
+
+ 0
+ 0
+
+
+
+ Button 12
+
+
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 56
-
-
-
-