Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecated Connections syntax, use onFoo(<arguments>) instead #349

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions package/contents/ui/AgendaEventItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ LinkRect {
}
Connections {
target: timeModel
onLoaded: agendaEventItem.checkIfInProgress()
onMinuteChanged: agendaEventItem.checkIfInProgress()
function onLoaded() {
agendaEventItem.checkIfInProgress()
}
function onMinuteChanged() {
agendaEventItem.checkIfInProgress()
}
}
Component.onCompleted: {
agendaEventItem.checkIfInProgress()
Expand Down Expand Up @@ -228,7 +232,7 @@ LinkRect {

} // eventColumn
}

onLeftClicked: {
// logger.log('agendaItem.event.leftClicked', model.startDateTime, mouse)
if (false) {
Expand Down
10 changes: 7 additions & 3 deletions package/contents/ui/AgendaListItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ GridLayout {
Component.onCompleted: agendaListItem.checkIfToday()
Connections {
target: timeModel
onLoaded: agendaListItem.checkIfToday()
onDateChanged: agendaListItem.checkIfToday()
function onLoaded() {
agendaListItem.checkIfToday()
}
function onDateChanged() {
agendaListItem.checkIfToday()
}
}
property bool agendaItemInProgress: agendaItemIsToday
property bool weatherOnRight: plasmoid.configuration.agendaWeatherOnRight
Expand All @@ -32,7 +36,7 @@ GridLayout {

Connections {
target: agendaModel
onPopulatingChanged: {
function onPopulatingChanged() {
if (!agendaModel.populating) {
agendaListItem.reset()
}
Expand Down
10 changes: 7 additions & 3 deletions package/contents/ui/AgendaTaskItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ LinkRect {
}
Connections {
target: timeModel
onLoaded: agendaTaskItem.checkIfIsOverdue()
onMinuteChanged: agendaTaskItem.checkIfIsOverdue()
function onLoaded() {
agendaTaskItem.checkIfIsOverdue()
}
function onMinuteChanged() {
agendaTaskItem.checkIfIsOverdue()
}
}
Component.onCompleted: {
agendaTaskItem.checkIfIsOverdue()
Expand Down Expand Up @@ -164,7 +168,7 @@ LinkRect {
// onClicked: Qt.openUrlExternally(model.htmlLink)
// }
}

onLeftClicked: {
var task = tasks.get(taskItemIndex)
logger.logJSON("task", task)
Expand Down
6 changes: 3 additions & 3 deletions package/contents/ui/AgendaView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Item {

Connections {
target: eventModel
onEventCreated: {
function onEventCreated() {
notificationManager.notify({
appName: i18n("Event Calendar"),
appIcon: "resource-calendar-insert",
Expand All @@ -34,7 +34,7 @@ Item {
})
})
}
onEventDeleted: {
function onEventDeleted() {
logger.logJSON('AgendaView.onEventDeleted', data)
notificationManager.notify({
appName: i18n("Event Calendar"),
Expand Down Expand Up @@ -80,7 +80,7 @@ Item {
// scrollToIndexTimer.updatePosition()
// }
// }

// Component.onCompleted: console.log(Date.now(), 'AgendaListItem.onCompleted', index)
// Component.onDestruction: console.log(Date.now(), 'AgendaListItem.onDestruction', index)
}
Expand Down
4 changes: 2 additions & 2 deletions package/contents/ui/DaysCalendar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ Item {

Connections {
target: theme
onTextColorChanged: {
function onTextColorChanged() {
canvas.requestPaint()
}
}
Expand Down Expand Up @@ -424,7 +424,7 @@ Item {

Connections {
target: daysCalendar
onActivateHighlightedItem: {
function onActivateHighlightedItem() {
if (delegate.containsMouse) {
delegate.clicked(null)
}
Expand Down
4 changes: 2 additions & 2 deletions package/contents/ui/EditEventForm.qml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ Loader {
//---- Testing
// Connections {
// target: durationSelector
// onStartDateTimeChanged: logger.logJSON('onStartDateTimeChanged', editEventItem.getChanges())
// onEndDateTimeChanged: logger.logJSON('onEndDateTimeChanged', editEventItem.getChanges())
// function onStartDateTimeChanged() { logger.logJSON('onStartDateTimeChanged', editEventItem.getChanges()) }
// function onEndDateTimeChanged() { logger.logJSON('onEndDateTimeChanged', editEventItem.getChanges()) }
// }

//----
Expand Down
72 changes: 49 additions & 23 deletions package/contents/ui/Logic.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Item {
//--- Update
Timer {
id: pollTimer

repeat: true
triggeredOnStart: true
interval: plasmoid.configuration.eventsPollInterval * 60000
Expand Down Expand Up @@ -79,7 +79,7 @@ Item {
} else {
shouldUpdate = true
}

if (force || shouldUpdate) {
updateWeatherTimer.restart()
}
Expand Down Expand Up @@ -160,33 +160,59 @@ Item {
target: plasmoid.configuration

//--- Events
onAccessTokenChanged: logic.updateEvents()
onCalendarIdListChanged: logic.updateEvents()
onEnabledCalendarPluginsChanged: logic.updateEvents()
onTasklistIdListChanged: logic.updateEvents()
onGoogleEventClickActionChanged: logic.updateEvents()
function onAccessTokenChanged() {
logic.updateEvents()
}
function onCalendarIdListChanged() {
logic.updateEvents()
}
function onEnabledCalendarPluginsChanged() {
logic.updateEvents()
}
function onTasklistIdListChanged() {
logic.updateEvents()
}
function onGoogleEventClickActionChanged() {
logic.updateEvents()
}

//--- Weather
onWeatherServiceChanged: logic.resetWeatherAndUpdate()
onOpenWeatherMapAppIdChanged: logic.resetWeatherAndUpdate()
onOpenWeatherMapCityIdChanged: logic.resetWeatherAndUpdate()
onWeatherCanadaCityIdChanged: logic.resetWeatherAndUpdate()
onWeatherUnitsChanged: logic.updateWeather(true)
onWidgetShowMeteogramChanged: {
function onWeatherServiceChanged() {
logic.resetWeatherAndUpdate()
}
function onOpenWeatherMapAppIdChanged() {
logic.resetWeatherAndUpdate()
}
function onOpenWeatherMapCityIdChanged() {
logic.resetWeatherAndUpdate()
}
function onWeatherCanadaCityIdChanged() {
logic.resetWeatherAndUpdate()
}
function onWeatherUnitsChanged() {
logic.updateWeather(true)
}
function onWidgetShowMeteogramChanged() {
if (plasmoid.configuration.widgetShowMeteogram) {
logic.updateHourlyWeather()
}
}

//--- UI
onAgendaBreakupMultiDayEventsChanged: popup.updateUI()
onMeteogramHoursChanged: popup.updateMeteogram()
function onAgendaBreakupMultiDayEventsChanged() {
popup.updateUI()
}
function onMeteogramHoursChanged() {
popup.updateMeteogram()
}
}

//---
Connections {
target: appletConfig
onClock24hChanged: popup.updateUI()
function onClock24hChanged() {
popup.updateUI()
}
}

//---
Expand All @@ -206,7 +232,7 @@ Item {
}
Connections {
target: eventModel
onError: {
function onError() {
logic.currentErrorMessage = msg
logic.currentErrorType = errorType
if (popup) popup.showError(logic.currentErrorMessage)
Expand All @@ -216,24 +242,24 @@ Item {
//---
Connections {
target: eventModel
onCalendarFetched: {
function onCalendarFetched() {
logger.debug('onCalendarFetched', calendarId)
// logger.debug('onCalendarFetched', calendarId, JSON.stringify(data, null, '\t'))
if (popup) popup.deferredUpdateUI()
}
onAllDataFetched: {
function onAllDataFetched() {
logger.debug('onAllDataFetched')
if (popup) popup.deferredUpdateUI()
}
onEventCreated: {
function onEventCreated() {
logger.logJSON('onEventCreated', calendarId, data)
if (popup) popup.deferredUpdateUI()
}
onEventUpdated: {
function onEventUpdated() {
logger.logJSON('onEventUpdated', calendarId, eventId, data)
if (popup) popup.deferredUpdateUI()
}
onEventDeleted: {
function onEventDeleted() {
logger.logJSON('onEventDeleted', calendarId, eventId, data)
if (popup) popup.deferredUpdateUI()
}
Expand All @@ -242,7 +268,7 @@ Item {
//---
Connections {
target: networkMonitor
onIsConnectedChanged: {
function onIsConnectedChanged() {
if (networkMonitor.isConnected) {
if (logic.currentErrorType == ErrorType.NetworkError) {
logic.clearError()
Expand Down
28 changes: 19 additions & 9 deletions package/contents/ui/MeteogramView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,21 @@ Item {

Connections {
target: appletConfig
onMeteogramTextColorChanged: graph.update()
onMeteogramScaleColorChanged: graph.update()
onMeteogramPositiveTempColorChanged: graph.update()
onMeteogramNegativeTempColorChanged: graph.update()
onMeteogramPrecipitationRawColorChanged: graph.update()
function onMeteogramTextColorChanged() {
graph.update()
}
function onMeteogramScaleColorChanged() {
graph.update()
}
function onMeteogramPositiveTempColorChanged() {
graph.update()
}
function onMeteogramNegativeTempColorChanged() {
graph.update()
}
function onMeteogramPrecipitationRawColorChanged() {
graph.update()
}
}

Item {
Expand Down Expand Up @@ -201,7 +211,7 @@ Item {
for (var i = 1; i < path.length - 2; i++) {
var xc = (gridPath[i].x + gridPath[i+1].x) / 2
var yc = (gridPath[i].y + gridPath[i+1].y) / 2

context.quadraticCurveTo(gridPath[i].x, gridPath[i].y, xc, yc)
}
var n = path.length-1
Expand Down Expand Up @@ -285,7 +295,7 @@ Item {
if (i === 0 || item.y < pathMinY) pathMinY = item.y
if (i === 0 || item.y > pathMaxY) pathMaxY = item.y
}

var pZeroY = graph.gridPoint(0, graph.freezingPoint).y
var pMaxY = graph.gridPoint(0, pathMinY).y // y axis gets flipped
var pMinY = graph.gridPoint(0, pathMaxY).y // y axis gets flipped
Expand Down Expand Up @@ -373,7 +383,7 @@ Item {
// context.strokeText(labelText, graph.gridX2, graph.gridY + 6)
// context.fillText(labelText, graph.gridX2, graph.gridY + 6)
// }


// Area
graph.updateGridItemAreas()
Expand All @@ -384,7 +394,7 @@ Item {
}



Repeater {
id: gridDataAreas
anchors.fill: parent
Expand Down
2 changes: 1 addition & 1 deletion package/contents/ui/PopupView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ MouseArea {

Connections {
target: monthView
onDateSelected: {
function onDateSelected() {
// logger.debug('onDateSelected', selectedDate)
scrollToSelection()
}
Expand Down
20 changes: 15 additions & 5 deletions package/contents/ui/TimeFormatSizeHelper.qml
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,26 @@ Item {

Connections {
target: clock
onWidthChanged: timeFormatSizeHelper.updateMinWidth()
onHeightChanged: timeFormatSizeHelper.updateMinWidth()
function onWidthChanged() {
timeFormatSizeHelper.updateMinWidth()
}
function onHeightChanged() {
timeFormatSizeHelper.updateMinWidth()
}
}
Connections {
target: timeLabel
onHeightChanged: timeFormatSizeHelper.updateMinWidth()
onTimeFormatChanged: timeFormatSizeHelper.updateMinWidth()
function onHeightChanged() {
timeFormatSizeHelper.updateMinWidth()
}
function onTimeFormatChanged() {
timeFormatSizeHelper.updateMinWidth()
}
}
Connections {
target: timeModel
onDateChanged: timeFormatSizeHelper.updateMinWidth()
function onDateChanged() {
timeFormatSizeHelper.updateMinWidth()
}
}
}
Loading