Commit 029ccec5 authored by Jean-Baptiste Demonte's avatar Jean-Baptiste Demonte

only intercept X for kodi on main menu #64 & complete help

parent f74adcdd
......@@ -52,6 +52,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Display NETWORK in storage devices list once switched on a NAS
- Jump to letter now moves to the first occurrence of the letter
- Fixed displayed names using more than 14 characters in TextEditComponent
- Avoid to launch Kodi when not in main interface
## [4.0.0] - 2016-02-02
### Added
......
......@@ -545,6 +545,10 @@ std::vector<HelpPrompt> ViewController::getHelpPrompts()
prompts = mCurrentView->getHelpPrompts();
if(RecalboxConf::getInstance()->get("emulationstation.menu") != "none"){
prompts.push_back(HelpPrompt("start", _("MENU")));
if (RecalboxConf::getInstance()->get("kodi.enabled") == "1" && RecalboxConf::getInstance()->get("kodi.xbutton") == "1") {
prompts.push_back(HelpPrompt("x", _("START KODI")));
}
}
return prompts;
......
......@@ -66,6 +66,7 @@ public:
};
inline const State& getState() const { return mState; }
inline bool isViewing(ViewMode viewing) const { return mState.viewing == viewing; }
virtual std::vector<HelpPrompt> getHelpPrompts() override;
virtual HelpStyle getHelpStyle() override;
......
......@@ -14,6 +14,7 @@
#include "RecalboxConf.h"
#include "Locale.h"
#include "MenuThemeData.h"
#include "views/ViewController.h"
Window::Window() : mNormalizeNextUpdate(false), mFrameTimeElapsed(0), mFrameCountElapsed(0), mAverageDeltaTime(10),
mAllowSleep(true), mSleeping(false), mTimeSinceLastInput(0), launchKodi(false)
......@@ -144,23 +145,30 @@ void Window::input(InputConfig* config, Input input)
Settings::getInstance()->setBool("DebugText", !Settings::getInstance()->getBool("DebugText"));
}
else
{
if(config->isMappedTo("x", input) && input.value && !launchKodi && RecalboxConf::getInstance()->get("kodi.enabled") == "1" && RecalboxConf::getInstance()->get("kodi.xbutton") == "1"){
launchKodi = true;
Window * window = this;
this->pushGui(new GuiMsgBox(this, _("DO YOU WANT TO START KODI MEDIA CENTER ?"), _("YES"),
[window, this] {
if( ! RecalboxSystem::getInstance()->launchKodi(window)) {
LOG(LogWarning) << "Shutdown terminated with non-zero result!";
}
launchKodi = false;
}, _("NO"), [this] {
launchKodi = false;
}));
}else {
if(peekGui())
{
if( config->isMappedTo("x", input) && input.value
&& !launchKodi && RecalboxConf::getInstance()->get("kodi.enabled") == "1" && RecalboxConf::getInstance()->get("kodi.xbutton") == "1"
&& ViewController::get()->isViewing(ViewController::SYSTEM_SELECT) /* only in the main menu */
&& mGuiStack.size() == 1 /* without any popup */ )
{
launchKodi = true;
Window * window = this;
this->pushGui(new GuiMsgBox(this, _("DO YOU WANT TO START KODI MEDIA CENTER ?"),
_("YES"), [window, this] {
if( ! RecalboxSystem::getInstance()->launchKodi(window)) {
LOG(LogWarning) << "Shutdown terminated with non-zero result!";
}
launchKodi = false;
},
_("NO"), [this] {
launchKodi = false;
}
));
}
else if(peekGui())
{
this->peekGui()->input(config, input);
}
}
}
}
......
......@@ -827,6 +827,10 @@ msgstr ""
msgid "MENU"
msgstr ""
#:
msgid "START KODI"
msgstr ""
#:
msgid "FILENAME, ASCENDING"
msgstr ""
......
......@@ -815,6 +815,10 @@ msgstr "Nb parties"
msgid "MENU"
msgstr "MENU"
#:
msgid "START KODI"
msgstr "LANCER KODI"
#:
msgid "FILENAME, ASCENDING"
msgstr "FICHIER, ASCENDANT"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment