Commit 15189fd2 authored by Laurent Montel's avatar Laurent Montel 😁

Add saveas action

parent 384bf75e
......@@ -304,6 +304,17 @@ void SieveEditorMainWidget::slotReplace()
}
}
void SieveEditorMainWidget::slotSaveAs()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->saveAs();
}
}
}
void SieveEditorMainWidget::slotScriptModified(bool modified,SieveEditorPageWidget *page)
{
const int index = mTabWidget->indexOf(page);
......
......@@ -59,6 +59,7 @@ public Q_SLOTS:
void slotCopy();
void slotPaste();
void slotCut();
void slotSaveAs();
Q_SIGNALS:
void updateButtons(bool newScriptAction, bool editScriptAction, bool deleteScriptAction, bool desactivateScriptAction);
void updateScriptList();
......
......@@ -162,6 +162,7 @@ void SieveEditorMainWindow::setupActions()
mPasteAction = KStandardAction::paste(mMainWidget->sieveEditorMainWidget(), SLOT(slotPaste()), ac);
mCutAction = KStandardAction::cut(mMainWidget->sieveEditorMainWidget(), SLOT(slotCut()), ac);
mSelectAllAction = KStandardAction::selectAll(mMainWidget->sieveEditorMainWidget(), SLOT(slotSelectAll()), ac);
mSaveAsAction = KStandardAction::saveAs(mMainWidget->sieveEditorMainWidget(), SLOT(slotSaveAs()), ac);
}
void SieveEditorMainWindow::slotRefreshList()
......@@ -245,6 +246,7 @@ void SieveEditorMainWindow::slotUpdateActions()
mSaveScript->setEnabled(hasPage && !mNetworkIsDown);
mRefreshList->setEnabled(!mNetworkIsDown);
mSaveAsAction->setEnabled(hasPage);
}
void SieveEditorMainWindow::slotUndoAvailable(bool b)
......
......@@ -73,6 +73,7 @@ private:
KAction *mPasteAction;
KAction *mCutAction;
KAction *mSelectAllAction;
KAction *mSaveAsAction;
QLabel *mStatusBarInfo;
bool mNetworkIsDown;
......
......@@ -206,6 +206,11 @@ void SieveEditorPageWidget::replace()
mSieveEditorWidget->replace();
}
void SieveEditorPageWidget::saveAs()
{
mSieveEditorWidget->slotSaveAs();
}
KSieveUi::SieveEditorWidget::EditorMode SieveEditorPageWidget::pageMode() const
{
return mSieveEditorWidget->mode();
......
......@@ -59,6 +59,7 @@ public:
bool hasSelection() const;
void selectAll();
void saveAs();
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