Trim mostly-deletion changes (~700 lines) across the modules the Release 2 build compiles: unused telegrams and receiver/handler code in TrainingAreaBase (telegrams, recv_from_dds_aes/fts, ism/main/pdm/position handlers), dead members in SqlBrowser and ProjectDataManagement, unused LtsPluginManager loader paths, LtsSession unit-test, WlsTetra and DdsView cleanups, plus the stale include_directories removal in Lts/CMakeLists.txt. Continues the Release 2 source prune (keep only what the build compiles). Excluded from this commit by design: the machine-specific .envrc (MIGRATE_PIPELINE_ROOT path fix stays uncommitted) and the untracked qt5-before/ reference tree.
68 lines
1.5 KiB
C++
Executable File
68 lines
1.5 KiB
C++
Executable File
#include "AddLine.h"
|
|
#include "ui_AddLinesUi.h"
|
|
#include <QtCore/QDebug>
|
|
|
|
AddLines::AddLines(QWidget* parent)
|
|
: QDialog(parent)
|
|
, m_ui(new Ui::AddLines)
|
|
{
|
|
qRegisterMetaType<AddModel*>("AddModel*");
|
|
m_ui->setupUi(this);
|
|
m_ui->dataView->setModel(&addModel);
|
|
|
|
connect(m_ui->pbDone, &QPushButton::clicked,
|
|
this, &AddLines::slotAddLines);
|
|
|
|
connect(m_ui->pbAbort, &QPushButton::clicked,
|
|
this, &AddLines::close);
|
|
|
|
connect(m_ui->pbDelete, &QPushButton::clicked,
|
|
this, &AddLines::slotDeleteLines);
|
|
|
|
connect(m_ui->pbClear, &QPushButton::clicked,
|
|
this, &AddLines::slotClear);
|
|
}
|
|
|
|
AddLines::~AddLines()
|
|
{
|
|
delete m_ui;
|
|
}
|
|
|
|
void AddLines::slotDeleteLines()
|
|
{
|
|
//qWarning() << "slotDeleteLines";
|
|
while (m_ui->dataView->selectionModel()->selectedRows().count())
|
|
{
|
|
const QModelIndexList selectedRows = m_ui->dataView->selectionModel()->selectedRows();
|
|
if (selectedRows.at(0).row() == addModel.rowCount()-1) // do not delete empty row!
|
|
{
|
|
return; // In hope that the selectedRows list is sorted.....
|
|
}
|
|
|
|
addModel.removeRow(selectedRows.at(0).row());
|
|
}
|
|
}
|
|
|
|
void AddLines::slotClear()
|
|
{
|
|
//qWarning() << "slotClear";
|
|
addModel.clear();
|
|
}
|
|
|
|
void AddLines::reject()
|
|
{
|
|
emit signalAddLines(nullptr);
|
|
}
|
|
|
|
void AddLines::copyDataFromModel(DataModel* dataModel)
|
|
{
|
|
addModel.setHeaderList(dataModel->getHeaderList());
|
|
addModel.setTablename(dataModel->getTableName());
|
|
}
|
|
|
|
void AddLines::slotAddLines()
|
|
{
|
|
this->hide(); // hide until in work..
|
|
emit signalAddLines(&addModel);
|
|
}
|