summaryrefslogtreecommitdiff
authordrw <drw>2005-02-23 16:14:09 (UTC)
committer drw <drw>2005-02-23 16:14:09 (UTC)
commite5b1e010c321ba1edac704f9d668df75b22fd074 (patch) (side-by-side diff)
treec76221c7d8292f66ef05040721edf816a04fbeba
parent30857db6ca3f355aa3d50b59f03a13c82f265af2 (diff)
downloadopie-e5b1e010c321ba1edac704f9d668df75b22fd074.zip
opie-e5b1e010c321ba1edac704f9d668df75b22fd074.tar.gz
opie-e5b1e010c321ba1edac704f9d668df75b22fd074.tar.bz2
Fix UI to prevent error dialog from displaying when it shouldn't
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/mainwindow.cpp61
-rw-r--r--noncore/settings/netsystemtime/ntptabwidget.cpp61
-rw-r--r--noncore/settings/netsystemtime/ntptabwidget.h46
-rw-r--r--noncore/settings/netsystemtime/timetabwidget.cpp57
-rw-r--r--noncore/settings/netsystemtime/timetabwidget.h47
5 files changed, 152 insertions, 120 deletions
diff --git a/noncore/settings/netsystemtime/mainwindow.cpp b/noncore/settings/netsystemtime/mainwindow.cpp
index 385d355..486257f 100644
--- a/noncore/settings/netsystemtime/mainwindow.cpp
+++ b/noncore/settings/netsystemtime/mainwindow.cpp
@@ -1,24 +1,24 @@
/*
-                This file is part of the OPIE Project
+ This file is part of the OPIE Project
=.
-             .=l. Copyright (c) 2002 OPIE team <opie@handhelds.org?>
-           .>+-=
- _;:,     .>    :=|. This file is free software; you can
-.> <`_,   >  .   <= redistribute it and/or modify it under
-:`=1 )Y*s>-.--   : the terms of the GNU General Public
-.="- .-=="i,     .._ License as published by the Free Software
- - .   .-<_>     .<> Foundation; either version 2 of the License,
-     ._= =}       : or (at your option) any later version.
-    .%`+i>       _;_.
-    .i_,=:_.      -<s. This file is distributed in the hope that
-     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
-    : ..    .:,     . . . without even the implied warranty of
-    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
-  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
-..}^=.=       =       ; Public License for more details.
-++=   -.     .`     .:
- :     =  ...= . :.=- You should have received a copy of the GNU
- -.   .:....=;==+<; General Public License along with this file;
-  -_. . .   )=.  = see the file COPYING. If not, write to the
-    --        :-=` Free Software Foundation, Inc.,
+ .=l. Copyright (c) 2002 OPIE team <opie@handhelds.org?>
+ .>+-=
+_;:, .> :=|. This file is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU General Public
+.="- .-=="i, .._ License as published by the Free Software
+- . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This file is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General
+..}^=.= = ; Public License for more details.
+++= -. .` .:
+: = ...= . :.=- You should have received a copy of the GNU
+-. .:....=;==+<; General Public License along with this file;
+ -_. . . )=. = see the file COPYING. If not, write to the
+ -- :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
@@ -53,3 +53,3 @@ using namespace Opie::Core;
MainWindow::MainWindow( QWidget *parent , const char *name, bool modal, WFlags f )
- : QDialog( 0x0, 0x0, TRUE, 0 )
+ : QDialog( parent, name, modal, f )
{
@@ -189,2 +189,7 @@ void MainWindow::runNTP()
+ // Disable set time buttons & change app caption to indicate time update is happening
+ ntpTab->setNTPBtnEnabled( false );
+ timeTab->setNTPBtnEnabled( false );
+ setCaption( tr( "Retrieving time from network..." ) );
+
if ( !ntpProcess )
@@ -208,2 +213,7 @@ void MainWindow::runNTP()
ntpTab->addNtpOutput( tr( "Error while executing ntpdate" ) );
+
+ // Re-enable set time buttons & change app caption to indicate time update is happening
+ ntpTab->setNTPBtnEnabled( true );
+ timeTab->setNTPBtnEnabled( true );
+ setCaption( tr( "SystemTime" ) );
}
@@ -300,2 +310,7 @@ void MainWindow::slotNtpFinished( OProcess *p )
+ // Re-enable set time buttons & change app caption to indicate time update is happening
+ ntpTab->setNTPBtnEnabled( true );
+ timeTab->setNTPBtnEnabled( true );
+ setCaption( tr( "SystemTime" ) );
+
// Verify run was successful
@@ -353,3 +368,3 @@ void MainWindow::slotNtpFinished( OProcess *p )
lookupCount++;
- predictTab->setShiftPerSec( timeShift / secsSinceLast );
+ predictTab->setShiftPerSec( (int)(timeShift / secsSinceLast) );
config.writeEntry( "secsSinceLast", secsSinceLast );
diff --git a/noncore/settings/netsystemtime/ntptabwidget.cpp b/noncore/settings/netsystemtime/ntptabwidget.cpp
index d71c230..616bc22 100644
--- a/noncore/settings/netsystemtime/ntptabwidget.cpp
+++ b/noncore/settings/netsystemtime/ntptabwidget.cpp
@@ -1,24 +1,24 @@
/*
-                This file is part of the OPIE Project
+ This file is part of the OPIE Project
=.
-             .=l. Copyright (c) 2002 OPIE team <opie@handhelds.org?>
-           .>+-=
- _;:,     .>    :=|. This file is free software; you can
-.> <`_,   >  .   <= redistribute it and/or modify it under
-:`=1 )Y*s>-.--   : the terms of the GNU General Public
-.="- .-=="i,     .._ License as published by the Free Software
- - .   .-<_>     .<> Foundation; either version 2 of the License,
-     ._= =}       : or (at your option) any later version.
-    .%`+i>       _;_.
-    .i_,=:_.      -<s. This file is distributed in the hope that
-     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
-    : ..    .:,     . . . without even the implied warranty of
-    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
-  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
-..}^=.=       =       ; Public License for more details.
-++=   -.     .`     .:
- :     =  ...= . :.=- You should have received a copy of the GNU
- -.   .:....=;==+<; General Public License along with this file;
-  -_. . .   )=.  = see the file COPYING. If not, write to the
-    --        :-=` Free Software Foundation, Inc.,
+ .=l. Copyright (c) 2002 OPIE team <opie@handhelds.org?>
+ .>+-=
+_;:, .> :=|. This file is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU General Public
+.="- .-=="i, .._ License as published by the Free Software
+- . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This file is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General
+..}^=.= = ; Public License for more details.
+++= -. .` .:
+: = ...= . :.=- You should have received a copy of the GNU
+-. .:....=;==+<; General Public License along with this file;
+ -_. . . )=. = see the file COPYING. If not, write to the
+ -- :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
@@ -48,3 +48,3 @@ NTPTabWidget::NTPTabWidget( QWidget *parent )
sv->addChild( container );
-
+
QGridLayout *layout = new QGridLayout( container );
@@ -72,11 +72,11 @@ NTPTabWidget::NTPTabWidget( QWidget *parent )
font.setPointSize( 7 );
- mleNtpOutput->setFont( font );
+ mleNtpOutput->setFont( font );
mleNtpOutput->setWordWrap( QMultiLineEdit::WidgetWidth );
layout->addMultiCellWidget( mleNtpOutput, 3, 3, 0, 1 );
-
+
// Set NTP time button
- QPushButton *pb = new QPushButton( Resource::loadPixmap( "netsystemtime/ntptab" ),
- tr( "Get time from the network" ), container );
- connect( pb, SIGNAL(clicked()), this, SIGNAL(getNTPTime()) );
- layout->addMultiCellWidget( pb, 4, 4, 0, 1 );
+ m_ntpBtn = new QPushButton( Resource::loadPixmap( "netsystemtime/ntptab" ),
+ tr( "Get time from the network" ), container );
+ connect( m_ntpBtn, SIGNAL(clicked()), this, SIGNAL(getNTPTime()) );
+ layout->addMultiCellWidget( m_ntpBtn, 4, 4, 0, 1 );
}
@@ -107 +107,6 @@ void NTPTabWidget::addNtpOutput( const QString &str )
}
+
+void NTPTabWidget::setNTPBtnEnabled( bool enabled )
+{
+ m_ntpBtn->setEnabled( enabled );
+}
diff --git a/noncore/settings/netsystemtime/ntptabwidget.h b/noncore/settings/netsystemtime/ntptabwidget.h
index 811c57e..f05482e 100644
--- a/noncore/settings/netsystemtime/ntptabwidget.h
+++ b/noncore/settings/netsystemtime/ntptabwidget.h
@@ -1,24 +1,24 @@
/*
-                This file is part of the OPIE Project
+ This file is part of the OPIE Project
=.
-             .=l. Copyright (c) 2002 OPIE team <opie@handhelds.org?>
-           .>+-=
- _;:,     .>    :=|. This file is free software; you can
-.> <`_,   >  .   <= redistribute it and/or modify it under
-:`=1 )Y*s>-.--   : the terms of the GNU General Public
-.="- .-=="i,     .._ License as published by the Free Software
- - .   .-<_>     .<> Foundation; either version 2 of the License,
-     ._= =}       : or (at your option) any later version.
-    .%`+i>       _;_.
-    .i_,=:_.      -<s. This file is distributed in the hope that
-     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
-    : ..    .:,     . . . without even the implied warranty of
-    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
-  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
-..}^=.=       =       ; Public License for more details.
-++=   -.     .`     .:
- :     =  ...= . :.=- You should have received a copy of the GNU
- -.   .:....=;==+<; General Public License along with this file;
-  -_. . .   )=.  = see the file COPYING. If not, write to the
-    --        :-=` Free Software Foundation, Inc.,
+ .=l. Copyright (c) 2002 OPIE team <opie@handhelds.org?>
+ .>+-=
+_;:, .> :=|. This file is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU General Public
+.="- .-=="i, .._ License as published by the Free Software
+- . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This file is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General
+..}^=.= = ; Public License for more details.
+++= -. .` .:
+: = ...= . :.=- You should have received a copy of the GNU
+-. .:....=;==+<; General Public License along with this file;
+ -_. . . )=. = see the file COPYING. If not, write to the
+ -- :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
@@ -35,2 +35,3 @@ class QLabel;
class QMultiLineEdit;
+class QPushButton;
@@ -48,2 +49,3 @@ public:
void addNtpOutput( const QString & );
+ void setNTPBtnEnabled( bool enabled );
@@ -54,2 +56,4 @@ private:
QMultiLineEdit *mleNtpOutput;
+ QPushButton *m_ntpBtn;
+
diff --git a/noncore/settings/netsystemtime/timetabwidget.cpp b/noncore/settings/netsystemtime/timetabwidget.cpp
index 3cc127d..905461f 100644
--- a/noncore/settings/netsystemtime/timetabwidget.cpp
+++ b/noncore/settings/netsystemtime/timetabwidget.cpp
@@ -1,24 +1,24 @@
/*
-                This file is part of the OPIE Project
+ This file is part of the OPIE Project
=.
-             .=l. Copyright (c) 2002 OPIE team <opie@handhelds.org?>
-           .>+-=
- _;:,     .>    :=|. This file is free software; you can
-.> <`_,   >  .   <= redistribute it and/or modify it under
-:`=1 )Y*s>-.--   : the terms of the GNU General Public
-.="- .-=="i,     .._ License as published by the Free Software
- - .   .-<_>     .<> Foundation; either version 2 of the License,
-     ._= =}       : or (at your option) any later version.
-    .%`+i>       _;_.
-    .i_,=:_.      -<s. This file is distributed in the hope that
-     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
-    : ..    .:,     . . . without even the implied warranty of
-    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
-  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
-..}^=.=       =       ; Public License for more details.
-++=   -.     .`     .:
- :     =  ...= . :.=- You should have received a copy of the GNU
- -.   .:....=;==+<; General Public License along with this file;
-  -_. . .   )=.  = see the file COPYING. If not, write to the
-    --        :-=` Free Software Foundation, Inc.,
+ .=l. Copyright (c) 2002 OPIE team <opie@handhelds.org?>
+ .>+-=
+_;:, .> :=|. This file is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU General Public
+.="- .-=="i, .._ License as published by the Free Software
+- . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This file is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General
+..}^=.= = ; Public License for more details.
+++= -. .` .:
+: = ...= . :.=- You should have received a copy of the GNU
+-. .:....=;==+<; General Public License along with this file;
+ -_. . . )=. = see the file COPYING. If not, write to the
+ -- :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
@@ -111,9 +111,9 @@ TimeTabWidget::TimeTabWidget( QWidget *parent )
// Set NTP time button
- QPushButton *pb = new QPushButton( Resource::loadPixmap( "netsystemtime/ntptab" ),
- tr( "Get time from the network" ), container );
- connect( pb, SIGNAL(clicked()), this, SIGNAL(getNTPTime()) );
- layout->addMultiCellWidget( pb, 8, 8, 0, 5 );
+ m_ntpBtn = new QPushButton( Resource::loadPixmap( "netsystemtime/ntptab" ),
+ tr( "Get time from the network" ), container );
+ connect( m_ntpBtn, SIGNAL(clicked()), this, SIGNAL(getNTPTime()) );
+ layout->addMultiCellWidget( m_ntpBtn, 8, 8, 0, 5 );
// Set predicted time button
- pb = new QPushButton( Resource::loadPixmap( "netsystemtime/predicttab" ), tr( "Set predicted time" ),
+ QPushButton *pb = new QPushButton( Resource::loadPixmap( "netsystemtime/predicttab" ), tr( "Set predicted time" ),
container );
@@ -194,2 +194,7 @@ void TimeTabWidget::setDateTime( const QDateTime &dt )
+void TimeTabWidget::setNTPBtnEnabled( bool enabled )
+{
+ m_ntpBtn->setEnabled( enabled );
+}
+
void TimeTabWidget::setSystemTime( const QDateTime &dt )
diff --git a/noncore/settings/netsystemtime/timetabwidget.h b/noncore/settings/netsystemtime/timetabwidget.h
index f44a1da..949535d 100644
--- a/noncore/settings/netsystemtime/timetabwidget.h
+++ b/noncore/settings/netsystemtime/timetabwidget.h
@@ -1,24 +1,24 @@
/*
-                This file is part of the OPIE Project
+ This file is part of the OPIE Project
=.
-             .=l. Copyright (c) 2002 OPIE team <opie@handhelds.org?>
-           .>+-=
- _;:,     .>    :=|. This file is free software; you can
-.> <`_,   >  .   <= redistribute it and/or modify it under
-:`=1 )Y*s>-.--   : the terms of the GNU General Public
-.="- .-=="i,     .._ License as published by the Free Software
- - .   .-<_>     .<> Foundation; either version 2 of the License,
-     ._= =}       : or (at your option) any later version.
-    .%`+i>       _;_.
-    .i_,=:_.      -<s. This file is distributed in the hope that
-     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
-    : ..    .:,     . . . without even the implied warranty of
-    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
-  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
-..}^=.=       =       ; Public License for more details.
-++=   -.     .`     .:
- :     =  ...= . :.=- You should have received a copy of the GNU
- -.   .:....=;==+<; General Public License along with this file;
-  -_. . .   )=.  = see the file COPYING. If not, write to the
-    --        :-=` Free Software Foundation, Inc.,
+ .=l. Copyright (c) 2002 OPIE team <opie@handhelds.org?>
+ .>+-=
+_;:, .> :=|. This file is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU General Public
+.="- .-=="i, .._ License as published by the Free Software
+- . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This file is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General
+..}^=.= = ; Public License for more details.
+++= -. .` .:
+: = ...= . :.=- You should have received a copy of the GNU
+-. .:....=;==+<; General Public License along with this file;
+ -_. . . )=. = see the file COPYING. If not, write to the
+ -- :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
@@ -37,2 +37,3 @@ class QComboBox;
class QDateTime;
+class QPushButton;
class QSpinBox;
@@ -45,3 +46,3 @@ class TimeTabWidget : public QWidget
public:
- TimeTabWidget( QWidget * = 0x0 );
+ TimeTabWidget( QWidget * = 0l );
~TimeTabWidget();
@@ -50,2 +51,3 @@ public:
void setDateTime( const QDateTime & );
+ void setNTPBtnEnabled( bool enabled );
@@ -57,2 +59,3 @@ private:
TimeZoneSelector *selTimeZone;
+ QPushButton *m_ntpBtn;