MCPcopy Create free account
hub / github.com/XorTroll/Goldleaf / PromptDeleteFile

Method PromptDeleteFile

Goldleaf/source/ui/ui_BrowserLayout.cpp:768–783  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

766 }
767
768 void BrowserLayout::PromptDeleteFile(const std::string &path) {
769 if(this->CheckWriteAccess()) {
770 const auto option = g_MainApplication->DisplayDialog(cfg::Strings.GetString(127), cfg::Strings.GetString(128), { cfg::Strings.GetString(111), cfg::Strings.GetString(18) }, true);
771 if(option < 0) {
772 return;
773 }
774
775 this->cur_exp->DeleteFile(path);
776 g_MainApplication->ShowNotification(cfg::Strings.GetString(129));
777 auto tmp_idx = this->browse_menu->GetSelectedIndex();
778 if(tmp_idx > 0) {
779 tmp_idx--;
780 }
781 this->UpdateElements(tmp_idx);
782 }
783 }
784
785 bool BrowserLayout::GoBack() {
786 return this->cur_exp->NavigateBack();

Callers 2

OnFileSelectedMethod · 0.95
StartInstallMethod · 0.80

Calls 5

CheckWriteAccessMethod · 0.95
UpdateElementsMethod · 0.95
DisplayDialogMethod · 0.80
ShowNotificationMethod · 0.80
DeleteFileMethod · 0.45

Tested by

no test coverage detected