public RemoteRepositoryController(LocalRepository repo) : base(repo) { HttpEncoder.Current = HttpEncoder.Default; connection = new S3Connection (); physicalController = new PhysicalRepositoryController (repo); }
private void loadSelectiveSyncCheckboxes() { foreach (System.Windows.Forms.CheckBox check in remoteFoldersCheckboxes) { this.Controls.Remove(check); } remoteFoldersCheckboxes.Clear(); List<RepositoryItem> remoteItems = new RemoteRepositoryController(null).RootFolders; List<RepositoryItem> localItems = new PhysicalRepositoryController(repoDao.MainActive).RootFolders; List<RepositoryItem> totalItems = new List<RepositoryItem>(); totalItems = remoteItems; foreach (RepositoryItem i in localItems) { if (!remoteItems.Contains(i)) { totalItems.Add(i); } } ignoreFolders = repoIgnore.All(repoDao.RootRepo()); foreach (RepositoryItem item in totalItems) { this.checkedListBox1.Items.Add(item.Key, !ignoreFolders.Any(i => i.Path.Equals(item.Key))); } backgroundWorker1.RunWorkerAsync(); }
//Helpers private void loadFolders() { foreach (NSView view in foldersView.Subviews) { view.RemoveFromSuperview (); } remoteFoldersCheckboxes = new List<NSButton> (); List<RepositoryItem> remoteItems = new RemoteRepositoryController (null).RootFolders; List<RepositoryItem> localItems = new PhysicalRepositoryController (repoDao.MainActive).RootFolders; List<RepositoryItem> totalItems = remoteItems; for (int i = 0; i < localItems.Count; i++) { if (!remoteItems.Contains (localItems [i])) { totalItems.Add (localItems [i]); } } ignoreFolders = repoIgnore.All (repoDao.RootRepo ()); for (int i = 0; i <totalItems.Count; i++) { NSButton chk = new NSButton () { Frame = new RectangleF (5, 256 - ((remoteFoldersCheckboxes.Count + 1) * 17), 300, 18), Title = remoteItems[i].Key, StringValue = remoteItems[i].Key }; chk.SetButtonType(NSButtonType.Switch); if(ignoreFolders.Any(j => j.Path.Equals(totalItems[i].Key))) chk.State = NSCellStateValue.Off; else chk.State = NSCellStateValue.On; remoteFoldersCheckboxes.Add (chk); foldersView.AddSubview (chk); } }
public void MoveSQFolder(string pathTo) { SQLiteRepositoryDAO repoDao = new SQLiteRepositoryDAO(); LocalRepository repo = repoDao.RootRepo(); PhysicalRepositoryController controller = new PhysicalRepositoryController(repo); KillSynchronizers(); controller.MoveDir(repo.Path, pathTo); repo.Path = pathTo; repoDao.Update(repo); InitializeSynchronizers(false); Program.Controller.Alert("SQFolder moved to "+ pathTo); }
public void UnlinkAccount() { KillSynchronizers(); PhysicalRepositoryController controller = new PhysicalRepositoryController(null); controller.DeleteDir(new DirectoryInfo(RuntimeSettings.ConfigPath)); Alert("Your account are now unlinked, you can run QloudSync again to login with your accout or a new one."); Quit(); }
void InitializeCheckboxesFolders() { remoteFoldersCheckboxes = new List<NSButton> (); List<RepositoryItem> remoteItems = new RemoteRepositoryController (null).RootFolders; List<RepositoryItem> localItems = new PhysicalRepositoryController (new LocalRepository(this.SQFolderText.StringValue, "", true, true)).RootFolders; foreach (RepositoryItem item in remoteItems) { NSButton chk = new NSButton () { Frame = new RectangleF (82, Frame.Height - 100 - ((remoteFoldersCheckboxes.Count + 1) * 17), 300, 18), Title = item.Key }; chk.SetButtonType(NSButtonType.Switch); chk.State = NSCellStateValue.On; remoteFoldersCheckboxes.Add (chk); } foreach (RepositoryItem item in localItems) { if (!remoteItems.Contains (item)) { NSButton chk = new NSButton () { Frame = new RectangleF (82, Frame.Height - 100 - ((remoteFoldersCheckboxes.Count + 1) * 17), 300, 18), Title = item.Key }; chk.SetButtonType (NSButtonType.Switch); chk.State = NSCellStateValue.On; remoteFoldersCheckboxes.Add (chk); } } foreach (NSButton chk in remoteFoldersCheckboxes) { ContentView.AddSubview (chk); } }
private void InitializeComponentCheckboxesFolders() { foreach (System.Windows.Forms.CheckBox check in remoteFoldersCheckboxes) { this.Controls.Remove(check); } remoteFoldersCheckboxes.Clear(); // // CheckBoxes // List<RepositoryItem> remoteItems = new RemoteRepositoryController(null).RootFolders; List<RepositoryItem> localItems = new PhysicalRepositoryController(new LocalRepository(label2.Text, "", true, true)).RootFolders; List<RepositoryItem> totalItems = new List<RepositoryItem>(); totalItems = remoteItems; foreach (RepositoryItem i in localItems) { if (!remoteItems.Contains(i)) { totalItems.Add(i); } } foreach (RepositoryItem item in totalItems) { System.Windows.Forms.CheckBox checkBox1 = new System.Windows.Forms.CheckBox(); checkBox1.BackColor = System.Drawing.Color.Transparent; checkBox1.Checked = true; checkBox1.CheckState = System.Windows.Forms.CheckState.Checked; checkBox1.Location = new System.Drawing.Point(82, 100 + ((remoteFoldersCheckboxes.Count + 1) * 17)); checkBox1.Name = "checkBox1"; checkBox1.Size = new System.Drawing.Size(250, 17); checkBox1.TabIndex = 17; checkBox1.Text = item.Key; checkBox1.UseVisualStyleBackColor = false; remoteFoldersCheckboxes.Add(checkBox1); } foreach (CheckBox item in remoteFoldersCheckboxes) { this.Controls.Add(item); } }