summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Mi <codeminister@publicstatic.de>2014-01-22 13:14:24 (GMT)
committerGregor Mi <codeminister@publicstatic.de>2014-01-22 13:14:24 (GMT)
commit8b1a074524cdbfe01d1b8551b4d6e7b529462671 (patch)
tree816310e35274d3df845b57b7c2b9ccc65e137a63
parent1ba15a3bc4a0291264b12df766badf5c34d265bc (diff)
SaveLocation: replace KComboBox with the Q one
-rw-r--r--src/SaveLocation.cpp14
-rw-r--r--src/SaveLocation.h2
-rw-r--r--src/SaveLocation.ui11
-rw-r--r--src/skanlite.cpp7
4 files changed, 15 insertions, 19 deletions
diff --git a/src/SaveLocation.cpp b/src/SaveLocation.cpp
index 31feb3a..7c8e5c0 100644
--- a/src/SaveLocation.cpp
+++ b/src/SaveLocation.cpp
@@ -27,23 +27,25 @@
#include <QDebug>
#include <QFileDialog>
+#include <QPushButton>
+#include <QComboBox>
SaveLocation::SaveLocation(QWidget *parent) : QDialog(parent)
{
setupUi(this);
- connect(u_saveDirLEdit, SIGNAL(textChanged(QString)), this, SLOT(update()));
- connect(u_imgPrefix, SIGNAL(textChanged(QString)), this, SLOT(update()));
- connect(u_imgFormat, SIGNAL(activated(QString)), this, SLOT(update()));
- connect(u_numStartFrom, SIGNAL(valueChanged(int)), this, SLOT(update()));
- connect(u_getDirButton, SIGNAL(clicked()), this, SLOT(getDir()));
+ connect(u_saveDirLEdit, SIGNAL(textChanged(QString)), this, SLOT(updateGui()));
+ connect(u_imgPrefix, SIGNAL(textChanged(QString)), this, SLOT(updateGui()));
+ connect(u_imgFormat, SIGNAL(activated(QString)), this, SLOT(updateGui()));
+ connect(u_numStartFrom, SIGNAL(valueChanged(int)), this, SLOT(updateGui()));
+ connect(u_getDirButton, &QPushButton::clicked, this, &SaveLocation::getDir);
}
SaveLocation::~SaveLocation()
{
}
-void SaveLocation::update()
+void SaveLocation::updateGui()
{
if (sender() != u_numStartFrom) {
u_numStartFrom->setValue(1); // Reset the counter whenever the directory or the prefix is changed
diff --git a/src/SaveLocation.h b/src/SaveLocation.h
index c733cff..eb64e72 100644
--- a/src/SaveLocation.h
+++ b/src/SaveLocation.h
@@ -38,7 +38,7 @@ public:
~SaveLocation();
private Q_SLOTS:
- void update();
+ void updateGui();
void getDir();
};
diff --git a/src/SaveLocation.ui b/src/SaveLocation.ui
index eaaf340..966ead2 100644
--- a/src/SaveLocation.ui
+++ b/src/SaveLocation.ui
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>401</width>
- <height>172</height>
+ <height>173</height>
</rect>
</property>
<property name="sizePolicy">
@@ -74,7 +74,7 @@
</widget>
</item>
<item>
- <widget class="KComboBox" name="u_imgFormat"/>
+ <widget class="QComboBox" name="u_imgFormat"/>
</item>
</layout>
</item>
@@ -176,13 +176,6 @@
</item>
</layout>
</widget>
- <customwidgets>
- <customwidget>
- <class>KComboBox</class>
- <extends>QComboBox</extends>
- <header>kcombobox.h</header>
- </customwidget>
- </customwidgets>
<resources/>
<connections/>
</ui>
diff --git a/src/skanlite.cpp b/src/skanlite.cpp
index 8e58a6e..fad4338 100644
--- a/src/skanlite.cpp
+++ b/src/skanlite.cpp
@@ -34,6 +34,7 @@
#include <QFileDialog>
#include <QUrl>
#include <QDialogButtonBox>
+#include <QComboBox>
#include <KAboutApplicationDialog>
#include <KAction>
@@ -151,7 +152,7 @@ Skanlite::Skanlite(const QString& device, QWidget* parent)
// default directory for the save dialog
m_saveLocation->u_saveDirLEdit->setText(m_settingsUi.saveDirLEdit->text());
m_saveLocation->u_imgPrefix->setText(m_settingsUi.imgPrefix->text());
- m_saveLocation->u_imgFormat->setCurrentItem(m_settingsUi.imgFormat->currentText());
+ m_saveLocation->u_imgFormat->setCurrentText(m_settingsUi.imgFormat->currentText());
}
// open the scan device
@@ -306,7 +307,7 @@ void Skanlite::showSettingsDialog(void)
// pressing OK in the settings dialog means use those settings.
m_saveLocation->u_saveDirLEdit->setText(m_settingsUi.saveDirLEdit->text());
m_saveLocation->u_imgPrefix->setText(m_settingsUi.imgPrefix->text());
- m_saveLocation->u_imgFormat->setCurrentItem(m_settingsUi.imgFormat->currentText());
+ m_saveLocation->u_imgFormat->setCurrentText(m_settingsUi.imgFormat->currentText());
m_firstImage = true;
}
@@ -493,7 +494,7 @@ void Skanlite::saveImage()
if (m_settingsUi.saveModeCB->currentIndex() == SaveModeManual) {
// Save last used dir, prefix and suffix.
m_saveLocation->u_saveDirLEdit->setText(KIO::upUrl(fileUrl).path());
- m_saveLocation->u_imgFormat->setCurrentItem(fileInfo.suffix());
+ m_saveLocation->u_imgFormat->setCurrentText(fileInfo.suffix());
}
}