- a few new buttons

- started to implement new backend
This commit is contained in:
Dorian Zedler 2020-11-16 18:01:03 +01:00
parent d2a165a1ec
commit cacd1f5468
Signed by: dorian
GPG key ID: D3B255CB8BC7CD37
38 changed files with 2703 additions and 98 deletions

View file

@ -0,0 +1,91 @@
/****************************************************************************
** Modern Linbo GUI
** Copyright (C) 2020 Dorian Zedler <dorian@itsblue.de>
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU Affero 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#ifndef LINBOBACKEND_H
#define LINBOBACKEND_H
#include <QObject>
#include <QStringList>
#include <QtDebug>
#include <QProcess>
#include <vector>
#include <iostream>
#include <fstream>
#include <istream>
#include <stdlib.h>
#include "linboconfig.h"
#include "linboos.h"
#include "linboimage.h"
#include "linbodiskpartition.h"
using namespace std;
class LinboBackend : public QObject
{
Q_OBJECT
public:
explicit LinboBackend(QObject *parent = nullptr);
LinboConfig* getConfig();
QList<LinboOs*> getOperatingSystems();
protected:
void read_qstring(ifstream* input, QString& tmp );
void read_bool( ifstream* input, bool& tmp);
bool read_pair(ifstream* input, QString& key, QString& value);
bool toBool(const QString& value);
LinboOs* read_os(ifstream* input);
LinboDiskPartition* read_partition(ifstream* input);
void read_globals( ifstream* input, LinboConfig* config );
void saveappend( QStringList& command, const QString& item );
QStringList mksyncstartcommand(LinboConfig& config, LinboOs& os);
QStringList mksynccommand(LinboConfig& config, LinboOs& os);
QStringList mksyncrcommand(LinboConfig& config, LinboOs& os);
QStringList mkpartitioncommand(vector <LinboDiskPartition> &p);
QStringList mkpartitioncommand_noformat(vector <LinboDiskPartition> &p);
QStringList mkcacheinitcommand(LinboConfig& config, vector<LinboOs> &os, const QString& type);
QStringList mklinboupdatecommand(LinboConfig& config);
private:
LinboConfig* config;
QList<LinboOs*> operatingSystems;
QList<LinboDiskPartition*> diskPartitions;
QProcess* process;
void readFromStdout();
void readFromStderr();
void executeCommand(QStringList commandArgs, bool waitForFinished = true);
public slots:
void executeAutostart();
void shutdown();
void reboot();
bool startOs(LinboOs* os);
//bool syncStartOs();
//bool reinstallStartOs();
signals:
};
#endif // LINBOBACKEND_H

View file

@ -0,0 +1,82 @@
/****************************************************************************
** Modern Linbo GUI
** Copyright (C) 2020 Dorian Zedler <dorian@itsblue.de>
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU Affero 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#ifndef LINBOCONFIG_H
#define LINBOCONFIG_H
#include <QObject>
class LinboConfig : public QObject
{
Q_OBJECT
public:
explicit LinboConfig(QObject *parent = nullptr);
friend class LinboBackend;
const QString& getServer() const {return this->server;}
const QString& getIpAddress() const {return this->ipAddress;}
const QString& getMacAddress() const {return this->macAddress;}
const QString& getVersion() const {return this->version;}
const QString& getHostname() const {return this->hostname;}
const QString& getCpu() const {return this->cpu;}
const QString& getRamSize() const {return this->ramSize;}
const QString& getCacheSize() const {return this->cacheSize;}
const QString& getHddSize() const {return this->hddSize;}
const QString& getCache() const {return this->cache;}
const QString& getHostgroup() const {return this->hostgroup;}
const unsigned int& getRootTimeout() const {return this->rootTimeout;}
const bool& getAutopartition() {return this->autoPartition;}
const bool& getAutoInitCache() {return this->autoInitCache;}
const QString& getBackgroundFontcolor() {return this->backgroundFontcolor;}
const QString& getConsoleFontcolorStdout() {return this->consoleFontcolorStdout;}
const QString& getConsoleFontcolorStderr() {return this->consoleFontcolorStderr;}
const QString& getDownloadType() {return this->downloadType;}
const bool& getAutoFormat() {return this->autoFormat;}
protected:
void setServer( const QString& server ) {this->server = server;}
void setIpAddress( const QString& ipAddress ) {this->ipAddress = ipAddress;}
void setMacAddress( const QString& macAddress ) {this->macAddress = macAddress;}
void setVersion( const QString& version ) {this->version = version;}
void setHostname( const QString& hostname ) {this->hostname = hostname;}
void setCpu( const QString& cpu ) {this->cpu = cpu;}
void setRamSize( const QString& ramSize ) {this->ramSize = ramSize;}
void setCacheSize( const QString& cacheSize ) {this->cacheSize = cacheSize;}
void setHddSize( const QString& hddSize ) {this->hddSize = hddSize;}
void setCache( const QString& cache ) {this->cache = cache;}
void setHostgroup( const QString& hostgroup ) {this->hostgroup = hostgroup;}
void setRootTimeout( const unsigned int& rootTimeout ) {this->rootTimeout = rootTimeout;}
void setAutopartition( const bool& autoPartition ){this->autoPartition = autoPartition;}
void setAutoInitCache( const bool& autoInitCache ){this->autoInitCache = autoInitCache;}
void setBackgroundFontcolor( const QString& backgroundFontcolor ){this->backgroundFontcolor = backgroundFontcolor;}
void setConsoleFontcolorStdout( const QString& consoleFontcolorStdout ){this->consoleFontcolorStdout = consoleFontcolorStdout;}
void setConsoleFontcolorStderr( const QString& consoleFontcolorStderr ){this->consoleFontcolorStderr = consoleFontcolorStderr;}
void setDownloadType( const QString& downloadType ){this->downloadType = downloadType;}
void setAutoFormat( const bool& autoFormat ){this->autoFormat = autoFormat;}
private:
QString server, ipAddress, macAddress, version, hostname, cpu, ramSize, cacheSize, hddSize, cache, hostgroup, downloadType, backgroundFontcolor, consoleFontcolorStdout, consoleFontcolorStderr;
unsigned int rootTimeout;
bool autoPartition, autoInitCache, autoFormat;
signals:
};
#endif // LINBOCONFIG_H

View file

@ -0,0 +1,54 @@
/****************************************************************************
** Modern Linbo GUI
** Copyright (C) 2020 Dorian Zedler <dorian@itsblue.de>
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU Affero 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#ifndef LINBODISKPARTITION_H
#define LINBODISKPARTITION_H
#include <QObject>
class LinboDiskPartition : public QObject
{
Q_OBJECT
public:
explicit LinboDiskPartition(QObject *parent = nullptr);
friend class LinboBackend;
const QString& getPath() const {return this->path;}
const QString& getId() const {return this->id;}
const QString& getFstype() const {return this->fstype;}
const unsigned int& getSize() const {return this->size;}
const bool& getBootable() const {return this->bootable;}
protected:
void setPath( const QString& path ) {this->path = path;}
void setId( const QString& id ) {this->id = id;}
void setFstype( const QString& fstype ) {this->fstype = fstype;}
void setSize( const unsigned int& size ) {this->size = size;}
void setBootable( const bool& bootable ) {this->bootable = bootable;}
private:
QString path, id, fstype;
unsigned int size;
bool bootable;
signals:
};
#endif // LINBODISKPARTITION_H

View file

@ -0,0 +1,46 @@
/****************************************************************************
** Modern Linbo GUI
** Copyright (C) 2020 Dorian Zedler <dorian@itsblue.de>
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU Affero 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#ifndef LINBOIMAGE_H
#define LINBOIMAGE_H
#include <QObject>
class LinboImage : public QObject
{
Q_OBJECT
public:
explicit LinboImage(QString name, QObject *parent = nullptr);
friend class LinboBackend;
const QString& getDescription() const {return this->description;}
const QString& getName() const {return this->name;}
protected:
void setDescription (const QString& description) {this->description = description;}
void setName(const QString& name) {this->name = name;}
private:
QString name,
description;
};
#endif // LINBOIMAGE_H

94
headers/backend/linboos.h Normal file
View file

@ -0,0 +1,94 @@
/****************************************************************************
** Modern Linbo GUI
** Copyright (C) 2020 Dorian Zedler <dorian@itsblue.de>
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU Affero 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#ifndef LINBOOS_H
#define LINBOOS_H
#include <QObject>
#include "linboimage.h"
class LinboOs : public QObject
{
Q_OBJECT
public:
explicit LinboOs(QObject *parent = nullptr);
friend class LinboBackend;
const QString& getName() const {return this->name;}
const QString& getDescription() const {return this->description;}
const QString& getVersion() const {return this->version;}
const LinboImage* getBaseImage() const {return this->baseImage;}
const LinboImage* getDifferentialImage() const {return this->differentialImage;}
const QString& getIconName() const {return this->iconName;}
const QString& getRootPartition() const {return this->rootPartition;}
const QString& getBootPartition() const {return this->bootPartition;}
const QString& getKernel() const {return this->kernel;}
const QString& getInitrd() const {return this->initrd;}
const QString& getKernelOptions() const {return this->kernelOptions;}
const bool& getSyncbutton() const {return this->syncButton;}
const bool& getStartbutton() const {return this->startButton;}
const bool& getNewbutton() const {return this->newButton;}
const bool& getAutostart() const {return this->autostart;}
const int& getAutostartTimeout() const {return this->autostartTimeout;}
const QString& getDefaultAction() const {return this->defaultAction;}
const bool& getHidden() const {return this->hidden;}
protected:
void setName( const QString& name ) {this->name = name;}
void setDescription ( const QString& description ) {this->description = description;}
void setVersion( const QString& version ) {this->version = version;}
void setBaseImage( LinboImage* baseImage ) {this->baseImage = baseImage;}
void setDifferentialImage(LinboImage* differentialImage) {this->differentialImage = differentialImage;}
void setIconName( const QString& iconName ) {this->iconName = iconName;}
void setRootPartition( const QString& rootPartition ) {this->rootPartition = rootPartition;}
void setBootPartition( const QString& bootPartition ) {this->bootPartition = bootPartition;}
void setKernel( const QString& kernel ) {this->kernel = kernel;}
void setInitrd( const QString& initrd ) {this->initrd = initrd;}
void setKernelOptions( const QString& kernelOptions ) {this->kernelOptions = kernelOptions;}
void setSyncButton ( const bool& syncButton ) {this->syncButton = syncButton;}
void setStartButton( const bool& startButton) {this->startButton = startButton;}
void setNewButton ( const bool& newButton ) {this->newButton = newButton;}
void setAutostart ( const bool& autostart ) {this->autostart = autostart;}
void setAutostartTimeout ( const int& autostartTimeout ) {this->autostartTimeout = autostartTimeout;}
void setDefaultAction ( const QString& defaultAction ) {this->defaultAction = defaultAction;}
void setHidden ( const bool& hidden ) {this->hidden = hidden;}
private:
QString name, // OS Name
version,
description,
iconName, // Thumbnail for Image
rootPartition, // Root partition
bootPartition, // Root partition
image,
kernel,
initrd,
kernelOptions,
defaultAction;
int autostartTimeout;
bool syncButton, startButton, newButton, autostart,
hidden; // show OS tab or not
LinboImage* baseImage;
LinboImage* differentialImage;
};
#endif // LINBOOS_H

View file

@ -1,3 +1,21 @@
/****************************************************************************
** Modern Linbo GUI
** Copyright (C) 2020 Dorian Zedler <dorian@itsblue.de>
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU Affero 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#ifndef LINBOGUI_H
#define LINBOGUI_H
@ -9,14 +27,21 @@
#include "linboGUIImpl.hh"
#include "linbostartpage.h"
#include "linbobackend.h"
class linboGui : public QDialog
class LinboGui : public QDialog
{
Q_OBJECT
public:
linboGui();
LinboGui();
void done(int r) override;
private:
LinboBackend* backend;
private slots:
void startOs();
};
#endif // LINBOGUI_H

View file

@ -1,14 +1,38 @@
/****************************************************************************
** Modern Linbo GUI
** Copyright (C) 2020 Dorian Zedler <dorian@itsblue.de>
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU Affero 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#ifndef LINBOOSSELECTBUTTON_H
#define LINBOOSSELECTBUTTON_H
#include <QObject>
#include "qmodernpushbutton.h"
#include "linboos.h"
class LinboOsSelectButton : public QModernPushButton
{
Q_OBJECT
public:
LinboOsSelectButton(QString icon, QWidget* parent = nullptr);
LinboOsSelectButton(QString icon, LinboOs* os, QWidget* parent = nullptr);
LinboOs* getOs();
private:
LinboOs* os;
};
#endif // LINBOOSSELECTBUTTON_H

View file

@ -1,3 +1,21 @@
/****************************************************************************
** Modern Linbo GUI
** Copyright (C) 2020 Dorian Zedler <dorian@itsblue.de>
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU Affero 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#ifndef LINBOGUISTARTPAGE_H
#define LINBOGUISTARTPAGE_H

View file

@ -1,3 +1,21 @@
/****************************************************************************
** Modern Linbo GUI
** Copyright (C) 2020 Dorian Zedler <dorian@itsblue.de>
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU Affero 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#ifndef QMODERNPUSHBUTTON_H
#define QMODERNPUSHBUTTON_H
@ -10,7 +28,7 @@
#include <QString>
#include <QDebug>
class QModernPushButton : public QPushButton
class QModernPushButton : public QAbstractButton
{
Q_OBJECT
public:
@ -18,10 +36,20 @@ public:
protected:
void resizeEvent(QResizeEvent *event) override;
void paintEvent(QPaintEvent *e) override;
void keyPressEvent(QKeyEvent *e) override;
void keyReleaseEvent(QKeyEvent *e) override;
void enterEvent(QEvent *e) override;
void leaveEvent(QEvent *e) override;
void mousePressEvent(QMouseEvent *e) override;
void mouseReleaseEvent(QMouseEvent *e) override;
private:
QSvgWidget* svgWidget;
QSvgWidget* overlayNormalWidget;
QSvgWidget* overlayHoveredWidget;
QGraphicsOpacityEffect* overlayHoveredEffect;
QSvgWidget* overlayPressedWidget;
QGraphicsOpacityEffect* overlayPressedEffect;
QSvgWidget* overlayCheckedWidget;
QGraphicsOpacityEffect* overlayCheckedEffect;
@ -29,8 +57,6 @@ private:
private slots:
void handleToggled(bool checked);
QString generateStyleSheet();
};
#endif // QMODERNPUSHBUTTON_H

View file

@ -14,10 +14,15 @@ target.path = /usr/bin
INCLUDEPATH += \
headers/ \
headers/backend \
headers/legacy
# Input
HEADERS += \
headers/backend/linboconfig.h \
headers/backend/linbodiskpartition.h \
headers/backend/linboimage.h \
headers/backend/linboos.h \
headers/legacy/image_description.hh \
headers/legacy/linboConsoleImpl.hh \
headers/legacy/linboCounterImpl.hh \
@ -34,16 +39,22 @@ HEADERS += \
headers/legacy/linboLogConsole.hh \
headers/legacy/linboRegisterBoxImpl.hh \
headers/legacy/linboYesNoImpl.hh \
headers/backend/linbobackend.h \
headers/linbogui.h \
headers/linboosselectbutton.h \
headers/linbostartpage.h \
headers/qmodernpushbutton.h
SOURCES += \
sources/backend/linboconfig.cpp \
sources/backend/linbodiskpartition.cpp \
sources/backend/linboimage.cpp \
sources/backend/linboos.cpp \
sources/legacy/image_description.cc \
sources/legacy/linboConsoleImpl.cc \
sources/legacy/linboCounterImpl.cc \
sources/legacy/linboGUIImpl.cc \
sources/legacy/linboGUIImplTmp.cpp \
sources/legacy/linboImageSelectorImpl.cc \
sources/legacy/linboImageUploadImpl.cc \
sources/legacy/linboInfoBrowserImpl.cc \
@ -56,6 +67,7 @@ SOURCES += \
sources/legacy/linboLogConsole.cc \
sources/legacy/linboRegisterBoxImpl.cc \
sources/legacy/linboYesNoImpl.cc \
sources/backend/linbobackend.cpp \
sources/linbogui.cpp \
sources/linboosselectbutton.cpp \
sources/linbostartpage.cpp \

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.13.2, 2020-11-16T00:29:24. -->
<!-- Written by QtCreator 4.13.2, 2020-11-16T18:00:23. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>

View file

@ -22,5 +22,9 @@
<file>svgIcons/syncAction.svg</file>
<file>svgIcons/resetAction.svg</file>
<file>svgIcons/overlayNormal.svg</file>
<file>svgIcons/overlayPressed.svg</file>
<file>svgIcons/shutdownAction.svg</file>
<file>svgIcons/rebootAction.svg</file>
<file>svgIcons/settingsAction.svg</file>
</qresource>
</RCC>

View file

@ -1 +0,0 @@
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="check" class="svg-inline--fa fa-check fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"></path></svg>

Before

Width:  |  Height:  |  Size: 504 B

View file

@ -0,0 +1,37 @@
<?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"
width="132.29167mm"
height="132.29167mm"
viewBox="0 0 132.29167 132.29167"
version="1.1"
id="svg836">
<defs
id="defs830" />
<metadata
id="metadata833">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1">
<rect
style="fill:#000000;fill-opacity:0.11127;stroke:none;stroke-width:3.96875;stroke-linecap:round"
id="rect1399"
width="132.29167"
height="132.29167"
x="0"
y="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 981 B

View file

@ -1 +0,0 @@
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="play" class="svg-inline--fa fa-play fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"></path></svg>

Before

Width:  |  Height:  |  Size: 339 B

View file

@ -1 +0,0 @@
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="power-off" class="svg-inline--fa fa-power-off fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M400 54.1c63 45 104 118.6 104 201.9 0 136.8-110.8 247.7-247.5 248C120 504.3 8.2 393 8 256.4 7.9 173.1 48.9 99.3 111.8 54.2c11.7-8.3 28-4.8 35 7.7L162.6 90c5.9 10.5 3.1 23.8-6.6 31-41.5 30.8-68 79.6-68 134.9-.1 92.3 74.5 168.1 168 168.1 91.6 0 168.6-74.2 168-169.1-.3-51.8-24.7-101.8-68.1-134-9.7-7.2-12.4-20.5-6.5-30.9l15.8-28.1c7-12.4 23.2-16.1 34.8-7.8zM296 264V24c0-13.3-10.7-24-24-24h-32c-13.3 0-24 10.7-24 24v240c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24z"></path></svg>

Before

Width:  |  Height:  |  Size: 701 B

View file

@ -0,0 +1,62 @@
<?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"
aria-hidden="true"
focusable="false"
data-prefix="fas"
data-icon="redo-alt"
class="svg-inline--fa fa-redo-alt fa-w-16"
role="img"
viewBox="0 0 500 500"
version="1.1"
id="svg4"
sodipodi:docname="rebootAction.svg"
width="500"
height="500"
inkscape:version="1.0.1 (0767f8302a, 2020-10-17)">
<metadata
id="metadata10">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs8" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1245"
inkscape:window-height="1376"
id="namedview6"
showgrid="false"
inkscape:zoom="1"
inkscape:cx="256"
inkscape:cy="256"
inkscape:window-x="70"
inkscape:window-y="27"
inkscape:window-maximized="0"
inkscape:current-layer="svg4" />
<path
fill="currentColor"
d="m 250.2752,100.00012 c 40.08206,0.072 76.47399,15.86674 103.34214,41.54335 l 21.60181,-21.60182 C 384.36431,110.7971 400,117.27371 400,130.20637 v 81.08407 c 0,8.01714 -6.49899,14.51613 -14.51613,14.51613 H 304.3998 c -12.93266,0 -19.40928,-15.63568 -10.26472,-24.78084 L 319.3871,175.77371 C 300.71935,158.29448 276.56391,148.61222 250.90121,148.39085 195.01532,147.90819 147.90746,193.135 148.39073,250.87593 148.84919,305.65073 193.25645,351.61302 250,351.61302 c 24.8752,0 48.38528,-8.87782 66.9127,-25.13467 2.86875,-2.51674 7.20121,-2.36371 9.9,0.33447 l 23.98911,23.98912 c 2.94678,2.94677 2.80101,7.751 -0.29153,10.54415 -26.59778,24.0248 -61.84536,38.65403 -100.51028,38.65403 -82.84234,0 -149.9994,-67.15706 -150,-149.99879 -6.05e-4,-82.74738 67.52782,-150.149393 150.2752,-150.00121 z"
id="path2"
style="stroke-width:10;stroke:#ffffff;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" />
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -1 +0,0 @@
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="recycle" class="svg-inline--fa fa-recycle fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M184.561 261.903c3.232 13.997-12.123 24.635-24.068 17.168l-40.736-25.455-50.867 81.402C55.606 356.273 70.96 384 96.012 384H148c6.627 0 12 5.373 12 12v40c0 6.627-5.373 12-12 12H96.115c-75.334 0-121.302-83.048-81.408-146.88l50.822-81.388-40.725-25.448c-12.081-7.547-8.966-25.961 4.879-29.158l110.237-25.45c8.611-1.988 17.201 3.381 19.189 11.99l25.452 110.237zm98.561-182.915l41.289 66.076-40.74 25.457c-12.051 7.528-9 25.953 4.879 29.158l110.237 25.45c8.672 1.999 17.215-3.438 19.189-11.99l25.45-110.237c3.197-13.844-11.99-24.719-24.068-17.168l-40.687 25.424-41.263-66.082c-37.521-60.033-125.209-60.171-162.816 0l-17.963 28.766c-3.51 5.62-1.8 13.021 3.82 16.533l33.919 21.195c5.62 3.512 13.024 1.803 16.536-3.817l17.961-28.743c12.712-20.341 41.973-19.676 54.257-.022zM497.288 301.12l-27.515-44.065c-3.511-5.623-10.916-7.334-16.538-3.821l-33.861 21.159c-5.62 3.512-7.33 10.915-3.818 16.536l27.564 44.112c13.257 21.211-2.057 48.96-27.136 48.96H320V336.02c0-14.213-17.242-21.383-27.313-11.313l-80 79.981c-6.249 6.248-6.249 16.379 0 22.627l80 79.989C302.689 517.308 320 510.3 320 495.989V448h95.88c75.274 0 121.335-82.997 81.408-146.88z"></path></svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -1 +0,0 @@
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="redo-alt" class="svg-inline--fa fa-redo-alt fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M256.455 8c66.269.119 126.437 26.233 170.859 68.685l35.715-35.715C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.75c-30.864-28.899-70.801-44.907-113.23-45.273-92.398-.798-170.283 73.977-169.484 169.442C88.764 348.009 162.184 424 256 424c41.127 0 79.997-14.678 110.629-41.556 4.743-4.161 11.906-3.908 16.368.553l39.662 39.662c4.872 4.872 4.631 12.815-.482 17.433C378.202 479.813 319.926 504 256 504 119.034 504 8.001 392.967 8 256.002 7.999 119.193 119.646 7.755 256.455 8z"></path></svg>

Before

Width:  |  Height:  |  Size: 781 B

View file

@ -43,8 +43,8 @@
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1850"
inkscape:window-height="1016"
inkscape:window-width="1245"
inkscape:window-height="1376"
id="namedview6"
showgrid="false"
inkscape:zoom="1"
@ -52,11 +52,11 @@
inkscape:cy="256"
inkscape:window-x="70"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:window-maximized="0"
inkscape:current-layer="svg4"
inkscape:document-rotation="0" />
<path
d="m 208.14107,253.45876 c 1.89377,8.20136 -7.10331,14.43455 -14.10234,10.05936 l -23.86876,-14.91501 -29.8049,47.69639 c -7.7836,12.45408 1.21289,28.70034 15.8918,28.70034 h 30.46174 c 3.88301,0 7.03125,3.14823 7.03125,7.03122 v 23.43745 c 0,3.88301 -3.14824,7.03125 -7.03125,7.03125 h -30.40138 c -44.14104,0 -71.075433,-48.66085 -47.70003,-86.06233 l 29.77852,-47.68818 -23.86231,-14.9109 c -7.07871,-4.42206 -5.25351,-15.2115 2.85879,-17.08473 l 64.59202,-14.91207 c 5.04552,-1.16486 10.07873,1.98105 11.24357,7.02537 z m 57.75064,-107.17651 24.19279,38.71632 -23.87112,14.91618 c -7.06113,4.41091 -5.27343,15.20679 2.85879,17.08473 l 64.59204,14.91207 c 5.08125,1.17129 10.08692,-2.01444 11.24355,-7.02537 l 14.91213,-64.59186 c 1.87323,-8.1117 -7.0254,-14.48376 -14.10235,-10.05936 l -23.84006,14.89686 -24.17755,-38.71987 c -21.98498,-35.175491 -73.36471,-35.256361 -95.40007,0 l -10.5252,16.85506 c -2.05663,3.29296 -1.05468,7.62948 2.23829,9.68728 l 19.87443,12.41892 c 3.29296,2.05781 7.63125,1.05644 9.68907,-2.23651 l 10.52401,-16.84157 c 7.44846,-11.91854 24.59359,-11.52889 31.79125,-0.0135 z m 125.48796,130.15518 -16.12208,-25.81928 c -2.05722,-3.29472 -6.39609,-4.29726 -9.69024,-2.23887 l -19.84044,12.39783 c -3.29298,2.05781 -4.29492,6.39549 -2.23711,9.68904 l 16.15078,25.84682 c 7.76778,12.42831 -1.20526,28.68744 -15.9,28.68744 H 287.49993 V 296.8866 c 0,-8.32791 -10.10274,-12.52907 -16.00373,-6.62868 l -46.87503,46.86376 c -3.66152,3.66093 -3.66152,9.59706 0,13.25799 l 46.87503,46.86845 c 5.86056,5.86171 16.00373,1.75546 16.00373,-6.62987 v -28.11849 h 56.17972 c 44.10588,0 71.09475,-48.63097 47.70002,-86.06233 z"
id="path2"
style="fill:#000000;fill-opacity:1;stroke-width:0.585938" />
style="fill:#000000;fill-opacity:1;stroke-width:10;stroke:#ffffff;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" />
</svg>

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

@ -0,0 +1,62 @@
<?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"
aria-hidden="true"
focusable="false"
data-prefix="fas"
data-icon="tools"
class="svg-inline--fa fa-tools fa-w-16"
role="img"
viewBox="0 0 500 500"
version="1.1"
id="svg4"
sodipodi:docname="settingAction.svg"
width="500"
height="500"
inkscape:version="1.0.1 (0767f8302a, 2020-10-17)">
<metadata
id="metadata10">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs8" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1245"
inkscape:window-height="1376"
id="namedview6"
showgrid="false"
inkscape:zoom="1"
inkscape:cx="256"
inkscape:cy="256"
inkscape:window-x="70"
inkscape:window-y="27"
inkscape:window-maximized="0"
inkscape:current-layer="svg4" />
<path
fill="currentColor"
d="m 393.62623,331.83283 -68.60946,-68.60658 c -13.5344,-13.53384 -33.74812,-16.1703 -50.03628,-8.14374 L 212.52303,192.62767 V 156.24451 L 137.52721,100 l -37.49791,37.49634 56.24686,74.99267 h 36.3847 l 62.45746,62.45484 c -7.96831,16.28748 -5.39033,36.50034 8.14407,50.03418 l 68.60947,68.60658 c 8.55421,8.55385 22.38156,8.55385 30.87718,0 l 30.87719,-30.87589 c 8.49562,-8.55385 8.49562,-22.38063 0,-30.87589 z M 294.37394,231.82306 c 16.58111,0 32.16618,6.44469 43.88428,18.16229 l 11.36655,11.36608 c 9.2573,-4.04257 18.04587,-9.66702 25.66264,-17.28347 21.73707,-21.73616 29.11947,-52.31911 22.20579,-80.08983 -1.28899,-5.27292 -7.90971,-7.08915 -11.77669,-3.22234 l -43.59132,43.58949 -39.78294,-6.62045 -6.62072,-39.78127 43.59132,-43.58949 c 3.86697,-3.86681 1.99207,-10.48726 -3.33966,-11.83478 -27.77189,-6.854803 -58.35613,0.52729 -80.03461,22.20486 -16.69829,16.69759 -24.54941,38.72669 -24.13928,60.6972 l 48.10279,48.10077 c 4.74583,-1.11318 9.66743,-1.69906 14.47185,-1.69906 z m -60.87551,48.04219 -33.22081,-33.21941 -89.2919,89.34674 c -14.647625,14.64701 -14.647625,38.37516 0,53.02216 14.64762,14.64701 38.37677,14.64701 53.02439,0 l 72.41784,-72.4148 c -4.45288,-11.65902 -5.80046,-24.37262 -2.92952,-36.73469 z m -95.97122,96.67024 c -7.73395,0 -14.06172,-6.3275 -14.06172,-14.06112 0,-7.79221 6.26918,-14.06113 14.06172,-14.06113 7.79253,0 14.06172,6.26892 14.06172,14.06113 0,7.73362 -6.26919,14.06112 -14.06172,14.06112 z"
id="path2"
style="stroke-width:5;stroke:#ffffff;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" />
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

@ -0,0 +1,62 @@
<?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"
aria-hidden="true"
focusable="false"
data-prefix="fas"
data-icon="power-off"
class="svg-inline--fa fa-power-off fa-w-16"
role="img"
viewBox="0 0 500 500"
version="1.1"
id="svg4"
sodipodi:docname="shutdownAction.svg"
width="500"
height="500"
inkscape:version="1.0.1 (0767f8302a, 2020-10-17)">
<metadata
id="metadata10">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs8" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1245"
inkscape:window-height="1376"
id="namedview6"
showgrid="false"
inkscape:zoom="1"
inkscape:cx="256"
inkscape:cy="256"
inkscape:window-x="70"
inkscape:window-y="27"
inkscape:window-maximized="0"
inkscape:current-layer="svg4" />
<path
fill="currentColor"
d="m 335.71424,132.20234 c 37.49995,26.78568 61.90469,70.59516 61.90469,120.17843 0,81.42847 -65.9523,147.4403 -147.32125,147.61887 -81.24991,0.17857 -147.79745,-66.07135 -147.9165,-147.38078 -0.0595,-49.58327 24.34521,-93.51179 61.78564,-120.35699 6.96428,-4.94047 16.66665,-2.85714 20.83331,4.58332 l 9.40476,16.72617 c 3.5119,6.25 1.84523,14.16665 -3.92858,18.45236 -24.70235,18.33331 -40.47614,47.3809 -40.47614,80.29753 -0.0595,54.94041 44.34519,100.0594 99.99989,100.0594 54.52374,0 100.35702,-44.16661 99.99988,-100.65464 -0.17857,-30.8333 -14.70237,-60.59517 -40.53567,-79.76181 -5.7738,-4.28571 -7.38094,-12.20237 -3.86904,-18.39284 l 9.40475,-16.72617 c 4.16666,-7.38094 13.80951,-9.58332 20.71426,-4.64285 z M 273.80955,257.14267 V 114.2857 c 0,-7.91666 -6.36904,-14.2857 -14.2857,-14.2857 h -19.04759 c -7.91666,0 -14.2857,6.36904 -14.2857,14.2857 v 142.85697 c 0,7.91666 6.36904,14.2857 14.2857,14.2857 h 19.04759 c 7.91666,0 14.2857,-6.36904 14.2857,-14.2857 z"
id="path2"
style="stroke-width:10;stroke:#ffffff;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" />
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

View file

@ -43,20 +43,20 @@
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1850"
inkscape:window-height="1016"
inkscape:window-width="1245"
inkscape:window-height="1376"
id="namedview6"
showgrid="false"
inkscape:zoom="0.84960938"
inkscape:zoom="1"
inkscape:cx="224"
inkscape:cy="256"
inkscape:window-x="70"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:window-maximized="0"
inkscape:current-layer="svg4"
inkscape:document-rotation="0" />
<path
d="M 376.87408,227.56198 184.94499,114.09481 c -15.59423,-9.21478 -39.47633,-0.27263 -39.47633,22.51896 v 226.87982 c 0,20.44699 22.1918,32.7697 39.47633,22.51894 L 376.87408,272.59989 c 17.12095,-10.08718 17.17546,-34.95072 0,-45.03791 z"
d="M 358.1199,229.32915 180.36724,124.24299 c -14.44239,-8.53415 -36.56049,-0.25249 -36.56049,20.85565 v 210.12183 c 0,18.93672 20.55265,30.34924 36.56049,20.85563 L 358.1199,271.04044 c 15.85635,-9.34212 15.90684,-32.36916 0,-41.71129 z"
id="path2"
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:20.9386;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:30;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</svg>

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -1 +0,0 @@
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="sync-alt" class="svg-inline--fa fa-sync-alt fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M370.72 133.28C339.458 104.008 298.888 87.962 255.848 88c-77.458.068-144.328 53.178-162.791 126.85-1.344 5.363-6.122 9.15-11.651 9.15H24.103c-7.498 0-13.194-6.807-11.807-14.176C33.933 94.924 134.813 8 256 8c66.448 0 126.791 26.136 171.315 68.685L463.03 40.97C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.749zM32 296h134.059c21.382 0 32.09 25.851 16.971 40.971l-41.75 41.75c31.262 29.273 71.835 45.319 114.876 45.28 77.418-.07 144.315-53.144 162.787-126.849 1.344-5.363 6.122-9.15 11.651-9.15h57.304c7.498 0 13.194 6.807 11.807 14.176C478.067 417.076 377.187 504 256 504c-66.448 0-126.791-26.136-171.315-68.685L48.97 471.03C33.851 486.149 8 475.441 8 454.059V320c0-13.255 10.745-24 24-24z"></path></svg>

Before

Width:  |  Height:  |  Size: 998 B

View file

@ -43,20 +43,20 @@
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1850"
inkscape:window-height="1016"
inkscape:window-width="1245"
inkscape:window-height="1376"
id="namedview6"
showgrid="false"
inkscape:zoom="1.2015291"
inkscape:zoom="1"
inkscape:cx="256"
inkscape:cy="256"
inkscape:window-x="70"
inkscape:window-x="1315"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:window-maximized="0"
inkscape:current-layer="svg4"
inkscape:document-rotation="0" />
<path
d="m 319.3871,175.7742 c -18.90847,-17.70485 -43.44678,-27.41009 -69.47904,-27.38709 -46.84959,0.0411 -87.29517,32.1641 -98.46229,76.72378 -0.81291,3.24375 -3.70283,5.53427 -7.04699,5.53427 h -34.65906 c -4.53508,0 -7.98024,-4.11715 -7.14133,-8.57418 C 115.68527,152.575 176.7014,100 250,100 c 40.19032,0 76.6881,15.80806 103.61794,41.54336 l 21.60182,-21.60183 C 384.36432,110.79698 400,117.27359 400,130.20625 v 81.08407 c 0,8.01714 -6.49899,14.51614 -14.51613,14.51614 h -81.08408 c -12.93265,0 -19.40928,-15.63569 -10.26471,-24.78086 z m -204.87097,98.41934 h 81.08407 c 12.93266,0 19.40928,15.63569 10.26471,24.78086 l -25.25202,25.25201 c 18.90848,17.70544 43.4486,27.4107 69.48146,27.3871 46.82541,-0.0423 87.2873,-32.14355 98.45988,-76.72319 0.81291,-3.24375 3.70283,-5.53428 7.04699,-5.53428 h 34.65967 c 4.53508,0 7.98024,4.11714 7.14134,8.5742 C 384.31473,347.425 323.29859,400 250,400 209.80967,400 173.31189,384.19194 146.38205,358.45665 l -21.60181,21.60183 C 115.63568,389.20302 100,382.7264 100,369.79375 v -81.08407 c 0,-8.01714 6.49899,-14.51613 14.51613,-14.51614 z"
id="path2"
style="fill:#000000;fill-opacity:1;stroke-width:0.604839" />
style="fill:#000000;fill-opacity:1;stroke-width:15;stroke:#ffffff;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" />
</svg>

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View file

@ -0,0 +1,416 @@
/****************************************************************************
** Modern Linbo GUI
** Copyright (C) 2020 Dorian Zedler <dorian@itsblue.de>
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU Affero 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#include "linbobackend.h"
#define LINBO_CMD(arg) QStringList("linbo_cmd") << (arg);
using namespace std;
LinboBackend::LinboBackend(QObject *parent) : QObject(parent)
{
this->config = new LinboConfig(this);
// read start.conf
qDebug() << "Starting to parse start.conf";
ifstream input;
input.open( "start.conf", ios_base::in );
QString tmp_qstring;
while( !input.eof() ) {
// *** Image description section ***
// entry in start tab
read_qstring(&input, tmp_qstring);
if ( tmp_qstring.startsWith("#") || tmp_qstring.isEmpty() ) continue;
tmp_qstring = tmp_qstring.section("#",0,0).stripWhiteSpace(); // Strip comment
if(tmp_qstring.lower().compare("[os]") == 0) {
LinboOs* tmpOs = read_os(&input);
if(!tmpOs->getName().isEmpty()) {
this->operatingSystems.append(tmpOs);
// check if this is an additional/incremental image for an existing OS
/* TODO unsigned int i; // Being checked later.
for(i = 0; i < elements.size(); i++ ) {
if(tmp_os.get_name().lower().compare(elements[i].get_name().lower()) == 0) {
elements[i].image_history.push_back(tmp_image); break;
}
}
if(i==elements.size()) { // Not included yet -> new image
tmp_os.image_history.push_back(tmp_image);
elements.push_back(tmp_os);
}*/
}
else {
tmpOs->deleteLater();
}
} else if(tmp_qstring.lower().compare("[linbo]") == 0) {
read_globals(&input, config);
} else if(tmp_qstring.lower().compare("[partition]") == 0) {
LinboDiskPartition* tmpPartition = read_partition(&input);
if(!tmpPartition->getPath().isEmpty()) {
diskPartitions.append(tmpPartition);
}
else {
tmpPartition->deleteLater();
}
}
}
input.close();
qDebug() << "Finished parsing start.conf";
qDebug() << "Loading global configuration";
// load global config
QStringList command;
this->process = new QProcess();
// client ip
command = LINBO_CMD("ip");
// myprocess->setArguments( command );
process->start( command.join(" ") );
while( !process->waitForFinished(10000) ) {}
this->config->setIpAddress(process->readAllStandardOutput());
// mac address
command.clear();
command = LINBO_CMD("mac");
process->start( command.join(" ") );
while( !process->waitForFinished(10000) ) {}
this->config->setMacAddress(process->readAllStandardOutput());
// Version
command = LINBO_CMD("version");
// myprocess->setArguments( command );
process->start( command.join(" ") );
while( !process->waitForFinished(10000) ) {}
this->config->setVersion(process->readAllStandardOutput().stripWhiteSpace());
// hostname
command = LINBO_CMD("hostname");
// myprocess->setArguments( command );
process->start( command.join(" ") );
while( !process->waitForFinished(10000) ) {}
this->config->setHostname(process->readAllStandardOutput());
// CPU
command = LINBO_CMD("cpu");
// myprocess->setArguments( command );
process->start( command.join(" ") );
while( !process->waitForFinished(10000) ) {}
this->config->setCpu(process->readAllStandardOutput());
// Memory
command = LINBO_CMD("memory");
process->start( command.join(" ") );
while( !process->waitForFinished(10000) ) {}
this->config->setRamSize(process->readAllStandardOutput());
// Cache Size
command = LINBO_CMD("size");
saveappend( command, this->config->getCache() );
process->start( command.join(" ") );
while( !process->waitForFinished(10000) ) {}
this->config->setCacheSize(process->readAllStandardOutput());
// Harddisk Size
QRegExp *removePartition = new QRegExp("[0-9]{1,2}");
QString hd = this->config->getCache();
hd.remove( *removePartition );
command = LINBO_CMD("size");
saveappend( command, hd );
process->start( command.join(" ") );
while( !process->waitForFinished(10000) ) {}
this->config->setHddSize(process->readAllStandardOutput());
}
// --------------------
// - Public functions -
// --------------------
void LinboBackend::executeAutostart() {
}
void LinboBackend::shutdown() {
QStringList command;
command.clear();
command = QStringList("busybox");
command.append("poweroff");
// TODO logConsole->writeStdOut( QString("shutdown entered") );
process->start( command.join(" ") );
}
void LinboBackend::reboot() {
QStringList command;
command.clear();
command = QStringList("busybox");
command.append("reboot");
// TODO logConsole->writeStdOut( QString("reboot entered") );
process->start( command.join(" ") );
}
bool LinboBackend::startOs(LinboOs* os) {
if(os == nullptr)
return false;
QStringList command = LINBO_CMD("start");
saveappend( command, os->getBootPartition() );
saveappend( command, os->getRootPartition() );
saveappend( command, os->getKernel() );
saveappend( command, os->getInitrd() );
saveappend( command, os->getKernelOptions() );
saveappend( command, this->config->getCache() );
this->executeCommand(command, false);
return true;
}
LinboConfig* LinboBackend::getConfig() {
return this->config;
}
QList<LinboOs*> LinboBackend::getOperatingSystems() {
return this->operatingSystems;
}
// -----------
// - Helpers -
// -----------
void LinboBackend::executeCommand(QStringList commandArgs, bool waitForFinished) {
QString command = commandArgs.takeFirst();
qDebug() << "Executing: " << command << " " << commandArgs.join(" ");
process->start(command, commandArgs);
process->waitForStarted();
if(waitForFinished)
while( !process->waitForFinished(10000) ) {}
}
void LinboBackend::read_qstring( ifstream* input, QString& tmp ) {
char line[500];
input->getline(line,500,'\n');
tmp = QString::fromAscii( line, -1 ).stripWhiteSpace();
}
void LinboBackend::read_bool( ifstream* input, bool& tmp) {
char line[500];
input->getline(line,500,'\n');
tmp = atoi( line );
}
// Return true unless beginning of new section '[' is found.
bool LinboBackend::read_pair(ifstream* input, QString& key, QString& value) {
char line[1024];
if(input->peek() == '[') return false; // Next section found.
input->getline(line,1024,'\n');
QString s = QString::fromAscii( line, -1 ).stripWhiteSpace();
key = s.section("=",0,0).stripWhiteSpace().lower();
if(s.startsWith("#")||key.isEmpty()) {
key = QString(""); value = QString("");
} else {
value=s.section("=",1).section("#",0,0).stripWhiteSpace();
}
return true;
}
bool LinboBackend::toBool(const QString& value) {
if(value.startsWith("yes",false)) return true;
if(value.startsWith("true",false)) return true;
if(value.startsWith("enable",false)) return true;
return false;
}
LinboOs* LinboBackend::read_os(ifstream* input) {
LinboOs* os = new LinboOs(this);
QString key, value;
while(!input->eof() && read_pair(input, key, value)) {
if(key.compare("name") == 0) os->setName(value);
else if(key.compare("description") == 0) os->setDescription(value);
else if(key.compare("version") == 0) os->setVersion(value);
else if(key.compare("iconname") == 0) os->setIconName(value);
else if(key.compare("image") == 0) os->setDifferentialImage(new LinboImage(value, os));
else if(key.compare("baseimage") == 0) os->setBaseImage(new LinboImage(value, os));
else if(key.compare("boot") == 0) os->setBootPartition(value);
else if(key.compare("root") == 0) os->setRootPartition(value);
else if(key.compare("kernel") == 0) os->setKernel(value);
else if(key.compare("initrd") == 0) os->setInitrd(value);
else if(key.compare("append") == 0) os->setKernelOptions(value);
else if(key.compare("syncenabled") == 0) os->setSyncButton(toBool(value));
else if(key.compare("startenabled") == 0) os->setStartButton(toBool(value));
else if((key.compare("remotesyncenabled") == 0) || (key.compare("newenabled") == 0)) os->setNewButton(toBool(value));
else if(key.compare("defaultaction") == 0) os->setDefaultAction(value);
else if(key.compare("autostart") == 0) os->setAutostart(toBool(value));
else if(key.compare("autostarttimeout") == 0) os->setAutostartTimeout(value.toInt());
else if(key.compare("hidden") == 0) os->setHidden(toBool(value));
}
return os;
}
LinboDiskPartition* LinboBackend::read_partition(ifstream* input) {
LinboDiskPartition* partition = new LinboDiskPartition(this);
QString key, value;
while(!input->eof() && read_pair(input, key, value)) {
if(key.compare("dev") == 0) partition->setPath(value);
else if(key.compare("size") == 0) partition->setSize(value.toInt());
else if(key.compare("id") == 0) partition->setId(value);
else if(key.compare("fstype") == 0) partition->setFstype(value);
else if(key.startsWith("bootable", false)) partition->setBootable(toBool(value));
}
return partition;
}
void LinboBackend::read_globals( ifstream* input, LinboConfig* config ) {
QString key, value;
while(!input->eof() && read_pair(input, key, value)) {
if(key.compare("server") == 0) config->setServer(value);
else if(key.compare("cache") == 0) config->setCache(value);
else if(key.compare("roottimeout") == 0) config->setRootTimeout((unsigned int)value.toInt());
else if(key.compare("group") == 0) config->setHostgroup(value);
else if(key.compare("autopartition") == 0) config->setAutopartition(toBool(value));
else if(key.compare("autoinitcache") == 0) config->setAutoInitCache(toBool(value));
else if(key.compare("autoformat") == 0) config->setAutoFormat(toBool(value));
else if(key.compare("backgroundfontcolor") == 0) config->setBackgroundFontcolor(value);
else if(key.compare("consolefontcolorstdout") == 0) config->setConsoleFontcolorStdout(value);
else if(key.compare("consolefontcolorstderr") == 0) config->setConsoleFontcolorStderr(value);
else if(key.compare("usemulticast") == 0) {
if( (unsigned int)value.toInt() == 0 )
config->setDownloadType("rsync");
else
config->setDownloadType("multicast");
}
else if(key.compare("downloadtype") == 0) config->setDownloadType(value);
}
}
// this appends a quoted space in case item is empty and resolves
// problems with linbo_cmd's weird "shift"-usage
void LinboBackend::saveappend( QStringList& command, const QString& item ) {
if ( item.isEmpty() )
command.append("");
else
command.append( item );
}
// Sync+start image
QStringList LinboBackend::mksyncstartcommand(LinboConfig& config, LinboOs& os) {
QStringList command = LINBO_CMD("syncstart");
saveappend( command, config.getServer() );
saveappend( command, config.getCache() );
saveappend( command, os.getBaseImage()->getName() );
saveappend( command, os.getDifferentialImage()->getName() );
saveappend( command, os.getBootPartition() ); // boot is same as root
saveappend( command, os.getRootPartition() );
saveappend( command, os.getKernel() );
saveappend( command, os.getInitrd() );
saveappend( command, os.getKernelOptions() );
return command;
}
// Sync image from cache
QStringList LinboBackend::mksynccommand(LinboConfig& config, LinboOs& os) {
QStringList command = LINBO_CMD("sync");
saveappend( command, config.getCache() );
saveappend( command, os.getBaseImage()->getName() );
saveappend( command, os.getDifferentialImage()->getName() );
saveappend( command, os.getBootPartition() );
saveappend( command, os.getRootPartition() );
saveappend( command, os.getKernel() );
saveappend( command, os.getInitrd() );
saveappend( command, os.getKernelOptions() );
return command;
}
// Sync image from server
QStringList LinboBackend::mksyncrcommand(LinboConfig& config, LinboOs& os) {
QStringList command = LINBO_CMD("syncr");
saveappend( command, config.getServer() );
saveappend( command, config.getCache() );
saveappend( command, os.getBaseImage()->getName() );
saveappend( command, os.getDifferentialImage()->getName() );
saveappend( command, os.getBootPartition() );
saveappend( command, os.getRootPartition() );
saveappend( command, os.getKernel() );
saveappend( command, os.getInitrd() );
saveappend( command, os.getKernelOptions() );
saveappend( command, QString("force") );
return command;
}
QStringList LinboBackend::mkpartitioncommand(vector <LinboDiskPartition> &p) {
QStringList command = LINBO_CMD("partition");
for(unsigned int i=0; i<p.size(); i++) {
saveappend( command, p[i].getPath() );
saveappend( command, (QString::number(p[i].getSize())) );
saveappend( command, p[i].getId() );
saveappend( command, (QString((p[i].getBootable())?"bootable":"\" \"")) );
saveappend( command, p[i].getFstype() );
}
return command;
}
QStringList LinboBackend::mkpartitioncommand_noformat(vector <LinboDiskPartition> &p) {
QStringList command = LINBO_CMD("partition_noformat");
for(unsigned int i=0; i<p.size(); i++) {
saveappend( command, p[i].getPath() );
saveappend( command, (QString::number(p[i].getSize())) );
saveappend( command, p[i].getId() );
saveappend( command, (QString((p[i].getBootable())?"bootable":"\" \"")) );
saveappend( command, p[i].getFstype() );
}
return command;
}
// type is 0 for rsync, 1 for multicast, 3 for bittorrent
QStringList LinboBackend::mkcacheinitcommand(LinboConfig& config, vector<LinboOs> &os, const QString& type) {
QStringList command = LINBO_CMD("initcache");
saveappend( command, config.getServer() );
saveappend( command, config.getCache() );
if( ! type.isEmpty() )
command.append(type);
else
command.append("rsync");
for(unsigned int i = 0; i < os.size(); i++) {
saveappend( command, os[i].getBaseImage()->getName() );
/* TODO ?? for(unsigned int j = 0; j < os[i].image_history.size(); j++) {
saveappend( command, os[i].image_history[j].get_image() );
}*/
}
return command;
}
QStringList LinboBackend::mklinboupdatecommand(LinboConfig& config) {
QStringList command = LINBO_CMD("update");
saveappend( command, config.getServer() );
saveappend( command, config.getCache() );
return command;
}

View file

@ -0,0 +1,30 @@
/****************************************************************************
** Modern Linbo GUI
** Copyright (C) 2020 Dorian Zedler <dorian@itsblue.de>
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU Affero 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#include "../../headers/backend/linboconfig.h"
LinboConfig::LinboConfig(QObject *parent) : QObject(parent)
{
autoPartition = 0;
autoInitCache = 0;
backgroundFontcolor = "black";
consoleFontcolorStdout = "white";
consoleFontcolorStderr = "red";
downloadType = "rsync";
autoFormat = 0;
}

View file

@ -0,0 +1,24 @@
/****************************************************************************
** Modern Linbo GUI
** Copyright (C) 2020 Dorian Zedler <dorian@itsblue.de>
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU Affero 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#include "../../headers/backend/linbodiskpartition.h"
LinboDiskPartition::LinboDiskPartition(QObject *parent) : QObject(parent)
{
}

View file

@ -0,0 +1,24 @@
/****************************************************************************
** Modern Linbo GUI
** Copyright (C) 2020 Dorian Zedler <dorian@itsblue.de>
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU Affero 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#include "../../headers/backend/linboimage.h"
LinboImage::LinboImage(QString name, QObject *parent) : QObject(parent)
{
this->setName(name);
}

View file

@ -0,0 +1,29 @@
/****************************************************************************
** Modern Linbo GUI
** Copyright (C) 2020 Dorian Zedler <dorian@itsblue.de>
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU Affero 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#include "../../headers/backend/linboos.h"
LinboOs::LinboOs(QObject *parent) : QObject(parent)
{
autostart = false;
autostartTimeout = 0;
hidden = false;
defaultAction = QString("sync");
// TODO ?? image_history.clear();
iconName = QString("defaultIcon.svg");
}

View file

@ -340,7 +340,6 @@ linboGUIImpl::linboGUIImpl(QWidget* parent) : QDialog(parent)
waiting->update();
waiting->execute();
#ifndef TEST_ENV
QWSServer* wsServer = QWSServer::instance();
QImage bgimg( "/icons/linbo_wallpaper.png", "PNG" );
@ -348,17 +347,9 @@ linboGUIImpl::linboGUIImpl(QWidget* parent) : QDialog(parent)
wsServer->setBackground( QBrush( bgimg.scaled( qRect.width(), qRect.height(), Qt::IgnoreAspectRatio ) ) );
wsServer->refresh();
}
#endif
// check whether we need to invert the color of some of our labels because of a
// dark background picture
ifstream input;
#ifdef TEST_ENV
input.open( "/home/dorian/Pictures/start.conf.win10-ubuntu", ios_base::in );
#else
input.open( "start.conf", ios_base::in );
#endif
QString tmp_qstring;
@ -379,7 +370,8 @@ linboGUIImpl::linboGUIImpl(QWidget* parent) : QDialog(parent)
unsigned int i; // Being checked later.
for(i = 0; i < elements.size(); i++ ) {
if(tmp_os.get_name().lower().compare(elements[i].get_name().lower()) == 0) {
elements[i].image_history.push_back(tmp_image); break;
elements[i].image_history.push_back(tmp_image);
break;
}
}
if(i==elements.size()) { // Not included yet -> new image
@ -1255,7 +1247,7 @@ linboGUIImpl::linboGUIImpl(QWidget* parent) : QDialog(parent)
registerbutton->setEnabled( true );
// add tooltip and icon
QToolTip::add( registerbutton, QString("?ffnet den Registrierungsdialog zur Aufnahme neuer Rechner") );
QToolTip::add( registerbutton, QString("Öffnet den Registrierungsdialog zur Aufnahme neuer Rechner") );
if( withicons )
registerbutton->setIconSet( QIcon( ":/icons/register-22x22.png") );

File diff suppressed because it is too large Load diff

View file

@ -3,6 +3,7 @@
#include <q3progressbar.h>
#include <iostream>
#include <qapplication.h>
#include <QtDebug>
#include "linboPushButton.hh"
linbopushbutton::linbopushbutton( QWidget* parent,
@ -134,6 +135,8 @@ void linbopushbutton::lclicked()
QString command = processargs.takeFirst();
logConsole->writeStdErr( QString("Executing ") + command + processargs.join(" ") );
qDebug() << QString("Executing ") + command + processargs.join(" ");
return;
progwindow->startTimer();
process->start( command, processargs );

View file

@ -1,6 +1,24 @@
/****************************************************************************
** Modern Linbo GUI
** Copyright (C) 2020 Dorian Zedler <dorian@itsblue.de>
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU Affero 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#include "../headers/linbogui.h"
linboGui::linboGui()
LinboGui::LinboGui()
{
// fill whole screen
Qt::WindowFlags flags;
@ -12,22 +30,28 @@ linboGui::linboGui()
this->setFixedWidth(QApplication::desktop()->screenGeometry().width());
// black bakground
// linuxmuster background color: #394f5e
this->setStyleSheet( "QDialog { background: white }");
// create an instance of the old GUI (as a backup)
linboGUIImpl* legacyGui = new linboGUIImpl(this);
legacyGui->setStyleSheet( "QDialog { background: white }");
//legacyGui->show();
// create the backend
this->backend = new LinboBackend(this);
qDebug() << this->backend->getOperatingSystems()[0]->getName();
// create the main layout
// OS Buttons
LinboOsSelectButton* osButton = new LinboOsSelectButton(":/svgIcons/ubuntu.svg", this);
LinboOsSelectButton* osButton = new LinboOsSelectButton(":/svgIcons/ubuntu.svg", nullptr, this);
osButton->setFixedHeight(250);
osButton->setFixedWidth(250);
osButton->setChecked(true);
LinboOsSelectButton* osButton_1 = new LinboOsSelectButton(":/svgIcons/windows.svg", this);
LinboOsSelectButton* osButton_1 = new LinboOsSelectButton(":/svgIcons/windows.svg", nullptr, this);
osButton_1->setFixedHeight(250);
osButton_1->setFixedWidth(250);
@ -45,6 +69,7 @@ linboGui::linboGui()
QModernPushButton* defaultActionButton = new QModernPushButton(":/svgIcons/startAction.svg");
defaultActionButton->setFixedHeight(110);
defaultActionButton->setFixedWidth(110);
connect(defaultActionButton, SIGNAL(clicked()), this, SLOT(startOs()));
QModernPushButton* secondActionButton = new QModernPushButton(":/svgIcons/syncAction.svg");
secondActionButton->setFixedHeight(50);
@ -60,20 +85,58 @@ linboGui::linboGui()
actionButtonLayout->addWidget(thirdActionButton);
actionButtonLayout->addItem(new QSpacerItem(10,10, QSizePolicy::Expanding, QSizePolicy::Minimum));
QLabel* versionLabel = new QLabel(backend->getConfig()->getVersion());
// main layout
QVBoxLayout* mainLayout = new QVBoxLayout(this);
QWidget* mainLayoutWidget = new QWidget(this);
mainLayoutWidget->setGeometry(this->geometry());
QVBoxLayout* mainLayout = new QVBoxLayout(mainLayoutWidget);
mainLayout->addItem(new QSpacerItem(10,10, QSizePolicy::Minimum, QSizePolicy::Expanding));
mainLayout->addLayout(osButtonRow);
mainLayout->addItem(new QSpacerItem(10,10, QSizePolicy::Minimum, QSizePolicy::Expanding));
//mainLayout->addItem(new QSpacerItem(10,10, QSizePolicy::Minimum, QSizePolicy::Expanding));
mainLayout->addWidget(defaultActionButton);
mainLayout->setAlignment(defaultActionButton, Qt::AlignHCenter);
mainLayout->addLayout(actionButtonLayout);
mainLayout->addItem(new QSpacerItem(10,10, QSizePolicy::Minimum, QSizePolicy::Expanding));
mainLayout->addWidget(versionLabel);
// power and settings Buttons
QWidget* powerActionsLayoutWidget = new QWidget(this);
int height = this->height() * 0.25;
int width = height / 3;
int buttonWidth = width * 0.8;
powerActionsLayoutWidget->setGeometry(QRect(this->width() - width * 1.1, this->height() - height + width * 0.1, width, height));
QModernPushButton* settingsActionButton = new QModernPushButton(":/svgIcons/settingsAction.svg");
connect(settingsActionButton, SIGNAL(clicked()), legacyGui, SLOT(open()));
settingsActionButton->setFixedHeight(buttonWidth);
settingsActionButton->setFixedWidth(buttonWidth);
QModernPushButton* rebootActionButton = new QModernPushButton(":/svgIcons/rebootAction.svg");
connect(rebootActionButton, SIGNAL(clicked()), this->backend, SLOT(reboot()));
rebootActionButton->setFixedHeight(buttonWidth);
rebootActionButton->setFixedWidth(buttonWidth);
QModernPushButton* shutdownActionButton = new QModernPushButton(":/svgIcons/shutdownAction.svg");
connect(shutdownActionButton, SIGNAL(clicked()), this->backend, SLOT(shutdown()));
shutdownActionButton->setFixedHeight(buttonWidth);
shutdownActionButton->setFixedWidth(buttonWidth);
QVBoxLayout* powerActionsLayout = new QVBoxLayout(powerActionsLayoutWidget);
powerActionsLayout->setSpacing(0);
powerActionsLayout->addWidget(settingsActionButton);
powerActionsLayout->addWidget(rebootActionButton);
powerActionsLayout->addWidget(shutdownActionButton);
}
void LinboGui::startOs() {
qDebug() << "starting: " << this->backend->getOperatingSystems()[1]->getName();
this->backend->startOs(this->backend->getOperatingSystems()[1]);
}
// prevent closing (eg. by pressing escape key)
void linboGui::done(int r) {
void LinboGui::done(int r) {
Q_UNUSED(r)
}

View file

@ -1,5 +1,29 @@
/****************************************************************************
** Modern Linbo GUI
** Copyright (C) 2020 Dorian Zedler <dorian@itsblue.de>
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU Affero 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#include "linboosselectbutton.h"
LinboOsSelectButton::LinboOsSelectButton(QString icon, QWidget* parent) : QModernPushButton(icon, parent)
LinboOsSelectButton::LinboOsSelectButton(QString icon, LinboOs* os, QWidget* parent) : QModernPushButton(icon, parent)
{
this->setCheckable(true);
this->os = os;
}
LinboOs* LinboOsSelectButton::getOs() {
return this->os;
}

View file

@ -1,3 +1,21 @@
/****************************************************************************
** Modern Linbo GUI
** Copyright (C) 2020 Dorian Zedler <dorian@itsblue.de>
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU Affero 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#include "../headers/linbostartpage.h"
linboStartPage::linboStartPage(QWidget *parent) : QWidget(parent)

View file

@ -17,9 +17,8 @@
int main( int argc, char* argv[] )
{
QApplication myapp( argc, argv );
QApplication linboGuiApp( argc, argv );
#ifndef TEST_ENV
QWSServer* wsServer = QWSServer::instance();
QImage bgimg( "/icons/linbo_wallpaper.png", "PNG" );
@ -30,31 +29,9 @@ int main( int argc, char* argv[] )
wsServer->setBackground( QBrush( bgimg.scaled( width, height, Qt::IgnoreAspectRatio ) ) );
wsServer->refresh();
}
#endif
LinboGui* linboGui = new LinboGui;
linboGui->show();
linboGui* gui = new linboGui;
gui->show();
// this paints a transparent main widget
//myGUI->setStyleSheet( "QDialog#linboGUI{ background: blue }");
/* myGUI->Console->viewport()->setAutoFillBackground(true);
myGUI->Console->setTextColor( QColor("white") );
QPalette palette; */
// a grey transparent background
// myGUI->Console->setStyleSheet("QTextEdit#Console{ background: transparent }");
#ifdef TEST_ENV
QMainWindow window;
window.setCentralWidget(myGUI);
window.setGeometry(myGUI->geometry());
window.show();
#endif
//QTimer::singleShot( 100, myGUI, SLOT(executeAutostart()) );
return myapp.exec();
return linboGuiApp.exec();
}

View file

@ -1,18 +1,42 @@
/****************************************************************************
** Modern Linbo GUI
** Copyright (C) 2020 Dorian Zedler <dorian@itsblue.de>
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU Affero 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#include "../headers/qmodernpushbutton.h"
QModernPushButton::QModernPushButton(QString icon, QWidget* parent) : QPushButton(parent)
QModernPushButton::QModernPushButton(QString icon, QWidget* parent) : QAbstractButton(parent)
{
this->setStyleSheet(this->generateStyleSheet());
this->setCheckable(true);
this->svgWidget = new QSvgWidget(this);
this->svgWidget->load(QString(icon));
this->setMouseTracking(true);
this->overlayNormalWidget = new QSvgWidget(this->svgWidget);
this->overlayHoveredWidget = new QSvgWidget(this->svgWidget);
this->overlayHoveredEffect = new QGraphicsOpacityEffect(this);
this->overlayHoveredEffect->setOpacity(0);
this->overlayHoveredWidget->setGraphicsEffect(this->overlayHoveredEffect);
this->overlayPressedWidget = new QSvgWidget(this->svgWidget);
this->overlayPressedWidget->load(QString(":svgIcons/overlayPressed.svg"));
this->overlayPressedEffect = new QGraphicsOpacityEffect(this);
this->overlayPressedEffect->setOpacity(0);
this->overlayPressedWidget->setGraphicsEffect(this->overlayPressedEffect);
this->overlayCheckedWidget = new QSvgWidget(this->svgWidget);
this->overlayCheckedWidget->load(QString(":svgIcons/overlayChecked.svg"));
this->overlayCheckedEffect = new QGraphicsOpacityEffect(this);
this->overlayCheckedEffect->setOpacity(0);
this->overlayCheckedWidget->setGraphicsEffect(this->overlayCheckedEffect);
@ -34,18 +58,6 @@ void QModernPushButton::handleToggled(bool checked) {
animation->start();
}
QString QModernPushButton::generateStyleSheet() {
return "QPushButton {\n"
" background-color: transparent;\n"
"}\n"
"QPushButton:hover {"
"background-color: lightblue;"
"}"
"QPushButton:active {\n"
" outline: none;"
"}";
}
void QModernPushButton::resizeEvent(QResizeEvent *event) {
this->svgWidget->setGeometry(QRect(0, 0, event->size().width(), event->size().height()));
@ -53,10 +65,45 @@ void QModernPushButton::resizeEvent(QResizeEvent *event) {
QFile file(":svgIcons/overlayNormal.svg");
file.open(QFile::ReadOnly);
QString overlayNormalString = file.readAll();
overlayNormalString.replace("stroke-width:15px", "stroke-width:" + QString::number(500/event->size().width() * 5) + "px");
//this->overlayNormalWidget->load(overlayNormalString.toUtf8());
this->overlayNormalWidget->setGeometry(QRect(0, 0, event->size().width(), event->size().height()));
//overlayNormalString.replace("stroke-width:15px", "stroke-width:" + QString::number(500/event->size().width() * 5) + "px");
this->overlayHoveredWidget->load(overlayNormalString.toUtf8());
this->overlayHoveredWidget->setGeometry(QRect(0, 0, event->size().width(), event->size().height()));
this->overlayCheckedWidget->setGeometry(QRect(0, 0, event->size().width(), event->size().height()));
}
void QModernPushButton::paintEvent(QPaintEvent *e) {
Q_UNUSED(e)
}
void QModernPushButton::keyPressEvent(QKeyEvent *e) {
// TODO
return QAbstractButton::keyPressEvent(e);
}
void QModernPushButton::keyReleaseEvent(QKeyEvent *e) {
// TODO
return QAbstractButton::keyReleaseEvent(e);
}
void QModernPushButton::enterEvent(QEvent *e) {
this->overlayHoveredEffect->setOpacity(1);
return QAbstractButton::enterEvent(e);
}
void QModernPushButton::leaveEvent(QEvent *e) {
this->overlayHoveredEffect->setOpacity(0);
return QAbstractButton::leaveEvent(e);
}
void QModernPushButton::mousePressEvent(QMouseEvent *e) {
this->overlayPressedEffect->setOpacity(1);
return QAbstractButton::mousePressEvent(e);
}
void QModernPushButton::mouseReleaseEvent(QMouseEvent *e) {
this->overlayPressedEffect->setOpacity(0);
return QAbstractButton::mouseReleaseEvent(e);
}