-rw-r--r-- | core/launcher/launcher.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index dc81c9e..1bd1156 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp | |||
@@ -202,131 +202,131 @@ void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, | |||
202 | 202 | ||
203 | ids.clear(); | 203 | ids.clear(); |
204 | 204 | ||
205 | Config cfg("Launcher"); | 205 | Config cfg("Launcher"); |
206 | 206 | ||
207 | QStringList types = rootFolder->types(); | 207 | QStringList types = rootFolder->types(); |
208 | for ( QStringList::Iterator it=types.begin(); it!=types.end(); ++it) { | 208 | for ( QStringList::Iterator it=types.begin(); it!=types.end(); ++it) { |
209 | if ( !(*it).isEmpty() ) { | 209 | if ( !(*it).isEmpty() ) { |
210 | (void)newView(*it,rootFolder->typePixmap(*it),rootFolder->typeName(*it)); | 210 | (void)newView(*it,rootFolder->typePixmap(*it),rootFolder->typeName(*it)); |
211 | setTabAppearance( *it, cfg ); | 211 | setTabAppearance( *it, cfg ); |
212 | } | 212 | } |
213 | } | 213 | } |
214 | QListIterator<AppLnk> it( rootFolder->children() ); | 214 | QListIterator<AppLnk> it( rootFolder->children() ); |
215 | AppLnk* l; | 215 | AppLnk* l; |
216 | while ( (l=it.current()) ) { | 216 | while ( (l=it.current()) ) { |
217 | if ( l->type() == "Separator" ) { // No tr | 217 | if ( l->type() == "Separator" ) { // No tr |
218 | rootFolder->remove(l); | 218 | rootFolder->remove(l); |
219 | delete l; | 219 | delete l; |
220 | } else { | 220 | } else { |
221 | int i=0; | 221 | int i=0; |
222 | for ( QStringList::Iterator it=types.begin(); it!=types.end(); ++it) { | 222 | for ( QStringList::Iterator it=types.begin(); it!=types.end(); ++it) { |
223 | if ( *it == l->type() ) | 223 | if ( *it == l->type() ) |
224 | ((LauncherView*)stack->widget(i))->addItem(l,FALSE); | 224 | ((LauncherView*)stack->widget(i))->addItem(l,FALSE); |
225 | i++; | 225 | i++; |
226 | } | 226 | } |
227 | } | 227 | } |
228 | ++it; | 228 | ++it; |
229 | } | 229 | } |
230 | rootFolder->detachChildren(); | 230 | rootFolder->detachChildren(); |
231 | for (int i=0; i<tabs; i++) | 231 | for (int i=0; i<tabs; i++) |
232 | ((LauncherView*)stack->widget(i))->sort(); | 232 | ((LauncherView*)stack->widget(i))->sort(); |
233 | 233 | ||
234 | // all documents | 234 | // all documents |
235 | QImage img( Resource::loadImage( "DocsIcon" ) ); | 235 | QImage img( Resource::loadImage( "DocsIcon" ) ); |
236 | QPixmap pm; | 236 | QPixmap pm; |
237 | pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); | 237 | pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); |
238 | docview = newView( "Documents", // No tr | 238 | docview = newView( "Documents", // No tr |
239 | pm, tr("Documents")); | 239 | pm, tr("Documents")); |
240 | docview->populate( docFolder, QString::null ); | 240 | docview->populate( docFolder, QString::null ); |
241 | docFolder->detachChildren(); | 241 | docFolder->detachChildren(); |
242 | docview->setFileSystems(fs); | 242 | docview->setFileSystems(fs); |
243 | docview->setToolsEnabled(TRUE); | 243 | docview->setToolsEnabled(TRUE); |
244 | setTabAppearance( "Documents", cfg ); // No tr | 244 | setTabAppearance( "Documents", cfg ); // No tr |
245 | 245 | ||
246 | connect( categoryBar, SIGNAL(selected(int)), stack, SLOT(raiseWidget(int)) ); | 246 | connect( categoryBar, SIGNAL(selected(int)), stack, SLOT(raiseWidget(int)) ); |
247 | 247 | ||
248 | ((LauncherView*)stack->widget(0))->setFocus(); | 248 | ((LauncherView*)stack->widget(0))->setFocus(); |
249 | 249 | ||
250 | categoryBar->show(); | 250 | categoryBar->show(); |
251 | stack->show(); | 251 | stack->show(); |
252 | } | 252 | } |
253 | 253 | ||
254 | void CategoryTabWidget::setTabAppearance( const QString &id, Config &cfg ) | 254 | void CategoryTabWidget::setTabAppearance( const QString &id, Config &cfg ) |
255 | { | 255 | { |
256 | QString grp( "Tab %1" ); // No tr | 256 | QString grp( "Tab %1" ); // No tr |
257 | cfg.setGroup( grp.arg(id) ); | 257 | cfg.setGroup( grp.arg(id) ); |
258 | LauncherView *v = view( id ); | 258 | LauncherView *v = view( id ); |
259 | int idx = ids.findIndex( id ); | 259 | int idx = ids.findIndex( id ); |
260 | CategoryTab *tab = (CategoryTab *)categoryBar->tab( idx ); | 260 | CategoryTab *tab = (CategoryTab *)categoryBar->tab( idx ); |
261 | 261 | ||
262 | // View | 262 | // View |
263 | QString view = cfg.readEntry( "View", "Icon" ); | 263 | QString view = cfg.readEntry( "View", "Icon" ); |
264 | if ( view == "List" ) // No tr | 264 | if ( view == "List" ) // No tr |
265 | v->setViewMode( LauncherView::List ); | 265 | v->setViewMode( LauncherView::List ); |
266 | QString bgType = cfg.readEntry( "BackgroundType", "Ruled" ); | 266 | QString bgType = cfg.readEntry( "BackgroundType", "Image" ); |
267 | if ( bgType == "Image" ) { // No tr | 267 | if ( bgType == "Image" ) { // No tr |
268 | QString pm = cfg.readEntry( "BackgroundImage", "wallpaper/marble" ); | 268 | QString pm = cfg.readEntry( "BackgroundImage", "launcher/opie-background" ); |
269 | v->setBackgroundType( LauncherView::Image, pm ); | 269 | v->setBackgroundType( LauncherView::Image, pm ); |
270 | } else if ( bgType == "SolidColor" ) { | 270 | } else if ( bgType == "SolidColor" ) { |
271 | QString c = cfg.readEntry( "BackgroundColor" ); | 271 | QString c = cfg.readEntry( "BackgroundColor" ); |
272 | v->setBackgroundType( LauncherView::SolidColor, c ); | 272 | v->setBackgroundType( LauncherView::SolidColor, c ); |
273 | } | 273 | } |
274 | QString textCol = cfg.readEntry( "TextColor" ); | 274 | QString textCol = cfg.readEntry( "TextColor" ); |
275 | if ( textCol.isEmpty() ) | 275 | if ( textCol.isEmpty() ) |
276 | v->setTextColor( QColor() ); | 276 | v->setTextColor( QColor() ); |
277 | else | 277 | else |
278 | v->setTextColor( QColor(textCol) ); | 278 | v->setTextColor( QColor(textCol) ); |
279 | QStringList font = cfg.readListEntry( "Font", ',' ); | 279 | QStringList font = cfg.readListEntry( "Font", ',' ); |
280 | if ( font.count() == 4 ) | 280 | if ( font.count() == 4 ) |
281 | v->setViewFont( QFont(font[0], font[1].toInt(), font[2].toInt(), font[3].toInt()!=0) ); | 281 | v->setViewFont( QFont(font[0], font[1].toInt(), font[2].toInt(), font[3].toInt()!=0) ); |
282 | 282 | ||
283 | // Tabs | 283 | // Tabs |
284 | QString tabCol = cfg.readEntry( "TabColor" ); | 284 | QString tabCol = cfg.readEntry( "TabColor" ); |
285 | if ( tabCol.isEmpty() ) | 285 | if ( tabCol.isEmpty() ) |
286 | tab->bgColor = QColor(); | 286 | tab->bgColor = QColor(); |
287 | else | 287 | else |
288 | tab->bgColor = QColor(tabCol); | 288 | tab->bgColor = QColor(tabCol); |
289 | QString tabTextCol = cfg.readEntry( "TabTextColor" ); | 289 | QString tabTextCol = cfg.readEntry( "TabTextColor" ); |
290 | if ( tabTextCol.isEmpty() ) | 290 | if ( tabTextCol.isEmpty() ) |
291 | tab->fgColor = QColor(); | 291 | tab->fgColor = QColor(); |
292 | else | 292 | else |
293 | tab->fgColor = QColor(tabTextCol); | 293 | tab->fgColor = QColor(tabTextCol); |
294 | } | 294 | } |
295 | 295 | ||
296 | void CategoryTabWidget::updateDocs(AppLnkSet* docFolder, const QList<FileSystem> &fs) | 296 | void CategoryTabWidget::updateDocs(AppLnkSet* docFolder, const QList<FileSystem> &fs) |
297 | { | 297 | { |
298 | docview->populate( docFolder, QString::null ); | 298 | docview->populate( docFolder, QString::null ); |
299 | docFolder->detachChildren(); | 299 | docFolder->detachChildren(); |
300 | docview->setFileSystems(fs); | 300 | docview->setFileSystems(fs); |
301 | docview->updateTools(); | 301 | docview->updateTools(); |
302 | } | 302 | } |
303 | 303 | ||
304 | void CategoryTabWidget::tabProperties() | 304 | void CategoryTabWidget::tabProperties() |
305 | { | 305 | { |
306 | LauncherView *view = (LauncherView*)stack->widget( categoryBar->currentTab() ); | 306 | LauncherView *view = (LauncherView*)stack->widget( categoryBar->currentTab() ); |
307 | QPopupMenu *m = new QPopupMenu( this ); | 307 | QPopupMenu *m = new QPopupMenu( this ); |
308 | m->insertItem( tr("Icon View"), LauncherView::Icon ); | 308 | m->insertItem( tr("Icon View"), LauncherView::Icon ); |
309 | m->insertItem( tr("List View"), LauncherView::List ); | 309 | m->insertItem( tr("List View"), LauncherView::List ); |
310 | m->setItemChecked( (int)view->viewMode(), TRUE ); | 310 | m->setItemChecked( (int)view->viewMode(), TRUE ); |
311 | int rv = m->exec( QCursor::pos() ); | 311 | int rv = m->exec( QCursor::pos() ); |
312 | if ( rv >= 0 && rv != view->viewMode() ) { | 312 | if ( rv >= 0 && rv != view->viewMode() ) { |
313 | view->setViewMode( (LauncherView::ViewMode)rv ); | 313 | view->setViewMode( (LauncherView::ViewMode)rv ); |
314 | } | 314 | } |
315 | 315 | ||
316 | delete m; | 316 | delete m; |
317 | } | 317 | } |
318 | 318 | ||
319 | QString CategoryTabWidget::getAllDocLinkInfo() const | 319 | QString CategoryTabWidget::getAllDocLinkInfo() const |
320 | { | 320 | { |
321 | return docview->getAllDocLinkInfo(); | 321 | return docview->getAllDocLinkInfo(); |
322 | } | 322 | } |
323 | 323 | ||
324 | LauncherView* CategoryTabWidget::newView( const QString& id, const QPixmap& pm, const QString& label ) | 324 | LauncherView* CategoryTabWidget::newView( const QString& id, const QPixmap& pm, const QString& label ) |
325 | { | 325 | { |
326 | LauncherView* view = new LauncherView( stack ); | 326 | LauncherView* view = new LauncherView( stack ); |
327 | connect( view, SIGNAL(clicked(const AppLnk*)), | 327 | connect( view, SIGNAL(clicked(const AppLnk*)), |
328 | this, SIGNAL(clicked(const AppLnk*))); | 328 | this, SIGNAL(clicked(const AppLnk*))); |
329 | connect( view, SIGNAL(rightPressed(AppLnk*)), | 329 | connect( view, SIGNAL(rightPressed(AppLnk*)), |
330 | this, SIGNAL(rightPressed(AppLnk*))); | 330 | this, SIGNAL(rightPressed(AppLnk*))); |
331 | ids.append(id); | 331 | ids.append(id); |
332 | categoryBar->addTab( new CategoryTab( pm, label ) ); | 332 | categoryBar->addTab( new CategoryTab( pm, label ) ); |