mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
CShellWindow: add new enum option ACKNOWLEDGE_MSG
allows to show a messagebox instead a small ok button
This commit is contained in:
@@ -34,7 +34,6 @@
|
|||||||
|
|
||||||
#include <global.h>
|
#include <global.h>
|
||||||
#include <neutrino.h>
|
#include <neutrino.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <driver/framebuffer.h>
|
#include <driver/framebuffer.h>
|
||||||
#include <gui/widget/textbox.h>
|
#include <gui/widget/textbox.h>
|
||||||
@@ -43,6 +42,7 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <system/helpers.h>
|
#include <system/helpers.h>
|
||||||
#include <gui/components/cc.h>
|
#include <gui/components/cc.h>
|
||||||
|
#include <gui/widget/messagebox.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
CShellWindow::CShellWindow(const std::string &command, const int _mode, int *res) {
|
CShellWindow::CShellWindow(const std::string &command, const int _mode, int *res) {
|
||||||
@@ -189,7 +189,9 @@ CShellWindow::CShellWindow(const std::string &command, const int _mode, int *res
|
|||||||
|
|
||||||
CShellWindow::~CShellWindow()
|
CShellWindow::~CShellWindow()
|
||||||
{
|
{
|
||||||
if (textBox && (mode & ACKNOWLEDGE)) {
|
if (textBox){
|
||||||
|
bool exit = false;
|
||||||
|
if (mode & ACKNOWLEDGE){
|
||||||
int b_width = 150;
|
int b_width = 150;
|
||||||
int b_height = 35;
|
int b_height = 35;
|
||||||
int xpos = frameBuffer->getScreenWidth() - b_width;
|
int xpos = frameBuffer->getScreenWidth() - b_width;
|
||||||
@@ -197,15 +199,24 @@ CShellWindow::~CShellWindow()
|
|||||||
|
|
||||||
CComponentsButton btn(xpos, ypos, b_width, b_height, LOCALE_MESSAGEBOX_OK, NEUTRINO_ICON_BUTTON_OKAY, NULL, true, true);
|
CComponentsButton btn(xpos, ypos, b_width, b_height, LOCALE_MESSAGEBOX_OK, NEUTRINO_ICON_BUTTON_OKAY, NULL, true, true);
|
||||||
btn.paint();
|
btn.paint();
|
||||||
|
}
|
||||||
|
else if (mode & ACKNOWLEDGE_MSG){
|
||||||
|
DisplayInfoMessage("...ready. Please press OK");
|
||||||
|
exit = true;
|
||||||
|
}
|
||||||
|
|
||||||
frameBuffer->blit();
|
frameBuffer->blit();
|
||||||
|
|
||||||
neutrino_msg_t msg;
|
neutrino_msg_t msg;
|
||||||
neutrino_msg_data_t data;
|
neutrino_msg_data_t data;
|
||||||
uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]);
|
uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]);
|
||||||
|
|
||||||
|
if (!exit)
|
||||||
|
{
|
||||||
do
|
do
|
||||||
g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd);
|
g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd);
|
||||||
while (msg != CRCInput::RC_ok && msg != CRCInput::RC_home && msg != CRCInput::RC_timeout);
|
while (msg != CRCInput::RC_ok && msg != CRCInput::RC_home && msg != CRCInput::RC_timeout);
|
||||||
|
}
|
||||||
|
|
||||||
frameBuffer->Clear();
|
frameBuffer->Clear();
|
||||||
frameBuffer->blit();
|
frameBuffer->blit();
|
||||||
|
@@ -39,7 +39,8 @@ class CShellWindow
|
|||||||
enum shellwindow_modes
|
enum shellwindow_modes
|
||||||
{
|
{
|
||||||
VERBOSE = 1,
|
VERBOSE = 1,
|
||||||
ACKNOWLEDGE = 2
|
ACKNOWLEDGE = 2,
|
||||||
|
ACKNOWLEDGE_MSG = 4
|
||||||
};
|
};
|
||||||
CShellWindow(const std::string &cmd, const int mode = 0, int *res = NULL);
|
CShellWindow(const std::string &cmd, const int mode = 0, int *res = NULL);
|
||||||
~CShellWindow();
|
~CShellWindow();
|
||||||
|
Reference in New Issue
Block a user