author | harlekin <harlekin> | 2003-03-23 13:14:25 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-03-23 13:14:25 (UTC) |
commit | 56192a3d601e5364e9b8f4c331d892befb19cbc1 (patch) (unidiff) | |
tree | 97966e16e29316a6dc28e2f0c9619192a3757b8f | |
parent | c3b01d2abd00b82b821604827987f2becccf5233 (diff) | |
download | opie-56192a3d601e5364e9b8f4c331d892befb19cbc1.zip opie-56192a3d601e5364e9b8f4c331d892befb19cbc1.tar.gz opie-56192a3d601e5364e9b8f4c331d892befb19cbc1.tar.bz2 |
after refresh show the same tab again as before ( for example after a medium is inserted or linkcChanged(QString) has been called
-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() | |||
149 | } | 149 | } |
150 | } | 150 | } |
151 | 151 | ||
152 | |||
153 | void CategoryTabWidget::showTab(const QString& id) | ||
154 | { | ||
155 | if ( categoryBar ) { | ||
156 | int idx = ids.findIndex( id ); | ||
157 | categoryBar->setCurrentTab( idx ); | ||
158 | } | ||
159 | } | ||
160 | |||
152 | void CategoryTabWidget::addItem( const QString& linkfile ) | 161 | void CategoryTabWidget::addItem( const QString& linkfile ) |
153 | { | 162 | { |
154 | int i=0; | 163 | int i=0; |
@@ -187,6 +196,12 @@ void CategoryTabWidget::addItem( const QString& linkfile ) | |||
187 | void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, | 196 | void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, |
188 | AppLnkSet* docFolder, const QList<FileSystem> &fs) | 197 | AppLnkSet* docFolder, const QList<FileSystem> &fs) |
189 | { | 198 | { |
199 | QString current; | ||
200 | if ( categoryBar ) { | ||
201 | int c = categoryBar->currentTab(); | ||
202 | if ( c >= 0 ) current = ids[c]; | ||
203 | } | ||
204 | |||
190 | delete categoryBar; | 205 | delete categoryBar; |
191 | categoryBar = new CategoryTabBar( this ); | 206 | categoryBar = new CategoryTabBar( this ); |
192 | QPalette pal = categoryBar->palette(); | 207 | QPalette pal = categoryBar->palette(); |
@@ -248,8 +263,14 @@ void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, | |||
248 | cfg. setGroup ( "GUI" ); | 263 | cfg. setGroup ( "GUI" ); |
249 | setBusyIndicatorType ( cfg. readEntry ( "BusyType", QString::null )); | 264 | setBusyIndicatorType ( cfg. readEntry ( "BusyType", QString::null )); |
250 | 265 | ||
266 | if ( !current.isNull() ) { | ||
267 | showTab(current); | ||
268 | } | ||
269 | |||
251 | categoryBar->show(); | 270 | categoryBar->show(); |
252 | stack->show(); | 271 | stack->show(); |
272 | |||
273 | QCopEnvelope e("QPE/TaskBar","reloadApps()"); | ||
253 | } | 274 | } |
254 | 275 | ||
255 | void CategoryTabWidget::setTabAppearance( const QString &id, Config &cfg ) | 276 | void CategoryTabWidget::setTabAppearance( const QString &id, Config &cfg ) |
@@ -614,7 +635,6 @@ Launcher::Launcher( QWidget* parent, const char* name, WFlags fl ) | |||
614 | m_timeStamp = QString::number( stamp ); | 635 | m_timeStamp = QString::number( stamp ); |
615 | 636 | ||
616 | tabs = new CategoryTabWidget( this ); | 637 | tabs = new CategoryTabWidget( this ); |
617 | tabs->setMaximumWidth( qApp->desktop()->width() ); | ||
618 | setCentralWidget( tabs ); | 638 | setCentralWidget( tabs ); |
619 | 639 | ||
620 | connect( tabs, SIGNAL(selected(const QString&)), | 640 | connect( tabs, SIGNAL(selected(const QString&)), |
@@ -674,6 +694,7 @@ void Launcher::showMaximized() | |||
674 | void Launcher::doMaximize() | 694 | void Launcher::doMaximize() |
675 | { | 695 | { |
676 | QMainWindow::showMaximized(); | 696 | QMainWindow::showMaximized(); |
697 | tabs->setMaximumWidth( qApp->desktop()->width() ); | ||
677 | } | 698 | } |
678 | 699 | ||
679 | void Launcher::updateMimeTypes() | 700 | void Launcher::updateMimeTypes() |
@@ -832,6 +853,11 @@ void Launcher::nextView() | |||
832 | tabs->nextTab(); | 853 | tabs->nextTab(); |
833 | } | 854 | } |
834 | 855 | ||
856 | void Launcher::showTab(const QString& id) | ||
857 | { | ||
858 | tabs->showTab(id); | ||
859 | raise(); | ||
860 | } | ||
835 | 861 | ||
836 | void Launcher::select( const AppLnk *appLnk ) | 862 | void Launcher::select( const AppLnk *appLnk ) |
837 | { | 863 | { |
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: | |||
72 | public slots: | 72 | public slots: |
73 | void nextTab(); | 73 | void nextTab(); |
74 | void prevTab(); | 74 | void prevTab(); |
75 | void showTab(const QString&); | ||
75 | 76 | ||
76 | protected slots: | 77 | protected slots: |
77 | void tabProperties(); | 78 | void tabProperties(); |
@@ -105,6 +106,7 @@ public: | |||
105 | 106 | ||
106 | public slots: | 107 | public slots: |
107 | void viewSelected(const QString&); | 108 | void viewSelected(const QString&); |
109 | void showTab(const QString&); | ||
108 | void select( const AppLnk * ); | 110 | void select( const AppLnk * ); |
109 | void externalSelected( const AppLnk *); | 111 | void externalSelected( const AppLnk *); |
110 | void properties( AppLnk * ); | 112 | void properties( AppLnk * ); |