view src/mainwindow.h @ 58:c941a045147b

Added tag 1.1 for changeset e66918e24edd
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 09 Aug 2016 10:14:26 +0200
parents 36ee5dd46fd3
children
line wrap: on
line source
/* Copyright (C) 2016 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 QLineEdit;
class QCheckBox;
class FileNameRequester;

/**
 * @class MainWindow
 * @brief The mainwindow of the application.
 * @details Holds the input fields and export options.
 */
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();

public slots:
    /** @brief directly set an input file. */
    void setInputFile(const QString& file);

    /** @brief Prefill title with @title. */
    void setTitle(const QString& title);

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

    /** @brief check if all mandataory fields are set. */
    void checkCompleted();

    /** @brief Do the actual conversion. */
    void doConvert();

private:
    QSettings mSettings;

    FileNameRequester* mInputRequester;
    FileNameRequester* mOutRequester;
    QLineEdit *mTitleEdit;
    QPushButton *mConvertBtn;
    QCheckBox *mPdfChk,
              *mXlsxChk,
              *mHtmlChk;
};
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)