mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
45 lines
2.4 KiB
C++
45 lines
2.4 KiB
C++
/* 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. 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 "blackgui/models/columnformatters.h"
|
|
#include "blackgui/models/columns.h"
|
|
#include "blackgui/models/identifierlistmodel.h"
|
|
#include "blackmisc/timestampbased.h"
|
|
|
|
#include <QtGlobal>
|
|
|
|
using namespace BlackMisc;
|
|
|
|
namespace BlackGui
|
|
{
|
|
namespace Models
|
|
{
|
|
CIdentifierListModel::CIdentifierListModel(QObject *parent) :
|
|
CListModelBase("ModelIdentifierList", parent)
|
|
{
|
|
this->m_columns.addColumn(CColumn::standardString("name", CIdentifier::IndexName));
|
|
this->m_columns.addColumn(CColumn::standardString("machine", CIdentifier::IndexMachineName));
|
|
this->m_columns.addColumn(CColumn::standardString("process", CIdentifier::IndexProcessName));
|
|
this->m_columns.addColumn(CColumn::standardString("p.id", "process id", CIdentifier::IndexProcessId));
|
|
this->m_columns.addColumn(CColumn("time", "received", CIdentifier::IndexUtcTimestamp, new CDateTimeFormatter(CDateTimeFormatter::formatHms())));
|
|
this->m_columns.addColumn(CColumn("lcl m.", "local machine", CIdentifier::IndexIsFromLocalMachine, new CBoolIconFormatter("local", "remote")));
|
|
this->m_columns.addColumn(CColumn("same p.", "same process", CIdentifier::IndexIsFromSameProcess, new CBoolIconFormatter("same process", "other process")));
|
|
this->m_columns.addColumn(CColumn::standardString("m.id", "machine id", CIdentifier::IndexMachineIdBase64));
|
|
|
|
// force strings for translation in resource files
|
|
(void)QT_TRANSLATE_NOOP("ModelIdentifierList", "name");
|
|
(void)QT_TRANSLATE_NOOP("ModelIdentifierList", "machine");
|
|
(void)QT_TRANSLATE_NOOP("ModelIdentifierList", "process");
|
|
(void)QT_TRANSLATE_NOOP("ModelIdentifierList", "p.id");
|
|
(void)QT_TRANSLATE_NOOP("ModelIdentifierList", "m.id");
|
|
(void)QT_TRANSLATE_NOOP("ModelIdentifierList", "lcl m.");
|
|
(void)QT_TRANSLATE_NOOP("ModelIdentifierList", "same p.");
|
|
}
|
|
} // class
|
|
} // namespace
|