From 57284e7c3548cf2eb50c5218962872e508fa402e Mon Sep 17 00:00:00 2001 From: Marc Sturm Date: Tue, 7 Nov 2023 10:42:43 +0100 Subject: [PATCH] GSvar: added menu entry to delete IGV folder --- src/GSvar/MainWindow.cpp | 21 ++++++++++++++++++++- src/GSvar/MainWindow.h | 2 ++ src/GSvar/MainWindow.ui | 9 +++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/GSvar/MainWindow.cpp b/src/GSvar/MainWindow.cpp index 4eba2e9eb..cff877f88 100644 --- a/src/GSvar/MainWindow.cpp +++ b/src/GSvar/MainWindow.cpp @@ -1,6 +1,7 @@ #include "MainWindow.h" #include #include +#include #include "Settings.h" #include "Exceptions.h" #include "ChromosomalIndex.h" @@ -1770,7 +1771,25 @@ void MainWindow::on_actionIgvClear_triggered() void MainWindow::on_actionIgvDocumentation_triggered() { - QDesktopServices::openUrl(QUrl("https://software.broadinstitute.org/software/igv/UserGuide")); + QDesktopServices::openUrl(QUrl("https://igv.org/doc/desktop/#UserGuide/reference_genome/")); +} + +void MainWindow::on_actionDeleteIgvFolder_triggered() +{ + QString title = "Delete IGV folder"; + QString path = QStandardPaths::standardLocations(QStandardPaths::HomeLocation).at(0) + QDir::separator() + "igv" + QDir::separator(); + QString path_canonical = QFileInfo(path).canonicalFilePath(); + if(path_canonical.isEmpty()) + { + QMessageBox::information(this, title, "IGV folder does not exist:\n" + path); + return; + } + + int res = QMessageBox::question(this, "Delete IGV folder", "Do you want to delete the IGV folder?\nLocation: "+path_canonical+"\n\nYou will use all settings (proxy, alignment options, ...)!"); + if (res==QMessageBox::Yes) + { + QDir(path_canonical).removeRecursively(); + } } void MainWindow::on_actionSV_triggered() diff --git a/src/GSvar/MainWindow.h b/src/GSvar/MainWindow.h index fce765913..f33e3ea8b 100644 --- a/src/GSvar/MainWindow.h +++ b/src/GSvar/MainWindow.h @@ -205,6 +205,8 @@ public slots: void on_actionIgvClear_triggered(); ///Open IGV documentation in browser void on_actionIgvDocumentation_triggered(); + ///Delete IGV folder + void on_actionDeleteIgvFolder_triggered(); ///Open CNV dialog void on_actionCNV_triggered(); ///Open ROH dialog diff --git a/src/GSvar/MainWindow.ui b/src/GSvar/MainWindow.ui index 9f3d691db..30ba2b494 100644 --- a/src/GSvar/MainWindow.ui +++ b/src/GSvar/MainWindow.ui @@ -437,8 +437,12 @@ Open custom track + + + + @@ -1458,6 +1462,11 @@ Settings + + + Delete IGV folder + +