author | zautrix <zautrix> | 2005-06-10 10:31:22 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-10 10:31:22 (UTC) |
commit | e5ca8e0d8d6d08b597253f43de401aa1a99a6abe (patch) (unidiff) | |
tree | c319ba89abbe5cd90647bc38deb0ab1ce46f48e5 /libkdepim/kprefsdialog.h | |
parent | 89c5159208fd982f527117e49d67ea1f90553dbe (diff) | |
download | kdepimpi-e5ca8e0d8d6d08b597253f43de401aa1a99a6abe.zip kdepimpi-e5ca8e0d8d6d08b597253f43de401aa1a99a6abe.tar.gz kdepimpi-e5ca8e0d8d6d08b597253f43de401aa1a99a6abe.tar.bz2 |
config dialog fixes
-rw-r--r-- | libkdepim/kprefsdialog.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libkdepim/kprefsdialog.h b/libkdepim/kprefsdialog.h index efcb86a..52ec809 100644 --- a/libkdepim/kprefsdialog.h +++ b/libkdepim/kprefsdialog.h | |||
@@ -317,129 +317,155 @@ class KPrefsDialogWidString : public KPrefsDialogWid | |||
317 | 317 | ||
318 | This class provides the framework for a preferences dialog. You have to | 318 | This class provides the framework for a preferences dialog. You have to |
319 | subclass it and add the code to create the actual configuration widgets and | 319 | subclass it and add the code to create the actual configuration widgets and |
320 | do the layout management. | 320 | do the layout management. |
321 | 321 | ||
322 | KPrefsDialog provides functions to add subclasses of @ref KPrefsDialogWid. For | 322 | KPrefsDialog provides functions to add subclasses of @ref KPrefsDialogWid. For |
323 | these widgets the reading, writing and setting to default values is handled | 323 | these widgets the reading, writing and setting to default values is handled |
324 | automatically. Custom widgets have to be handled in the functions @ref | 324 | automatically. Custom widgets have to be handled in the functions @ref |
325 | usrReadConfig() and @ref usrWriteConfig(). | 325 | usrReadConfig() and @ref usrWriteConfig(). |
326 | */ | 326 | */ |
327 | class KPrefsDialog : public KDialogBase | 327 | class KPrefsDialog : public KDialogBase |
328 | { | 328 | { |
329 | Q_OBJECT | 329 | Q_OBJECT |
330 | public: | 330 | public: |
331 | /** | 331 | /** |
332 | Create a KPrefsDialog for a KPrefs object. | 332 | Create a KPrefsDialog for a KPrefs object. |
333 | 333 | ||
334 | @param prefs KPrefs object used to access te configuration. | 334 | @param prefs KPrefs object used to access te configuration. |
335 | @param parent Parent widget. | 335 | @param parent Parent widget. |
336 | @param name Widget name. | 336 | @param name Widget name. |
337 | @param modal true, if dialog has to be modal, false for non-modal. | 337 | @param modal true, if dialog has to be modal, false for non-modal. |
338 | */ | 338 | */ |
339 | KPrefsDialog(KPrefs *prefs,QWidget *parent=0,char *name=0,bool modal=false); | 339 | KPrefsDialog(KPrefs *prefs,QWidget *parent=0,char *name=0,bool modal=false); |
340 | /** | 340 | /** |
341 | Destructor. | 341 | Destructor. |
342 | */ | 342 | */ |
343 | virtual ~KPrefsDialog(); | 343 | virtual ~KPrefsDialog(); |
344 | 344 | ||
345 | /** | 345 | /** |
346 | Register a custom KPrefsDialogWid object. | 346 | Register a custom KPrefsDialogWid object. |
347 | */ | 347 | */ |
348 | void addWid(KPrefsDialogWid *); | 348 | void addWid(KPrefsDialogWid *); |
349 | /** | 349 | /** |
350 | Register a @ref KPrefsDialogWidBool object. | 350 | Register a @ref KPrefsDialogWidBool object. |
351 | 351 | ||
352 | @param text Text of bool widget. | 352 | @param text Text of bool widget. |
353 | @param reference Reference to variable storing the setting. | 353 | @param reference Reference to variable storing the setting. |
354 | @param parent Parent widget. | 354 | @param parent Parent widget. |
355 | */ | 355 | */ |
356 | KPrefsDialogWidBool *addWidBool(const QString &text,bool *reference,QWidget *parent); | 356 | KPrefsDialogWidBool *addWidBool(const QString &text,bool *reference,QWidget *parent); |
357 | /** | 357 | /** |
358 | Register a @ref KPrefsDialogWidTime object. | 358 | Register a @ref KPrefsDialogWidTime object. |
359 | 359 | ||
360 | @param text Text of time widget. | 360 | @param text Text of time widget. |
361 | @param reference Reference to variable storing the setting. | 361 | @param reference Reference to variable storing the setting. |
362 | @param parent Parent widget. | 362 | @param parent Parent widget. |
363 | */ | 363 | */ |
364 | KPrefsDialogWidTime *addWidTime(const QString &text,int *reference,QWidget *parent); | 364 | KPrefsDialogWidTime *addWidTime(const QString &text,int *reference,QWidget *parent); |
365 | /** | 365 | /** |
366 | Register a @ref KPrefsDialogWidColor object. | 366 | Register a @ref KPrefsDialogWidColor object. |
367 | 367 | ||
368 | @param text Text of color widget. | 368 | @param text Text of color widget. |
369 | @param reference Reference to variable storing the setting. | 369 | @param reference Reference to variable storing the setting. |
370 | @param parent Parent widget. | 370 | @param parent Parent widget. |
371 | */ | 371 | */ |
372 | KPrefsDialogWidColor *addWidColor(const QString &text,QColor *reference,QWidget *parent); | 372 | KPrefsDialogWidColor *addWidColor(const QString &text,QColor *reference,QWidget *parent); |
373 | /** | 373 | /** |
374 | Register a @ref KPrefsDialogWidRadios object. | 374 | Register a @ref KPrefsDialogWidRadios object. |
375 | 375 | ||
376 | @param text Text of radio button box widget. | 376 | @param text Text of radio button box widget. |
377 | @param reference Reference to variable storing the setting. | 377 | @param reference Reference to variable storing the setting. |
378 | @param parent Parent widget. | 378 | @param parent Parent widget. |
379 | */ | 379 | */ |
380 | KPrefsDialogWidRadios *addWidRadios(const QString &text,int *reference,QWidget *parent); | 380 | KPrefsDialogWidRadios *addWidRadios(const QString &text,int *reference,QWidget *parent); |
381 | /** | 381 | /** |
382 | Register a @ref KPrefsDialogWidString object. | 382 | Register a @ref KPrefsDialogWidString object. |
383 | 383 | ||
384 | @param text Text of string widget. | 384 | @param text Text of string widget. |
385 | @param reference Reference to variable storing the setting. | 385 | @param reference Reference to variable storing the setting. |
386 | @param parent Parent widget. | 386 | @param parent Parent widget. |
387 | */ | 387 | */ |
388 | KPrefsDialogWidString *addWidString(const QString &text,QString *reference,QWidget *parent); | 388 | KPrefsDialogWidString *addWidString(const QString &text,QString *reference,QWidget *parent); |
389 | /** | 389 | /** |
390 | Register a password @ref KPrefsDialogWidString object, with echomode set to QLineEdit::Password. | 390 | Register a password @ref KPrefsDialogWidString object, with echomode set to QLineEdit::Password. |
391 | 391 | ||
392 | @param text Text of string widget. | 392 | @param text Text of string widget. |
393 | @param reference Reference to variable storing the setting. | 393 | @param reference Reference to variable storing the setting. |
394 | @param parent Parent widget. | 394 | @param parent Parent widget. |
395 | */ | 395 | */ |
396 | KPrefsDialogWidString *addWidPassword (const QString &text,QString *reference,QWidget *parent); | 396 | KPrefsDialogWidString *addWidPassword (const QString &text,QString *reference,QWidget *parent); |
397 | /** | 397 | /** |
398 | Register a @ref KPrefsDialogWidFont object. | 398 | Register a @ref KPrefsDialogWidFont object. |
399 | 399 | ||
400 | @param sampleText Sample text of font widget. | 400 | @param sampleText Sample text of font widget. |
401 | @param buttonText Button text of font widget. | 401 | @param buttonText Button text of font widget. |
402 | @param reference Reference to variable storing the setting. | 402 | @param reference Reference to variable storing the setting. |
403 | @param parent Parent widget. | 403 | @param parent Parent widget. |
404 | */ | 404 | */ |
405 | KPrefsDialogWidFont *addWidFont(const QString &sampleText,const QString &buttonText, | 405 | KPrefsDialogWidFont *addWidFont(const QString &sampleText,const QString &buttonText, |
406 | QFont *reference,QWidget *parent); | 406 | QFont *reference,QWidget *parent); |
407 | 407 | ||
408 | public slots: | 408 | public slots: |
409 | /** Set all widgets to default values. */ | 409 | /** Set all widgets to default values. */ |
410 | void setDefaults(); | 410 | void setDefaults(); |
411 | 411 | ||
412 | /** Read preferences from config file. */ | 412 | /** Read preferences from config file. */ |
413 | void readConfig(); | 413 | void readConfig(); |
414 | 414 | ||
415 | /** Write preferences to config file. */ | 415 | /** Write preferences to config file. */ |
416 | void writeConfig(); | 416 | void writeConfig(); |
417 | 417 | ||
418 | signals: | 418 | signals: |
419 | /** Emitted when the a changed configuration has been stored. */ | 419 | /** Emitted when the a changed configuration has been stored. */ |
420 | void configChanged(); | 420 | void configChanged(); |
421 | 421 | ||
422 | protected slots: | 422 | protected slots: |
423 | /** Apply changes to preferences */ | 423 | /** Apply changes to preferences */ |
424 | void slotApply(); | 424 | void slotApply(); |
425 | 425 | ||
426 | void accept(); | 426 | void accept(); |
427 | /** Accept changes to preferences and close dialog */ | 427 | /** Accept changes to preferences and close dialog */ |
428 | void slotOk(); | 428 | void slotOk(); |
429 | 429 | ||
430 | /** Set preferences to default values */ | 430 | /** Set preferences to default values */ |
431 | void slotDefault(); | 431 | void slotDefault(); |
432 | 432 | ||
433 | protected: | 433 | protected: |
434 | /** Implement this to read custom configuration widgets. */ | 434 | /** Implement this to read custom configuration widgets. */ |
435 | virtual void usrReadConfig() {} | 435 | virtual void usrReadConfig() {} |
436 | /** Implement this to write custom configuration widgets. */ | 436 | /** Implement this to write custom configuration widgets. */ |
437 | virtual void usrWriteConfig() {} | 437 | virtual void usrWriteConfig() {} |
438 | 438 | ||
439 | private: | 439 | private: |
440 | KPrefs *mPrefs; | 440 | KPrefs *mPrefs; |
441 | 441 | ||
442 | QPtrList<KPrefsDialogWid> mPrefsWids; | 442 | QPtrList<KPrefsDialogWid> mPrefsWids; |
443 | }; | 443 | }; |
444 | 444 | ||
445 | |||
446 | #include "kcmconfigs/kdepimconfigwidget.h" | ||
447 | class KPimPrefsGlobalDialog : public KPrefsDialog | ||
448 | { | ||
449 | Q_OBJECT | ||
450 | public: | ||
451 | KPimPrefsGlobalDialog(QWidget *parent=0,char *name=0,bool modal=true); | ||
452 | /** | ||
453 | Destructor. | ||
454 | */ | ||
455 | void showTZconfig(); | ||
456 | |||
457 | public slots: | ||
458 | |||
459 | signals: | ||
460 | protected slots: | ||
461 | |||
462 | protected: | ||
463 | void usrReadConfig(); | ||
464 | virtual void usrWriteConfig() ; | ||
465 | |||
466 | private: | ||
467 | KDEPIMConfigWidget* kdelibcfg; | ||
468 | |||
469 | }; | ||
470 | |||
445 | #endif | 471 | #endif |