mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-03-21 19:58:39 -04:00
Make the settings location appear in the log and in the about panel of the GUI also
This commit is contained in:
parent
dbf5fb895e
commit
bfaaf2e1d3
@ -7,6 +7,7 @@
|
||||
MainSettings::MainSettings() : m_audioDeviceManager(0)
|
||||
{
|
||||
resetToDefaults();
|
||||
qInfo("MainSettings::MainSettings: settings file: format: %d location: %s", getFileFormat(), qPrintable(getFileLocation()));
|
||||
}
|
||||
|
||||
MainSettings::~MainSettings()
|
||||
@ -22,6 +23,18 @@ MainSettings::~MainSettings()
|
||||
}
|
||||
}
|
||||
|
||||
const QString& MainSettings::getFileLocation() const
|
||||
{
|
||||
QSettings s;
|
||||
return s.fileName();
|
||||
}
|
||||
|
||||
int MainSettings::getFileFormat() const
|
||||
{
|
||||
QSettings s;
|
||||
return (int) s.format();
|
||||
}
|
||||
|
||||
void MainSettings::load()
|
||||
{
|
||||
QSettings s;
|
||||
|
@ -18,6 +18,8 @@ public:
|
||||
void save() const;
|
||||
|
||||
void resetToDefaults();
|
||||
const QString& getFileLocation() const;
|
||||
int getFileFormat() const; //!< see QSettings::Format for the values
|
||||
|
||||
Preset* newPreset(const QString& group, const QString& description);
|
||||
void deletePreset(const Preset* preset);
|
||||
|
@ -1,8 +1,9 @@
|
||||
#include "gui/aboutdialog.h"
|
||||
#include "ui_aboutdialog.h"
|
||||
#include "dsp/dsptypes.h"
|
||||
#include "settings/mainsettings.h"
|
||||
|
||||
AboutDialog::AboutDialog(const QString& apiHost, int apiPort, QWidget* parent) :
|
||||
AboutDialog::AboutDialog(const QString& apiHost, int apiPort, const MainSettings& mainSettings, QWidget* parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::AboutDialog)
|
||||
{
|
||||
@ -14,6 +15,7 @@ AboutDialog::AboutDialog(const QString& apiHost, int apiPort, QWidget* parent) :
|
||||
QString apiUrl = QString("http://%1:%2/").arg(apiHost).arg(apiPort);
|
||||
ui->restApiUrl->setText(QString("REST API documentation: <a href=\"%1\">%2</a>").arg(apiUrl).arg(apiUrl));
|
||||
ui->restApiUrl->setOpenExternalLinks(true);
|
||||
ui->settingsFile->setText(QString("Settings: %1").arg(mainSettings.getFileLocation()));
|
||||
}
|
||||
|
||||
AboutDialog::~AboutDialog()
|
||||
|
@ -5,6 +5,8 @@
|
||||
|
||||
#include "export.h"
|
||||
|
||||
class MainSettings;
|
||||
|
||||
namespace Ui {
|
||||
class AboutDialog;
|
||||
}
|
||||
@ -13,7 +15,7 @@ class SDRGUI_API AboutDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AboutDialog(const QString& apiHost, int apiPort, QWidget* parent = 0);
|
||||
explicit AboutDialog(const QString& apiHost, int apiPort, const MainSettings& mainSettings, QWidget* parent = 0);
|
||||
~AboutDialog();
|
||||
|
||||
private:
|
||||
|
@ -136,6 +136,17 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="settingsFile">
|
||||
<property name="text">
|
||||
<string>Here goes the settings file location</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="info">
|
||||
<property name="text">
|
||||
@ -176,6 +187,39 @@
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
<include location="../resources/res.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include <QKeyEvent>
|
||||
#include <QResource>
|
||||
#include <QFontDatabase>
|
||||
#include <QStandardPaths>
|
||||
|
||||
#include <plugin/plugininstancegui.h>
|
||||
#include <plugin/plugininstancegui.h>
|
||||
@ -100,14 +99,6 @@ MainWindow::MainWindow(qtwebapp::LoggerWithFile *logger, const MainParser& parse
|
||||
{
|
||||
qDebug() << "MainWindow::MainWindow: start";
|
||||
|
||||
#if QT_VERSION >= 0x050500
|
||||
QString path = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation);
|
||||
qInfo("MainWindow::MainWindow: settings path: %s", qPrintable(path));
|
||||
#else
|
||||
QString path = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation);
|
||||
qInfo("MainWindow::MainWindow: settings path: %s", qPrintable(path));
|
||||
#endif
|
||||
|
||||
m_instance = this;
|
||||
m_settings.setAudioDeviceManager(m_dspEngine->getAudioDeviceManager());
|
||||
|
||||
@ -1695,7 +1686,7 @@ void MainWindow::channelAddClicked(bool checked)
|
||||
|
||||
void MainWindow::on_action_About_triggered()
|
||||
{
|
||||
AboutDialog dlg(m_apiHost, m_apiPort, this);
|
||||
AboutDialog dlg(m_apiHost, m_apiPort, m_settings, this);
|
||||
dlg.exec();
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include <QDebug>
|
||||
#include <QSysInfo>
|
||||
#include <QResource>
|
||||
#include <QStandardPaths>
|
||||
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/dspdevicesourceengine.h"
|
||||
@ -60,14 +59,6 @@ MainCore::MainCore(qtwebapp::LoggerWithFile *logger, const MainParser& parser, Q
|
||||
{
|
||||
qDebug() << "MainCore::MainCore: start";
|
||||
|
||||
#if QT_VERSION >= 0x050500
|
||||
QString path = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation);
|
||||
qInfo("MainCore::MainCore: settings path: %s", qPrintable(path));
|
||||
#else
|
||||
QString path = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation);
|
||||
qInfo("MainCore::MainCore: settings path: %s", qPrintable(path));
|
||||
#endif
|
||||
|
||||
m_instance = this;
|
||||
m_settings.setAudioDeviceManager(m_dspEngine->getAudioDeviceManager());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user