Browse Source

Нарисовал морду

master
Тим 11 months ago
parent
commit
5e7b3def6b
22 changed files with 1287 additions and 31 deletions
  1. 96
    0
      PEHeaders.h
  2. 0
    11
      WBFace.cpp
  3. 0
    15
      WBFace.h
  4. 20
    0
      WBItem.cpp
  5. 8
    0
      WBItem.h
  6. 17
    0
      WBMain.cpp
  7. 19
    0
      WBMain.h
  8. 7
    0
      WBResources.qrc
  9. 15
    0
      WBTmp.cpp
  10. 18
    0
      WBTmp.h
  11. 17
    3
      WineBottle.pro
  12. 6
    2
      main.cpp
  13. 445
    0
      resources/forms/WBFace.ui
  14. 445
    0
      resources/forms/WBFace.ui.autosave
  15. BIN
      resources/icons/Main.png
  16. BIN
      resources/icons/Settings.png
  17. 51
    0
      ui/WBFace.cpp
  18. 56
    0
      ui/WBFace.h
  19. 17
    0
      ui/WBUiBase.cpp
  20. 25
    0
      ui/WBUiBase.h
  21. 9
    0
      wine/RegEdit.cpp
  22. 16
    0
      wine/RegEdit.h

+ 96
- 0
PEHeaders.h View File

@@ -0,0 +1,96 @@
#ifndef PEHEADERS_H
#define PEHEADERS_H

#pragma pack(push, 1)

namespace PEHeaders {
struct File
{
unsigned short Machine;
unsigned short NumberOfSections;
unsigned int TimeDateStamp;
unsigned int PointerToSymbolTable;
unsigned int NumberOfSymbols;
unsigned short SizeOfOptionalHeader;
unsigned short Characteristics;
};
enum eImageData{
eID_export,
eID_import,
eID_resource,
eID_exception,
eID_security,
eID_basereloc,
eID_debug,
eID_arch,
eID_globalptr,
eID_tls,
eID_load_config,
eID_bound_import,
eID_iat,
eID_delay_import,
eID_com_descriptor
};
struct ImageData{
unsigned int VirtualAddress;
unsigned int size;
};
struct Optional{
unsigned short Magic;
unsigned char MajorLinkerVersion;
unsigned char MinorLinkerVersion;
unsigned int SizeOfCode;
unsigned int SizeOfInitializedData;
unsigned int SizeOfUninitializedData;
unsigned int AddressOfEntryPoint;
unsigned int BaseOfCode;
unsigned int BaseOfData;
unsigned int ImageBase;
unsigned int SectionAlignment;
unsigned int FileAlignment;
unsigned short MajorOperatingSystemVersion;
unsigned short MinorOperatingSystemVersion;
unsigned short MajorImageVersion;
unsigned short MinorImageVersion;
unsigned short MajorSubsystemVersion;
unsigned short MinorSubsystemVersion;
unsigned int Win32VersionValue;
unsigned int SizeOfImage;
unsigned int SizeOfHeaders;
unsigned int CheckSum;
unsigned short Subsystem; // 2 -- GUI, 3 -- console
unsigned short DllCharacteristics;
unsigned int SizeOfStackReserve;
unsigned int SizeOfStackCommit;
unsigned int SizeOfHeapReserve;
unsigned int SizeOfHeapCommit;
unsigned int LoaderFlags;
unsigned int NumberOfRvaAndSizes; //const 16
ImageData DataDirectory[16]; // eImageData
};
struct Section
{
unsigned char Name[8];
union {
unsigned int PhysicalAddress;
unsigned int VirtualSize;
};
unsigned int VirtualAddress;
unsigned int SizeOfRawData;
unsigned int PointerToRawData;
unsigned int PointerToRelocations;
unsigned int PointerToLinenumbers;
unsigned short NumberOfRelocations;
unsigned short NumberOfLinenumbers;
unsigned int Characteristics;
};
struct Base{
unsigned int signature;
File file;
Optional optional;
};
}

#pragma pack(pop)

#endif // PEHEADERS_H

+ 0
- 11
WBFace.cpp View File

@@ -1,11 +0,0 @@
#include "WBFace.h"

WBFace::WBFace(QWidget *parent)
: QWidget(parent)
{
}

WBFace::~WBFace()
{

}

+ 0
- 15
WBFace.h View File

@@ -1,15 +0,0 @@
#ifndef WBFACE_H
#define WBFACE_H

#include <QWidget>

class WBFace : public QWidget
{
Q_OBJECT

public:
WBFace(QWidget *parent = 0);
~WBFace();
};

#endif // WBFACE_H

+ 20
- 0
WBItem.cpp View File

@@ -0,0 +1,20 @@
#include "WBItem.h"

#include <QFileInfo>
#include <QDir>

QString itemPath(QString item)
{
if (item.front() == '/')
item.remove(0, 1);
QString itemPath = "/usr/share/WineBottle/resources/" + item;
QString itemLocalPath = "/usr/local/share/WineBottle/resources/" + item;
QString itemHomePath = QDir::homePath() + ".local/share/WineBottle/resources/" + item;
if (QFileInfo::exists(itemPath))
return itemPath;
else if (QFileInfo::exists(itemLocalPath))
return itemLocalPath;
else if (QFileInfo::exists(itemHomePath))
return itemHomePath;
return ":/resources/" + item;
}

+ 8
- 0
WBItem.h View File

@@ -0,0 +1,8 @@
#ifndef WBITEM_H
#define WBITEM_H

#include <QString>

QString itemPath(QString item);

#endif // WBITEM_H

+ 17
- 0
WBMain.cpp View File

@@ -0,0 +1,17 @@
#include "WBMain.h"

WBMain::WBMain(QStringList args)
: WBFace(nullptr)
{
if (args.count()){
exe = args.front();
args.pop_front();
if (args.count())
le_args->setText(args.join(" "));
setWindowTitle(exe.completeBaseName());
}
}

WBMain::~WBMain()
{
}

+ 19
- 0
WBMain.h View File

@@ -0,0 +1,19 @@
#ifndef WBMAIN_H
#define WBMAIN_H

#include "ui/WBFace.h"
#include <QFileInfo>

class WBMain : public WBFace
{
Q_OBJECT

public:
WBMain(QStringList args);
~WBMain();

private:
QFileInfo exe;
};

#endif // WBMAIN_H

+ 7
- 0
WBResources.qrc View File

@@ -0,0 +1,7 @@
<RCC>
<qresource prefix="/">
<file>resources/forms/WBFace.ui</file>
<file>resources/icons/Main.png</file>
<file>resources/icons/Settings.png</file>
</qresource>
</RCC>

+ 15
- 0
WBTmp.cpp View File

@@ -0,0 +1,15 @@
#include "WBTmp.h"
#include <QApplication>

WBTmp::WBTmp(QObject *parent) : QObject(parent)
{
tmpDir = "/tmp/WineBottle/" + QString::number(QApplication::applicationPid()) + "/";
if (!tmpDir.exists())
tmpDir.mkpath(tmpDir.path());
}

WBTmp::~WBTmp()
{
if (!tmpDir.exists())
tmpDir.rmdir(tmpDir.path());
}

+ 18
- 0
WBTmp.h View File

@@ -0,0 +1,18 @@
#ifndef WBTMP_H
#define WBTMP_H

#include <QObject>
#include <QDir>

class WBTmp : public QObject
{
Q_OBJECT
public:
explicit WBTmp(QObject *parent = nullptr);
~WBTmp();

protected:
QDir tmpDir;
};

#endif // WBTMP_H

+ 17
- 3
WineBottle.pro View File

@@ -4,7 +4,7 @@
#
#-------------------------------------------------

QT += core gui widgets
QT += core gui widgets uitools

TARGET = WineBottle
TEMPLATE = app
@@ -24,12 +24,26 @@ CONFIG += c++11

SOURCES += \
main.cpp \
WBFace.cpp
WBItem.cpp \
WBMain.cpp \
ui/WBUiBase.cpp \
wine/RegEdit.cpp \
WBTmp.cpp \
ui/WBFace.cpp

HEADERS += \
WBFace.h
WBItem.h \
WBMain.h \
ui/WBUiBase.h \
wine/RegEdit.h \
WBTmp.h \
ui/WBFace.h \
PEHeaders.h

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

RESOURCES += \
WBResources.qrc

+ 6
- 2
main.cpp View File

@@ -1,10 +1,14 @@
#include "WBFace.h"
#include "WBMain.h"
#include <QApplication>
#include <QStringList>

int main(int argc, char *argv[])
{
QStringList args;
for (int i = 1; i < argc; ++i)
args << argv[i];
QApplication a(argc, argv);
WBFace w;
WBMain w(args);
w.show();

return a.exec();

+ 445
- 0
resources/forms/WBFace.ui View File

@@ -0,0 +1,445 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>330</width>
<height>364</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="1" column="1" colspan="2">
<widget class="QCheckBox" name="needConsole">
<property name="text">
<string>Console</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QCheckBox" name="log">
<property name="text">
<string>Logging</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="4">
<layout class="QFormLayout" name="argsLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_args">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Arguments:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="args"/>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="advanced">
<property name="text">
<string>Advanced parametrs</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="4">
<layout class="QGridLayout" name="bottleLayout">
<item row="0" column="3">
<layout class="QGridLayout" name="executeButtons">
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QPushButton" name="run">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>20</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Run</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="link">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>16</height>
</size>
</property>
<property name="text">
<string>Create link</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_bottle">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>65</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Bottle:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QComboBox" name="bottleList">
<property name="minimumSize">
<size>
<width>155</width>
<height>30</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="2" colspan="2">
<widget class="QGroupBox" name="dxmode">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="title">
<string>DirectX</string>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QRadioButton" name="dx_ogl">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>OpenGL</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="dx_csmt">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>CSMT</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QRadioButton" name="dx_nine">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Nine</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QGroupBox" name="desktopBox">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="title">
<string>Desktop</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_2">
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QRadioButton" name="desktop_disabled">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Disable</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="desktop_wine">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Wine</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QRadioButton" name="desktop_xephyr">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Xephyr</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<layout class="QGridLayout" name="gridLayout_3">
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="1">
<widget class="QLabel" name="label_desktopW">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Width:</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QSpinBox" name="desktopH">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="suffix">
<string>px</string>
</property>
<property name="maximum">
<number>768</number>
</property>
<property name="value">
<number>768</number>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_desktopH">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Height:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QSpinBox" name="desktopW">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="suffix">
<string>px</string>
</property>
<property name="maximum">
<number>1024</number>
</property>
<property name="value">
<number>1024</number>
</property>
</widget>
</item>
<item row="0" column="0" rowspan="2">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="3" column="0" colspan="4">
<widget class="QGroupBox" name="envBox">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="title">
<string>Environments</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QPlainTextEdit" name="envs">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="plainText">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

+ 445
- 0
resources/forms/WBFace.ui.autosave View File

@@ -0,0 +1,445 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>330</width>
<height>364</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="1" column="1" colspan="2">
<widget class="QCheckBox" name="needConsole">
<property name="text">
<string>Console</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QCheckBox" name="log">
<property name="text">
<string>Logging</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="4">
<layout class="QFormLayout" name="argsLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_args">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Arguments:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="args"/>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="advanced">
<property name="text">
<string>Advanced parametrs</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="4">
<layout class="QGridLayout" name="bottleLayout">
<item row="0" column="3">
<layout class="QGridLayout" name="executeButtons">
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QPushButton" name="run">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>20</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Run</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="link">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>16</height>
</size>
</property>
<property name="text">
<string>Create link</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_bottle">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>65</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Bottle:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QComboBox" name="bottleList">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="2" colspan="2">
<widget class="QGroupBox" name="dxmode">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="title">
<string>DirectX</string>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QRadioButton" name="dx_ogl">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>OpenGL</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="dx_csmt">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>CSMT</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QRadioButton" name="dx_nine">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Nine</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QGroupBox" name="desktopBox">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="title">
<string>Desktop</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_2">
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QRadioButton" name="desktop_disabled">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Disable</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="desktop_wine">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Wine</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QRadioButton" name="desktop_xephyr">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Xephyr</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<layout class="QGridLayout" name="gridLayout_3">
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="1">
<widget class="QLabel" name="label_desktopW">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Width:</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QSpinBox" name="desktopH">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="suffix">
<string>px</string>
</property>
<property name="maximum">
<number>768</number>
</property>
<property name="value">
<number>768</number>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_desktopH">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Height:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QSpinBox" name="desktopW">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="suffix">
<string>px</string>
</property>
<property name="maximum">
<number>1024</number>
</property>
<property name="value">
<number>1024</number>
</property>
</widget>
</item>
<item row="0" column="0" rowspan="2">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="3" column="0" colspan="4">
<widget class="QGroupBox" name="envBox">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="title">
<string>Environments</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QPlainTextEdit" name="envs">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="plainText">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

BIN
resources/icons/Main.png View File


BIN
resources/icons/Settings.png View File


+ 51
- 0
ui/WBFace.cpp View File

@@ -0,0 +1,51 @@
#include "WBFace.h"

WBFace::WBFace(QWidget *parent) : WBUiBase (parent, "WBFace")
{
layout()->setSizeConstraint(QLayout::SetFixedSize);

btn_run = ui->findChild<QPushButton*>("run");
btn_link = ui->findChild<QPushButton*>("link");

cb_advanced = ui->findChild<QCheckBox*>("advanced");
cb_log = ui->findChild<QCheckBox*>("log");

rb_desktop_disable = ui->findChild<QRadioButton*>("desktop_disabled");
rb_desktop_wine = ui->findChild<QRadioButton*>("desktop_wine");
rb_desktop_xephyr = ui->findChild<QRadioButton*>("desktop_xephyr");
rb_directx_opengl = ui->findChild<QRadioButton*>("dx_ogl");
rb_directx_csmt = ui->findChild<QRadioButton*>("dx_csmt");
rb_directx_nine = ui->findChild<QRadioButton*>("dx_nine");

combo_bottle = ui->findChild<QComboBox*>("bottleList");

le_args = ui->findChild<QLineEdit*>("args");

pte_envs = ui->findChild<QPlainTextEdit*>("envs");

spin_desktop_width = ui->findChild<QSpinBox*>("desktopW");
spin_desktop_height = ui->findChild<QSpinBox*>("desktopH");

group_envBox = ui->findChild<QGroupBox*>("envBox");
group_desktopBox = ui->findChild<QGroupBox*>("desktopBox");
group_dxmode = ui->findChild<QGroupBox*>("dxmode");

label_args = ui->findChild<QLabel*>("label_args");

if (cb_advanced == nullptr || !cb_advanced->isChecked()){
resize({0,0});
advancedToggle(false);
}

if (cb_advanced)
QObject::connect(cb_advanced, &QCheckBox::toggled, this, &WBFace::advancedToggle);
}

void WBFace::advancedToggle(const bool toggle)
{
le_args->setVisible(toggle);
group_envBox->setVisible(toggle);
group_desktopBox->setVisible(toggle);
group_dxmode->setVisible(toggle);
label_args->setVisible(toggle);
}

+ 56
- 0
ui/WBFace.h View File

@@ -0,0 +1,56 @@
#ifndef WBFACE_H
#define WBFACE_H

#include "WBUiBase.h"

#include <QPushButton>
#include <QCheckBox>
#include <QRadioButton>
#include <QComboBox>
#include <QLineEdit>
#include <QPlainTextEdit>
#include <QSpinBox>
#include <QGroupBox>
#include <QLabel>

class WBFace : public WBUiBase
{
Q_OBJECT

public:
WBFace(QWidget *parent);

protected:
QPushButton *btn_run;
QPushButton *btn_link;

QCheckBox *cb_advanced;
QCheckBox *cb_log;

QRadioButton *rb_desktop_disable;
QRadioButton *rb_desktop_wine;
QRadioButton *rb_desktop_xephyr;
QRadioButton *rb_directx_opengl;
QRadioButton *rb_directx_csmt;
QRadioButton *rb_directx_nine;

QComboBox *combo_bottle;

QLineEdit *le_args;

QPlainTextEdit *pte_envs;

QSpinBox *spin_desktop_width;
QSpinBox *spin_desktop_height;

QGroupBox *group_envBox;
QGroupBox *group_desktopBox;
QGroupBox *group_dxmode;

QLabel *label_args;

private slots:
void advancedToggle(const bool toggle);
};

#endif // WBFACE_H

+ 17
- 0
ui/WBUiBase.cpp View File

@@ -0,0 +1,17 @@
#include "WBUiBase.h"

WBUiBase::WBUiBase(QWidget *parent, QString form, QString icon)
: QWidget(parent)
{
setWindowIcon(QIcon(itemPath("icons/" + icon)));
QFile file(itemPath("forms/" + form + ".ui"));
file.open(QFile::ReadOnly);
QUiLoader loader;
ui = loader.load(&file, this);
file.close();


QGridLayout *layout = new QGridLayout;
layout->addWidget(ui);
setLayout(layout);
}

+ 25
- 0
ui/WBUiBase.h View File

@@ -0,0 +1,25 @@
#ifndef WBUIBASE_H
#define WBUIBASE_H

#include <QWidget>
#include <QGridLayout>
#include <QUiLoader>
#include <QFile>
#include <QIcon>
#include <QDebug>

#include "WBItem.h"

class WBUiBase : public QWidget
{
Q_OBJECT

public:
WBUiBase(QWidget *parent, QString form, QString icon = "Mian.png");
~WBUiBase(){}

protected:
QWidget *ui;
};

#endif // WBUIBASE_H

+ 9
- 0
wine/RegEdit.cpp View File

@@ -0,0 +1,9 @@
#include "RegEdit.h"

static const QString regTitle = "\xFF\xFEWindows Registry Editor Version 5.00\r\n\r\n";

// TODO: Класс зависит от класса wine, который осуществляет запуск процесса wine
RegEdit::RegEdit(QObject *parent) : WBTmp(parent)
{

}

+ 16
- 0
wine/RegEdit.h View File

@@ -0,0 +1,16 @@
#ifndef REGEDIT_H
#define REGEDIT_H

#include "../WBTmp.h"

class RegEdit : public WBTmp
{
Q_OBJECT
public:
explicit RegEdit(QObject *parent = nullptr);

protected:
QString section;
};

#endif // REGEDIT_H

Loading…
Cancel
Save