summaryrefslogtreecommitdiff
path: root/core/launcher/launcherview.cpp
authorsandman <sandman>2002-10-01 22:44:28 (UTC)
committer sandman <sandman>2002-10-01 22:44:28 (UTC)
commit8f904d99e7b6e04b6043226a63f6c417171a7cad (patch) (side-by-side diff)
tree07d5f2b7e1338cf1035fe92436328a9c74208b03 /core/launcher/launcherview.cpp
parent895280b5ff189fff2e77d6f5f27668e7dad0d88d (diff)
downloadopie-8f904d99e7b6e04b6043226a63f6c417171a7cad.zip
opie-8f904d99e7b6e04b6043226a63f6c417171a7cad.tar.gz
opie-8f904d99e7b6e04b6043226a63f6c417171a7cad.tar.bz2
busyindicator type can now be changed at run-time
Diffstat (limited to 'core/launcher/launcherview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcherview.cpp31
1 files changed, 25 insertions, 6 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index e15b150..fa46543 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -49,12 +49,17 @@ class BgPixmap
public:
BgPixmap( const QPixmap &p ) : pm(p), ref(1) {}
QPixmap pm;
int ref;
};
+enum BusyIndicatorType {
+ BIT_Normal = 0,
+ BIT_Blinking
+};
+
static QMap<QString,BgPixmap*> *bgCache = 0;
class LauncherIconView : public QIconView {
public:
LauncherIconView( QWidget* parent, const char* name=0 ) :
QIconView(parent,name),
@@ -79,12 +84,14 @@ public:
while ((l=it.current())) {
++it;
//qDebug("%p: hidden (should remove)",l);
}
#endif
}
+
+ void setBusyIndicatorType ( BusyIndicatorType t ) { busyType = t; }
QPixmap* busyPixmap() const { return (QPixmap*)&bpm[::abs(busystate)]; }
QIconViewItem* busyItem() const { return bsy; }
void setBigIcons( bool bi ) { bigIcns = bi; }
void updateCategoriesAndMimeTypes();
@@ -94,13 +101,12 @@ public:
// We don't want rubberbanding (yet)
}
void setBusy(bool on)
{
QIconViewItem *c = on ? currentItem() : 0;
- qDebug ( "set busy %d -> %s", on, c ? c-> text ().latin1() : "(null)" );
if ( bsy != c ) {
QIconViewItem *oldbsy = bsy;
bsy = c;
if ( oldbsy )
@@ -133,17 +139,21 @@ public:
int ai = qAlpha ( *rgb );
*rgb = qRgba ( ri, gi, bi, ai );
}
bpm [i].convertFromImage( img );
}
- busystate = 0;
- if ( busytimer )
- killTimer ( busytimer );
- timerEvent ( 0 );
- busytimer = startTimer ( 200 );
+ if ( busyType == BIT_Blinking ) {
+ busystate = 0;
+ if ( busytimer )
+ killTimer ( busytimer );
+ busytimer = startTimer ( 200 );
+ }
+ else
+ busystate = 3;
+ timerEvent ( 0 );
}
else {
killTimer ( busytimer );
busytimer = 0;
}
}
@@ -334,12 +344,13 @@ private:
bool bigIcns;
QPixmap bgPixmap;
QPixmap bpm [6];
QColor bgColor;
int busytimer;
int busystate;
+ BusyIndicatorType busyType;
};
bool LauncherView::bsy=FALSE;
void LauncherView::setBusy(bool on)
@@ -910,6 +921,14 @@ void LauncherView::paletteChange( const QPalette &p )
setBackgroundType( Ruled, QString::null );
QColorGroup cg = icons->colorGroup();
cg.setColor( QColorGroup::Text, textCol );
icons->setPalette( QPalette(cg,cg,cg) );
}
+
+void LauncherView::setBusyIndicatorType ( const QString &type )
+{
+ if ( type. lower ( ) == "blink" )
+ icons-> setBusyIndicatorType ( BIT_Blinking );
+ else
+ icons-> setBusyIndicatorType ( BIT_Normal );
+}