Support option for metered networks in Plasmoid as well
This commit is contained in:
parent
827251004e
commit
abf1ad6c5a
|
@ -4,6 +4,8 @@
|
||||||
#include <syncthingconnector/syncthingservice.h>
|
#include <syncthingconnector/syncthingservice.h>
|
||||||
#include <syncthingconnector/utils.h>
|
#include <syncthingconnector/utils.h>
|
||||||
|
|
||||||
|
#include <syncthingmodel/syncthingicons.h>
|
||||||
|
|
||||||
#include <syncthingwidgets/misc/direrrorsdialog.h>
|
#include <syncthingwidgets/misc/direrrorsdialog.h>
|
||||||
#include <syncthingwidgets/misc/internalerrorsdialog.h>
|
#include <syncthingwidgets/misc/internalerrorsdialog.h>
|
||||||
#include <syncthingwidgets/misc/otherdialogs.h>
|
#include <syncthingwidgets/misc/otherdialogs.h>
|
||||||
|
@ -12,10 +14,9 @@
|
||||||
#include <syncthingwidgets/settings/settingsdialog.h>
|
#include <syncthingwidgets/settings/settingsdialog.h>
|
||||||
#include <syncthingwidgets/settings/wizard.h>
|
#include <syncthingwidgets/settings/wizard.h>
|
||||||
#include <syncthingwidgets/webview/webviewdialog.h>
|
#include <syncthingwidgets/webview/webviewdialog.h>
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
|
||||||
#include <syncthingmodel/syncthingicons.h>
|
#include <syncthingwidgets/misc/syncthinglauncher.h>
|
||||||
|
#endif
|
||||||
#include <syncthingconnector/utils.h>
|
|
||||||
|
|
||||||
#include "resources/config.h"
|
#include "resources/config.h"
|
||||||
#include "resources/qtconfig.h"
|
#include "resources/qtconfig.h"
|
||||||
|
@ -366,6 +367,12 @@ void SyncthingApplet::showSettingsDlg()
|
||||||
{
|
{
|
||||||
if (!m_settingsDlg) {
|
if (!m_settingsDlg) {
|
||||||
m_settingsDlg = new SettingsDialog(*this);
|
m_settingsDlg = new SettingsDialog(*this);
|
||||||
|
// create a launcher as its monitoring of whether the network is metered is required by the connection settings
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
|
||||||
|
if (!SyncthingLauncher::mainInstance()) {
|
||||||
|
SyncthingLauncher::setMainInstance(new SyncthingLauncher(m_settingsDlg));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
// show wizard when requested
|
// show wizard when requested
|
||||||
connect(m_settingsDlg, &SettingsDialog::wizardRequested, this, &SyncthingApplet::showWizard);
|
connect(m_settingsDlg, &SettingsDialog::wizardRequested, this, &SyncthingApplet::showWizard);
|
||||||
// ensure settings take effect when applied
|
// ensure settings take effect when applied
|
||||||
|
|
Loading…
Reference in New Issue