summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcher.cpp34
-rw-r--r--core/launcher/launcher.h2
2 files changed, 32 insertions, 4 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
@@ -148,8 +148,17 @@ void CategoryTabWidget::nextTab()
categoryBar->setCurrentTab( (tab + 1)%n );
}
}
+
+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;
AppLnk *app = new AppLnk(linkfile);
@@ -186,8 +195,14 @@ 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();
pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) );
@@ -247,10 +262,16 @@ 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 )
{
@@ -613,9 +634,8 @@ Launcher::Launcher( QWidget* parent, const char* name, WFlags fl )
//uidgen.store( stamp );
m_timeStamp = QString::number( stamp );
tabs = new CategoryTabWidget( this );
- tabs->setMaximumWidth( qApp->desktop()->width() );
setCentralWidget( tabs );
connect( tabs, SIGNAL(selected(const QString&)),
this, SLOT(viewSelected(const QString&)) );
@@ -673,8 +693,9 @@ void Launcher::showMaximized()
void Launcher::doMaximize()
{
QMainWindow::showMaximized();
+ tabs->setMaximumWidth( qApp->desktop()->width() );
}
void Launcher::updateMimeTypes()
{
@@ -831,8 +852,13 @@ void Launcher::nextView()
{
tabs->nextTab();
}
+void Launcher::showTab(const QString& id)
+{
+ tabs->showTab(id);
+ raise();
+}
void Launcher::select( const AppLnk *appLnk )
{
if ( appLnk->type() == "Folder" ) { // No tr
@@ -888,9 +914,9 @@ void Launcher::updateLink(const QString& link)
else {
tabs->updateLink(link);
notify_sm = true;
}
-
+
if ( notify_sm )
QCopEnvelope e ( "QPE/TaskBar", "reloadApps()" );
}
@@ -1188,17 +1214,17 @@ void Launcher::launcherMessage( const QCString &msg, const QByteArray &data)
qDebug( "setFont: %s, %d, %d, %d", fam.latin1(), size, weight, italic );
}
else if ( msg == "setBusyIndicatorType(QString)" ) {
QString type;
- stream >> type;
+ stream >> type;
tabs->setBusyIndicatorType(type);
}
else if ( msg == "home()" ) {
if ( isVisibleWindow( winId ( )))
nextView ( );
else
raise ( );
-
+
}
}
void Launcher::storageChanged()
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
@@ -71,8 +71,9 @@ signals:
public slots:
void nextTab();
void prevTab();
+ void showTab(const QString&);
protected slots:
void tabProperties();
@@ -104,8 +105,9 @@ public:
static bool mkdir(const QString &path);
public slots:
void viewSelected(const QString&);
+ void showTab(const QString&);
void select( const AppLnk * );
void externalSelected( const AppLnk *);
void properties( AppLnk * );
void nextView();