2018-11-07 12:49:45 -05:00
|
|
|
#include "FoxLogWindow.hpp"
|
|
|
|
|
|
|
|
#include <QApplication>
|
|
|
|
|
|
|
|
#include "SettingsGroup.hpp"
|
|
|
|
#include "Configuration.hpp"
|
|
|
|
#include "models/Bands.hpp"
|
|
|
|
#include "item_delegates/ForeignKeyDelegate.hpp"
|
2018-11-11 23:06:26 -05:00
|
|
|
#include "item_delegates/DateTimeAsSecsSinceEpochDelegate.hpp"
|
|
|
|
#include "item_delegates/CallsignDelegate.hpp"
|
|
|
|
#include "item_delegates/MaidenheadLocatorDelegate.hpp"
|
2018-11-22 20:18:39 -05:00
|
|
|
#include "pimpl_impl.hpp"
|
2018-11-07 12:49:45 -05:00
|
|
|
|
|
|
|
#include "ui_FoxLogWindow.h"
|
|
|
|
|
2018-11-22 20:18:39 -05:00
|
|
|
class FoxLogWindow::impl final
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit impl () = default;
|
|
|
|
Ui::FoxLogWindow ui_;
|
|
|
|
};
|
|
|
|
|
2018-11-07 12:49:45 -05:00
|
|
|
FoxLogWindow::FoxLogWindow (QSettings * settings, Configuration const * configuration
|
|
|
|
, QAbstractItemModel * fox_log_model, QWidget * parent)
|
2018-11-22 20:18:39 -05:00
|
|
|
: AbstractLogWindow {"Fox Log Window", settings, configuration, parent}
|
2018-11-07 12:49:45 -05:00
|
|
|
{
|
|
|
|
setWindowTitle (QApplication::applicationName () + " - Fox Log");
|
2018-11-22 20:18:39 -05:00
|
|
|
m_->ui_.setupUi (this);
|
|
|
|
set_log_model (fox_log_model);
|
|
|
|
set_log_view (m_->ui_.log_table_view);
|
|
|
|
m_->ui_.log_table_view->setItemDelegateForColumn (1, new DateTimeAsSecsSinceEpochDelegate {this});
|
|
|
|
m_->ui_.log_table_view->setItemDelegateForColumn (2, new CallsignDelegate {this});
|
|
|
|
m_->ui_.log_table_view->setItemDelegateForColumn (3, new MaidenheadLocatorDelegate {this});
|
|
|
|
m_->ui_.log_table_view->setItemDelegateForColumn (6, new ForeignKeyDelegate {configuration->bands (), fox_log_model, 0, 6, this});
|
|
|
|
m_->ui_.log_table_view->horizontalHeader ()->moveSection (6, 1); // move band to first column
|
|
|
|
m_->ui_.rate_label->setNum (0);
|
|
|
|
m_->ui_.queued_label->setNum (0);
|
|
|
|
m_->ui_.callers_label->setNum (0);
|
2018-11-07 12:49:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
FoxLogWindow::~FoxLogWindow ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void FoxLogWindow::callers (int n)
|
|
|
|
{
|
2018-11-22 20:18:39 -05:00
|
|
|
m_->ui_.callers_label->setNum (n);
|
2018-11-07 12:49:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void FoxLogWindow::queued (int n)
|
|
|
|
{
|
2018-11-22 20:18:39 -05:00
|
|
|
m_->ui_.queued_label->setNum (n);
|
2018-11-07 12:49:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void FoxLogWindow::rate (int n)
|
|
|
|
{
|
2018-11-22 20:18:39 -05:00
|
|
|
m_->ui_.rate_label->setNum (n);
|
2018-11-07 12:49:45 -05:00
|
|
|
}
|