Commit e81b5f16 authored by Laurent Montel's avatar Laurent Montel 😁

Add SelectAll action

parent f95587b9
......@@ -204,6 +204,18 @@ bool SieveEditorMainWidget::hasSelection() const
return false;
}
void SieveEditorMainWidget::slotSelectAll()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->selectAll();
}
}
}
void SieveEditorMainWidget::slotCopy()
{
QWidget *w = mTabWidget->currentWidget();
......
......@@ -78,6 +78,7 @@ private slots:
void slotTabRemoveAllExclude(int index);
void slotUndo();
void slotRedo();
void slotSelectAll();
private:
QWidget *hasExistingPage(const KUrl &url);
......
......@@ -161,6 +161,7 @@ void SieveEditorMainWindow::setupActions()
mCopyAction = KStandardAction::copy(mMainWidget->sieveEditorMainWidget(), SLOT(slotCopy()), ac);
mPasteAction = KStandardAction::paste(mMainWidget->sieveEditorMainWidget(), SLOT(slotPaste()), ac);
mCutAction = KStandardAction::cut(mMainWidget->sieveEditorMainWidget(), SLOT(slotCut()), ac);
mSelectAllAction = KStandardAction::selectAll(mMainWidget->sieveEditorMainWidget(), SLOT(slotSelectAll()), ac);
}
void SieveEditorMainWindow::slotRefreshList()
......@@ -240,6 +241,8 @@ void SieveEditorMainWindow::slotUpdateActions()
mPasteAction->setEnabled(editActionEnabled);
mCutAction->setEnabled(editActionEnabled && mMainWidget->sieveEditorMainWidget()->hasSelection());
mSelectAllAction->setEnabled(editActionEnabled);
mSaveScript->setEnabled(hasPage && !mNetworkIsDown);
mRefreshList->setEnabled(!mNetworkIsDown);
}
......
......@@ -72,6 +72,7 @@ private:
KAction *mCopyAction;
KAction *mPasteAction;
KAction *mCutAction;
KAction *mSelectAllAction;
QLabel *mStatusBarInfo;
bool mNetworkIsDown;
......
......@@ -226,3 +226,7 @@ void SieveEditorPageWidget::copy()
mSieveEditorWidget->copy();
}
void SieveEditorPageWidget::selectAll()
{
mSieveEditorWidget->selectAll();
}
......@@ -58,6 +58,7 @@ public:
void copy();
bool hasSelection() const;
void selectAll();
Q_SIGNALS:
void refreshList();
void scriptModified(bool, SieveEditorPageWidget *);
......
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