blackgui library with list model classes for our lists

refs #81
This commit is contained in:
Klaus Basan
2013-12-16 00:20:18 +00:00
committed by Mathew Sutcliffe
parent c77951743e
commit 34774bd005
12 changed files with 881 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ include (externals.pri)
WITH_BLACKMISC = ON
WITH_BLACKCORE = ON
WITH_BLACKGUI = ON
WITH_SAMPLES = ON
#WITH_DRIVER_FSX = ON
@@ -23,6 +24,8 @@ equals(WITH_BLACKCORE, ON) {
SUBDIRS += src/blackcore
}
equals(WITH_BLACKGUI, ON) {
SUBDIRS += src/blackgui
}
equals(WITH_DRIVER_FSX, ON) {

View File

@@ -0,0 +1,46 @@
/* Copyright (C) 2013 VATSIM Community / contributors
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "aircraftlistmodel.h"
#include "blackmisc/avaircraftsituation.h"
#include "blackmisc/blackmiscfreefunctions.h"
using namespace BlackMisc::Aviation;
namespace BlackGui
{
/*
* Constructor
*/
CAircraftListModel::CAircraftListModel(QObject *parent) : CListModelBase("ViewAircraftList", parent)
{
this->m_columns.addColumn(CAircraft::IndexCallsign, "callsign");
this->m_columns.addColumn(CAircraft::IndexPilotRealname, "pilotrealname");
this->m_columns.addColumn(CAircraft::IndexDistance, "distance", Qt::AlignRight | Qt::AlignVCenter);
this->m_columns.addColumn(CAircraft::IndexFrequencyCom1, "frequency", Qt::AlignRight | Qt::AlignVCenter);
this->m_columns.addColumn(CAircraftIcao::IndexAsString, "model");
this->m_columns.addColumn(CAircraft::IndexTansponderFormatted, "transponder");
this->m_columns.addColumn(CAircraftSituation::IndexPositionLatitude, "latitude", Qt::AlignRight | Qt::AlignVCenter);
this->m_columns.addColumn(CAircraftSituation::IndexPositionLongitude, "longitude", Qt::AlignRight | Qt::AlignVCenter);
this->m_columns.addColumn(CAircraftSituation::IndexAltitude, "altitude", Qt::AlignRight | Qt::AlignVCenter);
this->m_columns.addColumn(CAircraftSituation::IndexGroundspeed, "groundspeed", Qt::AlignRight | Qt::AlignVCenter);
// default sort order
this->setSortColumnByPropertyIndex(CAircraft::IndexDistance);
this->m_sortOrder = Qt::AscendingOrder;
// force strings for translation in resource files
(void)QT_TRANSLATE_NOOP("ViewAircraftList", "callsign");
(void)QT_TRANSLATE_NOOP("ViewAircraftList", "pilotrealname");
(void)QT_TRANSLATE_NOOP("ViewAircraftList", "latitude");
(void)QT_TRANSLATE_NOOP("ViewAircraftList", "longitude");
(void)QT_TRANSLATE_NOOP("ViewAircraftList", "altitude");
(void)QT_TRANSLATE_NOOP("ViewAircraftList", "distance");
(void)QT_TRANSLATE_NOOP("ViewAircraftList", "height");
(void)QT_TRANSLATE_NOOP("ViewAircraftList", "transponder");
(void)QT_TRANSLATE_NOOP("ViewAircraftList", "groundspeed");
(void)QT_TRANSLATE_NOOP("ViewAircraftList", "model");
}
}

View File

@@ -0,0 +1,41 @@
/* Copyright (C) 2013 VATSIM Community / contributors
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*!
\file
*/
#ifndef BLACKGUI_AIRCRAFTLISTMODEL_H
#define BLACKGUI_AIRCRAFTLISTMODEL_H
#include "blackmisc/avaircraftlist.h"
#include "blackgui/listmodelbase.h"
#include <QAbstractItemModel>
#include <QDBusConnection>
namespace BlackGui
{
/*!
* \brief Aircraft list model
*/
class CAircraftListModel : public CListModelBase<BlackMisc::Aviation::CAircraft, BlackMisc::Aviation::CAircraftList>
{
public:
/*!
* \brief Constructor
* \param parent
*/
explicit CAircraftListModel(QObject *parent = nullptr);
/*!
* \brief Destructor
*/
virtual ~CAircraftListModel() {}
};
}
#endif // guard

View File

@@ -0,0 +1,39 @@
/* Copyright (C) 2013 VATSIM Community / contributors
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "atcstationlistmodel.h"
#include "blackmisc/blackmiscfreefunctions.h"
using namespace BlackMisc::Aviation;
namespace BlackGui
{
/*
* Constructor
*/
CAtcListModel::CAtcListModel(QObject *parent) : CListModelBase("ViewAtcList", parent)
{
this->m_columns.addColumn(CAtcStation::IndexCallsignAsStringAsSet, "callsign");
this->m_columns.addColumn(CAtcStation::IndexDistance, "distance", Qt::AlignRight | Qt::AlignVCenter);
this->m_columns.addColumn(CAtcStation::IndexFrequency, "frequency", Qt::AlignRight | Qt::AlignVCenter);
this->m_columns.addColumn(CAtcStation::IndexControllerRealname, "controllername");
this->m_columns.addColumn(CAtcStation::IndexIsOnline, "online");
this->m_columns.addColumn(CAtcStation::IndexBookedFrom, "bookedfrom");
this->m_columns.addColumn(CAtcStation::IndexBookedUntil, "bookeduntil");
// default sort order
this->setSortColumnByPropertyIndex(CAtcStation::IndexDistance);
this->m_sortOrder = Qt::AscendingOrder;
// force strings for translation in resource files
(void)QT_TRANSLATE_NOOP("ViewAtcList", "callsign");
(void)QT_TRANSLATE_NOOP("ViewAtcList", "distance");
(void)QT_TRANSLATE_NOOP("ViewAtcList", "frequency");
(void)QT_TRANSLATE_NOOP("ViewAtcList", "controllername");
(void)QT_TRANSLATE_NOOP("ViewAtcList", "online");
(void)QT_TRANSLATE_NOOP("ViewAtcList", "bookedfrom");
(void)QT_TRANSLATE_NOOP("ViewAtcList", "bookeduntil");
}
}

View File

@@ -0,0 +1,41 @@
/* Copyright (C) 2013 VATSIM Community / contributors
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*!
\file
*/
#ifndef BLACKGUI_ATCLISTMODEL_H
#define BLACKGUI_ATCLISTMODEL_H
#include "blackmisc/avatcstationlist.h"
#include "blackgui/listmodelbase.h"
#include <QAbstractItemModel>
#include <QDBusConnection>
namespace BlackGui
{
/*!
* \brief ATC list model
*/
class CAtcListModel : public CListModelBase<BlackMisc::Aviation::CAtcStation, BlackMisc::Aviation::CAtcStationList>
{
public:
/*!
* \brief Constructor
* \param parent
*/
explicit CAtcListModel(QObject *parent = nullptr);
/*!
* \brief Destructor
*/
virtual ~CAtcListModel() {}
};
}
#endif // guard

30
src/blackgui/blackgui.pro Normal file
View File

@@ -0,0 +1,30 @@
QT += network dbus gui widgets
TARGET = blackgui
TEMPLATE = lib
CONFIG += staticlib c++11
INCLUDEPATH += ..
DEPENDPATH += . ..
# PRECOMPILED_HEADER = stdpch.h
precompile_header:!isEmpty(PRECOMPILED_HEADER) {
DEFINES += USING_PCH
}
DEFINES += LOG_IN_FILE
# RESOURCES += blackgui.qrc
# lupdate (from cmd, e.g. lupdate blackmisc.pro)
# CODECFORTR = UTF-8
# TRANSLATIONS += translations/blackgui_i18n_de.ts \
# translations/blackgui_i18n_fr.ts \
# translations/blackgui_i18n_en.ts
win32:!win32-g++*: PRE_TARGETDEPS += ../../lib/blackmisc.lib
else: PRE_TARGETDEPS += ../../lib/libblackmisc.a
HEADERS += *.h
SOURCES += *.cpp
DESTDIR = ../../lib
OTHER_FILES +=

111
src/blackgui/columns.cpp Normal file
View File

@@ -0,0 +1,111 @@
/* Copyright (C) 2013 VATSIM Community / contributors
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "columns.h"
#include <QModelIndex>
namespace BlackGui
{
/*
* Header
*/
CColumns::CColumns(const QString &translationContext, QObject *parent) :
QObject(parent), m_translationContext(translationContext)
{
// void
}
/*
* Add column name
*/
void CColumns::addColumn(int propertyIndex, const QString &name, int alignment)
{
this->m_headerNames.append(name);
this->m_propertyIndexes.append(propertyIndex);
this->m_alignments.append(alignment);
}
/*
* Property index to name
*/
QString CColumns::propertyIndexToName(int propertyIndex) const
{
int column = this->propertyIndexToColumn(propertyIndex);
return this->m_headerNames.at(column);
}
/*
* Index to name
*/
QString CColumns::columnToName(int column) const
{
Q_ASSERT(column >= 0 && column < this->m_headerNames.size());
return this->m_headerNames.at(column);
}
/*
* Get property index
*/
int CColumns::columnToPropertyIndex(int column) const
{
Q_ASSERT(column >= 0 && column < this->m_propertyIndexes.size());
return this->m_propertyIndexes.at(column);
}
/*
* Property index to column
*/
int CColumns::propertyIndexToColumn(int propertyIndex) const
{
return this->m_propertyIndexes.indexOf(propertyIndex);
}
/*
* Name to property index
*/
int CColumns::nameToPropertyIndex(const QString &name) const
{
int column = this->m_headerNames.indexOf(name);
if (column < 0) return -1;
return this->m_propertyIndexes.at(column);
}
/*
* Size
*/
int CColumns::size() const
{
return this->m_headerNames.size();
}
/*
* Alignmet
*/
bool CColumns::hasAlignment(const QModelIndex &index) const
{
if (index.column() < 0 || index.column() >= this->m_alignments.size()) return false;
return this->m_alignments.at(index.column()) >= 0;
}
/*
* Aligmnet as QVariant
*/
QVariant CColumns::aligmentAsQVariant(const QModelIndex &index) const
{
if (index.column() < 0 || index.column() >= this->m_alignments.size()) return QVariant();
if (!this->hasAlignment(index)) return QVariant(Qt::AlignVCenter | Qt::AlignLeft); // default
return QVariant(this->m_alignments.at(index.column()));
}
/*
* Context
*/
const char *CColumns::getTranslationContext() const
{
return this->m_translationContext.toUtf8().constData();
}
} // namespace BlackGui

113
src/blackgui/columns.h Normal file
View File

@@ -0,0 +1,113 @@
/* Copyright (C) 2013 VATSIM Community / contributors
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*!
\file
*/
#ifndef BLACKGUI_COLUMNS_H
#define BLACKGUI_COLUMNS_H
#include "blackmisc/valueobject.h" // for qHash overload, include before Qt stuff due GCC issue
#include <QObject>
#include <QHash>
namespace BlackGui
{
/*!
* \brief Header data for a table
*/
class CColumns : public QObject
{
public:
/*!
* \brief Columns constructors
* \param translationContext
* \param parent
*/
CColumns(const QString &translationContext, QObject *parent = nullptr);
/*!
* \brief Add a column name
* \param propertyIndex
* \param name
* \param alignment
*/
void addColumn(int propertyIndex, const QString &name, int alignment = -1);
/*!
* \brief Property index to name
* \param propertyIndex
*/
QString propertyIndexToName(int propertyIndex) const;
/*!
* \brief Column index to name
* \param column
*/
QString columnToName(int column) const;
/*!
* \brief Column to property index
* \param index
*/
int columnToPropertyIndex(int column) const;
/*!
* \brief Property index to column
* \param propertyIndex
* \return
*/
int propertyIndexToColumn(int propertyIndex) const;
/*!
* \brief Column index to property index
* \param index
*/
int indexToPropertyIndex(int index) const;
/*!
* \brief Column index to name
* \param index
*/
int nameToPropertyIndex(const QString &name) const;
/*!
* \brief Size (number of columns)
* \return
*/
int size() const;
/*!
* \brief Alignment for this column?
* \param index
* \return
*/
bool hasAlignment(const QModelIndex &index) const;
/*!
* \brief Aligment as QVariant
* \param index
* \return
*/
QVariant aligmentAsQVariant(const QModelIndex &index) const;
/*!
* \brief Translation context
* \return
*/
const char *getTranslationContext() const;
private:
QString m_translationContext;
QList<QString> m_headerNames;
QList<int> m_propertyIndexes; // column to property index
QList<int> m_alignments;
};
} // namespace BlackGui
#endif // guard

View File

@@ -0,0 +1,146 @@
/* Copyright (C) 2013 VATSIM Community / contributors
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "listmodelbase.h"
#include "blackmisc/avatcstationlist.h"
#include "blackmisc/avaircraftlist.h"
#include "blackmisc/nwserverlist.h"
#include "blackmisc/blackmiscfreefunctions.h"
namespace BlackGui
{
/*
* Column count
*/
template <typename ObjectType, typename ListType> int CListModelBase<ObjectType, ListType>::columnCount(const QModelIndex & /** modelIndex **/) const
{
int c = this->m_columns.size();
return c;
}
/*
* Row count
*/
template <typename ObjectType, typename ListType> int CListModelBase<ObjectType, ListType>::rowCount(const QModelIndex & /** parent */) const
{
return this->m_list.size();
}
/*
* Column to property index
*/
template <typename ObjectType, typename ListType> int CListModelBase<ObjectType, ListType>::columnToPropertyIndex(int column) const
{
return this->m_columns.columnToPropertyIndex(column);
}
/*
* Header data
*/
template <typename ObjectType, typename ListType> QVariant CListModelBase<ObjectType, ListType>::headerData(int section, Qt::Orientation orientation, int role) const
{
if (role == Qt::DisplayRole && orientation == Qt::Horizontal)
{
if (section < 0 || section >= this->m_columns.size()) return QVariant();
QString col = this->m_columns.columnToName(section);
col = QCoreApplication::translate(this->m_columns.getTranslationContext(), col.toUtf8().constData());
return QVariant(col);
}
return QVariant();
}
/*
* Data
*/
template <typename ObjectType, typename ListType> QVariant CListModelBase<ObjectType, ListType>::data(const QModelIndex &index, int role) const
{
// checks
if (index.row() < 0 || index.row() >= this->m_list.size() ||
index.column() < 0 || index.column() >= this->columnCount(index))
{
return QVariant();
}
if (role == Qt::DisplayRole)
{
ObjectType obj = this->m_list[index.row()];
int propertyIndex = this->columnToPropertyIndex(index.column());
QString propertyString = obj.propertyByIndexAsString(propertyIndex, true);
return QVariant::fromValue(propertyString);
}
else if (role == Qt::TextAlignmentRole)
{
return this->m_columns.aligmentAsQVariant(index);
}
return QVariant();
}
/*
* Update
*/
template <typename ObjectType, typename ListType> int CListModelBase<ObjectType, ListType>::update(const ListType &list)
{
ListType copyList = (list.size() > 1 && this->hasValidSortColumn() ?
this->sortListByColumn(list, this->m_sortedColumn, this->m_sortOrder) :
list);
this->beginResetModel();
this->m_list.clear();
foreach(ObjectType object, copyList)
{
this->m_list.push_back(object);
}
this->endResetModel();
return this->m_list.size();
}
/*
* Sort
*/
template <typename ObjectType, typename ListType> void CListModelBase<ObjectType, ListType>::sort(int column, Qt::SortOrder order)
{
this->m_sortedColumn = column;
this->m_sortOrder = order;
if (this->m_list.size() < 2) return; // nothing to do
// sort the values
this->update(
this->sortListByColumn(this->m_list, column, order)
);
}
/*
* Sort list
*/
template <typename ObjectType, typename ListType> ListType CListModelBase<ObjectType, ListType>::sortListByColumn(const ListType &list, int column, Qt::SortOrder order)
{
if (list.size() < 2) return list; // nothing to do
int propertyIndex = this->m_columns.columnToPropertyIndex(column);
Q_ASSERT(propertyIndex >= 0);
if (propertyIndex < 0) return list;
// sort the values
return list.sorted
([ = ](const ObjectType & a, const ObjectType & b) -> bool
{
QVariant aQv = a.propertyByIndex(propertyIndex);
QVariant bQv = b.propertyByIndex(propertyIndex);
int compare = (order == Qt::AscendingOrder) ?
BlackMisc::compareQVariants(aQv, bQv) :
BlackMisc::compareQVariants(bQv, aQv);
return compare < 0;
}
);
}
// see here for the reason of thess forward instantiations
// http://www.parashift.com/c++-faq/separate-template-class-defn-from-decl.html
template class CListModelBase<BlackMisc::Aviation::CAtcStation, BlackMisc::Aviation::CAtcStationList>;
template class CListModelBase<BlackMisc::Network::CServer, BlackMisc::Network::CServerList>;
template class CListModelBase<BlackMisc::Aviation::CAircraft, BlackMisc::Aviation::CAircraftList>;
} // namespace

View File

@@ -0,0 +1,171 @@
/* Copyright (C) 2013 VATSIM Community / contributors
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*!
\file
*/
#ifndef BLACKGUI_LISTMODELBASE_H
#define BLACKGUI_LISTMODELBASE_H
#include "blackgui/columns.h"
#include <QAbstractItemModel>
namespace BlackGui
{
/*!
* \brief List model
*/
template <typename ObjectType, typename ListType> class CListModelBase : public QAbstractListModel
{
protected:
ListType m_list;
CColumns m_columns;
int m_sortedColumn;
Qt::SortOrder m_sortOrder;
/*!
* \brief Constructor
* \param translationContext
* \param parent
*/
CListModelBase(const QString &translationContext, QObject *parent = nullptr)
: QAbstractListModel(parent), m_columns(translationContext), m_sortedColumn(-1), m_sortOrder(Qt::AscendingOrder)
{
// void
}
/*!
* \brief Sort list by given order
* \param list
* \param column
* \param order
* \return
*/
ListType sortListByColumn(const ListType &list, int column, Qt::SortOrder order);
public:
/*!
* \brief Destructor
*/
virtual ~CListModelBase() {}
/*!
* \brief Column count
* \return
*/
virtual int columnCount(const QModelIndex &modelIndex) const;
/*!
* \brief Header data
* \param section
* \param orientation
* \param role
* \return
*/
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
/*!
* \brief Column to property index
* \param column
*/
virtual int columnToPropertyIndex(int column) const;
/*!
* \brief Set column for sort
* \param column
*/
virtual void setSortColumn(int column)
{
this->m_sortedColumn = column;
}
/*!
* \brief Set column for sort
* \param
*/
virtual void setSortColumnByPropertyIndex(int propertyIndex)
{
this->m_sortedColumn = this->m_columns.propertyIndexToColumn(propertyIndex);
}
/*!
* \brief Get sort column
* \return
*/
virtual int getSortColumn() const
{
return this->m_sortedColumn;
}
/*!
* \brief Has valid sort column
* \return
*/
virtual bool hasValidSortColumn() const
{
return this->m_sortedColumn >= 0 && this->m_sortedColumn < this->m_columns.size();
}
/*!
* \brief Get sort column
* \return
*/
virtual Qt::SortOrder getSortOrder() const
{
return this->m_sortOrder;
}
/*!
* \brief data
* \param index
* \param role
* \return
*/
virtual QVariant data(const QModelIndex &index, int role) const;
/*!
* \brief Row count
* \return
*/
virtual int rowCount(const QModelIndex &index = QModelIndex()) const;
/*!
* \brief Update
* \param list
* \return
*/
virtual int update(const ListType &list);
/*!
* \brief Object at row position
* \param index
* \return
*/
virtual const ObjectType &at(const QModelIndex &index) const
{
if (index.row() < 0 || index.row() >= this->m_list.size())
{
const static ObjectType def;
return def;
}
else
{
return this->m_list[index.row()];
}
}
/*!
* \brief sort
* \param column
* \param order
*/
virtual void sort(int column, Qt::SortOrder order);
};
}
#endif // guard

View File

@@ -0,0 +1,61 @@
/* Copyright (C) 2013 VATSIM Community / contributors
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "serverlistmodel.h"
#include "blackmisc/blackmiscfreefunctions.h"
#include <QMetaProperty>
#include <QBrush>
using namespace BlackMisc::Network;
namespace BlackGui
{
/*
* Constructor
*/
CServerListModel::CServerListModel(QObject *parent) :
CListModelBase("ViewServerList", parent)
{
this->m_columns.addColumn(CServer::IndexName, "name");
this->m_columns.addColumn(CServer::IndexDescription, "description");
this->m_columns.addColumn(CServer::IndexAddress, "address");
this->m_columns.addColumn(CServer::IndexPort, "port");
this->m_columns.addColumn(CServer::IndexUserRealname, "username");
this->m_columns.addColumn(CServer::IndexUserId, "userid");
// force strings for translation in resource files
(void)QT_TRANSLATE_NOOP("ViewServerList", "name");
(void)QT_TRANSLATE_NOOP("ViewServerList", "description");
(void)QT_TRANSLATE_NOOP("ViewServerList", "address");
(void)QT_TRANSLATE_NOOP("ViewServerList", "port");
(void)QT_TRANSLATE_NOOP("ViewServerList", "username");
(void)QT_TRANSLATE_NOOP("ViewServerList", "userid");
}
/*
* Special functions
*/
QVariant CServerListModel::data(const QModelIndex &index, int role) const
{
if (role == Qt::BackgroundRole)
{
if (!this->hasSelectedServer()) return QVariant();
CServer currentRow = this->at(index);
if (currentRow == this->getSelectedServer())
{
QBrush background(Qt::green);
return background;
}
else
{
return QVariant();
}
}
else
{
return CListModelBase::data(index, role);
}
}
}

View File

@@ -0,0 +1,79 @@
/* Copyright (C) 2013 VATSIM Community / contributors
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*!
\file
*/
#ifndef BLACKGUI_SERVERLISTMODEL_H
#define BLACKGUI_SERVERLISTMODEL_H
#include "blackmisc/nwserverlist.h"
#include "blackgui/listmodelbase.h"
#include <QAbstractItemModel>
#include <QDBusConnection>
namespace BlackGui
{
/*!
* \brief Server list model
*/
class CServerListModel : public CListModelBase<BlackMisc::Network::CServer, BlackMisc::Network::CServerList>
{
private:
BlackMisc::Network::CServer m_selectedServer;
public:
/*!
* \brief Constructor
* \param parent
*/
explicit CServerListModel(QObject *parent = nullptr);
/*!
* \brief Destructor
*/
virtual ~CServerListModel() {}
/*!
* \brief Has selected server?
* \return
*/
bool hasSelectedServer() const
{
return this->m_selectedServer.isValidForLogin();
}
/*!
* \brief Get selected server
* \return
*/
const BlackMisc::Network::CServer &getSelectedServer() const
{
return this->m_selectedServer;
}
/*!
* \brief SetSelectedServer
* \param selectedServer
*/
void setSelectedServer(const BlackMisc::Network::CServer &selectedServer)
{
this->m_selectedServer = selectedServer;
}
/*!
* \brief data
* \param index
* \param role
* \return
*/
virtual QVariant data(const QModelIndex &index, int role) const;
};
}
#endif // guard