/// <summary> /// Handles a click event on the Chorus Hub button /// (Shared folder mode is used for only testing purposes) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _useLocalNetworkButton_Click(object sender, EventArgs e) { if (RepositoryChosen != null) { RepositoryAddress address; if (_lanMode == LANMode.Folder) // used for only testing { address = _repository.GetDefaultNetworkAddress <DirectoryRepositorySource>(); } else // if (_lanMode == LANMode.ChorusHub) { Cursor.Current = Cursors.WaitCursor; string directoryName = Path.GetFileName(_repository.PathToRepo); var doWait = _chorusHubClient.PrepareHubToSync(directoryName, _repository.Identifier); if (doWait) { // TODO: show indeterminate progress bar for this wait Thread.Sleep(WAIT_CREATE_CH_REPO); } address = new ChorusHubRepositorySource(_chorusHubServerInfo.HostName, _chorusHubServerInfo.GetHgHttpUri(RepositoryAddress.ProjectNameVariable), false, _chorusHubClient.GetRepositoryInformation(null)); Cursor.Current = Cursors.Default; } RepositoryChosen.Invoke(this, new SyncStartArgs(address, _commitMessageText.Text)); } }
private void _useUSBButton_Click(object sender, EventArgs e) { if (RepositoryChosen != null) { var address = RepositoryAddress.Create(RepositoryAddress.HardWiredSources.UsbKey, "USB flash drive", false); RepositoryChosen.Invoke(this, new SyncStartArgs(address, _commitMessageText.Text)); } }
private void _useInternetButton_Click(object sender, EventArgs e) { if (RepositoryChosen != null) { var address = _repository.GetDefaultNetworkAddress <HttpRepositoryPath>(); RepositoryChosen.Invoke(this, new SyncStartArgs(address, _commitMessageText.Text)); } }
private void _useInternetButton_Click(object sender, EventArgs e) { if (RepositoryChosen != null) { _repository.RemoveCredentialsFromIniIfNecessary(); var address = _repository.GetDefaultNetworkAddress <HttpRepositoryPath>(); // ENHANCE (Hasso) 2021.04: prompt here for the password if the user has opted not to save it (https://jira.sil.org/browse/LT-20549) RepositoryChosen.Invoke(this, new SyncStartArgs(address, _commitMessageText.Text)); } }