Commit 83515eaf authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port to new connect api

parent bce7d53c
......@@ -71,10 +71,8 @@ MainWindow* Application::newMainWindow()
{
MainWindow* window = new MainWindow();
connect(window, &Konsole::MainWindow::newWindowRequest,
this, &Konsole::Application::createWindow);
connect(window, &Konsole::MainWindow::viewDetached,
this, &Konsole::Application::detachView);
connect(window, &Konsole::MainWindow::newWindowRequest, this, &Konsole::Application::createWindow);
connect(window, &Konsole::MainWindow::viewDetached, this, &Konsole::Application::detachView);
return window;
}
......@@ -455,8 +453,7 @@ void Application::startBackgroundMode(MainWindow* window)
action->setText(i18n("Toggle Background Window"));
action->setGlobalShortcut(KShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_F12)));
connect(action, SIGNAL(triggered()),
this, SLOT(toggleBackgroundInstance()));
connect(action, &KAction::triggered, this, &Application::toggleBackgroundInstance);
*/
_backgroundInstance = window;
}
......
......@@ -68,8 +68,8 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent)
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
connect(buttonBox, &QDialogButtonBox::accepted, this, &ColorSchemeEditor::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &ColorSchemeEditor::reject);
mainLayout->addWidget(buttonBox);
connect(buttonBox->button(QDialogButtonBox::Apply), &QPushButton::clicked, this, &Konsole::ColorSchemeEditor::saveColorScheme);
connect(okButton, &QPushButton::clicked, this, &Konsole::ColorSchemeEditor::saveColorScheme);
......@@ -80,8 +80,7 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent)
// description edit
_ui->descriptionEdit->setClearButtonEnabled(true);
connect(_ui->descriptionEdit , &QLineEdit::textChanged , this ,
&Konsole::ColorSchemeEditor::setDescription);
connect(_ui->descriptionEdit , &QLineEdit::textChanged , this , &Konsole::ColorSchemeEditor::setDescription);
// transparency slider
QFontMetrics metrics(font());
......@@ -90,8 +89,7 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent)
connect(_ui->transparencySlider , &QSlider::valueChanged , this , &Konsole::ColorSchemeEditor::setTransparencyPercentLabel);
// randomized background
connect(_ui->randomizedBackgroundCheck , &QCheckBox::toggled , this ,
&Konsole::ColorSchemeEditor::setRandomizedBackgroundColor);
connect(_ui->randomizedBackgroundCheck , &QCheckBox::toggled , this , &Konsole::ColorSchemeEditor::setRandomizedBackgroundColor);
// wallpaper stuff
QFileSystemModel *dirModel = new QFileSystemModel(this);
......@@ -104,10 +102,8 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent)
_ui->wallpaperPath->setClearButtonEnabled(true);
_ui->wallpaperSelectButton->setIcon(QIcon::fromTheme(QStringLiteral("image-x-generic")));
connect(_ui->wallpaperSelectButton, &QToolButton::clicked,
this, &Konsole::ColorSchemeEditor::selectWallpaper);
connect(_ui->wallpaperPath, &QLineEdit::textChanged,
this, &Konsole::ColorSchemeEditor::wallpaperPathChanged);
connect(_ui->wallpaperSelectButton, &QToolButton::clicked, this, &Konsole::ColorSchemeEditor::selectWallpaper);
connect(_ui->wallpaperPath, &QLineEdit::textChanged, this, &Konsole::ColorSchemeEditor::wallpaperPathChanged);
// color table
_ui->colorTable->setColumnCount(3);
......@@ -129,8 +125,7 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent)
_ui->colorTable->verticalHeader()->hide();
connect(_ui->colorTable , &QTableWidget::itemClicked , this ,
&Konsole::ColorSchemeEditor::editColorItem);
connect(_ui->colorTable , &QTableWidget::itemClicked , this , &Konsole::ColorSchemeEditor::editColorItem);
// warning label when transparency is not available
_ui->transparencyWarningWidget->setWordWrap(true);
......
......@@ -46,8 +46,8 @@ CopyInputDialog::CopyInputDialog(QWidget* parent)
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
connect(buttonBox, &QDialogButtonBox::accepted, this, &CopyInputDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &CopyInputDialog::reject);
mainLayout->addWidget(buttonBox);
setWindowModality(Qt::WindowModal);
......@@ -71,8 +71,7 @@ CopyInputDialog::CopyInputDialog(QWidget* parent)
filterProxyModel->setSourceModel(_model);
filterProxyModel->setFilterKeyColumn(-1);
connect(_ui->filterEdit, &QLineEdit::textChanged,
filterProxyModel, &QSortFilterProxyModel::setFilterFixedString);
connect(_ui->filterEdit, &QLineEdit::textChanged, filterProxyModel, &QSortFilterProxyModel::setFilterFixedString);
_ui->sessionList->setModel(filterProxyModel);
_ui->sessionList->setColumnHidden(0, true); // Hide number column
......
......@@ -93,8 +93,7 @@ EditProfileDialog::EditProfileDialog(QWidget* aParent)
// not been updated since the last profile change and will need
// to be refreshed when the user switches to them
_pageNeedsUpdate.resize(_ui->tabWidget->count());
connect(_ui->tabWidget, &QTabWidget::currentChanged, this,
&Konsole::EditProfileDialog::preparePage);
connect(_ui->tabWidget, &QTabWidget::currentChanged, this, &Konsole::EditProfileDialog::preparePage);
createTempProfile();
}
......@@ -303,24 +302,16 @@ void EditProfileDialog::setupGeneralPage(const Profile::Ptr profile)
// signals and slots
connect(_ui->dirSelectButton, &QToolButton::clicked, this, &Konsole::EditProfileDialog::selectInitialDir);
connect(_ui->iconSelectButton, &QPushButton::clicked, this, &Konsole::EditProfileDialog::selectIcon);
connect(_ui->startInSameDirButton, &QCheckBox::toggled, this ,
&Konsole::EditProfileDialog::startInSameDir);
connect(_ui->profileNameEdit, &QLineEdit::textChanged, this,
&Konsole::EditProfileDialog::profileNameChanged);
connect(_ui->initialDirEdit, &QLineEdit::textChanged, this,
&Konsole::EditProfileDialog::initialDirChanged);
connect(_ui->commandEdit, &QLineEdit::textChanged, this,
&Konsole::EditProfileDialog::commandChanged);
connect(_ui->environmentEditButton , &QPushButton::clicked, this,
&Konsole::EditProfileDialog::showEnvironmentEditor);
connect(_ui->terminalColumnsEntry, static_cast<void(KIntSpinBox::*)(int)>(&KIntSpinBox::valueChanged),
this, &Konsole::EditProfileDialog::terminalColumnsEntryChanged);
connect(_ui->terminalRowsEntry, static_cast<void(KIntSpinBox::*)(int)>(&KIntSpinBox::valueChanged),
this, &Konsole::EditProfileDialog::terminalRowsEntryChanged);
connect(_ui->showTerminalSizeHintButton, &QCheckBox::toggled, this,
&Konsole::EditProfileDialog::showTerminalSizeHint);
connect(_ui->startInSameDirButton, &QCheckBox::toggled, this , &Konsole::EditProfileDialog::startInSameDir);
connect(_ui->profileNameEdit, &QLineEdit::textChanged, this, &Konsole::EditProfileDialog::profileNameChanged);
connect(_ui->initialDirEdit, &QLineEdit::textChanged, this, &Konsole::EditProfileDialog::initialDirChanged);
connect(_ui->commandEdit, &QLineEdit::textChanged, this, &Konsole::EditProfileDialog::commandChanged);
connect(_ui->environmentEditButton , &QPushButton::clicked, this, &Konsole::EditProfileDialog::showEnvironmentEditor);
connect(_ui->terminalColumnsEntry, static_cast<void(KIntSpinBox::*)(int)>(&KIntSpinBox::valueChanged), this, &Konsole::EditProfileDialog::terminalColumnsEntryChanged);
connect(_ui->terminalRowsEntry, static_cast<void(KIntSpinBox::*)(int)>(&KIntSpinBox::valueChanged), this, &Konsole::EditProfileDialog::terminalRowsEntryChanged);
connect(_ui->showTerminalSizeHintButton, &QCheckBox::toggled, this, &Konsole::EditProfileDialog::showTerminalSizeHint);
}
void EditProfileDialog::showEnvironmentEditor()
{
......@@ -350,18 +341,15 @@ void EditProfileDialog::setupTabsPage(const Profile::Ptr profile)
_ui->renameTabWidget->setTabTitleText(profile->localTabTitleFormat());
_ui->renameTabWidget->setRemoteTabTitleText(profile->remoteTabTitleFormat());
connect(_ui->renameTabWidget, &Konsole::RenameTabWidget::tabTitleFormatChanged, this,
&Konsole::EditProfileDialog::tabTitleFormatChanged);
connect(_ui->renameTabWidget, &Konsole::RenameTabWidget::remoteTabTitleFormatChanged, this,
&Konsole::EditProfileDialog::remoteTabTitleFormatChanged);
connect(_ui->renameTabWidget, &Konsole::RenameTabWidget::tabTitleFormatChanged, this, &Konsole::EditProfileDialog::tabTitleFormatChanged);
connect(_ui->renameTabWidget, &Konsole::RenameTabWidget::remoteTabTitleFormatChanged, this, &Konsole::EditProfileDialog::remoteTabTitleFormatChanged);
// tab monitoring
const int silenceSeconds = profile->silenceSeconds();
_ui->silenceSecondsSpinner->setValue(silenceSeconds);
_ui->silenceSecondsSpinner->setSuffix(ki18ncp("Unit of time", " second", " seconds"));
connect(_ui->silenceSecondsSpinner, static_cast<void(KIntSpinBox::*)(int)>(&KIntSpinBox::valueChanged),
this, &Konsole::EditProfileDialog::silenceSecondsChanged);
connect(_ui->silenceSecondsSpinner, static_cast<void(KIntSpinBox::*)(int)>(&KIntSpinBox::valueChanged), this, &Konsole::EditProfileDialog::silenceSecondsChanged);
}
void EditProfileDialog::terminalColumnsEntryChanged(int value)
......@@ -451,20 +439,14 @@ void EditProfileDialog::setupAppearancePage(const Profile::Ptr profile)
_ui->colorSchemeList->installEventFilter(this);
_ui->colorSchemeList->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
connect(_ui->colorSchemeList->selectionModel(),
&QItemSelectionModel::selectionChanged,
this, &Konsole::EditProfileDialog::colorSchemeSelected);
connect(_ui->colorSchemeList, &QListView::entered, this,
&Konsole::EditProfileDialog::previewColorScheme);
connect(_ui->colorSchemeList->selectionModel(), &QItemSelectionModel::selectionChanged, this, &Konsole::EditProfileDialog::colorSchemeSelected);
connect(_ui->colorSchemeList, &QListView::entered, this, &Konsole::EditProfileDialog::previewColorScheme);
updateColorSchemeButtons();
connect(_ui->editColorSchemeButton, &QPushButton::clicked, this,
&Konsole::EditProfileDialog::editColorScheme);
connect(_ui->removeColorSchemeButton, &QPushButton::clicked, this,
&Konsole::EditProfileDialog::removeColorScheme);
connect(_ui->newColorSchemeButton, &QPushButton::clicked, this,
&Konsole::EditProfileDialog::newColorScheme);
connect(_ui->editColorSchemeButton, &QPushButton::clicked, this, &Konsole::EditProfileDialog::editColorScheme);
connect(_ui->removeColorSchemeButton, &QPushButton::clicked, this, &Konsole::EditProfileDialog::removeColorScheme);
connect(_ui->newColorSchemeButton, &QPushButton::clicked, this, &Konsole::EditProfileDialog::newColorScheme);
// setup font preview
const bool antialias = profile->antiAliasFonts();
......@@ -476,22 +458,17 @@ void EditProfileDialog::setupAppearancePage(const Profile::Ptr profile)
_ui->fontPreviewLabel->setFont(profileFont);
setFontInputValue(profileFont);
connect(_ui->fontSizeInput, &KDoubleNumInput::valueChanged, this,
&Konsole::EditProfileDialog::setFontSize);
connect(_ui->selectFontButton, &QPushButton::clicked, this,
&Konsole::EditProfileDialog::showFontDialog);
connect(_ui->fontSizeInput, &KDoubleNumInput::valueChanged, this, &Konsole::EditProfileDialog::setFontSize);
connect(_ui->selectFontButton, &QPushButton::clicked, this, &Konsole::EditProfileDialog::showFontDialog);
// setup font smoothing
_ui->antialiasTextButton->setChecked(antialias);
connect(_ui->antialiasTextButton, &QCheckBox::toggled, this,
&Konsole::EditProfileDialog::setAntialiasText);
connect(_ui->antialiasTextButton, &QCheckBox::toggled, this, &Konsole::EditProfileDialog::setAntialiasText);
_ui->boldIntenseButton->setChecked(profile->boldIntense());
connect(_ui->boldIntenseButton, &QCheckBox::toggled, this,
&Konsole::EditProfileDialog::setBoldIntense);
connect(_ui->boldIntenseButton, &QCheckBox::toggled, this, &Konsole::EditProfileDialog::setBoldIntense);
_ui->enableMouseWheelZoomButton->setChecked(profile->mouseWheelZoomEnabled());
connect(_ui->enableMouseWheelZoomButton, &QCheckBox::toggled, this,
&Konsole::EditProfileDialog::toggleMouseWheelZoom);
connect(_ui->enableMouseWheelZoomButton, &QCheckBox::toggled, this, &Konsole::EditProfileDialog::toggleMouseWheelZoom);
}
void EditProfileDialog::setAntialiasText(bool enable)
{
......@@ -714,8 +691,7 @@ void EditProfileDialog::showColorSchemeEditor(bool isNewScheme)
}
_colorDialog = new ColorSchemeEditor(this);
connect(_colorDialog, &Konsole::ColorSchemeEditor::colorSchemeSaveRequested,
this, &Konsole::EditProfileDialog::saveColorScheme);
connect(_colorDialog, &Konsole::ColorSchemeEditor::colorSchemeSaveRequested, this, &Konsole::EditProfileDialog::saveColorScheme);
_colorDialog->setup(colors, isNewScheme);
_colorDialog->show();
......@@ -846,18 +822,13 @@ void EditProfileDialog::setupKeyboardPage(const Profile::Ptr /* profile */)
// setup translator list
updateKeyBindingsList(true);
connect(_ui->keyBindingList->selectionModel(),
&QItemSelectionModel::selectionChanged,
this, &Konsole::EditProfileDialog::keyBindingSelected);
connect(_ui->newKeyBindingsButton, &QPushButton::clicked, this,
&Konsole::EditProfileDialog::newKeyBinding);
connect(_ui->keyBindingList->selectionModel(), &QItemSelectionModel::selectionChanged, this, &Konsole::EditProfileDialog::keyBindingSelected);
connect(_ui->newKeyBindingsButton, &QPushButton::clicked, this, &Konsole::EditProfileDialog::newKeyBinding);
updateKeyBindingsButtons();
connect(_ui->editKeyBindingsButton, &QPushButton::clicked, this,
&Konsole::EditProfileDialog::editKeyBinding);
connect(_ui->removeKeyBindingsButton, &QPushButton::clicked, this,
&Konsole::EditProfileDialog::removeKeyBinding);
connect(_ui->editKeyBindingsButton, &QPushButton::clicked, this, &Konsole::EditProfileDialog::editKeyBinding);
connect(_ui->removeKeyBindingsButton, &QPushButton::clicked, this, &Konsole::EditProfileDialog::removeKeyBinding);
}
void EditProfileDialog::keyBindingSelected()
{
......@@ -979,8 +950,7 @@ void EditProfileDialog::setupScrollingPage(const Profile::Ptr profile)
// setup scrollback type radio
int scrollBackType = profile->property<int>(Profile::HistoryMode);
_ui->historySizeWidget->setMode(Enum::HistoryModeEnum(scrollBackType));
connect(_ui->historySizeWidget, &Konsole::HistorySizeWidget::historyModeChanged,
this, &Konsole::EditProfileDialog::historyModeChanged);
connect(_ui->historySizeWidget, &Konsole::HistorySizeWidget::historyModeChanged, this, &Konsole::EditProfileDialog::historyModeChanged);
// setup scrollback line count spinner
const int historySize = profile->historySize();
......@@ -998,8 +968,7 @@ void EditProfileDialog::setupScrollingPage(const Profile::Ptr profile)
setupRadio(pageamounts, scrollFullPage);
// signals and slots
connect(_ui->historySizeWidget, &Konsole::HistorySizeWidget::historySizeChanged,
this, &Konsole::EditProfileDialog::historySizeChanged);
connect(_ui->historySizeWidget, &Konsole::HistorySizeWidget::historySizeChanged, this, &Konsole::EditProfileDialog::historySizeChanged);
}
void EditProfileDialog::historySizeChanged(int lineCount)
......@@ -1068,20 +1037,17 @@ void EditProfileDialog::setupMousePage(const Profile::Ptr profile)
// interaction options
_ui->wordCharacterEdit->setText(profile->wordCharacters());
connect(_ui->wordCharacterEdit, &QLineEdit::textChanged, this,
&Konsole::EditProfileDialog::wordCharactersChanged);
connect(_ui->wordCharacterEdit, &QLineEdit::textChanged, this, &Konsole::EditProfileDialog::wordCharactersChanged);
int tripleClickMode = profile->property<int>(Profile::TripleClickMode);
_ui->tripleClickModeCombo->setCurrentIndex(tripleClickMode);
connect(_ui->tripleClickModeCombo, static_cast<void(KComboBox::*)(int)>(&KComboBox::activated), this,
&Konsole::EditProfileDialog::TripleClickModeChanged);
connect(_ui->tripleClickModeCombo, static_cast<void(KComboBox::*)(int)>(&KComboBox::activated), this, &Konsole::EditProfileDialog::TripleClickModeChanged);
_ui->openLinksByDirectClickButton->setEnabled(_ui->underlineLinksButton->isChecked());
_ui->enableMouseWheelZoomButton->setChecked(profile->mouseWheelZoomEnabled());
connect(_ui->enableMouseWheelZoomButton, &QCheckBox::toggled, this,
&Konsole::EditProfileDialog::toggleMouseWheelZoom);
connect(_ui->enableMouseWheelZoomButton, &QCheckBox::toggled, this, &Konsole::EditProfileDialog::toggleMouseWheelZoom);
}
void EditProfileDialog::setupAdvancedPage(const Profile::Ptr profile)
{
......@@ -1108,8 +1074,7 @@ void EditProfileDialog::setupAdvancedPage(const Profile::Ptr profile)
const int lineSpacing = profile->lineSpacing();
_ui->lineSpacingSpinner->setValue(lineSpacing);
connect(_ui->lineSpacingSpinner, static_cast<void(KIntSpinBox::*)(int)>(&KIntSpinBox::valueChanged),
this, &Konsole::EditProfileDialog::lineSpacingChanged);
connect(_ui->lineSpacingSpinner, static_cast<void(KIntSpinBox::*)(int)>(&KIntSpinBox::valueChanged), this, &Konsole::EditProfileDialog::lineSpacingChanged);
// cursor options
if (profile->useCustomCursorColor())
......@@ -1121,8 +1086,7 @@ void EditProfileDialog::setupAdvancedPage(const Profile::Ptr profile)
connect(_ui->customCursorColorButton, &QRadioButton::clicked, this, &Konsole::EditProfileDialog::customCursorColor);
connect(_ui->autoCursorColorButton, &QRadioButton::clicked, this, &Konsole::EditProfileDialog::autoCursorColor);
connect(_ui->customColorSelectButton, &KColorButton::changed,
this, &Konsole::EditProfileDialog::customCursorColorChanged);
connect(_ui->customColorSelectButton, &KColorButton::changed, this, &Konsole::EditProfileDialog::customCursorColorChanged);
int shape = profile->property<int>(Profile::CursorShape);
_ui->cursorShapeCombo->setCurrentIndex(shape);
......
......@@ -51,10 +51,8 @@ Emulation::Emulation() :
QObject::connect(&_bulkTimer2, &QTimer::timeout, this, &Konsole::Emulation::showBulk);
// listen for mouse status changes
connect(this , &Konsole::Emulation::programUsesMouseChanged ,
this, &Konsole::Emulation::usesMouseChanged);
connect(this , &Konsole::Emulation::programBracketedPasteModeChanged ,
this, &Konsole::Emulation::bracketedPasteModeChanged);
connect(this , &Konsole::Emulation::programUsesMouseChanged , this, &Konsole::Emulation::usesMouseChanged);
connect(this , &Konsole::Emulation::programBracketedPasteModeChanged , this, &Konsole::Emulation::bracketedPasteModeChanged);
}
bool Emulation::programUsesMouse() const
......@@ -82,13 +80,10 @@ ScreenWindow* Emulation::createWindow()
ScreenWindow* window = new ScreenWindow(_currentScreen);
_windows << window;
connect(window , &Konsole::ScreenWindow::selectionChanged,
this , &Konsole::Emulation::bufferedUpdate);
connect(window, &Konsole::ScreenWindow::selectionChanged,
this, &Konsole::Emulation::checkSelectedText);
connect(window , &Konsole::ScreenWindow::selectionChanged, this , &Konsole::Emulation::bufferedUpdate);
connect(window, &Konsole::ScreenWindow::selectionChanged, this, &Konsole::Emulation::checkSelectedText);
connect(this , &Konsole::Emulation::outputChanged,
window , &Konsole::ScreenWindow::notifyOutputChanged);
connect(this , &Konsole::Emulation::outputChanged, window , &Konsole::ScreenWindow::notifyOutputChanged);
return window;
}
......
......@@ -44,8 +44,8 @@ HistorySizeDialog::HistorySizeDialog(QWidget* parent)
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
connect(buttonBox, &QDialogButtonBox::accepted, this, &HistorySizeDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &HistorySizeDialog::reject);
mainLayout->addWidget(buttonBox);
setWindowModality(Qt::WindowModal);
......
......@@ -49,21 +49,18 @@ HistorySizeWidget::HistorySizeWidget(QWidget* parent)
// focus and select the spinner automatically when appropriate
_ui->fixedSizeHistoryButton->setFocusProxy(_ui->historyLineSpinner);
connect(_ui->fixedSizeHistoryButton , &QRadioButton::clicked ,
_ui->historyLineSpinner , &KIntSpinBox::selectAll);
connect(_ui->fixedSizeHistoryButton , &QRadioButton::clicked , _ui->historyLineSpinner , &KIntSpinBox::selectAll);
QButtonGroup* modeGroup = new QButtonGroup(this);
modeGroup->addButton(_ui->noHistoryButton);
modeGroup->addButton(_ui->fixedSizeHistoryButton);
modeGroup->addButton(_ui->unlimitedHistoryButton);
connect(modeGroup, static_cast<void(QButtonGroup::*)(QAbstractButton*)>(&QButtonGroup::buttonClicked),
this, &Konsole::HistorySizeWidget::buttonClicked);
connect(modeGroup, static_cast<void(QButtonGroup::*)(QAbstractButton*)>(&QButtonGroup::buttonClicked), this, &Konsole::HistorySizeWidget::buttonClicked);
_ui->historyLineSpinner->setSuffix(ki18ncp("Unit of scrollback", " line", " lines"));
this->setLineCount(HistorySizeWidget::DefaultLineCount);
connect(_ui->historyLineSpinner, static_cast<void(KIntSpinBox::*)(int)>(&KIntSpinBox::valueChanged),
this, &Konsole::HistorySizeWidget::historySizeChanged);
connect(_ui->historyLineSpinner, static_cast<void(KIntSpinBox::*)(int)>(&KIntSpinBox::valueChanged), this, &Konsole::HistorySizeWidget::historySizeChanged);
}
HistorySizeWidget::~HistorySizeWidget()
......
......@@ -119,27 +119,23 @@ IncrementalSearchBar::IncrementalSearchBar(QWidget* aParent)
_caseSensitive = optionsMenu->addAction(i18nc("@item:inmenu", "Case sensitive"));
_caseSensitive->setCheckable(true);
_caseSensitive->setToolTip(i18nc("@info:tooltip", "Sets whether the search is case sensitive"));
connect(_caseSensitive, &QAction::toggled,
this, &Konsole::IncrementalSearchBar::matchCaseToggled);
connect(_caseSensitive, &QAction::toggled, this, &Konsole::IncrementalSearchBar::matchCaseToggled);
_regExpression = optionsMenu->addAction(i18nc("@item:inmenu", "Match regular expression"));
_regExpression->setCheckable(true);
connect(_regExpression, &QAction::toggled,
this, &Konsole::IncrementalSearchBar::matchRegExpToggled);
connect(_regExpression, &QAction::toggled, this, &Konsole::IncrementalSearchBar::matchRegExpToggled);
_highlightMatches = optionsMenu->addAction(i18nc("@item:inmenu", "Highlight all matches"));
_highlightMatches->setCheckable(true);
_highlightMatches->setToolTip(i18nc("@info:tooltip", "Sets whether matching text should be highlighted"));
_highlightMatches->setChecked(true);
connect(_highlightMatches, &QAction::toggled,
this, &Konsole::IncrementalSearchBar::highlightMatchesToggled);
connect(_highlightMatches, &QAction::toggled, this, &Konsole::IncrementalSearchBar::highlightMatchesToggled);
_reverseSearch = optionsMenu->addAction(i18n("Search backwards"));
_reverseSearch->setCheckable(true);
_reverseSearch->setToolTip(i18n("Sets whether search should start from the bottom"));
_reverseSearch->setChecked(true);
connect(_reverseSearch, &QAction::toggled,
this, &Konsole::IncrementalSearchBar::updateButtonsAccordingToReverseSearchSetting);
connect(_reverseSearch, &QAction::toggled, this, &Konsole::IncrementalSearchBar::updateButtonsAccordingToReverseSearchSetting);
updateButtonsAccordingToReverseSearchSetting();
barLayout->addStretch();
......
......@@ -41,8 +41,7 @@ KeyBindingEditor::KeyBindingEditor(QWidget* parent)
_ui->setupUi(this);
// description edit
connect(_ui->descriptionEdit , &QLineEdit::textChanged ,
this , &Konsole::KeyBindingEditor::setTranslatorDescription);
connect(_ui->descriptionEdit , &QLineEdit::textChanged , this , &Konsole::KeyBindingEditor::setTranslatorDescription);
// key bindings table
_ui->keyBindingTable->setColumnCount(2);
......@@ -227,7 +226,6 @@ void KeyBindingEditor::setupKeyBindingTable(const KeyboardTranslator* translator
}
_ui->keyBindingTable->sortItems(0);
connect(_ui->keyBindingTable , &QTableWidget::itemChanged , this ,
&Konsole::KeyBindingEditor::bindingTableItemChanged);
connect(_ui->keyBindingTable , &QTableWidget::itemChanged , this , &Konsole::KeyBindingEditor::bindingTableItemChanged);
}
......@@ -87,7 +87,7 @@ MainWindow::MainWindow()
}
}
connect(KWindowSystem::self(), SIGNAL(compositingChanged(bool)), this, SLOT(updateUseTransparency()));
connect(KWindowSystem::self(), &KWindowSystem::compositingChanged, this, &MainWindow::updateUseTransparency);
updateUseTransparency();
......@@ -97,21 +97,14 @@ MainWindow::MainWindow()
// create view manager
_viewManager = new ViewManager(this, actionCollection());
connect(_viewManager, &Konsole::ViewManager::empty, this, &Konsole::MainWindow::close);
connect(_viewManager, &Konsole::ViewManager::activeViewChanged, this,
&Konsole::MainWindow::activeViewChanged);
connect(_viewManager, &Konsole::ViewManager::unplugController, this,
&Konsole::MainWindow::disconnectController);
connect(_viewManager, &Konsole::ViewManager::viewPropertiesChanged,
bookmarkHandler(), &Konsole::BookmarkHandler::setViews);
connect(_viewManager, &Konsole::ViewManager::updateWindowIcon, this,
&Konsole::MainWindow::updateWindowIcon);
connect(_viewManager, static_cast<void(ViewManager::*)(Profile::Ptr)>(&Konsole::ViewManager::newViewRequest),
this, &Konsole::MainWindow::newFromProfile);
connect(_viewManager, static_cast<void(ViewManager::*)()>(&Konsole::ViewManager::newViewRequest),
this, &Konsole::MainWindow::newTab);
connect(_viewManager, &Konsole::ViewManager::viewDetached,
this, &Konsole::MainWindow::viewDetached);
connect(_viewManager, &Konsole::ViewManager::activeViewChanged, this, &Konsole::MainWindow::activeViewChanged);
connect(_viewManager, &Konsole::ViewManager::unplugController, this, &Konsole::MainWindow::disconnectController);
connect(_viewManager, &Konsole::ViewManager::viewPropertiesChanged, bookmarkHandler(), &Konsole::BookmarkHandler::setViews);
connect(_viewManager, &Konsole::ViewManager::updateWindowIcon, this, &Konsole::MainWindow::updateWindowIcon);
connect(_viewManager, static_cast<void(ViewManager::*)(Profile::Ptr)>(&Konsole::ViewManager::newViewRequest), this, &Konsole::MainWindow::newFromProfile);
connect(_viewManager, static_cast<void(ViewManager::*)()>(&Konsole::ViewManager::newViewRequest), this, &Konsole::MainWindow::newTab);
connect(_viewManager, &Konsole::ViewManager::viewDetached, this, &Konsole::MainWindow::viewDetached);
// create the main widget
setupMainWidget();
......@@ -225,8 +218,7 @@ void MainWindow::activeViewChanged(SessionController* controller)
// associate bookmark menu with current session
bookmarkHandler()->setActiveView(controller);
disconnect(bookmarkHandler(), &Konsole::BookmarkHandler::openUrl, 0, 0);
connect(bookmarkHandler(), &Konsole::BookmarkHandler::openUrl, controller,
&Konsole::SessionController::openUrl);
connect(bookmarkHandler(), &Konsole::BookmarkHandler::openUrl, controller, &Konsole::SessionController::openUrl);
if (_pluggedController)
disconnectController(_pluggedController);
......@@ -235,10 +227,8 @@ void MainWindow::activeViewChanged(SessionController* controller)
_pluggedController = controller;
// listen for title changes from the current session
connect(controller, &Konsole::SessionController::titleChanged,
this, &Konsole::MainWindow::activeViewTitleChanged);
connect(controller, &Konsole::SessionController::rawTitleChanged,
this, &Konsole::MainWindow::updateWindowCaption);
connect(controller, &Konsole::SessionController::titleChanged, this, &Konsole::MainWindow::activeViewTitleChanged);
connect(controller, &Konsole::SessionController::rawTitleChanged, this, &Konsole::MainWindow::updateWindowCaption);
controller->setShowMenuAction(_toggleMenuBarAction);
guiFactory()->addClient(controller);
......@@ -373,11 +363,9 @@ void MainWindow::setProfileList(ProfileList* list)
{
profileListChanged(list->actions());
connect(list, &Konsole::ProfileList::profileSelected, this,
&Konsole::MainWindow::newFromProfile);
connect(list, &Konsole::ProfileList::profileSelected, this, &Konsole::MainWindow::newFromProfile);
connect(list, &Konsole::ProfileList::actionsChanged, this,
&Konsole::MainWindow::profileListChanged);
connect(list, &Konsole::ProfileList::actionsChanged, this, &Konsole::MainWindow::profileListChanged);
}
void MainWindow::profileListChanged(const QList<QAction*>& sessionActions)
......
......@@ -56,8 +56,8 @@ ManageProfilesDialog::ManageProfilesDialog(QWidget* aParent)
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(slotAccepted()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
connect(buttonBox, &QDialogButtonBox::accepted, this, &ManageProfilesDialog::slotAccepted);
connect(buttonBox, &QDialogButtonBox::rejected, this, &ManageProfilesDialog::reject);
mainLayout->addWidget(buttonBox);
......@@ -76,15 +76,10 @@ ManageProfilesDialog::ManageProfilesDialog(QWidget* aParent)
populateTable();
// listen for changes to profiles
connect(ProfileManager::instance(), &Konsole::ProfileManager::profileAdded, this,
&Konsole::ManageProfilesDialog::addItems);
connect(ProfileManager::instance(), &Konsole::ProfileManager::profileRemoved, this,
&Konsole::ManageProfilesDialog::removeItems);
connect(ProfileManager::instance(), &Konsole::ProfileManager::profileChanged, this,
&Konsole::ManageProfilesDialog::updateItems);
connect(ProfileManager::instance() ,
&Konsole::ProfileManager::favoriteStatusChanged, this,
&Konsole::ManageProfilesDialog::updateFavoriteStatus);
connect(ProfileManager::instance(), &Konsole::ProfileManager::profileAdded, this, &Konsole::ManageProfilesDialog::addItems);
connect(ProfileManager::instance(), &Konsole::ProfileManager::profileRemoved, this, &Konsole::ManageProfilesDialog::removeItems);
connect(ProfileManager::instance(), &Konsole::ProfileManager::profileChanged, this, &Konsole::ManageProfilesDialog::updateItems);
connect(ProfileManager::instance() , &Konsole::ProfileManager::favoriteStatusChanged, this, &Konsole::ManageProfilesDialog::updateFavoriteStatus);
// resize the session table to the full width of the table
_ui->sessionTable->horizontalHeader()->setHighlightSections(false);
......@@ -244,17 +239,14 @@ void ManageProfilesDialog::populateTable()
}
updateDefaultItem();
connect(_sessionModel, &QStandardItemModel::itemChanged, this,
&Konsole::ManageProfilesDialog::itemDataChanged);
connect(_sessionModel, &QStandardItemModel::itemChanged, this, &Konsole::ManageProfilesDialog::itemDataChanged);
// listen for changes in the table selection and update the state of the form's buttons
// accordingly.
//
// it appears that the selection model is changed when the model itself is replaced,
// so the signals need to be reconnected each time the model is updated.
connect(_ui->sessionTable->selectionModel(),
&QItemSelectionModel::selectionChanged, this,
&Konsole::ManageProfilesDialog::tableSelectionChanged);
connect(_ui->sessionTable->selectionModel(), &QItemSelectionModel::selectionChanged, this, &Konsole::ManageProfilesDialog::tableSelectionChanged);
_ui->sessionTable->selectRow(0);
}
......
......@@ -64,8 +64,7 @@ Part::Part(QWidget* parentWidget , QObject* parent, const QVariantList&)
_viewManager = new ViewManager(this, actionCollection());
_viewManager->setNavigationMethod(ViewManager::NoNavigation);
connect(_viewManager, &Konsole::ViewManager::activeViewChanged, this ,
&Konsole::Part::activeViewChanged);
connect(_viewManager, &Konsole::ViewManager::activeViewChanged, this , &Konsole::Part::activeViewChanged);
connect(_viewManager, &Konsole::ViewManager::empty, this, &Konsole::Part::terminalExited);
connect(_viewManager, static_cast<void(ViewManager::*)()>(&Konsole::ViewManager::newViewRequest), this, &Konsole::Part::newTab);
......@@ -246,11 +245,9 @@ void Part::activeViewChanged(SessionController* controller)
insertChildClient(controller);
setupActionsForSession(controller);
connect(controller, &Konsole::SessionController::titleChanged, this,
&Konsole::Part::activeViewTitleChanged);
connect(controller, &Konsole::SessionController::titleChanged, this, &Konsole::Part::activeViewTitleChanged);