Some GUI adjustments / formatting found during #702

* selection in view (full row)
* Unused function removed
* Allow reduced message form
This commit is contained in:
Klaus Basan
2016-07-05 12:36:40 +02:00
parent ebb3d0d690
commit 77c749aba2
11 changed files with 66 additions and 22 deletions

View File

@@ -121,9 +121,9 @@ namespace BlackGui
void CAtcStationComponent::update()
{
if (!sGui || !sGui->getIContextNetwork()) { return; }
Q_ASSERT(this->ui->tvp_AtcStationsBooked);
Q_ASSERT(this->ui->tvp_AtcStationsOnline);
Q_ASSERT(sGui->getIContextNetwork());
// check if component is visible, if we have already data then skip udpate
bool hasData = this->countBookedStations() > 0 || this->countOnlineStations() > 0;

View File

@@ -82,11 +82,6 @@ namespace BlackGui
CDbStashComponent::~CDbStashComponent()
{ }
void CDbStashComponent::gracefulShutdown()
{
// shutdown
}
CStatusMessage CDbStashComponent::validateStashModel(const CAircraftModel &model, bool allowReplace) const
{
if (!allowReplace && this->ui->tvp_StashAircraftModels->container().containsModelStringOrDbKey(model))

View File

@@ -70,9 +70,6 @@ namespace BlackGui
//! Destructor
~CDbStashComponent();
//! Graceful shutdown
void gracefulShutdown();
//! Test the given model if it can be stashed
BlackMisc::CStatusMessage validateStashModel(const BlackMisc::Simulation::CAircraftModel &model, bool allowReplace) const;

View File

@@ -547,14 +547,14 @@ namespace BlackGui
QString modelStr(model.hasModelString() ? model.getModelString() : "<unknown>");
if (model.getAircraftIcaoCode().hasDesignator())
{
CLogMessage(this).validationInfo("Reverse lookup for %1") << modelStr;
CLogMessage(this).validationInfo("Reverse lookup for '%1'") << modelStr;
// update GUI
this->setGuiIcaoValues(model, false);
}
else
{
CLogMessage(this).validationInfo("Reverse lookup for %1 failed, set data manually") << modelStr;
CLogMessage(this).validationInfo("Reverse lookup for '%1'' failed, set data manually") << modelStr;
}
}

View File

@@ -27,7 +27,6 @@
class QWidget;
namespace Ui { class CModelMatcherComponent; }
namespace BlackGui
{
namespace Components

View File

@@ -61,5 +61,16 @@ namespace BlackGui
{
this->setVisible(!isVisible());
}
void CStatusMessageForm::setReducedInfo(bool minimized)
{
ui->le_Timestamp->setVisible(!minimized);
ui->lbl_Timestamp->setVisible(!minimized);
ui->le_Categories->setVisible(!minimized);
ui->lbl_Categories->setVisible(!minimized);
ui->le_Severity->setVisible(!minimized);
ui->lbl_SeverityIcon->setVisible(!minimized);
ui->lbl_Severity->setVisible(!minimized);
}
} // ns
} // ns

View File

@@ -23,7 +23,6 @@
class QWidget;
namespace Ui { class CStatusMessageForm; }
namespace BlackGui
{
namespace Components
@@ -52,6 +51,9 @@ namespace BlackGui
//! Toggle visibility
void toggleVisibility();
//! Minimize by hiding status ...
void setReducedInfo(bool minimized);
private:
QScopedPointer<Ui::CStatusMessageForm> ui;
};

View File

@@ -48,6 +48,5 @@ namespace BlackGui
this->m_timer->start(); // restart other timer
this->m_timerSingleShot->start(10);
}
} // namespace
} // namespace

View File

@@ -25,6 +25,7 @@ namespace BlackGui
namespace Components
{
//! Timer used in components for updates
//! \deprecated used at the beginning of the project, likely to be removed in the future
class BLACKGUI_EXPORT CUpdateTimer: public QObject
{
Q_OBJECT

View File

@@ -57,9 +57,9 @@ namespace BlackGui
void CUserComponent::update()
{
if (!sGui || !sGui->getIContextNetwork()) { return; }
Q_ASSERT(this->ui->tvp_AllUsers);
Q_ASSERT(this->ui->tvp_Clients);
Q_ASSERT(sGui->getIContextNetwork());
if (sGui->getIContextNetwork()->isConnected())
{
@@ -99,6 +99,5 @@ namespace BlackGui
this->ui->tvp_Clients->clear();
}
}
} // namespace
} // namespace

View File

@@ -27,9 +27,6 @@
<string>Users</string>
</attribute>
<layout class="QVBoxLayout" name="vl_AllUsers">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
@@ -44,6 +41,12 @@
</property>
<item>
<widget class="BlackGui::Views::CUserView" name="tvp_AllUsers">
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
@@ -56,9 +59,6 @@
<string>Clients</string>
</attribute>
<layout class="QVBoxLayout" name="vl_Clients">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
@@ -73,6 +73,12 @@
</property>
<item>
<widget class="BlackGui::Views::CClientView" name="tvp_Clients">
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
@@ -80,6 +86,35 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tb_MatchingLog">
<attribute name="title">
<string>Matching log</string>
</attribute>
<layout class="QVBoxLayout" name="vl_MatchingLog">
<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>
<widget class="BlackGui::Components::CModelMatcherLogComponent" name="comp_MatchingLog">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<customwidgets>
<customwidget>
@@ -92,6 +127,12 @@
<extends>QTableView</extends>
<header>blackgui/views/clientview.h</header>
</customwidget>
<customwidget>
<class>BlackGui::Components::CModelMatcherLogComponent</class>
<extends>QFrame</extends>
<header>blackgui/components/modelmatcherlogcomponent.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>