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
Calindori
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
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
Plasma Mobile
Calindori
Commits
34e7a3db
Commit
34e7a3db
authored
Mar 09, 2019
by
Dimitris Kardarakos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provide a confirmation dialog before calendar deletion
parent
ab2192b9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
11 deletions
+78
-11
src/contents/ui/CalendarAction.qml
src/contents/ui/CalendarAction.qml
+3
-11
src/contents/ui/ConfirmationSheet.qml
src/contents/ui/ConfirmationSheet.qml
+62
-0
src/contents/ui/Main.qml
src/contents/ui/Main.qml
+12
-0
src/resources.qrc
src/resources.qrc
+1
-0
No files found.
src/contents/ui/CalendarAction.qml
View file @
34e7a3db
...
...
@@ -27,6 +27,8 @@ Kirigami.Action {
property
bool
isCalendar
:
true
property
var
configuration
signal
deleteCalendar
checked
:
(
text
==
configuration
.
activeCalendar
)
Kirigami.Action
{
...
...
@@ -42,16 +44,6 @@ Kirigami.Action {
text
:
"
Delete
"
iconName
:
"
delete
"
onTriggered
:
{
if
(
configuration
.
activeCalendar
==
parent
.
text
)
{
showPassiveNotification
(
"
Active calendar cannot be deleted
"
);
}
else
{
var
toRemoveCalendarComponent
=
Qt
.
createQmlObject
(
"
import org.kde.phone.calindori 0.1 as Calindori; Calindori.LocalCalendar { name:
\"
"
+
parent
.
text
+
"
\"
}
"
,
root
);
toRemoveCalendarComponent
.
deleteCalendar
();
configuration
.
removeCalendar
(
parent
.
text
);
showPassiveNotification
(
"
Calendar
"
+
parent
.
text
+
"
has been deleted
"
);
}
}
onTriggered
:
(
configuration
.
activeCalendar
==
parent
.
text
)
?
showPassiveNotification
(
"
Active calendar cannot be deleted
"
)
:
deleteCalendar
()
}
}
src/contents/ui/ConfirmationSheet.qml
0 → 100644
View file @
34e7a3db
/*
* Copyright 2019 Dimitris Kardarakos <dimkard@posteo.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import
QtQuick
2.0
import
QtQuick
.
Controls
2.4
as
Controls2
import
QtQuick
.
Layouts
1.11
import
org
.
kde
.
kirigami
2.4
as
Kirigami
import
org
.
kde
.
phone
.
calindori
0.1
as
Calindori
Kirigami.OverlaySheet
{
id
:
deleteSheet
property
string
calendar
property
var
configuration
contentItem
:
Controls2.Label
{
Layout.fillWidth
:
true
wrapMode
:
Text
.
WordWrap
text
:
"
All data included in this calendar will be deleted. Proceed with deletion?
"
}
parent
:
applicationWindow
().
overlay
footer
:
RowLayout
{
Item
{
Layout.fillWidth
:
true
}
Controls2.ToolButton
{
text
:
qsTr
(
"
Delete
"
)
onClicked
:
{
var
toRemoveCalendarComponent
=
Qt
.
createQmlObject
(
"
import org.kde.phone.calindori 0.1 as Calindori; Calindori.LocalCalendar { name:
\"
"
+
deleteSheet
.
calendar
+
"
\"
}
"
,
root
);
toRemoveCalendarComponent
.
deleteCalendar
();
configuration
.
removeCalendar
(
deleteSheet
.
calendar
);
showPassiveNotification
(
"
Calendar
"
+
deleteSheet
.
calendar
+
"
has been deleted
"
);
deleteSheet
.
close
();
}
}
Controls2.ToolButton
{
text
:
qsTr
(
"
Cancel
"
)
onClicked
:
deleteSheet
.
close
()
}
}
}
src/contents/ui/Main.qml
View file @
34e7a3db
...
...
@@ -20,6 +20,7 @@
import
QtQuick
2.1
import
QtQuick
.
Layouts
1.2
import
org
.
kde
.
kirigami
2.0
as
Kirigami
import
QtQuick
.
Controls
2.4
as
Controls2
import
org
.
kde
.
phone
.
calindori
0.1
as
Calindori
import
"
Utils.js
"
as
Utils
...
...
@@ -89,6 +90,11 @@ Kirigami.ApplicationWindow {
CalendarAction
{
configuration
:
calindoriConfig
onDeleteCalendar
:
{
deleteSheet
.
calendar
=
text
;
deleteSheet
.
open
();
}
}
}
...
...
@@ -217,5 +223,11 @@ Kirigami.ApplicationWindow {
}
}
ConfirmationSheet
{
id
:
deleteSheet
configuration
:
calindoriConfig
}
}
src/resources.qrc
View file @
34e7a3db
...
...
@@ -13,5 +13,6 @@
<file alias="CalendarInputPage.qml">contents/ui/CalendarInputPage.qml</file>
<file alias="Utils.js">contents/code/Utils.js</file>
<file alias="CalendarAction.qml">contents/ui/CalendarAction.qml</file>
<file alias="ConfirmationSheet.qml">contents/ui/ConfirmationSheet.qml</file>
</qresource>
</RCC>
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