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
@@ -12,13 +12,13 @@
12    .i_,=:_.      -<s. This file is distributed in the hope that 12    .i_,=:_.      -<s. This file is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of 14    : ..    .:,     . . . without even the implied warranty of
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
22    --        :-=` Free Software Foundation, Inc., 22    --        :-=` Free Software Foundation, Inc.,
23 59 Temple Place - Suite 330, 23 59 Temple Place - Suite 330,
24 Boston, MA 02111-1307, USA. 24 Boston, MA 02111-1307, USA.
@@ -59,13 +59,13 @@ TabsSettings::TabsSettings ( QWidget *parent, const char *name )
59 lay-> addMultiCellWidget ( l, 0, 0, 0, 1 ); 59 lay-> addMultiCellWidget ( l, 0, 0, 0, 1 );
60 60
61 m_list = new QListBox ( this ); 61 m_list = new QListBox ( this );
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 );
69 connect ( p1, SIGNAL( clicked ( )), this, SLOT( newClicked ( ))); 69 connect ( p1, SIGNAL( clicked ( )), this, SLOT( newClicked ( )));
70 70
71 p2 = new QPushButton ( tr( "Edit" ), this ); 71 p2 = new QPushButton ( tr( "Edit" ), this );
@@ -75,35 +75,39 @@ TabsSettings::TabsSettings ( QWidget *parent, const char *name )
75 p3 = new QPushButton ( tr( "Delete" ), this ); 75 p3 = new QPushButton ( tr( "Delete" ), this );
76 lay-> addWidget ( p3, 3, 1 ); 76 lay-> addWidget ( p3, 3, 1 );
77 connect ( p3, SIGNAL( clicked ( )), this, SLOT( deleteClicked ( ))); 77 connect ( p3, SIGNAL( clicked ( )), this, SLOT( deleteClicked ( )));
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
96void TabsSettings::init ( ) 100void TabsSettings::init ( )
97{ 101{
98 AppLnkSet rootFolder( MimeType::appsFolderName ( )); 102 AppLnkSet rootFolder( MimeType::appsFolderName ( ));
99 QStringList types = rootFolder. types ( ); 103 QStringList types = rootFolder. types ( );
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;
107 } 111 }
108 QImage img ( Resource::loadImage ( "DocsIcon" )); 112 QImage img ( Resource::loadImage ( "DocsIcon" ));
109 QPixmap pix; 113 QPixmap pix;
@@ -111,17 +115,19 @@ void TabsSettings::init ( )
111 m_list-> insertItem ( pix, tr( "Documents" )); 115 m_list-> insertItem ( pix, tr( "Documents" ));
112 m_ids += "Documents"; // No tr 116 m_ids += "Documents"; // No tr
113 117
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
125 m_tabs. clear ( ); 131 m_tabs. clear ( );
126 132
127 TabConfig global_def; 133 TabConfig global_def;
@@ -133,13 +139,13 @@ void TabsSettings::readTabSettings ( Config &cfg )
133 global_def. m_font_use = false; 139 global_def. m_font_use = false;
134 global_def. m_font_family = font ( ). family ( ); 140 global_def. m_font_family = font ( ). family ( );
135 global_def. m_font_size = font ( ). pointSize ( ); 141 global_def. m_font_size = font ( ). pointSize ( );
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;
143 149
144 cfg. setGroup ( grp. arg ( *it )); 150 cfg. setGroup ( grp. arg ( *it ));
145 151
@@ -164,25 +170,25 @@ void TabsSettings::readTabSettings ( Config &cfg )
164 if ( f. count ( ) == 4 ) { 170 if ( f. count ( ) == 4 ) {
165 tc. m_font_use = true; 171 tc. m_font_use = true;
166 tc. m_font_family = f [0]; 172 tc. m_font_family = f [0];
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] );
186 } 192 }
187 if ( same ) { 193 if ( same ) {
188 m_tabs [GLOBALID] = *first; 194 m_tabs [GLOBALID] = *first;
@@ -200,13 +206,13 @@ void TabsSettings::accept ( )
200 206
201 for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { 207 for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) {
202 TabConfig &tc = m_tabs [*it]; 208 TabConfig &tc = m_tabs [*it];
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:
210 cfg.writeEntry ( "View", "Icon" ); 216 cfg.writeEntry ( "View", "Icon" );
211 break; 217 break;
212 case TabConfig::List: 218 case TabConfig::List:
@@ -224,13 +230,13 @@ void TabsSettings::accept ( )
224 if ( tc. m_font_use ) { 230 if ( tc. m_font_use ) {
225 QString f = tc. m_font_family + "," + QString::number ( tc. m_font_size ) + "," + QString::number ( tc. m_font_weight ) + "," + ( tc. m_font_italic ? "1" : "0" ); 231 QString f = tc. m_font_family + "," + QString::number ( tc. m_font_size ) + "," + QString::number ( tc. m_font_weight ) + "," + ( tc. m_font_italic ? "1" : "0" );
226 cfg. writeEntry ( "Font", f ); 232 cfg. writeEntry ( "Font", f );
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 ) {
234 case TabConfig::Ruled: 240 case TabConfig::Ruled:
235 cfg.writeEntry( "BackgroundType", "Ruled" ); 241 cfg.writeEntry( "BackgroundType", "Ruled" );
236 be << *it << tc. m_bg_type << QString(""); 242 be << *it << tc. m_bg_type << QString("");
@@ -254,16 +260,18 @@ void TabsSettings::accept ( )
254 fe << tc. m_font_size; 260 fe << tc. m_font_size;
255 fe << tc. m_font_weight; 261 fe << tc. m_font_weight;
256 fe << ( tc. m_font_italic ? 1 : 0 ); 262 fe << ( tc. m_font_italic ? 1 : 0 );
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;
267 } 275 }
268} 276}
269 277
@@ -272,39 +280,39 @@ void TabsSettings::newClicked ( )
272 QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" )); 280 QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" ));
273} 281}
274 282
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
282 QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" )); 290 QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" ));
283} 291}
284 292
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
@@ -56,13 +56,13 @@ protected:
56 56
57private: 57private:
58 QListBox *m_list; 58 QListBox *m_list;
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
66 66
67 67
68#endif 68#endif