view src/mainwindow.h @ 65:defd29b9f25a

Converter: Unescape IMG and Latex references
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 26 Aug 2016 15:26:17 +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)