Starting to change arrl_digi to activeStations.

This commit is contained in:
Joe Taylor 2022-03-11 14:58:13 -05:00
parent f26b1c424f
commit 4e96e58d57
5 changed files with 35 additions and 35 deletions

View File

@ -10,40 +10,40 @@
#include "moc_arrl_digi.cpp"
ARRL_Digi::ARRL_Digi(QSettings * settings, QFont const& font, QWidget *parent) :
ActiveStations::ActiveStations(QSettings * settings, QFont const& font, QWidget *parent) :
QWidget(parent),
settings_ {settings},
ui(new Ui::ARRL_Digi)
ui(new Ui::ActiveStations)
{
ui->setupUi(this);
setWindowTitle (QApplication::applicationName () + " - " + tr ("ARRL International Digital Contest"));
ui->ARRL_DigiPlainTextEdit->setReadOnly (true);
ui->ActiveStationsPlainTextEdit->setReadOnly (true);
changeFont (font);
read_settings ();
ui->header_label->setText("Pts Call Grid Az S/N Dial Freq");
}
ARRL_Digi::~ARRL_Digi()
ActiveStations::~ActiveStations()
{
write_settings ();
}
void ARRL_Digi::changeFont (QFont const& font)
void ActiveStations::changeFont (QFont const& font)
{
ui->header_label->setStyleSheet (font_as_stylesheet (font));
ui->ARRL_DigiPlainTextEdit->setStyleSheet (font_as_stylesheet (font));
ui->ActiveStationsPlainTextEdit->setStyleSheet (font_as_stylesheet (font));
setContentFont (font);
updateGeometry ();
}
void ARRL_Digi::setContentFont(QFont const& font)
void ActiveStations::setContentFont(QFont const& font)
{
ui->ARRL_DigiPlainTextEdit->setFont (font);
ui->ActiveStationsPlainTextEdit->setFont (font);
QTextCharFormat charFormat;
charFormat.setFont (font);
ui->ARRL_DigiPlainTextEdit->selectAll ();
auto cursor = ui->ARRL_DigiPlainTextEdit->textCursor ();
ui->ActiveStationsPlainTextEdit->selectAll ();
auto cursor = ui->ActiveStationsPlainTextEdit->textCursor ();
cursor.mergeCharFormat (charFormat);
cursor.clearSelection ();
cursor.movePosition (QTextCursor::End);
@ -52,23 +52,23 @@ void ARRL_Digi::setContentFont(QFont const& font)
cursor.movePosition (QTextCursor::Up);
cursor.movePosition (QTextCursor::StartOfLine);
ui->ARRL_DigiPlainTextEdit->setTextCursor (cursor);
ui->ARRL_DigiPlainTextEdit->ensureCursorVisible ();
ui->ActiveStationsPlainTextEdit->setTextCursor (cursor);
ui->ActiveStationsPlainTextEdit->ensureCursorVisible ();
}
void ARRL_Digi::read_settings ()
void ActiveStations::read_settings ()
{
SettingsGroup group {settings_, "ARRL_Digi"};
SettingsGroup group {settings_, "ActiveStations"};
restoreGeometry (settings_->value ("window/geometry").toByteArray ());
}
void ARRL_Digi::write_settings ()
void ActiveStations::write_settings ()
{
SettingsGroup group {settings_, "ARRL_Digi"};
SettingsGroup group {settings_, "ActiveStations"};
settings_->setValue ("window/geometry", saveGeometry ());
}
void ARRL_Digi::displayARRL_Digi(QString const& t)
void ActiveStations::displayActiveStations(QString const& t)
{
ui->ARRL_DigiPlainTextEdit->setPlainText(t);
ui->ActiveStationsPlainTextEdit->setPlainText(t);
}

View File

@ -8,18 +8,18 @@ class QSettings;
class QFont;
namespace Ui {
class ARRL_Digi;
class ActiveStations;
}
class ARRL_Digi
class ActiveStations
: public QWidget
{
Q_OBJECT
public:
explicit ARRL_Digi(QSettings *, QFont const&, QWidget * parent = 0);
~ARRL_Digi();
void displayARRL_Digi(QString const&);
explicit ActiveStations(QSettings *, QFont const&, QWidget * parent = 0);
~ActiveStations();
void displayActiveStations(QString const&);
void changeFont (QFont const&);
private:
@ -28,7 +28,7 @@ private:
void setContentFont (QFont const&);
QSettings * settings_;
QScopedPointer<Ui::ARRL_Digi> ui;
QScopedPointer<Ui::ActiveStations> ui;
};
#endif

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ARRL_Digi</class>
<widget class="QWidget" name="ARRL_Digi">
<class>ActiveStations</class>
<widget class="QWidget" name="ActiveStations">
<property name="geometry">
<rect>
<x>0</x>
@ -17,7 +17,7 @@
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QPlainTextEdit" name="ARRL_DigiPlainTextEdit">
<widget class="QPlainTextEdit" name="ActiveStationsPlainTextEdit">
<property name="lineWrapMode">
<enum>QPlainTextEdit::NoWrap</enum>
</property>

View File

@ -2758,15 +2758,15 @@ void MainWindow::on_actionMessage_averaging_triggered()
void MainWindow::on_actionARRL_Intl_Digi_triggered()
{
if(m_ARRL_DigiWidget == NULL) {
m_ARRL_DigiWidget.reset (new ARRL_Digi {m_settings, m_config.decoded_text_font ()});
if(m_ActiveStationsWidget == NULL) {
m_ActiveStationsWidget.reset (new ActiveStations {m_settings, m_config.decoded_text_font ()});
// Connect signals from Message Averaging window
connect (this, &MainWindow::finished, m_ARRL_DigiWidget.data (), &ARRL_Digi::close);
connect (this, &MainWindow::finished, m_ActiveStationsWidget.data (), &ActiveStations::close);
}
m_ARRL_DigiWidget->showNormal();
m_ARRL_DigiWidget->raise();
m_ARRL_DigiWidget->activateWindow();
m_ActiveStationsWidget->showNormal();
m_ActiveStationsWidget->raise();
m_ActiveStationsWidget->activateWindow();
}
void MainWindow::on_actionOpen_triggered() //Open File

View File

@ -78,7 +78,7 @@ class WideGraph;
class LogQSO;
class Transceiver;
class MessageAveraging;
class ARRL_Digi;
class ActiveStations;
class FoxLogWindow;
class CabrilloLogWindow;
class ColorHighlighting;
@ -400,7 +400,7 @@ private:
QScopedPointer<HelpTextWindow> m_prefixes;
QScopedPointer<HelpTextWindow> m_mouseCmnds;
QScopedPointer<MessageAveraging> m_msgAvgWidget;
QScopedPointer<ARRL_Digi> m_ARRL_DigiWidget;
QScopedPointer<ActiveStations> m_ActiveStationsWidget;
QScopedPointer<FoxLogWindow> m_foxLogWindow;
QScopedPointer<CabrilloLogWindow> m_contestLogWindow;
QScopedPointer<ColorHighlighting> m_colorHighlighting;