void PHPWorkspaceView::OnToggleAutoUpload(wxCommandEvent& e) { SSHWorkspaceSettings settings; settings.Load(); settings.EnableRemoteUpload(e.IsChecked()); settings.Save(); }
void PHPWorkspaceView::DoOpenSSHAccountManager() { SSHWorkspaceSettings settings; settings.Load(); SFTPBrowserDlg dlg(EventNotifier::Get()->TopFrame(), _("Select the remote folder corrseponding to the current workspace file"), "", clSFTP::SFTP_BROWSE_FOLDERS); // Browse for folders only dlg.Initialize(settings.GetAccount(), settings.GetRemoteFolder()); if(dlg.ShowModal() == wxID_OK) { settings.SetAccount(dlg.GetAccount()); settings.SetRemoteFolder(dlg.GetPath()); settings.Save(); } }
bool PhpSFTPHandler::EnsureAccountExists(SSHWorkspaceSettings& workspaceSettings) { // Do we need to sync? if(!(workspaceSettings.IsRemoteUploadSet() && workspaceSettings.IsRemoteUploadEnabled())) { return false; } SFTPSettings sftpSettings; sftpSettings.Load(); // Try to locate hte SSH account for this workspace SSHAccountInfo account; if(!sftpSettings.GetAccount(workspaceSettings.GetAccount(), account)) { // Failed to locate the SSH account, disable sync wxString msg; msg << _("Failed to locate SSH account: ") << workspaceSettings.GetAccount() << "\n"; ::wxMessageBox(msg, _("SFTP"), wxOK | wxICON_ERROR); // Clear the sync settings and return workspaceSettings.Reset(); workspaceSettings.Save(); return false; } return true; }