kopia lustrzana https://gitlab.com/eliggett/wfview
Merge branch 'creator-widgets' of https://gitlab.com/eliggett/wfview into creator-widgets
commit
6a87cb7386
|
@ -2738,3 +2738,15 @@ void settingswidget::on_connectBtn_clicked()
|
|||
emit connectButtonPressed();
|
||||
}
|
||||
|
||||
|
||||
void settingswidget::on_saveSettingsBtn_clicked()
|
||||
{
|
||||
emit saveSettingsButtonPressed();
|
||||
}
|
||||
|
||||
|
||||
void settingswidget::on_revertSettingsBtn_clicked()
|
||||
{
|
||||
emit revertSettingsButtonPressed();
|
||||
}
|
||||
|
||||
|
|
|
@ -97,6 +97,8 @@ signals:
|
|||
void changedUdpPref(prefUDPItem i);
|
||||
void changedServerPref(prefServerItem i);
|
||||
void connectButtonPressed();
|
||||
void saveSettingsButtonPressed();
|
||||
void revertSettingsButtonPressed();
|
||||
|
||||
private slots:
|
||||
void on_settingsList_currentRowChanged(int currentRow);
|
||||
|
@ -243,6 +245,10 @@ private slots:
|
|||
|
||||
void on_connectBtn_clicked();
|
||||
|
||||
void on_saveSettingsBtn_clicked();
|
||||
|
||||
void on_revertSettingsBtn_clicked();
|
||||
|
||||
private:
|
||||
Ui::settingswidget *ui;
|
||||
void createSettingsListItems();
|
||||
|
|
|
@ -1296,8 +1296,8 @@ ONLY use Manual CI-V when Transceive mode is not supported</string>
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>916</width>
|
||||
<height>309</height>
|
||||
<width>582</width>
|
||||
<height>254</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
|
@ -3278,6 +3278,43 @@ ONLY use Manual CI-V when Transceive mode is not supported</string>
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="bottomButtonsLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="saveSettingsBtn">
|
||||
<property name="text">
|
||||
<string>Save Settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="revertSettingsBtn">
|
||||
<property name="text">
|
||||
<string>Revert to Default</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
|
|
|
@ -19,6 +19,7 @@ spectrumScope::spectrumScope(uchar receiver, uchar vfo, QWidget *parent)
|
|||
splitter = new QSplitter(this);
|
||||
layout->addWidget(splitter);
|
||||
splitter->setOrientation(Qt::Vertical);
|
||||
originalParent = parent;
|
||||
|
||||
displayLayout = new QHBoxLayout();
|
||||
|
||||
|
@ -1787,13 +1788,29 @@ void spectrumScope::detachScope(bool state)
|
|||
detachButton->setText("Attach");
|
||||
qInfo(logGui()) << "Detaching scope" << (receiver?"Sub":"Main");
|
||||
this->parentWidget()->layout()->replaceWidget(this,windowLabel);
|
||||
|
||||
QTimer::singleShot(1, [&](){
|
||||
if(originalParent) {
|
||||
this->originalParent->resize(1,1);
|
||||
}
|
||||
});
|
||||
|
||||
this->parentWidget()->resize(1,1);
|
||||
this->setParent(NULL);
|
||||
|
||||
this-> setWindowFlags(Qt::Window | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint);
|
||||
this->move(screen()->geometry().center() - frameGeometry().center());
|
||||
} else {
|
||||
detachButton->setText("Detach");
|
||||
qInfo(logGui()) << "Attaching scope" << (receiver?"Sub":"Main");
|
||||
windowLabel->parentWidget()->layout()->replaceWidget(windowLabel,this);
|
||||
|
||||
QTimer::singleShot(1, [&](){
|
||||
if(originalParent) {
|
||||
this->originalParent->resize(1,1);
|
||||
}
|
||||
});
|
||||
|
||||
windowLabel->setParent(NULL);
|
||||
delete windowLabel;
|
||||
}
|
||||
|
|
28
wfmain.cpp
28
wfmain.cpp
|
@ -871,6 +871,8 @@ void wfmain::connectSettingsWidget()
|
|||
|
||||
connect(this, SIGNAL(connectionStatus(bool)), setupui, SLOT(connectionStatus(bool)));
|
||||
connect(setupui, SIGNAL(connectButtonPressed()), this, SLOT(handleExtConnectBtn()));
|
||||
connect(setupui, SIGNAL(saveSettingsButtonPressed()), this, SLOT(on_saveSettingsBtn_clicked()));
|
||||
connect(setupui, SIGNAL(revertSettingsButtonPressed()), this, SLOT(handleRevertSettingsBtn()));
|
||||
}
|
||||
|
||||
// NOT Migrated, EHL TODO, carefully remove this function
|
||||
|
@ -1026,7 +1028,7 @@ void wfmain::configureVFOs()
|
|||
connect(receiver,SIGNAL(showStatusBarText(QString)),this,SLOT(showStatusBarText(QString)));
|
||||
receivers.append(receiver);
|
||||
|
||||
ui->scopeSpacer->changeSize(0,0,QSizePolicy::Minimum);
|
||||
//ui->scopeSpacer->changeSize(0,0,QSizePolicy::Minimum);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1509,6 +1511,7 @@ void wfmain::setDefPrefs()
|
|||
defPrefs.forceRTSasPTT = false;
|
||||
defPrefs.serialPortRadio = QString("auto");
|
||||
defPrefs.serialPortBaud = 115200;
|
||||
defPrefs.enableLAN = false;
|
||||
defPrefs.polling_ms = 0; // 0 = Automatic
|
||||
defPrefs.enablePTT = true;
|
||||
defPrefs.niceTS = true;
|
||||
|
@ -1534,6 +1537,8 @@ void wfmain::setDefPrefs()
|
|||
|
||||
defPrefs.tcpPort = 0;
|
||||
defPrefs.tciPort = 50001;
|
||||
defPrefs.clusterUdpEnable = false;
|
||||
defPrefs.clusterTcpEnable = false;
|
||||
defPrefs.waterfallFormat = 0;
|
||||
defPrefs.audioSystem = qtAudio;
|
||||
defPrefs.enableUSBControllers = false;
|
||||
|
@ -1780,8 +1785,6 @@ void wfmain::loadSettings()
|
|||
udpPrefs.clientName = settings->value("ClientName", udpDefPrefs.clientName).toString();
|
||||
|
||||
udpPrefs.halfDuplex = settings->value("HalfDuplex", udpDefPrefs.halfDuplex).toBool();
|
||||
//ui->audioDuplexCombo->setVisible(false);
|
||||
//ui->label_51->setVisible(false);
|
||||
|
||||
settings->endGroup();
|
||||
|
||||
|
@ -4164,6 +4167,25 @@ void wfmain::handleExtConnectBtn() {
|
|||
on_connectBtn_clicked();
|
||||
}
|
||||
|
||||
void wfmain::handleRevertSettingsBtn() {
|
||||
// from settings widget
|
||||
int ret = QMessageBox::warning(this, tr("Revert settings"),
|
||||
tr("Are you sure you wish to reset all wfview settings?\nIf so, wfview will exit and you will need to start the program again."),
|
||||
QMessageBox::Ok | QMessageBox::Cancel,
|
||||
QMessageBox::Cancel);
|
||||
if (ret == QMessageBox::Ok) {
|
||||
qInfo(logSystem()) << "Per user request, resetting preferences.";
|
||||
prefs = defPrefs;
|
||||
udpPrefs = udpDefPrefs;
|
||||
serverConfig.enabled = false;
|
||||
serverConfig.users.clear();
|
||||
|
||||
saveSettings();
|
||||
qInfo(logSystem()) << "Closing wfview for full preference-reset.";
|
||||
QApplication::exit();
|
||||
}
|
||||
}
|
||||
|
||||
void wfmain::on_connectBtn_clicked()
|
||||
{
|
||||
this->rigStatus->setText(""); // Clear status
|
||||
|
|
1
wfmain.h
1
wfmain.h
|
@ -330,6 +330,7 @@ private slots:
|
|||
void extChangedServerPref(prefServerItem i);
|
||||
|
||||
void handleExtConnectBtn();
|
||||
void handleRevertSettingsBtn();
|
||||
|
||||
void receiveScopeSettings(uchar receiver, int theme, quint16 len, int floor, int ceiling);
|
||||
void receiveValue(cacheItem val);
|
||||
|
|
88
wfmain.ui
88
wfmain.ui
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>942</width>
|
||||
<height>327</height>
|
||||
<width>946</width>
|
||||
<height>361</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
|
@ -18,8 +18,66 @@
|
|||
</property>
|
||||
<widget class="QWidget" name="centralWidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QFrame" name="scopeVFOGroup">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="scopeVFOLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="vfoLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="mainGroup">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
|
@ -48,26 +106,6 @@
|
|||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="scopeSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="vfoLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
|
@ -992,7 +1030,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame">
|
||||
<widget class="QFrame" name="lowerButtonsFrame">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
|
@ -1012,6 +1050,9 @@
|
|||
<property name="rightMargin">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="aboutBtn">
|
||||
<property name="text">
|
||||
|
@ -1105,6 +1146,7 @@
|
|||
<widget class="QPushButton" name="exitBtn">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
Ładowanie…
Reference in New Issue