mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 00:41:09 +02:00
dboxinfo: allow to show "neutrino uptime"
Origin commit data
------------------
Branch: ni/coolstream
Commit: a98f94621a
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2017-12-26 (Tue, 26 Dec 2017)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
committed by
vanhofen
parent
725a69916a
commit
abfd7f3155
@@ -4,7 +4,7 @@
|
|||||||
Copyright (C) 2001 Steffen Hehn 'McClean'
|
Copyright (C) 2001 Steffen Hehn 'McClean'
|
||||||
Homepage: http://dbox.cyberphoria.org/
|
Homepage: http://dbox.cyberphoria.org/
|
||||||
|
|
||||||
(C) 2009-2011, 2013-2014 Stefan Seyfried
|
(C) 2009-2011, 2013-2014, 2017 Stefan Seyfried
|
||||||
|
|
||||||
License: GPL
|
License: GPL
|
||||||
|
|
||||||
@@ -74,6 +74,7 @@ CDBoxInfoWidget::CDBoxInfoWidget()
|
|||||||
percWidth = 3 * fm->getMaxDigitWidth()
|
percWidth = 3 * fm->getMaxDigitWidth()
|
||||||
+ fm->getRenderWidth("%"); //100%
|
+ fm->getRenderWidth("%"); //100%
|
||||||
nameWidth = fontWidth * 17;
|
nameWidth = fontWidth * 17;
|
||||||
|
upmode = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CDBoxInfoWidget::~CDBoxInfoWidget()
|
CDBoxInfoWidget::~CDBoxInfoWidget()
|
||||||
@@ -135,6 +136,10 @@ int CDBoxInfoWidget::exec(CMenuTarget* parent, const std::string &)
|
|||||||
res = menu_return::RETURN_EXIT_ALL;
|
res = menu_return::RETURN_EXIT_ALL;
|
||||||
doLoop = false;
|
doLoop = false;
|
||||||
}
|
}
|
||||||
|
else if (msg == CRCInput::RC_info) {
|
||||||
|
upmode = !upmode;
|
||||||
|
paint();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int mr = CNeutrinoApp::getInstance()->handleMsg( msg, data );
|
int mr = CNeutrinoApp::getInstance()->handleMsg( msg, data );
|
||||||
@@ -388,6 +393,8 @@ void CDBoxInfoWidget::paint()
|
|||||||
std::string str_now(strftime(g_Locale->getText(LOCALE_EXTRA_DBOXINFO_TIMEFORMAT), now));
|
std::string str_now(strftime(g_Locale->getText(LOCALE_EXTRA_DBOXINFO_TIMEFORMAT), now));
|
||||||
struct sysinfo info;
|
struct sysinfo info;
|
||||||
sysinfo(&info);
|
sysinfo(&info);
|
||||||
|
if (upmode)
|
||||||
|
info.uptime = time_monotonic() - CNeutrinoApp::getInstance()->getStartTime();
|
||||||
now -= info.uptime;
|
now -= info.uptime;
|
||||||
std::string str_boot(strftime(g_Locale->getText(LOCALE_EXTRA_DBOXINFO_TIMEFORMAT), now));
|
std::string str_boot(strftime(g_Locale->getText(LOCALE_EXTRA_DBOXINFO_TIMEFORMAT), now));
|
||||||
|
|
||||||
|
@@ -53,6 +53,7 @@ class CDBoxInfoWidget : public CMenuTarget
|
|||||||
int sizeWidth; // width of mem / disk sizes
|
int sizeWidth; // width of mem / disk sizes
|
||||||
int percWidth;
|
int percWidth;
|
||||||
int nameWidth;
|
int nameWidth;
|
||||||
|
bool upmode; // system or neutrino uptime
|
||||||
|
|
||||||
void paint();
|
void paint();
|
||||||
CComponentsHeader *header;
|
CComponentsHeader *header;
|
||||||
|
@@ -2378,6 +2378,8 @@ bool is_wakeup()
|
|||||||
|
|
||||||
int CNeutrinoApp::run(int argc, char **argv)
|
int CNeutrinoApp::run(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
neutrino_start_time = time_monotonic();
|
||||||
|
|
||||||
puts("[neutrino] executing " NEUTRINO_APP_START_SCRIPT ".");
|
puts("[neutrino] executing " NEUTRINO_APP_START_SCRIPT ".");
|
||||||
if (my_system(NEUTRINO_APP_START_SCRIPT) != 0)
|
if (my_system(NEUTRINO_APP_START_SCRIPT) != 0)
|
||||||
perror(NEUTRINO_APP_START_SCRIPT " failed");
|
perror(NEUTRINO_APP_START_SCRIPT " failed");
|
||||||
|
@@ -91,6 +91,8 @@ private:
|
|||||||
int lastChannelMode;
|
int lastChannelMode;
|
||||||
struct timeval standby_pressed_at;
|
struct timeval standby_pressed_at;
|
||||||
|
|
||||||
|
time_t neutrino_start_time;
|
||||||
|
|
||||||
int current_muted;
|
int current_muted;
|
||||||
|
|
||||||
bool skipShutdownTimer;
|
bool skipShutdownTimer;
|
||||||
@@ -188,6 +190,7 @@ public:
|
|||||||
void switchTvRadioMode(const int prev_mode = NeutrinoModes::mode_unknown);
|
void switchTvRadioMode(const int prev_mode = NeutrinoModes::mode_unknown);
|
||||||
void switchInfoIconsOnOff(); //NI
|
void switchInfoIconsOnOff(); //NI
|
||||||
|
|
||||||
|
time_t getStartTime() { return neutrino_start_time; }
|
||||||
|
|
||||||
bool isMuted() {return current_muted; }
|
bool isMuted() {return current_muted; }
|
||||||
void setCurrentMuted(int m) { current_muted = m; }
|
void setCurrentMuted(int m) { current_muted = m; }
|
||||||
|
Reference in New Issue
Block a user