m_pRemoteLV = NULL;
m_pProgress = NULL;
m_pCancelingDlg = NULL;
+ m_pCreateFolderDlg = NULL;
m_hwndFTDialog = NULL;
m_hwndLocalPath = NULL;
m_szRemotePath[0] = '\0';
m_szLocalPathTmp[0] = '\0';
m_szRemotePathTmp[0] = '\0';
+ m_szCreateFolderName[0] = '\0';
}
FTDialog::~FTDialog()
setButtonsState();
}
+bool
+FTDialog::getCreateFolderName()
+{
+ if (m_pCreateFolderDlg != NULL) return false;
+
+ bool bResult = false;
+
+ m_pCreateFolderDlg = new FTDialog::CreateFolderDlg(this);
+ m_pCreateFolderDlg->create();
+ if (strlen(m_pCreateFolderDlg->getFolderName()) != 0) {
+ strcpy(m_szCreateFolderName, m_pCreateFolderDlg->getFolderName());
+ bResult = true;
+ } else {
+ m_szCreateFolderName[0] = '\0';
+ bResult = false;
+ }
+ delete m_pCreateFolderDlg;
+ m_pCreateFolderDlg = NULL;
+
+ return bResult;
+}
+
void
FTDialog::onLocalCreateFolder()
{
-
+ if (getCreateFolderName()) {
+ char path[FT_FILENAME_SIZE];
+ sprintf(path, "%s\\%s", m_szLocalPath, m_szCreateFolderName);
+ setStatusText("Creating Local Folder: %s", path);
+ FolderManager fm;
+ if (fm.createDir(path)) showLocalLVItems();
+ }
}
void
FTDialog::onRemoteCreateFolder()
{
-
+ if (getCreateFolderName()) {
+ m_pFileTransfer->createRemoteFolder(m_szRemotePath, m_szCreateFolderName);
+ }
}
void
}
return FALSE;
}
+
+FTDialog::CreateFolderDlg::CreateFolderDlg(FTDialog *pFTDlg) : Dialog(GetModuleHandle(0))
+{
+ m_pFTDlg = pFTDlg;
+ m_szFolderName[0] = '\0';
+}
+
+FTDialog::CreateFolderDlg::~CreateFolderDlg()
+{
+
+}
+
+bool
+FTDialog::CreateFolderDlg::create()
+{
+ return showDialog(MAKEINTRESOURCE(IDD_FTCREATEFOLDER), m_pFTDlg->getWndHandle());
+}
+
+bool
+FTDialog::CreateFolderDlg::onOk()
+{
+ strcpy(m_szFolderName, getItemString(IDC_FTFOLDERNAME));
+ return true;
+}
void onLocalRButton();
void onRemoteRButton();
+ bool getCreateFolderName();
void onLocalCreateFolder();
void onRemoteCreateFolder();
char m_szRemotePath[FT_FILENAME_SIZE];
char m_szLocalPathTmp[FT_FILENAME_SIZE];
char m_szRemotePathTmp[FT_FILENAME_SIZE];
+ char m_szCreateFolderName[FT_FILENAME_SIZE];
static const char szCheckDeleteQueueText[];
static const char szCheckTransferQueueText[];
CreateFolderDlg(FTDialog *pFTDlg);
~CreateFolderDlg();
+ bool onOk();
+ bool create();
+ char *getFolderName() { return m_szFolderName; }
+
+ private:
+ FTDialog *m_pFTDlg;
+ char m_szFolderName[FT_FILENAME_SIZE];
};
private:
}
}
+void
+FileTransfer::createRemoteFolder(char *pPath, char *pName)
+{
+ char fullPath[FT_FILENAME_SIZE];
+ sprintf(fullPath, "%s\\%s", pPath, pName);
+ m_pFTDialog->setStatusText("Creating Remote Folder: %s", fullPath);
+ m_pWriter->writeFileCreateDirRqst(strlen(fullPath), fullPath);
+ m_queueFileListRqst.add(pPath, 0, 0, FT_FLR_DEST_MAIN);
+ m_pWriter->writeFileListRqst(strlen(pPath), pPath, false);
+}
+
bool
FileTransfer::procFileListDataMsg()
{
void uploadFilePortion();
+ void createRemoteFolder(char *pPath, char *pName);
+
bool m_bCancel;
private:
CAPTION "Create a New Folder"
FONT 8, "MS Sans Serif"
BEGIN
+ EDITTEXT IDC_FTFOLDERNAME,7,19,179,14,ES_AUTOHSCROLL
DEFPUSHBUTTON "OK",IDOK,80,42,50,14
PUSHBUTTON "Cancel",IDCANCEL,136,42,50,14
LTEXT "New Folder Name",IDC_STATIC,7,7,179,8
- EDITTEXT IDC_FTFOLDERNAME,7,19,179,14,ES_AUTOHSCROLL
END