mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 08:21:07 +02:00
CComponentsFrmClock: Fix thread handling
- Set clock activ = false for default
Origin commit data
------------------
Branch: ni/coolstream
Commit: ddc826ab51
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2014-02-13 (Thu, 13 Feb 2014)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -2123,7 +2123,7 @@ void CChannelList::paintHead()
|
||||
|
||||
if (g_Sectionsd->getIsTimeSet()) {
|
||||
if (headerClock == NULL) {
|
||||
headerClock = new CComponentsFrmClock(0, 0, 0, 0, "%H:%M");
|
||||
headerClock = new CComponentsFrmClock(0, 0, 0, 0, "%H:%M", true);
|
||||
headerClock->setClockBlink("%H %M");
|
||||
headerClock->setClockIntervall(1);
|
||||
|
||||
|
@@ -76,7 +76,6 @@ void CComponentsFrmClock::initVarClock( const int& x_pos, const int& y_pos, cons
|
||||
cl_thread = 0;
|
||||
cl_interval = 1;
|
||||
|
||||
activeClock = true;
|
||||
cl_blink_str = "";
|
||||
paintClock = false;
|
||||
|
||||
@@ -373,3 +372,12 @@ Font** CComponentsFrmClock::getClockFont()
|
||||
return cl_font;
|
||||
|
||||
}
|
||||
|
||||
void CComponentsFrmClock::setClockActiv(bool activ/* = true*/)
|
||||
{
|
||||
activeClock = activ;
|
||||
if (activ && !cl_thread)
|
||||
startThread();
|
||||
if (!activ && cl_thread)
|
||||
stopThread();
|
||||
}
|
||||
|
@@ -94,7 +94,7 @@ class CComponentsFrmClock : public CComponentsForm
|
||||
|
||||
public:
|
||||
CComponentsFrmClock( const int& x_pos = 1, const int& y_pos = 1, const int& w = 200, const int& h = 48,
|
||||
const char* format_str = "%H:%M", bool activ=true, bool has_shadow = CC_SHADOW_OFF,
|
||||
const char* format_str = "%H:%M", bool activ=false, bool has_shadow = CC_SHADOW_OFF,
|
||||
fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
|
||||
virtual ~CComponentsFrmClock();
|
||||
|
||||
@@ -134,7 +134,7 @@ class CComponentsFrmClock : public CComponentsForm
|
||||
virtual void refresh() { initCCLockItems(); }
|
||||
|
||||
///set clock activ/inactiv
|
||||
virtual void setClockActiv(bool activ = true){activeClock = activ;};
|
||||
virtual void setClockActiv(bool activ = true);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -610,7 +610,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
}
|
||||
else if (actionKey == "running_clock"){
|
||||
if (clock_r == NULL){
|
||||
clock_r = new CComponentsFrmClock(100, 50, 0, 50, "%H.%M:%S");
|
||||
clock_r = new CComponentsFrmClock(100, 50, 0, 50, "%H.%M:%S", true);
|
||||
clock_r->setClockFont(SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME);
|
||||
clock_r->setClockIntervall(1);
|
||||
// clock_r->doPaintBg(false);
|
||||
|
Reference in New Issue
Block a user