[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [plasma-workspace] applets/digital-clock/package/contents: Revert all of the Calendar-agenda changes
From:       Martin Klapetek <mklapetek () kde ! org>
Date:       2015-11-18 20:58:10
Message-ID: E1Zz9nu-0005sN-MD () scm ! kde ! org
[Download RAW message or body]

Git commit 697aaf8067ebac4c649895e57eff73a5f071b430 by Martin Klapetek.
Committed on 18/11/2015 at 20:57.
Pushed by mklapetek into branch 'master'.

Revert all of the Calendar-agenda changes

Because this code depends on plasma-framework and kdeclarative versions
that will not be released before Plasma 5.5 beta, this needs to be
reverted.

And because beta is also feature and string freeze, this will be
postponed to 5.6.

Reverts these commits:
a179d512b4fcba909a7c03da995dd963c220491b
69e13f67379e3f45e216a8f2423e56693674bf43
4b631f8c5c99957313ce2a1953b7975836fcef46
7232b798d557fb8d785827143aa576b24e790acc
ea6691a307f22490030a4fbfcc8d85535cc32284

M  +5    -23   applets/digital-clock/package/contents/config/config.qml
M  +0    -3    applets/digital-clock/package/contents/config/main.xml
M  +11   -163  applets/digital-clock/package/contents/ui/CalendarView.qml
M  +6    -1    applets/digital-clock/package/contents/ui/configAppearance.qml
D  +0    -72   applets/digital-clock/package/contents/ui/configCalendar.qml

http://commits.kde.org/plasma-workspace/697aaf8067ebac4c649895e57eff73a5f071b430

diff --git a/applets/digital-clock/package/contents/config/config.qml \
b/applets/digital-clock/package/contents/config/config.qml index 8e74dab..877e40c \
                100644
--- a/applets/digital-clock/package/contents/config/config.qml
+++ b/applets/digital-clock/package/contents/config/config.qml
@@ -1,6 +1,5 @@
 /*
  * Copyright 2013  Bhushan Shah <bhush94@gmail.com>
- * Copyright 2015  Martin Klapetek <mklapetek@kde.org>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -22,38 +21,21 @@
 import QtQuick 2.0
 
 import org.kde.plasma.configuration 2.0
-import org.kde.plasma.calendar 2.0 as PlasmaCalendar
 
 ConfigModel {
-    id: configModel
-
+//     ConfigCategory {
+//          name: i18n("General")
+//          icon: "preferences-system-time"
+//          source: "configGeneral.qml"
+//     }
     ConfigCategory {
          name: i18n("Appearance")
          icon: "preferences-desktop-color"
          source: "configAppearance.qml"
     }
     ConfigCategory {
-        name: i18n("Calendar")
-        icon: "view-calendar"
-        source: "configCalendar.qml"
-    }
-    ConfigCategory {
         name: i18n("Time Zones")
         icon: "preferences-system-time"
         source: "configTimeZones.qml"
     }
-
-    Component.onCompleted: {
-        var model = PlasmaCalendar.EventPluginsManager.model;
-
-        for (var i = 0; i < model.rowCount(); i++) {
-            if (model.get(i, "checked") == true) {
-                configModel.appendCategory(model.get(i, "decoration"),
-                                        model.get(i, "display"),
-                                        model.get(i, "configUi"),
-                                        "",
-                                        true);
-            }
-        }
-    }
 }
diff --git a/applets/digital-clock/package/contents/config/main.xml \
b/applets/digital-clock/package/contents/config/main.xml index b8b3d8d..aacbe27 \
                100644
--- a/applets/digital-clock/package/contents/config/main.xml
+++ b/applets/digital-clock/package/contents/config/main.xml
@@ -48,9 +48,6 @@
     <entry name="use24hFormat" type="UInt">
         <default>1</default>
     </entry>
-    <entry name="enabledCalendarPlugins" type="StringList">
-        <default></default>
-    </entry>
   </group>
 
 </kcfg>
diff --git a/applets/digital-clock/package/contents/ui/CalendarView.qml \
b/applets/digital-clock/package/contents/ui/CalendarView.qml index b0daebe..09dbe5e \
                100644
--- a/applets/digital-clock/package/contents/ui/CalendarView.qml
+++ b/applets/digital-clock/package/contents/ui/CalendarView.qml
@@ -23,19 +23,23 @@ import org.kde.plasma.components 2.0 as PlasmaComponents
 import org.kde.plasma.extras 2.0 as PlasmaExtras
 
 Item {
+    /******************************************************************
+     *
+     * TODO: Revert commit bfd62154d8e892d4fdc87d27d25d07cb7841c1e6
+     *       to bring back the original agenda part
+     *
+     ******************************************************************/
+
     id: calendar
 
     Layout.minimumWidth: _minimumWidth
     Layout.minimumHeight: _minimumHeight
 
     // The "sensible" values
-    property int _minimumWidth: _minimumHeight * 1.5 + (monthView.showWeekNumbers ? \
Math.round(_minimumHeight * 1.75) : Math.round(_minimumHeight * 1.5)) +    property \
int _minimumWidth: monthView.showWeekNumbers ? Math.round(_minimumHeight * 1.75) : \
Math.round(_minimumHeight * 1.5)  property int _minimumHeight: units.gridUnit * 14
     Layout.preferredWidth: _minimumWidth
-    Layout.preferredHeight: _minimumHeight * 1.5
-
-    property int avWidth: (parent.width - (3 * units.largeSpacing)) / 2
-    property int avHeight: parent.height - (2 * units.largeSpacing)
+    Layout.preferredHeight: Math.round(_minimumHeight * 1.5)
 
     //anchors.margins: units.largeSpacing
     property int spacing: units.largeSpacing
@@ -55,159 +59,9 @@ Item {
     }
 
     Item {
-        id: agenda
-
-        width: avWidth
-        anchors {
-            top: parent.top
-            left: parent.left
-            bottom: parent.bottom
-            leftMargin: spacing
-            topMargin: spacing
-            bottomMargin: spacing
-        }
-
-        function dateString(format) {
-            return Qt.formatDate(monthView.currentDate, format);
-        }
-
-        Connections {
-            target: monthView
-
-            onCurrentDateChanged: {
-                // Apparently this is needed because this is a simple QList being
-                // returned and if the list for the current day has 1 event and the
-                // user clicks some other date which also has 1 event, QML sees the
-                // sizes match and does not update the labels with the content.
-                // Resetting the model to null first clears it and then correct data
-                // are displayed.
-                holidaysList.model = null;
-                holidaysList.model = \
                monthView.daysModel.eventsForDate(monthView.currentDate);
-            }
-        }
-
-        Connections {
-            target: monthView.daysModel
-
-            onAgendaUpdated: {
-                // Checks if the dates are the same, comparing the date objects
-                // directly won't work and this does a simple integer subtracting
-                // so should be fastest. One of the JS weirdness.
-                if (updatedDate - monthView.currentDate === 0) {
-                    holidaysList.model = null;
-                    holidaysList.model = \
                monthView.daysModel.eventsForDate(monthView.currentDate);
-                }
-            }
-        }
-
-        Connections {
-            target: plasmoid.configuration
-
-            onEnabledCalendarPluginsChanged: {
-                PlasmaCalendar.EventPluginsManager.enabledPlugins = \
                plasmoid.configuration.enabledCalendarPlugins;
-            }
-        }
-
-        PlasmaComponents.Label {
-            id: dayLabel
-            height: dayHeading.height + dateHeading.height
-            width: paintedWidth
-            font.pixelSize: height
-            font.weight: Font.Light
-            text: agenda.dateString("dd")
-            opacity: 0.6
-        }
-
-        PlasmaExtras.Heading {
-            id: dayHeading
-            anchors {
-                top: parent.top
-                left: dayLabel.right
-                right: parent.right
-                leftMargin: spacing / 2
-            }
-            level: 1
-            elide: Text.ElideRight
-            text: agenda.dateString("dddd")
-        }
-        PlasmaComponents.Label {
-            id: dateHeading
-            anchors {
-                top: dayHeading.bottom
-                left: dayLabel.right
-                right: parent.right
-                leftMargin: spacing / 2
-            }
-            elide: Text.ElideRight
-            text: Qt.locale().standaloneMonthName(monthView.currentDate.getMonth())
-                             + agenda.dateString(" yyyy")
-        }
-
-        ListView {
-            id: holidaysList
-            anchors {
-                top: dateHeading.bottom
-                left: parent.left
-                right: parent.right
-                bottom: parent.bottom
-            }
-
-            delegate: Item {
-                id: eventItem
-                width: holidaysList.width
-                height: eventTitle.paintedHeight
-                property bool hasTime: {
-                    var startIsMidnight = modelData.startDateTime.getHours() == 0
-                                       && modelData.startDateTime.getMinutes() == 0;
-
-                    var endIsMidnight = modelData.endDateTime.getHours() == 0
-                                     && modelData.endDateTime.getMinutes() == 0;
-
-                    var sameDay = modelData.startDateTime.getDate() == \
                modelData.endDateTime.getDate()
-                               && modelData.startDateTime.getDay() == \
                modelData.endDateTime.getDay()
-
-                    if (startIsMidnight && endIsMidnight && sameDay) {
-                        return false
-                    }
-
-                    return true;
-                }
-
-                PlasmaComponents.Label {
-                    text: {
-                        if (modelData.startDateTime - modelData.endDateTime === 0) {
-                            return Qt.formatTime(modelData.startDateTime);
-                        } else {
-                            return Qt.formatTime(modelData.startDateTime) + " - " + \
                Qt.formatTime(modelData.endDateTime);
-                        }
-                    }
-                    visible: eventItem.hasTime
-                }
-                PlasmaComponents.Label {
-                    id: eventTitle
-                    width: eventItem.hasTime ? parent.width * 0.7 : parent.width
-                    anchors.right: parent.right
-                    text: modelData.title
-                }
-            }
-
-            section.property: "modelData.eventType"
-            section.delegate: PlasmaExtras.Heading {
-                level: 3
-                elide: Text.ElideRight
-                text: section
-            }
-        }
-    }
-    Item {
         id: cal
-        width: avWidth
-        anchors {
-            top: parent.top
-            right: parent.right
-            bottom: parent.bottom
-            margins: spacing
-        }
+        anchors.fill: parent
+        anchors.margins: spacing
 
         PlasmaCalendar.MonthView {
             id: monthView
@@ -229,10 +83,4 @@ Item {
         onCheckedChanged: plasmoid.hideOnWindowDeactivate = !checked
     }
 
-    Component.onCompleted: {
-        // Set the list of enabled plugins from config
-        // to the manager
-        PlasmaCalendar.EventPluginsManager.enabledPlugins = \
                plasmoid.configuration.enabledCalendarPlugins;
-    }
-
 }
diff --git a/applets/digital-clock/package/contents/ui/configAppearance.qml \
b/applets/digital-clock/package/contents/ui/configAppearance.qml index \
                5d562b0..fc9a09e 100644
--- a/applets/digital-clock/package/contents/ui/configAppearance.qml
+++ b/applets/digital-clock/package/contents/ui/configAppearance.qml
@@ -23,7 +23,6 @@
 import QtQuick 2.0
 import QtQuick.Controls 1.0 as QtControls
 import QtQuick.Layouts 1.0 as QtLayouts
-import org.kde.plasma.calendar 2.0 as PlasmaCalendar
 
 Item {
     id: appearancePage
@@ -40,6 +39,7 @@ Item {
     property alias cfg_showLocalTimezone: showLocalTimezone.checked
     property alias cfg_displayTimezoneAsCode: timezoneCodeRadio.checked
     property alias cfg_showSeconds: showSeconds.checked
+    property alias cfg_showWeekNumbers: showWeekNumbers.checked
 
     property alias cfg_showDate: showDate.checked
     property string cfg_dateFormat: "shortDate"
@@ -134,6 +134,10 @@ Item {
                     id: showDate
                     text: i18n("Show date")
                 }
+                QtControls.CheckBox {
+                    id: showWeekNumbers
+                    text: i18n("Show week numbers in Calendar")
+                }
 
                 QtControls.CheckBox {
                     id: showSeconds
@@ -150,6 +154,7 @@ Item {
                     text: i18n("Show local time zone")
                 }
 
+
                 QtControls.Label {
                     text: i18n("Display time zone as:")
                 }
diff --git a/applets/digital-clock/package/contents/ui/configCalendar.qml \
b/applets/digital-clock/package/contents/ui/configCalendar.qml deleted file mode \
100644 index 7ff92e5..0000000
--- a/applets/digital-clock/package/contents/ui/configCalendar.qml
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2015 Martin Klapetek <mklapetek@kde.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License or (at your option) version 3 or any later version
- * accepted by the membership of KDE e.V. (or its successor approved
- * by the membership of KDE e.V.), which shall act as a proxy
- * defined in Section 14 of version 3 of the license.
- *
- * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>
- */
-
-import QtQuick 2.0
-import QtQuick.Controls 1.0 as QtControls
-import QtQuick.Layouts 1.0 as QtLayouts
-import org.kde.plasma.calendar 2.0 as PlasmaCalendar
-
-Item {
-    id: calendarPage
-    width: childrenRect.width
-    height: childrenRect.height
-
-    signal configurationChanged
-
-    property alias cfg_showWeekNumbers: showWeekNumbers.checked
-
-    function saveConfig()
-    {
-        plasmoid.configuration.enabledCalendarPlugins = \
                PlasmaCalendar.EventPluginsManager.enabledPlugins;
-    }
-
-    QtLayouts.ColumnLayout {
-        QtControls.CheckBox {
-            id: showWeekNumbers
-            text: i18n("Show week numbers in Calendar")
-        }
-
-        QtControls.GroupBox {
-            QtLayouts.Layout.fillWidth: true
-            title: i18n("Available Calendar Plugins")
-            flat: true
-
-            Repeater {
-                id: calendarPluginsRepeater
-                model: PlasmaCalendar.EventPluginsManager.model
-                delegate: QtLayouts.RowLayout {
-                    QtControls.CheckBox {
-                        text: model.display
-                        checked: model.checked
-                        onClicked: {
-                            //needed for model's setData to be called
-                            model.checked = checked;
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    Component.onCompleted: {
-        PlasmaCalendar.EventPluginsManager.populateEnabledPluginsList(plasmoid.configuration.enabledCalendarPlugins);
                
-    }
-}
-


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic