Commit 42a2c9a2 authored by Dimitris Kardarakos's avatar Dimitris Kardarakos

First release preparation: enable localization, code cleaning and README update

parent 2a9c5a6b
Pipeline #3871 passed with stage
in 7 minutes and 17 seconds
......@@ -34,6 +34,7 @@ find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Gui
find_package(KF5Config)
find_package(KF5Kirigami2)
find_package(KF5Plasma)
find_package(KF5I18n)
find_package(KF5CalendarCore REQUIRED)
################# Enable C++11 features for clang and gcc #################
......
# Calindori
Calendar for Plasma Mobile
Calendar application for Plasma Mobile
# Installation
Calindori is a touch friendly calendar application. It has been designed for mobile devices but it can also run on desktop environments. Users of Calindori are able to check previous and future dates and manage tasks and events.
When executing the application for the first time, a new calendar file is created that follows the ical standard. Alternatively, users may create additional calendars or import existing ones.
## Build
mkdir build
cd build
......
# Changelog
## Version 0.1
Initial release
......@@ -6,13 +6,18 @@
<name>Calindori</name>
<summary>Calendar application</summary>
<description>
<p>Calindori supports:</p>
<p>Calindori is a touch friendly calendar application. It has been designed for mobile devices but it can also run on desktop environments. Users of Calindori are able to check previous and future dates and manage tasks and events.</p>
<p>When executing the application for the first time, a new calendar file is created that follows the ical standard. Alternatively, users may create additional calendars or import existing ones.</p>
<p>Features:</p>
<ul>
<li>Agenda</li>
<li>Events</li>
<li>Todos</li>
<li>Multiple calendars</li>
<li>Import calendar</li>
</ul>
</description>
<url type="bugtracker">https://phabricator.kde.org/T6942</url>
<url type="bugtracker">https://invent.kde.org/dkardarakos/calindori/issues</url>
<project_group>KDE</project_group>
<provides>
<binary>calindori</binary>
......
[Desktop Entry]
Name=Calindori
Comment=Calindori
Version=0.1
Exec=calindori
MimeType=application/x-calindori;
Icon=calindori
......
......@@ -13,7 +13,7 @@ qt5_add_resources(RESOURCES resources.qrc)
add_subdirectory(plugins)
add_executable(calindori ${calindori_SRCS} ${RESOURCES})
target_link_libraries(calindori Qt5::Core Qt5::Qml Qt5::Quick Qt5::Test Qt5::Svg KF5::ConfigCore KF5::Plasma)
target_link_libraries(calindori Qt5::Core Qt5::Qml Qt5::Quick Qt5::Test Qt5::Svg KF5::ConfigCore KF5::Plasma KF5::I18n)
install(TARGETS calindori ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
......
......@@ -19,9 +19,10 @@
*/
/**
* Creates the list of actions of 'Calendars' action container
*/
function loadGlobalActions(calendars, calendarActions, calendarActionComp) {
* Creates the list of actions of 'Calendars' action container
*/
function loadGlobalActions(calendars, calendarActions, calendarActionComp)
{
var cfgCalendars = calendars.split(calendars.includes(";") ? ";" : null);
var currentChildren = calendarActions.children;
var newChildren = [];
......
......@@ -44,6 +44,6 @@ Kirigami.Action {
text: "Delete"
iconName: "delete"
onTriggered: (configuration.activeCalendar == parent.text) ? showPassiveNotification("Active calendar cannot be deleted") : deleteCalendar()
onTriggered: (configuration.activeCalendar == parent.text) ? showPassiveNotification(i18n("The active calendar cannot be deleted")) : deleteCalendar()
}
}
......@@ -40,7 +40,7 @@ Kirigami.Page {
function importCalendar() {
if(root.fileToImport.text == "") {
showPassiveNotification("Please import a calendar file");
showPassiveNotification(i18n("Please import a calendar file"));
return;
}
......@@ -54,7 +54,7 @@ Kirigami.Page {
var importResult = calendarController.importCalendar(root.calendarName, root.fileToImport);
if(!(importResult.success)) {
showPassiveNotification("Calendar not imported. " + importResult.reason);
showPassiveNotification(i18n("Calendar not imported. %1",importResult.reason));
return;
}
......
/*
* Copyright 2018 Dimitris Kardarakos <dimkard@gmail.com>
* 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
......
......@@ -31,7 +31,7 @@ Kirigami.OverlaySheet {
contentItem: Controls2.Label {
Layout.fillWidth: true
wrapMode: Text.WordWrap
text: "All data included in this calendar will be deleted. Proceed with deletion?"
text: i18n("All data included in this calendar will be deleted. Proceed with deletion?")
}
parent: applicationWindow().overlay
......@@ -42,13 +42,13 @@ Kirigami.OverlaySheet {
}
Controls2.ToolButton {
text: qsTr("Delete")
text: i18n("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");
showPassiveNotification(i18n("Calendar %1 has been deleted",deleteSheet.calendar));
deleteSheet.close();
}
}
......
/*
* Copyright 2019 Dimitris Kardarakos
* 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
......
/*
* Copyright 2019 Dimitris Kardarakos <dimkard@gmail.com>
* 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
......@@ -72,7 +72,7 @@ Kirigami.Page {
return result;
}
title: qsTr("Event")
title: i18n("Event")
ColumnLayout {
......@@ -86,7 +86,7 @@ Kirigami.Page {
Controls2.Label {
id: calendarName
Kirigami.FormData.label: qsTr("Calendar:")
Kirigami.FormData.label: i18n("Calendar:")
Layout.fillWidth: true
text: root.calendar.name
}
......@@ -99,20 +99,20 @@ Kirigami.Page {
id: summary
Layout.fillWidth: true
Kirigami.FormData.label: qsTr("Summary:")
Kirigami.FormData.label: i18n("Summary:")
text: eventData ? eventData.summary : ""
}
RowLayout {
Kirigami.FormData.label: qsTr("Start:")
Kirigami.FormData.label: i18n("Start:")
spacing: 0
Controls2.ToolButton {
Layout.fillWidth: true
text: root.startdt.toLocaleDateString(Qt.locale(),Locale.NarrowFormat)
onClicked: showPassiveNotification("Start date cannot be changed")
onClicked: showPassiveNotification(i18n("Start date cannot be changed"))
}
Controls2.ToolButton {
......@@ -126,26 +126,26 @@ Kirigami.Page {
enabled: !allDaySelector.checked
onClicked: {
startTimePickerSheet.hours = startTimeSelector.startHour
startTimePickerSheet.minutes = startTimeSelector.startMinutes
startTimePickerSheet.pm = startTimeSelector.startPm
startTimePickerSheet.open()
startTimePickerSheet.hours = startTimeSelector.startHour;
startTimePickerSheet.minutes = startTimeSelector.startMinutes;
startTimePickerSheet.pm = startTimeSelector.startPm;
startTimePickerSheet.open();
}
Connections {
target: startTimePickerSheet
onDatePicked: {
startTimeSelector.startHour = startTimePickerSheet.hours
startTimeSelector.startMinutes = startTimePickerSheet.minutes
startTimeSelector.startPm = startTimePickerSheet.pm
startTimeSelector.startHour = startTimePickerSheet.hours;
startTimeSelector.startMinutes = startTimePickerSheet.minutes;
startTimeSelector.startPm = startTimePickerSheet.pm;
}
}
}
}
RowLayout {
Kirigami.FormData.label: "End:"
Kirigami.FormData.label: i18n("End:")
spacing: 0
Controls2.ToolButton {
......@@ -157,15 +157,15 @@ Kirigami.Page {
enabled: !allDaySelector.checked
onClicked: {
endDatePickerSheet.selectedDate = endDateSelector.endDate
endDatePickerSheet.open()
endDatePickerSheet.selectedDate = endDateSelector.endDate;
endDatePickerSheet.open();
}
Connections {
target: endDatePickerSheet
onDatePicked: {
endDateSelector.endDate = endDatePickerSheet.selectedDate
endDateSelector.endDate = endDatePickerSheet.selectedDate;
}
}
}
......@@ -181,19 +181,19 @@ Kirigami.Page {
enabled: !allDaySelector.checked && (root.enddt != undefined && !isNaN(root.enddt))
onClicked: {
endTimePickerSheet.hours = endTimeSelector.endHour
endTimePickerSheet.minutes = endTimeSelector.endMinutes
endTimePickerSheet.pm = endTimeSelector.endPm
endTimePickerSheet.open()
endTimePickerSheet.hours = endTimeSelector.endHour;
endTimePickerSheet.minutes = endTimeSelector.endMinutes;
endTimePickerSheet.pm = endTimeSelector.endPm;
endTimePickerSheet.open();
}
Connections {
target: endTimePickerSheet
onDatePicked: {
endTimeSelector.endHour = endTimePickerSheet.hours
endTimeSelector.endMinutes = endTimePickerSheet.minutes
endTimeSelector.endPm = endTimePickerSheet.pm
endTimeSelector.endHour = endTimePickerSheet.hours;
endTimeSelector.endMinutes = endTimePickerSheet.minutes;
endTimeSelector.endPm = endTimePickerSheet.pm;
}
}
}
......@@ -204,7 +204,7 @@ Kirigami.Page {
enabled: !isNaN(root.startdt)
checked: eventData ? eventData.allday: false
text: qsTr("All day")
text: i18n("All day")
}
Kirigami.Separator {
......@@ -215,7 +215,7 @@ Kirigami.Page {
id: location
Layout.fillWidth: true
Kirigami.FormData.label: qsTr("Location:")
Kirigami.FormData.label: i18n("Location:")
text: eventData ? eventData.location : ""
}
}
......@@ -233,7 +233,7 @@ Kirigami.Page {
Layout.maximumWidth: eventCard.width
wrapMode: Text.WrapAnywhere
text: eventData ? eventData.description : ""
placeholderText: qsTr("Description")
placeholderText: i18n("Description")
}
}
......@@ -242,7 +242,7 @@ Kirigami.Page {
left: Kirigami.Action {
id: cancelAction
text: qsTr("Cancel")
text: i18n("Cancel")
icon.name : "dialog-cancel"
onTriggered: editcompleted()
......@@ -251,7 +251,7 @@ Kirigami.Page {
main: Kirigami.Action {
id: info
text: qsTr("Info")
text: i18n("Info")
icon.name : "documentinfo"
onTriggered: showPassiveNotification("Please save or cancel this event")
......@@ -260,8 +260,8 @@ Kirigami.Page {
right: Kirigami.Action {
id: saveAction
text: qsTr("Save")
icon.name : "dialog-ok"
text: i18n("Save")
icon.name: "dialog-ok"
onTriggered: {
var validation = validate();
......
/*
* Copyright 2018 Dimitris Kardarakos <dimkard@gmail.com>
* 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
......@@ -36,11 +36,11 @@ Kirigami.Page {
cardsListview.model.loadEvents();
}
title: qsTr("Events")
title: i18n("Events")
actions.main: Kirigami.Action {
icon.name: "resource-calendar-insert"
text: qsTr("Add event")
text: i18n("Add event")
onTriggered: pageStack.push(eventEditor, {startdt: eventStartDt})
}
......@@ -76,7 +76,7 @@ Kirigami.Page {
actions: [
Kirigami.Action {
text: qsTr("Delete")
text: i18n("Delete")
icon.name: "delete"
onTriggered: {
......@@ -88,7 +88,7 @@ Kirigami.Page {
},
Kirigami.Action {
text: qsTr("Edit")
text: i18n("Edit")
icon.name: "editor"
onTriggered: pageStack.push(eventEditor, { startdt: model.dtstart, uid: model.uid, eventData: model })
......@@ -99,7 +99,6 @@ Kirigami.Page {
Controls2.Label {
property bool sameEndStart : model.dtstart && !isNaN(model.dtstart) && model.dtend && !isNaN(model.dtend) && model.dtstart.toLocaleString(Qt.locale(), "dd.MM.yyyy") == model.dtend.toLocaleString(Qt.locale(), "dd.MM.yyyy")
property string timeFormat: model.allday ? "" : "hh:mm"
property string dateFormat: model.allday ? "ddd d MMM yyyy" : "ddd d MMM yyyy hh:mm"
property string separator: model.allday ? "" : " - "
......@@ -131,8 +130,7 @@ Kirigami.Page {
Component {
id: eventController
Calindori.EventController {
}
Calindori.EventController {}
}
}
......@@ -38,7 +38,7 @@ Item {
property string filterName: "All files"
property string fileUrl
property bool selectFolder: false
property string title: qsTr("Select a file")
property string title: i18n("Select a file")
signal accepted
Loader {
......
/*
* Copyright 2018 Dimitris Kardarakos <dimkard@gmail.com>
* 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
......@@ -40,20 +40,20 @@ Kirigami.ApplicationWindow {
Kirigami.Action {
id: calendarActions
text: "Calendars"
text: i18n("Calendars")
iconName: "view-calendar"
Kirigami.Action {
text: "Create"
text: i18n("Create")
iconName: "list-add"
onTriggered: root.pageStack.push(calendarEditor, {mode: "add"});
onTriggered: root.pageStack.push(calendarEditor, {mode: "add"})
}
Kirigami.Action {
text: "Import"
text: i18n("Import")
iconName: "document-import"
onTriggered: root.pageStack.push(calendarEditor, {mode: "import"});
onTriggered: root.pageStack.push(calendarEditor, {mode: "import"})
}
Kirigami.Action {
......@@ -64,7 +64,7 @@ Kirigami.ApplicationWindow {
Kirigami.Action {
id: show
text: "Show"
text: i18n("Show")
iconName: "view-choose"
Kirigami.Action {
......@@ -72,12 +72,12 @@ Kirigami.ApplicationWindow {
iconName: "view-calendar-day"
onTriggered: {
pageStack.clear();
pageStack.push(calendarDashboardComponent)
pageStack.push(calendarDashboardComponent);
}
}
Kirigami.Action {
text: "Tasks" + " (" + localCalendar.name + ")"
text: i18n("Tasks (%1)", localCalendar.name)
iconName: "view-calendar-tasks"
onTriggered: {
pageStack.clear();
......@@ -164,14 +164,14 @@ Kirigami.ApplicationWindow {
contextualActions: [
Kirigami.Action {
iconName: "view-calendar-tasks"
text: "Tasks"
text: i18n("Tasks")
onTriggered: root.pageStack.push(todosView, { todoDt: calendarMonthView.selectedDate })
},
Kirigami.Action {
iconName: "view-calendar-events"
text: "Events"
text: i18n("Events")
onTriggered: root.pageStack.push(eventsView, { eventStartDt: calendarMonthView.selectedDate })
}
......
/*
* Copyright 2019 Dimitris Kardarakos
* 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
......@@ -46,17 +46,17 @@ Kirigami.OverlaySheet {
}
Controls2.ToolButton {
text: qsTr("OK")
text: i18n("OK")
onClicked: {
timePickerSheet.datePicked()
timePickerSheet.close()
timePickerSheet.datePicked();
timePickerSheet.close();
}
}
Controls2.ToolButton {
text: qsTr("Cancel")
text: i18n("Cancel")
onClicked: {
timePickerSheet.close()
timePickerSheet.close();
}
}
}
......
......@@ -42,7 +42,7 @@ Kirigami.Page {
signal taskeditcompleted
title: qsTr("Task")
title: i18n("Task")
ColumnLayout {
......@@ -68,7 +68,7 @@ Kirigami.Page {
Controls2.Label {
id: calendarName
Kirigami.FormData.label: qsTr("Calendar:")
Kirigami.FormData.label: i18n("Calendar:")
Layout.fillWidth: true
text: root.calendar.name
}
......@@ -81,13 +81,13 @@ Kirigami.Page {
id: summary
Layout.fillWidth: true
Kirigami.FormData.label: qsTr("Summary:")
Kirigami.FormData.label: i18n("Summary:")
text: todoData ? todoData.summary : ""
}
RowLayout {
Kirigami.FormData.label: qsTr("Start time:")
Kirigami.FormData.label: i18n("Start time:")
enabled: root.startdt != undefined && !isNaN(root.startdt)
Controls2.ToolButton {
......@@ -103,20 +103,19 @@ Kirigami.Page {
enabled: !allDaySelector.checked
onClicked: {
startTimePickerSheet.hours = startTimeSelector.startHour
startTimePickerSheet.minutes = startTimeSelector.startMinutes
startTimePickerSheet.pm = startTimeSelector.startPm
startTimePickerSheet.open()
startTimePickerSheet.hours = startTimeSelector.startHour;
startTimePickerSheet.minutes = startTimeSelector.startMinutes;
startTimePickerSheet.pm = startTimeSelector.startPm;
startTimePickerSheet.open();
}
Connections {
target: startTimePickerSheet
onDatePicked: {
startTimeSelector.startHour = startTimePickerSheet.hours
startTimeSelector.startMinutes = startTimePickerSheet.minutes
startTimeSelector.startPm = startTimePickerSheet.pm
startTimeSelector.startHour = startTimePickerSheet.hours;
startTimeSelector.startMinutes = startTimePickerSheet.minutes;
startTimeSelector.startPm = startTimePickerSheet.pm;
}
}
}
......@@ -127,7 +126,7 @@ Kirigami.Page {
enabled: !isNaN(root.startdt)
checked: todoData ? todoData.allday: false
text: qsTr("All day")
text: i18n("All day")
}
Kirigami.Separator {
......@@ -138,7 +137,7 @@ Kirigami.Page {
id: location
Layout.fillWidth: true
Kirigami.FormData.label: qsTr("Location:")
Kirigami.FormData.label: i18n("Location:")
text: todoData ? todoData.location : ""
}
......@@ -159,7 +158,7 @@ Kirigami.Page {
Layout.maximumWidth: todoCard.width
wrapMode: Text.WrapAnywhere
text: todoData ? todoData.description : ""
placeholderText: qsTr("Description")
placeholderText: i18n("Description")
}
Kirigami.Separator {
......@@ -169,7 +168,7 @@ Kirigami.Page {
Controls2.CheckBox {
id: completed
text: qsTr("Completed")
text: i18n("Completed")
checked: todoData ? todoData.completed: false
}
}
......@@ -179,7 +178,7 @@ Kirigami.Page {
left: Kirigami.Action {
id: cancelAction
text: qsTr("Cancel")
text: i18n("Cancel")
icon.name : "dialog-cancel"
onTriggered: {
......@@ -191,18 +190,18 @@ Kirigami.Page {
main: Kirigami.Action {
id: info
text: qsTr("Info")
text: i18n("Info")
icon.name : "documentinfo"
onTriggered: {
showPassiveNotification("Please save or cancel this task");
showPassiveNotification(i18n("Please save or cancel this task"));
}
}
right: Kirigami.Action {
id: saveAction
text: qsTr("Save")
text: i18n("Save")
icon.name : "dialog-ok"
onTriggered: {
......@@ -219,25 +218,6 @@ Kirigami.Page {
}
}
//TODO
// contextualActions: [
// Kirigami.Action {
// iconName:"editor"
// text: "Edit Start Date"
//
// onTriggered: showPassiveNotification("Edit start date")
//
// }
// ,
// Kirigami.Action { //TODO: Do we needed it?
// iconName:"delete"
// text: "Clear Start Date"
//
// onTriggered: {
// root.startdt = new Date("No Date");
// }
// }
// ]
}
TimePickerSheet {
......
/*
* Copyright 2018 Dimitris Kardarakos <dimkard@gmail.com>
* 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
......@@ -36,15 +36,14 @@ Kirigami.Page {
cardsListview.model.loadTasks();
}
title: qsTr("Tasks")
title: i18n("Tasks")
actions.main: Kirigami.Action {
icon.name: "resource-calendar-insert"
text: qsTr("Add task")
text: i18n("Add task")
onTriggered: pageStack.push(todoEditor, {startdt: todoDt})
}
Component {
id: todoEditor
TodoEditor {
......@@ -64,7 +63,6 @@ Kirigami.Page {
model: Calindori.TodosModel {
filterdt: root.todoDt
memorycalendar: root.calendar.memorycalendar
}
delegate: Kirigami.Card {
......@@ -75,7 +73,7 @@ Kirigami.Page {
actions: [
Kirigami.Action {
text: qsTr("Delete")
text: i18n("Delete")
icon.name: "delete"
onTriggered: {
......@@ -87,7 +85,7 @@ Kirigami.Page {
},
Kirigami.Action {
text: qsTr("Edit")
text: i18n("Edit")
icon.name: "editor"
onTriggered: pageStack.push(todoEditor, { startdt: model.dtstart, uid: model.uid, todoData: model })
......
......@@ -61,5 +61,4 @@ ColumnLayout {
((root.headerEventsCount > 0) ? i18np("%1 event", "%1 events",root.headerEventsCount) : "")
opacity: 0.6
}
}
/*
* Copyright 2018 Dimitris Kardarakos <dimkard@gmail.com>
* Copyright 2018 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
......
/*
* Copyright 2018 Dimitris Kardarakos <dimkard@gmail.com>
* Copyright 2018 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
......
......@@ -29,7 +29,6 @@ ColumnLayout {
property int hours
property int minutes
property bool pm
Item {
id: clock
......@@ -38,7 +37,9 @@ ColumnLayout {
height: width
Layout.alignment: Qt.AlignHCenter