From a0418e8556412dc65efd61a5a36655c26a557055 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Sat, 26 Jan 2019 01:16:18 -0600 Subject: [PATCH] Remove reverse-applicable patches. --- debian/changelog | 1 + debian/patches/add-autoexpansion-1.patch | 105 - debian/patches/add-autoexpansion-2.patch | 35 - debian/patches/add-autoexpansion-3.patch | 238 --- debian/patches/add-autoexpansion-4.patch | 114 -- .../completely-remove-plugin-clock.patch | 1756 ----------------- .../don't-autounmute-on-volume-change.patch | 30 - debian/patches/override-icon-theme.patch | 322 --- debian/patches/series | 7 - 9 files changed, 1 insertion(+), 2607 deletions(-) delete mode 100644 debian/patches/add-autoexpansion-1.patch delete mode 100644 debian/patches/add-autoexpansion-2.patch delete mode 100644 debian/patches/add-autoexpansion-3.patch delete mode 100644 debian/patches/add-autoexpansion-4.patch delete mode 100644 debian/patches/completely-remove-plugin-clock.patch delete mode 100644 debian/patches/don't-autounmute-on-volume-change.patch delete mode 100644 debian/patches/override-icon-theme.patch delete mode 100644 debian/patches/series diff --git a/debian/changelog b/debian/changelog index e48a747..0ee0278 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ lxqt-panel (0.14.0-0ubuntu1) UNRELEASED; urgency=medium * New upstream release. - Bump build dependencies. + - Remove reverse-applicable patches. * Bump Standards-version to 4.3.0, no changes needed. * Bump debhelper compat to 12, no changes needed. * Add a new lxqt-panel-l10n package. diff --git a/debian/patches/add-autoexpansion-1.patch b/debian/patches/add-autoexpansion-1.patch deleted file mode 100644 index 3d26ebf..0000000 --- a/debian/patches/add-autoexpansion-1.patch +++ /dev/null @@ -1,105 +0,0 @@ -Description: Allow plugin's "static" configration change - This is patch 1/4 adding autoexpansion support to the spacer plugin. -Author: Palo Kisa -Origin: upstream -Bug: https://github.com/lxqt/lxqt/issues/1038 -Applied-Upstream: commit:6fbe184 -Last-Update: 2018-08-16 ---- a/panel/ilxqtpanel.h -+++ b/panel/ilxqtpanel.h -@@ -110,6 +110,16 @@ public: - * - */ - virtual void willShowWindow(QWidget * w) = 0; -+ -+ /*! -+ * \brief By calling this function, a plugin notifies the panel about change of it's "static" -+ * configuration -+ * -+ * \param plugin the changed plugin -+ * -+ * \sa ILXQtPanelPlugin::isSeparate(), ILXQtPanelPlugin::isExpandable -+ */ -+ virtual void pluginFlagsChanged(const ILXQtPanelPlugin * plugin) = 0; - }; - - #endif // ILXQTPANEL_H ---- a/panel/ilxqtpanelplugin.h -+++ b/panel/ilxqtpanelplugin.h -@@ -196,6 +196,17 @@ public: - mPanel->willShowWindow(w); - } - -+ /*! -+ * \brief By calling this function, a plugin notifies the panel about change of it's "static" -+ * configuration -+ * -+ * \sa isSeparate(), isExpandable -+ */ -+ inline void pluginFlagsChanged() -+ { -+ mPanel->pluginFlagsChanged(this); -+ } -+ - virtual bool isSeparate() const { return false; } - virtual bool isExpandable() const { return false; } - private: ---- a/panel/lxqtpanel.cpp -+++ b/panel/lxqtpanel.cpp -@@ -1225,6 +1225,14 @@ void LXQtPanel::willShowWindow(QWidget * - /************************************************ - - ************************************************/ -+void LXQtPanel::pluginFlagsChanged(const ILXQtPanelPlugin * /*plugin*/) -+{ -+ mLayout->rebuild(); -+} -+ -+/************************************************ -+ -+ ************************************************/ - QString LXQtPanel::qssPosition() const - { - return positionToStr(position()); ---- a/panel/lxqtpanel.h -+++ b/panel/lxqtpanel.h -@@ -146,6 +146,7 @@ public: - QRect calculatePopupWindowPos(QPoint const & absolutePos, QSize const & windowSize) const override; - QRect calculatePopupWindowPos(const ILXQtPanelPlugin *plugin, const QSize &windowSize) const override; - void willShowWindow(QWidget * w) override; -+ void pluginFlagsChanged(const ILXQtPanelPlugin * plugin) override; - // ........ end of ILXQtPanel overrides - - /** ---- a/panel/lxqtpanellayout.cpp -+++ b/panel/lxqtpanellayout.cpp -@@ -946,6 +946,16 @@ void LXQtPanelLayout::setLineCount(int v - /************************************************ - - ************************************************/ -+void LXQtPanelLayout::rebuild() -+{ -+ mLeftGrid->rebuild(); -+ mRightGrid->rebuild(); -+} -+ -+ -+/************************************************ -+ -+ ************************************************/ - int LXQtPanelLayout::lineSize() const - { - return mLeftGrid->lineSize(); ---- a/panel/lxqtpanellayout.h -+++ b/panel/lxqtpanellayout.h -@@ -73,6 +73,10 @@ public: - ILXQtPanel::Position position() const { return mPosition; } - void setPosition(ILXQtPanel::Position value); - -+ /*! \brief Force the layout to re-read items/plugins "static" configuration -+ */ -+ void rebuild(); -+ - static bool itemIsSeparate(QLayoutItem *item); - signals: - void pluginMoved(Plugin * plugin); diff --git a/debian/patches/add-autoexpansion-2.patch b/debian/patches/add-autoexpansion-2.patch deleted file mode 100644 index c9f9d0e..0000000 --- a/debian/patches/add-autoexpansion-2.patch +++ /dev/null @@ -1,35 +0,0 @@ -Description: Add "override" to declarations - This is patch 2/4 adding autoexpansion support to the spacer plugin. -Author: Palo Kisa -Origin: upstream -Bug: https://github.com/lxqt/lxqt/issues/1038 -Applied-Upstream: commit:764aadd -Last-Update: 2018-08-16 ---- a/plugin-spacer/spacer.h -+++ b/plugin-spacer/spacer.h -@@ -57,18 +57,18 @@ class Spacer : public QObject, public I - public: - Spacer(const ILXQtPanelPluginStartupInfo &startupInfo); - -- virtual QWidget *widget() { return &mSpacer; } -- virtual QString themeId() const { return "Spacer"; } -+ virtual QWidget *widget() override { return &mSpacer; } -+ virtual QString themeId() const override { return "Spacer"; } - -- bool isSeparate() const { return true; } -+ bool isSeparate() const override { return true; } - -- virtual ILXQtPanelPlugin::Flags flags() const { return HaveConfigDialog; } -- QDialog *configureDialog(); -+ virtual ILXQtPanelPlugin::Flags flags() const override { return HaveConfigDialog; } -+ QDialog *configureDialog() override; - -- virtual void realign(); -+ virtual void realign() override; - - private slots: -- virtual void settingsChanged(); -+ virtual void settingsChanged() override; - - private: - void setSizes(); diff --git a/debian/patches/add-autoexpansion-3.patch b/debian/patches/add-autoexpansion-3.patch deleted file mode 100644 index dc58736..0000000 --- a/debian/patches/add-autoexpansion-3.patch +++ /dev/null @@ -1,238 +0,0 @@ -Description: Add auto-expansion feature - This is patch 3/4 adding autoexpansion support to the spacer plugin. -Author: Palo Kisa -Origin: upstream -Bug: https://github.com/lxqt/lxqt/issues/1038 -Applied-Upstream: commit:b57a178 -Last-Update: 2018-08-16 ---- a/plugin-spacer/spacer.cpp -+++ b/plugin-spacer/spacer.cpp -@@ -55,6 +55,7 @@ Spacer::Spacer(const ILXQtPanelPluginSta - QObject() - , ILXQtPanelPlugin(startupInfo) - , mSize(8) -+ , mExpandable(false) - { - settingsChanged(); - } -@@ -65,8 +66,12 @@ Spacer::Spacer(const ILXQtPanelPluginSta - void Spacer::settingsChanged() - { - mSize = settings()->value("size", 8).toInt(); -+ const bool old_expandable = mExpandable; -+ mExpandable = settings()->value("expandable", false).toBool(); - mSpacer.setType(settings()->value("spaceType", SpacerConfiguration::msTypes[0]).toString()); - setSizes(); -+ if (old_expandable != mExpandable) -+ pluginFlagsChanged(); - } - - /************************************************ -@@ -82,21 +87,30 @@ QDialog *Spacer::configureDialog() - ************************************************/ - void Spacer::setSizes() - { -- if (panel()->isHorizontal()) -+ if (mExpandable) - { -- mSpacer.setOrientation("horizontal"); -- mSpacer.setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); -- mSpacer.setFixedWidth(mSize); -- mSpacer.setMinimumHeight(0); -- mSpacer.setMaximumHeight(QWIDGETSIZE_MAX); -- } -- else -+ mSpacer.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); -+ mSpacer.setMinimumSize({1, 1}); -+ mSpacer.setMaximumSize({QWIDGETSIZE_MAX, QWIDGETSIZE_MAX}); -+ mSpacer.setOrientation(panel()->isHorizontal() ? "horizontal" : "vertical"); -+ } else - { -- mSpacer.setOrientation("vertical"); -- mSpacer.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); -- mSpacer.setFixedHeight(mSize); -- mSpacer.setMinimumWidth(0); -- mSpacer.setMaximumWidth(QWIDGETSIZE_MAX); -+ if (panel()->isHorizontal()) -+ { -+ mSpacer.setOrientation("horizontal"); -+ mSpacer.setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); -+ mSpacer.setFixedWidth(mSize); -+ mSpacer.setMinimumHeight(0); -+ mSpacer.setMaximumHeight(QWIDGETSIZE_MAX); -+ } -+ else -+ { -+ mSpacer.setOrientation("vertical"); -+ mSpacer.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); -+ mSpacer.setFixedHeight(mSize); -+ mSpacer.setMinimumWidth(0); -+ mSpacer.setMaximumWidth(QWIDGETSIZE_MAX); -+ } - } - } - ---- a/plugin-spacer/spacer.h -+++ b/plugin-spacer/spacer.h -@@ -61,6 +61,7 @@ public: - virtual QString themeId() const override { return "Spacer"; } - - bool isSeparate() const override { return true; } -+ bool isExpandable() const override { return mExpandable; } - - virtual ILXQtPanelPlugin::Flags flags() const override { return HaveConfigDialog; } - QDialog *configureDialog() override; -@@ -76,6 +77,7 @@ private: - private: - SpacerWidget mSpacer; - int mSize; -+ int mExpandable; - }; - - class SpacerPluginLibrary: public QObject, public ILXQtPanelPluginLibrary ---- a/plugin-spacer/spacerconfiguration.cpp -+++ b/plugin-spacer/spacerconfiguration.cpp -@@ -52,6 +52,8 @@ SpacerConfiguration::SpacerConfiguration - - connect(ui->sizeSB, static_cast(&QSpinBox::valueChanged), this, &SpacerConfiguration::sizeChanged); - connect(ui->typeCB, static_cast(&QComboBox::currentIndexChanged), this, &SpacerConfiguration::typeChanged); -+ //Note: if there will be more than 2 radio buttons for width/size type, this simple setting logic will break -+ connect(ui->sizeExpandRB, &QAbstractButton::toggled, this, &SpacerConfiguration::widthTypeChanged); - } - - SpacerConfiguration::~SpacerConfiguration() -@@ -63,6 +65,10 @@ void SpacerConfiguration::loadSettings() - { - ui->sizeSB->setValue(settings().value("size", 8).toInt()); - ui->typeCB->setCurrentIndex(ui->typeCB->findData(settings().value("spaceType", msTypes[0]).toString())); -+ const bool expandable = settings().value("expandable", false).toBool(); -+ ui->sizeExpandRB->setChecked(expandable); -+ ui->sizeFixedRB->setChecked(!expandable); -+ ui->sizeSB->setDisabled(expandable); - } - - void SpacerConfiguration::sizeChanged(int value) -@@ -74,3 +80,8 @@ void SpacerConfiguration::typeChanged(in - { - settings().setValue("spaceType", ui->typeCB->itemData(index, Qt::UserRole)); - } -+ -+void SpacerConfiguration::widthTypeChanged(bool expandableChecked) -+{ -+ settings().setValue("expandable", expandableChecked); -+} ---- a/plugin-spacer/spacerconfiguration.h -+++ b/plugin-spacer/spacerconfiguration.h -@@ -58,6 +58,7 @@ private slots: - void loadSettings(); - void sizeChanged(int value); - void typeChanged(int index); -+ void widthTypeChanged(bool expandableChecked); - }; - - #endif // SPACERCONFIGURATION_H ---- a/plugin-spacer/spacerconfiguration.ui -+++ b/plugin-spacer/spacerconfiguration.ui -@@ -6,6 +6,8 @@ - - 0 - 0 -+ 289 -+ 135 - - - -@@ -19,7 +21,7 @@ - - - -- -+ - - - 4 -@@ -32,21 +34,14 @@ - - - -- -+ - - - Space type: - - - -- -- -- -- false -- -- -- -- -+ - - - Qt::Horizontal -@@ -56,6 +51,27 @@ - - - -+ -+ -+ -+ fixed -+ -+ -+ -+ -+ -+ -+ false -+ -+ -+ -+ -+ -+ -+ expandable -+ -+ -+ - - - -@@ -65,6 +81,32 @@ - clicked(QAbstractButton*) - SpacerConfiguration - close() -+ -+ -+ 20 -+ 20 -+ -+ -+ 20 -+ 20 -+ -+ -+ -+ -+ sizeFixedRB -+ toggled(bool) -+ sizeSB -+ setEnabled(bool) -+ -+ -+ 152 -+ 21 -+ -+ -+ 244 -+ 21 -+ -+ - - - diff --git a/debian/patches/add-autoexpansion-4.patch b/debian/patches/add-autoexpansion-4.patch deleted file mode 100644 index 3ca8802..0000000 --- a/debian/patches/add-autoexpansion-4.patch +++ /dev/null @@ -1,114 +0,0 @@ -Description: Use QStringLiteral whenever possible - This is patch 4/4 adding autoexpansion support to the spacer plugin. -Author: Palo Kisa -Origin: upstream -Bug: https://github.com/lxqt/lxqt/issues/1038 -Applied-Upstream: commit:4908fcd -Last-Update: 2018-08-16 ---- a/plugin-spacer/spacer.cpp -+++ b/plugin-spacer/spacer.cpp -@@ -65,10 +65,10 @@ Spacer::Spacer(const ILXQtPanelPluginSta - ************************************************/ - void Spacer::settingsChanged() - { -- mSize = settings()->value("size", 8).toInt(); -+ mSize = settings()->value(QStringLiteral("size"), 8).toInt(); - const bool old_expandable = mExpandable; -- mExpandable = settings()->value("expandable", false).toBool(); -- mSpacer.setType(settings()->value("spaceType", SpacerConfiguration::msTypes[0]).toString()); -+ mExpandable = settings()->value(QStringLiteral("expandable"), false).toBool(); -+ mSpacer.setType(settings()->value(QStringLiteral("spaceType"), SpacerConfiguration::msTypes[0]).toString()); - setSizes(); - if (old_expandable != mExpandable) - pluginFlagsChanged(); -@@ -92,12 +92,12 @@ void Spacer::setSizes() - mSpacer.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - mSpacer.setMinimumSize({1, 1}); - mSpacer.setMaximumSize({QWIDGETSIZE_MAX, QWIDGETSIZE_MAX}); -- mSpacer.setOrientation(panel()->isHorizontal() ? "horizontal" : "vertical"); -+ mSpacer.setOrientation(panel()->isHorizontal() ? QStringLiteral("horizontal") : QStringLiteral("vertical")); - } else - { - if (panel()->isHorizontal()) - { -- mSpacer.setOrientation("horizontal"); -+ mSpacer.setOrientation(QStringLiteral("horizontal")); - mSpacer.setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); - mSpacer.setFixedWidth(mSize); - mSpacer.setMinimumHeight(0); -@@ -105,7 +105,7 @@ void Spacer::setSizes() - } - else - { -- mSpacer.setOrientation("vertical"); -+ mSpacer.setOrientation(QStringLiteral("vertical")); - mSpacer.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - mSpacer.setFixedHeight(mSize); - mSpacer.setMinimumWidth(0); ---- a/plugin-spacer/spacer.h -+++ b/plugin-spacer/spacer.h -@@ -58,7 +58,7 @@ public: - Spacer(const ILXQtPanelPluginStartupInfo &startupInfo); - - virtual QWidget *widget() override { return &mSpacer; } -- virtual QString themeId() const override { return "Spacer"; } -+ virtual QString themeId() const override { return QStringLiteral("Spacer"); } - - bool isSeparate() const override { return true; } - bool isExpandable() const override { return mExpandable; } ---- a/plugin-spacer/spacerconfiguration.cpp -+++ b/plugin-spacer/spacerconfiguration.cpp -@@ -31,9 +31,9 @@ - //Note: strings can't actually be translated here (in static initialization time) - // the QT_TR_NOOP here is just for qt translate tools to get the strings for translation - const QStringList SpacerConfiguration::msTypes = { -- QLatin1String(QT_TR_NOOP("lined")) -- , QLatin1String(QT_TR_NOOP("dotted")) -- , QLatin1String(QT_TR_NOOP("invisible")) -+ QStringLiteral(QT_TR_NOOP("lined")) -+ , QStringLiteral(QT_TR_NOOP("dotted")) -+ , QStringLiteral(QT_TR_NOOP("invisible")) - }; - - SpacerConfiguration::SpacerConfiguration(PluginSettings *settings, QWidget *parent) : -@@ -41,7 +41,7 @@ SpacerConfiguration::SpacerConfiguration - ui(new Ui::SpacerConfiguration) - { - setAttribute(Qt::WA_DeleteOnClose); -- setObjectName("SpacerConfigurationWindow"); -+ setObjectName(QStringLiteral("SpacerConfigurationWindow")); - ui->setupUi(this); - - //Note: translation is needed here in runtime (translator is attached already) -@@ -63,9 +63,9 @@ SpacerConfiguration::~SpacerConfiguratio - - void SpacerConfiguration::loadSettings() - { -- ui->sizeSB->setValue(settings().value("size", 8).toInt()); -- ui->typeCB->setCurrentIndex(ui->typeCB->findData(settings().value("spaceType", msTypes[0]).toString())); -- const bool expandable = settings().value("expandable", false).toBool(); -+ ui->sizeSB->setValue(settings().value(QStringLiteral("size"), 8).toInt()); -+ ui->typeCB->setCurrentIndex(ui->typeCB->findData(settings().value(QStringLiteral("spaceType"), msTypes[0]).toString())); -+ const bool expandable = settings().value(QStringLiteral("expandable"), false).toBool(); - ui->sizeExpandRB->setChecked(expandable); - ui->sizeFixedRB->setChecked(!expandable); - ui->sizeSB->setDisabled(expandable); -@@ -73,15 +73,15 @@ void SpacerConfiguration::loadSettings() - - void SpacerConfiguration::sizeChanged(int value) - { -- settings().setValue("size", value); -+ settings().setValue(QStringLiteral("size"), value); - } - - void SpacerConfiguration::typeChanged(int index) - { -- settings().setValue("spaceType", ui->typeCB->itemData(index, Qt::UserRole)); -+ settings().setValue(QStringLiteral("spaceType"), ui->typeCB->itemData(index, Qt::UserRole)); - } - - void SpacerConfiguration::widthTypeChanged(bool expandableChecked) - { -- settings().setValue("expandable", expandableChecked); -+ settings().setValue(QStringLiteral("expandable"), expandableChecked); - } diff --git a/debian/patches/completely-remove-plugin-clock.patch b/debian/patches/completely-remove-plugin-clock.patch deleted file mode 100644 index b5ce999..0000000 --- a/debian/patches/completely-remove-plugin-clock.patch +++ /dev/null @@ -1,1756 +0,0 @@ -Description: Definitely remove plugin-clock -Author: Palo Kisa -Origin: upstream -Bug: https://github.com/lxqt/lxqt/issues/1356 -Applied-Upstream: commit:3eb1a8b -Last-Update: 2018-07-16 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -85,22 +85,14 @@ message(STATUS "Panel plugins location: - - # Plugin system - # You can enable/disable building of the plugin using cmake options. --# cmake -DCLOCK_PLUGIN=Yes .. # Enable clock plugin --# cmake -DCLOCK_PLUGIN=No .. # Disable clock plugin -+# cmake -DWORLDCLOCK_PLUGIN=Yes .. # Enable worldclock plugin -+# cmake -DWORLDCLOCK_PLUGIN=No .. # Disable worldclock plugin - - include("cmake/BuildPlugin.cmake") - - set(ENABLED_PLUGINS) # list of enabled plugins - set(STATIC_PLUGINS) # list of statically linked plugins - --setByDefault(CLOCK_PLUGIN Yes) --if(CLOCK_PLUGIN) -- list(APPEND STATIC_PLUGINS "clock") -- add_definitions(-DWITH_CLOCK_PLUGIN) -- list(APPEND ENABLED_PLUGINS "Clock") -- add_subdirectory(plugin-clock) --endif() -- - setByDefault(COLORPICKER_PLUGIN Yes) - if(COLORPICKER_PLUGIN) - list(APPEND ENABLED_PLUGINS "Color Picker") ---- a/panel/plugin.cpp -+++ b/panel/plugin.cpp -@@ -50,8 +50,6 @@ - #include - - // statically linked built-in plugins --#include "../plugin-clock/lxqtclock.h" // clock --extern void * loadPluginTranslation_clock_helper; - #include "../plugin-desktopswitch/desktopswitch.h" // desktopswitch - extern void * loadPluginTranslation_desktopswitch_helper; - #include "../plugin-mainmenu/lxqtmainmenu.h" // mainmenu -@@ -194,9 +192,6 @@ namespace - //NOTE2: we need to reference some (dummy) symbol from (autogenerated) LXQtPluginTranslationLoader.cpp - // to be not stripped (as unused/unreferenced) in static linking time - static plugin_tuple_t const static_plugins[] = { --#if defined(WITH_CLOCK_PLUGIN) -- std::make_tuple(QLatin1String("clock"), plugin_ptr_t{new LXQtClockPluginLibrary}, loadPluginTranslation_clock_helper),// clock --#endif - #if defined(WITH_DESKTOPSWITCH_PLUGIN) - std::make_tuple(QLatin1String("desktopswitch"), plugin_ptr_t{new DesktopSwitchPluginLibrary}, loadPluginTranslation_desktopswitch_helper),// desktopswitch - #endif ---- a/plugin-clock/CMakeLists.txt -+++ /dev/null -@@ -1,19 +0,0 @@ --set(PLUGIN "clock") -- --set(HEADERS -- lxqtclock.h -- lxqtclockconfiguration.h -- calendarpopup.h --) -- --set(SOURCES -- lxqtclock.cpp -- lxqtclockconfiguration.cpp -- calendarpopup.cpp --) -- --set(UIS -- lxqtclockconfiguration.ui --) -- --BUILD_LXQT_PLUGIN(${PLUGIN}) ---- a/plugin-clock/calendarpopup.cpp -+++ /dev/null -@@ -1,57 +0,0 @@ --/* BEGIN_COMMON_COPYRIGHT_HEADER -- * (c)LGPL2+ -- * -- * LXQt - a lightweight, Qt based, desktop toolset -- * https://lxqt.org -- * -- * Copyright: 2014 LXQt team -- * Authors: -- * Paulo Lieuthier -- * -- * This program or library is free software; you can redistribute it -- * and/or modify it under the terms of the GNU Lesser General Public -- * License as published by the Free Software Foundation; either -- * version 2.1 of the License, or (at your option) any later version. -- * -- * This library 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 -- * Lesser General Public License for more details. -- -- * You should have received a copy of the GNU Lesser General -- * Public License along with this library; if not, write to the -- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -- * Boston, MA 02110-1301 USA -- * -- * END_COMMON_COPYRIGHT_HEADER */ -- --#include "calendarpopup.h" --#include --#include -- --CalendarPopup::CalendarPopup(QWidget *parent): -- QDialog(parent, Qt::Window | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint | Qt::Popup | Qt::X11BypassWindowManagerHint) --{ -- setLayout(new QHBoxLayout(this)); -- layout()->setMargin(1); -- -- cal = new QCalendarWidget(this); -- layout()->addWidget(cal); -- adjustSize(); --} -- --CalendarPopup::~CalendarPopup() --{ --} -- --void CalendarPopup::show() --{ -- cal->setSelectedDate(QDate::currentDate()); -- activateWindow(); -- QDialog::show(); --} -- --void CalendarPopup::setFirstDayOfWeek(Qt::DayOfWeek wday) --{ -- cal->setFirstDayOfWeek(wday); --} ---- a/plugin-clock/calendarpopup.h -+++ /dev/null -@@ -1,49 +0,0 @@ --/* BEGIN_COMMON_COPYRIGHT_HEADER -- * (c)LGPL2+ -- * -- * LXQt - a lightweight, Qt based, desktop toolset -- * https://lxqt.org -- * -- * Copyright: 2014 LXQt team -- * Authors: -- * Paulo Lieuthier -- * -- * This program or library is free software; you can redistribute it -- * and/or modify it under the terms of the GNU Lesser General Public -- * License as published by the Free Software Foundation; either -- * version 2.1 of the License, or (at your option) any later version. -- * -- * This library 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 -- * Lesser General Public License for more details. -- -- * You should have received a copy of the GNU Lesser General -- * Public License along with this library; if not, write to the -- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -- * Boston, MA 02110-1301 USA -- * -- * END_COMMON_COPYRIGHT_HEADER */ -- --#ifndef CALENDARPOPUP_H --#define CALENDARPOPUP_H -- --#include --#include -- --class CalendarPopup : public QDialog --{ -- Q_OBJECT -- --public: -- CalendarPopup(QWidget *parent = 0); -- ~CalendarPopup(); -- void setFirstDayOfWeek(Qt::DayOfWeek wday); -- -- void show(); -- --private: -- QCalendarWidget *cal; --}; -- --#endif // CALENDARPOPUP_H ---- a/plugin-clock/lxqtclock.cpp -+++ /dev/null -@@ -1,346 +0,0 @@ --/* BEGIN_COMMON_COPYRIGHT_HEADER -- * (c)LGPL2+ -- * -- * LXQt - a lightweight, Qt based, desktop toolset -- * https://lxqt.org -- * -- * Copyright: 2010-2013 Razor team -- * Authors: -- * Christopher "VdoP" Regali -- * Alexander Sokoloff -- * Maciej Płaza -- * Kuzma Shapran -- * -- * This program or library is free software; you can redistribute it -- * and/or modify it under the terms of the GNU Lesser General Public -- * License as published by the Free Software Foundation; either -- * version 2.1 of the License, or (at your option) any later version. -- * -- * This library 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 -- * Lesser General Public License for more details. -- -- * You should have received a copy of the GNU Lesser General -- * Public License along with this library; if not, write to the -- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -- * Boston, MA 02110-1301 USA -- * -- * END_COMMON_COPYRIGHT_HEADER */ -- -- --#include "lxqtclock.h" -- --#include --#include --#include --#include -- --#include --#include --#include --#include --#include --#include -- --#include --#include -- --static void notifyAboutDeprecation(PluginSettings * settings) --{ -- // this is called only from LXQtClock c-tor...so just from main thread, no locking needed -- // Note: we get/store the "dont_show" in section of particular instance of clock => this is not 100% valid -- // for al possible changes of panel configuration, but we can live with this -- static bool notification_done = settings->value(QLatin1String("dont_show_deprecation"), false).toBool(); -- if (!notification_done) -- { -- LXQt::Notification * notification = new LXQt::Notification{LXQtClock::tr("Date&Time (clock) plugin is deprecated")}; -- notification->setBody(LXQtClock::tr("The clock plugin is deprecated and will be removed in future version of LXQt. Consider" -- " replacing it with worldclock.
")); -- notification->setActions({LXQtClock::tr("don't show this again")}); -- notification->setTimeout(5000); -- QObject::connect(notification, &LXQt::Notification::actionActivated, settings, [notification, settings] (int actionNumber) -> void -- { -- if (actionNumber == 0) -- settings->setValue(QLatin1String("dont_show_deprecation"), true); -- notification->close(); -- }); -- QObject::connect(notification, &LXQt::Notification::notificationClosed, notification, &QObject::deleteLater); -- notification->update(); -- notification_done = true; -- } --} -- --/** -- * @file lxqtclock.cpp -- * @brief implements LXQtclock and LXQtclockgui -- * @author Christopher "VdoP" Regali -- * @author Kuzma Shapran -- */ -- --class DownscaleFontStyle : public QProxyStyle --{ -- using QProxyStyle::QProxyStyle; --public: -- -- virtual void drawItemText(QPainter * painter, const QRect & rect, int flags -- , const QPalette & pal, bool enabled, const QString & text -- , QPalette::ColorRole textRole = QPalette::NoRole) const override -- { -- while (1 < painter->font().pointSize() -- && !(rect.size() - painter->fontMetrics().boundingRect(text).size()).isValid()) -- { -- QFont f{painter->font()}; -- f.setPointSize(f.pointSize() - 1); -- painter->setFont(f); -- } -- return QProxyStyle::drawItemText(painter, rect, flags, pal, enabled, text, textRole); -- } --}; -- --/** -- * @brief constructor -- */ --LXQtClock::LXQtClock(const ILXQtPanelPluginStartupInfo &startupInfo): -- QObject(), -- ILXQtPanelPlugin(startupInfo), -- mAutoRotate(true), -- mTextStyle{new DownscaleFontStyle}, -- mCurrentCharCount(0) --{ -- QTimer::singleShot(0, this, [this] { notifyAboutDeprecation(settings()); }); -- -- mMainWidget = new QWidget(); -- mRotatedWidget = new LXQt::RotatedWidget(*(new QWidget()), mMainWidget); -- mContent = mRotatedWidget->content(); -- mContent->setStyle(mTextStyle.data()); -- mTimeLabel = new QLabel(mContent); -- mDateLabel = new QLabel(mContent); -- -- QVBoxLayout *borderLayout = new QVBoxLayout(mMainWidget); -- borderLayout->setContentsMargins(0, 0, 0, 0); -- borderLayout->setSpacing(0); -- borderLayout->addWidget(mRotatedWidget, 0, Qt::AlignCenter); -- -- mTimeLabel->setObjectName("TimeLabel"); -- mDateLabel->setObjectName("DateLabel"); -- -- mTimeLabel->setAlignment(Qt::AlignCenter); -- mDateLabel->setAlignment(Qt::AlignCenter); -- -- mContent->setLayout(new QVBoxLayout{mContent}); -- mContent->layout()->setContentsMargins(0, 0, 0, 0); -- mContent->layout()->setSpacing(0); -- mContent->layout()->addWidget(mTimeLabel); -- mContent->layout()->addWidget(mDateLabel); -- -- mClockTimer = new QTimer(this); -- mClockTimer->setTimerType(Qt::PreciseTimer); -- connect (mClockTimer, SIGNAL(timeout()), SLOT(updateTime())); -- -- mClockFormat = "hh:mm"; -- -- mCalendarPopup = new CalendarPopup(mContent); -- -- mMainWidget->installEventFilter(this); -- settingsChanged(); --} -- --/** -- * @brief destructor -- */ --LXQtClock::~LXQtClock() --{ -- delete mMainWidget; --} -- --QDateTime LXQtClock::currentDateTime() --{ -- return QDateTime(mUseUTC ? QDateTime::currentDateTimeUtc() : QDateTime::currentDateTime()); --} -- --/** -- * @brief updates the time -- * Color and font settings can be configured in Qt CSS -- */ --void LXQtClock::updateTime() --{ -- //XXX: do we need this with PreciseTimer ? -- if (currentDateTime().time().msec() > 500) -- restartTimer(); -- -- showTime(); --} -- --void LXQtClock::showTime() --{ -- QDateTime now{currentDateTime()}; -- int new_char_count; -- if (mDateOnNewLine) -- { -- QString new_time = QLocale::system().toString(now, mTimeFormat); -- QString new_date = QLocale::system().toString(now, mDateFormat); -- new_char_count = qMax(new_time.size(), new_date.size()); -- mTimeLabel->setText(new_time); -- mDateLabel->setText(new_date); -- } -- else -- { -- QString new_time = QLocale::system().toString(now, mClockFormat); -- new_char_count = new_time.size(); -- mTimeLabel->setText(new_time); -- } -- -- //Note: if transformation (custom rendering) is enabled we need the explicit update -- //(update doesn't cause superfluous paint events) -- mRotatedWidget->update(); -- -- if (mCurrentCharCount != new_char_count) -- { -- mCurrentCharCount = new_char_count; -- realign(); -- } --} -- --void LXQtClock::restartTimer() --{ -- if (mClockTimer->isActive()) -- mClockTimer->stop(); -- int updateInterval = mClockTimer->interval(); -- QDateTime now{currentDateTime()}; -- int delay = updateInterval - ((now.time().msec() + now.time().second() * 1000) % updateInterval); -- QTimer::singleShot(delay, Qt::PreciseTimer, mClockTimer, SLOT(start())); -- QTimer::singleShot(delay, Qt::PreciseTimer, this, SLOT(updateTime())); --} -- --void LXQtClock::settingsChanged() --{ -- mFirstDayOfWeek = settings()->value("firstDayOfWeek", -1).toInt(); -- if (-1 == mFirstDayOfWeek) -- mCalendarPopup->setFirstDayOfWeek(QLocale::system().firstDayOfWeek()); -- else -- mCalendarPopup->setFirstDayOfWeek(static_cast(mFirstDayOfWeek)); -- -- mTimeFormat = settings()->value("timeFormat", QLocale::system().timeFormat(QLocale::ShortFormat).toUpper().contains("AP") ? "h:mm AP" : "HH:mm").toString(); -- -- mUseUTC = settings()->value("UTC", false).toBool(); -- if (mUseUTC) -- mTimeFormat += "' Z'"; -- -- mDateFormat = settings()->value("dateFormat", Qt::SystemLocaleShortDate).toString(); -- -- bool dateBeforeTime = (settings()->value("showDate", "no").toString().toLower() == "before"); -- bool dateAfterTime = (settings()->value("showDate", "no").toString().toLower() == "after"); -- mDateOnNewLine = (settings()->value("showDate", "no").toString().toLower() == "below"); -- -- mAutoRotate = settings()->value("autoRotate", true).toBool(); -- -- if (dateBeforeTime) -- mClockFormat = QString("%1 %2").arg(mDateFormat).arg(mTimeFormat); -- else if (dateAfterTime) -- mClockFormat = QString("%1 %2").arg(mTimeFormat).arg(mDateFormat); -- else -- mClockFormat = mTimeFormat; -- -- mDateLabel->setHidden(!mDateOnNewLine); -- -- // mDateFormat usually does not contain time portion, but since it's possible to use custom date format - it has to be supported. [Kuzma Shapran] -- int updateInterval = QString(mTimeFormat + " " + mDateFormat).replace(QRegExp("'[^']*'"),"").contains("s") ? 1000 : 60000; -- -- QDateTime now = currentDateTime(); -- -- showTime(); -- -- if (mClockTimer->interval() != updateInterval) -- { -- mClockTimer->setInterval(updateInterval); -- -- restartTimer(); -- } --} -- --void LXQtClock::realign() --{ -- QSize size{QWIDGETSIZE_MAX, QWIDGETSIZE_MAX}; -- Qt::Corner origin = Qt::TopLeftCorner; -- if (mAutoRotate || panel()->isHorizontal()) -- { -- switch (panel()->position()) -- { -- case ILXQtPanel::PositionTop: -- case ILXQtPanel::PositionBottom: -- origin = Qt::TopLeftCorner; -- break; -- -- case ILXQtPanel::PositionLeft: -- origin = Qt::BottomLeftCorner; -- break; -- -- case ILXQtPanel::PositionRight: -- origin = Qt::TopRightCorner; -- break; -- } -- -- //set minwidth -- QFontMetrics metrics{mTimeLabel->font()}; -- //Note: using a constant string of reasonably wide characters for computing the width -- // (not the current text as width of text can differ for each particular string (based on font)) -- size.setWidth(metrics.boundingRect(QString{mCurrentCharCount, 'A'}).width()); -- } else if (!panel()->isHorizontal()) -- { -- size.setWidth(panel()->globalGeometry().width()); -- } -- -- mTimeLabel->setFixedWidth(size.width()); -- mDateLabel->setFixedWidth(size.width()); -- -- int label_height = mTimeLabel->sizeHint().height(); -- size.setHeight(mDateOnNewLine ? label_height * 2 : label_height); -- -- const bool changed = mContent->maximumSize() != size || mRotatedWidget->origin() != origin; -- -- mContent->setFixedSize(size); -- mRotatedWidget->setOrigin(origin); -- -- if (changed) -- { -- mRotatedWidget->adjustContentSize(); -- mRotatedWidget->update(); -- } --} -- --void LXQtClock::activated(ActivationReason reason) --{ -- if (reason != ILXQtPanelPlugin::Trigger) -- return; -- -- if (!mCalendarPopup->isVisible()) -- { -- QRect pos = calculatePopupWindowPos(mCalendarPopup->size()); -- mCalendarPopup->move(pos.topLeft()); -- willShowWindow(mCalendarPopup); -- mCalendarPopup->show(); -- } -- else -- { -- mCalendarPopup->hide(); -- } --} -- --QDialog * LXQtClock::configureDialog() --{ -- return new LXQtClockConfiguration(settings()); --} -- --bool LXQtClock::eventFilter(QObject *watched, QEvent *event) --{ -- if (watched == mMainWidget) -- { -- if (event->type() == QEvent::ToolTip) -- mMainWidget->setToolTip(QDateTime::currentDateTime().toString(Qt::DefaultLocaleLongDate)); -- -- return false; -- } -- -- return false; --} ---- a/plugin-clock/lxqtclock.h -+++ /dev/null -@@ -1,105 +0,0 @@ --/* BEGIN_COMMON_COPYRIGHT_HEADER -- * (c)LGPL2+ -- * -- * LXQt - a lightweight, Qt based, desktop toolset -- * https://lxqt.org -- * -- * Copyright: 2010-2013 Razor team -- * Authors: -- * Christopher "VdoP" Regali -- * Alexander Sokoloff -- * Maciej Płaza -- * Kuzma Shapran -- * -- * This program or library is free software; you can redistribute it -- * and/or modify it under the terms of the GNU Lesser General Public -- * License as published by the Free Software Foundation; either -- * version 2.1 of the License, or (at your option) any later version. -- * -- * This library 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 -- * Lesser General Public License for more details. -- -- * You should have received a copy of the GNU Lesser General -- * Public License along with this library; if not, write to the -- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -- * Boston, MA 02110-1301 USA -- * -- * END_COMMON_COPYRIGHT_HEADER */ -- --#ifndef LXQTCLOCK_H --#define LXQTCLOCK_H -- --#include "../panel/ilxqtpanelplugin.h" --#include "lxqtclockconfiguration.h" --#include "calendarpopup.h" --#include -- --#include -- --class QLabel; --class QDialog; --class QTimer; --class QProxyStyle; -- --class LXQtClock : public QObject, public ILXQtPanelPlugin --{ -- Q_OBJECT --public: -- LXQtClock(const ILXQtPanelPluginStartupInfo &startupInfo); -- ~LXQtClock(); -- -- virtual Flags flags() const { return PreferRightAlignment | HaveConfigDialog ; } -- QString themeId() const { return "Clock"; } -- QWidget *widget() { return mMainWidget; } -- QDialog *configureDialog(); -- void settingsChanged(); -- -- void activated(ActivationReason reason); -- bool isSeparate() const { return true; } -- -- void realign(); -- --public slots: -- void updateTime(); -- --protected: -- bool eventFilter(QObject *watched, QEvent *event); -- --private: -- QTimer* mClockTimer; -- QWidget *mMainWidget; -- QWidget *mContent; -- LXQt::RotatedWidget* mRotatedWidget; -- QLabel* mTimeLabel; -- QLabel* mDateLabel; -- QString mClockFormat; -- QString mToolTipFormat; -- CalendarPopup* mCalendarPopup; -- QString mTimeFormat; -- QString mDateFormat; -- bool mDateOnNewLine; -- bool mUseUTC; -- int mFirstDayOfWeek; -- bool mAutoRotate; -- QScopedPointer mTextStyle; -- int mCurrentCharCount; -- -- QDateTime currentDateTime(); -- void showTime(); -- void restartTimer(); --}; -- -- --class LXQtClockPluginLibrary: public QObject, public ILXQtPanelPluginLibrary --{ -- Q_OBJECT -- // Q_PLUGIN_METADATA(IID "lxqt.org/Panel/PluginInterface/3.0") -- Q_INTERFACES(ILXQtPanelPluginLibrary) --public: -- ILXQtPanelPlugin *instance(const ILXQtPanelPluginStartupInfo &startupInfo) const { return new LXQtClock(startupInfo);} --}; -- -- --#endif ---- a/plugin-clock/lxqtclockconfiguration.cpp -+++ /dev/null -@@ -1,301 +0,0 @@ --/* BEGIN_COMMON_COPYRIGHT_HEADER -- * (c)LGPL2+ -- * -- * LXQt - a lightweight, Qt based, desktop toolset -- * https://lxqt.org -- * -- * Copyright: 2011 Razor team -- * Authors: -- * Maciej Płaza -- * -- * This program or library is free software; you can redistribute it -- * and/or modify it under the terms of the GNU Lesser General Public -- * License as published by the Free Software Foundation; either -- * version 2.1 of the License, or (at your option) any later version. -- * -- * This library 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 -- * Lesser General Public License for more details. -- -- * You should have received a copy of the GNU Lesser General -- * Public License along with this library; if not, write to the -- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -- * Boston, MA 02110-1301 USA -- * -- * END_COMMON_COPYRIGHT_HEADER */ -- -- --#include --#include --#include -- --#include "lxqtclockconfiguration.h" --#include "ui_lxqtclockconfiguration.h" -- --namespace --{ -- class FirstDayCombo : public QStandardItemModel -- { -- public: -- FirstDayCombo() -- { -- QStandardItem* item = 0; -- int row = 0; -- item = new QStandardItem; -- item->setData(-1, Qt::UserRole); -- setItem(row, 0, item); -- item = new QStandardItem; -- item->setData(tr(""), Qt::DisplayRole); -- setItem(row, 1, item); -- ++row; -- for (int wday = Qt::Monday; Qt::Sunday >= wday; ++wday, ++row) -- { -- item = new QStandardItem; -- item->setData(wday, Qt::UserRole); -- setItem(row, 0, item); -- item = new QStandardItem; -- item->setData(QLocale::system().dayName(wday), Qt::DisplayRole); -- setItem(row, 1, item); -- } -- } -- -- int findIndex(int wday) -- { -- int i = rowCount() - 1; -- for ( ; 0 <= i; --i) -- { -- if (item(i)->data(Qt::UserRole).toInt() == wday) -- break; -- } -- return i; -- } -- -- }; --} -- --LXQtClockConfiguration::LXQtClockConfiguration(PluginSettings *settings, QWidget *parent) : -- LXQtPanelPluginConfigDialog(settings, parent), -- ui(new Ui::LXQtClockConfiguration), -- mOldIndex(1) --{ -- setAttribute(Qt::WA_DeleteOnClose); -- setObjectName("ClockConfigurationWindow"); -- ui->setupUi(this); -- -- connect(ui->buttons, SIGNAL(clicked(QAbstractButton*)), SLOT(dialogButtonsAction(QAbstractButton*))); -- -- ui->firstDayOfWeekCB->setModel(new FirstDayCombo); -- ui->firstDayOfWeekCB->setModelColumn(1); -- -- loadSettings(); -- /* We use clicked() and activated(int) because these signals aren't emitting after programmaticaly -- change of state */ -- -- connect(ui->dateFormatCOB, SIGNAL(activated(int)), SLOT(dateFormatActivated(int))); -- -- connect(ui->showSecondsCB, SIGNAL(clicked()), SLOT(saveSettings())); -- connect(ui->ampmClockCB, SIGNAL(clicked()), SLOT(saveSettings())); -- connect(ui->useUtcCB, SIGNAL(clicked()), SLOT(saveSettings())); -- connect(ui->dontShowDateRB, SIGNAL(clicked()), SLOT(saveSettings())); -- connect(ui->showDateBeforeTimeRB, SIGNAL(clicked()), SLOT(saveSettings())); -- connect(ui->showDateAfterTimeRB, SIGNAL(clicked()), SLOT(saveSettings())); -- connect(ui->showDateBelowTimeRB, SIGNAL(clicked()), SLOT(saveSettings())); -- -- connect(ui->autorotateCB, SIGNAL(clicked()), SLOT(saveSettings())); -- connect(ui->firstDayOfWeekCB, SIGNAL(activated(int)), SLOT(saveSettings())); --} -- --LXQtClockConfiguration::~LXQtClockConfiguration() --{ -- delete ui; --} -- --static int currentYear = QDate::currentDate().year(); -- --void LXQtClockConfiguration::addDateFormat(const QString &format) --{ -- if (ui->dateFormatCOB->findData(QVariant(format)) == -1) -- ui->dateFormatCOB->addItem(QDate(currentYear, 1, 1).toString(format), QVariant(format)); --} -- --void LXQtClockConfiguration::createDateFormats() --{ -- ui->dateFormatCOB->clear(); -- -- QString systemDateLocale = QLocale::system().dateFormat(QLocale::ShortFormat).toUpper(); -- -- if (systemDateLocale.indexOf("Y") < systemDateLocale.indexOf("D")) -- // Big-endian (year, month, day) -> in some Asia countires like China or Japan -- { -- addDateFormat("MMM d"); -- addDateFormat("MMMM d"); -- addDateFormat("MMM d, ddd"); -- addDateFormat("MMMM d, dddd"); -- addDateFormat("yyyy MMM d"); -- addDateFormat("yyyy MMMM d"); -- addDateFormat("yyyy MMM d, ddd"); -- addDateFormat("yyyy MMMM d, dddd"); -- addDateFormat("MMM dd"); -- addDateFormat("MMMM dd"); -- addDateFormat("MMM dd, ddd"); -- addDateFormat("MMMM dd, dddd"); -- addDateFormat("yyyy MMM dd"); -- addDateFormat("yyyy MMMM dd"); -- addDateFormat("yyyy MMM dd, ddd"); -- addDateFormat("yyyy MMMM dd, dddd"); -- } -- else if (systemDateLocale.indexOf("M") < systemDateLocale.indexOf("D")) -- // Middle-endian (month, day, year) -> USA -- { -- addDateFormat("MMM d"); -- addDateFormat("MMMM d"); -- addDateFormat("ddd, MMM d"); -- addDateFormat("dddd, MMMM d"); -- addDateFormat("MMM d yyyy"); -- addDateFormat("MMMM d yyyy"); -- addDateFormat("ddd, MMM d yyyy"); -- addDateFormat("dddd, MMMM d yyyy"); -- addDateFormat("MMM dd"); -- addDateFormat("MMMM dd"); -- addDateFormat("ddd, MMM dd"); -- addDateFormat("dddd, MMMM dd"); -- addDateFormat("MMM dd yyyy"); -- addDateFormat("MMMM dd yyyy"); -- addDateFormat("ddd, MMM dd yyyy"); -- addDateFormat("dddd, MMMM dd yyyy"); -- } -- else -- // Little-endian (day, month, year) -> most of Europe -- { -- addDateFormat("d MMM"); -- addDateFormat("d MMMM"); -- addDateFormat("ddd, d MMM"); -- addDateFormat("dddd, d MMMM"); -- addDateFormat("d MMM yyyy"); -- addDateFormat("d MMMM yyyy"); -- addDateFormat("ddd, d MMM yyyy"); -- addDateFormat("dddd, d MMMM yyyy"); -- addDateFormat("dd MMM"); -- addDateFormat("dd MMMM"); -- addDateFormat("ddd, dd MMM"); -- addDateFormat("dddd, dd MMMM"); -- addDateFormat("dd MMM yyyy"); -- addDateFormat("dd MMMM yyyy"); -- addDateFormat("ddd, dd MMM yyyy"); -- addDateFormat("dddd, dd MMMM yyyy"); -- } -- -- addDateFormat(QLocale::system().dateFormat(QLocale::ShortFormat)); -- addDateFormat(QLocale::system().dateFormat(QLocale::LongFormat)); -- -- addDateFormat("yyyy-MM-dd"); // ISO -- -- if (mCustomDateFormat.isEmpty()) -- ui->dateFormatCOB->addItem("Custom ...", QVariant(mCustomDateFormat)); -- else -- ui->dateFormatCOB->addItem(QString("Custom (%1) ...").arg(QDate(currentYear, 1, 1).toString(mCustomDateFormat)), QVariant(mCustomDateFormat)); --} -- --void LXQtClockConfiguration::loadSettings() --{ -- QString systemDateLocale = QLocale::system().dateFormat(QLocale::ShortFormat).toUpper(); -- QString systemTimeLocale = QLocale::system().timeFormat(QLocale::ShortFormat).toUpper(); -- -- QString timeFormat = settings().value("timeFormat", systemTimeLocale.contains("AP") ? "h:mm AP" : "HH:mm").toString(); -- -- ui->showSecondsCB->setChecked(timeFormat.indexOf("ss") > -1); -- -- ui->ampmClockCB->setChecked(timeFormat.toUpper().indexOf("AP") > -1); -- -- ui->useUtcCB->setChecked(settings().value("UTC", false).toBool()); -- -- ui->dontShowDateRB->setChecked(true); -- ui->showDateBeforeTimeRB->setChecked(settings().value("showDate", "no").toString().toLower() == "before"); -- ui->showDateAfterTimeRB->setChecked(settings().value("showDate", "no").toString().toLower() == "after"); -- ui->showDateBelowTimeRB->setChecked(settings().value("showDate", "no").toString().toLower() == "below"); -- -- mCustomDateFormat = settings().value("customDateFormat", QString()).toString(); -- QString dateFormat = settings().value("dateFormat", QLocale::system().dateFormat(QLocale::ShortFormat)).toString(); -- -- createDateFormats(); -- -- if (mCustomDateFormat == dateFormat) -- ui->dateFormatCOB->setCurrentIndex(ui->dateFormatCOB->count() - 1); -- else -- { -- ui->dateFormatCOB->setCurrentIndex(ui->dateFormatCOB->findData(dateFormat)); -- if (ui->dateFormatCOB->currentIndex() < 0) -- ui->dateFormatCOB->setCurrentIndex(1); -- } -- mOldIndex = ui->dateFormatCOB->currentIndex(); -- -- ui->autorotateCB->setChecked(settings().value("autoRotate", true).toBool()); -- ui->firstDayOfWeekCB->setCurrentIndex(dynamic_cast(*(ui->firstDayOfWeekCB->model())).findIndex(settings().value("firstDayOfWeek", -1).toInt())); --} -- --void LXQtClockConfiguration::saveSettings() --{ -- QString timeFormat(ui->ampmClockCB->isChecked() ? "h:mm AP" : "HH:mm"); -- -- if (ui->showSecondsCB->isChecked()) -- timeFormat.insert(timeFormat.indexOf("mm") + 2, ":ss"); -- -- settings().setValue("timeFormat", timeFormat); -- -- settings().setValue("UTC", ui->useUtcCB->isChecked()); -- -- settings().setValue("showDate", -- ui->showDateBeforeTimeRB->isChecked() ? "before" : -- (ui->showDateAfterTimeRB->isChecked() ? "after" : -- (ui->showDateBelowTimeRB->isChecked() ? "below" : "no" ))); -- -- settings().setValue("customDateFormat", mCustomDateFormat); -- if (ui->dateFormatCOB->currentIndex() == (ui->dateFormatCOB->count() - 1)) -- settings().setValue("dateFormat", mCustomDateFormat); -- else -- settings().setValue("dateFormat", ui->dateFormatCOB->itemData(ui->dateFormatCOB->currentIndex())); -- -- settings().setValue("autoRotate", ui->autorotateCB->isChecked()); -- settings().setValue("firstDayOfWeek", dynamic_cast(*ui->firstDayOfWeekCB->model()).item(ui->firstDayOfWeekCB->currentIndex(), 0)->data(Qt::UserRole)); --} -- --void LXQtClockConfiguration::dateFormatActivated(int index) --{ -- if (index == ui->dateFormatCOB->count() - 1) -- { -- bool ok; -- QString newCustomDateFormat = QInputDialog::getText(this, tr("Input custom date format"), tr( -- "Interpreted sequences of date format are:\n" -- "\n" -- "d\tthe day as number without a leading zero (1 to 31)\n" -- "dd\tthe day as number with a leading zero (01 to 31)\n" -- "ddd\tthe abbreviated localized day name (e.g. 'Mon' to 'Sun').\n" -- "dddd\tthe long localized day name (e.g. 'Monday' to 'Sunday').\n" -- "M\tthe month as number without a leading zero (1-12)\n" -- "MM\tthe month as number with a leading zero (01-12)\n" -- "MMM\tthe abbreviated localized month name (e.g. 'Jan' to 'Dec').\n" -- "MMMM\tthe long localized month name (e.g. 'January' to 'December').\n" -- "yy\tthe year as two digit number (00-99)\n" -- "yyyy\tthe year as four digit number\n" -- "\n" -- "All other input characters will be treated as text.\n" -- "Any sequence of characters that are enclosed in single quotes (')\n" -- "will also be treated as text and not be used as an expression.\n" -- "\n" -- "\n" -- "Custom date format:" -- ), QLineEdit::Normal, mCustomDateFormat, &ok); -- if (ok) -- { -- mCustomDateFormat = newCustomDateFormat; -- mOldIndex = index; -- createDateFormats(); -- } -- ui->dateFormatCOB->setCurrentIndex(mOldIndex); -- } -- else -- mOldIndex = index; -- -- saveSettings(); --} ---- a/plugin-clock/lxqtclockconfiguration.h -+++ /dev/null -@@ -1,79 +0,0 @@ --/* BEGIN_COMMON_COPYRIGHT_HEADER -- * (c)LGPL2+ -- * -- * LXQt - a lightweight, Qt based, desktop toolset -- * https://lxqt.org -- * -- * Copyright: 2011 Razor team -- * Authors: -- * Maciej Płaza -- * -- * This program or library is free software; you can redistribute it -- * and/or modify it under the terms of the GNU Lesser General Public -- * License as published by the Free Software Foundation; either -- * version 2.1 of the License, or (at your option) any later version. -- * -- * This library 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 -- * Lesser General Public License for more details. -- -- * You should have received a copy of the GNU Lesser General -- * Public License along with this library; if not, write to the -- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -- * Boston, MA 02110-1301 USA -- * -- * END_COMMON_COPYRIGHT_HEADER */ -- -- --#ifndef LXQTCLOCKCONFIGURATION_H --#define LXQTCLOCKCONFIGURATION_H -- --#include "../panel/lxqtpanelpluginconfigdialog.h" --#include "../panel/pluginsettings.h" -- --#include --#include --#include --#include -- --namespace Ui { -- class LXQtClockConfiguration; --} -- --class LXQtClockConfiguration : public LXQtPanelPluginConfigDialog --{ -- Q_OBJECT -- --public: -- explicit LXQtClockConfiguration(PluginSettings *settings, QWidget *parent = 0); -- ~LXQtClockConfiguration(); -- --private: -- Ui::LXQtClockConfiguration *ui; -- -- /* -- Read settings from conf file and put data into controls. -- */ -- void loadSettings(); -- -- /* -- Creates a date formats consistent with the region read from locale. -- */ -- void createDateFormats(); -- --private slots: -- /* -- Saves settings in conf file. -- */ -- void saveSettings(); -- void dateFormatActivated(int); -- --private: -- int mOldIndex; -- QString mCustomDateFormat; -- -- void addDateFormat(const QString &format); --}; -- --#endif // LXQTCLOCKCONFIGURATION_H ---- a/plugin-clock/lxqtclockconfiguration.ui -+++ /dev/null -@@ -1,232 +0,0 @@ -- -- -- LXQtClockConfiguration -- -- -- -- 0 -- 0 -- 330 -- 447 -- -- -- -- Clock Settings -- -- -- -- -- -- Time -- -- -- -- -- -- &Show seconds -- -- -- -- -- -- -- 12 &hour style -- -- -- -- -- -- -- &Use UTC -- -- -- -- -- -- -- -- -- -- Date -- -- -- -- -- -- false -- -- -- Date &format -- -- -- dateFormatCOB -- -- -- -- -- -- -- false -- -- -- -- -- -- -- &Do not show date -- -- -- true -- -- -- -- -- -- -- Show date &before time -- -- -- -- -- -- -- Show date &after time -- -- -- -- -- -- -- Show date below time on new &line -- -- -- -- -- -- -- First day of week in calendar -- -- -- firstDayOfWeekCB -- -- -- -- -- -- -- -- -- -- -- -- -- -- Orientation -- -- -- -- -- -- Auto&rotate when the panel is vertical -- -- -- true -- -- -- -- -- -- -- -- -- -- Qt::Vertical -- -- -- -- 20 -- 0 -- -- -- -- -- -- -- -- Qt::Horizontal -- -- -- QDialogButtonBox::Close|QDialogButtonBox::Reset -- -- -- -- -- -- -- -- -- buttons -- accepted() -- LXQtClockConfiguration -- accept() -- -- -- 214 -- 350 -- -- -- 157 -- 274 -- -- -- -- -- buttons -- rejected() -- LXQtClockConfiguration -- reject() -- -- -- 214 -- 350 -- -- -- 196 -- 274 -- -- -- -- -- dontShowDateRB -- toggled(bool) -- dateFormatL -- setDisabled(bool) -- -- -- 68 -- 166 -- -- -- 63 -- 267 -- -- -- -- -- dontShowDateRB -- toggled(bool) -- dateFormatCOB -- setDisabled(bool) -- -- -- 174 -- 167 -- -- -- 239 -- 275 -- -- -- -- -- ---- a/plugin-clock/resources/clock.desktop.in -+++ /dev/null -@@ -1,8 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. --Icon=preferences-system-time -- --#TRANSLATIONS_DIR=../translations ---- a/plugin-clock/translations/clock_ar.desktop -+++ /dev/null -@@ -1,2 +0,0 @@ --Name[ar]=التّاريخ والوقت --Comment[ar]=تعرض الوقت الحاليّ. فيها تقويم. ---- a/plugin-clock/translations/clock_cs.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[cs]=Hodiny a kalendář --Name[cs]=Hodiny ---- a/plugin-clock/translations/clock_cs_CZ.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[cs_CZ]=Hodiny a kalendář --Name[cs_CZ]=Hodiny ---- a/plugin-clock/translations/clock_da.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. --Icon=preferences-system-time -- --#TRANSLATIONS_DIR=../translations -- --# Translations --Name[da]=Dato og klokkeslæt --Comment[da]=Viser den aktuelle tid. Der følger en kalender med. ---- a/plugin-clock/translations/clock_de.desktop -+++ /dev/null -@@ -1,2 +0,0 @@ --Name[de]=Uhr und Kalender --Comment[de]=Zeigt die aktuelle Uhrzeit. Ein Kalender ist auch enthalten. ---- a/plugin-clock/translations/clock_el.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[el]=Ρολόι και ημερολόγιο --Name[el]=Ρολόι ---- a/plugin-clock/translations/clock_eo.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[eo]=Horloĝo kaj kalendaro --Name[eo]=Horloĝo ---- a/plugin-clock/translations/clock_es.desktop -+++ /dev/null -@@ -1,2 +0,0 @@ --Name[es]=Fecha y hora --Comment[es]=Muestra la hora actual. Incluye un calendario. ---- a/plugin-clock/translations/clock_es_VE.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[es_VE]=Reloj y calendario --Name[es_VE]=Reloj ---- a/plugin-clock/translations/clock_eu.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[eu]=Erlojua eta egutegia --Name[eu]=Erlojua ---- a/plugin-clock/translations/clock_fi.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[fi]=Kello ja kalenteri --Name[fi]=Kello ---- a/plugin-clock/translations/clock_fr.desktop -+++ /dev/null -@@ -1,3 +0,0 @@ --# Translations --Comment[fr]=Horloge et calendrier --Name[fr]=Horloge ---- a/plugin-clock/translations/clock_hu.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[hu]=Óra és naptár --Name[hu]=Óra ---- a/plugin-clock/translations/clock_ia.desktop -+++ /dev/null -@@ -1,10 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Clock --Comment=Clock and calendar -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations ---- a/plugin-clock/translations/clock_id_ID.desktop -+++ /dev/null -@@ -1,10 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Clock --Comment=Clock and calendar -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations ---- a/plugin-clock/translations/clock_it.desktop -+++ /dev/null -@@ -1,3 +0,0 @@ --Comment[it]=Orologio e calendario --Name[it]=Orologio -- ---- a/plugin-clock/translations/clock_ja.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[ja]=時計とカレンダー --Name[ja]=時計 ---- a/plugin-clock/translations/clock_ko.desktop -+++ /dev/null -@@ -1,10 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Clock --Comment=Clock and calendar -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations ---- a/plugin-clock/translations/clock_lt.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[lt]=Laikrodis ir kalendorius --Name[lt]=Laikrodis ---- a/plugin-clock/translations/clock_nl.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[nl]=Klok en kalender --Name[nl]=Klok ---- a/plugin-clock/translations/clock_pl.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[pl]=Wyświetla obecny czas. Zawiera kalendarz. --Name[pl]=Zegar ---- a/plugin-clock/translations/clock_pt.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- --# Translations --Name[pt]=Relógio --Comment[pt]=Relógio e calendário -- ---- a/plugin-clock/translations/clock_pt_BR.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[pt_BR]=Relógio e calendário --Name[pt_BR]=Relógio ---- a/plugin-clock/translations/clock_ro_RO.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[ro_RO]=Afișează ora curentă incluzând și un calendar. --Name[ro_RO]=Data și ora ---- a/plugin-clock/translations/clock_ru.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[ru]=Отображение текущего времени. Поставляется с календарем. --Name[ru]=Дата и время ---- a/plugin-clock/translations/clock_sk.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[sk]=Hodiny a kalendár --Name[sk]=Hodiny ---- a/plugin-clock/translations/clock_sl.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[sl]=Ura in koledar --Name[sl]=Ura ---- a/plugin-clock/translations/clock_sr.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[sr]=Сат и календар --Name[sr]=Сат ---- a/plugin-clock/translations/clock_sr@ijekavian.desktop -+++ /dev/null -@@ -1,2 +0,0 @@ --Name[sr@ijekavian]=Сат --Comment[sr@ijekavian]=Сат и календар ---- a/plugin-clock/translations/clock_sr@ijekavianlatin.desktop -+++ /dev/null -@@ -1,2 +0,0 @@ --Name[sr@ijekavianlatin]=Sat --Comment[sr@ijekavianlatin]=Sat i kalendar ---- a/plugin-clock/translations/clock_sr@latin.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[sr@latin]=Sat i kalendar --Name[sr@latin]=Sat ---- a/plugin-clock/translations/clock_th_TH.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[th_TH]=นาฬิกาและปฏิทิน --Name[th_TH]=นาฬิกา ---- a/plugin-clock/translations/clock_tr.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[tr]=Saat ve takvim --Name[tr]=Saat ---- a/plugin-clock/translations/clock_uk.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[uk]=Показує поточний час. Календар --Name[uk]=Дата і час ---- a/plugin-clock/translations/clock_zh_CN.GB2312.desktop -+++ /dev/null -@@ -1,10 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Clock --Comment=Clock and calendar -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations ---- a/plugin-clock/translations/clock_zh_CN.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[zh_CN]=时钟和日历 --Name[zh_CN]=时钟 ---- a/plugin-clock/translations/clock_zh_TW.desktop -+++ /dev/null -@@ -1,12 +0,0 @@ --[Desktop Entry] --Type=Service --ServiceTypes=LXQtPanel/Plugin --Name=Date & time --Comment=Displays the current time. Comes with a calendar. -- --#TRANSLATIONS_DIR=../translations -- -- --# Translations --Comment[zh_TW]=時鐘與日曆 --Name[zh_TW]=時鐘 diff --git a/debian/patches/don't-autounmute-on-volume-change.patch b/debian/patches/don't-autounmute-on-volume-change.patch deleted file mode 100644 index 8438bf6..0000000 --- a/debian/patches/don't-autounmute-on-volume-change.patch +++ /dev/null @@ -1,30 +0,0 @@ -Description: volume: Do not auto-unmute on volume change -Author: Palo Kisa -Origin: upstream -Bug: https://github.com/lxqt/lxqt/issues/1520 -Applied-Upstream: commit:41259bb -Last-Update: 2018-07-16 ---- a/plugin-volume/audiodevice.cpp -+++ b/plugin-volume/audiodevice.cpp -@@ -114,7 +114,6 @@ void AudioDevice::setVolume(int volume) - return; - - setVolumeNoCommit(volume); -- setMute(false); - - if (m_engine) - m_engine->commitDeviceVolume(this); ---- a/plugin-volume/lxqtvolume.cpp -+++ b/plugin-volume/lxqtvolume.cpp -@@ -283,10 +283,7 @@ void LXQtVolume::showNotification(bool f - { - if (Q_LIKELY(m_defaultSink)) - { -- if (m_defaultSink->mute()) -- m_notification->setSummary(tr("Volume: muted")); -- else -- m_notification->setSummary(tr("Volume: %1%").arg(QString::number(m_defaultSink->volume()))); -+ m_notification->setSummary(tr("Volume: %1%%2").arg(QString::number(m_defaultSink->volume())).arg(m_defaultSink->mute() ? tr("(muted)") : "")); - m_notification->update(); - } - } diff --git a/debian/patches/override-icon-theme.patch b/debian/patches/override-icon-theme.patch deleted file mode 100644 index 4982280..0000000 --- a/debian/patches/override-icon-theme.patch +++ /dev/null @@ -1,322 +0,0 @@ -Description: Add optional overriding of icon theme. -Author: Walter Lapchynski -Last-Updated: 2018-08-22 -Applied-Upstream: https://github.com/lxqt/lxqt-panel/pull/674/commits/1a70479ed931e07a67a182223426328ab3fcbeff ---- a/panel/config/configpaneldialog.cpp -+++ b/panel/config/configpaneldialog.cpp -@@ -56,3 +56,8 @@ void ConfigPanelDialog::showConfigPlugin - { - showPage(mPluginsPage); - } -+ -+void ConfigPanelDialog::updateIconThemeSettings() -+{ -+ mPanelPage->updateIconThemeSettings(); -+} ---- a/panel/config/configpaneldialog.h -+++ b/panel/config/configpaneldialog.h -@@ -43,6 +43,7 @@ public: - - void showConfigPanelPage(); - void showConfigPluginsPage(); -+ void updateIconThemeSettings(); - - private: - ConfigPanelWidget *mPanelPage; ---- a/panel/config/configpanelwidget.cpp -+++ b/panel/config/configpanelwidget.cpp -@@ -57,6 +57,7 @@ ConfigPanelWidget::ConfigPanelWidget(LXQ - - fillComboBox_position(); - fillComboBox_alignment(); -+ fillComboBox_icon(); - - mOldPanelSize = mPanel->panelSize(); - mOldIconSize = mPanel->iconSize(); -@@ -115,6 +116,9 @@ ConfigPanelWidget::ConfigPanelWidget(LXQ - connect(ui->slider_opacity, &QSlider::valueChanged, this, &ConfigPanelWidget::editChanged); - - connect(ui->checkBox_reserveSpace, &QAbstractButton::toggled, [this](bool checked) { mPanel->setReserveSpace(checked, true); }); -+ -+ connect(ui->groupBox_icon, &QGroupBox::clicked, this, &ConfigPanelWidget::editChanged); -+ connect(ui->comboBox_icon, QOverload::of(&QComboBox::activated), this, &ConfigPanelWidget::editChanged); - } - - -@@ -211,6 +215,59 @@ void ConfigPanelWidget::fillComboBox_ali - }; - } - -+/************************************************ -+ * -+ ************************************************/ -+void ConfigPanelWidget::fillComboBox_icon() -+{ -+ ui->groupBox_icon->setChecked(!mPanel->iconTheme().isEmpty()); -+ -+ QStringList themeList; -+ QStringList processed; -+ const QStringList baseDirs = QIcon::themeSearchPaths(); -+ for (const QString &baseDirName : baseDirs) -+ { -+ QDir baseDir(baseDirName); -+ if (!baseDir.exists()) -+ continue; -+ const QFileInfoList dirs = baseDir.entryInfoList(QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name); -+ for (const QFileInfo &dir : dirs) -+ { -+ if (!processed.contains(dir.canonicalFilePath())) -+ { -+ processed << dir.canonicalFilePath(); -+ QDir Dir(dir.canonicalFilePath()); -+ QSettings file(Dir.absoluteFilePath(QStringLiteral("index.theme")), QSettings::IniFormat); -+ if (file.status() == QSettings::NoError -+ && !file.value(QStringLiteral("Icon Theme/Directories")).toStringList().join(QLatin1Char(' ')).isEmpty() -+ && !file.value(QStringLiteral("Icon Theme/Hidden"), false).toBool()) -+ { -+ themeList << Dir.dirName(); -+ } -+ } -+ } -+ } -+ if (!themeList.isEmpty()) -+ { -+ themeList.sort(); -+ ui->comboBox_icon->insertItems(0, themeList); -+ QString curTheme = QIcon::themeName(); -+ if (!curTheme.isEmpty()) -+ ui->comboBox_icon->setCurrentText(curTheme); -+ } -+} -+ -+ -+/************************************************ -+ * -+ ************************************************/ -+void ConfigPanelWidget::updateIconThemeSettings() -+{ -+ ui->groupBox_icon->setChecked(!mPanel->iconTheme().isEmpty()); -+ QString curTheme = QIcon::themeName(); -+ if (!curTheme.isEmpty()) -+ ui->comboBox_icon->setCurrentText(curTheme); -+} - - /************************************************ - * -@@ -284,6 +341,11 @@ void ConfigPanelWidget::editChanged() - - QString image = ui->checkBox_customBgImage->isChecked() ? ui->lineEdit_customBgImage->text() : QString(); - mPanel->setBackgroundImage(image, true); -+ -+ if (!ui->groupBox_icon->isChecked()) -+ mPanel->setIconTheme(QString()); -+ else if (!ui->comboBox_icon->currentText().isEmpty()) -+ mPanel->setIconTheme(ui->comboBox_icon->currentText()); - } - - ---- a/panel/config/configpanelwidget.h -+++ b/panel/config/configpanelwidget.h -@@ -49,6 +49,7 @@ public: - - int screenNum() const { return mScreenNum; } - ILXQtPanel::Position position() const { return mPosition; } -+ void updateIconThemeSettings(); - - signals: - void changed(); -@@ -73,6 +74,7 @@ private: - void addPosition(const QString& name, int screen, LXQtPanel::Position position); - void fillComboBox_position(); - void fillComboBox_alignment(); -+ void fillComboBox_icon(); - int indexForPosition(int screen, ILXQtPanel::Position position); - int getMaxLength(); - ---- a/panel/config/configpanelwidget.ui -+++ b/panel/config/configpanelwidget.ui -@@ -555,6 +555,44 @@ - - -
-+ -+ -+ -+ A partial workaround for widget styles that -+cannot give a separate theme to the panel. -+ -+You might also want to disable: -+ -+LXQt Appearance Configuration → -+Icons Theme → -+Colorize icons based on widget style (palette) -+ -+ -+ Override icon &theme -+ -+ -+ true -+ -+ -+ false -+ -+ -+ -+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter -+ -+ -+ -+ -+ Icon theme for panels: -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - ---- a/panel/lxqtpanel.cpp -+++ b/panel/lxqtpanel.cpp -@@ -1354,6 +1354,28 @@ void LXQtPanel::setShowDelay(int showDel - saveSettings(true); - } - -+QString LXQtPanel::iconTheme() const -+{ -+ return mSettings->value("iconTheme").toString(); -+} -+ -+void LXQtPanel::setIconTheme(const QString& iconTheme) -+{ -+ LXQtPanelApplication *a = reinterpret_cast(qApp); -+ a->setIconTheme(iconTheme); -+} -+ -+void LXQtPanel::updateConfigDialog() const -+{ -+ if (!mConfigDialog.isNull() && mConfigDialog->isVisible()) -+ { -+ mConfigDialog->updateIconThemeSettings(); -+ const QList widgets = mConfigDialog->findChildren(); -+ for (QWidget *widget : widgets) -+ widget->update(); -+ } -+} -+ - bool LXQtPanel::isPluginSingletonAndRunnig(QString const & pluginId) const - { - Plugin const * plugin = mPlugins->pluginByID(pluginId); ---- a/panel/lxqtpanel.h -+++ b/panel/lxqtpanel.h -@@ -222,6 +222,7 @@ public: - bool hidable() const { return mHidable; } - int animationTime() const { return mAnimationTime; } - int showDelay() const { return mShowDelayTimer.interval(); } -+ QString iconTheme() const; - - /*! - * \brief Checks if a given Plugin is running and has the -@@ -232,6 +233,11 @@ public: - * ILXQtPanelPlugin::SingleInstance flag set, false otherwise. - */ - bool isPluginSingletonAndRunnig(QString const & pluginId) const; -+ /*! -+ * \brief Updates the config dialog. Used for updating its icons -+ * when the panel-specific icon theme changes. -+ */ -+ void updateConfigDialog() const; - - public slots: - /** -@@ -299,6 +305,7 @@ public slots: - void setHidable(bool hidable, bool save); //!< \sa setPanelSize() - void setAnimationTime(int animationTime, bool save); //!< \sa setPanelSize() - void setShowDelay(int showDelay, bool save); //!< \sa setPanelSize() -+ void setIconTheme(const QString& iconTheme); - - /** - * @brief Saves the current configuration, i.e. writes the current -@@ -549,7 +556,7 @@ private: - * @brief Stores if mLength is stored in pixels or relative to the - * screen size in percents. If true, the length is stored in percents, - * otherwise in pixels. -- * -+ * - * \sa mLength - */ - bool mLengthInPercents; ---- a/panel/lxqtpanelapplication.cpp -+++ b/panel/lxqtpanelapplication.cpp -@@ -117,6 +117,15 @@ LXQtPanelApplication::LXQtPanelApplicati - - QStringList panels = d->mSettings->value("panels").toStringList(); - -+ // WARNING: Giving a separate icon theme to the panel is wrong and has side effects. -+ // However, it is optional and can be used as the last resort for avoiding a low -+ // contrast in the case of symbolic SVG icons. (The correct way of doing that is -+ // using a Qt widget style that can assign a separate theme/QPalette to the panel.) -+ mGlobalIconTheme = QIcon::themeName(); -+ const QString iconTheme = d->mSettings->value("iconTheme").toString(); -+ if (!iconTheme.isEmpty()) -+ QIcon::setThemeName(iconTheme); -+ - if (panels.isEmpty()) - { - panels << "panel1"; -@@ -280,3 +289,21 @@ bool LXQtPanelApplication::isPluginSingl - - return false; - } -+ -+// See LXQtPanelApplication::LXQtPanelApplication for why this isn't good. -+void LXQtPanelApplication::setIconTheme(const QString &iconTheme) -+{ -+ Q_D(LXQtPanelApplication); -+ -+ d->mSettings->setValue("iconTheme", iconTheme == mGlobalIconTheme ? QString() : iconTheme); -+ QString newTheme = iconTheme.isEmpty() ? mGlobalIconTheme : iconTheme; -+ if (newTheme != QIcon::themeName()) -+ { -+ QIcon::setThemeName(newTheme); -+ for(LXQtPanel* panel : qAsConst(mPanels)) -+ { -+ panel->update(); -+ panel->updateConfigDialog(); -+ } -+ } -+} ---- a/panel/lxqtpanelapplication.h -+++ b/panel/lxqtpanelapplication.h -@@ -69,12 +69,14 @@ public: - explicit LXQtPanelApplication(int& argc, char** argv); - ~LXQtPanelApplication(); - -+ void setIconTheme(const QString &iconTheme); -+ - /*! - * \brief Determines the number of LXQtPanel objects - * \return the current number of LXQtPanel objects - */ -- int count() { return mPanels.count(); } -- -+ int count() const { return mPanels.count(); } -+ - /*! - * \brief Checks if a given Plugin is running and has the - * ILXQtPanelPlugin::SingleInstance flag set. As Plugins are added to -@@ -123,6 +125,10 @@ private: - */ - QList mPanels; - /*! -+ * \brief The global icon theme used by all apps (except for panels perhaps). -+ */ -+ QString mGlobalIconTheme; -+ /*! - * \brief Creates a new LXQtPanel with the given name and connects the - * appropriate signals and slots. - * This method can be used at application startup. diff --git a/debian/patches/series b/debian/patches/series deleted file mode 100644 index ff10b2e..0000000 --- a/debian/patches/series +++ /dev/null @@ -1,7 +0,0 @@ -completely-remove-plugin-clock.patch -don't-autounmute-on-volume-change.patch -add-autoexpansion-1.patch -add-autoexpansion-2.patch -add-autoexpansion-3.patch -add-autoexpansion-4.patch -override-icon-theme.patch