kopia lustrzana https://gitlab.com/eliggett/wfview
Cleaner tab add/remove code for the settings tab.
rodzic
93b1af6eb6
commit
a84fb6d091
49
wfmain.cpp
49
wfmain.cpp
|
@ -53,6 +53,7 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, const QString s
|
||||||
setupKeyShortcuts();
|
setupKeyShortcuts();
|
||||||
|
|
||||||
setupMainUI();
|
setupMainUI();
|
||||||
|
prepareSettingsWindow();
|
||||||
|
|
||||||
setSerialDevicesUI();
|
setSerialDevicesUI();
|
||||||
|
|
||||||
|
@ -880,8 +881,18 @@ void wfmain::setupMainUI()
|
||||||
[=](const unsigned char &newValue) { issueCmdUniquePriority(cmdSetTPBFOuter, newValue);}
|
[=](const unsigned char &newValue) { issueCmdUniquePriority(cmdSetTPBFOuter, newValue);}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void wfmain::prepareSettingsWindow()
|
||||||
|
{
|
||||||
|
settingsTabisAttached = true;
|
||||||
|
// settingsTab;
|
||||||
|
settingsWidgetWindow = new QWidget;
|
||||||
|
settingsWidgetLayout = new QGridLayout;
|
||||||
|
settingsWidgetTab = new QTabWidget;
|
||||||
|
|
||||||
|
settingsWidgetWindow->setLayout(settingsWidgetLayout);
|
||||||
|
settingsWidgetLayout->addWidget(settingsWidgetTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wfmain::updateSizes(int tabIndex)
|
void wfmain::updateSizes(int tabIndex)
|
||||||
|
@ -6223,7 +6234,8 @@ void wfmain::on_debugBtn_clicked()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Color Helper Functions:
|
// ---------- color helper functions: ---------- //
|
||||||
|
|
||||||
void wfmain::setColorElement(QColor color,
|
void wfmain::setColorElement(QColor color,
|
||||||
QLedLabel *led,
|
QLedLabel *led,
|
||||||
QLabel *label,
|
QLabel *label,
|
||||||
|
@ -6388,16 +6400,25 @@ void wfmain::setColorLineEditOperations(QColor *colorStore,
|
||||||
|
|
||||||
void wfmain::on_colorPopOutBtn_clicked()
|
void wfmain::on_colorPopOutBtn_clicked()
|
||||||
{
|
{
|
||||||
QWidget *settingsPop = new QWidget;
|
|
||||||
QWidget *settingsTab = ui->tabWidget->currentWidget();
|
if(settingsTabisAttached)
|
||||||
ui->tabWidget->removeTab(ui->tabWidget->indexOf(settingsTab));
|
{
|
||||||
QGridLayout *g = new QGridLayout;
|
settingsTab = ui->tabWidget->currentWidget();
|
||||||
QTabWidget *t = new QTabWidget;
|
ui->tabWidget->removeTab(ui->tabWidget->indexOf(settingsTab));
|
||||||
settingsPop->setLayout(g);
|
settingsWidgetTab->addTab(settingsTab, "Settings");
|
||||||
g->addWidget(t);
|
settingsWidgetWindow->show();
|
||||||
t->addTab(settingsTab, "Settings");
|
ui->colorPopOutBtn->setText("Re-attach");
|
||||||
settingsPop->show();
|
settingsTabisAttached = false;
|
||||||
//connect(settingsPop, SIGNAL(destroyed(QObject*)), this, foo());
|
} else {
|
||||||
|
settingsTab = settingsWidgetTab->currentWidget();
|
||||||
|
|
||||||
|
settingsWidgetTab->removeTab(settingsWidgetTab->indexOf(settingsTab));
|
||||||
|
ui->tabWidget->addTab(settingsTab, "Settings");
|
||||||
|
settingsWidgetWindow->close();
|
||||||
|
|
||||||
|
ui->colorPopOutBtn->setText("Pop-Out");
|
||||||
|
settingsTabisAttached = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wfmain::setDefaultColorPresets()
|
void wfmain::setDefaultColorPresets()
|
||||||
|
@ -6496,7 +6517,9 @@ void wfmain::on_colorPresetCombo_currentIndexChanged(int index)
|
||||||
loadColorPresetToUIandPlots(index);
|
loadColorPresetToUIandPlots(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Color buttons and lineEdit action functions:
|
// ---------- end color helper functions ---------- //
|
||||||
|
|
||||||
|
// ---------- Color UI slots ----------//
|
||||||
|
|
||||||
// Grid:
|
// Grid:
|
||||||
void wfmain::on_colorSetBtnGrid_clicked()
|
void wfmain::on_colorSetBtnGrid_clicked()
|
||||||
|
@ -6750,3 +6773,5 @@ void wfmain::on_colorEditMeterText_editingFinished()
|
||||||
QColor *c = &(colorPreset[pos].meterLowText);
|
QColor *c = &(colorPreset[pos].meterLowText);
|
||||||
setColorLineEditOperations(c, ui->colorEditMeterText, ui->colorSwatchMeterText);
|
setColorLineEditOperations(c, ui->colorEditMeterText, ui->colorSwatchMeterText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---------- End color UI slots ----------//
|
||||||
|
|
10
wfmain.h
10
wfmain.h
|
@ -428,7 +428,6 @@ private slots:
|
||||||
|
|
||||||
void on_dataModeBtn_toggled(bool checked);
|
void on_dataModeBtn_toggled(bool checked);
|
||||||
|
|
||||||
|
|
||||||
void on_transmitBtn_clicked();
|
void on_transmitBtn_clicked();
|
||||||
|
|
||||||
void on_adjRefBtn_clicked();
|
void on_adjRefBtn_clicked();
|
||||||
|
@ -930,6 +929,15 @@ private:
|
||||||
void setColorButtonOperations(QColor *colorStore, QLineEdit *e, QLedLabel *d);
|
void setColorButtonOperations(QColor *colorStore, QLineEdit *e, QLedLabel *d);
|
||||||
void setColorLineEditOperations(QColor *colorStore, QLineEdit *e, QLedLabel *d);
|
void setColorLineEditOperations(QColor *colorStore, QLineEdit *e, QLedLabel *d);
|
||||||
|
|
||||||
|
void detachSettingsTab();
|
||||||
|
void reattachSettingsTab();
|
||||||
|
void prepareSettingsWindow();
|
||||||
|
QWidget *settingsWidgetWindow;
|
||||||
|
QWidget *settingsTab;
|
||||||
|
QGridLayout *settingsWidgetLayout;
|
||||||
|
QTabWidget *settingsWidgetTab;
|
||||||
|
bool settingsTabisAttached = true;
|
||||||
|
|
||||||
quint64 roundFrequency(quint64 frequency, unsigned int tsHz);
|
quint64 roundFrequency(quint64 frequency, unsigned int tsHz);
|
||||||
quint64 roundFrequencyWithStep(quint64 oldFreq, int steps,\
|
quint64 roundFrequencyWithStep(quint64 oldFreq, int steps,\
|
||||||
unsigned int tsHz);
|
unsigned int tsHz);
|
||||||
|
|
Ładowanie…
Reference in New Issue