Initial commit

This commit is contained in:
woblight
2018-06-09 10:42:11 +02:00
commit f3d5f56692
27 changed files with 2348 additions and 0 deletions
+60
View File
@@ -0,0 +1,60 @@
import QtQuick 2.9
import GitAddonsManager.engine 1.0
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3
ToolButton {
id: upBtn
enabled: addon.status == Addon.Ready && (addon.gitStatus != Addon.UpToDate && addon.gitStatus != Addon.Error)
state: addon.gitStatus & ~Addon.MergeStatusMask
icon.color: enabled ? "transparent" : "lightgray"
onClicked: addon.update()
hoverEnabled: true
states: [
State {
name: Addon.UpToDate
PropertyChanges {
target: upBtn
icon.name: "update-none"
ToolTip.visible: hovered
ToolTip.text: "Up to date"
}
},
State {
name: Addon.Ahead
PropertyChanges {
target: upBtn
icon.name: "update-low"
ToolTip.visible: hovered
ToolTip.text: "Perform downgrade"
}
},
State {
name: Addon.Behind
PropertyChanges {
target: upBtn
icon.name: "update-low"
ToolTip.visible: hovered
ToolTip.text: "Perform upgrade"
}
},
State {
name: Addon.Diverged
PropertyChanges {
target: upBtn
icon.name: "update-high"
ToolTip.visible: hovered
ToolTip.text: "Perform checkout"
}
},
State {
name: Addon.Error
PropertyChanges {
target: upBtn
icon.name: "update-high"
ToolTip.visible: hovered
ToolTip.text: "Error"
}
}
]
}
+117
View File
@@ -0,0 +1,117 @@
import QtQuick 2.9
import GitAddonsManager.engine 1.0
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3
ColumnLayout {
ToolBar {
Layout.fillWidth: true
RowLayout {
anchors.fill: parent
ToolButton {
hoverEnabled: true
action: addAction
ToolTip.visible: hovered
ToolTip.text: "Download a new addon from a git repository"
}
ToolButton {
hoverEnabled: true
action: updateAllAction
ToolTip.visible: hovered
ToolTip.text: "Upgrade all addons"
}
ToolButton {
hoverEnabled: true
action: openAddonsFolder
ToolTip.visible: hovered
ToolTip.text: "Open addons folder externally"
}
Item {
Layout.fillWidth: true
}
ToolButton {
hoverEnabled: true
Layout.alignment: Qt.AlignRight
action: refreshAction
ToolTip.visible: hovered
ToolTip.text: "Refresh addons list and check for updates"
}
}
}
RowLayout {
Layout.fillHeight: true
Layout.fillWidth: true
spacing: 0
ListView {
ScrollBar.vertical: scrollBar
clip: true
Layout.fillHeight: true
Layout.fillWidth: true
model: Engine.addons
id: listView
delegate: MouseArea {
property Addon addon: Engine.addons[index]
width: parent.width
implicitHeight: row.height
hoverEnabled: true
id: ma
RowLayout {
spacing: 0
width: parent.width
id: row
Rectangle {
visible: ma.containsMouse || addonMenu.visible || branchSelector.popup.visible
Layout.fillHeight: true
width: 4
color: deleteButton.hovered ? "red" : "lightgreen"
}
Label {
id: addonName
text: addon.name
Layout.fillWidth: true
background: ProgressBar {
id: pBar
from: 0
to: addon.total
value: addon.progress
visible: addon.status == Addon.Status.Busy
indeterminate: to == 0
}
}
ComboBox {
id: branchSelector
model: addon.branches
onModelChanged: currentIndex = find(addon.currentBranch)
Component.onCompleted: currentIndex = find(addon.currentBranch)
onActivated: addon.currentBranch = currentText
}
AddonUpdateButton {
width: parent.width
}
ToolButton {
icon.name: "overflow-menu"
onClicked: if (!addonMenu.visible) addonMenu.visible = true
checked: addonMenu.visible
Menu {
x: -width
id: addonMenu
visible: false
MenuItem {
enabled: addon.status == Addon.Status.Ready
id: deleteButton
text: qsTr("delete")
icon.name: "delete"
onTriggered: addon.uninstall()
}
}
}
}
}
}
ScrollBar {id: scrollBar; Layout.fillHeight: true; visible: listView.contentHeight > listView.header}
}
}
+46
View File
@@ -0,0 +1,46 @@
QT += quick widgets concurrent
CONFIG += c++1z
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
main.cpp \
addon.cpp \
control.cpp
RESOURCES += qml.qrc
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
HEADERS += \
addon.h \
control.h
LIBS += -lgit2
win32 {
DEFINES += "_WIN32_WINNT=0x06010000"
}
DISTFILES += \
README.md
QMAKE_CXXFLAGS += -fconcepts
+43
View File
@@ -0,0 +1,43 @@
import QtQuick 2.9
import QtQuick.Controls 2.4
import GitAddonsManager.engine 1.0
import QtQuick.Layouts 1.3
ColumnLayout {
Frame {
Layout.fillWidth: true
contentItem: RowLayout {
width: parent.width
TextField {
Layout.fillWidth: true
id: path
text: Engine.addonsPath
onAccepted: Engine.addonsPath = text
placeholderText: qsTr("Path to AddOns folder")
hoverEnabled: true
ToolTip.visible: hovered
ToolTip.text: qsTr("Path to the folder containing the addons")
}
Button {
text: qsTr("Browse")
onClicked: fileDialog.visible = true
hoverEnabled: true
ToolTip.visible: hovered
ToolTip.text: qsTr("Choose the folder containing the addons")
}
}
}
CheckBox {
tristate: Engine.minimizeToTray == Engine.MinimizeToTrayAsk
onCheckedChanged: Engine.minimizeToTray = checked ? Engine.MinimizeToTrayYes : Engine.MinimizeToTrayNo
checkState: Engine.minimizeToTray == Engine.MinimizeToTrayAsk ?
Qt.PartiallyChecked :
Engine.minimizeToTray == Engine.MinimizeToTrayYes ?
Qt.Checked : Qt.Unchecked
text: qsTr("Minimize to System Tray")
hoverEnabled: true
ToolTip.visible: hovered
ToolTip.text: qsTr("Minimize to System Tray when the main window is closed.")
}
}
+5
View File
@@ -0,0 +1,5 @@
# GitAddonsManager
Git based World of Warcraft addon manager.
This application exclusively manage git repositories, addons not containing a git repositories will be ignored. All addons hosted on Gitlab, Github and likes are compatible but must be cloned through git (if you don't know what that means, you will need to redownload your addons through this app).
+49
View File
@@ -0,0 +1,49 @@
/* Copyright 2018 WobLight
*
* 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/>.
*/
import QtQuick 2.0
import Qt.labs.platform 1.0
import GitAddonsManager.engine 1.0
SystemTrayIcon {
visible: true
iconName: "update-none"
onActivated: {
window.show()
window.raise()
window.requestActivate()
}
menu: Menu {
visible: false
MenuItem {
text: qsTr("Check for updates")
onTriggered: Engine.scanForAddons()
enabled: Engine.status == Engine.Ready
}
MenuItem {
text: qsTr("Update all")
onTriggered: updateAll()
enabled: availableUpdates > 0
}
MenuSeparator {}
MenuItem {
text: qsTr("Close")
onTriggered: Qt.quit()
}
}
}
+545
View File
@@ -0,0 +1,545 @@
/* Copyright 2018 WobLight
*
* 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 "addon.h"
#include <QDir>
#include <git2.h>
#include <QDebug>
#include "control.h"
#ifdef Q_OS_WIN32
#include <windows.h>
#include <winbase.h>
#endif
#include <type_traits>
#include <QtConcurrent>
#include <QFutureWatcher>
#include <QReadWriteLock>
Addon::Addon(QString name, git_repository *repo, QObject *parent) : QObject(parent),
m_name(name), m_repo(repo, &git_repository_free), m_progress(0), m_total(0), m_status(Status::Ready), m_gitStatus(GitStatusFlag::UpToDate), m_pool(new QThreadPool(this))
{
connect(this, &Addon::remoteChanged, this, &Addon::fetchRemote);
connect(this, &Addon::currentBranchChanged, this, &Addon::updateGitStatus);
scanBranches();
}
QString Addon::name() const
{
return m_name;
}
void Addon::setName(QString name)
{
if (m_name == name)
return;
m_name = name;
emit nameChanged(m_name);
}
void Addon::update()
{
removeSubfolders();
delegate("Update", [this](){
git_reference *lbr = nullptr;
git_reference *rbr = nullptr;
git_reference *ubr = nullptr;
int error = git_branch_lookup(&lbr, m_repo.get(), m_currentBranch.toLocal8Bit(), GIT_BRANCH_LOCAL);
git_annotated_commit *ac;
git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
opts.checkout_strategy = GIT_CHECKOUT_FORCE;
if (error == GIT_ENOTFOUND) {
git_branch_lookup(&lbr, m_repo.get(), m_currentBranch.toLocal8Bit(), GIT_BRANCH_REMOTE);
git_annotated_commit_from_ref(&ac, m_repo.get(), lbr);
} else {
git_branch_upstream(&rbr, lbr);
git_annotated_commit_from_ref(&ac, m_repo.get(), rbr);
}
if (!git_branch_is_head(lbr))
git_repository_set_head(m_repo.get(), git_reference_name(lbr));
git_reference_set_target(&ubr, lbr, git_annotated_commit_id(ac), nullptr);
git_checkout_head(m_repo.get(), &opts);
git_annotated_commit_free(ac);
if (rbr)
git_reference_free(rbr);
git_reference_free(lbr);
git_reference_free(ubr);
}, [this](){updateGitStatus();});
unpackSubfolders();
}
void Addon::scanBranches()
{
delegate("Branch Scan", [this](){
struct {
QStringList rs;
QStringList bs;
QString cb;
QString cr;
} data;
git_strarray remotes;
int error = git_remote_list(&remotes, m_repo.get());
for (unsigned int i = 0; i < remotes.count; i++)
data.rs << remotes.strings[i];
git_strarray_free(&remotes);
git_branch_iterator *iter = nullptr;
error = git_branch_iterator_new(&iter, m_repo.get(), GIT_BRANCH_ALL);
git_reference *ref = nullptr;
const char *bname = nullptr;
git_branch_t btype;
while (!(error = git_branch_next(&ref, &btype, iter))) {
git_branch_name(&bname, ref);
data.bs << bname;
if (git_branch_is_head(ref)) {
data.cb = bname;
git_buf buf = GIT_BUF_INIT_CONST(0, nullptr);
(git_reference_is_remote(ref) ?
git_branch_remote_name :
git_branch_upstream_remote
)(&buf, m_repo.get(), git_reference_name(ref));
data.cr = buf.ptr;
}
git_reference_free(ref);
}
git_branch_iterator_free(iter);
return data;
},[this](auto data){
setRemote(data.cr);
setCurrentBranch(data.cb);
setRemotes(data.rs);
setBranches(data.bs);
scanSubfolders();
});
}
void Addon::scanSubfolders()
{
delegate("Subfolders Scan", [this](){
QStringList sf;
git_object *obj = nullptr;
git_revparse_single(&obj, m_repo.get(), "HEAD^{tree}");
git_tree *tree = reinterpret_cast<git_tree *>(obj);
git_tree_walk(tree, GIT_TREEWALK_PRE, [](const char *root, const git_tree_entry *entry, void *payload) -> int{
QString path = root;
if (path.isEmpty())
return 0;
QStringList *sf = static_cast<QStringList *>(payload);
QString file = git_tree_entry_name(entry);
if (file.toLower() == path.toLower().chopped(1) + ".toc") {
*sf << path.chopped(1);
return 1;
}
if (path.split("/").size() > 1)
return 1;
return 0;
}, &sf);
git_object_free(obj);
return sf;
},[this](auto subs){setSubfolders(subs);});
}
void Addon::setBranches(QStringList branches)
{
if (m_branches == branches)
return;
m_branches = branches;
emit branchesChanged(m_branches);
}
void Addon::setCurrentBranch(QString currentBranch)
{
if (m_currentBranch == currentBranch)
return;
m_currentBranch = currentBranch;
emit currentBranchChanged(m_currentBranch);
}
void Addon::setRemote(QString remote)
{
if (m_remote == remote)
return;
m_remote = remote;
emit remoteChanged(m_remote);
}
void Addon::setRemotes(QStringList remotes)
{
if (m_remotes == remotes)
return;
m_remotes = remotes;
emit remotesChanged(m_remotes);
}
int fetch_progress_cb(const git_transfer_progress *stats, void *payload) {
Addon *a = static_cast<Addon *>(payload);
QMetaObject::invokeMethod(a,"setTotal",Q_ARG(int, stats->total_objects));
QMetaObject::invokeMethod(a,"setProgress",Q_ARG(int, stats->received_objects));
return 0;
}
void Addon::fetchRemote(QString remote)
{
delegate(remote + " Fetch", [this, remote](){
git_fetch_options fetch_opts = GIT_FETCH_OPTIONS_INIT;
fetch_opts.callbacks.transfer_progress = &fetch_progress_cb;
fetch_opts.callbacks.payload = this;
git_remote *r;
git_remote_lookup(&r, m_repo.get(), remote.toLocal8Bit());
int error = git_remote_fetch(r,nullptr,&fetch_opts,nullptr);
if (error < 0) {
const git_error *e = giterr_last();
qDebug() <<QString::asprintf("Error %d/%d: %s\n", error, e->klass, e->message);
}
git_remote_free(r);
}, [this](){updateGitStatus();});
}
void Addon::setProgress(int fetchProgress)
{
if (m_progress == fetchProgress)
return;
m_progress = fetchProgress;
emit progressChanged(m_progress);
}
void Addon::setTotal(int fetchSize)
{
if (m_total == fetchSize)
return;
m_total = fetchSize;
emit totalChanged(m_total);
}
void Addon::setStatus(Addon::Status status)
{
if (m_status == status)
return;
m_status = status;
emit statusChanged(m_status);
}
void Addon::setGitStatus(Addon::GitStatus gitStatus)
{
if (m_gitStatus == gitStatus)
return;
m_gitStatus = gitStatus;
emit gitStatusChanged(m_gitStatus);
}
void Addon::updateGitStatus()
{
delegate("Git Status Update", [this](){
git_reference *tr;
git_branch_lookup(&tr, m_repo.get(), m_currentBranch.toLocal8Bit(), GIT_BRANCH_LOCAL);
if (!tr) {
git_branch_lookup(&tr, m_repo.get(), m_currentBranch.toLocal8Bit(), GIT_BRANCH_REMOTE);
}
else {
git_reference *rbr;
git_branch_upstream(&rbr, tr);
git_reference_free(tr);
tr = rbr;
}
if (!tr)
return GitStatusFlag::UpToDate;
git_reference *lr;
git_repository_head(&lr, m_repo.get());
git_annotated_commit *uc;
git_annotated_commit *lc;
git_annotated_commit_from_ref(&uc, m_repo.get(), tr);
git_annotated_commit_from_ref(&lc, m_repo.get(), lr);
size_t ahead;
size_t behind;
git_graph_ahead_behind(&ahead, &behind, m_repo.get(), git_annotated_commit_id(lc), git_annotated_commit_id(uc));
if (!(ahead || behind))
return GitStatusFlag::UpToDate;
else if (ahead && !behind)
return GitStatusFlag::Ahead;
else if (!ahead)
return GitStatusFlag::Behind;
else
return GitStatusFlag::Diverged;
git_reference_free(tr);
git_reference_free(lr);
git_annotated_commit_free(uc);
git_annotated_commit_free(lc);
/// TODO: check for local changes/merge
/*if (git_repository_head_detached(m_repo.get())) {
setGitStatus(GitStatus::Conflicting);
return;
}
git_reference *tr;
git_branch_lookup(&tr, m_repo.get(), m_currentBranch.toLocal8Bit(), GIT_BRANCH_LOCAL);
if (!tr) {
git_branch_lookup(&tr, m_repo.get(), m_currentBranch.toLocal8Bit(), GIT_BRANCH_REMOTE);
}
else {
git_reference *rbr;
git_branch_upstream(&rbr, tr);
git_reference_free(tr);
tr = rbr;
}
git_buf buf = GIT_BUF_INIT_CONST(0, nullptr);
git_branch_remote_name(&buf, m_repo.get(), git_reference_name(tr));
if (buf.ptr != remote())
setRemote(buf.ptr);
else {
git_annotated_commit *ac;
git_annotated_commit_from_ref(&ac, m_repo.get(), tr);
git_merge_analysis_t an;
git_merge_preference_t pref;
git_merge_analysis(&an, &pref, m_repo.get(),(const git_annotated_commit **)&ac, 1);
if (an & GIT_MERGE_ANALYSIS_UP_TO_DATE) {
if (git_annotated_commit_id(*ac) != git_head)
setGitStatus(GitStatus::Conflicting);
else
setGitStatus(GitStatus::UpToDate);
}
else if (an & GIT_MERGE_ANALYSIS_FASTFORWARD)
setGitStatus(GitStatus::FastForwardable);
else
setGitStatus(GitStatus::Conflicting);
git_annotated_commit_free(ac);
}
git_reference_free(tr);*/
}, [this](auto s){
setGitStatus(s);
});
}
void Addon::uninstall()
{
removeSubfolders();
closeRepo();
delegate("Removing addon folder", [this](){
removeFolder(Control::instance()->addonsPath() + "/" + m_name);
}, [](){Control::instance()->scanForAddons();});
}
void Addon::setSubfolders(QStringList subfolders)
{
if (m_subfolders == subfolders)
return;
m_subfolders = subfolders;
emit subfoldersChanged(m_subfolders);
}
void walkFolders(QFileInfo &info, auto f){
if (info.isDir() && !info.isSymLink()) {
foreach (QFileInfo sub, QDir(info.filePath()).entryInfoList(QDir::AllEntries|QDir::NoDotAndDotDot|QDir::Hidden))
walkFolders(sub, f);
}
f(info);
}
void Addon::removeFolder(QString path) {
QFileInfo info(path);
if (info.exists()) {
int i = 0;
walkFolders(info, [ &i](QFileInfo /*info*/){
i++;
});
emit totalChanged(i);
i = 0;
walkFolders(info, [this, &i](QFileInfo info){
if (!info.isSymLink() && info.isDir())
info.dir().rmdir(info.fileName());
else
QFile(info.filePath()).remove();
emit totalChanged(++i);
});
}
}
void Addon::removeSubfolders()
{
delegate("Removing Subfolders", [this](){
foreach (QString subf, m_subfolders)
removeFolder(Control::instance()->addonsPath() + "/" + subf);
});
}
void Addon::unpackSubfolders(){
delegate("Unpacking Subfolders", [this](){
QStringList errors;
QDir addonsDir(Control::instance()->addonsPath());
if (m_subfolders.contains(m_name, Qt::CaseInsensitive)) {
QString oldName = m_name;
setName(m_name + ".repo");
addonsDir.rename(oldName, m_name);
openRepo();
}
QDir::setCurrent(addonsDir.canonicalPath());
QDir dir(m_name);
foreach (QString subfn, m_subfolders) {
QFileInfo addonFolder(subfn);
if (addonFolder.exists()) {
QFileInfo dest(addonFolder.fileName() + ".bak");
int i = 0;
while (dest.exists())
dest = QFileInfo(addonFolder.fileName() + ".bak." + QString::number(++i));
addonsDir.rename(addonFolder.fileName(), dest.fileName());
if (QFileInfo(subfn).exists()) {
errors << QString("The folder \"%1\" already existed and couldn't be renamed. The addon subfolder has been skipped").arg(subfn, dest.exists());
continue;
}
errors << QString("The folder \"%1\" already existed and has been renamed to \"%2\"").arg(subfn, dest.fileName());
}
#ifdef Q_OS_WIN32
QString link = subfn;
link.replace("/","\\");
QString target = "./"+m_name+"/"+subfn;
target.replace("/","\\");
wchar_t link_w[link.size() +1];
wchar_t target_w[target.size() +1];
int pos = link.toWCharArray(link_w);
link_w[pos] = '\0';
pos = target.toWCharArray(target_w);
target_w[pos] = '\0';
#else
QFile::link("./"+m_name+"/"+subfn, subfn);
#endif
if (!QFileInfo(subfn).exists()) {
dir.rename(subfn, "../"+subfn);
}
QFileInfo info(subfn);
if (!info.exists()) {
errors << "Failed to link or move \""+ info.absoluteFilePath() + "\" to \"" + addonFolder.absoluteFilePath()+"\"";
}
}
return errors;
}, [this](auto errors){
if (errors.size() > 0) {
setStatus(Status::Error);
//setStatusMessage(errors.join('\n'));
}
});
}
QStringList Addon::branches() const
{
return m_branches;
}
QString Addon::currentBranch() const
{
return m_currentBranch;
}
QString Addon::remote() const
{
return m_remote;
}
QStringList Addon::remotes() const
{
return m_remotes;
}
int Addon::progress() const
{
return m_progress;
}
int Addon::total() const
{
return m_total;
}
Addon::Status Addon::status() const
{
return m_status;
}
Addon::GitStatus Addon::gitStatus() const
{
return m_gitStatus;
}
QStringList Addon::subfolders() const
{
return m_subfolders;
}
void Addon::closeRepo()
{
m_repo.reset();
}
void Addon::openRepo()
{
git_repository *repo = nullptr;
git_repository_open(&repo, (Control::instance()->addonsPath() + "/" + m_name).toLocal8Bit());
m_repo.reset(repo);
}
void Addon::delegate(QString taskname, auto work, auto callback)
{
if (status() != Status::Ready) {
qInfo() << name() << "Enqueueing" << taskname;
m_tasks.enqueue({taskname, [this, taskname, work, callback](){delegate(taskname, work,callback);}});
return;
}
qInfo() << name() << "Executing " << taskname;
setProgress(0);
setTotal(0);
setStatus(Status::Busy);
using ret_t = typename std::invoke_result<decltype(work)>::type;
QFuture<ret_t> fut = QtConcurrent::run(m_pool, work);
QFutureWatcher<ret_t> *fw = new QFutureWatcher<ret_t>();
connect(fw, &QFutureWatcher<ret_t>::finished, [this, callback, fw](){
setStatus(Status::Ready);
TaskQueue old;
m_tasks.swap(old);
if constexpr (std::is_same<ret_t, void>::value)
callback();
else
callback(fw->result());
while(!old.isEmpty())
m_tasks.enqueue(old.dequeue());
if (!m_tasks.isEmpty() && status() != Status::Busy)
m_tasks.dequeue().second();
});
connect(fw, &QFutureWatcher<ret_t>::finished, fw, &QFutureWatcher<ret_t>::deleteLater);
fw->setFuture(fut);
}
void Addon::delegate(QString taskname, auto work)
{
using ret_t = typename std::invoke_result<decltype(work)>::type;
if constexpr (std::is_same<ret_t, void>::value)
delegate(taskname, work, [](){});
else
delegate(taskname, work, [](ret_t){});
}
+171
View File
@@ -0,0 +1,171 @@
/* Copyright 2018 WobLight
*
* 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 ADDON_H
#define ADDON_H
#include <QObject>
#include <QFileInfo>
#include <memory>
#include <functional>
#include <QQueue>
class git_repository;
using repo_p = std::unique_ptr<git_repository, void(*)(git_repository *)>;
class QThreadPool;
class Addon : public QObject
{
Q_OBJECT
using TaskQueue = QQueue<QPair<QString,std::function<void()>>>;
TaskQueue m_tasks;
QString m_name;
repo_p m_repo;
QStringList m_branches;
QString m_currentBranch;
QString m_remote;
QStringList m_remotes;
int m_progress;
int m_total;
public:
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(QStringList branches READ branches WRITE setBranches NOTIFY branchesChanged)
Q_PROPERTY(QString currentBranch READ currentBranch WRITE setCurrentBranch NOTIFY currentBranchChanged)
Q_PROPERTY(QString remote READ remote WRITE setRemote NOTIFY remoteChanged)
Q_PROPERTY(QStringList remotes READ remotes WRITE setRemotes NOTIFY remotesChanged)
Q_PROPERTY(int progress READ progress WRITE setProgress NOTIFY progressChanged)
Q_PROPERTY(int total READ total WRITE setTotal NOTIFY totalChanged)
Q_PROPERTY(QStringList subfolders READ subfolders WRITE setSubfolders NOTIFY subfoldersChanged)
enum class Status {
Error = -1,
Ready,
Busy
};
Q_ENUM(Status)
Q_PROPERTY(Status status READ status WRITE setStatus NOTIFY statusChanged)
enum GitStatusFlag {
Error = -1,
UpToDate = 0,
Ahead = 1,
Behind = 2,
Diverged = 3,
FastForward = 4,
Merge = 5,
Conflict = 6,
MergeStatusMask = 0x1100
};
Q_ENUM(GitStatusFlag)
Q_DECLARE_FLAGS(GitStatus, GitStatusFlag)
Q_PROPERTY(GitStatus gitStatus READ gitStatus WRITE setGitStatus NOTIFY gitStatusChanged)
Q_FLAGS(GitStatus)
explicit Addon(QString name, git_repository *repo, QObject *parent = nullptr);
QString name() const;
QStringList branches() const;
QString currentBranch() const;
QString remote() const;
QStringList remotes() const;
int progress() const;
int total() const;
Status status() const;
GitStatus gitStatus() const;
QStringList subfolders() const;
private:
Status m_status;
GitStatus m_gitStatus;
QStringList m_subfolders;
void closeRepo();
void openRepo();
void delegate(QString taskname, auto work, auto callback);
void delegate(QString taskname, auto work);
QThreadPool *m_pool;
void removeFolder(QString path);
signals:
void nameChanged(QString name);
void branchesChanged(QStringList branches);
void currentBranchChanged(QString currentBranch);
void remoteChanged(QString remote);
void remotesChanged(QStringList remotes);
void progressChanged(int progress);
void totalChanged(int total);
void statusChanged(Status status);
void gitStatusChanged(GitStatus gitStatus);
void subfoldersChanged(QStringList subfolders);
public slots:
void setName(QString name);
void update();
void scanBranches();
void scanSubfolders();
void setBranches(QStringList branches);
void setCurrentBranch(QString currentBranch);
void setRemote(QString remote);
void setRemotes(QStringList remotes);
void fetchRemote(QString remote);
void setProgress(int progress);
void setTotal(int total);
void setStatus(Status status);
void setGitStatus(GitStatus gitStatus);
void updateGitStatus();
void uninstall();
void setSubfolders(QStringList subfolders);
void removeSubfolders();
void unpackSubfolders();
};
Q_DECLARE_OPERATORS_FOR_FLAGS(Addon::GitStatus)
#endif // ADDON_H
+288
View File
@@ -0,0 +1,288 @@
/* Copyright 2018 WobLight
*
* 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 "control.h"
#include <QSettings>
#include <QDir>
#include <QFutureWatcher>
#include "addon.h"
#include <git2.h>
#include <QDebug>
#include <QtConcurrent>
#include <type_traits>
Control *Control::m_instance = nullptr;
Control::Control(QObject *parent) : QObject(parent), m_progress(0), m_total(0), m_status(Status::Ready), m_statusMessage(""), m_pool(new QThreadPool(this))
{
QSettings settings;
setAddonsPath(settings.value("addonsPath").toString());
setFirstBoot(settings.value("firstBoot",true).toBool());
setMinimizeToTray((MinimizeToTray)settings.value("minimizeToTray",(int)MinimizeToTrayAsk).toInt());
connect(this, &Control::addonsPathChanged, this, &Control::scanForAddons);
connect(this, &Control::addonsPathChanged, this, &Control::saveAddonsPath);
delegate("Initializing libgit2...", [](){git_libgit2_init();},[this](){scanForAddons();});
}
void Control::delegate(QString taskname, auto work, auto callback)
{
if (status() != Status::Ready) {
qInfo() << "Enqueueing" << taskname;
m_tasks.enqueue({taskname, [this, taskname, work, callback](){delegate(taskname, work,callback);}});
return;
}
qInfo() << "Executing " << taskname;
setStatusMessage(taskname);
setProgress(0);
setTotal(0);
setStatus(Status::Busy);
using ret_t = typename std::invoke_result<decltype(work)>::type;
QFuture<ret_t> fut = QtConcurrent::run(m_pool, work);
QFutureWatcher<ret_t> *fw = new QFutureWatcher<ret_t>();
connect(fw, &QFutureWatcher<ret_t>::finished, [this, callback, fw](){
setStatus(Status::Ready);
TaskQueue old;
m_tasks.swap(old);
if constexpr (std::is_same<ret_t, void>::value)
callback();
else
callback(fw->result());
while(!old.isEmpty())
m_tasks.enqueue(old.dequeue());
if (!m_tasks.isEmpty() && status() != Status::Busy)
m_tasks.dequeue().second();
});
connect(fw, &QFutureWatcher<ret_t>::finished, fw, &QFutureWatcher<ret_t>::deleteLater);
fw->setFuture(fut);
}
void Control::delegate(QString taskname, auto work)
{
using ret_t = typename std::invoke_result<decltype(work)>::type;
if constexpr (std::is_same<ret_t, void>::value)
delegate(taskname, work, [](){});
else
delegate(taskname, work, [](ret_t){});
}
QList<QObject *> Control::addons() const
{
return m_addons;
}
QString Control::addonsPath() const
{
return m_addonsPath;
}
Control *Control::instance()
{
if (!m_instance)
m_instance = new Control();
return m_instance;
}
int Control::progress() const
{
return m_progress;
}
int Control::total() const
{
return m_total;
}
Control::Status Control::status() const
{
return m_status;
}
QString Control::statusMessage() const
{
return m_statusMessage;
}
bool Control::firstBoot() const
{
return m_firstBoot;
}
Control::MinimizeToTray Control::minimizeToTray() const
{
return m_minimizeToTray;
}
void Control::setAddons(QList<QObject *> addons)
{
if (m_addons == addons)
return;
m_addons = addons;
emit addonsChanged(m_addons);
}
void Control::setAddonsPath(QString addonsPath)
{
addonsPath = QUrl::fromLocalFile(addonsPath).adjusted(QUrl::NormalizePathSegments|QUrl::StripTrailingSlash).toLocalFile();
if (m_addonsPath == addonsPath)
return;
m_addonsPath = addonsPath;
emit addonsPathChanged(m_addonsPath);
}
void Control::saveAddonsPath()
{
QSettings settings;
settings.setValue("addonsPath", m_addonsPath);
}
void Control::scanForAddons()
{
using init_t = QPair<QString, git_repository*>;
delegate("Scanning addons folder...", [this](){
QList<init_t> list;
QDir addonsFolder(m_addonsPath);
foreach (QFileInfo dirInfo, addonsFolder.entryInfoList(QDir::AllDirs)) {
QDir gitdir(dirInfo.canonicalFilePath() + "/.git");
if (!gitdir.exists()) continue;
git_repository *repo = nullptr;
int error = git_repository_open(&repo, dirInfo.canonicalFilePath().toLocal8Bit());
if (error) continue;
//QFileInfo toc(dirInfo.canonicalFilePath() + "/" + dirInfo.fileName() + ".toc");
//if (toc.exists())
list << init_t(dirInfo.fileName(), repo);
}
return list;
}, [this](auto list){
QObjectList ol;
foreach (init_t i, list)
ol << new Addon(i.first, i.second);
setAddons(ol);
});
}
int clone_progress_cb(const git_transfer_progress *stats, void *payload) {
Q_UNUSED(payload)
Control::instance()->setTotal(stats->total_objects);
Control::instance()->setProgress(stats->received_objects);
return 0;
}
void Control::clone(QUrl url)
{
delegate("Cloning addon...",[this, url]() {
struct {
QString name;
git_repository *repo = nullptr;
QString error;
} data;
data.name = url.fileName().section('.',0,0);
git_clone_options opts = GIT_CLONE_OPTIONS_INIT;
opts.fetch_opts.callbacks.transfer_progress = &clone_progress_cb;
int error = git_clone(&data.repo, url.toString().toLocal8Bit(), (m_addonsPath + "/" + data.name).toLocal8Bit(), &opts);
if (error < 0) {
const git_error *e = giterr_last();
data.error = QString::asprintf("Error %d/%d: %s", error, e->klass, e->message);
return data;
}
QDir dir(m_addonsPath);
dir.cd(data.name);
QStringList toc = dir.entryList({"*.toc"});
if (toc.isEmpty()) {
} else if (toc[0].toLower() != dir.dirName().toLower() + ".toc") {
dir.cdUp();
QString newName = toc[0].chopped(4);
dir.rename(data.name, newName);
data.name = newName;
}
return data;
},[this](auto ret){
if (ret.error.isEmpty()) {
auto add = new Addon(ret.name, ret.repo);
m_addons << add;
addonsChanged(m_addons);
add->unpackSubfolders();
} else {
setStatus(Status::Error);
setStatusMessage(ret.error);
}
});
}
void Control::setProgress(int progress)
{
if (m_progress == progress)
return;
m_progress = progress;
emit progressChanged(m_progress);
}
void Control::setTotal(int total)
{
if (m_total == total)
return;
m_total = total;
emit totalChanged(m_total);
}
void Control::setStatus(Control::Status status)
{
if (m_status == status)
return;
m_status = status;
emit statusChanged(m_status);
}
void Control::setStatusMessage(QString statusMessage)
{
if (m_statusMessage == statusMessage)
return;
m_statusMessage = statusMessage;
emit statusMessageChanged(m_statusMessage);
}
void Control::setFirstBoot(bool firstBoot)
{
if (m_firstBoot == firstBoot)
return;
m_firstBoot = firstBoot;
emit firstBootChanged(m_firstBoot);
QSettings s;
s.setValue("firstBoot", false);
}
void Control::setMinimizeToTray(MinimizeToTray minimizeToTray)
{
if (m_minimizeToTray == minimizeToTray)
return;
m_minimizeToTray = minimizeToTray;
emit minimizeToTrayChanged(m_minimizeToTray);
QSettings s;
s.setValue("minimizeToTray",(int)minimizeToTray);
}
+133
View File
@@ -0,0 +1,133 @@
/* Copyright 2018 WobLight
*
* 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 GITCONTROL_H
#define GITCONTROL_H
#include <QObject>
#include <QQueue>
#include <QUrl>
#include <functional>
class QThreadPool;
class Control : public QObject
{
Q_OBJECT
using TaskQueue = QQueue<QPair<QString,std::function<void()>>>;
TaskQueue m_tasks;
QList<QObject *> m_addons;
QString m_addonsPath;
public:
Q_PROPERTY(QList<QObject *> addons READ addons WRITE setAddons NOTIFY addonsChanged)
Q_PROPERTY(QString addonsPath READ addonsPath WRITE setAddonsPath NOTIFY addonsPathChanged)
Q_PROPERTY(int progress READ progress WRITE setProgress NOTIFY progressChanged)
Q_PROPERTY(int total READ total WRITE setTotal NOTIFY totalChanged)
Q_PROPERTY(QString statusMessage READ statusMessage WRITE setStatusMessage NOTIFY statusMessageChanged)
Q_PROPERTY(bool firstBoot READ firstBoot WRITE setFirstBoot NOTIFY firstBootChanged)
enum class Status {
Error = -1,
Ready,
Busy
};
Q_ENUM(Status)
Q_PROPERTY(Status status READ status WRITE setStatus NOTIFY statusChanged)
enum MinimizeToTray {
MinimizeToTrayAsk = -1,
MinimizeToTrayNo = 0,
MinimizeToTrayYes = 1
};
Q_ENUM(MinimizeToTray)
Q_PROPERTY(MinimizeToTray minimizeToTray READ minimizeToTray WRITE setMinimizeToTray NOTIFY minimizeToTrayChanged)
QList<QObject *> addons() const;
QString addonsPath() const;
static Control *instance();
int progress() const;
int total() const;
Status status() const;
QString statusMessage() const;
bool firstBoot() const;
MinimizeToTray minimizeToTray() const;
private:
static Control *m_instance;
explicit Control(QObject *parent = nullptr);
int m_progress;
int m_total;
Status m_status;
QString m_statusMessage;
bool m_firstBoot;
MinimizeToTray m_minimizeToTray;
QThreadPool *m_pool;
void delegate(QString message, auto work, auto callback);
void delegate(QString message, auto work);
signals:
void addonsChanged(QList<QObject *> addons);
void addonsPathChanged(QString addonsPath);
void progressChanged(int progress);
void totalChanged(int total);
void statusChanged(Status status);
void statusMessageChanged(QString statusMessage);
void firstBootChanged(bool firstBoot);
void minimizeToTrayChanged(MinimizeToTray minimizeToTray);
public slots:
void setAddons(QList<QObject *> addons);
void setAddonsPath(QString addonsPath);
void saveAddonsPath();
void scanForAddons();
void clone(QUrl url);
void setProgress(int progress);
void setTotal(int total);
void setStatus(Status status);
void setStatusMessage(QString statusMessage);
void setFirstBoot(bool firstBoot);
void setMinimizeToTray(MinimizeToTray minimizeToTray);
};
Q_DECLARE_METATYPE(Control::MinimizeToTray)
#endif // GITCONTROL_H
Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

+209
View File
@@ -0,0 +1,209 @@
The Breeze Icon Theme in icons/
Copyright (C) 2014 Uri Herrera <uri_herrera@nitrux.in> and others
This 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 3 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, see <http://www.gnu.org/licenses/>.
Clarification:
The GNU Lesser General Public License or LGPL is written for
software libraries in the first place. We expressly want the LGPL to
be valid for this artwork library too.
KDE Breeze theme icons is a special kind of software library, it is an
artwork library, it's elements can be used in a Graphical User Interface, or
GUI.
Source code, for this library means:
- where they exist, SVG;
- otherwise, if applicable, the multi-layered formats xcf or psd, or
otherwise png.
The LGPL in some sections obliges you to make the files carry
notices. With images this is in some cases impossible or hardly useful.
With this library a notice is placed at a prominent place in the directory
containing the elements. You may follow this practice.
The exception in section 5 of the GNU Lesser General Public License covers
the use of elements of this art library in a GUI.
https://vdesign.kde.org/
-----
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
+90
View File
@@ -0,0 +1,90 @@
[Icon Theme]
Name=Breeze
Name[ar]=نسيم
Name[ast]=Breeze
Name[ca]=Brisa
Name[ca@valencia]=Brisa
Name[cs]=Breeze
Name[da]=Breeze
Name[de]=Breeze
Name[el]=Breeze
Name[en_GB]=Breeze
Name[es]=Brisa
Name[et]=Breeze
Name[eu]=Breeze
Name[fi]=Breeze
Name[fr]=Brise
Name[gd]=Oiteag
Name[gl]=Breeze
Name[ia]=Breeze
Name[id]=Breeze
Name[it]=Brezza
Name[ko]=Breeze
Name[nl]=Breeze
Name[nn]=Breeze
Name[pl]=Bryza
Name[pt]=Brisa
Name[pt_BR]=Breeze
Name[ru]=Breeze
Name[sk]=Breeze
Name[sl]=Sapica
Name[sr]=Поветарац
Name[sr@ijekavian]=Поветарац
Name[sr@ijekavianlatin]=Povetarac
Name[sr@latin]=Povetarac
Name[sv]=Breeze
Name[uk]=Breeze
Name[x-test]=xxBreezexx
Name[zh_CN]=微风
Name[zh_TW]=Breeze
Comment=Default Plasma 5 Theme
Comment[ar]=سمة «بلازما ٥» الافتراضيّة
Comment[ast]=El tema por defeutu de Plasma 5
Comment[ca]=Tema del Plasma 5 per defecte
Comment[ca@valencia]=Tema del Plasma 5 per defecte
Comment[cs]=Výchozí motiv Plasma 5
Comment[da]=Standard Plasma 5-tema
Comment[de]=Standard-Arbeitsflächendesign für Plasma 5
Comment[el]=Προκαθορισμένο θέμα Plasma 5
Comment[en_GB]=Default Plasma 5 Theme
Comment[es]=Tema por omisión de Plasma 5
Comment[et]=Vaikimisi Plasma 5 teema
Comment[eu]=Plasma 5eko gai lehenetsia
Comment[fi]=Plasma 5:n oletusteema
Comment[fr]=Thème par défaut de Plasma 5
Comment[gd]=Ùrlar Plasma 5 bunaiteach
Comment[gl]=Tema predeterminado de Plasma 5
Comment[he]=ערכת הנושא הברירת־מחדל של Plama
Comment[ia]=Thema predefinite de Plasma 5
Comment[id]=Tema Baku Plasma 5
Comment[it]=Tema predefinito di Plasma 5
Comment[ko]=기본 Plasma 5 테마
Comment[nl]=Standaard Plasma 5 thema
Comment[nn]=Standard Plasma 5-tema
Comment[pl]=Domyślny wystrój Plazmy 5
Comment[pt]=Tema Predefinido do Plasma 5
Comment[pt_BR]=Tema padrão do Plasma 5
Comment[ru]=Стандартный набор значков в Plasma 5
Comment[sk]=Predvolená téma Plasma 5
Comment[sl]=Privzeta tema za Plasmo 5
Comment[sr]=Подразумевана тема Плазме 5
Comment[sr@ijekavian]=Подразумевана тема Плазме 5
Comment[sr@ijekavianlatin]=Podrazumevana tema Plasme 5
Comment[sr@latin]=Podrazumevana tema Plasme 5
Comment[sv]=Plasma 5 standardtema
Comment[tr]=Varsayılan Plasma 5 Teması
Comment[uk]=Типова тема Плазми 5
Comment[x-test]=xxDefault Plasma 5 Themexx
Comment[zh_CN]=默认 Plasma 5 主题
Comment[zh_TW]=預設的 Plasma 5 主題
DisplayDepth=32
FollowsColorScheme=true
Directories=svg
[svg]
Type=Fixed
Size=48
+11
View File
@@ -0,0 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22">
<defs>
<clipPath>
<path d="m0 706.465h1490.926v-706.465h-1490.926v706.465"/>
</clipPath>
<clipPath>
<path d="m22.1953 686.117h1447.7347v-667.1902h-1447.7347v667.1902"/>
</clipPath>
</defs>
<path d="m8 3v1 1h1v-1h4v1h1v-1-1h-6m-4 3v1h14v-1h-14m2 2v11h1 9v-1-10h-1v10h-8v-10h-1" style="fill:#da4453"/>
</svg>

After

Width:  |  Height:  |  Size: 396 B

+18
View File
@@ -0,0 +1,18 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
<defs
id="defs3051">
<style
type="text/css"
id="current-color-scheme">
.ColorScheme-Text {
color:#4d4d4d;
}
</style>
</defs>
<path
style="fill:currentColor;fill-opacity:1;stroke:none"
d="M 4 4 L 4 28 L 18 28 L 18 27 L 5 27 L 5 14 L 10 14 L 13 11 L 27 11 L 27 16 L 28 16 L 28 7 L 18 7 L 15 4 L 4 4 z M 23 16 L 18 21 L 18.707031 21.707031 L 22.5 17.914062 L 22.5 28.003906 L 23.5 28.003906 L 23.5 17.914062 L 27.292969 21.707031 L 28 21 L 24 17 L 23 16 z "
id="path71"
class="ColorScheme-Text"
/>
</svg>

After

Width:  |  Height:  |  Size: 645 B

+18
View File
@@ -0,0 +1,18 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
<defs
id="defs3051">
<style
type="text/css"
id="current-color-scheme">
.ColorScheme-Text {
color:#4d4d4d;
}
</style>
</defs>
<path
style="fill:currentColor;fill-opacity:1;stroke:none"
d="M 16 4 A 12 12 0 0 0 4 16 A 12 12 0 0 0 16 28 A 12 12 0 0 0 18 27.818359 L 18 26.810547 A 11 11 0 0 1 16 27 A 11 11 0 0 1 5 16 A 11 11 0 0 1 16 5 A 11 11 0 0 1 27 16 A 11 11 0 0 1 26.226562 20 L 27.308594 20 A 12 12 0 0 0 28 16 A 12 12 0 0 0 16 4 z M 15 9 L 15 11 L 17 11 L 17 9 L 15 9 z M 15 13 L 15 23 L 17 23 L 17 13 L 15 13 z M 19 16 L 19.007812 28 L 22.599609 23.076172 L 28 23.076172 L 19 16 z "
id="path37"
class="ColorScheme-Text"
/>
</svg>

After

Width:  |  Height:  |  Size: 779 B

+13
View File
@@ -0,0 +1,13 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<defs id="defs3051">
<style type="text/css" id="current-color-scheme">
.ColorScheme-Text {
color:#4d4d4d;
}
</style>
</defs>
<path style="fill:currentColor;fill-opacity:1;stroke:none"
d="M 11 5 L 11 12 L 4 12 L 4 13 L 11 13 L 11 20 L 12 20 L 12 13 L 19 13 L 19 12 L 12 12 L 12 5 L 11 5 z "
class="ColorScheme-Text"
/>
</svg>

After

Width:  |  Height:  |  Size: 437 B

+69
View File
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 32 32"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="overflow-menu.svg">
<metadata
id="metadata9">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="982"
inkscape:window-height="703"
id="namedview7"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:zoom="7.375"
inkscape:cx="31.254158"
inkscape:cy="23.675403"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="svg2">
<inkscape:grid
type="xygrid"
id="grid3337" />
</sodipodi:namedview>
<defs
id="defs3051">
<style
type="text/css"
id="current-color-scheme">
.ColorScheme-Text {
color:#4d4d4d;
}
</style>
</defs>
<path
style="fill:currentColor;fill-opacity:1;stroke:none"
d="m 15,5 0,2 2,0 0,-2 z m 0,10 0,2 2,0 0,-2 z m 0,10 0,2 2,0 0,-2 z"
id="a"
class="ColorScheme-Text"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccccccc" />
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

+21
View File
@@ -0,0 +1,21 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22">
<defs id="defs3051">
<style type="text/css" id="current-color-scheme">
.ColorScheme-Text {
color:#4d4d4d;
}
.ColorScheme-NegativeText {
color:#da4453;
}
</style>
</defs>
<path
style="fill:currentColor;fill-opacity:1;stroke:none"
d="M 11.126953 3.0019531 C 9.2851776 2.9719906 7.4335432 3.5755063 5.921875 4.8164062 C 2.8985906 7.2983061 2.1145626 11.6125 4.0703125 15 L 3.2050781 15.5 L 5.5039062 16.482422 L 5.8027344 14 L 4.9375 14.5 C 3.2230001 11.5304 3.9082004 7.7655435 6.5585938 5.5898438 C 9.2089874 3.4141439 13.034664 3.4761283 15.613281 5.7363281 L 16.271484 4.984375 C 14.800746 3.6952251 12.968729 3.0319156 11.126953 3.0019531 z M 16.494141 5.5195312 L 16.195312 8 L 17.0625 7.5 C 17.959107 9.0529689 18.193685 10.823632 17.839844 12.470703 C 18.160446 12.639467 18.458135 12.8441 18.720703 13.089844 C 19.259064 11.093388 19.024658 8.89995 17.927734 7 L 18.792969 6.5 L 16.494141 5.5195312 z M 11 6 L 7 10 L 9 10 L 9 15 L 12.144531 15 C 12.303295 14.394491 12.599063 13.848255 13 13.388672 L 13 10 L 15 10 L 11 6 z M 6.3847656 16.265625 L 5.7265625 17.017578 C 7.7928746 18.828768 10.571366 19.397714 13.089844 18.71875 C 12.844491 18.456567 12.641272 18.159893 12.472656 17.839844 C 10.366502 18.293393 8.099985 17.769044 6.3847656 16.265625 z "
class="ColorScheme-Text"/>
<path
style="fill:currentColor;fill-opacity:1;stroke:none"
d="M 16 13 A 2.9999907 2.9999907 0 0 0 13 16 A 2.9999907 2.9999907 0 0 0 16 19 A 2.9999907 2.9999907 0 0 0 19 16 A 2.9999907 2.9999907 0 0 0 16 13 z "
class="ColorScheme-NegativeText"
/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

+26
View File
@@ -0,0 +1,26 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22">
<defs id="defs3051">
<style type="text/css" id="current-color-scheme">
.ColorScheme-Text {
color:#4d4d4d;
}
.ColorScheme-Highlight {
color:#3daee9;
}
</style>
</defs>
<g
transform="translate(0,-1030.3622)">
<path
style="opacity:1;fill:currentColor;fill-opacity:1;stroke:none"
class="ColorScheme-Text"
d="M 11.126953 3.0019531 C 9.2851775 2.9719906 7.4335432 3.5755063 5.921875 4.8164062 C 2.8985906 7.2983061 2.1145626 11.6125 4.0703125 15 L 3.2050781 15.5 L 5.5039062 16.482422 L 5.8027344 14 L 4.9375 14.5 C 3.2230001 11.5304 3.9082004 7.7655436 6.5585938 5.5898438 C 9.2089874 3.4141439 13.034664 3.4761283 15.613281 5.7363281 L 16.271484 4.984375 C 14.800746 3.6952251 12.968729 3.0319156 11.126953 3.0019531 z M 16.494141 5.5195312 L 16.195312 8 L 17.0625 7.5 C 17.959107 9.0529689 18.193685 10.823632 17.839844 12.470703 C 18.160446 12.639467 18.458135 12.8441 18.720703 13.089844 C 19.259064 11.093388 19.024658 8.89995 17.927734 7 L 18.792969 6.5 L 16.494141 5.5195312 z M 11 6 L 7 10 L 9 10 L 9 15 L 12.144531 15 C 12.303295 14.3945 12.599063 13.848272 13 13.388672 L 13 10 L 15 10 L 11 6 z M 6.3847656 16.265625 L 5.7265625 17.017578 C 7.7928746 18.828768 10.571366 19.397714 13.089844 18.71875 C 12.844491 18.456567 12.641272 18.159893 12.472656 17.839844 C 10.366502 18.293393 8.099985 17.769043 6.3847656 16.265625 z "
transform="translate(0,1030.3622)"
id="path6941" />
<path
style="fill:currentColor;fill-opacity:1;stroke:none"
class="ColorScheme-Highlight"
d="m 19,1046.3622 a 2.9999907,2.9999907 0 0 1 -2.99999,3 2.9999907,2.9999907 0 0 1 -2.999991,-3 2.9999907,2.9999907 0 0 1 2.999991,-3 2.9999907,2.9999907 0 0 1 2.99999,3 z"
id="path7376" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

+27
View File
@@ -0,0 +1,27 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22">
<defs id="defs3051">
<style type="text/css" id="current-color-scheme">
.ColorScheme-Text {
color:#4d4d4d;
}
.ColorScheme-NeutralText {
color:#f67400;
}
</style>
</defs>
<g
transform="translate(0,-1030.3622)">
<path
style="opacity:1;fill:currentColor;fill-opacity:1;stroke:none"
d="M 11.126953 3.0019531 C 9.2851775 2.9719906 7.4335432 3.5755063 5.921875 4.8164062 C 2.8985906 7.2983061 2.1145626 11.6125 4.0703125 15 L 3.2050781 15.5 L 5.5039062 16.482422 L 5.8027344 14 L 4.9375 14.5 C 3.2230001 11.5304 3.9082004 7.7655436 6.5585938 5.5898438 C 9.2089874 3.4141439 13.034664 3.4761283 15.613281 5.7363281 L 16.271484 4.984375 C 14.800746 3.6952251 12.968729 3.0319156 11.126953 3.0019531 z M 16.494141 5.5195312 L 16.195312 8 L 17.0625 7.5 C 17.959107 9.0529689 18.193685 10.823632 17.839844 12.470703 C 18.160446 12.639467 18.458135 12.8441 18.720703 13.089844 C 19.259064 11.093388 19.024658 8.89995 17.927734 7 L 18.792969 6.5 L 16.494141 5.5195312 z M 11 6 L 7 10 L 9 10 L 9 15 L 12.144531 15 C 12.303295 14.3945 12.599063 13.848272 13 13.388672 L 13 10 L 15 10 L 11 6 z M 6.3847656 16.265625 L 5.7265625 17.017578 C 7.7928746 18.828768 10.571366 19.397714 13.089844 18.71875 C 12.844491 18.456567 12.641272 18.159893 12.472656 17.839844 C 10.366502 18.293393 8.099985 17.769043 6.3847656 16.265625 z "
transform="translate(0,1030.3622)"
id="path6941"
class="ColorScheme-Text" />
<path
style="fill:currentColor;fill-opacity:1;stroke:none"
class="ColorScheme-NeutralText"
d="m 19,1046.3622 a 2.9999907,2.9999907 0 0 1 -2.99999,3 2.9999907,2.9999907 0 0 1 -2.999991,-3 2.9999907,2.9999907 0 0 1 2.999991,-3 2.9999907,2.9999907 0 0 1 2.99999,3 z"
/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

+13
View File
@@ -0,0 +1,13 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22">
<defs id="defs3051">
<style type="text/css" id="current-color-scheme">
.ColorScheme-Text {
color:#4d4d4d;
}
</style>
</defs>
<path
style="opacity:1;fill:currentColor;fill-opacity:1;stroke:none"
d="M 11.126953 3.0019531 C 9.2851775 2.9719906 7.4335432 3.5755063 5.921875 4.8164062 C 2.8985906 7.2983061 2.1145626 11.6125 4.0703125 15 L 3.2050781 15.5 L 5.5039062 16.482422 L 5.8027344 14 L 4.9375 14.5 C 3.2230001 11.5304 3.9082004 7.7655436 6.5585938 5.5898438 C 9.2089874 3.4141439 13.034664 3.4761283 15.613281 5.7363281 L 16.271484 4.984375 C 14.800746 3.6952251 12.968729 3.0319156 11.126953 3.0019531 z M 16.494141 5.5195312 L 16.195312 8 L 17.0625 7.5 C 18.777 10.4696 18.089847 14.23641 15.439453 16.412109 C 12.789059 18.587809 8.963383 18.525825 6.3847656 16.265625 L 5.7265625 17.017578 C 8.6680383 19.595878 13.052835 19.667347 16.076172 17.185547 C 19.099457 14.703747 19.883484 10.3875 17.927734 7 L 18.792969 6.5 L 16.494141 5.5195312 z M 11 6 L 7 10 L 9 10 L 9 15 L 13 15 L 13 10 L 15 10 L 11 6 z "
class="ColorScheme-Text" />
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

+13
View File
@@ -0,0 +1,13 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
<defs id="defs3051">
<style type="text/css" id="current-color-scheme">
.ColorScheme-Text {
color:#4d4d4d;
}
</style>
</defs>
<path style="fill:currentColor;fill-opacity:1;stroke:none"
d="M 8 2 C 6.8911827 2 5.8599294 2.3193334 4.96875 2.84375 L 5.53125 3.40625 L 5.71875 3.59375 L 7.65625 5.53125 L 8.375 4.8125 L 6.75 3.1875 C 6.94534 3.1364099 7.1398623 3.0897842 7.34375 3.0625 C 7.3961563 3.0547113 7.4470287 3.0373165 7.5 3.03125 C 7.6680854 3.01418 7.827411 3 8 3 C 10.761424 3 13 5.2385759 13 8 C 13 8.243024 12.97155 8.4855082 12.9375 8.71875 C 12.917545 8.8549993 12.905714 8.9925532 12.875 9.125 C 12.80805 9.4115815 12.708353 9.672624 12.59375 9.9375 C 12.580478 9.9681753 12.576374 10.000899 12.5625 10.03125 C 12.521539 10.122908 12.454245 10.194583 12.40625 10.28125 C 12.401797 10.289291 12.410582 10.304303 12.40625 10.3125 L 13.15625 11.03125 C 13.680667 10.140071 14 9.108818 14 8 C 14 4.6862909 11.313707 2 8 2 z M 2.84375 4.96875 C 2.3193332 5.8599294 2 6.891182 2 8 C 2 11.313709 4.6862934 14 8 14 C 9.1088173 14 10.140071 13.680667 11.03125 13.15625 L 10.46875 12.59375 L 10.28125 12.40625 L 8.34375 10.5 L 7.65625 11.1875 L 9.25 12.8125 C 9.05466 12.86359 8.8601377 12.910216 8.65625 12.9375 C 8.6038437 12.945289 8.5529713 12.962684 8.5 12.96875 C 8.3319146 12.98582 8.172589 13 8 13 C 7.827411 13 7.6680854 12.98582 7.5 12.96875 C 7.3319147 12.95168 7.162744 12.939552 7 12.90625 C 4.7215847 12.440019 3 10.416246 3 8 C 3 7.7517374 3.0275593 7.5198138 3.0625 7.28125 C 3.0824555 7.1450007 3.0942865 7.0074468 3.125 6.875 C 3.1919502 6.5884185 3.2916465 6.327376 3.40625 6.0625 C 3.4192426 6.031782 3.4239145 5.9991506 3.4375 5.96875 C 3.4781185 5.8798895 3.5461122 5.8040145 3.59375 5.71875 L 3.59375 5.6875 L 2.84375 4.96875 z "
class="ColorScheme-Text"
/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

+43
View File
@@ -0,0 +1,43 @@
/* Copyright 2018 WobLight
*
* 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 <QApplication>
#include <QQmlApplicationEngine>
#include "control.h"
#include "addon.h"
#include <QIcon>
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
app.setApplicationDisplayName("Git Addons Manager");
QCoreApplication::setOrganizationName("GitAddonsManager");
QCoreApplication::setApplicationName("Git Addons Manager");
QIcon::setThemeName("breeze");
QQmlApplicationEngine engine;
qmlRegisterSingletonType<Control>("GitAddonsManager.engine",1,0,"Engine",[](QQmlEngine *, QJSEngine *)->QObject*{
return Control::instance();
});
qmlRegisterUncreatableType<Addon>("GitAddonsManager.engine",1,0,"Addon","");
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}
+297
View File
@@ -0,0 +1,297 @@
/* Copyright 2018 WobLight
*
* 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/>.
*/
import QtQuick 2.9
import GitAddonsManager.engine 1.0
import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.0
import QtQuick.Layouts 1.3
ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("Git Addon Updater")
id: window
property int availableUpdates: 0
Component.onCompleted: {
availableUpdates = Qt.binding(function(){
var count = 0
for (var i = 0; i < Engine.addons.length; i++) {
var addon = Engine.addons[i]
if (addon.gitStatus & Addon.Behind)
count = count + 1
}
return count
})
}
function updateAll() {
for (var i = 0; i < Engine.addons.length; i++) {
var addon = Engine.addons[i]
if (addon.gitStatus & Addon.Behind)
addon.update()
}
}
onAvailableUpdatesChanged: {
if (availableUpdates > 0) {
tray.showMessage("Addons updates available", "You have " + availableUpdates + " addons waiting for update.", 1, 5000)
} else {
tray.showMessage("Addons up to date", "All addons are updated", 1)
}
}
onClosing: {
if (Engine.minimizeToTray == Engine.MinimizeToTrayAsk) {
close.accepted = false
closeDialog.visible = true
} else if (Engine.minimizeToTray == Engine.MinimizeToTrayNo)
Qt.quit()
else if (Qt.platform.os == "windows")
window.visible = false
}
Action {
id: refreshAction
icon.name: "view-refresh"
onTriggered: Engine.scanForAddons()
shortcut: StandardKey.Refresh
}
Action {
id: addAction
icon.name: "list-add"
onTriggered: addDialog.visible = true
shortcut: StandardKey.New
}
Action {
id: updateAllAction
icon.name: availableUpdates > 0 ? "update-high" : "update-none"
onTriggered: updateAll()
enabled: availableUpdates > 0
}
Action {
id: openAddonsFolder
icon.name: "go-parent-folder"
onTriggered: Qt.openUrlExternally((Qt.platform.os == "windows" ? "file:///" : "file://")+Engine.addonsPath)
}
ColumnLayout{
anchors.fill: parent
TabBar {
Layout.fillWidth: true
id: bar
TabButton {
text: qsTr("Addons")
}
TabButton {
text: qsTr("Options")
}
TabButton {
text: qsTr("About")
}
}
StackLayout {
Layout.fillWidth: true
Layout.fillHeight: true
currentIndex: bar.currentIndex
AddonsPanel {
Layout.fillHeight: true
Layout.fillWidth: true
}
Options {
width: parent.width
}
ColumnLayout {
Label {
text: "Author: woblight <woblight@gmail.com>"
}
Label {
text: "Source code: <a href=https://gitlab.com/woblight/GitAddonsManager>GitLab</a>"
onLinkActivated: Qt.openUrlExternally(link)
textFormat: Text.RichText
}
}
}
}
FileDialog {
id: fileDialog
title: qsTr("Choose addons directory")
folder: Engine.addonsPath != "" ? Engine.addonsPath : shortcuts.home
onAccepted: Engine.addonsPath = fileUrl.toString().replace("file://","")
selectFolder: true
visible: Engine.addonsPath == ""
}
Dialog {
parent: ApplicationWindow.overlay
id: cloneHelpDialog
modal: true
visible: cloneHelpBtn.checked
x: (parent.width - width) / 2
y: (parent.height - height) / 2
title: qsTr("Clone URL Help")
ColumnLayout {
anchors.fill: parent
Label {
text: "Look for \"clone url\" on the repository webpage, it usually ends in .git"
}
Label { text: "Gitlab" }
Image {
source: "qrc:/gitlab_clone_url.jpg"
fillMode: Image.PreserveAspectCrop
Layout.fillHeight: true
Layout.fillWidth: true
}
Label { text: "Github" }
Image {
source: "qrc:/github_clone_url.jpg"
fillMode: Image.PreserveAspectCrop
Layout.fillHeight: true
Layout.fillWidth: true
}
}
}
Dialog {
width: window.width
x: (parent.width - width) / 2
y: (parent.height - height) / 2
id: addDialog
title: "Clone Repository"
standardButtons: Dialog.Ok | Dialog.Cancel
RowLayout {
anchors.fill: parent
TextField {
Layout.fillWidth: true
id: addField
placeholderText: "Git clone url"
onAccepted: addDialog.accept()
focus: visible
}
ToolButton {
id: cloneHelpBtn
icon.name: "help-whatsthis"
onClicked: cloneHelpDialog.visible = true
}
}
focus: visible
modal: true
onAccepted: {
Engine.clone(addField.text)
addField.clear()
}
onRejected: addField.clear()
}
Dialog {
x: (parent.width - width) / 2
y: (parent.height - height) / 2
title: Engine.statusMessage
id: cloningDialong
ProgressBar {
anchors.fill: parent
id: cloningBar
to: Engine.total
value: Engine.progress
indeterminate: to == 0
}
visible: Engine.status == Engine.Busy
modal: true
closePolicy: Popup.NoAutoClose
}
Dialog {
x: (parent.width - width) / 2
y: (parent.height - height) / 2
title: "An error occourred"
id: errorDialong
Label {
text: Engine.statusMessage
}
visible: Engine.status == Engine.Error
modal: true
closePolicy: Popup.NoAutoClose
standardButtons: Dialog.Ok
onClosed: Engine.status = Engine.Ready
}
Tray {
id: tray
}
Dialog {
x: (parent.width - width) / 2
y: (parent.height - height) / 2
visible: Engine.addonsPath != "" && !Engine.addonsPath.toLowerCase().match("interface/addons$")
title: qsTr("Warning")
Label {
anchors.fill: parent
text: qsTr("The path set for addons does not appear to be valid. Please make sure it is set to the Interface/AddOns folder inside your World of Warcraft folder.")
wrapMode: Text.WordWrap
}
modal: true
}
Dialog {
id: closeDialog
x: (parent.width - width) / 2
y: (parent.height - height) / 2
closePolicy: Popup.NoAutoClose
modal: true
title: qsTr("Choose closing behaviour")
Label {
text: qsTr("Your choise will be saved and be changed any time by the Options panel")
}
footer: DialogButtonBox {
Button {
text: "Close Application"
onClicked: {
Engine.minimizeToTray = Engine.MinimizeToTrayNo
Qt.quit()
}
DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
}
Button {
text: "Minimize in System Tray"
onClicked: {
Engine.minimizeToTray = Engine.MinimizeToTrayYes
close()
}
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
}
}
}
Dialog {
x: (parent.width - width) / 2
y: (parent.height - height) / 2
visible: Engine.firstBoot
onClosed: Engine.firstBoot = false
title: qsTr("Note on GitAddonsManager")
Label {
anchors.fill: parent
text: qsTr("Greetings,<br/>"+
"This application will manage <b>only</b> addons <b>cloned</b> with git, not regularly downloaded ones. <i><b>If you don't know what that means</b>, probably none of your current addons will be listed and only addons added through this aplication will be managed.</i><br/>"+
"With this application is <b>only possible</b> to clone (download) addons from <b>git repositories</b> (e.g. Gitlab and Github).<br/>Finally, this is an alpha version things might not go as intended.")
textFormat: Text.RichText
wrapMode: Text.WordWrap
}
modal: true
standardButtons: Dialog.Close
}
}
+23
View File
@@ -0,0 +1,23 @@
<RCC>
<qresource prefix="/">
<file>main.qml</file>
<file>Tray.qml</file>
<file>Options.qml</file>
<file>AddonUpdateButton.qml</file>
<file>AddonsPanel.qml</file>
<file>icons/breeze/svg/delete.svg</file>
<file>icons/breeze/svg/list-add.svg</file>
<file>icons/breeze/svg/overflow-menu.svg</file>
<file>icons/breeze/svg/update-high.svg</file>
<file>icons/breeze/svg/update-low.svg</file>
<file>icons/breeze/svg/update-medium.svg</file>
<file>icons/breeze/svg/update-none.svg</file>
<file>icons/breeze/svg/view-refresh.svg</file>
<file>icons/breeze/COPYING-ICONS</file>
<file>icons/breeze/index.theme</file>
<file>icons/breeze/svg/go-parent-folder.svg</file>
<file>icons/breeze/svg/help-whatsthis.svg</file>
<file>github_clone_url.jpg</file>
<file>gitlab_clone_url.jpg</file>
</qresource>
</RCC>