summaryrefslogtreecommitdiff
path: root/widgets/activeStations.cpp
diff options
context:
space:
mode:
authorChristoph Berg <christoph.berg@credativ.de>2022-08-23 10:23:31 +0200
committerChristoph Berg <christoph.berg@credativ.de>2022-08-23 10:23:31 +0200
commit0e579a45e2e5823f90e2632073749583cd15fa0d (patch)
tree5e709e13d41c8ea0da0968fb6c4566057b4b7909 /widgets/activeStations.cpp
parent28d1767618141cd6481de2e93e36e3dfa555d4b4 (diff)
parent2d1068e60bce7ae1fff11623454900e8cee956b1 (diff)
Update upstream source from tag 'upstream/2.6.0_rc3+repack'
Update to upstream version '2.6.0~rc3+repack' with Debian dir 9ee8bc3a4b60bb88f4d57c7d1f2d37dbc1632144
Diffstat (limited to 'widgets/activeStations.cpp')
-rwxr-xr-xwidgets/activeStations.cpp250
1 files changed, 125 insertions, 125 deletions
diff --git a/widgets/activeStations.cpp b/widgets/activeStations.cpp
index b5ecbf73..7703f080 100755
--- a/widgets/activeStations.cpp
+++ b/widgets/activeStations.cpp
@@ -1,125 +1,125 @@
-#include "activeStations.h"
-
-#include <QSettings>
-#include <QApplication>
-#include <QTextCharFormat>
-#include <QDateTime>
-#include <QDebug>
-
-#include "SettingsGroup.hpp"
-#include "qt_helpers.hpp"
-#include "ui_activeStations.h"
-
-#include "moc_activeStations.cpp"
-
-ActiveStations::ActiveStations(QSettings * settings, QFont const& font, QWidget *parent) :
- QWidget(parent),
- settings_ {settings},
- ui(new Ui::ActiveStations)
-{
- ui->setupUi(this);
- setWindowTitle (QApplication::applicationName () + " - " + tr ("Active Stations"));
- ui->RecentStationsPlainTextEdit->setReadOnly (true);
- changeFont (font);
- read_settings ();
- ui->header_label2->setText(" N Call Grid Az S/N Freq Tx Age Pts");
- connect(ui->RecentStationsPlainTextEdit, SIGNAL(selectionChanged()), this, SLOT(select()));
- connect(ui->cbReadyOnly, SIGNAL(toggled(bool)), this, SLOT(on_cbReadyOnly_toggled(bool)));
-}
-
-ActiveStations::~ActiveStations()
-{
- write_settings ();
-}
-
-void ActiveStations::changeFont (QFont const& font)
-{
- ui->header_label2->setStyleSheet (font_as_stylesheet (font));
- ui->RecentStationsPlainTextEdit->setStyleSheet (font_as_stylesheet (font));
- updateGeometry ();
-}
-
-void ActiveStations::read_settings ()
-{
- SettingsGroup group {settings_, "ActiveStations"};
- restoreGeometry (settings_->value ("window/geometry").toByteArray ());
- ui->sbMaxRecent->setValue(settings_->value("MaxRecent",10).toInt());
- ui->sbMaxAge->setValue(settings_->value("MaxAge",10).toInt());
- ui->cbReadyOnly->setChecked(settings_->value("ReadyOnly",false).toBool());
-}
-
-void ActiveStations::write_settings ()
-{
- SettingsGroup group {settings_, "ActiveStations"};
- settings_->setValue ("window/geometry", saveGeometry ());
- settings_->setValue("MaxRecent",ui->sbMaxRecent->value());
- settings_->setValue("MaxAge",ui->sbMaxAge->value());
- settings_->setValue("ReadyOnly",ui->cbReadyOnly->isChecked());
-}
-
-void ActiveStations::displayRecentStations(QString const& t)
-{
- ui->RecentStationsPlainTextEdit->setPlainText(t);
-}
-
-int ActiveStations::maxRecent()
-{
- return ui->sbMaxRecent->value();
-}
-
-int ActiveStations::maxAge()
-{
- return ui->sbMaxAge->value();
-}
-
-void ActiveStations::select()
-{
- if(m_clickOK) {
- qint64 msec=QDateTime::currentMSecsSinceEpoch();
- if((msec-m_msec0)<500) return;
- m_msec0=msec;
- int nline=ui->RecentStationsPlainTextEdit->textCursor().blockNumber();
- emit callSandP(nline);
- }
-}
-
-void ActiveStations::setClickOK(bool b)
-{
- m_clickOK=b;
-}
-
-void ActiveStations::erase()
-{
- ui->RecentStationsPlainTextEdit->clear();
-}
-
-bool ActiveStations::readyOnly()
-{
- return ui->cbReadyOnly->isChecked();
-}
-
-void ActiveStations::on_cbReadyOnly_toggled(bool b)
-{
- m_bReadyOnly=b;
- emit activeStationsDisplay();
-}
-
-void ActiveStations::setRate(int n)
-{
- ui->rate->setText(QString::number(n));
-}
-
-void ActiveStations::setScore(int n)
-{
- ui->score->setText(QLocale(QLocale::English).toString(n));
-}
-
-void ActiveStations::setBandChanges(int n)
-{
- if(n >= 8) {
- ui->bandChanges->setStyleSheet("QLineEdit{background: rgb(255, 64, 64)}");
- } else {
- ui->bandChanges->setStyleSheet ("");
- }
- ui->bandChanges->setText(QString::number(n));
-}
+#include "activeStations.h"
+
+#include <QSettings>
+#include <QApplication>
+#include <QTextCharFormat>
+#include <QDateTime>
+#include <QDebug>
+
+#include "SettingsGroup.hpp"
+#include "qt_helpers.hpp"
+#include "ui_activeStations.h"
+
+#include "moc_activeStations.cpp"
+
+ActiveStations::ActiveStations(QSettings * settings, QFont const& font, QWidget *parent) :
+ QWidget(parent),
+ settings_ {settings},
+ ui(new Ui::ActiveStations)
+{
+ ui->setupUi(this);
+ setWindowTitle (QApplication::applicationName () + " - " + tr ("Active Stations"));
+ ui->RecentStationsPlainTextEdit->setReadOnly (true);
+ changeFont (font);
+ read_settings ();
+ ui->header_label2->setText(" N Call Grid Az S/N Freq Tx Age Pts");
+ connect(ui->RecentStationsPlainTextEdit, SIGNAL(selectionChanged()), this, SLOT(select()));
+ connect(ui->cbReadyOnly, SIGNAL(toggled(bool)), this, SLOT(on_cbReadyOnly_toggled(bool)));
+}
+
+ActiveStations::~ActiveStations()
+{
+ write_settings ();
+}
+
+void ActiveStations::changeFont (QFont const& font)
+{
+ ui->header_label2->setStyleSheet (font_as_stylesheet (font));
+ ui->RecentStationsPlainTextEdit->setStyleSheet (font_as_stylesheet (font));
+ updateGeometry ();
+}
+
+void ActiveStations::read_settings ()
+{
+ SettingsGroup group {settings_, "ActiveStations"};
+ restoreGeometry (settings_->value ("window/geometry").toByteArray ());
+ ui->sbMaxRecent->setValue(settings_->value("MaxRecent",10).toInt());
+ ui->sbMaxAge->setValue(settings_->value("MaxAge",10).toInt());
+ ui->cbReadyOnly->setChecked(settings_->value("ReadyOnly",false).toBool());
+}
+
+void ActiveStations::write_settings ()
+{
+ SettingsGroup group {settings_, "ActiveStations"};
+ settings_->setValue ("window/geometry", saveGeometry ());
+ settings_->setValue("MaxRecent",ui->sbMaxRecent->value());
+ settings_->setValue("MaxAge",ui->sbMaxAge->value());
+ settings_->setValue("ReadyOnly",ui->cbReadyOnly->isChecked());
+}
+
+void ActiveStations::displayRecentStations(QString const& t)
+{
+ ui->RecentStationsPlainTextEdit->setPlainText(t);
+}
+
+int ActiveStations::maxRecent()
+{
+ return ui->sbMaxRecent->value();
+}
+
+int ActiveStations::maxAge()
+{
+ return ui->sbMaxAge->value();
+}
+
+void ActiveStations::select()
+{
+ if(m_clickOK) {
+ qint64 msec=QDateTime::currentMSecsSinceEpoch();
+ if((msec-m_msec0)<500) return;
+ m_msec0=msec;
+ int nline=ui->RecentStationsPlainTextEdit->textCursor().blockNumber();
+ emit callSandP(nline);
+ }
+}
+
+void ActiveStations::setClickOK(bool b)
+{
+ m_clickOK=b;
+}
+
+void ActiveStations::erase()
+{
+ ui->RecentStationsPlainTextEdit->clear();
+}
+
+bool ActiveStations::readyOnly()
+{
+ return ui->cbReadyOnly->isChecked();
+}
+
+void ActiveStations::on_cbReadyOnly_toggled(bool b)
+{
+ m_bReadyOnly=b;
+ emit activeStationsDisplay();
+}
+
+void ActiveStations::setRate(int n)
+{
+ ui->rate->setText(QString::number(n));
+}
+
+void ActiveStations::setScore(int n)
+{
+ ui->score->setText(QLocale(QLocale::English).toString(n));
+}
+
+void ActiveStations::setBandChanges(int n)
+{
+ if(n >= 8) {
+ ui->bandChanges->setStyleSheet("QLineEdit{background: rgb(255, 64, 64)}");
+ } else {
+ ui->bandChanges->setStyleSheet ("");
+ }
+ ui->bandChanges->setText(QString::number(n));
+}