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() void CAtcStationComponent::update()
{ {
if (!sGui || !sGui->getIContextNetwork()) { return; }
Q_ASSERT(this->ui->tvp_AtcStationsBooked); Q_ASSERT(this->ui->tvp_AtcStationsBooked);
Q_ASSERT(this->ui->tvp_AtcStationsOnline); Q_ASSERT(this->ui->tvp_AtcStationsOnline);
Q_ASSERT(sGui->getIContextNetwork());
// check if component is visible, if we have already data then skip udpate // check if component is visible, if we have already data then skip udpate
bool hasData = this->countBookedStations() > 0 || this->countOnlineStations() > 0; bool hasData = this->countBookedStations() > 0 || this->countOnlineStations() > 0;

View File

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

View File

@@ -70,9 +70,6 @@ namespace BlackGui
//! Destructor //! Destructor
~CDbStashComponent(); ~CDbStashComponent();
//! Graceful shutdown
void gracefulShutdown();
//! Test the given model if it can be stashed //! Test the given model if it can be stashed
BlackMisc::CStatusMessage validateStashModel(const BlackMisc::Simulation::CAircraftModel &model, bool allowReplace) const; 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>"); QString modelStr(model.hasModelString() ? model.getModelString() : "<unknown>");
if (model.getAircraftIcaoCode().hasDesignator()) if (model.getAircraftIcaoCode().hasDesignator())
{ {
CLogMessage(this).validationInfo("Reverse lookup for %1") << modelStr; CLogMessage(this).validationInfo("Reverse lookup for '%1'") << modelStr;
// update GUI // update GUI
this->setGuiIcaoValues(model, false); this->setGuiIcaoValues(model, false);
} }
else 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; class QWidget;
namespace Ui { class CModelMatcherComponent; } namespace Ui { class CModelMatcherComponent; }
namespace BlackGui namespace BlackGui
{ {
namespace Components namespace Components

View File

@@ -61,5 +61,16 @@ namespace BlackGui
{ {
this->setVisible(!isVisible()); 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
} // ns } // ns

View File

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

View File

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

View File

@@ -25,6 +25,7 @@ namespace BlackGui
namespace Components namespace Components
{ {
//! Timer used in components for updates //! 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 class BLACKGUI_EXPORT CUpdateTimer: public QObject
{ {
Q_OBJECT Q_OBJECT

View File

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

View File

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