|      1 /* | 
     1 /* | 
|      2  *  ZCinema: Zandronum demo launcher | 
     2  *  ZCinema: Zandronum demo launcher | 
|      3  *  Copyright (C) 2013 Santeri Piippo | 
     3  *  Copyright (C) 2013-2015 Teemu Piippo | 
|      4  * | 
     4  * | 
|      5  *  This program is free software: you can redistribute it and/or modify | 
     5  *  This program is free software: you can redistribute it and/or modify | 
|      6  *  it under the terms of the GNU General Public License as published by | 
     6  *  it under the terms of the GNU General Public License as published by | 
|      7  *  the Free Software Foundation, either version 3 of the License, or | 
     7  *  the Free Software Foundation, either version 3 of the License, or | 
|      8  *  (at your option) any later version. | 
     8  *  (at your option) any later version. | 
|     14  * | 
    14  * | 
|     15  *  You should have received a copy of the GNU General Public License | 
    15  *  You should have received a copy of the GNU General Public License | 
|     16  *  along with this program.  If not, see <http://www.gnu.org/licenses/>. | 
    16  *  along with this program.  If not, see <http://www.gnu.org/licenses/>. | 
|     17  */ | 
    17  */ | 
|     18  | 
    18  | 
|     19 #ifndef ZCINEMA_CONFIG_H | 
    19 #pragma once | 
|     20 #define ZCINEMA_CONFIG_H | 
        | 
|     21  | 
        | 
|     22 #include <QDialog> | 
    20 #include <QDialog> | 
|     23 #include "main.h" | 
    21 #include "main.h" | 
|     24 #include "types.h" | 
    22 #include "types.h" | 
|     25  | 
    23  | 
|     26 class QFormLayout; | 
    24 class ConfigWindow : public QDialog | 
|     27 class QNetworkReply; | 
    25 { | 
|     28 class QHBoxLayout; | 
        | 
|     29 class QLabel; | 
        | 
|     30 class QAbstractButton; | 
        | 
|     31 class QLineEdit; | 
        | 
|     32 class Ui_ConfigBox; | 
        | 
|     33 class QNetworkAccessManager; | 
        | 
|     34  | 
        | 
|     35 class ConfigBox : public QDialog { | 
        | 
|     36 	Q_OBJECT | 
    26 	Q_OBJECT | 
|     37 	 | 
    27 	 | 
|     38 public: | 
    28 public: | 
|     39 	explicit ConfigBox (QWidget* parent = null, Qt::WindowFlags f = 0); | 
    29 	typedef QMap<QString, class QLineEdit*> ZanBinaryMap; | 
|     40 	virtual ~ConfigBox(); | 
    30  | 
|     41 	void addPath (str path); | 
    31 	ConfigWindow (QWidget* parent = NULL, Qt::WindowFlags f = 0); | 
|         | 
    32 	virtual ~ConfigWindow(); | 
|         | 
    33 	void addPath (QString path); | 
|     42 	void initFromSettings(); | 
    34 	void initFromSettings(); | 
|     43 	void saveSettings(); | 
    35 	void saveSettings(); | 
|     44 	void initVersions(); | 
    36 	void initVersions(); | 
|     45 	 | 
    37 	 | 
|     46 	static str getBinaryPath (QWidget* parent); | 
    38 	static QString getBinaryPath (QWidget* parent); | 
|     47 	 | 
    39 	 | 
|     48 public slots: | 
    40 public slots: | 
|     49 	void addPath(); | 
    41 	void addPath(); | 
|     50 	void findPath(); | 
    42 	void findPath(); | 
|     51 	void delPath(); | 
    43 	void delPath(); | 
|     52 	void findZanBinary(); | 
    44 	void findZanBinary(); | 
|     53 	void editBinaries(); | 
    45 	void buttonPressed (class QAbstractButton* btn); | 
|     54 	void buttonPressed (QAbstractButton* btn); | 
        | 
|     55 	 | 
    46 	 | 
|     56 private: | 
    47 private: | 
|     57 	Ui_ConfigBox*        ui; | 
    48 	class Ui_ConfigBox* ui; | 
|     58 	list<QLineEdit*>   m_zanBinaries; | 
    49 	ZanBinaryMap m_pathInputFields; | 
|     59 	list<QWidget*>     m_binaryLayoutWidgets; | 
    50 	QList<QWidget*> m_binaryLayoutWidgets; | 
|     60 	QFormLayout*       m_releaseLayout, | 
    51 	class QVBoxLayout* m_releaseLayout; | 
|     61 	           *       m_testLayout; | 
    52 	class QVBoxLayout* m_testLayout; | 
|     62 	 | 
    53 	 | 
|     63 	void addVersion (const str& name, bool isRelease); | 
    54 	void addVersion (const ZandronumVersion& version); | 
|     64 }; | 
    55 }; | 
|     65  | 
        | 
|     66 #endif // ZCINEMA_CONFIG_H | 
        |