Diffstat (limited to 'noncore/settings/packagemanager/entrydlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/entrydlg.cpp | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/noncore/settings/packagemanager/entrydlg.cpp b/noncore/settings/packagemanager/entrydlg.cpp index 3b794b4..5d61342 100644 --- a/noncore/settings/packagemanager/entrydlg.cpp +++ b/noncore/settings/packagemanager/entrydlg.cpp | |||
@@ -1,75 +1,76 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the OPIE Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | =. Copyright (c) 2004 Dan Williams <drw@handhelds.org> | 4 | Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org> |
5 | .=l. | 5 | =. |
6 | .>+-= | 6 | .=l. |
7 | _;:, .> :=|. This file is free software; you can | 7 | .>+-= |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | _;:, .> :=|. This program is free software; you can |
9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | ._= =} : or (at your option) any later version. | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | .%`+i> _;_. | 13 | ._= =} : or (at your option) any later version. |
14 | .i_,=:_. -<s. This file is distributed in the hope that | 14 | .%`+i> _;_. |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | : .. .:, . . . without even the implied warranty of | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | : .. .:, . . . without even the implied warranty of |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | ..}^=.= = ; Public License for more details. | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ++= -. .` .: | 20 | ..}^=.= = ; Library General Public License for more |
21 | : = ...= . :.=- You should have received a copy of the GNU | 21 | ++= -. .` .: details. |
22 | -. .:....=;==+<; General Public License along with this file; | 22 | : = ...= . :.=- |
23 | -_. . . )=. = see the file COPYING. If not, write to the | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -- :-=` Free Software Foundation, Inc., | 24 | -_. . . )=. = Library General Public License along with |
25 | 59 Temple Place - Suite 330, | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
26 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
27 | |||
28 | */ | 29 | */ |
29 | 30 | ||
30 | #include "entrydlg.h" | 31 | #include "entrydlg.h" |
31 | 32 | ||
32 | #include <opie2/ofiledialog.h> | 33 | #include <opie2/ofiledialog.h> |
33 | 34 | ||
34 | #include <qpe/qpeapplication.h> | 35 | #include <qpe/qpeapplication.h> |
35 | #include <qpe/resource.h> | 36 | #include <qpe/resource.h> |
36 | 37 | ||
37 | #include <qlabel.h> | 38 | #include <qlabel.h> |
38 | #include <qlayout.h> | 39 | #include <qlayout.h> |
39 | #include <qlineedit.h> | 40 | #include <qlineedit.h> |
40 | #include <qpushbutton.h> | 41 | #include <qpushbutton.h> |
41 | 42 | ||
42 | EntryDlg::EntryDlg( const QString &label, QWidget* parent, const char* name, bool modal ) | 43 | EntryDlg::EntryDlg( const QString &label, QWidget* parent, const char* name, bool modal ) |
43 | : QDialog( parent, name, modal ) | 44 | : QDialog( parent, name, modal ) |
44 | { | 45 | { |
45 | QGridLayout *layout = new QGridLayout( this, 3, 2, 2, 4 ); | 46 | QGridLayout *layout = new QGridLayout( this, 3, 2, 2, 4 ); |
46 | 47 | ||
47 | QLabel *l = new QLabel( label, this ); | 48 | QLabel *l = new QLabel( label, this ); |
48 | l->setAlignment( AlignLeft | AlignTop | WordBreak ); | 49 | l->setAlignment( AlignLeft | AlignTop | WordBreak ); |
49 | layout->addMultiCellWidget( l, 0, 0, 0, 1 ); | 50 | layout->addMultiCellWidget( l, 0, 0, 0, 1 ); |
50 | 51 | ||
51 | m_entry = new QLineEdit( this ); | 52 | m_entry = new QLineEdit( this ); |
52 | layout->addWidget( m_entry, 1, 0 ); | 53 | layout->addWidget( m_entry, 1, 0 ); |
53 | connect( m_entry, SIGNAL(returnPressed()), this, SLOT(slotTryAccept()) ); | 54 | connect( m_entry, SIGNAL(returnPressed()), this, SLOT(slotTryAccept()) ); |
54 | 55 | ||
55 | QPixmap pic; | 56 | QPixmap pic; |
56 | pic.convertFromImage( Resource::loadImage( "folder" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | 57 | pic.convertFromImage( Resource::loadImage( "folder" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); |
57 | QPushButton *btn = new QPushButton( pic, QString::null, this ); | 58 | QPushButton *btn = new QPushButton( pic, QString::null, this ); |
58 | btn->setMaximumWidth( btn->height() ); | 59 | btn->setMaximumWidth( btn->height() ); |
59 | connect( btn, SIGNAL(clicked()), this, SLOT(slotSelectPath()) ); | 60 | connect( btn, SIGNAL(clicked()), this, SLOT(slotSelectPath()) ); |
60 | layout->addWidget( btn, 1, 1 ); | 61 | layout->addWidget( btn, 1, 1 ); |
61 | 62 | ||
62 | layout->setRowStretch( 2, 10 ); | 63 | layout->setRowStretch( 2, 10 ); |
63 | 64 | ||
64 | resize( width(), l->height() + btn->height() + 8 ); | 65 | resize( width(), l->height() + btn->height() + 8 ); |
65 | } | 66 | } |
66 | 67 | ||
67 | void EntryDlg::setText( const QString &text ) | 68 | void EntryDlg::setText( const QString &text ) |
68 | { | 69 | { |
69 | m_entry->setText( text ); | 70 | m_entry->setText( text ); |
70 | m_entry->selectAll(); | 71 | m_entry->selectAll(); |
71 | } | 72 | } |
72 | 73 | ||
73 | QString EntryDlg::getText() | 74 | QString EntryDlg::getText() |
74 | { | 75 | { |
75 | return m_entry->text(); | 76 | return m_entry->text(); |