Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
PIM Sieve Editor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PIM
PIM Sieve Editor
Commits
aa0b8a38
Commit
aa0b8a38
authored
Feb 23, 2015
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename method
parent
15189fd2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
17 deletions
+17
-17
sieveeditormainwidget.cpp
sieveeditormainwidget.cpp
+4
-4
sieveeditormainwidget.h
sieveeditormainwidget.h
+1
-1
sieveeditormainwindow.cpp
sieveeditormainwindow.cpp
+6
-6
sieveeditormainwindow.h
sieveeditormainwindow.h
+2
-2
sieveeditorpagewidget.cpp
sieveeditorpagewidget.cpp
+3
-3
sieveeditorpagewidget.h
sieveeditorpagewidget.h
+1
-1
No files found.
sieveeditormainwidget.cpp
View file @
aa0b8a38
...
...
@@ -104,7 +104,7 @@ void SieveEditorMainWidget::slotCreateScriptPage(const KUrl &url, const QStringL
mTabWidget
->
addTab
(
editor
,
url
.
fileName
());
mTabWidget
->
setCurrentWidget
(
editor
);
if
(
isNewScript
)
editor
->
save
Script
(
false
,
true
);
editor
->
upload
Script
(
false
,
true
);
}
}
...
...
@@ -138,13 +138,13 @@ void SieveEditorMainWidget::refreshList()
mScriptManagerWidget
->
refreshList
();
}
void
SieveEditorMainWidget
::
save
Script
()
void
SieveEditorMainWidget
::
upload
Script
()
{
QWidget
*
w
=
mTabWidget
->
currentWidget
();
if
(
w
)
{
SieveEditorPageWidget
*
page
=
qobject_cast
<
SieveEditorPageWidget
*>
(
w
);
if
(
page
)
{
page
->
save
Script
();
page
->
upload
Script
();
}
}
}
...
...
@@ -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
->
save
Script
();
page
->
upload
Script
();
}
else
if
(
result
==
KMessageBox
::
Cancel
)
{
return
;
}
...
...
sieveeditormainwidget.h
View file @
aa0b8a38
...
...
@@ -41,7 +41,7 @@ public:
void
editScript
();
void
desactivateScript
();
void
refreshList
();
void
save
Script
();
void
upload
Script
();
bool
needToSaveScript
();
KTabWidget
*
tabWidget
()
const
;
...
...
sieveeditormainwindow.cpp
View file @
aa0b8a38
...
...
@@ -119,8 +119,8 @@ void SieveEditorMainWindow::setupActions()
KStandardAction
::
quit
(
this
,
SLOT
(
close
()),
ac
);
KStandardAction
::
preferences
(
this
,
SLOT
(
slotConfigure
()),
ac
);
m
SaveScript
=
KStandardAction
::
save
(
this
,
SLOT
(
slotSave
Script
()),
ac
);
m
Save
Script
->
setEnabled
(
false
);
m
UploadScript
=
KStandardAction
::
save
(
this
,
SLOT
(
slotUpload
Script
()),
ac
);
m
Upload
Script
->
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
::
slot
Save
Script
()
void
SieveEditorMainWindow
::
slot
Upload
Script
()
{
mMainWidget
->
sieveEditorMainWidget
()
->
save
Script
();
mMainWidget
->
sieveEditorMainWidget
()
->
upload
Script
();
}
void
SieveEditorMainWindow
::
slotDesactivateScript
()
...
...
@@ -230,7 +230,7 @@ void SieveEditorMainWindow::slotAddServerSieve()
void
SieveEditorMainWindow
::
slotUpdateActions
()
{
const
bool
hasPage
=
(
mMainWidget
->
sieveEditorMainWidget
()
->
tabWidget
()
->
count
()
>
0
);
m
Save
Script
->
setEnabled
(
hasPage
);
m
Upload
Script
->
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
);
m
Save
Script
->
setEnabled
(
hasPage
&&
!
mNetworkIsDown
);
m
Upload
Script
->
setEnabled
(
hasPage
&&
!
mNetworkIsDown
);
mRefreshList
->
setEnabled
(
!
mNetworkIsDown
);
mSaveAsAction
->
setEnabled
(
hasPage
);
}
...
...
sieveeditormainwindow.h
View file @
aa0b8a38
...
...
@@ -46,7 +46,7 @@ private slots:
void
slotEditScript
();
void
slotDesactivateScript
();
void
slotRefreshList
();
void
slot
Save
Script
();
void
slot
Upload
Script
();
void
slotSystemNetworkStatusChanged
(
Solid
::
Networking
::
Status
status
);
void
slotUpdateActions
();
void
slotUndoAvailable
(
bool
);
...
...
@@ -63,7 +63,7 @@ private:
KAction
*
mEditScript
;
KAction
*
mDesactivateScript
;
KAction
*
mRefreshList
;
KAction
*
m
Save
Script
;
KAction
*
m
Upload
Script
;
KAction
*
mGoToLine
;
KAction
*
mFindAction
;
KAction
*
mReplaceAction
;
...
...
sieveeditorpagewidget.cpp
View file @
aa0b8a38
...
...
@@ -105,7 +105,7 @@ void SieveEditorPageWidget::slotGetResult( KManageSieve::SieveJob *, bool succes
mSieveEditorWidget
->
setModified
(
false
);
}
void
SieveEditorPageWidget
::
save
Script
(
bool
showInformation
,
bool
forceSave
)
void
SieveEditorPageWidget
::
upload
Script
(
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
)
{
save
Script
();
upload
Script
();
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
)
{
save
Script
();
upload
Script
();
result
=
true
;
}
else
if
(
resultQuestion
==
KMessageBox
::
Cancel
)
{
result
=
true
;
...
...
sieveeditorpagewidget.h
View file @
aa0b8a38
...
...
@@ -40,7 +40,7 @@ public:
void
loadScript
(
const
KUrl
&
url
,
const
QStringList
&
capabilities
);
KUrl
currentUrl
()
const
;
void
setIsNewScript
(
bool
isNewScript
);
void
save
Script
(
bool
showInformation
=
true
,
bool
forceSave
=
false
);
void
upload
Script
(
bool
showInformation
=
true
,
bool
forceSave
=
false
);
bool
needToSaveScript
();
bool
isModified
()
const
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment