kopia lustrzana https://github.com/f4exb/sdrangel
Merge back to v7
commit
78674ead2e
|
@ -107,11 +107,6 @@ bool Configuration::deserialize(const QByteArray& data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int Configuration::getNumberOfWorkspaces() const
|
|
||||||
{
|
|
||||||
return m_workspaceGeometries.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Configuration::clearData()
|
void Configuration::clearData()
|
||||||
{
|
{
|
||||||
m_deviceSetPresets.clear();
|
m_deviceSetPresets.clear();
|
||||||
|
|
|
@ -47,7 +47,7 @@ public:
|
||||||
void setDescription(const QString& description) { m_description = description; }
|
void setDescription(const QString& description) { m_description = description; }
|
||||||
const QString& getDescription() const { return m_description; }
|
const QString& getDescription() const { return m_description; }
|
||||||
|
|
||||||
int getNumberOfWorkspaces() const;
|
int getNumberOfWorkspaceGeometries() const { return m_workspaceGeometries.size(); }
|
||||||
QList<QByteArray>& getWorkspaceGeometries() { return m_workspaceGeometries; }
|
QList<QByteArray>& getWorkspaceGeometries() { return m_workspaceGeometries; }
|
||||||
const QList<QByteArray>& getWorkspaceGeometries() const { return m_workspaceGeometries; }
|
const QList<QByteArray>& getWorkspaceGeometries() const { return m_workspaceGeometries; }
|
||||||
FeatureSetPreset& getFeatureSetPreset() { return m_featureSetPreset; }
|
FeatureSetPreset& getFeatureSetPreset() { return m_featureSetPreset; }
|
||||||
|
|
|
@ -54,6 +54,7 @@ DeviceGUI::DeviceGUI(QWidget *parent) :
|
||||||
m_indexLabel->setToolTip("Device type and set index");
|
m_indexLabel->setToolTip("Device type and set index");
|
||||||
|
|
||||||
m_settingsButton = new QPushButton();
|
m_settingsButton = new QPushButton();
|
||||||
|
m_settingsButton->setFixedSize(20, 20);
|
||||||
QIcon settingsIcon(":/gear.png");
|
QIcon settingsIcon(":/gear.png");
|
||||||
m_settingsButton->setIcon(settingsIcon);
|
m_settingsButton->setIcon(settingsIcon);
|
||||||
m_settingsButton->setToolTip("Common settings");
|
m_settingsButton->setToolTip("Common settings");
|
||||||
|
|
|
@ -83,7 +83,7 @@ protected:
|
||||||
void mouseReleaseEvent(QMouseEvent* event) override;
|
void mouseReleaseEvent(QMouseEvent* event) override;
|
||||||
void mouseMoveEvent(QMouseEvent* event) override;
|
void mouseMoveEvent(QMouseEvent* event) override;
|
||||||
void resetContextMenuType() { m_contextMenuType = ContextMenuNone; }
|
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;
|
DeviceType m_deviceType;
|
||||||
int m_deviceSetIndex;
|
int m_deviceSetIndex;
|
||||||
|
|
|
@ -685,3 +685,23 @@ void Workspace::restoreMdiGeometry(const QByteArray& blob)
|
||||||
{
|
{
|
||||||
m_mdi->restoreGeometry(qUncompress(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<FeatureGUI *> &list);
|
||||||
void orderByIndex(QList<DeviceGUI *> &list);
|
void orderByIndex(QList<DeviceGUI *> &list);
|
||||||
void orderByIndex(QList<MainSpectrumGUI *> &list);
|
void orderByIndex(QList<MainSpectrumGUI *> &list);
|
||||||
|
void adjustSubWindowsAfterRestore();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_index;
|
int m_index;
|
||||||
|
|
|
@ -97,7 +97,7 @@ MainSpectrumGUI::MainSpectrumGUI(GLSpectrum *spectrum, GLSpectrumGUI *spectrumGU
|
||||||
// m_statusLabel->setToolTip("Spectrum status");
|
// m_statusLabel->setToolTip("Spectrum status");
|
||||||
|
|
||||||
m_layouts = new QVBoxLayout();
|
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_layouts->setSpacing(0);
|
||||||
|
|
||||||
m_topLayout = new QHBoxLayout();
|
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)",
|
qDebug("MainWindow::loadConfiguration: configuration [%s | %s] %d workspace(s) - %d device set(s) - %d feature(s)",
|
||||||
qPrintable(configuration->getGroup()),
|
qPrintable(configuration->getGroup()),
|
||||||
qPrintable(configuration->getDescription()),
|
qPrintable(configuration->getDescription()),
|
||||||
configuration->getNumberOfWorkspaces(),
|
configuration->getNumberOfWorkspaceGeometries(),
|
||||||
configuration->getDeviceSetPresets().size(),
|
configuration->getDeviceSetPresets().size(),
|
||||||
configuration->getFeatureSetPreset().getFeatureCount()
|
configuration->getFeatureSetPreset().getFeatureCount()
|
||||||
);
|
);
|
||||||
|
@ -1210,7 +1210,7 @@ void MainWindow::loadConfiguration(const Configuration *configuration, bool from
|
||||||
// Reconstruct
|
// Reconstruct
|
||||||
|
|
||||||
// Workspaces
|
// Workspaces
|
||||||
for (int i = 0; i < configuration->getNumberOfWorkspaces(); i++) {
|
for (int i = 0; i < configuration->getNumberOfWorkspaceGeometries(); i++) {
|
||||||
addWorkspace();
|
addWorkspace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1321,8 +1321,10 @@ void MainWindow::loadConfiguration(const Configuration *configuration, bool from
|
||||||
waitBox->setInformativeText("Finalizing...");
|
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]->restoreGeometry(configuration->getWorkspaceGeometries()[i]);
|
||||||
|
m_workspaces[i]->adjustSubWindowsAfterRestore();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (waitBox)
|
if (waitBox)
|
||||||
|
|
Ładowanie…
Reference in New Issue