refs #196, secondary GUI subproject for #151

This commit is contained in:
Klaus Basan
2014-03-27 01:11:32 +01:00
parent e1e4fbb449
commit a4e6f0e20c
13 changed files with 1588 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
#include "dockwindow.h"
#include "ui_dockwindow.h"
#include <QMouseEvent>
CDockWindow::CDockWindow(GuiModes::WindowMode windowMode, QWidget *parent) :
QMainWindow(parent, windowMode == GuiModes::WindowFrameless ? (Qt::Window | Qt::FramelessWindowHint) : Qt::Tool),
ui(new Ui::CDockWindow),
m_windowMode(windowMode)
{
ui->setupUi(this);
connect(this->ui->dw_Edit, &QDockWidget::topLevelChanged, this, &CDockWindow::dockWindowTopLevelChanged);
}
void CDockWindow::mouseMoveEvent(QMouseEvent *event)
{
if (this->m_windowMode == GuiModes::WindowFrameless && event->buttons() & Qt::LeftButton)
{
move(event->globalPos() - this->m_dragPosition);
event->accept();
return;
}
QWidget::mouseMoveEvent(event);
}
void CDockWindow::mousePressEvent(QMouseEvent *event)
{
if (this->m_windowMode == GuiModes::WindowFrameless && event->button() == Qt::LeftButton)
{
this->m_dragPosition = event->globalPos() - this->frameGeometry().topLeft();
event->accept();
return;
}
QWidget::mousePressEvent(event);
}
void CDockWindow::dockWindowTopLevelChanged(bool topLevel)
{
if (topLevel)
this->adjustSize();
}
CDockWindow::~CDockWindow()
{
delete ui;
}

View File

@@ -0,0 +1,46 @@
#ifndef BLACKGUI_DOCKWINDOW_H
#define BLACKGUI_DOCKWINDOW_H
#include "guimodeenums.h"
#include <QMainWindow>
namespace Ui
{
class CDockWindow;
}
class CDockWindow : public QMainWindow
{
Q_OBJECT
public:
explicit CDockWindow(GuiModes::WindowMode windowMode, QWidget *parent = nullptr);
~CDockWindow();
protected:
/*!
* \brief Mouse moving, required for frameless window
*/
void mouseMoveEvent(QMouseEvent *event);
/*!
* \brief Mouse press, required for frameless window
*/
void mousePressEvent(QMouseEvent *event);
private:
Ui::CDockWindow *ui;
GuiModes::WindowMode m_windowMode;
// frameless window
QPoint m_dragPosition; /*!< position, if moving is handled with frameless window */
private slots:
//! \brief Docked window is floating / docked again
void dockWindowTopLevelChanged(bool topLevel);
};
#endif // DOCKWINDOW_H

View File

@@ -0,0 +1,593 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CDockWindow</class>
<widget class="QMainWindow" name="CDockWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>323</width>
<height>332</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<property name="tabShape">
<enum>QTabWidget::Triangular</enum>
</property>
<property name="dockOptions">
<set>QMainWindow::AllowTabbedDocks|QMainWindow::AnimatedDocks</set>
</property>
<property name="unifiedTitleAndToolBarOnMac">
<bool>false</bool>
</property>
<widget class="QWidget" name="qw_DockWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>100</height>
</size>
</property>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>323</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QDockWidget" name="dw_Edit">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>524287</width>
<height>40</height>
</size>
</property>
<property name="floating">
<bool>false</bool>
</property>
<attribute name="dockWidgetArea">
<number>8</number>
</attribute>
<widget class="QWidget" name="qw_Edit">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QGridLayout" name="gridLayout_11"/>
</widget>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<widget class="QDockWidget" name="dw_ComPanel">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">#qw_ComPanel {
background: #89a3ae;
}
QLineEdit {
background: transparent;
text-align: right;
}
#qw_ComPanelCom1Active,
#qw_ComPanelCom2Active,
#qw_ComPanelTransponderTop,
#qw_ComPanelCom1Standby,
#qw_ComPanelCom2Standby
{
border: 1px solid black;
border-radius: 5px;
}
#qw_ComPanelCom1Active,
#qw_ComPanelCom2Active,
#qw_ComPanelTransponderTop
{
background: #262727;
}
#qw_ComPanelCom1Standby,
#qw_ComPanelCom2Standby
{
background: #265168;
}
#qw_ComPanelCom1Active QLineEdit,
#qw_ComPanelCom2Active QLineEdit,
#qw_ComPanelTransponderTop QLineEdit
{
font: 16px bold &quot;Arial&quot;;
color: lightgreen;
padding-left: 2px;
}
#qw_ComPanelCom1Active QLabel,
#qw_ComPanelCom2Active QLabel,
#qw_ComPanelTransponderTop QLabel
{
color: white;
padding-left: 2px;
}
#qw_ComPanelCom1Standby QLineEdit,
#qw_ComPanelCom2Standby QLineEdit
{
font: 14px &quot;Arial&quot;;
color: white;
padding-left: 2px;
}
#qw_ComPanelCom1Standby QLabel,
#qw_ComPanelCom2Standby QLabel
{
color: white;
padding-left: 2px;
}
</string>
</property>
<attribute name="dockWidgetArea">
<number>4</number>
</attribute>
<widget class="QWidget" name="qw_ComPanel">
<layout class="QVBoxLayout" name="vl_ComPanel">
<property name="spacing">
<number>0</number>
</property>
<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>
<item>
<layout class="QGridLayout" name="gl_ComPanel">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<property name="horizontalSpacing">
<number>4</number>
</property>
<property name="verticalSpacing">
<number>2</number>
</property>
<item row="1" column="0">
<widget class="QWidget" name="qw_ComPanelCom1Standby" native="true">
<layout class="QGridLayout" name="gl_ComPanelCom1Standby">
<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="QLabel" name="lbl_ComPanelCom1Standby">
<property name="text">
<string>standby:</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QLineEdit" name="le_ComPanelCom1Standby">
<property name="inputMask">
<string>DDD.990</string>
</property>
<property name="text">
<string>123.750</string>
</property>
<property name="maxLength">
<number>7</number>
</property>
<property name="frame">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="pb_ComPanelCom1Toggle">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>15</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="2">
<widget class="QWidget" name="qw_ComPanelCom2Standby" native="true">
<layout class="QGridLayout" name="gl_ComPanelCom2Standby">
<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="QLabel" name="lbl_ComAndTransponderCom2Standby">
<property name="text">
<string>standby:</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QLineEdit" name="le_ComPanelCom2Standby">
<property name="inputMask">
<string>DDD.990</string>
</property>
<property name="text">
<string>123.750</string>
</property>
<property name="maxLength">
<number>7</number>
</property>
<property name="frame">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="pb_ComPanelCom2Toggle">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>15</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="3">
<widget class="QWidget" name="qw_ComPanelTransponderTop" native="true">
<layout class="QGridLayout" name="gl_ComPanelTransponderTop">
<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="QLabel" name="lbl_ComPanelTransponder">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="text">
<string>XPDR:</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLineEdit" name="le_ComPanelTransponder">
<property name="inputMask">
<string>9999</string>
</property>
<property name="text">
<string>7000</string>
</property>
<property name="maxLength">
<number>4</number>
</property>
<property name="frame">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="0">
<widget class="QWidget" name="qw_ComPanelCom1Active" native="true">
<layout class="QGridLayout" name="gl_ComPanelCom1Active">
<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="QLabel" name="lbl_ComAndTransponderCom1Active">
<property name="text">
<string>COM1:</string>
</property>
<property name="buddy">
<cstring>qw_ComPanelCom1Active</cstring>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLineEdit" name="le_ComPanelCom1Active">
<property name="inputMask">
<string>DDD.990</string>
</property>
<property name="text">
<string>123.750</string>
</property>
<property name="maxLength">
<number>7</number>
</property>
<property name="frame">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QFrame" name="qf_ComPanelCom1ActiveValid">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="1" rowspan="2">
<widget class="QWidget" name="gw_ComPanelMiddleConsole" native="true">
<layout class="QGridLayout" name="gl_ComPanelMiddleConsole">
<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="1" column="0" alignment="Qt::AlignHCenter">
<widget class="QLabel" name="lbl_ComPanelMute">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../src/blackgui/blackgui.qrc">:/blackgui/icons/audiovolumelow.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lbl_ComanelLoginStatus">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../src/blackgui/blackgui.qrc">:/blackgui/icons/loginred.png</pixmap>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="2">
<widget class="QWidget" name="qw_ComPanelCom2Active" native="true">
<layout class="QGridLayout" name="gl_ComPanelCom2Active">
<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="1">
<widget class="QFrame" name="qf_ComPanelCom2ActiveValid">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lbl_ComAndTransponderCom2Active">
<property name="text">
<string>COM2:</string>
</property>
<property name="buddy">
<cstring>qw_ComPanelCom2Active</cstring>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLineEdit" name="le_ComPanelCom2Active">
<property name="inputMask">
<string>DDD.990</string>
</property>
<property name="text">
<string>128.800</string>
</property>
<property name="maxLength">
<number>7</number>
</property>
<property name="frame">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="3">
<widget class="QWidget" name="qw_ComPanelTransponderModes" native="true">
<layout class="QGridLayout" name="gl_ComPanelTransponderModes">
<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="horizontalSpacing">
<number>2</number>
</property>
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QPushButton" name="pb_ComPanelStandby">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>15</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="pb_ComPanelCharly">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>15</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="pb_ComPanelIdent">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>15</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</widget>
<resources>
<include location="../../src/blackgui/blackgui.qrc"/>
</resources>
<connections/>
</ui>

View File

@@ -0,0 +1,30 @@
/* Copyright (C) 2013 VATSIM Community / authors
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef SAMPLE_GUIMODEENUMS_H
#define SAMPLE_GUIMODEENUMS_H
struct GuiModes {
public:
/*!
* \brief Window mode
*/
enum WindowMode {
WindowFrameless,
WindowNormal
};
/*!
* \brief Core runs how and where?
*/
enum CoreMode {
CoreInGuiProcess,
CoreExternal,
CoreExternalVoiceLocal
};
};
#endif // guard

View File

@@ -0,0 +1,60 @@
#include "introwindow.h"
#include "ui_introwindow.h"
#include <QDesktopServices>
#include <QUrl>
/*
* Constructor
*/
CIntroWindow::CIntroWindow(QWidget *parent) :
QDialog(parent, Qt::Tool),
ui(new Ui::CIntroWindow)
{
ui->setupUi(this);
this->layout()->setSizeConstraint(QLayout::SetFixedSize);
}
/*
* Destructor
*/
CIntroWindow::~CIntroWindow() { }
/*
* Window mode
*/
GuiModes::WindowMode CIntroWindow::getWindowMode() const
{
if (this->ui->rb_WindowNormal->isChecked()) return GuiModes::WindowNormal;
if (this->ui->rb_WindowFrameless->isChecked()) return GuiModes::WindowFrameless;
qFatal("Illegal GUI status (window mode");
return GuiModes::WindowNormal; // just for compiler warning
}
/*
* Core mode
*/
GuiModes::CoreMode CIntroWindow::getCoreMode() const
{
if (this->ui->rb_CoreExternal->isChecked())return GuiModes::CoreExternal;
if (this->ui->rb_CoreExternalVoiceLocal->isChecked()) return GuiModes::CoreExternalVoiceLocal;
if (this->ui->rb_CoreInGuiProcess->isChecked()) return GuiModes::CoreInGuiProcess;
qFatal("Illegal GUI status (core mode");
return GuiModes::CoreExternal; // just for compiler warning
}
/*
* Button clicked
*/
void CIntroWindow::buttonClicked() const
{
QObject *sender = QObject::sender();
if (sender == this->ui->pb_ModelDb)
{
QDesktopServices::openUrl(QUrl("http://vatrep.vatsim-germany.org/page/index.php", QUrl::TolerantMode));
}
else if (sender == this->ui->pb_WebSite)
{
QDesktopServices::openUrl(QUrl("https://dev.vatsim-germany.org/", QUrl::TolerantMode));
}
}

View File

@@ -0,0 +1,56 @@
/* Copyright (C) 2013 VATSIM Community / authors
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef SAMPLE_INTROWINDOW_H
#define SAMPLE_INTROWINDOW_H
#include "guimodeenums.h"
#include <QDialog>
#include <QScopedPointer>
namespace Ui
{
class CIntroWindow;
}
class CIntroWindow : public QDialog
{
Q_OBJECT
public:
/*!
* \brief Constructor
* \param parent widget
*/
explicit CIntroWindow(QWidget *parent = nullptr);
/*!
* Destructor
*/
~CIntroWindow();
/*!
* \brief Selected window mode
* \see GuiModes::WindowMode
*/
GuiModes::WindowMode getWindowMode() const;
/*!
* \brief Get core mode
* \see GuiModes::CoreMode
*/
GuiModes::CoreMode getCoreMode() const;
private slots:
/*!
* \brief Button has been clicked
*/
void buttonClicked() const;
private:
QScopedPointer<Ui::CIntroWindow> ui;
};
#endif // guard

View File

@@ -0,0 +1,289 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CIntroWindow</class>
<widget class="QDialog" name="CIntroWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>239</width>
<height>260</height>
</rect>
</property>
<property name="windowTitle">
<string>BlackGUI intro screen</string>
</property>
<property name="windowIcon">
<iconset resource="../../src/blackgui/blackgui.qrc">
<normaloff>:/blackgui/icons/aircraftdeparture.png</normaloff>:/blackgui/icons/aircraftdeparture.png</iconset>
</property>
<property name="styleSheet">
<string notr="true">QWidget {
font-family: arial-rounded;
font: bold 10px;
color: yellow; /** font **/
background-color: black;
}
QPushButton {
background-color: rgba(255, 255, 0, 175);
color: black;
border-style: solid;
border-width:1px;
border-radius: 5px;
border-color: green;
margin: 3px;
padding: 3px;
}
QRadioButton {
background-color: transparent;
}
QGroupBox {
border: 2px solid yellow;
border-radius: 5px;
margin-top: 2ex; /* leave space at the top for the title */
}
QGroupBox::title {
subcontrol-origin: margin;
subcontrol-position: top left; /* position at the top center */
padding: 0 0px;
margin: 0px;
background-color: black;
}
#lbl_Icon {
max-height: 128;
max-width: 128;
}</string>
</property>
<property name="sizeGripEnabled">
<bool>false</bool>
</property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<property name="spacing">
<number>9</number>
</property>
<item row="0" column="0">
<widget class="QGroupBox" name="gb_Window">
<property name="title">
<string>Window</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QRadioButton" name="rb_WindowNormal">
<property name="text">
<string>Normal</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rb_WindowFrameless">
<property name="text">
<string>Frameless</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="gb_Core">
<property name="title">
<string>Core</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QRadioButton" name="rb_CoreInGuiProcess">
<property name="text">
<string>Included in GUI
process</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rb_CoreExternal">
<property name="text">
<string>External (DBus)</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rb_CoreExternalVoiceLocal">
<property name="text">
<string>External,
voice included</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="1" rowspan="2">
<widget class="QFrame" name="fr_Info">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="vl_FrameInfo">
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<widget class="QPushButton" name="pb_ModelDb">
<property name="text">
<string>Model DB</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pb_WebSite">
<property name="text">
<string>Web site</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="bb_OkCancel">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../../src/blackgui/blackgui.qrc"/>
</resources>
<connections>
<connection>
<sender>bb_OkCancel</sender>
<signal>accepted()</signal>
<receiver>CIntroWindow</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>257</x>
<y>230</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>bb_OkCancel</sender>
<signal>rejected()</signal>
<receiver>CIntroWindow</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>310</x>
<y>230</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>pb_ModelDb</sender>
<signal>clicked()</signal>
<receiver>CIntroWindow</receiver>
<slot>buttonClicked()</slot>
<hints>
<hint type="sourcelabel">
<x>217</x>
<y>34</y>
</hint>
<hint type="destinationlabel">
<x>319</x>
<y>37</y>
</hint>
</hints>
</connection>
<connection>
<sender>pb_WebSite</sender>
<signal>clicked()</signal>
<receiver>CIntroWindow</receiver>
<slot>buttonClicked()</slot>
<hints>
<hint type="sourcelabel">
<x>262</x>
<y>58</y>
</hint>
<hint type="destinationlabel">
<x>322</x>
<y>73</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>buttonClicked()</slot>
</slots>
</ui>

View File

@@ -0,0 +1,57 @@
#include "introwindow.h"
#include "dockwindow.h"
#include "guimodeenums.h"
#include "blackmisc/blackmiscfreefunctions.h"
#include <QtGlobal>
#include <QApplication>
#include <QMessageBox>
#include <QTranslator>
/*!
* \brief Main
* \param argc
* \param argv
* \return
*/
int main(int argc, char *argv[])
{
// register
Q_INIT_RESOURCE(blackgui);
BlackMisc::initResources();
BlackMisc::registerMetadata();
// BlackMisc::displayAllUserMetatypesTypes();
QFile file(":blackmisc/translations/blackmisc_i18n_de.qm");
qDebug() << (file.exists() ? "Found translations in resources" : "No translations in resources");
QTranslator translator;
if (translator.load("blackmisc_i18n_de", ":blackmisc/translations/"))
{
qDebug() << "Translator loaded";
}
// app
QApplication a(argc, argv);
a.installTranslator(&translator);
// modes
GuiModes::WindowMode windowMode;
GuiModes::CoreMode coreMode;
// Dialog to decide external or internal core
CIntroWindow intro;
if (intro.exec() == QDialog::Rejected)
{
return 0;
}
else
{
coreMode = intro.getCoreMode();
windowMode = intro.getWindowMode();
}
intro.close();
// Window
CDockWindow dockWindow(windowMode);
dockWindow.show();
return a.exec();
}

View File

@@ -0,0 +1,34 @@
include (../../config.pri)
include (../../build.pri)
QT += core dbus gui network xml multimedia
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = sample_blackgui2
TEMPLATE = app
SOURCES += *.cpp
HEADERS += *.h
FORMS += *.ui
CONFIG += blackmisc blacksound blackcore blackgui blacksim
DEPENDPATH += . ../../src/blackmisc ../../src/blackgui ../../src/blacksound ../../src/blacksim ../../src/blackcore
INCLUDEPATH += . ../../src
DESTDIR = ../../bin
win32:!win32-g++*: PRE_TARGETDEPS += ../../lib/blackmisc.lib \
../../lib/blackgui.lib \
../../lib/blacksim.lib \
../../lib/blacksound.lib \
../../lib/blackcore.lib
else: PRE_TARGETDEPS += ../../lib/libblackmisc.a \
../../lib/libblackgui.a \
../../lib/libblacksim.a \
../../lib/libblacksound.a \
../../lib/libblackcore.a
OTHER_FILES += *.qss
include (../../libraries.pri)

View File

@@ -0,0 +1,23 @@
QWidget {
font-family: arial-rounded;
font: bold 10px;
color: black; /** font **/
}
QPushButton {
background-color: rgba(255, 255, 0, 175);
border-style: solid;
border-width:1px;
border-radius:0px;
border-color: green;
max-height:20px;
}
QTextEdit {
background-color: rgba(255, 255, 0, 175);
border-style: solid;
border-width:1px;
border-radius:6px;
border-color: green;
opacity: 0.5;
}

View File

@@ -0,0 +1,23 @@
QWidget {
font-family: arial-rounded;
font: bold 10px;
color: black; /** font **/
}
QPushButton {
background-color: rgba(255, 255, 0, 175);
border-style: solid;
border-width:1px;
border-radius:0px;
border-color: green;
max-height:20px;
}
QTextEdit {
background-color: rgba(255, 255, 0, 175);
border-style: solid;
border-width:1px;
border-radius:6px;
border-color: green;
opacity: 0.5;
}

View File

@@ -0,0 +1,331 @@
/** http://qt-project.org/doc/qt-4.8/stylesheet-examples.html **/
QWidget {
background-color: black;
font: bold 10px;
color: white; /** font **/
}
QProgressBar {
border: 1px solid green;
border-radius: 5px;
text-align: center;
padding: 0px;
height: 16px;
}
QProgressBar::chunk {
background-color: darkblue;
width: 10px;
margin: 0.5px;
}
#wi_CentralWidgetOutside {
/** there is no opacity with background image, so we need semitransparent images **/
/** background-image: url(:/blackgui/icons/titaniumtexture.jpg) **/
/** border: 2px solid green; **/
/** border-radius: 20px; **/
background-color: darkslategray;
margin: 0px;
padding: 5px;
}
#fr_CentralFrameInside {
background-color: darkslategray;
margin: 5px;
}
#wi_MainKeypadArea {
background-color: darkslategray;
}
#gb_AtcStationsOnlineInfo {
border-style: none;
}
#sw_MainMiddle {
padding: 3px;
border: 0px;
border-radius: 10px;
}
#sw_MainMiddle QPushButton {
font-family: arial-rounded;
background-color: rgba(0, 0, 255, 128);
border-style: none;
border-radius:3px;
color: yellow;
padding: 3px;
}
/* No style for Dial
#sw_MainMiddel QDial {
background-color: rgba(0, 0, 255, 128);
}
*/
#wi_MainKeypadArea QPushButton {
font-family: arial-rounded;
background-color: black;
border-style: solid;
border-width:1px;
border-radius:6px;
border-color: green;
max-height:20px;
min-width:60px;
min-height:20px;
}
#wi_MainKeypadAreaWindow {
background-color: darkslategray;
}
#le_CommandLineInput {
margin-bottom: 5px;
padding: 3px;
border-radius: 5px;
}
QTabWidget::pane { /* The tab widget frame */
border: none;
}
QTabWidget::tab-bar {
left: 5px; /* move to the right by 5px */
}
QTabBar::tab {
border: 1px solid green;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
min-width: 30px;
padding: 2px;
padding-left: 4px;
padding-right: 4px;
margin-right: 3px;
}
QTabBar::tab::selected {
background-color: rgba(0, 0, 255, 128);
}
QLabel {
background: transparent;
}
QLineEdit {
background: black;
border: 1px solid green;
border-radius: 5px;
}
QLineEdit[readOnly="true"] {
background: black;
}
QCheckBox {
color: white; /** font **/
border: 0px solid green;
background: transparent;
}
QTextEdit {
border: 1px solid green;
background: transparent;
border-radius: 5px;
}
QPlainTextEdit {
border: 1px solid green;
background: transparent;
border-radius: 5px;
}
QGroupBox {
border: 1px solid green;
}
QToolBox {
border: none;
}
QToolBox::tab {
border: 1px solid green;
border-radius: 6px;
min-width: 30px;
padding: 2px;
padding-left: 4px;
padding-right: 4px;
}
QToolBox::tab::selected {
background-color: rgba(0, 0, 255, 128);
}
QRadioButton {
font: 10px;
}
QComboBox {
border: 1px solid green;
border-radius: 5px;
padding: 1px;
background: transparent;
}
QDoubleSpinBox {
border: 1px solid green;
border-radius: 5px;
padding: 1px;
background: transparent;
}
QMenuBar {
background: darkslategray;
}
QMenu {
background: black;
margin: 2px; /* some spacing around the menu */
}
QMenu::item {
padding: 2px 25px 1px 20px;
border: 2px solid darkslategray; /* reserve space for selection border */
background: black;
}
QMenu::item:selected {
border-color: darkblue;
background: black;
}
QMenu::indicator {
background-color: black;
}
QMenuBar {
background-color: darkslategray;
}
QMenuBar::item {
spacing: 3px; /* spacing between menu bar items */
padding: 1px 4px;
background: transparent;
border-radius: 4px;
}
QMenuBar::item:selected { /* when selected using mouse or keyboard */
background: black;
}
QMenuBar::item:pressed {
background: black;
}
QScrollBar:horizontal {
border: 2px solid gray;
background: slategray;
height: 10px;
margin: 0px 5px 0 5px;
}
QScrollBar:vertical {
border: 2px solid gray;
background: slategray;
width: 10px;
margin: 5px 0 5px 0;
}
QScrollBar::handle:horizontal {
background: black;
min-width: 15px;
}
QScrollBar::handle:vertical {
background: black;
min-height: 15px;
}
QScrollBar::add-line:horizontal {
border: 2px solid gray;
background: blue;
width: 5px;
subcontrol-position: right;
subcontrol-origin: margin;
}
QScrollBar::sub-line:horizontal {
border: 2px solid gray;
background: blue;
width: 5px;
subcontrol-position: left;
subcontrol-origin: margin;
}
QScrollBar::add-line:vertical {
border: 2px solid gray;
background: blue;
height: 5px;
subcontrol-position: bottom;
subcontrol-origin: margin;
}
QScrollBar::sub-line:vertical {
border: 2px solid gray;
background: blue;
height: 5px;
subcontrol-position: top;
subcontrol-origin: margin;
}
QHeaderView::section {
border: 1px solid blue;
background-color: darkslategray;
padding: 1px;
margin: 0px;
}
QTableView {
border: 1px solid green;
border-radius: 5px;
background-color: black;
alternate-background-color: darkslategray;
selection-background-color: blue;
margin-left: 2px;
margin-top: 0;
margin-bottom: 0;
padding:0;
}
QSlider::groove:horizontal {
border: 1px solid gray;
height: 4px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */
background: darkslategray;
}
QSlider::handle:horizontal {
background: lightgray;
border: 1px solid darkslategra;
width: 18px;
margin: -2px 0; /* handle is placed by default on the contents rect of the groove. Expand outside the groove */
border-radius: 3px;
}
QSizeGrip {
image: url(:/blackgui/icons/resize.png);
width: 16px;
height: 16px;
}
QStatusBar {
background: darkslategray;
}
QStatusBar::item {
border: none;
}
QStatusBar QLabel {
border: none;
}