Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Commit 1a71f4fc authored by Gregor Mi's avatar Gregor Mi

SaveImageDialog: fix focus handling

parent 31050787
......@@ -179,12 +179,6 @@ Skanlite::Skanlite(const QString& device, QWidget* parent)
// prepare the Show Image Dialog
m_showImgDialog->setButtonIcon(KDialog::User1, QIcon::fromTheme("document-save")); // still needed?
m_showImgDialog->setDefaultButton(KDialog::User1); // still needed?
connect(m_showImgDialog, SIGNAL(user1Clicked()), this, SLOT(saveImage()));
m_showImgDialog = new QDialog(this);
QVBoxLayout *mainLayout = new QVBoxLayout(m_showImgDialog);
......@@ -196,6 +190,9 @@ Skanlite::Skanlite(const QString& device, QWidget* parent)
m_showImgDialogSaveButton = dlgBtnBoxBottom->button(QDialogButtonBox::Save);
m_showImgDialogSaveButton->setDefault(true); // still needed?
m_showImgDialog->resize(640, 480);
connect(dlgBtnBoxBottom, SIGNAL(accepted()), this, SLOT(saveImage()));
connect(dlgBtnBoxBottom, SIGNAL(accepted()), m_showImgDialog, SLOT(accept()));
......@@ -346,8 +343,8 @@ void Skanlite::imageReady(QByteArray &data, int w, int h, int bpl, int f)
m_img = m_ksanew->toQImageSilent(data, w, h, bpl, (KSaneIface::KSaneWidget::ImageFormat)f);
// m_showImgDialog->setDefaultButton(KDialog::User1); // FIXME KF5
m_showImgDialog->exec(); // FIXME KF5 see above
// save has been done as a result of save or then we got cancel
else {
......@@ -83,6 +83,8 @@ class Skanlite : public QDialog
Ui::SkanliteSettings m_settingsUi;
QDialog *m_settingsDialog = nullptr;
QDialog *m_showImgDialog = nullptr;
// having this variable here is not so nice; ShowImgageDialog should be separate class
QPushButton *m_showImgDialogSaveButton = nullptr;
SaveLocation *m_saveLocation = nullptr;
QString m_deviceName;
QMap<QString,QString> m_defaultScanOpts;
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