Mounting changes
This commit is contained in:
@@ -121,6 +121,7 @@
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
|
||||
</Link>
|
||||
<Midl>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
@@ -177,6 +178,7 @@
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
|
||||
</Link>
|
||||
<Midl>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
|
@@ -108,6 +108,13 @@ CSiaDriveDlg::CSiaDriveDlg(CWnd* pParent /*=NULL*/)
|
||||
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
|
||||
}
|
||||
|
||||
CSiaDriveDlg::~CSiaDriveDlg()
|
||||
{
|
||||
_dokan.reset(nullptr);
|
||||
_siaApi.reset(nullptr);
|
||||
}
|
||||
|
||||
|
||||
void CSiaDriveDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDHtmlDialog::DoDataExchange(pDX);
|
||||
@@ -207,21 +214,22 @@ HRESULT CSiaDriveDlg::OnButtonUnlockWallet(IHTMLElement* /*pElement*/)
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
std::unique_ptr<Dokan::CSiaDokanDrive> d;
|
||||
void CSiaDriveDlg::OnDocumentComplete(LPDISPATCH, LPCTSTR)
|
||||
{
|
||||
KillTimer(IDT_UPDATE);
|
||||
KillTimer(IDT_UI_ACTION_QUEUE);
|
||||
|
||||
// Create new API to clear all cached data used by threaded implementations
|
||||
_siaApi.reset(new CSiaApi({ L"localhost", 9980, L"1.1.1" }, &_siaConfig));
|
||||
|
||||
if (!_siaApi)
|
||||
{
|
||||
_siaApi.reset(new CSiaApi({ L"localhost", 9980, L"1.1.1" }, &_siaConfig));
|
||||
}
|
||||
ClearDisplay();
|
||||
CallClientScript(L"setAvailableDrives", json(GetAvailableDrives()), nullptr);
|
||||
if (!d)
|
||||
if (!_dokan)
|
||||
{
|
||||
d.reset(new Dokan::CSiaDokanDrive(*_siaApi, &_siaConfig));
|
||||
d->Mount('A', CA2W(_siaConfig.GetCacheFolder().c_str()).m_psz, 10);
|
||||
_dokan.reset(new Dokan::CSiaDokanDrive(*_siaApi, &_siaConfig));
|
||||
_dokan->Mount('Y', CA2W(_siaConfig.GetCacheFolder().c_str()).m_psz, 10);
|
||||
}
|
||||
|
||||
SetTimer(IDT_UPDATE, 2000, nullptr);
|
||||
|
@@ -6,6 +6,7 @@
|
||||
#include <SiaApi.h>
|
||||
#include "SiaDriveConfig.h"
|
||||
#include "ntray.h"
|
||||
#include "../SiaDrive.Dokan.Api/SiaDokanDrive.h"
|
||||
|
||||
using namespace Sia::Api;
|
||||
|
||||
@@ -16,6 +17,9 @@ class CSiaDriveDlg : public CDHtmlDialog
|
||||
public:
|
||||
CSiaDriveDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
public:
|
||||
virtual ~CSiaDriveDlg();
|
||||
|
||||
// Dialog Data
|
||||
#ifdef AFX_DESIGN_TIME
|
||||
enum { IDD = IDD_SIADRIVE_DIALOG, IDH = IDR_HTML_SIADRIVE_DIALOG };
|
||||
@@ -99,6 +103,7 @@ private:
|
||||
CSiaDriveConfig _siaConfig;
|
||||
CTrayNotifyIcon _tray;
|
||||
std::unique_ptr<CSiaApi> _siaApi;
|
||||
std::unique_ptr<Dokan::CSiaDokanDrive> _dokan;
|
||||
CString _walletCreatedSeed;
|
||||
String _receiveAddress;
|
||||
std::mutex _uiActionQueueMutex;
|
||||
|
Reference in New Issue
Block a user