Moving preview window to new branch
This commit is contained in:
parent
8f9d74199b
commit
e5a1b2283e
@ -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
|
||||
|
2
main.cpp
2
main.cpp
@ -1,11 +1,11 @@
|
||||
#include "picture.h"
|
||||
#include <QApplication>
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
Picture w;
|
||||
w.show();
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
|
23
picture.cpp
23
picture.cpp
@ -1,11 +1,4 @@
|
||||
#include "picture.h"
|
||||
#include "ui_picture.h"
|
||||
#include <syscall.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#include <QDebug>
|
||||
#include <QImageReader>
|
||||
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("<NO PICTURES>");
|
||||
}
|
||||
}
|
||||
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...");
|
||||
}
|
||||
|
20
picture.h
20
picture.h
@ -4,9 +4,19 @@
|
||||
#include <QMainWindow>
|
||||
#include <QDir>
|
||||
#include <QFileDialog>
|
||||
#include "ui_picture.h"
|
||||
#include "ui_preview.h"
|
||||
#include <syscall.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#include <QDebug>
|
||||
#include <QImageReader>
|
||||
#include <QDialog>
|
||||
|
||||
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
|
||||
|
@ -50,7 +50,7 @@
|
||||
<widget class="QPushButton" name="erase">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>270</x>
|
||||
<x>310</x>
|
||||
<y>10</y>
|
||||
<width>124</width>
|
||||
<height>27</height>
|
||||
|
66
preview.ui
Normal file
66
preview.ui
Normal file
@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog</class>
|
||||
<widget class="QDialog" name="Dialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>432</width>
|
||||
<height>334</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1</x>
|
||||
<y>1</y>
|
||||
<width>120</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Process this picture?</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1</x>
|
||||
<y>22</y>
|
||||
<width>431</width>
|
||||
<height>311</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QGraphicsView" name="image"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="noButton">
|
||||
<property name="text">
|
||||
<string>No (n)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="yesButton">
|
||||
<property name="text">
|
||||
<string>Yes (y)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<zorder>buttonBox</zorder>
|
||||
<zorder>image</zorder>
|
||||
<zorder>buttonBox</zorder>
|
||||
<zorder>noButton</zorder>
|
||||
<zorder>yesButton</zorder>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
Loading…
Reference in New Issue
Block a user