umbrello 2.32.3 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

settingsdialog.h
Go to the documentation of this file.
1 /***************************************************************************
2 * This program is free software; you can redistribute it and/or modify *
3 * it under the terms of the GNU General Public License as published by *
4 * the Free Software Foundation; either version 2 of the License, or *
5 * (at your option) any later version. *
6 * *
7 * copyright (C) 2002-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10 #ifndef SETTINGSDIALOG_H
11 #define SETTINGSDIALOG_H
12
13 // app includes
14 #include "multipagedialogbase.h"
15 #include "optionstate.h"
16
17 // kde includes
18 #include <kcombobox.h>
19 #include <kcolorbutton.h>
20 #include <klineedit.h>
21
22 class AutoLayoutOptionPage;
23 class ClassOptionsPage;
24 class CodeImportOptionsPage;
25 class CodeGenOptionsPage;
26 class CodeViewerOptionsPage;
27 class DontAskAgainWidget;
28 class GeneralOptionPage;
29 class KColorButton;
30 class KFontChooser;
31 #if QT_VERSION < 0x050000
32 class KIntSpinBox;
33 #endif
34 class UIOptionsPage;
35
36 class QCheckBox;
37 #if QT_VERSION >= 0x050000
38 class QFontDialog;
39 #endif
40 class QGroupBox;
41 #if QT_VERSION >= 0x050000
42 class QSpinBox;
43 #endif
44 class UMLWidgetStylePage;
45
51 class SettingsDialog : public MultiPageDialogBase
52 {
53 Q_OBJECT
54
55 public:
56 SettingsDialog(QWidget * parent, Settings::OptionState *state);
57 ~SettingsDialog();
58
59 void setCurrentPage(PageType page);
60
61 //public methods
62 bool getChangesApplied() {
63 return m_bChangesApplied;
64 }
65
66 QString getCodeGenerationLanguage();
67
68 protected:
69
70 private:
71 //private structs
72 struct UIWidgets {
73 QCheckBox * rightToLeftUI;
74 QGroupBox * colorGB;
75
76 QCheckBox * textColorCB;
77 QCheckBox * lineColorCB;
78 QCheckBox * fillColorCB;
79 QCheckBox * lineWidthCB;
80 QCheckBox * gridColorCB;
81 QCheckBox * bgColorCB;
82
83 KColorButton * textColorB;
84 KColorButton * lineColorB;
85 KColorButton * fillColorB;
86 KColorButton * gridColorB;
87 KColorButton * bgColorB;
88 #if QT_VERSION >= 0x050000
89 QSpinBox * lineWidthB;
90 #else
91 KIntSpinBox * lineWidthB;
92 #endif
93 QCheckBox * useFillColorCB;
94 }
95 ;//end struct UIWidgets
96
97 //private methods
98 void setupUIPage();
99 void setupGeneralPage();
100 void setupClassPage();
101 void setupCodeImportPage();
102 void setupCodeGenPage();
103 void setupCodeViewerPage(Settings::CodeViewerState options);
104 void setupAutoLayoutPage();
105 void applyPage(KPageWidgetItem*);
106
107 //private attributes
108 DontAskAgainWidget *m_dontAskAgainWidget;
109 Settings::OptionState *m_pOptionState;
110 UMLWidgetStylePage * m_pUserInterfacePage;
111 AutoLayoutOptionPage * m_pAutoLayoutPage;
112 CodeImportOptionsPage * m_pCodeImportPage;
113 CodeGenOptionsPage * m_pCodeGenPage;
114 CodeViewerOptionsPage * m_pCodeViewerPage;
115 GeneralOptionPage * m_pGeneralPage;
116 ClassOptionsPage * m_pClassPage;
117 UIOptionsPage *m_uiOptionsPage;
118
119 bool m_bChangesApplied;
120 KPageWidgetItem *pageCodeViewer, *pageFont, *pageCodeImport, *pageCodeGen,
121 *pageUserInterface, *pageClass, *pageAutoLayout, *pageGeneral;
122
123 private slots:
124 void slotApply();
125 void slotOk();
126 void slotDefault();
127 };
128
129 #endif
DontAskAgainWidget
Definition: dontaskagain.h:67
settingsdialog.h
Settings::OptionState::uiState
UIState uiState
Definition: optionstate.h:328
SettingsDialog::m_pCodeImportPage
CodeImportOptionsPage * m_pCodeImportPage
Definition: settingsdialog.h:112
Icon_Utils::it_Properties_Class
@ it_Properties_Class
Definition: icon_utils.h:79
UIOptionsPage::setDefaults
void setDefaults()
Definition: uioptionspage.cpp:165
SettingsDialog::setupUIPage
void setupUIPage()
Definition: settingsdialog.cpp:111
SettingsDialog::UIWidgets::lineWidthCB
QCheckBox * lineWidthCB
Definition: settingsdialog.h:79
Icon_Utils::it_Properties_UserInterface
@ it_Properties_UserInterface
Definition: icon_utils.h:78
SettingsDialog::m_pCodeGenPage
CodeGenOptionsPage * m_pCodeGenPage
Definition: settingsdialog.h:113
SettingsDialog::UIWidgets::lineWidthB
KIntSpinBox * lineWidthB
Definition: settingsdialog.h:91
SettingsDialog::pageFont
KPageWidgetItem * pageFont
Definition: settingsdialog.h:120
Icon_Utils::it_Properties_CodeImport
@ it_Properties_CodeImport
Definition: icon_utils.h:80
Settings::UIState::font
QFont font
Definition: optionstate.h:92
SettingsDialog
Definition: settingsdialog.h:52
SettingsDialog::setupCodeImportPage
void setupCodeImportPage()
Definition: settingsdialog.cpp:134
SettingsDialog::UIWidgets
Definition: settingsdialog.h:72
MultiPageDialogBase::UserInterfacePage
@ UserInterfacePage
Definition: multipagedialogbase.h:65
SettingsDialog::getCodeGenerationLanguage
QString getCodeGenerationLanguage()
Definition: settingsdialog.cpp:262
UMLWidgetStylePage
Definition: umlwidgetstylepage.h:38
MultiPageDialogBase::setCurrentPage
void setCurrentPage(KPageWidgetItem *page)
Definition: multipagedialogbase.cpp:206
CodeImportOptionsPage::setDefaults
void setDefaults()
Definition: codeimportoptionspage.cpp:52
DontAskAgainHandler::createWidget
DontAskAgainWidget * createWidget()
Definition: dontaskagain.cpp:133
ClassOptionsPage::setDefaults
void setDefaults()
Definition: classoptionspage.cpp:95
ClassOptionsPage::apply
void apply()
Definition: classoptionspage.cpp:115
AutoLayoutOptionPage
Definition: autolayoutoptionpage.h:25
GeneralOptionPage::apply
void apply()
Definition: generaloptionpage.cpp:198
classoptionspage.h
SettingsDialog::m_bChangesApplied
bool m_bChangesApplied
Definition: settingsdialog.h:119
multipagedialogbase.h
SettingsDialog::pageAutoLayout
KPageWidgetItem * pageAutoLayout
Definition: settingsdialog.h:121
SettingsDialog::setupClassPage
void setupClassPage()
Definition: settingsdialog.cpp:127
ClassOptionsPage
A dialog page to display the class related options.
Definition: classoptionspage.h:40
SettingsDialog::UIWidgets::textColorB
KColorButton * textColorB
Definition: settingsdialog.h:83
SettingsDialog::pageGeneral
KPageWidgetItem * pageGeneral
Definition: settingsdialog.h:121
MultiPageDialogBase::FontPage
@ FontPage
Definition: multipagedialogbase.h:63
umbrellosettings.h
codegenoptionspage.h
codevieweroptionspage.h
SettingsDialog::UIWidgets::fillColorCB
QCheckBox * fillColorCB
Definition: settingsdialog.h:78
SettingsDialog::m_dontAskAgainWidget
DontAskAgainWidget * m_dontAskAgainWidget
Definition: settingsdialog.h:108
SettingsDialog::setupGeneralPage
void setupGeneralPage()
Definition: settingsdialog.cpp:118
SettingsDialog::m_pAutoLayoutPage
AutoLayoutOptionPage * m_pAutoLayoutPage
Definition: settingsdialog.h:111
MultiPageDialogBase::accept
void accept()
Definition: multipagedialogbase.cpp:173
SettingsDialog::pageCodeViewer
KPageWidgetItem * pageCodeViewer
Definition: settingsdialog.h:120
Icon_Utils::it_Properties_CodeGeneration
@ it_Properties_CodeGeneration
Definition: icon_utils.h:81
CodeViewerOptionsPage::getOptions
Settings::CodeViewerState getOptions()
Definition: codevieweroptionspage.cpp:57
CodeViewerOptionsPage::apply
void apply()
Definition: codevieweroptionspage.cpp:43
MultiPageDialogBase::resetFontPage
void resetFontPage(QWidget *widget)
Definition: multipagedialogbase.cpp:431
MultiPageDialogBase::CodeImportPage
@ CodeImportPage
Definition: multipagedialogbase.h:60
CodeImportOptionsPage::apply
void apply()
Definition: codeimportoptionspage.cpp:64
MultiPageDialogBase::createPage
QFrame * createPage(const QString &name, const QString &header, Icon_Utils::IconType icon)
Definition: multipagedialogbase.cpp:325
SettingsDialog::SettingsDialog
SettingsDialog(QWidget *parent, Settings::OptionState *state)
Definition: settingsdialog.cpp:46
Icon_Utils::it_Properties_CodeViewer
@ it_Properties_CodeViewer
Definition: icon_utils.h:82
uioptionspage.h
optionstate.h
Icon_Utils::it_Properties_AutoLayout
@ it_Properties_AutoLayout
Definition: icon_utils.h:235
MultiPageDialogBase::applyClicked
void applyClicked()
Definition: moc_multipagedialogbase.cpp:192
SettingsDialog::pageUserInterface
KPageWidgetItem * pageUserInterface
Definition: settingsdialog.h:121
SettingsDialog::m_pClassPage
ClassOptionsPage * m_pClassPage
Definition: settingsdialog.h:116
MultiPageDialogBase::applyFontPage
void applyFontPage(AssociationWidget *widget)
Definition: multipagedialogbase.cpp:441
MultiPageDialogBase::CodeViewerPage
@ CodeViewerPage
Definition: multipagedialogbase.h:62
SettingsDialog::m_pCodeViewerPage
CodeViewerOptionsPage * m_pCodeViewerPage
Definition: settingsdialog.h:114
AutoLayoutOptionPage::apply
void apply()
Definition: autolayoutoptionpage.cpp:68
UIOptionsPage
A dialog page to display the user interface options.
Definition: uioptionspage.h:42
CodeGenOptionsPage
Definition: codegenoptionspage.h:36
SettingsDialog::setupAutoLayoutPage
void setupAutoLayoutPage()
Definition: settingsdialog.cpp:158
SettingsDialog::UIWidgets::rightToLeftUI
QCheckBox * rightToLeftUI
Definition: settingsdialog.h:73
CodeGenOptionsPage::apply
void apply()
Definition: codegenoptionspage.cpp:218
CodeViewerOptionsPage
Definition: codevieweroptionspage.h:23
AutoLayoutOptionPage::setDefaults
void setDefaults()
Definition: autolayoutoptionpage.cpp:58
MultiPageDialogBase::okClicked
void okClicked()
Definition: moc_multipagedialogbase.cpp:186
SettingsDialog::getChangesApplied
bool getChangesApplied()
Definition: settingsdialog.h:62
SettingsDialog::UIWidgets::useFillColorCB
QCheckBox * useFillColorCB
Definition: settingsdialog.h:93
SettingsDialog::pageCodeImport
KPageWidgetItem * pageCodeImport
Definition: settingsdialog.h:120
SettingsDialog::slotApply
void slotApply()
Definition: settingsdialog.cpp:165
SettingsDialog::UIWidgets::textColorCB
QCheckBox * textColorCB
Definition: settingsdialog.h:76
MultiPageDialogBase
Definition: multipagedialogbase.h:52
DontAskAgainWidget::apply
bool apply()
Definition: dontaskagain.cpp:74
SettingsDialog::m_pUserInterfacePage
UMLWidgetStylePage * m_pUserInterfacePage
Definition: settingsdialog.h:110
i18n
#define i18n
Definition: main.cpp:39
SettingsDialog::slotOk
void slotOk()
Definition: settingsdialog.cpp:172
MultiPageDialogBase::ClassPage
@ ClassPage
Definition: multipagedialogbase.h:59
MultiPageDialogBase::setupFontPage
KPageWidgetItem * setupFontPage(const QFont &font)
Definition: multipagedialogbase.cpp:400
SettingsDialog::m_pOptionState
Settings::OptionState * m_pOptionState
Definition: settingsdialog.h:109
MyProject\connect
connect()
Definition: namespaces-multiple.php:5
SettingsDialog::UIWidgets::colorGB
QGroupBox * colorGB
Definition: settingsdialog.h:74
SettingsDialog::applyPage
void applyPage(KPageWidgetItem *)
Definition: settingsdialog.cpp:223
SettingsDialog::m_pGeneralPage
GeneralOptionPage * m_pGeneralPage
Definition: settingsdialog.h:115
GeneralOptionPage::setDefaults
void setDefaults()
Definition: generaloptionpage.cpp:184
SettingsDialog::m_uiOptionsPage
UIOptionsPage * m_uiOptionsPage
Definition: settingsdialog.h:117
Icon_Utils::it_Properties_General
@ it_Properties_General
Definition: icon_utils.h:64
Settings::OptionState
Definition: optionstate.h:314
MultiPageDialogBase::AutoLayoutPage
@ AutoLayoutPage
Definition: multipagedialogbase.h:58
SettingsDialog::setupCodeGenPage
void setupCodeGenPage()
Definition: settingsdialog.cpp:141
SettingsDialog::~SettingsDialog
~SettingsDialog()
Definition: settingsdialog.cpp:67
MultiPageDialogBase::defaultClicked
void defaultClicked()
Definition: moc_multipagedialogbase.cpp:198
CodeImportOptionsPage
Definition: codeimportoptionspage.h:33
umlwidgetstylepage.h
debug_utils.h
icon_utils.h
MultiPageDialogBase::setCaption
void setCaption(const QString &caption)
Definition: multipagedialogbase.cpp:162
autolayoutoptionpage.h
SettingsDialog::slotDefault
void slotDefault()
Definition: settingsdialog.cpp:185
SettingsDialog::UIWidgets::gridColorCB
QCheckBox * gridColorCB
Definition: settingsdialog.h:80
CodeGenOptionsPage::getLanguage
QString getLanguage()
Definition: codegenoptionspage.cpp:347
SettingsDialog::UIWidgets::bgColorB
KColorButton * bgColorB
Definition: settingsdialog.h:87
dontaskagain.h
SettingsDialog::UIWidgets::lineColorCB
QCheckBox * lineColorCB
Definition: settingsdialog.h:77
Settings::OptionState::codeViewerState
CodeViewerState codeViewerState
Definition: optionstate.h:330
DontAskAgainHandler::instance
static DontAskAgainHandler & instance()
Definition: dontaskagain.cpp:138
SettingsDialog::UIWidgets::bgColorCB
QCheckBox * bgColorCB
Definition: settingsdialog.h:81
SettingsDialog::pageCodeGen
KPageWidgetItem * pageCodeGen
Definition: settingsdialog.h:120
SettingsDialog::setCurrentPage
void setCurrentPage(PageType page)
Definition: settingsdialog.cpp:76
generaloptionpage.h
SettingsDialog::UIWidgets::lineColorB
KColorButton * lineColorB
Definition: settingsdialog.h:84
Settings::CodeViewerState
configurable params for the code viewer tool
Definition: codeviewerstate.h:20
DontAskAgainWidget::setDefaults
void setDefaults()
Definition: dontaskagain.cpp:93
SettingsDialog::UIWidgets::gridColorB
KColorButton * gridColorB
Definition: settingsdialog.h:86
SettingsDialog::UIWidgets::fillColorB
KColorButton * fillColorB
Definition: settingsdialog.h:85
SettingsDialog::pageClass
KPageWidgetItem * pageClass
Definition: settingsdialog.h:121
MultiPageDialogBase::GeneralPage
@ GeneralPage
Definition: multipagedialogbase.h:64
SettingsDialog::setupCodeViewerPage
void setupCodeViewerPage(Settings::CodeViewerState options)
Definition: settingsdialog.cpp:150
UIOptionsPage::apply
void apply()
Definition: uioptionspage.cpp:188
codeimportoptionspage.h
GeneralOptionPage
Definition: generaloptionpage.h:38
MultiPageDialogBase::CodeGenerationPage
@ CodeGenerationPage
Definition: multipagedialogbase.h:61
MultiPageDialogBase::currentPage
KPageWidgetItem * currentPage()
Definition: multipagedialogbase.cpp:185
MultiPageDialogBase::PageType
PageType
Available page types.
Definition: multipagedialogbase.h:57
layoutgenerator.h