Diffstat (limited to 'noncore/unsupported/mailit/editaccount.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/unsupported/mailit/editaccount.cpp | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/noncore/unsupported/mailit/editaccount.cpp b/noncore/unsupported/mailit/editaccount.cpp new file mode 100644 index 0000000..c4f95ea --- a/dev/null +++ b/noncore/unsupported/mailit/editaccount.cpp | |||
@@ -0,0 +1,120 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2001 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qt Palmtop Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | *** | ||
19 | **********************************************************************/ | ||
20 | |||
21 | #include "editaccount.h" | ||
22 | |||
23 | EditAccount::EditAccount( QWidget* parent, const char* name, WFlags fl ) | ||
24 | : QDialog(parent, name, fl) | ||
25 | { | ||
26 | setCaption( tr("Edit Account") ); | ||
27 | init(); | ||
28 | popPasswInput->setEchoMode(QLineEdit::Password); | ||
29 | } | ||
30 | |||
31 | void EditAccount::setAccount(MailAccount *in, bool newOne) | ||
32 | { | ||
33 | account = in; | ||
34 | if (newOne) { | ||
35 | accountNameInput->setText(""); | ||
36 | nameInput->setText(""); | ||
37 | emailInput->setText(""); | ||
38 | popUserInput->setText(""); | ||
39 | popPasswInput->setText(""); | ||
40 | popServerInput->setText(""); | ||
41 | smtpServerInput->setText(""); | ||
42 | syncCheckBox->setChecked(TRUE); | ||
43 | |||
44 | setCaption( tr("Create new Account") ); | ||
45 | } else { | ||
46 | accountNameInput->setText(account->accountName); | ||
47 | nameInput->setText(account->name); | ||
48 | emailInput->setText(account->emailAddress); | ||
49 | popUserInput->setText(account->popUserName); | ||
50 | popPasswInput->setText(account->popPasswd); | ||
51 | popServerInput->setText(account->popServer); | ||
52 | smtpServerInput->setText(account->smtpServer); | ||
53 | syncCheckBox->setChecked(account->synchronize); | ||
54 | } | ||
55 | } | ||
56 | |||
57 | void EditAccount::init() | ||
58 | { | ||
59 | grid = new QGridLayout(this); | ||
60 | grid->setSpacing( 6 ); | ||
61 | grid->setMargin( 11 ); | ||
62 | |||
63 | accountNameInputLabel = new QLabel(tr("Account name"), this); | ||
64 | grid->addWidget( accountNameInputLabel, 0, 0 ); | ||
65 | accountNameInput = new QLineEdit( this, "account nameInput" ); | ||
66 | grid->addWidget( accountNameInput, 0, 1 ); | ||
67 | |||
68 | nameInputLabel = new QLabel(tr("Your name"), this); | ||
69 | grid->addWidget( nameInputLabel, 1, 0 ); | ||
70 | nameInput = new QLineEdit( this, "nameInput" ); | ||
71 | grid->addWidget( nameInput, 1, 1 ); | ||
72 | |||
73 | emailInputLabel = new QLabel("Email", this); | ||
74 | grid->addWidget(emailInputLabel, 2, 0 ); | ||
75 | emailInput = new QLineEdit( this, "emailInput" ); | ||
76 | grid->addWidget( emailInput, 2, 1 ); | ||
77 | |||
78 | popUserInputLabel = new QLabel("POP username", this); | ||
79 | grid->addWidget( popUserInputLabel, 3, 0 ); | ||
80 | popUserInput = new QLineEdit( this, "popUserInput" ); | ||
81 | grid->addWidget( popUserInput, 3, 1 ); | ||
82 | |||
83 | popPasswInputLabel = new QLabel( "POP password", this); | ||
84 | grid->addWidget( popPasswInputLabel, 4, 0 ); | ||
85 | popPasswInput = new QLineEdit( this, "popPasswInput" ); | ||
86 | grid->addWidget( popPasswInput, 4, 1 ); | ||
87 | |||
88 | popServerInputLabel = new QLabel("POP server", this); | ||
89 | grid->addWidget( popServerInputLabel, 5, 0 ); | ||
90 | popServerInput = new QLineEdit( this, "popServerInput" ); | ||
91 | grid->addWidget( popServerInput, 5, 1 ); | ||
92 | |||
93 | smtpServerInputLabel = new QLabel("SMTP server", this ); | ||
94 | grid->addWidget( smtpServerInputLabel, 6, 0 ); | ||
95 | smtpServerInput = new QLineEdit( this, "smtpServerInput" ); | ||
96 | grid->addWidget( smtpServerInput, 6, 1 ); | ||
97 | |||
98 | syncCheckBox = new QCheckBox( tr( "Synchronize with server" ), this); | ||
99 | syncCheckBox->setChecked( TRUE ); | ||
100 | grid->addMultiCellWidget( syncCheckBox, 7, 7, 0, 1 ); | ||
101 | } | ||
102 | |||
103 | |||
104 | void EditAccount::accept() | ||
105 | { | ||
106 | account->accountName = accountNameInput->text(); | ||
107 | account->name = nameInput->text(); | ||
108 | account->emailAddress = emailInput->text(); | ||
109 | account->popUserName = popUserInput->text(); | ||
110 | account->popPasswd = popPasswInput->text(); | ||
111 | account->popServer = popServerInput->text(); | ||
112 | account->smtpServer = smtpServerInput->text(); | ||
113 | account->synchronize = syncCheckBox->isChecked(); | ||
114 | |||
115 | QDialog::accept(); | ||
116 | } | ||
117 | |||
118 | void EditAccount::reject() | ||
119 | { | ||
120 | } | ||