[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kphotoalbum] Exif: Ported Exif::ReReadDialog to QDialog.
From: Tobias Leupold <tobias.leupold () web ! de>
Date: 2016-08-17 21:04:11
Message-ID: E1ba80R-00087b-0S () code ! kde ! org
[Download RAW message or body]
Git commit 44944f0ef05e0f403e2f788cea66b541f2ab039f by Tobias Leupold.
Committed on 17/08/2016 at 21:03.
Pushed by tleupold into branch 'master'.
Ported Exif::ReReadDialog to QDialog.
M +11 -6 Exif/ReReadDialog.cpp
M +3 -3 Exif/ReReadDialog.h
http://commits.kde.org/kphotoalbum/44944f0ef05e0f403e2f788cea66b541f2ab039f
diff --git a/Exif/ReReadDialog.cpp b/Exif/ReReadDialog.cpp
index d0d2d28..3e701a1 100644
--- a/Exif/ReReadDialog.cpp
+++ b/Exif/ReReadDialog.cpp
@@ -23,6 +23,7 @@
#include <QLabel>
#include <QListWidget>
#include <QVBoxLayout>
+#include <QDialogButtonBox>
#include <KConfigGroup>
#include <KLocalizedString>
@@ -34,15 +35,14 @@
#include <Settings/SettingsData.h>
-Exif::ReReadDialog::ReReadDialog( QWidget* parent )
- :KDialog( parent )
+Exif::ReReadDialog::ReReadDialog(QWidget* parent) : QDialog(parent)
{
setWindowTitle( i18n("Read EXIF info from files") );
QWidget* top = new QWidget;
- setMainWidget( top );
-
QVBoxLayout* lay1 = new QVBoxLayout( top );
+ setLayout(lay1);
+ lay1->addWidget(top);
m_exifDB = new QCheckBox( i18n( "Update EXIF search database" ), top );
lay1->addWidget( m_exifDB );
@@ -70,9 +70,14 @@ Exif::ReReadDialog::ReReadDialog( QWidget* parent )
m_fileList->setSelectionMode( QAbstractItemView::NoSelection );
boxLayout->addWidget( m_fileList );
- connect( this, SIGNAL(okClicked()), this, SLOT(readInfo()) );
+
connect( m_date, SIGNAL(toggled(bool)), m_force_date, SLOT(setEnabled(bool)) );
connect( m_date, SIGNAL(toggled(bool)), this, SLOT(warnAboutDates(bool)) );
+
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
+ connect(buttonBox, &QDialogButtonBox::accepted, this, &ReReadDialog::readInfo);
+ lay1->addWidget(buttonBox);
}
int Exif::ReReadDialog::exec( const DB::FileNameList& list )
@@ -90,7 +95,7 @@ int Exif::ReReadDialog::exec( const DB::FileNameList& list )
m_fileList->clear();
m_fileList->addItems( list.toStringList(DB::RelativeToImageRoot) );
- return KDialog::exec();
+ return QDialog::exec();
}
void Exif::ReReadDialog::readInfo()
diff --git a/Exif/ReReadDialog.h b/Exif/ReReadDialog.h
index 57a2d73..2261dd6 100644
--- a/Exif/ReReadDialog.h
+++ b/Exif/ReReadDialog.h
@@ -19,7 +19,7 @@
#ifndef REREADDIALOG_H
#define REREADDIALOG_H
-#include <KDialog>
+#include <QDialog>
#include <DB/FileNameList.h>
@@ -30,13 +30,13 @@ class QListWidget;
namespace Exif
{
-class ReReadDialog :public KDialog {
+class ReReadDialog : public QDialog {
Q_OBJECT
public:
explicit ReReadDialog( QWidget* parent );
// prevent hiding of base class method:
- using KDialog::exec;
+ using QDialog::exec;
int exec( const DB::FileNameList& );
protected slots:
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic