author | drw <drw> | 2005-06-15 18:52:47 (UTC) |
---|---|---|
committer | drw <drw> | 2005-06-15 18:52:47 (UTC) |
commit | c93c8f75bb082c0257ce80f9e8a1eb470bdce397 (patch) (unidiff) | |
tree | 2a83c0cbe4398daf0a141a62b80bd1b926353ce2 /noncore/settings/netsystemtime/ntptabwidget.cpp | |
parent | 1c8aab0c489b9d469646a0e0ab08f500f1bbb507 (diff) | |
download | opie-c93c8f75bb082c0257ce80f9e8a1eb470bdce397.zip opie-c93c8f75bb082c0257ce80f9e8a1eb470bdce397.tar.gz opie-c93c8f75bb082c0257ce80f9e8a1eb470bdce397.tar.bz2 |
Resource -> OResource and fix doc headers
Diffstat (limited to 'noncore/settings/netsystemtime/ntptabwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/netsystemtime/ntptabwidget.cpp | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/noncore/settings/netsystemtime/ntptabwidget.cpp b/noncore/settings/netsystemtime/ntptabwidget.cpp index 616bc22..16d21cc 100644 --- a/noncore/settings/netsystemtime/ntptabwidget.cpp +++ b/noncore/settings/netsystemtime/ntptabwidget.cpp | |||
@@ -1,103 +1,108 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the OPIE Project | 2 | This file is part of the Opie Project |
3 | =. | 3 | |
4 | .=l. Copyright (c) 2002 OPIE team <opie@handhelds.org?> | 4 | Copyright (C) Opie Team <opie-devel@handhelds.org> |
5 | .>+-= | 5 | =. |
6 | _;:, .> :=|. This file is free software; you can | 6 | .=l. |
7 | .> <`_, > . <= redistribute it and/or modify it under | 7 | .>+-= |
8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 8 | _;:, .> :=|. This program is free software; you can |
9 | .="- .-=="i, .._ License as published by the Free Software | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | - . .-<_> .<> Foundation; either version 2 of the License, | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | ._= =} : or (at your option) any later version. | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | .%`+i> _;_. | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | .i_,=:_. -<s. This file is distributed in the hope that | 13 | ._= =} : or (at your option) any later version. |
14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 14 | .%`+i> _;_. |
15 | : .. .:, . . . without even the implied warranty of | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 17 | : .. .:, . . . without even the implied warranty of |
18 | ..}^=.= = ; Public License for more details. | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | ++= -. .` .: | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | : = ...= . :.=- You should have received a copy of the GNU | 20 | ..}^=.= = ; Library General Public License for more |
21 | -. .:....=;==+<; General Public License along with this file; | 21 | ++= -. .` .: details. |
22 | -_. . . )=. = see the file COPYING. If not, write to the | 22 | : = ...= . :.=- |
23 | -- :-=` Free Software Foundation, Inc., | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | 59 Temple Place - Suite 330, | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
26 | |||
27 | */ | 29 | */ |
28 | 30 | ||
29 | #include "ntptabwidget.h" | 31 | #include "ntptabwidget.h" |
30 | 32 | ||
31 | #include <qpe/resource.h> | 33 | #include <opie2/oresource.h> |
34 | |||
35 | #include <qpe/applnk.h> | ||
32 | 36 | ||
33 | #include <qlabel.h> | 37 | #include <qlabel.h> |
34 | #include <qlayout.h> | 38 | #include <qlayout.h> |
35 | #include <qmultilineedit.h> | 39 | #include <qmultilineedit.h> |
36 | #include <qpushbutton.h> | 40 | #include <qpushbutton.h> |
37 | #include <qscrollview.h> | 41 | #include <qscrollview.h> |
38 | 42 | ||
39 | NTPTabWidget::NTPTabWidget( QWidget *parent ) | 43 | NTPTabWidget::NTPTabWidget( QWidget *parent ) |
40 | : QWidget( parent, 0x0, 0 ) | 44 | : QWidget( parent, 0x0, 0 ) |
41 | { | 45 | { |
42 | QVBoxLayout *tmpvb = new QVBoxLayout( this ); | 46 | QVBoxLayout *tmpvb = new QVBoxLayout( this ); |
43 | QScrollView *sv = new QScrollView( this ); | 47 | QScrollView *sv = new QScrollView( this ); |
44 | tmpvb->addWidget( sv, 0, 0 ); | 48 | tmpvb->addWidget( sv, 0, 0 ); |
45 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 49 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
46 | sv->setFrameStyle( QFrame::NoFrame ); | 50 | sv->setFrameStyle( QFrame::NoFrame ); |
47 | QWidget *container = new QWidget( sv->viewport() ); | 51 | QWidget *container = new QWidget( sv->viewport() ); |
48 | sv->addChild( container ); | 52 | sv->addChild( container ); |
49 | 53 | ||
50 | QGridLayout *layout = new QGridLayout( container ); | 54 | QGridLayout *layout = new QGridLayout( container ); |
51 | layout->setMargin( 2 ); | 55 | layout->setMargin( 2 ); |
52 | layout->setSpacing( 4 ); | 56 | layout->setSpacing( 4 ); |
53 | 57 | ||
54 | // Start time | 58 | // Start time |
55 | layout->addWidget( new QLabel( tr( "Start time" ), container ), 0, 0 ); | 59 | layout->addWidget( new QLabel( tr( "Start time" ), container ), 0, 0 ); |
56 | lblStartTime = new QLabel( tr( "n/a" ), container ); | 60 | lblStartTime = new QLabel( tr( "n/a" ), container ); |
57 | layout->addWidget( lblStartTime, 0, 1 ); | 61 | layout->addWidget( lblStartTime, 0, 1 ); |
58 | 62 | ||
59 | // Time shift | 63 | // Time shift |
60 | layout->addWidget( new QLabel( tr( "Time shift" ), container ), 1, 0 ); | 64 | layout->addWidget( new QLabel( tr( "Time shift" ), container ), 1, 0 ); |
61 | lblTimeShift = new QLabel( tr( "n/a" ), container ); | 65 | lblTimeShift = new QLabel( tr( "n/a" ), container ); |
62 | layout->addWidget( lblTimeShift, 1, 1 ); | 66 | layout->addWidget( lblTimeShift, 1, 1 ); |
63 | 67 | ||
64 | // New time | 68 | // New time |
65 | layout->addWidget( new QLabel( tr( "New time" ), container ), 2, 0 ); | 69 | layout->addWidget( new QLabel( tr( "New time" ), container ), 2, 0 ); |
66 | lblNewTime = new QLabel( tr( "n/a" ), container ); | 70 | lblNewTime = new QLabel( tr( "n/a" ), container ); |
67 | layout->addWidget( lblNewTime, 2, 1 ); | 71 | layout->addWidget( lblNewTime, 2, 1 ); |
68 | 72 | ||
69 | // NTP output display | 73 | // NTP output display |
70 | mleNtpOutput = new QMultiLineEdit( container ); | 74 | mleNtpOutput = new QMultiLineEdit( container ); |
71 | QFont font( mleNtpOutput->font() ); | 75 | QFont font( mleNtpOutput->font() ); |
72 | font.setPointSize( 7 ); | 76 | font.setPointSize( 7 ); |
73 | mleNtpOutput->setFont( font ); | 77 | mleNtpOutput->setFont( font ); |
74 | mleNtpOutput->setWordWrap( QMultiLineEdit::WidgetWidth ); | 78 | mleNtpOutput->setWordWrap( QMultiLineEdit::WidgetWidth ); |
75 | layout->addMultiCellWidget( mleNtpOutput, 3, 3, 0, 1 ); | 79 | layout->addMultiCellWidget( mleNtpOutput, 3, 3, 0, 1 ); |
76 | 80 | ||
77 | // Set NTP time button | 81 | // Set NTP time button |
78 | m_ntpBtn = new QPushButton( Resource::loadPixmap( "netsystemtime/ntptab" ), | 82 | m_ntpBtn = new QPushButton( Opie::Core::OResource::loadPixmap( "netsystemtime/ntptab", Opie::Core::OResource::SmallIcon ), |
79 | tr( "Get time from the network" ), container ); | 83 | tr( "Get time from the network" ), container ); |
84 | m_ntpBtn->setMinimumHeight( AppLnk::smallIconSize()+4 ); | ||
80 | connect( m_ntpBtn, SIGNAL(clicked()), this, SIGNAL(getNTPTime()) ); | 85 | connect( m_ntpBtn, SIGNAL(clicked()), this, SIGNAL(getNTPTime()) ); |
81 | layout->addMultiCellWidget( m_ntpBtn, 4, 4, 0, 1 ); | 86 | layout->addMultiCellWidget( m_ntpBtn, 4, 4, 0, 1 ); |
82 | } | 87 | } |
83 | 88 | ||
84 | NTPTabWidget::~NTPTabWidget() | 89 | NTPTabWidget::~NTPTabWidget() |
85 | { | 90 | { |
86 | } | 91 | } |
87 | 92 | ||
88 | void NTPTabWidget::setStartTime( const QString &str ) | 93 | void NTPTabWidget::setStartTime( const QString &str ) |
89 | { | 94 | { |
90 | lblStartTime->setText( str ); | 95 | lblStartTime->setText( str ); |
91 | } | 96 | } |
92 | 97 | ||
93 | void NTPTabWidget::setTimeShift( const QString &str ) | 98 | void NTPTabWidget::setTimeShift( const QString &str ) |
94 | { | 99 | { |
95 | lblTimeShift->setText( str ); | 100 | lblTimeShift->setText( str ); |
96 | } | 101 | } |
97 | 102 | ||
98 | void NTPTabWidget::setNewTime( const QString &str ) | 103 | void NTPTabWidget::setNewTime( const QString &str ) |
99 | { | 104 | { |
100 | lblNewTime->setText( str ); | 105 | lblNewTime->setText( str ); |
101 | } | 106 | } |
102 | 107 | ||
103 | void NTPTabWidget::addNtpOutput( const QString &str ) | 108 | void NTPTabWidget::addNtpOutput( const QString &str ) |