mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-05-03 20:59:59 +02:00
Converted the "project properties" dialog to ConfigDialog.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@1882 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
126
sources/projectconfigpages.h
Normal file
126
sources/projectconfigpages.h
Normal file
@@ -0,0 +1,126 @@
|
||||
#ifndef PROJECTCONFIGPAGES_H
|
||||
#define PROJECTCONFIGPAGES_H
|
||||
#include "configpage.h"
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QETProject;
|
||||
class BorderPropertiesWidget;
|
||||
class TitleBlockPropertiesWidget;
|
||||
class ConductorPropertiesWidget;
|
||||
|
||||
/**
|
||||
This class, derived from ConfigPage, aims at providing the basic skeleton
|
||||
for a project configuration page.
|
||||
*/
|
||||
class ProjectConfigPage : public ConfigPage {
|
||||
Q_OBJECT
|
||||
// Constructor, destructor
|
||||
public:
|
||||
ProjectConfigPage(QETProject *, QWidget * = 0);
|
||||
virtual ~ProjectConfigPage();
|
||||
private:
|
||||
ProjectConfigPage(const ProjectConfigPage &);
|
||||
|
||||
// methods
|
||||
public:
|
||||
virtual QETProject *project() const;
|
||||
virtual QETProject *setProject(QETProject *project, bool = true);
|
||||
virtual void applyConf();
|
||||
/**
|
||||
Apply configuration to the project after user input. This method is
|
||||
automatically called when the ConfigDialog is validated, and only if the
|
||||
project is both non-zero and not read-only.
|
||||
*/
|
||||
virtual void applyProjectConf() = 0;
|
||||
|
||||
protected:
|
||||
virtual void init();
|
||||
/**
|
||||
Use this pure virtual method to initialize your page widgets.
|
||||
*/
|
||||
virtual void initWidgets() = 0;
|
||||
/**
|
||||
Use this pure virtual method to initialize your page layout. This method is
|
||||
always called after initWidgets().
|
||||
*/
|
||||
virtual void initLayout() = 0;
|
||||
/**
|
||||
Use this pure virtual method to fill widgets with project values.
|
||||
*/
|
||||
virtual void readValuesFromProject() = 0;
|
||||
/**
|
||||
Use this pure virtual method to adjust the "read only" state of your page
|
||||
widgets according to the currently edited project.
|
||||
*/
|
||||
virtual void adjustReadOnly() = 0;
|
||||
|
||||
// attributes
|
||||
protected:
|
||||
QETProject *project_; ///< Currently edited project
|
||||
};
|
||||
|
||||
/**
|
||||
This page enables users to configure the main properties of a project.
|
||||
*/
|
||||
class ProjectMainConfigPage : public ProjectConfigPage {
|
||||
Q_OBJECT
|
||||
// Constructor, destructor
|
||||
public:
|
||||
ProjectMainConfigPage(QETProject *, QWidget * = 0);
|
||||
virtual ~ProjectMainConfigPage();
|
||||
private:
|
||||
ProjectMainConfigPage(const ProjectMainConfigPage &);
|
||||
|
||||
// methods
|
||||
public:
|
||||
QString title() const;
|
||||
QIcon icon() const;
|
||||
void applyProjectConf();
|
||||
QString projectTitle() const;
|
||||
|
||||
protected:
|
||||
void initWidgets();
|
||||
void initLayout();
|
||||
void readValuesFromProject();
|
||||
void adjustReadOnly();
|
||||
|
||||
// attributes
|
||||
protected:
|
||||
QLabel *title_label_;
|
||||
QLineEdit *title_value_;
|
||||
};
|
||||
|
||||
/**
|
||||
This page enables users to configure the default properties of diagrams
|
||||
newly added to the edited project.
|
||||
*/
|
||||
class ProjectNewDiagramConfigPage : public ProjectConfigPage {
|
||||
Q_OBJECT
|
||||
// Constructor, destructor
|
||||
public:
|
||||
ProjectNewDiagramConfigPage(QETProject *, QWidget * = 0);
|
||||
virtual ~ProjectNewDiagramConfigPage();
|
||||
private:
|
||||
ProjectNewDiagramConfigPage(const ProjectNewDiagramConfigPage &);
|
||||
|
||||
// methods
|
||||
public:
|
||||
QString title() const;
|
||||
QIcon icon() const;
|
||||
void applyProjectConf();
|
||||
|
||||
protected:
|
||||
void initWidgets();
|
||||
void initLayout();
|
||||
void readValuesFromProject();
|
||||
void adjustReadOnly();
|
||||
|
||||
// attributes
|
||||
private:
|
||||
QLabel *informative_label_;
|
||||
BorderPropertiesWidget *border_;
|
||||
TitleBlockPropertiesWidget *titleblock_;
|
||||
ConductorPropertiesWidget *conductor_;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user