diff --git a/src/blackgui/models/listmodelbase.cpp b/src/blackgui/models/listmodelbase.cpp index 76a66c6cd..05be7a2fd 100644 --- a/src/blackgui/models/listmodelbase.cpp +++ b/src/blackgui/models/listmodelbase.cpp @@ -8,9 +8,6 @@ */ #include "listmodelbase.h" -#include "blackmisc/simulation/aircraftmodellist.h" -#include "blackmisc/namevariantpairlist.h" -#include "blackmisc/statusmessagelist.h" #include "blackmisc/aviation/atcstationlist.h" #include "blackmisc/aviation/aircraftlist.h" #include "blackmisc/aviation/airportlist.h" @@ -21,6 +18,10 @@ #include "blackmisc/network/aircraftmappinglist.h" #include "blackmisc/setkeyboardhotkeylist.h" #include "blackmisc/simulation/simulatedaircraftlist.h" +#include "blackmisc/simulation/aircraftmodellist.h" +#include "blackmisc/namevariantpairlist.h" +#include "blackmisc/statusmessagelist.h" +#include "blackmisc/originatorlist.h" #include "blackmisc/variant.h" #include "blackmisc/blackmiscfreefunctions.h" @@ -459,6 +460,7 @@ namespace BlackGui // 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; template class CListModelBase; template class CListModelBase; template class CListModelBase; diff --git a/src/blackgui/models/originatorlistmodel.cpp b/src/blackgui/models/originatorlistmodel.cpp new file mode 100644 index 000000000..63d57c887 --- /dev/null +++ b/src/blackgui/models/originatorlistmodel.cpp @@ -0,0 +1,44 @@ +/* Copyright (C) 2015 + * swift Project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ + +#include "originatorlistmodel.h" +#include "blackmisc/blackmiscfreefunctions.h" +#include +#include + +using namespace BlackMisc; + +namespace BlackGui +{ + namespace Models + { + COriginatorListModel::COriginatorListModel(QObject *parent) : + CListModelBase("ModelOriginatorList", parent) + { + this->m_columns.addColumn(CColumn::standardString("name", COriginator::IndexName)); + this->m_columns.addColumn(CColumn::standardString("machine", COriginator::IndexMachineName)); + this->m_columns.addColumn(CColumn::standardString("process", COriginator::IndexProcessName)); + this->m_columns.addColumn(CColumn::standardString("p.id", "process id", COriginator::IndexProcessId)); + this->m_columns.addColumn(CColumn("time", "received", COriginator::IndexUtcTimestamp, new CDateTimeFormatter(CDateTimeFormatter::formatHms()))); + this->m_columns.addColumn(CColumn("lcl m.", "local machine", COriginator::IndexIsFromLocalMachine, new CBoolIconFormatter("local", "remote"))); + this->m_columns.addColumn(CColumn("same p.", "same process", COriginator::IndexIsFromSameProcess, new CBoolIconFormatter("same process", "other process"))); + this->m_columns.addColumn(CColumn::standardString("m.id", "machine id", COriginator::IndexMachineIdBase64)); + + // force strings for translation in resource files + (void)QT_TRANSLATE_NOOP("ModelOriginatorList", "name"); + (void)QT_TRANSLATE_NOOP("ModelOriginatorList", "machine"); + (void)QT_TRANSLATE_NOOP("ModelOriginatorList", "process"); + (void)QT_TRANSLATE_NOOP("ModelOriginatorList", "p.id"); + (void)QT_TRANSLATE_NOOP("ModelOriginatorList", "m.id"); + (void)QT_TRANSLATE_NOOP("ModelOriginatorList", "lcl m."); + (void)QT_TRANSLATE_NOOP("ModelOriginatorList", "same p."); + } + + } // class +} // namespace diff --git a/src/blackgui/models/originatorlistmodel.h b/src/blackgui/models/originatorlistmodel.h new file mode 100644 index 000000000..6afdf0712 --- /dev/null +++ b/src/blackgui/models/originatorlistmodel.h @@ -0,0 +1,37 @@ +/* Copyright (C) 2015 + * swift Project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ + +//! \file + +#ifndef BLACKGUI_ORIGINATORLISTMODEL_H +#define BLACKGUI_ORIGINATORLISTMODEL_H + +#include "blackgui/blackguiexport.h" +#include "blackmisc/originatorlist.h" +#include "blackgui/models/listmodelbase.h" +#include + +namespace BlackGui +{ + namespace Models + { + //! Originator list model + class BLACKGUI_EXPORT COriginatorListModel : public CListModelBase + { + public: + + //! Constructor + explicit COriginatorListModel(QObject *parent = nullptr); + + //! Destructor + virtual ~COriginatorListModel() {} + }; + } // ns +} // ns +#endif // guard diff --git a/src/blackgui/views/originatorview.cpp b/src/blackgui/views/originatorview.cpp new file mode 100644 index 000000000..b26fd1896 --- /dev/null +++ b/src/blackgui/views/originatorview.cpp @@ -0,0 +1,25 @@ +/* Copyright (C) 2015 + * swift project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ + +#include "originatorview.h" +#include + +using namespace BlackMisc; +using namespace BlackGui::Models; + +namespace BlackGui +{ + namespace Views + { + COriginatorView::COriginatorView(QWidget *parent) : CViewBase(parent) + { + this->standardInit(new COriginatorListModel(this)); + } + } +} // namespace diff --git a/src/blackgui/views/originatorview.h b/src/blackgui/views/originatorview.h new file mode 100644 index 000000000..4014c62bd --- /dev/null +++ b/src/blackgui/views/originatorview.h @@ -0,0 +1,34 @@ +/* Copyright (C) 2015 + * swift project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ + +//! \file + +#ifndef BLACKGUI_ORIGINATORVIEW_H +#define BLACKGUI_ORIGINATORVIEW_H + +#include "blackgui/blackguiexport.h" +#include "viewbase.h" +#include "../models/originatorlistmodel.h" + +namespace BlackGui +{ + namespace Views + { + //! Originator servers + class BLACKGUI_EXPORT COriginatorView : public CViewBase + { + + public: + + //! Constructor + explicit COriginatorView(QWidget *parent = nullptr); + }; + } +} +#endif // guard diff --git a/src/blackgui/views/viewbase.cpp b/src/blackgui/views/viewbase.cpp index 8c241419c..9a5f38720 100644 --- a/src/blackgui/views/viewbase.cpp +++ b/src/blackgui/views/viewbase.cpp @@ -9,6 +9,7 @@ #include "viewbase.h" #include "../models/statusmessagelistmodel.h" +#include "../models/originatorlistmodel.h" #include "../models/namevariantpairlistmodel.h" #include "../models/atcstationlistmodel.h" #include "../models/aircraftmodellistmodel.h" @@ -402,6 +403,8 @@ namespace BlackGui // http://www.parashift.com/c++-faq/separate-template-class-defn-from-decl.html template class CViewBase; template class CViewBase; + template class CViewBase; + template class CViewBase; template class CViewBase; template class CViewBase;