-rw-r--r-- | core/launcher/launcher.cpp | 28 | ||||
-rw-r--r-- | core/launcher/launcher.h | 2 |
2 files changed, 29 insertions, 1 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index fc944e1..e74301c 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp @@ -149,6 +149,15 @@ void CategoryTabWidget::nextTab() } } + +void CategoryTabWidget::showTab(const QString& id) +{ + if ( categoryBar ) { + int idx = ids.findIndex( id ); + categoryBar->setCurrentTab( idx ); + } +} + void CategoryTabWidget::addItem( const QString& linkfile ) { int i=0; @@ -187,6 +196,12 @@ void CategoryTabWidget::addItem( const QString& linkfile ) void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, AppLnkSet* docFolder, const QList<FileSystem> &fs) { + QString current; + if ( categoryBar ) { + int c = categoryBar->currentTab(); + if ( c >= 0 ) current = ids[c]; + } + delete categoryBar; categoryBar = new CategoryTabBar( this ); QPalette pal = categoryBar->palette(); @@ -248,8 +263,14 @@ void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, cfg. setGroup ( "GUI" ); setBusyIndicatorType ( cfg. readEntry ( "BusyType", QString::null )); + if ( !current.isNull() ) { + showTab(current); + } + categoryBar->show(); stack->show(); + + QCopEnvelope e("QPE/TaskBar","reloadApps()"); } void CategoryTabWidget::setTabAppearance( const QString &id, Config &cfg ) @@ -614,7 +635,6 @@ Launcher::Launcher( QWidget* parent, const char* name, WFlags fl ) m_timeStamp = QString::number( stamp ); tabs = new CategoryTabWidget( this ); - tabs->setMaximumWidth( qApp->desktop()->width() ); setCentralWidget( tabs ); connect( tabs, SIGNAL(selected(const QString&)), @@ -674,6 +694,7 @@ void Launcher::showMaximized() void Launcher::doMaximize() { QMainWindow::showMaximized(); + tabs->setMaximumWidth( qApp->desktop()->width() ); } void Launcher::updateMimeTypes() @@ -832,6 +853,11 @@ void Launcher::nextView() tabs->nextTab(); } +void Launcher::showTab(const QString& id) +{ + tabs->showTab(id); + raise(); +} void Launcher::select( const AppLnk *appLnk ) { diff --git a/core/launcher/launcher.h b/core/launcher/launcher.h index 89bf6f3..c92ef5d 100644 --- a/core/launcher/launcher.h +++ b/core/launcher/launcher.h @@ -72,6 +72,7 @@ signals: public slots: void nextTab(); void prevTab(); + void showTab(const QString&); protected slots: void tabProperties(); @@ -105,6 +106,7 @@ public: public slots: void viewSelected(const QString&); + void showTab(const QString&); void select( const AppLnk * ); void externalSelected( const AppLnk *); void properties( AppLnk * ); |