• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Konsole

  • kde-4.14
  • applications
  • konsole
  • src
EditProfileDialog.cpp
Go to the documentation of this file.
1 /*
2  Copyright 2007-2008 by Robert Knight <robertknight@gmail.com>
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301 USA.
18 */
19 
20 // Own
21 #include "EditProfileDialog.h"
22 
23 // Standard
24 #include <cmath>
25 
26 // Qt
27 #include <QtGui/QBrush>
28 #include <QtGui/QPainter>
29 #include <QStandardItem>
30 #include <QtCore/QTextCodec>
31 #include <QtGui/QLinearGradient>
32 #include <QtGui/QRadialGradient>
33 #include <QtCore/QTimer>
34 
35 // KDE
36 #include <kdeversion.h>
37 #if KDE_IS_VERSION(4, 9, 1)
38 #include <KCodecAction>
39 #else
40 #include <kcodecaction.h>
41 #endif
42 
43 #include <KFontDialog>
44 #include <KIcon>
45 #include <KIconDialog>
46 #include <KFileDialog>
47 #include <KUrlCompletion>
48 #include <KWindowSystem>
49 #include <KTextEdit>
50 #include <KMessageBox>
51 
52 // Konsole
53 #include "ColorScheme.h"
54 #include "ColorSchemeManager.h"
55 #include "ColorSchemeEditor.h"
56 #include "ui_EditProfileDialog.h"
57 #include "KeyBindingEditor.h"
58 #include "KeyboardTranslator.h"
59 #include "KeyboardTranslatorManager.h"
60 #include "ProfileManager.h"
61 #include "ShellCommand.h"
62 #include "WindowSystemInfo.h"
63 #include "Enumeration.h"
64 
65 using namespace Konsole;
66 
67 EditProfileDialog::EditProfileDialog(QWidget* aParent)
68  : KDialog(aParent)
69  , _delayedPreviewTimer(new QTimer(this))
70  , _colorDialog(0)
71 {
72  setCaption(i18n("Edit Profile"));
73  setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Apply);
74 
75  // disable the apply button , since no modification has been made
76  enableButtonApply(false);
77 
78  connect(this, SIGNAL(applyClicked()), this, SLOT(save()));
79 
80  connect(_delayedPreviewTimer, SIGNAL(timeout()), this, SLOT(delayedPreviewActivate()));
81 
82  _ui = new Ui::EditProfileDialog();
83  _ui->setupUi(mainWidget());
84 
85  // there are various setupXYZPage() methods to load the items
86  // for each page and update their states to match the profile
87  // being edited.
88  //
89  // these are only called when needed ( ie. when the user clicks
90  // the tab to move to that page ).
91  //
92  // the _pageNeedsUpdate vector keeps track of the pages that have
93  // not been updated since the last profile change and will need
94  // to be refreshed when the user switches to them
95  _pageNeedsUpdate.resize(_ui->tabWidget->count());
96  connect(_ui->tabWidget, SIGNAL(currentChanged(int)), this,
97  SLOT(preparePage(int)));
98 
99  createTempProfile();
100 }
101 EditProfileDialog::~EditProfileDialog()
102 {
103  delete _ui;
104 }
105 void EditProfileDialog::save()
106 {
107  if (_tempProfile->isEmpty())
108  return;
109 
110  ProfileManager::instance()->changeProfile(_profile, _tempProfile->setProperties());
111 
112  // ensure that these settings are not undone by a call
113  // to unpreview()
114  QHashIterator<Profile::Property, QVariant> iter(_tempProfile->setProperties());
115  while (iter.hasNext()) {
116  iter.next();
117  _previewedProperties.remove(iter.key());
118  }
119 
120  createTempProfile();
121 
122  enableButtonApply(false);
123 }
124 void EditProfileDialog::reject()
125 {
126  unpreviewAll();
127  KDialog::reject();
128 }
129 void EditProfileDialog::accept()
130 {
131  Q_ASSERT(_profile);
132  Q_ASSERT(_tempProfile);
133 
134  if ((_tempProfile->isPropertySet(Profile::Name) &&
135  _tempProfile->name().isEmpty())
136  || (_profile->name().isEmpty() && _tempProfile->name().isEmpty())) {
137  KMessageBox::sorry(this,
138  i18n("<p>Each profile must have a name before it can be saved "
139  "into disk.</p>"));
140  return;
141  }
142  save();
143  unpreviewAll();
144  KDialog::accept();
145 }
146 QString EditProfileDialog::groupProfileNames(const ProfileGroup::Ptr group, int maxLength)
147 {
148  QString caption;
149  int count = group->profiles().count();
150  for (int i = 0; i < count; i++) {
151  caption += group->profiles()[i]->name();
152  if (i < (count - 1)) {
153  caption += ',';
154  // limit caption length to prevent very long window titles
155  if (maxLength > 0 && caption.length() > maxLength) {
156  caption += "...";
157  break;
158  }
159  }
160  }
161  return caption;
162 }
163 void EditProfileDialog::updateCaption(const Profile::Ptr profile)
164 {
165  const int MAX_GROUP_CAPTION_LENGTH = 25;
166  ProfileGroup::Ptr group = profile->asGroup();
167  if (group && group->profiles().count() > 1) {
168  QString caption = groupProfileNames(group, MAX_GROUP_CAPTION_LENGTH);
169  setCaption(i18np("Editing profile: %2",
170  "Editing %1 profiles: %2",
171  group->profiles().count(),
172  caption));
173  } else {
174  setCaption(i18n("Edit Profile \"%1\"", profile->name()));
175  }
176 }
177 void EditProfileDialog::setProfile(Profile::Ptr profile)
178 {
179  Q_ASSERT(profile);
180 
181  _profile = profile;
182 
183  // update caption
184  updateCaption(profile);
185 
186  // mark each page of the dialog as out of date
187  // and force an update of the currently visible page
188  //
189  // the other pages will be updated as necessary
190  _pageNeedsUpdate.fill(true);
191  preparePage(_ui->tabWidget->currentIndex());
192 
193  if (_tempProfile) {
194  createTempProfile();
195  }
196 }
197 const Profile::Ptr EditProfileDialog::lookupProfile() const
198 {
199  return _profile;
200 }
201 void EditProfileDialog::preparePage(int page)
202 {
203  const Profile::Ptr profile = lookupProfile();
204 
205  Q_ASSERT(_pageNeedsUpdate.count() > page);
206  Q_ASSERT(profile);
207 
208  QWidget* pageWidget = _ui->tabWidget->widget(page);
209 
210  if (_pageNeedsUpdate[page]) {
211  if (pageWidget == _ui->generalTab)
212  setupGeneralPage(profile);
213  else if (pageWidget == _ui->tabsTab)
214  setupTabsPage(profile);
215  else if (pageWidget == _ui->appearanceTab)
216  setupAppearancePage(profile);
217  else if (pageWidget == _ui->scrollingTab)
218  setupScrollingPage(profile);
219  else if (pageWidget == _ui->keyboardTab)
220  setupKeyboardPage(profile);
221  else if (pageWidget == _ui->mouseTab)
222  setupMousePage(profile);
223  else if (pageWidget == _ui->advancedTab)
224  setupAdvancedPage(profile);
225  else
226  Q_ASSERT(false);
227 
228  _pageNeedsUpdate[page] = false;
229  }
230 }
231 void EditProfileDialog::selectProfileName()
232 {
233  _ui->profileNameEdit->setFocus();
234  _ui->profileNameEdit->selectAll();
235 }
236 void EditProfileDialog::setupGeneralPage(const Profile::Ptr profile)
237 {
238  // basic profile options
239  {
240  _ui->emptyNameWarningWidget->setWordWrap(false);
241  _ui->emptyNameWarningWidget->setCloseButtonVisible(false);
242  _ui->emptyNameWarningWidget->setMessageType(KMessageWidget::Warning);
243 
244  ProfileGroup::Ptr group = profile->asGroup();
245  if (!group || group->profiles().count() < 2) {
246  _ui->profileNameEdit->setText(profile->name());
247  _ui->profileNameEdit->setClearButtonShown(true);
248 
249  _ui->emptyNameWarningWidget->setVisible(profile->name().isEmpty());
250  _ui->emptyNameWarningWidget->setText(i18n("Profile name is empty."));
251  } else {
252  _ui->profileNameEdit->setText(groupProfileNames(group, -1));
253  _ui->profileNameEdit->setEnabled(false);
254  _ui->profileNameLabel->setEnabled(false);
255 
256  _ui->emptyNameWarningWidget->setVisible(false);
257  }
258  }
259 
260  ShellCommand command(profile->command() , profile->arguments());
261  _ui->commandEdit->setText(command.fullCommand());
262  KUrlCompletion* exeCompletion = new KUrlCompletion(KUrlCompletion::ExeCompletion);
263  exeCompletion->setParent(this);
264  exeCompletion->setDir(QString());
265  _ui->commandEdit->setCompletionObject(exeCompletion);
266 
267  _ui->initialDirEdit->setText(profile->defaultWorkingDirectory());
268  KUrlCompletion* dirCompletion = new KUrlCompletion(KUrlCompletion::DirCompletion);
269  dirCompletion->setParent(this);
270  _ui->initialDirEdit->setCompletionObject(dirCompletion);
271  _ui->initialDirEdit->setClearButtonShown(true);
272 
273  _ui->dirSelectButton->setIcon(KIcon("folder-open"));
274  _ui->iconSelectButton->setIcon(KIcon(profile->icon()));
275  _ui->startInSameDirButton->setChecked(profile->startInCurrentSessionDir());
276 
277  // terminal options
278  _ui->terminalColumnsEntry->setValue(profile->terminalColumns());
279  _ui->terminalRowsEntry->setValue(profile->terminalRows());
280 
281  // window options
282  _ui->showTerminalSizeHintButton->setChecked(profile->showTerminalSizeHint());
283 
284  // signals and slots
285  connect(_ui->dirSelectButton, SIGNAL(clicked()), this, SLOT(selectInitialDir()));
286  connect(_ui->iconSelectButton, SIGNAL(clicked()), this, SLOT(selectIcon()));
287  connect(_ui->startInSameDirButton, SIGNAL(toggled(bool)), this ,
288  SLOT(startInSameDir(bool)));
289  connect(_ui->profileNameEdit, SIGNAL(textChanged(QString)), this,
290  SLOT(profileNameChanged(QString)));
291  connect(_ui->initialDirEdit, SIGNAL(textChanged(QString)), this,
292  SLOT(initialDirChanged(QString)));
293  connect(_ui->commandEdit, SIGNAL(textChanged(QString)), this,
294  SLOT(commandChanged(QString)));
295  connect(_ui->environmentEditButton , SIGNAL(clicked()), this,
296  SLOT(showEnvironmentEditor()));
297 
298  connect(_ui->terminalColumnsEntry, SIGNAL(valueChanged(int)),
299  this, SLOT(terminalColumnsEntryChanged(int)));
300  connect(_ui->terminalRowsEntry, SIGNAL(valueChanged(int)),
301  this, SLOT(terminalRowsEntryChanged(int)));
302 
303  connect(_ui->showTerminalSizeHintButton, SIGNAL(toggled(bool)), this,
304  SLOT(showTerminalSizeHint(bool)));
305 }
306 void EditProfileDialog::showEnvironmentEditor()
307 {
308  const Profile::Ptr profile = lookupProfile();
309 
310  QWeakPointer<KDialog> dialog = new KDialog(this);
311  KTextEdit* edit = new KTextEdit(dialog.data());
312 
313  QStringList currentEnvironment = profile->environment();
314 
315  edit->setPlainText(currentEnvironment.join("\n"));
316  edit->setToolTip(i18nc("@info:tooltip", "One environment variable per line"));
317 
318  dialog.data()->setPlainCaption(i18n("Edit Environment"));
319  dialog.data()->setMainWidget(edit);
320 
321  if (dialog.data()->exec() == QDialog::Accepted) {
322  QStringList newEnvironment = edit->toPlainText().split('\n');
323  updateTempProfileProperty(Profile::Environment, newEnvironment);
324  }
325 
326  delete dialog.data();
327 }
328 void EditProfileDialog::setupTabsPage(const Profile::Ptr profile)
329 {
330  // tab title format
331  _ui->renameTabWidget->setTabTitleText(profile->localTabTitleFormat());
332  _ui->renameTabWidget->setRemoteTabTitleText(profile->remoteTabTitleFormat());
333 
334  connect(_ui->renameTabWidget, SIGNAL(tabTitleFormatChanged(QString)), this,
335  SLOT(tabTitleFormatChanged(QString)));
336  connect(_ui->renameTabWidget, SIGNAL(remoteTabTitleFormatChanged(QString)), this,
337  SLOT(remoteTabTitleFormatChanged(QString)));
338 
339  // tab monitoring
340  const int silenceSeconds = profile->silenceSeconds();
341  _ui->silenceSecondsSpinner->setValue(silenceSeconds);
342  _ui->silenceSecondsSpinner->setSuffix(ki18ncp("Unit of time", " second", " seconds"));
343 
344  connect(_ui->silenceSecondsSpinner, SIGNAL(valueChanged(int)),
345  this, SLOT(silenceSecondsChanged(int)));
346 }
347 
348 void EditProfileDialog::terminalColumnsEntryChanged(int value)
349 {
350  updateTempProfileProperty(Profile::TerminalColumns, value);
351 }
352 void EditProfileDialog::terminalRowsEntryChanged(int value)
353 {
354  updateTempProfileProperty(Profile::TerminalRows, value);
355 }
356 void EditProfileDialog::showTerminalSizeHint(bool value)
357 {
358  updateTempProfileProperty(Profile::ShowTerminalSizeHint, value);
359 }
360 void EditProfileDialog::tabTitleFormatChanged(const QString& format)
361 {
362  updateTempProfileProperty(Profile::LocalTabTitleFormat, format);
363 }
364 void EditProfileDialog::remoteTabTitleFormatChanged(const QString& format)
365 {
366  updateTempProfileProperty(Profile::RemoteTabTitleFormat, format);
367 }
368 
369 void EditProfileDialog::silenceSecondsChanged(int seconds)
370 {
371  updateTempProfileProperty(Profile::SilenceSeconds, seconds);
372 }
373 
374 void EditProfileDialog::selectIcon()
375 {
376  const QString& icon = KIconDialog::getIcon(KIconLoader::Desktop, KIconLoader::Application,
377  false, 0, false, this);
378  if (!icon.isEmpty()) {
379  _ui->iconSelectButton->setIcon(KIcon(icon));
380  updateTempProfileProperty(Profile::Icon, icon);
381  }
382 }
383 void EditProfileDialog::profileNameChanged(const QString& text)
384 {
385  _ui->emptyNameWarningWidget->setVisible(text.isEmpty());
386 
387  updateTempProfileProperty(Profile::Name, text);
388  updateTempProfileProperty(Profile::UntranslatedName, text);
389  updateCaption(_tempProfile);
390 }
391 void EditProfileDialog::startInSameDir(bool sameDir)
392 {
393  updateTempProfileProperty(Profile::StartInCurrentSessionDir, sameDir);
394 }
395 void EditProfileDialog::initialDirChanged(const QString& dir)
396 {
397  updateTempProfileProperty(Profile::Directory, dir);
398 }
399 void EditProfileDialog::commandChanged(const QString& command)
400 {
401  ShellCommand shellCommand(command);
402 
403  updateTempProfileProperty(Profile::Command, shellCommand.command());
404  updateTempProfileProperty(Profile::Arguments, shellCommand.arguments());
405 }
406 void EditProfileDialog::selectInitialDir()
407 {
408  const KUrl url = KFileDialog::getExistingDirectoryUrl(_ui->initialDirEdit->text(),
409  this,
410  i18n("Select Initial Directory"));
411 
412  if (!url.isEmpty())
413  _ui->initialDirEdit->setText(url.path());
414 }
415 void EditProfileDialog::setupAppearancePage(const Profile::Ptr profile)
416 {
417  ColorSchemeViewDelegate* delegate = new ColorSchemeViewDelegate(this);
418  _ui->colorSchemeList->setItemDelegate(delegate);
419 
420  _ui->transparencyWarningWidget->setVisible(false);
421  _ui->transparencyWarningWidget->setWordWrap(true);
422  _ui->transparencyWarningWidget->setCloseButtonVisible(false);
423  _ui->transparencyWarningWidget->setMessageType(KMessageWidget::Warning);
424 
425  _ui->editColorSchemeButton->setEnabled(false);
426  _ui->removeColorSchemeButton->setEnabled(false);
427 
428  // setup color list
429  updateColorSchemeList(true);
430 
431  _ui->colorSchemeList->setMouseTracking(true);
432  _ui->colorSchemeList->installEventFilter(this);
433  _ui->colorSchemeList->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
434 
435  connect(_ui->colorSchemeList->selectionModel(),
436  SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
437  this, SLOT(colorSchemeSelected()));
438  connect(_ui->colorSchemeList, SIGNAL(entered(QModelIndex)), this,
439  SLOT(previewColorScheme(QModelIndex)));
440 
441  updateColorSchemeButtons();
442 
443  connect(_ui->editColorSchemeButton, SIGNAL(clicked()), this,
444  SLOT(editColorScheme()));
445  connect(_ui->removeColorSchemeButton, SIGNAL(clicked()), this,
446  SLOT(removeColorScheme()));
447  connect(_ui->newColorSchemeButton, SIGNAL(clicked()), this,
448  SLOT(newColorScheme()));
449 
450  // setup font preview
451  const bool antialias = profile->antiAliasFonts();
452 
453  QFont profileFont = profile->font();
454  profileFont.setStyleStrategy(antialias ? QFont::PreferAntialias : QFont::NoAntialias);
455 
456  _ui->fontPreviewLabel->installEventFilter(this);
457  _ui->fontPreviewLabel->setFont(profileFont);
458  setFontInputValue(profileFont);
459 
460  connect(_ui->fontSizeInput, SIGNAL(valueChanged(double)), this,
461  SLOT(setFontSize(double)));
462  connect(_ui->selectFontButton, SIGNAL(clicked()), this,
463  SLOT(showFontDialog()));
464 
465  // setup font smoothing
466  _ui->antialiasTextButton->setChecked(antialias);
467  connect(_ui->antialiasTextButton, SIGNAL(toggled(bool)), this,
468  SLOT(setAntialiasText(bool)));
469 
470  _ui->boldIntenseButton->setChecked(profile->boldIntense());
471  connect(_ui->boldIntenseButton, SIGNAL(toggled(bool)), this,
472  SLOT(setBoldIntense(bool)));
473  _ui->enableMouseWheelZoomButton->setChecked(profile->mouseWheelZoomEnabled());
474  connect(_ui->enableMouseWheelZoomButton, SIGNAL(toggled(bool)), this,
475  SLOT(toggleMouseWheelZoom(bool)));
476 }
477 void EditProfileDialog::setAntialiasText(bool enable)
478 {
479  QFont profileFont = _ui->fontPreviewLabel->font();
480  profileFont.setStyleStrategy(enable ? QFont::PreferAntialias : QFont::NoAntialias);
481 
482  // update preview to reflect text smoothing state
483  fontSelected(profileFont);
484  updateTempProfileProperty(Profile::AntiAliasFonts, enable);
485 }
486 void EditProfileDialog::setBoldIntense(bool enable)
487 {
488  preview(Profile::BoldIntense, enable);
489  updateTempProfileProperty(Profile::BoldIntense, enable);
490 }
491 void EditProfileDialog::toggleMouseWheelZoom(bool enable)
492 {
493  updateTempProfileProperty(Profile::MouseWheelZoomEnabled, enable);
494 }
495 void EditProfileDialog::updateColorSchemeList(bool selectCurrentScheme)
496 {
497  if (!_ui->colorSchemeList->model())
498  _ui->colorSchemeList->setModel(new QStandardItemModel(this));
499 
500  const QString& name = lookupProfile()->colorScheme();
501  const ColorScheme* currentScheme = ColorSchemeManager::instance()->findColorScheme(name);
502 
503  QStandardItemModel* model = qobject_cast<QStandardItemModel*>(_ui->colorSchemeList->model());
504 
505  Q_ASSERT(model);
506 
507  model->clear();
508 
509  QStandardItem* selectedItem = 0;
510 
511  QList<const ColorScheme*> schemeList = ColorSchemeManager::instance()->allColorSchemes();
512 
513  foreach(const ColorScheme* scheme, schemeList) {
514  QStandardItem* item = new QStandardItem(scheme->description());
515  item->setData(QVariant::fromValue(scheme) , Qt::UserRole + 1);
516  item->setFlags(item->flags());
517 
518  if (currentScheme == scheme)
519  selectedItem = item;
520 
521  model->appendRow(item);
522  }
523 
524  model->sort(0);
525 
526  if (selectCurrentScheme && selectedItem) {
527  _ui->colorSchemeList->updateGeometry();
528  _ui->colorSchemeList->selectionModel()->setCurrentIndex(selectedItem->index() ,
529  QItemSelectionModel::Select);
530 
531  // update transparency warning label
532  updateTransparencyWarning();
533  }
534 }
535 void EditProfileDialog::updateKeyBindingsList(bool selectCurrentTranslator)
536 {
537  if (!_ui->keyBindingList->model())
538  _ui->keyBindingList->setModel(new QStandardItemModel(this));
539 
540  const QString& name = lookupProfile()->keyBindings();
541 
542  KeyboardTranslatorManager* keyManager = KeyboardTranslatorManager::instance();
543  const KeyboardTranslator* currentTranslator = keyManager->findTranslator(name);
544 
545  QStandardItemModel* model = qobject_cast<QStandardItemModel*>(_ui->keyBindingList->model());
546 
547  Q_ASSERT(model);
548 
549  model->clear();
550 
551  QStandardItem* selectedItem = 0;
552 
553  QStringList translatorNames = keyManager->allTranslators();
554  foreach(const QString& translatorName, translatorNames) {
555  const KeyboardTranslator* translator = keyManager->findTranslator(translatorName);
556 
557  QStandardItem* item = new QStandardItem(translator->description());
558  item->setEditable(false);
559  item->setData(QVariant::fromValue(translator), Qt::UserRole + 1);
560  item->setIcon(KIcon("preferences-desktop-keyboard"));
561 
562  if (translator == currentTranslator)
563  selectedItem = item;
564 
565  model->appendRow(item);
566  }
567 
568  model->sort(0);
569 
570  if (selectCurrentTranslator && selectedItem) {
571  _ui->keyBindingList->selectionModel()->setCurrentIndex(selectedItem->index() ,
572  QItemSelectionModel::Select);
573  }
574 }
575 bool EditProfileDialog::eventFilter(QObject* watched , QEvent* aEvent)
576 {
577  if (watched == _ui->colorSchemeList && aEvent->type() == QEvent::Leave) {
578  if (_tempProfile->isPropertySet(Profile::ColorScheme))
579  preview(Profile::ColorScheme, _tempProfile->colorScheme());
580  else
581  unpreview(Profile::ColorScheme);
582  }
583  if (watched == _ui->fontPreviewLabel && aEvent->type() == QEvent::FontChange) {
584  const QFont& labelFont = _ui->fontPreviewLabel->font();
585  _ui->fontPreviewLabel->setText(i18n("%1", labelFont.family()));
586  }
587 
588  return KDialog::eventFilter(watched, aEvent);
589 }
590 void EditProfileDialog::unpreviewAll()
591 {
592  _delayedPreviewTimer->stop();
593  _delayedPreviewProperties.clear();
594 
595  QHash<Profile::Property, QVariant> map;
596  QHashIterator<int, QVariant> iter(_previewedProperties);
597  while (iter.hasNext()) {
598  iter.next();
599  map.insert((Profile::Property)iter.key(), iter.value());
600  }
601 
602  // undo any preview changes
603  if (!map.isEmpty())
604  ProfileManager::instance()->changeProfile(_profile, map, false);
605 }
606 void EditProfileDialog::unpreview(int aProperty)
607 {
608  _delayedPreviewProperties.remove(aProperty);
609 
610  if (!_previewedProperties.contains(aProperty))
611  return;
612 
613  QHash<Profile::Property, QVariant> map;
614  map.insert((Profile::Property)aProperty, _previewedProperties[aProperty]);
615  ProfileManager::instance()->changeProfile(_profile, map, false);
616 
617  _previewedProperties.remove(aProperty);
618 }
619 void EditProfileDialog::delayedPreview(int aProperty , const QVariant& value)
620 {
621  _delayedPreviewProperties.insert(aProperty, value);
622 
623  _delayedPreviewTimer->stop();
624  _delayedPreviewTimer->start(300);
625 }
626 void EditProfileDialog::delayedPreviewActivate()
627 {
628  Q_ASSERT(qobject_cast<QTimer*>(sender()));
629 
630  QMutableHashIterator<int, QVariant> iter(_delayedPreviewProperties);
631  if (iter.hasNext()) {
632  iter.next();
633  preview(iter.key(), iter.value());
634  }
635 }
636 void EditProfileDialog::preview(int aProperty , const QVariant& value)
637 {
638  QHash<Profile::Property, QVariant> map;
639  map.insert((Profile::Property)aProperty, value);
640 
641  _delayedPreviewProperties.remove(aProperty);
642 
643  const Profile::Ptr original = lookupProfile();
644 
645  // skip previews for profile groups if the profiles in the group
646  // have conflicting original values for the property
647  //
648  // TODO - Save the original values for each profile and use to unpreview properties
649  ProfileGroup::Ptr group = original->asGroup();
650  if (group && group->profiles().count() > 1 &&
651  original->property<QVariant>((Profile::Property)aProperty).isNull())
652  return;
653 
654  if (!_previewedProperties.contains(aProperty)) {
655  _previewedProperties.insert(aProperty , original->property<QVariant>((Profile::Property)aProperty));
656  }
657 
658  // temporary change to color scheme
659  ProfileManager::instance()->changeProfile(_profile , map , false);
660 }
661 void EditProfileDialog::previewColorScheme(const QModelIndex& index)
662 {
663  const QString& name = index.data(Qt::UserRole + 1).value<const ColorScheme*>()->name();
664 
665  delayedPreview(Profile::ColorScheme , name);
666 }
667 void EditProfileDialog::removeColorScheme()
668 {
669  QModelIndexList selected = _ui->colorSchemeList->selectionModel()->selectedIndexes();
670 
671  if (!selected.isEmpty()) {
672  const QString& name = selected.first().data(Qt::UserRole + 1).value<const ColorScheme*>()->name();
673 
674  if (ColorSchemeManager::instance()->deleteColorScheme(name))
675  _ui->colorSchemeList->model()->removeRow(selected.first().row());
676  }
677 }
678 void EditProfileDialog::showColorSchemeEditor(bool isNewScheme)
679 {
680  // Finding selected ColorScheme
681  QModelIndexList selected = _ui->colorSchemeList->selectionModel()->selectedIndexes();
682  QAbstractItemModel* model = _ui->colorSchemeList->model();
683  const ColorScheme* colors = 0;
684  if (!selected.isEmpty())
685  colors = model->data(selected.first(), Qt::UserRole + 1).value<const ColorScheme*>();
686  else
687  colors = ColorSchemeManager::instance()->defaultColorScheme();
688 
689  Q_ASSERT(colors);
690 
691  // Setting up ColorSchemeEditor ui
692  // close any running ColorSchemeEditor
693  if (_colorDialog) {
694  closeColorSchemeEditor();
695  }
696  _colorDialog = new ColorSchemeEditor(this);
697 
698  connect(_colorDialog, SIGNAL(colorSchemeSaveRequested(ColorScheme,bool)),
699  this, SLOT(saveColorScheme(ColorScheme,bool)));
700  _colorDialog->setup(colors, isNewScheme);
701 
702  _colorDialog->show();
703 }
704 void EditProfileDialog::closeColorSchemeEditor()
705 {
706  if (_colorDialog) {
707  _colorDialog->close();
708  delete _colorDialog;
709  }
710 }
711 void EditProfileDialog::newColorScheme()
712 {
713  showColorSchemeEditor(true);
714 }
715 void EditProfileDialog::editColorScheme()
716 {
717  showColorSchemeEditor(false);
718 }
719 void EditProfileDialog::saveColorScheme(const ColorScheme& scheme, bool isNewScheme)
720 {
721  ColorScheme* newScheme = new ColorScheme(scheme);
722 
723  // if this is a new color scheme, pick a name based on the description
724  if (isNewScheme) {
725  newScheme->setName(newScheme->description());
726  }
727 
728  ColorSchemeManager::instance()->addColorScheme(newScheme);
729 
730  updateColorSchemeList(true);
731 
732  preview(Profile::ColorScheme, newScheme->name());
733 }
734 void EditProfileDialog::colorSchemeSelected()
735 {
736  QModelIndexList selected = _ui->colorSchemeList->selectionModel()->selectedIndexes();
737 
738  if (!selected.isEmpty()) {
739  QAbstractItemModel* model = _ui->colorSchemeList->model();
740  const ColorScheme* colors = model->data(selected.first(), Qt::UserRole + 1).value<const ColorScheme*>();
741  if (colors) {
742  updateTempProfileProperty(Profile::ColorScheme, colors->name());
743  previewColorScheme(selected.first());
744 
745  updateTransparencyWarning();
746  }
747  }
748 
749  updateColorSchemeButtons();
750 }
751 void EditProfileDialog::updateColorSchemeButtons()
752 {
753  enableIfNonEmptySelection(_ui->editColorSchemeButton, _ui->colorSchemeList->selectionModel());
754  enableIfNonEmptySelection(_ui->removeColorSchemeButton, _ui->colorSchemeList->selectionModel());
755 }
756 void EditProfileDialog::updateKeyBindingsButtons()
757 {
758  enableIfNonEmptySelection(_ui->editKeyBindingsButton, _ui->keyBindingList->selectionModel());
759  enableIfNonEmptySelection(_ui->removeKeyBindingsButton, _ui->keyBindingList->selectionModel());
760 }
761 void EditProfileDialog::enableIfNonEmptySelection(QWidget* widget, QItemSelectionModel* selectionModel)
762 {
763  widget->setEnabled(selectionModel->hasSelection());
764 }
765 void EditProfileDialog::updateTransparencyWarning()
766 {
767  // zero or one indexes can be selected
768  foreach(const QModelIndex & index , _ui->colorSchemeList->selectionModel()->selectedIndexes()) {
769  bool needTransparency = index.data(Qt::UserRole + 1).value<const ColorScheme*>()->opacity() < 1.0;
770 
771  if (!needTransparency) {
772  _ui->transparencyWarningWidget->setHidden(true);
773  } else if (!KWindowSystem::compositingActive()) {
774  _ui->transparencyWarningWidget->setText(i18n("This color scheme uses a transparent background"
775  " which does not appear to be supported on your"
776  " desktop"));
777  _ui->transparencyWarningWidget->setHidden(false);
778  } else if (!WindowSystemInfo::HAVE_TRANSPARENCY) {
779  _ui->transparencyWarningWidget->setText(i18n("Konsole was started before desktop effects were enabled."
780  " You need to restart Konsole to see transparent background."));
781  _ui->transparencyWarningWidget->setHidden(false);
782  }
783  }
784 }
785 
786 void EditProfileDialog::createTempProfile()
787 {
788  _tempProfile = Profile::Ptr(new Profile);
789  _tempProfile->setHidden(true);
790 }
791 
792 void EditProfileDialog::updateTempProfileProperty(Profile::Property aProperty, const QVariant & value)
793 {
794  _tempProfile->setProperty(aProperty, value);
795  updateButtonApply();
796 }
797 
798 void EditProfileDialog::updateButtonApply()
799 {
800  bool userModified = false;
801 
802  QHashIterator<Profile::Property, QVariant> iter(_tempProfile->setProperties());
803  while (iter.hasNext()) {
804  iter.next();
805 
806  Profile::Property aProperty = iter.key();
807  QVariant value = iter.value();
808 
809  // for previewed property
810  if (_previewedProperties.contains(static_cast<int>(aProperty))) {
811  if (value != _previewedProperties.value(static_cast<int>(aProperty))) {
812  userModified = true;
813  break;
814  }
815  // for not-previewed property
816  } else if ((value != _profile->property<QVariant>(aProperty))) {
817  userModified = true;
818  break;
819  }
820  }
821 
822  enableButtonApply(userModified);
823 }
824 
825 void EditProfileDialog::setupKeyboardPage(const Profile::Ptr /* profile */)
826 {
827  // setup translator list
828  updateKeyBindingsList(true);
829 
830  connect(_ui->keyBindingList->selectionModel(),
831  SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
832  SLOT(keyBindingSelected()));
833  connect(_ui->newKeyBindingsButton, SIGNAL(clicked()), this,
834  SLOT(newKeyBinding()));
835 
836  updateKeyBindingsButtons();
837 
838  connect(_ui->editKeyBindingsButton, SIGNAL(clicked()), this,
839  SLOT(editKeyBinding()));
840  connect(_ui->removeKeyBindingsButton, SIGNAL(clicked()), this,
841  SLOT(removeKeyBinding()));
842 }
843 void EditProfileDialog::keyBindingSelected()
844 {
845  QModelIndexList selected = _ui->keyBindingList->selectionModel()->selectedIndexes();
846 
847  if (!selected.isEmpty()) {
848  QAbstractItemModel* model = _ui->keyBindingList->model();
849  const KeyboardTranslator* translator = model->data(selected.first(), Qt::UserRole + 1)
850  .value<const KeyboardTranslator*>();
851  if (translator) {
852  updateTempProfileProperty(Profile::KeyBindings, translator->name());
853  }
854  }
855 
856  updateKeyBindingsButtons();
857 }
858 void EditProfileDialog::removeKeyBinding()
859 {
860  QModelIndexList selected = _ui->keyBindingList->selectionModel()->selectedIndexes();
861 
862  if (!selected.isEmpty()) {
863  const QString& name = selected.first().data(Qt::UserRole + 1).value<const KeyboardTranslator*>()->name();
864  if (KeyboardTranslatorManager::instance()->deleteTranslator(name))
865  _ui->keyBindingList->model()->removeRow(selected.first().row());
866  }
867 }
868 void EditProfileDialog::showKeyBindingEditor(bool isNewTranslator)
869 {
870  QModelIndexList selected = _ui->keyBindingList->selectionModel()->selectedIndexes();
871  QAbstractItemModel* model = _ui->keyBindingList->model();
872 
873  const KeyboardTranslator* translator = 0;
874  if (!selected.isEmpty())
875  translator = model->data(selected.first(), Qt::UserRole + 1).value<const KeyboardTranslator*>();
876  else
877  translator = KeyboardTranslatorManager::instance()->defaultTranslator();
878 
879  Q_ASSERT(translator);
880 
881  QWeakPointer<KDialog> dialog = new KDialog(this);
882 
883  if (isNewTranslator)
884  dialog.data()->setCaption(i18n("New Key Binding List"));
885  else
886  dialog.data()->setCaption(i18n("Edit Key Binding List"));
887 
888  KeyBindingEditor* editor = new KeyBindingEditor;
889  dialog.data()->setMainWidget(editor);
890 
891  if (translator)
892  editor->setup(translator);
893 
894  if (isNewTranslator)
895  editor->setDescription(i18n("New Key Binding List"));
896 
897  if (dialog.data()->exec() == QDialog::Accepted) {
898  KeyboardTranslator* newTranslator = new KeyboardTranslator(*editor->translator());
899 
900  if (isNewTranslator)
901  newTranslator->setName(newTranslator->description());
902 
903  KeyboardTranslatorManager::instance()->addTranslator(newTranslator);
904 
905  updateKeyBindingsList();
906 
907  const QString& currentTranslator = lookupProfile()
908  ->property<QString>(Profile::KeyBindings);
909 
910  if (newTranslator->name() == currentTranslator) {
911  updateTempProfileProperty(Profile::KeyBindings, newTranslator->name());
912  }
913  }
914  delete dialog.data();
915 }
916 void EditProfileDialog::newKeyBinding()
917 {
918  showKeyBindingEditor(true);
919 }
920 void EditProfileDialog::editKeyBinding()
921 {
922  showKeyBindingEditor(false);
923 }
924 void EditProfileDialog::setupCheckBoxes(BooleanOption* options , const Profile::Ptr profile)
925 {
926  while (options->button != 0) {
927  options->button->setChecked(profile->property<bool>(options->property));
928  connect(options->button, SIGNAL(toggled(bool)), this, options->slot);
929 
930  ++options;
931  }
932 }
933 void EditProfileDialog::setupRadio(RadioOption* possibilities , int actual)
934 {
935  while (possibilities->button != 0) {
936  if (possibilities->value == actual)
937  possibilities->button->setChecked(true);
938  else
939  possibilities->button->setChecked(false);
940 
941  connect(possibilities->button, SIGNAL(clicked()), this, possibilities->slot);
942 
943  ++possibilities;
944  }
945 }
946 
947 void EditProfileDialog::setupScrollingPage(const Profile::Ptr profile)
948 {
949  // setup scrollbar radio
950  int scrollBarPosition = profile->property<int>(Profile::ScrollBarPosition);
951 
952  RadioOption positions[] = { {_ui->scrollBarHiddenButton, Enum::ScrollBarHidden, SLOT(hideScrollBar())},
953  {_ui->scrollBarLeftButton, Enum::ScrollBarLeft, SLOT(showScrollBarLeft())},
954  {_ui->scrollBarRightButton, Enum::ScrollBarRight, SLOT(showScrollBarRight())},
955  {0, 0, 0}
956  };
957 
958  setupRadio(positions , scrollBarPosition);
959 
960  // setup scrollback type radio
961  int scrollBackType = profile->property<int>(Profile::HistoryMode);
962  _ui->historySizeWidget->setMode(Enum::HistoryModeEnum(scrollBackType));
963  connect(_ui->historySizeWidget, SIGNAL(historyModeChanged(Enum::HistoryModeEnum)),
964  this, SLOT(historyModeChanged(Enum::HistoryModeEnum)));
965 
966  // setup scrollback line count spinner
967  const int historySize = profile->historySize();
968  _ui->historySizeWidget->setLineCount(historySize);
969 
970  // setup scrollpageamount type radio
971  int scrollFullPage = profile->property<int>(Profile::ScrollFullPage);
972 
973  RadioOption pageamounts[] = {
974  {_ui->scrollHalfPage, Enum::ScrollPageHalf, SLOT(scrollHalfPage())},
975  {_ui->scrollFullPage, Enum::ScrollPageFull, SLOT(scrollFullPage())},
976  {0, 0, 0}
977  };
978 
979  setupRadio(pageamounts, scrollFullPage);
980 
981  // signals and slots
982  connect(_ui->historySizeWidget, SIGNAL(historySizeChanged(int)),
983  this, SLOT(historySizeChanged(int)));
984 }
985 
986 void EditProfileDialog::historySizeChanged(int lineCount)
987 {
988  updateTempProfileProperty(Profile::HistorySize , lineCount);
989 }
990 void EditProfileDialog::historyModeChanged(Enum::HistoryModeEnum mode)
991 {
992  updateTempProfileProperty(Profile::HistoryMode, mode);
993 }
994 void EditProfileDialog::hideScrollBar()
995 {
996  updateTempProfileProperty(Profile::ScrollBarPosition, Enum::ScrollBarHidden);
997 }
998 void EditProfileDialog::showScrollBarLeft()
999 {
1000  updateTempProfileProperty(Profile::ScrollBarPosition, Enum::ScrollBarLeft);
1001 }
1002 void EditProfileDialog::showScrollBarRight()
1003 {
1004  updateTempProfileProperty(Profile::ScrollBarPosition, Enum::ScrollBarRight);
1005 }
1006 void EditProfileDialog::scrollFullPage()
1007 {
1008  updateTempProfileProperty(Profile::ScrollFullPage, Enum::ScrollPageFull);
1009 }
1010 void EditProfileDialog::scrollHalfPage()
1011 {
1012  updateTempProfileProperty(Profile::ScrollFullPage, Enum::ScrollPageHalf);
1013 }
1014 void EditProfileDialog::setupMousePage(const Profile::Ptr profile)
1015 {
1016  BooleanOption options[] = { {
1017  _ui->underlineLinksButton , Profile::UnderlineLinksEnabled,
1018  SLOT(toggleUnderlineLinks(bool))
1019  },
1020  {
1021  _ui->ctrlRequiredForDragButton, Profile::CtrlRequiredForDrag,
1022  SLOT(toggleCtrlRequiredForDrag(bool))
1023  },
1024  {
1025  _ui->copyTextToClipboardButton , Profile::AutoCopySelectedText,
1026  SLOT(toggleCopyTextToClipboard(bool))
1027  },
1028  {
1029  _ui->trimTrailingSpacesButton , Profile::TrimTrailingSpacesInSelectedText,
1030  SLOT(toggleTrimTrailingSpacesInSelectedText(bool))
1031  },
1032  {
1033  _ui->openLinksByDirectClickButton , Profile::OpenLinksByDirectClickEnabled,
1034  SLOT(toggleOpenLinksByDirectClick(bool))
1035  },
1036  { 0 , Profile::Property(0) , 0 }
1037  };
1038  setupCheckBoxes(options , profile);
1039 
1040  // setup middle click paste mode
1041  const int middleClickPasteMode = profile->property<int>(Profile::MiddleClickPasteMode);
1042  RadioOption pasteModes[] = {
1043  {_ui->pasteFromX11SelectionButton, Enum::PasteFromX11Selection, SLOT(pasteFromX11Selection())},
1044  {_ui->pasteFromClipboardButton, Enum::PasteFromClipboard, SLOT(pasteFromClipboard())},
1045  {0, 0, 0}
1046  };
1047  setupRadio(pasteModes , middleClickPasteMode);
1048 
1049  // interaction options
1050  _ui->wordCharacterEdit->setText(profile->wordCharacters());
1051 
1052  connect(_ui->wordCharacterEdit, SIGNAL(textChanged(QString)), this,
1053  SLOT(wordCharactersChanged(QString)));
1054 
1055  int tripleClickMode = profile->property<int>(Profile::TripleClickMode);
1056  _ui->tripleClickModeCombo->setCurrentIndex(tripleClickMode);
1057 
1058  connect(_ui->tripleClickModeCombo, SIGNAL(activated(int)), this,
1059  SLOT(TripleClickModeChanged(int)));
1060 
1061  _ui->openLinksByDirectClickButton->setEnabled(_ui->underlineLinksButton->isChecked());
1062 
1063  _ui->enableMouseWheelZoomButton->setChecked(profile->mouseWheelZoomEnabled());
1064  connect(_ui->enableMouseWheelZoomButton, SIGNAL(toggled(bool)), this,
1065  SLOT(toggleMouseWheelZoom(bool)));
1066 }
1067 void EditProfileDialog::setupAdvancedPage(const Profile::Ptr profile)
1068 {
1069  BooleanOption options[] = { {
1070  _ui->enableBlinkingTextButton , Profile::BlinkingTextEnabled ,
1071  SLOT(toggleBlinkingText(bool))
1072  },
1073  {
1074  _ui->enableFlowControlButton , Profile::FlowControlEnabled ,
1075  SLOT(toggleFlowControl(bool))
1076  },
1077  {
1078  _ui->enableBlinkingCursorButton , Profile::BlinkingCursorEnabled ,
1079  SLOT(toggleBlinkingCursor(bool))
1080  },
1081  {
1082  _ui->enableBidiRenderingButton , Profile::BidiRenderingEnabled ,
1083  SLOT(togglebidiRendering(bool))
1084  },
1085  { 0 , Profile::Property(0) , 0 }
1086  };
1087  setupCheckBoxes(options , profile);
1088 
1089  const int lineSpacing = profile->lineSpacing();
1090  _ui->lineSpacingSpinner->setValue(lineSpacing);
1091 
1092  connect(_ui->lineSpacingSpinner, SIGNAL(valueChanged(int)),
1093  this, SLOT(lineSpacingChanged(int)));
1094 
1095  // cursor options
1096  if (profile->useCustomCursorColor())
1097  _ui->customCursorColorButton->setChecked(true);
1098  else
1099  _ui->autoCursorColorButton->setChecked(true);
1100 
1101  _ui->customColorSelectButton->setColor(profile->customCursorColor());
1102 
1103  connect(_ui->customCursorColorButton, SIGNAL(clicked()), this, SLOT(customCursorColor()));
1104  connect(_ui->autoCursorColorButton, SIGNAL(clicked()), this, SLOT(autoCursorColor()));
1105  connect(_ui->customColorSelectButton, SIGNAL(changed(QColor)),
1106  SLOT(customCursorColorChanged(QColor)));
1107 
1108  int shape = profile->property<int>(Profile::CursorShape);
1109  _ui->cursorShapeCombo->setCurrentIndex(shape);
1110 
1111  connect(_ui->cursorShapeCombo, SIGNAL(activated(int)), this, SLOT(setCursorShape(int)));
1112 
1113  // encoding options
1114  QAction* codecAction = new KCodecAction(this);
1115  _ui->selectEncodingButton->setMenu(codecAction->menu());
1116  connect(codecAction, SIGNAL(triggered(QTextCodec*)), this, SLOT(setDefaultCodec(QTextCodec*)));
1117 
1118  _ui->characterEncodingLabel->setText(profile->defaultEncoding());
1119 }
1120 void EditProfileDialog::setDefaultCodec(QTextCodec* codec)
1121 {
1122  QString name = QString(codec->name());
1123 
1124  updateTempProfileProperty(Profile::DefaultEncoding, name);
1125  _ui->characterEncodingLabel->setText(codec->name());
1126 }
1127 void EditProfileDialog::customCursorColorChanged(const QColor& color)
1128 {
1129  updateTempProfileProperty(Profile::CustomCursorColor, color);
1130 
1131  // ensure that custom cursor colors are enabled
1132  _ui->customCursorColorButton->click();
1133 }
1134 void EditProfileDialog::wordCharactersChanged(const QString& text)
1135 {
1136  updateTempProfileProperty(Profile::WordCharacters, text);
1137 }
1138 void EditProfileDialog::autoCursorColor()
1139 {
1140  updateTempProfileProperty(Profile::UseCustomCursorColor, false);
1141 }
1142 void EditProfileDialog::customCursorColor()
1143 {
1144  updateTempProfileProperty(Profile::UseCustomCursorColor, true);
1145 }
1146 void EditProfileDialog::setCursorShape(int index)
1147 {
1148  updateTempProfileProperty(Profile::CursorShape, index);
1149 }
1150 void EditProfileDialog::togglebidiRendering(bool enable)
1151 {
1152  updateTempProfileProperty(Profile::BidiRenderingEnabled, enable);
1153 }
1154 void EditProfileDialog::lineSpacingChanged(int spacing)
1155 {
1156  updateTempProfileProperty(Profile::LineSpacing, spacing);
1157 }
1158 void EditProfileDialog::toggleBlinkingCursor(bool enable)
1159 {
1160  updateTempProfileProperty(Profile::BlinkingCursorEnabled, enable);
1161 }
1162 void EditProfileDialog::toggleUnderlineLinks(bool enable)
1163 {
1164  updateTempProfileProperty(Profile::UnderlineLinksEnabled, enable);
1165  _ui->openLinksByDirectClickButton->setEnabled(enable);
1166 }
1167 void EditProfileDialog::toggleCtrlRequiredForDrag(bool enable)
1168 {
1169  updateTempProfileProperty(Profile::CtrlRequiredForDrag, enable);
1170 }
1171 void EditProfileDialog::toggleOpenLinksByDirectClick(bool enable)
1172 {
1173  updateTempProfileProperty(Profile::OpenLinksByDirectClickEnabled, enable);
1174 }
1175 void EditProfileDialog::toggleCopyTextToClipboard(bool enable)
1176 {
1177  updateTempProfileProperty(Profile::AutoCopySelectedText, enable);
1178 }
1179 void EditProfileDialog::toggleTrimTrailingSpacesInSelectedText(bool enable)
1180 {
1181  updateTempProfileProperty(Profile::TrimTrailingSpacesInSelectedText, enable);
1182 }
1183 void EditProfileDialog::pasteFromX11Selection()
1184 {
1185  updateTempProfileProperty(Profile::MiddleClickPasteMode, Enum::PasteFromX11Selection);
1186 }
1187 void EditProfileDialog::pasteFromClipboard()
1188 {
1189  updateTempProfileProperty(Profile::MiddleClickPasteMode, Enum::PasteFromClipboard);
1190 }
1191 void EditProfileDialog::TripleClickModeChanged(int newValue)
1192 {
1193  updateTempProfileProperty(Profile::TripleClickMode, newValue);
1194 }
1195 void EditProfileDialog::toggleBlinkingText(bool enable)
1196 {
1197  updateTempProfileProperty(Profile::BlinkingTextEnabled, enable);
1198 }
1199 void EditProfileDialog::toggleFlowControl(bool enable)
1200 {
1201  updateTempProfileProperty(Profile::FlowControlEnabled, enable);
1202 }
1203 void EditProfileDialog::fontSelected(const QFont& aFont)
1204 {
1205  QFont previewFont = aFont;
1206 
1207  setFontInputValue(aFont);
1208 
1209  _ui->fontPreviewLabel->setFont(previewFont);
1210 
1211  preview(Profile::Font, aFont);
1212  updateTempProfileProperty(Profile::Font, aFont);
1213 }
1214 void EditProfileDialog::showFontDialog()
1215 {
1216  QString sampleText = QString("ell 'lL', one '1', little eye 'i', big eye");
1217  sampleText += QString("'I', lL1iI, Zero '0', little oh 'o', big oh 'O', 0oO");
1218  sampleText += QString("`~!@#$%^&*()_+-=[]\\{}|:\";'<>?,./");
1219  sampleText += QString("0123456789");
1220  sampleText += QString("\nThe Quick Brown Fox Jumps Over The Lazy Dog\n");
1221  sampleText += i18n("--- Type anything in this box ---");
1222  QFont currentFont = _ui->fontPreviewLabel->font();
1223 
1224  QWeakPointer<KFontDialog> dialog = new KFontDialog(this, KFontChooser::FixedFontsOnly);
1225  dialog.data()->setCaption(i18n("Select Fixed Width Font"));
1226  dialog.data()->setFont(currentFont, true);
1227 
1228  // TODO (hindenburg): When https://git.reviewboard.kde.org/r/103357 is
1229  // committed, change the below.
1230  // Use text more fitting to show font differences in a terminal
1231  QList<KFontChooser*> chooserList = dialog.data()->findChildren<KFontChooser*>();
1232  if (!chooserList.isEmpty())
1233  chooserList.at(0)->setSampleText(sampleText);
1234 
1235  connect(dialog.data(), SIGNAL(fontSelected(QFont)), this, SLOT(fontSelected(QFont)));
1236 
1237  if (dialog.data()->exec() == QDialog::Rejected)
1238  fontSelected(currentFont);
1239  delete dialog.data();
1240 }
1241 void EditProfileDialog::setFontSize(double pointSize)
1242 {
1243  QFont newFont = _ui->fontPreviewLabel->font();
1244  newFont.setPointSizeF(pointSize);
1245  _ui->fontPreviewLabel->setFont(newFont);
1246 
1247  preview(Profile::Font, newFont);
1248  updateTempProfileProperty(Profile::Font, newFont);
1249 }
1250 
1251 void EditProfileDialog::setFontInputValue(const QFont& aFont)
1252 {
1253  _ui->fontSizeInput->setValue(aFont.pointSizeF());
1254 }
1255 
1256 ColorSchemeViewDelegate::ColorSchemeViewDelegate(QObject* aParent)
1257  : QAbstractItemDelegate(aParent)
1258 {
1259 }
1260 
1261 void ColorSchemeViewDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option,
1262  const QModelIndex& index) const
1263 {
1264  const ColorScheme* scheme = index.data(Qt::UserRole + 1).value<const ColorScheme*>();
1265  Q_ASSERT(scheme);
1266  if (!scheme)
1267  return;
1268 
1269  bool transparencyAvailable = KWindowSystem::compositingActive();
1270 
1271  painter->setRenderHint(QPainter::Antialiasing);
1272 
1273  // draw background
1274  painter->setPen(QPen(scheme->foregroundColor() , 1));
1275 
1276  // radial gradient for background
1277  // from a lightened version of the scheme's background color in the center to
1278  // a darker version at the outer edge
1279  QColor color = scheme->backgroundColor();
1280  QRectF backgroundRect = QRectF(option.rect).adjusted(1.5, 1.5, -1.5, -1.5);
1281 
1282  QRadialGradient backgroundGradient(backgroundRect.center() , backgroundRect.width() / 2);
1283  backgroundGradient.setColorAt(0 , color.lighter(105));
1284  backgroundGradient.setColorAt(1 , color.darker(115));
1285 
1286  const int backgroundRectXRoundness = 4;
1287  const int backgroundRectYRoundness = 30;
1288 
1289  QPainterPath backgroundRectPath(backgroundRect.topLeft());
1290  backgroundRectPath.addRoundRect(backgroundRect , backgroundRectXRoundness , backgroundRectYRoundness);
1291 
1292  if (transparencyAvailable) {
1293  painter->save();
1294  color.setAlphaF(scheme->opacity());
1295  painter->setCompositionMode(QPainter::CompositionMode_Source);
1296  painter->setBrush(backgroundGradient);
1297 
1298  painter->drawPath(backgroundRectPath);
1299  painter->restore();
1300  } else {
1301  painter->setBrush(backgroundGradient);
1302  painter->drawPath(backgroundRectPath);
1303  }
1304 
1305  // draw stripe at the side using scheme's foreground color
1306  painter->setPen(QPen(Qt::NoPen));
1307  QPainterPath path(option.rect.topLeft());
1308  path.lineTo(option.rect.width() / 10.0 , option.rect.top());
1309  path.lineTo(option.rect.bottomLeft());
1310  path.lineTo(option.rect.topLeft());
1311  painter->setBrush(scheme->foregroundColor());
1312  painter->drawPath(path.intersected(backgroundRectPath));
1313 
1314  // draw highlight
1315  // with a linear gradient going from translucent white to transparent
1316  QLinearGradient gradient(option.rect.topLeft() , option.rect.bottomLeft());
1317  gradient.setColorAt(0 , QColor(255, 255, 255, 90));
1318  gradient.setColorAt(1 , Qt::transparent);
1319  painter->setBrush(gradient);
1320  painter->drawRoundRect(backgroundRect , 4 , 30);
1321 
1322  const bool isSelected = option.state & QStyle::State_Selected;
1323 
1324  // draw border on selected items
1325  if (isSelected) {
1326  static const int selectedBorderWidth = 6;
1327 
1328  painter->setBrush(QBrush(Qt::NoBrush));
1329  QPen pen;
1330 
1331  QColor highlightColor = option.palette.highlight().color();
1332  highlightColor.setAlphaF(1.0);
1333 
1334  pen.setBrush(highlightColor);
1335  pen.setWidth(selectedBorderWidth);
1336  pen.setJoinStyle(Qt::MiterJoin);
1337 
1338  painter->setPen(pen);
1339 
1340  painter->drawRect(option.rect.adjusted(selectedBorderWidth / 2,
1341  selectedBorderWidth / 2,
1342  -selectedBorderWidth / 2,
1343  -selectedBorderWidth / 2));
1344  }
1345 
1346  // draw color scheme name using scheme's foreground color
1347  QPen pen(scheme->foregroundColor());
1348  painter->setPen(pen);
1349 
1350  painter->drawText(option.rect , Qt::AlignCenter ,
1351  index.data(Qt::DisplayRole).value<QString>());
1352 }
1353 
1354 QSize ColorSchemeViewDelegate::sizeHint(const QStyleOptionViewItem& option,
1355  const QModelIndex& /*index*/) const
1356 {
1357  const int width = 200;
1358  qreal colorWidth = (qreal)width / TABLE_COLORS;
1359  int margin = 5;
1360  qreal heightForWidth = (colorWidth * 2) + option.fontMetrics.height() + margin;
1361 
1362  // temporary
1363  return QSize(width, static_cast<int>(heightForWidth));
1364 }
1365 
1366 #include "EditProfileDialog.moc"
Konsole::KeyboardTranslatorManager::addTranslator
void addTranslator(KeyboardTranslator *translator)
Adds a new translator.
Definition: KeyboardTranslatorManager.cpp:54
QModelIndex
TABLE_COLORS
#define TABLE_COLORS
Definition: CharacterColor.h:117
Konsole::Profile::HistoryMode
(HistoryModeEnum) Specifies the storage type used for keeping the output produced by terminal session...
Definition: Profile.h:137
Konsole::Profile::DefaultEncoding
(String) Default text codec
Definition: Profile.h:221
Konsole::KeyboardTranslator
A converter which maps between key sequences pressed by the user and the character strings which shou...
Definition: KeyboardTranslator.h:52
QEvent
QStandardItemModel
QWidget
Konsole::Profile::AntiAliasFonts
(bool) Whether fonts should be aliased or not
Definition: Profile.h:223
QEvent::type
Type type() const
QHash::insert
iterator insert(const Key &key, const T &value)
QColor::darker
QColor darker(int factor) const
QStandardItem::setIcon
void setIcon(const QIcon &icon)
Konsole::Profile::ShowTerminalSizeHint
(bool) Specifies whether show hint for terminal size after resizing the application window...
Definition: Profile.h:120
QTextCodec::name
virtual QByteArray name() const =0
QPainter::setCompositionMode
void setCompositionMode(CompositionMode mode)
QPainter::setRenderHint
void setRenderHint(RenderHint hint, bool on)
QMutableHashIterator
Konsole::KeyboardTranslator::description
QString description() const
Returns the descriptive name of this keyboard translator.
Definition: KeyboardTranslator.cpp:641
QFont::pointSizeF
qreal pointSizeF() const
QStandardItem::flags
Qt::ItemFlags flags() const
Konsole::Profile::FlowControlEnabled
(bool) Specifies whether the flow control keys (typically Ctrl+S, Ctrl+Q) have any effect...
Definition: Profile.h:165
Konsole::Profile::CustomCursorColor
(QColor) The color used by terminal displays to draw the cursor.
Definition: Profile.h:187
QStandardItemModel::clear
void clear()
QGradient::setColorAt
void setColorAt(qreal position, const QColor &color)
KeyboardTranslatorManager.h
QFont
QVector::fill
QVector< T > & fill(const T &value, int size)
QList::at
const T & at(int i) const
Konsole::Profile::RemoteTabTitleFormat
(QString) The format used for tab titles when the session is running a remote command (eg...
Definition: Profile.h:116
Konsole::Profile::TrimTrailingSpacesInSelectedText
(bool) If true, trailing spaces are trimmed in selected text
Definition: Profile.h:209
QPainter::save
void save()
Konsole::ProfileGroup::Ptr
KSharedPtr< ProfileGroup > Ptr
Definition: Profile.h:602
QVariant::value
T value() const
Konsole::Profile::KeyBindings
(QString) The name of the key bindings.
Definition: Profile.h:131
Konsole::Enum::ScrollPageFull
Scroll full page.
Definition: Enumeration.h:74
QPen::setJoinStyle
void setJoinStyle(Qt::PenJoinStyle style)
QWeakPointer::data
T * data() const
QBrush
Konsole::Enum::PasteFromX11Selection
Paste from X11 Selection.
Definition: Enumeration.h:102
KDialog
Konsole::Profile::WordCharacters
(QString) A string consisting of the characters used to delimit words when selecting text in the term...
Definition: Profile.h:191
Konsole::Profile::SilenceSeconds
(int) Specifies the threshold of detected silence in seconds.
Definition: Profile.h:232
Konsole::ColorSchemeViewDelegate::paint
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: EditProfileDialog.cpp:1261
Konsole::Profile::MiddleClickPasteMode
(MiddleClickPasteModeEnum) Specifies the source from which mouse middle click pastes data...
Definition: Profile.h:219
Konsole::Profile::Font
(QFont) The font to use in terminal displays using this profile.
Definition: Profile.h:122
Konsole::Profile
Represents a terminal set-up which can be used to set the initial state of new terminal sessions or a...
Definition: Profile.h:60
QLinearGradient
ShellCommand.h
QPen::setBrush
void setBrush(const QBrush &brush)
Konsole::Profile::Property
Property
This enum describes the available properties which a Profile may consist of.
Definition: Profile.h:77
Konsole::ColorSchemeViewDelegate::ColorSchemeViewDelegate
ColorSchemeViewDelegate(QObject *parent=0)
Definition: EditProfileDialog.cpp:1256
Konsole::Enum::ScrollBarHidden
Do not show the scroll-bar.
Definition: Enumeration.h:64
Konsole::Profile::Directory
(QString) The initial working directory for sessions created using this profile.
Definition: Profile.h:108
Konsole::KeyBindingEditor::translator
KeyboardTranslator * translator() const
Returns the modified translator describing the changes to the bindings and other settings which the u...
Definition: KeyBindingEditor.cpp:181
Konsole::Profile::BlinkingTextEnabled
(bool) Specifies whether text in terminal displays is allowed to blink.
Definition: Profile.h:161
ColorSchemeManager.h
Konsole::EditProfileDialog::accept
virtual void accept()
Definition: EditProfileDialog.cpp:129
QStandardItem::setData
virtual void setData(const QVariant &value, int role)
Konsole::Enum::ScrollPageHalf
Scroll half page.
Definition: Enumeration.h:72
Konsole::Profile::Command
(QString) The command to execute ( excluding arguments ) when creating a new terminal session using t...
Definition: Profile.h:93
Konsole::Profile::UseCustomCursorColor
(bool) If true, terminal displays use a fixed color to draw the cursor, specified by the CustomCursor...
Definition: Profile.h:177
Konsole::EditProfileDialog::EditProfileDialog
EditProfileDialog(QWidget *parent=0)
Constructs a new dialog with the specified parent.
Definition: EditProfileDialog.cpp:67
Konsole::EditProfileDialog::eventFilter
virtual bool eventFilter(QObject *watched, QEvent *event)
Definition: EditProfileDialog.cpp:575
Konsole::Profile::UntranslatedName
(QString) The untranslated name of this profile.
Definition: Profile.h:85
QPainter::drawRect
void drawRect(const QRectF &rectangle)
Konsole::ColorSchemeManager::allColorSchemes
QList< const ColorScheme * > allColorSchemes()
Returns a list of the all the available color schemes.
Definition: ColorSchemeManager.cpp:204
Konsole::KeyboardTranslator::setName
void setName(const QString &name)
Sets the name of this keyboard translator.
Definition: KeyboardTranslator.cpp:646
Konsole::ShellCommand
A class to parse and extract information about shell commands.
Definition: ShellCommand.h:52
Konsole::ColorScheme::opacity
qreal opacity() const
Returns the opacity level for this color scheme, see setOpacity() TODO: More documentation.
Definition: ColorScheme.cpp:284
Konsole::Profile::BlinkingCursorEnabled
(bool) Specifies whether the cursor blinks ( in a manner similar to text editing applications ) ...
Definition: Profile.h:172
QWidget::setEnabled
void setEnabled(bool)
ColorSchemeEditor.h
Konsole::KeyboardTranslatorManager::allTranslators
QStringList allTranslators()
Returns a list of the names of available keyboard translators.
Definition: KeyboardTranslatorManager.cpp:188
Konsole::KeyBindingEditor::setDescription
void setDescription(const QString &description)
Sets the text of the editor's description field.
Definition: KeyBindingEditor.cpp:149
Konsole::Profile::AutoCopySelectedText
(bool) If true, automatically copy selected text into the clipboard
Definition: Profile.h:207
Konsole::ProfileManager::instance
static ProfileManager * instance()
Returns the profile manager instance.
Definition: ProfileManager.cpp:114
KeyboardTranslator.h
Konsole::Profile::StartInCurrentSessionDir
(bool) Whether new sessions should be started in the same directory as the currently active session...
Definition: Profile.h:230
QVector::resize
void resize(int size)
QTimer
QVariant::isNull
bool isNull() const
Konsole::Profile::UnderlineLinksEnabled
(bool) If true, text that matches a link or an email address is underlined when hovered by the mouse ...
Definition: Profile.h:201
KeyBindingEditor.h
Konsole::Profile::BoldIntense
(bool) Whether character with intense colors should be rendered in bold font or just in bright color...
Definition: Profile.h:226
QHash
QStyleOptionViewItem
QObject
QPainter::setPen
void setPen(const QColor &color)
Konsole::Profile::ScrollFullPage
(bool) Specifies whether the PageUp/Down will scroll the full height or half height.
Definition: Profile.h:153
QPainterPath::lineTo
void lineTo(const QPointF &endPoint)
QStandardItem::setFlags
void setFlags(QFlags< Qt::ItemFlag > flags)
QList::isEmpty
bool isEmpty() const
QPainter
QHashIterator
QRectF::topLeft
QPointF topLeft() const
QString::isEmpty
bool isEmpty() const
Konsole::KeyBindingEditor::setup
void setup(const KeyboardTranslator *translator)
Initializes the dialog with the bindings and other settings from the specified translator.
Definition: KeyBindingEditor.cpp:167
Konsole::Profile::LineSpacing
(int) Specifies the pixels between the terminal lines.
Definition: Profile.h:168
QFont::setStyleStrategy
void setStyleStrategy(StyleStrategy s)
Konsole::Profile::Arguments
(QStringList) The arguments which are passed to the program specified by the Command property when cr...
Definition: Profile.h:98
Konsole::ColorSchemeManager::addColorScheme
void addColorScheme(ColorScheme *scheme)
Adds a new color scheme to the manager.
Definition: ColorSchemeManager.cpp:293
QItemSelectionModel::hasSelection
bool hasSelection() const
QPainter::setBrush
void setBrush(const QBrush &brush)
QPainter::drawText
void drawText(const QPointF &position, const QString &text)
Konsole::Profile::Icon
(QString) The name of the icon associated with this profile.
Definition: Profile.h:89
QRectF::center
QPointF center() const
EditProfileDialog.h
QAbstractItemModel::data
virtual QVariant data(const QModelIndex &index, int role) const =0
Konsole::Profile::TripleClickMode
(TripleClickModeEnum) Specifies which part of current line should be selected with triple click actio...
Definition: Profile.h:197
QString
QList
Enumeration.h
QColor
QHash::remove
int remove(const Key &key)
QTextCodec
Konsole::ColorSchemeEditor::setup
void setup(const ColorScheme *scheme, bool isNewScheme)
Initializes the dialog with the properties of the specified color scheme.
Definition: ColorSchemeEditor.cpp:196
QPainter::drawRoundRect
void drawRoundRect(const QRectF &r, int xRnd, int yRnd)
Konsole::Profile::BidiRenderingEnabled
(bool) Specifies whether the terminal will enable Bidirectional text display
Definition: Profile.h:157
Konsole::Enum::PasteFromClipboard
Paste from Clipboard.
Definition: Enumeration.h:104
QStringList
Konsole::ColorScheme::description
QString description() const
Returns the descriptive name of the color scheme.
Definition: ColorScheme.cpp:166
Konsole::EditProfileDialog::reject
virtual void reject()
Definition: EditProfileDialog.cpp:124
Konsole::WindowSystemInfo::HAVE_TRANSPARENCY
static const bool HAVE_TRANSPARENCY
Definition: WindowSystemInfo.h:31
WindowSystemInfo.h
Konsole::ColorScheme::setName
void setName(const QString &name)
Sets the name of the color scheme.
Definition: ColorScheme.cpp:171
QHash::clear
void clear()
QHash::value
const T value(const Key &key) const
QHashIterator::next
Item next()
QSize
Konsole::Enum::HistoryModeEnum
HistoryModeEnum
This enum describes the modes available to remember lines of output produced by the terminal...
Definition: Enumeration.h:38
QColor::lighter
QColor lighter(int factor) const
QTimer::stop
void stop()
Konsole::KeyboardTranslatorManager::defaultTranslator
const KeyboardTranslator * defaultTranslator()
Returns the default translator for Konsole.
Definition: KeyboardTranslatorManager.cpp:177
QVariant::fromValue
QVariant fromValue(const T &value)
QFont::setPointSizeF
void setPointSizeF(qreal pointSize)
Konsole::EditProfileDialog::lookupProfile
const Profile::Ptr lookupProfile() const
Definition: EditProfileDialog.cpp:197
ColorScheme.h
QPainter::restore
void restore()
Konsole::Profile::Ptr
KSharedPtr< Profile > Ptr
Definition: Profile.h:67
QItemSelection
Konsole::ColorSchemeViewDelegate::sizeHint
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: EditProfileDialog.cpp:1354
QPainterPath
Konsole::ColorSchemeManager::findColorScheme
const ColorScheme * findColorScheme(const QString &name)
Returns the color scheme with the given name or 0 if no scheme with that name exists.
Definition: ColorSchemeManager.cpp:326
Konsole::KeyboardTranslator::name
QString name() const
Returns the name of this keyboard translator.
Definition: KeyboardTranslator.cpp:651
Konsole::Profile::HistorySize
(int) Specifies the number of lines of output to remember in terminal sessions using this profile...
Definition: Profile.h:143
QRectF::width
qreal width() const
Konsole::ColorSchemeViewDelegate
A delegate which can display and edit color schemes in a view.
Definition: EditProfileDialog.h:260
Konsole::ProfileManager::changeProfile
void changeProfile(Profile::Ptr profile, QHash< Profile::Property, QVariant > propertyMap, bool persistent=true)
Updates a profile with the changes specified in propertyMap.
Definition: ProfileManager.cpp:330
Konsole::Profile::CursorShape
(CursorShapeEnum) The shape used by terminal displays to represent the cursor.
Definition: Profile.h:183
QPainter::drawPath
void drawPath(const QPainterPath &path)
QModelIndex::data
QVariant data(int role) const
QPen::setWidth
void setWidth(int width)
QHash::isEmpty
bool isEmpty() const
ProfileManager.h
QRectF
QRadialGradient
Konsole::ColorSchemeEditor
A dialog for editing color schemes.
Definition: ColorSchemeEditor.h:55
QString::count
int count() const
Konsole::EditProfileDialog::~EditProfileDialog
virtual ~EditProfileDialog()
Definition: EditProfileDialog.cpp:101
QFont::family
QString family() const
Konsole::Profile::ScrollBarPosition
(ScrollBarPositionEnum) Specifies the position of the scroll bar in terminal displays using this prof...
Definition: Profile.h:149
Konsole::Profile::TerminalColumns
(int) Specifies the preferred columns.
Definition: Profile.h:239
QAction
Konsole::EditProfileDialog::setProfile
void setProfile(Profile::Ptr profile)
Initializes the dialog with the settings for the specified session type.
Definition: EditProfileDialog.cpp:177
QVector::count
int count(const T &value) const
Konsole::KeyboardTranslatorManager::instance
static KeyboardTranslatorManager * instance()
Returns the global KeyboardTranslatorManager instance.
Definition: KeyboardTranslatorManager.cpp:49
Konsole::Profile::ColorScheme
(QString) The name of the color scheme to use in terminal displays using this profile.
Definition: Profile.h:127
QString::length
int length() const
QStringList::split
QStringList split(const QString &sep, const QString &str, bool allowEmptyEntries)
QPainterPath::addRoundRect
void addRoundRect(const QRectF &r, int xRnd, int yRnd)
QStandardItem::index
QModelIndex index() const
QAbstractItemModel
QWeakPointer
QPen
QTimer::start
void start(int msec)
QColor::setAlphaF
void setAlphaF(qreal alpha)
QRectF::adjusted
QRectF adjusted(qreal dx1, qreal dy1, qreal dx2, qreal dy2) const
Konsole::Profile::MouseWheelZoomEnabled
(bool) If true, mouse wheel scroll with Ctrl key pressed increases/decreases the terminal font size...
Definition: Profile.h:252
Konsole::ColorScheme::name
QString name() const
Returns the name of the color scheme.
Definition: ColorScheme.cpp:175
Konsole::Enum::ScrollBarRight
Show the scroll-bar on the right of the terminal display.
Definition: Enumeration.h:62
QHash::contains
bool contains(const Key &key) const
QStandardItem
Konsole::ColorScheme::backgroundColor
QColor backgroundColor() const
Convenience method.
Definition: ColorScheme.cpp:270
Konsole::Profile::LocalTabTitleFormat
(QString) The format used for tab titles when running normal commands.
Definition: Profile.h:112
QStandardItemModel::sort
virtual void sort(int column, Qt::SortOrder order)
QItemSelectionModel
QAction::menu
QMenu * menu() const
Konsole::ColorScheme::foregroundColor
QColor foregroundColor() const
Convenience method.
Definition: ColorScheme.cpp:266
Konsole::KeyboardTranslatorManager
Manages the keyboard translations available for use by terminal sessions, see KeyboardTranslator.
Definition: KeyboardTranslatorManager.h:41
QString::data
QChar * data()
Konsole::KeyBindingEditor
A dialog which allows the user to edit a key bindings list which maps between key combinations input ...
Definition: KeyBindingEditor.h:50
QStandardItemModel::appendRow
void appendRow(const QList< QStandardItem * > &items)
Konsole::Enum::ScrollBarLeft
Show the scroll-bar on the left of the terminal display.
Definition: Enumeration.h:60
Konsole::Profile::TerminalRows
(int) Specifies the preferred rows.
Definition: Profile.h:241
Konsole::Profile::OpenLinksByDirectClickEnabled
(bool) If true, links can be opened by direct mouse click.
Definition: Profile.h:203
QStandardItem::setEditable
void setEditable(bool editable)
Konsole::ColorSchemeManager::defaultColorScheme
const ColorScheme * defaultColorScheme() const
Returns the default color scheme for Konsole.
Definition: ColorSchemeManager.cpp:288
Konsole::EditProfileDialog::selectProfileName
void selectProfileName()
Selects the text in the profile name edit area.
Definition: EditProfileDialog.cpp:231
Konsole::Profile::Name
(QString) The descriptive name of this profile.
Definition: Profile.h:81
Konsole::ColorSchemeManager::instance
static ColorSchemeManager * instance()
Returns the global color scheme manager instance.
Definition: ColorSchemeManager.cpp:172
Konsole::ColorScheme
Represents a color scheme for a terminal display.
Definition: ColorScheme.h:72
QVariant
Konsole::Profile::CtrlRequiredForDrag
(bool) If true, control key must be pressed to click and drag selected text.
Definition: Profile.h:205
Konsole::Profile::Environment
(QStringList) Additional environment variables (in the form of NAME=VALUE pairs) which are passed to ...
Definition: Profile.h:104
QAbstractItemDelegate
Konsole::KeyboardTranslatorManager::findTranslator
const KeyboardTranslator * findTranslator(const QString &name)
Returns the keyboard translator with the given name or 0 if no translator with that name exists...
Definition: KeyboardTranslatorManager.cpp:102
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Konsole

Skip menu "Konsole"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal