mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-08 14:41:57 +08:00
added plugin manager gui #4168
This commit is contained in:
24
src/gui/plugin/gui.pro
Normal file
24
src/gui/plugin/gui.pro
Normal file
@@ -0,0 +1,24 @@
|
||||
TARGET = plugindownloader
|
||||
TEMPLATE = app
|
||||
SOURCES += src/main.cpp \
|
||||
src/MainWindow.cpp \
|
||||
src/Authenticate.cpp
|
||||
HEADERS += src/MainWindow.h \
|
||||
src/Arguments.h \
|
||||
src/Authenticate.h
|
||||
FORMS += res/MainWindowBase.ui
|
||||
win32 {
|
||||
Debug:DESTDIR = ../../../bin/Debug
|
||||
Release:DESTDIR = ../../../bin/Release
|
||||
}
|
||||
else:DESTDIR = ../../../bin
|
||||
debug {
|
||||
OBJECTS_DIR = tmp/debug
|
||||
MOC_DIR = tmp/debug
|
||||
RCC_DIR = tmp/debug
|
||||
}
|
||||
release {
|
||||
OBJECTS_DIR = tmp/release
|
||||
MOC_DIR = tmp/release
|
||||
RCC_DIR = tmp/release
|
||||
}
|
||||
84
src/gui/plugin/res/MainWindowBase.ui
Normal file
84
src/gui/plugin/res/MainWindowBase.ui
Normal file
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>293</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Synergy Plugin Downloader</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralWidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTextEdit" name="m_pTextEditInfo">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="undoRedoEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="m_pLabelTip">
|
||||
<property name="text">
|
||||
<string>Processing, please wait...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menuBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
13
src/gui/plugin/src/Arguments.h
Normal file
13
src/gui/plugin/src/Arguments.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef ARGUMENTS_H
|
||||
#define ARGUMENTS_H
|
||||
|
||||
#include <QString>
|
||||
|
||||
class Arguments
|
||||
{
|
||||
public:
|
||||
QString email;
|
||||
QString password;
|
||||
};
|
||||
|
||||
#endif // ARGUMENTS_H
|
||||
5
src/gui/plugin/src/Authenticate.cpp
Normal file
5
src/gui/plugin/src/Authenticate.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
#include "Authenticate.h"
|
||||
|
||||
Authenticate::Authenticate()
|
||||
{
|
||||
}
|
||||
10
src/gui/plugin/src/Authenticate.h
Normal file
10
src/gui/plugin/src/Authenticate.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef AUTHENTICATE_H
|
||||
#define AUTHENTICATE_H
|
||||
|
||||
class Authenticate
|
||||
{
|
||||
public:
|
||||
Authenticate();
|
||||
};
|
||||
|
||||
#endif // AUTHENTICATE_H
|
||||
31
src/gui/plugin/src/MainWindow.cpp
Normal file
31
src/gui/plugin/src/MainWindow.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "MainWindow.h"
|
||||
#include "ui_MainWindowBase.h"
|
||||
|
||||
MainWindow::MainWindow(Arguments& args, QWidget* parent) :
|
||||
QMainWindow(parent),
|
||||
m_Arguments(args)
|
||||
{
|
||||
setupUi(this);
|
||||
appendInfo(m_Arguments.email);
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
}
|
||||
|
||||
void MainWindow::changeEvent(QEvent* e)
|
||||
{
|
||||
QMainWindow::changeEvent(e);
|
||||
switch (e->type()) {
|
||||
case QEvent::LanguageChange:
|
||||
retranslateUi(this);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::appendInfo(QString& s)
|
||||
{
|
||||
m_pTextEditInfo->append(s);
|
||||
}
|
||||
26
src/gui/plugin/src/MainWindow.h
Normal file
26
src/gui/plugin/src/MainWindow.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include "Arguments.h"
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
#include "ui_MainWindowBase.h"
|
||||
|
||||
class MainWindow : public QMainWindow, public Ui::MainWindow {
|
||||
Q_OBJECT
|
||||
public:
|
||||
MainWindow(Arguments& args, QWidget* parent = 0);
|
||||
~MainWindow();
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent* e);
|
||||
|
||||
private:
|
||||
void appendInfo(QString& s);
|
||||
|
||||
private:
|
||||
Arguments m_Arguments;
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
27
src/gui/plugin/src/main.cpp
Normal file
27
src/gui/plugin/src/main.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include "MainWindow.h"
|
||||
#include "Arguments.h"
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
|
||||
void parseArgs(Arguments& args, int argc, char* argv[])
|
||||
{
|
||||
for (int i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "--email") == 0) {
|
||||
args.email = argv[++i];
|
||||
}
|
||||
if (strcmp(argv[i], "--password") == 0) {
|
||||
args.password = argv[++i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
Arguments args;
|
||||
parseArgs(args, argc, argv);
|
||||
|
||||
QApplication a(argc, argv);
|
||||
MainWindow w(args);
|
||||
w.show();
|
||||
return a.exec();
|
||||
}
|
||||
Reference in New Issue
Block a user