Diffstat (limited to 'noncore/net/networksetup/namedialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/networksetup/namedialog.cpp | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/noncore/net/networksetup/namedialog.cpp b/noncore/net/networksetup/namedialog.cpp new file mode 100644 index 0000000..c5efa37 --- a/dev/null +++ b/noncore/net/networksetup/namedialog.cpp | |||
@@ -0,0 +1,61 @@ | |||
1 | /**************************************************************************** | ||
2 | ** Form implementation generated from reading ui file 'namedialog.ui' | ||
3 | ** | ||
4 | ** Created: Sat Dec 15 04:36:20 2001 | ||
5 | ** by: The User Interface Compiler (uic) | ||
6 | ** | ||
7 | ** WARNING! All changes made in this file will be lost! | ||
8 | ****************************************************************************/ | ||
9 | #include "namedialog.h" | ||
10 | |||
11 | #include <qlineedit.h> | ||
12 | #include <qpushbutton.h> | ||
13 | #include <qlayout.h> | ||
14 | #include <qvariant.h> | ||
15 | #include <qtooltip.h> | ||
16 | #include <qwhatsthis.h> | ||
17 | |||
18 | /* | ||
19 | * Constructs a NameDialog which is a child of 'parent', with the | ||
20 | * name 'name' and widget flags set to 'f' | ||
21 | * | ||
22 | * The dialog will by default be modeless, unless you set 'modal' to | ||
23 | * TRUE to construct a modal dialog. | ||
24 | */ | ||
25 | NameDialog::NameDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) | ||
26 | : QDialog( parent, name, modal, fl ) | ||
27 | { | ||
28 | if ( !name ) | ||
29 | setName( "NameDialog" ); | ||
30 | resize( 176, 65 ); | ||
31 | setCaption( tr( "Enter A Name" ) ); | ||
32 | NameDialogLayout = new QGridLayout( this ); | ||
33 | NameDialogLayout->setSpacing( 6 ); | ||
34 | NameDialogLayout->setMargin( 5 ); | ||
35 | |||
36 | Name = new QLineEdit( this, "Name" ); | ||
37 | |||
38 | NameDialogLayout->addMultiCellWidget( Name, 0, 0, 0, 1 ); | ||
39 | |||
40 | cancel = new QPushButton( this, "Cancel" ); | ||
41 | cancel->setText( tr( "&Cancel" ) ); | ||
42 | |||
43 | NameDialogLayout->addWidget( cancel, 1, 1 ); | ||
44 | |||
45 | ok = new QPushButton( this, "ok" ); | ||
46 | ok->setText( tr( "&Ok" ) ); | ||
47 | |||
48 | NameDialogLayout->addWidget( ok, 1, 0 ); | ||
49 | |||
50 | connect( ok, SIGNAL( clicked() ), this, SLOT( accept() ) ); | ||
51 | connect( cancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); | ||
52 | connect( Name, SIGNAL(returnPressed () ), this, SLOT(accept() ) ); | ||
53 | } | ||
54 | |||
55 | QString NameDialog::go(){ | ||
56 | if( exec() ) //pressed OK | ||
57 | return (Name->text()); | ||
58 | else //pressed cancel | ||
59 | return QString(); | ||
60 | } | ||
61 | |||