From e5b1e010c321ba1edac704f9d668df75b22fd074 Mon Sep 17 00:00:00 2001 From: drw Date: Wed, 23 Feb 2005 16:14:09 +0000 Subject: Fix UI to prevent error dialog from displaying when it shouldn't --- (limited to 'noncore/settings/netsystemtime/ntptabwidget.cpp') 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,26 +1,26 @@ /* -                This file is part of the OPIE Project + This file is part of the OPIE Project =. -             .=l. Copyright (c) 2002 OPIE team -           .>+-= - _;:,     .>    :=|. 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_,=:_.      -`: 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 + .>+-= +_;:, .> :=|. 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_,=:_. -`: 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, Boston, MA 02111-1307, USA. @@ -46,7 +46,7 @@ NTPTabWidget::NTPTabWidget( QWidget *parent ) sv->setFrameStyle( QFrame::NoFrame ); QWidget *container = new QWidget( sv->viewport() ); sv->addChild( container ); - + QGridLayout *layout = new QGridLayout( container ); layout->setMargin( 2 ); layout->setSpacing( 4 ); @@ -70,15 +70,15 @@ NTPTabWidget::NTPTabWidget( QWidget *parent ) mleNtpOutput = new QMultiLineEdit( container ); QFont font( mleNtpOutput->font() ); 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 ); } NTPTabWidget::~NTPTabWidget() @@ -105,3 +105,8 @@ void NTPTabWidget::addNtpOutput( const QString &str ) mleNtpOutput->append( str ); mleNtpOutput->setCursorPosition( mleNtpOutput->numLines() + 1, 0, FALSE ); } + +void NTPTabWidget::setNTPBtnEnabled( bool enabled ) +{ + m_ntpBtn->setEnabled( enabled ); +} -- cgit v0.9.0.2