Changeset View
Changeset View
Standalone View
Standalone View
src/quickaddons/configmodule.h
Show First 20 Lines • Show All 126 Lines • ▼ Show 20 Line(s) | |||||
127 | */ | 127 | */ | ||
128 | class QUICKADDONS_EXPORT ConfigModule : public QObject | 128 | class QUICKADDONS_EXPORT ConfigModule : public QObject | ||
129 | { | 129 | { | ||
130 | Q_OBJECT | 130 | Q_OBJECT | ||
131 | 131 | | |||
132 | Q_PROPERTY(QQuickItem *mainUi READ mainUi CONSTANT) | 132 | Q_PROPERTY(QQuickItem *mainUi READ mainUi CONSTANT) | ||
133 | Q_PROPERTY(KQuickAddons::ConfigModule::Buttons buttons READ buttons WRITE setButtons NOTIFY buttonsChanged) | 133 | Q_PROPERTY(KQuickAddons::ConfigModule::Buttons buttons READ buttons WRITE setButtons NOTIFY buttonsChanged) | ||
134 | Q_PROPERTY(bool needsSave READ needsSave WRITE setNeedsSave NOTIFY needsSaveChanged) | 134 | Q_PROPERTY(bool needsSave READ needsSave WRITE setNeedsSave NOTIFY needsSaveChanged) | ||
135 | Q_PROPERTY(bool representsDefaults READ representsDefaults WRITE setRepresentsDefaults NOTIFY representsDefaultsChanged) | ||||
135 | Q_PROPERTY(QString name READ name CONSTANT) | 136 | Q_PROPERTY(QString name READ name CONSTANT) | ||
136 | Q_PROPERTY(QString description READ description CONSTANT) | 137 | Q_PROPERTY(QString description READ description CONSTANT) | ||
137 | Q_PROPERTY(QString quickHelp READ quickHelp WRITE setQuickHelp NOTIFY quickHelpChanged) | 138 | Q_PROPERTY(QString quickHelp READ quickHelp WRITE setQuickHelp NOTIFY quickHelpChanged) | ||
138 | Q_PROPERTY(QString rootOnlyMessage READ rootOnlyMessage WRITE setRootOnlyMessage NOTIFY rootOnlyMessageChanged) | 139 | Q_PROPERTY(QString rootOnlyMessage READ rootOnlyMessage WRITE setRootOnlyMessage NOTIFY rootOnlyMessageChanged) | ||
139 | Q_PROPERTY(bool useRootOnlyMessage READ useRootOnlyMessage WRITE setUseRootOnlyMessage NOTIFY useRootOnlyMessageChanged) | 140 | Q_PROPERTY(bool useRootOnlyMessage READ useRootOnlyMessage WRITE setUseRootOnlyMessage NOTIFY useRootOnlyMessageChanged) | ||
140 | Q_PROPERTY(bool needsAuthorization READ needsAuthorization WRITE setNeedsAuthorization NOTIFY needsAuthorizationChanged) | 141 | Q_PROPERTY(bool needsAuthorization READ needsAuthorization WRITE setNeedsAuthorization NOTIFY needsAuthorizationChanged) | ||
141 | Q_PROPERTY(int columnWidth READ columnWidth WRITE setColumnWidth NOTIFY columnWidthChanged) | 142 | Q_PROPERTY(int columnWidth READ columnWidth WRITE setColumnWidth NOTIFY columnWidthChanged) | ||
142 | Q_PROPERTY(int depth READ depth NOTIFY depthChanged) | 143 | Q_PROPERTY(int depth READ depth NOTIFY depthChanged) | ||
▲ Show 20 Lines • Show All 132 Lines • ▼ Show 20 Line(s) | 247 | //QML property accessors | |||
275 | void setNeedsSave(bool needs); | 276 | void setNeedsSave(bool needs); | ||
276 | 277 | | |||
277 | /** | 278 | /** | ||
278 | * True when the module has something changed and needs save. | 279 | * True when the module has something changed and needs save. | ||
279 | */ | 280 | */ | ||
280 | bool needsSave(); | 281 | bool needsSave(); | ||
281 | 282 | | |||
282 | /** | 283 | /** | ||
284 | * Set this property to true when the user sets the state of the module | ||||
285 | * to the default settings (e.g. clicking Defaults would do nothing). | ||||
286 | */ | ||||
287 | void setRepresentsDefaults(bool defaults); | ||||
288 | | ||||
289 | /** | ||||
290 | * True when the module state represents the default settings. | ||||
291 | */ | ||||
292 | bool representsDefaults(); | ||||
293 | | ||||
294 | /** | ||||
283 | * Sets the buttons to display. | 295 | * Sets the buttons to display. | ||
284 | * | 296 | * | ||
285 | * Help: shows a "Help" button. | 297 | * Help: shows a "Help" button. | ||
286 | * | 298 | * | ||
287 | * Default: shows a "Use Defaults" button. | 299 | * Default: shows a "Use Defaults" button. | ||
288 | * | 300 | * | ||
289 | * Apply: in kcontrol this will show an "Apply" and "Reset" button, | 301 | * Apply: in kcontrol this will show an "Apply" and "Reset" button, | ||
290 | * in kcmshell this will show an "Ok", "Apply" and "Cancel" button. | 302 | * in kcmshell this will show an "Ok", "Apply" and "Cancel" button. | ||
▲ Show 20 Lines • Show All 221 Lines • ▼ Show 20 Line(s) | 499 | Q_SIGNALS: | |||
512 | * | 524 | * | ||
513 | * This signal is emitted whenever the state of the configuration | 525 | * This signal is emitted whenever the state of the configuration | ||
514 | * shown in the module changes. It allows the module container to | 526 | * shown in the module changes. It allows the module container to | ||
515 | * keep track of unsaved changes. | 527 | * keep track of unsaved changes. | ||
516 | */ | 528 | */ | ||
517 | void needsSaveChanged(); | 529 | void needsSaveChanged(); | ||
518 | 530 | | |||
519 | /** | 531 | /** | ||
532 | * Indicate that the state of the modules contents has changed | ||||
533 | * in a way that it might represents the defaults settings, or | ||||
534 | * stopped representing them. | ||||
535 | */ | ||||
536 | void representsDefaultsChanged(); | ||||
537 | | ||||
538 | /** | ||||
520 | * Emits this signal whenever the need for root authorization to save changes. | 539 | * Emits this signal whenever the need for root authorization to save changes. | ||
521 | */ | 540 | */ | ||
522 | void needsAuthorizationChanged(); | 541 | void needsAuthorizationChanged(); | ||
523 | 542 | | |||
524 | /** | 543 | /** | ||
525 | * Indicate that the module's root message has changed. | 544 | * Indicate that the module's root message has changed. | ||
526 | * | 545 | * | ||
527 | * Emits this signal whenever the module's root message changes. | 546 | * Emits this signal whenever the module's root message changes. | ||
▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines |