2015-05-13 07:49:49 -07:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
2015-05-27 02:15:13 -07:00
|
|
|
#include <QProcess>
|
2015-05-13 07:49:49 -07:00
|
|
|
#include <QProgressBar>
|
|
|
|
#include <QMessageBox>
|
|
|
|
#include <QRegExp>
|
|
|
|
#include <QTranslator>
|
2015-05-14 00:28:08 -07:00
|
|
|
#include <QColorDialog>
|
2015-05-15 10:44:37 -07:00
|
|
|
#include <QDate>
|
2015-05-27 02:15:13 -07:00
|
|
|
#include <QCloseEvent>
|
2015-05-31 00:17:24 -07:00
|
|
|
#include <QInputDialog>
|
|
|
|
#include <QActionGroup>
|
2015-10-23 22:05:05 -07:00
|
|
|
#include <QSettings>
|
2015-05-27 02:15:13 -07:00
|
|
|
#ifdef Q_OS_WIN
|
|
|
|
#include <QWinTaskbarProgress>
|
|
|
|
#include <QWinTaskbarButton>
|
|
|
|
#endif
|
|
|
|
|
2015-07-03 22:42:23 -07:00
|
|
|
#include "configdialog.h"
|
2015-05-13 07:49:49 -07:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class MainWindow;
|
|
|
|
}
|
|
|
|
|
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit MainWindow(QWidget *parent = 0);
|
|
|
|
~MainWindow();
|
|
|
|
|
2015-07-03 22:42:23 -07:00
|
|
|
// Interaction with config dialog
|
|
|
|
void closeConfigDialog(void);
|
|
|
|
void updateConfigSettings(const ConfigSettings &newSettings);
|
|
|
|
|
2015-05-13 07:49:49 -07:00
|
|
|
protected:
|
2015-05-27 02:15:13 -07:00
|
|
|
void closeEvent(QCloseEvent* event);
|
2015-05-13 07:49:49 -07:00
|
|
|
// this event is called, when a new translator is loaded or the system language is changed
|
|
|
|
void changeEvent(QEvent*);
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
// this slot is called by the language menu actions
|
|
|
|
void slotLanguageChanged(QAction* action);
|
2015-05-31 00:17:24 -07:00
|
|
|
void slotProfileChanged(QAction* action);
|
2015-05-13 07:49:49 -07:00
|
|
|
|
|
|
|
private slots:
|
2015-05-15 10:44:37 -07:00
|
|
|
QString getOutputFileName();
|
2015-05-13 07:49:49 -07:00
|
|
|
void on_button_generate_clicked();
|
|
|
|
void readOutput();
|
2015-05-27 02:15:13 -07:00
|
|
|
void readError();
|
2015-05-13 07:49:49 -07:00
|
|
|
void mapperFinisched(int exit);
|
2015-05-27 02:15:13 -07:00
|
|
|
void error(QProcess::ProcessError error);
|
2015-06-30 08:39:31 -07:00
|
|
|
void wrapupMapper();
|
2015-05-31 00:17:24 -07:00
|
|
|
void createProfilesMenu();
|
2015-05-13 07:49:49 -07:00
|
|
|
void writeSettings();
|
2015-10-23 22:05:05 -07:00
|
|
|
void writeProfile(QString strProfile);
|
2015-05-13 07:49:49 -07:00
|
|
|
void readSettings();
|
2015-10-23 22:05:05 -07:00
|
|
|
void readProfile(QString strProfile);
|
2015-06-28 23:40:12 -07:00
|
|
|
bool migrateSettingsProfiles();
|
2015-05-13 07:49:49 -07:00
|
|
|
|
|
|
|
void on_browseWorld_clicked();
|
|
|
|
|
|
|
|
void on_saveImage_clicked();
|
|
|
|
|
|
|
|
void on_browseHeightmapNodes_clicked();
|
|
|
|
|
|
|
|
void on_browse_HeightmapColors_clicked();
|
|
|
|
|
2015-05-14 04:07:23 -07:00
|
|
|
void on_browseColorsTxt_clicked();
|
|
|
|
|
2015-05-15 10:44:37 -07:00
|
|
|
void on_actionAbout_MinetestMapperGUI_triggered();
|
|
|
|
|
|
|
|
void on_actionAbout_MinetestMapper_triggered();
|
|
|
|
|
|
|
|
void on_path_OutputImage_textChanged();
|
|
|
|
|
|
|
|
void on_selectHeightmapColor_clicked();
|
|
|
|
|
2015-05-27 02:15:13 -07:00
|
|
|
void on_button_cancel_clicked();
|
|
|
|
|
2015-05-31 00:17:24 -07:00
|
|
|
void on_actionNew_Profile_triggered();
|
|
|
|
|
2015-06-15 06:14:35 -07:00
|
|
|
void on_actionEdit_colors_txt_triggered();
|
|
|
|
|
|
|
|
void on_actionEdit_heightmap_nodes_txt_triggered();
|
|
|
|
|
|
|
|
void on_actionEdit_heightmap_colors_txt_triggered();
|
|
|
|
|
2015-07-02 09:04:54 -07:00
|
|
|
void on_drawScaleLeft_toggled(bool checked);
|
|
|
|
|
|
|
|
void on_drawScaleTop_toggled(bool checked);
|
|
|
|
|
|
|
|
void on_drawHeightscale_toggled(bool checked);
|
2015-07-02 09:04:54 -07:00
|
|
|
|
|
|
|
void on_tilecenter_clicked();
|
|
|
|
|
|
|
|
void on_tileorigin_clicked();
|
2015-07-02 09:04:54 -07:00
|
|
|
|
2015-07-03 22:42:23 -07:00
|
|
|
void on_actionPreferences_triggered();
|
|
|
|
|
2015-05-13 07:49:49 -07:00
|
|
|
private:
|
|
|
|
Ui::MainWindow *ui;
|
|
|
|
QProgressBar *progressBar;
|
2015-05-27 02:15:13 -07:00
|
|
|
QProcess *myProcess;
|
2015-05-31 00:17:24 -07:00
|
|
|
QActionGroup *profileGroup;
|
2015-05-27 02:15:13 -07:00
|
|
|
#ifdef Q_OS_WIN
|
|
|
|
QWinTaskbarButton *taskbarButton;
|
|
|
|
QWinTaskbarProgress *taskbarProgress;
|
|
|
|
#endif
|
2015-07-03 22:42:23 -07:00
|
|
|
ConfigSettings currentSettings;
|
|
|
|
ConfigDialog *configDialog;
|
|
|
|
|
2015-07-02 05:48:40 -07:00
|
|
|
void finishUiInitialisation(void);
|
2015-05-13 07:49:49 -07:00
|
|
|
|
|
|
|
// loads a language by the given language shortcur (e.g. de, en)
|
|
|
|
void loadLanguage(const QString& rLanguage);
|
|
|
|
|
|
|
|
// creates the language menu dynamically from the content of m_langPath
|
|
|
|
void createLanguageMenu(void);
|
|
|
|
|
|
|
|
QTranslator m_translator; // contains the translations for this application
|
|
|
|
QTranslator m_translatorQt; // contains the translations for qt
|
|
|
|
QString m_currLang; // contains the currently loaded language
|
|
|
|
QString m_langPath; // Path of language files. This is always fixed to /languages.
|
2015-10-23 22:05:05 -07:00
|
|
|
QString currentProfile; //contains the name of current loaded profile
|
|
|
|
QSettings settings;
|
2015-05-13 07:49:49 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAINWINDOW_H
|