refs #755, mapping UI improvements

* make drop area more obvious by icon and color
* improve forms so the layout looks better on large screens
* button to display model dialog (like distributor, ICAO, ...)
This commit is contained in:
Klaus Basan
2016-09-02 23:00:12 +02:00
committed by Roland Winklmeier
parent aafff6cd82
commit 10325ee8a9
18 changed files with 67 additions and 51 deletions

View File

@@ -447,7 +447,7 @@ namespace BlackGui
} }
} }
void CDbMappingComponent::ps_modifyModelDialog() void CDbMappingComponent::modifyModelDialog()
{ {
// only one model selected, use as default // only one model selected, use as default
if (ui->comp_StashAircraft->view()->hasSingleSelectedRow()) if (ui->comp_StashAircraft->view()->hasSingleSelectedRow())
@@ -945,7 +945,7 @@ namespace BlackGui
this->m_menuActions[0] = menuActions.addAction(this->m_menuActions[0], CIcons::appAircraftIcao16(), "Current aircraft ICAO", CMenuAction::pathStashEditor(), this, { mapComp, &CDbMappingComponent::ps_applyFormAircraftIcaoData }); this->m_menuActions[0] = menuActions.addAction(this->m_menuActions[0], CIcons::appAircraftIcao16(), "Current aircraft ICAO", CMenuAction::pathStashEditor(), this, { mapComp, &CDbMappingComponent::ps_applyFormAircraftIcaoData });
this->m_menuActions[1] = menuActions.addAction(this->m_menuActions[1], CIcons::appDistributors16(), "Current distributor", CMenuAction::pathStashEditor(), this, { mapComp, &CDbMappingComponent::ps_applyFormDistributorData }); this->m_menuActions[1] = menuActions.addAction(this->m_menuActions[1], CIcons::appDistributors16(), "Current distributor", CMenuAction::pathStashEditor(), this, { mapComp, &CDbMappingComponent::ps_applyFormDistributorData });
this->m_menuActions[2] = menuActions.addAction(this->m_menuActions[2], CIcons::appLiveries16(), "Current livery", CMenuAction::pathStashEditor(), this, { mapComp, &CDbMappingComponent::ps_applyFormLiveryData }); this->m_menuActions[2] = menuActions.addAction(this->m_menuActions[2], CIcons::appLiveries16(), "Current livery", CMenuAction::pathStashEditor(), this, { mapComp, &CDbMappingComponent::ps_applyFormLiveryData });
this->m_menuActions[3] = menuActions.addAction(this->m_menuActions[3], CIcons::databaseTable16(), "Modify DB model data", CMenuAction::pathStashEditor(), this, { mapComp, &CDbMappingComponent::ps_modifyModelDialog }); this->m_menuActions[3] = menuActions.addAction(this->m_menuActions[3], CIcons::databaseTable16(), "Modify DB model data", CMenuAction::pathStashEditor(), this, { mapComp, &CDbMappingComponent::modifyModelDialog });
} }
this->nestedCustomMenu(menuActions); this->nestedCustomMenu(menuActions);
} }

View File

@@ -187,6 +187,9 @@ namespace BlackGui
//! Stash models //! Stash models
void stashSelectedModels(); void stashSelectedModels();
//! Open model modify dialog
void modifyModelDialog();
signals: signals:
//! Request to filter by livery //! Request to filter by livery
void filterByLivery(const BlackMisc::Aviation::CLivery &livery); void filterByLivery(const BlackMisc::Aviation::CLivery &livery);
@@ -273,9 +276,6 @@ namespace BlackGui
//! Apply current DB data from form //! Apply current DB data from form
void ps_applyFormDistributorData(); void ps_applyFormDistributorData();
//! Open model modify dialog
void ps_modifyModelDialog();
//! Add to own model set //! Add to own model set
void ps_addToOwnModelSet(); void ps_addToOwnModelSet();

View File

@@ -250,7 +250,7 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>100</height> <height>110</height>
</size> </size>
</property> </property>
</widget> </widget>
@@ -288,13 +288,13 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>882</width> <width>882</width>
<height>425</height> <height>450</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>425</height> <height>450</height>
</size> </size>
</property> </property>
<layout class="QHBoxLayout" name="hl_EditorsScrollArea"> <layout class="QHBoxLayout" name="hl_EditorsScrollArea">

View File

@@ -72,6 +72,7 @@ namespace BlackGui
connect(ui->pb_AirlineIcao, &QPushButton::pressed, this, &CDbStashComponent::ps_copyOverPartsToSelected); connect(ui->pb_AirlineIcao, &QPushButton::pressed, this, &CDbStashComponent::ps_copyOverPartsToSelected);
connect(ui->pb_Livery, &QPushButton::pressed, this, &CDbStashComponent::ps_copyOverPartsToSelected); connect(ui->pb_Livery, &QPushButton::pressed, this, &CDbStashComponent::ps_copyOverPartsToSelected);
connect(ui->pb_Distributor, &QPushButton::pressed, this, &CDbStashComponent::ps_copyOverPartsToSelected); connect(ui->pb_Distributor, &QPushButton::pressed, this, &CDbStashComponent::ps_copyOverPartsToSelected);
connect(ui->pb_Model, &QPushButton::pressed, this, &CDbStashComponent::ps_modifyModelDialog);
ui->tvp_StashAircraftModels->menuAddItems(CAircraftModelView::MenuRemoveSelectedRows); ui->tvp_StashAircraftModels->menuAddItems(CAircraftModelView::MenuRemoveSelectedRows);
ui->tvp_StashAircraftModels->setHighlightModelStrings(true); ui->tvp_StashAircraftModels->setHighlightModelStrings(true);
@@ -450,6 +451,14 @@ namespace BlackGui
} }
} }
void CDbStashComponent::ps_modifyModelDialog()
{
if (this->getMappingComponent())
{
this->getMappingComponent()->modifyModelDialog();
}
}
void CDbStashComponent::ps_onRowCountChanged(int number, bool filter) void CDbStashComponent::ps_onRowCountChanged(int number, bool filter)
{ {
Q_UNUSED(number); Q_UNUSED(number);

View File

@@ -159,6 +159,9 @@ namespace BlackGui
//! Copy over values //! Copy over values
void ps_copyOverPartsToSelected(); void ps_copyOverPartsToSelected();
//! Display model dialog
void ps_modifyModelDialog();
//! Row count changed //! Row count changed
void ps_onRowCountChanged(int number, bool filter); void ps_onRowCountChanged(int number, bool filter);

View File

@@ -124,6 +124,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QPushButton" name="pb_Model">
<property name="text">
<string>Model</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QPushButton" name="pb_Distributor"> <widget class="QPushButton" name="pb_Distributor">
<property name="text"> <property name="text">
@@ -171,6 +178,7 @@
<tabstop>pb_RemoveInvald</tabstop> <tabstop>pb_RemoveInvald</tabstop>
<tabstop>pb_Publish</tabstop> <tabstop>pb_Publish</tabstop>
<tabstop>cb_SelectedOnly</tabstop> <tabstop>cb_SelectedOnly</tabstop>
<tabstop>pb_Model</tabstop>
<tabstop>pb_Distributor</tabstop> <tabstop>pb_Distributor</tabstop>
<tabstop>pb_AircraftIcao</tabstop> <tabstop>pb_AircraftIcao</tabstop>
<tabstop>pb_Livery</tabstop> <tabstop>pb_Livery</tabstop>

View File

@@ -27,12 +27,13 @@ namespace BlackGui
{ {
CDropSite::CDropSite(QWidget *parent) : QLabel(parent) CDropSite::CDropSite(QWidget *parent) : QLabel(parent)
{ {
setFrameStyle(QFrame::Sunken | QFrame::StyledPanel); this->setFrameStyle(QFrame::Sunken | QFrame::StyledPanel);
setAlignment(Qt::AlignCenter); this->setAlignment(Qt::AlignCenter);
setAcceptDrops(true); this->setAcceptDrops(true);
this->setInfoText(tr("<drop content>")); this->setTextFormat(Qt::RichText);
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CDropSite::ps_onStyleSheetsChanged); this->setInfoText("drop data here");
this->ps_onStyleSheetsChanged(); this->ps_onStyleSheetsChanged();
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CDropSite::ps_onStyleSheetsChanged);
} }
void CDropSite::setInfoText(const QString &dropSiteText) void CDropSite::setInfoText(const QString &dropSiteText)
@@ -50,7 +51,8 @@ namespace BlackGui
void CDropSite::resetText() void CDropSite::resetText()
{ {
setText(this->m_infoText); const QString html = "<img src=':/own/icons/own/drophere16.png'>&nbsp;&nbsp;" + this->m_infoText.toHtmlEscaped();
setText(html);
} }
void CDropSite::dragEnterEvent(QDragEnterEvent *event) void CDropSite::dragEnterEvent(QDragEnterEvent *event)

View File

@@ -7,13 +7,13 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>402</width> <width>402</width>
<height>241</height> <height>271</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>220</height> <height>225</height>
</size> </size>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@@ -40,7 +40,7 @@
<property name="title"> <property name="title">
<string>Aircraft ICAO</string> <string>Aircraft ICAO</string>
</property> </property>
<layout class="QGridLayout" name="gl_AircraftIcao"> <layout class="QGridLayout" name="gl_AircraftIcao" columnstretch="0,1,0">
<item row="1" column="1"> <item row="1" column="1">
<widget class="QWidget" name="wi_DesignatorRank" native="true"> <widget class="QWidget" name="wi_DesignatorRank" native="true">
<layout class="QHBoxLayout" name="hl_DesignatorRank"> <layout class="QHBoxLayout" name="hl_DesignatorRank">

View File

@@ -40,7 +40,7 @@
<property name="title"> <property name="title">
<string>Airline ICAO</string> <string>Airline ICAO</string>
</property> </property>
<layout class="QGridLayout" name="gl_AirlineIcao"> <layout class="QGridLayout" name="gl_AirlineIcao" columnstretch="0,1,0">
<item row="5" column="1"> <item row="5" column="1">
<widget class="QWidget" name="wi_Timestamps" native="true"> <widget class="QWidget" name="wi_Timestamps" native="true">
<layout class="QHBoxLayout" name="hl_Timestamps"> <layout class="QHBoxLayout" name="hl_Timestamps">

View File

@@ -6,14 +6,14 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>299</width> <width>297</width>
<height>175</height> <height>200</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>175</height> <height>185</height>
</size> </size>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@@ -40,7 +40,7 @@
<property name="title"> <property name="title">
<string>Distributor</string> <string>Distributor</string>
</property> </property>
<layout class="QGridLayout" name="gl_Distributor"> <layout class="QGridLayout" name="gl_Distributor" columnstretch="0,1,1,0">
<item row="2" column="1"> <item row="2" column="1">
<widget class="QLineEdit" name="le_Alias1"> <widget class="QLineEdit" name="le_Alias1">
<property name="placeholderText"> <property name="placeholderText">

View File

@@ -2,14 +2,6 @@
<ui version="4.0"> <ui version="4.0">
<class>CLiveryForm</class> <class>CLiveryForm</class>
<widget class="QFrame" name="CLiveryForm"> <widget class="QFrame" name="CLiveryForm">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>361</width>
<height>422</height>
</rect>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Livery editor</string> <string>Livery editor</string>
</property> </property>
@@ -34,7 +26,7 @@
<property name="title"> <property name="title">
<string>Livery</string> <string>Livery</string>
</property> </property>
<layout class="QGridLayout" name="gl_Livery"> <layout class="QGridLayout" name="gl_Livery" columnstretch="0,1,1,1,0">
<item row="4" column="0"> <item row="4" column="0">
<widget class="QLabel" name="lbl_Timestamp"> <widget class="QLabel" name="lbl_Timestamp">
<property name="text"> <property name="text">
@@ -140,14 +132,7 @@
</widget> </widget>
</item> </item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="BlackGui::CLabelAndIcon" name="lai_Id"> <widget class="BlackGui::CLabelAndIcon" name="lai_Id"/>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item> </item>
<item row="6" column="0" colspan="4"> <item row="6" column="0" colspan="4">
<widget class="BlackGui::Editors::CAirlineIcaoForm" name="editor_AirlineIcao"> <widget class="BlackGui::Editors::CAirlineIcaoForm" name="editor_AirlineIcao">

View File

@@ -2,14 +2,6 @@
<ui version="4.0"> <ui version="4.0">
<class>CLabelAndIcon</class> <class>CLabelAndIcon</class>
<widget class="QFrame" name="CLabelAndIcon"> <widget class="QFrame" name="CLabelAndIcon">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>50</width>
<height>15</height>
</rect>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Frame</string> <string>Frame</string>
</property> </property>
@@ -52,6 +44,19 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="hs_LabelAndAction">
<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> </layout>
</widget> </widget>
<resources/> <resources/>

View File

@@ -119,12 +119,13 @@ BlackGui--COverlayMessages {
} }
BlackGui--CDropSite { BlackGui--CDropSite {
color: blue; color: grey;
border: 2px solid green; border: 2px dashed grey;
border-radius: 5px; border-radius: 5px;
min-height: 20px; min-height: 18px;
max-height: 20px; max-height: 18px;
margin: 2px; margin: 2px;
padding: 2px;
} }
/* Validator bar */ /* Validator bar */

View File

@@ -423,6 +423,9 @@
<file>icons/own/swift/swiftCircle512.png</file> <file>icons/own/swift/swiftCircle512.png</file>
<file>icons/own/swift/swiftCircle1024.png</file> <file>icons/own/swift/swiftCircle1024.png</file>
<file>icons/own/swift/swiftCartoonNova64.png</file> <file>icons/own/swift/swiftCartoonNova64.png</file>
<file>icons/own/drophere24.png</file>
<file>icons/own/drophere48.png</file>
<file>icons/own/drophere16.png</file>
</qresource> </qresource>
<qresource prefix="/qled"> <qresource prefix="/qled">
<file>icons/qled/circle_black.svg</file> <file>icons/qled/circle_black.svg</file>

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB