diff --git a/Picture.pro b/Picture.pro index 8de8f4f..9e8b806 100644 --- a/Picture.pro +++ b/Picture.pro @@ -17,7 +17,8 @@ SOURCES += main.cpp\ HEADERS += picture.h -FORMS += picture.ui +FORMS += picture.ui \ + preview.ui unix: CONFIG += link_pkgconfig unix: PKGCONFIG += exiv2 diff --git a/main.cpp b/main.cpp index 313e48b..7aa843b 100644 --- a/main.cpp +++ b/main.cpp @@ -1,11 +1,11 @@ #include "picture.h" #include + int main(int argc, char *argv[]) { QApplication a(argc, argv); Picture w; w.show(); - return a.exec(); } diff --git a/picture.cpp b/picture.cpp index d6b3d97..43eef75 100644 --- a/picture.cpp +++ b/picture.cpp @@ -1,11 +1,4 @@ #include "picture.h" -#include "ui_picture.h" -#include -#include -#include -#include -#include -#include Picture::Picture(QWidget *parent) : QMainWindow(parent), ui(new Ui::Picture){ @@ -42,7 +35,16 @@ void Picture::changeDirectory(){ } void Picture::fillList() { ui->fileList->clear(); - ui->fileList->addItems(directory.entryList()); + //ui->fileList->addItems(directory.entryList()); + foreach(const QString &str,directory.entryList()){ + QImageReader reader(directory.absolutePath()+"/"+str); + if(!reader.format().isEmpty()){ + ui->fileList->addItem(str); + } + } + if(ui->fileList->count()==0){ + ui->fileList->addItem(""); + } } void Picture::on_cd_clicked(){ changeDirectory(); @@ -75,9 +77,6 @@ void Picture::on_refresh_clicked(){ void Picture::on_clearLog_clicked(){ ui->log->setText(""); } - -void Picture::on_erase_pressed() -{ - +void Picture::on_erase_pressed(){ ui->log->append("Erasing metadata from images..."); } diff --git a/picture.h b/picture.h index eb74ad5..4a46ad5 100644 --- a/picture.h +++ b/picture.h @@ -4,9 +4,19 @@ #include #include #include +#include "ui_picture.h" +#include "ui_preview.h" +#include +#include +#include +#include +#include +#include +#include namespace Ui { -class Picture; + class Picture; + class Preview; } class Picture : public QMainWindow @@ -19,21 +29,13 @@ public: private slots: void changeDirectory(); void fillList(); - - void on_cd_clicked(); - void on_erase_clicked(); - void on_refresh_clicked(); - void on_clearLog_clicked(); - void on_erase_pressed(); - private: Ui::Picture *ui; QDir directory; }; - #endif // PICTURE_H diff --git a/picture.ui b/picture.ui index 75cf90b..7997705 100644 --- a/picture.ui +++ b/picture.ui @@ -50,7 +50,7 @@ - 270 + 310 10 124 27 diff --git a/preview.ui b/preview.ui new file mode 100644 index 0000000..92cccb3 --- /dev/null +++ b/preview.ui @@ -0,0 +1,66 @@ + + + Dialog + + + + 0 + 0 + 432 + 334 + + + + Dialog + + + + + 1 + 1 + 120 + 16 + + + + Process this picture? + + + + + + 1 + 22 + 431 + 311 + + + + + + + + + + No (n) + + + + + + + Yes (y) + + + + + + buttonBox + image + buttonBox + noButton + yesButton + + + +