From db094c3a10b78cba648b3d0bb23e7344577060f5 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 9 Mar 2013 14:05:24 +0100 Subject: [PATCH] CComponentsWindow: remove refresh() initCCWItems() does the same, but is private Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/de330ac39cb69a45a09cd6fde369520055f69ef1 Author: Thilo Graf Date: 2013-03-09 (Sat, 09 Mar 2013) ------------------ This commit was generated by Migit --- src/gui/components/cc.h | 4 ++-- src/gui/components/cc_frm_window.cpp | 15 +++++++++++++-- src/gui/test_menu.cpp | 1 - 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/gui/components/cc.h b/src/gui/components/cc.h index 667aeeb9b..0d529f725 100644 --- a/src/gui/components/cc.h +++ b/src/gui/components/cc.h @@ -33,7 +33,7 @@ #include #include -//#define DEBUG_CC +#define DEBUG_CC class CComponents { @@ -515,8 +515,8 @@ class CComponentsWindow : public CComponentsForm ~CComponentsWindow(); void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); - void refresh(){initCCWItems();}; void setWindowCaption(const std::string& text){ccw_caption = text;}; + void setWindowCaption(neutrino_locale_t locale_text); void setWindowIcon(const char* iconname){ccw_icon_name = iconname;}; }; diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 69a5dbffb..fa2c22634 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -67,10 +67,18 @@ CComponentsWindow::~CComponentsWindow() delete ccw_head; } +void CComponentsWindow::setWindowCaption(neutrino_locale_t locale_text) +{ + ccw_caption = g_Locale->getText(locale_text); +} + void CComponentsWindow::initHeader() { - if (ccw_head == NULL) - ccw_head = new CComponentsHeader(); + if (ccw_head){ + delete ccw_head; + ccw_head = NULL; + } + ccw_head = new CComponentsHeader(); ccw_head->setXPos(0); ccw_head->setYPos(0); @@ -89,6 +97,9 @@ void CComponentsWindow::initCCWItems() void CComponentsWindow::paint(bool do_save_bg) { + //prepare items before paint + initCCWItems(); + //paint body paintInit(do_save_bg); diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index ecdef3651..dce736483 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -512,7 +512,6 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) window->setWindowIcon(NEUTRINO_ICON_LOCK); window->setWindowCaption("Test"); } - window->refresh(); if (!window->isPainted()) window->paint();