From 48e09d97b1568e70c457ae9b1174baf83b967765 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 2 Aug 2017 08:59:56 +0200 Subject: [PATCH] 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: https://github.com/neutrino-images/ni-neutrino/commit/9678adc4017771205c59b23b93e1cdf3849ef630 Author: Thilo Graf Date: 2017-08-02 (Wed, 02 Aug 2017) --- src/gui/buildinfo.cpp | 15 +++++++-------- src/gui/buildinfo.h | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index bf7349352..fb9d7a3ac 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -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 diff --git a/src/gui/buildinfo.h b/src/gui/buildinfo.h index 154cba8bb..30a1033be 100644 --- a/src/gui/buildinfo.h +++ b/src/gui/buildinfo.h @@ -52,7 +52,7 @@ class CBuildInfo : public CMenuTarget, public CComponentsWindow void initVarBuildInfo(); void InitInfoItems(); - bool HasData(); + bool GetData(); public: //type_id's for infos