Changeset View
Changeset View
Standalone View
Standalone View
krusader/ActionMan/addplaceholderpopup.cpp
Show First 20 Lines • Show All 102 Lines • ▼ Show 20 Line(s) | 56 | { | |||
---|---|---|---|---|---|
103 | } | 103 | } | ||
104 | 104 | | |||
105 | } | 105 | } | ||
106 | 106 | | |||
107 | 107 | | |||
108 | QString AddPlaceholderPopup::getPlaceholder(const QPoint& pos) | 108 | QString AddPlaceholderPopup::getPlaceholder(const QPoint& pos) | ||
109 | { | 109 | { | ||
110 | QAction *res = exec(pos); | 110 | QAction *res = exec(pos); | ||
111 | if (res == 0) | 111 | if (res == nullptr) | ||
112 | return QString(); | 112 | return QString(); | ||
113 | 113 | | |||
114 | // add the selected flag to the command line | 114 | // add the selected flag to the command line | ||
115 | if (res->data().toInt() == EXECUTABLE_ID) { // did the user need an executable ? | 115 | if (res->data().toInt() == EXECUTABLE_ID) { // did the user need an executable ? | ||
116 | // select an executable | 116 | // select an executable | ||
117 | QString filename = QFileDialog::getOpenFileName(this); | 117 | QString filename = QFileDialog::getOpenFileName(this); | ||
118 | if (!filename.isEmpty()) { | 118 | if (!filename.isEmpty()) { | ||
119 | return filename + ' '; // with extra space | 119 | return filename + ' '; // with extra space | ||
120 | // return filename; // without extra space | 120 | // return filename; // without extra space | ||
121 | } | 121 | } | ||
122 | } else { // user selected something from the menus | 122 | } else { // user selected something from the menus | ||
123 | Expander expander; | 123 | Expander expander; | ||
124 | const exp_placeholder* currentPlaceholder = expander.placeholder(res->data().toInt() & ~(ACTIVE_MASK | OTHER_MASK | LEFT_MASK | RIGHT_MASK | INDEPENDENT_MASK)); | 124 | const exp_placeholder* currentPlaceholder = expander.placeholder(res->data().toInt() & ~(ACTIVE_MASK | OTHER_MASK | LEFT_MASK | RIGHT_MASK | INDEPENDENT_MASK)); | ||
125 | // if ( ¤tPlaceholder->expFunc == 0 ) { | 125 | // if ( ¤tPlaceholder->expFunc == 0 ) { | ||
126 | // KMessageBox::sorry( this, "BOFH Excuse #93:\nFeature not yet implemented" ); | 126 | // KMessageBox::sorry( this, "BOFH Excuse #93:\nFeature not yet implemented" ); | ||
127 | // return QString(); | 127 | // return QString(); | ||
128 | // } | 128 | // } | ||
129 | ParameterDialog* parameterDialog = new ParameterDialog(currentPlaceholder, this); | 129 | auto* parameterDialog = new ParameterDialog(currentPlaceholder, this); | ||
130 | QString panel, parameter = parameterDialog->getParameter(); | 130 | QString panel, parameter = parameterDialog->getParameter(); | ||
131 | delete parameterDialog; | 131 | delete parameterDialog; | ||
132 | // indicate the panel with 'a' 'o', 'l', 'r' or '_'. | 132 | // indicate the panel with 'a' 'o', 'l', 'r' or '_'. | ||
133 | if (res->data().toInt() & ACTIVE_MASK) | 133 | if (res->data().toInt() & ACTIVE_MASK) | ||
134 | panel = 'a'; | 134 | panel = 'a'; | ||
135 | else if (res->data().toInt() & OTHER_MASK) | 135 | else if (res->data().toInt() & OTHER_MASK) | ||
136 | panel = 'o'; | 136 | panel = 'o'; | ||
137 | else if (res->data().toInt() & LEFT_MASK) | 137 | else if (res->data().toInt() & LEFT_MASK) | ||
Show All 11 Lines | |||||
149 | 149 | | |||
150 | //////////////////////////////////////////////////////////////////////////////////////////// | 150 | //////////////////////////////////////////////////////////////////////////////////////////// | ||
151 | /////////////////////////////// ParameterDialog //////////////////////////////////// | 151 | /////////////////////////////// ParameterDialog //////////////////////////////////// | ||
152 | //////////////////////////////////////////////////////////////////////////////////////////// | 152 | //////////////////////////////////////////////////////////////////////////////////////////// | ||
153 | 153 | | |||
154 | ParameterDialog::ParameterDialog(const exp_placeholder* currentPlaceholder, QWidget *parent) : QDialog(parent) | 154 | ParameterDialog::ParameterDialog(const exp_placeholder* currentPlaceholder, QWidget *parent) : QDialog(parent) | ||
155 | { | 155 | { | ||
156 | setWindowTitle(i18n("User Action Parameter Dialog")); | 156 | setWindowTitle(i18n("User Action Parameter Dialog")); | ||
157 | QVBoxLayout *mainLayout = new QVBoxLayout; | 157 | auto *mainLayout = new QVBoxLayout; | ||
158 | setLayout(mainLayout); | 158 | setLayout(mainLayout); | ||
159 | 159 | | |||
160 | _parameter.clear(); | 160 | _parameter.clear(); | ||
161 | _parameterCount = currentPlaceholder->parameterCount(); | 161 | _parameterCount = currentPlaceholder->parameterCount(); | ||
162 | 162 | | |||
163 | QWidget *page = new QWidget(this); | 163 | QWidget *page = new QWidget(this); | ||
164 | mainLayout->addWidget(page); | 164 | mainLayout->addWidget(page); | ||
165 | QVBoxLayout* layout = new QVBoxLayout(page); | 165 | auto* layout = new QVBoxLayout(page); | ||
166 | layout->setSpacing(11); | 166 | layout->setSpacing(11); | ||
167 | layout->setContentsMargins(0, 0, 0, 0); | 167 | layout->setContentsMargins(0, 0, 0, 0); | ||
168 | 168 | | |||
169 | layout->addWidget(new QLabel(i18n("This placeholder allows some parameter:"), page)); | 169 | layout->addWidget(new QLabel(i18n("This placeholder allows some parameter:"), page)); | ||
170 | 170 | | |||
171 | for (int i = 0; i < _parameterCount; ++i) { | 171 | for (int i = 0; i < _parameterCount; ++i) { | ||
172 | if (currentPlaceholder->parameter(i).preset() == "__placeholder") | 172 | if (currentPlaceholder->parameter(i).preset() == "__placeholder") | ||
173 | _parameter.append(new ParameterPlaceholder(currentPlaceholder->parameter(i), page)); | 173 | _parameter.append(new ParameterPlaceholder(currentPlaceholder->parameter(i), page)); | ||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | 250 | { | |||
256 | 256 | | |||
257 | if (valid) | 257 | if (valid) | ||
258 | accept(); | 258 | accept(); | ||
259 | } | 259 | } | ||
260 | 260 | | |||
261 | ///////////// ParameterText | 261 | ///////////// ParameterText | ||
262 | ParameterText::ParameterText(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | 262 | ParameterText::ParameterText(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | ||
263 | { | 263 | { | ||
264 | QVBoxLayout* layout = new QVBoxLayout(this); | 264 | auto* layout = new QVBoxLayout(this); | ||
265 | layout->setSpacing(6); | 265 | layout->setSpacing(6); | ||
266 | layout->setContentsMargins(0, 0, 0, 0); | 266 | layout->setContentsMargins(0, 0, 0, 0); | ||
267 | 267 | | |||
268 | layout->addWidget(new QLabel(i18n(parameter.description().toUtf8()), this)); | 268 | layout->addWidget(new QLabel(i18n(parameter.description().toUtf8()), this)); | ||
269 | layout->addWidget(_lineEdit = new KLineEdit(parameter.preset(), this)); | 269 | layout->addWidget(_lineEdit = new KLineEdit(parameter.preset(), this)); | ||
270 | _preset = parameter.preset(); | 270 | _preset = parameter.preset(); | ||
271 | } | 271 | } | ||
272 | 272 | | |||
Show All 15 Lines | 287 | if (_lineEdit->text().isEmpty()) | |||
288 | return false; | 288 | return false; | ||
289 | else | 289 | else | ||
290 | return true; | 290 | return true; | ||
291 | } | 291 | } | ||
292 | 292 | | |||
293 | ///////////// ParameterPlaceholder | 293 | ///////////// ParameterPlaceholder | ||
294 | ParameterPlaceholder::ParameterPlaceholder(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | 294 | ParameterPlaceholder::ParameterPlaceholder(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | ||
295 | { | 295 | { | ||
296 | QVBoxLayout* layout = new QVBoxLayout(this); | 296 | auto* layout = new QVBoxLayout(this); | ||
297 | layout->setSpacing(6); | 297 | layout->setSpacing(6); | ||
298 | layout->setContentsMargins(0, 0, 0, 0); | 298 | layout->setContentsMargins(0, 0, 0, 0); | ||
299 | 299 | | |||
300 | layout->addWidget(new QLabel(i18n(parameter.description().toUtf8()), this)); | 300 | layout->addWidget(new QLabel(i18n(parameter.description().toUtf8()), this)); | ||
301 | QWidget * hboxWidget = new QWidget(this); | 301 | QWidget * hboxWidget = new QWidget(this); | ||
302 | layout->addWidget(hboxWidget); | 302 | layout->addWidget(hboxWidget); | ||
303 | QHBoxLayout * hbox = new QHBoxLayout(hboxWidget); | 303 | auto * hbox = new QHBoxLayout(hboxWidget); | ||
304 | 304 | | |||
305 | hbox->setContentsMargins(0, 0, 0, 0); | 305 | hbox->setContentsMargins(0, 0, 0, 0); | ||
306 | hbox->setSpacing(6); | 306 | hbox->setSpacing(6); | ||
307 | _lineEdit = new KLineEdit(hboxWidget); | 307 | _lineEdit = new KLineEdit(hboxWidget); | ||
308 | hbox->addWidget(_lineEdit); | 308 | hbox->addWidget(_lineEdit); | ||
309 | _button = new QToolButton(hboxWidget); | 309 | _button = new QToolButton(hboxWidget); | ||
310 | _button->setIcon(Icon("list-add")); | 310 | _button->setIcon(Icon("list-add")); | ||
311 | hbox->addWidget(_button); | 311 | hbox->addWidget(_button); | ||
Show All 16 Lines | |||||
328 | { | 328 | { | ||
329 | if (_lineEdit->text().isEmpty()) | 329 | if (_lineEdit->text().isEmpty()) | ||
330 | return false; | 330 | return false; | ||
331 | else | 331 | else | ||
332 | return true; | 332 | return true; | ||
333 | } | 333 | } | ||
334 | void ParameterPlaceholder::addPlaceholder() | 334 | void ParameterPlaceholder::addPlaceholder() | ||
335 | { | 335 | { | ||
336 | AddPlaceholderPopup* popup = new AddPlaceholderPopup(this); | 336 | auto* popup = new AddPlaceholderPopup(this); | ||
337 | QString exp = popup->getPlaceholder(mapToGlobal(QPoint(_button->pos().x() + _button->width() + 6, _button->pos().y() + _button->height() / 2))); | 337 | QString exp = popup->getPlaceholder(mapToGlobal(QPoint(_button->pos().x() + _button->width() + 6, _button->pos().y() + _button->height() / 2))); | ||
338 | _lineEdit->insert(exp); | 338 | _lineEdit->insert(exp); | ||
339 | delete popup; | 339 | delete popup; | ||
340 | } | 340 | } | ||
341 | 341 | | |||
342 | ///////////// ParameterYes | 342 | ///////////// ParameterYes | ||
343 | ParameterYes::ParameterYes(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | 343 | ParameterYes::ParameterYes(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | ||
344 | { | 344 | { | ||
345 | QVBoxLayout* layout = new QVBoxLayout(this); | 345 | auto* layout = new QVBoxLayout(this); | ||
346 | layout->setSpacing(6); | 346 | layout->setSpacing(6); | ||
347 | layout->setContentsMargins(0, 0, 0, 0); | 347 | layout->setContentsMargins(0, 0, 0, 0); | ||
348 | 348 | | |||
349 | layout->addWidget(_checkBox = new QCheckBox(i18n(parameter.description().toUtf8()), this)); | 349 | layout->addWidget(_checkBox = new QCheckBox(i18n(parameter.description().toUtf8()), this)); | ||
350 | _checkBox->setChecked(true); | 350 | _checkBox->setChecked(true); | ||
351 | } | 351 | } | ||
352 | 352 | | |||
353 | QString ParameterYes::text() | 353 | QString ParameterYes::text() | ||
Show All 14 Lines | |||||
368 | bool ParameterYes::valid() | 368 | bool ParameterYes::valid() | ||
369 | { | 369 | { | ||
370 | return true; | 370 | return true; | ||
371 | } | 371 | } | ||
372 | 372 | | |||
373 | ///////////// ParameterNo | 373 | ///////////// ParameterNo | ||
374 | ParameterNo::ParameterNo(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | 374 | ParameterNo::ParameterNo(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | ||
375 | { | 375 | { | ||
376 | QVBoxLayout* layout = new QVBoxLayout(this); | 376 | auto* layout = new QVBoxLayout(this); | ||
377 | layout->setSpacing(6); | 377 | layout->setSpacing(6); | ||
378 | layout->setContentsMargins(0, 0, 0, 0); | 378 | layout->setContentsMargins(0, 0, 0, 0); | ||
379 | 379 | | |||
380 | layout->addWidget(_checkBox = new QCheckBox(i18n(parameter.description().toUtf8()), this)); | 380 | layout->addWidget(_checkBox = new QCheckBox(i18n(parameter.description().toUtf8()), this)); | ||
381 | _checkBox->setChecked(false); | 381 | _checkBox->setChecked(false); | ||
382 | } | 382 | } | ||
383 | 383 | | |||
384 | QString ParameterNo::text() | 384 | QString ParameterNo::text() | ||
Show All 14 Lines | |||||
399 | bool ParameterNo::valid() | 399 | bool ParameterNo::valid() | ||
400 | { | 400 | { | ||
401 | return true; | 401 | return true; | ||
402 | } | 402 | } | ||
403 | 403 | | |||
404 | ///////////// ParameterFile | 404 | ///////////// ParameterFile | ||
405 | ParameterFile::ParameterFile(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | 405 | ParameterFile::ParameterFile(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | ||
406 | { | 406 | { | ||
407 | QVBoxLayout* layout = new QVBoxLayout(this); | 407 | auto* layout = new QVBoxLayout(this); | ||
408 | layout->setSpacing(6); | 408 | layout->setSpacing(6); | ||
409 | layout->setContentsMargins(0, 0, 0, 0); | 409 | layout->setContentsMargins(0, 0, 0, 0); | ||
410 | 410 | | |||
411 | layout->addWidget(new QLabel(i18n(parameter.description().toUtf8()), this)); | 411 | layout->addWidget(new QLabel(i18n(parameter.description().toUtf8()), this)); | ||
412 | 412 | | |||
413 | QWidget * hboxWidget = new QWidget(this); | 413 | QWidget * hboxWidget = new QWidget(this); | ||
414 | layout->addWidget(hboxWidget); | 414 | layout->addWidget(hboxWidget); | ||
415 | QHBoxLayout * hbox = new QHBoxLayout(hboxWidget); | 415 | auto * hbox = new QHBoxLayout(hboxWidget); | ||
416 | 416 | | |||
417 | hbox->setContentsMargins(0, 0, 0, 0); | 417 | hbox->setContentsMargins(0, 0, 0, 0); | ||
418 | hbox->setSpacing(6); | 418 | hbox->setSpacing(6); | ||
419 | _lineEdit = new KLineEdit(hboxWidget); | 419 | _lineEdit = new KLineEdit(hboxWidget); | ||
420 | hbox->addWidget(_lineEdit); | 420 | hbox->addWidget(_lineEdit); | ||
421 | _button = new QToolButton(hboxWidget); | 421 | _button = new QToolButton(hboxWidget); | ||
422 | hbox->addWidget(_button); | 422 | hbox->addWidget(_button); | ||
423 | _button->setIcon(Icon("document-open")); | 423 | _button->setIcon(Icon("document-open")); | ||
Show All 23 Lines | |||||
447 | { | 447 | { | ||
448 | QString filename = QFileDialog::getOpenFileName(this); | 448 | QString filename = QFileDialog::getOpenFileName(this); | ||
449 | _lineEdit->insert(filename); | 449 | _lineEdit->insert(filename); | ||
450 | } | 450 | } | ||
451 | 451 | | |||
452 | ///////////// ParameterChoose | 452 | ///////////// ParameterChoose | ||
453 | ParameterChoose::ParameterChoose(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | 453 | ParameterChoose::ParameterChoose(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | ||
454 | { | 454 | { | ||
455 | QVBoxLayout* layout = new QVBoxLayout(this); | 455 | auto* layout = new QVBoxLayout(this); | ||
456 | layout->setSpacing(6); | 456 | layout->setSpacing(6); | ||
457 | layout->setContentsMargins(0, 0, 0, 0); | 457 | layout->setContentsMargins(0, 0, 0, 0); | ||
458 | 458 | | |||
459 | layout->addWidget(new QLabel(i18n(parameter.description().toUtf8()), this)); | 459 | layout->addWidget(new QLabel(i18n(parameter.description().toUtf8()), this)); | ||
460 | layout->addWidget(_combobox = new KComboBox(this)); | 460 | layout->addWidget(_combobox = new KComboBox(this)); | ||
461 | _combobox->addItems(parameter.preset().section(':', 1).split(';')); | 461 | _combobox->addItems(parameter.preset().section(':', 1).split(';')); | ||
462 | } | 462 | } | ||
463 | 463 | | |||
Show All 12 Lines | |||||
476 | bool ParameterChoose::valid() | 476 | bool ParameterChoose::valid() | ||
477 | { | 477 | { | ||
478 | return true; | 478 | return true; | ||
479 | } | 479 | } | ||
480 | 480 | | |||
481 | ///////////// ParameterSelect | 481 | ///////////// ParameterSelect | ||
482 | ParameterSelect::ParameterSelect(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | 482 | ParameterSelect::ParameterSelect(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | ||
483 | { | 483 | { | ||
484 | QVBoxLayout* layout = new QVBoxLayout(this); | 484 | auto* layout = new QVBoxLayout(this); | ||
485 | layout->setSpacing(6); | 485 | layout->setSpacing(6); | ||
486 | layout->setContentsMargins(0, 0, 0, 0); | 486 | layout->setContentsMargins(0, 0, 0, 0); | ||
487 | 487 | | |||
488 | layout->addWidget(new QLabel(i18n(parameter.description().toUtf8()), this)); | 488 | layout->addWidget(new QLabel(i18n(parameter.description().toUtf8()), this)); | ||
489 | layout->addWidget(_combobox = new KComboBox(this)); | 489 | layout->addWidget(_combobox = new KComboBox(this)); | ||
490 | _combobox->setEditable(true); | 490 | _combobox->setEditable(true); | ||
491 | 491 | | |||
492 | KConfigGroup group(krConfig, "Private"); | 492 | KConfigGroup group(krConfig, "Private"); | ||
Show All 19 Lines | |||||
512 | bool ParameterSelect::valid() | 512 | bool ParameterSelect::valid() | ||
513 | { | 513 | { | ||
514 | return true; | 514 | return true; | ||
515 | } | 515 | } | ||
516 | 516 | | |||
517 | ///////////// ParameterGoto | 517 | ///////////// ParameterGoto | ||
518 | ParameterGoto::ParameterGoto(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | 518 | ParameterGoto::ParameterGoto(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | ||
519 | { | 519 | { | ||
520 | QVBoxLayout* layout = new QVBoxLayout(this); | 520 | auto* layout = new QVBoxLayout(this); | ||
521 | layout->setSpacing(6); | 521 | layout->setSpacing(6); | ||
522 | layout->setContentsMargins(0, 0, 0, 0); | 522 | layout->setContentsMargins(0, 0, 0, 0); | ||
523 | 523 | | |||
524 | layout->addWidget(new QLabel(i18n(parameter.description().toUtf8()), this)); | 524 | layout->addWidget(new QLabel(i18n(parameter.description().toUtf8()), this)); | ||
525 | 525 | | |||
526 | QWidget * hboxWidget = new QWidget(this); | 526 | QWidget * hboxWidget = new QWidget(this); | ||
527 | QHBoxLayout * hbox = new QHBoxLayout(hboxWidget); | 527 | auto * hbox = new QHBoxLayout(hboxWidget); | ||
528 | 528 | | |||
529 | hbox->setContentsMargins(0, 0, 0, 0); | 529 | hbox->setContentsMargins(0, 0, 0, 0); | ||
530 | hbox->setSpacing(6); | 530 | hbox->setSpacing(6); | ||
531 | _lineEdit = new KLineEdit(hboxWidget); | 531 | _lineEdit = new KLineEdit(hboxWidget); | ||
532 | _lineEdit->setCompletionObject(new KUrlCompletion(KUrlCompletion::DirCompletion)); | 532 | _lineEdit->setCompletionObject(new KUrlCompletion(KUrlCompletion::DirCompletion)); | ||
533 | hbox->addWidget(_lineEdit); | 533 | hbox->addWidget(_lineEdit); | ||
534 | _dirButton = new QToolButton(hboxWidget); | 534 | _dirButton = new QToolButton(hboxWidget); | ||
535 | hbox->addWidget(_dirButton); | 535 | hbox->addWidget(_dirButton); | ||
Show All 28 Lines | |||||
564 | } | 564 | } | ||
565 | void ParameterGoto::setDir() | 565 | void ParameterGoto::setDir() | ||
566 | { | 566 | { | ||
567 | QString folder = QFileDialog::getExistingDirectory(this); | 567 | QString folder = QFileDialog::getExistingDirectory(this); | ||
568 | _lineEdit->setText(folder); | 568 | _lineEdit->setText(folder); | ||
569 | } | 569 | } | ||
570 | void ParameterGoto::addPlaceholder() | 570 | void ParameterGoto::addPlaceholder() | ||
571 | { | 571 | { | ||
572 | AddPlaceholderPopup* popup = new AddPlaceholderPopup(this); | 572 | auto* popup = new AddPlaceholderPopup(this); | ||
573 | QString exp = popup->getPlaceholder(mapToGlobal(QPoint(_placeholderButton->pos().x() + _placeholderButton->width() + 6, _placeholderButton->pos().y() + _placeholderButton->height() / 2))); | 573 | QString exp = popup->getPlaceholder(mapToGlobal(QPoint(_placeholderButton->pos().x() + _placeholderButton->width() + 6, _placeholderButton->pos().y() + _placeholderButton->height() / 2))); | ||
574 | _lineEdit->insert(exp); | 574 | _lineEdit->insert(exp); | ||
575 | delete popup; | 575 | delete popup; | ||
576 | } | 576 | } | ||
577 | 577 | | |||
578 | ///////////// ParameterSyncprofile | 578 | ///////////// ParameterSyncprofile | ||
579 | ParameterSyncprofile::ParameterSyncprofile(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | 579 | ParameterSyncprofile::ParameterSyncprofile(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | ||
580 | { | 580 | { | ||
581 | QVBoxLayout* layout = new QVBoxLayout(this); | 581 | auto* layout = new QVBoxLayout(this); | ||
582 | layout->setSpacing(6); | 582 | layout->setSpacing(6); | ||
583 | layout->setContentsMargins(0, 0, 0, 0); | 583 | layout->setContentsMargins(0, 0, 0, 0); | ||
584 | 584 | | |||
585 | layout->addWidget(new QLabel(i18n(parameter.description().toUtf8()), this)); | 585 | layout->addWidget(new QLabel(i18n(parameter.description().toUtf8()), this)); | ||
586 | layout->addWidget(_combobox = new KComboBox(this)); | 586 | layout->addWidget(_combobox = new KComboBox(this)); | ||
587 | 587 | | |||
588 | _combobox->addItems(ProfileManager::availableProfiles("SynchronizerProfile")); | 588 | _combobox->addItems(ProfileManager::availableProfiles("SynchronizerProfile")); | ||
589 | } | 589 | } | ||
Show All 13 Lines | |||||
603 | bool ParameterSyncprofile::valid() | 603 | bool ParameterSyncprofile::valid() | ||
604 | { | 604 | { | ||
605 | return true; | 605 | return true; | ||
606 | } | 606 | } | ||
607 | 607 | | |||
608 | ///////////// ParameterSearch | 608 | ///////////// ParameterSearch | ||
609 | ParameterSearch::ParameterSearch(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | 609 | ParameterSearch::ParameterSearch(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | ||
610 | { | 610 | { | ||
611 | QVBoxLayout* layout = new QVBoxLayout(this); | 611 | auto* layout = new QVBoxLayout(this); | ||
612 | layout->setSpacing(6); | 612 | layout->setSpacing(6); | ||
613 | layout->setContentsMargins(0, 0, 0, 0); | 613 | layout->setContentsMargins(0, 0, 0, 0); | ||
614 | 614 | | |||
615 | layout->addWidget(new QLabel(i18n(parameter.description().toUtf8()), this)); | 615 | layout->addWidget(new QLabel(i18n(parameter.description().toUtf8()), this)); | ||
616 | layout->addWidget(_combobox = new KComboBox(this)); | 616 | layout->addWidget(_combobox = new KComboBox(this)); | ||
617 | 617 | | |||
618 | _combobox->addItems(ProfileManager::availableProfiles("SearcherProfile")); | 618 | _combobox->addItems(ProfileManager::availableProfiles("SearcherProfile")); | ||
619 | } | 619 | } | ||
Show All 13 Lines | |||||
633 | bool ParameterSearch::valid() | 633 | bool ParameterSearch::valid() | ||
634 | { | 634 | { | ||
635 | return true; | 635 | return true; | ||
636 | } | 636 | } | ||
637 | 637 | | |||
638 | ///////////// ParameterPanelprofile | 638 | ///////////// ParameterPanelprofile | ||
639 | ParameterPanelprofile::ParameterPanelprofile(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | 639 | ParameterPanelprofile::ParameterPanelprofile(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | ||
640 | { | 640 | { | ||
641 | QVBoxLayout* layout = new QVBoxLayout(this); | 641 | auto* layout = new QVBoxLayout(this); | ||
642 | layout->setSpacing(6); | 642 | layout->setSpacing(6); | ||
643 | layout->setContentsMargins(0, 0, 0, 0); | 643 | layout->setContentsMargins(0, 0, 0, 0); | ||
644 | 644 | | |||
645 | layout->addWidget(new QLabel(i18n(parameter.description().toUtf8()), this)); | 645 | layout->addWidget(new QLabel(i18n(parameter.description().toUtf8()), this)); | ||
646 | layout->addWidget(_combobox = new KComboBox(this)); | 646 | layout->addWidget(_combobox = new KComboBox(this)); | ||
647 | 647 | | |||
648 | _combobox->addItems(ProfileManager::availableProfiles("Panel")); | 648 | _combobox->addItems(ProfileManager::availableProfiles("Panel")); | ||
649 | } | 649 | } | ||
Show All 13 Lines | |||||
663 | bool ParameterPanelprofile::valid() | 663 | bool ParameterPanelprofile::valid() | ||
664 | { | 664 | { | ||
665 | return true; | 665 | return true; | ||
666 | } | 666 | } | ||
667 | 667 | | |||
668 | ///////////// ParameterInt | 668 | ///////////// ParameterInt | ||
669 | ParameterInt::ParameterInt(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | 669 | ParameterInt::ParameterInt(const exp_parameter& parameter, QWidget* parent) : ParameterBase(parameter, parent) | ||
670 | { | 670 | { | ||
671 | QHBoxLayout* layout = new QHBoxLayout(this); | 671 | auto* layout = new QHBoxLayout(this); | ||
672 | layout->setSpacing(6); | 672 | layout->setSpacing(6); | ||
673 | layout->setContentsMargins(0, 0, 0, 0); | 673 | layout->setContentsMargins(0, 0, 0, 0); | ||
674 | 674 | | |||
675 | layout->addWidget(new QLabel(i18n(parameter.description().toUtf8()), this)); | 675 | layout->addWidget(new QLabel(i18n(parameter.description().toUtf8()), this)); | ||
676 | layout->addWidget(_spinbox = new QSpinBox(this)); | 676 | layout->addWidget(_spinbox = new QSpinBox(this)); | ||
677 | QStringList para = parameter.preset().section(':', 1).split(';'); | 677 | QStringList para = parameter.preset().section(':', 1).split(';'); | ||
678 | 678 | | |||
679 | _spinbox->setMinimum(para[0].toInt()); | 679 | _spinbox->setMinimum(para[0].toInt()); | ||
Show All 24 Lines |