Commit 475e5474 authored by Laurent Montel's avatar Laurent Montel 😁

Fix replace action

parent e537a78e
......@@ -74,6 +74,11 @@ SieveTemplateEditDialog::SieveTemplateEditDialog(QWidget *parent, bool defaultTe
connect( shortcut, SIGNAL(activated()), SLOT(slotFind()) );
connect( mTextEdit, SIGNAL(findText()), SLOT(slotFind()) );
shortcut = new QShortcut(this);
shortcut->setKey(Qt::Key_R + Qt::CTRL);
connect( shortcut, SIGNAL(activated()), SLOT(slotReplace()) );
connect( mTextEdit, SIGNAL(replaceText()), SLOT(slotReplace()) );
w->setLayout(vbox);
setMainWidget(w);
if (!defaultTemplate) {
......@@ -90,12 +95,19 @@ SieveTemplateEditDialog::~SieveTemplateEditDialog()
writeConfig();
}
void SieveTemplateEditDialog::slotReplace()
{
mFindBar->showReplace();
mSliderContainer->slideIn();
mFindBar->focusAndSetCursor();
}
void SieveTemplateEditDialog::slotFind()
{
if ( mTextEdit->textCursor().hasSelection() )
mFindBar->setText( mTextEdit->textCursor().selectedText() );
mTextEdit->moveCursor(QTextCursor::Start);
mFindBar->show();
mFindBar->showFind();
mSliderContainer->slideIn();
mFindBar->focusAndSetCursor();
}
......
......@@ -47,6 +47,7 @@ public:
private Q_SLOTS:
void slotTemplateChanged();
void slotFind();
void slotReplace();
private:
void readConfig();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment