Skip to content

Commit

Permalink
GSvar: added menu entry to delete IGV folder
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-sturm committed Nov 7, 2023
1 parent 35eead6 commit 57284e7
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/GSvar/MainWindow.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "MainWindow.h"
#include <QFileDialog>
#include <QMessageBox>
#include <QStandardPaths>
#include "Settings.h"
#include "Exceptions.h"
#include "ChromosomalIndex.h"
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions src/GSvar/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions src/GSvar/MainWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,12 @@
<string>Open custom track</string>
</property>
</widget>
<addaction name="actionIgvDocumentation"/>
<addaction name="separator"/>
<addaction name="actionIgvClear"/>
<addaction name="menuOpenCustomTrack"/>
<addaction name="separator"/>
<addaction name="actionDeleteIgvFolder"/>
</widget>
<widget class="QMenu" name="menuVariants">
<property name="title">
Expand Down Expand Up @@ -1458,6 +1462,11 @@
<string>Settings</string>
</property>
</action>
<action name="actionDeleteIgvFolder">
<property name="text">
<string>Delete IGV folder</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
Expand Down

0 comments on commit 57284e7

Please sign in to comment.