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

Rename method

parent 15189fd2
......@@ -104,7 +104,7 @@ void SieveEditorMainWidget::slotCreateScriptPage(const KUrl &url, const QStringL
mTabWidget->addTab(editor, url.fileName());
mTabWidget->setCurrentWidget(editor);
if (isNewScript)
editor->saveScript(false, true);
editor->uploadScript(false, true);
}
}
......@@ -138,13 +138,13 @@ void SieveEditorMainWidget::refreshList()
mScriptManagerWidget->refreshList();
}
void SieveEditorMainWidget::saveScript()
void SieveEditorMainWidget::uploadScript()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->saveScript();
page->uploadScript();
}
}
}
......@@ -343,7 +343,7 @@ void SieveEditorMainWidget::slotTabCloseRequested(int index)
if (page->isModified()) {
const int result = KMessageBox::questionYesNoCancel(this, i18n("Script was modified. Do you want to save before closing?"), i18n("Close script"));
if (result == KMessageBox::Yes) {
page->saveScript();
page->uploadScript();
} else if (result == KMessageBox::Cancel) {
return;
}
......
......@@ -41,7 +41,7 @@ public:
void editScript();
void desactivateScript();
void refreshList();
void saveScript();
void uploadScript();
bool needToSaveScript();
KTabWidget *tabWidget() const;
......
......@@ -119,8 +119,8 @@ void SieveEditorMainWindow::setupActions()
KStandardAction::quit(this, SLOT(close()), ac );
KStandardAction::preferences( this, SLOT(slotConfigure()), ac );
mSaveScript = KStandardAction::save( this, SLOT(slotSaveScript()), ac );
mSaveScript->setEnabled(false);
mUploadScript = KStandardAction::save( this, SLOT(slotUploadScript()), ac );
mUploadScript->setEnabled(false);
KAction *act = ac->addAction(QLatin1String("add_server_sieve"), this, SLOT(slotAddServerSieve()));
act->setText(i18n("Add Server Sieve..."));
......@@ -171,9 +171,9 @@ void SieveEditorMainWindow::slotRefreshList()
mMainWidget->sieveEditorMainWidget()->refreshList();
}
void SieveEditorMainWindow::slotSaveScript()
void SieveEditorMainWindow::slotUploadScript()
{
mMainWidget->sieveEditorMainWidget()->saveScript();
mMainWidget->sieveEditorMainWidget()->uploadScript();
}
void SieveEditorMainWindow::slotDesactivateScript()
......@@ -230,7 +230,7 @@ void SieveEditorMainWindow::slotAddServerSieve()
void SieveEditorMainWindow::slotUpdateActions()
{
const bool hasPage = (mMainWidget->sieveEditorMainWidget()->tabWidget()->count()>0);
mSaveScript->setEnabled(hasPage);
mUploadScript->setEnabled(hasPage);
const bool editActionEnabled = (hasPage && mMainWidget->sieveEditorMainWidget()->pageMode() == KSieveUi::SieveEditorWidget::TextMode);
mGoToLine->setEnabled(editActionEnabled);
mFindAction->setEnabled(editActionEnabled);
......@@ -244,7 +244,7 @@ void SieveEditorMainWindow::slotUpdateActions()
mSelectAllAction->setEnabled(editActionEnabled);
mSaveScript->setEnabled(hasPage && !mNetworkIsDown);
mUploadScript->setEnabled(hasPage && !mNetworkIsDown);
mRefreshList->setEnabled(!mNetworkIsDown);
mSaveAsAction->setEnabled(hasPage);
}
......
......@@ -46,7 +46,7 @@ private slots:
void slotEditScript();
void slotDesactivateScript();
void slotRefreshList();
void slotSaveScript();
void slotUploadScript();
void slotSystemNetworkStatusChanged(Solid::Networking::Status status);
void slotUpdateActions();
void slotUndoAvailable(bool);
......@@ -63,7 +63,7 @@ private:
KAction *mEditScript;
KAction *mDesactivateScript;
KAction *mRefreshList;
KAction *mSaveScript;
KAction *mUploadScript;
KAction *mGoToLine;
KAction *mFindAction;
KAction *mReplaceAction;
......
......@@ -105,7 +105,7 @@ void SieveEditorPageWidget::slotGetResult( KManageSieve::SieveJob *, bool succes
mSieveEditorWidget->setModified(false);
}
void SieveEditorPageWidget::saveScript(bool showInformation, bool forceSave)
void SieveEditorPageWidget::uploadScript(bool showInformation, bool forceSave)
{
if (mSieveEditorWidget->isModified() || forceSave) {
KManageSieve::SieveJob * job = KManageSieve::SieveJob::put( mCurrentURL, mSieveEditorWidget->script(), mWasActive, mWasActive );
......@@ -137,7 +137,7 @@ bool SieveEditorPageWidget::needToSaveScript()
if (mIsNewScript) {
const int resultQuestion = KMessageBox::warningYesNoCancel(this, i18n("Script '%1' is new. Do you want to save it?", mCurrentURL.fileName()));
if (resultQuestion == KMessageBox::Yes) {
saveScript();
uploadScript();
result = true;
} else if (resultQuestion == KMessageBox::Cancel) {
result = true;
......@@ -146,7 +146,7 @@ bool SieveEditorPageWidget::needToSaveScript()
if (mSieveEditorWidget->isModified()) {
const int resultQuestion =KMessageBox::warningYesNoCancel(this, i18n("Script '%1' was changed. Do you want to save it ?", mCurrentURL.fileName()));
if (resultQuestion == KMessageBox::Yes) {
saveScript();
uploadScript();
result = true;
} else if (resultQuestion == KMessageBox::Cancel) {
result = true;
......
......@@ -40,7 +40,7 @@ public:
void loadScript(const KUrl &url, const QStringList &capabilities);
KUrl currentUrl() const;
void setIsNewScript(bool isNewScript);
void saveScript(bool showInformation = true, bool forceSave = false);
void uploadScript(bool showInformation = true, bool forceSave = false);
bool needToSaveScript();
bool isModified() const;
......
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