GUI: add possibility to call script from link in result paragraph html
This commit is contained in:
@@ -151,6 +151,22 @@ bool DesktopDb::allApps(vector<AppDef> *apps)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DesktopDb::appByName(const string& nm, AppDef& app)
|
||||
{
|
||||
for (AppMap::const_iterator it = m_appMap.begin();
|
||||
it != m_appMap.end(); it++) {
|
||||
for (vector<AppDef>::const_iterator it1 = it->second.begin();
|
||||
it1 != it->second.end(); it1++) {
|
||||
if (!nm.compare(it1->name)) {
|
||||
app.name = it1->name;
|
||||
app.command = it1->command;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
const string& DesktopDb::getReason()
|
||||
{
|
||||
return m_reason;
|
||||
|
||||
@@ -33,6 +33,8 @@ public:
|
||||
AppDef(const std::string& nm, const std::string& cmd)
|
||||
: name(nm), command(cmd)
|
||||
{}
|
||||
AppDef() {}
|
||||
|
||||
std::string name;
|
||||
std::string command;
|
||||
};
|
||||
@@ -64,6 +66,11 @@ public:
|
||||
*/
|
||||
bool allApps(vector<AppDef> *apps);
|
||||
|
||||
/**
|
||||
* Get app with given name
|
||||
*/
|
||||
bool appByName(const string& nm, AppDef& app);
|
||||
|
||||
typedef map<string, vector<DesktopDb::AppDef> > AppMap;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user