122
124
icons->Add(*upIcon);
124
126
wxFlexGridSizer *topSizer = new wxFlexGridSizer(2, 1);
125
wxStaticBoxSizer *connectionBox = new wxStaticBoxSizer(new wxStaticBox(this, -1, _("FTP Connection"), wxDefaultPosition, wxDefaultSize, 0, wxT("")), wxVERTICAL);
126
wxStaticBoxSizer *fileBox = new wxStaticBoxSizer(new wxStaticBox(this, -1, _("File Manager"), wxDefaultPosition, wxDefaultSize, 0, wxT("")), wxVERTICAL);
127
wxStaticBoxSizer *siteBox = new wxStaticBoxSizer(new wxStaticBox(this, -1, _("Site Manager"), wxDefaultPosition, wxDefaultSize, 0, wxT("")), wxVERTICAL);
127
wxStaticBoxSizer *connectionBox = new wxStaticBoxSizer(new wxStaticBox(this, -1, wxT("FTP Connection"), wxDefaultPosition, wxDefaultSize, 0, wxT("")), wxVERTICAL);
128
wxStaticBoxSizer *fileBox = new wxStaticBoxSizer(new wxStaticBox(this, -1, wxT("File Manager"), wxDefaultPosition, wxDefaultSize, 0, wxT("")), wxVERTICAL);
129
wxStaticBoxSizer *siteBox = new wxStaticBoxSizer(new wxStaticBox(this, -1, wxT("Site Manager"), wxDefaultPosition, wxDefaultSize, 0, wxT("")), wxVERTICAL);
129
131
wxFlexGridSizer *connectionSizer = new wxFlexGridSizer(2, 4);
130
132
wxBoxSizer *leftSizer = new wxBoxSizer(wxVERTICAL);
138
140
txtFtpHost = new wxTextCtrl(this, wxID_FTPHOST, wxT(""), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, wxT(""));
139
141
txtFtpUser = new wxTextCtrl(this, wxID_FTPUSER, wxT(""), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, wxT(""));
140
142
txtFtpPass = new wxTextCtrl(this, wxID_FTPPASS, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD, wxDefaultValidator, wxT(""));
141
btnConnect = new wxButton(this, wxID_CONNECT, _("&Connect"), wxDefaultPosition, wxDefaultSize);
142
btnDisconnect = new wxButton(this, wxID_DISCONNECT, _("&Disconnect"), wxDefaultPosition, wxDefaultSize);
143
btnConnect = new wxButton(this, wxID_CONNECT, wxT("&Connect"), wxDefaultPosition, wxDefaultSize);
144
btnDisconnect = new wxButton(this, wxID_DISCONNECT, wxT("&Disconnect"), wxDefaultPosition, wxDefaultSize);
143
145
btnDisconnect->Enable(false);
145
btnUploadFile = new wxButton(this, wxID_UPLOAD_FILE, _("Upload &File"), wxDefaultPosition, wxDefaultSize);
147
btnUploadFile = new wxButton(this, wxID_UPLOAD_FILE, wxT("Upload &File"), wxDefaultPosition, wxDefaultSize);
146
148
btnUploadFile->Enable(false);
147
btnUploadDir = new wxButton(this, wxID_UPLOAD_DIR, _("Upload F&older"), wxDefaultPosition, wxDefaultSize);
149
btnUploadDir = new wxButton(this, wxID_UPLOAD_DIR, wxT("Upload F&older"), wxDefaultPosition, wxDefaultSize);
148
150
btnUploadDir->Enable(false);
149
btnCreateDir = new wxButton(this, wxID_CREATEDIR, _("N&ew Folder"), wxDefaultPosition, wxDefaultSize);
151
btnCreateDir = new wxButton(this, wxID_CREATEDIR, wxT("N&ew Folder"), wxDefaultPosition, wxDefaultSize);
150
152
btnCreateDir->Enable(false);
152
btnDelSite = new wxButton(this, wxID_DELSITE, _("&Remove Site"), wxDefaultPosition, wxDefaultSize);
154
btnDelSite = new wxButton(this, wxID_DELSITE, wxT("&Remove Site"), wxDefaultPosition, wxDefaultSize);
154
156
fileManager = new wxListView(this, wxID_FILEMANAGER, wxDefaultPosition, wxSize(350, 350), wxLC_REPORT, wxDefaultValidator, wxT(""));
155
157
fileManager->AssignImageList(icons, wxIMAGE_LIST_SMALL);
156
158
//fileManager->Show(false);
157
fileManager->InsertColumn(0, _("name"));
158
fileManager->InsertColumn(1, _("size (bytes)"));
159
fileManager->InsertColumn(2, _("permissions"));
159
fileManager->InsertColumn(0, wxT("Name"));
160
fileManager->InsertColumn(1, wxT("Size (bytes)"));
161
fileManager->InsertColumn(2, wxT("Permissions"));
161
163
siteList = new wxListView(this, wxID_SITELIST, wxDefaultPosition, wxSize(200, 215), wxLC_REPORT | wxLC_NO_HEADER, wxDefaultValidator, wxT(""));
162
164
siteList->InsertColumn(0, wxT(""));
164
connectionSizer->Add(new wxStaticText(this, -1, _("Name:"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT, wxT("")));
166
connectionSizer->Add(new wxStaticText(this, -1, wxT("Name:"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT, wxT("")));
165
167
connectionSizer->Add(txtFtpName);
166
connectionSizer->Add(new wxStaticText(this, -1, _("Host:"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT, wxT("")));
168
connectionSizer->Add(new wxStaticText(this, -1, wxT("Host:"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT, wxT("")));
167
169
connectionSizer->Add(txtFtpHost);
168
connectionSizer->Add(new wxStaticText(this, -1, _("Username:"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT, wxT("")));
170
connectionSizer->Add(new wxStaticText(this, -1, wxT("Username:"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT, wxT("")));
169
171
connectionSizer->Add(txtFtpUser);
170
connectionSizer->Add(new wxStaticText(this, -1, _("Password:"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT, wxT("")));
172
connectionSizer->Add(new wxStaticText(this, -1, wxT("Password:"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT, wxT("")));
171
173
connectionSizer->Add(txtFtpPass);
172
174
connectionSizer->Add(btnConnect, 0, wxALIGN_LEFT | wxALL, 5);
173
175
connectionSizer->Add(btnDisconnect, 0, wxALIGN_LEFT | wxALL, 5);
386
391
listIndex = event.m_itemIndex;
388
393
wxMenu *menu = new wxMenu();
389
wxMenuItem *del = new wxMenuItem(menu, wxID_POPUP_DELETE, _("Delete"), _("Delete file(s) from server"));
390
wxMenuItem *rn = new wxMenuItem(menu, wxID_POPUP_RENAME, _("Rename"), _("Rename file"));
391
wxMenuItem *dl = new wxMenuItem(menu, wxID_POPUP_DOWNLOAD, _("Download"), _("Download this file(s) to your computer"));
394
wxMenuItem *del = new wxMenuItem(menu, wxID_POPUP_DELETE, wxT("Delete"), wxT("Delete file(s) from server"));
395
wxMenuItem *rn = new wxMenuItem(menu, wxID_POPUP_RENAME, wxT("Rename"), wxT("Rename file"));
396
wxMenuItem *dl = new wxMenuItem(menu, wxID_POPUP_DOWNLOAD, wxT("Download"), wxT("Download this file(s) to your computer"));
393
398
wxMenuItem *sep = new wxMenuItem(menu, -1, wxT(""), wxT(""));
1215
wxDirDialog *saveDir = new wxDirDialog(this, _("Download Folder"), wxT(""));
1216
int result = saveDir->ShowModal();
1220
wxDirDialog saveDir(this, wxT("Download Folder"), wxT(""));
1221
int result = saveDir.ShowModal();
1218
1223
if (result == wxID_OK)
1219
DownloadDir(src, saveDir->GetPath());
1224
DownloadDir(src, saveDir.GetPath());
1225
wxFileDialog *saveFile = new wxFileDialog(this, _("Download File"), wxT(""), src, _("All Files (*.*)|*.*"), wxSAVE);
1226
int result = saveFile->ShowModal();
1230
FileDialog saveFile(this, wxT("Download File"), wxT(""), src, wxT("All files (*.*)|*.*"), wxSAVE);
1231
int result = saveFile.ShowModal();
1228
1233
if (result == wxID_OK)
1229
DownloadFile(src, saveFile->GetPath());
1234
DownloadFile(src, saveFile.GetPath());