version 0.5.0_alpha
git-svn-id: svn://db.shs.com.ru/pip@8 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -8,20 +8,25 @@ Daemon::Daemon(): PIPeer("_pisd_" + PISystemInfo::instance()->hostname + "_" + P
|
||||
timer.setName("__S__Daemon_timer");
|
||||
enabled = false;
|
||||
mode = offset = cur = height = 0;
|
||||
CONNECTU(&console, keyPressed, this, keyEvent)
|
||||
//CONNECTU(&console, keyPressed, this, keyEvent)
|
||||
CONNECTU(&timer, tickEvent, this, timerEvent)
|
||||
timer.addDelimiter(5);
|
||||
timer.start(200);
|
||||
}
|
||||
|
||||
|
||||
void Daemon::keyEvent(char key) {
|
||||
PIScreenTile * Daemon::tile() const {
|
||||
return new PIScreenTile();
|
||||
}
|
||||
|
||||
|
||||
void Daemon::keyEvent(PIKbdListener::KeyEvent key) {
|
||||
if (!enabled) return;
|
||||
int num = key - '0';
|
||||
int num = key.key - '0';
|
||||
switch (mode) {
|
||||
case 0:
|
||||
if (num >= 0 && num <= 9) {
|
||||
connectToDaemon(dnames.value(key - '0'));
|
||||
connectToDaemon(dnames.value(key.key - '0'));
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@@ -33,7 +38,7 @@ void Daemon::keyEvent(char key) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
switch (key) {
|
||||
switch (key.key) {
|
||||
case PIKbdListener::UpArrow:
|
||||
/*cur--;
|
||||
if (cur < 0) cur = 0;
|
||||
@@ -205,14 +210,14 @@ void Daemon::updateConsole() {
|
||||
|
||||
|
||||
void Daemon::tabConnectedHeader(int cols) {
|
||||
console.addString("Connected to: " + connectedDaemon(), 1, PIConsole::BackGreen | PIConsole::Bold);
|
||||
/*console.addString("Connected to: " + connectedDaemon(), 1, PIConsole::BackGreen | PIConsole::Bold);
|
||||
for (int i = 2; i <= cols; ++i)
|
||||
console.addString(" ", i, PIConsole::Green | PIConsole::Inverse);
|
||||
console.addString(" ", i, PIConsole::Green | PIConsole::Inverse);*/
|
||||
}
|
||||
|
||||
|
||||
void Daemon::tabConnect() {
|
||||
startTab();
|
||||
/*startTab();
|
||||
console.addString("Available daemons:");
|
||||
int num = 0;
|
||||
dnames.clear();
|
||||
@@ -221,23 +226,23 @@ void Daemon::tabConnect() {
|
||||
dnames[num] = p;
|
||||
console.addString(" " + PIString(num++) + " - " + p);
|
||||
}
|
||||
finishTab();
|
||||
finishTab();*/
|
||||
}
|
||||
|
||||
|
||||
void Daemon::tabFeature() {
|
||||
startTab();
|
||||
/*startTab();
|
||||
tabConnectedHeader();
|
||||
console.addString("What do you wish to do with this daemon?");
|
||||
console.addString(" 0 - show host info");
|
||||
console.addString(" 1 - file manager");
|
||||
console.addString(" 2 - execute command");
|
||||
finishTab();
|
||||
finishTab();*/
|
||||
}
|
||||
|
||||
|
||||
void Daemon::tabInfo() {
|
||||
startTab(2);
|
||||
/*startTab(2);
|
||||
tabConnectedHeader(2);
|
||||
console.addString("Exec command: " + info_other.execCommand);
|
||||
console.addString(" Executed on " + info_other.execDateTime.toString());
|
||||
@@ -248,5 +253,5 @@ void Daemon::tabInfo() {
|
||||
console.addString("Architecture: " + info_other.architecture);
|
||||
console.addString(" CPU count: " + PIString::fromNumber(info_other.processorsCount));
|
||||
console.addVariable("of this process", &sys_mon_other, 2);
|
||||
finishTab();
|
||||
finishTab();*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user