Commit 644e0714 authored by Alexander Stippich's avatar Alexander Stippich
Browse files

more separating of sane internals from KSaneWidget

and some header cleanup
parent 9006660f
......@@ -10,13 +10,6 @@
#include "ksanedevicedialog.h"
// Sane includes
extern "C"
{
#include <sane/saneopts.h>
#include <sane/sane.h>
}
#include <QScrollArea>
#include <QLabel>
#include <QDialogButtonBox>
......
......@@ -454,19 +454,19 @@ void KSaneWidgetPrivate::createOptInterface()
LabeledGamma *gammaB = nullptr;
if ((option = m_ksaneCoreInterface->getOption(KSaneCore::GammaRedOption)) != nullptr) {
m_optGamR = option;
gammaR = new LabeledGamma(gamma_frm, option);
gammaR = new LabeledGamma(gamma_frm, option, Qt::red);
gam_frm_l->addWidget(gammaR);
m_handledOptions.insert(option->name());
}
if ((option = m_ksaneCoreInterface->getOption(KSaneCore::GammaGreenOption)) != nullptr) {
m_optGamG = option;
gammaG = new LabeledGamma(gamma_frm, option);
gammaG = new LabeledGamma(gamma_frm, option, Qt::green);
gam_frm_l->addWidget(gammaG);
m_handledOptions.insert(option->name());
}
if ((option = m_ksaneCoreInterface->getOption(KSaneCore::GammaBlueOption)) != nullptr) {
m_optGamB = option;
gammaB = new LabeledGamma(gamma_frm, option);
gammaB = new LabeledGamma(gamma_frm, option, Qt::blue);
gam_frm_l->addWidget(gammaB);
m_handledOptions.insert(option->name());
}
......
......@@ -10,7 +10,7 @@
// KDE includes
#include <klocalizedstring.h>
#include <KLocalizedString>
namespace KSaneIface
{
......
......@@ -8,12 +8,11 @@
#include "labeledcombo.h"
#include <QLabel>
#include <QComboBox>
//KDE includes
#include <klocalizedstring.h>
#include <KLocalizedString>
// Sane includes
extern "C"
......@@ -24,7 +23,7 @@ extern "C"
namespace KSaneIface
{
static const char tmp_binary[] = "Binary";
LabeledCombo::LabeledCombo(QWidget *parent, const QString &ltext, const QStringList &list)
......
......@@ -20,7 +20,7 @@
// KDE includes
#include <klocalizedstring.h>
#include <KLocalizedString>
namespace KSaneIface
{
......
......@@ -11,7 +11,7 @@
//KDE includes
#include <klocalizedstring.h>
#include <KLocalizedString>
#define FLOAT_MULTIP 32768.0
#define TO_DOUBLE(v) (static_cast<double>(v) / FLOAT_MULTIP)
......
......@@ -9,11 +9,11 @@
// Local includes
#include "labeledgamma.h"
#include "ksanebaseoption.h"
#include "ksaneoption.h"
#include <QGroupBox>
#include <klocalizedstring.h>
#include <KLocalizedString>
namespace KSaneIface
{
......@@ -24,7 +24,7 @@ LabeledGamma::LabeledGamma(QWidget *parent, const QString &text, int max)
initGamma(text, max);
}
LabeledGamma::LabeledGamma(QWidget *parent, KSaneOption *option)
LabeledGamma::LabeledGamma(QWidget *parent, KSaneOption *option, QColor color)
: KSaneOptionWidget(parent, option)
{
......@@ -32,15 +32,7 @@ LabeledGamma::LabeledGamma(QWidget *parent, KSaneOption *option)
initGamma(option->title(), max);
connect(this, &LabeledGamma::valuesChanged, option, &KSaneOption::setValue);
connect(option, &KSaneOption::valueChanged, this, &LabeledGamma::setValues);
if (option->name() == QString::fromUtf8(SANE_NAME_GAMMA_VECTOR_R)) {
setColor(Qt::red);
}
if (option->name() == QString::fromUtf8(SANE_NAME_GAMMA_VECTOR_G)) {
setColor(Qt::green);
}
if (option->name() == QString::fromUtf8(SANE_NAME_GAMMA_VECTOR_B)) {
setColor(Qt::blue);
}
setColor(color);
setToolTip(option->description());
}
......
......@@ -38,7 +38,7 @@ public:
*/
LabeledGamma(QWidget *parent, const QString &text, int max);
LabeledGamma(QWidget *parent, KSaneOption *option);
LabeledGamma(QWidget *parent, KSaneOption *option, QColor color = Qt::black);
~LabeledGamma();
void setColor(const QColor &color);
......
......@@ -16,7 +16,7 @@
// KDE includes
#include <kpluralhandlingspinbox.h>
#include <KPluralHandlingSpinBox>
namespace KSaneIface
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment