summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-03-24 20:51:53 (UTC)
committer harlekin <harlekin>2003-03-24 20:51:53 (UTC)
commite0c0eaf4b77f87d27cd56ffae62bb8cc702753c1 (patch) (unidiff)
tree9e07a20530b8e8777398f00337f9d6d05b74f1fb
parent2bf0790dac098fd24a20161f32cd848a87fe56ca (diff)
downloadopie-e0c0eaf4b77f87d27cd56ffae62bb8cc702753c1.zip
opie-e0c0eaf4b77f87d27cd56ffae62bb8cc702753c1.tar.gz
opie-e0c0eaf4b77f87d27cd56ffae62bb8cc702753c1.tar.bz2
configuration for hte big busy cursor
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/launcher/tabssettings.cpp52
-rw-r--r--core/settings/launcher/tabssettings.h2
2 files changed, 31 insertions, 23 deletions
diff --git a/core/settings/launcher/tabssettings.cpp b/core/settings/launcher/tabssettings.cpp
index 9d6e8c1..7cd00bd 100644
--- a/core/settings/launcher/tabssettings.cpp
+++ b/core/settings/launcher/tabssettings.cpp
@@ -15,7 +15,7 @@
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
17..}^=.=       =       ; Public License for more details. 17..}^=.=       =       ; Public License for more details.
18++=   -.     .`     .: 18++=   -.     .`     .:
19 :     =  ...= . :.=- You should have received a copy of the GNU 19 :     =  ...= . :.=- You should have received a copy of the GNU
20 -.   .:....=;==+<; General Public License along with this file; 20 -.   .:....=;==+<; General Public License along with this file;
21  -_. . .   )=.  = see the file COPYING. If not, write to the 21  -_. . .   )=.  = see the file COPYING. If not, write to the
@@ -62,7 +62,7 @@ TabsSettings::TabsSettings ( QWidget *parent, const char *name )
62 lay-> addMultiCellWidget ( m_list, 1, 4, 0, 0 ); 62 lay-> addMultiCellWidget ( m_list, 1, 4, 0, 0 );
63 63
64 QWhatsThis::add ( m_list, tr( "foobar" )); 64 QWhatsThis::add ( m_list, tr( "foobar" ));
65 65
66 QPushButton *p1, *p2, *p3; 66 QPushButton *p1, *p2, *p3;
67 p1 = new QPushButton ( tr( "New" ), this ); 67 p1 = new QPushButton ( tr( "New" ), this );
68 lay-> addWidget ( p1, 1, 1 ); 68 lay-> addWidget ( p1, 1, 1 );
@@ -78,18 +78,22 @@ TabsSettings::TabsSettings ( QWidget *parent, const char *name )
78 78
79 lay-> setRowStretch ( 4, 10 ); 79 lay-> setRowStretch ( 4, 10 );
80 80
81 m_bigbusy = new QCheckBox( tr( "Enable big busy indicator" ), this );
82 lay-> addMultiCellWidget ( m_bigbusy, 5, 5, 0, 1 );
83
81 m_busyblink = new QCheckBox ( tr( "Enable blinking busy indicator" ), this ); 84 m_busyblink = new QCheckBox ( tr( "Enable blinking busy indicator" ), this );
82 lay-> addMultiCellWidget ( m_busyblink, 5, 5, 0, 1 ); 85 lay-> addMultiCellWidget ( m_busyblink, 6, 6, 0, 1 );
83 86
84 p1-> setEnabled ( false ); 87 p1-> setEnabled ( false );
85 p3-> setEnabled ( false ); 88 p3-> setEnabled ( false );
86 89
87 init ( ); 90 init ( );
88 91
89 QWhatsThis::add ( m_list, tr( "Select the Launcher Tab you want to edit or delete." )); 92 QWhatsThis::add ( m_list, tr( "Select the Launcher Tab you want to edit or delete." ));
90 QWhatsThis::add ( p1, tr( "Adds a new Tab to the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); 93 QWhatsThis::add ( p1, tr( "Adds a new Tab to the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." ));
91 QWhatsThis::add ( p2, tr( "Opens a new dialog to customize the select Tab." )); 94 QWhatsThis::add ( p2, tr( "Opens a new dialog to customize the select Tab." ));
92 QWhatsThis::add ( p3, tr( "Deletes a Tab from the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); 95 QWhatsThis::add ( p3, tr( "Deletes a Tab from the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." ));
96 QWhatsThis::add ( m_bigbusy, tr( "Activate this, if you want a big busy indicator in the middle of the screen instead of the one in taskbar." ));
93 QWhatsThis::add ( m_busyblink, tr( "Activate this, if you want a blinking busy indicator for starting applications in the Launcher." )); 97 QWhatsThis::add ( m_busyblink, tr( "Activate this, if you want a blinking busy indicator for starting applications in the Launcher." ));
94} 98}
95 99
@@ -100,7 +104,7 @@ void TabsSettings::init ( )
100 104
101 m_list-> insertItem ( tr( "All Tabs" )); 105 m_list-> insertItem ( tr( "All Tabs" ));
102 m_ids << GLOBALID; 106 m_ids << GLOBALID;
103 107
104 for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { 108 for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) {
105 m_list-> insertItem ( rootFolder. typePixmap ( *it ), rootFolder. typeName ( *it )); 109 m_list-> insertItem ( rootFolder. typePixmap ( *it ), rootFolder. typeName ( *it ));
106 m_ids << *it; 110 m_ids << *it;
@@ -114,11 +118,13 @@ void TabsSettings::init ( )
114 Config cfg ( "Launcher" ); 118 Config cfg ( "Launcher" );
115 119
116 readTabSettings ( cfg ); 120 readTabSettings ( cfg );
117 121
118 cfg. setGroup ( "GUI" ); 122 cfg. setGroup ( "GUI" );
119 m_busyblink-> setChecked ( cfg. readEntry ( "BusyType" ). lower ( ) == "blink" ); 123 m_busyblink-> setChecked ( cfg. readEntry ( "BusyType" ). lower ( ) == "blink" );
124 m_bigbusy->setChecked( cfg. readBoolEntry ( "BigBusy" ) );
120} 125}
121 126
127
122void TabsSettings::readTabSettings ( Config &cfg ) 128void TabsSettings::readTabSettings ( Config &cfg )
123{ 129{
124 QString grp ( "Tab %1" ); // No tr 130 QString grp ( "Tab %1" ); // No tr
@@ -136,7 +142,7 @@ void TabsSettings::readTabSettings ( Config &cfg )
136 global_def. m_font_weight = 50; 142 global_def. m_font_weight = 50;
137 global_def. m_font_italic = false; 143 global_def. m_font_italic = false;
138 global_def. m_changed = false; 144 global_def. m_changed = false;
139 145
140 146
141 for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { 147 for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) {
142 TabConfig tc = ( it != m_ids. begin ( )) ? m_tabs [GLOBALID] : global_def; 148 TabConfig tc = ( it != m_ids. begin ( )) ? m_tabs [GLOBALID] : global_def;
@@ -167,19 +173,19 @@ void TabsSettings::readTabSettings ( Config &cfg )
167 tc. m_font_size = f [1]. toInt ( ); 173 tc. m_font_size = f [1]. toInt ( );
168 tc. m_font_weight = f [2]. toInt ( ); 174 tc. m_font_weight = f [2]. toInt ( );
169 tc. m_font_italic = ( f [3]. toInt ( )); 175 tc. m_font_italic = ( f [3]. toInt ( ));
170 } 176 }
171 m_tabs [*it] = tc; 177 m_tabs [*it] = tc;
172 } 178 }
173 179
174 // if all tabs have the same config, then initialize the GLOBALID tab to these values 180 // if all tabs have the same config, then initialize the GLOBALID tab to these values
175 181
176 TabConfig *first = 0; 182 TabConfig *first = 0;
177 bool same = true; 183 bool same = true;
178 184
179 for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { 185 for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) {
180 if ( *it == GLOBALID ) 186 if ( *it == GLOBALID )
181 continue; 187 continue;
182 else if ( !first ) 188 else if ( !first )
183 first = &m_tabs [*it]; 189 first = &m_tabs [*it];
184 else 190 else
185 same &= ( *first == m_tabs [*it] ); 191 same &= ( *first == m_tabs [*it] );
@@ -203,7 +209,7 @@ void TabsSettings::accept ( )
203 209
204 if ( !tc. m_changed ) 210 if ( !tc. m_changed )
205 continue; 211 continue;
206 212
207 cfg. setGroup ( grp. arg ( *it )); 213 cfg. setGroup ( grp. arg ( *it ));
208 switch ( tc. m_view ) { 214 switch ( tc. m_view ) {
209 case TabConfig::Icon: 215 case TabConfig::Icon:
@@ -227,7 +233,7 @@ void TabsSettings::accept ( )
227 } 233 }
228 else 234 else
229 cfg. removeEntry ( "Font" ); 235 cfg. removeEntry ( "Font" );
230 236
231 QCopEnvelope be ( "QPE/Launcher", "setTabBackground(QString,int,QString)" ); 237 QCopEnvelope be ( "QPE/Launcher", "setTabBackground(QString,int,QString)" );
232 238
233 switch ( tc. m_bg_type ) { 239 switch ( tc. m_bg_type ) {
@@ -257,10 +263,12 @@ void TabsSettings::accept ( )
257 263
258 tc. m_changed = false; 264 tc. m_changed = false;
259 } 265 }
260 cfg. setGroup ( "GUI" ); 266 cfg. setGroup ( "GUI" );
261 QString busytype = QString ( m_busyblink-> isChecked ( ) ? "blink" : "" ); 267 QString busytype = QString ( m_busyblink-> isChecked ( ) ? "blink" : "" );
262
263 cfg. writeEntry ( "BusyType", busytype ); 268 cfg. writeEntry ( "BusyType", busytype );
269
270 cfg. writeEntry ( "BigBusy", m_bigbusy->isChecked( ) );
271
264 { 272 {
265 QCopEnvelope e ( "QPE/Launcher", "setBusyIndicatorType(QString)" ); 273 QCopEnvelope e ( "QPE/Launcher", "setBusyIndicatorType(QString)" );
266 e << busytype; 274 e << busytype;
@@ -275,7 +283,7 @@ void TabsSettings::newClicked ( )
275void TabsSettings::deleteClicked ( ) 283void TabsSettings::deleteClicked ( )
276{ 284{
277 int ind = m_list-> currentItem ( ); 285 int ind = m_list-> currentItem ( );
278 286
279 if ( ind < 0 ) 287 if ( ind < 0 )
280 return; 288 return;
281 289
@@ -285,26 +293,26 @@ void TabsSettings::deleteClicked ( )
285void TabsSettings::editClicked ( ) 293void TabsSettings::editClicked ( )
286{ 294{
287 int ind = m_list-> currentItem ( ); 295 int ind = m_list-> currentItem ( );
288 296
289 if ( ind < 0 ) 297 if ( ind < 0 )
290 return; 298 return;
291 299
292 TabConfig tc = m_tabs [m_ids [ind]]; 300 TabConfig tc = m_tabs [m_ids [ind]];
293 301
294 TabDialog *d = new TabDialog ( m_list-> pixmap ( ind ), m_list-> text ( ind ), tc, this, "TabDialog", true ); 302 TabDialog *d = new TabDialog ( m_list-> pixmap ( ind ), m_list-> text ( ind ), tc, this, "TabDialog", true );
295 303
296 d-> showMaximized ( ); 304 d-> showMaximized ( );
297 if ( d-> exec ( ) == QDialog::Accepted ) { 305 if ( d-> exec ( ) == QDialog::Accepted ) {
298 tc. m_changed = true; 306 tc. m_changed = true;
299 m_tabs [m_ids [ind]] = tc; 307 m_tabs [m_ids [ind]] = tc;
300 308
301 if ( m_ids [ind] == GLOBALID ) { 309 if ( m_ids [ind] == GLOBALID ) {
302 for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { 310 for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) {
303 if ( *it != GLOBALID ) 311 if ( *it != GLOBALID )
304 m_tabs [*it] = tc; 312 m_tabs [*it] = tc;
305 } 313 }
306 } 314 }
307 } 315 }
308 316
309 delete d; 317 delete d;
310} 318}
diff --git a/core/settings/launcher/tabssettings.h b/core/settings/launcher/tabssettings.h
index 47fcee2..439def6 100644
--- a/core/settings/launcher/tabssettings.h
+++ b/core/settings/launcher/tabssettings.h
@@ -59,7 +59,7 @@ private:
59 //QString currentTab; 59 //QString currentTab;
60 QStringList m_ids; 60 QStringList m_ids;
61 QMap <QString, TabConfig> m_tabs; 61 QMap <QString, TabConfig> m_tabs;
62 QCheckBox *m_busyblink; 62 QCheckBox *m_busyblink, *m_bigbusy;
63}; 63};
64 64
65 65