Changeset View
Changeset View
Standalone View
Standalone View
MainWindow/InvalidDateFinder.cpp
| Show All 34 Lines | |||||
| 35 | #include <QPushButton> | 35 | #include <QPushButton> | ||
| 36 | #include <QVBoxLayout> | 36 | #include <QVBoxLayout> | ||
| 37 | 37 | | |||
| 38 | using namespace MainWindow; | 38 | using namespace MainWindow; | ||
| 39 | 39 | | |||
| 40 | InvalidDateFinder::InvalidDateFinder( QWidget* parent ) | 40 | InvalidDateFinder::InvalidDateFinder( QWidget* parent ) | ||
| 41 | :QDialog( parent ) | 41 | :QDialog( parent ) | ||
| 42 | { | 42 | { | ||
| 43 | setWindowTitle( i18n("Search for Images and Videos with Missing Dates" ) ); | 43 | setWindowTitle(i18nc("@title:window", "Search for Images and Videos with Missing Dates")); | ||
| 44 | QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel); | 44 | QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel); | ||
| 45 | QWidget *mainWidget = new QWidget(this); | 45 | QWidget *mainWidget = new QWidget(this); | ||
| 46 | QVBoxLayout *mainLayout = new QVBoxLayout; | 46 | QVBoxLayout *mainLayout = new QVBoxLayout; | ||
| 47 | setLayout(mainLayout); | 47 | setLayout(mainLayout); | ||
| 48 | mainLayout->addWidget(mainWidget); | 48 | mainLayout->addWidget(mainWidget); | ||
| 49 | 49 | | |||
| 50 | QGroupBox* grp = new QGroupBox( i18n("Which Images and Videos to Display") ); | 50 | QGroupBox* grp = new QGroupBox( i18n("Which Images and Videos to Display") ); | ||
| 51 | QVBoxLayout* grpLay = new QVBoxLayout( grp ); | 51 | QVBoxLayout* grpLay = new QVBoxLayout( grp ); | ||
| Show All 20 Lines | |||||
| 72 | { | 72 | { | ||
| 73 | QDialog::accept(); | 73 | QDialog::accept(); | ||
| 74 | Utilities::ShowBusyCursor dummy; | 74 | Utilities::ShowBusyCursor dummy; | ||
| 75 | 75 | | |||
| 76 | // create the info dialog | 76 | // create the info dialog | ||
| 77 | QDialog* info = new QDialog; | 77 | QDialog* info = new QDialog; | ||
| 78 | QVBoxLayout *mainLayout = new QVBoxLayout; | 78 | QVBoxLayout *mainLayout = new QVBoxLayout; | ||
| 79 | info->setLayout(mainLayout); | 79 | info->setLayout(mainLayout); | ||
| 80 | info->setWindowTitle( i18n("Image Info" ) ); | 80 | info->setWindowTitle(i18nc("@title:window", "Image Info")); | ||
| 81 | 81 | | |||
| 82 | KTextEdit* edit = new KTextEdit( info ); | 82 | KTextEdit* edit = new KTextEdit( info ); | ||
| 83 | mainLayout->addWidget( edit ); | 83 | mainLayout->addWidget( edit ); | ||
| 84 | edit->setText( i18n("<h1>Here you may see the date changes for the displayed items.</h1>") ); | 84 | edit->setText( i18n("<h1>Here you may see the date changes for the displayed items.</h1>") ); | ||
| 85 | 85 | | |||
| 86 | QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok); | 86 | QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok); | ||
| 87 | QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); | 87 | QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); | ||
| 88 | okButton->setDefault(true); | 88 | okButton->setDefault(true); | ||
| 89 | okButton->setShortcut(Qt::CTRL | Qt::Key_Return); | 89 | okButton->setShortcut(Qt::CTRL | Qt::Key_Return); | ||
| 90 | info->connect(buttonBox, &QDialogButtonBox::accepted, info, &QDialog::accept); | 90 | info->connect(buttonBox, &QDialogButtonBox::accepted, info, &QDialog::accept); | ||
| 91 | info->connect(buttonBox, &QDialogButtonBox::rejected, info, &QDialog::reject); | 91 | info->connect(buttonBox, &QDialogButtonBox::rejected, info, &QDialog::reject); | ||
| 92 | mainLayout->addWidget(buttonBox); | 92 | mainLayout->addWidget(buttonBox); | ||
| 93 | 93 | | |||
| 94 | // Now search for the images. | 94 | // Now search for the images. | ||
| 95 | const DB::FileNameList list = DB::ImageDB::instance()->images(); | 95 | const DB::FileNameList list = DB::ImageDB::instance()->images(); | ||
| 96 | DB::FileNameList toBeShown; | 96 | DB::FileNameList toBeShown; | ||
| 97 | QProgressDialog dialog( nullptr); | 97 | QProgressDialog dialog( nullptr); | ||
| 98 | dialog.setWindowTitle(i18n("Reading file properties")); | 98 | dialog.setWindowTitle(i18nc("@title:window", "Reading File Properties")); | ||
| 99 | dialog.setMaximum(list.size()); | 99 | dialog.setMaximum(list.size()); | ||
| 100 | dialog.setValue(0); | 100 | dialog.setValue(0); | ||
| 101 | int progress = 0; | 101 | int progress = 0; | ||
| 102 | 102 | | |||
| 103 | Q_FOREACH(const DB::FileName& fileName, list) { | 103 | Q_FOREACH(const DB::FileName& fileName, list) { | ||
| 104 | dialog.setValue( ++progress ); | 104 | dialog.setValue( ++progress ); | ||
| 105 | qApp->processEvents( QEventLoop::AllEvents ); | 105 | qApp->processEvents( QEventLoop::AllEvents ); | ||
| 106 | if ( dialog.wasCanceled() ) | 106 | if ( dialog.wasCanceled() ) | ||
| ▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines | |||||