summaryrefslogtreecommitdiff
path: root/library/qpedecoration_qws.cpp
Unidiff
Diffstat (limited to 'library/qpedecoration_qws.cpp') (more/less context) (show whitespace changes)
-rw-r--r--library/qpedecoration_qws.cpp26
1 files changed, 17 insertions, 9 deletions
diff --git a/library/qpedecoration_qws.cpp b/library/qpedecoration_qws.cpp
index 5e0c32a..933542d 100644
--- a/library/qpedecoration_qws.cpp
+++ b/library/qpedecoration_qws.cpp
@@ -180,36 +180,36 @@ bool QPEManager::eventFilter( QObject *o, QEvent *e )
180 switch ( e->type() ) { 180 switch ( e->type() ) {
181 case QEvent::MouseButtonPress: 181 case QEvent::MouseButtonPress:
182 { 182 {
183 pressTime = QTime::currentTime(); 183 pressTime = QTime::currentTime();
184 QPoint p = ((QMouseEvent*)e)->globalPos(); 184 QPoint p = ((QMouseEvent*)e)->globalPos();
185 int inRegion = pointInQpeRegion( w, p ); 185 int inRegion = pointInQpeRegion( w, p );
186#ifdef WHATSTHIS_MODE 186#ifdef WHATSTHIS_MODE
187 if ( !w->geometry().contains(p) && QWhatsThis::inWhatsThisMode() ) { 187 if ( !w->geometry().contains(p) && QWhatsThis::inWhatsThisMode() ) {
188 QString text; 188 QString text;
189 switch ( inRegion ) { 189 switch ( inRegion ) {
190 case QWSDecoration::Close: 190 case QWSDecoration::Close:
191 if ( ((HackWidget*)w)->needsOk() ) 191 if ( ((HackWidget*)w)->needsOk() )
192 text = tr("Click to close this window, discarding changes."); 192 text = QObject::tr("Click to close this window, discarding changes.");
193 else 193 else
194 text = tr("Click to close this window."); 194 text = QObject::tr("Click to close this window.");
195 break; 195 break;
196 case QWSDecoration::Minimize: 196 case QWSDecoration::Minimize:
197 text = tr("Click to close this window and apply changes."); 197 text = QObject::tr("Click to close this window and apply changes.");
198 break; 198 break;
199 case QWSDecoration::Maximize: 199 case QWSDecoration::Maximize:
200 if ( w->isMaximized() ) 200 if ( w->isMaximized() )
201 text = tr("Click to make this window moveable."); 201 text = QObject::tr("Click to make this window moveable.");
202 else 202 else
203 text = tr("Click to make this window use all available screen area."); 203 text = QObject::tr("Click to make this window use all available screen area.");
204 break; 204 break;
205 default: 205 default:
206 break; 206 break;
207 } 207 }
208 QWhatsThis::leaveWhatsThisMode( text ); 208 QWhatsThis::leaveWhatsThisMode( text );
209 whatsThisTimeout(); 209 whatsThisTimeout();
210 helpState = 0; 210 helpState = 0;
211 return true; 211 return true;
212 } 212 }
213#endif 213#endif
214 if ( inRegion == QPEDecoration::Help ) { 214 if ( inRegion == QPEDecoration::Help ) {
215#ifdef WHATSTHIS_MODE 215#ifdef WHATSTHIS_MODE
@@ -501,26 +501,34 @@ void QPEDecoration::init ( const QString &plugin )
501 libname = plugin; 501 libname = plugin;
502 502
503 if ( wdlib ) { 503 if ( wdlib ) {
504 wdiface->release(); 504 wdiface->release();
505 wdlib->unload(); 505 wdlib->unload();
506 delete wdlib; 506 delete wdlib;
507 wdlib = 0; 507 wdlib = 0;
508 } else { 508 } else {
509 delete wdiface; 509 delete wdiface;
510 } 510 }
511 511
512 WindowDecorationInterface *iface = 0; 512 WindowDecorationInterface *iface = 0;
513 QString path = QPEApplication::qpeDir() + "/plugins/decorations"; 513 QString path = QPEApplication::qpeDir() + "/plugins/decorations/";
514 QLibrary *lib = new QLibrary( path + "/" + plugin ); 514
515 if ( plugin.find( ".so" ) > 0 ) {
516 // full library name supplied
517 path += plugin;
518 } else {
519 path += "lib" + plugin.lower() + ".so"; // compatibility
520 }
521
522 QLibrary *lib = new QLibrary( path );
515 if ( lib->queryInterface( IID_WindowDecoration, (QUnknownInterface**)&iface ) == QS_OK && iface ) { 523 if ( lib->queryInterface( IID_WindowDecoration, (QUnknownInterface**)&iface ) == QS_OK && iface ) {
516 wdiface = iface; 524 wdiface = iface;
517 wdlib = lib; 525 wdlib = lib;
518 } else { 526 } else {
519 delete lib; 527 delete lib;
520 wdiface = new DefaultWindowDecoration; 528 wdiface = new DefaultWindowDecoration;
521 } 529 }
522 530
523 helpFile = QString(qApp->argv()[0]) + ".html"; 531 helpFile = QString(qApp->argv()[0]) + ".html";
524 QStringList helpPath = Global::helpPath(); 532 QStringList helpPath = Global::helpPath();
525 helpExists = FALSE; 533 helpExists = FALSE;
526 for (QStringList::ConstIterator it=helpPath.begin(); it!=helpPath.end() && !helpExists; ++it) { 534 for (QStringList::ConstIterator it=helpPath.begin(); it!=helpPath.end() && !helpExists; ++it) {
@@ -861,38 +869,38 @@ void QPEDecoration::minimize( QWidget *widget )
861 s.activate(); 869 s.activate();
862 } else { 870 } else {
863 help( widget ); 871 help( widget );
864 } 872 }
865} 873}
866 874
867void QPEDecoration::help( QWidget *w ) 875void QPEDecoration::help( QWidget *w )
868{ 876{
869 if ( helpExists ) { 877 if ( helpExists ) {
870 Global::execute( "helpbrowser", helpFile ); 878 Global::execute( "helpbrowser", helpFile );
871 } else if ( w && w->testWFlags(Qt::WStyle_ContextHelp) ) { 879 } else if ( w && w->testWFlags(Qt::WStyle_ContextHelp) ) {
872 QWhatsThis::enterWhatsThisMode(); 880 QWhatsThis::enterWhatsThisMode();
873 QWhatsThis::leaveWhatsThisMode( qApp->tr( 881 QWhatsThis::leaveWhatsThisMode( QObject::tr(
874 "<Qt>Comprehensive help is not available for this application, " 882 "<Qt>Comprehensive help is not available for this application, "
875 "however there is context-sensitive help.<p>To use context-sensitive help:<p>" 883 "however there is context-sensitive help.<p>To use context-sensitive help:<p>"
876 "<ol><li>click and hold the help button." 884 "<ol><li>click and hold the help button."
877 "<li>when the title bar shows <b>What's this...</b>, " 885 "<li>when the title bar shows <b>What's this...</b>, "
878 "click on any control.</ol></Qt>" ) ); 886 "click on any control.</ol></Qt>" ) );
879 } 887 }
880} 888}
881 889
882void QPEDecoration::windowData( const QWidget *w, WindowDecorationInterface::WindowData &wd ) const 890void QPEDecoration::windowData( const QWidget *w, WindowDecorationInterface::WindowData &wd ) const
883{ 891{
884 wd.rect = w->rect(); 892 wd.rect = w->rect();
885 if ( qpeManager->whatsThisWidget() == w ) 893 if ( qpeManager->whatsThisWidget() == w )
886 wd.caption = qApp->tr("What's this..." ); 894 wd.caption = QObject::tr("What's this..." );
887 else 895 else
888 wd.caption = w->caption(); 896 wd.caption = w->caption();
889 wd.palette = qApp->palette(); 897 wd.palette = qApp->palette();
890 wd.flags = 0; 898 wd.flags = 0;
891 wd.flags |= w->isMaximized() ? WindowDecorationInterface::WindowData::Maximized : 0; 899 wd.flags |= w->isMaximized() ? WindowDecorationInterface::WindowData::Maximized : 0;
892 wd.flags |= w->testWFlags(Qt::WStyle_Dialog) ? WindowDecorationInterface::WindowData::Dialog : 0; 900 wd.flags |= w->testWFlags(Qt::WStyle_Dialog) ? WindowDecorationInterface::WindowData::Dialog : 0;
893 const QWidget *active = qpeManager->activeWidget(); 901 const QWidget *active = qpeManager->activeWidget();
894 wd.flags |= w == active ? WindowDecorationInterface::WindowData::Active : 0; 902 wd.flags |= w == active ? WindowDecorationInterface::WindowData::Active : 0;
895 wd.reserved = 1; 903 wd.reserved = 1;
896} 904}
897 905
898/* 906/*