Changeset View
Changeset View
Standalone View
Standalone View
basictab.cpp
Show All 20 Lines | |||||
21 | #include "basictab.h" | 21 | #include "basictab.h" | ||
22 | 22 | | |||
23 | #include <QCheckBox> | 23 | #include <QCheckBox> | ||
24 | #include <QLabel> | 24 | #include <QLabel> | ||
25 | #include <QGroupBox> | 25 | #include <QGroupBox> | ||
26 | #include <QVBoxLayout> | 26 | #include <QVBoxLayout> | ||
27 | #include <QGridLayout> | 27 | #include <QGridLayout> | ||
28 | 28 | | |||
29 | #include <KConfigGroup> | ||||
29 | #include <KLocalizedString> | 30 | #include <KLocalizedString> | ||
30 | #include <KDialog> | | |||
31 | #include <KKeySequenceWidget> | 31 | #include <KKeySequenceWidget> | ||
32 | #include <KLineEdit> | 32 | #include <KLineEdit> | ||
33 | #include <KIconButton> | 33 | #include <KIconButton> | ||
34 | #include <KDesktopFile> | 34 | #include <KDesktopFile> | ||
35 | #include <KUrlRequester> | 35 | #include <KUrlRequester> | ||
36 | #include <KShell> | 36 | #include <KShell> | ||
37 | 37 | | |||
38 | #ifndef Q_OS_WIN | 38 | #ifndef Q_OS_WIN | ||
Show All 18 Lines | 56 | #endif | |||
57 | slotDisableAction(); | 57 | slotDisableAction(); | ||
58 | } | 58 | } | ||
59 | 59 | | |||
60 | void BasicTab::initGeneralTab() | 60 | void BasicTab::initGeneralTab() | ||
61 | { | 61 | { | ||
62 | // general tab | 62 | // general tab | ||
63 | QWidget *generalTab = new QWidget(); | 63 | QWidget *generalTab = new QWidget(); | ||
64 | QGridLayout *generalTabLayout = new QGridLayout(generalTab); | 64 | QGridLayout *generalTabLayout = new QGridLayout(generalTab); | ||
65 | generalTabLayout->setContentsMargins(KDialog::marginHint(), KDialog::marginHint(), KDialog::marginHint(), KDialog::marginHint()); | | |||
66 | generalTabLayout->setSpacing(KDialog::spacingHint()); | | |||
67 | generalTab->setAcceptDrops(false); | 65 | generalTab->setAcceptDrops(false); | ||
68 | 66 | | |||
69 | // name | 67 | // name | ||
70 | _nameLabel = new QLabel(i18n("&Name:")); | 68 | _nameLabel = new QLabel(i18n("&Name:")); | ||
71 | generalTabLayout->addWidget(_nameLabel, 0, 0); | 69 | generalTabLayout->addWidget(_nameLabel, 0, 0); | ||
72 | _nameEdit = new KLineEdit(); | 70 | _nameEdit = new KLineEdit(); | ||
73 | _nameEdit->setAcceptDrops(false); | 71 | _nameEdit->setAcceptDrops(false); | ||
74 | _nameLabel->setBuddy(_nameEdit); | 72 | _nameLabel->setBuddy(_nameEdit); | ||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | |||||
138 | { | 136 | { | ||
139 | // advanced tab | 137 | // advanced tab | ||
140 | QWidget *advancedTab = new QWidget(); | 138 | QWidget *advancedTab = new QWidget(); | ||
141 | QVBoxLayout *advancedTabLayout = new QVBoxLayout(advancedTab); | 139 | QVBoxLayout *advancedTabLayout = new QVBoxLayout(advancedTab); | ||
142 | 140 | | |||
143 | // work path | 141 | // work path | ||
144 | _workPathGroup = new QGroupBox(); | 142 | _workPathGroup = new QGroupBox(); | ||
145 | QHBoxLayout *workPathGroupLayout = new QHBoxLayout(_workPathGroup); | 143 | QHBoxLayout *workPathGroupLayout = new QHBoxLayout(_workPathGroup); | ||
146 | workPathGroupLayout->setSpacing(KDialog::spacingHint()); | | |||
147 | workPathGroupLayout->setContentsMargins(KDialog::marginHint(), KDialog::marginHint(), KDialog::marginHint(), KDialog::marginHint()); | | |||
148 | _pathLabel = new QLabel(i18n("&Work path:")); | 144 | _pathLabel = new QLabel(i18n("&Work path:")); | ||
149 | workPathGroupLayout->addWidget(_pathLabel); | 145 | workPathGroupLayout->addWidget(_pathLabel); | ||
150 | _pathEdit = new KUrlRequester(); | 146 | _pathEdit = new KUrlRequester(); | ||
151 | _pathEdit->setMode(KFile::Directory | KFile::LocalOnly); | 147 | _pathEdit->setMode(KFile::Directory | KFile::LocalOnly); | ||
152 | _pathEdit->lineEdit()->setAcceptDrops(false); | 148 | _pathEdit->lineEdit()->setAcceptDrops(false); | ||
153 | _pathLabel->setBuddy(_pathEdit); | 149 | _pathLabel->setBuddy(_pathEdit); | ||
154 | workPathGroupLayout->addWidget(_pathEdit); | 150 | workPathGroupLayout->addWidget(_pathEdit); | ||
155 | advancedTabLayout->addWidget(_workPathGroup); | 151 | advancedTabLayout->addWidget(_workPathGroup); | ||
156 | 152 | | |||
157 | // terminal CB | 153 | // terminal CB | ||
158 | _terminalGroup = new QGroupBox(); | 154 | _terminalGroup = new QGroupBox(); | ||
159 | QVBoxLayout *terminalGroupLayout = new QVBoxLayout(_terminalGroup); | 155 | QVBoxLayout *terminalGroupLayout = new QVBoxLayout(_terminalGroup); | ||
160 | terminalGroupLayout->setContentsMargins(KDialog::marginHint(), KDialog::marginHint(), KDialog::marginHint(), KDialog::marginHint()); | | |||
161 | terminalGroupLayout->setSpacing(KDialog::spacingHint()); | | |||
162 | _terminalCB = new QCheckBox(i18n("Run in term&inal")); | 156 | _terminalCB = new QCheckBox(i18n("Run in term&inal")); | ||
163 | terminalGroupLayout->addWidget(_terminalCB); | 157 | terminalGroupLayout->addWidget(_terminalCB); | ||
164 | // terminal options | 158 | // terminal options | ||
165 | QWidget *terminalOptionsGroup = new QWidget(); | 159 | QWidget *terminalOptionsGroup = new QWidget(); | ||
166 | QHBoxLayout *terminalOptionsGroupLayout = new QHBoxLayout(terminalOptionsGroup); | 160 | QHBoxLayout *terminalOptionsGroupLayout = new QHBoxLayout(terminalOptionsGroup); | ||
167 | terminalOptionsGroupLayout->setSpacing(KDialog::spacingHint()); | | |||
168 | _terminalOptionsLabel = new QLabel(i18n("Terminal &options:")); | 161 | _terminalOptionsLabel = new QLabel(i18n("Terminal &options:")); | ||
169 | terminalOptionsGroupLayout->addWidget(_terminalOptionsLabel); | 162 | terminalOptionsGroupLayout->addWidget(_terminalOptionsLabel); | ||
170 | _terminalOptionsEdit = new KLineEdit(); | 163 | _terminalOptionsEdit = new KLineEdit(); | ||
171 | _terminalOptionsEdit->setAcceptDrops(false); | 164 | _terminalOptionsEdit->setAcceptDrops(false); | ||
172 | _terminalOptionsEdit->setEnabled(false); | 165 | _terminalOptionsEdit->setEnabled(false); | ||
173 | _terminalOptionsLabel->setBuddy(_terminalOptionsEdit); | 166 | _terminalOptionsLabel->setBuddy(_terminalOptionsEdit); | ||
174 | terminalOptionsGroupLayout->addWidget(_terminalOptionsEdit); | 167 | terminalOptionsGroupLayout->addWidget(_terminalOptionsEdit); | ||
175 | terminalGroupLayout->addWidget(terminalOptionsGroup); | 168 | terminalGroupLayout->addWidget(terminalOptionsGroup); | ||
176 | advancedTabLayout->addWidget(_terminalGroup); | 169 | advancedTabLayout->addWidget(_terminalGroup); | ||
177 | 170 | | |||
178 | // user name CB | 171 | // user name CB | ||
179 | _userGroup = new QGroupBox(); | 172 | _userGroup = new QGroupBox(); | ||
180 | QVBoxLayout *userGroupLayout = new QVBoxLayout(_userGroup); | 173 | QVBoxLayout *userGroupLayout = new QVBoxLayout(_userGroup); | ||
181 | userGroupLayout->setContentsMargins(KDialog::marginHint(), KDialog::marginHint(), KDialog::marginHint(), KDialog::marginHint()); | | |||
182 | userGroupLayout->setSpacing(KDialog::spacingHint()); | | |||
183 | _userCB = new QCheckBox(i18n("&Run as a different user")); | 174 | _userCB = new QCheckBox(i18n("&Run as a different user")); | ||
184 | userGroupLayout->addWidget(_userCB); | 175 | userGroupLayout->addWidget(_userCB); | ||
185 | // user name | 176 | // user name | ||
186 | QWidget *userNameGroup = new QWidget(); | 177 | QWidget *userNameGroup = new QWidget(); | ||
187 | QHBoxLayout *userNameGroupLayout = new QHBoxLayout(userNameGroup); | 178 | QHBoxLayout *userNameGroupLayout = new QHBoxLayout(userNameGroup); | ||
188 | userNameGroupLayout->setSpacing(KDialog::spacingHint()); | | |||
189 | _userNameLabel = new QLabel(i18n("&Username:")); | 179 | _userNameLabel = new QLabel(i18n("&Username:")); | ||
190 | userNameGroupLayout->addWidget(_userNameLabel); | 180 | userNameGroupLayout->addWidget(_userNameLabel); | ||
191 | _userNameEdit = new KLineEdit(); | 181 | _userNameEdit = new KLineEdit(); | ||
192 | _userNameEdit->setAcceptDrops(false); | 182 | _userNameEdit->setAcceptDrops(false); | ||
193 | _userNameEdit->setEnabled(false); | 183 | _userNameEdit->setEnabled(false); | ||
194 | _userNameLabel->setBuddy(_userNameEdit); | 184 | _userNameLabel->setBuddy(_userNameEdit); | ||
195 | userNameGroupLayout->addWidget(_userNameEdit); | 185 | userNameGroupLayout->addWidget(_userNameEdit); | ||
196 | userGroupLayout->addWidget(userNameGroup); | 186 | userGroupLayout->addWidget(userNameGroup); | ||
197 | advancedTabLayout->addWidget(_userGroup); | 187 | advancedTabLayout->addWidget(_userGroup); | ||
198 | 188 | | |||
199 | // key binding | 189 | // key binding | ||
200 | _keyBindingGroup = new QGroupBox(); | 190 | _keyBindingGroup = new QGroupBox(); | ||
201 | QHBoxLayout *keyBindingGroupLayout = new QHBoxLayout(_keyBindingGroup); | 191 | QHBoxLayout *keyBindingGroupLayout = new QHBoxLayout(_keyBindingGroup); | ||
202 | keyBindingGroupLayout->setContentsMargins(KDialog::marginHint(), KDialog::marginHint(), KDialog::marginHint(), KDialog::marginHint()); | | |||
203 | keyBindingGroupLayout->setSpacing(KDialog::spacingHint()); | | |||
204 | _keyBindingLabel = new QLabel(i18n("Current shortcut &key:")); | 192 | _keyBindingLabel = new QLabel(i18n("Current shortcut &key:")); | ||
205 | keyBindingGroupLayout->addWidget(_keyBindingLabel); | 193 | keyBindingGroupLayout->addWidget(_keyBindingLabel); | ||
206 | _keyBindingEdit = new KKeySequenceWidget(); | 194 | _keyBindingEdit = new KKeySequenceWidget(); | ||
207 | _keyBindingEdit->setMultiKeyShortcutsAllowed(false); | 195 | _keyBindingEdit->setMultiKeyShortcutsAllowed(false); | ||
208 | _keyBindingLabel->setBuddy(_keyBindingEdit); | 196 | _keyBindingLabel->setBuddy(_keyBindingEdit); | ||
209 | keyBindingGroupLayout->addWidget(_keyBindingEdit); | 197 | keyBindingGroupLayout->addWidget(_keyBindingEdit); | ||
210 | advancedTabLayout->addWidget(_keyBindingGroup); | 198 | advancedTabLayout->addWidget(_keyBindingGroup); | ||
211 | 199 | | |||
▲ Show 20 Lines • Show All 317 Lines • Show Last 20 Lines |