Changeset View
Changeset View
Standalone View
Standalone View
src/EditProfileDialog.cpp
Show First 20 Lines • Show All 322 Lines • ▼ Show 20 Line(s) | 260 | { | |||
---|---|---|---|---|---|
323 | connect(_ui->showTerminalSizeHintButton, &QCheckBox::toggled, this, | 323 | connect(_ui->showTerminalSizeHintButton, &QCheckBox::toggled, this, | ||
324 | &Konsole::EditProfileDialog::showTerminalSizeHint); | 324 | &Konsole::EditProfileDialog::showTerminalSizeHint); | ||
325 | } | 325 | } | ||
326 | 326 | | |||
327 | void EditProfileDialog::showEnvironmentEditor() | 327 | void EditProfileDialog::showEnvironmentEditor() | ||
328 | { | 328 | { | ||
329 | bool ok; | 329 | bool ok; | ||
330 | const Profile::Ptr profile = lookupProfile(); | 330 | const Profile::Ptr profile = lookupProfile(); | ||
331 | QStringList currentEnvironment = profile->environment(); | 331 | | ||
332 | QStringList currentEnvironment; | ||||
333 | | ||||
334 | // the user could re-open the environment editor before clicking OK/Apply | ||||
335 | // in the parent edit profile dialog, so we make sure to show the the new | ||||
336 | // environment vars | ||||
337 | if (_tempProfile->isPropertySet(Profile::Environment)) { | ||||
338 | currentEnvironment = _tempProfile->environment(); | ||||
339 | } else { | ||||
340 | currentEnvironment = profile->environment(); | ||||
341 | } | ||||
332 | 342 | | |||
333 | QString text = QInputDialog::getMultiLineText(this, | 343 | QString text = QInputDialog::getMultiLineText(this, | ||
334 | i18n("Edit Environment"), | 344 | i18n("Edit Environment"), | ||
335 | i18n("One environment variable per line"), | 345 | i18n("One environment variable per line"), | ||
336 | currentEnvironment.join(QStringLiteral("\n")), | 346 | currentEnvironment.join(QStringLiteral("\n")), | ||
337 | &ok); | 347 | &ok); | ||
338 | 348 | | |||
339 | if (ok && !text.isEmpty()) { | 349 | QStringList newEnvironment; | ||
340 | QStringList newEnvironment = text.split(QLatin1Char('\n')); | 350 | | ||
351 | if (ok) { | ||||
352 | if(!text.isEmpty()) { | ||||
353 | newEnvironment = text.split(QLatin1Char('\n')); | ||||
354 | updateTempProfileProperty(Profile::Environment, newEnvironment); | ||||
355 | } else { | ||||
356 | // the user could have removed all entries so we return an empty list | ||||
341 | updateTempProfileProperty(Profile::Environment, newEnvironment); | 357 | updateTempProfileProperty(Profile::Environment, newEnvironment); | ||
342 | } | 358 | } | ||
343 | } | 359 | } | ||
360 | } | ||||
344 | 361 | | |||
345 | void EditProfileDialog::setupTabsPage(const Profile::Ptr profile) | 362 | void EditProfileDialog::setupTabsPage(const Profile::Ptr profile) | ||
346 | { | 363 | { | ||
347 | // tab title format | 364 | // tab title format | ||
348 | _ui->renameTabWidget->setTabTitleText(profile->localTabTitleFormat()); | 365 | _ui->renameTabWidget->setTabTitleText(profile->localTabTitleFormat()); | ||
349 | _ui->renameTabWidget->setRemoteTabTitleText(profile->remoteTabTitleFormat()); | 366 | _ui->renameTabWidget->setRemoteTabTitleText(profile->remoteTabTitleFormat()); | ||
350 | 367 | | |||
351 | connect(_ui->renameTabWidget, &Konsole::RenameTabWidget::tabTitleFormatChanged, this, | 368 | connect(_ui->renameTabWidget, &Konsole::RenameTabWidget::tabTitleFormatChanged, this, | ||
▲ Show 20 Lines • Show All 1175 Lines • Show Last 20 Lines |