From 03cb7a153af1f48786e998adfbe9875f45b23613 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Thu, 25 May 2017 17:28:53 -0500 Subject: [PATCH 01/10] Using worldclock is easier because that is what the new clock will be mostly based off of --- plugin-clock/CMakeLists.txt | 20 +- plugin-clock/calendarpopup.cpp | 57 ---- plugin-clock/calendarpopup.h | 49 --- plugin-clock/lxqtclock.cpp | 318 ------------------ plugin-clock/lxqtclock.h | 105 ------ plugin-clock/lxqtclockconfiguration.cpp | 301 ----------------- plugin-clock/lxqtclockconfiguration.h | 79 ----- plugin-clock/lxqtclockconfiguration.ui | 232 ------------- .../lxqtworldclock.cpp | 0 .../lxqtworldclock.h | 0 .../lxqtworldclockconfiguration.cpp | 0 .../lxqtworldclockconfiguration.h | 0 .../lxqtworldclockconfiguration.ui | 0 ...xqtworldclockconfigurationmanualformat.cpp | 0 .../lxqtworldclockconfigurationmanualformat.h | 0 ...lxqtworldclockconfigurationmanualformat.ui | 0 .../lxqtworldclockconfigurationtimezones.cpp | 0 .../lxqtworldclockconfigurationtimezones.h | 0 .../lxqtworldclockconfigurationtimezones.ui | 0 plugin-clock/resources/clock.desktop.in | 8 - .../resources/worldclock.desktop.in | 0 plugin-clock/translations/clock_ar.desktop | 2 - plugin-clock/translations/clock_cs.desktop | 12 - plugin-clock/translations/clock_cs_CZ.desktop | 12 - plugin-clock/translations/clock_da.desktop | 12 - plugin-clock/translations/clock_de.desktop | 2 - plugin-clock/translations/clock_el.desktop | 12 - plugin-clock/translations/clock_eo.desktop | 12 - plugin-clock/translations/clock_es.desktop | 12 - plugin-clock/translations/clock_es_VE.desktop | 12 - plugin-clock/translations/clock_eu.desktop | 12 - plugin-clock/translations/clock_fi.desktop | 12 - plugin-clock/translations/clock_fr.desktop | 3 - plugin-clock/translations/clock_hu.desktop | 12 - plugin-clock/translations/clock_ia.desktop | 10 - plugin-clock/translations/clock_id_ID.desktop | 10 - plugin-clock/translations/clock_it.desktop | 3 - plugin-clock/translations/clock_ja.desktop | 12 - plugin-clock/translations/clock_ko.desktop | 10 - plugin-clock/translations/clock_lt.desktop | 12 - plugin-clock/translations/clock_nl.desktop | 12 - plugin-clock/translations/clock_pl.desktop | 12 - plugin-clock/translations/clock_pl_PL.desktop | 12 - plugin-clock/translations/clock_pt.desktop | 12 - plugin-clock/translations/clock_pt_BR.desktop | 12 - plugin-clock/translations/clock_ro_RO.desktop | 12 - plugin-clock/translations/clock_ru.desktop | 12 - plugin-clock/translations/clock_sk.desktop | 12 - plugin-clock/translations/clock_sl.desktop | 12 - plugin-clock/translations/clock_sr.desktop | 12 - .../translations/clock_sr@ijekavian.desktop | 2 - .../clock_sr@ijekavianlatin.desktop | 2 - .../translations/clock_sr@latin.desktop | 12 - plugin-clock/translations/clock_th_TH.desktop | 12 - plugin-clock/translations/clock_tr.desktop | 12 - plugin-clock/translations/clock_uk.desktop | 12 - .../translations/clock_zh_CN.GB2312.desktop | 10 - plugin-clock/translations/clock_zh_CN.desktop | 12 - plugin-clock/translations/clock_zh_TW.desktop | 12 - .../translations/worldclock_ar.desktop | 0 .../translations/worldclock_da.desktop | 0 .../translations/worldclock_de.desktop | 0 .../translations/worldclock_el.desktop | 0 .../translations/worldclock_fr.desktop | 0 .../translations/worldclock_hu.desktop | 0 .../translations/worldclock_it.desktop | 0 .../translations/worldclock_ja.desktop | 0 .../translations/worldclock_pt.desktop | 0 .../translations/worldclock_ru.desktop | 0 plugin-worldclock/CMakeLists.txt | 23 -- 70 files changed, 12 insertions(+), 1570 deletions(-) delete mode 100644 plugin-clock/calendarpopup.cpp delete mode 100644 plugin-clock/calendarpopup.h delete mode 100644 plugin-clock/lxqtclock.cpp delete mode 100644 plugin-clock/lxqtclock.h delete mode 100644 plugin-clock/lxqtclockconfiguration.cpp delete mode 100644 plugin-clock/lxqtclockconfiguration.h delete mode 100644 plugin-clock/lxqtclockconfiguration.ui rename {plugin-worldclock => plugin-clock}/lxqtworldclock.cpp (100%) rename {plugin-worldclock => plugin-clock}/lxqtworldclock.h (100%) rename {plugin-worldclock => plugin-clock}/lxqtworldclockconfiguration.cpp (100%) rename {plugin-worldclock => plugin-clock}/lxqtworldclockconfiguration.h (100%) rename {plugin-worldclock => plugin-clock}/lxqtworldclockconfiguration.ui (100%) rename {plugin-worldclock => plugin-clock}/lxqtworldclockconfigurationmanualformat.cpp (100%) rename {plugin-worldclock => plugin-clock}/lxqtworldclockconfigurationmanualformat.h (100%) rename {plugin-worldclock => plugin-clock}/lxqtworldclockconfigurationmanualformat.ui (100%) rename {plugin-worldclock => plugin-clock}/lxqtworldclockconfigurationtimezones.cpp (100%) rename {plugin-worldclock => plugin-clock}/lxqtworldclockconfigurationtimezones.h (100%) rename {plugin-worldclock => plugin-clock}/lxqtworldclockconfigurationtimezones.ui (100%) delete mode 100644 plugin-clock/resources/clock.desktop.in rename {plugin-worldclock => plugin-clock}/resources/worldclock.desktop.in (100%) delete mode 100644 plugin-clock/translations/clock_ar.desktop delete mode 100644 plugin-clock/translations/clock_cs.desktop delete mode 100644 plugin-clock/translations/clock_cs_CZ.desktop delete mode 100644 plugin-clock/translations/clock_da.desktop delete mode 100644 plugin-clock/translations/clock_de.desktop delete mode 100644 plugin-clock/translations/clock_el.desktop delete mode 100644 plugin-clock/translations/clock_eo.desktop delete mode 100644 plugin-clock/translations/clock_es.desktop delete mode 100644 plugin-clock/translations/clock_es_VE.desktop delete mode 100644 plugin-clock/translations/clock_eu.desktop delete mode 100644 plugin-clock/translations/clock_fi.desktop delete mode 100644 plugin-clock/translations/clock_fr.desktop delete mode 100644 plugin-clock/translations/clock_hu.desktop delete mode 100644 plugin-clock/translations/clock_ia.desktop delete mode 100644 plugin-clock/translations/clock_id_ID.desktop delete mode 100644 plugin-clock/translations/clock_it.desktop delete mode 100644 plugin-clock/translations/clock_ja.desktop delete mode 100644 plugin-clock/translations/clock_ko.desktop delete mode 100644 plugin-clock/translations/clock_lt.desktop delete mode 100644 plugin-clock/translations/clock_nl.desktop delete mode 100644 plugin-clock/translations/clock_pl.desktop delete mode 100644 plugin-clock/translations/clock_pl_PL.desktop delete mode 100644 plugin-clock/translations/clock_pt.desktop delete mode 100644 plugin-clock/translations/clock_pt_BR.desktop delete mode 100644 plugin-clock/translations/clock_ro_RO.desktop delete mode 100644 plugin-clock/translations/clock_ru.desktop delete mode 100644 plugin-clock/translations/clock_sk.desktop delete mode 100644 plugin-clock/translations/clock_sl.desktop delete mode 100644 plugin-clock/translations/clock_sr.desktop delete mode 100644 plugin-clock/translations/clock_sr@ijekavian.desktop delete mode 100644 plugin-clock/translations/clock_sr@ijekavianlatin.desktop delete mode 100644 plugin-clock/translations/clock_sr@latin.desktop delete mode 100644 plugin-clock/translations/clock_th_TH.desktop delete mode 100644 plugin-clock/translations/clock_tr.desktop delete mode 100644 plugin-clock/translations/clock_uk.desktop delete mode 100644 plugin-clock/translations/clock_zh_CN.GB2312.desktop delete mode 100644 plugin-clock/translations/clock_zh_CN.desktop delete mode 100644 plugin-clock/translations/clock_zh_TW.desktop rename {plugin-worldclock => plugin-clock}/translations/worldclock_ar.desktop (100%) rename {plugin-worldclock => plugin-clock}/translations/worldclock_da.desktop (100%) rename {plugin-worldclock => plugin-clock}/translations/worldclock_de.desktop (100%) rename {plugin-worldclock => plugin-clock}/translations/worldclock_el.desktop (100%) rename {plugin-worldclock => plugin-clock}/translations/worldclock_fr.desktop (100%) rename {plugin-worldclock => plugin-clock}/translations/worldclock_hu.desktop (100%) rename {plugin-worldclock => plugin-clock}/translations/worldclock_it.desktop (100%) rename {plugin-worldclock => plugin-clock}/translations/worldclock_ja.desktop (100%) rename {plugin-worldclock => plugin-clock}/translations/worldclock_pt.desktop (100%) rename {plugin-worldclock => plugin-clock}/translations/worldclock_ru.desktop (100%) delete mode 100644 plugin-worldclock/CMakeLists.txt diff --git a/plugin-clock/CMakeLists.txt b/plugin-clock/CMakeLists.txt index d04476193..90d10c234 100644 --- a/plugin-clock/CMakeLists.txt +++ b/plugin-clock/CMakeLists.txt @@ -1,19 +1,23 @@ -set(PLUGIN "clock") +set(PLUGIN "worldclock") set(HEADERS - lxqtclock.h - lxqtclockconfiguration.h - calendarpopup.h + lxqtworldclock.h + lxqtworldclockconfiguration.h + lxqtworldclockconfigurationtimezones.h + lxqtworldclockconfigurationmanualformat.h ) set(SOURCES - lxqtclock.cpp - lxqtclockconfiguration.cpp - calendarpopup.cpp + lxqtworldclock.cpp + lxqtworldclockconfiguration.cpp + lxqtworldclockconfigurationtimezones.cpp + lxqtworldclockconfigurationmanualformat.cpp ) set(UIS - lxqtclockconfiguration.ui + lxqtworldclockconfiguration.ui + lxqtworldclockconfigurationtimezones.ui + lxqtworldclockconfigurationmanualformat.ui ) BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/plugin-clock/calendarpopup.cpp b/plugin-clock/calendarpopup.cpp deleted file mode 100644 index 0203ecf3c..000000000 --- a/plugin-clock/calendarpopup.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXDE-Qt - a lightweight, Qt based, desktop toolset - * http://razor-qt.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); -} diff --git a/plugin-clock/calendarpopup.h b/plugin-clock/calendarpopup.h deleted file mode 100644 index a40b89bda..000000000 --- a/plugin-clock/calendarpopup.h +++ /dev/null @@ -1,49 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXDE-Qt - a lightweight, Qt based, desktop toolset - * http://razor-qt.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 diff --git a/plugin-clock/lxqtclock.cpp b/plugin-clock/lxqtclock.cpp deleted file mode 100644 index 34d8a63fc..000000000 --- a/plugin-clock/lxqtclock.cpp +++ /dev/null @@ -1,318 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXDE-Qt - a lightweight, Qt based, desktop toolset - * http://razor-qt.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 - -/** - * @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) -{ - 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()->globalGometry().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; -} diff --git a/plugin-clock/lxqtclock.h b/plugin-clock/lxqtclock.h deleted file mode 100644 index c5e16bf8f..000000000 --- a/plugin-clock/lxqtclock.h +++ /dev/null @@ -1,105 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXDE-Qt - a lightweight, Qt based, desktop toolset - * http://razor-qt.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 "lxde-qt.org/Panel/PluginInterface/3.0") - Q_INTERFACES(ILXQtPanelPluginLibrary) -public: - ILXQtPanelPlugin *instance(const ILXQtPanelPluginStartupInfo &startupInfo) const { return new LXQtClock(startupInfo);} -}; - - -#endif diff --git a/plugin-clock/lxqtclockconfiguration.cpp b/plugin-clock/lxqtclockconfiguration.cpp deleted file mode 100644 index 6d93e289e..000000000 --- a/plugin-clock/lxqtclockconfiguration.cpp +++ /dev/null @@ -1,301 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXDE-Qt - a lightweight, Qt based, desktop toolset - * http://razor-qt.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(); -} diff --git a/plugin-clock/lxqtclockconfiguration.h b/plugin-clock/lxqtclockconfiguration.h deleted file mode 100644 index bf3553aef..000000000 --- a/plugin-clock/lxqtclockconfiguration.h +++ /dev/null @@ -1,79 +0,0 @@ -/* BEGIN_COMMON_COPYRIGHT_HEADER - * (c)LGPL2+ - * - * LXDE-Qt - a lightweight, Qt based, desktop toolset - * http://razor-qt.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 diff --git a/plugin-clock/lxqtclockconfiguration.ui b/plugin-clock/lxqtclockconfiguration.ui deleted file mode 100644 index 2912ef35c..000000000 --- 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 - - - - - diff --git a/plugin-worldclock/lxqtworldclock.cpp b/plugin-clock/lxqtworldclock.cpp similarity index 100% rename from plugin-worldclock/lxqtworldclock.cpp rename to plugin-clock/lxqtworldclock.cpp diff --git a/plugin-worldclock/lxqtworldclock.h b/plugin-clock/lxqtworldclock.h similarity index 100% rename from plugin-worldclock/lxqtworldclock.h rename to plugin-clock/lxqtworldclock.h diff --git a/plugin-worldclock/lxqtworldclockconfiguration.cpp b/plugin-clock/lxqtworldclockconfiguration.cpp similarity index 100% rename from plugin-worldclock/lxqtworldclockconfiguration.cpp rename to plugin-clock/lxqtworldclockconfiguration.cpp diff --git a/plugin-worldclock/lxqtworldclockconfiguration.h b/plugin-clock/lxqtworldclockconfiguration.h similarity index 100% rename from plugin-worldclock/lxqtworldclockconfiguration.h rename to plugin-clock/lxqtworldclockconfiguration.h diff --git a/plugin-worldclock/lxqtworldclockconfiguration.ui b/plugin-clock/lxqtworldclockconfiguration.ui similarity index 100% rename from plugin-worldclock/lxqtworldclockconfiguration.ui rename to plugin-clock/lxqtworldclockconfiguration.ui diff --git a/plugin-worldclock/lxqtworldclockconfigurationmanualformat.cpp b/plugin-clock/lxqtworldclockconfigurationmanualformat.cpp similarity index 100% rename from plugin-worldclock/lxqtworldclockconfigurationmanualformat.cpp rename to plugin-clock/lxqtworldclockconfigurationmanualformat.cpp diff --git a/plugin-worldclock/lxqtworldclockconfigurationmanualformat.h b/plugin-clock/lxqtworldclockconfigurationmanualformat.h similarity index 100% rename from plugin-worldclock/lxqtworldclockconfigurationmanualformat.h rename to plugin-clock/lxqtworldclockconfigurationmanualformat.h diff --git a/plugin-worldclock/lxqtworldclockconfigurationmanualformat.ui b/plugin-clock/lxqtworldclockconfigurationmanualformat.ui similarity index 100% rename from plugin-worldclock/lxqtworldclockconfigurationmanualformat.ui rename to plugin-clock/lxqtworldclockconfigurationmanualformat.ui diff --git a/plugin-worldclock/lxqtworldclockconfigurationtimezones.cpp b/plugin-clock/lxqtworldclockconfigurationtimezones.cpp similarity index 100% rename from plugin-worldclock/lxqtworldclockconfigurationtimezones.cpp rename to plugin-clock/lxqtworldclockconfigurationtimezones.cpp diff --git a/plugin-worldclock/lxqtworldclockconfigurationtimezones.h b/plugin-clock/lxqtworldclockconfigurationtimezones.h similarity index 100% rename from plugin-worldclock/lxqtworldclockconfigurationtimezones.h rename to plugin-clock/lxqtworldclockconfigurationtimezones.h diff --git a/plugin-worldclock/lxqtworldclockconfigurationtimezones.ui b/plugin-clock/lxqtworldclockconfigurationtimezones.ui similarity index 100% rename from plugin-worldclock/lxqtworldclockconfigurationtimezones.ui rename to plugin-clock/lxqtworldclockconfigurationtimezones.ui diff --git a/plugin-clock/resources/clock.desktop.in b/plugin-clock/resources/clock.desktop.in deleted file mode 100644 index e6e990140..000000000 --- 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 diff --git a/plugin-worldclock/resources/worldclock.desktop.in b/plugin-clock/resources/worldclock.desktop.in similarity index 100% rename from plugin-worldclock/resources/worldclock.desktop.in rename to plugin-clock/resources/worldclock.desktop.in diff --git a/plugin-clock/translations/clock_ar.desktop b/plugin-clock/translations/clock_ar.desktop deleted file mode 100644 index cc1b687d5..000000000 --- a/plugin-clock/translations/clock_ar.desktop +++ /dev/null @@ -1,2 +0,0 @@ -Name[ar]=التّاريخ والوقت -Comment[ar]=تعرض الوقت الحاليّ. فيها تقويم. diff --git a/plugin-clock/translations/clock_cs.desktop b/plugin-clock/translations/clock_cs.desktop deleted file mode 100644 index 20f62398e..000000000 --- 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 diff --git a/plugin-clock/translations/clock_cs_CZ.desktop b/plugin-clock/translations/clock_cs_CZ.desktop deleted file mode 100644 index c99c1f0cd..000000000 --- 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 diff --git a/plugin-clock/translations/clock_da.desktop b/plugin-clock/translations/clock_da.desktop deleted file mode 100644 index 4aa5ecdcd..000000000 --- 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. diff --git a/plugin-clock/translations/clock_de.desktop b/plugin-clock/translations/clock_de.desktop deleted file mode 100644 index f24f08ed8..000000000 --- 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. diff --git a/plugin-clock/translations/clock_el.desktop b/plugin-clock/translations/clock_el.desktop deleted file mode 100644 index 05f41b1fa..000000000 --- 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]=Ρολόι diff --git a/plugin-clock/translations/clock_eo.desktop b/plugin-clock/translations/clock_eo.desktop deleted file mode 100644 index 1042ea542..000000000 --- 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 diff --git a/plugin-clock/translations/clock_es.desktop b/plugin-clock/translations/clock_es.desktop deleted file mode 100644 index bb26d1ff4..000000000 --- a/plugin-clock/translations/clock_es.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]=Reloj y calendario -Name[es]=Reloj diff --git a/plugin-clock/translations/clock_es_VE.desktop b/plugin-clock/translations/clock_es_VE.desktop deleted file mode 100644 index 2621c2be0..000000000 --- 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 diff --git a/plugin-clock/translations/clock_eu.desktop b/plugin-clock/translations/clock_eu.desktop deleted file mode 100644 index 6edd44624..000000000 --- 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 diff --git a/plugin-clock/translations/clock_fi.desktop b/plugin-clock/translations/clock_fi.desktop deleted file mode 100644 index 0035c6a33..000000000 --- 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 diff --git a/plugin-clock/translations/clock_fr.desktop b/plugin-clock/translations/clock_fr.desktop deleted file mode 100644 index 1035f7b5e..000000000 --- a/plugin-clock/translations/clock_fr.desktop +++ /dev/null @@ -1,3 +0,0 @@ -# Translations -Comment[fr]=Horloge et calendrier -Name[fr]=Horloge diff --git a/plugin-clock/translations/clock_hu.desktop b/plugin-clock/translations/clock_hu.desktop deleted file mode 100644 index be55b7c99..000000000 --- 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 diff --git a/plugin-clock/translations/clock_ia.desktop b/plugin-clock/translations/clock_ia.desktop deleted file mode 100644 index 9c7df2430..000000000 --- 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 diff --git a/plugin-clock/translations/clock_id_ID.desktop b/plugin-clock/translations/clock_id_ID.desktop deleted file mode 100644 index 9c7df2430..000000000 --- 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 diff --git a/plugin-clock/translations/clock_it.desktop b/plugin-clock/translations/clock_it.desktop deleted file mode 100644 index bd40ee3bb..000000000 --- a/plugin-clock/translations/clock_it.desktop +++ /dev/null @@ -1,3 +0,0 @@ -Comment[it]=Orologio e calendario -Name[it]=Orologio - diff --git a/plugin-clock/translations/clock_ja.desktop b/plugin-clock/translations/clock_ja.desktop deleted file mode 100644 index 67e702a21..000000000 --- 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]=時計 diff --git a/plugin-clock/translations/clock_ko.desktop b/plugin-clock/translations/clock_ko.desktop deleted file mode 100644 index 9c7df2430..000000000 --- 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 diff --git a/plugin-clock/translations/clock_lt.desktop b/plugin-clock/translations/clock_lt.desktop deleted file mode 100644 index 6ccf8b1de..000000000 --- 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 diff --git a/plugin-clock/translations/clock_nl.desktop b/plugin-clock/translations/clock_nl.desktop deleted file mode 100644 index b041bc1fc..000000000 --- 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 diff --git a/plugin-clock/translations/clock_pl.desktop b/plugin-clock/translations/clock_pl.desktop deleted file mode 100644 index baefee716..000000000 --- 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]=Zegar oraz kalendarz -Name[pl]=Zegar diff --git a/plugin-clock/translations/clock_pl_PL.desktop b/plugin-clock/translations/clock_pl_PL.desktop deleted file mode 100644 index 37b3bd9af..000000000 --- a/plugin-clock/translations/clock_pl_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_PL]=Zegar i kalendarz -Name[pl_PL]=Zegar diff --git a/plugin-clock/translations/clock_pt.desktop b/plugin-clock/translations/clock_pt.desktop deleted file mode 100644 index e4a511f02..000000000 --- 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 - diff --git a/plugin-clock/translations/clock_pt_BR.desktop b/plugin-clock/translations/clock_pt_BR.desktop deleted file mode 100644 index 42aab7836..000000000 --- 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 diff --git a/plugin-clock/translations/clock_ro_RO.desktop b/plugin-clock/translations/clock_ro_RO.desktop deleted file mode 100644 index d4ca3e14d..000000000 --- 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 diff --git a/plugin-clock/translations/clock_ru.desktop b/plugin-clock/translations/clock_ru.desktop deleted file mode 100644 index c5bc1dccd..000000000 --- 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]=Дата и время diff --git a/plugin-clock/translations/clock_sk.desktop b/plugin-clock/translations/clock_sk.desktop deleted file mode 100644 index 9730f2664..000000000 --- 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 diff --git a/plugin-clock/translations/clock_sl.desktop b/plugin-clock/translations/clock_sl.desktop deleted file mode 100644 index f056c30c8..000000000 --- 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 diff --git a/plugin-clock/translations/clock_sr.desktop b/plugin-clock/translations/clock_sr.desktop deleted file mode 100644 index 363f64e26..000000000 --- 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]=Сат diff --git a/plugin-clock/translations/clock_sr@ijekavian.desktop b/plugin-clock/translations/clock_sr@ijekavian.desktop deleted file mode 100644 index 2c1f60945..000000000 --- a/plugin-clock/translations/clock_sr@ijekavian.desktop +++ /dev/null @@ -1,2 +0,0 @@ -Name[sr@ijekavian]=Сат -Comment[sr@ijekavian]=Сат и календар diff --git a/plugin-clock/translations/clock_sr@ijekavianlatin.desktop b/plugin-clock/translations/clock_sr@ijekavianlatin.desktop deleted file mode 100644 index f4845497c..000000000 --- a/plugin-clock/translations/clock_sr@ijekavianlatin.desktop +++ /dev/null @@ -1,2 +0,0 @@ -Name[sr@ijekavianlatin]=Sat -Comment[sr@ijekavianlatin]=Sat i kalendar diff --git a/plugin-clock/translations/clock_sr@latin.desktop b/plugin-clock/translations/clock_sr@latin.desktop deleted file mode 100644 index e1fbd72f1..000000000 --- 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 diff --git a/plugin-clock/translations/clock_th_TH.desktop b/plugin-clock/translations/clock_th_TH.desktop deleted file mode 100644 index 4ec456557..000000000 --- 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]=นาฬิกา diff --git a/plugin-clock/translations/clock_tr.desktop b/plugin-clock/translations/clock_tr.desktop deleted file mode 100644 index b17ccc556..000000000 --- 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 diff --git a/plugin-clock/translations/clock_uk.desktop b/plugin-clock/translations/clock_uk.desktop deleted file mode 100644 index a76879cf7..000000000 --- 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]=Дата і час diff --git a/plugin-clock/translations/clock_zh_CN.GB2312.desktop b/plugin-clock/translations/clock_zh_CN.GB2312.desktop deleted file mode 100644 index 9c7df2430..000000000 --- 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 diff --git a/plugin-clock/translations/clock_zh_CN.desktop b/plugin-clock/translations/clock_zh_CN.desktop deleted file mode 100644 index f875ee0bf..000000000 --- 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]=时钟 diff --git a/plugin-clock/translations/clock_zh_TW.desktop b/plugin-clock/translations/clock_zh_TW.desktop deleted file mode 100644 index 12bbe250d..000000000 --- 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/plugin-worldclock/translations/worldclock_ar.desktop b/plugin-clock/translations/worldclock_ar.desktop similarity index 100% rename from plugin-worldclock/translations/worldclock_ar.desktop rename to plugin-clock/translations/worldclock_ar.desktop diff --git a/plugin-worldclock/translations/worldclock_da.desktop b/plugin-clock/translations/worldclock_da.desktop similarity index 100% rename from plugin-worldclock/translations/worldclock_da.desktop rename to plugin-clock/translations/worldclock_da.desktop diff --git a/plugin-worldclock/translations/worldclock_de.desktop b/plugin-clock/translations/worldclock_de.desktop similarity index 100% rename from plugin-worldclock/translations/worldclock_de.desktop rename to plugin-clock/translations/worldclock_de.desktop diff --git a/plugin-worldclock/translations/worldclock_el.desktop b/plugin-clock/translations/worldclock_el.desktop similarity index 100% rename from plugin-worldclock/translations/worldclock_el.desktop rename to plugin-clock/translations/worldclock_el.desktop diff --git a/plugin-worldclock/translations/worldclock_fr.desktop b/plugin-clock/translations/worldclock_fr.desktop similarity index 100% rename from plugin-worldclock/translations/worldclock_fr.desktop rename to plugin-clock/translations/worldclock_fr.desktop diff --git a/plugin-worldclock/translations/worldclock_hu.desktop b/plugin-clock/translations/worldclock_hu.desktop similarity index 100% rename from plugin-worldclock/translations/worldclock_hu.desktop rename to plugin-clock/translations/worldclock_hu.desktop diff --git a/plugin-worldclock/translations/worldclock_it.desktop b/plugin-clock/translations/worldclock_it.desktop similarity index 100% rename from plugin-worldclock/translations/worldclock_it.desktop rename to plugin-clock/translations/worldclock_it.desktop diff --git a/plugin-worldclock/translations/worldclock_ja.desktop b/plugin-clock/translations/worldclock_ja.desktop similarity index 100% rename from plugin-worldclock/translations/worldclock_ja.desktop rename to plugin-clock/translations/worldclock_ja.desktop diff --git a/plugin-worldclock/translations/worldclock_pt.desktop b/plugin-clock/translations/worldclock_pt.desktop similarity index 100% rename from plugin-worldclock/translations/worldclock_pt.desktop rename to plugin-clock/translations/worldclock_pt.desktop diff --git a/plugin-worldclock/translations/worldclock_ru.desktop b/plugin-clock/translations/worldclock_ru.desktop similarity index 100% rename from plugin-worldclock/translations/worldclock_ru.desktop rename to plugin-clock/translations/worldclock_ru.desktop diff --git a/plugin-worldclock/CMakeLists.txt b/plugin-worldclock/CMakeLists.txt deleted file mode 100644 index 90d10c234..000000000 --- a/plugin-worldclock/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -set(PLUGIN "worldclock") - -set(HEADERS - lxqtworldclock.h - lxqtworldclockconfiguration.h - lxqtworldclockconfigurationtimezones.h - lxqtworldclockconfigurationmanualformat.h -) - -set(SOURCES - lxqtworldclock.cpp - lxqtworldclockconfiguration.cpp - lxqtworldclockconfigurationtimezones.cpp - lxqtworldclockconfigurationmanualformat.cpp -) - -set(UIS - lxqtworldclockconfiguration.ui - lxqtworldclockconfigurationtimezones.ui - lxqtworldclockconfigurationmanualformat.ui -) - -BUILD_LXQT_PLUGIN(${PLUGIN}) From f307050a51bfdc00b522843625d334876352318a Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Thu, 25 May 2017 17:32:14 -0500 Subject: [PATCH 02/10] Remove worldclock from CMakeLists.txt --- CMakeLists.txt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c20cd8393..eb3099b26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -241,14 +241,6 @@ if(VOLUME_PLUGIN) add_subdirectory(plugin-volume) endif() -setByDefault(WORLDCLOCK_PLUGIN Yes) -if(WORLDCLOCK_PLUGIN) - list(APPEND STATIC_PLUGINS "worldclock") - add_definitions(-DWITH_WORLDCLOCK_PLUGIN) - list(APPEND ENABLED_PLUGINS "World Clock") - add_subdirectory(plugin-worldclock) -endif(WORLDCLOCK_PLUGIN) - setByDefault(SPACER_PLUGIN Yes) if(SPACER_PLUGIN) list(APPEND STATIC_PLUGINS "spacer") From ef42145bac3b595003513ed99b47f8403efc53e3 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Thu, 25 May 2017 17:41:49 -0500 Subject: [PATCH 03/10] Rename files appropriately --- plugin-clock/{lxqtworldclock.cpp => lxqtclock.cpp} | 0 plugin-clock/{lxqtworldclock.h => lxqtclock.h} | 0 ...worldclockconfiguration.cpp => lxqtclockconfiguration.cpp} | 0 ...lxqtworldclockconfiguration.h => lxqtclockconfiguration.h} | 0 ...qtworldclockconfiguration.ui => lxqtclockconfiguration.ui} | 0 ...anualformat.cpp => lxqtclockconfigurationmanualformat.cpp} | 0 ...ionmanualformat.h => lxqtclockconfigurationmanualformat.h} | 0 ...nmanualformat.ui => lxqtclockconfigurationmanualformat.ui} | 0 ...ationtimezones.cpp => lxqtclockconfigurationtimezones.cpp} | 0 ...igurationtimezones.h => lxqtclockconfigurationtimezones.h} | 0 ...urationtimezones.ui => lxqtclockconfigurationtimezones.ui} | 0 .../resources/{worldclock.desktop.in => clock.desktop.in} | 4 ++-- .../translations/{worldclock_ar.desktop => clock_ar.desktop} | 0 .../translations/{worldclock_da.desktop => clock_da.desktop} | 0 .../translations/{worldclock_de.desktop => clock_de.desktop} | 0 .../translations/{worldclock_el.desktop => clock_el.desktop} | 0 .../translations/{worldclock_fr.desktop => clock_fr.desktop} | 0 .../translations/{worldclock_hu.desktop => clock_hu.desktop} | 0 .../translations/{worldclock_it.desktop => clock_it.desktop} | 0 .../translations/{worldclock_ja.desktop => clock_ja.desktop} | 0 .../translations/{worldclock_pt.desktop => clock_pt.desktop} | 0 .../translations/{worldclock_ru.desktop => clock_ru.desktop} | 0 22 files changed, 2 insertions(+), 2 deletions(-) rename plugin-clock/{lxqtworldclock.cpp => lxqtclock.cpp} (100%) rename plugin-clock/{lxqtworldclock.h => lxqtclock.h} (100%) rename plugin-clock/{lxqtworldclockconfiguration.cpp => lxqtclockconfiguration.cpp} (100%) rename plugin-clock/{lxqtworldclockconfiguration.h => lxqtclockconfiguration.h} (100%) rename plugin-clock/{lxqtworldclockconfiguration.ui => lxqtclockconfiguration.ui} (100%) rename plugin-clock/{lxqtworldclockconfigurationmanualformat.cpp => lxqtclockconfigurationmanualformat.cpp} (100%) rename plugin-clock/{lxqtworldclockconfigurationmanualformat.h => lxqtclockconfigurationmanualformat.h} (100%) rename plugin-clock/{lxqtworldclockconfigurationmanualformat.ui => lxqtclockconfigurationmanualformat.ui} (100%) rename plugin-clock/{lxqtworldclockconfigurationtimezones.cpp => lxqtclockconfigurationtimezones.cpp} (100%) rename plugin-clock/{lxqtworldclockconfigurationtimezones.h => lxqtclockconfigurationtimezones.h} (100%) rename plugin-clock/{lxqtworldclockconfigurationtimezones.ui => lxqtclockconfigurationtimezones.ui} (100%) rename plugin-clock/resources/{worldclock.desktop.in => clock.desktop.in} (70%) rename plugin-clock/translations/{worldclock_ar.desktop => clock_ar.desktop} (100%) rename plugin-clock/translations/{worldclock_da.desktop => clock_da.desktop} (100%) rename plugin-clock/translations/{worldclock_de.desktop => clock_de.desktop} (100%) rename plugin-clock/translations/{worldclock_el.desktop => clock_el.desktop} (100%) rename plugin-clock/translations/{worldclock_fr.desktop => clock_fr.desktop} (100%) rename plugin-clock/translations/{worldclock_hu.desktop => clock_hu.desktop} (100%) rename plugin-clock/translations/{worldclock_it.desktop => clock_it.desktop} (100%) rename plugin-clock/translations/{worldclock_ja.desktop => clock_ja.desktop} (100%) rename plugin-clock/translations/{worldclock_pt.desktop => clock_pt.desktop} (100%) rename plugin-clock/translations/{worldclock_ru.desktop => clock_ru.desktop} (100%) diff --git a/plugin-clock/lxqtworldclock.cpp b/plugin-clock/lxqtclock.cpp similarity index 100% rename from plugin-clock/lxqtworldclock.cpp rename to plugin-clock/lxqtclock.cpp diff --git a/plugin-clock/lxqtworldclock.h b/plugin-clock/lxqtclock.h similarity index 100% rename from plugin-clock/lxqtworldclock.h rename to plugin-clock/lxqtclock.h diff --git a/plugin-clock/lxqtworldclockconfiguration.cpp b/plugin-clock/lxqtclockconfiguration.cpp similarity index 100% rename from plugin-clock/lxqtworldclockconfiguration.cpp rename to plugin-clock/lxqtclockconfiguration.cpp diff --git a/plugin-clock/lxqtworldclockconfiguration.h b/plugin-clock/lxqtclockconfiguration.h similarity index 100% rename from plugin-clock/lxqtworldclockconfiguration.h rename to plugin-clock/lxqtclockconfiguration.h diff --git a/plugin-clock/lxqtworldclockconfiguration.ui b/plugin-clock/lxqtclockconfiguration.ui similarity index 100% rename from plugin-clock/lxqtworldclockconfiguration.ui rename to plugin-clock/lxqtclockconfiguration.ui diff --git a/plugin-clock/lxqtworldclockconfigurationmanualformat.cpp b/plugin-clock/lxqtclockconfigurationmanualformat.cpp similarity index 100% rename from plugin-clock/lxqtworldclockconfigurationmanualformat.cpp rename to plugin-clock/lxqtclockconfigurationmanualformat.cpp diff --git a/plugin-clock/lxqtworldclockconfigurationmanualformat.h b/plugin-clock/lxqtclockconfigurationmanualformat.h similarity index 100% rename from plugin-clock/lxqtworldclockconfigurationmanualformat.h rename to plugin-clock/lxqtclockconfigurationmanualformat.h diff --git a/plugin-clock/lxqtworldclockconfigurationmanualformat.ui b/plugin-clock/lxqtclockconfigurationmanualformat.ui similarity index 100% rename from plugin-clock/lxqtworldclockconfigurationmanualformat.ui rename to plugin-clock/lxqtclockconfigurationmanualformat.ui diff --git a/plugin-clock/lxqtworldclockconfigurationtimezones.cpp b/plugin-clock/lxqtclockconfigurationtimezones.cpp similarity index 100% rename from plugin-clock/lxqtworldclockconfigurationtimezones.cpp rename to plugin-clock/lxqtclockconfigurationtimezones.cpp diff --git a/plugin-clock/lxqtworldclockconfigurationtimezones.h b/plugin-clock/lxqtclockconfigurationtimezones.h similarity index 100% rename from plugin-clock/lxqtworldclockconfigurationtimezones.h rename to plugin-clock/lxqtclockconfigurationtimezones.h diff --git a/plugin-clock/lxqtworldclockconfigurationtimezones.ui b/plugin-clock/lxqtclockconfigurationtimezones.ui similarity index 100% rename from plugin-clock/lxqtworldclockconfigurationtimezones.ui rename to plugin-clock/lxqtclockconfigurationtimezones.ui diff --git a/plugin-clock/resources/worldclock.desktop.in b/plugin-clock/resources/clock.desktop.in similarity index 70% rename from plugin-clock/resources/worldclock.desktop.in rename to plugin-clock/resources/clock.desktop.in index e957f5a10..5321bf490 100644 --- a/plugin-clock/resources/worldclock.desktop.in +++ b/plugin-clock/resources/clock.desktop.in @@ -1,8 +1,8 @@ [Desktop Entry] Type=Service ServiceTypes=LXQtPanel/Plugin -Name=World clock -Comment=World clock plugin. +Name=Clock +Comment=Clock plugin. Icon=clock #TRANSLATIONS_DIR=../translations diff --git a/plugin-clock/translations/worldclock_ar.desktop b/plugin-clock/translations/clock_ar.desktop similarity index 100% rename from plugin-clock/translations/worldclock_ar.desktop rename to plugin-clock/translations/clock_ar.desktop diff --git a/plugin-clock/translations/worldclock_da.desktop b/plugin-clock/translations/clock_da.desktop similarity index 100% rename from plugin-clock/translations/worldclock_da.desktop rename to plugin-clock/translations/clock_da.desktop diff --git a/plugin-clock/translations/worldclock_de.desktop b/plugin-clock/translations/clock_de.desktop similarity index 100% rename from plugin-clock/translations/worldclock_de.desktop rename to plugin-clock/translations/clock_de.desktop diff --git a/plugin-clock/translations/worldclock_el.desktop b/plugin-clock/translations/clock_el.desktop similarity index 100% rename from plugin-clock/translations/worldclock_el.desktop rename to plugin-clock/translations/clock_el.desktop diff --git a/plugin-clock/translations/worldclock_fr.desktop b/plugin-clock/translations/clock_fr.desktop similarity index 100% rename from plugin-clock/translations/worldclock_fr.desktop rename to plugin-clock/translations/clock_fr.desktop diff --git a/plugin-clock/translations/worldclock_hu.desktop b/plugin-clock/translations/clock_hu.desktop similarity index 100% rename from plugin-clock/translations/worldclock_hu.desktop rename to plugin-clock/translations/clock_hu.desktop diff --git a/plugin-clock/translations/worldclock_it.desktop b/plugin-clock/translations/clock_it.desktop similarity index 100% rename from plugin-clock/translations/worldclock_it.desktop rename to plugin-clock/translations/clock_it.desktop diff --git a/plugin-clock/translations/worldclock_ja.desktop b/plugin-clock/translations/clock_ja.desktop similarity index 100% rename from plugin-clock/translations/worldclock_ja.desktop rename to plugin-clock/translations/clock_ja.desktop diff --git a/plugin-clock/translations/worldclock_pt.desktop b/plugin-clock/translations/clock_pt.desktop similarity index 100% rename from plugin-clock/translations/worldclock_pt.desktop rename to plugin-clock/translations/clock_pt.desktop diff --git a/plugin-clock/translations/worldclock_ru.desktop b/plugin-clock/translations/clock_ru.desktop similarity index 100% rename from plugin-clock/translations/worldclock_ru.desktop rename to plugin-clock/translations/clock_ru.desktop From aa66b520bb8b02c47dfbc359602b7a60a0b6a5c5 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Thu, 25 May 2017 18:08:36 -0500 Subject: [PATCH 04/10] Make it buildable --- panel/plugin.cpp | 7 +----- plugin-clock/CMakeLists.txt | 24 +++++++++---------- plugin-clock/lxqtclock.cpp | 2 +- plugin-clock/lxqtclock.h | 2 +- plugin-clock/lxqtclockconfiguration.cpp | 8 +++---- .../lxqtclockconfigurationmanualformat.cpp | 4 ++-- .../lxqtclockconfigurationtimezones.cpp | 4 ++-- plugin-clock/translations/clock_ar.desktop | 2 -- plugin-clock/translations/clock_da.desktop | 12 ---------- plugin-clock/translations/clock_de.desktop | 2 -- plugin-clock/translations/clock_el.desktop | 2 -- plugin-clock/translations/clock_fr.desktop | 2 -- plugin-clock/translations/clock_hu.desktop | 3 --- plugin-clock/translations/clock_it.desktop | 3 --- plugin-clock/translations/clock_ja.desktop | 7 ------ plugin-clock/translations/clock_pt.desktop | 3 --- plugin-clock/translations/clock_ru.desktop | 7 ------ 17 files changed, 23 insertions(+), 71 deletions(-) delete mode 100644 plugin-clock/translations/clock_ar.desktop delete mode 100644 plugin-clock/translations/clock_da.desktop delete mode 100644 plugin-clock/translations/clock_de.desktop delete mode 100644 plugin-clock/translations/clock_el.desktop delete mode 100644 plugin-clock/translations/clock_fr.desktop delete mode 100644 plugin-clock/translations/clock_hu.desktop delete mode 100644 plugin-clock/translations/clock_it.desktop delete mode 100644 plugin-clock/translations/clock_ja.desktop delete mode 100644 plugin-clock/translations/clock_pt.desktop delete mode 100644 plugin-clock/translations/clock_ru.desktop diff --git a/panel/plugin.cpp b/panel/plugin.cpp index 416a87b96..6ce33ecbe 100644 --- a/panel/plugin.cpp +++ b/panel/plugin.cpp @@ -68,8 +68,6 @@ extern void * loadPluginTranslation_statusnotifier_helper; extern void * loadPluginTranslation_taskbar_helper; #include "../plugin-tray/lxqttrayplugin.h" // tray extern void * loadPluginTranslation_tray_helper; -#include "../plugin-worldclock/lxqtworldclock.h" // worldclock -extern void * loadPluginTranslation_worldclock_helper; QColor Plugin::mMoveMarkerColor= QColor(255, 0, 0, 255); @@ -195,7 +193,7 @@ namespace // 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 + std::make_tuple(QLatin1String("clock"), plugin_ptr_t{new LXQtWorldClockLibrary}, loadPluginTranslation_clock_helper),// clock #endif #if defined(WITH_DESKTOPSWITCH_PLUGIN) std::make_tuple(QLatin1String("desktopswitch"), plugin_ptr_t{new DesktopSwitchPluginLibrary}, loadPluginTranslation_desktopswitch_helper),// desktopswitch @@ -220,9 +218,6 @@ namespace #endif #if defined(WITH_TRAY_PLUGIN) std::make_tuple(QLatin1String("tray"), plugin_ptr_t{new LXQtTrayPluginLibrary}, loadPluginTranslation_tray_helper),// tray -#endif -#if defined(WITH_WORLDCLOCK_PLUGIN) - std::make_tuple(QLatin1String("worldclock"), plugin_ptr_t{new LXQtWorldClockLibrary}, loadPluginTranslation_worldclock_helper),// worldclock #endif }; static constexpr plugin_tuple_t const * const plugins_begin = static_plugins; diff --git a/plugin-clock/CMakeLists.txt b/plugin-clock/CMakeLists.txt index 90d10c234..d3ca0b3c8 100644 --- a/plugin-clock/CMakeLists.txt +++ b/plugin-clock/CMakeLists.txt @@ -1,23 +1,23 @@ -set(PLUGIN "worldclock") +set(PLUGIN "clock") set(HEADERS - lxqtworldclock.h - lxqtworldclockconfiguration.h - lxqtworldclockconfigurationtimezones.h - lxqtworldclockconfigurationmanualformat.h + lxqtclock.h + lxqtclockconfiguration.h + lxqtclockconfigurationtimezones.h + lxqtclockconfigurationmanualformat.h ) set(SOURCES - lxqtworldclock.cpp - lxqtworldclockconfiguration.cpp - lxqtworldclockconfigurationtimezones.cpp - lxqtworldclockconfigurationmanualformat.cpp + lxqtclock.cpp + lxqtclockconfiguration.cpp + lxqtclockconfigurationtimezones.cpp + lxqtclockconfigurationmanualformat.cpp ) set(UIS - lxqtworldclockconfiguration.ui - lxqtworldclockconfigurationtimezones.ui - lxqtworldclockconfigurationmanualformat.ui + lxqtclockconfiguration.ui + lxqtclockconfigurationtimezones.ui + lxqtclockconfigurationmanualformat.ui ) BUILD_LXQT_PLUGIN(${PLUGIN}) diff --git a/plugin-clock/lxqtclock.cpp b/plugin-clock/lxqtclock.cpp index 54a89e535..661b5ccae 100644 --- a/plugin-clock/lxqtclock.cpp +++ b/plugin-clock/lxqtclock.cpp @@ -26,7 +26,7 @@ * * END_COMMON_COPYRIGHT_HEADER */ -#include "lxqtworldclock.h" +#include "lxqtclock.h" #include #include diff --git a/plugin-clock/lxqtclock.h b/plugin-clock/lxqtclock.h index 8bbc4d449..729d5098a 100644 --- a/plugin-clock/lxqtclock.h +++ b/plugin-clock/lxqtclock.h @@ -37,7 +37,7 @@ #include #include "../panel/ilxqtpanelplugin.h" -#include "lxqtworldclockconfiguration.h" +#include "lxqtclockconfiguration.h" class ActiveLabel; diff --git a/plugin-clock/lxqtclockconfiguration.cpp b/plugin-clock/lxqtclockconfiguration.cpp index d0e759f5a..8b1dbea70 100644 --- a/plugin-clock/lxqtclockconfiguration.cpp +++ b/plugin-clock/lxqtclockconfiguration.cpp @@ -27,12 +27,12 @@ * END_COMMON_COPYRIGHT_HEADER */ -#include "lxqtworldclockconfiguration.h" +#include "lxqtclockconfiguration.h" -#include "ui_lxqtworldclockconfiguration.h" +#include "ui_lxqtclockconfiguration.h" -#include "lxqtworldclockconfigurationtimezones.h" -#include "lxqtworldclockconfigurationmanualformat.h" +#include "lxqtclockconfigurationtimezones.h" +#include "lxqtclockconfigurationmanualformat.h" #include diff --git a/plugin-clock/lxqtclockconfigurationmanualformat.cpp b/plugin-clock/lxqtclockconfigurationmanualformat.cpp index cc186b8c9..fffdaead3 100644 --- a/plugin-clock/lxqtclockconfigurationmanualformat.cpp +++ b/plugin-clock/lxqtclockconfigurationmanualformat.cpp @@ -29,9 +29,9 @@ #include -#include "lxqtworldclockconfigurationmanualformat.h" +#include "lxqtclockconfigurationmanualformat.h" -#include "ui_lxqtworldclockconfigurationmanualformat.h" +#include "ui_lxqtclockconfigurationmanualformat.h" LXQtWorldClockConfigurationManualFormat::LXQtWorldClockConfigurationManualFormat(QWidget *parent) : diff --git a/plugin-clock/lxqtclockconfigurationtimezones.cpp b/plugin-clock/lxqtclockconfigurationtimezones.cpp index 2674983da..fc3eb511a 100644 --- a/plugin-clock/lxqtclockconfigurationtimezones.cpp +++ b/plugin-clock/lxqtclockconfigurationtimezones.cpp @@ -29,9 +29,9 @@ #include -#include "lxqtworldclockconfigurationtimezones.h" +#include "lxqtclockconfigurationtimezones.h" -#include "ui_lxqtworldclockconfigurationtimezones.h" +#include "ui_lxqtclockconfigurationtimezones.h" LXQtWorldClockConfigurationTimeZones::LXQtWorldClockConfigurationTimeZones(QWidget *parent) : diff --git a/plugin-clock/translations/clock_ar.desktop b/plugin-clock/translations/clock_ar.desktop deleted file mode 100644 index 9e3a92052..000000000 --- a/plugin-clock/translations/clock_ar.desktop +++ /dev/null @@ -1,2 +0,0 @@ -Name[ar]=ساعة العالم -Comment[ar]=ملحقة لساعة العالم. diff --git a/plugin-clock/translations/clock_da.desktop b/plugin-clock/translations/clock_da.desktop deleted file mode 100644 index 80b6c81dc..000000000 --- a/plugin-clock/translations/clock_da.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LXQtPanel/Plugin -Name=World clock -Comment=World clock plugin. -Icon=clock - -#TRANSLATIONS_DIR=../translations - -# Translations -Name[da]=Verdensur -Comment[da]=Verdensur-plugin. \ No newline at end of file diff --git a/plugin-clock/translations/clock_de.desktop b/plugin-clock/translations/clock_de.desktop deleted file mode 100644 index c4e8a1b22..000000000 --- a/plugin-clock/translations/clock_de.desktop +++ /dev/null @@ -1,2 +0,0 @@ -Name[de]=Weltzeituhr -Comment[de]=Weltzeituhr diff --git a/plugin-clock/translations/clock_el.desktop b/plugin-clock/translations/clock_el.desktop deleted file mode 100644 index 05e992bf5..000000000 --- a/plugin-clock/translations/clock_el.desktop +++ /dev/null @@ -1,2 +0,0 @@ -Name[el]=Παγκόσμιο ρολόι -Comment[el]=Πρόσθετο παγκόσμιου ρολογιού diff --git a/plugin-clock/translations/clock_fr.desktop b/plugin-clock/translations/clock_fr.desktop deleted file mode 100644 index a01b50e5b..000000000 --- a/plugin-clock/translations/clock_fr.desktop +++ /dev/null @@ -1,2 +0,0 @@ -Name[fr]=Horloge universelle -Comment[fr]=Horloge universelle diff --git a/plugin-clock/translations/clock_hu.desktop b/plugin-clock/translations/clock_hu.desktop deleted file mode 100644 index 36fd874c9..000000000 --- a/plugin-clock/translations/clock_hu.desktop +++ /dev/null @@ -1,3 +0,0 @@ -#TRANSLATIONS -Name[hu]=Világóra -Comment[hu]=Világóra bővítmény diff --git a/plugin-clock/translations/clock_it.desktop b/plugin-clock/translations/clock_it.desktop deleted file mode 100644 index 21570f42f..000000000 --- a/plugin-clock/translations/clock_it.desktop +++ /dev/null @@ -1,3 +0,0 @@ -#TRANSLATIONS -Name[it]=Orologio mondiale -Comment[it]=Mostra un orologio con un fuso orario diverso diff --git a/plugin-clock/translations/clock_ja.desktop b/plugin-clock/translations/clock_ja.desktop deleted file mode 100644 index a1b09d74a..000000000 --- a/plugin-clock/translations/clock_ja.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LXQtPanel/Plugin -Name[ja]=世界時計 -Comment[ja]=世界時計のウィジェットです - -#TRANSLATIONS_DIR=../translations diff --git a/plugin-clock/translations/clock_pt.desktop b/plugin-clock/translations/clock_pt.desktop deleted file mode 100644 index de26cace3..000000000 --- a/plugin-clock/translations/clock_pt.desktop +++ /dev/null @@ -1,3 +0,0 @@ -#TRANSLATIONS -Name[pt]=Relógio mundial -Comment[pt]=Extra para mostrar um relógio mundial diff --git a/plugin-clock/translations/clock_ru.desktop b/plugin-clock/translations/clock_ru.desktop deleted file mode 100644 index 901f660d8..000000000 --- a/plugin-clock/translations/clock_ru.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Type=Service -ServiceTypes=LXQtPanel/Plugin -Name[ru]=Мировое время -Comment[ru]=Плагин мирового времени. - -#TRANSLATIONS_DIR=../translations From eaf7d2bdcdf6aeace65759227e219f8e2ec46dc3 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Thu, 25 May 2017 18:14:04 -0500 Subject: [PATCH 05/10] Complete rebranding --- panel/plugin.cpp | 2 +- plugin-clock/lxqtclock.cpp | 42 ++++++++-------- plugin-clock/lxqtclock.h | 18 +++---- plugin-clock/lxqtclockconfiguration.cpp | 48 +++++++++---------- plugin-clock/lxqtclockconfiguration.h | 18 +++---- plugin-clock/lxqtclockconfiguration.ui | 8 ++-- .../lxqtclockconfigurationmanualformat.cpp | 10 ++-- .../lxqtclockconfigurationmanualformat.h | 10 ++-- .../lxqtclockconfigurationmanualformat.ui | 8 ++-- .../lxqtclockconfigurationtimezones.cpp | 16 +++---- .../lxqtclockconfigurationtimezones.h | 10 ++-- .../lxqtclockconfigurationtimezones.ui | 8 ++-- plugin-clock/translations | 1 + 13 files changed, 100 insertions(+), 99 deletions(-) create mode 160000 plugin-clock/translations diff --git a/panel/plugin.cpp b/panel/plugin.cpp index 6ce33ecbe..2ced521b5 100644 --- a/panel/plugin.cpp +++ b/panel/plugin.cpp @@ -193,7 +193,7 @@ namespace // 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 LXQtWorldClockLibrary}, loadPluginTranslation_clock_helper),// clock + std::make_tuple(QLatin1String("clock"), plugin_ptr_t{new LXQtClockLibrary}, loadPluginTranslation_clock_helper),// clock #endif #if defined(WITH_DESKTOPSWITCH_PLUGIN) std::make_tuple(QLatin1String("desktopswitch"), plugin_ptr_t{new DesktopSwitchPluginLibrary}, loadPluginTranslation_desktopswitch_helper),// desktopswitch diff --git a/plugin-clock/lxqtclock.cpp b/plugin-clock/lxqtclock.cpp index 661b5ccae..f59138d9a 100644 --- a/plugin-clock/lxqtclock.cpp +++ b/plugin-clock/lxqtclock.cpp @@ -40,7 +40,7 @@ #include -LXQtWorldClock::LXQtWorldClock(const ILXQtPanelPluginStartupInfo &startupInfo): +LXQtClock::LXQtClock(const ILXQtPanelPluginStartupInfo &startupInfo): QObject(), ILXQtPanelPlugin(startupInfo), mPopup(NULL), @@ -72,19 +72,19 @@ LXQtWorldClock::LXQtWorldClock(const ILXQtPanelPluginStartupInfo &startupInfo): connect(mContent, SIGNAL(wheelScrolled(int)), SLOT(wheelScrolled(int))); } -LXQtWorldClock::~LXQtWorldClock() +LXQtClock::~LXQtClock() { delete mMainWidget; } -void LXQtWorldClock::timeout() +void LXQtClock::timeout() { if (QDateTime{}.time().msec() > 500) restartTimer(); setTimeText(); } -void LXQtWorldClock::setTimeText() +void LXQtClock::setTimeText() { QDateTime now = QDateTime::currentDateTime(); QString timeZoneName = mActiveTimeZone; @@ -100,17 +100,17 @@ void LXQtWorldClock::setTimeText() } } -void LXQtWorldClock::restartTimer() +void LXQtClock::restartTimer() { mTimer->stop(); mTimer->setInterval(mUpdateInterval); int delay = static_cast((mUpdateInterval - (static_cast(QTime::currentTime().msecsSinceStartOfDay()) % mUpdateInterval)) % mUpdateInterval); - QTimer::singleShot(delay, Qt::PreciseTimer, this, &LXQtWorldClock::setTimeText); + QTimer::singleShot(delay, Qt::PreciseTimer, this, &LXQtClock::setTimeText); QTimer::singleShot(delay, Qt::PreciseTimer, mTimer, SLOT(start())); } -void LXQtWorldClock::settingsChanged() +void LXQtClock::settingsChanged() { PluginSettings *_settings = settings(); @@ -306,12 +306,12 @@ void LXQtWorldClock::settingsChanged() setTimeText(); } -QDialog *LXQtWorldClock::configureDialog() +QDialog *LXQtClock::configureDialog() { - return new LXQtWorldClockConfiguration(settings()); + return new LXQtClockConfiguration(settings()); } -void LXQtWorldClock::wheelScrolled(int delta) +void LXQtClock::wheelScrolled(int delta) { if (mTimeZones.count() > 1) { @@ -320,7 +320,7 @@ void LXQtWorldClock::wheelScrolled(int delta) } } -void LXQtWorldClock::activated(ActivationReason reason) +void LXQtClock::activated(ActivationReason reason) { switch (reason) { @@ -334,7 +334,7 @@ void LXQtWorldClock::activated(ActivationReason reason) if (!mPopup) { - mPopup = new LXQtWorldClockPopup(mContent); + mPopup = new LXQtClockPopup(mContent); connect(mPopup, SIGNAL(deactivated()), SLOT(deletePopup())); if (reason == ILXQtPanelPlugin::Trigger) @@ -376,21 +376,21 @@ void LXQtWorldClock::activated(ActivationReason reason) } } -void LXQtWorldClock::deletePopup() +void LXQtClock::deletePopup() { mPopupContent = NULL; mPopup->deleteLater(); mPopup = NULL; } -QString LXQtWorldClock::formatDateTime(const QDateTime &datetime, const QString &timeZoneName) +QString LXQtClock::formatDateTime(const QDateTime &datetime, const QString &timeZoneName) { QTimeZone timeZone(timeZoneName.toLatin1()); QDateTime tzNow = datetime.toTimeZone(timeZone); return tzNow.toString(preformat(mFormat, timeZone, tzNow)); } -void LXQtWorldClock::updatePopupContent() +void LXQtClock::updatePopupContent() { if (mPopupContent) { @@ -415,13 +415,13 @@ void LXQtWorldClock::updatePopupContent() } } -bool LXQtWorldClock::formatHasTimeZone(QString format) +bool LXQtClock::formatHasTimeZone(QString format) { format.replace(QRegExp(QLatin1String("'[^']*'")), QString()); return format.toLower().contains(QLatin1String("t")); } -QString LXQtWorldClock::preformat(const QString &format, const QTimeZone &timeZone, const QDateTime &dateTime) +QString LXQtClock::preformat(const QString &format, const QTimeZone &timeZone, const QDateTime &dateTime) { QString result = format; int from = 0; @@ -501,7 +501,7 @@ QString LXQtWorldClock::preformat(const QString &format, const QTimeZone &timeZo return result; } -void LXQtWorldClock::realign() +void LXQtClock::realign() { if (mAutoRotate) switch (panel()->position()) @@ -553,20 +553,20 @@ void ActiveLabel::mouseReleaseEvent(QMouseEvent* event) QLabel::mouseReleaseEvent(event); } -LXQtWorldClockPopup::LXQtWorldClockPopup(QWidget *parent) : +LXQtClockPopup::LXQtClockPopup(QWidget *parent) : QDialog(parent, Qt::Window | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint | Qt::Popup | Qt::X11BypassWindowManagerHint) { setLayout(new QHBoxLayout(this)); layout()->setMargin(1); } -void LXQtWorldClockPopup::show() +void LXQtClockPopup::show() { QDialog::show(); activateWindow(); } -bool LXQtWorldClockPopup::event(QEvent *event) +bool LXQtClockPopup::event(QEvent *event) { if (event->type() == QEvent::Close) emit deactivated(); diff --git a/plugin-clock/lxqtclock.h b/plugin-clock/lxqtclock.h index 729d5098a..ae940cd5e 100644 --- a/plugin-clock/lxqtclock.h +++ b/plugin-clock/lxqtclock.h @@ -42,15 +42,15 @@ class ActiveLabel; class QTimer; -class LXQtWorldClockPopup; +class LXQtClockPopup; -class LXQtWorldClock : public QObject, public ILXQtPanelPlugin +class LXQtClock : public QObject, public ILXQtPanelPlugin { Q_OBJECT public: - LXQtWorldClock(const ILXQtPanelPluginStartupInfo &startupInfo); - ~LXQtWorldClock(); + LXQtClock(const ILXQtPanelPluginStartupInfo &startupInfo); + ~LXQtClock(); virtual QWidget *widget() { return mMainWidget; } virtual QString themeId() const { return QLatin1String("WorldClock"); } @@ -72,7 +72,7 @@ private slots: QWidget *mMainWidget; LXQt::RotatedWidget* mRotatedWidget; ActiveLabel *mContent; - LXQtWorldClockPopup* mPopup; + LXQtClockPopup* mPopup; QTimer *mTimer; int mUpdateInterval; @@ -112,12 +112,12 @@ Q_OBJECT void mouseReleaseEvent(QMouseEvent* event); }; -class LXQtWorldClockPopup : public QDialog +class LXQtClockPopup : public QDialog { Q_OBJECT public: - LXQtWorldClockPopup(QWidget *parent = 0); + LXQtClockPopup(QWidget *parent = 0); void show(); @@ -129,7 +129,7 @@ class LXQtWorldClockPopup : public QDialog }; -class LXQtWorldClockLibrary: public QObject, public ILXQtPanelPluginLibrary +class LXQtClockLibrary: public QObject, public ILXQtPanelPluginLibrary { Q_OBJECT Q_PLUGIN_METADATA(IID "lxde-qt.org/Panel/PluginInterface/3.0") @@ -137,7 +137,7 @@ class LXQtWorldClockLibrary: public QObject, public ILXQtPanelPluginLibrary public: ILXQtPanelPlugin *instance(const ILXQtPanelPluginStartupInfo &startupInfo) const { - return new LXQtWorldClock(startupInfo); + return new LXQtClock(startupInfo); } }; diff --git a/plugin-clock/lxqtclockconfiguration.cpp b/plugin-clock/lxqtclockconfiguration.cpp index 8b1dbea70..0bc284340 100644 --- a/plugin-clock/lxqtclockconfiguration.cpp +++ b/plugin-clock/lxqtclockconfiguration.cpp @@ -37,9 +37,9 @@ #include -LXQtWorldClockConfiguration::LXQtWorldClockConfiguration(PluginSettings *settings, QWidget *parent) : +LXQtClockConfiguration::LXQtClockConfiguration(PluginSettings *settings, QWidget *parent) : LXQtPanelPluginConfigDialog(settings, parent), - ui(new Ui::LXQtWorldClockConfiguration), + ui(new Ui::LXQtClockConfiguration), mLockCascadeSettingChanges(false), mConfigurationTimeZones(nullptr), mConfigurationManualFormat(nullptr) @@ -86,12 +86,12 @@ LXQtWorldClockConfiguration::LXQtWorldClockConfiguration(PluginSettings *setting loadSettings(); } -LXQtWorldClockConfiguration::~LXQtWorldClockConfiguration() +LXQtClockConfiguration::~LXQtClockConfiguration() { delete ui; } -void LXQtWorldClockConfiguration::loadSettings() +void LXQtClockConfiguration::loadSettings() { mLockCascadeSettingChanges = true; @@ -235,7 +235,7 @@ void LXQtWorldClockConfiguration::loadSettings() mLockCascadeSettingChanges = false; } -void LXQtWorldClockConfiguration::saveSettings() +void LXQtClockConfiguration::saveSettings() { if (mLockCascadeSettingChanges) return; @@ -377,7 +377,7 @@ void LXQtWorldClockConfiguration::saveSettings() settings().setValue(QLatin1String("autoRotate"), ui->autorotateCB->isChecked()); } -void LXQtWorldClockConfiguration::timeFormatChanged(int index) +void LXQtClockConfiguration::timeFormatChanged(int index) { bool longTimeFormatSelected = index == 1; bool customTimeFormatSelected = index == 2; @@ -385,20 +385,20 @@ void LXQtWorldClockConfiguration::timeFormatChanged(int index) ui->timezoneGB->setEnabled(!longTimeFormatSelected); } -void LXQtWorldClockConfiguration::dateGroupToggled(bool dateIsChecked) +void LXQtClockConfiguration::dateGroupToggled(bool dateIsChecked) { bool customDateFormatSelected = ui->dateFormatCB->currentIndex() == ui->dateFormatCB->count() - 1; ui->dateCustomW->setEnabled(dateIsChecked && customDateFormatSelected); } -void LXQtWorldClockConfiguration::dateFormatChanged(int index) +void LXQtClockConfiguration::dateFormatChanged(int index) { bool customDateFormatSelected = index == ui->dateFormatCB->count() - 1; bool dateIsChecked = ui->dateGB->isChecked(); ui->dateCustomW->setEnabled(dateIsChecked && customDateFormatSelected); } -void LXQtWorldClockConfiguration::advancedFormatToggled(bool on) +void LXQtClockConfiguration::advancedFormatToggled(bool on) { bool longTimeFormatSelected = ui->timeFormatCB->currentIndex() == 1; ui->timeGB->setEnabled(!on); @@ -406,11 +406,11 @@ void LXQtWorldClockConfiguration::advancedFormatToggled(bool on) ui->dateGB->setEnabled(!on); } -void LXQtWorldClockConfiguration::customiseManualFormatClicked() +void LXQtClockConfiguration::customiseManualFormatClicked() { if (!mConfigurationManualFormat) { - mConfigurationManualFormat = new LXQtWorldClockConfigurationManualFormat(this); + mConfigurationManualFormat = new LXQtClockConfigurationManualFormat(this); connect(mConfigurationManualFormat, SIGNAL(manualFormatChanged()), this, SLOT(manualFormatChanged())); } @@ -423,13 +423,13 @@ void LXQtWorldClockConfiguration::customiseManualFormatClicked() saveSettings(); } -void LXQtWorldClockConfiguration::manualFormatChanged() +void LXQtClockConfiguration::manualFormatChanged() { mManualFormat = mConfigurationManualFormat->manualFormat(); saveSettings(); } -void LXQtWorldClockConfiguration::updateTimeZoneButtons() +void LXQtClockConfiguration::updateTimeZoneButtons() { QList selectedItems = ui->timeZonesTW->selectedItems(); int selectedCount = selectedItems.count() / 2; @@ -485,7 +485,7 @@ void LXQtWorldClockConfiguration::updateTimeZoneButtons() ui->moveDownPB->setEnabled(canMoveDown); } -int LXQtWorldClockConfiguration::findTimeZone(const QString& timeZone) +int LXQtClockConfiguration::findTimeZone(const QString& timeZone) { QList items = ui->timeZonesTW->findItems(timeZone, Qt::MatchExactly); foreach (QTableWidgetItem* item, items) @@ -494,10 +494,10 @@ int LXQtWorldClockConfiguration::findTimeZone(const QString& timeZone) return -1; } -void LXQtWorldClockConfiguration::addTimeZone() +void LXQtClockConfiguration::addTimeZone() { if (!mConfigurationTimeZones) - mConfigurationTimeZones = new LXQtWorldClockConfigurationTimeZones(this); + mConfigurationTimeZones = new LXQtClockConfigurationTimeZones(this); if (mConfigurationTimeZones->updateAndExec() == QDialog::Accepted) { @@ -520,7 +520,7 @@ void LXQtWorldClockConfiguration::addTimeZone() saveSettings(); } -void LXQtWorldClockConfiguration::removeTimeZone() +void LXQtClockConfiguration::removeTimeZone() { foreach (QTableWidgetItem *item, ui->timeZonesTW->selectedItems()) if (item->column() == 0) @@ -536,7 +536,7 @@ void LXQtWorldClockConfiguration::removeTimeZone() saveSettings(); } -void LXQtWorldClockConfiguration::setBold(QTableWidgetItem *item, bool value) +void LXQtClockConfiguration::setBold(QTableWidgetItem *item, bool value) { if (item) { @@ -546,19 +546,19 @@ void LXQtWorldClockConfiguration::setBold(QTableWidgetItem *item, bool value) } } -void LXQtWorldClockConfiguration::setBold(int row, bool value) +void LXQtClockConfiguration::setBold(int row, bool value) { setBold(ui->timeZonesTW->item(row, 0), value); setBold(ui->timeZonesTW->item(row, 1), value); } -void LXQtWorldClockConfiguration::setDefault(int row) +void LXQtClockConfiguration::setDefault(int row) { setBold(row, true); mDefaultTimeZone = ui->timeZonesTW->item(row, 0)->text(); } -void LXQtWorldClockConfiguration::setTimeZoneAsDefault() +void LXQtClockConfiguration::setTimeZoneAsDefault() { setBold(findTimeZone(mDefaultTimeZone), false); @@ -567,7 +567,7 @@ void LXQtWorldClockConfiguration::setTimeZoneAsDefault() saveSettings(); } -void LXQtWorldClockConfiguration::editTimeZoneCustomName() +void LXQtClockConfiguration::editTimeZoneCustomName() { int row = ui->timeZonesTW->selectedItems()[0]->row(); @@ -586,7 +586,7 @@ void LXQtWorldClockConfiguration::editTimeZoneCustomName() } } -void LXQtWorldClockConfiguration::moveTimeZoneUp() +void LXQtClockConfiguration::moveTimeZoneUp() { int m = ui->timeZonesTW->rowCount(); bool skipTop = true; @@ -619,7 +619,7 @@ void LXQtWorldClockConfiguration::moveTimeZoneUp() saveSettings(); } -void LXQtWorldClockConfiguration::moveTimeZoneDown() +void LXQtClockConfiguration::moveTimeZoneDown() { int m = ui->timeZonesTW->rowCount(); bool skipBottom = true; diff --git a/plugin-clock/lxqtclockconfiguration.h b/plugin-clock/lxqtclockconfiguration.h index 438cb393b..14e529c3b 100644 --- a/plugin-clock/lxqtclockconfiguration.h +++ b/plugin-clock/lxqtclockconfiguration.h @@ -36,26 +36,26 @@ #include namespace Ui { - class LXQtWorldClockConfiguration; + class LXQtClockConfiguration; } -class LXQtWorldClockConfigurationTimeZones; -class LXQtWorldClockConfigurationManualFormat; +class LXQtClockConfigurationTimeZones; +class LXQtClockConfigurationManualFormat; class QTableWidgetItem; -class LXQtWorldClockConfiguration : public LXQtPanelPluginConfigDialog +class LXQtClockConfiguration : public LXQtPanelPluginConfigDialog { Q_OBJECT public: - explicit LXQtWorldClockConfiguration(PluginSettings *settings, QWidget *parent = nullptr); - ~LXQtWorldClockConfiguration(); + explicit LXQtClockConfiguration(PluginSettings *settings, QWidget *parent = nullptr); + ~LXQtClockConfiguration(); public slots: void saveSettings(); private: - Ui::LXQtWorldClockConfiguration *ui; + Ui::LXQtClockConfiguration *ui; /* Read settings from conf file and put data into controls. @@ -83,8 +83,8 @@ private slots: bool mLockCascadeSettingChanges; - LXQtWorldClockConfigurationTimeZones *mConfigurationTimeZones; - LXQtWorldClockConfigurationManualFormat *mConfigurationManualFormat; + LXQtClockConfigurationTimeZones *mConfigurationTimeZones; + LXQtClockConfigurationManualFormat *mConfigurationManualFormat; QString mManualFormat; diff --git a/plugin-clock/lxqtclockconfiguration.ui b/plugin-clock/lxqtclockconfiguration.ui index 3ee08fdf2..678212b84 100644 --- a/plugin-clock/lxqtclockconfiguration.ui +++ b/plugin-clock/lxqtclockconfiguration.ui @@ -1,7 +1,7 @@ - LXQtWorldClockConfiguration - + LXQtClockConfiguration + 0 @@ -591,7 +591,7 @@ buttons accepted() - LXQtWorldClockConfiguration + LXQtClockConfiguration accept() @@ -607,7 +607,7 @@ buttons rejected() - LXQtWorldClockConfiguration + LXQtClockConfiguration reject() diff --git a/plugin-clock/lxqtclockconfigurationmanualformat.cpp b/plugin-clock/lxqtclockconfigurationmanualformat.cpp index fffdaead3..fa55b53a8 100644 --- a/plugin-clock/lxqtclockconfigurationmanualformat.cpp +++ b/plugin-clock/lxqtclockconfigurationmanualformat.cpp @@ -34,9 +34,9 @@ #include "ui_lxqtclockconfigurationmanualformat.h" -LXQtWorldClockConfigurationManualFormat::LXQtWorldClockConfigurationManualFormat(QWidget *parent) : +LXQtClockConfigurationManualFormat::LXQtClockConfigurationManualFormat(QWidget *parent) : QDialog(parent), - ui(new Ui::LXQtWorldClockConfigurationManualFormat) + ui(new Ui::LXQtClockConfigurationManualFormat) { setObjectName("WorldClockConfigurationManualFormatWindow"); setWindowModality(Qt::WindowModal); @@ -45,17 +45,17 @@ LXQtWorldClockConfigurationManualFormat::LXQtWorldClockConfigurationManualFormat connect(ui->manualFormatPTE, SIGNAL(textChanged()), this, SIGNAL(manualFormatChanged())); } -LXQtWorldClockConfigurationManualFormat::~LXQtWorldClockConfigurationManualFormat() +LXQtClockConfigurationManualFormat::~LXQtClockConfigurationManualFormat() { delete ui; } -void LXQtWorldClockConfigurationManualFormat::setManualFormat(const QString& text) +void LXQtClockConfigurationManualFormat::setManualFormat(const QString& text) { ui->manualFormatPTE->setPlainText(text); } -QString LXQtWorldClockConfigurationManualFormat::manualFormat() const +QString LXQtClockConfigurationManualFormat::manualFormat() const { return ui->manualFormatPTE->toPlainText(); } diff --git a/plugin-clock/lxqtclockconfigurationmanualformat.h b/plugin-clock/lxqtclockconfigurationmanualformat.h index bcfd545e6..49e9114af 100644 --- a/plugin-clock/lxqtclockconfigurationmanualformat.h +++ b/plugin-clock/lxqtclockconfigurationmanualformat.h @@ -35,18 +35,18 @@ namespace Ui { - class LXQtWorldClockConfigurationManualFormat; + class LXQtClockConfigurationManualFormat; } class QTreeWidgetItem; -class LXQtWorldClockConfigurationManualFormat : public QDialog +class LXQtClockConfigurationManualFormat : public QDialog { Q_OBJECT public: - explicit LXQtWorldClockConfigurationManualFormat(QWidget *parent = NULL); - ~LXQtWorldClockConfigurationManualFormat(); + explicit LXQtClockConfigurationManualFormat(QWidget *parent = NULL); + ~LXQtClockConfigurationManualFormat(); void setManualFormat(const QString&); @@ -56,7 +56,7 @@ class LXQtWorldClockConfigurationManualFormat : public QDialog void manualFormatChanged(); private: - Ui::LXQtWorldClockConfigurationManualFormat *ui; + Ui::LXQtClockConfigurationManualFormat *ui; }; #endif // LXQT_PANEL_WORLDCLOCK_CONFIGURATION_MANUAL_FORMAT_H diff --git a/plugin-clock/lxqtclockconfigurationmanualformat.ui b/plugin-clock/lxqtclockconfigurationmanualformat.ui index 103be21af..191050eab 100644 --- a/plugin-clock/lxqtclockconfigurationmanualformat.ui +++ b/plugin-clock/lxqtclockconfigurationmanualformat.ui @@ -1,7 +1,7 @@ - LXQtWorldClockConfigurationManualFormat - + LXQtClockConfigurationManualFormat + 0 @@ -150,7 +150,7 @@ buttons accepted() - LXQtWorldClockConfigurationManualFormat + LXQtClockConfigurationManualFormat accept() @@ -166,7 +166,7 @@ buttons rejected() - LXQtWorldClockConfigurationManualFormat + LXQtClockConfigurationManualFormat reject() diff --git a/plugin-clock/lxqtclockconfigurationtimezones.cpp b/plugin-clock/lxqtclockconfigurationtimezones.cpp index fc3eb511a..8bc042bab 100644 --- a/plugin-clock/lxqtclockconfigurationtimezones.cpp +++ b/plugin-clock/lxqtclockconfigurationtimezones.cpp @@ -34,9 +34,9 @@ #include "ui_lxqtclockconfigurationtimezones.h" -LXQtWorldClockConfigurationTimeZones::LXQtWorldClockConfigurationTimeZones(QWidget *parent) : +LXQtClockConfigurationTimeZones::LXQtClockConfigurationTimeZones(QWidget *parent) : QDialog(parent), - ui(new Ui::LXQtWorldClockConfigurationTimeZones) + ui(new Ui::LXQtClockConfigurationTimeZones) { setObjectName("WorldClockConfigurationTimeZonesWindow"); setWindowModality(Qt::WindowModal); @@ -46,17 +46,17 @@ LXQtWorldClockConfigurationTimeZones::LXQtWorldClockConfigurationTimeZones(QWidg connect(ui->timeZonesTW, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), SLOT(itemDoubleClicked(QTreeWidgetItem*,int))); } -LXQtWorldClockConfigurationTimeZones::~LXQtWorldClockConfigurationTimeZones() +LXQtClockConfigurationTimeZones::~LXQtClockConfigurationTimeZones() { delete ui; } -QString LXQtWorldClockConfigurationTimeZones::timeZone() +QString LXQtClockConfigurationTimeZones::timeZone() { return mTimeZone; } -void LXQtWorldClockConfigurationTimeZones::itemSelectionChanged() +void LXQtClockConfigurationTimeZones::itemSelectionChanged() { QList items = ui->timeZonesTW->selectedItems(); if (!items.empty()) @@ -65,13 +65,13 @@ void LXQtWorldClockConfigurationTimeZones::itemSelectionChanged() mTimeZone.clear(); } -void LXQtWorldClockConfigurationTimeZones::itemDoubleClicked(QTreeWidgetItem* /*item*/, int /*column*/) +void LXQtClockConfigurationTimeZones::itemDoubleClicked(QTreeWidgetItem* /*item*/, int /*column*/) { if (!mTimeZone.isEmpty()) accept(); } -QTreeWidgetItem* LXQtWorldClockConfigurationTimeZones::makeSureParentsExist(const QStringList &parts, QMap &parentItems) +QTreeWidgetItem* LXQtClockConfigurationTimeZones::makeSureParentsExist(const QStringList &parts, QMap &parentItems) { if (parts.length() == 1) return 0; @@ -98,7 +98,7 @@ QTreeWidgetItem* LXQtWorldClockConfigurationTimeZones::makeSureParentsExist(cons return newItem; } -int LXQtWorldClockConfigurationTimeZones::updateAndExec() +int LXQtClockConfigurationTimeZones::updateAndExec() { QDateTime now = QDateTime::currentDateTime(); diff --git a/plugin-clock/lxqtclockconfigurationtimezones.h b/plugin-clock/lxqtclockconfigurationtimezones.h index cb5150c96..73167f8a3 100644 --- a/plugin-clock/lxqtclockconfigurationtimezones.h +++ b/plugin-clock/lxqtclockconfigurationtimezones.h @@ -35,18 +35,18 @@ namespace Ui { - class LXQtWorldClockConfigurationTimeZones; + class LXQtClockConfigurationTimeZones; } class QTreeWidgetItem; -class LXQtWorldClockConfigurationTimeZones : public QDialog +class LXQtClockConfigurationTimeZones : public QDialog { Q_OBJECT public: - explicit LXQtWorldClockConfigurationTimeZones(QWidget *parent = NULL); - ~LXQtWorldClockConfigurationTimeZones(); + explicit LXQtClockConfigurationTimeZones(QWidget *parent = NULL); + ~LXQtClockConfigurationTimeZones(); int updateAndExec(); @@ -57,7 +57,7 @@ public slots: void itemDoubleClicked(QTreeWidgetItem*,int); private: - Ui::LXQtWorldClockConfigurationTimeZones *ui; + Ui::LXQtClockConfigurationTimeZones *ui; QString mTimeZone; diff --git a/plugin-clock/lxqtclockconfigurationtimezones.ui b/plugin-clock/lxqtclockconfigurationtimezones.ui index b823921a5..4358d51be 100644 --- a/plugin-clock/lxqtclockconfigurationtimezones.ui +++ b/plugin-clock/lxqtclockconfigurationtimezones.ui @@ -1,7 +1,7 @@ - LXQtWorldClockConfigurationTimeZones - + LXQtClockConfigurationTimeZones + 0 @@ -71,7 +71,7 @@ buttons accepted() - LXQtWorldClockConfigurationTimeZones + LXQtClockConfigurationTimeZones accept() @@ -87,7 +87,7 @@ buttons rejected() - LXQtWorldClockConfigurationTimeZones + LXQtClockConfigurationTimeZones reject() diff --git a/plugin-clock/translations b/plugin-clock/translations new file mode 160000 index 000000000..66c121270 --- /dev/null +++ b/plugin-clock/translations @@ -0,0 +1 @@ +Subproject commit 66c121270124c17e1ce9dbe9cdb463c824a81487 From a8f353507c01eec85a6bdbc59620d0db670c84f6 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Fri, 26 May 2017 20:49:43 -0500 Subject: [PATCH 06/10] Whoops, forgot some final spots in the header where I needed to rename from worldclock --- plugin-clock/lxqtclock.h | 6 +++--- plugin-clock/lxqtclockconfiguration.h | 6 +++--- plugin-clock/lxqtclockconfigurationmanualformat.h | 6 +++--- plugin-clock/lxqtclockconfigurationtimezones.h | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/plugin-clock/lxqtclock.h b/plugin-clock/lxqtclock.h index ae940cd5e..2aa669295 100644 --- a/plugin-clock/lxqtclock.h +++ b/plugin-clock/lxqtclock.h @@ -26,8 +26,8 @@ * * END_COMMON_COPYRIGHT_HEADER */ -#ifndef LXQT_PANEL_WORLDCLOCK_H -#define LXQT_PANEL_WORLDCLOCK_H +#ifndef LXQT_PANEL_CLOCK_H +#define LXQT_PANEL_CLOCK_H #include @@ -141,4 +141,4 @@ class LXQtClockLibrary: public QObject, public ILXQtPanelPluginLibrary } }; -#endif // LXQT_PANEL_WORLDCLOCK_H +#endif // LXQT_PANEL_CLOCK_H diff --git a/plugin-clock/lxqtclockconfiguration.h b/plugin-clock/lxqtclockconfiguration.h index 14e529c3b..94204d268 100644 --- a/plugin-clock/lxqtclockconfiguration.h +++ b/plugin-clock/lxqtclockconfiguration.h @@ -26,8 +26,8 @@ * END_COMMON_COPYRIGHT_HEADER */ -#ifndef LXQT_PANEL_WORLDCLOCK_CONFIGURATION_H -#define LXQT_PANEL_WORLDCLOCK_CONFIGURATION_H +#ifndef LXQT_PANEL_CLOCK_CONFIGURATION_H +#define LXQT_PANEL_CLOCK_CONFIGURATION_H #include "../panel/lxqtpanelpluginconfigdialog.h" #include "../panel/pluginsettings.h" @@ -94,4 +94,4 @@ private slots: int findTimeZone(const QString& timeZone); }; -#endif // LXQT_PANEL_WORLDCLOCK_CONFIGURATION_H +#endif // LXQT_PANEL_CLOCK_CONFIGURATION_H diff --git a/plugin-clock/lxqtclockconfigurationmanualformat.h b/plugin-clock/lxqtclockconfigurationmanualformat.h index 49e9114af..e29e3d9f2 100644 --- a/plugin-clock/lxqtclockconfigurationmanualformat.h +++ b/plugin-clock/lxqtclockconfigurationmanualformat.h @@ -27,8 +27,8 @@ * END_COMMON_COPYRIGHT_HEADER */ -#ifndef LXQT_PANEL_WORLDCLOCK_CONFIGURATION_MANUAL_FORMAT_H -#define LXQT_PANEL_WORLDCLOCK_CONFIGURATION_MANUAL_FORMAT_H +#ifndef LXQT_PANEL_CLOCK_CONFIGURATION_MANUAL_FORMAT_H +#define LXQT_PANEL_CLOCK_CONFIGURATION_MANUAL_FORMAT_H #include #include @@ -59,4 +59,4 @@ class LXQtClockConfigurationManualFormat : public QDialog Ui::LXQtClockConfigurationManualFormat *ui; }; -#endif // LXQT_PANEL_WORLDCLOCK_CONFIGURATION_MANUAL_FORMAT_H +#endif // LXQT_PANEL_CLOCK_CONFIGURATION_MANUAL_FORMAT_H diff --git a/plugin-clock/lxqtclockconfigurationtimezones.h b/plugin-clock/lxqtclockconfigurationtimezones.h index 73167f8a3..75a2ea2a0 100644 --- a/plugin-clock/lxqtclockconfigurationtimezones.h +++ b/plugin-clock/lxqtclockconfigurationtimezones.h @@ -27,8 +27,8 @@ * END_COMMON_COPYRIGHT_HEADER */ -#ifndef LXQT_PANEL_WORLDCLOCK_CONFIGURATION_TIMEZONES_H -#define LXQT_PANEL_WORLDCLOCK_CONFIGURATION_TIMEZONES_H +#ifndef LXQT_PANEL_CLOCK_CONFIGURATION_TIMEZONES_H +#define LXQT_PANEL_CLOCK_CONFIGURATION_TIMEZONES_H #include #include @@ -64,4 +64,4 @@ public slots: QTreeWidgetItem* makeSureParentsExist(const QStringList &parts, QMap &parentItems); }; -#endif // LXQT_PANEL_WORLDCLOCK_CONFIGURATION_TIMEZONES_H +#endif // LXQT_PANEL_CLOCK_CONFIGURATION_TIMEZONES_H From ad3eabf81da048146292788f402f114e72d98ca3 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Fri, 26 May 2017 21:34:54 -0500 Subject: [PATCH 07/10] Add hover text to match the original clock plugin --- plugin-clock/lxqtclock.cpp | 15 +++++++++++++++ plugin-clock/lxqtclock.h | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/plugin-clock/lxqtclock.cpp b/plugin-clock/lxqtclock.cpp index f59138d9a..675fecc13 100644 --- a/plugin-clock/lxqtclock.cpp +++ b/plugin-clock/lxqtclock.cpp @@ -64,6 +64,8 @@ LXQtClock::LXQtClock(const ILXQtPanelPluginStartupInfo &startupInfo): mContent->setAlignment(Qt::AlignCenter); + mMainWidget->installEventFilter(this); + settingsChanged(); mTimer->setTimerType(Qt::PreciseTimer); @@ -523,6 +525,19 @@ void LXQtClock::realign() mRotatedWidget->setOrigin(Qt::TopLeftCorner); } +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; +} + ActiveLabel::ActiveLabel(QWidget *parent) : QLabel(parent) { diff --git a/plugin-clock/lxqtclock.h b/plugin-clock/lxqtclock.h index 2aa669295..5c2a8fcab 100644 --- a/plugin-clock/lxqtclock.h +++ b/plugin-clock/lxqtclock.h @@ -68,6 +68,9 @@ private slots: void deletePopup(); void setTimeText(); +protected: + bool eventFilter(QObject *watched, QEvent *event); + private: QWidget *mMainWidget; LXQt::RotatedWidget* mRotatedWidget; @@ -82,6 +85,7 @@ private slots: QString mDefaultTimeZone; QString mActiveTimeZone; QString mFormat; + QString mToolTipFormat; bool mAutoRotate; QLabel *mPopupContent; From f0d7b6e2cf647f6e25b0c77b61ebcad887c3afef Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Fri, 26 May 2017 21:37:45 -0500 Subject: [PATCH 08/10] Make a few trivial UI changes --- plugin-clock/lxqtclockconfiguration.ui | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugin-clock/lxqtclockconfiguration.ui b/plugin-clock/lxqtclockconfiguration.ui index 678212b84..574909185 100644 --- a/plugin-clock/lxqtclockconfiguration.ui +++ b/plugin-clock/lxqtclockconfiguration.ui @@ -11,7 +11,7 @@ - World Clock Settings + Clock Settings @@ -374,7 +374,7 @@ - &Customise ... + &Customize... @@ -428,7 +428,7 @@ - IANA id + IANA ID @@ -443,7 +443,7 @@ - &Add ... + &Add... @@ -473,7 +473,7 @@ false - &Edit custom name ... + &Edit custom name... From 1d52a91f05e6d5a83951bcb193ae244174797e2b Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Fri, 26 May 2017 21:49:09 -0500 Subject: [PATCH 09/10] Make trivial fixes to the UI for the manual clock configuration dialog box --- plugin-clock/lxqtclockconfigurationmanualformat.ui | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin-clock/lxqtclockconfigurationmanualformat.ui b/plugin-clock/lxqtclockconfigurationmanualformat.ui index 191050eab..634d1ca80 100644 --- a/plugin-clock/lxqtclockconfigurationmanualformat.ui +++ b/plugin-clock/lxqtclockconfigurationmanualformat.ui @@ -11,7 +11,7 @@ - World Clock Time Zones + Clock Time Zones @@ -110,12 +110,12 @@ <tr><td>ap <i>or</i> a</td><td>use am/pm display. <b>a/ap</b> will be replaced by either "am" or "pm".<</td></tr> <tr><td>t</td><td>the timezone (for example "CEST")</td></tr> <tr><td>T</td><td>the offset from UTC</td></tr> -<tr><td>TT</td><td>the timezone IANA id</td></tr> +<tr><td>TT</td><td>the timezone IANA ID</td></tr> <tr><td>TTT</td><td>the timezone abbreviation</td></tr> <tr><td>TTTT</td><td>the timezone short display name</td></tr> <tr><td>TTTTT</td><td>the timezone long display name</td></tr> <tr><td>TTTTTT</td><td>the timezone custom name. You can change it the 'Time zones' tab of the configuration window</td></tr></table> -<br /><b>Notes:</b> <ul><li>Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</li><li>Minimal update interval is 1 second. If z or zzz is configured time is shown with the milliseconds fraction, but not updated on millisecond basis (avoiding big performance hit).</li><ul> +<br /><b>Notes:</b> <ul><li>Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#', and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.</li><li>The minimal update interval is 1 second. If z or zzz is set, the time is shown with the milliseconds fraction, but not updated every millisecond (avoiding a big performance hit).</li><ul> From c2212df2b269ec387729f9b9cdfac0c89e9a1707 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Fri, 26 May 2017 22:51:36 -0500 Subject: [PATCH 10/10] Rework the clock configuration UI: - Remove the "General" menu because there was only one checkmark, and it was applicable in the new location anyways. - Change the formatting so that the advanced format checkbox and the customize button are on the same line, and it looks better this way. - General grammar and punctuation fixes. --- plugin-clock/lxqtclockconfiguration.cpp | 4 +- plugin-clock/lxqtclockconfiguration.h | 2 +- plugin-clock/lxqtclockconfiguration.ui | 105 +++++++++--------------- 3 files changed, 43 insertions(+), 68 deletions(-) diff --git a/plugin-clock/lxqtclockconfiguration.cpp b/plugin-clock/lxqtclockconfiguration.cpp index 0bc284340..44ddb7588 100644 --- a/plugin-clock/lxqtclockconfiguration.cpp +++ b/plugin-clock/lxqtclockconfiguration.cpp @@ -65,7 +65,7 @@ LXQtClockConfiguration::LXQtClockConfiguration(PluginSettings *settings, QWidget connect(ui->datePadDayCB, SIGNAL(clicked()), SLOT(saveSettings())); connect(ui->dateLongNamesCB, SIGNAL(clicked()), SLOT(saveSettings())); connect(ui->advancedManualGB, SIGNAL(clicked()), SLOT(saveSettings())); - connect(ui->customisePB, SIGNAL(clicked()), SLOT(customiseManualFormatClicked())); + connect(ui->customizePB, SIGNAL(clicked()), SLOT(customizeManualFormatClicked())); connect(ui->timeFormatCB, SIGNAL(currentIndexChanged(int)), SLOT(timeFormatChanged(int))); @@ -406,7 +406,7 @@ void LXQtClockConfiguration::advancedFormatToggled(bool on) ui->dateGB->setEnabled(!on); } -void LXQtClockConfiguration::customiseManualFormatClicked() +void LXQtClockConfiguration::customizeManualFormatClicked() { if (!mConfigurationManualFormat) { diff --git a/plugin-clock/lxqtclockconfiguration.h b/plugin-clock/lxqtclockconfiguration.h index 94204d268..f7c6fdbb4 100644 --- a/plugin-clock/lxqtclockconfiguration.h +++ b/plugin-clock/lxqtclockconfiguration.h @@ -67,7 +67,7 @@ private slots: void dateGroupToggled(bool); void dateFormatChanged(int); void advancedFormatToggled(bool); - void customiseManualFormatClicked(); + void customizeManualFormatClicked(); void manualFormatChanged(); void updateTimeZoneButtons(); diff --git a/plugin-clock/lxqtclockconfiguration.ui b/plugin-clock/lxqtclockconfiguration.ui index 574909185..4378853cf 100644 --- a/plugin-clock/lxqtclockconfiguration.ui +++ b/plugin-clock/lxqtclockconfiguration.ui @@ -345,42 +345,47 @@ - - - Ad&vanced manual format - - - true + + + + + Ad&vanced manual format + + + false + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Customize... + + + + + + + + + Auto&rotate when the panel is vertical - false + true - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - &Customize... - - - - - - @@ -504,8 +509,8 @@ - 1 - 0 + 13 + 13 @@ -514,36 +519,6 @@ - - - &General - - - - - - Auto&rotate when the panel is vertical - - - true - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - -