Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/wizards/kmymoneywizard.h
- This file was moved from kmymoney/widgets/kmymoneywizard.h.
Context not available. | |||||
140 | * @note The implementation of this class is heavily based on ideas found at | 140 | * @note The implementation of this class is heavily based on ideas found at | ||
---|---|---|---|---|---|
141 | * http://doc.trolltech.com/4.1/dialogs-complexwizard.html | 141 | * http://doc.trolltech.com/4.1/dialogs-complexwizard.html | ||
142 | */ | 142 | */ | ||
143 | class KMyMoneyWizardPrivate; | ||||
143 | class KMyMoneyWizard : public QDialog | 144 | class KMyMoneyWizard : public QDialog | ||
144 | { | 145 | { | ||
145 | friend class KMyMoneyWizardPage; | 146 | friend class KMyMoneyWizardPage; | ||
Context not available. | |||||
202 | void createCategory(const QString& txt, QString& id); | 203 | void createCategory(const QString& txt, QString& id); | ||
203 | 204 | | |||
204 | protected: | 205 | protected: | ||
206 | KMyMoneyWizardPrivate * const d_ptr; | ||||
207 | KMyMoneyWizard(KMyMoneyWizardPrivate &dd, QWidget* parent = nullptr, bool modal = false, Qt::WindowFlags f = 0); | ||||
205 | /** | 208 | /** | ||
206 | * Constructor (kept protected, so that one cannot create such an object directly) | 209 | * Constructor (kept protected, so that one cannot create such an object directly) | ||
207 | */ | 210 | */ | ||
208 | explicit KMyMoneyWizard(QWidget* parent = nullptr, bool modal = false, Qt::WindowFlags f = 0); | 211 | explicit KMyMoneyWizard(QWidget* parent = nullptr, bool modal = false, Qt::WindowFlags f = 0); | ||
209 | 212 | | |||
210 | /** | | |||
211 | * This method sets up the first page after creation of the object | | |||
212 | * | | |||
213 | * @param page pointer to first page of wizard | | |||
214 | */ | | |||
215 | void setFirstPage(KMyMoneyWizardPage* page); | | |||
216 | | ||||
217 | /** | | |||
218 | * This method allows to hide or show a @p step. | | |||
219 | * | | |||
220 | * @param step step to be shown/hidden | | |||
221 | * @param hidden hide step if true (the default) or show it if false | | |||
222 | */ | | |||
223 | void setStepHidden(int step, bool hidden = true); | | |||
224 | | ||||
225 | protected slots: | 213 | protected slots: | ||
226 | virtual void accept(); | 214 | void accept() override; | ||
227 | void completeStateChanged(); | 215 | void completeStateChanged(); | ||
228 | 216 | | |||
229 | private: | | |||
230 | void updateStepCount(); | | |||
231 | | ||||
232 | private slots: | 217 | private slots: | ||
233 | void backButtonClicked(); | 218 | void backButtonClicked(); | ||
234 | void nextButtonClicked(); | 219 | void nextButtonClicked(); | ||
235 | void helpButtonClicked(); | 220 | void helpButtonClicked(); | ||
236 | 221 | | |||
237 | protected: | | |||
238 | /* | | |||
239 | * The buttons | | |||
240 | */ | | |||
241 | QPushButton* m_cancelButton; | | |||
242 | QPushButton* m_backButton; | | |||
243 | QPushButton* m_nextButton; | | |||
244 | QPushButton* m_finishButton; | | |||
245 | QPushButton* m_helpButton; | | |||
246 | | ||||
247 | private: | 222 | private: | ||
248 | /** | 223 | Q_DECLARE_PRIVATE(KMyMoneyWizard) | ||
249 | * Switch to page which is currently the top of the history stack. | | |||
250 | * @p oldPage is a pointer to the current page or 0 if no page | | |||
251 | * is shown. | | |||
252 | * | | |||
253 | * @param oldPage pointer to currently displayed page | | |||
254 | */ | | |||
255 | void switchPage(KMyMoneyWizardPage* oldPage); | | |||
256 | | ||||
257 | /** | | |||
258 | * This method selects the step given by @p step. | | |||
259 | * | | |||
260 | * @param step step to be selected | | |||
261 | */ | | |||
262 | void selectStep(int step); | | |||
263 | | ||||
264 | /* | | |||
265 | * The layouts | | |||
266 | */ | | |||
267 | QVBoxLayout* m_wizardLayout; | | |||
268 | QVBoxLayout* m_stepLayout; | | |||
269 | QVBoxLayout* m_pageLayout; | | |||
270 | QHBoxLayout* m_buttonLayout; | | |||
271 | | ||||
272 | /* | | |||
273 | * Some misc. widgets required | | |||
274 | */ | | |||
275 | QFrame* m_stepFrame; | | |||
276 | QLabel* m_stepLabel; | | |||
277 | QPalette m_stepPalette; | | |||
278 | | ||||
279 | QList<QLabel*> m_steps; // the list of step labels | | |||
280 | int m_step; // the currently selected step | | |||
281 | | ||||
282 | /* | | |||
283 | * The title bar | | |||
284 | */ | | |||
285 | KMyMoneyTitleLabel* m_titleLabel; | | |||
286 | | ||||
287 | /* | | |||
288 | * The history stack | | |||
289 | */ | | |||
290 | QList<KMyMoneyWizardPage*> m_history; | | |||
291 | | ||||
292 | QString m_helpContext; | | |||
293 | }; | 224 | }; | ||
294 | 225 | | |||
295 | | ||||
296 | | ||||
297 | #endif | 226 | #endif | ||
Context not available. |