First commit.
parent
8e9ee285a6
commit
9d99a9dc94
|
@ -0,0 +1,25 @@
|
|||
#-------------------------------------------------
|
||||
#
|
||||
# Project created by QtCreator 2016-01-29T18:44:36
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
QT += core gui webkitwidgets network
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
TARGET = MinetestLauncher
|
||||
TEMPLATE = app
|
||||
|
||||
CONFIG += c++11
|
||||
|
||||
SOURCES += main.cpp\
|
||||
mainwindow.cpp \
|
||||
profile.cpp \
|
||||
profilemanager.cpp
|
||||
|
||||
HEADERS += mainwindow.h \
|
||||
profile.h \
|
||||
profilemanager.h
|
||||
|
||||
FORMS += mainwindow.ui
|
|
@ -0,0 +1,11 @@
|
|||
#include "mainwindow.h"
|
||||
#include <QApplication>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
MainWindow w;
|
||||
w.show();
|
||||
|
||||
return a.exec();
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::MainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
namespace Ui {
|
||||
class MainWindow;
|
||||
}
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MainWindow(QWidget *parent = 0);
|
||||
~MainWindow();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
|
@ -0,0 +1,128 @@
|
|||
<?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>1099</width>
|
||||
<height>626</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Minetest Launcher</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralWidget">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<widget class="QWebView" name="webView">
|
||||
<property name="url">
|
||||
<url>
|
||||
<string>http://dev.minetest.net/index.php?title=Changelog&printable=yes#0.4.12_.E2.86.92_0.4.13</string>
|
||||
</url>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox">
|
||||
<property name="currentText">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QPushButton" name="createBtn">
|
||||
<property name="text">
|
||||
<string>Create</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="editBtn">
|
||||
<property name="text">
|
||||
<string>Edit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="deleteBtn">
|
||||
<property name="text">
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<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>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QPushButton" name="playBtn">
|
||||
<property name="text">
|
||||
<string>Play!</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menuBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1099</width>
|
||||
<height>30</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="mainToolBar">
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusBar"/>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QWebView</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>QtWebKitWidgets/QWebView</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -0,0 +1,17 @@
|
|||
#include "profile.h"
|
||||
|
||||
Profile::Profile(QString n, QString v)
|
||||
{
|
||||
name = n;
|
||||
version = v;
|
||||
}
|
||||
|
||||
Profile Profile::fromJson(QJsonObject obj)
|
||||
{
|
||||
return Profile(obj.value("name").toString(), obj.value("version").toString());
|
||||
}
|
||||
|
||||
QDir Profile::getPath()
|
||||
{
|
||||
return QDir(prefix.filePath(name));
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
#ifndef PROFILE_H
|
||||
#define PROFILE_H
|
||||
|
||||
#include <QString>
|
||||
#include <QDir>
|
||||
#include <QJsonObject>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Profile
|
||||
{
|
||||
public:
|
||||
Profile(QString, QString);
|
||||
static Profile fromJson(QJsonObject);
|
||||
QDir getPath();
|
||||
|
||||
QString getName() { return name; }
|
||||
QString getVersion() { return version; }
|
||||
|
||||
private:
|
||||
QDir prefix = QDir(QDir::home().filePath(".minetest"));
|
||||
QString name, version;
|
||||
};
|
||||
|
||||
#endif // PROFILE_H
|
|
@ -0,0 +1,11 @@
|
|||
#include "profilemanager.h"
|
||||
|
||||
ProfileManager::ProfileManager()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool ProfileManager::addProfile(Profile profile)
|
||||
{
|
||||
return false;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef PROFILEMANAGER_H
|
||||
#define PROFILEMANAGER_H
|
||||
|
||||
#include "profile.h"
|
||||
#include<vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class ProfileManager
|
||||
{
|
||||
public:
|
||||
ProfileManager();
|
||||
bool addProfile(Profile);
|
||||
|
||||
private:
|
||||
vector<Profile> profiles;
|
||||
};
|
||||
|
||||
#endif // PROFILEMANAGER_H
|
Loading…
Reference in New Issue