src/versionEditor.h

Sun, 08 Sep 2013 19:56:11 +0300

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Sun, 08 Sep 2013 19:56:11 +0300
changeset 25
256bb5c6b77f
child 30
6b82f6a3ad53
permissions
-rw-r--r--

Added a version data editor

#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