From a762eeb9ff7b6cbfc26faafd6e00c3338c3cf8e5 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 29 Jun 2016 20:38:21 +0200 Subject: [PATCH] CShellWindow: add members to set/get commands and get current mode This allows to use shellwindow objects with existing instance. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e8a758ac61afff71816a478b9b9b1e138eb75074 Author: Thilo Graf Date: 2016-06-29 (Wed, 29 Jun 2016) --- src/gui/widget/shellwindow.cpp | 10 +++++++--- src/gui/widget/shellwindow.h | 4 ++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/gui/widget/shellwindow.cpp b/src/gui/widget/shellwindow.cpp index 4147fb717..a0602a68d 100644 --- a/src/gui/widget/shellwindow.cpp +++ b/src/gui/widget/shellwindow.cpp @@ -51,10 +51,14 @@ CShellWindow::CShellWindow(const std::string &Command, const int Mode, int *Res, textBox = NULL; frameBuffer = CFrameBuffer::getInstance(); - command = Command; - mode = Mode; - res = Res; + setCommand(Command, Mode, Res, auto_exec); +} +void CShellWindow::setCommand(const std::string &Command, const int Mode, int* Res, bool auto_exec) +{ + command = Command; + mode = Mode; + res = Res; if (auto_exec) exec(); } diff --git a/src/gui/widget/shellwindow.h b/src/gui/widget/shellwindow.h index 75cbd88f5..c875a22e4 100644 --- a/src/gui/widget/shellwindow.h +++ b/src/gui/widget/shellwindow.h @@ -56,6 +56,10 @@ class CShellWindow : public sigc::trackable }; CShellWindow(const std::string &Command, const int Mode = 0, int* Res = NULL, bool auto_exec = true); ~CShellWindow(); + void setCommand(const std::string &Command, const int Mode = 0, int* Res = NULL, bool auto_exec = true); + std::string getCommand(){return command;} + int getMode(){return mode;} + void exec(); /*!