author | ulf69 <ulf69> | 2004-09-29 20:38:10 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-09-29 20:38:10 (UTC) |
commit | 21e794339f8988d9c370bebec45f60f2918fb671 (patch) (unidiff) | |
tree | 530ac79d2436b7b4588374cddbf95cd73ab5c1e2 | |
parent | 53c2eac6f60a37f9ac8fc10b86460eb9c7347b51 (diff) | |
download | kdepimpi-21e794339f8988d9c370bebec45f60f2918fb671.zip kdepimpi-21e794339f8988d9c370bebec45f60f2918fb671.tar.gz kdepimpi-21e794339f8988d9c370bebec45f60f2918fb671.tar.bz2 |
changed text slightly to accomodate 5500 Layout
-rw-r--r-- | pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp b/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp index 1fc7a94..8afea76 100644 --- a/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp +++ b/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp | |||
@@ -1,302 +1,302 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qcheckbox.h> | 24 | #include <qcheckbox.h> |
25 | #include <qframe.h> | 25 | #include <qframe.h> |
26 | #include <qgroupbox.h> | 26 | #include <qgroupbox.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qpushbutton.h> | 28 | #include <qpushbutton.h> |
29 | #include <qtabwidget.h> | 29 | #include <qtabwidget.h> |
30 | #include <qcombobox.h> | 30 | #include <qcombobox.h> |
31 | #include <qlineedit.h> | 31 | #include <qlineedit.h> |
32 | #include <qspinbox.h> | 32 | #include <qspinbox.h> |
33 | #include <qlabel.h> | 33 | #include <qlabel.h> |
34 | #include <qfile.h> | 34 | #include <qfile.h> |
35 | #include <qvbox.h> | 35 | #include <qvbox.h> |
36 | 36 | ||
37 | #include <kconfig.h> | 37 | #include <kconfig.h> |
38 | #include <kdebug.h> | 38 | #include <kdebug.h> |
39 | #include <kdialog.h> | 39 | #include <kdialog.h> |
40 | #include <klistview.h> | 40 | #include <klistview.h> |
41 | #include <klocale.h> | 41 | #include <klocale.h> |
42 | #include <kglobal.h> | 42 | #include <kglobal.h> |
43 | #include <kmessagebox.h> | 43 | #include <kmessagebox.h> |
44 | #include <kstandarddirs.h> | 44 | #include <kstandarddirs.h> |
45 | #include <kio/kfile/kurlrequester.h> | 45 | #include <kio/kfile/kurlrequester.h> |
46 | 46 | ||
47 | #include "pwmprefs.h" | 47 | #include "pwmprefs.h" |
48 | 48 | ||
49 | #include "pwmconfigwidget.h" | 49 | #include "pwmconfigwidget.h" |
50 | #include "pwmexception.h" | 50 | #include "pwmexception.h" |
51 | 51 | ||
52 | PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *name ) | 52 | PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *name ) |
53 | : KPrefsWidget(prefs, parent, name ) | 53 | : KPrefsWidget(prefs, parent, name ) |
54 | { | 54 | { |
55 | QVBoxLayout *topLayout = new QVBoxLayout( this, 0, | 55 | QVBoxLayout *topLayout = new QVBoxLayout( this, 0, |
56 | KDialog::spacingHint() ); | 56 | KDialog::spacingHint() ); |
57 | 57 | ||
58 | QTabWidget *tabWidget = new QTabWidget( this ); | 58 | QTabWidget *tabWidget = new QTabWidget( this ); |
59 | topLayout->addWidget( tabWidget ); | 59 | topLayout->addWidget( tabWidget ); |
60 | 60 | ||
61 | // windowsStyle page | 61 | // windowsStyle page |
62 | ////////////////////////////////////////////////////// | 62 | ////////////////////////////////////////////////////// |
63 | QWidget *windowStylePage = new QWidget( this ); | 63 | QWidget *windowStylePage = new QWidget( this ); |
64 | QGridLayout *windowStyleLayout = new QGridLayout( windowStylePage, 3, 3); | 64 | QGridLayout *windowStyleLayout = new QGridLayout( windowStylePage, 3, 3); |
65 | 65 | ||
66 | int i = 0; | 66 | int i = 0; |
67 | KPrefsWidRadios * windowStyle = addWidRadios(i18n("Window-style:") ,&(prefs->mMainViewStyle), windowStylePage); | 67 | KPrefsWidRadios * windowStyle = addWidRadios(i18n("Window-style:") ,&(prefs->mMainViewStyle), windowStylePage); |
68 | windowStyle->addRadio(i18n("Category on top")); | 68 | windowStyle->addRadio(i18n("Category on top")); |
69 | windowStyle->addRadio(i18n("Category-list left")); | 69 | windowStyle->addRadio(i18n("Category-list left/top")); |
70 | windowStyleLayout->addMultiCellWidget( (QWidget*)windowStyle->groupBox(),i,i,0,2); | 70 | windowStyleLayout->addMultiCellWidget( (QWidget*)windowStyle->groupBox(),i,i,0,2); |
71 | ++i; | 71 | ++i; |
72 | 72 | ||
73 | KPrefsWidFont *selEntrFont = | 73 | KPrefsWidFont *selEntrFont = |
74 | addWidFont(i18n("Password"),i18n("Font for Pw entries:"), | 74 | addWidFont(i18n("Password"),i18n("Font for Pw entries:"), |
75 | &(prefs->mEntryFont),windowStylePage); | 75 | &(prefs->mEntryFont),windowStylePage); |
76 | windowStyleLayout->addWidget(selEntrFont->label(),i,0); | 76 | windowStyleLayout->addWidget(selEntrFont->label(),i,0); |
77 | windowStyleLayout->addWidget(selEntrFont->preview(),i,1); | 77 | windowStyleLayout->addWidget(selEntrFont->preview(),i,1); |
78 | windowStyleLayout->addWidget(selEntrFont->button(),i,2); | 78 | windowStyleLayout->addWidget(selEntrFont->button(),i,2); |
79 | ++i; | 79 | ++i; |
80 | 80 | ||
81 | 81 | ||
82 | // File page | 82 | // File page |
83 | ////////////////////////////////////////////////////// | 83 | ////////////////////////////////////////////////////// |
84 | QWidget *filePage = new QWidget( this ); | 84 | QWidget *filePage = new QWidget( this ); |
85 | QGridLayout *fileLayout = new QGridLayout( filePage, 3, 2); | 85 | QGridLayout *fileLayout = new QGridLayout( filePage, 3, 2); |
86 | 86 | ||
87 | i = 0; | 87 | i = 0; |
88 | KPrefsWidRadios * compr = addWidRadios(i18n("Compression:") ,&(prefs->mCompression), filePage); | 88 | KPrefsWidRadios * compr = addWidRadios(i18n("Compression:") ,&(prefs->mCompression), filePage); |
89 | compr->addRadio(i18n("none")); | 89 | compr->addRadio(i18n("none")); |
90 | compr->addRadio(i18n("gzip")); | 90 | compr->addRadio(i18n("gzip")); |
91 | compr->addRadio(i18n("bzip2")); | 91 | compr->addRadio(i18n("bzip2")); |
92 | fileLayout->addMultiCellWidget( (QWidget*)compr->groupBox(),i,i,0,1); | 92 | fileLayout->addMultiCellWidget( (QWidget*)compr->groupBox(),i,i,0,1); |
93 | ++i; | 93 | ++i; |
94 | 94 | ||
95 | permissionLineEdit = new QLineEdit(filePage); | 95 | permissionLineEdit = new QLineEdit(filePage); |
96 | QLabel* permissionLineLabel = new QLabel(permissionLineEdit, i18n("Permissions:"), filePage); | 96 | QLabel* permissionLineLabel = new QLabel(permissionLineEdit, i18n("Permissions:"), filePage); |
97 | fileLayout->addWidget(permissionLineLabel,i,0); | 97 | fileLayout->addWidget(permissionLineLabel,i,0); |
98 | fileLayout->addWidget(permissionLineEdit,i,1); | 98 | fileLayout->addWidget(permissionLineEdit,i,1); |
99 | ++i; | 99 | ++i; |
100 | 100 | ||
101 | KPrefsWidBool *sb = addWidBool(i18n("Make backup before saving"), | 101 | KPrefsWidBool *sb = addWidBool(i18n("Make backup before saving"), |
102 | &(prefs->mMakeFileBackup),filePage); | 102 | &(prefs->mMakeFileBackup),filePage); |
103 | fileLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); | 103 | fileLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); |
104 | ++i; | 104 | ++i; |
105 | 105 | ||
106 | // Timeout page | 106 | // Timeout page |
107 | ////////////////////////////////////////////////////// | 107 | ////////////////////////////////////////////////////// |
108 | QWidget *timeoutPage = new QWidget( this ); | 108 | QWidget *timeoutPage = new QWidget( this ); |
109 | QGridLayout *timeoutLayout = new QGridLayout( timeoutPage, 3, 2); | 109 | QGridLayout *timeoutLayout = new QGridLayout( timeoutPage, 3, 2); |
110 | 110 | ||
111 | i = 0; | 111 | i = 0; |
112 | pwTimeoutSpinBox = new QSpinBox( timeoutPage, "pwTimeoutSpinBox" ); | 112 | pwTimeoutSpinBox = new QSpinBox( timeoutPage, "pwTimeoutSpinBox" ); |
113 | QLabel* timeoutLabel = new QLabel(pwTimeoutSpinBox, i18n("Password timeout\n(timeout to hold password in\nmemory,so you don't have to\nre-enter it,if you\nalready have entered it)\n[set to 0 to disable]:"), timeoutPage); | 113 | QLabel* timeoutLabel = new QLabel(pwTimeoutSpinBox, i18n("Password timeout\n(timeout to hold password in\nmemory,so you don't have to\nre-enter it,if you\nalready have entered it)\n[set to 0 to disable]:"), timeoutPage); |
114 | timeoutLayout->addMultiCellWidget(timeoutLabel,i, i, 0 ,0); | 114 | timeoutLayout->addMultiCellWidget(timeoutLabel,i, i, 0 ,0); |
115 | timeoutLayout->addWidget(pwTimeoutSpinBox,i,1); | 115 | timeoutLayout->addWidget(pwTimeoutSpinBox,i,1); |
116 | ++i; | 116 | ++i; |
117 | 117 | ||
118 | lockTimeoutSpinBox = new QSpinBox( timeoutPage, "lockTimeoutSpinBox" ); | 118 | lockTimeoutSpinBox = new QSpinBox( timeoutPage, "lockTimeoutSpinBox" ); |
119 | QLabel* lockTimeoutLabel = new QLabel(lockTimeoutSpinBox, i18n("Auto-lock timeout\n(auto lock document after this\namount of seconds)\n[set to 0 to disable]:"), timeoutPage); | 119 | QLabel* lockTimeoutLabel = new QLabel(lockTimeoutSpinBox, i18n("Auto-lock timeout\n(auto lock document after this\namount of seconds)\n[set to 0 to disable]:"), timeoutPage); |
120 | timeoutLayout->addMultiCellWidget(lockTimeoutLabel,i, i, 0 ,0); | 120 | timeoutLayout->addMultiCellWidget(lockTimeoutLabel,i, i, 0 ,0); |
121 | timeoutLayout->addWidget(lockTimeoutSpinBox,i,1); | 121 | timeoutLayout->addWidget(lockTimeoutSpinBox,i,1); |
122 | ++i; | 122 | ++i; |
123 | 123 | ||
124 | sb = addWidBool(i18n("deep-lock on autolock"), | 124 | sb = addWidBool(i18n("deep-lock on autolock"), |
125 | &(prefs->mAutoDeeplock),timeoutPage); | 125 | &(prefs->mAutoDeeplock),timeoutPage); |
126 | timeoutLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); | 126 | timeoutLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); |
127 | ++i; | 127 | ++i; |
128 | 128 | ||
129 | 129 | ||
130 | // Autostart page | 130 | // Autostart page |
131 | ////////////////////////////////////////////////////// | 131 | ////////////////////////////////////////////////////// |
132 | QWidget *autostartPage = new QWidget( this ); | 132 | QWidget *autostartPage = new QWidget( this ); |
133 | QGridLayout *autostartLayout = new QGridLayout( autostartPage, 3, 2); | 133 | QGridLayout *autostartLayout = new QGridLayout( autostartPage, 3, 2); |
134 | 134 | ||
135 | i = 0; | 135 | i = 0; |
136 | 136 | ||
137 | autostartLineEdit = new KURLRequester(autostartPage, "autoStartLineEdit"); | 137 | autostartLineEdit = new KURLRequester(autostartPage, "autoStartLineEdit"); |
138 | QLabel* autostartLineLabel = new QLabel(autostartLineEdit, "Open this file automatically on startup:",autostartPage); | 138 | QLabel* autostartLineLabel = new QLabel(autostartLineEdit, "Open this file automatically on startup:",autostartPage); |
139 | autostartLayout->addMultiCellWidget(autostartLineLabel,i,i,0,1); | 139 | autostartLayout->addMultiCellWidget(autostartLineLabel,i,i,0,1); |
140 | ++i; | 140 | ++i; |
141 | autostartLayout->addMultiCellWidget(autostartLineEdit,i,i,0,1); | 141 | autostartLayout->addMultiCellWidget(autostartLineEdit,i,i,0,1); |
142 | ++i; | 142 | ++i; |
143 | 143 | ||
144 | sb = addWidBool(i18n("open deeplocked"), | 144 | sb = addWidBool(i18n("open deeplocked"), |
145 | &(prefs->mAutostartDeeplocked),autostartPage); | 145 | &(prefs->mAutostartDeeplocked),autostartPage); |
146 | autostartLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); | 146 | autostartLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); |
147 | ++i; | 147 | ++i; |
148 | 148 | ||
149 | 149 | ||
150 | // external app page | 150 | // external app page |
151 | ////////////////////////////////////////////////////// | 151 | ////////////////////////////////////////////////////// |
152 | QWidget *externalappPage = new QWidget( this ); | 152 | QWidget *externalappPage = new QWidget( this ); |
153 | QGridLayout *externalappLayout = new QGridLayout( externalappPage, 3, 2); | 153 | QGridLayout *externalappLayout = new QGridLayout( externalappPage, 3, 2); |
154 | 154 | ||
155 | i = 0; | 155 | i = 0; |
156 | 156 | ||
157 | browserLineEdit = new QLineEdit(externalappPage); | 157 | browserLineEdit = new QLineEdit(externalappPage); |
158 | QLabel* browserLineLabel = new QLabel(browserLineEdit, i18n("Favourite browser:"), externalappPage); | 158 | QLabel* browserLineLabel = new QLabel(browserLineEdit, i18n("Favourite browser:"), externalappPage); |
159 | externalappLayout->addWidget(browserLineLabel,i,0); | 159 | externalappLayout->addWidget(browserLineLabel,i,0); |
160 | externalappLayout->addWidget(browserLineEdit,i,1); | 160 | externalappLayout->addWidget(browserLineEdit,i,1); |
161 | ++i; | 161 | ++i; |
162 | 162 | ||
163 | xtermLineEdit = new QLineEdit(externalappPage); | 163 | xtermLineEdit = new QLineEdit(externalappPage); |
164 | QLabel* xtermLineLabel = new QLabel(xtermLineEdit, i18n("Favourite x-terminal:"), externalappPage); | 164 | QLabel* xtermLineLabel = new QLabel(xtermLineEdit, i18n("Favourite x-terminal:"), externalappPage); |
165 | externalappLayout->addWidget(xtermLineLabel,i,0); | 165 | externalappLayout->addWidget(xtermLineLabel,i,0); |
166 | externalappLayout->addWidget(xtermLineEdit,i,1); | 166 | externalappLayout->addWidget(xtermLineEdit,i,1); |
167 | ++i; | 167 | ++i; |
168 | 168 | ||
169 | 169 | ||
170 | // miscelaneous page | 170 | // miscelaneous page |
171 | ////////////////////////////////////////////////////// | 171 | ////////////////////////////////////////////////////// |
172 | QWidget *miscPage = new QWidget( this ); | 172 | QWidget *miscPage = new QWidget( this ); |
173 | QGridLayout *miscLayout = new QGridLayout( miscPage, 3, 2); | 173 | QGridLayout *miscLayout = new QGridLayout( miscPage, 3, 2); |
174 | 174 | ||
175 | i = 0; | 175 | i = 0; |
176 | 176 | ||
177 | sb = addWidBool(i18n("Show icon in system-tray"),&(prefs->mTray),miscPage); | 177 | sb = addWidBool(i18n("Show icon in system-tray"),&(prefs->mTray),miscPage); |
178 | miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); | 178 | miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); |
179 | ++i; | 179 | ++i; |
180 | 180 | ||
181 | 181 | ||
182 | sb = addWidBool(i18n("Open document with passwords unlocked"),&(prefs->mUnlockOnOpen),miscPage); | 182 | sb = addWidBool(i18n("Open document with passwords unlocked"),&(prefs->mUnlockOnOpen),miscPage); |
183 | miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); | 183 | miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); |
184 | ++i; | 184 | ++i; |
185 | 185 | ||
186 | sb = addWidBool(i18n("auto-minimize to tray on startup"),&(prefs->mAutoMinimizeOnStart),miscPage); | 186 | sb = addWidBool(i18n("auto-minimize to tray on startup"),&(prefs->mAutoMinimizeOnStart),miscPage); |
187 | miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); | 187 | miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); |
188 | sb->checkBox()->setEnabled (FALSE); | 188 | sb->checkBox()->setEnabled (FALSE); |
189 | ++i; | 189 | ++i; |
190 | 190 | ||
191 | KPrefsWidRadios * minimizeRadio = addWidRadios(i18n("auto-lock on minimize:") ,&(prefs->mMinimizeLock), miscPage); | 191 | KPrefsWidRadios * minimizeRadio = addWidRadios(i18n("auto-lock on minimize:") ,&(prefs->mMinimizeLock), miscPage); |
192 | minimizeRadio->addRadio(i18n("don't lock")); | 192 | minimizeRadio->addRadio(i18n("don't lock")); |
193 | minimizeRadio->addRadio(i18n("normal lock")); | 193 | minimizeRadio->addRadio(i18n("normal lock")); |
194 | minimizeRadio->addRadio(i18n("deep-lock")); | 194 | minimizeRadio->addRadio(i18n("deep-lock")); |
195 | miscLayout->addMultiCellWidget( (QWidget*)minimizeRadio->groupBox(),i,i,0,2); | 195 | miscLayout->addMultiCellWidget( (QWidget*)minimizeRadio->groupBox(),i,i,0,2); |
196 | ++i; | 196 | ++i; |
197 | 197 | ||
198 | sb = addWidBool(i18n("KWallet emulation"),&(prefs->mKWalletEmu),miscPage); | 198 | sb = addWidBool(i18n("KWallet emulation"),&(prefs->mKWalletEmu),miscPage); |
199 | miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); | 199 | miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); |
200 | ++i; | 200 | ++i; |
201 | 201 | ||
202 | sb = addWidBool(i18n("Close instead Minimize into tray"),&(prefs->mClose),miscPage); | 202 | sb = addWidBool(i18n("Close instead Minimize into tray"),&(prefs->mClose),miscPage); |
203 | miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); | 203 | miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); |
204 | ++i; | 204 | ++i; |
205 | 205 | ||
206 | 206 | ||
207 | 207 | ||
208 | tabWidget->addTab( windowStylePage, i18n( "Look && feel" ) ); | 208 | tabWidget->addTab( windowStylePage, i18n( "Look && feel" ) ); |
209 | tabWidget->addTab( filePage, i18n( "File" ) ); | 209 | tabWidget->addTab( filePage, i18n( "File" ) ); |
210 | tabWidget->addTab( timeoutPage, i18n( "Timeout" ) ); | 210 | tabWidget->addTab( timeoutPage, i18n( "Timeout" ) ); |
211 | tabWidget->addTab( autostartPage, i18n( "Autostart" ) ); | 211 | tabWidget->addTab( autostartPage, i18n( "Autostart" ) ); |
212 | tabWidget->addTab( externalappPage, i18n( "External apps" ) ); | 212 | tabWidget->addTab( externalappPage, i18n( "External apps" ) ); |
213 | tabWidget->addTab( miscPage, i18n( "Miscellaneous" ) ); | 213 | tabWidget->addTab( miscPage, i18n( "Miscellaneous" ) ); |
214 | 214 | ||
215 | 215 | ||
216 | connect( permissionLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) ); | 216 | connect( permissionLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) ); |
217 | connect( pwTimeoutSpinBox, SIGNAL( valueChanged(int) ), this, SLOT( modified() ) ); | 217 | connect( pwTimeoutSpinBox, SIGNAL( valueChanged(int) ), this, SLOT( modified() ) ); |
218 | connect( lockTimeoutSpinBox, SIGNAL( valueChanged(int) ), this, SLOT( modified() ) ); | 218 | connect( lockTimeoutSpinBox, SIGNAL( valueChanged(int) ), this, SLOT( modified() ) ); |
219 | connect( autostartLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) ); | 219 | connect( autostartLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) ); |
220 | connect( browserLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) ); | 220 | connect( browserLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) ); |
221 | connect( xtermLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) ); | 221 | connect( xtermLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) ); |
222 | 222 | ||
223 | } | 223 | } |
224 | 224 | ||
225 | 225 | ||
226 | void PWMConfigWidget::usrReadConfig() | 226 | void PWMConfigWidget::usrReadConfig() |
227 | { | 227 | { |
228 | PWMPrefs* prefs = PWMPrefs::instance(); | 228 | PWMPrefs* prefs = PWMPrefs::instance(); |
229 | 229 | ||
230 | setFilePermissions(prefs->mFilePermissions); | 230 | setFilePermissions(prefs->mFilePermissions); |
231 | 231 | ||
232 | pwTimeoutSpinBox->setValue(prefs->mPwTimeout); | 232 | pwTimeoutSpinBox->setValue(prefs->mPwTimeout); |
233 | lockTimeoutSpinBox->setValue(prefs->mLockTimeout); | 233 | lockTimeoutSpinBox->setValue(prefs->mLockTimeout); |
234 | autostartLineEdit->setURL(prefs->mAutoStart); | 234 | autostartLineEdit->setURL(prefs->mAutoStart); |
235 | browserLineEdit->setText(prefs->mBrowserCommand); | 235 | browserLineEdit->setText(prefs->mBrowserCommand); |
236 | xtermLineEdit->setText(prefs->mXTermCommand); | 236 | xtermLineEdit->setText(prefs->mXTermCommand); |
237 | 237 | ||
238 | } | 238 | } |
239 | 239 | ||
240 | void PWMConfigWidget::usrWriteConfig() | 240 | void PWMConfigWidget::usrWriteConfig() |
241 | { | 241 | { |
242 | PWMPrefs* prefs = PWMPrefs::instance(); | 242 | PWMPrefs* prefs = PWMPrefs::instance(); |
243 | 243 | ||
244 | prefs->mFilePermissions = getFilePermissions(); | 244 | prefs->mFilePermissions = getFilePermissions(); |
245 | 245 | ||
246 | prefs->mPwTimeout = pwTimeoutSpinBox->value(); | 246 | prefs->mPwTimeout = pwTimeoutSpinBox->value(); |
247 | prefs->mLockTimeout = lockTimeoutSpinBox->value(); | 247 | prefs->mLockTimeout = lockTimeoutSpinBox->value(); |
248 | prefs->mAutoStart = autostartLineEdit->url(); | 248 | prefs->mAutoStart = autostartLineEdit->url(); |
249 | 249 | ||
250 | prefs->mBrowserCommand = browserLineEdit->text(); | 250 | prefs->mBrowserCommand = browserLineEdit->text(); |
251 | prefs->mXTermCommand = xtermLineEdit->text(); | 251 | prefs->mXTermCommand = xtermLineEdit->text(); |
252 | } | 252 | } |
253 | 253 | ||
254 | int PWMConfigWidget::getFilePermissions() | 254 | int PWMConfigWidget::getFilePermissions() |
255 | { | 255 | { |
256 | char octalDigits[] = "01234567"; | 256 | char octalDigits[] = "01234567"; |
257 | bool isOctal; | 257 | bool isOctal; |
258 | QString permString(permissionLineEdit->text()); | 258 | QString permString(permissionLineEdit->text()); |
259 | int i, j, length = permString.length(); | 259 | int i, j, length = permString.length(); |
260 | if (length != 3) { | 260 | if (length != 3) { |
261 | printWarn("Wrong permission string length! Please enter " | 261 | printWarn("Wrong permission string length! Please enter " |
262 | "the string like the following example: 600"); | 262 | "the string like the following example: 600"); |
263 | return CONF_DEFAULT_FILEPERMISSIONS; | 263 | return CONF_DEFAULT_FILEPERMISSIONS; |
264 | } | 264 | } |
265 | for (i = 0; i < length; ++i) { | 265 | for (i = 0; i < length; ++i) { |
266 | isOctal = false; | 266 | isOctal = false; |
267 | for (j = 0; j < 8; ++j) { | 267 | for (j = 0; j < 8; ++j) { |
268 | if (permString.at(i) == octalDigits[j]) { | 268 | if (permString.at(i) == octalDigits[j]) { |
269 | isOctal = true; | 269 | isOctal = true; |
270 | break; | 270 | break; |
271 | } | 271 | } |
272 | } | 272 | } |
273 | if (!isOctal) { | 273 | if (!isOctal) { |
274 | printWarn("CONFIG: File-permissions: This is " | 274 | printWarn("CONFIG: File-permissions: This is " |
275 | "not an octal number "); | 275 | "not an octal number "); |
276 | return CONF_DEFAULT_FILEPERMISSIONS; | 276 | return CONF_DEFAULT_FILEPERMISSIONS; |
277 | } | 277 | } |
278 | } | 278 | } |
279 | 279 | ||
280 | int ret = strtol(permString.latin1(), 0, 8); | 280 | int ret = strtol(permString.latin1(), 0, 8); |
281 | if (ret == 0) { | 281 | if (ret == 0) { |
282 | /* either an error occured, or the user did really type 000 */ | 282 | /* either an error occured, or the user did really type 000 */ |
283 | printWarn("CONFIG: File-permissions: Hm, either conversion error, " | 283 | printWarn("CONFIG: File-permissions: Hm, either conversion error, " |
284 | "or you really typed 000. 8-)"); | 284 | "or you really typed 000. 8-)"); |
285 | return CONF_DEFAULT_FILEPERMISSIONS; | 285 | return CONF_DEFAULT_FILEPERMISSIONS; |
286 | } | 286 | } |
287 | return ret; | 287 | return ret; |
288 | } | 288 | } |
289 | 289 | ||
290 | void PWMConfigWidget::setFilePermissions(int perm) | 290 | void PWMConfigWidget::setFilePermissions(int perm) |
291 | { | 291 | { |
292 | char tmpBuf[30]; | 292 | char tmpBuf[30]; |
293 | sprintf(tmpBuf, "%o", perm); | 293 | sprintf(tmpBuf, "%o", perm); |
294 | permissionLineEdit->setText(tmpBuf); | 294 | permissionLineEdit->setText(tmpBuf); |
295 | } | 295 | } |
296 | 296 | ||
297 | 297 | ||
298 | 298 | ||
299 | #ifndef PWM_EMBEDDED | 299 | #ifndef PWM_EMBEDDED |
300 | #include "pwmconfigwidget.moc" | 300 | #include "pwmconfigwidget.moc" |
301 | #endif //PWM_EMBEDDED | 301 | #endif //PWM_EMBEDDED |
302 | 302 | ||