Browse Source

Use correct ShellExecute verb for system::openFolder() on Windows.

tags/v1.0.0
Andrew Belt 5 years ago
parent
commit
c8d495dfe3
2 changed files with 9 additions and 7 deletions
  1. +7
    -5
      src/app/MenuBar.cpp
  2. +2
    -2
      src/system.cpp

+ 7
- 5
src/app/MenuBar.cpp View File

@@ -54,7 +54,7 @@ struct NotificationIcon : widget::Widget {
struct UrlItem : ui::MenuItem {
std::string url;
void onAction(const event::Action &e) override {
std::thread t([=]() {
std::thread t([=] {
system::openBrowser(url);
});
t.detach();
@@ -490,7 +490,7 @@ struct LogInItem : ui::MenuItem {
isLoggingIn = true;
std::string email = emailField->text;
std::string password = passwordField->text;
std::thread t([=]() {
std::thread t([=] {
plugin::logIn(email, password);
isLoggingIn = false;
});
@@ -526,7 +526,7 @@ struct SyncItem : ui::MenuItem {
}

void onAction(const event::Action &e) override {
std::thread t([=]() {
std::thread t([=] {
plugin::syncUpdates();
});
t.detach();
@@ -574,7 +574,7 @@ struct PluginSyncItem : ui::MenuItem {
}

void onAction(const event::Action &e) override {
std::thread t([=]() {
std::thread t([=] {
plugin::syncUpdate(update);
});
t.detach();
@@ -702,7 +702,9 @@ struct LibraryButton : MenuButton {

struct UserFolderItem : ui::MenuItem {
void onAction(const event::Action &e) override {
std::thread t(system::openFolder, asset::user(""));
std::thread t([] {
system::openFolder(asset::user(""));
});
t.detach();
}
};


+ 2
- 2
src/system.cpp View File

@@ -191,7 +191,7 @@ void openBrowser(const std::string &url) {
#endif
#if defined ARCH_WIN
std::wstring urlW = string::toWstring(url);
ShellExecuteW(NULL, L"open", urlW.c_str(), NULL, NULL, SW_SHOWNORMAL);
ShellExecuteW(NULL, L"open", urlW.c_str(), NULL, NULL, SW_SHOWDEFAULT);
#endif
}

@@ -202,7 +202,7 @@ void openFolder(const std::string &path) {
#endif
#if defined ARCH_WIN
std::wstring pathW = string::toWstring(path);
ShellExecuteW(NULL, L"explorer", pathW.c_str(), NULL, NULL, SW_SHOWNORMAL);
ShellExecuteW(NULL, L"explore", pathW.c_str(), NULL, NULL, SW_SHOWDEFAULT);
#endif
}



Loading…
Cancel
Save