Diffstat (limited to 'core/pim/today/todayconfig.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/today/todayconfig.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp index 0774ccb..a60f1d2 100644 --- a/core/pim/today/todayconfig.cpp +++ b/core/pim/today/todayconfig.cpp | |||
@@ -45,25 +45,25 @@ public: | |||
45 | } | 45 | } |
46 | }; | 46 | }; |
47 | 47 | ||
48 | 48 | ||
49 | /** | 49 | /** |
50 | * The class has currently quite some duplicate code. | 50 | * The class has currently quite some duplicate code. |
51 | * By that way it would be real easy to have it as seperate app in settings tab | 51 | * By that way it would be real easy to have it as seperate app in settings tab |
52 | * | 52 | * |
53 | */ | 53 | */ |
54 | TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal ) | 54 | TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal ) |
55 | : QDialog( parent, name, modal, WStyle_ContextHelp ) { | 55 | : QDialog( parent, name, modal, WStyle_ContextHelp ) { |
56 | 56 | ||
57 | setCaption( tr( "Today config" ) ); | 57 | setCaption( tr( "Today Config" ) ); |
58 | 58 | ||
59 | QVBoxLayout *layout = new QVBoxLayout( this ); | 59 | QVBoxLayout *layout = new QVBoxLayout( this ); |
60 | TabWidget3 = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); | 60 | TabWidget3 = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); |
61 | layout->addWidget( TabWidget3 ); | 61 | layout->addWidget( TabWidget3 ); |
62 | 62 | ||
63 | tab_2 = new QWidget( TabWidget3, "tab_2" ); | 63 | tab_2 = new QWidget( TabWidget3, "tab_2" ); |
64 | QVBoxLayout *tab2Layout = new QVBoxLayout( tab_2, 4 ,4 ); | 64 | QVBoxLayout *tab2Layout = new QVBoxLayout( tab_2, 4 ,4 ); |
65 | QLabel *l = new QLabel( tr( "Load which plugins in what order:" ), tab_2 ); | 65 | QLabel *l = new QLabel( tr( "Load which plugins in what order:" ), tab_2 ); |
66 | tab2Layout->addWidget( l ); | 66 | tab2Layout->addWidget( l ); |
67 | QHBox *hbox1 = new QHBox( tab_2 ); | 67 | QHBox *hbox1 = new QHBox( tab_2 ); |
68 | m_appletListView = new QListView( hbox1 ); | 68 | m_appletListView = new QListView( hbox1 ); |
69 | m_appletListView->addColumn( "PluginList" ); | 69 | m_appletListView->addColumn( "PluginList" ); |
@@ -76,24 +76,32 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal ) | |||
76 | tab2Layout->addWidget( hbox1 ); | 76 | tab2Layout->addWidget( hbox1 ); |
77 | TabWidget3->addTab( tab_2, "pass", tr( "active/order" ) ); | 77 | TabWidget3->addTab( tab_2, "pass", tr( "active/order" ) ); |
78 | 78 | ||
79 | tab_3 = new QWidget( TabWidget3, "tab_3" ); | 79 | tab_3 = new QWidget( TabWidget3, "tab_3" ); |
80 | QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 ); | 80 | QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 ); |
81 | tab3Layout->setMargin( 20 ); | 81 | tab3Layout->setMargin( 20 ); |
82 | QHBox *hbox_auto = new QHBox( tab_3 ); | 82 | QHBox *hbox_auto = new QHBox( tab_3 ); |
83 | TextLabel2 = new QLabel( hbox_auto, "AutoStart" ); | 83 | TextLabel2 = new QLabel( hbox_auto, "AutoStart" ); |
84 | TextLabel2->setText( tr( "autostart on \nresume?\n (Opie only)" ) ); | 84 | TextLabel2->setText( tr( "autostart on \nresume?\n (Opie only)" ) ); |
85 | QWhatsThis::add( TextLabel2 , tr( "Check this if today should be autostarted on resume." ) ); | 85 | QWhatsThis::add( TextLabel2 , tr( "Check this if today should be autostarted on resume." ) ); |
86 | CheckBoxAuto = new QCheckBox( hbox_auto, "CheckBoxAuto" ); | 86 | CheckBoxAuto = new QCheckBox( hbox_auto, "CheckBoxAuto" ); |
87 | QWhatsThis::add( CheckBoxAuto, tr( "Check this if today should be autostarted on resume." ) ); | 87 | QWhatsThis::add( CheckBoxAuto, tr( "Check this if today should be autostarted on resume." ) ); |
88 | |||
89 | QHBox *hbox_hide = new QHBox( tab_3 ); | ||
90 | TextLabel4 = new QLabel( hbox_hide, "HideBanner" ); | ||
91 | TextLabel4->setText( tr( "Tiny Banner" ) ); | ||
92 | //QWhatsThis::add( TextLabel2 , tr( "Check this if today should be autostarted on resume." ) ); | ||
93 | CheckBoxHide = new QCheckBox( hbox_hide, "CheckBoxHide" ); | ||
94 | // QWhatsThis::add( CheckBoxAuto, tr( "Check this if today should be autostarted on resume." ) ); | ||
95 | |||
88 | QHBox *hbox_inactive = new QHBox( tab_3 ); | 96 | QHBox *hbox_inactive = new QHBox( tab_3 ); |
89 | TimeLabel = new QLabel( hbox_inactive, "TimeLabel" ); | 97 | TimeLabel = new QLabel( hbox_inactive, "TimeLabel" ); |
90 | TimeLabel->setText( tr( "minutes inactive" ) ); | 98 | TimeLabel->setText( tr( "minutes inactive" ) ); |
91 | QWhatsThis::add( TimeLabel , tr( "How many minutes has the PDA been suspended before the autostart feature kicks in on resume" ) ); | 99 | QWhatsThis::add( TimeLabel , tr( "How many minutes has the PDA been suspended before the autostart feature kicks in on resume" ) ); |
92 | SpinBoxTime = new QSpinBox( hbox_inactive, "TimeSpinner" ); | 100 | SpinBoxTime = new QSpinBox( hbox_inactive, "TimeSpinner" ); |
93 | SpinBoxTime->setMaxValue ( 1440 ); | 101 | SpinBoxTime->setMaxValue ( 1440 ); |
94 | QWhatsThis::add( SpinBoxTime , tr( "How many minutes has the PDA been suspended before the autostart feature kicks in on resume" ) ); | 102 | QWhatsThis::add( SpinBoxTime , tr( "How many minutes has the PDA been suspended before the autostart feature kicks in on resume" ) ); |
95 | QHBox *hbox_iconSize = new QHBox( tab_3 ); | 103 | QHBox *hbox_iconSize = new QHBox( tab_3 ); |
96 | QLabel *iconSizeLabel = new QLabel( hbox_iconSize, "iconSizeLabel" ); | 104 | QLabel *iconSizeLabel = new QLabel( hbox_iconSize, "iconSizeLabel" ); |
97 | iconSizeLabel->setText( tr( "Icon size" ) ); | 105 | iconSizeLabel->setText( tr( "Icon size" ) ); |
98 | QWhatsThis::add( iconSizeLabel, tr( "Set the icon size in pixel" ) ); | 106 | QWhatsThis::add( iconSizeLabel, tr( "Set the icon size in pixel" ) ); |
99 | SpinBoxIconSize = new QSpinBox( hbox_iconSize, "TimeSpinner" ); | 107 | SpinBoxIconSize = new QSpinBox( hbox_iconSize, "TimeSpinner" ); |
@@ -103,24 +111,25 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal ) | |||
103 | QHBox *hbox_refresh = new QHBox( tab_3 ); | 111 | QHBox *hbox_refresh = new QHBox( tab_3 ); |
104 | QLabel *refreshLabel = new QLabel( hbox_refresh ); | 112 | QLabel *refreshLabel = new QLabel( hbox_refresh ); |
105 | refreshLabel->setText( tr( "Refresh" ) ); | 113 | refreshLabel->setText( tr( "Refresh" ) ); |
106 | QWhatsThis::add( refreshLabel, tr( "How often should Today refresh itself" ) ); | 114 | QWhatsThis::add( refreshLabel, tr( "How often should Today refresh itself" ) ); |
107 | SpinRefresh = new QSpinBox( hbox_refresh ); | 115 | SpinRefresh = new QSpinBox( hbox_refresh ); |
108 | SpinRefresh->setMinValue( 0 ); | 116 | SpinRefresh->setMinValue( 0 ); |
109 | SpinRefresh->setSuffix( tr( " sec" ) ); | 117 | SpinRefresh->setSuffix( tr( " sec" ) ); |
110 | SpinRefresh->setMaxValue ( 7200 ); | 118 | SpinRefresh->setMaxValue ( 7200 ); |
111 | SpinRefresh->setSpecialValueText ( tr("never") ); | 119 | SpinRefresh->setSpecialValueText ( tr("never") ); |
112 | QWhatsThis::add( SpinRefresh, tr( "How often should Today refresh itself" ) ); | 120 | QWhatsThis::add( SpinRefresh, tr( "How often should Today refresh itself" ) ); |
113 | 121 | ||
114 | tab3Layout->addWidget( hbox_auto ); | 122 | tab3Layout->addWidget( hbox_auto ); |
123 | tab3Layout->addWidget( hbox_hide ); | ||
115 | tab3Layout->addWidget( hbox_inactive ); | 124 | tab3Layout->addWidget( hbox_inactive ); |
116 | tab3Layout->addWidget( hbox_iconSize ); | 125 | tab3Layout->addWidget( hbox_iconSize ); |
117 | tab3Layout->addWidget( hbox_refresh ); | 126 | tab3Layout->addWidget( hbox_refresh ); |
118 | TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) ); | 127 | TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) ); |
119 | 128 | ||
120 | m_applets_changed = false; | 129 | m_applets_changed = false; |
121 | 130 | ||
122 | connect ( m_appletListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( appletChanged ( ) ) ); | 131 | connect ( m_appletListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( appletChanged ( ) ) ); |
123 | 132 | ||
124 | readConfig(); | 133 | readConfig(); |
125 | showMaximized(); | 134 | showMaximized(); |
126 | } | 135 | } |
@@ -151,24 +160,25 @@ void TodayConfig::setAutoStart() { | |||
151 | void TodayConfig::readConfig() { | 160 | void TodayConfig::readConfig() { |
152 | Config cfg( "today" ); | 161 | Config cfg( "today" ); |
153 | cfg.setGroup( "Autostart" ); | 162 | cfg.setGroup( "Autostart" ); |
154 | m_autoStart = cfg.readNumEntry( "autostart", 1 ); | 163 | m_autoStart = cfg.readNumEntry( "autostart", 1 ); |
155 | CheckBoxAuto->setChecked( m_autoStart ); | 164 | CheckBoxAuto->setChecked( m_autoStart ); |
156 | m_autoStartTimer = cfg.readNumEntry( "autostartdelay", 0 ); | 165 | m_autoStartTimer = cfg.readNumEntry( "autostartdelay", 0 ); |
157 | SpinBoxTime->setValue( m_autoStartTimer ); | 166 | SpinBoxTime->setValue( m_autoStartTimer ); |
158 | 167 | ||
159 | cfg.setGroup( "General" ); | 168 | cfg.setGroup( "General" ); |
160 | m_iconSize = cfg.readNumEntry( "IconSize", 18 ); | 169 | m_iconSize = cfg.readNumEntry( "IconSize", 18 ); |
161 | SpinBoxIconSize->setValue( m_iconSize ); | 170 | SpinBoxIconSize->setValue( m_iconSize ); |
162 | SpinRefresh->setValue( cfg.readNumEntry( "checkinterval", 15000 ) / 1000 ); | 171 | SpinRefresh->setValue( cfg.readNumEntry( "checkinterval", 15000 ) / 1000 ); |
172 | CheckBoxHide->setChecked( cfg.readNumEntry( "HideBanner", 0 ) ); | ||
163 | 173 | ||
164 | 174 | ||
165 | cfg.setGroup( "Plugins" ); | 175 | cfg.setGroup( "Plugins" ); |
166 | m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); | 176 | m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); |
167 | } | 177 | } |
168 | 178 | ||
169 | /** | 179 | /** |
170 | * Write the config part | 180 | * Write the config part |
171 | */ | 181 | */ |
172 | void TodayConfig::writeConfig() { | 182 | void TodayConfig::writeConfig() { |
173 | Config cfg( "today" ); | 183 | Config cfg( "today" ); |
174 | cfg.setGroup( "Plugins" ); | 184 | cfg.setGroup( "Plugins" ); |
@@ -198,24 +208,25 @@ void TodayConfig::writeConfig() { | |||
198 | cfg.writeEntry( "AllApplets", all_applets, ',' ); | 208 | cfg.writeEntry( "AllApplets", all_applets, ',' ); |
199 | } | 209 | } |
200 | 210 | ||
201 | cfg.setGroup( "Autostart" ); | 211 | cfg.setGroup( "Autostart" ); |
202 | m_autoStart = CheckBoxAuto->isChecked(); | 212 | m_autoStart = CheckBoxAuto->isChecked(); |
203 | cfg.writeEntry( "autostart", m_autoStart ); | 213 | cfg.writeEntry( "autostart", m_autoStart ); |
204 | m_autoStartTimer = SpinBoxTime->value(); | 214 | m_autoStartTimer = SpinBoxTime->value(); |
205 | cfg.writeEntry( "autostartdelay", m_autoStartTimer ); | 215 | cfg.writeEntry( "autostartdelay", m_autoStartTimer ); |
206 | m_iconSize = SpinBoxIconSize->value(); | 216 | m_iconSize = SpinBoxIconSize->value(); |
207 | 217 | ||
208 | cfg.setGroup( "General" ); | 218 | cfg.setGroup( "General" ); |
209 | cfg.writeEntry( "IconSize", m_iconSize ); | 219 | cfg.writeEntry( "IconSize", m_iconSize ); |
220 | cfg.writeEntry( "HideBanner", CheckBoxHide->isChecked() ); | ||
210 | cfg.writeEntry( "checkinterval", SpinRefresh->value()*1000 ); | 221 | cfg.writeEntry( "checkinterval", SpinRefresh->value()*1000 ); |
211 | 222 | ||
212 | // set autostart settings | 223 | // set autostart settings |
213 | setAutoStart(); | 224 | setAutoStart(); |
214 | } | 225 | } |
215 | 226 | ||
216 | 227 | ||
217 | void TodayConfig::moveSelectedUp() { | 228 | void TodayConfig::moveSelectedUp() { |
218 | QListViewItem *item = m_appletListView->selectedItem(); | 229 | QListViewItem *item = m_appletListView->selectedItem(); |
219 | if ( item && item->itemAbove() ) { | 230 | if ( item && item->itemAbove() ) { |
220 | item->itemAbove()->moveItem( item ); | 231 | item->itemAbove()->moveItem( item ); |
221 | } | 232 | } |