reapack

Package manager for REAPER
Log | Files | Refs | Submodules | README | LICENSE

commit 169196d86b0b6b3b27eb3322617495ec38d1fa4c
parent 0b659e37398f0a99b67d94ffa59f2476f6f06ecf
Author: cfillion <cfillion@users.noreply.github.com>
Date:   Sun,  4 Jun 2017 03:51:45 -0400

Revert "api: create ImportRepository function"

This reverts commit 0b659e37398f0a99b67d94ffa59f2476f6f06ecf.

Diffstat:
Msrc/api.cpp | 6------
Msrc/api.hpp | 1-
Msrc/import.cpp | 7++-----
Msrc/import.hpp | 3+--
Msrc/main.cpp | 3+--
Msrc/manager.cpp | 4++--
Msrc/manager.hpp | 2+-
Msrc/reapack.cpp | 4++--
Msrc/reapack.hpp | 2+-
9 files changed, 10 insertions(+), 22 deletions(-)

diff --git a/src/api.cpp b/src/api.cpp @@ -295,9 +295,3 @@ DEFINE_API(PackageEntry*, GetOwner, ((const char*, fn))((char*, errorOut))((int, return nullptr; } }); - -DEFINE_API(void, ImportRepository, ((const char*, url)), R"( - Opens the "Import a repository" dialog with the input box pre-filled with given url. -)", { - reapack->importRemote(url); -}); diff --git a/src/api.hpp b/src/api.hpp @@ -53,7 +53,6 @@ namespace API { extern APIFunc FreeEntry; extern APIFunc GetEntryInfo; extern APIFunc GetOwner; - extern APIFunc ImportRepository; }; #endif diff --git a/src/import.cpp b/src/import.cpp @@ -34,9 +34,8 @@ using namespace std; static const auto_char *TITLE = AUTO_STR("ReaPack: Import a repository"); static const string DISCOVER_URL = "https://reapack.com/repos"; -Import::Import(const string &initialUrl, ReaPack *reapack) - : Dialog(IDD_IMPORT_DIALOG), m_initialUrl(initialUrl), - m_reapack(reapack), m_download(nullptr) +Import::Import(ReaPack *reapack) + : Dialog(IDD_IMPORT_DIALOG), m_reapack(reapack), m_download(nullptr) { } @@ -51,8 +50,6 @@ void Import::onInit() m_discover = getControl(IDC_DISCOVER); m_ok = getControl(IDOK); - SetWindowText(m_url, make_autostring(m_initialUrl).c_str()); - #ifdef PBM_SETMARQUEE SendMessage(m_progress, PBM_SETMARQUEE, 1, 0); #endif diff --git a/src/import.hpp b/src/import.hpp @@ -31,7 +31,7 @@ class Remote; class Import : public Dialog { public: - Import(const std::string &initialUrl, ReaPack *); + Import(ReaPack *); protected: void onInit() override; @@ -44,7 +44,6 @@ private: bool import(const Remote &); void setWaiting(bool); - std::string m_initialUrl; ReaPack *m_reapack; MemoryDownload *m_download; short m_fakePos; diff --git a/src/main.cpp b/src/main.cpp @@ -150,7 +150,7 @@ static void setupActions() &reapack->browseAction, bind(&ReaPack::browsePackages, reapack)); reapack->setupAction("REAPACK_IMPORT", "ReaPack: Import a repository...", - &reapack->importAction, bind(&ReaPack::importRemote, reapack, "")); + &reapack->importAction, bind(&ReaPack::importRemote, reapack)); reapack->setupAction("REAPACK_MANAGE", "ReaPack: Manage repositories...", &reapack->configAction, bind(&ReaPack::manageRemotes, reapack)); @@ -168,7 +168,6 @@ static void setupAPI() reapack->setupAPI(&API::FreeEntry); reapack->setupAPI(&API::GetEntryInfo); reapack->setupAPI(&API::GetOwner); - reapack->setupAPI(&API::ImportRepository); } extern "C" REAPER_PLUGIN_DLL_EXPORT int REAPER_PLUGIN_ENTRYPOINT( diff --git a/src/manager.cpp b/src/manager.cpp @@ -470,13 +470,13 @@ void Manager::importExport() menu.show(getControl(IDC_IMPORT), handle()); } -bool Manager::importRepo(const string &url) +bool Manager::importRepo() { if(m_importing) // avoid opening the import dialog twice on windows return true; m_importing = true; - const auto ret = Dialog::Show<Import>(instance(), handle(), url, m_reapack); + const auto ret = Dialog::Show<Import>(instance(), handle(), m_reapack); m_importing = false; return ret != 0; diff --git a/src/manager.hpp b/src/manager.hpp @@ -39,7 +39,7 @@ public: Manager(ReaPack *); void refresh(); - bool importRepo(const std::string &url = {}); + bool importRepo(); protected: void onInit() override; diff --git a/src/reapack.cpp b/src/reapack.cpp @@ -200,13 +200,13 @@ void ReaPack::uninstall(const Remote &remote) }); } -void ReaPack::importRemote(const string &url) +void ReaPack::importRemote() { const bool autoClose = m_manager == nullptr; manageRemotes(); - if(!m_manager->importRepo(url) && autoClose) + if(!m_manager->importRepo() && autoClose) m_manager->close(); } diff --git a/src/reapack.hpp b/src/reapack.hpp @@ -66,7 +66,7 @@ public: void enable(const Remote &r) { setRemoteEnabled(true, r); } void uninstall(const Remote &); - void importRemote(const std::string &url = {}); + void importRemote(); void manageRemotes(); void aboutSelf(); void about(const Remote &);