summaryrefslogtreecommitdiff
authoralwin <alwin>2004-11-11 21:10:16 (UTC)
committer alwin <alwin>2004-11-11 21:10:16 (UTC)
commitd2d25a3c1e60a34436cd93e5214a35b3edd05c6c (patch) (side-by-side diff)
tree0c1bd62dd09e7a86292399f68c823b7eb6ae031e
parente85cf7184c3444e26c1858d0564fa5d3614dd7b5 (diff)
downloadopie-d2d25a3c1e60a34436cd93e5214a35b3edd05c6c.zip
opie-d2d25a3c1e60a34436cd93e5214a35b3edd05c6c.tar.gz
opie-d2d25a3c1e60a34436cd93e5214a35b3edd05c6c.tar.bz2
- flush icon cache if reloading all documents
- send QCop message when the doctab is enabled/disabled so the disabled widget appears or the doc-list will reread
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/documentlist.cpp10
-rw-r--r--core/launcher/documentlist.h1
-rw-r--r--core/launcher/launcher.cpp25
-rw-r--r--core/launcher/launcher.h1
-rw-r--r--core/launcher/launcherview.cpp4
-rw-r--r--core/launcher/server.cpp2
6 files changed, 37 insertions, 6 deletions
diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp
index d8e7a83..9781a32 100644
--- a/core/launcher/documentlist.cpp
+++ b/core/launcher/documentlist.cpp
@@ -269,27 +269,35 @@ void DocumentList::reloadDocLnks()
{
if ( !d->scanDocs )
return;
if ( d->sendDocLnks && d->serverGui ) {
d->serverGui->documentScanningProgress( 0 );
d->serverGui->allDocumentsRemoved();
}
rescan();
}
+void DocumentList::reforceDocuments()
+{
+ Config cfg( "Launcher" );
+ cfg.setGroup( "DocTab" );
+ d->scanDocs = cfg.readBoolEntry( "Enable", true );
+ reloadDocLnks();
+}
+
void DocumentList::linkChanged( QString arg )
{
- //odebug << "linkchanged( " << arg << " )" << oendl;
+ odebug << "linkchanged( " << arg << " )" << oendl;
if ( arg.isNull() || OGlobal::isAppLnkFileName( arg ) ) {
reloadAppLnks();
} else {
const QList<DocLnk> &list = d->dls.children();
QListIterator<DocLnk> it( list );
while ( it.current() ) {
DocLnk *doc = it.current();
++it;
if ( ( doc->linkFileKnown() && doc->linkFile() == arg )
|| ( doc->fileKnown() && doc->file() == arg ) ) {
diff --git a/core/launcher/documentlist.h b/core/launcher/documentlist.h
index 232bb6a..8b69e95 100644
--- a/core/launcher/documentlist.h
+++ b/core/launcher/documentlist.h
@@ -33,24 +33,25 @@ class DocumentList : public QObject {
public:
DocumentList( ServerInterface *serverGui, bool scanDocs = TRUE,
QObject *parent = 0, const char *name = 0 );
~DocumentList();
void linkChanged( QString link );
void restoreDone();
void storageChanged();
void sendAllDocLinks();
void reloadAppLnks();
void reloadDocLnks();
+ void reforceDocuments();
void DiffAppLnks();
// Orig DocList stuff
void start();
void pause();
void resume();
void rescan();
static AppLnkSet *appLnkSet;
/*
void resend();
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index ccc2114..970b8cb 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -432,30 +432,51 @@ void LauncherTabWidget::launcherMessage( const QCString &msg, const QByteArray &
} else {
view(id)->clearViewFont();
}
}
}else if ( msg == "setBusyIndicatorType(QString)" ) {
QString type;
stream >> type;
setBusyIndicatorType( type );
}else if ( msg == "home()" ) {
if ( isVisibleWindow( static_cast<QWidget*>(parent())->winId() ) ) {
if (categoryBar)
categoryBar->nextTab();
- }else
+ }else {
static_cast<QWidget*>(parent())->raise();
}
+ } else if (msg=="doctabEnabled(int)") {
+ int id; stream >> id;
+ odebug << "Doctab enabled " << id << oendl;
+ reCheckDoctab(id);
+ }
}
-
+void LauncherTabWidget::reCheckDoctab(int how)
+{
+ if ((bool)how == docTabEnabled) {
+ /* nothing to do */
+ return;
+ }
+ if (docLoadingWidget) {
+ stack->removeWidget(docLoadingWidget);
+ delete docLoadingWidget;
+ docLoadingWidget = 0;
+ }
+ createDocLoadingWidget();
+ {
+ QCopEnvelope( "QPE/System", "reforceDocuments()" );
+ odebug << "Sending doc rescan" << oendl;
+ }
+}
//---------------------------------------------------------------------------
Launcher::Launcher()
: QMainWindow( 0, "PDA User Interface", QWidget::WStyle_Customize | QWidget::WGroupLeader )
{
tabs = 0;
tb = 0;
Config cfg( "Launcher" );
cfg.setGroup( "DocTab" );
docTabEnabled = cfg.readBoolEntry( "Enable", true );
}
diff --git a/core/launcher/launcher.h b/core/launcher/launcher.h
index db6ac54..b741064 100644
--- a/core/launcher/launcher.h
+++ b/core/launcher/launcher.h
@@ -72,24 +72,25 @@ protected slots:
void raiseTabWidget();
void tabProperties();
void initLayout();
private slots:
void launcherMessage( const QCString &, const QByteArray &);
void appMessage( const QCString &, const QByteArray &);
void setProgressStyle();
protected:
void paletteChange( const QPalette &p );
void styleChange( QStyle & );
+ void reCheckDoctab(int how);
private:
Launcher *launcher;
LauncherView *docview;
QWidgetStack *stack;
LauncherView *docLoadingWidget;
QProgressBar *docLoadingWidgetProgress;
bool docLoadingWidgetEnabled;
bool docTabEnabled;
int m_DocumentTabId;
};
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index c9efacb..2783423 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -323,27 +323,24 @@ int LauncherIconView::compare(const AppLnk* a, const AppLnk* b)
}
void LauncherIconView::setSortMethod( SortMethod m )
{
if ( sortmeth != m ) {
sortmeth = m;
sort();
}
}
void LauncherIconView::setCategoryFilter( int catfilter, bool resort )
{
- Categories cat;
- cat.load( categoryFileName() );
- QString str;
if ( catfilter == -2 )
cf = 0;
else
cf = catfilter;
hideOrShowItems(resort);
}
void LauncherIconView::setTypeFilter(const QString& typefilter, bool resort)
{
tf = QRegExp(typefilter,FALSE,TRUE);
hideOrShowItems(resort);
}
@@ -1074,24 +1071,25 @@ void LauncherView::itemPressed( int btn, QIconViewItem *item )
AppLnk *appLnk = ((LauncherItem *)item)->appLnk();
if ( btn == RightButton )
emit rightPressed( appLnk );
else if ( btn == ShiftButton )
emit rightPressed( appLnk );
item->setSelected(FALSE);
}
}
void LauncherView::removeAllItems()
{
odebug << "LauncherView::removeAllItems()" << oendl;
+ if (LauncherIconView::sm_EyeCache) LauncherIconView::sm_EyeCache->clear();
icons->clear();
}
bool LauncherView::removeLink(const QString& linkfile)
{
return icons->removeLink(linkfile);
}
void LauncherView::addItem(AppLnk* app, bool resort)
{
icons->addItem(app,resort);
}
diff --git a/core/launcher/server.cpp b/core/launcher/server.cpp
index 42186d3..15cd686 100644
--- a/core/launcher/server.cpp
+++ b/core/launcher/server.cpp
@@ -333,24 +333,26 @@ void Server::systemMsg(const QCString &msg, const QByteArray &data)
#warning FIXME support TempScreenSaverMode
#if 0
} else if ( msg == "setTempScreenSaverMode(int,int)" ) {
int mode, pid;
stream >> mode >> pid;
tsmMonitor->setTempMode(mode, pid);
#endif
} else if ( msg == "linkChanged(QString)" ) {
QString link;
stream >> link;
odebug << "desktop.cpp systemMsg -> linkchanged( " << link << " )" << oendl;
docList->linkChanged(link);
+ } else if (msg =="reforceDocuments()") {
+ docList->reforceDocuments();
} else if ( msg == "serviceChanged(QString)" ) {
MimeType::updateApplications();
} else if ( msg == "mkdir(QString)" ) {
QString dir;
stream >> dir;
if ( !dir.isEmpty() )
mkdir( dir );
} else if ( msg == "rdiffGenSig(QString,QString)" ) {
QString baseFile, sigFile;
stream >> baseFile >> sigFile;
QRsync::generateSignature( baseFile, sigFile );
} else if ( msg == "rdiffGenDiff(QString,QString,QString)" ) {