Bibletime – a bible study tool
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. /*********
  2. *
  3. * This file is part of BibleTime's source code, http://www.bibletime.info/.
  4. *
  5. * Copyright 1999-2006 by the BibleTime developers.
  6. * The BibleTime source code is licensed under the GNU General Public License version 2.0.
  7. *
  8. **********/
  9. #ifndef COPTIONSDIALOG_H
  10. #define COPTIONSDIALOG_H
  11. #include "cprofilemgr.h"
  12. #include "cbtconfig.h"
  13. #include "util/cpointers.h"
  14. //QT includes
  15. #include <tqwidget.h>
  16. #include <tqframe.h>
  17. #include <tqguardedptr.h>
  18. #include <tqlabel.h>
  19. #include <tqstring.h>
  20. #include <tqmap.h>
  21. #include <tqdict.h>
  22. #include <tqmap.h>
  23. //KDE includes
  24. #include <kdialogbase.h>
  25. #include <kfontdialog.h>
  26. #include <kaccel.h>
  27. #include <kcolorbutton.h>
  28. #include <kapp.h>
  29. #include <klocale.h>
  30. class TQHBox;
  31. class TQCheckBox;
  32. class TQComboBox;
  33. class TQRadioButton;
  34. class TQWidgetStack;
  35. class TDEListBox;
  36. class KKeyChooser;
  37. class KTabCtl;
  38. class TDEHTMLPart;
  39. class TDEActionCollection;
  40. /**
  41. * The optionsdialog of BibleTime
  42. * @author The BibleTime Team
  43. */
  44. class COptionsDialog : public KDialogBase, public CPointers {
  45. Q_OBJECT
  46. public:
  47. COptionsDialog(TQWidget *parent, const char *name, TDEActionCollection* actionCollection);
  48. virtual ~COptionsDialog();
  49. enum Parts {
  50. Startup,
  51. Font,
  52. DisplayTemplates,
  53. Desk,
  54. Hotkeys
  55. };
  56. /** Opens the page which contaisn the given part ID. */
  57. const bool showPart( COptionsDialog::Parts ID );
  58. private:
  59. struct Settings {
  60. struct StartupSettings {
  61. TQCheckBox* showTips;
  62. TQCheckBox* showLogo;
  63. }
  64. startup;
  65. struct SwordSettings {
  66. TQComboBox* standardBible;
  67. TQComboBox* standardCommentary;
  68. TQComboBox* standardLexicon;
  69. TQComboBox* standardDailyDevotional;
  70. TQComboBox* standardHebrewStrong;
  71. TQComboBox* standardGreekStrong;
  72. TQComboBox* standardHebrewMorph;
  73. TQComboBox* standardGreekMorph;
  74. TQCheckBox* lineBreaks;
  75. TQCheckBox* verseNumbers;
  76. TQCheckBox* headings;
  77. TQCheckBox* hebrewPoints;
  78. TQCheckBox* hebrewCantillation;
  79. TQCheckBox* morphSegmentation;
  80. TQCheckBox* greekAccents;
  81. TQCheckBox* textualVariants;
  82. TQCheckBox* scriptureReferences;
  83. }
  84. swords; // not: sword instead of sword -> namespace error
  85. struct KeySettings {
  86. TQComboBox* typeChooser;
  87. TQWidgetStack* keyChooserStack;
  88. struct WindowType {
  89. TQGuardedPtr<KKeyChooser> keyChooser;
  90. TDEActionCollection* actionCollection;
  91. TQString title;
  92. WindowType() {
  93. keyChooser = 0;
  94. actionCollection = 0;
  95. };
  96. WindowType(const TQString& newTitle) {
  97. title = newTitle;
  98. keyChooser = 0;
  99. actionCollection = 0;
  100. }
  101. };
  102. WindowType application;
  103. WindowType general;
  104. WindowType bible;
  105. WindowType commentary;
  106. WindowType lexicon;
  107. WindowType book;
  108. }
  109. keys;
  110. struct DisplayStyleSettings {
  111. TQComboBox* styleChooser;
  112. TDEHTMLPart* stylePreview;
  113. }
  114. displayStyle;
  115. struct FontSettings {
  116. TQComboBox* swordLocaleCombo;
  117. TDEFontChooser* fontChooser;
  118. TQComboBox* usage;
  119. TQCheckBox* useOwnFontBox;
  120. //the pair os to check whether the standard font (bool == false) or whether an own font should be used (true)
  121. TQMap<TQString,CBTConfig::FontSettingsPair> fontMap;
  122. }
  123. fonts;
  124. }
  125. m_settings;
  126. protected slots: // Protected slots
  127. /**
  128. * Called when a new font in the fonts page was selected.
  129. */
  130. void newDisplayWindowFontSelected(const TQFont &);
  131. /**
  132. * Called when the combobox contents is changed
  133. */
  134. void newDisplayWindowFontAreaSelected(const TQString&);
  135. /**
  136. * Called if the OK button was clicked
  137. */
  138. void slotOk();
  139. /**
  140. * Called if the Apply button was clicked
  141. * commented out for the time being. ck
  142. */
  143. void slotApply();
  144. /**
  145. * This slot is called when the "Use own font for language" bo was clicked.
  146. */
  147. void useOwnFontClicked(bool);
  148. /**
  149. * Update the style preview widget
  150. */
  151. void updateStylePreview();
  152. /**
  153. * The type of the keyaccel area changed
  154. */
  155. void slotKeyChooserTypeChanged(const TQString&);
  156. protected: // Protected methods
  157. /**
  158. * Initializes the startup section of the OD.
  159. */
  160. void initDisplay();
  161. /**
  162. * Init Sword section.
  163. */
  164. void initSword();
  165. /**
  166. * Init accel key section.
  167. */
  168. void initAccelerators();
  169. /**
  170. * Init fonts section.
  171. */
  172. void initLanguages();
  173. /** Save the display settings.
  174. */
  175. void saveDisplay();
  176. /** Save the key accel settings.
  177. */
  178. void saveAccelerators();
  179. /** Save the font settings.
  180. */
  181. void saveLanguages();
  182. /** Save the Sword specific settings.
  183. */
  184. void saveSword();
  185. signals: // Signals
  186. void signalSettingsChanged();
  187. };
  188. #endif