reapack

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

commit da7e5df2c5ee703b1da06cb97d9f0d767b8eec4a
parent 9b95782bda63188d6c5851254affcd38b995052c
Author: cfillion <cfillion@users.noreply.github.com>
Date:   Tue, 20 Jun 2017 18:27:26 -0400

Revert "api: add tab parameter to About* functions"

This reverts commit ae05b4645224af99f9ff0b53e0a97790e65641dd.

Diffstat:
Msrc/about.cpp | 9---------
Msrc/about.hpp | 1-
Msrc/api.cpp | 22+++++++---------------
Msrc/reapack.cpp | 9+++------
Msrc/reapack.hpp | 2+-
5 files changed, 11 insertions(+), 32 deletions(-)

diff --git a/src/about.cpp b/src/about.cpp @@ -236,15 +236,6 @@ void About::setAction(const string &label) show(btn); } -void About::setTab(const int tab) -{ - // FIXME: Remove hard-coded maximum tab count - const int firstTab = 3 - m_tabs->count(); - assert(firstTab >= 0); - if(tab >= firstTab) - m_tabs->setCurrentIndex(tab - firstTab); -} - void About::selectLink(const int ctrl) { const auto &links = m_links[ctrl]; diff --git a/src/about.hpp b/src/about.hpp @@ -50,7 +50,6 @@ public: void setTitle(const std::string &); void setMetadata(const Metadata *, bool substitution = false); void setAction(const std::string &); - void setTab(int tab); ReaPack *reapack() const { return m_reapack; } TabBar *tabs() const { return m_tabs; } diff --git a/src/api.cpp b/src/api.cpp @@ -109,11 +109,9 @@ void APIDef::unregister(const char *key, void *ptr) "APIdef_" API_PREFIX #name, (void *)API_##name::definition, \ } -DEFINE_API(bool, AboutInstalledPackage, ((PackageEntry*, entry))((int, tab)), +DEFINE_API(bool, AboutInstalledPackage, ((PackageEntry*, entry)), R"(Show the about dialog of the given package entry. -The repository index is downloaded asynchronously if the cached copy doesn't exist or is older than one week. - -tab: 0=about (if available), 1=history, 2=contents)", +The repository index is downloaded asynchronously if the cached copy doesn't exist or is older than one week.)", { if(!s_entries.count(entry)) return false; @@ -138,26 +136,20 @@ tab: 0=about (if available), 1=history, 2=contents)", return; const Package *pkg = indexes.front()->find(entryCopy.category, entryCopy.package); - if(!pkg) - return; - - About *about = reapack->about(); - about->setDelegate(make_shared<AboutPackageDelegate>(pkg, entryCopy.version)); - about->setTab(tab); + if(pkg) + reapack->about()->setDelegate(make_shared<AboutPackageDelegate>(pkg, entryCopy.version)); }); tx->runTasks(); return true; }); -DEFINE_API(bool, AboutRepository, ((const char*, repoName))((int, tab)), +DEFINE_API(bool, AboutRepository, ((const char*, repoName)), R"(Show the about dialog of the given repository. Returns true if the repository exists in the user configuration. -The repository index is downloaded asynchronously if the cached copy doesn't exist or is older than one week. - -tab: 0=about (if available), 1=packages, 2=installed files)", +The repository index is downloaded asynchronously if the cached copy doesn't exist or is older than one week.)", { if(const Remote &repo = reapack->remote(repoName)) { - reapack->about(repo, tab); + reapack->about(repo); return true; } diff --git a/src/reapack.cpp b/src/reapack.cpp @@ -227,7 +227,7 @@ Remote ReaPack::remote(const string &name) const return m_config->remotes.get(name); } -void ReaPack::about(const Remote &repo, const int tab) +void ReaPack::about(const Remote &repo) { Transaction *tx = setupTransaction(); if(!tx) @@ -238,11 +238,8 @@ void ReaPack::about(const Remote &repo, const int tab) tx->fetchIndexes(repos); tx->onFinish([=] { const auto &indexes = tx->getIndexes(repos); - if(!indexes.empty()) { - About *dlg = about(); - dlg->setDelegate(make_shared<AboutIndexDelegate>(indexes.front())); - dlg->setTab(tab); - } + if(!indexes.empty()) + about()->setDelegate(make_shared<AboutIndexDelegate>(indexes.front())); }); tx->runTasks(); } diff --git a/src/reapack.hpp b/src/reapack.hpp @@ -69,7 +69,7 @@ public: void importRemote(); void manageRemotes(); void aboutSelf(); - void about(const Remote &, int tab = -1); + void about(const Remote &); About *about(bool instantiate = true); Browser *browsePackages(); void refreshManager();