protected override void RemoveSelected() { if (Project != null) { var msg = Catalog.GetString("You are about to delete a category and all the plays added to this category. Do you want to proceed?"); if (MessagesHelpers.QuestionMessage(this, msg)) { try { foreach (var cat in selected) { Project.RemoveCategory(cat); } } catch { MessagesHelpers.WarningMessage(this, Catalog.GetString("A template needs at least one category")); } } } else { foreach (Category cat in selected) { if (template.Count == 1) { MessagesHelpers.WarningMessage(this, Catalog.GetString("A template needs at least one category")); } else { template.Remove(cat); } } } base.RemoveSelected(); }
protected override void RemoveSelected() { if (Project != null) { var msg = Catalog.GetString("You are about to delete a player and all " + "its tags. Do you want to proceed?"); if (MessagesHelpers.QuestionMessage(this, msg)) { try { foreach (var player in selected) { Project.RemovePlayer(template, player); } } catch { MessagesHelpers.WarningMessage(this, Catalog.GetString("A template needs at least one category")); } } } else { try { foreach (var player in selected) { Template.Remove(player); } } catch { MessagesHelpers.WarningMessage(this, Catalog.GetString("A template needs at least one category")); } } base.RemoveSelected(); }
protected virtual void OnDeleteButtonPressed(object sender, System.EventArgs e) { List <ProjectDescription> deletedProjects = new List <ProjectDescription>(); if (selectedProjects == null) { return; } foreach (ProjectDescription selectedProject in selectedProjects) { if (openedProject != null && selectedProject.File.FilePath == openedProject.Description.File.FilePath) { MessagesHelpers.WarningMessage(this, Catalog.GetString("This Project is actually in use.") + "\n" + Catalog.GetString("Close it first to allow its removal from the database")); continue; } var msg = Catalog.GetString("Do you really want to delete:") + "\n" + selectedProject.Title; if (MessagesHelpers.QuestionMessage(this, msg)) { DB.RemoveProject(selectedProject.UUID); deletedProjects.Add(selectedProject); } } projectlistwidget1.RemoveProjects(deletedProjects); Clear(); }
void HandleDeleteTeamClicked(object sender, EventArgs e) { if (loadedTeam != null) { if (loadedTeam.Static) { string msg = Catalog.GetString("System teams can't be deleted"); MessagesHelpers.WarningMessage(this, msg); return; } else { string msg = Catalog.GetString("Do you really want to delete the template: ") + loadedTeam.Name; if (MessagesHelpers.QuestionMessage(this, msg, null)) { provider.Delete(loadedTeam.Name); teams.Remove(ref selectedIter); templatesNames.Remove(loadedTeam.Name); selectedIter = TreeIter.Zero; teamseditortreeview.Selection.SelectPath(new TreePath("0")); HandleSelectionChanged(null, null); } } } }
public void WarningMessage(string message, object parent = null) { if (parent == null) { parent = mainWindow as Widget; } MessagesHelpers.WarningMessage(parent as Widget, message); }
protected virtual void OnHotKeyChanged(HotKey prevHotKey, Category category) { if (hkList.Contains(category.HotKey)) { MessagesHelpers.WarningMessage(this, Catalog.GetString("This hotkey is already in use.")); category.HotKey = prevHotKey; timenodeproperties2.Category = category; //Update Gui } else if (category.HotKey.Defined) { hkList.Remove(prevHotKey); hkList.Add(category.HotKey); } }
protected virtual void OnProjectlistwidget1ProjectsSelected(List <ProjectDescription> projects) { ProjectDescription project; /* prompt tp save the opened project if has changes */ if (projectdetails.Edited) { PromptToSaveEditedProject(); } selectedProjects = projects; /* if no projects are selected clear everything */ if (projects.Count == 0) { Clear(); return; /* if more than one project is selected clear everything but keep * the delete button and the export button sensitives */ } else if (projects.Count > 1) { Clear(); deleteButton.Sensitive = true; exportbutton.Sensitive = true; return; } /* if only one project is selected try to load it in the editor */ project = projects[0]; if (openedProject != null && project.File.FilePath == openedProject.Description.File.FilePath) { MessagesHelpers.WarningMessage(this, Catalog.GetString("The Project you are trying to load is actually in use.") + "\n" + Catalog.GetString("Close it first to edit it")); Clear(); } else { projectdetails.Sensitive = true; projectdetails.SetProject(DB.GetProject(project.UUID)); saveButton.Sensitive = false; deleteButton.Sensitive = true; exportbutton.Sensitive = true; } }
void DeviceChanged(int deviceID) { string msg; /* device disconnected, pause capture */ if (deviceID == -1) { PausePeriod(); msg = Catalog.GetString("Device disconnected. " + "The capture will be paused"); MessagesHelpers.WarningMessage(this, msg); } else { msg = Catalog.GetString("Device reconnected. " + "Do you want to restart the capture?"); if (MessagesHelpers.QuestionMessage(this, msg, null)) { ResumePeriod(); } } }
void HandleDeleteClicked(object sender, EventArgs e) { List <ProjectDescription> deletedProjects; if (selectedProjects == null) { return; } deletedProjects = new List <ProjectDescription> (); foreach (ProjectDescription selectedProject in selectedProjects) { if (openedProject != null && openedProject.ID == selectedProject.ProjectID) { MessagesHelpers.WarningMessage(this, Catalog.GetString("This Project is actually in use.") + "\n" + Catalog.GetString("Close it first to allow its removal from the database")); continue; } string msg = Catalog.GetString("Do you really want to delete:") + "\n" + selectedProject.Title; if (MessagesHelpers.QuestionMessage(this, msg)) { // Unload first if (loadedProject != null && loadedProject.ID == selectedProject.ProjectID) { loadedProject = null; } DB.RemoveProject(selectedProject.ProjectID); deletedProjects.Add(selectedProject); } } projectlistwidget1.RemoveProjects(deletedProjects); // In the case where there are no projects left we need to clear the project desc widget if (DB.GetAllProjects().Count == 0) { rbox.Visible = false; } }
public void WarningMessage(string message, object parent = null) { MessagesHelpers.WarningMessage(GetParentWidget(parent), message); }