summaryrefslogtreecommitdiff
path: root/core/launcher/taskbar.cpp
Side-by-side diff
Diffstat (limited to 'core/launcher/taskbar.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/taskbar.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/core/launcher/taskbar.cpp b/core/launcher/taskbar.cpp
index abe238f..63361fe 100644
--- a/core/launcher/taskbar.cpp
+++ b/core/launcher/taskbar.cpp
@@ -155,51 +155,50 @@ public:
}
void paintEvent( QPaintEvent * )
{
int y = (height()-sizeHint().height())/2;
QPainter p(this);
if ( nl )
p.drawPixmap(1,y,nl_pm);
if ( cl )
p.drawPixmap(1,y+nl_pm.height()+1,cl_pm);
}
private:
QPixmap nl_pm, cl_pm;
bool nl, cl;
};
//---------------------------------------------------------------------------
TaskBar::~TaskBar()
{
}
TaskBar::TaskBar() : QHBox(0, 0, WStyle_Customize | WStyle_Tool | WStyle_StaysOnTop | WGroupLeader)
{
- Config cfg( "Launcher" );
- cfg.setGroup( "InputMethods" );
- resizeRunningApp = cfg.readBoolEntry( "Resize", true );
+ /* Read InputMethod Config */
+ readConfig();
sm = new StartMenu( this );
connect( sm, SIGNAL(tabSelected(const QString&)), this,
SIGNAL(tabSelected(const QString&)) );
inputMethods = new InputMethods( this );
connect( inputMethods, SIGNAL(inputToggled(bool)),
this, SLOT(calcMaxWindowRect()) );
stack = new QWidgetStack( this );
stack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) );
label = new QLabel(stack);
runningAppBar = new RunningAppBar(stack);
stack->raiseWidget(runningAppBar);
waitIcon = new Wait( this );
(void) new AppIcons( this );
sysTray = new SysTray( this );
/* ### FIXME plugin loader and safe mode */
#if 0
if (PluginLoader::inSafeMode())
@@ -314,67 +313,75 @@ void TaskBar::calcMaxWindowRect()
QWSServer::setMaxWindowRect( qt_screen->mapToDevice(wr,QSize(qt_screen->width(),qt_screen->height())) );
#else
QWSServer::setMaxWindowRect( wr );
#endif
#endif
}
}
void TaskBar::receive( const QCString &msg, const QByteArray &data )
{
QDataStream stream( data, IO_ReadOnly );
if ( msg == "message(QString)" ) {
QString text;
stream >> text;
setStatusMessage( text );
} else if ( msg == "hideInputMethod()" ) {
inputMethods->hideInputMethod();
} else if ( msg == "showInputMethod()" ) {
inputMethods->showInputMethod();
} else if ( msg == "showInputMethod(QString)" ) {
QString name;
stream >> name;
inputMethods->showInputMethod(name);
} else if ( msg == "reloadInputMethods()" ) {
+ readConfig();
+ inputMethods->readConfig();
inputMethods->loadInputMethods();
} else if ( msg == "reloadApplets()" ) {
sysTray->clearApplets();
sm->createMenu();
sysTray->addApplets();
}else if ( msg == "toggleMenu()" ) {
if ( sm-> launchMenu-> isVisible() )
sm-> launch();
else
QCopEnvelope e( "QPE/System", "toggleApplicationMenu()" );
}else if ( msg == "toggleStartMenu()" )
sm->launch();
}
void TaskBar::setApplicationState( const QString &name, ServerInterface::ApplicationState state )
{
if ( state == ServerInterface::Launching )
runningAppBar->applicationLaunched( name );
else if ( state == ServerInterface::Terminated )
runningAppBar->applicationTerminated( name );
}
void TaskBar::toggleNumLockState()
{
if ( lockState ) lockState->toggleNumLockState();
}
void TaskBar::toggleCapsLockState()
{
if ( lockState ) lockState->toggleCapsLockState();
}
void TaskBar::toggleSymbolInput()
{
QString unicodeInput = qApp->translate( "InputMethods", "Unicode" );
if ( inputMethods->currentShown() == unicodeInput ) {
inputMethods->hideInputMethod();
} else {
inputMethods->showInputMethod( unicodeInput );
}
}
+void TaskBar::readConfig() {
+ Config cfg( "Launcher" );
+ cfg.setGroup( "InputMethods" );
+ resizeRunningApp = cfg.readBoolEntry( "Resize", true );
+}
+
#include "taskbar.moc"