From fb4c884885e546515a88f0ab644482fe373704ef Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Sun, 4 Nov 2012 14:28:41 +0000 Subject: Do not create Screenshots if the directory doesn't exist (fixes #153) git-svn-id: http://svn.miranda-ng.org/main/trunk@2181 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SendScreenshotPlus/src/Main.cpp | 1 + plugins/SendScreenshotPlus/src/UMainForm.cpp | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) (limited to 'plugins') diff --git a/plugins/SendScreenshotPlus/src/Main.cpp b/plugins/SendScreenshotPlus/src/Main.cpp index 923de72621..5b855c7972 100644 --- a/plugins/SendScreenshotPlus/src/Main.cpp +++ b/plugins/SendScreenshotPlus/src/Main.cpp @@ -360,6 +360,7 @@ LPTSTR GetCustomPath() { TCHAR szError[MAX_PATH]; mir_sntprintf(szError,MAX_PATH,TranslateT("Could not create Screenshot folder (error code: %d):\n%s\nDo you have write permissions?"),result,pszPath); MessageBox(NULL, szError, _T("Send Screenshot"), MB_OK | MB_ICONERROR | MB_APPLMODAL); + return 0; } return pszPath; } diff --git a/plugins/SendScreenshotPlus/src/UMainForm.cpp b/plugins/SendScreenshotPlus/src/UMainForm.cpp index 249227a91a..3059c23f67 100644 --- a/plugins/SendScreenshotPlus/src/UMainForm.cpp +++ b/plugins/SendScreenshotPlus/src/UMainForm.cpp @@ -774,17 +774,20 @@ void TfrmMain::SaveOptions(void) { //--------------------------------------------------------------------------- void TfrmMain::Init(LPTSTR DestFolder, HANDLE Contact) { - m_FDestFolder = mir_tstrdup(DestFolder); - m_hContact = Contact; - if(!m_hContact) m_opt_cboxSendBy = SS_JUSTSAVE; + if(DestFolder) + { + m_FDestFolder = mir_tstrdup(DestFolder); + m_hContact = Contact; + if(!m_hContact) m_opt_cboxSendBy = SS_JUSTSAVE; - // create window - m_hWnd = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_UMainForm),0, (DLGPROC)DlgTfrmMain,(LPARAM)this); - //register object - _HandleMapping.insert(CHandleMapping::value_type(m_hWnd, this)); + // create window + m_hWnd = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_UMainForm),0, (DLGPROC)DlgTfrmMain,(LPARAM)this); + //register object + _HandleMapping.insert(CHandleMapping::value_type(m_hWnd, this)); - //check Contact - if(m_cSend) m_cSend->SetContact(Contact); + //check Contact + if(m_cSend) m_cSend->SetContact(Contact); + } } //--------------------------------------------------------------------------- -- cgit v1.2.3