Launch explorer
This commit is contained in:
@@ -180,6 +180,8 @@
|
||||
<input type="checkbox" id="ID_SettingsLockWalletOnExit"><br><br>
|
||||
<h2>Auto-start on Logon</h2>
|
||||
<input type="checkbox" id="ID_SettingsAutoStart"><br><br>
|
||||
<h2>Launch file manager on mount</h2>
|
||||
<input type="checkbox" id="ID_SettingsLaunchFileManager"><br><br>
|
||||
<h2>Use Bundled siad</h2>
|
||||
<input type="checkbox" id="ID_SettingsLaunchServer"><br><br>
|
||||
<h2>API Port</h2>
|
||||
|
@@ -172,6 +172,11 @@
|
||||
if (document.getElementById('sia_settings_window').classList.contains('hidden-element')) {
|
||||
setValue('ID_SettingsRPCPort', port);
|
||||
}
|
||||
},
|
||||
setLaunchFileManager: (launch) => {
|
||||
if (document.getElementById('sia_settings_window').classList.contains('hidden-element')) {
|
||||
setChecked('ID_SettingsLaunchFileManager', launch);
|
||||
}
|
||||
}
|
||||
};
|
||||
})();
|
||||
@@ -336,7 +341,8 @@
|
||||
'UseBundledSiad': getChecked('ID_SettingsLaunchServer'),
|
||||
'ApiPort': getValue('ID_SettingsApiPort'),
|
||||
'HostPort': getValue('ID_SettingsHostPort'),
|
||||
'RpcPort': getValue('ID_SettingsRPCPort')
|
||||
'RpcPort': getValue('ID_SettingsRPCPort'),
|
||||
'LaunchFileManager': getChecked('ID_SettingsLaunchFileManager')
|
||||
}, (success, reason) => {
|
||||
if (success) {
|
||||
beginMainApplication();
|
||||
|
@@ -26,6 +26,7 @@ public:
|
||||
JProperty(bool, LockWalletOnExit, public, public, _configDocument)
|
||||
JProperty(bool, AutoStartOnLogon, public, public, _configDocument)
|
||||
JProperty(bool, LaunchBundledSiad, public, public, _configDocument)
|
||||
JProperty(bool, LaunchFileMgrOnMount, public, public, _configDocument)
|
||||
JProperty(std::string, EventLevel, public, public, _configDocument)
|
||||
|
||||
private:
|
||||
|
@@ -212,6 +212,7 @@ public:
|
||||
{
|
||||
CefRefPtr<CefV8Value> settings = arguments[0];
|
||||
CefRefPtr<CefV8Value> cb = arguments[1];
|
||||
_siaDriveConfig->SetLaunchFileMgrOnMount(settings->GetValue("LaunchFileManager")->GetBoolValue());
|
||||
_siaDriveConfig->SetAutoStartOnLogon(settings->GetValue("AutoStartOnLogon")->GetBoolValue());
|
||||
_siaDriveConfig->SetLaunchBundledSiad(settings->GetValue("UseBundledSiad")->GetBoolValue());
|
||||
_siaDriveConfig->SetLockWalletOnExit(settings->GetValue("UnlockOnExit")->GetBoolValue());
|
||||
@@ -443,6 +444,7 @@ void CSiaDriveApp::SiaApiRefreshCallback(CefRefPtr<CefV8Context> context, const
|
||||
uiState->SetValue("allocatedRenterFunds", CefV8Value::CreateString(_siaApi->GetRenter()->GetFunds().ToString()), V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
ExecuteSetter(context, uiActions, "setAutoStartOnLogon", CefV8Value::CreateBool(_siaDriveConfig->GetAutoStartOnLogon()));
|
||||
ExecuteSetter(context, uiActions, "setLaunchBundledSiad", CefV8Value::CreateBool(_siaDriveConfig->GetLaunchBundledSiad()));
|
||||
ExecuteSetter(context, uiActions, "setLaunchFileManager", CefV8Value::CreateBool(_siaDriveConfig->GetLaunchFileMgrOnMount()));
|
||||
ExecuteSetter(context, uiActions, "setApiPort", CefV8Value::CreateUInt(_siaDriveConfig->GetApiPort()));
|
||||
ExecuteSetter(context, uiActions, "setHostPort", CefV8Value::CreateUInt(_siaDriveConfig->GetHostPort()));
|
||||
ExecuteSetter(context, uiActions, "setRpcPort", CefV8Value::CreateUInt(_siaDriveConfig->GetRpcPort()));
|
||||
|
@@ -114,6 +114,11 @@ bool CSiaDriveConfig::LoadDefaults()
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (!CheckLaunchFileMgrOnMount())
|
||||
{
|
||||
SetLaunchFileMgrOnMount(true);
|
||||
changed = true;
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#include <uploadmanager.h>
|
||||
#include <dokan.h>
|
||||
#include <filepath.h>
|
||||
#include <siadriveconfig.h>
|
||||
|
||||
using namespace Sia::Api;
|
||||
using namespace Sia::Api::Dokan;
|
||||
@@ -1949,6 +1950,10 @@ private:
|
||||
static NTSTATUS DOKAN_CALLBACK Sia_Mounted(PDOKAN_FILE_INFO dokanFileInfo)
|
||||
{
|
||||
CEventSystem::EventSystem.NotifyEvent(CreateSystemEvent(DriveMounted(_mountPoint)));
|
||||
if (_siaDriveConfig->GetLaunchFileMgrOnMount())
|
||||
{
|
||||
::ShellExecute(nullptr, L"open", &_mountPoint[0], nullptr, nullptr, SW_SHOWDEFAULT);
|
||||
}
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user