andre@25: /* Copyright (C) 2015 by ETH Zürich andre@25: * Software engineering by Intevation GmbH andre@0: * andre@0: * This file is Free Software under the GNU GPL (v>=2) andre@0: * and comes with ABSOLUTELY NO WARRANTY! andre@0: * See LICENSE.txt for details. andre@0: */ andre@0: andre@0: andre@0: /** @file The Main UI class. andre@0: * andre@0: * Parent class of all dialogs and graphical user interaction. andre@0: */ andre@0: #include andre@0: #include andre@5: #include andre@0: andre@0: class QPushButton; andre@0: class QDropEvent; andre@0: class QDragLeaveEvent; andre@0: class QDragMoveEvent; andre@0: class QDragEnterEvent; andre@2: class MetaDataView; andre@2: class PNGPlayer; andre@0: andre@0: class MainWindow : public QMainWindow andre@0: { andre@0: Q_OBJECT andre@0: andre@0: public: andre@0: MainWindow(); andre@0: andre@0: protected: andre@0: /** @brief UI setup */ andre@0: void setupGUI(); andre@0: andre@0: /** @brief Cleanup and save the current state */ andre@0: virtual void closeEvent(QCloseEvent *event); andre@0: andre@0: /** @brief Restores the last window state */ andre@0: void readSettings(); andre@0: andre@2: /* The drag drop actions andre@0: void dragEnterEvent(QDragEnterEvent *event); andre@0: void dragMoveEvent(QDragMoveEvent *event); andre@0: void dragLeaveEvent(QDragLeaveEvent *event); andre@0: void dropEvent(QDropEvent *event); andre@2: */ andre@32: andre@32: void setupShortcuts(); andre@32: andre@0: public slots: andre@0: /** @brief set an absolute folder to read a metadata.csv from. */ andre@0: void setFolder(const QString &folder); andre@0: andre@9: /** @brief set an absolute folder to check for subfolders. */ andre@9: void setRootFolder(const QString &folder); andre@9: andre@9: public: andre@9: /** @brief start the folder selection and show afterwards. */ andre@9: void showWithFolderSelect(); andre@9: andre@9: /** @brief start the subfolder selection and show afterwards. */ andre@9: void showSubFolderSelect(); andre@9: andre@0: protected slots: andre@0: /** @brief Show an error dialog to the user. */ andre@0: void showErrorMessage(const QString& errMsg); andre@0: andre@5: /** @brief update the status bar for the image. andre@5: * andre@5: * Function signature is similar to showPicture in pngviewer andre@5: */ andre@5: void showPictureNameStatus(const QString& fileName, int current, andre@5: int max, const QDateTime& timestamp ); andre@5: andre@0: private: andre@0: QSettings mSettings; andre@0: andre@0: QString mCurFolder; andre@9: QString mRootFolder; andre@9: QString mSubFolder; andre@2: MetaDataView *mDataView; andre@2: PNGPlayer *mPlayer; andre@0: };