author | harlekin <harlekin> | 2003-12-05 11:20:37 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-12-05 11:20:37 (UTC) |
commit | 2b37759fc317b5efd9b371210b16117f7d346455 (patch) (unidiff) | |
tree | f99beb5ff1c886f9b41a2d3a34300f8f121cf738 /core/pim/today/todayconfig.cpp | |
parent | 1ef5137234e2b7cd0be2a220a86d848503196269 (diff) | |
download | opie-2b37759fc317b5efd9b371210b16117f7d346455.zip opie-2b37759fc317b5efd9b371210b16117f7d346455.tar.gz opie-2b37759fc317b5efd9b371210b16117f7d346455.tar.bz2 |
today in HEAD up to date
Diffstat (limited to 'core/pim/today/todayconfig.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/today/todayconfig.cpp | 73 |
1 files changed, 16 insertions, 57 deletions
diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp index a60f1d2..bfb5ec6 100644 --- a/core/pim/today/todayconfig.cpp +++ b/core/pim/today/todayconfig.cpp | |||
@@ -1,16 +1,16 @@ | |||
1 | /* | 1 | /* |
2 | * todayconfig.cpp | 2 | * todayconfig.cpp |
3 | * | 3 | * |
4 | * copyright : (c) 2002 by Maximilian Reiß | 4 | * copyright : (c) 2002, 2003 by Maximilian Reiß |
5 | * email : harlekin@handhelds.org | 5 | * email : harlekin@handhelds.org |
6 | * | 6 | * |
7 | */ | 7 | */ |
8 | /*************************************************************************** | 8 | /*************************************************************************** |
9 | * * | 9 | * * |
10 | * This program is free software; you can redistribute it and/or modify * | 10 | * This program is free software; you can redistribute it and/or modify * |
11 | * it under the terms of the GNU General Public License as published by * | 11 | * it under the terms of the GNU General Public License as published by * |
12 | * the Free Software Foundation; either version 2 of the License, or * | 12 | * the Free Software Foundation; either version 2 of the License, or * |
13 | * (at your option) any later version. * | 13 | * (at your option) any later version. * |
14 | * * | 14 | * * |
15 | ***************************************************************************/ | 15 | ***************************************************************************/ |
16 | 16 | ||
@@ -67,72 +67,31 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal ) | |||
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" ); |
70 | m_appletListView->header()->hide(); | 70 | m_appletListView->header()->hide(); |
71 | m_appletListView->setSorting( -1 ); | 71 | m_appletListView->setSorting( -1 ); |
72 | QWhatsThis::add( m_appletListView, tr( "Check a checkbox to activate/deactivate a plugin or use the arrow buttons on the right to change the appearance order" ) ); | 72 | QWhatsThis::add( m_appletListView, tr( "Check a checkbox to activate/deactivate a plugin or use the arrow buttons on the right to change the appearance order" ) ); |
73 | QVBox *vbox1 = new QVBox( hbox1 ); | 73 | QVBox *vbox1 = new QVBox( hbox1 ); |
74 | new ToolButton( vbox1, tr( "Move Up" ), "up", this , SLOT( moveSelectedUp() ) ); | 74 | new ToolButton( vbox1, tr( "Move Up" ), "up", this , SLOT( moveSelectedUp() ) ); |
75 | new ToolButton( vbox1, tr( "Move Down" ), "down", this , SLOT( moveSelectedDown() ) ); | 75 | new ToolButton( vbox1, tr( "Move Down" ), "down", this , SLOT( moveSelectedDown() ) ); |
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 | // Misc tab | ||
79 | tab_3 = new QWidget( TabWidget3, "tab_3" ); | 80 | tab_3 = new QWidget( TabWidget3, "tab_3" ); |
80 | QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 ); | 81 | QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 ); |
81 | tab3Layout->setMargin( 20 ); | 82 | |
82 | QHBox *hbox_auto = new QHBox( tab_3 ); | 83 | m_guiMisc = new TodayConfigMiscBase( tab_3 ); |
83 | TextLabel2 = new QLabel( hbox_auto, "AutoStart" ); | 84 | |
84 | TextLabel2->setText( tr( "autostart on \nresume?\n (Opie only)" ) ); | 85 | tab3Layout->addWidget( m_guiMisc ); |
85 | QWhatsThis::add( TextLabel2 , tr( "Check this if today should be autostarted on resume." ) ); | ||
86 | CheckBoxAuto = new QCheckBox( hbox_auto, "CheckBoxAuto" ); | ||
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 | |||
96 | QHBox *hbox_inactive = new QHBox( tab_3 ); | ||
97 | TimeLabel = new QLabel( hbox_inactive, "TimeLabel" ); | ||
98 | TimeLabel->setText( tr( "minutes inactive" ) ); | ||
99 | QWhatsThis::add( TimeLabel , tr( "How many minutes has the PDA been suspended before the autostart feature kicks in on resume" ) ); | ||
100 | SpinBoxTime = new QSpinBox( hbox_inactive, "TimeSpinner" ); | ||
101 | SpinBoxTime->setMaxValue ( 1440 ); | ||
102 | QWhatsThis::add( SpinBoxTime , tr( "How many minutes has the PDA been suspended before the autostart feature kicks in on resume" ) ); | ||
103 | QHBox *hbox_iconSize = new QHBox( tab_3 ); | ||
104 | QLabel *iconSizeLabel = new QLabel( hbox_iconSize, "iconSizeLabel" ); | ||
105 | iconSizeLabel->setText( tr( "Icon size" ) ); | ||
106 | QWhatsThis::add( iconSizeLabel, tr( "Set the icon size in pixel" ) ); | ||
107 | SpinBoxIconSize = new QSpinBox( hbox_iconSize, "TimeSpinner" ); | ||
108 | SpinBoxIconSize->setMaxValue( 32 ); | ||
109 | QWhatsThis::add( SpinBoxIconSize, tr( "Set the icon size in pixel" ) ); | ||
110 | |||
111 | QHBox *hbox_refresh = new QHBox( tab_3 ); | ||
112 | QLabel *refreshLabel = new QLabel( hbox_refresh ); | ||
113 | refreshLabel->setText( tr( "Refresh" ) ); | ||
114 | QWhatsThis::add( refreshLabel, tr( "How often should Today refresh itself" ) ); | ||
115 | SpinRefresh = new QSpinBox( hbox_refresh ); | ||
116 | SpinRefresh->setMinValue( 0 ); | ||
117 | SpinRefresh->setSuffix( tr( " sec" ) ); | ||
118 | SpinRefresh->setMaxValue ( 7200 ); | ||
119 | SpinRefresh->setSpecialValueText ( tr("never") ); | ||
120 | QWhatsThis::add( SpinRefresh, tr( "How often should Today refresh itself" ) ); | ||
121 | |||
122 | tab3Layout->addWidget( hbox_auto ); | ||
123 | tab3Layout->addWidget( hbox_hide ); | ||
124 | tab3Layout->addWidget( hbox_inactive ); | ||
125 | tab3Layout->addWidget( hbox_iconSize ); | ||
126 | tab3Layout->addWidget( hbox_refresh ); | ||
127 | TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) ); | 86 | TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) ); |
128 | 87 | ||
129 | m_applets_changed = false; | 88 | m_applets_changed = false; |
130 | 89 | ||
131 | connect ( m_appletListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( appletChanged ( ) ) ); | 90 | connect ( m_appletListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( appletChanged ( ) ) ); |
132 | 91 | ||
133 | readConfig(); | 92 | readConfig(); |
134 | showMaximized(); | 93 | showMaximized(); |
135 | } | 94 | } |
136 | 95 | ||
137 | 96 | ||
138 | /** | 97 | /** |
@@ -152,33 +111,33 @@ void TodayConfig::setAutoStart() { | |||
152 | e << QString( "remove" ); | 111 | e << QString( "remove" ); |
153 | e << QString( "today" ); | 112 | e << QString( "today" ); |
154 | } | 113 | } |
155 | } | 114 | } |
156 | 115 | ||
157 | /** | 116 | /** |
158 | * Read the config part | 117 | * Read the config part |
159 | */ | 118 | */ |
160 | void TodayConfig::readConfig() { | 119 | void TodayConfig::readConfig() { |
161 | Config cfg( "today" ); | 120 | Config cfg( "today" ); |
162 | cfg.setGroup( "Autostart" ); | 121 | cfg.setGroup( "Autostart" ); |
163 | m_autoStart = cfg.readNumEntry( "autostart", 1 ); | 122 | m_autoStart = cfg.readNumEntry( "autostart", 1 ); |
164 | CheckBoxAuto->setChecked( m_autoStart ); | 123 | m_guiMisc->CheckBoxAuto->setChecked( m_autoStart ); |
165 | m_autoStartTimer = cfg.readNumEntry( "autostartdelay", 0 ); | 124 | m_autoStartTimer = cfg.readNumEntry( "autostartdelay", 0 ); |
166 | SpinBoxTime->setValue( m_autoStartTimer ); | 125 | m_guiMisc->SpinBoxTime->setValue( m_autoStartTimer ); |
167 | 126 | ||
168 | cfg.setGroup( "General" ); | 127 | cfg.setGroup( "General" ); |
169 | m_iconSize = cfg.readNumEntry( "IconSize", 18 ); | 128 | m_iconSize = cfg.readNumEntry( "IconSize", 18 ); |
170 | SpinBoxIconSize->setValue( m_iconSize ); | 129 | m_guiMisc->SpinBoxIconSize->setValue( m_iconSize ); |
171 | SpinRefresh->setValue( cfg.readNumEntry( "checkinterval", 15000 ) / 1000 ); | 130 | m_guiMisc->SpinRefresh->setValue( cfg.readNumEntry( "checkinterval", 15000 ) / 1000 ); |
172 | CheckBoxHide->setChecked( cfg.readNumEntry( "HideBanner", 0 ) ); | 131 | m_guiMisc->CheckBoxHide->setChecked( cfg.readNumEntry( "HideBanner", 0 ) ); |
173 | 132 | ||
174 | 133 | ||
175 | cfg.setGroup( "Plugins" ); | 134 | cfg.setGroup( "Plugins" ); |
176 | m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); | 135 | m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); |
177 | } | 136 | } |
178 | 137 | ||
179 | /** | 138 | /** |
180 | * Write the config part | 139 | * Write the config part |
181 | */ | 140 | */ |
182 | void TodayConfig::writeConfig() { | 141 | void TodayConfig::writeConfig() { |
183 | Config cfg( "today" ); | 142 | Config cfg( "today" ); |
184 | cfg.setGroup( "Plugins" ); | 143 | cfg.setGroup( "Plugins" ); |
@@ -200,34 +159,34 @@ void TodayConfig::writeConfig() { | |||
200 | } | 159 | } |
201 | if ( list_it.current() == (*it) ) { | 160 | if ( list_it.current() == (*it) ) { |
202 | all_applets << it.key(); | 161 | all_applets << it.key(); |
203 | } | 162 | } |
204 | } | 163 | } |
205 | } | 164 | } |
206 | cfg.writeEntry( "ExcludeApplets", exclude, ',' ); | 165 | cfg.writeEntry( "ExcludeApplets", exclude, ',' ); |
207 | cfg.writeEntry( "IncludeApplets", include, ',' ); | 166 | cfg.writeEntry( "IncludeApplets", include, ',' ); |
208 | cfg.writeEntry( "AllApplets", all_applets, ',' ); | 167 | cfg.writeEntry( "AllApplets", all_applets, ',' ); |
209 | } | 168 | } |
210 | 169 | ||
211 | cfg.setGroup( "Autostart" ); | 170 | cfg.setGroup( "Autostart" ); |
212 | m_autoStart = CheckBoxAuto->isChecked(); | 171 | m_autoStart = m_guiMisc->CheckBoxAuto->isChecked(); |
213 | cfg.writeEntry( "autostart", m_autoStart ); | 172 | cfg.writeEntry( "autostart", m_autoStart ); |
214 | m_autoStartTimer = SpinBoxTime->value(); | 173 | m_autoStartTimer = m_guiMisc->SpinBoxTime->value(); |
215 | cfg.writeEntry( "autostartdelay", m_autoStartTimer ); | 174 | cfg.writeEntry( "autostartdelay", m_autoStartTimer ); |
216 | m_iconSize = SpinBoxIconSize->value(); | 175 | m_iconSize = m_guiMisc->SpinBoxIconSize->value(); |
217 | 176 | ||
218 | cfg.setGroup( "General" ); | 177 | cfg.setGroup( "General" ); |
219 | cfg.writeEntry( "IconSize", m_iconSize ); | 178 | cfg.writeEntry( "IconSize", m_iconSize ); |
220 | cfg.writeEntry( "HideBanner", CheckBoxHide->isChecked() ); | 179 | cfg.writeEntry( "HideBanner", m_guiMisc->CheckBoxHide->isChecked() ); |
221 | cfg.writeEntry( "checkinterval", SpinRefresh->value()*1000 ); | 180 | cfg.writeEntry( "checkinterval", m_guiMisc->SpinRefresh->value()*1000 ); |
222 | 181 | ||
223 | // set autostart settings | 182 | // set autostart settings |
224 | setAutoStart(); | 183 | setAutoStart(); |
225 | } | 184 | } |
226 | 185 | ||
227 | 186 | ||
228 | void TodayConfig::moveSelectedUp() { | 187 | void TodayConfig::moveSelectedUp() { |
229 | QListViewItem *item = m_appletListView->selectedItem(); | 188 | QListViewItem *item = m_appletListView->selectedItem(); |
230 | if ( item && item->itemAbove() ) { | 189 | if ( item && item->itemAbove() ) { |
231 | item->itemAbove()->moveItem( item ); | 190 | item->itemAbove()->moveItem( item ); |
232 | } | 191 | } |
233 | } | 192 | } |