mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 08:51:04 +02:00
CBuildinfo: Don't load graphical related objects if not needed.
Objects are only required in show mode. HasData() is renamed because of for more
plausibility.
Origin commit data
------------------
Commit: 9678adc401
Author: Thilo Graf <dbt@novatux.de>
Date: 2017-08-02 (Wed, 02 Aug 2017)
This commit is contained in:
@@ -35,13 +35,13 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
CBuildInfo::CBuildInfo(bool show) : CComponentsWindow(0, 0, CCW_PERCENT 90, CCW_PERCENT 90, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO)
|
||||
CBuildInfo::CBuildInfo(bool show) : CComponentsWindow(0, 0, CCW_PERCENT 85, CCW_PERCENT 85, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO)
|
||||
{
|
||||
initVarBuildInfo();
|
||||
if (show)
|
||||
exec(NULL, "");
|
||||
else
|
||||
InitInfoItems();
|
||||
GetData();
|
||||
}
|
||||
|
||||
//init all var members
|
||||
@@ -52,7 +52,6 @@ void CBuildInfo::initVarBuildInfo()
|
||||
font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT];
|
||||
setWindowHeaderButtons(CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT);
|
||||
|
||||
|
||||
shadow = CC_SHADOW_ON;
|
||||
}
|
||||
|
||||
@@ -64,13 +63,13 @@ int CBuildInfo::exec(CMenuTarget* parent, const string & /*actionKey*/)
|
||||
if (parent)
|
||||
parent->hide();
|
||||
|
||||
InitInfoItems();
|
||||
|
||||
//exit if no informations available
|
||||
if (!HasData()){
|
||||
if (!GetData()){
|
||||
return res;
|
||||
}
|
||||
|
||||
InitInfoItems();
|
||||
|
||||
//paint window
|
||||
if (!is_painted)
|
||||
paint();
|
||||
@@ -117,7 +116,7 @@ void CBuildInfo::setFontType(Font* font_text)
|
||||
InitInfoItems();
|
||||
}
|
||||
|
||||
bool CBuildInfo::HasData()
|
||||
bool CBuildInfo::GetData()
|
||||
{
|
||||
v_info.clear();
|
||||
|
||||
@@ -166,7 +165,7 @@ bool CBuildInfo::HasData()
|
||||
void CBuildInfo::InitInfoItems()
|
||||
{
|
||||
//get and checkup required informations
|
||||
if (!HasData())
|
||||
if (!GetData())
|
||||
return;
|
||||
|
||||
//ensure a clean body
|
||||
|
@@ -52,7 +52,7 @@ class CBuildInfo : public CMenuTarget, public CComponentsWindow
|
||||
void initVarBuildInfo();
|
||||
void InitInfoItems();
|
||||
|
||||
bool HasData();
|
||||
bool GetData();
|
||||
public:
|
||||
|
||||
//type_id's for infos
|
||||
|
Reference in New Issue
Block a user