19#ifndef PLUGINREPODIALOG_HPP
20#define PLUGINREPODIALOG_HPP
22#define PACKAGE_REPO_BROWSER_TITLE "NumeRe: Package Manager"
26#include "../controls/treelistctrl.h"
27#include "../compositions/viewerframe.hpp"
28#include "../terminal/terminal.hpp"
65 virtual wxThread::ExitCode
Entry();
67 void OnClose(wxCloseEvent& event);
70 std::vector<std::string>
getRepoList(
const std::string& sRepoUrl);
81 std::string
getEntry(
const wxTreeItemId& item,
const std::string& sIdentifier);
82 std::string
getUrl(
const wxTreeItemId& item);
84 wxTreeItemId
findPackage(
const std::string& sPackageFileName);
The terminal class for the GUI. It's a specialisation of the GenericTerminal.
This class represents a simple browser for the package repository with an install and uninstall capab...
std::string m_fileNameToInstall
std::string getDependencies(const wxTreeItemId &item)
Return the package dependencies.
bool getFileFromRepo(const std::string &sUrl)
Returns the contents of the passed URL as a file and writes it to its counterpart in the <SCRIPTPATH>...
std::string createSalt()
Simple function to make the URL more unique to avoid server caching (which might resolve in a very de...
std::string getUrl(const wxTreeItemId &item)
Return the package URL.
virtual wxThread::ExitCode Entry()
Secondary thread worker function.
wxButton * m_uninstallButton
void resolveDependencies(std::string sDepList, std::vector< std::string > &vDeps)
This member function resolves the dependencies of a selected file using a recursion....
std::string getEntry(const wxTreeItemId &item, const std::string &sIdentifier)
Returns the value of the selected identifier or an empty string, if the identifier cannot be found.
wxcode::wxTreeListCtrl * m_listCtrl
bool isUpdateable(const wxTreeItemId &item)
Returns, whether the current item is an updateable package (already installed but newer version avail...
NumeReTerminal * m_terminal
wxStaticText * m_statusText
wxButton * m_installButton
bool isInstallable(const wxTreeItemId &item)
Returns, whether the current item is an installable package (not already installed).
void OnClose(wxCloseEvent &event)
OnClose event handler. Will terminate the thread, if it's running.
void StartThread(ThreadTask task)
Start a new thread with the passed task.
void OnInstall(wxCommandEvent &event)
Button event handler linked to the "install/update" button.
std::vector< std::string > getRepoList(const std::string &sRepoUrl)
This member function fetches the repository main page as HTML and extracts the list of item links in ...
void OnUninstall(wxCommandEvent &event)
Button event handler linked to the "uninstall" button.
PackageRepoBrowser(wxWindow *parent, NumeReTerminal *terminal, IconManager *icons)
PackageRepositoryBrowser constructor. Starts the file loading task.
void OnItemSelect(wxTreeEvent &event)
Item select event handler to enable or disable the buttons depending on the state of the package or w...
wxTreeItemId findPackage(const std::string &sPackageFileName)
Find a package entry from its file name. The returned ID must be checked for validness via wxTreeItem...
std::vector< std::string > m_vUrls
void DetectInstalledPackages()
Detect installed packages by loading the list of installed and comparing them to the loaded contents ...
void populatePackageList(const std::string &sUrl)
Gets an URL and retrieve its counterpart from the repository. If the link does not reference a file b...
void OnThreadUpdate(wxThreadEvent &event)
Thread update event handler. Will trigger the actual installation, if the files were loaded successfu...
This class generalizes a set of basic floating window functionalities like being closable by pressing...