Skip to content

Commit

Permalink
v0.5-alpha : open in finder
Browse files Browse the repository at this point in the history
  • Loading branch information
Amr Osman authored and Amr Osman committed Nov 13, 2018
1 parent bc72e55 commit 5ab4d11
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ bool Kernel::Unmount(bool silent)
return isMounted;
}

void Kernel::OpenFinder()
{
QDesktopServices::openUrl(QUrl::fromLocalFile(settings.options.mount_point));
}

void Kernel::Settings()
{
QDesktopServices::openUrl(QUrl::fromLocalFile(settings.fileName()));
Expand Down
1 change: 1 addition & 0 deletions kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Kernel : public QObject
public slots:
void Mount();
bool Unmount(bool silent=false);
void OpenFinder();
void Settings();
void Quit()__attribute__((noreturn));
void onNetworkStateChanged(QNetworkSession::State state);
Expand Down
3 changes: 3 additions & 0 deletions menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Menu::Menu(Kernel &kernel, QWidget *parent):QMenu(parent),_kernel(&kernel)
{
addAction("Mount",&kernel,SLOT(Mount()));
addAction("Open in Finder",&kernel,SLOT(OpenFinder()));
addAction("UnMount",&kernel,SLOT(Unmount()));
addAction("Settings",&kernel,SLOT(Settings()));
addSeparator();
Expand All @@ -28,12 +29,14 @@ void Menu::showMountOnly()
{
actions().at(0)->setVisible(true);
actions().at(1)->setVisible(false);
actions().at(2)->setVisible(false);
}

void Menu::showUnmountOnly()
{
actions().at(0)->setVisible(false);
actions().at(1)->setVisible(true);
actions().at(2)->setVisible(true);
}

void Menu::toggleUi()
Expand Down

0 comments on commit 5ab4d11

Please sign in to comment.