mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-05-28 05:02:25 -04:00
Merge back to v7
This commit is contained in:
commit
78674ead2e
@ -107,11 +107,6 @@ bool Configuration::deserialize(const QByteArray& data)
|
||||
}
|
||||
}
|
||||
|
||||
int Configuration::getNumberOfWorkspaces() const
|
||||
{
|
||||
return m_workspaceGeometries.size();
|
||||
}
|
||||
|
||||
void Configuration::clearData()
|
||||
{
|
||||
m_deviceSetPresets.clear();
|
||||
|
@ -47,7 +47,7 @@ public:
|
||||
void setDescription(const QString& description) { m_description = description; }
|
||||
const QString& getDescription() const { return m_description; }
|
||||
|
||||
int getNumberOfWorkspaces() const;
|
||||
int getNumberOfWorkspaceGeometries() const { return m_workspaceGeometries.size(); }
|
||||
QList<QByteArray>& getWorkspaceGeometries() { return m_workspaceGeometries; }
|
||||
const QList<QByteArray>& getWorkspaceGeometries() const { return m_workspaceGeometries; }
|
||||
FeatureSetPreset& getFeatureSetPreset() { return m_featureSetPreset; }
|
||||
|
@ -54,6 +54,7 @@ DeviceGUI::DeviceGUI(QWidget *parent) :
|
||||
m_indexLabel->setToolTip("Device type and set index");
|
||||
|
||||
m_settingsButton = new QPushButton();
|
||||
m_settingsButton->setFixedSize(20, 20);
|
||||
QIcon settingsIcon(":/gear.png");
|
||||
m_settingsButton->setIcon(settingsIcon);
|
||||
m_settingsButton->setToolTip("Common settings");
|
||||
|
@ -83,7 +83,7 @@ protected:
|
||||
void mouseReleaseEvent(QMouseEvent* event) override;
|
||||
void mouseMoveEvent(QMouseEvent* event) override;
|
||||
void resetContextMenuType() { m_contextMenuType = ContextMenuNone; }
|
||||
int getAdditionalHeight() const { return 26 + 22; } // height of top and bottom bars
|
||||
int getAdditionalHeight() const { return 22 + 22; }
|
||||
|
||||
DeviceType m_deviceType;
|
||||
int m_deviceSetIndex;
|
||||
|
@ -685,3 +685,23 @@ void Workspace::restoreMdiGeometry(const QByteArray& blob)
|
||||
{
|
||||
m_mdi->restoreGeometry(qUncompress(blob));
|
||||
}
|
||||
|
||||
void Workspace::adjustSubWindowsAfterRestore()
|
||||
{
|
||||
QList<QMdiSubWindow *> subWindowList = m_mdi->subWindowList();
|
||||
|
||||
for (auto& subWindow : subWindowList)
|
||||
{
|
||||
if ((subWindow->y() >= 20) && (subWindow->y() < 40)) {
|
||||
subWindow->move(subWindow->x(), subWindow->y() - 20);
|
||||
}
|
||||
|
||||
if (qobject_cast<ChannelGUI*>(subWindow)) {
|
||||
subWindow->resize(subWindow->width(), subWindow->height() - 22);
|
||||
}
|
||||
|
||||
if (qobject_cast<FeatureGUI*>(subWindow)) {
|
||||
subWindow->resize(subWindow->width(), subWindow->height() - 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -57,6 +57,7 @@ public:
|
||||
void orderByIndex(QList<FeatureGUI *> &list);
|
||||
void orderByIndex(QList<DeviceGUI *> &list);
|
||||
void orderByIndex(QList<MainSpectrumGUI *> &list);
|
||||
void adjustSubWindowsAfterRestore();
|
||||
|
||||
private:
|
||||
int m_index;
|
||||
|
@ -97,7 +97,7 @@ MainSpectrumGUI::MainSpectrumGUI(GLSpectrum *spectrum, GLSpectrumGUI *spectrumGU
|
||||
// m_statusLabel->setToolTip("Spectrum status");
|
||||
|
||||
m_layouts = new QVBoxLayout();
|
||||
m_layouts->setContentsMargins(m_resizer.m_gripSize, 4, m_resizer.m_gripSize, 4);
|
||||
m_layouts->setContentsMargins(m_resizer.m_gripSize, m_resizer.m_gripSize, m_resizer.m_gripSize, m_resizer.m_gripSize);
|
||||
m_layouts->setSpacing(0);
|
||||
|
||||
m_topLayout = new QHBoxLayout();
|
||||
|
@ -1173,7 +1173,7 @@ void MainWindow::loadConfiguration(const Configuration *configuration, bool from
|
||||
qDebug("MainWindow::loadConfiguration: configuration [%s | %s] %d workspace(s) - %d device set(s) - %d feature(s)",
|
||||
qPrintable(configuration->getGroup()),
|
||||
qPrintable(configuration->getDescription()),
|
||||
configuration->getNumberOfWorkspaces(),
|
||||
configuration->getNumberOfWorkspaceGeometries(),
|
||||
configuration->getDeviceSetPresets().size(),
|
||||
configuration->getFeatureSetPreset().getFeatureCount()
|
||||
);
|
||||
@ -1210,7 +1210,7 @@ void MainWindow::loadConfiguration(const Configuration *configuration, bool from
|
||||
// Reconstruct
|
||||
|
||||
// Workspaces
|
||||
for (int i = 0; i < configuration->getNumberOfWorkspaces(); i++) {
|
||||
for (int i = 0; i < configuration->getNumberOfWorkspaceGeometries(); i++) {
|
||||
addWorkspace();
|
||||
}
|
||||
|
||||
@ -1321,8 +1321,10 @@ void MainWindow::loadConfiguration(const Configuration *configuration, bool from
|
||||
waitBox->setInformativeText("Finalizing...");
|
||||
}
|
||||
|
||||
for (int i = 0; i < configuration->getNumberOfWorkspaces(); i++) {
|
||||
for (int i = 0; i < configuration->getNumberOfWorkspaceGeometries(); i++)
|
||||
{
|
||||
m_workspaces[i]->restoreGeometry(configuration->getWorkspaceGeometries()[i]);
|
||||
m_workspaces[i]->adjustSubWindowsAfterRestore();
|
||||
}
|
||||
|
||||
if (waitBox)
|
||||
|
Loading…
x
Reference in New Issue
Block a user