-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
356 changed files
with
15,216 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "Date and Time management", | ||
"icon": "preferences-system-time", | ||
"uuid": "e8e71dad-f372-4f96-a2c9-3462af834ada", | ||
"vi": { | ||
"name": "Quản lý ngày và giờ" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
QT += gui widgets | ||
|
||
TEMPLATE = lib | ||
CONFIG += plugin | ||
|
||
CONFIG += c++11 | ||
|
||
# Include the-libs build tools | ||
include(/usr/share/the-libs/pri/gentranslations.pri) | ||
|
||
# You can make your code fail to compile if it uses deprecated APIs. | ||
# In order to do so, uncomment the following line. | ||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 | ||
|
||
SOURCES += \ | ||
onboarding/onboardingtimezone.cpp \ | ||
plugin.cpp \ | ||
popovers/settimezonepopover.cpp \ | ||
settings/datetimepane.cpp \ | ||
timezonesmodel.cpp | ||
|
||
HEADERS += \ | ||
onboarding/onboardingtimezone.h \ | ||
plugin.h \ | ||
popovers/settimezonepopover.h \ | ||
settings/datetimepane.h \ | ||
timezonesmodel.h | ||
|
||
DISTFILES += \ | ||
Plugin.json \ | ||
defaults.conf | ||
|
||
unix { | ||
translations.files = translations/*.qm | ||
translations.path = /usr/share/thedesk/TimeDatePlugin/translations | ||
|
||
defaults.files = defaults.conf | ||
defaults.path = /etc/theSuite/theDesk/TimeDatePlugin/ | ||
|
||
INSTALLS += translations defaults | ||
} | ||
|
||
include(../plugins.pri) | ||
|
||
FORMS += \ | ||
onboarding/onboardingtimezone.ui \ | ||
popovers/settimezonepopover.ui \ | ||
settings/datetimepane.ui |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/**************************************** | ||
* | ||
* INSERT-PROJECT-NAME-HERE - INSERT-GENERIC-NAME-HERE | ||
* Copyright (C) 2020 Victor Tran | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* *************************************/ | ||
#include "onboardingtimezone.h" | ||
#include "ui_onboardingtimezone.h" | ||
|
||
#include <statemanager.h> | ||
#include <onboardingmanager.h> | ||
#include "timezonesmodel.h" | ||
|
||
struct OnboardingTimeZonePrivate { | ||
TimezonesModel* model; | ||
}; | ||
|
||
OnboardingTimeZone::OnboardingTimeZone(QWidget* parent) : | ||
OnboardingPage(parent), | ||
ui(new Ui::OnboardingTimeZone) { | ||
ui->setupUi(this); | ||
d = new OnboardingTimeZonePrivate(); | ||
d->model = new TimezonesModel(); | ||
|
||
ui->titleLabel->setBackButtonShown(true); | ||
ui->listView->setModel(d->model); | ||
ui->listView->setItemDelegate(new TimezonesModelDelegate()); | ||
ui->nextButton->setEnabled(false); | ||
} | ||
|
||
OnboardingTimeZone::~OnboardingTimeZone() { | ||
delete ui; | ||
} | ||
|
||
QString OnboardingTimeZone::name() { | ||
return QStringLiteral("OnboardingTimeZone"); | ||
} | ||
|
||
QString OnboardingTimeZone::displayName() { | ||
return tr("Time Zone"); | ||
} | ||
|
||
void OnboardingTimeZone::on_titleLabel_backButtonClicked() { | ||
StateManager::onboardingManager()->previousStep(); | ||
} | ||
|
||
void OnboardingTimeZone::on_nextButton_clicked() { | ||
StateManager::onboardingManager()->nextStep(); | ||
} | ||
|
||
void OnboardingTimeZone::on_searchBox_textChanged(const QString& arg1) { | ||
d->model->search(arg1); | ||
} | ||
|
||
void OnboardingTimeZone::on_listView_activated(const QModelIndex& index) { | ||
QDBusMessage setTimezoneMessage = QDBusMessage::createMethodCall("org.freedesktop.timedate1", "/org/freedesktop/timedate1", "org.freedesktop.timedate1", "SetTimezone"); | ||
setTimezoneMessage.setArguments({index.data(Qt::UserRole).toString(), true}); | ||
QDBusConnection::systemBus().call(setTimezoneMessage, QDBus::NoBlock); | ||
|
||
StateManager::onboardingManager()->setDateVisible(true); | ||
ui->nextButton->setEnabled(true); | ||
} | ||
|
||
void OnboardingTimeZone::on_ntpCheckbox_toggled(bool checked) { | ||
QDBusMessage setNtpMessage = QDBusMessage::createMethodCall("org.freedesktop.timedate1", "/org/freedesktop/timedate1", "org.freedesktop.timedate1", "SetNTP"); | ||
setNtpMessage.setArguments({checked, true}); | ||
QDBusConnection::systemBus().call(setNtpMessage); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/**************************************** | ||
* | ||
* INSERT-PROJECT-NAME-HERE - INSERT-GENERIC-NAME-HERE | ||
* Copyright (C) 2020 Victor Tran | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* *************************************/ | ||
#ifndef ONBOARDINGTIMEZONE_H | ||
#define ONBOARDINGTIMEZONE_H | ||
|
||
#include <QWidget> | ||
#include <onboardingpage.h> | ||
|
||
namespace Ui { | ||
class OnboardingTimeZone; | ||
} | ||
|
||
struct OnboardingTimeZonePrivate; | ||
class OnboardingTimeZone : public OnboardingPage { | ||
Q_OBJECT | ||
|
||
public: | ||
explicit OnboardingTimeZone(QWidget* parent = nullptr); | ||
~OnboardingTimeZone(); | ||
|
||
private: | ||
Ui::OnboardingTimeZone* ui; | ||
OnboardingTimeZonePrivate* d; | ||
|
||
// OnboardingPage interface | ||
public: | ||
QString name(); | ||
QString displayName(); | ||
private slots: | ||
void on_titleLabel_backButtonClicked(); | ||
void on_nextButton_clicked(); | ||
void on_searchBox_textChanged(const QString& arg1); | ||
void on_listView_activated(const QModelIndex& index); | ||
void on_ntpCheckbox_toggled(bool checked); | ||
}; | ||
|
||
#endif // ONBOARDINGTIMEZONE_H |
Oops, something went wrong.