author | ar <ar> | 2004-02-08 16:09:19 (UTC) |
---|---|---|
committer | ar <ar> | 2004-02-08 16:09:19 (UTC) |
commit | 6506eeeeaa8d52ae0895630de00e38bc2b8ff10c (patch) (unidiff) | |
tree | a306b368cc4192e6a8528c7d602e4726c73a247c | |
parent | 811821ed75b87468f521bef2077cf5988aac9b47 (diff) | |
download | opie-6506eeeeaa8d52ae0895630de00e38bc2b8ff10c.zip opie-6506eeeeaa8d52ae0895630de00e38bc2b8ff10c.tar.gz opie-6506eeeeaa8d52ae0895630de00e38bc2b8ff10c.tar.bz2 |
improve support for BigScreen
-rw-r--r-- | core/applets/batteryapplet/battery.cpp | 2 | ||||
-rw-r--r-- | core/launcher/launcher.cpp | 3 | ||||
-rw-r--r-- | core/launcher/serverapp.cpp | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/audiowidget.cpp | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/videowidget.cpp | 2 | ||||
-rw-r--r-- | core/obex/obexhandler.cpp | 3 | ||||
-rw-r--r-- | core/pim/today/today.cpp | 2 | ||||
-rw-r--r-- | core/pim/today/todayconfig.cpp | 3 | ||||
-rw-r--r-- | core/settings/button/buttonsettings.cpp | 3 | ||||
-rw-r--r-- | core/settings/launcher/tabssettings.cpp | 4 | ||||
-rw-r--r-- | core/settings/light-and-power/light.cpp | 3 | ||||
-rw-r--r-- | core/settings/security/security.cpp | 2 |
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 | |||
@@ -15,129 +15,129 @@ | |||
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include "battery.h" | 20 | #include "battery.h" |
21 | #include "batterystatus.h" | 21 | #include "batterystatus.h" |
22 | 22 | ||
23 | #include <qpe/applnk.h> | 23 | #include <qpe/applnk.h> |
24 | #include <qpe/config.h> | 24 | #include <qpe/config.h> |
25 | #include <qpe/power.h> | 25 | #include <qpe/power.h> |
26 | #include <qpe/qpeapplication.h> | 26 | #include <qpe/qpeapplication.h> |
27 | 27 | ||
28 | #include <qpainter.h> | 28 | #include <qpainter.h> |
29 | #include <qtimer.h> | 29 | #include <qtimer.h> |
30 | 30 | ||
31 | 31 | ||
32 | BatteryMeter::BatteryMeter( QWidget *parent ) | 32 | BatteryMeter::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 | ||
50 | BatteryMeter::~BatteryMeter() | 50 | BatteryMeter::~BatteryMeter() |
51 | { | 51 | { |
52 | delete ps; | 52 | delete ps; |
53 | } | 53 | } |
54 | 54 | ||
55 | QSize BatteryMeter::sizeHint() const | 55 | QSize 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 | ||
60 | void BatteryMeter::mousePressEvent( QMouseEvent* e ) | 60 | void 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 | ||
73 | void BatteryMeter::mouseReleaseEvent( QMouseEvent* e) | 73 | void 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 | ||
85 | void BatteryMeter::timerEvent( QTimerEvent * ) | 85 | void 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 | ||
109 | void BatteryMeter::chargeTimeout() | 109 | void 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 | ||
120 | void BatteryMeter::paintEvent( QPaintEvent* ) | 120 | void 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 ); |
128 | p.setFont( f ); | 128 | p.setFont( f ); |
129 | p.drawText( 0, height()/2, QString::number( percent ) ); | 129 | p.drawText( 0, height()/2, QString::number( percent ) ); |
130 | p.drawText( width()/4, height(), "%" ); | 130 | p.drawText( width()/4, height(), "%" ); |
131 | return; | 131 | return; |
132 | } | 132 | } |
133 | 133 | ||
134 | QPainter p(this); | 134 | QPainter p(this); |
135 | QColor color; | 135 | QColor color; |
136 | QColor g = gray.light( 160 ); | 136 | QColor g = gray.light( 160 ); |
137 | switch ( ps->acStatus() ) | 137 | switch ( ps->acStatus() ) |
138 | { | 138 | { |
139 | case PowerStatus::Offline: color = blue.light( 150 ); break; | 139 | case PowerStatus::Offline: color = blue.light( 150 ); break; |
140 | case PowerStatus::Online: color = green.dark( 130 ).light( 180 ); break; | 140 | case PowerStatus::Online: color = green.dark( 130 ).light( 180 ); break; |
141 | default: color = red.light( 160 ); | 141 | default: color = red.light( 160 ); |
142 | } | 142 | } |
143 | 143 | ||
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 | |||
@@ -552,130 +552,129 @@ void Launcher::toggleSymbolInput() | |||
552 | void Launcher::toggleNumLockState() | 552 | void Launcher::toggleNumLockState() |
553 | { | 553 | { |
554 | tb->toggleNumLockState(); | 554 | tb->toggleNumLockState(); |
555 | } | 555 | } |
556 | 556 | ||
557 | void Launcher::toggleCapsLockState() | 557 | void Launcher::toggleCapsLockState() |
558 | { | 558 | { |
559 | tb->toggleCapsLockState(); | 559 | tb->toggleCapsLockState(); |
560 | } | 560 | } |
561 | 561 | ||
562 | static bool isVisibleWindow(int wid) | 562 | static bool isVisibleWindow(int wid) |
563 | { | 563 | { |
564 | #ifdef Q_WS_QWS | 564 | #ifdef Q_WS_QWS |
565 | const QList<QWSWindow> &list = qwsServer->clientWindows(); | 565 | const QList<QWSWindow> &list = qwsServer->clientWindows(); |
566 | QWSWindow* w; | 566 | QWSWindow* w; |
567 | for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) { | 567 | for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) { |
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 | ||
575 | void Launcher::viewSelected(const QString& s) | 575 | void Launcher::viewSelected(const QString& s) |
576 | { | 576 | { |
577 | setCaption( s + tr(" - Launcher") ); | 577 | setCaption( s + tr(" - Launcher") ); |
578 | } | 578 | } |
579 | 579 | ||
580 | void Launcher::showTab(const QString& id) | 580 | void 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 | ||
586 | void Launcher::select( const AppLnk *appLnk ) | 586 | void 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 | ||
608 | void Launcher::properties( AppLnk *appLnk ) | 608 | void 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 | ||
621 | void Launcher::storageChanged( const QList<FileSystem> &fs ) | 620 | void 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 | ||
626 | void Launcher::systemMessage( const QCString &msg, const QByteArray &data) | 625 | void 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 |
642 | void Launcher::typeAdded( const QString& type, const QString& name, | 641 | void 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 | ||
659 | void Launcher::typeRemoved( const QString& type ) | 658 | void 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 | } |
666 | 665 | ||
667 | void Launcher::applicationAdded( const QString& type, const AppLnk& app ) | 666 | void Launcher::applicationAdded( const QString& type, const AppLnk& app ) |
668 | { | 667 | { |
669 | if ( app.type() == "Separator" ) // No tr | 668 | if ( app.type() == "Separator" ) // No tr |
670 | return; | 669 | return; |
671 | 670 | ||
672 | LauncherView *view = tabs->view( type ); | 671 | LauncherView *view = tabs->view( type ); |
673 | if ( view ) | 672 | if ( view ) |
674 | view->addItem( new AppLnk( app ), FALSE ); | 673 | view->addItem( new AppLnk( app ), FALSE ); |
675 | else | 674 | else |
676 | qWarning("addAppLnk: No view for type %s. Can't add app %s!", | 675 | qWarning("addAppLnk: No view for type %s. Can't add app %s!", |
677 | type.latin1(),app.name().latin1() ); | 676 | type.latin1(),app.name().latin1() ); |
678 | 677 | ||
679 | MimeType::registerApp( app ); | 678 | MimeType::registerApp( app ); |
680 | } | 679 | } |
681 | 680 | ||
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 | |||
@@ -641,129 +641,129 @@ bool ServerApplication::qwsEventFilter( QWSEvent *e ) | |||
641 | 641 | ||
642 | if ( e->type == QWSEvent::Mouse ) { | 642 | if ( e->type == QWSEvent::Mouse ) { |
643 | QWSMouseEvent *me = (QWSMouseEvent *)e; | 643 | QWSMouseEvent *me = (QWSMouseEvent *)e; |
644 | static bool up = TRUE; | 644 | static bool up = TRUE; |
645 | if ( me->simpleData.state&LeftButton ) { | 645 | if ( me->simpleData.state&LeftButton ) { |
646 | if ( up ) { | 646 | if ( up ) { |
647 | up = FALSE; | 647 | up = FALSE; |
648 | screenClick(TRUE); | 648 | screenClick(TRUE); |
649 | } | 649 | } |
650 | } else if ( !up ) { | 650 | } else if ( !up ) { |
651 | up = TRUE; | 651 | up = TRUE; |
652 | screenClick(FALSE); | 652 | screenClick(FALSE); |
653 | } | 653 | } |
654 | }else if ( e->type == QWSEvent::Key ) { | 654 | }else if ( e->type == QWSEvent::Key ) { |
655 | QWSKeyEvent * ke = static_cast<QWSKeyEvent*>( e ); | 655 | QWSKeyEvent * ke = static_cast<QWSKeyEvent*>( e ); |
656 | if ( kf->checkButtonAction( false, | 656 | if ( kf->checkButtonAction( false, |
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 | ||
670 | void ServerApplication::showSafeMode() | 670 | void 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 | ||
683 | void ServerApplication::clearSafeMode() | 683 | void 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 | ||
698 | void ServerApplication::shutdown() | 698 | void 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 | ||
708 | void ServerApplication::shutdown( ShutdownImpl::Type t ) | 708 | void 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 | ||
741 | void ServerApplication::restart() | 741 | void 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 |
754 | /* same as above */ | 754 | /* same as above */ |
755 | emit aboutToQuit(); | 755 | emit aboutToQuit(); |
756 | prepareForTermination(TRUE); | 756 | prepareForTermination(TRUE); |
757 | doRestart = TRUE; | 757 | doRestart = TRUE; |
758 | quit(); | 758 | quit(); |
759 | #else | 759 | #else |
760 | prepareForTermination( true ); | 760 | prepareForTermination( true ); |
761 | for ( int fd = 3; fd < 100; fd++ ) | 761 | for ( int fd = 3; fd < 100; fd++ ) |
762 | close( fd ); | 762 | close( fd ); |
763 | execl( ( qpeDir() + "/bin/qpe" ).latin1(), "qpe", 0 ); | 763 | execl( ( qpeDir() + "/bin/qpe" ).latin1(), "qpe", 0 ); |
764 | exit( 1 ); | 764 | exit( 1 ); |
765 | #endif | 765 | #endif |
766 | } | 766 | } |
767 | } | 767 | } |
768 | 768 | ||
769 | void ServerApplication::rereadVolumes() | 769 | void ServerApplication::rereadVolumes() |
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 | |||
@@ -225,129 +225,129 @@ void AudioWidget::resizeEvent( QResizeEvent * ) { | |||
225 | QPoint p( xoff, yoff ); | 225 | QPoint p( xoff, yoff ); |
226 | 226 | ||
227 | QPixmap *pixUp = combineImageWithBackground( *imgUp, *pixBg, p ); | 227 | QPixmap *pixUp = combineImageWithBackground( *imgUp, *pixBg, p ); |
228 | QPixmap *pixDn = combineImageWithBackground( *imgDn, *pixBg, p ); | 228 | QPixmap *pixDn = combineImageWithBackground( *imgDn, *pixBg, p ); |
229 | 229 | ||
230 | for ( int i = 0; i < 10; i++ ) { | 230 | for ( int i = 0; i < 10; i++ ) { |
231 | if ( !masks[i]->isNull() ) { | 231 | if ( !masks[i]->isNull() ) { |
232 | delete buttonPixUp[i]; | 232 | delete buttonPixUp[i]; |
233 | delete buttonPixDown[i]; | 233 | delete buttonPixDown[i]; |
234 | buttonPixUp[i] = maskPixToMask( *pixUp, *masks[i] ); | 234 | buttonPixUp[i] = maskPixToMask( *pixUp, *masks[i] ); |
235 | buttonPixDown[i] = maskPixToMask( *pixDn, *masks[i] ); | 235 | buttonPixDown[i] = maskPixToMask( *pixDn, *masks[i] ); |
236 | } | 236 | } |
237 | } | 237 | } |
238 | 238 | ||
239 | delete pixUp; | 239 | delete pixUp; |
240 | delete pixDn; | 240 | delete pixDn; |
241 | } | 241 | } |
242 | 242 | ||
243 | 243 | ||
244 | static bool audioSliderBeingMoved = FALSE; | 244 | static bool audioSliderBeingMoved = FALSE; |
245 | 245 | ||
246 | void AudioWidget::sliderPressed() { | 246 | void AudioWidget::sliderPressed() { |
247 | audioSliderBeingMoved = TRUE; | 247 | audioSliderBeingMoved = TRUE; |
248 | } | 248 | } |
249 | 249 | ||
250 | 250 | ||
251 | void AudioWidget::sliderReleased() { | 251 | void 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 | ||
260 | void AudioWidget::setPosition( long i ) { | 260 | void 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 | ||
267 | void AudioWidget::setLength( long max ) { | 267 | void AudioWidget::setLength( long max ) { |
268 | updateSlider( mediaPlayerState->position(), max ); | 268 | updateSlider( mediaPlayerState->position(), max ); |
269 | } | 269 | } |
270 | 270 | ||
271 | 271 | ||
272 | void AudioWidget::setView( char view ) { | 272 | void 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 | ||
298 | static QString timeAsString( long length ) { | 298 | static 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 | ||
305 | void AudioWidget::updateSlider( long i, long max ) { | 305 | void AudioWidget::updateSlider( long i, long max ) { |
306 | this->setFocus(); | 306 | this->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 | ||
324 | void AudioWidget::setToggleButton( int i, bool down ) { | 324 | void 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 | ||
330 | void AudioWidget::toggleButton( int i ) { | 330 | void 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 | ||
337 | void AudioWidget::paintButton( QPainter *p, int i ) { | 337 | void AudioWidget::paintButton( QPainter *p, int i ) { |
338 | if ( audioButtons[i].isDown ) | 338 | if ( audioButtons[i].isDown ) |
339 | p->drawPixmap( xoff, yoff, *buttonPixDown[i] ); | 339 | p->drawPixmap( xoff, yoff, *buttonPixDown[i] ); |
340 | else | 340 | else |
341 | p->drawPixmap( xoff, yoff, *buttonPixUp[i] ); | 341 | p->drawPixmap( xoff, yoff, *buttonPixUp[i] ); |
342 | } | 342 | } |
343 | 343 | ||
344 | 344 | ||
345 | void AudioWidget::timerEvent( QTimerEvent * ) { | 345 | void AudioWidget::timerEvent( QTimerEvent * ) { |
346 | /* | 346 | /* |
347 | int x = audioButtons[AudioPlay].xPos; | 347 | int x = audioButtons[AudioPlay].xPos; |
348 | int y = audioButtons[AudioPlay].yPos; | 348 | int y = audioButtons[AudioPlay].yPos; |
349 | QPainter p( this ); | 349 | QPainter p( this ); |
350 | // Optimize to only draw the little bit of the changing images which is different | 350 | // Optimize to only draw the little bit of the changing images which is different |
351 | p.drawPixmap( x + 14, y + 8, *pixmaps[3], 32 * frame, 0, 32, 32 ); | 351 | p.drawPixmap( x + 14, y + 8, *pixmaps[3], 32 * frame, 0, 32, 32 ); |
352 | p.drawPixmap( x + 37, y + 37, *pixmaps[2], 18 * AudioPlay, 0, 6, 3 ); | 352 | p.drawPixmap( x + 37, y + 37, *pixmaps[2], 18 * AudioPlay, 0, 6, 3 ); |
353 | */ | 353 | */ |
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 | |||
@@ -644,129 +644,129 @@ bool PlayListWidget::prev() { | |||
644 | 644 | ||
645 | 645 | ||
646 | bool PlayListWidget::next() { | 646 | bool PlayListWidget::next() { |
647 | if ( mediaPlayerState->playlist() ) { | 647 | if ( mediaPlayerState->playlist() ) { |
648 | if ( mediaPlayerState->shuffled() ) { | 648 | if ( mediaPlayerState->shuffled() ) { |
649 | return prev(); | 649 | return prev(); |
650 | } else { | 650 | } else { |
651 | if ( !d->selectedFiles->next() ) { | 651 | if ( !d->selectedFiles->next() ) { |
652 | if ( mediaPlayerState->looping() ) { | 652 | if ( mediaPlayerState->looping() ) { |
653 | return d->selectedFiles->first(); | 653 | return d->selectedFiles->first(); |
654 | } else { | 654 | } else { |
655 | return FALSE; | 655 | return FALSE; |
656 | } | 656 | } |
657 | } | 657 | } |
658 | return TRUE; | 658 | return TRUE; |
659 | } | 659 | } |
660 | } else { | 660 | } else { |
661 | return mediaPlayerState->looping(); | 661 | return mediaPlayerState->looping(); |
662 | } | 662 | } |
663 | } | 663 | } |
664 | 664 | ||
665 | 665 | ||
666 | bool PlayListWidget::first() { | 666 | bool 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 | ||
674 | bool PlayListWidget::last() { | 674 | bool 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 | ||
682 | void PlayListWidget::saveList() { | 682 | void PlayListWidget::saveList() { |
683 | writem3u(); | 683 | writem3u(); |
684 | } | 684 | } |
685 | 685 | ||
686 | void PlayListWidget::loadList( const DocLnk & lnk) { | 686 | void 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 | ||
699 | void PlayListWidget::setPlaylist( bool shown ) { | 699 | void 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 | ||
706 | void PlayListWidget::setView( char view ) { | 706 | void 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 | ||
713 | void PlayListWidget::addSelected() { | 713 | void 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 | ||
756 | void PlayListWidget::removeSelected() { | 756 | void PlayListWidget::removeSelected() { |
757 | d->selectedFiles->removeSelected( ); | 757 | d->selectedFiles->removeSelected( ); |
758 | } | 758 | } |
759 | 759 | ||
760 | void PlayListWidget::playIt( QListViewItem *) { | 760 | void PlayListWidget::playIt( QListViewItem *) { |
761 | // d->setDocumentUsed = FALSE; | 761 | // d->setDocumentUsed = FALSE; |
762 | // mediaPlayerState->curPosition =0; | 762 | // mediaPlayerState->curPosition =0; |
763 | // mediaPlayerState->setPlaying(FALSE); | 763 | // mediaPlayerState->setPlaying(FALSE); |
764 | mediaPlayerState->setPlaying(TRUE); | 764 | mediaPlayerState->setPlaying(TRUE); |
765 | d->selectedFiles->unSelect(); | 765 | d->selectedFiles->unSelect(); |
766 | } | 766 | } |
767 | 767 | ||
768 | void PlayListWidget::addToSelection( QListViewItem *it) { | 768 | void PlayListWidget::addToSelection( QListViewItem *it) { |
769 | d->setDocumentUsed = FALSE; | 769 | d->setDocumentUsed = FALSE; |
770 | 770 | ||
771 | if(it) { | 771 | if(it) { |
772 | switch ( tabWidget->currentPageIndex()) { | 772 | switch ( tabWidget->currentPageIndex()) { |
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 | |||
@@ -359,129 +359,129 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
359 | case VideoPlay: { | 359 | case VideoPlay: { |
360 | // qDebug("play"); | 360 | // qDebug("play"); |
361 | if( !mediaPlayerState->playing()) { | 361 | if( !mediaPlayerState->playing()) { |
362 | mediaPlayerState->setPlaying( true); | 362 | mediaPlayerState->setPlaying( true); |
363 | setToggleButton( i-1, false ); | 363 | setToggleButton( i-1, false ); |
364 | setToggleButton( i, false ); | 364 | setToggleButton( i, false ); |
365 | return; | 365 | return; |
366 | } | 366 | } |
367 | if( mediaPlayerState->isPaused ) { | 367 | if( mediaPlayerState->isPaused ) { |
368 | // qDebug("isPaused"); | 368 | // qDebug("isPaused"); |
369 | setToggleButton( i, FALSE ); | 369 | setToggleButton( i, FALSE ); |
370 | mediaPlayerState->setPaused( FALSE ); | 370 | mediaPlayerState->setPaused( FALSE ); |
371 | return; | 371 | return; |
372 | } else if( !mediaPlayerState->isPaused ) { | 372 | } else if( !mediaPlayerState->isPaused ) { |
373 | // qDebug("is not paused"); | 373 | // qDebug("is not paused"); |
374 | setToggleButton( i, TRUE ); | 374 | setToggleButton( i, TRUE ); |
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 | ||
395 | void VideoWidget::mousePressEvent( QMouseEvent *event ) { | 395 | void VideoWidget::mousePressEvent( QMouseEvent *event ) { |
396 | mouseMoveEvent( event ); | 396 | mouseMoveEvent( event ); |
397 | } | 397 | } |
398 | 398 | ||
399 | 399 | ||
400 | void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) { | 400 | void 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 | ||
411 | void VideoWidget::makeVisible() { | 411 | void 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 | ||
429 | void VideoWidget::paintEvent( QPaintEvent * pe) { | 429 | void 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 | ||
458 | void VideoWidget::closeEvent( QCloseEvent* ) { | 458 | void VideoWidget::closeEvent( QCloseEvent* ) { |
459 | mediaPlayerState->setList(); | 459 | mediaPlayerState->setList(); |
460 | } | 460 | } |
461 | 461 | ||
462 | 462 | ||
463 | bool VideoWidget::playVideo() { | 463 | bool 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(); |
472 | int h = width(); | 472 | int h = width(); |
473 | 473 | ||
474 | ColorFormat format = (dd == 16) ? RGB565 : BGRA8888; | 474 | ColorFormat format = (dd == 16) ? RGB565 : BGRA8888; |
475 | 475 | ||
476 | if ( mediaPlayerState->fullscreen() ) | 476 | if ( mediaPlayerState->fullscreen() ) |
477 | { | 477 | { |
478 | #ifdef USE_DIRECT_PAINTER | 478 | #ifdef USE_DIRECT_PAINTER |
479 | QDirectPainter p(this); | 479 | QDirectPainter p(this); |
480 | 480 | ||
481 | if ( ( qt_screen->transformOrientation() == 3 ) && | 481 | if ( ( qt_screen->transformOrientation() == 3 ) && |
482 | ( ( dd == 16 ) || ( dd == 32 ) ) && ( p.numRects() == 1 ) ) | 482 | ( ( dd == 16 ) || ( dd == 32 ) ) && ( p.numRects() == 1 ) ) |
483 | { | 483 | { |
484 | 484 | ||
485 | w = 320; | 485 | w = 320; |
486 | h = 240; | 486 | h = 240; |
487 | 487 | ||
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 | ||
9 | using namespace OpieObex; | 10 | using namespace OpieObex; |
10 | 11 | ||
11 | /* TRANSLATOR OpieObex::ObexHandler */ | 12 | /* TRANSLATOR OpieObex::ObexHandler */ |
12 | 13 | ||
13 | ObexHandler::ObexHandler() { | 14 | ObexHandler::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 | } |
21 | ObexHandler::~ObexHandler() { | 22 | ObexHandler::~ObexHandler() { |
22 | delete m_sender; | 23 | delete m_sender; |
23 | delete m_receiver; | 24 | delete m_receiver; |
24 | } | 25 | } |
25 | void ObexHandler::doSend(const QString& str, const QString& desc) { | 26 | void 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 | } |
34 | void ObexHandler::doReceive(bool b) { | 35 | void 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 | } |
44 | void ObexHandler::slotSent() { | 45 | void 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 | } |
53 | void ObexHandler::irdaMessage( const QCString& msg, const QByteArray& data) { | 54 | void 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 | |||
@@ -21,129 +21,129 @@ | |||
21 | #include "today.h" | 21 | #include "today.h" |
22 | 22 | ||
23 | #include <qpe/config.h> | 23 | #include <qpe/config.h> |
24 | #include <qpe/qcopenvelope_qws.h> | 24 | #include <qpe/qcopenvelope_qws.h> |
25 | #include <qpe/resource.h> | 25 | #include <qpe/resource.h> |
26 | #include <qpe/global.h> | 26 | #include <qpe/global.h> |
27 | #include <qpe/qpeapplication.h> | 27 | #include <qpe/qpeapplication.h> |
28 | #include <qpe/contact.h> | 28 | #include <qpe/contact.h> |
29 | 29 | ||
30 | #include <qdir.h> | 30 | #include <qdir.h> |
31 | #include <qtimer.h> | 31 | #include <qtimer.h> |
32 | #include <qwhatsthis.h> | 32 | #include <qwhatsthis.h> |
33 | 33 | ||
34 | struct TodayPlugin { | 34 | struct TodayPlugin { |
35 | TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {} | 35 | TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {} |
36 | QLibrary *library; | 36 | QLibrary *library; |
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 | ||
46 | static QValueList<TodayPlugin> pluginList; | 46 | static QValueList<TodayPlugin> pluginList; |
47 | 47 | ||
48 | static QMap<QString, TodayPlugin> tempList; | 48 | static QMap<QString, TodayPlugin> tempList; |
49 | 49 | ||
50 | Today::Today( QWidget* parent, const char* name, WFlags fl ) | 50 | Today::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 | */ |
91 | void Today::channelReceived( const QCString &msg, const QByteArray & data ) { | 91 | void 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 | ||
100 | void Today::setRefreshTimer( int interval ) { | 100 | void 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 | */ |
115 | void Today::setOwnerField() { | 115 | void 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 | */ |
129 | void Today::setOwnerField( QString &message ) { | 129 | void 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 | } |
134 | 134 | ||
135 | /** | 135 | /** |
136 | * Init stuff needed for today. Reads the config file. | 136 | * Init stuff needed for today. Reads the config file. |
137 | */ | 137 | */ |
138 | void Today::init() { | 138 | void Today::init() { |
139 | // read config | 139 | // read config |
140 | Config cfg( "today" ); | 140 | Config cfg( "today" ); |
141 | 141 | ||
142 | cfg.setGroup( "Plugins" ); | 142 | cfg.setGroup( "Plugins" ); |
143 | m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); | 143 | m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); |
144 | m_allApplets = cfg.readListEntry( "AllApplets", ',' ); | 144 | m_allApplets = cfg.readListEntry( "AllApplets", ',' ); |
145 | 145 | ||
146 | cfg.setGroup( "General" ); | 146 | cfg.setGroup( "General" ); |
147 | m_iconSize = cfg.readNumEntry( "IconSize", 18 ); | 147 | m_iconSize = cfg.readNumEntry( "IconSize", 18 ); |
148 | m_hideBanner = cfg.readNumEntry( "HideBanner", 0 ); | 148 | m_hideBanner = cfg.readNumEntry( "HideBanner", 0 ); |
149 | setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) ); | 149 | setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) ); |
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,154 +1,155 @@ | |||
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 | ||
32 | class ToolButton : public QToolButton { | 33 | class ToolButton : public QToolButton { |
33 | 34 | ||
34 | public: | 35 | public: |
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 | */ |
51 | TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal ) | 52 | TodayConfig::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 | */ |
98 | void TodayConfig::setAutoStart() { | 99 | void 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 | */ |
116 | void TodayConfig::readConfig() { | 117 | void 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 | */ |
138 | void TodayConfig::writeConfig() { | 139 | void TodayConfig::writeConfig() { |
139 | Config cfg( "today" ); | 140 | Config cfg( "today" ); |
140 | cfg.setGroup( "Plugins" ); | 141 | cfg.setGroup( "Plugins" ); |
141 | if ( m_applets_changed ) { | 142 | if ( m_applets_changed ) { |
142 | QStringList exclude; | 143 | QStringList exclude; |
143 | QStringList include; | 144 | QStringList include; |
144 | QStringList all_applets; | 145 | QStringList all_applets; |
145 | 146 | ||
146 | QListViewItemIterator list_it( m_appletListView ); | 147 | QListViewItemIterator list_it( m_appletListView ); |
147 | 148 | ||
148 | // this makes sure the names get saved in the order selected | 149 | // this makes sure the names get saved in the order selected |
149 | for ( ; list_it.current(); ++list_it ) { | 150 | for ( ; list_it.current(); ++list_it ) { |
150 | QMap <QString, QCheckListItem *>::Iterator it; | 151 | QMap <QString, QCheckListItem *>::Iterator it; |
151 | for ( it = m_applets.begin(); it != m_applets. end (); ++it ) { | 152 | for ( it = m_applets.begin(); it != m_applets. end (); ++it ) { |
152 | if ( list_it.current() == (*it) && !(*it)-> isOn () ) { | 153 | if ( list_it.current() == (*it) && !(*it)-> isOn () ) { |
153 | exclude << it.key(); | 154 | exclude << it.key(); |
154 | } else if ( list_it.current() == (*it) && (*it)-> isOn () ){ | 155 | } else if ( list_it.current() == (*it) && (*it)-> isOn () ){ |
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 | |||
@@ -153,103 +153,102 @@ void ButtonSettings::updateLabels ( ) | |||
153 | for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { | 153 | for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { |
154 | qCopInfo cip = ButtonUtils::inst ( )-> messageToInfo ((*it)-> m_pmsg ); | 154 | qCopInfo cip = ButtonUtils::inst ( )-> messageToInfo ((*it)-> m_pmsg ); |
155 | 155 | ||
156 | (*it)-> m_picon-> setPixmap ( cip. m_icon ); | 156 | (*it)-> m_picon-> setPixmap ( cip. m_icon ); |
157 | (*it)-> m_plabel-> setText ( cip. m_name ); | 157 | (*it)-> m_plabel-> setText ( cip. m_name ); |
158 | 158 | ||
159 | qCopInfo cih = ButtonUtils::inst ( )-> messageToInfo ((*it)-> m_hmsg ); | 159 | qCopInfo cih = ButtonUtils::inst ( )-> messageToInfo ((*it)-> m_hmsg ); |
160 | 160 | ||
161 | (*it)-> m_hicon-> setPixmap ( cih. m_icon ); | 161 | (*it)-> m_hicon-> setPixmap ( cih. m_icon ); |
162 | (*it)-> m_hlabel-> setText ( cih. m_name ); | 162 | (*it)-> m_hlabel-> setText ( cih. m_name ); |
163 | } | 163 | } |
164 | } | 164 | } |
165 | 165 | ||
166 | buttoninfo *ButtonSettings::buttonInfoForKeycode ( ushort key ) | 166 | buttoninfo *ButtonSettings::buttonInfoForKeycode ( ushort key ) |
167 | { | 167 | { |
168 | for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { | 168 | for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { |
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 | ||
175 | void ButtonSettings::keyPressEvent ( QKeyEvent *e ) | 175 | void 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 | ||
188 | void ButtonSettings::keyReleaseEvent ( QKeyEvent *e ) | 188 | void 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 | ||
200 | void ButtonSettings::keyTimeout ( ) | 200 | void 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 | ||
208 | void ButtonSettings::edit ( buttoninfo *bi, bool hold ) | 208 | void 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 | ||
238 | void ButtonSettings::accept ( ) | 237 | void 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 | ||
251 | void ButtonSettings::done ( int r ) | 250 | void 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,98 +1,99 @@ | |||
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 | ||
52 | TabsSettings::TabsSettings ( QWidget *parent, const char *name ) | 53 | TabsSettings::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 | ||
83 | m_busyani = new QCheckBox ( tr( "Enable animated busy indicator" ), this ); | 84 | m_busyani = new QCheckBox ( tr( "Enable animated busy indicator" ), this ); |
84 | lay-> addMultiCellWidget ( m_busyani, 6, 6, 0, 1 ); | 85 | lay-> addMultiCellWidget ( m_busyani, 6, 6, 0, 1 ); |
85 | 86 | ||
86 | p1-> setEnabled ( false ); | 87 | p1-> setEnabled ( false ); |
87 | p3-> setEnabled ( false ); | 88 | p3-> setEnabled ( false ); |
88 | 89 | ||
89 | init ( ); | 90 | init ( ); |
90 | 91 | ||
91 | QWhatsThis::add ( m_list, tr( "Select the Launcher Tab you want to edit or delete." )); | 92 | QWhatsThis::add ( m_list, tr( "Select the Launcher Tab you want to edit or delete." )); |
92 | QWhatsThis::add ( p1, tr( "Adds a new Tab to the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); | 93 | QWhatsThis::add ( p1, tr( "Adds a new Tab to the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); |
93 | QWhatsThis::add ( p2, tr( "Opens a new dialog to customize the select Tab." )); | 94 | QWhatsThis::add ( p2, tr( "Opens a new dialog to customize the select Tab." )); |
94 | QWhatsThis::add ( p3, tr( "Deletes a Tab from the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); | 95 | QWhatsThis::add ( p3, tr( "Deletes a Tab from the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); |
95 | QWhatsThis::add ( m_bigbusy, tr( "Activate this, if you want a big busy indicator in the middle of the screen instead of the one in taskbar." )); | 96 | QWhatsThis::add ( m_bigbusy, tr( "Activate this, if you want a big busy indicator in the middle of the screen instead of the one in taskbar." )); |
96 | QWhatsThis::add ( m_busyani, tr( "Activate this, if you want an animatedbusy indicator for starting applications in the Launcher." )); | 97 | QWhatsThis::add ( m_busyani, tr( "Activate this, if you want an animatedbusy indicator for starting applications in the Launcher." )); |
97 | } | 98 | } |
98 | 99 | ||
@@ -239,79 +240,78 @@ void TabsSettings::accept ( ) | |||
239 | case TabConfig::Ruled: | 240 | case TabConfig::Ruled: |
240 | cfg.writeEntry( "BackgroundType", "Ruled" ); | 241 | cfg.writeEntry( "BackgroundType", "Ruled" ); |
241 | be << *it << tc. m_bg_type << QString(""); | 242 | be << *it << tc. m_bg_type << QString(""); |
242 | break; | 243 | break; |
243 | case TabConfig::SolidColor: | 244 | case TabConfig::SolidColor: |
244 | cfg.writeEntry( "BackgroundType", "SolidColor" ); | 245 | cfg.writeEntry( "BackgroundType", "SolidColor" ); |
245 | be << *it << tc. m_bg_type << tc. m_bg_color; | 246 | be << *it << tc. m_bg_type << tc. m_bg_color; |
246 | break; | 247 | break; |
247 | case TabConfig::Image: | 248 | case TabConfig::Image: |
248 | cfg.writeEntry( "BackgroundType", "Image" ); | 249 | cfg.writeEntry( "BackgroundType", "Image" ); |
249 | be << *it << tc. m_bg_type << tc. m_bg_image; | 250 | be << *it << tc. m_bg_type << tc. m_bg_image; |
250 | break; | 251 | break; |
251 | } | 252 | } |
252 | 253 | ||
253 | QCopEnvelope te( "QPE/Launcher", "setTextColor(QString,QString)" ); | 254 | QCopEnvelope te( "QPE/Launcher", "setTextColor(QString,QString)" ); |
254 | te << *it << tc. m_text_color; | 255 | te << *it << tc. m_text_color; |
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 | ||
277 | void TabsSettings::newClicked ( ) | 278 | void 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 | ||
282 | void TabsSettings::deleteClicked ( ) | 283 | void 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 | ||
292 | void TabsSettings::editClicked ( ) | 293 | void 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 | |||
@@ -149,130 +149,129 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) | |||
149 | closeHingeAction_ac->setCurrentItem( config.readNumEntry("CloseHingeAction", 0) ); | 149 | closeHingeAction_ac->setCurrentItem( config.readNumEntry("CloseHingeAction", 0) ); |
150 | 150 | ||
151 | bright = config. readNumEntry ( "Brightness", 255 ); | 151 | bright = config. readNumEntry ( "Brightness", 255 ); |
152 | brightness_ac-> setTickInterval ( QMAX( 16, 256 / m_bres )); | 152 | brightness_ac-> setTickInterval ( QMAX( 16, 256 / m_bres )); |
153 | brightness_ac-> setLineStep ( QMAX( 1, 256 / m_bres )); | 153 | brightness_ac-> setLineStep ( QMAX( 1, 256 / m_bres )); |
154 | brightness_ac-> setPageStep ( QMAX( 1, 256 / m_bres )); | 154 | brightness_ac-> setPageStep ( QMAX( 1, 256 / m_bres )); |
155 | brightness_ac-> setValue ( bright ); | 155 | brightness_ac-> setValue ( bright ); |
156 | 156 | ||
157 | if (m_cres) { | 157 | if (m_cres) { |
158 | contr = config. readNumEntry ( "Contrast", 127); | 158 | contr = config. readNumEntry ( "Contrast", 127); |
159 | contrast_ac-> setTickInterval ( QMAX( 16, 256 / m_cres )); | 159 | contrast_ac-> setTickInterval ( QMAX( 16, 256 / m_cres )); |
160 | contrast_ac-> setLineStep ( QMAX( 1, 256 / m_cres )); | 160 | contrast_ac-> setLineStep ( QMAX( 1, 256 / m_cres )); |
161 | contrast_ac-> setPageStep ( QMAX( 1, 256 / m_cres )); | 161 | contrast_ac-> setPageStep ( QMAX( 1, 256 / m_cres )); |
162 | contrast_ac-> setValue ( contr ); | 162 | contrast_ac-> setValue ( contr ); |
163 | } | 163 | } |
164 | 164 | ||
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 | ||
197 | LightSettings::~LightSettings ( ) | 197 | LightSettings::~LightSettings ( ) |
198 | { | 198 | { |
199 | } | 199 | } |
200 | 200 | ||
201 | void LightSettings::calibrateSensor ( ) | 201 | void 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 | ||
209 | void LightSettings::calibrateSensorAC ( ) | 209 | void 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 | ||
218 | void LightSettings::setBacklight ( int bright ) | 217 | void 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 | ||
229 | void LightSettings::setContrast ( int contr ) | 228 | void 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 | ||
235 | void LightSettings::setFrequency ( int index ) | 234 | void 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 | ||
241 | void LightSettings::resetBacklight ( ) | 240 | void LightSettings::resetBacklight ( ) |
242 | { | 241 | { |
243 | setBacklight ( -1 ); | 242 | setBacklight ( -1 ); |
244 | setContrast ( -1 ); | 243 | setContrast ( -1 ); |
245 | } | 244 | } |
246 | 245 | ||
247 | void LightSettings::setCloseHingeAction ( int index ) | 246 | void LightSettings::setCloseHingeAction ( int index ) |
248 | { | 247 | { |
249 | qWarning("LightSettings::setCloseHingeStatus(%d)", index); | 248 | qWarning("LightSettings::setCloseHingeStatus(%d)", index); |
250 | } | 249 | } |
251 | 250 | ||
252 | void LightSettings::accept ( ) | 251 | void 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 () ); |
263 | if (m_cres) | 262 | if (m_cres) |
264 | config. writeEntry ( "Contrast", contrast-> value () ); | 263 | config. writeEntry ( "Contrast", contrast-> value () ); |
265 | config. writeEntry ( "Freq", frequency->currentItem() ); | 264 | config. writeEntry ( "Freq", frequency->currentItem() ); |
266 | config. writeEntry ( "CloseHingeAction", closeHingeAction->currentItem() ); | 265 | config. writeEntry ( "CloseHingeAction", closeHingeAction->currentItem() ); |
267 | 266 | ||
268 | // ac | 267 | // ac |
269 | config. setGroup ( "AC" ); | 268 | config. setGroup ( "AC" ); |
270 | config. writeEntry ( "LcdOffOnly", LcdOffOnly_ac-> isChecked ( )); | 269 | config. writeEntry ( "LcdOffOnly", LcdOffOnly_ac-> isChecked ( )); |
271 | config. writeEntry ( "Dim", interval_dim_ac-> value ( )); | 270 | config. writeEntry ( "Dim", interval_dim_ac-> value ( )); |
272 | config. writeEntry ( "LightOff", interval_lightoff_ac-> value ( )); | 271 | config. writeEntry ( "LightOff", interval_lightoff_ac-> value ( )); |
273 | config. writeEntry ( "Suspend", interval_suspend_ac-> value ( )); | 272 | config. writeEntry ( "Suspend", interval_suspend_ac-> value ( )); |
274 | config. writeEntry ( "Brightness", brightness_ac-> value () ); | 273 | config. writeEntry ( "Brightness", brightness_ac-> value () ); |
275 | if (m_cres) | 274 | if (m_cres) |
276 | config. writeEntry ( "Contrast", contrast_ac-> value () ); | 275 | config. writeEntry ( "Contrast", contrast_ac-> value () ); |
277 | config. writeEntry ( "Freq", frequency_ac->currentItem() ); | 276 | config. writeEntry ( "Freq", frequency_ac->currentItem() ); |
278 | config. writeEntry ( "CloseHingeAction", closeHingeAction_ac->currentItem() ); | 277 | config. writeEntry ( "CloseHingeAction", closeHingeAction_ac->currentItem() ); |
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 | |||
@@ -41,129 +41,129 @@ | |||
41 | passcode = cfg.readEntry("passcode"); | 41 | passcode = cfg.readEntry("passcode"); |
42 | passcode_poweron->setChecked(cfg.readBoolEntry("passcode_poweron",FALSE)); | 42 | passcode_poweron->setChecked(cfg.readBoolEntry("passcode_poweron",FALSE)); |
43 | cfg.setGroup("Sync"); | 43 | cfg.setGroup("Sync"); |
44 | int auth_peer = cfg.readNumEntry("auth_peer",0xc0a88100);//new default 192.168.129.0/24 | 44 | int auth_peer = cfg.readNumEntry("auth_peer",0xc0a88100);//new default 192.168.129.0/24 |
45 | int auth_peer_bits = cfg.readNumEntry("auth_peer_bits",24); | 45 | int auth_peer_bits = cfg.readNumEntry("auth_peer_bits",24); |
46 | selectNet(auth_peer,auth_peer_bits,TRUE); | 46 | selectNet(auth_peer,auth_peer_bits,TRUE); |
47 | 47 | ||
48 | connect(syncnet, SIGNAL(textChanged(const QString&)), | 48 | connect(syncnet, SIGNAL(textChanged(const QString&)), |
49 | this, SLOT(setSyncNet(const QString&))); | 49 | this, SLOT(setSyncNet(const QString&))); |
50 | 50 | ||
51 | cfg.setGroup("Sync"); | 51 | cfg.setGroup("Sync"); |
52 | QString sa = cfg.readEntry("syncapp","Qtopia"); | 52 | QString sa = cfg.readEntry("syncapp","Qtopia"); |
53 | 53 | ||
54 | for (int i=0; i<syncapp->count(); i++) { | 54 | for (int i=0; i<syncapp->count(); i++) { |
55 | if ( syncapp->text(i) == sa ) { | 55 | if ( syncapp->text(i) == sa ) { |
56 | syncapp->setCurrentItem(i); | 56 | syncapp->setCurrentItem(i); |
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 | ||
108 | Security::~Security() | 108 | Security::~Security() |
109 | { | 109 | { |
110 | } | 110 | } |
111 | 111 | ||
112 | void Security::deleteListEntry() | 112 | void Security::deleteListEntry() |
113 | { | 113 | { |
114 | syncnet->removeItem(syncnet->currentItem()); | 114 | syncnet->removeItem(syncnet->currentItem()); |
115 | } | 115 | } |
116 | 116 | ||
117 | void Security::restoreDefaults() | 117 | void 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 | ||
135 | void Security::insertDefaultRanges() | 135 | void 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 | ||
147 | void Security::updateGUI() | 147 | void 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 ); |
154 | clearpasscode->setEnabled( !empty ); | 154 | clearpasscode->setEnabled( !empty ); |
155 | 155 | ||
156 | autologinToggle->setChecked(autoLogin); | 156 | autologinToggle->setChecked(autoLogin); |
157 | userlist->setEnabled(autoLogin); | 157 | userlist->setEnabled(autoLogin); |
158 | } | 158 | } |
159 | 159 | ||
160 | 160 | ||
161 | void Security::show() | 161 | void Security::show() |
162 | { | 162 | { |
163 | //valid=FALSE; | 163 | //valid=FALSE; |
164 | setEnabled(FALSE); | 164 | setEnabled(FALSE); |
165 | SecurityBase::show(); | 165 | SecurityBase::show(); |
166 | if ( passcode.isEmpty() ) { | 166 | if ( passcode.isEmpty() ) { |
167 | // could insist... | 167 | // could insist... |
168 | //changePassCode(); | 168 | //changePassCode(); |
169 | //if ( passcode.isEmpty() ) | 169 | //if ( passcode.isEmpty() ) |