| 1 |
/* |
| 2 |
* Copyright (C) 2005-2018 Team Kodi |
| 3 |
* This file is part of Kodi - https://kodi.tv |
| 4 |
* |
| 5 |
* SPDX-License-Identifier: GPL-2.0-or-later |
| 6 |
* See LICENSES/README.md for more information. |
| 7 |
*/ |
| 8 |
|
| 9 |
#include "DialogOKHelper.h" |
| 10 |
|
| 11 |
#include "ServiceBroker.h" |
| 12 |
#include "messaging/ApplicationMessenger.h" |
| 13 |
|
| 14 |
namespace KODI |
| 15 |
{ |
| 16 |
namespace MESSAGING |
| 17 |
{ |
| 18 |
namespace HELPERS |
| 19 |
{ |
| 20 |
bool ShowOKDialogText(CVariant heading, CVariant text) |
| 21 |
{ |
| 22 |
DialogOKMessage options; |
| 23 |
options.heading = std::move(heading); |
| 24 |
options.text = std::move(text); |
| 25 |
|
| 26 |
if (CServiceBroker::GetAppMessenger()->SendMsg(TMSG_GUI_DIALOG_OK, -1, -1, |
| 27 |
static_cast<void*>(&options)) > 0) |
| 28 |
return true; |
| 29 |
return false; |
| 30 |
} |
| 31 |
|
| 32 |
void UpdateOKDialogText(CVariant heading, CVariant text) |
| 33 |
{ |
| 34 |
DialogOKMessage options; |
| 35 |
options.heading = std::move(heading); |
| 36 |
options.text = std::move(text); |
| 37 |
options.show = false; |
| 38 |
|
| 39 |
CServiceBroker::GetAppMessenger()->SendMsg(TMSG_GUI_DIALOG_OK, -1, -1, |
| 40 |
static_cast<void*>(&options)); |
| 41 |
} |
| 42 |
|
| 43 |
bool ShowOKDialogLines(CVariant heading, CVariant line0, CVariant line1, CVariant line2) |
| 44 |
{ |
| 45 |
DialogOKMessage options; |
| 46 |
options.heading = std::move(heading); |
| 47 |
options.lines[0] = std::move(line0); |
| 48 |
options.lines[1] = std::move(line1); |
| 49 |
options.lines[2] = std::move(line2); |
| 50 |
|
| 51 |
if (CServiceBroker::GetAppMessenger()->SendMsg(TMSG_GUI_DIALOG_OK, -1, -1, |
| 52 |
static_cast<void*>(&options)) > 0) |
| 53 |
return true; |
| 54 |
return false; |
| 55 |
} |
| 56 |
|
| 57 |
} |
| 58 |
} |
| 59 |
} |