Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

jsonrpc: send Input.OnInputRequested/OnInputFinished from CGUIDialogN…

…umeric as well
  • Loading branch information...
commit 4c5310b2053919b69946fbeb3d8691a1828d1973 1 parent 9740905
@Montellese authored
View
46 xbmc/dialogs/GUIDialogNumeric.cpp
@@ -27,6 +27,7 @@
#include "input/XBMC_vkeys.h"
#include "utils/StringUtils.h"
#include "guilib/LocalizeStrings.h"
+#include "interfaces/AnnouncementManager.h"
#define CONTROL_HEADING_LABEL 1
#define CONTROL_INPUT_LABEL 4
@@ -54,6 +55,51 @@ CGUIDialogNumeric::~CGUIDialogNumeric(void)
{
}
+void CGUIDialogNumeric::OnInitWindow()
+{
+ CGUIDialog::OnInitWindow();
+
+ CVariant data;
+ switch (m_mode)
+ {
+ case INPUT_TIME:
+ data["type"] = "time";
+ break;
+ case INPUT_DATE:
+ data["type"] = "date";
+ break;
+ case INPUT_IP_ADDRESS:
+ data["type"] = "ip";
+ break;
+ case INPUT_PASSWORD:
+ data["type"] = "password";
+ break;
+ case INPUT_NUMBER:
+ data["type"] = "number";
+ break;
+ case INPUT_TIME_SECONDS:
+ data["type"] = "seconds";
+ break;
+ default:
+ data["type"] = "keyboard";
+ break;
+ }
+
+ const CGUILabelControl *control = (const CGUILabelControl *)GetControl(CONTROL_HEADING_LABEL);
+ if (control != NULL)
+ data["title"] = control->GetDescription();
+
+ ANNOUNCEMENT::CAnnouncementManager::Announce(ANNOUNCEMENT::Input, "xbmc", "OnInputRequested", data);
+}
+
+void CGUIDialogNumeric::OnDeinitWindow(int nextWindowID)
+{
+ // call base class
+ CGUIDialog::OnDeinitWindow(nextWindowID);
+
+ ANNOUNCEMENT::CAnnouncementManager::Announce(ANNOUNCEMENT::Input, "xbmc", "OnInputFinished");
+}
+
bool CGUIDialogNumeric::OnAction(const CAction &action)
{
if (action.GetID() == ACTION_NEXT_ITEM)
View
3  xbmc/dialogs/GUIDialogNumeric.h
@@ -54,6 +54,9 @@ class CGUIDialogNumeric :
static bool ShowAndGetSeconds(CStdString& timeString, const CStdString &heading);
protected:
+ virtual void OnInitWindow();
+ virtual void OnDeinitWindow(int nextWindowID);
+
void OnNumber(unsigned int num);
void VerifyDate(bool checkYear);
void OnNext();
Please sign in to comment.
Something went wrong with that request. Please try again.