Formatting, new icons, minor tweaks

This commit is contained in:
Klaus Basan
2014-09-23 00:36:13 +02:00
parent be0d1e8153
commit ef5f5bde0f
23 changed files with 120 additions and 53 deletions

View File

@@ -8,8 +8,9 @@
*/
#include "aircraftcomponent.h"
#include "dockwidgetinfoareacomponent.h"
#include "ui_aircraftcomponent.h"
#include "dockwidgetinfoareacomponent.h"
#include "../guiutility.h"
namespace BlackGui
{

View File

@@ -16,7 +16,6 @@
#include "blackgui/components/timerbasedcomponent.h"
#include "blackgui/components/dockwidgetinfoareacomponent.h"
#include "blackmisc/avaircraft.h"
#include <QTabWidget>
namespace Ui { class CAircraftComponent; }
@@ -49,7 +48,7 @@ namespace BlackGui
int countAirportsInRange() const;
public slots:
//! Update users
//! Update aircrafts
void update();
//! \copydoc CTimerBasedComponent::setUpdateIntervalSeconds
@@ -71,7 +70,7 @@ namespace BlackGui
private:
Ui::CAircraftComponent *ui;
CTimerBasedComponent *m_timerComponent;
CTimerBasedComponent *m_timerComponent;
};
}
}

View File

@@ -48,12 +48,12 @@ namespace BlackGui
Q_ASSERT(connected);
connected = this->connect(this->ui->pb_AtcStationsLoadMetar, SIGNAL(clicked()), this, SLOT(getMetar()));
Q_ASSERT(connected);
connect(this, &QTabWidget::currentChanged, this, &CAtcStationComponent::ps_atcStationsTabChanged);
connect(this, &QTabWidget::currentChanged, this, &CAtcStationComponent::ps_atcStationsTabChanged); // "local" tab changed (booked, online)
connect(this->ui->tvp_AtcStationsOnline, &QTableView::clicked, this, &CAtcStationComponent::ps_onlineAtcStationSelected);
connect(this->ui->tvp_AtcStationsOnline, &CAtcStationView::testRequestDummyAtcOnlineStations, this, &CAtcStationComponent::ps_testCreateDummyOnlineAtcStations);
connect(this->ui->tvp_AtcStationsOnline, &CAtcStationView::requestUpdate, this, &CAtcStationComponent::ps_requestOnlineStationsUpdate);
connect(this->ui->pb_AtcStationsAtisReload, &QPushButton::clicked, this, &CAtcStationComponent::ps_requestAtis);
connect(this->ui->tvp_AtcStationsBooked, &CAtcStationView::requestUpdate, this, &CAtcStationComponent::ps_reloadAtcStationsBooked);
connect(this->ui->pb_AtcStationsAtisReload, &QPushButton::clicked, this, &CAtcStationComponent::ps_requestAtis);
}
CAtcStationComponent::~CAtcStationComponent()
@@ -82,10 +82,7 @@ namespace BlackGui
this->connect(this->getIContextNetwork(), &IContextNetwork::changedAtcStationOnlineConnectionStatus, this, &CAtcStationComponent::changedAtcStationOnlineConnectionStatus);
this->connect(this->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CAtcStationComponent::ps_connectionStatusChanged);
}
bool connected = connect(this->getParentInfoArea(), &CInfoArea::tabBarCurrentChanged, this, &CAtcStationComponent::ps_infoAreaTabBarChanged);
Q_ASSERT(connected);
connect(this->getParentInfoArea(), &CInfoArea::tabBarCurrentChanged, this, &CAtcStationComponent::ps_infoAreaTabBarChanged);
}
void CAtcStationComponent::update()
@@ -98,7 +95,7 @@ namespace BlackGui
bool hasData = this->countBookedStations() > 0 || this->countOnlineStations() > 0;
if (hasData && !this->isVisibleWidget())
{
// KWB remove: qDebug() will be removed soo
// KWB remove: qDebug() will be removed soon
qDebug() << this->objectName() << "Skipping update, not visible";
return;
}

View File

@@ -201,6 +201,6 @@ namespace BlackGui
void CDockWidget::onStyleSheetsChanged()
{
// void
// void, for further extensions
}
}

View File

@@ -133,6 +133,12 @@ namespace BlackGui
return QVariant(cvo->toPixmap());
}
CDateTimeFormatter::CDateTimeFormatter(const QString formatString, int alignment, bool i18n) :
CDefaultFormatter(alignment, i18n, { Qt::DisplayRole }), m_formatString(formatString)
{
// void
}
QVariant CDateTimeFormatter::displayRole(const QVariant &dateTime) const
{
if (dateTime.isNull()) return "";

View File

@@ -209,8 +209,7 @@ namespace BlackGui
{
public:
//! Constructor
CDateTimeFormatter(const QString formatString = formatYmd(), int alignment = alignDefault(), bool i18n = true) :
CDefaultFormatter(alignment, i18n, { Qt::DisplayRole }), m_formatString(formatString) {}
CDateTimeFormatter(const QString formatString = formatYmd(), int alignment = alignDefault(), bool i18n = true);
//! \copydoc CDefaultFormatter::displayRole
virtual QVariant displayRole(const QVariant &dateTime) const override;

View File

@@ -129,10 +129,9 @@ namespace BlackGui
{
// KWB remove: qDebug() will be removed soon
qDebug() << "update" << this->objectName() << "size" << container.size() << "thread:" << QThread::currentThreadId();
// Keep sorting out of begin/end reset model
QTime myTimer;
// Keep sorting out of begin/end reset model
ContainerType sortedContainer;
bool performSort = sort && container.size() > 1 && this->hasValidSortColumn();
if (performSort)

View File

@@ -54,7 +54,7 @@ namespace BlackGui
/*!
* Set column for sorting
* \param propertyIndex index of column to be sorted by
* \param propertyIndex index of column to be sorted
*/
virtual void setSortColumnByPropertyIndex(const BlackMisc::CPropertyIndex &propertyIndex)
{
@@ -85,6 +85,8 @@ namespace BlackGui
protected slots:
//! Helper method with template free signature
//! \param variant container is transferred in variant
//! \param sort
int updateContainer(const QVariant &variant, bool sort)
{
return this->performUpdateContainer(variant, sort);

View File

@@ -32,6 +32,7 @@ namespace BlackGui
virtual ~IUpdateWorker() { terminateThread();}
signals:
//! Update is completed
void updateFinished();
public slots:

View File

@@ -55,7 +55,7 @@ namespace BlackGui
QAction *actionInteractiveResize = new QAction(&menu);
actionInteractiveResize->setObjectName(this->objectName().append("ActionResizing"));
actionInteractiveResize->setIconText("Resize (auto)");
actionInteractiveResize->setIcon(CIcons::viewMulticolumn());
actionInteractiveResize->setIcon(CIcons::viewMultiColumn());
actionInteractiveResize->setCheckable(true);
actionInteractiveResize->setChecked(this->m_resizeMode == ResizingAuto);
actionInteractiveResize->setEnabled(enabled);

View File

@@ -47,7 +47,7 @@ namespace BlackGui
//! Clear data
virtual void clear() = 0;
//! Current rows resize mode
//! Resize mode
ResizeMode getResizeMode() const { return m_resizeMode; }
//! Set resize mode
@@ -100,8 +100,8 @@ namespace BlackGui
//! \param resize
virtual int performUpdateContainer(const QVariant &variant, bool sort, bool resize) = 0;
//! Skip resizing
virtual bool skipResize() const = 0;
//! Skip resizing because of size?
virtual bool reachedResizeThreshold() const = 0;
//! Resize or skip resize?
virtual bool resize() const;