COPKGManager: add member to handle line of shell lines

prepared for use as callback in shell window class, currently
it is not possible to get line output from shellwindow object, this
should help soon

also added ne locales


Origin commit data
------------------
Commit: 4909844ad6
Author: Thilo Graf <dbt@novatux.de>
Date: 2014-12-10 (Wed, 10 Dec 2014)
This commit is contained in:
2014-12-10 10:41:34 +01:00
parent 6a28f2e66c
commit c1ff8c9d5f
6 changed files with 90 additions and 43 deletions

View File

@@ -46,7 +46,7 @@
#include <errno.h>
#include <system/debug.h>
CShellWindow::CShellWindow(const std::string &Command, const int Mode, int *Res)
CShellWindow::CShellWindow(const std::string &Command, const int Mode, int *Res, bool auto_exec)
{
textBox = NULL;
frameBuffer = CFrameBuffer::getInstance();
@@ -55,7 +55,8 @@ CShellWindow::CShellWindow(const std::string &Command, const int Mode, int *Res)
mode = Mode;
res = Res;
exec();
if (auto_exec)
exec();
}
void CShellWindow::exec()
@@ -152,6 +153,10 @@ void CShellWindow::exec()
lines.push_back(line);
incomplete = true;
}
//callback for line handler
std::string s_output = std::string((output));
OnShellOutputLoop(s_output);
if (lines.size() > lines_max)
lines.pop_front();
txt = "";