Misc. wizard UI adjustments

- toolbox layout for terrain probe/XSwiftBus
- load overview URLs in table
- size adjustments
This commit is contained in:
Klaus Basan
2018-10-06 13:15:41 +02:00
parent 037708e4fa
commit b5bfe301d2
6 changed files with 72 additions and 84 deletions

View File

@@ -28,7 +28,7 @@ namespace BlackGui
ui->setupUi(this); ui->setupUi(this);
ui->wp_CopyModels->setConfigComponent(ui->comp_CopyModels); ui->wp_CopyModels->setConfigComponent(ui->comp_CopyModels);
ui->wp_Simulator->setConfigComponent(ui->comp_Simulator); ui->wp_Simulator->setConfigComponent(ui->comp_Simulator);
ui->wp_SimulatorSpecific->setConfigComponent(ui->comp_XSwiftBus, ui->comp_FsxTerrainProbe); ui->wp_SimulatorSpecific->setConfigComponent(ui->comp_InstallXSwiftBus, ui->comp_InstallFsxTerrainProbe);
ui->wp_DataLoad->setConfigComponent(ui->comp_DataLoad); ui->wp_DataLoad->setConfigComponent(ui->comp_DataLoad);
ui->wp_Hotkeys->setConfigComponent(ui->comp_Hotkeys); ui->wp_Hotkeys->setConfigComponent(ui->comp_Hotkeys);
ui->wp_Legal->setConfigComponent(ui->comp_LegalInformation); ui->wp_Legal->setConfigComponent(ui->comp_LegalInformation);

View File

@@ -6,14 +6,14 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>800</width> <width>700</width>
<height>600</height> <height>600</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>500</width> <width>700</width>
<height>500</height> <height>600</height>
</size> </size>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@@ -198,37 +198,43 @@
<property name="subTitle"> <property name="subTitle">
<string>Install XSwiftBus (X-Plane only) or swift terrain probe (FSX/P3D only)</string> <string>Install XSwiftBus (X-Plane only) or swift terrain probe (FSX/P3D only)</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QVBoxLayout" name="vl_SimulatorSpecific">
<property name="leftMargin"> <item>
<number>4</number> <widget class="QToolBox" name="tb_SimulatorSpecific">
</property> <widget class="QWidget" name="pg_InstallFsxTerrainProbe" native="true">
<property name="topMargin"> <attribute name="label">
<number>4</number> <string extracomment="FSX/P3D: Needed with the x86 legacy 32bit SimConnect">Install FSX terrain probe</string>
</property> </attribute>
<property name="rightMargin"> <layout class="QVBoxLayout" name="vl_P3DFsx">
<number>4</number> <item alignment="Qt::AlignTop">
</property> <widget class="BlackGui::Components::CInstallFsxTerrainProbeComponent" name="comp_InstallFsxTerrainProbe">
<property name="bottomMargin"> <property name="minimumSize">
<number>4</number> <size>
</property> <width>0</width>
<item row="1" column="0"> <height>50</height>
<widget class="BlackGui::Components::CInstallXSwiftBusComponent" name="comp_XSwiftBus"> </size>
<property name="minimumSize"> </property>
<size> </widget>
<width>0</width> </item>
<height>150</height> </layout>
</size> </widget>
</property> <widget class="QWidget" name="pg_InstallXSwiftBus" native="true">
</widget> <attribute name="label">
</item> <string extracomment="Install the XSwiftBus component">XPlane: Install XSwiftBus</string>
<item row="0" column="0"> </attribute>
<widget class="BlackGui::Components::CInstallFsxTerrainProbeComponent" name="comp_FsxTerrainProbe" native="true"> <layout class="QVBoxLayout" name="vl_XPlane">
<property name="minimumSize"> <item alignment="Qt::AlignTop">
<size> <widget class="BlackGui::Components::CInstallXSwiftBusComponent" name="comp_InstallXSwiftBus">
<width>0</width> <property name="minimumSize">
<height>75</height> <size>
</size> <width>0</width>
</property> <height>50</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
</layout> </layout>
@@ -373,7 +379,7 @@
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>BlackGui::Components::CInstallFsxTerrainProbeComponent</class> <class>BlackGui::Components::CInstallFsxTerrainProbeComponent</class>
<extends>QWidget</extends> <extends>QFrame</extends>
<header>blackgui/components/installfsxterrainprobecomponent.h</header> <header>blackgui/components/installfsxterrainprobecomponent.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>

View File

@@ -15,6 +15,7 @@
#include "blackcore/webdataservices.h" #include "blackcore/webdataservices.h"
#include "blackcore/db/infodatareader.h" #include "blackcore/db/infodatareader.h"
#include "blackmisc/network/networkutils.h" #include "blackmisc/network/networkutils.h"
#include "blackmisc/htmlutils.h"
#include <QPointer> #include <QPointer>
#include <QMessageBox> #include <QMessageBox>
@@ -216,11 +217,10 @@ namespace BlackGui
// Shared URLs // Shared URLs
const CUrlList sharedUrls(sGui->getGlobalSetup().getSwiftSharedUrls()); const CUrlList sharedUrls(sGui->getGlobalSetup().getSwiftSharedUrls());
const QString tableHtml("<table>%1</table>"); const QString valueHtml("<img src=\"%1\">&nbsp;%2");
const QString rowHtml("<tr><td><img src=\"%1\">&nbsp;</td><td>%2</td></tr>");
const QString urlLinkHtml("<a href=\"%1\">%2</a>"); const QString urlLinkHtml("<a href=\"%1\">%2</a>");
QString allRowsHtml; QStringList values;
for (const CUrl &sharedUrl : sharedUrls) for (const CUrl &sharedUrl : sharedUrls)
{ {
if (!sGui || sGui->isShuttingDown()) if (!sGui || sGui->isShuttingDown())
@@ -230,9 +230,13 @@ namespace BlackGui
return; return;
} }
canConnect = CNetworkUtils::canConnect(sharedUrl); canConnect = CNetworkUtils::canConnect(sharedUrl);
allRowsHtml += rowHtml.arg(canConnect ? imgOk : imgFailed, urlLinkHtml.arg(sharedUrl.getFullUrl(), sharedUrl.getHost())); values.push_back(
valueHtml.arg(canConnect ? imgOk : imgFailed, urlLinkHtml.arg(sharedUrl.getFullUrl(), sharedUrl.getHost()))
);
} }
ui->lbl_SharedUrls->setText(tableHtml.arg(allRowsHtml.trimmed()));
const QString sharedUrlTable = toHtmTable(values, 2);
ui->lbl_SharedUrls->setText(sharedUrlTable);
ui->lbl_SharedUrls->setMinimumHeight(10 + (18 * sharedUrls.size())); ui->lbl_SharedUrls->setMinimumHeight(10 + (18 * sharedUrls.size()));
const QString currentlyUsedSharedUrl = sGui->getWorkingSharedUrl().toQString(); const QString currentlyUsedSharedUrl = sGui->getWorkingSharedUrl().toQString();
ui->lbl_SharedUrls->setToolTip( ui->lbl_SharedUrls->setToolTip(

View File

@@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>644</width> <width>644</width>
<height>367</height> <height>253</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@@ -140,7 +140,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="10" column="0"> <item row="10" column="0" alignment="Qt::AlignVCenter">
<widget class="QLabel" name="lbl_DbUrl"> <widget class="QLabel" name="lbl_DbUrl">
<property name="text"> <property name="text">
<string>DB URL:</string> <string>DB URL:</string>
@@ -258,16 +258,10 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="11" column="2" colspan="9" alignment="Qt::AlignTop"> <item row="11" column="2" colspan="9">
<widget class="QLabel" name="lbl_SharedUrls"> <widget class="QLabel" name="lbl_SharedUrls">
<property name="minimumSize">
<size>
<width>0</width>
<height>125</height>
</size>
</property>
<property name="text"> <property name="text">
<string>Checking shared servers' URLs</string> <string>Shared URL will go here</string>
</property> </property>
</widget> </widget>
</item> </item>
@@ -532,7 +526,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="11" column="0" alignment="Qt::AlignTop"> <item row="11" column="0" alignment="Qt::AlignVCenter">
<widget class="QLabel" name="lbl_SharedUrl"> <widget class="QLabel" name="lbl_SharedUrl">
<property name="text"> <property name="text">
<string>Shared:</string> <string>Shared:</string>

View File

@@ -7,13 +7,16 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>427</width> <width>427</width>
<height>194</height> <height>189</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Copy swift probe</string> <string>Copy swift probe</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="vl_InstallFsxTerrainProbe">
<property name="spacing">
<number>0</number>
</property>
<item> <item>
<widget class="QFrame" name="fr_InfoHeader"> <widget class="QFrame" name="fr_InfoHeader">
<layout class="QHBoxLayout" name="hl_InfoHeader" stretch="1,1,3"> <layout class="QHBoxLayout" name="hl_InfoHeader" stretch="1,1,3">

View File

@@ -6,16 +6,10 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>600</width> <width>396</width>
<height>400</height> <height>317</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>600</width>
<height>400</height>
</size>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Install XSwiftBus</string> <string>Install XSwiftBus</string>
</property> </property>
@@ -41,7 +35,7 @@
<item> <item>
<widget class="QLabel" name="lbl_XplaneIcon"> <widget class="QLabel" name="lbl_XplaneIcon">
<property name="text"> <property name="text">
<string>&lt;html&gt;&lt;img src=&quot;:/simulators/icons/simulators/XPlane.png&quot; width=200&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;img src=&quot;:/simulators/icons/simulators/XPlane.png&quot; width=175&gt;&lt;/html&gt;</string>
</property> </property>
</widget> </widget>
</item> </item>
@@ -68,16 +62,16 @@
</property> </property>
<layout class="QGridLayout" name="gl_DownloadAndInstall"> <layout class="QGridLayout" name="gl_DownloadAndInstall">
<property name="leftMargin"> <property name="leftMargin">
<number>4</number> <number>5</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>4</number> <number>5</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>4</number> <number>5</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>4</number> <number>5</number>
</property> </property>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="lbl_XSwiftBusPluginDir"> <widget class="QLabel" name="lbl_XSwiftBusPluginDir">
@@ -185,16 +179,16 @@
</property> </property>
<layout class="QVBoxLayout" name="vl_XSwiftBusSettings"> <layout class="QVBoxLayout" name="vl_XSwiftBusSettings">
<property name="leftMargin"> <property name="leftMargin">
<number>4</number> <number>5</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>4</number> <number>5</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>4</number> <number>5</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>4</number> <number>5</number>
</property> </property>
<item> <item>
<widget class="BlackGui::Components::CSettingsXSwiftBusComponent" name="comp_SettingsXSwiftBus"> <widget class="BlackGui::Components::CSettingsXSwiftBusComponent" name="comp_SettingsXSwiftBus">
@@ -209,19 +203,6 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<spacer name="vs_XSwiftBusComponent">
<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> </layout>
</widget> </widget>
<customwidgets> <customwidgets>