summaryrefslogtreecommitdiff
path: root/core
Unidiff
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/batteryapplet/battery.cpp2
-rw-r--r--core/launcher/launcher.cpp3
-rw-r--r--core/launcher/serverapp.cpp2
-rw-r--r--core/multimedia/opieplayer/audiowidget.cpp2
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp2
-rw-r--r--core/multimedia/opieplayer/videowidget.cpp2
-rw-r--r--core/obex/obexhandler.cpp3
-rw-r--r--core/pim/today/today.cpp2
-rw-r--r--core/pim/today/todayconfig.cpp3
-rw-r--r--core/settings/button/buttonsettings.cpp3
-rw-r--r--core/settings/launcher/tabssettings.cpp4
-rw-r--r--core/settings/light-and-power/light.cpp3
-rw-r--r--core/settings/security/security.cpp2
13 files changed, 16 insertions, 17 deletions
diff --git a/core/applets/batteryapplet/battery.cpp b/core/applets/batteryapplet/battery.cpp
index 4adcab4..3b64fb5 100644
--- a/core/applets/batteryapplet/battery.cpp
+++ b/core/applets/batteryapplet/battery.cpp
@@ -31,97 +31,97 @@
31 31
32BatteryMeter::BatteryMeter( QWidget *parent ) 32BatteryMeter::BatteryMeter( QWidget *parent )
33 : QWidget( parent ), charging(false) 33 : QWidget( parent ), charging(false)
34{ 34{
35 ps = new PowerStatus; 35 ps = new PowerStatus;
36 startTimer( 10000 ); 36 startTimer( 10000 );
37 37
38 setFixedWidth( QMAX(AppLnk::smallIconSize()*3/4, 6) ); 38 setFixedWidth( QMAX(AppLnk::smallIconSize()*3/4, 6) );
39 setFixedHeight( AppLnk::smallIconSize() ); 39 setFixedHeight( AppLnk::smallIconSize() );
40 40
41 chargeTimer = new QTimer( this ); 41 chargeTimer = new QTimer( this );
42 connect( chargeTimer, SIGNAL(timeout()), this, SLOT(chargeTimeout()) ); 42 connect( chargeTimer, SIGNAL(timeout()), this, SLOT(chargeTimeout()) );
43 timerEvent(0); 43 timerEvent(0);
44 QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); 44 QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold );
45 Config c( "qpe" ); 45 Config c( "qpe" );
46 c.setGroup( "Battery" ); 46 c.setGroup( "Battery" );
47 style = c.readNumEntry( "Style", 0 ); 47 style = c.readNumEntry( "Style", 0 );
48} 48}
49 49
50BatteryMeter::~BatteryMeter() 50BatteryMeter::~BatteryMeter()
51{ 51{
52 delete ps; 52 delete ps;
53} 53}
54 54
55QSize BatteryMeter::sizeHint() const 55QSize BatteryMeter::sizeHint() const
56{ 56{
57 return QSize(QMAX(AppLnk::smallIconSize()*3/4, 6), height() ); 57 return QSize(QMAX(AppLnk::smallIconSize()*3/4, 6), height() );
58} 58}
59 59
60void BatteryMeter::mousePressEvent( QMouseEvent* e ) 60void BatteryMeter::mousePressEvent( QMouseEvent* e )
61{ 61{
62 if ( e->button() == RightButton ) 62 if ( e->button() == RightButton )
63 { 63 {
64 style = 1-style; 64 style = 1-style;
65 Config c( "qpe" ); 65 Config c( "qpe" );
66 c.setGroup( "Battery" ); 66 c.setGroup( "Battery" );
67 c.writeEntry( "Style", style ); 67 c.writeEntry( "Style", style );
68 repaint( true ); 68 repaint( true );
69 } 69 }
70 QWidget::mousePressEvent( e ); 70 QWidget::mousePressEvent( e );
71} 71}
72 72
73void BatteryMeter::mouseReleaseEvent( QMouseEvent* e) 73void BatteryMeter::mouseReleaseEvent( QMouseEvent* e)
74{ 74{
75 if ( batteryView && batteryView->isVisible() ) { 75 if ( batteryView && batteryView->isVisible() ) {
76 delete (QWidget *) batteryView; 76 delete (QWidget *) batteryView;
77 } else { 77 } else {
78 if ( !batteryView ) batteryView = new BatteryStatus( ps ); 78 if ( !batteryView ) batteryView = new BatteryStatus( ps );
79 batteryView->showMaximized(); 79 QPEApplication::showWidget( batteryView );
80 batteryView->raise(); 80 batteryView->raise();
81 batteryView->show(); 81 batteryView->show();
82 } 82 }
83} 83}
84 84
85void BatteryMeter::timerEvent( QTimerEvent * ) 85void BatteryMeter::timerEvent( QTimerEvent * )
86{ 86{
87 PowerStatus prev = *ps; 87 PowerStatus prev = *ps;
88 88
89 *ps = PowerStatusManager::readStatus(); 89 *ps = PowerStatusManager::readStatus();
90 90
91 if ( prev != *ps ) { 91 if ( prev != *ps ) {
92 percent = ps->batteryPercentRemaining(); 92 percent = ps->batteryPercentRemaining();
93 if ( !charging && ps->batteryStatus() == PowerStatus::Charging ) { 93 if ( !charging && ps->batteryStatus() == PowerStatus::Charging ) {
94 percent = 0; 94 percent = 0;
95 charging = true; 95 charging = true;
96 chargeTimer->start( 500 ); 96 chargeTimer->start( 500 );
97 } else if ( charging && ps->batteryStatus() != PowerStatus::Charging ) { 97 } else if ( charging && ps->batteryStatus() != PowerStatus::Charging ) {
98 charging = false; 98 charging = false;
99 chargeTimer->stop(); 99 chargeTimer->stop();
100 if ( batteryView ) 100 if ( batteryView )
101 batteryView->updatePercent( percent ); 101 batteryView->updatePercent( percent );
102 } 102 }
103 repaint( style != 0 ); 103 repaint( style != 0 );
104 if ( batteryView ) 104 if ( batteryView )
105 batteryView->repaint(); 105 batteryView->repaint();
106 } 106 }
107} 107}
108 108
109void BatteryMeter::chargeTimeout() 109void BatteryMeter::chargeTimeout()
110{ 110{
111 percent += 20; 111 percent += 20;
112 if ( percent > 100 ) 112 if ( percent > 100 )
113 percent = 0; 113 percent = 0;
114 114
115 repaint(FALSE); 115 repaint(FALSE);
116 if ( batteryView ) 116 if ( batteryView )
117 batteryView->updatePercent( percent ); 117 batteryView->updatePercent( percent );
118} 118}
119 119
120void BatteryMeter::paintEvent( QPaintEvent* ) 120void BatteryMeter::paintEvent( QPaintEvent* )
121{ 121{
122 122
123 if ( style == 1 ) 123 if ( style == 1 )
124 { 124 {
125 QPainter p(this); 125 QPainter p(this);
126 QFont f( "Fixed", AppLnk::smallIconSize()/2 ); 126 QFont f( "Fixed", AppLnk::smallIconSize()/2 );
127 QFontMetrics fm( f ); 127 QFontMetrics fm( f );
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index bdddd37..98e7481 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -568,98 +568,97 @@ static bool isVisibleWindow(int wid)
568 if ( w->winId() == wid ) 568 if ( w->winId() == wid )
569 return !w->isFullyObscured(); 569 return !w->isFullyObscured();
570 } 570 }
571#endif 571#endif
572 return FALSE; 572 return FALSE;
573} 573}
574 574
575void Launcher::viewSelected(const QString& s) 575void Launcher::viewSelected(const QString& s)
576{ 576{
577 setCaption( s + tr(" - Launcher") ); 577 setCaption( s + tr(" - Launcher") );
578} 578}
579 579
580void Launcher::showTab(const QString& id) 580void Launcher::showTab(const QString& id)
581{ 581{
582 tabs->categoryBar->showTab(id); 582 tabs->categoryBar->showTab(id);
583 raise(); 583 raise();
584} 584}
585 585
586void Launcher::select( const AppLnk *appLnk ) 586void Launcher::select( const AppLnk *appLnk )
587{ 587{
588 if ( appLnk->type() == "Folder" ) { // No tr 588 if ( appLnk->type() == "Folder" ) { // No tr
589 // Not supported: flat is simpler for the user 589 // Not supported: flat is simpler for the user
590 } else { 590 } else {
591 if ( appLnk->exec().isNull() ) { 591 if ( appLnk->exec().isNull() ) {
592 int i = QMessageBox::information(this,tr("No application"), 592 int i = QMessageBox::information(this,tr("No application"),
593 tr("<p>No application is defined for this document." 593 tr("<p>No application is defined for this document."
594 "<p>Type is %1.").arg(appLnk->type()), tr("OK"), tr("View as text"), 0, 0, 1); 594 "<p>Type is %1.").arg(appLnk->type()), tr("OK"), tr("View as text"), 0, 0, 1);
595 595
596 /* ### Fixme */ 596 /* ### Fixme */
597 if ( i == 1 ) 597 if ( i == 1 )
598 Global::execute("textedit",appLnk->file()); 598 Global::execute("textedit",appLnk->file());
599 599
600 return; 600 return;
601 } 601 }
602 tabs->setBusy(TRUE); 602 tabs->setBusy(TRUE);
603 emit executing( appLnk ); 603 emit executing( appLnk );
604 appLnk->execute(); 604 appLnk->execute();
605 } 605 }
606} 606}
607 607
608void Launcher::properties( AppLnk *appLnk ) 608void Launcher::properties( AppLnk *appLnk )
609{ 609{
610 if ( appLnk->type() == "Folder" ) { // No tr 610 if ( appLnk->type() == "Folder" ) { // No tr
611 // Not supported: flat is simpler for the user 611 // Not supported: flat is simpler for the user
612 } else { 612 } else {
613/* ### libqtopia FIXME also moving docLnks... */ 613/* ### libqtopia FIXME also moving docLnks... */
614 LnkProperties prop(appLnk,0 ); 614 LnkProperties prop(appLnk,0 );
615 615
616 prop.showMaximized(); 616 QPEApplication::execDialog( &prop );
617 prop.exec();
618 } 617 }
619} 618}
620 619
621void Launcher::storageChanged( const QList<FileSystem> &fs ) 620void Launcher::storageChanged( const QList<FileSystem> &fs )
622{ 621{
623 // ### update combo boxes if we had a combo box for the storage type 622 // ### update combo boxes if we had a combo box for the storage type
624} 623}
625 624
626void Launcher::systemMessage( const QCString &msg, const QByteArray &data) 625void Launcher::systemMessage( const QCString &msg, const QByteArray &data)
627{ 626{
628 QDataStream stream( data, IO_ReadOnly ); 627 QDataStream stream( data, IO_ReadOnly );
629 if ( msg == "busy()" ) { 628 if ( msg == "busy()" ) {
630 tb->startWait(); 629 tb->startWait();
631 } else if ( msg == "notBusy(QString)" ) { 630 } else if ( msg == "notBusy(QString)" ) {
632 QString app; 631 QString app;
633 stream >> app; 632 stream >> app;
634 tabs->setBusy(FALSE); 633 tabs->setBusy(FALSE);
635 tb->stopWait(app); 634 tb->stopWait(app);
636 } else if (msg == "applyStyle()") { 635 } else if (msg == "applyStyle()") {
637 tabs->currentView()->relayout(); 636 tabs->currentView()->relayout();
638 } 637 }
639} 638}
640 639
641// These are the update functions from the server 640// These are the update functions from the server
642void Launcher::typeAdded( const QString& type, const QString& name, 641void Launcher::typeAdded( const QString& type, const QString& name,
643 const QPixmap& pixmap, const QPixmap& ) 642 const QPixmap& pixmap, const QPixmap& )
644{ 643{
645 tabs->newView( type, pixmap, name ); 644 tabs->newView( type, pixmap, name );
646 ids.append( type ); 645 ids.append( type );
647 tb->refreshStartMenu(); 646 tb->refreshStartMenu();
648 647
649 static bool first = TRUE; 648 static bool first = TRUE;
650 if ( first ) { 649 if ( first ) {
651 first = FALSE; 650 first = FALSE;
652 tabs->categoryBar->showTab(type); 651 tabs->categoryBar->showTab(type);
653 } 652 }
654 653
655 tabs->view( type )->setUpdatesEnabled( FALSE ); 654 tabs->view( type )->setUpdatesEnabled( FALSE );
656 tabs->view( type )->setSortEnabled( FALSE ); 655 tabs->view( type )->setSortEnabled( FALSE );
657} 656}
658 657
659void Launcher::typeRemoved( const QString& type ) 658void Launcher::typeRemoved( const QString& type )
660{ 659{
661 tabs->view( type )->removeAllItems(); 660 tabs->view( type )->removeAllItems();
662 tabs->deleteView( type ); 661 tabs->deleteView( type );
663 ids.remove( type ); 662 ids.remove( type );
664 tb->refreshStartMenu(); 663 tb->refreshStartMenu();
665} 664}
diff --git a/core/launcher/serverapp.cpp b/core/launcher/serverapp.cpp
index e8d49fd..e18bcee 100644
--- a/core/launcher/serverapp.cpp
+++ b/core/launcher/serverapp.cpp
@@ -657,97 +657,97 @@ bool ServerApplication::qwsEventFilter( QWSEvent *e )
657 ke-> simpleData.keycode, 657 ke-> simpleData.keycode,
658 ke-> simpleData.is_press, 658 ke-> simpleData.is_press,
659 ke-> simpleData.is_auto_repeat ) ) 659 ke-> simpleData.is_auto_repeat ) )
660 return true; 660 return true;
661 } 661 }
662 662
663 return QPEApplication::qwsEventFilter( e ); 663 return QPEApplication::qwsEventFilter( e );
664} 664}
665#endif 665#endif
666 666
667 667
668/* ### FIXME libqtopia Plugin Safe Mode */ 668/* ### FIXME libqtopia Plugin Safe Mode */
669 669
670void ServerApplication::showSafeMode() 670void ServerApplication::showSafeMode()
671{ 671{
672#if 0 672#if 0
673 if ( QMessageBox::warning(0, tr("Safe Mode"), tr("<P>A system startup error occurred, " 673 if ( QMessageBox::warning(0, tr("Safe Mode"), tr("<P>A system startup error occurred, "
674 "and the system is now in Safe Mode. " 674 "and the system is now in Safe Mode. "
675 "Plugins are not loaded in Safe Mode. " 675 "Plugins are not loaded in Safe Mode. "
676 "You can use the Plugin Manager to " 676 "You can use the Plugin Manager to "
677 "disable plugins that cause system error."), tr("OK"), tr("Plugin Manager..."), 0) == 1 ) { 677 "disable plugins that cause system error."), tr("OK"), tr("Plugin Manager..."), 0) == 1 ) {
678 Global::execute( "pluginmanager" ); 678 Global::execute( "pluginmanager" );
679 } 679 }
680#endif 680#endif
681} 681}
682 682
683void ServerApplication::clearSafeMode() 683void ServerApplication::clearSafeMode()
684{ 684{
685#if 0 685#if 0
686 // If we've been running OK for a while then we won't bother going into 686 // If we've been running OK for a while then we won't bother going into
687 // safe mode immediately on the next crash. 687 // safe mode immediately on the next crash.
688 Config cfg( "PluginLoader" ); 688 Config cfg( "PluginLoader" );
689 cfg.setGroup( "Global" ); 689 cfg.setGroup( "Global" );
690 QString mode = cfg.readEntry( "Mode", "Normal" ); 690 QString mode = cfg.readEntry( "Mode", "Normal" );
691 if ( mode == "MaybeSafe" ) { 691 if ( mode == "MaybeSafe" ) {
692 cfg.writeEntry( "Mode", "Normal" ); 692 cfg.writeEntry( "Mode", "Normal" );
693 } 693 }
694#endif 694#endif
695} 695}
696 696
697 697
698void ServerApplication::shutdown() 698void ServerApplication::shutdown()
699{ 699{
700 if ( type() != GuiServer ) 700 if ( type() != GuiServer )
701 return; 701 return;
702 ShutdownImpl *sd = new ShutdownImpl( 0, 0, WDestructiveClose ); 702 ShutdownImpl *sd = new ShutdownImpl( 0, 0, WDestructiveClose );
703 connect( sd, SIGNAL(shutdown(ShutdownImpl::Type)), 703 connect( sd, SIGNAL(shutdown(ShutdownImpl::Type)),
704 this, SLOT(shutdown(ShutdownImpl::Type)) ); 704 this, SLOT(shutdown(ShutdownImpl::Type)) );
705 sd->showMaximized(); 705 QPEApplication::showWidget( sd );
706} 706}
707 707
708void ServerApplication::shutdown( ShutdownImpl::Type t ) 708void ServerApplication::shutdown( ShutdownImpl::Type t )
709{ 709{
710 char *opt = 0; 710 char *opt = 0;
711 711
712 switch ( t ) { 712 switch ( t ) {
713 case ShutdownImpl::ShutdownSystem: 713 case ShutdownImpl::ShutdownSystem:
714 opt = "-h"; 714 opt = "-h";
715 // fall through 715 // fall through
716 case ShutdownImpl::RebootSystem: 716 case ShutdownImpl::RebootSystem:
717 if ( opt == 0 ) 717 if ( opt == 0 )
718 opt = "-r"; 718 opt = "-r";
719 719
720 if ( execl( "/sbin/shutdown", "shutdown", opt, "now", ( void* ) 0) < 0 ) 720 if ( execl( "/sbin/shutdown", "shutdown", opt, "now", ( void* ) 0) < 0 )
721 perror("shutdown"); 721 perror("shutdown");
722 // ::syslog ( LOG_ERR, "Erroring execing shutdown\n" ); 722 // ::syslog ( LOG_ERR, "Erroring execing shutdown\n" );
723 723
724 break; 724 break;
725 case ShutdownImpl::RestartDesktop: 725 case ShutdownImpl::RestartDesktop:
726 restart(); 726 restart();
727 break; 727 break;
728 case ShutdownImpl::TerminateDesktop: 728 case ShutdownImpl::TerminateDesktop:
729 prepareForTermination( FALSE ); 729 prepareForTermination( FALSE );
730 730
731 // This is a workaround for a Qt bug 731 // This is a workaround for a Qt bug
732 // clipboard applet has to stop its poll timer, or Qt/E 732 // clipboard applet has to stop its poll timer, or Qt/E
733 // will hang on quit() right before it emits aboutToQuit() 733 // will hang on quit() right before it emits aboutToQuit()
734 emit aboutToQuit ( ); 734 emit aboutToQuit ( );
735 735
736 quit(); 736 quit();
737 break; 737 break;
738 } 738 }
739} 739}
740 740
741void ServerApplication::restart() 741void ServerApplication::restart()
742{ 742{
743 if ( allowRestart ) { 743 if ( allowRestart ) {
744 744
745 /* 745 /*
746 * Applets and restart is a problem. Some applets delete 746 * Applets and restart is a problem. Some applets delete
747 * their widgets even if ownership gets transfered to the 747 * their widgets even if ownership gets transfered to the
748 * parent (Systray ) but deleting the applet may be unsafe 748 * parent (Systray ) but deleting the applet may be unsafe
749 * as well ( double deletion ). Some have topLevel widgets 749 * as well ( double deletion ). Some have topLevel widgets
750 * and when we dlclose and then delete the widget we will 750 * and when we dlclose and then delete the widget we will
751 * crash and an crash during restart is not nice 751 * crash and an crash during restart is not nice
752 */ 752 */
753#ifdef ALL_APPLETS_ON_THIS_WORLD_ARE_FIXED 753#ifdef ALL_APPLETS_ON_THIS_WORLD_ARE_FIXED
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp
index 44fbe48..fbc5072 100644
--- a/core/multimedia/opieplayer/audiowidget.cpp
+++ b/core/multimedia/opieplayer/audiowidget.cpp
@@ -241,97 +241,97 @@ void AudioWidget::resizeEvent( QResizeEvent * ) {
241} 241}
242 242
243 243
244static bool audioSliderBeingMoved = FALSE; 244static bool audioSliderBeingMoved = FALSE;
245 245
246void AudioWidget::sliderPressed() { 246void AudioWidget::sliderPressed() {
247 audioSliderBeingMoved = TRUE; 247 audioSliderBeingMoved = TRUE;
248} 248}
249 249
250 250
251void AudioWidget::sliderReleased() { 251void AudioWidget::sliderReleased() {
252 audioSliderBeingMoved = FALSE; 252 audioSliderBeingMoved = FALSE;
253 if ( slider.width() == 0 ) 253 if ( slider.width() == 0 )
254 return; 254 return;
255 long val = long((double)slider.value() * mediaPlayerState->length() / slider.width()); 255 long val = long((double)slider.value() * mediaPlayerState->length() / slider.width());
256 mediaPlayerState->setPosition( val ); 256 mediaPlayerState->setPosition( val );
257} 257}
258 258
259 259
260void AudioWidget::setPosition( long i ) { 260void AudioWidget::setPosition( long i ) {
261// qDebug("set position %d",i); 261// qDebug("set position %d",i);
262 long length = mediaPlayerState->length(); 262 long length = mediaPlayerState->length();
263 updateSlider( i, length ); 263 updateSlider( i, length );
264} 264}
265 265
266 266
267void AudioWidget::setLength( long max ) { 267void AudioWidget::setLength( long max ) {
268 updateSlider( mediaPlayerState->position(), max ); 268 updateSlider( mediaPlayerState->position(), max );
269} 269}
270 270
271 271
272void AudioWidget::setView( char view ) { 272void AudioWidget::setView( char view ) {
273 273
274 if (mediaPlayerState->isStreaming) { 274 if (mediaPlayerState->isStreaming) {
275 if( !slider.isHidden()) slider.hide(); 275 if( !slider.isHidden()) slider.hide();
276 disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); 276 disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
277 disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); 277 disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
278 } else { 278 } else {
279// this stops the slider from being moved, thus 279// this stops the slider from being moved, thus
280 // does not stop stream when it reaches the end 280 // does not stop stream when it reaches the end
281 slider.show(); 281 slider.show();
282 connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); 282 connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
283 connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); 283 connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
284 } 284 }
285 285
286 if ( view == 'a' ) { 286 if ( view == 'a' ) {
287 startTimer( 150 ); 287 startTimer( 150 );
288// show(); 288// show();
289 showMaximized(); 289 QPEApplication::showWidget( this );
290 } else { 290 } else {
291 killTimers(); 291 killTimers();
292 hide(); 292 hide();
293 } 293 }
294 294
295} 295}
296 296
297 297
298static QString timeAsString( long length ) { 298static QString timeAsString( long length ) {
299 length /= 44100; 299 length /= 44100;
300 int minutes = length / 60; 300 int minutes = length / 60;
301 int seconds = length % 60; 301 int seconds = length % 60;
302 return QString("%1:%2%3").arg( minutes ).arg( seconds / 10 ).arg( seconds % 10 ); 302 return QString("%1:%2%3").arg( minutes ).arg( seconds / 10 ).arg( seconds % 10 );
303} 303}
304 304
305void AudioWidget::updateSlider( long i, long max ) { 305void AudioWidget::updateSlider( long i, long max ) {
306this->setFocus(); 306this->setFocus();
307 time.setText( timeAsString( i ) + " / " + timeAsString( max ) ); 307 time.setText( timeAsString( i ) + " / " + timeAsString( max ) );
308 308
309 if ( max == 0 ) 309 if ( max == 0 )
310 return; 310 return;
311 // Will flicker too much if we don't do this 311 // Will flicker too much if we don't do this
312 // Scale to something reasonable 312 // Scale to something reasonable
313 int width = slider.width(); 313 int width = slider.width();
314 int val = int((double)i * width / max); 314 int val = int((double)i * width / max);
315 if ( !audioSliderBeingMoved ) { 315 if ( !audioSliderBeingMoved ) {
316 if ( slider.value() != val ) 316 if ( slider.value() != val )
317 slider.setValue( val ); 317 slider.setValue( val );
318 if ( slider.maxValue() != width ) 318 if ( slider.maxValue() != width )
319 slider.setMaxValue( width ); 319 slider.setMaxValue( width );
320 } 320 }
321} 321}
322 322
323 323
324void AudioWidget::setToggleButton( int i, bool down ) { 324void AudioWidget::setToggleButton( int i, bool down ) {
325 if ( down != audioButtons[i].isDown ) 325 if ( down != audioButtons[i].isDown )
326 toggleButton( i ); 326 toggleButton( i );
327} 327}
328 328
329 329
330void AudioWidget::toggleButton( int i ) { 330void AudioWidget::toggleButton( int i ) {
331 audioButtons[i].isDown = !audioButtons[i].isDown; 331 audioButtons[i].isDown = !audioButtons[i].isDown;
332 QPainter p(this); 332 QPainter p(this);
333 paintButton ( &p, i ); 333 paintButton ( &p, i );
334} 334}
335 335
336 336
337void AudioWidget::paintButton( QPainter *p, int i ) { 337void AudioWidget::paintButton( QPainter *p, int i ) {
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index 82fd1e1..db99866 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -660,97 +660,97 @@ bool PlayListWidget::next() {
660 } else { 660 } else {
661 return mediaPlayerState->looping(); 661 return mediaPlayerState->looping();
662 } 662 }
663} 663}
664 664
665 665
666bool PlayListWidget::first() { 666bool PlayListWidget::first() {
667 if ( mediaPlayerState->playlist() ) 667 if ( mediaPlayerState->playlist() )
668 return d->selectedFiles->first(); 668 return d->selectedFiles->first();
669 else 669 else
670 return mediaPlayerState->looping(); 670 return mediaPlayerState->looping();
671} 671}
672 672
673 673
674bool PlayListWidget::last() { 674bool PlayListWidget::last() {
675 if ( mediaPlayerState->playlist() ) 675 if ( mediaPlayerState->playlist() )
676 return d->selectedFiles->last(); 676 return d->selectedFiles->last();
677 else 677 else
678 return mediaPlayerState->looping(); 678 return mediaPlayerState->looping();
679} 679}
680 680
681 681
682void PlayListWidget::saveList() { 682void PlayListWidget::saveList() {
683 writem3u(); 683 writem3u();
684} 684}
685 685
686void PlayListWidget::loadList( const DocLnk & lnk) { 686void PlayListWidget::loadList( const DocLnk & lnk) {
687 QString name = lnk.name(); 687 QString name = lnk.name();
688 // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<currentList is "+name); 688 // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<currentList is "+name);
689 689
690 if( name.length()>0) { 690 if( name.length()>0) {
691 setCaption("OpiePlayer: "+name); 691 setCaption("OpiePlayer: "+name);
692 // qDebug("<<<<<<<<<<<<load list "+ lnk.file()); 692 // qDebug("<<<<<<<<<<<<load list "+ lnk.file());
693 clearList(); 693 clearList();
694 readm3u(lnk.file()); 694 readm3u(lnk.file());
695 tabWidget->setCurrentPage(0); 695 tabWidget->setCurrentPage(0);
696 } 696 }
697} 697}
698 698
699void PlayListWidget::setPlaylist( bool shown ) { 699void PlayListWidget::setPlaylist( bool shown ) {
700 if ( shown ) 700 if ( shown )
701 d->playListFrame->show(); 701 d->playListFrame->show();
702 else 702 else
703 d->playListFrame->hide(); 703 d->playListFrame->hide();
704} 704}
705 705
706void PlayListWidget::setView( char view ) { 706void PlayListWidget::setView( char view ) {
707 if ( view == 'l' ) 707 if ( view == 'l' )
708 showMaximized(); 708 QPEApplication::showWidget( this );
709 else 709 else
710 hide(); 710 hide();
711} 711}
712 712
713void PlayListWidget::addSelected() { 713void PlayListWidget::addSelected() {
714 DocLnk lnk; 714 DocLnk lnk;
715 QString filename; 715 QString filename;
716 switch (tabWidget->currentPageIndex()) { 716 switch (tabWidget->currentPageIndex()) {
717 717
718 case 0: //playlist 718 case 0: //playlist
719 return; 719 return;
720 break; 720 break;
721 case 1: { //audio 721 case 1: { //audio
722 QListViewItemIterator it( audioView ); 722 QListViewItemIterator it( audioView );
723 for ( ; it.current(); ++it ) { 723 for ( ; it.current(); ++it ) {
724 if ( it.current()->isSelected() ) { 724 if ( it.current()->isSelected() ) {
725 filename = it.current()->text(3); 725 filename = it.current()->text(3);
726 lnk.setName( QFileInfo(filename).baseName() ); //sets name 726 lnk.setName( QFileInfo(filename).baseName() ); //sets name
727 lnk.setFile( filename ); //sets file name 727 lnk.setFile( filename ); //sets file name
728 d->selectedFiles->addToSelection( lnk); 728 d->selectedFiles->addToSelection( lnk);
729 } 729 }
730 } 730 }
731 audioView->clearSelection(); 731 audioView->clearSelection();
732 // d->selectedFiles->next(); 732 // d->selectedFiles->next();
733 } 733 }
734 break; 734 break;
735 735
736 case 2: { // video 736 case 2: { // video
737 QListViewItemIterator it( videoView ); 737 QListViewItemIterator it( videoView );
738 for ( ; it.current(); ++it ) { 738 for ( ; it.current(); ++it ) {
739 if ( it.current()->isSelected() ) { 739 if ( it.current()->isSelected() ) {
740 740
741 filename = it.current()->text(3); 741 filename = it.current()->text(3);
742 lnk.setName( QFileInfo(filename).baseName() ); //sets name 742 lnk.setName( QFileInfo(filename).baseName() ); //sets name
743 lnk.setFile( filename ); //sets file name 743 lnk.setFile( filename ); //sets file name
744 d->selectedFiles->addToSelection( lnk); 744 d->selectedFiles->addToSelection( lnk);
745 } 745 }
746 } 746 }
747 videoView->clearSelection(); 747 videoView->clearSelection();
748 } 748 }
749 break; 749 break;
750 }; 750 };
751 // tabWidget->setCurrentPage(0); 751 // tabWidget->setCurrentPage(0);
752 writeCurrentM3u(); 752 writeCurrentM3u();
753 753
754} 754}
755 755
756void PlayListWidget::removeSelected() { 756void PlayListWidget::removeSelected() {
diff --git a/core/multimedia/opieplayer/videowidget.cpp b/core/multimedia/opieplayer/videowidget.cpp
index d9a9478..5273ad3 100644
--- a/core/multimedia/opieplayer/videowidget.cpp
+++ b/core/multimedia/opieplayer/videowidget.cpp
@@ -375,97 +375,97 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) {
375 mediaPlayerState->setPaused( TRUE ); 375 mediaPlayerState->setPaused( TRUE );
376 return; 376 return;
377 } else { 377 } else {
378 return; 378 return;
379 } 379 }
380 } 380 }
381 381
382 case VideoStop: mediaPlayerState->setPlaying( FALSE ); setToggleButton( i+1, true); setToggleButton( i, true ); return; 382 case VideoStop: mediaPlayerState->setPlaying( FALSE ); setToggleButton( i+1, true); setToggleButton( i, true ); return;
383 case VideoNext: mediaPlayerState->setNext(); return; 383 case VideoNext: mediaPlayerState->setNext(); return;
384 case VideoPrevious: mediaPlayerState->setPrev(); return; 384 case VideoPrevious: mediaPlayerState->setPrev(); return;
385 case VideoVolUp: emit moreReleased(); return; 385 case VideoVolUp: emit moreReleased(); return;
386 case VideoVolDown: emit lessReleased(); return; 386 case VideoVolDown: emit lessReleased(); return;
387 case VideoFullscreen: mediaPlayerState->setFullscreen( TRUE ); makeVisible(); return; 387 case VideoFullscreen: mediaPlayerState->setFullscreen( TRUE ); makeVisible(); return;
388 } 388 }
389 } 389 }
390 } 390 }
391 } 391 }
392} 392}
393 393
394 394
395void VideoWidget::mousePressEvent( QMouseEvent *event ) { 395void VideoWidget::mousePressEvent( QMouseEvent *event ) {
396 mouseMoveEvent( event ); 396 mouseMoveEvent( event );
397} 397}
398 398
399 399
400void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) { 400void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) {
401 if ( mediaPlayerState->fullscreen() ) 401 if ( mediaPlayerState->fullscreen() )
402 { 402 {
403 mediaPlayerState->setFullscreen( FALSE ); 403 mediaPlayerState->setFullscreen( FALSE );
404 makeVisible(); 404 makeVisible();
405 } 405 }
406 mouseMoveEvent( event ); 406 mouseMoveEvent( event );
407// } 407// }
408} 408}
409 409
410 410
411void VideoWidget::makeVisible() { 411void VideoWidget::makeVisible() {
412 if ( mediaPlayerState->fullscreen() ) 412 if ( mediaPlayerState->fullscreen() )
413 { 413 {
414 setBackgroundMode( QWidget::NoBackground ); 414 setBackgroundMode( QWidget::NoBackground );
415 showFullScreen(); 415 showFullScreen();
416 resize( qApp->desktop()->size() ); 416 resize( qApp->desktop()->size() );
417 slider->hide(); 417 slider->hide();
418 } 418 }
419 else 419 else
420 { 420 {
421 setBackgroundPixmap( *pixBg ); 421 setBackgroundPixmap( *pixBg );
422 showNormal(); 422 showNormal();
423 showMaximized(); 423 QPEApplication::showWidget( this );
424 slider->show(); 424 slider->show();
425 } 425 }
426} 426}
427 427
428 428
429void VideoWidget::paintEvent( QPaintEvent * pe) { 429void VideoWidget::paintEvent( QPaintEvent * pe) {
430 QPainter p( this ); 430 QPainter p( this );
431 431
432 if ( mediaPlayerState->fullscreen() ) { 432 if ( mediaPlayerState->fullscreen() ) {
433 // Clear the background 433 // Clear the background
434 p.setBrush( QBrush( Qt::black ) ); 434 p.setBrush( QBrush( Qt::black ) );
435 p.drawRect( rect() ); 435 p.drawRect( rect() );
436 } else { 436 } else {
437 if ( !pe->erased() ) { 437 if ( !pe->erased() ) {
438 // Combine with background and double buffer 438 // Combine with background and double buffer
439 QPixmap pix( pe->rect().size() ); 439 QPixmap pix( pe->rect().size() );
440 QPainter p( &pix ); 440 QPainter p( &pix );
441 p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); 441 p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
442 p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() ); 442 p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() );
443 for ( int i = 0; i < numVButtons; i++ ) { 443 for ( int i = 0; i < numVButtons; i++ ) {
444 paintButton( &p, i ); 444 paintButton( &p, i );
445 } 445 }
446 QPainter p2( this ); 446 QPainter p2( this );
447 p2.drawPixmap( pe->rect().topLeft(), pix ); 447 p2.drawPixmap( pe->rect().topLeft(), pix );
448 } else { 448 } else {
449 QPainter p( this ); 449 QPainter p( this );
450 for ( int i = 0; i < numVButtons; i++ ) 450 for ( int i = 0; i < numVButtons; i++ )
451 paintButton( &p, i ); 451 paintButton( &p, i );
452 } 452 }
453 slider->repaint( TRUE ); 453 slider->repaint( TRUE );
454 } 454 }
455} 455}
456 456
457 457
458void VideoWidget::closeEvent( QCloseEvent* ) { 458void VideoWidget::closeEvent( QCloseEvent* ) {
459 mediaPlayerState->setList(); 459 mediaPlayerState->setList();
460} 460}
461 461
462 462
463bool VideoWidget::playVideo() { 463bool VideoWidget::playVideo() {
464 bool result = FALSE; 464 bool result = FALSE;
465// qDebug("<<<<<<<<<<<<<<<< play video"); 465// qDebug("<<<<<<<<<<<<<<<< play video");
466 int stream = 0; 466 int stream = 0;
467 467
468 int sw = mediaPlayerState->curDecoder()->videoWidth( stream ); 468 int sw = mediaPlayerState->curDecoder()->videoWidth( stream );
469 int sh = mediaPlayerState->curDecoder()->videoHeight( stream ); 469 int sh = mediaPlayerState->curDecoder()->videoHeight( stream );
470 int dd = QPixmap::defaultDepth(); 470 int dd = QPixmap::defaultDepth();
471 int w = height(); 471 int w = height();
diff --git a/core/obex/obexhandler.cpp b/core/obex/obexhandler.cpp
index 5aaf63c..c237555 100644
--- a/core/obex/obexhandler.cpp
+++ b/core/obex/obexhandler.cpp
@@ -1,67 +1,68 @@
1#include <qcopchannel_qws.h> 1#include <qcopchannel_qws.h>
2 2
3#include <qpe/qcopenvelope_qws.h> 3#include <qpe/qcopenvelope_qws.h>
4#include <qpe/qpeapplication.h>
4 5
5#include "obexsend.h" 6#include "obexsend.h"
6#include "receiver.h" 7#include "receiver.h"
7#include "obexhandler.h" 8#include "obexhandler.h"
8 9
9using namespace OpieObex; 10using namespace OpieObex;
10 11
11/* TRANSLATOR OpieObex::ObexHandler */ 12/* TRANSLATOR OpieObex::ObexHandler */
12 13
13ObexHandler::ObexHandler() { 14ObexHandler::ObexHandler() {
14 m_wasRec = false; 15 m_wasRec = false;
15 m_sender = 0l; 16 m_sender = 0l;
16 m_receiver = 0l; 17 m_receiver = 0l;
17 QCopChannel* chan = new QCopChannel("QPE/Obex"); 18 QCopChannel* chan = new QCopChannel("QPE/Obex");
18 connect(chan, SIGNAL(received(const QCString&, const QByteArray& ) ), 19 connect(chan, SIGNAL(received(const QCString&, const QByteArray& ) ),
19 this, SLOT(irdaMessage(const QCString&, const QByteArray& ) ) ); 20 this, SLOT(irdaMessage(const QCString&, const QByteArray& ) ) );
20} 21}
21ObexHandler::~ObexHandler() { 22ObexHandler::~ObexHandler() {
22 delete m_sender; 23 delete m_sender;
23 delete m_receiver; 24 delete m_receiver;
24} 25}
25void ObexHandler::doSend(const QString& str, const QString& desc) { 26void ObexHandler::doSend(const QString& str, const QString& desc) {
26 delete m_sender; 27 delete m_sender;
27 m_sender = new SendWidget; 28 m_sender = new SendWidget;
28 m_sender->raise(); 29 m_sender->raise();
29 m_sender->showMaximized(); 30 QPEApplication::showWidget( m_sender );
30 connect(m_sender, SIGNAL(done() ), 31 connect(m_sender, SIGNAL(done() ),
31 this, SLOT(slotSent() ) ); 32 this, SLOT(slotSent() ) );
32 m_sender->send( str, desc ); 33 m_sender->send( str, desc );
33} 34}
34void ObexHandler::doReceive(bool b) { 35void ObexHandler::doReceive(bool b) {
35 if (m_receiver && b ) return; // we should enable receiver and it is on 36 if (m_receiver && b ) return; // we should enable receiver and it is on
36 else if (!m_receiver && !b ) return; // we should disbale receiver and it is off 37 else if (!m_receiver && !b ) return; // we should disbale receiver and it is off
37 else if (m_receiver && !b ) { 38 else if (m_receiver && !b ) {
38 delete m_receiver; 39 delete m_receiver;
39 m_receiver=0; 40 m_receiver=0;
40 }else if (!m_receiver && b ) { 41 }else if (!m_receiver && b ) {
41 m_receiver= new Receiver; 42 m_receiver= new Receiver;
42 } 43 }
43} 44}
44void ObexHandler::slotSent() { 45void ObexHandler::slotSent() {
45 QString file = m_sender->file(); 46 QString file = m_sender->file();
46 delete m_sender; 47 delete m_sender;
47 m_sender = 0; 48 m_sender = 0;
48 QCopEnvelope e ("QPE/Obex", "done(QString)" ); 49 QCopEnvelope e ("QPE/Obex", "done(QString)" );
49 e << file; 50 e << file;
50 doReceive(m_wasRec ); 51 doReceive(m_wasRec );
51 m_wasRec = false; 52 m_wasRec = false;
52} 53}
53void ObexHandler::irdaMessage( const QCString& msg, const QByteArray& data) { 54void ObexHandler::irdaMessage( const QCString& msg, const QByteArray& data) {
54 QDataStream stream( data, IO_ReadOnly ); 55 QDataStream stream( data, IO_ReadOnly );
55 if ( msg == "send(QString,QString,QString)" ) { 56 if ( msg == "send(QString,QString,QString)" ) {
56 QString name, desc; 57 QString name, desc;
57 stream >> desc; 58 stream >> desc;
58 stream >> name; 59 stream >> name;
59 m_wasRec = (m_receiver != 0 ); 60 m_wasRec = (m_receiver != 0 );
60 doReceive( false ); 61 doReceive( false );
61 doSend(name, desc); 62 doSend(name, desc);
62 }else if (msg == "receive(int)") { 63 }else if (msg == "receive(int)") {
63 int rec; 64 int rec;
64 stream >> rec; 65 stream >> rec;
65 doReceive(rec); 66 doReceive(rec);
66 } 67 }
67} 68}
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 139c91b..c83a5df 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -37,97 +37,97 @@ struct TodayPlugin {
37 QInterfacePtr<TodayPluginInterface> iface; 37 QInterfacePtr<TodayPluginInterface> iface;
38 TodayPluginObject *guiPart; 38 TodayPluginObject *guiPart;
39 QWidget *guiBox; 39 QWidget *guiBox;
40 QString name; 40 QString name;
41 bool active; 41 bool active;
42 bool excludeRefresh; 42 bool excludeRefresh;
43 int pos; 43 int pos;
44}; 44};
45 45
46static QValueList<TodayPlugin> pluginList; 46static QValueList<TodayPlugin> pluginList;
47 47
48static QMap<QString, TodayPlugin> tempList; 48static QMap<QString, TodayPlugin> tempList;
49 49
50Today::Today( QWidget* parent, const char* name, WFlags fl ) 50Today::Today( QWidget* parent, const char* name, WFlags fl )
51 : TodayBase( parent, name, fl ) { 51 : TodayBase( parent, name, fl ) {
52 52
53 QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) ); 53 QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) );
54 QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) ); 54 QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) );
55 55
56#if defined(Q_WS_QWS) 56#if defined(Q_WS_QWS)
57#if !defined(QT_NO_COP) 57#if !defined(QT_NO_COP)
58 QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this ); 58 QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this );
59 connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ), 59 connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ),
60 this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); 60 this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) );
61#endif 61#endif
62#endif 62#endif
63 63
64 setOwnerField(); 64 setOwnerField();
65 m_refreshTimer = new QTimer( this ); 65 m_refreshTimer = new QTimer( this );
66 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 66 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
67 m_refreshTimer->start( 15000 ); 67 m_refreshTimer->start( 15000 );
68 m_big_box = 0L; 68 m_big_box = 0L;
69 69
70 70
71 layout = new QVBoxLayout( this ); 71 layout = new QVBoxLayout( this );
72 layout->addWidget( Frame ); 72 layout->addWidget( Frame );
73 layout->addWidget( OwnerField ); 73 layout->addWidget( OwnerField );
74 74
75 m_sv = new QScrollView( this ); 75 m_sv = new QScrollView( this );
76 m_sv->setResizePolicy( QScrollView::AutoOneFit ); 76 m_sv->setResizePolicy( QScrollView::AutoOneFit );
77 m_sv->setHScrollBarMode( QScrollView::AlwaysOff ); 77 m_sv->setHScrollBarMode( QScrollView::AlwaysOff );
78 m_sv->setFrameShape( QFrame::NoFrame ); 78 m_sv->setFrameShape( QFrame::NoFrame );
79 79
80 layout->addWidget( m_sv ); 80 layout->addWidget( m_sv );
81 layout->setStretchFactor( m_sv,4 ); 81 layout->setStretchFactor( m_sv,4 );
82 82
83 qApp->processEvents(); 83 qApp->processEvents();
84 loadPlugins(); 84 loadPlugins();
85 showMaximized(); 85 QPEApplication::showWidget( this );
86} 86}
87 87
88/** 88/**
89 * Qcop receive method. 89 * Qcop receive method.
90 */ 90 */
91void Today::channelReceived( const QCString &msg, const QByteArray & data ) { 91void Today::channelReceived( const QCString &msg, const QByteArray & data ) {
92 QDataStream stream( data, IO_ReadOnly ); 92 QDataStream stream( data, IO_ReadOnly );
93 if ( msg == "message(QString)" ) { 93 if ( msg == "message(QString)" ) {
94 QString message; 94 QString message;
95 stream >> message; 95 stream >> message;
96 setOwnerField( message ); 96 setOwnerField( message );
97 } 97 }
98} 98}
99 99
100void Today::setRefreshTimer( int interval ) { 100void Today::setRefreshTimer( int interval ) {
101 101
102 disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 102 disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
103 103
104 // 0 is "never" case 104 // 0 is "never" case
105 if ( !interval == 0 ) { 105 if ( !interval == 0 ) {
106 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 106 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
107 m_refreshTimer->changeInterval( interval ); 107 m_refreshTimer->changeInterval( interval );
108 } 108 }
109} 109}
110 110
111 111
112/** 112/**
113 * Initialises the owner field with the default value, the username 113 * Initialises the owner field with the default value, the username
114 */ 114 */
115void Today::setOwnerField() { 115void Today::setOwnerField() {
116 QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" ); 116 QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" );
117 if ( QFile::exists( file ) ) { 117 if ( QFile::exists( file ) ) {
118 Contact cont = Contact::readVCard( file )[0]; 118 Contact cont = Contact::readVCard( file )[0];
119 QString returnString = cont.fullName(); 119 QString returnString = cont.fullName();
120 OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" ); 120 OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" );
121 } else { 121 } else {
122 OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" ); 122 OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" );
123 } 123 }
124} 124}
125 125
126/** 126/**
127 * Set the owner field with a given QString, for example per qcop. 127 * Set the owner field with a given QString, for example per qcop.
128 */ 128 */
129void Today::setOwnerField( QString &message ) { 129void Today::setOwnerField( QString &message ) {
130 if ( !message.isEmpty() ) { 130 if ( !message.isEmpty() ) {
131 OwnerField->setText( "<b>" + message + "</b>" ); 131 OwnerField->setText( "<b>" + message + "</b>" );
132 } 132 }
133} 133}
diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp
index e71c5b0..9ced0d8 100644
--- a/core/pim/today/todayconfig.cpp
+++ b/core/pim/today/todayconfig.cpp
@@ -1,138 +1,139 @@
1/* 1/*
2 * todayconfig.cpp 2 * todayconfig.cpp
3 * 3 *
4 * copyright : (c) 2002, 2003 by Maximilian Reiß 4 * copyright : (c) 2002, 2003 by Maximilian Reiß
5 * email : harlekin@handhelds.org 5 * email : harlekin@handhelds.org
6 * 6 *
7 */ 7 */
8/*************************************************************************** 8/***************************************************************************
9 * * 9 * *
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17#include "todayconfig.h" 17#include "todayconfig.h"
18 18
19#include <qpe/config.h> 19#include <qpe/config.h>
20#include <qpe/resource.h> 20#include <qpe/resource.h>
21#include <qpe/qcopenvelope_qws.h> 21#include <qpe/qcopenvelope_qws.h>
22#include <qpe/qpeapplication.h>
22 23
23#include <qcheckbox.h> 24#include <qcheckbox.h>
24#include <qlabel.h> 25#include <qlabel.h>
25#include <qspinbox.h> 26#include <qspinbox.h>
26#include <qlayout.h> 27#include <qlayout.h>
27#include <qheader.h> 28#include <qheader.h>
28#include <qvbox.h> 29#include <qvbox.h>
29#include <qtoolbutton.h> 30#include <qtoolbutton.h>
30#include <qwhatsthis.h> 31#include <qwhatsthis.h>
31 32
32class ToolButton : public QToolButton { 33class ToolButton : public QToolButton {
33 34
34public: 35public:
35 ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) 36 ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE )
36 : QToolButton( parent, name ) { 37 : QToolButton( parent, name ) {
37 setPixmap( Resource::loadPixmap( icon ) ); 38 setPixmap( Resource::loadPixmap( icon ) );
38 setAutoRaise( TRUE ); 39 setAutoRaise( TRUE );
39 setFocusPolicy( QWidget::NoFocus ); 40 setFocusPolicy( QWidget::NoFocus );
40 setToggleButton( t ); 41 setToggleButton( t );
41 connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); 42 connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot );
42 } 43 }
43}; 44};
44 45
45 46
46/** 47/**
47 * The class has currently quite some duplicate code. 48 * The class has currently quite some duplicate code.
48 * By that way it would be real easy to have it as seperate app in settings tab 49 * By that way it would be real easy to have it as seperate app in settings tab
49 * 50 *
50 */ 51 */
51TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal ) 52TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal )
52 : QDialog( parent, name, modal, WStyle_ContextHelp ) { 53 : QDialog( parent, name, modal, WStyle_ContextHelp ) {
53 54
54 setCaption( tr( "Today Config" ) ); 55 setCaption( tr( "Today Config" ) );
55 56
56 QVBoxLayout *layout = new QVBoxLayout( this ); 57 QVBoxLayout *layout = new QVBoxLayout( this );
57 TabWidget3 = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); 58 TabWidget3 = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom );
58 layout->addWidget( TabWidget3 ); 59 layout->addWidget( TabWidget3 );
59 60
60 tab_2 = new QWidget( TabWidget3, "tab_2" ); 61 tab_2 = new QWidget( TabWidget3, "tab_2" );
61 QVBoxLayout *tab2Layout = new QVBoxLayout( tab_2, 4 ,4 ); 62 QVBoxLayout *tab2Layout = new QVBoxLayout( tab_2, 4 ,4 );
62 QLabel *l = new QLabel( tr( "Load which plugins in what order:" ), tab_2 ); 63 QLabel *l = new QLabel( tr( "Load which plugins in what order:" ), tab_2 );
63 tab2Layout->addWidget( l ); 64 tab2Layout->addWidget( l );
64 QHBox *hbox1 = new QHBox( tab_2 ); 65 QHBox *hbox1 = new QHBox( tab_2 );
65 m_appletListView = new QListView( hbox1 ); 66 m_appletListView = new QListView( hbox1 );
66 m_appletListView->addColumn( "PluginList" ); 67 m_appletListView->addColumn( "PluginList" );
67 m_appletListView->header()->hide(); 68 m_appletListView->header()->hide();
68 m_appletListView->setSorting( -1 ); 69 m_appletListView->setSorting( -1 );
69 QWhatsThis::add( m_appletListView, tr( "Check a checkbox to activate/deactivate a plugin or use the arrow buttons on the right to change the appearance order" ) ); 70 QWhatsThis::add( m_appletListView, tr( "Check a checkbox to activate/deactivate a plugin or use the arrow buttons on the right to change the appearance order" ) );
70 QVBox *vbox1 = new QVBox( hbox1 ); 71 QVBox *vbox1 = new QVBox( hbox1 );
71 new ToolButton( vbox1, tr( "Move Up" ), "up", this , SLOT( moveSelectedUp() ) ); 72 new ToolButton( vbox1, tr( "Move Up" ), "up", this , SLOT( moveSelectedUp() ) );
72 new ToolButton( vbox1, tr( "Move Down" ), "down", this , SLOT( moveSelectedDown() ) ); 73 new ToolButton( vbox1, tr( "Move Down" ), "down", this , SLOT( moveSelectedDown() ) );
73 tab2Layout->addWidget( hbox1 ); 74 tab2Layout->addWidget( hbox1 );
74 TabWidget3->addTab( tab_2, "pass", tr( "active/order" ) ); 75 TabWidget3->addTab( tab_2, "pass", tr( "active/order" ) );
75 76
76 // Misc tab 77 // Misc tab
77 tab_3 = new QWidget( TabWidget3, "tab_3" ); 78 tab_3 = new QWidget( TabWidget3, "tab_3" );
78 QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 ); 79 QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 );
79 80
80 m_guiMisc = new TodayConfigMiscBase( tab_3 ); 81 m_guiMisc = new TodayConfigMiscBase( tab_3 );
81 82
82 tab3Layout->addWidget( m_guiMisc ); 83 tab3Layout->addWidget( m_guiMisc );
83 TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) ); 84 TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) );
84 85
85 m_applets_changed = false; 86 m_applets_changed = false;
86 87
87 connect ( m_appletListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( appletChanged ( ) ) ); 88 connect ( m_appletListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( appletChanged ( ) ) );
88 89
89 readConfig(); 90 readConfig();
90 showMaximized(); 91 QPEApplication::showDialog( this );
91} 92}
92 93
93 94
94/** 95/**
95 * Autostart, uses the new (opie only) autostart method in the launcher code. 96 * Autostart, uses the new (opie only) autostart method in the launcher code.
96 * If registered against that today ist started on each resume. 97 * If registered against that today ist started on each resume.
97 */ 98 */
98void TodayConfig::setAutoStart() { 99void TodayConfig::setAutoStart() {
99 Config cfg( "today" ); 100 Config cfg( "today" );
100 cfg.setGroup( "Autostart" ); 101 cfg.setGroup( "Autostart" );
101 if ( m_autoStart ) { 102 if ( m_autoStart ) {
102 QCopEnvelope e( "QPE/System", "autoStart(QString,QString,QString)" ); 103 QCopEnvelope e( "QPE/System", "autoStart(QString,QString,QString)" );
103 e << QString( "add" ); 104 e << QString( "add" );
104 e << QString( "today" ); 105 e << QString( "today" );
105 e << QString( "%1" ).arg( m_autoStartTimer ); 106 e << QString( "%1" ).arg( m_autoStartTimer );
106 } else { 107 } else {
107 QCopEnvelope e( "QPE/System", "autoStart(QString,QString)" ); 108 QCopEnvelope e( "QPE/System", "autoStart(QString,QString)" );
108 e << QString( "remove" ); 109 e << QString( "remove" );
109 e << QString( "today" ); 110 e << QString( "today" );
110 } 111 }
111} 112}
112 113
113/** 114/**
114 * Read the config part 115 * Read the config part
115 */ 116 */
116void TodayConfig::readConfig() { 117void TodayConfig::readConfig() {
117 Config cfg( "today" ); 118 Config cfg( "today" );
118 cfg.setGroup( "Autostart" ); 119 cfg.setGroup( "Autostart" );
119 m_autoStart = cfg.readNumEntry( "autostart", 1 ); 120 m_autoStart = cfg.readNumEntry( "autostart", 1 );
120 m_guiMisc->CheckBoxAuto->setChecked( m_autoStart ); 121 m_guiMisc->CheckBoxAuto->setChecked( m_autoStart );
121 m_autoStartTimer = cfg.readNumEntry( "autostartdelay", 0 ); 122 m_autoStartTimer = cfg.readNumEntry( "autostartdelay", 0 );
122 m_guiMisc->SpinBoxTime->setValue( m_autoStartTimer ); 123 m_guiMisc->SpinBoxTime->setValue( m_autoStartTimer );
123 124
124 cfg.setGroup( "General" ); 125 cfg.setGroup( "General" );
125 m_iconSize = cfg.readNumEntry( "IconSize", 18 ); 126 m_iconSize = cfg.readNumEntry( "IconSize", 18 );
126 m_guiMisc->SpinBoxIconSize->setValue( m_iconSize ); 127 m_guiMisc->SpinBoxIconSize->setValue( m_iconSize );
127 m_guiMisc->SpinRefresh->setValue( cfg.readNumEntry( "checkinterval", 15000 ) / 1000 ); 128 m_guiMisc->SpinRefresh->setValue( cfg.readNumEntry( "checkinterval", 15000 ) / 1000 );
128 m_guiMisc->CheckBoxHide->setChecked( cfg.readNumEntry( "HideBanner", 0 ) ); 129 m_guiMisc->CheckBoxHide->setChecked( cfg.readNumEntry( "HideBanner", 0 ) );
129 130
130 131
131 cfg.setGroup( "Plugins" ); 132 cfg.setGroup( "Plugins" );
132 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); 133 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' );
133} 134}
134 135
135/** 136/**
136 * Write the config part 137 * Write the config part
137 */ 138 */
138void TodayConfig::writeConfig() { 139void TodayConfig::writeConfig() {
diff --git a/core/settings/button/buttonsettings.cpp b/core/settings/button/buttonsettings.cpp
index 523e295..141e0f6 100644
--- a/core/settings/button/buttonsettings.cpp
+++ b/core/settings/button/buttonsettings.cpp
@@ -169,87 +169,86 @@ buttoninfo *ButtonSettings::buttonInfoForKeycode ( ushort key )
169 if ((*it)-> m_button-> keycode ( ) == key ) 169 if ((*it)-> m_button-> keycode ( ) == key )
170 return *it; 170 return *it;
171 } 171 }
172 return 0; 172 return 0;
173} 173}
174 174
175void ButtonSettings::keyPressEvent ( QKeyEvent *e ) 175void ButtonSettings::keyPressEvent ( QKeyEvent *e )
176{ 176{
177 buttoninfo *bi = buttonInfoForKeycode ( e-> key ( )); 177 buttoninfo *bi = buttonInfoForKeycode ( e-> key ( ));
178 178
179 if ( bi && !e-> isAutoRepeat ( )) { 179 if ( bi && !e-> isAutoRepeat ( )) {
180 m_timer-> stop ( ); 180 m_timer-> stop ( );
181 m_last_button = bi; 181 m_last_button = bi;
182 m_timer-> start ( ODevice::inst ( )-> buttonHoldTime ( ), true ); 182 m_timer-> start ( ODevice::inst ( )-> buttonHoldTime ( ), true );
183 } 183 }
184 else 184 else
185 QDialog::keyPressEvent ( e ); 185 QDialog::keyPressEvent ( e );
186} 186}
187 187
188void ButtonSettings::keyReleaseEvent ( QKeyEvent *e ) 188void ButtonSettings::keyReleaseEvent ( QKeyEvent *e )
189{ 189{
190 buttoninfo *bi = buttonInfoForKeycode ( e-> key ( )); 190 buttoninfo *bi = buttonInfoForKeycode ( e-> key ( ));
191 191
192 if ( bi && !e-> isAutoRepeat ( ) && m_timer-> isActive ( )) { 192 if ( bi && !e-> isAutoRepeat ( ) && m_timer-> isActive ( )) {
193 m_timer-> stop ( ); 193 m_timer-> stop ( );
194 edit ( bi, false ); 194 edit ( bi, false );
195 } 195 }
196 else 196 else
197 QDialog::keyReleaseEvent ( e ); 197 QDialog::keyReleaseEvent ( e );
198} 198}
199 199
200void ButtonSettings::keyTimeout ( ) 200void ButtonSettings::keyTimeout ( )
201{ 201{
202 if ( m_last_button ) { 202 if ( m_last_button ) {
203 edit ( m_last_button, true ); 203 edit ( m_last_button, true );
204 m_last_button = false; 204 m_last_button = false;
205 } 205 }
206} 206}
207 207
208void ButtonSettings::edit ( buttoninfo *bi, bool hold ) 208void ButtonSettings::edit ( buttoninfo *bi, bool hold )
209{ 209{
210 210
211 if ( m_lock ) 211 if ( m_lock )
212 return; 212 return;
213 m_lock = true; 213 m_lock = true;
214 214
215 RemapDlg *d = new RemapDlg ( bi-> m_button, hold, this ); 215 RemapDlg *d = new RemapDlg ( bi-> m_button, hold, this );
216 216
217 d-> showMaximized ( ); 217 if ( QPEApplication::execDialog ( d ) == QDialog::Accepted ) {
218 if ( d-> exec ( ) == QDialog::Accepted ) {
219 218
220 219
221 if ( hold ) { 220 if ( hold ) {
222 bi-> m_hmsg = d-> message ( ); 221 bi-> m_hmsg = d-> message ( );
223 bi-> m_hdirty = true; 222 bi-> m_hdirty = true;
224 } 223 }
225 else { 224 else {
226 bi-> m_pmsg = d-> message ( ); 225 bi-> m_pmsg = d-> message ( );
227 bi-> m_pdirty = true; 226 bi-> m_pdirty = true;
228 } 227 }
229 228
230 updateLabels ( ); 229 updateLabels ( );
231 } 230 }
232 231
233 delete d; 232 delete d;
234 233
235 m_lock = false; 234 m_lock = false;
236} 235}
237 236
238void ButtonSettings::accept ( ) 237void ButtonSettings::accept ( )
239{ 238{
240 for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { 239 for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) {
241 buttoninfo *bi = *it; 240 buttoninfo *bi = *it;
242 241
243 if ( bi-> m_pdirty ) 242 if ( bi-> m_pdirty )
244 ODevice::inst ( )-> remapPressedAction ( bi-> m_index, bi-> m_pmsg ); 243 ODevice::inst ( )-> remapPressedAction ( bi-> m_index, bi-> m_pmsg );
245 if ( bi-> m_hdirty ) 244 if ( bi-> m_hdirty )
246 ODevice::inst ( )-> remapHeldAction ( bi-> m_index, bi-> m_hmsg ); 245 ODevice::inst ( )-> remapHeldAction ( bi-> m_index, bi-> m_hmsg );
247 } 246 }
248 QDialog::accept ( ); 247 QDialog::accept ( );
249} 248}
250 249
251void ButtonSettings::done ( int r ) 250void ButtonSettings::done ( int r )
252{ 251{
253 QDialog::done ( r ); 252 QDialog::done ( r );
254 close ( ); 253 close ( );
255} 254}
diff --git a/core/settings/launcher/tabssettings.cpp b/core/settings/launcher/tabssettings.cpp
index a3d31a5..17a1609 100644
--- a/core/settings/launcher/tabssettings.cpp
+++ b/core/settings/launcher/tabssettings.cpp
@@ -1,82 +1,83 @@
1/* 1/*
2               =. This file is part of the OPIE Project 2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> 3             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
4           .>+-= 4           .>+-=
5 _;:,     .>    :=|. This file is free software; you can 5 _;:,     .>    :=|. This file is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under 6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU General Public 7:`=1 )Y*s>-.--   : the terms of the GNU General Public
8.="- .-=="i,     .._ License as published by the Free Software 8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License, 9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version. 10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_. 11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This file is distributed in the hope that 12    .i_,=:_.      -<s. This file is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of 14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
17..}^=.=       =       ; Public License for more details. 17..}^=.=       =       ; Public License for more details.
18++=   -.     .`     .: 18++=   -.     .`     .:
19 :     =  ...= . :.=- You should have received a copy of the GNU 19 :     =  ...= . :.=- You should have received a copy of the GNU
20 -.   .:....=;==+<; General Public License along with this file; 20 -.   .:....=;==+<; General Public License along with this file;
21  -_. . .   )=.  = see the file COPYING. If not, write to the 21  -_. . .   )=.  = see the file COPYING. If not, write to the
22    --        :-=` Free Software Foundation, Inc., 22    --        :-=` Free Software Foundation, Inc.,
23 59 Temple Place - Suite 330, 23 59 Temple Place - Suite 330,
24 Boston, MA 02111-1307, USA. 24 Boston, MA 02111-1307, USA.
25 25
26*/ 26*/
27 27
28#include "tabssettings.h" 28#include "tabssettings.h"
29 29
30#include <qpe/resource.h> 30#include <qpe/resource.h>
31#include <qpe/applnk.h> 31#include <qpe/applnk.h>
32#include <qpe/mimetype.h> 32#include <qpe/mimetype.h>
33#include <qpe/qcopenvelope_qws.h> 33#include <qpe/qcopenvelope_qws.h>
34#include <qpe/config.h> 34#include <qpe/config.h>
35#include <qpe/qpeapplication.h>
35 36
36#include <qlistbox.h> 37#include <qlistbox.h>
37#include <qpushbutton.h> 38#include <qpushbutton.h>
38#include <qlayout.h> 39#include <qlayout.h>
39#include <qlabel.h> 40#include <qlabel.h>
40#include <qwhatsthis.h> 41#include <qwhatsthis.h>
41#include <qcheckbox.h> 42#include <qcheckbox.h>
42 43
43#include "tabdialog.h" 44#include "tabdialog.h"
44 45
45#include <stdlib.h> 46#include <stdlib.h>
46#include <qmessagebox.h> 47#include <qmessagebox.h>
47 48
48 49
49 #define GLOBALID ".global." 50 #define GLOBALID ".global."
50 51
51 52
52TabsSettings::TabsSettings ( QWidget *parent, const char *name ) 53TabsSettings::TabsSettings ( QWidget *parent, const char *name )
53 : QWidget ( parent, name ) 54 : QWidget ( parent, name )
54{ 55{
55 QGridLayout *lay = new QGridLayout ( this, 0, 0, 4, 4 ); 56 QGridLayout *lay = new QGridLayout ( this, 0, 0, 4, 4 );
56 57
57 QLabel *l = new QLabel ( tr( "Launcher Tabs:" ), this ); 58 QLabel *l = new QLabel ( tr( "Launcher Tabs:" ), this );
58 lay-> addMultiCellWidget ( l, 0, 0, 0, 1 ); 59 lay-> addMultiCellWidget ( l, 0, 0, 0, 1 );
59 60
60 m_list = new QListBox ( this ); 61 m_list = new QListBox ( this );
61 lay-> addMultiCellWidget ( m_list, 1, 4, 0, 0 ); 62 lay-> addMultiCellWidget ( m_list, 1, 4, 0, 0 );
62 63
63 QWhatsThis::add ( m_list, tr( "foobar" )); 64 QWhatsThis::add ( m_list, tr( "foobar" ));
64 65
65 QPushButton *p1, *p2, *p3; 66 QPushButton *p1, *p2, *p3;
66 p1 = new QPushButton ( tr( "New" ), this ); 67 p1 = new QPushButton ( tr( "New" ), this );
67 lay-> addWidget ( p1, 1, 1 ); 68 lay-> addWidget ( p1, 1, 1 );
68 connect ( p1, SIGNAL( clicked ( )), this, SLOT( newClicked ( ))); 69 connect ( p1, SIGNAL( clicked ( )), this, SLOT( newClicked ( )));
69 70
70 p2 = new QPushButton ( tr( "Edit" ), this ); 71 p2 = new QPushButton ( tr( "Edit" ), this );
71 lay-> addWidget ( p2, 2, 1 ); 72 lay-> addWidget ( p2, 2, 1 );
72 connect ( p2, SIGNAL( clicked ( )), this, SLOT( editClicked ( ))); 73 connect ( p2, SIGNAL( clicked ( )), this, SLOT( editClicked ( )));
73 74
74 p3 = new QPushButton ( tr( "Delete" ), this ); 75 p3 = new QPushButton ( tr( "Delete" ), this );
75 lay-> addWidget ( p3, 3, 1 ); 76 lay-> addWidget ( p3, 3, 1 );
76 connect ( p3, SIGNAL( clicked ( )), this, SLOT( deleteClicked ( ))); 77 connect ( p3, SIGNAL( clicked ( )), this, SLOT( deleteClicked ( )));
77 78
78 lay-> setRowStretch ( 4, 10 ); 79 lay-> setRowStretch ( 4, 10 );
79 80
80 m_bigbusy = new QCheckBox( tr( "Enable big busy indicator" ), this ); 81 m_bigbusy = new QCheckBox( tr( "Enable big busy indicator" ), this );
81 lay-> addMultiCellWidget ( m_bigbusy, 5, 5, 0, 1 ); 82 lay-> addMultiCellWidget ( m_bigbusy, 5, 5, 0, 1 );
82 83
@@ -255,63 +256,62 @@ void TabsSettings::accept ( )
255 256
256 QCopEnvelope fe ( "QPE/Launcher", "setFont(QString,QString,int,int,int)" ); 257 QCopEnvelope fe ( "QPE/Launcher", "setFont(QString,QString,int,int,int)" );
257 fe << *it; 258 fe << *it;
258 fe << ( tc. m_font_use ? tc. m_font_family : QString::null ); 259 fe << ( tc. m_font_use ? tc. m_font_family : QString::null );
259 fe << tc. m_font_size; 260 fe << tc. m_font_size;
260 fe << tc. m_font_weight; 261 fe << tc. m_font_weight;
261 fe << ( tc. m_font_italic ? 1 : 0 ); 262 fe << ( tc. m_font_italic ? 1 : 0 );
262 263
263 tc. m_changed = false; 264 tc. m_changed = false;
264 } 265 }
265 cfg. setGroup ( "GUI" ); 266 cfg. setGroup ( "GUI" );
266 QString busytype = QString ( m_busyani-> isChecked ( ) ? "Animated" : "" ); 267 QString busytype = QString ( m_busyani-> isChecked ( ) ? "Animated" : "" );
267 cfg. writeEntry ( "BusyType", busytype ); 268 cfg. writeEntry ( "BusyType", busytype );
268 269
269 cfg. writeEntry ( "BigBusy", m_bigbusy->isChecked( ) ); 270 cfg. writeEntry ( "BigBusy", m_bigbusy->isChecked( ) );
270 271
271 { 272 {
272 QCopEnvelope e ( "QPE/Launcher", "setBusyIndicatorType(QString)" ); 273 QCopEnvelope e ( "QPE/Launcher", "setBusyIndicatorType(QString)" );
273 e << busytype; 274 e << busytype;
274 } 275 }
275} 276}
276 277
277void TabsSettings::newClicked ( ) 278void TabsSettings::newClicked ( )
278{ 279{
279 QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" )); 280 QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" ));
280} 281}
281 282
282void TabsSettings::deleteClicked ( ) 283void TabsSettings::deleteClicked ( )
283{ 284{
284 int ind = m_list-> currentItem ( ); 285 int ind = m_list-> currentItem ( );
285 286
286 if ( ind < 0 ) 287 if ( ind < 0 )
287 return; 288 return;
288 289
289 QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" )); 290 QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" ));
290} 291}
291 292
292void TabsSettings::editClicked ( ) 293void TabsSettings::editClicked ( )
293{ 294{
294 int ind = m_list-> currentItem ( ); 295 int ind = m_list-> currentItem ( );
295 296
296 if ( ind < 0 ) 297 if ( ind < 0 )
297 return; 298 return;
298 299
299 TabConfig tc = m_tabs [m_ids [ind]]; 300 TabConfig tc = m_tabs [m_ids [ind]];
300 301
301 TabDialog *d = new TabDialog ( m_list-> pixmap ( ind ), m_list-> text ( ind ), tc, this, "TabDialog", true ); 302 TabDialog *d = new TabDialog ( m_list-> pixmap ( ind ), m_list-> text ( ind ), tc, this, "TabDialog", true );
302 303
303 d-> showMaximized ( ); 304 if ( QPEApplication::execDialog( d ) == QDialog::Accepted ) {
304 if ( d-> exec ( ) == QDialog::Accepted ) {
305 tc. m_changed = true; 305 tc. m_changed = true;
306 m_tabs [m_ids [ind]] = tc; 306 m_tabs [m_ids [ind]] = tc;
307 307
308 if ( m_ids [ind] == GLOBALID ) { 308 if ( m_ids [ind] == GLOBALID ) {
309 for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { 309 for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) {
310 if ( *it != GLOBALID ) 310 if ( *it != GLOBALID )
311 m_tabs [*it] = tc; 311 m_tabs [*it] = tc;
312 } 312 }
313 } 313 }
314 } 314 }
315 315
316 delete d; 316 delete d;
317} 317}
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp
index b21215b..60f7417 100644
--- a/core/settings/light-and-power/light.cpp
+++ b/core/settings/light-and-power/light.cpp
@@ -165,98 +165,97 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags )
165 // light sensor 165 // light sensor
166 auto_brightness_ac-> setChecked ( config. readBoolEntry ( "LightSensor", false )); 166 auto_brightness_ac-> setChecked ( config. readBoolEntry ( "LightSensor", false ));
167 m_sensordata_ac = config. readListEntry ( "LightSensorData", ';' ); 167 m_sensordata_ac = config. readListEntry ( "LightSensorData", ';' );
168 168
169 // warnings 169 // warnings
170 config. setGroup ( "Warnings" ); 170 config. setGroup ( "Warnings" );
171 warnintervalBox-> setValue ( config. readNumEntry ( "checkinterval", 10000 ) / 1000 ); 171 warnintervalBox-> setValue ( config. readNumEntry ( "checkinterval", 10000 ) / 1000 );
172 lowSpinBox-> setValue ( config. readNumEntry ( "powerverylow", 10 ) ); 172 lowSpinBox-> setValue ( config. readNumEntry ( "powerverylow", 10 ) );
173 criticalSpinBox-> setValue ( config. readNumEntry ( "powercritical", 5 ) ); 173 criticalSpinBox-> setValue ( config. readNumEntry ( "powercritical", 5 ) );
174 174
175 m_resettimer = new QTimer ( this ); 175 m_resettimer = new QTimer ( this );
176 connect ( m_resettimer, SIGNAL( timeout ( )), this, SLOT( resetBacklight ( ))); 176 connect ( m_resettimer, SIGNAL( timeout ( )), this, SLOT( resetBacklight ( )));
177 177
178 if ( PowerStatusManager::readStatus ( ). acStatus ( ) != PowerStatus::Online ) { 178 if ( PowerStatusManager::readStatus ( ). acStatus ( ) != PowerStatus::Online ) {
179 tabs-> setCurrentPage ( 0 ); 179 tabs-> setCurrentPage ( 0 );
180 } 180 }
181 else { 181 else {
182 tabs-> setCurrentPage ( 1 ); 182 tabs-> setCurrentPage ( 1 );
183 } 183 }
184 184
185 connect ( brightness, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int ))); 185 connect ( brightness, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int )));
186 connect ( brightness_ac, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int ))); 186 connect ( brightness_ac, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int )));
187 if (m_cres) { 187 if (m_cres) {
188 connect ( contrast, SIGNAL( valueChanged ( int )), this, SLOT( setContrast ( int ))); 188 connect ( contrast, SIGNAL( valueChanged ( int )), this, SLOT( setContrast ( int )));
189 connect ( contrast_ac, SIGNAL( valueChanged ( int )), this, SLOT( setContrast ( int ))); 189 connect ( contrast_ac, SIGNAL( valueChanged ( int )), this, SLOT( setContrast ( int )));
190 } 190 }
191 connect( frequency, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) ); 191 connect( frequency, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) );
192 connect( frequency_ac, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) ); 192 connect( frequency_ac, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) );
193 connect( closeHingeAction, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) ); 193 connect( closeHingeAction, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) );
194 connect( closeHingeAction_ac, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) ); 194 connect( closeHingeAction_ac, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) );
195} 195}
196 196
197LightSettings::~LightSettings ( ) 197LightSettings::~LightSettings ( )
198{ 198{
199} 199}
200 200
201void LightSettings::calibrateSensor ( ) 201void LightSettings::calibrateSensor ( )
202{ 202{
203 Sensor *s = new Sensor ( m_sensordata, this ); 203 Sensor *s = new Sensor ( m_sensordata, this );
204 connect ( s, SIGNAL( viewBacklight ( int )), this, SLOT( setBacklight ( int ))); 204 connect ( s, SIGNAL( viewBacklight ( int )), this, SLOT( setBacklight ( int )));
205 QPEApplication::execDialog( s ); 205 QPEApplication::execDialog( s );
206 delete s; 206 delete s;
207} 207}
208 208
209void LightSettings::calibrateSensorAC ( ) 209void LightSettings::calibrateSensorAC ( )
210{ 210{
211 Sensor *s = new Sensor ( m_sensordata_ac, this ); 211 Sensor *s = new Sensor ( m_sensordata_ac, this );
212 connect ( s, SIGNAL( viewBacklight ( int )), this, SLOT( setBacklight ( int ))); 212 connect ( s, SIGNAL( viewBacklight ( int )), this, SLOT( setBacklight ( int )));
213 s-> showMaximized ( ); 213 QPEApplication::execDialog ( s );
214 s-> exec ( );
215 delete s; 214 delete s;
216} 215}
217 216
218void LightSettings::setBacklight ( int bright ) 217void LightSettings::setBacklight ( int bright )
219{ 218{
220 QCopEnvelope e ( "QPE/System", "setBacklight(int)" ); 219 QCopEnvelope e ( "QPE/System", "setBacklight(int)" );
221 e << bright; 220 e << bright;
222 221
223 if ( bright != -1 ) { 222 if ( bright != -1 ) {
224 m_resettimer-> stop ( ); 223 m_resettimer-> stop ( );
225 m_resettimer-> start ( 4000, true ); 224 m_resettimer-> start ( 4000, true );
226 } 225 }
227} 226}
228 227
229void LightSettings::setContrast ( int contr ) 228void LightSettings::setContrast ( int contr )
230{ 229{
231 if (contr == -1) contr = m_oldcontrast; 230 if (contr == -1) contr = m_oldcontrast;
232 ODevice::inst ( )-> setDisplayContrast(contr); 231 ODevice::inst ( )-> setDisplayContrast(contr);
233} 232}
234 233
235void LightSettings::setFrequency ( int index ) 234void LightSettings::setFrequency ( int index )
236{ 235{
237 qWarning("LightSettings::setFrequency(%d)", index); 236 qWarning("LightSettings::setFrequency(%d)", index);
238 ODevice::inst ( )-> setCurrentCpuFrequency(index); 237 ODevice::inst ( )-> setCurrentCpuFrequency(index);
239} 238}
240 239
241void LightSettings::resetBacklight ( ) 240void LightSettings::resetBacklight ( )
242{ 241{
243 setBacklight ( -1 ); 242 setBacklight ( -1 );
244 setContrast ( -1 ); 243 setContrast ( -1 );
245} 244}
246 245
247void LightSettings::setCloseHingeAction ( int index ) 246void LightSettings::setCloseHingeAction ( int index )
248{ 247{
249 qWarning("LightSettings::setCloseHingeStatus(%d)", index); 248 qWarning("LightSettings::setCloseHingeStatus(%d)", index);
250} 249}
251 250
252void LightSettings::accept ( ) 251void LightSettings::accept ( )
253{ 252{
254 Config config ( "apm" ); 253 Config config ( "apm" );
255 254
256 // bat 255 // bat
257 config. setGroup ( "Battery" ); 256 config. setGroup ( "Battery" );
258 config. writeEntry ( "LcdOffOnly", LcdOffOnly-> isChecked ( )); 257 config. writeEntry ( "LcdOffOnly", LcdOffOnly-> isChecked ( ));
259 config. writeEntry ( "Dim", interval_dim-> value ( )); 258 config. writeEntry ( "Dim", interval_dim-> value ( ));
260 config. writeEntry ( "LightOff", interval_lightoff-> value ( )); 259 config. writeEntry ( "LightOff", interval_lightoff-> value ( ));
261 config. writeEntry ( "Suspend", interval_suspend-> value ( )); 260 config. writeEntry ( "Suspend", interval_suspend-> value ( ));
262 config. writeEntry ( "Brightness", brightness-> value () ); 261 config. writeEntry ( "Brightness", brightness-> value () );
diff --git a/core/settings/security/security.cpp b/core/settings/security/security.cpp
index 7bb14cd..34f7e50 100644
--- a/core/settings/security/security.cpp
+++ b/core/settings/security/security.cpp
@@ -57,97 +57,97 @@
57 } 57 }
58 } 58 }
59 59
60 /* 60 /*
61 cfg.setGroup("Remote"); 61 cfg.setGroup("Remote");
62 if ( telnetAvailable() ) 62 if ( telnetAvailable() )
63 telnet->setChecked(cfg.readEntry("allow_telnet")); 63 telnet->setChecked(cfg.readEntry("allow_telnet"));
64 else 64 else
65 telnet->hide(); 65 telnet->hide();
66 66
67 if ( sshAvailable() ) 67 if ( sshAvailable() )
68 ssh->setChecked(cfg.readEntry("allow_ssh")); 68 ssh->setChecked(cfg.readEntry("allow_ssh"));
69 else 69 else
70 ssh->hide(); 70 ssh->hide();
71 */ 71 */
72 72
73 QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf"; 73 QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf";
74 Config loginCfg(configFile,Config::File); 74 Config loginCfg(configFile,Config::File);
75 75
76 loginCfg.setGroup("General"); 76 loginCfg.setGroup("General");
77 autoLoginName=loginCfg.readEntry("AutoLogin",""); 77 autoLoginName=loginCfg.readEntry("AutoLogin","");
78 78
79 if (autoLoginName.stripWhiteSpace().isEmpty()) { 79 if (autoLoginName.stripWhiteSpace().isEmpty()) {
80 autoLogin=false; 80 autoLogin=false;
81 } else { 81 } else {
82 autoLogin=true; 82 autoLogin=true;
83 } 83 }
84 84
85 cfg.setGroup("SyncMode"); 85 cfg.setGroup("SyncMode");
86 int mode = cfg.readNumEntry("Mode",2); // Default to Sharp 86 int mode = cfg.readNumEntry("Mode",2); // Default to Sharp
87 syncModeCombo->setCurrentItem( mode - 1 ); 87 syncModeCombo->setCurrentItem( mode - 1 );
88 88
89 //since nobody knows what this is and it doesn't do anything, i'll hide it # CoreDump 89 //since nobody knows what this is and it doesn't do anything, i'll hide it # CoreDump
90 // is this work-in-progress or can it be removed? 90 // is this work-in-progress or can it be removed?
91 syncModeCombo->hide(); 91 syncModeCombo->hide();
92 92
93 connect(autologinToggle, SIGNAL(toggled(bool)), this, SLOT(toggleAutoLogin(bool))); 93 connect(autologinToggle, SIGNAL(toggled(bool)), this, SLOT(toggleAutoLogin(bool)));
94 connect(userlist, SIGNAL(activated(int)), this, SLOT(changeLoginName(int))); 94 connect(userlist, SIGNAL(activated(int)), this, SLOT(changeLoginName(int)));
95 connect(changepasscode,SIGNAL(clicked()), this, SLOT(changePassCode())); 95 connect(changepasscode,SIGNAL(clicked()), this, SLOT(changePassCode()));
96 connect(clearpasscode,SIGNAL(clicked()), this, SLOT(clearPassCode())); 96 connect(clearpasscode,SIGNAL(clicked()), this, SLOT(clearPassCode()));
97 connect(syncapp,SIGNAL(activated(int)), this, SLOT(changeSyncApp())); 97 connect(syncapp,SIGNAL(activated(int)), this, SLOT(changeSyncApp()));
98 connect(restoredefaults,SIGNAL(clicked()), this, SLOT(restoreDefaults())); 98 connect(restoredefaults,SIGNAL(clicked()), this, SLOT(restoreDefaults()));
99 connect(deleteentry,SIGNAL(clicked()), this, SLOT(deleteListEntry())); 99 connect(deleteentry,SIGNAL(clicked()), this, SLOT(deleteListEntry()));
100 100
101 loadUsers(); 101 loadUsers();
102 updateGUI(); 102 updateGUI();
103 103
104 dl = new QPEDialogListener(this); 104 dl = new QPEDialogListener(this);
105 showMaximized(); 105 QPEApplication::showDialog( this );
106} 106}
107 107
108Security::~Security() 108Security::~Security()
109{ 109{
110} 110}
111 111
112void Security::deleteListEntry() 112void Security::deleteListEntry()
113{ 113{
114 syncnet->removeItem(syncnet->currentItem()); 114 syncnet->removeItem(syncnet->currentItem());
115} 115}
116 116
117void Security::restoreDefaults() 117void Security::restoreDefaults()
118 { 118 {
119 QMessageBox unrecbox( 119 QMessageBox unrecbox(
120 tr("Attention"), 120 tr("Attention"),
121 tr("<p>All user-defined net ranges will be lost."), 121 tr("<p>All user-defined net ranges will be lost."),
122 QMessageBox::Warning, 122 QMessageBox::Warning,
123 QMessageBox::Cancel, QMessageBox::Yes, QMessageBox::NoButton, 123 QMessageBox::Cancel, QMessageBox::Yes, QMessageBox::NoButton,
124 0, QString::null, TRUE, WStyle_StaysOnTop); 124 0, QString::null, TRUE, WStyle_StaysOnTop);
125 unrecbox.setButtonText(QMessageBox::Cancel, tr("Cancel")); 125 unrecbox.setButtonText(QMessageBox::Cancel, tr("Cancel"));
126 unrecbox.setButtonText(QMessageBox::Yes, tr("Ok")); 126 unrecbox.setButtonText(QMessageBox::Yes, tr("Ok"));
127 127
128 if ( unrecbox.exec() == QMessageBox::Yes) 128 if ( unrecbox.exec() == QMessageBox::Yes)
129 { 129 {
130 syncnet->clear(); 130 syncnet->clear();
131 insertDefaultRanges(); 131 insertDefaultRanges();
132 } 132 }
133} 133}
134 134
135void Security::insertDefaultRanges() 135void Security::insertDefaultRanges()
136{ 136{
137 syncnet->insertItem( tr( "192.168.129.0/24" ) ); 137 syncnet->insertItem( tr( "192.168.129.0/24" ) );
138 syncnet->insertItem( tr( "192.168.1.0/24" ) ); 138 syncnet->insertItem( tr( "192.168.1.0/24" ) );
139 syncnet->insertItem( tr( "192.168.0.0/16" ) ); 139 syncnet->insertItem( tr( "192.168.0.0/16" ) );
140 syncnet->insertItem( tr( "172.16.0.0/12" ) ); 140 syncnet->insertItem( tr( "172.16.0.0/12" ) );
141 syncnet->insertItem( tr( "10.0.0.0/8" ) ); 141 syncnet->insertItem( tr( "10.0.0.0/8" ) );
142 syncnet->insertItem( tr( "1.0.0.0/8" ) ); 142 syncnet->insertItem( tr( "1.0.0.0/8" ) );
143 syncnet->insertItem( tr( "Any" ) ); 143 syncnet->insertItem( tr( "Any" ) );
144 syncnet->insertItem( tr( "None" ) ); 144 syncnet->insertItem( tr( "None" ) );
145} 145}
146 146
147void Security::updateGUI() 147void Security::updateGUI()
148{ 148{
149 bool empty = passcode.isEmpty(); 149 bool empty = passcode.isEmpty();
150 150
151 changepasscode->setText( empty ? tr("Set passcode" ) 151 changepasscode->setText( empty ? tr("Set passcode" )
152 : tr("Change passcode" ) ); 152 : tr("Change passcode" ) );
153 passcode_poweron->setEnabled( !empty ); 153 passcode_poweron->setEnabled( !empty );