src/versionEditor.h

Sun, 08 Sep 2013 21:57:23 +0300

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Sun, 08 Sep 2013 21:57:23 +0300
changeset 27
b9307871cf10
parent 25
256bb5c6b77f
child 30
6b82f6a3ad53
permissions
-rw-r--r--

clear the rows of the version editor properly when clearing versions; don't save the config when closing the version editor since then changes will apply even if user presses cancel in the main config box

#ifndef ZANDEMO_VERSIONEDITOR_H
#define ZANDEMO_VERSIONEDITOR_H

#include <QDialog>
#include "types.h"

class QCheckBox;
class Ui_VersionEditor;
class Ui_AddVersion;

class VersionEditor : public QDialog {
	Q_OBJECT
	
public:
	enum {
		NameColumn,
		ReleaseColumn,
		PathColumn
	};
	
	explicit VersionEditor (QWidget* parent = 0, Qt::WindowFlags f = 0);
	virtual ~VersionEditor();
	
public slots:
	void add();
	void edit();
	void remove();
	void clear();
	void saveChanges();
	void selectionChanged (int row);
	
private:
	Ui_VersionEditor* m_ui;
	
	void initVersions();
	void addVersion (str name, str path, bool isRelease);
	QCheckBox* getReleaseCheckbox (int i);
};

class AddVersionPrompt : public QDialog {
	Q_OBJECT
	
public:
	explicit AddVersionPrompt (QWidget* parent = 0, Qt::WindowFlags f = 0);
	virtual ~AddVersionPrompt();
	
public:
	str name();
	str path();
	bool release();
	void setName (const str& a);
	void setPath (const str& a);
	void setRelease (bool a);
	
public slots:
	void findPath();
	void fieldsChanged();
	
private:
	Ui_AddVersion* m_ui;
};

#endif // ZANDEMO_VERSIONEDITOR_H

mercurial