Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Kalendar
Commits
48bbaa33
Commit
48bbaa33
authored
Dec 04, 2021
by
Claudio Cambra
Browse files
Disable drag and drop when processing prior drops
parent
cb8395d4
Pipeline
#105202
passed with stage
in 5 minutes and 3 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/calendarmanager.cpp
View file @
48bbaa33
...
...
@@ -791,6 +791,8 @@ void CalendarManager::updateIncidenceDates(IncidenceWrapper *incidenceWrapper, i
setNewDates
(
incidenceWrapper
->
incidencePtr
());
m_changer
->
modifyIncidence
(
item
,
oldIncidence
);
}
Q_EMIT
updateIncidenceDatesCompleted
();
}
bool
CalendarManager
::
hasChildren
(
KCalendarCore
::
Incidence
::
Ptr
incidence
)
...
...
src/calendarmanager.h
View file @
48bbaa33
...
...
@@ -106,6 +106,7 @@ Q_SIGNALS:
void
undoRedoDataChanged
();
void
incidenceChanged
();
void
enabledTodoCollectionsChanged
();
void
updateIncidenceDatesCompleted
();
private:
Akonadi
::
ETMCalendar
::
Ptr
m_calendar
=
nullptr
;
...
...
src/contents/ui/MonthView.qml
View file @
48bbaa33
...
...
@@ -34,6 +34,8 @@ Kirigami.Page {
readonly
property
bool
isLarge
:
width
>
Kirigami
.
Units
.
gridUnit
*
40
readonly
property
bool
isTiny
:
width
<
Kirigami
.
Units
.
gridUnit
*
18
property
bool
dragDropEnabled
:
true
function
setToDate
(
date
,
isInitialMonth
=
false
)
{
monthPage
.
initialMonth
=
isInitialMonth
;
let
monthDiff
=
date
.
getMonth
()
-
pathView
.
currentItem
.
firstDayOfMonth
.
getMonth
()
+
(
12
*
(
date
.
getFullYear
()
-
pathView
.
currentItem
.
firstDayOfMonth
.
getFullYear
()))
...
...
@@ -153,6 +155,7 @@ Kirigami.Page {
height
:
pathView
.
height
model
:
monthViewModel
// from monthPage model
isCurrentView
:
viewLoader
.
isCurrentItem
dragDropEnabled
:
monthPage
.
dragDropEnabled
startDate
:
viewLoader
.
startDate
currentDate
:
monthPage
.
currentDate
...
...
src/contents/ui/MultiDayView.qml
View file @
48bbaa33
...
...
@@ -46,6 +46,7 @@ Item {
property
int
month
property
alias
bgLoader
:
backgroundLoader
.
item
property
bool
isCurrentView
:
true
property
bool
dragDropEnabled
:
true
//Internal
property
int
numberOfLinesShown
:
0
...
...
@@ -307,6 +308,7 @@ Item {
horizontalSpacing
:
linesRepeater
.
spacing
openOccurrenceId
:
root
.
openOccurrence
?
root
.
openOccurrence
.
incidenceId
:
""
isDark
:
root
.
isDark
dragDropEnabled
:
root
.
dragDropEnabled
}
}
}
...
...
src/contents/ui/MultiDayViewIncidenceDelegate.qml
View file @
48bbaa33
...
...
@@ -62,6 +62,7 @@ Rectangle {
property
bool
caught
:
false
property
real
caughtX
:
0
property
real
caughtY
:
0
property
bool
dragDropEnabled
:
true
Drag.active
:
mouseArea
.
drag
.
active
Drag.hotSpot.x
:
mouseArea
.
mouseX
...
...
@@ -158,7 +159,7 @@ Rectangle {
incidenceData
:
modelData
collectionId
:
modelData
.
collectionId
drag.target
:
!
Kirigami
.
Settings
.
isMobile
&&
!
modelData
.
isReadOnly
?
parent
:
undefined
drag.target
:
!
Kirigami
.
Settings
.
isMobile
&&
!
modelData
.
isReadOnly
&&
incidenceDelegate
.
dragDropEnabled
?
parent
:
undefined
onReleased
:
parent
.
Drag
.
drop
()
onViewClicked
:
viewIncidence
(
modelData
)
...
...
src/contents/ui/ScheduleView.qml
View file @
48bbaa33
...
...
@@ -42,6 +42,7 @@ Kirigami.Page {
readonly
property
bool
isLarge
:
width
>
Kirigami
.
Units
.
gridUnit
*
30
readonly
property
bool
isDark
:
LabelUtils
.
isDarkColor
(
Kirigami
.
Theme
.
backgroundColor
)
property
real
maxTimeLabelWidth
:
0
property
bool
dragDropEnabled
:
true
onSelectedDateChanged
:
{
pathView
.
currentItem
.
item
.
savedYScrollPos
=
0
;
...
...
@@ -571,7 +572,7 @@ Kirigami.Page {
incidenceData
:
modelData
collectionId
:
modelData
.
collectionId
drag.target
:
!
Kirigami
.
Settings
.
isMobile
&&
!
modelData
.
isReadOnly
?
incidenceCard
:
undefined
drag.target
:
!
Kirigami
.
Settings
.
isMobile
&&
!
modelData
.
isReadOnly
&&
root
.
dragDropEnabled
?
incidenceCard
:
undefined
onReleased
:
incidenceCard
.
Drag
.
drop
()
onViewClicked
:
root
.
viewIncidence
(
modelData
)
...
...
src/contents/ui/WeekView.qml
View file @
48bbaa33
...
...
@@ -40,6 +40,7 @@ Kirigami.Page {
property
int
daysToShow
:
7
readonly
property
int
minutesFromStartOfDay
:
(
root
.
currentDate
.
getHours
()
*
60
)
+
root
.
currentDate
.
getMinutes
()
readonly
property
bool
isDark
:
LabelUtils
.
isDarkColor
(
Kirigami
.
Theme
.
backgroundColor
)
property
bool
dragDropEnabled
:
true
property
real
scrollbarWidth
:
0
readonly
property
real
dayWidth
:
((
root
.
width
-
hourLabelWidth
-
leftPadding
-
scrollbarWidth
)
/
daysToShow
)
-
gridLineWidth
...
...
@@ -480,6 +481,7 @@ Kirigami.Page {
openOccurrenceId
:
root
.
openOccurrence
?
root
.
openOccurrence
.
incidenceId
:
""
isDark
:
root
.
isDark
reactToCurrentMonth
:
false
dragDropEnabled
:
root
.
dragDropEnabled
}
}
}
...
...
@@ -923,7 +925,7 @@ Kirigami.Page {
incidenceData
:
modelData
collectionId
:
modelData
.
collectionId
drag.target
:
!
Kirigami
.
Settings
.
isMobile
&&
!
modelData
.
isReadOnly
?
parent
:
undefined
drag.target
:
!
Kirigami
.
Settings
.
isMobile
&&
!
modelData
.
isReadOnly
&&
root
.
dragDropEnabled
?
parent
:
undefined
onReleased
:
parent
.
Drag
.
drop
()
onViewClicked
:
viewIncidence
(
modelData
)
...
...
src/contents/ui/main.qml
View file @
48bbaa33
...
...
@@ -910,6 +910,12 @@ Kirigami.ApplicationWindow {
}
function
setUpIncidenceDateChange
(
incidenceWrapper
,
startOffset
,
endOffset
,
occurrenceDate
,
caughtDelegate
)
{
pageStack
.
currentItem
.
dragDropEnabled
=
false
;
if
(
pageStack
.
layers
.
currentItem
&&
pageStack
.
layers
.
currentItem
.
dragDropEnabled
)
{
pageStack
.
layers
.
currentItem
.
dragDropEnabled
=
false
;
}
if
(
incidenceWrapper
.
recurrenceData
.
type
===
0
)
{
CalendarManager
.
updateIncidenceDates
(
incidenceWrapper
,
startOffset
,
endOffset
);
}
else
{
...
...
@@ -931,6 +937,17 @@ Kirigami.ApplicationWindow {
}
}
Connections
{
target
:
CalendarManager
function
onUpdateIncidenceDatesCompleted
()
{
pageStack
.
currentItem
.
dragDropEnabled
=
true
;
if
(
pageStack
.
layers
.
currentItem
&&
pageStack
.
layers
.
currentItem
.
dragDropEnabled
)
{
pageStack
.
layers
.
currentItem
.
dragDropEnabled
=
true
;
}
}
}
Component
{
id
:
deleteIncidenceSheetComponent
DeleteIncidenceSheet
{
...
...
Claudio Cambra
@clau-cambra
mentioned in issue
#127 (closed)
·
Dec 04, 2021
mentioned in issue
#127 (closed)
mentioned in issue #127
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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