From 2a020c9d47b45462b1ccc5e93c7a8f7fbbe4e0cc Mon Sep 17 00:00:00 2001 From: Scharel Clemens Date: Tue, 11 Dec 2018 00:10:51 +0100 Subject: [PATCH] Easter Egg --- qml/pages/SettingsPage.qml | 22 ++++++- translations/harbour-nextcloudnotes-de.ts | 8 +++ translations/harbour-nextcloudnotes-sv.ts | 8 +++ translations/harbour-nextcloudnotes.ts | 74 +++++++++++++---------- 4 files changed, 78 insertions(+), 34 deletions(-) diff --git a/qml/pages/SettingsPage.qml b/qml/pages/SettingsPage.qml index eb9d456..3d4e673 100644 --- a/qml/pages/SettingsPage.qml +++ b/qml/pages/SettingsPage.qml @@ -1,6 +1,8 @@ import QtQuick 2.0 import Sailfish.Silica 1.0 import Nemo.Configuration 1.0 +import Nemo.Notifications 1.0 + Page { id: page @@ -103,7 +105,7 @@ Page { menu: ContextMenu { Repeater { id: autoSyncIntervalRepeater - model: [0, 3, 5, 10, 20, 30, 60, 120, 300, 600] + model: [0, 3, 5, 10, 20, 30, 42, 60, 120, 300, 600] MenuItem { text: modelData === 0 ? qsTr("Disabled") : (qsTr("every") + " " + @@ -113,12 +115,28 @@ Page { Component.onCompleted: { if (modelData === appSettings.autoSyncInterval) { autoSyncComboBox.currentIndex = index + theAnswer.enabled = true } } } } } - onCurrentIndexChanged: appSettings.autoSyncInterval = autoSyncIntervalRepeater.model[currentIndex] + onCurrentIndexChanged: { + appSettings.autoSyncInterval = autoSyncIntervalRepeater.model[currentIndex] + if (autoSyncIntervalRepeater.model[currentIndex] === 42 && theAnswer.enabled) { + theAnswer.publish() + } + } + Notification { + id: theAnswer + property bool enabled: false + icon: "image://theme/icon-lock-information" + summary: qsTr("The Answer is 42") + body: qsTr("Congratulation you found the Answer to the Ultimate Question of Life, The Universe, and Everything!") + previewSummary: summary + category: "Easter Egg" + urgency: Notification.Low + } } SectionHeader { diff --git a/translations/harbour-nextcloudnotes-de.ts b/translations/harbour-nextcloudnotes-de.ts index 040f3ff..7118e03 100644 --- a/translations/harbour-nextcloudnotes-de.ts +++ b/translations/harbour-nextcloudnotes-de.ts @@ -406,6 +406,14 @@ For interoperability with other apps such as Joplin Kann für die Interoperabilität mit anderen Apps (z.B. Joplin) nützlich sein + + The Answer is 42 + Die Antwort lautet 42 + + + Congratulation you found the Answer to the Ultimate Question of Life, The Universe, and Everything! + Glückwunsch, du hast die Antwort auf die Frage nach dem Leben, dem Universum und dem ganzen Rest gefunden! + UnencryptedDialog diff --git a/translations/harbour-nextcloudnotes-sv.ts b/translations/harbour-nextcloudnotes-sv.ts index 498c117..c4e43cc 100644 --- a/translations/harbour-nextcloudnotes-sv.ts +++ b/translations/harbour-nextcloudnotes-sv.ts @@ -406,6 +406,14 @@ unknown okänd + + The Answer is 42 + + + + Congratulation you found the Answer to the Ultimate Question of Life, The Universe, and Everything! + + UnencryptedDialog diff --git a/translations/harbour-nextcloudnotes.ts b/translations/harbour-nextcloudnotes.ts index aef2166..e9851a0 100644 --- a/translations/harbour-nextcloudnotes.ts +++ b/translations/harbour-nextcloudnotes.ts @@ -340,162 +340,172 @@ SettingsPage - + About - + Settings - + Accounts - + No Nextcloud account yet - + Unnamed account - + unknown - + Edit - + Delete - + Deleting account - + Add account - + Synchronization - + Auto-Sync - + Periodically pull notes from the server - + Disabled - + every - + Minutes - + Seconds - + + The Answer is 42 + + + + + Congratulation you found the Answer to the Ultimate Question of Life, The Universe, and Everything! + + + + Appearance - + Last edited - + Category - + Title alphabetically - + Sort notes by - + This will also change how the notes are grouped - + Show separator - + Show a separator line between the notes - + lines - + Number of lines in the preview - + Editing - + Monospaced font - + Use a monospeced font to edit a note - + Capital 'X' in checkboxes - + For interoperability with other apps such as Joplin