view src/mainwindow.h @ 90:c3000fa6ca56

Add back button to subfolder selection dialog
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 19 Jun 2015 14:27:56 +0200
parents 11aaa9214cfb
children
line wrap: on
line source
/* Copyright (C) 2015 by ETH Zürich
 * Software engineering by Intevation GmbH
 *
 * This file is Free Software under the GNU GPL (v>=2)
 * and comes with ABSOLUTELY NO WARRANTY!
 * See LICENSE.txt for details.
 */


/** @file The Main UI class.
 *
 * Parent class of all dialogs and graphical user interaction.
 */
#include <QMainWindow>
#include <QSettings>

class QPushButton;
class QDropEvent;
class QDragLeaveEvent;
class QDragMoveEvent;
class QDragEnterEvent;
class MetaDataView;
class PNGPlayer;

/**
 * @class MainWindow
 * @brief The mainwindow of the application.
 * @details Holds the pngplayer and the metadataview and binds them together.
 */
class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow();

protected:
    /** @brief UI setup */
    void setupGUI();

    /** @brief Cleanup and save the current state */
    virtual void closeEvent(QCloseEvent *event);

    /** @brief Restores the last window state */
    void readSettings();

    /* The drag drop actions
    void dragEnterEvent(QDragEnterEvent *event);
    void dragMoveEvent(QDragMoveEvent *event);
    void dragLeaveEvent(QDragLeaveEvent *event);
    void dropEvent(QDropEvent *event);
 */

    void setupShortcuts();

public slots:
    /** @brief set an absolute folder to read a metadata.csv from. */
    void setFolder(const QString &folder);

    /** @brief set an absolute folder to check for subfolders. */
    void setRootFolder(const QString &folder);

public:
    /** @brief start the folder selection and show afterwards. */
    void showWithFolderSelect();

    /** @brief start the subfolder selection and show afterwards. */
    void showSubFolderSelect();

protected slots:
    /** @brief Show an error dialog to the user. */
    void showErrorMessage(const QString& errMsg);

    /** @brief update the status bar for the image.
     *
     * Function signature is similar to showPicture in pngviewer
     */
    void showPictureNameStatus(const QString& fileName, int current,
            int max, const QString& timestamp );

    /** @brief Go back to the folder seleciton. */
    void goBack();

private:
    QSettings mSettings;

    QString mCurFolder;
    QString mRootFolder;
    QString mSubFolder;
    MetaDataView *mDataView;
    PNGPlayer *mPlayer;
};
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)