From 11b33072510851f4e8f80cc9f58ede1e20098d6a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 4 Apr 2016 21:57:17 +0200 Subject: [PATCH 001/171] CMsgBox: rework msgbox classes with Window class implementation Replacing messagebox, hintbox_ext and some derivated parts with basic class hintbox and derivated class CMsgBox. This should unify window handling and avoids maintain of multiple classes with quasi same purpose and adds more functionality. TODO: fix and optimize details Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/dde298b1b72f11c67df276672e3860971b2896e9 Author: Thilo Graf Date: 2016-04-04 (Mon, 04 Apr 2016) --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + data/locale/nederlands.locale | 1 + src/driver/moviecut.cpp | 4 +- src/driver/record.cpp | 10 +- src/driver/screenshot.cpp | 2 +- src/gui/audioplayer.cpp | 6 +- src/gui/bedit/bouqueteditor_bouquets.cpp | 12 +- src/gui/bedit/bouqueteditor_channels.cpp | 4 +- src/gui/bookmarkmanager.cpp | 2 +- src/gui/bouquetlist.cpp | 6 +- src/gui/buildinfo.cpp | 2 +- src/gui/channellist.cpp | 12 +- src/gui/components/cc_frm.cpp | 59 +- src/gui/components/cc_frm.h | 27 +- src/gui/components/cc_frm_button.cpp | 18 +- src/gui/components/cc_frm_button.h | 27 +- src/gui/components/cc_frm_footer.cpp | 53 +- src/gui/components/cc_frm_footer.h | 38 +- src/gui/components/cc_frm_window.h | 5 + src/gui/components/cc_signals.h | 2 +- src/gui/components/cc_types.h | 4 +- src/gui/epgplus.cpp | 6 +- src/gui/epgview.cpp | 12 +- src/gui/eventlist.cpp | 6 +- src/gui/favorites.cpp | 8 +- src/gui/filebrowser.cpp | 4 +- src/gui/hdd_menu.cpp | 16 +- src/gui/keybind_setup.cpp | 4 +- src/gui/lua/lua_hintbox.cpp | 2 +- src/gui/lua/lua_menue.cpp | 2 +- src/gui/lua/lua_messagebox.cpp | 36 +- src/gui/lua/lua_messagebox.h | 2 +- src/gui/lua/lua_misc.cpp | 2 +- src/gui/lua/lua_video.cpp | 2 +- src/gui/miscsettings_menu.cpp | 4 +- src/gui/motorcontrol.cpp | 4 +- src/gui/moviebrowser/mb.cpp | 30 +- src/gui/moviebrowser/mb_help.h | 40 +- src/gui/movieplayer.cpp | 4 +- src/gui/network_setup.cpp | 28 +- src/gui/opkg_manager.cpp | 16 +- src/gui/personalize.cpp | 16 +- src/gui/pictureviewer.cpp | 57 +- src/gui/pipsetup.cpp | 2 +- src/gui/pluginlist.cpp | 6 +- src/gui/rc_lock.cpp | 9 +- src/gui/record_setup.cpp | 4 +- src/gui/scan.cpp | 4 +- src/gui/scan_setup.cpp | 2 +- src/gui/screensetup.cpp | 4 +- src/gui/settings_manager.cpp | 8 +- src/gui/start_wizard.cpp | 6 +- src/gui/test_menu.cpp | 171 +++- src/gui/test_menu.h | 2 +- src/gui/themes.cpp | 4 +- src/gui/timerlist.cpp | 14 +- src/gui/update.cpp | 34 +- src/gui/update_ext.cpp | 8 +- src/gui/upnpbrowser.cpp | 8 +- src/gui/user_menue_setup.cpp | 2 +- src/gui/videosettings.cpp | 4 +- src/gui/widget/Makefile.am | 2 - src/gui/widget/colorchooser.cpp | 4 +- src/gui/widget/helpbox.cpp | 216 ++-- src/gui/widget/helpbox.h | 111 +- src/gui/widget/hintbox.cpp | 615 ++++++----- src/gui/widget/hintbox.h | 220 ++-- src/gui/widget/keyboard_input.cpp | 4 +- src/gui/widget/messagebox.cpp | 38 +- src/gui/widget/messagebox.h | 2 + src/gui/widget/msgbox.cpp | 1176 ++++++++-------------- src/gui/widget/msgbox.h | 336 ++++--- src/gui/widget/shellwindow.cpp | 2 +- src/gui/widget/stringinput.cpp | 4 +- src/gui/widget/stringinput_ext.cpp | 10 +- src/neutrino.cpp | 40 +- src/neutrino_menue.h | 1 + src/system/locals.h | 1 + src/system/locals_intern.h | 1 + src/system/setting_helpers.cpp | 6 +- 81 files changed, 1981 insertions(+), 1697 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 7f9468a2a..b9b67613b 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -780,6 +780,7 @@ hdd_statfs_recording nur während Aufnahme hdd_umount Aushängen hdd_umount_warn Laufwerk aushängen hdd_umounted Laufwerk entfernt +help_box_title Hilfe imageinfo.api API: imageinfo.creator Ersteller: imageinfo.date Datum: diff --git a/data/locale/english.locale b/data/locale/english.locale index b9bd319b0..acf01b734 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -780,6 +780,7 @@ hdd_statfs_recording while recording only hdd_umount Unmount hdd_umount_warn unmount device hdd_umounted Device removed +help_box_title Help imageinfo.api API: imageinfo.creator Creator: imageinfo.date Date: diff --git a/data/locale/nederlands.locale b/data/locale/nederlands.locale index 0deb34b3c..5c81c018d 100644 --- a/data/locale/nederlands.locale +++ b/data/locale/nederlands.locale @@ -725,6 +725,7 @@ hdd_statfs_recording alleen tijdens opname hdd_umount Unmount hdd_umount_warn Apparaat ontkoppelen hdd_umounted Device verwijderd +help_box_title Help imageinfo.api API: imageinfo.creator Ontwikkelaar: imageinfo.date Datum: diff --git a/src/driver/moviecut.cpp b/src/driver/moviecut.cpp index a4f8890cf..749053023 100644 --- a/src/driver/moviecut.cpp +++ b/src/driver/moviecut.cpp @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include @@ -295,7 +295,7 @@ int CMovieCut::getInput() int retval = 0; g_RCInput->getMsg(&msg, &data, 1, false); if (msg == CRCInput::RC_home) { - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIECUT_CANCEL, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIECUT_CANCEL, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo) == CMsgBox::mbrYes) retval |= 4; } if (msg != CRCInput::RC_timeout) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 7dd3183ab..042cf1ad4 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include #include @@ -1385,7 +1385,7 @@ int CRecordManager::exec(CMenuTarget* parent, const std::string & actionKey ) snprintf(rec_msg1, sizeof(rec_msg1)-1, "%s", g_Locale->getText(LOCALE_RECORDINGMENU_MULTIMENU_ASK_STOP_ALL)); snprintf(rec_msg, sizeof(rec_msg)-1, rec_msg1, records); if(ShowMsg(LOCALE_SHUTDOWN_RECORDING_QUERY, rec_msg, - CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrYes) + CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450, 30) == CMsgBox::mbrYes) { snprintf(rec_msg1, sizeof(rec_msg1)-1, "%s", g_Locale->getText(LOCALE_RECORDINGMENU_MULTIMENU_INFO_STOP_ALL)); @@ -1418,7 +1418,7 @@ int CRecordManager::exec(CMenuTarget* parent, const std::string & actionKey ) inst->GetRecordString(title, duration); title += duration; tostart = (ShowMsg(LOCALE_RECORDING_IS_RUNNING, title.c_str(), - CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrYes); + CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450, 30) == CMsgBox::mbrYes); } if (tostart) { CRecordManager::getInstance()->Record(live_channel_id); @@ -1565,7 +1565,7 @@ bool CRecordManager::AskToStop(const t_channel_id channel_id, const int recid) return false; if(ShowMsg(LOCALE_SHUTDOWN_RECORDING_QUERY, title.c_str(), - CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrYes) { + CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450, 30) == CMsgBox::mbrYes) { mutex.lock(); if (recid) inst = FindInstanceID(recid); @@ -1858,7 +1858,7 @@ bool CRecordManager::MountDirectory(const char *recordingDir) strcat(msg,recordingDir); ShowMsg(LOCALE_MESSAGEBOX_ERROR, msg, - CMessageBox::mbrBack, CMessageBox::mbBack,NEUTRINO_ICON_ERROR, 450, 10); // UTF-8 + CMsgBox::mbrBack, CMsgBox::mbBack,NEUTRINO_ICON_ERROR, 450, 10); // UTF-8 ret = false; } break; diff --git a/src/driver/screenshot.cpp b/src/driver/screenshot.cpp index 5b32b1e7a..e438f924b 100644 --- a/src/driver/screenshot.cpp +++ b/src/driver/screenshot.cpp @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 1561a8616..c96652ac9 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -61,7 +61,7 @@ #include #include #include -#include +#include #include #include #include @@ -2653,8 +2653,8 @@ bool CAudioPlayerGui::askToOverwriteFile(const std::string& filename) g_Locale->getText(LOCALE_AUDIOPLAYER_PLAYLIST_FILEOVERWRITE_MSG), filename.c_str()); bool res = (ShowMsg(LOCALE_AUDIOPLAYER_PLAYLIST_FILEOVERWRITE_TITLE, - msg,CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo) - == CMessageBox::mbrYes); + msg,CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo) + == CMsgBox::mbrYes); this->paint(); return res; } diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 4138c987d..28223aa4a 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -35,7 +35,7 @@ #include #include -#include +#include #include #include #include @@ -245,19 +245,19 @@ int CBEBouquetWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* { if (bouquetsChanged) { - int result = ShowMsg(LOCALE_BOUQUETEDITOR_NAME, LOCALE_BOUQUETEDITOR_SAVECHANGES, CMessageBox::mbrYes, CMessageBox::mbAll); + int result = ShowMsg(LOCALE_BOUQUETEDITOR_NAME, LOCALE_BOUQUETEDITOR_SAVECHANGES, CMsgBox::mbrYes, CMsgBox::mbYesNoCancel, NULL, 600); switch( result ) { - case CMessageBox::mbrYes : + case CMsgBox::mbrYes : loop=false; saveChanges(); break; - case CMessageBox::mbrNo : + case CMsgBox::mbrNo : loop=false; discardChanges(); break; - case CMessageBox::mbrCancel : + case CMsgBox::mbrCancel : paintHead(); paint(); paintFoot(); @@ -394,7 +394,7 @@ void CBEBouquetWidget::deleteBouquet() if (selected >= Bouquets->size()) /* Bouquets->size() might be 0 */ return; - if (ShowMsg(LOCALE_FILEBROWSER_DELETE, (*Bouquets)[selected]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : (*Bouquets)[selected]->Name, CMessageBox::mbrNo, CMessageBox::mbYes|CMessageBox::mbNo)!=CMessageBox::mbrYes) + if (ShowMsg(LOCALE_FILEBROWSER_DELETE, (*Bouquets)[selected]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : (*Bouquets)[selected]->Name, CMsgBox::mbrNo, CMsgBox::mbYes|CMsgBox::mbNo)!=CMsgBox::mbrYes) return; g_bouquetManager->deleteBouquet(selected); diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 874096dd7..38310c319 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -28,7 +28,7 @@ #include #endif -#include +#include #include "bouqueteditor_channels.h" #include @@ -470,7 +470,7 @@ void CBEChannelWidget::deleteChannel() if (selected >= Channels->size()) /* Channels.size() might be 0 */ return; - if (ShowMsg(LOCALE_FILEBROWSER_DELETE, (*Channels)[selected]->getName(), CMessageBox::mbrNo, CMessageBox::mbYes|CMessageBox::mbNo)!=CMessageBox::mbrYes) + if (ShowMsg(LOCALE_FILEBROWSER_DELETE, (*Channels)[selected]->getName(), CMsgBox::mbrNo, CMsgBox::mbYes|CMsgBox::mbNo)!=CMsgBox::mbrYes) return; g_bouquetManager->Bouquets[bouquet]->removeService((*Channels)[selected]->getChannelID()); diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index cad6d739d..8d7f21453 100644 --- a/src/gui/bookmarkmanager.cpp +++ b/src/gui/bookmarkmanager.cpp @@ -39,7 +39,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 6570b0cb3..49c0cbd1b 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include @@ -346,8 +346,8 @@ int CBouquetList::doMenu() if(select >= 0) { old_selected = select; - int result = ShowMsg ( LOCALE_BOUQUETEDITOR_DELETE, Bouquets[selected]->channelList->getName(), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo ); - if(result != CMessageBox::mbrYes) + int result = ShowMsg ( LOCALE_BOUQUETEDITOR_DELETE, Bouquets[selected]->channelList->getName(), CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo ); + if(result != CMsgBox::mbrYes) return 0; if (zapitBouquet) { diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index f89f933d3..3cc94094a 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include using namespace std; diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index c6c9bafa3..176f34315 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -59,10 +59,14 @@ #include #include #include -#include -#include #include #include +#if 0 +#include +#include +#else +#include +#endif #include #include @@ -2627,7 +2631,7 @@ void CChannelList::deleteChannel(bool ask) if (!bouquet || !bouquet->zapitBouquet) return; - if (ask && ShowMsg(LOCALE_FILEBROWSER_DELETE, (*chanlist)[selected]->getName(), CMessageBox::mbrNo, CMessageBox::mbYes|CMessageBox::mbNo)!=CMessageBox::mbrYes) + if (ask && ShowMsg(LOCALE_FILEBROWSER_DELETE, (*chanlist)[selected]->getName(), CMsgBox::mbrNo, CMsgBox::mbYes|CMsgBox::mbNo)!=CMsgBox::mbrYes) return; bouquet->zapitBouquet->removeService((*chanlist)[selected]->getChannelID()); @@ -2718,7 +2722,7 @@ bool CChannelList::addChannelToBouquet() } } } else { - ShowMsg(LOCALE_EXTRA_ADD_TO_BOUQUET, LOCALE_EXTRA_CHALREADYINBQ, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_EXTRA_ADD_TO_BOUQUET, LOCALE_EXTRA_CHALREADYINBQ, CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO); return false; } } diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 69d1fb7d3..29ab9ba9e 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -57,6 +57,10 @@ CComponentsForm::CComponentsForm( const int x_pos, const int y_pos, const int w, corner_type = CORNER_ALL; cc_item_index = 0; + //add default exit keys for exec handler + v_exit_keys.push_back(CRCInput::RC_home); + v_exit_keys.push_back(CRCInput::RC_setup); + v_cc_items.clear(); append_x_offset = 0; @@ -69,7 +73,7 @@ CComponentsForm::CComponentsForm( const int x_pos, const int y_pos, const int w, page_scroll_mode = PG_SCROLL_M_UP_DOWN_KEY; //connect page scroll slot - sigc::slot3 sl = sigc::mem_fun(*this, &CComponentsForm::execPageScroll); + sigc::slot4 sl = sigc::mem_fun(*this, &CComponentsForm::execPageScroll); this->OnExec.connect(sl); } @@ -91,74 +95,65 @@ CComponentsForm::~CComponentsForm() int CComponentsForm::exec() { dprintf(DEBUG_NORMAL, "[CComponentsForm] [%s - %d] \n", __func__, __LINE__); - OnBeforeExec(); + + //basic values neutrino_msg_t msg; neutrino_msg_data_t data; - int res = menu_return::RETURN_REPAINT; - uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(-1); - //required exit keys - msg_list_t exit_keys[2]; - exit_keys[0].msg = CRCInput::RC_setup; - exit_keys[1].msg = CRCInput::RC_home; + //allow exec loop + bool cancel_exec = false; - bool exit_loop = false; - while (!exit_loop) + //signal before exec + OnBeforeExec(); + + while (!cancel_exec) { g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd ); //execute connected slots - OnExec(msg, data, res); - + OnExec(msg, data, res, cancel_exec); //exit loop - execExit(msg, data, res, exit_loop, exit_keys, 2); + execExit(msg, data, res, cancel_exec, v_exit_keys); if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) { dprintf(DEBUG_INFO, "[CComponentsForm] [%s - %d] messages_return::cancel_all\n", __func__, __LINE__); res = menu_return::RETURN_EXIT_ALL; - exit_loop = EXIT; + cancel_exec = EXIT; } } + //signal after exec OnAfterExec(); + return res; } -void CComponentsForm::execKey(neutrino_msg_t& msg, neutrino_msg_data_t& data, int& res, bool& exit_loop, const struct msg_list_t * const msg_list, const size_t& key_count, bool force_exit) -{ - for(size_t i = 0; i < key_count; i++){ - if (execKey(msg, data, res, exit_loop, msg_list[i].msg, force_exit)){ - break; - } - } -} - -void CComponentsForm::execKey(neutrino_msg_t& msg, neutrino_msg_data_t& data, int& res, bool& exit_loop, const std::vector& v_msg_list, bool force_exit) +void CComponentsForm::execKey(neutrino_msg_t& msg, neutrino_msg_data_t& data, int& res, bool& cancel_exec, const std::vector& v_msg_list, bool force_exit) { for(size_t i = 0; i < v_msg_list.size(); i++){ - if (execKey(msg, data, res, exit_loop, v_msg_list[i], force_exit)){ + if (execKey(msg, data, res, cancel_exec, v_msg_list[i], force_exit)){ break; } } } -inline bool CComponentsForm::execKey(neutrino_msg_t& msg, neutrino_msg_data_t& data, int& res, bool& exit_loop, const neutrino_msg_t& msg_val, bool force_exit) +inline bool CComponentsForm::execKey(neutrino_msg_t& msg, neutrino_msg_data_t& data, int& res, bool& cancel_exec, const neutrino_msg_t& msg_val, bool force_exit) { if (msg == msg_val){ OnExecMsg(msg, data, res); if (force_exit) - exit_loop = EXIT; + cancel_exec = EXIT; return true; } return false; } -void CComponentsForm::execPageScroll(neutrino_msg_t& msg, neutrino_msg_data_t& /*data*/, int& /*res*/) +void CComponentsForm::execPageScroll(neutrino_msg_t& msg, neutrino_msg_data_t& /*data*/, int& /*res*/, bool& /*cancel_exec*/) { if (page_scroll_mode == PG_SCROLL_M_OFF) return; @@ -178,9 +173,9 @@ void CComponentsForm::execPageScroll(neutrino_msg_t& msg, neutrino_msg_data_t& / } } -void CComponentsForm::execExit(neutrino_msg_t& msg, neutrino_msg_data_t& data, int& res, bool& exit_loop, const struct msg_list_t * const msg_list, const size_t& key_count) +void CComponentsForm::execExit(neutrino_msg_t& msg, neutrino_msg_data_t& data, int& res, bool& cancel_exec, const std::vector& v_msg_list) { - execKey(msg, data, res, exit_loop, msg_list, key_count, true); + execKey(msg, data, res, cancel_exec, v_msg_list, true); } @@ -558,14 +553,14 @@ void CComponentsForm::setPageCount(const u_int8_t& pageCount) u_int8_t CComponentsForm::getPageCount() { - u_int8_t num = 1; + u_int8_t num = 0; for(size_t i=0; igetPageNumber(); num = max(item_num, num); } //convert type, possible -Wconversion warnings! - page_count = static_cast(num); + page_count = static_cast(num+1); return page_count; } diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index 2efc89bf5..82a1a4df2 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -56,6 +56,9 @@ class CComponentsForm : public CComponentsItem ///enable/disable page scrolling, default enabled with page scroll mode up/down keys, see also enablePageScroll() int page_scroll_mode; + ///container for exit keys, default exit keys are CRCInput::RC_home and CRCInput::RC_setup + std::vector v_exit_keys; + ///initialize basic properties virtual void Init( const int& x_pos, const int& y_pos, const int& w, const int& h, const fb_pixel_t& color_frame, @@ -149,6 +152,11 @@ class CComponentsForm : public CComponentsItem ///exec main method, see also sub exec methods virtual int exec(); + ///adds additional exec key to current collection, default exit keys are CRCInput::RC_home and CRCInput::RC_setup + virtual void addExitKey(const neutrino_msg_t& key){v_exit_keys.push_back(key);} + ///remove all current exec keys from current collection, NOTE: use addExitKey() if new exec key is required + virtual void removeExitKeys(){v_exit_keys.clear();} + ///enum exec loop control enum { @@ -156,38 +164,29 @@ class CComponentsForm : public CComponentsItem EXIT = 1 }; ///execKey() methods handle events for defined neutrino messages, see class CRCInput::, this methodes contains a signal handler named OnExecMsg, so it is possible to connect with any common function or method - ///exec sub method for pressed keys, parameters1/2 by rev, parameter3 msg_list as struct contains a list of possible RC-messages for defined message, parameter4 defines size of struct, parameter5 force_exit default = false - virtual void execKey( neutrino_msg_t& msg, - neutrino_msg_data_t& data, - int& res, - bool& exit_loop, - const struct msg_list_t * const msg_list, - const size_t& key_count, - bool force_exit = false); ///exec sub method for pressed keys, parameters1/2 by rev, parameter3 msg_list as vector contains a list of possible RC-messages for defined message, parameter4 force_exit default = false virtual void execKey( neutrino_msg_t& msg, neutrino_msg_data_t& data, int& res, - bool& exit_loop, + bool& cancel_exec, const std::vector& msg_list, bool force_exit = false); ///exec sub method for pressed key, parameters1/2 by rev, parameter3 force_exit default = false virtual bool execKey( neutrino_msg_t& msg, neutrino_msg_data_t& data, int& res, - bool& exit_loop, + bool& cancel_exec, const neutrino_msg_t& msg_val, bool force_exit = false); ///exec sub method for page scroll, parameter1 neutrino_msg_t by rev - virtual void execPageScroll(neutrino_msg_t& msg, neutrino_msg_data_t& data, int& res); + virtual void execPageScroll(neutrino_msg_t& msg, neutrino_msg_data_t& data, int& res, bool& cancel_exec); ///exec sub method for exit loop, parameters by rev virtual void execExit( neutrino_msg_t& msg, neutrino_msg_data_t& data, - int& res, bool& exit_loop, - const struct msg_list_t * const msg_list, - const size_t& key_count); + int& res, bool& cancel_exec, + const std::vector& v_msg_list); ///enum scroll direction enum diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index b5fd5ddef..5986bf888 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -124,7 +124,8 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const cc_btn_font = NULL; cc_btn_icon = icon_name; cc_btn_capt = caption; - cc_btn_msg = CRCInput::RC_nokey; + cc_directKey = CRCInput::RC_nokey; + cc_directKeyAlt = cc_directKey; cc_btn_result = -1; cc_btn_alias = -1; @@ -187,12 +188,13 @@ void CComponentsButton::initCaption() } //set basic properties + int w_frame = max(fr_thickness, fr_thickness_sel); if (cc_btn_capt_obj){ //position and size - int x_cap = fr_thickness; + int x_cap = w_frame; x_cap += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() : 0; - int w_cap = width - fr_thickness - append_x_offset - x_cap - fr_thickness; + int w_cap = width - w_frame - append_x_offset - x_cap - w_frame; int h_cap = height*65/100 /*- 2*fr_thickness*/; /*NOTE: @@ -201,7 +203,7 @@ void CComponentsButton::initCaption() but text render isn't wrong here, because capitalized chars or long chars like e. 'q', 'y' are considered! Therefore we here need other icons or a hack, that considers some different height values. */ - int y_cap = height/2 - h_cap/2 + fr_thickness/2; + int y_cap = height/2 - h_cap/2 + w_frame/2; cc_btn_capt_obj->setDimensionsAll(x_cap, y_cap, w_cap, h_cap); @@ -216,14 +218,14 @@ void CComponentsButton::initCaption() cc_btn_capt_obj->setTextColor(this->cc_item_enabled ? cc_btn_capt_col : cc_btn_capt_disable_col); //corner of text item - cc_btn_capt_obj->setCorner(corner_rad-fr_thickness, corner_type); + cc_btn_capt_obj->setCorner(corner_rad-w_frame, corner_type); } //handle common position of icon and text inside container required for alignment - int w_required = fr_thickness + append_x_offset; + int w_required = w_frame + append_x_offset; w_required += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() + append_x_offset : 0; w_required += cc_btn_font ? cc_btn_font->getRenderWidth(cc_btn_capt) : 0; - w_required += append_x_offset + fr_thickness; + w_required += append_x_offset + w_frame; //dynamic width if (w_required > width){ @@ -235,7 +237,7 @@ void CComponentsButton::initCaption() int x_icon = width/2 - w_required/2 /*+ fr_thickness + append_x_offset*/; int w_icon = 0; if (cc_btn_icon_obj){ - x_icon += fr_thickness + append_x_offset; + x_icon += w_frame + append_x_offset; cc_btn_icon_obj->setXPos(x_icon); w_icon = cc_btn_icon_obj->getWidth(); /*in case of dynamic changed height of caption or button opbject itself, diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index 1b9123b41..80653e2be 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -70,8 +70,10 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen ///property: icon name, only icons supported, to find in gui/widget/icons.h std::string cc_btn_icon; - ///property: assigned event message value, see driver/rcinput.h for possible values, default value = CRCInput::RC_nokey, see also setButtonEventMsg(), getButtonEventMsg() - neutrino_msg_t cc_btn_msg; + ///property: assigned event message value, see driver/rcinput.h for possible values, default value = CRCInput::RC_nokey, see also setButtonDirectKey(), getButtonDirectKey() + neutrino_msg_t cc_directKey; + ///property: assigned an alternate event message value, see driver/rcinput.h for possible values, default value = CRCInput::RC_nokey, see also setButtonDirectKeyAlt(), getButtonDirectKeyAlt() + neutrino_msg_t cc_directKeyAlt; ///property: assigned return value, see also setButtonResult(), getButtonResult(), default value = -1 (not defined) int cc_btn_result; ///property: assigned alias value, see also setButtonAlias(), getButtonAlias(), default value = -1 (not defined) @@ -133,7 +135,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ///set text color - virtual void setButtonTextColor(fb_pixel_t text_color, fb_pixel_t text_color_disabled = COL_MENUCONTENTINACTIVE_TEXT){cc_btn_capt_col = text_color; cc_btn_capt_disable_col = text_color_disabled;} + inline virtual void setButtonTextColor(fb_pixel_t caption_color){cc_btn_capt_col = caption_color;}; /**Member to modify background behavior of embeded caption object. * @param[in] mode @@ -162,9 +164,9 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen virtual void setCaption(const neutrino_locale_t locale_text); ///get caption, type as std::string - virtual std::string getCaptionString(){return cc_btn_capt;}; + inline virtual std::string getCaptionString(){return cc_btn_capt;}; ///get loacalized caption id, type = neutrino_locale_t - virtual neutrino_locale_t getCaptionLocale(){return cc_btn_capt_locale;}; + inline virtual neutrino_locale_t getCaptionLocale(){return cc_btn_capt_locale;}; ///property: set font for label caption, parameter as font object, value NULL causes usaage of dynamic font virtual void setButtonFont(Font* font){cc_btn_font = font; initCCBtnItems();}; @@ -176,17 +178,21 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); ///assigns an event msg value to button object, parameter1 as neutrino_msg_t, see driver/rcinput.h for possible values - virtual void setButtonEventMsg(const neutrino_msg_t& msg){cc_btn_msg = msg;}; - ///return an event msg value to button object, see driver/rcinput.h for possible values - inline virtual neutrino_msg_t getButtonEventMsg(){return cc_btn_msg;}; + inline virtual void setButtonDirectKey(const neutrino_msg_t& msg){cc_directKey = msg;}; + ///assigns an alternate event msg value to button object, parameter1 as neutrino_msg_t, see driver/rcinput.h for possible values + inline virtual void setButtonDirectKeyA(const neutrino_msg_t& msg){cc_directKeyAlt = msg;}; + ///returns an event msg value to button object, see driver/rcinput.h for possible values + inline virtual neutrino_msg_t getButtonDirectKey(){return cc_directKey;}; + ///returns an alternate event msg value to button object, but returns the primary direct key if no key was defined, see driver/rcinput.h for possible values + inline virtual neutrino_msg_t getButtonDirectKeyA(){return cc_directKeyAlt != CRCInput::RC_nokey ? cc_directKeyAlt : cc_directKey ;}; ///assigns an return value to button object, parameter1 as int - virtual void setButtonResult(const int& result_value){cc_btn_result = result_value;}; + inline virtual void setButtonResult(const int& result_value){cc_btn_result = result_value;}; ///returns current result value of button object inline virtual int getButtonResult(){return cc_btn_result;}; ///assigns an alias value to button object, parameter1 as int, e.g. previous known as mbYes, mbNo... from message boxes - virtual void setButtonAlias(const int& alias_value){cc_btn_alias = alias_value;}; + inline virtual void setButtonAlias(const int& alias_value){cc_btn_alias = alias_value;}; ///returns an alias value from button object, see also cc_btn_alias inline virtual int getButtonAlias(){return cc_btn_alias;}; }; @@ -239,6 +245,7 @@ class CComponentsButtonGreen : public CComponentsButton :CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_GREEN, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_GREEN; + }; CComponentsButtonGreen( const int& x_pos, const int& y_pos, const int& w, const int& h, const neutrino_locale_t& caption_locale, diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 0eec2443c..5b6da399e 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -144,9 +144,8 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn_min, (btn_contour ? height-2*fr_thickness : height), txt, icon_name); btn->setButtonFont(ccf_btn_font); btn->doPaintBg(btn_contour); - btn->enableFrame(btn_contour); - btn->setButtonTextColor(COL_MENUFOOT_TEXT); - btn->setButtonEventMsg(content[i].btn_msg); + btn->setButtonDirectKey(content[i].directKey); + btn->setButtonDirectKeyA(content[i].directKeyAlt); btn->setButtonResult(content[i].btn_result); btn->setButtonAlias(content[i].btn_alias); @@ -164,6 +163,9 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont btn->setColorFrame(f_col); } + if (btn_contour) + btn->setFrameThickness(3, 3); + chain->addCCItem(btn); //set x position of next button object @@ -200,7 +202,8 @@ void CComponentsFooter::setButtonLabels(const struct button_label_l * const cont for (size_t i= 0; i< label_count; i++){ buttons[i].button = content[i].button; buttons[i].text = content[i].locale != NONEXISTANT_LOCALE ? g_Locale->getText(content[i].locale) : ""; - buttons[i].btn_msg = content[i].btn_msg; + buttons[i].directKey = content[i].directKey; + buttons[i].directKeyAlt = content[i].directKeyAlt; buttons[i].btn_result = content[i].btn_result; buttons[i].btn_alias = content[i].btn_alias; } @@ -217,7 +220,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label * const conten buttons[i].locale = content[i].locale; //NOTE: here are used default values, because old button label struct don't know about this, //if it possible, don't use this methode! - buttons[i].btn_msg = CRCInput::RC_nokey; + buttons[i].directKey = buttons[i].directKeyAlt = CRCInput::RC_nokey; buttons[i].btn_result = -1; buttons[i].btn_alias = -1; } @@ -232,7 +235,8 @@ void CComponentsFooter::setButtonLabels(const vector &v_content, for (size_t i= 0; i< label_count; i++){ buttons[i].button = v_content[i].button; buttons[i].locale = v_content[i].locale; - buttons[i].btn_msg = v_content[i].btn_msg; + buttons[i].directKey = v_content[i].directKey; + buttons[i].directKeyAlt = v_content[i].directKeyAlt; buttons[i].btn_result = v_content[i].btn_result; buttons[i].btn_alias = v_content[i].btn_alias; } @@ -248,7 +252,8 @@ void CComponentsFooter::setButtonLabels(const vector &v_content, for (size_t i= 0; i< label_count; i++){ buttons[i].button = v_content[i].button; buttons[i].text = v_content[i].text; - buttons[i].btn_msg = v_content[i].btn_msg; + buttons[i].directKey = v_content[i].directKey; + buttons[i].directKeyAlt = v_content[i].directKeyAlt; buttons[i].btn_result = v_content[i].btn_result; buttons[i].btn_alias = v_content[i].btn_alias; } @@ -256,24 +261,39 @@ void CComponentsFooter::setButtonLabels(const vector &v_content, setButtonLabels(buttons, label_count, chain_width, label_width); } -void CComponentsFooter::setButtonLabel(const char *button_icon, const std::string& text, const int& chain_width, const int& label_width, const neutrino_msg_t& msg, const int& result_value, const int& alias_value) +void CComponentsFooter::setButtonLabel( const char *button_icon, + const std::string& text, + const int& chain_width, + const int& label_width, + const neutrino_msg_t& msg, + const int& result_value, + const int& alias_value, + const neutrino_msg_t& directKeyAlt) { button_label_s button[1]; button[0].button = button_icon; button[0].text = text; - button[0].btn_msg = msg; + button[0].directKey = msg; + button[0].directKeyAlt = directKeyAlt; button[0].btn_result = result_value; button[0].btn_alias = alias_value; setButtonLabels(button, 1, chain_width, label_width); } -void CComponentsFooter::setButtonLabel(const char *button_icon, const neutrino_locale_t& locale, const int& chain_width, const int& label_width, const neutrino_msg_t& msg, const int& result_value, const int& alias_value) +void CComponentsFooter::setButtonLabel( const char *button_icon, + const neutrino_locale_t& locale, + const int& chain_width, + const int& label_width, + const neutrino_msg_t& msg, + const int& result_value, + const int& alias_value, + const neutrino_msg_t& directKeyAlt) { string txt = locale != NONEXISTANT_LOCALE ? g_Locale->getText(locale) : ""; - setButtonLabel(button_icon, txt, chain_width, label_width, msg, result_value, alias_value); + setButtonLabel(button_icon, txt, chain_width, label_width, msg, result_value, alias_value, directKeyAlt); } void CComponentsFooter::showButtonContour(bool show) @@ -325,3 +345,14 @@ void CComponentsFooter::paintButtons(const int& x_pos, this->paint(do_save_bg); } + +void CComponentsFooter::setButtonText(const uint& btn_id, const std::string& text) +{ + CComponentsItem *item = getButtonChainObject()->getCCItem(btn_id); + if (item){ + CComponentsButton *button = static_cast(item); + button->setCaption(text); + } + else + dprintf(DEBUG_NORMAL, "[CComponentsForm] [%s - %d] Error: can't set button text, possible wrong btn_id=%u, item=%p...\n", __func__, __LINE__, btn_id, item); +} diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index bf9a16e2a..053a6d3da 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -34,7 +34,8 @@ typedef struct button_label_s { const char * button; std::string text; - neutrino_msg_t btn_msg; + neutrino_msg_t directKey; + neutrino_msg_t directKeyAlt; int btn_result; int btn_alias; } button_label_s_struct; @@ -43,7 +44,8 @@ typedef struct button_label_l { const char * button; neutrino_locale_t locale; - neutrino_msg_t btn_msg; + neutrino_msg_t directKey; + neutrino_msg_t directKeyAlt; int btn_result; int btn_alias; } button_label_l_struct; @@ -106,9 +108,23 @@ class CComponentsFooter : public CComponentsHeader void setButtonLabels(const struct button_label * const content, const size_t& label_count, const int& chain_width = 0, const int& label_width = 0); ///add single button label with string label type as content, chain_width as int, label width as int - void setButtonLabel(const char *button_icon, const std::string& text, const int& chain_width = 0, const int& label_width = 0, const neutrino_msg_t& msg = CRCInput::RC_nokey, const int& result_value = -1, const int& alias_value = -1); + void setButtonLabel( const char *button_icon, + const std::string& text, + const int& chain_width = 0, + const int& label_width = 0, + const neutrino_msg_t& msg = CRCInput::RC_nokey, + const int& result_value = -1, + const int& alias_value = -1, + const neutrino_msg_t& directKeyAlt = CRCInput::RC_nokey); ///add single button label with locale label type as content, chain_width as int, label width as int - void setButtonLabel(const char *button_icon, const neutrino_locale_t& locale, const int& chain_width = 0, const int& label_width = 0, const neutrino_msg_t& msg = CRCInput::RC_nokey, const int& result_value = -1, const int& alias_value = -1); + void setButtonLabel( const char *button_icon, + const neutrino_locale_t& locale, + const int& chain_width = 0, + const int& label_width = 0, + const neutrino_msg_t& msg = CRCInput::RC_nokey, + const int& result_value = -1, + const int& alias_value = -1, + const neutrino_msg_t& directKeyAlt = CRCInput::RC_nokey); ///causes show/hide countour of button frame and background, parameter bool show, default= true void showButtonContour(bool show = true); @@ -120,12 +136,26 @@ class CComponentsFooter : public CComponentsHeader ///returns selected button object, return value as pointer to object, NULL means nothing is selected CComponentsButton* getSelectedButtonObject(); + /*! + Sets a new text to an already predefined button. + 1st parameter 'btn_id' accepts current id of an already defined button. 2nd parameter sets the new text as std::string + Usage: + Buttons come with any text eg. 'Ok', 'No', 'Yes' ...whatever and this member allows to manipulate the text via button id. + Button id means the showed button begins from the left position of button chain, starts with value=0, also to get via getButtonChainObject()->getCCItemId([CComponentsButton*]) + example: 1st buttons text is 'Hello', 2nd Button's text is 'You!', + Now we want to change the text of 2nd button to 'World", so we must do this: + setButtonText(1, "World"); + Wrong id's will be ignored. + */ + void setButtonText(const uint& btn_id, const std::string& text); + ///property: set font for label caption, parameter as font object, value NULL causes usage of dynamic font void setButtonFont(Font* font){ccf_btn_font = font;}; ///returns pointer to internal button container CComponentsFrmChain* getButtonChainObject(){return chain;}; + ///this is a nearly methode similar with the older button handler find in gui/widget/buttons.h, some parameters are different, but require minimalized input ///this member sets some basic parameters and will paint concurrently on execute, explicit call of paint() is not required void paintButtons( const int& x_pos, diff --git a/src/gui/components/cc_frm_window.h b/src/gui/components/cc_frm_window.h index 212db8ef7..6d1807798 100644 --- a/src/gui/components/cc_frm_window.h +++ b/src/gui/components/cc_frm_window.h @@ -222,6 +222,11 @@ class CComponentsWindow : public CComponentsForm ///paint all window items, this overwriting paint() from CComponentsForm void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); + + ///adds additional exec key to current collection, default exit keys are CRCInput::RC_home and CRCInput::RC_setup + virtual void addExitKey(const neutrino_msg_t& key){getBodyObject()->addExitKey(key);} + ///remove all current exec keys from current collection, NOTE: use addExitKey() if new exec key is required + virtual void removeExitKeys(){getBodyObject()->removeExitKeys();} }; class CComponentsWindowMax : public CComponentsWindow diff --git a/src/gui/components/cc_signals.h b/src/gui/components/cc_signals.h index feee1ef67..da6a6d8b2 100644 --- a/src/gui/components/cc_signals.h +++ b/src/gui/components/cc_signals.h @@ -102,7 +102,7 @@ class CComponentsSignals : public sigc::trackable sigc::signal OnAfterExec; ///signal on execute of CComponentsForm::exec() - sigc::signal OnExec; + sigc::signal OnExec; ///signal on received message in CComponentsForm::execKey() sigc::signal OnExecMsg; diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index 549bf2c30..6a3490a6a 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -125,9 +125,9 @@ typedef struct cc_screen_data_t //combination of rc messages with related icon typedef struct msg_list_t { - neutrino_msg_t msg; + neutrino_msg_t directKey; const char* icon; -} key_list_t; +} msg_list_struct_t; //align types enum diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 4cd2ef8a3..9b2f2026b 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include "bouquetlist.h" @@ -1293,7 +1293,7 @@ int EpgPlus::MenuTargetAddReminder::exec (CMenuTarget * /*parent*/, const std::s g_Timerd->addZaptoTimerEvent (this->epgPlus->selectedChannelEntry->channel->getChannelID(), (*It)->channelEvent.startTime - (g_settings.zapto_pre_time * 60), (*It)->channelEvent.startTime - ANNOUNCETIME - (g_settings.zapto_pre_time * 60), 0, (*It)->channelEvent.eventID, (*It)->channelEvent.startTime, 0); ShowMsg (LOCALE_TIMER_EVENTTIMED_TITLE, g_Locale->getText (LOCALE_TIMER_EVENTTIMED_MSG) - , CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 + , CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 } else printf ("timerd not available\n"); } @@ -1330,7 +1330,7 @@ int EpgPlus::MenuTargetAddRecordTimer::exec (CMenuTarget * /*parent*/, const std printf("already found in moviebrowser: %s\n", rec_title); char message[1024]; snprintf(message, sizeof(message)-1, g_Locale->getText(LOCALE_RECORDING_ALREADY_FOUND), rec_title); - doRecord = (ShowMsg(LOCALE_RECORDING_ALREADY_FOUND_CHECK, message, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes); + doRecord = (ShowMsg(LOCALE_RECORDING_ALREADY_FOUND_CHECK, message, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo) == CMsgBox::mbrYes); } } if (g_Timerd->isTimerdAvailable() && doRecord) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 521d9b3d7..9133b56bd 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include @@ -1101,7 +1101,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start printf("already found in moviebrowser: %s\n", rec_title); char message[1024]; snprintf(message, sizeof(message)-1, g_Locale->getText(LOCALE_RECORDING_ALREADY_FOUND), rec_title); - doRecord = (ShowMsg(LOCALE_RECORDING_ALREADY_FOUND_CHECK, message, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes); + doRecord = (ShowMsg(LOCALE_RECORDING_ALREADY_FOUND_CHECK, message, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo) == CMsgBox::mbrYes); } } if (doRecord && !call_fromfollowlist) @@ -1131,11 +1131,11 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start epgData.eventID, epgData.epg_times.startzeit, epgData.epg_times.startzeit - (ANNOUNCETIME + 120 ), TIMERD_APIDS_CONF, true, epgData.epg_times.startzeit - (ANNOUNCETIME + 120) > time(NULL), recDir, true); - ShowMsg(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } } else { - ShowMsg(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } } @@ -1165,7 +1165,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start stars = tmdb->getStars(); showText(showPos, sy + toph, tmdb_active); } else { - ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMessageBox::mbrOk , CMessageBox::mbrOk); + ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMsgBox::mbrOk , CMsgBox::mbrOk); } delete tmdb; } else { @@ -1194,7 +1194,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start epgData.epg_times.startzeit - (g_settings.zapto_pre_time * 60), epgData.epg_times.startzeit - ANNOUNCETIME - (g_settings.zapto_pre_time * 60), 0, epgData.eventID, epgData.epg_times.startzeit, 0); - ShowMsg(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index ddb63f8cb..9ebeeba47 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -39,7 +39,7 @@ #include #include -#include +#include #include #include @@ -475,7 +475,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna printf("already found in moviebrowser: %s\n", rec_title); char message[1024]; snprintf(message, sizeof(message)-1, g_Locale->getText(LOCALE_RECORDING_ALREADY_FOUND), rec_title); - doRecord = (ShowMsg(LOCALE_RECORDING_ALREADY_FOUND_CHECK, message, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes); + doRecord = (ShowMsg(LOCALE_RECORDING_ALREADY_FOUND_CHECK, message, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo) == CMsgBox::mbrYes); } } t_channel_id used_id = IS_WEBTV(channel_id) ? channel_id : evtlist[selected].channelID; @@ -511,7 +511,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna evtlist[selected].startTime - (g_settings.zapto_pre_time * 60), evtlist[selected].startTime - ANNOUNCETIME - (g_settings.zapto_pre_time * 60), 0, evtlist[selected].eventID, evtlist[selected].startTime, 0); - //ShowMsg(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + //ShowMsg(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO); timerlist.clear(); g_Timerd->getTimerList (timerlist); paint(evtlist[selected].channelID ); diff --git a/src/gui/favorites.cpp b/src/gui/favorites.cpp index c3d978f99..041cf35d1 100644 --- a/src/gui/favorites.cpp +++ b/src/gui/favorites.cpp @@ -36,7 +36,7 @@ #include #include -#include +#include #include #include @@ -122,7 +122,7 @@ int CFavorites::exec(CMenuTarget* parent, const std::string & actionKey) #if 0 if (!bouquetList) { - ShowMsg(LOCALE_FAVORITES_BOUQUETNAME, LOCALE_FAVORITES_NOBOUQUETS, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_FAVORITES_BOUQUETNAME, LOCALE_FAVORITES_NOBOUQUETS, CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO); return res; } #endif @@ -147,7 +147,7 @@ int CFavorites::exec(CMenuTarget* parent, const std::string & actionKey) { if (status & 2) str += g_Locale->getText(LOCALE_EXTRA_CHADDED); else str += g_Locale->getText(LOCALE_EXTRA_CHALREADYINBQ); - ShowMsg(LOCALE_EXTRA_ADD_TO_BOUQUET, str, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 + ShowMsg(LOCALE_EXTRA_ADD_TO_BOUQUET, str, CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 } else { @@ -155,7 +155,7 @@ int CFavorites::exec(CMenuTarget* parent, const std::string & actionKey) if (status & 2) str += g_Locale->getText(LOCALE_FAVORITES_CHADDED); else str += g_Locale->getText(LOCALE_FAVORITES_CHALREADYINBQ); if (status) str += g_Locale->getText(LOCALE_FAVORITES_FINALHINT); - ShowMsg(LOCALE_FAVORITES_BOUQUETNAME, str, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 + ShowMsg(LOCALE_FAVORITES_BOUQUETNAME, str, CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 } diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 8a0f84f26..736fc6b0f 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include @@ -800,7 +800,7 @@ bool CFileBrowser::exec(const char * const dirname) _msg << filelist[selected].getFileName(); _msg << " " << g_Locale->getText(LOCALE_FILEBROWSER_DODELETE2); - if (ShowMsg(LOCALE_FILEBROWSER_DELETE, _msg.str(), CMessageBox::mbrNo, CMessageBox::mbYes|CMessageBox::mbNo)==CMessageBox::mbrYes) + if (ShowMsg(LOCALE_FILEBROWSER_DELETE, _msg.str(), CMsgBox::mbrNo, CMsgBox::mbYes|CMsgBox::mbNo)==CMsgBox::mbrYes) { std::string n = filelist[selected].Name; recursiveDelete(n.c_str()); diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index a8afb2431..dcb79167e 100644 --- a/src/gui/hdd_menu.cpp +++ b/src/gui/hdd_menu.cpp @@ -46,7 +46,7 @@ #include #include -#include +#include #include #include @@ -375,8 +375,8 @@ void CHDDMenuHandler::setRecordPath(std::string &dev) } bool old_menu = in_menu; in_menu = false; - int res = ShowMsg(LOCALE_RECORDINGMENU_DEFDIR, LOCALE_HDD_SET_RECDIR, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo); - if(res == CMessageBox::mbrYes) { + int res = ShowMsg(LOCALE_RECORDINGMENU_DEFDIR, LOCALE_HDD_SET_RECDIR, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo); + if(res == CMsgBox::mbrYes) { g_settings.network_nfs_recordingdir = newpath; CRecordManager::getInstance()->SetDirectory(g_settings.network_nfs_recordingdir); if(g_settings.timeshiftdir.empty()) @@ -426,8 +426,8 @@ int CHDDMenuHandler::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t dat if (added && !mounted && tmp != "sr") { std::string message = dev + ": " + g_Locale->getText(LOCALE_HDD_MOUNT_FAILED); message += std::string(" ") + g_Locale->getText(LOCALE_HDD_FORMAT) + std::string(" ?"); - int res = ShowMsg(LOCALE_MESSAGEBOX_INFO, message, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo); - if(res == CMessageBox::mbrYes) { + int res = ShowMsg(LOCALE_MESSAGEBOX_INFO, message, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo); + if(res == CMsgBox::mbrYes) { unsigned char * p = new unsigned char[dev.size() + 1]; if (p) { sprintf((char *)p, "%s", dev.c_str()); @@ -778,7 +778,7 @@ _show_menu: void CHDDMenuHandler::showError(neutrino_locale_t err) { - ShowMsg(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(err), CMessageBox::mbrOk, CMessageBox::mbOk); + ShowMsg(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(err), CMsgBox::mbrOk, CMsgBox::mbOk); } int CHDDMenuHandler::formatDevice(std::string dev) @@ -809,8 +809,8 @@ int CHDDMenuHandler::formatDevice(std::string dev) std::string mkfscmd = devtool->mkfs + " " + devtool->mkfs_options + " " + partname; printf("mkfs cmd: [%s]\n", mkfscmd.c_str()); - res = ShowMsg(LOCALE_HDD_FORMAT, g_Locale->getText(LOCALE_HDD_FORMAT_WARN), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo ); - if(res != CMessageBox::mbrYes) + res = ShowMsg(LOCALE_HDD_FORMAT, g_Locale->getText(LOCALE_HDD_FORMAT_WARN), CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo ); + if(res != CMsgBox::mbrYes) return menu_return::RETURN_REPAINT; bool srun = my_system(3, "killall", "-9", "smbd"); diff --git a/src/gui/keybind_setup.cpp b/src/gui/keybind_setup.cpp index 3db50e64c..4985536fa 100644 --- a/src/gui/keybind_setup.cpp +++ b/src/gui/keybind_setup.cpp @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include @@ -330,7 +330,7 @@ int CKeybindSetup::showKeySetup() strcat(RC_HW_msg, g_Locale->getText(LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_MSG_PART2)); strcat(RC_HW_msg, RC_HW_str[g_settings.remote_control_hardware]); strcat(RC_HW_msg, g_Locale->getText(LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_MSG_PART3)); - if(ShowMsg(LOCALE_MESSAGEBOX_INFO, RC_HW_msg, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_INFO, 450, 15, true) == CMessageBox::mbrNo) { + if(ShowMsg(LOCALE_MESSAGEBOX_INFO, RC_HW_msg, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_INFO, 450, 15) == CMsgBox::mbrNo) { g_settings.remote_control_hardware = org_remote_control_hardware; g_RCInput->CRCInput::set_rc_hw(); } diff --git a/src/gui/lua/lua_hintbox.cpp b/src/gui/lua/lua_hintbox.cpp index cfa25f203..eec52f441 100644 --- a/src/gui/lua/lua_hintbox.cpp +++ b/src/gui/lua/lua_hintbox.cpp @@ -149,7 +149,7 @@ int CLuaInstHintbox::HintboxExec(lua_State *L) res = messages_return::cancel_info; else if (msg == CRCInput::RC_home) res = messages_return::cancel_all; - else if ((D->b->has_scrollbar()) && ((msg == CRCInput::RC_up) || (msg == CRCInput::RC_down))) { + else if (/*(D->b->has_scrollbar()) &&*/ ((msg == CRCInput::RC_up) || (msg == CRCInput::RC_down))) { if (msg == CRCInput::RC_up) D->b->scroll_up(); else diff --git a/src/gui/lua/lua_menue.cpp b/src/gui/lua/lua_menue.cpp index b704b56c8..c8f0fbf5c 100644 --- a/src/gui/lua/lua_menue.cpp +++ b/src/gui/lua/lua_menue.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/gui/lua/lua_messagebox.cpp b/src/gui/lua/lua_messagebox.cpp index 303db0541..9611a1254 100644 --- a/src/gui/lua/lua_messagebox.cpp +++ b/src/gui/lua/lua_messagebox.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include "luainstance.h" @@ -74,10 +74,10 @@ int CLuaInstMessagebox::MessageboxExec(lua_State *L) std::string tmp; if (tableLookup(L, "align", tmp)) { table_key mb[] = { - { "center1", CMessageBox::mbBtnAlignCenter1 }, - { "center2", CMessageBox::mbBtnAlignCenter2 }, - { "left", CMessageBox::mbBtnAlignLeft }, - { "right", CMessageBox::mbBtnAlignRight }, + { "center1", CMsgBox::mbBtnAlignCenter1 }, + { "center2", CMsgBox::mbBtnAlignCenter2 }, + { "left", CMsgBox::mbBtnAlignLeft }, + { "right", CMsgBox::mbBtnAlignRight }, { NULL, 0 } }; for (int i = 0; mb[i].name; i++) @@ -93,12 +93,12 @@ int CLuaInstMessagebox::MessageboxExec(lua_State *L) lua_pushvalue(L, -2); const char *val = lua_tostring(L, -2); table_key mb[] = { - { "yes", CMessageBox::mbYes }, - { "no", CMessageBox::mbNo }, - { "cancel", CMessageBox::mbCancel }, - { "all", CMessageBox::mbAll }, - { "back", CMessageBox::mbBack }, - { "ok", CMessageBox::mbOk }, + { "yes", CMsgBox::mbYes }, + { "no", CMsgBox::mbNo }, + { "cancel", CMsgBox::mbCancel }, + { "all", CMsgBox::mbAll }, + { "back", CMsgBox::mbBack }, + { "ok", CMsgBox::mbOk }, { NULL, 0 } }; for (int i = 0; mb[i].name; i++) @@ -109,14 +109,14 @@ int CLuaInstMessagebox::MessageboxExec(lua_State *L) } lua_pop(L, 1); if ((show_buttons & 0xFF) == 0) - show_buttons |= CMessageBox::mbAll; + show_buttons |= CMsgBox::mbAll; table_key mbr[] = { - { "yes", CMessageBox::mbrYes }, - { "no", CMessageBox::mbrNo }, - { "cancel", CMessageBox::mbrCancel }, - { "back", CMessageBox::mbrBack }, - { "ok", CMessageBox::mbrOk }, + { "yes", CMsgBox::mbrYes }, + { "no", CMsgBox::mbrNo }, + { "cancel", CMsgBox::mbrCancel }, + { "back", CMsgBox::mbrBack }, + { "ok", CMsgBox::mbrOk }, { NULL, 0 } }; if (tableLookup(L, "default", tmp)) { @@ -127,7 +127,7 @@ int CLuaInstMessagebox::MessageboxExec(lua_State *L) } } - int res = ShowMsg(name, text, (CMessageBox::result_) default_button, (CMessageBox::buttons_) show_buttons, icon.empty() ? NULL : icon.c_str(), width, timeout, return_default_on_timeout); + int res = ShowMsg(name, text, (CMsgBox::msg_result_t) default_button, (CMsgBox::button_define_t) show_buttons, icon.empty() ? NULL : icon.c_str(), width, timeout, return_default_on_timeout); tmp = "cancel"; for (int i = 0; mbr[i].name; i++) diff --git a/src/gui/lua/lua_messagebox.h b/src/gui/lua/lua_messagebox.h index 83d2114e2..1269f8332 100644 --- a/src/gui/lua/lua_messagebox.h +++ b/src/gui/lua/lua_messagebox.h @@ -25,7 +25,7 @@ class CLuaMessagebox { public: - CMessageBox *b; + CMsgBox *b; CLuaMessagebox(); ~CLuaMessagebox(); }; diff --git a/src/gui/lua/lua_misc.cpp b/src/gui/lua/lua_misc.cpp index 9b965ae5d..739f7a568 100644 --- a/src/gui/lua/lua_misc.cpp +++ b/src/gui/lua/lua_misc.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/gui/lua/lua_video.cpp b/src/gui/lua/lua_video.cpp index dfef5c7e5..9e1b6774c 100644 --- a/src/gui/lua/lua_video.cpp +++ b/src/gui/lua/lua_video.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index b76adc465..0adee6672 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -46,7 +46,7 @@ #include #include -#include +#include #include #include @@ -125,7 +125,7 @@ int CMiscMenue::exec(CMenuTarget* parent, const std::string &actionKey) unsigned num = CEitManager::getInstance()->getEventsCount(); char str[128]; sprintf(str, "Event count: %d", num); - ShowMsg(LOCALE_MESSAGEBOX_INFO, str, CMessageBox::mbrBack, CMessageBox::mbBack); + ShowMsg(LOCALE_MESSAGEBOX_INFO, str, CMsgBox::mbrBack, CMsgBox::mbBack); return menu_return::RETURN_REPAINT; } else if(actionKey == "energy") diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp index 50a5ed1f8..438e3eebe 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include @@ -230,7 +230,7 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) buf += " "; buf += satname; buf += " ?"; - store = (ShowMsg(LOCALE_MESSAGEBOX_INFO, buf,CMessageBox::mbrNo,CMessageBox::mbNo|CMessageBox::mbYes) == CMessageBox::mbrYes); + store = (ShowMsg(LOCALE_MESSAGEBOX_INFO, buf,CMsgBox::mbrNo,CMsgBox::mbNo|CMsgBox::mbYes) == CMsgBox::mbrYes); } } if(store) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 11f4c5156..147db2845 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -55,7 +55,7 @@ #include #include #include -#include +#include #include #include #include @@ -798,7 +798,7 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) else if (actionKey == "copy_onefile" || actionKey == "copy_several") { bool onefile = (actionKey == "copy_onefile"); - if ((show_mode == MB_SHOW_RECORDS) && (ShowMsg(LOCALE_MESSAGEBOX_INFO, onefile ? LOCALE_MOVIEBROWSER_COPY : LOCALE_MOVIEBROWSER_COPIES, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes)) + if ((show_mode == MB_SHOW_RECORDS) && (ShowMsg(LOCALE_MESSAGEBOX_INFO, onefile ? LOCALE_MOVIEBROWSER_COPY : LOCALE_MOVIEBROWSER_COPIES, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo) == CMsgBox::mbrYes)) { CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_COPYING); hintBox->paint(); @@ -810,7 +810,7 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) bool res = mc.copyMovie(m_movieSelectionHandler, onefile); //g_RCInput->clearRCMsg(); if (res == 0) - ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_COPY_FAILED, CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); + ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_COPY_FAILED, CMsgBox::mbrCancel, CMsgBox::mbCancel, NEUTRINO_ICON_ERROR); else m_doLoadMovies = true; m_doRefresh = true; @@ -820,10 +820,10 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) { #if 0 if ((m_movieSelectionHandler == playing_info) && (NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode())) - ShowMsg(LOCALE_MESSAGEBOX_ERROR, "Impossible to cut playing movie.", CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); + ShowMsg(LOCALE_MESSAGEBOX_ERROR, "Impossible to cut playing movie.", CMsgBox::mbrCancel, CMsgBox::mbCancel, NEUTRINO_ICON_ERROR); else #endif - if ((show_mode == MB_SHOW_RECORDS) && (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_CUT, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes)) + if ((show_mode == MB_SHOW_RECORDS) && (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_CUT, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo) == CMsgBox::mbrYes)) { CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_CUTTING); hintBox->paint(); @@ -835,7 +835,7 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) bool res = mc.cutMovie(m_movieSelectionHandler); //g_RCInput->clearRCMsg(); if (!res) - ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_CUT_FAILED, CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); + ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_CUT_FAILED, CMsgBox::mbrCancel, CMsgBox::mbCancel, NEUTRINO_ICON_ERROR); else m_doLoadMovies = true; m_doRefresh = true; @@ -846,12 +846,12 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) if ((show_mode == MB_SHOW_RECORDS) && m_movieSelectionHandler != NULL) { if ((m_movieSelectionHandler == playing_info) && (NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode())) - ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_TRUNCATE_FAILED_PLAYING, CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); + ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_TRUNCATE_FAILED_PLAYING, CMsgBox::mbrCancel, CMsgBox::mbCancel, NEUTRINO_ICON_ERROR); else if (m_movieSelectionHandler->bookmarks.end == 0) - ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_BOOK_NO_END, CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); + ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_BOOK_NO_END, CMsgBox::mbrCancel, CMsgBox::mbCancel, NEUTRINO_ICON_ERROR); else { - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_TRUNCATE, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_TRUNCATE, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo) == CMsgBox::mbrYes) { CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_TRUNCATING); hintBox->paint(); @@ -861,7 +861,7 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) delete hintBox; g_RCInput->clearRCMsg(); if (!res) - ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_TRUNCATE_FAILED, CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); + ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_TRUNCATE_FAILED, CMsgBox::mbrCancel, CMsgBox::mbCancel, NEUTRINO_ICON_ERROR); else m_doLoadMovies = true; m_doRefresh = true; @@ -1745,7 +1745,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) if (!fname.empty()) { //delete Cover - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, CMsgBox::mbrNo, CMsgBox:: mbYes | CMsgBox::mbNo) == CMsgBox::mbrYes) { unlink(fname.c_str()); refresh(); @@ -2169,7 +2169,7 @@ bool CMovieBrowser::onDeleteFile(MI_MOVIE_INFO *movieinfo, bool skipAsk) int msgBoxWidth = 450; std::string msg = formatDeleteMsg(movieinfo, msgFont, msgBoxWidth); - if ((skipAsk || !movieinfo->delAsk) || (ShowMsg(LOCALE_FILEBROWSER_DELETE, msg, CMessageBox::mbrYes, CMessageBox::mbYes|CMessageBox::mbNo, NULL, msgBoxWidth)==CMessageBox::mbrYes)) + if ((skipAsk || !movieinfo->delAsk) || (ShowMsg(LOCALE_FILEBROWSER_DELETE, msg, CMsgBox::mbrYes, CMsgBox::mbYes|CMsgBox::mbNo, NULL, msgBoxWidth)==CMsgBox::mbrYes)) { CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_MOVIEBROWSER_DELETE_INFO)); hintBox->paint(); @@ -2245,7 +2245,7 @@ bool CMovieBrowser::onDelete(bool cursor_only) char buf1[1024]; snprintf(buf1, sizeof(buf1), g_Locale->getText(LOCALE_MOVIEBROWSER_ASK_REC_TO_DELETE), delName.c_str()); if (ShowMsg(LOCALE_RECORDINGMENU_RECORD_IS_RUNNING, buf1, - CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrNo) + CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450, 30, false) == CMsgBox::mbrNo) toDelete = false; else { CTimerd::RecordingStopInfo recinfo; @@ -2266,7 +2266,7 @@ bool CMovieBrowser::onDelete(bool cursor_only) if (!dellist.empty()) { bool skipAsk = false; if (dellist_cnt > 1) - skipAsk = (ShowMsg(LOCALE_FILEBROWSER_DELETE, LOCALE_MOVIEBROWSER_DELETE_ALL, CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes); + skipAsk = (ShowMsg(LOCALE_FILEBROWSER_DELETE, LOCALE_MOVIEBROWSER_DELETE_ALL, CMsgBox::mbrNo, CMsgBox:: mbYes | CMsgBox::mbNo) == CMsgBox::mbrYes); for (dellist_it = dellist.begin(); dellist_it != dellist.end(); ++dellist_it) result |= onDeleteFile((MI_MOVIE_INFO *)&(*dellist_it), skipAsk); dellist.clear(); @@ -3608,7 +3608,7 @@ int CYTCacheSelectorTarget::exec(CMenuTarget* /*parent*/, const std::string & ac cYTCache::getInstance()->remove(&movieBrowser->yt_completed[selected - movieBrowser->yt_completed_offset]); } else if (actionKey.empty()) { if (movieBrowser->yt_pending_offset && selected >= movieBrowser->yt_pending_offset && selected < movieBrowser->yt_pending_end) { - if (ShowMsg (LOCALE_MOVIEBROWSER_YT_CACHE, g_Locale->getText(LOCALE_MOVIEBROWSER_YT_CANCEL_TRANSFER), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) + if (ShowMsg (LOCALE_MOVIEBROWSER_YT_CACHE, g_Locale->getText(LOCALE_MOVIEBROWSER_YT_CANCEL_TRANSFER), CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo) == CMsgBox::mbrYes) cYTCache::getInstance()->cancel(&movieBrowser->yt_pending[selected - movieBrowser->yt_pending_offset]); else return menu_return::RETURN_NONE; diff --git a/src/gui/moviebrowser/mb_help.h b/src/gui/moviebrowser/mb_help.h index dc77e86d1..b16a1dd47 100644 --- a/src/gui/moviebrowser/mb_help.h +++ b/src/gui/moviebrowser/mb_help.h @@ -51,21 +51,31 @@ class CMovieHelp : public CMenuTarget int exec(CMenuTarget* /*parent*/, const std::string & /*actionKey*/) { - Helpbox helpbox; - helpbox.addLine(NEUTRINO_ICON_BUTTON_RED, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_RED)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_GREEN, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_GREEN)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_YELLOW, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_YELLOW)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_BLUE, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_BLUE)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_MENU_SMALL,g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_MENU)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_PLAY, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_PLAY)); - helpbox.addLine(""); - helpbox.addLine(NEUTRINO_ICON_BUTTON_OKAY, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_OKAY)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_MUTE_SMALL,g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_MUTE)); - helpbox.addLine(""); - helpbox.addLine(NEUTRINO_ICON_BUTTON_LEFT, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_LEFT)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_RIGHT, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_RIGHT)); - helpbox.show(LOCALE_MESSAGEBOX_INFO); - return(0); + Helpbox helpbox(g_Locale->getText(LOCALE_HELP_BOX_TITLE)); + helpbox.addLine("Standard functions", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 10, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]); + helpbox.addSeparatorLine(); + helpbox.addLine(NEUTRINO_ICON_BUTTON_RED, "Change sort", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); + helpbox.addLine(NEUTRINO_ICON_BUTTON_GREEN, "Show filter window", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); + helpbox.addLine(NEUTRINO_ICON_BUTTON_YELLOW, "Changing the active window", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); + helpbox.addLine(NEUTRINO_ICON_BUTTON_BLUE, "Reload recording info", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); + helpbox.addLine(NEUTRINO_ICON_BUTTON_MENU, "Open Moviebrowser menue", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); + helpbox.addLine("+/- Change view", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); + helpbox.addSeparator(); +#if 0 + helpbox.addPagebreak(); +#endif + helpbox.addLine("During playback", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 10, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]); + helpbox.addSeparatorLine(); + helpbox.addLine(NEUTRINO_ICON_BUTTON_BLUE, "Marking menu", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); + helpbox.addLine(NEUTRINO_ICON_BUTTON_0, "Not perform marking action", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); + + helpbox.addExitKey(CRCInput::RC_ok); + + helpbox.show(); + int ret = helpbox.exec(); + helpbox.hide(); + + return ret; } }; diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 12e74be70..960022af5 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -2187,7 +2187,7 @@ void CMoviePlayerGui::UpdatePosition() void CMoviePlayerGui::showHelpTS() { - Helpbox helpbox; + Helpbox helpbox(g_Locale->getText(LOCALE_MESSAGEBOX_INFO)); helpbox.addLine(NEUTRINO_ICON_BUTTON_RED, g_Locale->getText(LOCALE_MOVIEPLAYER_TSHELP1)); helpbox.addLine(NEUTRINO_ICON_BUTTON_GREEN, g_Locale->getText(LOCALE_MOVIEPLAYER_TSHELP2)); helpbox.addLine(NEUTRINO_ICON_BUTTON_YELLOW, g_Locale->getText(LOCALE_MOVIEPLAYER_TSHELP3)); @@ -2200,7 +2200,7 @@ void CMoviePlayerGui::showHelpTS() helpbox.addLine(NEUTRINO_ICON_BUTTON_7, g_Locale->getText(LOCALE_MOVIEPLAYER_TSHELP10)); helpbox.addLine(NEUTRINO_ICON_BUTTON_9, g_Locale->getText(LOCALE_MOVIEPLAYER_TSHELP11)); helpbox.addLine(g_Locale->getText(LOCALE_MOVIEPLAYER_TSHELP12)); - helpbox.show(LOCALE_MESSAGEBOX_INFO); + helpbox.show(); } void CMoviePlayerGui::selectChapter() diff --git a/src/gui/network_setup.cpp b/src/gui/network_setup.cpp index 717ee4098..a3b652e36 100644 --- a/src/gui/network_setup.cpp +++ b/src/gui/network_setup.cpp @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include @@ -132,13 +132,13 @@ int CNetworkSetup::exec(CMenuTarget* parent, const std::string &actionKey) } else if(actionKey=="restore") { - int result = ShowMsg(LOCALE_MAINSETTINGS_NETWORK, g_Locale->getText(LOCALE_NETWORKMENU_RESET_SETTINGS_NOW), CMessageBox::mbrNo, - CMessageBox::mbYes | - CMessageBox::mbNo , + int result = ShowMsg(LOCALE_MAINSETTINGS_NETWORK, g_Locale->getText(LOCALE_NETWORKMENU_RESET_SETTINGS_NOW), CMsgBox::mbrNo, + CMsgBox::mbYes | + CMsgBox::mbNo , NEUTRINO_ICON_QUESTION, width); - if (result == CMessageBox::mbrYes) { + if (result == CMsgBox::mbrYes) { restoreNetworkSettings(); } return res; @@ -552,7 +552,7 @@ bool CNetworkSetup::checkForIP() printf("[network setup] empty address %s\n", g_Locale->getText(n_settings[i].addr_name)); char msg[64]; snprintf(msg, 64, g_Locale->getText(LOCALE_NETWORKMENU_ERROR_NO_ADDRESS), g_Locale->getText(n_settings[i].addr_name)); - ShowMsg(LOCALE_MAINSETTINGS_NETWORK, msg, CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_ERROR, width); + ShowMsg(LOCALE_MAINSETTINGS_NETWORK, msg, CMsgBox::mbrOk, CMsgBox::mbOk, NEUTRINO_ICON_ERROR, width); return false; } } @@ -595,21 +595,21 @@ void CNetworkSetup::applyNetworkSettings() int CNetworkSetup::saveChangesDialog() { // Save the settings after changes, if user wants to! - int result = ShowMsg(LOCALE_MAINSETTINGS_NETWORK, g_Locale->getText(LOCALE_NETWORKMENU_APPLY_SETTINGS_NOW), CMessageBox::mbrYes, - CMessageBox::mbYes | - CMessageBox::mbNo , + int result = ShowMsg(LOCALE_MAINSETTINGS_NETWORK, g_Locale->getText(LOCALE_NETWORKMENU_APPLY_SETTINGS_NOW), CMsgBox::mbrYes, + CMsgBox::mbYes | + CMsgBox::mbNo , NEUTRINO_ICON_QUESTION, width); switch(result) { - case CMessageBox::mbrYes: + case CMsgBox::mbrYes: if (!checkForIP()) return menu_return::RETURN_REPAINT; return exec(NULL, "networkapply"); break; - case CMessageBox::mbrNo: //no + case CMsgBox::mbrNo: //no return exec(NULL, "restore"); break; } @@ -694,7 +694,7 @@ void CNetworkSetup::showCurrentNetworkSettings() + g_Locale->getText(LOCALE_NETWORKMENU_NAMESERVER) + ": " + nameserver + '\n' + g_Locale->getText(LOCALE_NETWORKMENU_GATEWAY ) + ": " + router; } - ShowMsg(LOCALE_NETWORKMENU_SHOW, text, CMessageBox::mbrBack, CMessageBox::mbBack); // UTF-8 + ShowMsg(LOCALE_NETWORKMENU_SHOW, text, CMsgBox::mbrBack, CMsgBox::mbBack); // UTF-8 } const char * CNetworkSetup::mypinghost(std::string &host) @@ -790,7 +790,7 @@ void CNetworkSetup::testNetworkSettings() } } - ShowMsg(LOCALE_NETWORKMENU_TEST, text, CMessageBox::mbrBack, CMessageBox::mbBack); // UTF-8 + ShowMsg(LOCALE_NETWORKMENU_TEST, text, CMsgBox::mbrBack, CMsgBox::mbBack); // UTF-8 } int CNetworkSetup::showWlanList() @@ -804,7 +804,7 @@ int CNetworkSetup::showWlanList() bool found = get_wlan_list(g_settings.ifname, networks); hintBox.hide(); if (!found) { - ShowMsg(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_NETWORKMENU_SSID_SCAN_ERROR), CMessageBox::mbrBack, CMessageBox::mbBack); // UTF-8 + ShowMsg(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_NETWORKMENU_SSID_SCAN_ERROR), CMsgBox::mbrBack, CMsgBox::mbBack); // UTF-8 return res; } diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index a0605f430..b3df893e8 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -40,7 +40,7 @@ #include #include -#include +#include #include #include @@ -158,7 +158,7 @@ int COPKGManager::exec(CMenuTarget* parent, const string &actionKey) char loc[200]; snprintf(loc, sizeof(loc), g_Locale->getText(LOCALE_OPKG_MESSAGEBOX_REMOVE), pkg_vec[selected]->name.c_str()); - if (ShowMsg(LOCALE_OPKG_TITLE, loc, CMessageBox::mbrCancel, CMessageBox::mbYes | CMessageBox::mbCancel) != CMessageBox::mbrCancel) { + if (ShowMsg(LOCALE_OPKG_TITLE, loc, CMsgBox::mbrCancel, CMsgBox::mbYes | CMsgBox::mbCancel) != CMsgBox::mbrCancel) { if (parent) parent->hide(); execCmd(pkg_types[OM_REMOVE] + pkg_vec[selected]->name, CShellWindow::VERBOSE | CShellWindow::ACKNOWLEDGE_EVENT); @@ -239,7 +239,7 @@ int COPKGManager::exec(CMenuTarget* parent, const string &actionKey) char l[200]; snprintf(l, sizeof(l), g_Locale->getText(LOCALE_OPKG_MESSAGEBOX_REINSTALL), actionKey.c_str()); l[sizeof(l) - 1] = 0; - if (ShowMsg(LOCALE_OPKG_TITLE, l, CMessageBox::mbrCancel, CMessageBox::mbYes | CMessageBox::mbCancel) == CMessageBox::mbrCancel) + if (ShowMsg(LOCALE_OPKG_TITLE, l, CMsgBox::mbrCancel, CMsgBox::mbYes | CMsgBox::mbCancel) == CMsgBox::mbrCancel) return res; force = "--force-reinstall "; } @@ -577,11 +577,11 @@ int COPKGManager::showMenu() */ //restart neutrino: user decision if(!access( "/tmp/.restart", F_OK)){ - int msg = ShowMsg(LOCALE_OPKG_TITLE, g_Locale->getText(LOCALE_OPKG_SUCCESS_INSTALL), CMessageBox::mbrNo, - CMessageBox::mbYes | CMessageBox::mbNo, + int msg = ShowMsg(LOCALE_OPKG_TITLE, g_Locale->getText(LOCALE_OPKG_SUCCESS_INSTALL), CMsgBox::mbrNo, + CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_QUESTION, width); - if (msg == CMessageBox::mbrYes) + if (msg == CMsgBox::mbrYes) exit_action = "restart"; } //restart neutrino: forced @@ -971,8 +971,8 @@ bool COPKGManager::installPackage(const string& pkg_name, string options, bool f DisplayErrorMessage("Can't download package. Check network!"); break; case OM_UNSATISFIED_DEPS_ERR:{ - int msgRet = ShowMsg("Installation", "Unsatisfied deps while installation! Try to repeat to force dependencies!", CMessageBox::mbrCancel, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 600, -1); - if (msgRet == CMessageBox::mbrYes) + int msgRet = ShowMsg("Installation", "Unsatisfied deps while installation! Try to repeat to force dependencies!", CMsgBox::mbrCancel, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 600, -1); + if (msgRet == CMsgBox::mbrYes) return installPackage(pkg_name, "--force-depends"); break; } diff --git a/src/gui/personalize.cpp b/src/gui/personalize.cpp index ff36b8ef7..243f1584e 100644 --- a/src/gui/personalize.cpp +++ b/src/gui/personalize.cpp @@ -170,7 +170,7 @@ #include #include #include -#include "widget/messagebox.h" +#include "widget/msgbox.h" #include "widget/hintbox.h" #include "widget/keychooser.h" #include "color.h" @@ -734,13 +734,15 @@ bool CPersonalizeGui::changeNotify(const neutrino_locale_t locale, void *data) //shows a short help message void CPersonalizeGui::ShowHelpPersonalize() { - Helpbox helpbox; + Helpbox helpbox(g_Locale->getText(LOCALE_PERSONALIZE_HELP)); for (int i = (int)LOCALE_PERSONALIZE_HELP_LINE1; i<= (int)LOCALE_PERSONALIZE_HELP_LINE8; i++) - helpbox.addLine(g_Locale->getText((neutrino_locale_t)i)); + helpbox.addLine(g_Locale->getText((neutrino_locale_t)i), CTextBox::CENTER); - - helpbox.show(LOCALE_PERSONALIZE_HELP); + helpbox.addExitKey(CRCInput::RC_ok); + helpbox.show(); + helpbox.exec(); + helpbox.hide(); } void CPersonalizeGui::ApplySettings() @@ -763,7 +765,7 @@ void CPersonalizeGui::SaveAndExit() ApplySettings(); return; } - if (ShowMsg(LOCALE_PERSONALIZE_HEAD, g_Locale->getText(LOCALE_PERSONALIZE_APPLY_SETTINGS), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_QUESTION) == CMessageBox::mbrYes) + if (ShowMsg(LOCALE_PERSONALIZE_HEAD, g_Locale->getText(LOCALE_PERSONALIZE_APPLY_SETTINGS), CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_QUESTION) == CMsgBox::mbrYes) { CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_MAINSETTINGS_SAVESETTINGSNOW_HINT)); // UTF-8 hintBox.paint(); @@ -772,7 +774,7 @@ void CPersonalizeGui::SaveAndExit() } else { - if (ShowMsg(LOCALE_PERSONALIZE_HEAD, g_Locale->getText(LOCALE_MESSAGEBOX_DISCARD), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_QUESTION) == CMessageBox::mbrYes) + if (ShowMsg(LOCALE_PERSONALIZE_HEAD, g_Locale->getText(LOCALE_MESSAGEBOX_DISCARD), CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_QUESTION) == CMsgBox::mbrYes) exec(NULL, "restore"); } } diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index dc4344012..d7cc78419 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -56,7 +56,7 @@ #include #include #include -#include +#include // remove this #include @@ -845,7 +845,7 @@ void CPictureViewerGui::endView() void CPictureViewerGui::deletePicFile(unsigned int index, bool mode) { CVFD::getInstance()->showMenuText(0, playlist[index].Name.c_str()); - if (ShowMsg(LOCALE_FILEBROWSER_DELETE, playlist[index].Filename, CMessageBox::mbrNo, CMessageBox::mbYes|CMessageBox::mbNo)==CMessageBox::mbrYes) + if (ShowMsg(LOCALE_FILEBROWSER_DELETE, playlist[index].Filename, CMsgBox::mbrNo, CMsgBox::mbYes|CMsgBox::mbNo)==CMsgBox::mbrYes) { unlink(playlist[index].Filename.c_str()); printf("[ %s ] delete file: %s\r\n",__FUNCTION__,playlist[index].Filename.c_str()); @@ -860,7 +860,7 @@ void CPictureViewerGui::deletePicFile(unsigned int index, bool mode) void CPictureViewerGui::showHelp() { - Helpbox helpbox; + Helpbox helpbox(g_Locale->getText(LOCALE_MESSAGEBOX_INFO)); helpbox.addLine(g_Locale->getText(LOCALE_PICTUREVIEWER_HELP1)); helpbox.addLine(NEUTRINO_ICON_BUTTON_OKAY, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP2)); helpbox.addLine(NEUTRINO_ICON_BUTTON_5, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP3)); @@ -871,30 +871,29 @@ void CPictureViewerGui::showHelp() helpbox.addLine(NEUTRINO_ICON_BUTTON_RIGHT, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP7)); helpbox.addLine(NEUTRINO_ICON_BUTTON_5, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP3)); helpbox.addLine(NEUTRINO_ICON_BUTTON_HOME, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP8)); - helpbox.addPagebreak(); - helpbox.addLine(g_Locale->getText(LOCALE_PICTUREVIEWER_HELP9)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_OKAY, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP10)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_LEFT, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP11)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_RIGHT, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP12)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_1, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP13)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_3, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP14)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_2, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP15)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_4, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP16)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_6, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP17)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_8, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP18)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_5, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP3)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_0, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP19)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_HOME, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP8)); - if(audioplayer) - { - helpbox.addPagebreak(); - helpbox.addLine(g_Locale->getText(LOCALE_PICTUREVIEWER_HELP30)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_PLAY, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP31)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_PAUSE, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP32)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_STOP, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP33)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_FORWARD, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP34)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_BACKWARD, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP35)); - } - hide(); - helpbox.show(LOCALE_MESSAGEBOX_INFO); +// helpbox.addPagebreak(); +// helpbox.addLine(g_Locale->getText(LOCALE_PICTUREVIEWER_HELP9)); +// helpbox.addLine(NEUTRINO_ICON_BUTTON_OKAY, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP10)); +// helpbox.addLine(NEUTRINO_ICON_BUTTON_LEFT, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP11)); +// helpbox.addLine(NEUTRINO_ICON_BUTTON_RIGHT, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP12)); +// helpbox.addLine(NEUTRINO_ICON_BUTTON_1, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP13)); +// helpbox.addLine(NEUTRINO_ICON_BUTTON_3, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP14)); +// helpbox.addLine(NEUTRINO_ICON_BUTTON_2, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP15)); +// helpbox.addLine(NEUTRINO_ICON_BUTTON_4, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP16)); +// helpbox.addLine(NEUTRINO_ICON_BUTTON_6, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP17)); +// helpbox.addLine(NEUTRINO_ICON_BUTTON_8, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP18)); +// helpbox.addLine(NEUTRINO_ICON_BUTTON_5, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP3)); +// helpbox.addLine(NEUTRINO_ICON_BUTTON_0, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP19)); +// helpbox.addLine(NEUTRINO_ICON_BUTTON_HOME, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP8)); +// if(audioplayer) +// { +// helpbox.addPagebreak(); +// helpbox.addLine(g_Locale->getText(LOCALE_PICTUREVIEWER_HELP30)); +// helpbox.addLine(NEUTRINO_ICON_BUTTON_PLAY, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP31)); +// helpbox.addLine(NEUTRINO_ICON_BUTTON_PAUSE, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP32)); +// helpbox.addLine(NEUTRINO_ICON_BUTTON_STOP, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP33)); +// helpbox.addLine(NEUTRINO_ICON_BUTTON_FORWARD, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP34)); +// helpbox.addLine(NEUTRINO_ICON_BUTTON_BACKWARD, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP35)); +// } + helpbox.show(); } diff --git a/src/gui/pipsetup.cpp b/src/gui/pipsetup.cpp index 6be220ec7..d6120cec2 100644 --- a/src/gui/pipsetup.cpp +++ b/src/gui/pipsetup.cpp @@ -3,7 +3,7 @@ #endif #include -#include +#include #include #include diff --git a/src/gui/pluginlist.cpp b/src/gui/pluginlist.cpp index 4e5dcaabc..18db834ec 100644 --- a/src/gui/pluginlist.cpp +++ b/src/gui/pluginlist.cpp @@ -37,7 +37,7 @@ #include #include -#include +#include #include #include @@ -77,7 +77,7 @@ int CPluginList::run() g_PluginList->startPlugin(number); if (!g_PluginList->getScriptOutput().empty()) { hide(); - ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_SHELL); + ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_SHELL); } return menu_return::RETURN_REPAINT; } @@ -168,7 +168,7 @@ int CPluginsExec::exec(CMenuTarget* parent, const std::string & actionKey) g_PluginList->startPlugin(sel); if (!g_PluginList->getScriptOutput().empty()) - ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_SHELL); + ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_SHELL); if (g_PluginList->getIntegration(sel) == CPlugins::I_TYPE_DISABLED) return menu_return::RETURN_EXIT; diff --git a/src/gui/rc_lock.cpp b/src/gui/rc_lock.cpp index 354a89caa..add7f0463 100644 --- a/src/gui/rc_lock.cpp +++ b/src/gui/rc_lock.cpp @@ -31,7 +31,8 @@ #include #include -#include +#include + const std::string CRCLock::NO_USER_INPUT = "NO_USER_INPUT"; @@ -74,15 +75,15 @@ int CRCLock::exec(CMenuTarget* parent, const std::string &actionKey) char lock_msg[1024]; snprintf(lock_msg, sizeof(lock_msg)-1, g_Locale->getText(LOCALE_RCLOCK_LOCKMSG), key_unlock.c_str()); - if (ShowMsg(LOCALE_RCLOCK_TITLE, lock_msg, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbCancel, - NEUTRINO_ICON_INFO, 450, no_input ? 5 : -1, no_input) == CMessageBox::mbrCancel) + if (ShowMsg(LOCALE_RCLOCK_TITLE, lock_msg, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbCancel, + NEUTRINO_ICON_INFO, 450, no_input ? 5 : -1, no_input) == CMsgBox::mbrCancel) return menu_return::RETURN_EXIT_ALL; locked = true; lockRC(); locked = false; - ShowMsg(LOCALE_RCLOCK_TITLE, LOCALE_RCLOCK_UNLOCKMSG, CMessageBox::mbrBack, CMessageBox::mbBack, + ShowMsg(LOCALE_RCLOCK_TITLE, LOCALE_RCLOCK_UNLOCKMSG, CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO, 450, no_input ? 5 : -1); return menu_return::RETURN_EXIT_ALL; } diff --git a/src/gui/record_setup.cpp b/src/gui/record_setup.cpp index 89a5c714d..00ef84383 100644 --- a/src/gui/record_setup.cpp +++ b/src/gui/record_setup.cpp @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include #include @@ -85,7 +85,7 @@ int CRecordSetup::exec(CMenuTarget* parent, const std::string &actionKey) } else if(actionKey == "help_recording") { - ShowMsg(LOCALE_SETTINGS_HELP, LOCALE_RECORDINGMENU_HELP, CMessageBox::mbrBack, CMessageBox::mbBack); + ShowMsg(LOCALE_SETTINGS_HELP, LOCALE_RECORDINGMENU_HELP, CMsgBox::mbrBack, CMsgBox::mbBack); return res; } else if(actionKey == "recordingdir") diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index f3b48ea68..e22733be7 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include @@ -327,7 +327,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) else if(msg == CRCInput::RC_home) { if(manual && !scansettings.scan_nit_manual) continue; - if (ShowMsg(LOCALE_SCANTS_ABORT_HEADER, LOCALE_SCANTS_ABORT_BODY, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { + if (ShowMsg(LOCALE_SCANTS_ABORT_HEADER, LOCALE_SCANTS_ABORT_BODY, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo) == CMsgBox::mbrYes) { g_Zapit->stopScan(); } } diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index 5ad95d794..6cfb80c05 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -371,7 +371,7 @@ int CScanSetup::exec(CMenuTarget* parent, const std::string &actionKey) else if(actionKey == "reloadchannels") { printf("[neutrino] CScanSetup::%s reloadchannels...\n", __FUNCTION__); - CHintBox chb(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SERVICEMENU_RELOAD_HINT)); + CHint chb(LOCALE_SERVICEMENU_RELOAD_HINT); chb.paint(); /* save if changed, to make sure NEW/REMOVED/... flags are updated */ CServiceManager::getInstance()->SaveServices(true, true); diff --git a/src/gui/screensetup.cpp b/src/gui/screensetup.cpp index 9b446f0cd..b1327fed2 100644 --- a/src/gui/screensetup.cpp +++ b/src/gui/screensetup.cpp @@ -37,7 +37,7 @@ #include #include -#include +#include #include #include @@ -136,7 +136,7 @@ int CScreenSetup::exec(CMenuTarget* parent, const std::string &) ( g_settings.screen_EndX != x_coord[1] ) || ( g_settings.screen_StartY != y_coord[0] ) || ( g_settings.screen_EndY != y_coord[1] ) ) && - (ShowMsg(LOCALE_VIDEOMENU_SCREENSETUP, LOCALE_MESSAGEBOX_DISCARD, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbCancel) == CMessageBox::mbrCancel)) + (ShowMsg(LOCALE_VIDEOMENU_SCREENSETUP, LOCALE_MESSAGEBOX_DISCARD, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbCancel) == CMsgBox::mbrCancel)) break; case CRCInput::RC_timeout: diff --git a/src/gui/settings_manager.cpp b/src/gui/settings_manager.cpp index ebb1d8515..5c5ff7a4f 100644 --- a/src/gui/settings_manager.cpp +++ b/src/gui/settings_manager.cpp @@ -36,7 +36,7 @@ #include #include -#include +#include #include #include @@ -116,7 +116,7 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey) my_system(2, backup_sh, fileBrowser.getSelectedFile()->Name.c_str()); } else - ShowMsg(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_SETTINGS_BACKUP_FAILED),CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_ERROR); + ShowMsg(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_SETTINGS_BACKUP_FAILED),CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_ERROR); } return res; } @@ -126,8 +126,8 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey) fileBrowser.Filter = &fileFilter; if (fileBrowser.exec("/media") == true) { - int result = ShowMsg(LOCALE_SETTINGS_RESTORE, g_Locale->getText(LOCALE_SETTINGS_RESTORE_WARN), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo); - if(result == CMessageBox::mbrYes) + int result = ShowMsg(LOCALE_SETTINGS_RESTORE, g_Locale->getText(LOCALE_SETTINGS_RESTORE_WARN), CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo); + if(result == CMsgBox::mbrYes) { const char restore_sh[] = "/bin/restore.sh"; printf("restore: executing [%s %s]\n", restore_sh, fileBrowser.getSelectedFile()->Name.c_str()); diff --git a/src/gui/start_wizard.cpp b/src/gui/start_wizard.cpp index dddbc7ece..ffe812ca8 100644 --- a/src/gui/start_wizard.cpp +++ b/src/gui/start_wizard.cpp @@ -51,7 +51,7 @@ #include #include -#include +#include #include @@ -92,7 +92,7 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/) CSettingsManager settingsManager(SNeutrinoSettings::WIZARD_START); settingsManager.exec(NULL, ""); - if(ShowMsg (LOCALE_WIZARD_WELCOME_HEAD, g_Locale->getText(LOCALE_WIZARD_WELCOME_TEXT), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbrCancel) == CMessageBox::mbrYes) + if(ShowMsg (LOCALE_WIZARD_WELCOME_HEAD, g_Locale->getText(LOCALE_WIZARD_WELCOME_TEXT), CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbrCancel) == CMsgBox::mbrYes) { int advanced = 1; #ifdef ENABLE_FASTSCAN @@ -132,7 +132,7 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/) if(advanced && init_settings && (res != menu_return::RETURN_EXIT_ALL)) { if (ShowMsg(LOCALE_WIZARD_INITIAL_SETTINGS, g_Locale->getText(LOCALE_WIZARD_INSTALL_SETTINGS), - CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrYes) { + CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450, 30) == CMsgBox::mbrYes) { system("/bin/cp " CONFIGDIR "/initial/* " CONFIGDIR "/zapit/"); CFEManager::getInstance()->loadSettings(); CFEManager::getInstance()->saveSettings(); diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 8769c4120..332489810 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -47,13 +48,13 @@ #include #include -#include +#include #include #include #include #include #include -#include + #include #include #include @@ -145,7 +146,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) text[12*len] = 0; CVFD::getInstance()->ShowText(text); - ShowMsg(LOCALE_MESSAGEBOX_INFO, "VFD test, Press OK to return", CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_MESSAGEBOX_INFO, "VFD test, Press OK to return", CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO); CVFD::getInstance()->Clear(); return res; @@ -185,7 +186,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) close(fd); - ShowMsg(LOCALE_MESSAGEBOX_INFO, str, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_MESSAGEBOX_INFO, str, CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO); return res; } @@ -196,17 +197,17 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) switch(ret) { case 0: - ShowMsg(LOCALE_MESSAGEBOX_INFO, str, CMessageBox::mbrBack, CMessageBox::mbBack, "info.raw"); + ShowMsg(LOCALE_MESSAGEBOX_INFO, str, CMsgBox::mbrBack, CMsgBox::mbBack, "info.raw"); break; case -1: - ShowMsg(LOCALE_MESSAGEBOX_INFO, "Smardcard 1 ATR read failed", CMessageBox::mbrBack, CMessageBox::mbBack, "info"); + ShowMsg(LOCALE_MESSAGEBOX_INFO, "Smardcard 1 ATR read failed", CMsgBox::mbrBack, CMsgBox::mbBack, "info"); break; case -2: - ShowMsg(LOCALE_MESSAGEBOX_INFO, "Smardcard 1 reset failed", CMessageBox::mbrBack, CMessageBox::mbBack, "info"); + ShowMsg(LOCALE_MESSAGEBOX_INFO, "Smardcard 1 reset failed", CMsgBox::mbrBack, CMsgBox::mbBack, "info"); break; default: case -3: - ShowMsg(LOCALE_MESSAGEBOX_INFO, "Smardcard 1 open failed", CMessageBox::mbrBack, CMessageBox::mbBack, "info"); + ShowMsg(LOCALE_MESSAGEBOX_INFO, "Smardcard 1 open failed", CMsgBox::mbrBack, CMsgBox::mbBack, "info"); break; } @@ -219,17 +220,17 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) switch(ret) { case 0: - ShowMsg(LOCALE_MESSAGEBOX_INFO, str, CMessageBox::mbrBack, CMessageBox::mbBack, "info.raw"); + ShowMsg(LOCALE_MESSAGEBOX_INFO, str, CMsgBox::mbrBack, CMsgBox::mbBack, "info.raw"); break; case -1: - ShowMsg(LOCALE_MESSAGEBOX_INFO, "Smardcard 2 ATR read failed", CMessageBox::mbrBack, CMessageBox::mbBack, "info"); + ShowMsg(LOCALE_MESSAGEBOX_INFO, "Smardcard 2 ATR read failed", CMsgBox::mbrBack, CMsgBox::mbBack, "info"); break; case -2: - ShowMsg(LOCALE_MESSAGEBOX_INFO, "Smardcard 2 reset failed", CMessageBox::mbrBack, CMessageBox::mbBack, "info"); + ShowMsg(LOCALE_MESSAGEBOX_INFO, "Smardcard 2 reset failed", CMsgBox::mbrBack, CMsgBox::mbBack, "info"); break; default: case -3: - ShowMsg(LOCALE_MESSAGEBOX_INFO, "Smardcard 2 open failed", CMessageBox::mbrBack, CMessageBox::mbBack, "info"); + ShowMsg(LOCALE_MESSAGEBOX_INFO, "Smardcard 2 open failed", CMsgBox::mbrBack, CMsgBox::mbBack, "info"); break; } @@ -252,7 +253,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) sprintf(buffer, "HDD: /dev/sda1 is %s", mounted ? "mounted" : "NOT mounted"); printf("%s\n", buffer); - ShowMsg(LOCALE_MESSAGEBOX_INFO, buffer, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_MESSAGEBOX_INFO, buffer, CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO); return res; } @@ -273,7 +274,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) sprintf(buffer, "MMC: /dev/mmcblk0p1 is %s", mounted ? "mounted" : "NOT mounted"); printf("%s\n", buffer); - ShowMsg(LOCALE_MESSAGEBOX_INFO, buffer, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_MESSAGEBOX_INFO, buffer, CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO); return res; } @@ -631,10 +632,11 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) else if (actionKey == "window"){ if (window == NULL){ window = new CComponentsWindow(); - window->setWindowCaption("|.....................|"); + window->setWindowCaption("|........HEADER........|", CTextBox::CENTER); window->setDimensionsAll(50, 50, 500, 500); window->setWindowIcon(NEUTRINO_ICON_INFO); window->enableShadow(); + window->getFooterObject()->setCaption("|........FOOTER........|", CTextBox::CENTER); CComponentsShapeCircle *c10 = new CComponentsShapeCircle(0, 0, 28); CComponentsShapeCircle *c11 = new CComponentsShapeCircle(0, CC_APPEND, 28); @@ -655,10 +657,20 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) c14->setColorBody(COL_RED); c14->setPageNumber(1); window->addWindowItem(c14); - } - else{ - window->setWindowIcon(NEUTRINO_ICON_LOCK); - window->setWindowCaption("Test"); + + CComponentsExtTextForm *text_1 = new CComponentsExtTextForm(); + text_1->setDimensionsAll(10, CC_CENTERED, 380, 48); + text_1->setLabelAndText("Page", "Number 1", g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]); + text_1->setFrameThickness(2); + text_1->setPageNumber(0); + window->addWindowItem(text_1); + + CComponentsExtTextForm *text_2 = new CComponentsExtTextForm(); + text_2->setDimensionsAll(10, 200, 380, 48); + text_2->setLabelAndText("Page", "Number 2", g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]); + text_2->setFrameThickness(2); + text_2->setPageNumber(1); + window->addWindowItem(text_2); } #if 0 if (!window->isPainted()){ @@ -666,10 +678,12 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) } else{ #endif //or paint direct a defined page - if (window->getCurrentPage() == 1) - window->paintPage(0); - else - window->paintPage(1); +// if (window->getCurrentPage() == 1) + window->enablePageScroll(CComponentsWindow::PG_SCROLL_M_UP_DOWN_KEY | CComponentsWindow::PG_SCROLL_M_LEFT_RIGHT_KEY); + window->enableSidebar(); + window->paint(); + window->getBodyObject()->exec(); + window->hide(); #if 0 } #endif @@ -711,17 +725,104 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) } return res; } + else if (actionKey == "hintbox_test") + { + ShowHint("Testmenu: Hintbox popup test", "Test for HintBox,\nPlease press any key or wait some seconds! ...", 700, 10, NULL, NEUTRINO_ICON_HINT_IMAGEINFO, CComponentsHeader::CC_BTN_EXIT); + return menu_return::RETURN_REPAINT; + } + else if (actionKey == "msgbox_test_yes_no") + { + int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press key! ...", CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 500, -1); + + std::string msg_txt = "Return value of MsgBox test is "; + msg_txt += to_string(msgRet); + ShowHint("MsgBox test returns", msg_txt.c_str()); + return menu_return::RETURN_REPAINT; + } + else if (actionKey == "msgbox_test_cancel"){ + CMsgBox * msgBox = new CMsgBox("Testmenu: MsgBox exit test", "Please press key"); +// msgBox->setTimeOut(g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR]); + msgBox->paint(); + res = msgBox->exec(); + msgBox->hide(); + + std::string msg_txt = "Return value of MsgBox test is "; + msg_txt += to_string(msgBox->getResult()); + delete msgBox; + + ShowHint("MsgBox test returns", msg_txt.c_str(), 700, 10, NULL, NULL, CComponentsHeader::CC_BTN_EXIT); + + return res; + } + else if (actionKey == "msgbox_test_all"){ + int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press key! ...", CMsgBox::mbrOk, CMsgBox::mbAll, NULL, 700, -1); + + std::string msg_txt = "Return value of MsgBox test is "; + msg_txt += to_string(msgRet); + ShowHint("MsgBox test returns", msg_txt.c_str()); + return menu_return::RETURN_REPAINT; + } + else if (actionKey == "msgbox_test_yes_no_cancel"){ + int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press key! ...", CMsgBox::mbrCancel, CMsgBox::mbYes | CMsgBox::mbNo | CMsgBox::mbCancel, NULL, 500, -1); + + std::string msg_txt = "Return value of MsgBox test is "; + msg_txt += to_string(msgRet); + ShowHint("MsgBox test returns", msg_txt.c_str()); + return menu_return::RETURN_REPAINT; + } + else if (actionKey == "msgbox_test_ok_cancel"){ + int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press key! ...", CMsgBox::mbrOk, CMsgBox::mbOk | CMsgBox::mbCancel, NULL, 500, -1); + + std::string msg_txt = "Return value of MsgBox test is "; + msg_txt += to_string(msgRet); + ShowHint("MsgBox test returns", msg_txt.c_str()); + return menu_return::RETURN_REPAINT; + } + else if (actionKey == "msgbox_test_ok"){ + int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press ok key! ...", CMsgBox::mbrOk, CMsgBox::mbOk, NULL, 500, -1); + + std::string msg_txt = "Return value of MsgBox test is "; + msg_txt += to_string(msgRet); + ShowHint("MsgBox test returns", msg_txt.c_str()); + return menu_return::RETURN_REPAINT; + } + else if (actionKey == "msgbox_test_cancel_timeout"){ + int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press ok key or wait! ...", CMsgBox::mbrCancel, CMsgBox::mbOKCancel, NULL, 500, 6, true); + + std::string msg_txt = "Return value of MsgBox test is "; + msg_txt += to_string(msgRet); + ShowHint("MsgBox test returns", msg_txt.c_str()); + return menu_return::RETURN_REPAINT; + } + else if (actionKey == "msgbox_error"){ + DisplayErrorMessage("Error Test!"); + return menu_return::RETURN_REPAINT; + } + else if (actionKey == "msgbox_info"){ + DisplayInfoMessage("Info Test!"); + return menu_return::RETURN_REPAINT; + } else if (actionKey == "footer_key"){ neutrino_msg_t msg; neutrino_msg_data_t data; - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, "Footer-Key pressed. Press EXIT to return"); + CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, "Footer-Key pressed. Press EXIT to return", 350, NULL, NULL, CComponentsHeader::CC_BTN_EXIT); + + //optional: it is also possible to add more items into the hint box + //here some examples: + hintBox->addHintItem(new CComponentsShapeSquare(CC_CENTERED, CC_APPEND, 330, 2, NULL, false, COL_MENUCONTENT_PLUS_6, COL_RED)); + hintBox->addHintItem("- text with left icon", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, NEUTRINO_ICON_HINT_INFO); + hintBox->addHintItem("- text right without an icon", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH | CTextBox::RIGHT); + hintBox->addHintItem("- text right with an icon", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH | CTextBox::RIGHT, NEUTRINO_ICON_HINT_INFO); + hintBox->paint(); while (1) { g_RCInput->getMsg(&msg, &data, 100); if (msg == CRCInput::RC_home) + hintBox->hide(); break; } + hintBox->hide(); delete hintBox; return res; @@ -760,6 +861,11 @@ int CTestMenu::showTestMenu() f_bi->setHint(NEUTRINO_ICON_HINT_IMAGEINFO, LOCALE_MENU_HINT_BUILDINFO); w_test.addItem(f_bi); + //msg/hintbox + CMenuWidget * w_msg = new CMenuWidget("MsgBox/Hint-Tests", NEUTRINO_ICON_INFO, width, MN_WIDGET_ID_TESTMENU_HINT_MSG_TESTS); + w_test.addItem(new CMenuForwarder(w_msg->getName(), true, NULL, w_msg)); + showMsgTests(w_msg); + //footer buttons static const struct button_label footerButtons[2] = { { NEUTRINO_ICON_BUTTON_RED, LOCALE_COLORCHOOSER_RED }, @@ -852,3 +958,20 @@ void CTestMenu::showHWTests(CMenuWidget *widget) CFEManager::getInstance()->linkFrontends(true); #endif } + +void CTestMenu::showMsgTests(CMenuWidget *widget) +{ + widget->addIntroItems(); + widget->addItem(new CMenuForwarder("HintBox test!", true, NULL, this, "hintbox_test")); + widget->addItem(new CMenuSeparator(CMenuSeparator::STRING | CMenuSeparator::LINE, "MsgBox")); + widget->addItem(new CMenuForwarder("cancel on timeout", true, NULL, this, "msgbox_test_cancel_timeout")); + widget->addItem(new CMenuForwarder("yes no", true, NULL, this, "msgbox_test_yes_no")); + widget->addItem(new CMenuForwarder("cancel", true, NULL, this, "msgbox_test_cancel")); + widget->addItem(new CMenuForwarder("ok", true, NULL, this, "msgbox_test_ok")); + widget->addItem(new CMenuForwarder("ok cancel", true, NULL, this, "msgbox_test_ok_cancel")); + widget->addItem(new CMenuForwarder("yes no cancel", true, NULL, this, "msgbox_test_yes_no_cancel")); + widget->addItem(new CMenuForwarder("all", true, NULL, this, "msgbox_test_all")); + widget->addItem(new CMenuSeparator(CMenuSeparator::STRING | CMenuSeparator::LINE, "Error/Info")); + widget->addItem(new CMenuForwarder("Error Message!", true, NULL, this, "msgbox_error")); + widget->addItem(new CMenuForwarder("Info Message!", true, NULL, this, "msgbox_info")); +} diff --git a/src/gui/test_menu.h b/src/gui/test_menu.h index e7196d29f..1b09192b0 100644 --- a/src/gui/test_menu.h +++ b/src/gui/test_menu.h @@ -59,7 +59,7 @@ class CTestMenu : public CMenuTarget int showTestMenu(); void showHWTests(CMenuWidget *widget); void showCCTests(CMenuWidget *widget); - + void showMsgTests(CMenuWidget *widget); public: CTestMenu(); ~CTestMenu(); diff --git a/src/gui/themes.cpp b/src/gui/themes.cpp index cd611c9a0..eba23ef63 100644 --- a/src/gui/themes.cpp +++ b/src/gui/themes.cpp @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include @@ -182,7 +182,7 @@ int CThemes::Show() } if (hasThemeChanged) { - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_COLORTHEMEMENU_QUESTION, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_SETTINGS) != CMessageBox::mbrYes) + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_COLORTHEMEMENU_QUESTION, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_SETTINGS) != CMsgBox::mbrYes) rememberOldTheme( false ); else hasThemeChanged = false; diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 70d603a02..7500f3267 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -61,7 +61,7 @@ #include #include #include -#include +#include #include #include #include @@ -679,7 +679,7 @@ bool CTimerList::remoteChanExists(t_channel_id channel_id) if (r_url == "false") ShowMsg(LOCALE_REMOTEBOX_CHANNEL_NA, convertChannelId2String(channel_id), - CMessageBox::mbrOk, CMessageBox::mbOk, NULL, 450, 30, false); + CMsgBox::mbrOk, CMsgBox::mbOk, NULL, 450, 30, false); return (r_url == "true"); } @@ -879,7 +879,7 @@ int CTimerList::show() title = "(" + epgdata.title + ")\n"; snprintf(buf1, sizeof(buf1)-1, g_Locale->getText(LOCALE_TIMERLIST_ASK_TO_DELETE), title.c_str()); if(ShowMsg(LOCALE_RECORDINGMENU_RECORD_IS_RUNNING, buf1, - CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrNo) { + CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450, 30) == CMsgBox::mbrNo) { killTimer = false; update = false; } @@ -1529,7 +1529,7 @@ int CTimerList::modifyTimer() } if (modified) { - if (ShowMsg(LOCALE_TIMERLIST_SAVE, LOCALE_PERSONALIZE_APPLY_SETTINGS, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 20, true) == CMessageBox::mbrYes) + if (ShowMsg(LOCALE_TIMERLIST_SAVE, LOCALE_PERSONALIZE_APPLY_SETTINGS, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450, 20, true) == CMsgBox::mbrYes) exec(NULL, "modifytimer"); } @@ -1729,8 +1729,8 @@ bool CTimerList::askUserOnRemoteTimerConflict(time_t announceTime, time_t stopTi struct tm *sTime = localtime(&(it->stopTime)); timerbuf += strftime("%d.%m. %H:%M\n",sTime); } - if (overlappingTimers.size() > 0) - return (ShowMsg(LOCALE_MESSAGEBOX_INFO,timerbuf,CMessageBox::mbrNo,CMessageBox::mbNo|CMessageBox::mbYes) == CMessageBox::mbrYes); + if (!overlappingTimers.empty()) + return (ShowMsg(LOCALE_MESSAGEBOX_INFO,timerbuf,CMsgBox::mbrNo,CMsgBox::mbNo|CMsgBox::mbYes) == CMsgBox::mbrYes); else return true; } @@ -1787,7 +1787,7 @@ bool askUserOnTimerConflict(time_t announceTime, time_t stopTime, t_channel_id c // todo: localize message //g_Locale->getText(TIMERLIST_OVERLAPPING_MESSAGE); - return (ShowMsg(LOCALE_MESSAGEBOX_INFO,timerbuf,CMessageBox::mbrNo,CMessageBox::mbNo|CMessageBox::mbYes) == CMessageBox::mbrYes); + return (ShowMsg(LOCALE_MESSAGEBOX_INFO,timerbuf,CMsgBox::mbrNo,CMsgBox::mbNo|CMsgBox::mbYes) == CMsgBox::mbrYes); } else return true; diff --git a/src/gui/update.cpp b/src/gui/update.cpp index 0d0aa41fc..503b6be55 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include #include @@ -300,14 +300,16 @@ bool CFlashUpdate::selectHttpImage(void) if (urls.empty()) { - ShowMsg(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_FLASHUPDATE_GETINFOFILEERROR), CMessageBox::mbrOk, CMessageBox::mbOk); // UTF-8 + ShowMsg(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_FLASHUPDATE_GETINFOFILEERROR), CMsgBox::mbrOk, CMsgBox::mbOk); // UTF-8 return false; } if (notify) { - if(newfound) - ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_NEW_FOUND), CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_INFO); + if(!newfound) + ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_NEW_FOUND, CMsgBox::mbrOk, CMsgBox::mbOk, NEUTRINO_ICON_INFO, MSGBOX_MIN_WIDTH, 6 ); +#if 0 else - ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_NEW_NOTFOUND), CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_NEW_NOTFOUND, CMsgBox::mbrOk, CMsgBox::mbOk, NEUTRINO_ICON_INFO, MSGBOX_MIN_WIDTH, 6); +#endif } menu_ret = SelectionWidget.exec(NULL, ""); @@ -385,7 +387,7 @@ printf("[update] mode is %d\n", softupdate_mode); if(fileType < '3') { if ((strncmp(RELEASE_CYCLE, versionInfo->getReleaseCycle(), 2) != 0) && - (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_WRONGBASE), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) != CMessageBox::mbrYes)) + (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_WRONGBASE), CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes)) { delete versionInfo; //ShowHint(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_FLASHUPDATE_WRONGBASE)); // UTF-8 @@ -393,8 +395,8 @@ printf("[update] mode is %d\n", softupdate_mode); } if ((strcmp("Release", versionInfo->getType()) != 0) && - //(ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_EXPERIMENTALIMAGE), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) != CMessageBox::mbrYes)) // UTF-8 - (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_EXPERIMENTALIMAGE, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) != CMessageBox::mbrYes)) + //(ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_EXPERIMENTALIMAGE), CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes)) // UTF-8 + (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_EXPERIMENTALIMAGE, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes)) { delete versionInfo; return false; @@ -445,8 +447,8 @@ printf("[update] mode is %d\n", softupdate_mode); if (file_selected->getType() == CFile::FILE_PKG_PACKAGE){ COPKGManager opkg; if (opkg.hasOpkgSupport()){ - int msgres = ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_OPKG_WARNING_3RDPARTY_PACKAGES, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE, 700); // UTF-8 - if (msgres == CMessageBox::mbrYes){ + int msgres = ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_OPKG_WARNING_3RDPARTY_PACKAGES, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE, 700); // UTF-8 + if (msgres == CMsgBox::mbrYes){ if (!opkg.installPackage(UpdatesBrowser.getSelectedFile()->Name)) DisplayErrorMessage(g_Locale->getText(LOCALE_OPKG_FAILURE_INSTALL)); } @@ -476,7 +478,7 @@ printf("[update] mode is %d\n", softupdate_mode); strcpy(msg, g_Locale->getText(LOCALE_FLASHUPDATE_NOVERSION)); //never read msg_body = LOCALE_FLASHUPDATE_MSGBOX_MANUAL; } - return (ShowMsg(LOCALE_MESSAGEBOX_INFO, msg, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) == CMessageBox::mbrYes); // UTF-8 + return (ShowMsg(LOCALE_MESSAGEBOX_INFO, msg, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) == CMsgBox::mbrYes); // UTF-8 } int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) @@ -540,7 +542,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) return menu_return::RETURN_REPAINT; } if(softupdate_mode==1) { //internet-update - if ( ShowMsg(LOCALE_MESSAGEBOX_INFO, (fileType < '3') ? LOCALE_FLASHUPDATE_INSTALL_IMAGE : LOCALE_FLASHUPDATE_INSTALL_PACKAGE, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) != CMessageBox::mbrYes) // UTF-8 + if ( ShowMsg(LOCALE_MESSAGEBOX_INFO, (fileType < '3') ? LOCALE_FLASHUPDATE_INSTALL_IMAGE : LOCALE_FLASHUPDATE_INSTALL_PACKAGE, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes) // UTF-8 { hide(); return menu_return::RETURN_REPAINT; @@ -556,7 +558,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) //flash it... #ifndef BOXMODEL_APOLLO if (g_settings.apply_settings) { - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_APPLY_SETTINGS), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) == CMessageBox::mbrYes) + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_APPLY_SETTINGS), CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) == CMsgBox::mbrYes) if (!CExtUpdate::getInstance()->applySettings(filename, CExtUpdate::MODE_SOFTUPDATE)) { hide(); return menu_return::RETURN_REPAINT; @@ -593,7 +595,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) fread(buffer, (uint32_t)filesize, 1, fd); fclose(fd); buffer[filesize] = 0; - ShowMsg(LOCALE_MESSAGEBOX_INFO, buffer, CMessageBox::mbrBack, CMessageBox::mbBack); // UTF-8 + ShowMsg(LOCALE_MESSAGEBOX_INFO, buffer, CMsgBox::mbrBack, CMsgBox::mbBack); // UTF-8 free(buffer); } } @@ -861,7 +863,7 @@ void CFlashExpert::writemtd(const std::string & filename, int mtdNumber) FILESYSTEM_ENCODING_TO_UTF8_STRING(filename).c_str(), CMTDInfo::getInstance()->getMTDName(mtdNumber).c_str()); - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, message, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) != CMessageBox::mbrYes) // UTF-8 + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, message, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes) // UTF-8 return; #ifdef VFD_UPDATE CVFD::getInstance()->showProgressBar2(0,"checking",0,"Update Neutrino"); @@ -1051,7 +1053,7 @@ int CFlashExpertSetup::exec(CMenuTarget* parent, const std::string &actionKey) // create image warning const char *box = (mtdInfo->getMTDEraseSize(mtdInfo->findMTDsystem()) == 0x40000) ? "Trinity" : "Tank"; snprintf(message, sizeof(message)-1, g_Locale->getText(LOCALE_FLASHUPDATE_CREATEIMAGE_WARNING), box, box); - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, message, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) != CMessageBox::mbrYes) + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, message, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE, 600) != CMsgBox::mbrYes) skipImage = true; } if (!skipImage) { diff --git a/src/gui/update_ext.cpp b/src/gui/update_ext.cpp index 3e6246d36..f92df2c7d 100644 --- a/src/gui/update_ext.cpp +++ b/src/gui/update_ext.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include @@ -549,7 +549,7 @@ bool CExtUpdate::checkSpecialFolders(std::string line, bool copy) neutrino_locale_t msg = (copy) ? LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_SKIPPED : LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_DEL_SKIPPED; snprintf(buf, sizeof(buf), g_Locale->getText(msg), line.c_str()); WRITE_UPDATE_LOG("%s%s", buf, "\n"); - ShowMsg(LOCALE_MESSAGEBOX_INFO, buf, CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_MESSAGEBOX_INFO, buf, CMsgBox::mbrOk, CMsgBox::mbOk, NEUTRINO_ICON_INFO); return true; } return false; @@ -719,13 +719,13 @@ bool CExtUpdate::readBackupList(const std::string & dstPath) memset(buf1, '\0', sizeof(buf1)); if (free3 <= flashError) { snprintf(buf1, sizeof(buf1)-1, g_Locale->getText(LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_ERROR), free3, total); - ShowMsg(LOCALE_MESSAGEBOX_ERROR, buf1, CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_ERROR); + ShowMsg(LOCALE_MESSAGEBOX_ERROR, buf1, CMsgBox::mbrOk, CMsgBox::mbOk, NEUTRINO_ICON_ERROR); flashErrorFlag = true; return false; } else if (free3 <= flashWarning) { snprintf(buf1, sizeof(buf1)-1, g_Locale->getText(LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_WARNING), free3, total); - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, buf1, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_INFO) != CMessageBox::mbrYes) { + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, buf1, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_INFO) != CMsgBox::mbrYes) { flashErrorFlag = true; return false; } diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index faf85ed8b..f6c34630a 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include #include @@ -254,13 +254,13 @@ bool CUpnpBrowserGui::discoverDevices() catch (std::runtime_error error) { delete scanBox; - ShowMsg(LOCALE_MESSAGEBOX_INFO, error.what(), CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + DisplayErrorMessage(error.what()); return false; } delete scanBox; if (m_devices.empty()) { - ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_UPNPBROWSER_NOSERVERS, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + DisplayInfoMessage(g_Locale->getText(LOCALE_UPNPBROWSER_NOSERVERS)); return false; } return true; @@ -288,7 +288,7 @@ bool CUpnpBrowserGui::getResults(std::string id, unsigned int start, unsigned in } catch (std::runtime_error error) { - ShowMsg(LOCALE_MESSAGEBOX_INFO, error.what(), CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + DisplayErrorMessage(error.what()); return false; } return true; diff --git a/src/gui/user_menue_setup.cpp b/src/gui/user_menue_setup.cpp index ac39d1393..8db4e8306 100644 --- a/src/gui/user_menue_setup.cpp +++ b/src/gui/user_menue_setup.cpp @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp index 144d6bfa1..5bfeeabe4 100644 --- a/src/gui/videosettings.cpp +++ b/src/gui/videosettings.cpp @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include @@ -419,7 +419,7 @@ void CVideoSettings::setupVideoSystem(bool do_ask) if (prev_video_mode != g_settings.video_Mode) { frameBuffer->paintBackground(); - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_VIDEO_MODE_OK), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_INFO) != CMessageBox::mbrYes) + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_VIDEO_MODE_OK), CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_INFO) != CMsgBox::mbrYes) { g_settings.video_Mode = prev_video_mode; videoDecoder->SetVideoSystem(g_settings.video_Mode); diff --git a/src/gui/widget/Makefile.am b/src/gui/widget/Makefile.am index 0788d0319..17a932b04 100644 --- a/src/gui/widget/Makefile.am +++ b/src/gui/widget/Makefile.am @@ -20,14 +20,12 @@ libneutrino_gui_widget_a_SOURCES = \ drawable.cpp \ helpbox.cpp \ hintbox.cpp \ - hintboxext.cpp \ keychooser.cpp \ keyboard_input.cpp \ listbox.cpp \ listframe.cpp \ listhelpers.cpp \ menue.cpp \ - messagebox.cpp \ mountchooser.cpp \ msgbox.cpp \ shellwindow.cpp \ diff --git a/src/gui/widget/colorchooser.cpp b/src/gui/widget/colorchooser.cpp index a1eef250c..f7b90b371 100644 --- a/src/gui/widget/colorchooser.cpp +++ b/src/gui/widget/colorchooser.cpp @@ -43,7 +43,7 @@ #include #include -#include +#include #include @@ -218,7 +218,7 @@ int CColorChooser::exec(CMenuTarget* parent, const std::string &) } case CRCInput::RC_home: if (((*value[VALUE_R] != r_alt) || (*value[VALUE_G] != g_alt) || (*value[VALUE_B] != b_alt) || ((value[VALUE_ALPHA]) && (*(value[VALUE_ALPHA]) != a_alt))) && - (ShowMsg(name, LOCALE_MESSAGEBOX_DISCARD, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbCancel) == CMessageBox::mbrCancel)) + (ShowMsg(name, LOCALE_MESSAGEBOX_DISCARD, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbCancel) == CMsgBox::mbrCancel)) break; // sonst abbruch... diff --git a/src/gui/widget/helpbox.cpp b/src/gui/widget/helpbox.cpp index 43a854915..8d963e8e9 100644 --- a/src/gui/widget/helpbox.cpp +++ b/src/gui/widget/helpbox.cpp @@ -1,32 +1,24 @@ /* - Neutrino-GUI - DBoxII-Project - - Copyright (C) 2001 Steffen Hehn 'McClean' - Homepage: http://dbox.cyberphoria.org/ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + Implement CComponent-Windowclass. + Copyright (C) 2015 Thilo Graf 'dbt' License: GPL - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ @@ -34,78 +26,172 @@ #include #endif -#include -#include -#include #include #include +#include -Helpbox::Helpbox() +using namespace std; + +Helpbox::Helpbox( const string& Title, + const string& Default_Text, + const int& text_mode, + const int& line_space, + Font* default_font_text, + const char* Icon): + CComponentsWindowMax( Title, + Icon, + NULL, + CC_SHADOW_ON, + COL_MENUCONTENT_PLUS_6, + COL_MENUCONTENT_PLUS_0, + COL_MENUCONTENTDARK_PLUS_0) { + page = 0; + hbox_y = 1; + setWindowHeaderButtons(CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT); + ccw_footer->setButtonLabel(NEUTRINO_ICON_BUTTON_HOME, LOCALE_MESSAGEBOX_BACK, 0, 150); + + hbox_font = default_font_text; + if (default_font_text == NULL) + hbox_font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]; + + if (!Default_Text.empty()) + addLine(Default_Text.c_str(), Default_Text, text_mode, line_space, HELPBOX_DEFAULT_LINE_INDENT ,hbox_font); + + //ensure hided channellist, because shared RC_ok + CNeutrinoApp::getInstance()->allowChannelList(false); } -Helpbox::~Helpbox() + +void Helpbox::addLine(const std::string& icon, const std::string& text, const int& text_mode, const int& line_space, const int& line_indent, Font* font_text) { - for (ContentLines::iterator it = m_lines.begin(); - it != m_lines.end(); ++it) - { - for (std::vector::iterator it2 = it->begin(); - it2 != it->end(); ++it2) - { - delete *it2; - } - } + CComponentsItem *pre_item = !ccw_body->empty() ? ccw_body->back() : NULL; //get the last current item + + if (pre_item){ + if (pre_item->getPageNumber() == page) + hbox_y = pre_item->getYPos() + pre_item->getHeight(); + } + + int h_line = line_space; + Font* font = hbox_font; + if (font_text){ + h_line = max(h_line, font_text->getHeight()); + font = font_text; + } + + CComponentsFrmChain *line = new CComponentsFrmChain(line_indent, hbox_y, 0, h_line); + if ((hbox_y + h_line)>ccw_body->getHeight()){ + addPagebreak(); + line->setYPos(hbox_y); + } + line->setPageNumber(page); + + int w_body = ccw_body->getWidth(); + line->setWidth(w_body - line_indent - 40); + line->setXPos(line_indent); + line->setColorBody(ccw_body->getColorBody()); + + CComponentsPicture *picon = NULL; + int w_picon = 0; + if (!icon.empty()){ + picon = new CComponentsPicture (0, 0, icon); + w_picon = picon->getHeight(); + picon->setYPos(line->getHeight()/2 - w_picon/2); + line->addCCItem(picon); + } + + if (!text.empty()){ + int x_text = w_picon + (picon ? 10 : 0); + CComponentsText * txt = new CComponentsText(x_text, 0, line->getWidth()-x_text, line_space, text, text_mode, font); +#if 0 //"contrast agent", if you want to see where the text items are drawn. + txt->setColorBody(COL_RED); + txt->doPaintBg(true); +#endif + line->addCCItem(txt); + } + addWindowItem(line); } -void Helpbox::show(const neutrino_locale_t Caption, const int Width, int timeout) -{ - CMessageBox msgBox(Caption, m_lines, Width, NEUTRINO_ICON_INFO, CMessageBox::mbrBack,CMessageBox::mbBack); - msgBox.exec(timeout); + + +void Helpbox::addSeparatorLine(const int& line_space, const int& line_indent, bool enable_gradient) +{ + CComponentsItem *pre_item = !ccw_body->empty() ? ccw_body->back() : NULL; //get the last current item + + if (pre_item){ + if (pre_item->getPageNumber() == page) + hbox_y = pre_item->getYPos() + pre_item->getHeight(); + } + + int h_line = line_space; + + CComponentsFrmChain *line = new CComponentsFrmChain(line_indent, hbox_y, 0, h_line); + line->setPageNumber(page); + + int w_body = ccw_body->getWidth(); + line->setWidth(w_body - line_indent - 40); + line->setXPos(line_indent); + line->setColorBody(ccw_body->getColorBody()); + + CComponentsShapeSquare *sepline = new CComponentsShapeSquare (0, 0, line->getWidth(), 2); + sepline->setYPos(line->getHeight()/2 - sepline->getHeight()/2); + sepline->setColorBody(COL_MENUCONTENTINACTIVE_TEXT); + sepline->enableColBodyGradient(enable_gradient); + sepline->setColBodyGradient(CColorGradient::gradientLight2Dark, CFrameBuffer::gradientHorizontal, CColorGradient::light); + + line->addCCItem(sepline); + + addWindowItem(line); } -void Helpbox::addLine(const char *text) +void Helpbox::addSeparator(const int& line_space) { - std::vector v; - Drawable *d = new DText(text); - v.push_back(d); - m_lines.push_back(v); + CComponentsItem *pre_item = !ccw_body->empty() ? ccw_body->back() : NULL; //get the last current item + + if (pre_item){ + if (pre_item->getPageNumber() == page) + hbox_y = pre_item->getYPos() + pre_item->getHeight(); + } + + CComponentsFrmChain *line = new CComponentsFrmChain(0, hbox_y, 0, line_space); + line->setPageNumber(page); + + int w_body = ccw_body->getWidth(); + line->setWidth(w_body - 40); + line->setColorBody(ccw_body->getColorBody()); + + addWindowItem(line); } -void Helpbox::addLine(std::string& text) + + + + +void Helpbox::addLine(const char *icon, const char *text, const int& text_mode, const int& line_space, const int& line_indent, Font* font_text) { - std::vector v; - Drawable *d = new DText(text); - v.push_back(d); - m_lines.push_back(v); + addLine(icon, std::string(text), text_mode, line_space, line_indent, font_text); + } -void Helpbox::addLine(const char *icon, const char *text) + +void Helpbox::addLine(const char *text, const int& text_mode, const int& line_space, const int& line_indent, Font* font_text) { - std::vector v; - Drawable *di = new DIcon(icon); - Drawable *dt = new DText(text); - v.push_back(di); - v.push_back(dt); - m_lines.push_back(v); + addLine("", std::string(text), text_mode, line_space, line_indent, font_text); } -void Helpbox::addLine(std::string& icon, std::string& text) +void Helpbox::addLine(const std::string& text, const int& text_mode, const int& line_space, const int& line_indent, Font* font_text) { - std::vector v; - Drawable *di = new DIcon(icon); - Drawable *dt = new DText(text); - v.push_back(di); - v.push_back(dt); - m_lines.push_back(v); + addLine("", text, text_mode, line_space, line_indent, font_text); } + + void Helpbox::addPagebreak(void) { - std::vector v; - Drawable *p = new DPagebreak(); - v.push_back(p); - m_lines.push_back(v); + page ++; + setPageCount(page); + hbox_y = 1; } diff --git a/src/gui/widget/helpbox.h b/src/gui/widget/helpbox.h index a1d4d3c22..86a5aed4b 100644 --- a/src/gui/widget/helpbox.h +++ b/src/gui/widget/helpbox.h @@ -1,64 +1,95 @@ /* - Neutrino-GUI - DBoxII-Project - - Copyright (C) 2001 Steffen Hehn 'McClean' - Homepage: http://dbox.cyberphoria.org/ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + Implement CComponent-Windowclass. + Copyright (C) 2015 Thilo Graf 'dbt' License: GPL - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #ifndef __helpbox__ #define __helpbox__ -#include +#include +#include +#include -#include +#define HELPBOX_DEFAULT_LINE_HEIGHT 35 +#define HELPBOX_DEFAULT_LINE_INDENT 10 -#include -#include - -class Helpbox +class Helpbox : public CComponentsWindowMax { -public: - - Helpbox(); - ~Helpbox(); - - void show(const neutrino_locale_t Caption, const int Width = 450, int timeout = -1); - - void addLine(std::string& text); - void addLine(const char *text); - void addLine(std::string& icon, std::string& text); - void addLine(const char *icon, const char *text); - void addPagebreak(); -protected: - private: + uint8_t page; + //start position of items on page + int hbox_y; - ContentLines m_lines; + ///default font + Font* hbox_font; +public: + Helpbox( const std::string& Title, + const std::string& Default_Text = std::string(), + const int& text_mode = CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, + const int& line_space = HELPBOX_DEFAULT_LINE_HEIGHT, + Font* font_text = NULL, + const char* Icon = NEUTRINO_ICON_INFO); + + ///show = paint, for compatibility + void show(bool do_save_bg = true){ paint(do_save_bg) ;} + + void addLine( const std::string& text, + const int& text_mode = CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, + const int& line_space = HELPBOX_DEFAULT_LINE_HEIGHT, + const int& line_indent = HELPBOX_DEFAULT_LINE_INDENT, + Font* font_text = NULL); + + void addLine( const char *text, + const int& text_mode = CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, + const int& line_space = HELPBOX_DEFAULT_LINE_HEIGHT, + const int& line_indent = HELPBOX_DEFAULT_LINE_INDENT, + Font* font_text = NULL); + + void addLine( const std::string& icon, + const std::string& text, + const int& text_mode = CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, + const int& line_space = HELPBOX_DEFAULT_LINE_HEIGHT, + const int& line_indent = HELPBOX_DEFAULT_LINE_INDENT, + Font* font_text = NULL); + + void addLine( const char *icon, + const char *text, + const int& text_mode = CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, + const int& line_space = HELPBOX_DEFAULT_LINE_HEIGHT, + const int& line_indent = HELPBOX_DEFAULT_LINE_INDENT, + Font* font_text = NULL); + + ///adds a separator as horizontal line, arg 'line_space' defines the space of full separator height, the separator line itself has a defined height of 2px and is centered within line space. + ///arg 'line_indent' defines begin of line from left border within body object. + ///arg 'enable_gradient' enable/disable gradient, Note: default = true, but gradient is only effected, if global/theme gradient settings are enabled! + void addSeparatorLine( const int& line_space = HELPBOX_DEFAULT_LINE_HEIGHT, + const int& line_indent = HELPBOX_DEFAULT_LINE_INDENT, + bool enable_gradient = true); + ///adds a simple empty separator as horizontal space, arg 'line_space' defines the space of full separator height + void addSeparator( const int& line_space = HELPBOX_DEFAULT_LINE_HEIGHT); + + void addPagebreak(); + + int exec(){return ccw_body->exec();} }; #endif diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index febb0f5fa..8e669af40 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -1,24 +1,29 @@ /* - Neutrino-GUI - DBoxII-Project + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean - Copyright (C) 2001 Steffen Hehn 'McClean' - Homepage: http://dbox.cyberphoria.org/ + Hintbox based up initial code by + Copyright (C) 2003 Ralf Gandy 'thegoodguy' + Copyright (C) 2004 Sven Traenkle 'zwen' Copyright (C) 2008-2009, 2011, 2013 Stefan Seyfried + Implementation of CComponent Window class. + Copyright (C) 2014-2015 Thilo Graf 'dbt' + License: GPL - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . + along with this program. If not, see . */ @@ -26,250 +31,139 @@ #include #endif -#include - #include #include - -#define borderwidth 4 +#include "hintbox.h" +#include -#define HINTBOX_MAX_HEIGHT 420 -CHintBox::CHintBox(const neutrino_locale_t Caption, const char * const Text, const int Width, const char * const Icon) +/* + x w + y+-ccw_head----------------------------------------------+ + |icon | caption | buttons |header (ccw_head) + +-ccw_body----------------------------------------------+ + |+-obj_content-----------------------------------------+| + ||+-obj_hint 0----------------------------------------+||body (ccw_body) + h||| obj_picon | obj_text ||| | + ||+---------------------------------------------------+|| +-contents (obj_content) + |+-----------------------------------------------------+| | + +-------------------------------------------------------+ +-hint 0 (obj_hint) default added with new instance of CHintBox + | + | + +-hint n optional added with addHintItem() +*/ + +using namespace std; + + +CHintBox::CHintBox( const neutrino_locale_t Caption, + const char * const Text, + const int Width, + const char * const Icon, + const char * const Picon, + const int& header_buttons, + const int& text_mode, + const int& indent): CComponentsWindow( 1, 1, width, + HINTBOX_MIN_HEIGHT, + Caption, + string(Icon == NULL ? "" : Icon), + NULL, + CC_SHADOW_ON) { - const char * caption_tmp = g_Locale->getText(Caption); - init(caption_tmp, Text, Width, Icon); + init(Text, Width, string(Picon == NULL ? "" : Picon), header_buttons, text_mode, indent); } -CHintBox::CHintBox(const neutrino_locale_t Caption, const neutrino_locale_t Text, const int Width, const char * const Icon) +CHintBox::CHintBox( const char * const Caption, + const char * const Text, + const int Width, + const char * const Icon, + const char * const Picon, + const int& header_buttons, + const int& text_mode, + const int& indent):CComponentsWindow( 1, 1, width, + HINTBOX_MIN_HEIGHT, + Caption, + string(Icon == NULL ? "" : Icon), + NULL, + CC_SHADOW_ON) { - const char * caption_tmp = g_Locale->getText(Caption); - const char * text_tmp = g_Locale->getText(Text); - init(caption_tmp, text_tmp, Width, Icon); + init(string(Text), Width, string(Picon == NULL ? "" : Picon), header_buttons, text_mode, indent); } -CHintBox::CHintBox(const char * const Caption, const char * const Text, const int Width, const char * const Icon) +CHintBox::CHintBox( const neutrino_locale_t Caption, + const neutrino_locale_t Text, + const int Width, + const char * const Icon, + const char * const Picon, + const int& header_buttons, + const int& text_mode, + const int& indent):CComponentsWindow( 1, 1, width, + HINTBOX_MIN_HEIGHT, + Caption, + string(Icon == NULL ? "" : Icon), + NULL, + CC_SHADOW_ON) { - init(Caption, Text, Width, Icon); + init(g_Locale->getText(Text), Width, string(Picon == NULL ? "" : Picon), header_buttons, text_mode, indent); } -CHintBox::CHintBox(const char * const Caption, const neutrino_locale_t Text, const int Width, const char * const Icon) +CHintBox::CHintBox( const char * const Caption, + const neutrino_locale_t Text, + const int Width, + const char * const Icon, + const char * const Picon, + const int& header_buttons, + const int& text_mode, + const int& indent):CComponentsWindow( 1, 1, width, + HINTBOX_MIN_HEIGHT, + Caption, + string(Icon == NULL ? "" : Icon), + NULL, + CC_SHADOW_ON) { - const char * text_tmp = g_Locale->getText(Text); - init(Caption, text_tmp, Width, Icon); -} -void CHintBox::init(const char * const Caption, const char * const Text, const int Width, const char * const Icon) -{ - char * begin; - char * pos; - int nw; - int scrollWidth = 0; - int maxLineWidth = 0; - - message = strdup(Text); - - width = Width; - - theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); - fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); - height = theight + fheight; - textStartX = 0; - - caption = Caption; - - begin = message; - - while (true) - { - height += fheight; - if (height > HINTBOX_MAX_HEIGHT) - height -= fheight; - - line.push_back(begin); - pos = strchr(begin, '\n'); - if (pos != NULL) - { - *pos = 0; - begin = pos + 1; - } - else - break; - } - if (fheight != 0) - entries_per_page = ((height - theight) / fheight) - 1; - else /* avoid division by zero */ - entries_per_page = 1; - current_page = 0; - - unsigned int additional_width; - - if (entries_per_page < line.size()) - scrollWidth = 15; - else - scrollWidth = 0; - additional_width = 20 + scrollWidth; - - if (Icon != NULL) - { - iconfile = Icon; - additional_width += 30; - } - else - iconfile = ""; - - nw = additional_width + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(caption); - - if (nw > width) - width = nw; - - for (std::vector::const_iterator it = line.begin(); it != line.end(); ++it) - { - int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(*it); - maxLineWidth = std::max(maxLineWidth, w); - nw = additional_width + w; - if (nw > width) - width = nw; - } - - /* make sure we don't overflow the usable area */ - if (nw > (int)CFrameBuffer::getInstance()->getScreenWidth()) - width = CFrameBuffer::getInstance()->getScreenWidth(); - textStartX = (width - scrollWidth - maxLineWidth) / 2; - - window = NULL; + init(g_Locale->getText(Text), Width, string(Picon == NULL ? "" : Picon), header_buttons, text_mode, indent); } -CHintBox::~CHintBox(void) +void CHintBox::init(const std::string& Text, const int& Width, const std::string& Picon, const int& header_buttons, const int& text_mode, const int& indent) { - hide(); - free(message); + lines = 0; + timeout = HINTBOX_DEFAULT_TIMEOUT; + w_indentation = indent; + + //set required window width and basic height + width = max(HINTBOX_MIN_WIDTH, Width); + height = max(HINTBOX_MIN_HEIGHT, height); + + ccw_buttons = header_buttons; + + //enable shadow + shadow = true; + + //disable disable header if no title has been defined + if (ccw_caption.empty()) + showHeader(false); + + //disable footer for default + showFooter(false); + + //add the content container, contains the hint objects + obj_content = new CComponentsFrmChain(CC_CENTERED, CC_CENTERED, ccw_body->getWidth(), ccw_body->getHeight(), NULL, CC_DIR_X, ccw_body); + obj_content->doPaintBg(false); + + y_hint_obj = 0; + h_hint_obj = obj_content->getHeight(); + + if (!Text.empty()) + addHintItem(Text, text_mode, Picon); } -void CHintBox::paint(void) -{ - if (window != NULL) - { - /* - * do not paint stuff twice: - * => thread safety needed by movieplayer.cpp: - * one thread calls our paint method, the other one our hide method - * => no memory leaks - */ - return; - } - - CFrameBuffer* frameBuffer = CFrameBuffer::getInstance(); - window = new CFBWindow(frameBuffer->getScreenX() + ((frameBuffer->getScreenWidth() - width ) >> 1), - frameBuffer->getScreenY() + ((frameBuffer->getScreenHeight() - height) >> 2), - width + borderwidth, - height + borderwidth); - refresh(); -} - -void CHintBox::refresh(void) -{ - if (window == NULL) - { - return; - } - - //window->paintBoxRel(borderwidth, height, width, borderwidth, COL_SHADOW_PLUS_0); - //window->paintBoxRel(width, borderwidth, borderwidth, height - borderwidth, COL_SHADOW_PLUS_0); - window->paintBoxRel(width - 20, borderwidth, borderwidth + 20, height - borderwidth - 20, COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_TOP); // right - window->paintBoxRel(borderwidth, height-20, width, borderwidth+20, COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); // bottom - - CComponentsHeader header(window->x, window->y, width, theight, caption, iconfile); - header.paint(CC_SAVE_SCREEN_NO); - -#if 0 - //window->paintBoxRel(0, 0, width, theight, (CFBWindow::color_t)COL_MENUHEAD_PLUS_0); - window->paintBoxRel(0, 0, width, theight, (CFBWindow::color_t)COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round - - if (!iconfile.empty()) - { - int iw, ih; - CFrameBuffer::getInstance()->getIconSize(iconfile.c_str(), &iw, &ih); - //window->paintIcon(iconfile.c_str(), 8, 5); - window->paintIcon(iconfile.c_str(), 10, 0, theight); - //window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], iw+20, theight, width - 20-iw, g_Locale->getText(caption), COL_MENUHEAD_TEXT); - window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], iw+20, theight, width - 20-iw, caption, COL_MENUHEAD_TEXT); - } - else - window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], 10, theight, width - 10, caption, COL_MENUHEAD_TEXT); -#endif - //window->paintBoxRel(0, theight, width, (entries_per_page + 1) * fheight, (CFBWindow::color_t)COL_MENUCONTENT_PLUS_0); - window->paintBoxRel(0, theight, width, (entries_per_page + 1) * fheight, (CFBWindow::color_t)COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);//round - - int count = entries_per_page; - int ypos = theight + (fheight >> 1); - - for (std::vector::const_iterator it = line.begin() + (entries_per_page * current_page); ((it != line.end()) && (count > 0)); ++it, count--) - window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU], textStartX, (ypos += fheight), width, *it, COL_MENUCONTENT_TEXT); - - if (entries_per_page < line.size()) - { - ypos = theight + (fheight >> 1); - window->paintBoxRel(width - 15, ypos, 15, entries_per_page * fheight, COL_SCROLLBAR_PASSIVE_PLUS_0); - unsigned int marker_size = (entries_per_page * fheight) / ((line.size() + entries_per_page - 1) / entries_per_page); - window->paintBoxRel(width - 13, ypos + current_page * marker_size, 11, marker_size, COL_SCROLLBAR_ACTIVE_PLUS_0); - } -} - -bool CHintBox::has_scrollbar(void) -{ - return (entries_per_page < line.size()); -} - -void CHintBox::scroll_up(void) -{ - if (current_page > 0) - { - current_page--; - refresh(); - } -} - -void CHintBox::scroll_down(void) -{ - if ((entries_per_page * (current_page + 1)) <= line.size()) - { - current_page++; - refresh(); - } -} - -void CHintBox::hide(void) -{ - if (window != NULL) - { - delete window; - window = NULL; - } -} - -int ShowHint(const neutrino_locale_t Caption, const char * const Text, const int Width, int timeout, const char * const Icon) -{ - const char * caption = g_Locale->getText(Caption); - - return ShowHint(caption, Text, Width, timeout, Icon); -} - -int ShowHint(const char * const Caption, const char * const Text, const int Width, int timeout, const char * const Icon) +int CHintBox::exec() { neutrino_msg_t msg; neutrino_msg_data_t data; - - CHintBox * hintBox = new CHintBox(Caption, Text, Width, Icon); - hintBox->paint(); - - if ( timeout == -1 ) - timeout = 5; /// default timeout 5 sec - //timeout = g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR]; - - uint64_t timeoutEnd = CRCInput::calcTimeoutEnd( timeout ); - int res = messages_return::none; + uint64_t timeoutEnd = CRCInput::calcTimeoutEnd( timeout ); while ( ! ( res & ( messages_return::cancel_info | messages_return::cancel_all ) ) ) { @@ -283,21 +177,21 @@ int ShowHint(const char * const Caption, const char * const Text, const int Widt { res = messages_return::cancel_all; } - else if ((hintBox->has_scrollbar()) && ((msg == CRCInput::RC_up) || (msg == CRCInput::RC_down))) + else if ((msg == CRCInput::RC_up) || (msg == CRCInput::RC_down)) { if (msg == CRCInput::RC_up) - hintBox->scroll_up(); + this->scroll_up(); else - hintBox->scroll_down(); - } - else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { - // do nothing + this->scroll_down(); } + else if (CNeutrinoApp::getInstance()->listModeKey(msg)){ + // do nothing //TODO: if passed rc messages are ignored rc messaages: has no effect here too!! + } else if(msg == CRCInput::RC_mode) { res = messages_return::handled; break; } - else if((msg == (neutrino_msg_t) g_settings.key_switchformat) || (msg == (neutrino_msg_t) g_settings.key_next43mode)) { + else if((msg == CRCInput::RC_next) || (msg == CRCInput::RC_prev)) { res = messages_return::cancel_all; g_RCInput->postMsg(msg, data); } @@ -306,26 +200,257 @@ int ShowHint(const char * const Caption, const char * const Text, const int Widt res = CNeutrinoApp::getInstance()->handleMsg(msg, data); if (res & messages_return::unhandled) { - // leave here and handle above... g_RCInput->postMsg(msg, data); res = messages_return::cancel_all; } } } - - hintBox->hide(); - delete hintBox; return res; } -int ShowHint(const neutrino_locale_t Caption, const neutrino_locale_t Text, const int Width, int timeout, const char * const Icon) +void CHintBox::addHintItem(const std::string& Text, const int& text_mode, const std::string& Picon, const u_int8_t& at_page_number, const fb_pixel_t& color_text, Font* font_text) { - return ShowHint(Caption, g_Locale->getText(Text),Width,timeout,Icon); + dprintf(DEBUG_INFO, "[CHintBox] [%s - %d] add new hint '%s' %s\n", __func__, __LINE__, Text.c_str(), Picon.c_str()); + + //set required font and line size + Font* font = font_text == NULL ? g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO] : font_text; + int h_line = font->getHeight(); + + //init side picon object + CComponentsPicture *obj_picon = new CComponentsPicture(0, 0, Picon); + obj_picon->doPaintBg(false); + int w_picon = obj_picon->getWidth(); + + //init text item object + int x_text_obj = (w_picon > 0) ? (w_picon + w_indentation) : 0; + int w_text_obj = obj_content->getWidth() - w_picon - w_indentation; + int h_text_obj = max(h_line, obj_picon->getHeight()); + CComponentsText *obj_text = new CComponentsText(x_text_obj, + 0, + w_text_obj, + h_text_obj, + Text, + text_mode, + font); + + //provide the internal textbox object + CTextBox *textbox = obj_text->getCTextBoxObject(); + int lines_count = textbox->getLines(); + + //get required height of text object related to lines count and height of head and footer, if available + int h_required = lines_count * h_line + (ccw_head ? ccw_head->getHeight() : 0) + (ccw_footer ? ccw_footer->getHeight() : 0); + + //set minimal required height + height = max(height, min(HINTBOX_MAX_HEIGHT, max(HINTBOX_MIN_HEIGHT, h_required))); + + //if have no pre defined text mode: + //more than 1 line or a picon is defined, then do not center text and allow scroll if > 1 lines + if (text_mode == 0){ + if (lines_count == 1) + obj_text->setTextMode(CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH | CTextBox::CENTER); + if (w_picon > 1) + obj_text->setTextMode(CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH); + if (lines_count > 1) + obj_text->setTextMode(CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH | (h_required > HINTBOX_MAX_HEIGHT ? CTextBox::SCROLL : CTextBox::AUTO_HIGH)); + if (lines_count > 1 && w_picon == 0) + obj_text->setTextMode(CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH | CTextBox::CENTER | (h_required > HINTBOX_MAX_HEIGHT ? CTextBox::SCROLL : CTextBox::AUTO_HIGH)); + } + else + obj_text->setTextMode(text_mode); + + //text item object: don't paint background + obj_text->doPaintBg(false); + obj_text->setCorner(corner_rad, corner_type); + + //set text color + obj_text->setTextColor(color_text); + + //calculate height of hint object + if (obj_content->size() == 0){ + if (lines_count == 1){ + h_hint_obj = max(h_hint_obj, h_text_obj); + obj_text->setYPos(CC_CENTERED); + } + else + h_hint_obj = max(h_hint_obj, h_line*lines_count); + } + else{ + if (lines_count == 1){ + h_hint_obj = h_text_obj; + obj_text->setYPos(CC_CENTERED); + } + else + h_hint_obj = h_line*lines_count; + } + + //init hint container object + if (isPageChanged()) + y_hint_obj = 0; + CComponentsFrmChain *obj_hint = new CComponentsFrmChain( 0+w_indentation, + y_hint_obj, + obj_content->getWidth()-2*w_indentation, + h_hint_obj, + NULL, + CC_DIR_X, + obj_content); + + //don't paint background for hint container + obj_hint->doPaintBg(false); + obj_hint->setCorner(corner_rad, corner_type); + obj_hint->setPageNumber(at_page_number); + + //add the created items to obj_hint + obj_hint->addCCItem(obj_picon); + obj_hint->addCCItem(obj_text); + + //text object obtains the full height of its parent object + obj_text->setHeightP(100); + + //if we have only one line and a defined picon, then do centering picon to text on the left site + if (lines_count == 1) + obj_picon->setYPos(CC_CENTERED); + + //set next y pos for the next hint object + y_hint_obj += h_hint_obj; + + + //recalculate new hintbox height + ReSize(); + + //set hint box position general to center and refresh window + setCenterPos(); + Refresh(); + + lines += lines_count; } -int ShowHint(const char * const Caption, const neutrino_locale_t Text, const int Width, int timeout, const char * const Icon) +void CHintBox::setMsgText(const std::string& Text, const uint& hint_id, const int& mode, Font* font_text, const fb_pixel_t& color_text, const int& style) { - return ShowHint(Caption, g_Locale->getText(Text),Width,timeout,Icon); + uint id = hint_id; + if (hint_id+1 > obj_content->size()){ + id = 0; + dprintf(DEBUG_NORMAL, "[CHintBox] [%s - %d] mismatching hint_id [%u]...\n", __func__, __LINE__, id); + } + + CComponentsFrmChain *obj_hint = static_cast(obj_content->getCCItem(id)); + CComponentsText *obj_text = static_cast(obj_hint->getCCItem(1)); + + //set required font and line size + Font* font = font_text == NULL ? g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO] : font_text; + if (obj_text) + obj_text->setText(Text, mode, font, color_text, style); } +void CHintBox::ReSize() +{ + int h_content_old = obj_content->getHeight(); + int h_content_new = 0; + for (size_t i= 0; i< obj_content->size(); i++){ + CComponentsItem *item = obj_content->getCCItem(i); + h_content_new += item->getHeight(); + } + int h_content_diff = h_content_new - h_content_old; + + obj_content->setHeight(h_content_new); + setHeight(height+h_content_diff); +} + + +void CHintBox::Scroll(bool down, const uint& hint_id) +{ + uint id = hint_id; + if (hint_id+1 > obj_content->size()){ + id = 0; + dprintf(DEBUG_NORMAL, "[CHintBox] [%s - %d] mismatching hint_id [%u]...\n", __func__, __LINE__, id); + } + + CComponentsFrmChain *obj_hint = static_cast(obj_content->getCCItem(id)); + CComponentsText *obj_text = static_cast(obj_hint->getCCItem(1)); + + if (obj_text) { + dprintf(DEBUG_INFO, "[CHintBox] [%s - %d] try to scroll %s hint_id [%u]...Text= %s\n", __func__, __LINE__, down ? "down" : "up", id, obj_text->getText().c_str()); + CTextBox* textbox = obj_text->getCTextBoxObject(); + if (textbox) { + textbox->enableBackgroundPaint(true); + if (down) + textbox->scrollPageDown(1); + else + textbox->scrollPageUp(1); + textbox->enableBackgroundPaint(false); + } + } +} + +void CHintBox::scroll_up(const uint& hint_id) +{ + Scroll(false, hint_id); +} + +void CHintBox::scroll_down(const uint& hint_id) +{ + Scroll(true, hint_id); +} + + +int ShowHint(const char * const Caption, const char * const Text, const int Width, int timeout, const char * const Icon, const char * const Picon, const int& header_buttons) +{ + int res = messages_return::none; + + CHintBox hintBox(Caption, Text, Width, Icon, Picon, header_buttons); + hintBox.setTimeOut(timeout); + hintBox.paint(); + res = hintBox.exec(); + hintBox.hide(); + + return res; +} + +int ShowHint(const neutrino_locale_t Caption, const char * const Text, const int Width, int timeout, const char * const Icon, const char * const Picon, const int& header_buttons) +{ + const char * caption = g_Locale->getText(Caption); + return ShowHint(caption, Text, Width, timeout, Icon, Picon, header_buttons); +} + +int ShowHint(const neutrino_locale_t Caption, const neutrino_locale_t Text, const int Width, int timeout, const char * const Icon, const char * const Picon, const int& header_buttons) +{ + return ShowHint(Caption, g_Locale->getText(Text),Width,timeout,Icon, Picon, header_buttons); +} + +int ShowHint(const char * const Caption, const neutrino_locale_t Text, const int Width, int timeout, const char * const Icon, const char * const Picon, const int& header_buttons) +{ + return ShowHint(Caption, g_Locale->getText(Text),Width,timeout, Icon, Picon, header_buttons); +} + + +CHint::CHint(const char * const Text, bool show_background) : CHintBox("" , Text) +{ + paint_bg = show_background; + ccw_show_header = false; + ccw_show_footer = false; +} + +CHint::CHint(const neutrino_locale_t Text, bool show_background) : CHintBox("" , g_Locale->getText(Text)) +{ + paint_bg = show_background; + ccw_show_header = false; + ccw_show_footer = false; +} + +int ShowHintS(const char * const Text, int timeout, bool show_background) +{ + int res = messages_return::none; + + CHint hint(Text, show_background); + hint.setTimeOut(timeout); + hint.paint(); + res = hint.exec(); + hint.hide(); + + return res; +} + +int ShowHintS(const neutrino_locale_t Text, int timeout, bool show_background) +{ + return ShowHintS(g_Locale->getText(Text), timeout, show_background); +} diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index 460d9f556..a071824ae 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -1,88 +1,194 @@ /* - Neutrino-GUI - DBoxII-Project + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean - Copyright (C) 2001 Steffen Hehn 'McClean' - Homepage: http://dbox.cyberphoria.org/ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. + Hintbox based up initial code by + Copyright (C) 2003 Ralf Gandy 'thegoodguy' + Copyright (C) 2004 Sven Traenkle 'zwen' + Copyright (C) 2008-2009, 2011, 2013 Stefan Seyfried + Implementation of CComponent Window class. + Copyright (C) 2014-2015 Thilo Graf 'dbt' License: GPL - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ -#ifndef __hintbox__ -#define __hintbox__ +#ifndef __C_HINTBOX__ +#define __C_HINTBOX__ -#include -#include -#include +#include -#include -#include +#define HINTBOX_MIN_WIDTH 600 +#define HINTBOX_MIN_HEIGHT 125 +#define HINTBOX_MAX_HEIGHT 420 +#define HINTBOX_DEFAULT_TIMEOUT 5 +//frame around hint container as indent +#define W_FRAME 15 +//frame color around hint/message box +#define HINTBOX_DEFAULT_FRAME_COLOR COL_MENUCONTENT_PLUS_6 -class CHintBox +//! Sub class of CComponentsWindow. Shows a window as a hintbox with text and optional icon beside of text. +/*! +CHintBox provides a small window with header and a text item, +optional you can add an icon in the header and/or beside left of +text and context buttons on the right site of header. +*/ + +class CHintBox : public CComponentsWindow { - protected: + protected: + int y_hint_obj; + int h_hint_obj; + int w_indentation; - CFBWindow * window; + ///global count of lines + uint lines; - unsigned int entries_per_page; - unsigned int current_page; + ///timeout value, see also setTimeOut() + int timeout; - int width; - int height; - int textStartX; + ///content container object, contains the hint objects, it's a child of body object + CComponentsFrmChain *obj_content; - int fheight; - int theight; - const char * caption; - char * message; - std::vector line; - std::string iconfile; - void init(const char * const Caption, const char * const Text, const int Width, const char * const Icon); - void refresh(void); + ///scroll handler, default down and for the 1st hint item (=0), NOTE: exec() must be called! see also scroll_down()/scroll_up() + void Scroll(bool down, const uint& hint_id = 0); - public: - // Text is UTF-8 encoded - CHintBox(const neutrino_locale_t Caption, const char * const Text, const int Width = 450, const char * const Icon = NEUTRINO_ICON_INFO); - CHintBox(const neutrino_locale_t Caption, const neutrino_locale_t Text, const int Width = 450, const char * const Icon = NEUTRINO_ICON_INFO); - CHintBox(const char * const Caption, const char * const Text, const int Width = 450, const char * const Icon = NEUTRINO_ICON_INFO); - CHintBox(const char * const Caption, const neutrino_locale_t Text, const int Width = 450, const char * const Icon = NEUTRINO_ICON_INFO); - ~CHintBox(void); + ///main init handler + void init( const std::string& Text, + const int& Width, + const std::string& Picon, + const int& header_buttons, + const int& text_mode, + const int& indent); - bool has_scrollbar(void); - void scroll_up(void); - void scroll_down(void); + void ReSize(); - void paint(void); - void hide(void); + public: + // Text is UTF-8 encoded + CHintBox( const neutrino_locale_t Caption, + const char * const Text, + const int Width = HINTBOX_MIN_WIDTH, + const char * const Icon = NULL, + const char * const Picon = NULL, + const int& header_buttons = 0, + const int& text_mode = 0, + const int& indent = W_FRAME); + + CHintBox( const char * const Caption, + const char * const Text, + const int Width = HINTBOX_MIN_WIDTH, + const char * const Icon = NULL, + const char * const Picon = NULL, + const int& header_buttons = 0, + const int& text_mode = 0, + const int& indent = W_FRAME); + + CHintBox( const neutrino_locale_t Caption, + const neutrino_locale_t Text, + const int Width = HINTBOX_MIN_WIDTH, + const char * const Icon = NULL, + const char * const Picon = NULL, + const int& header_buttons = 0, + const int& text_mode = 0, + const int& indent = W_FRAME); + + CHintBox( const char * const Caption, + const neutrino_locale_t Text, + const int Width = HINTBOX_MIN_WIDTH, + const char * const Icon = NULL, + const char * const Picon = NULL, + const int& header_buttons = 0, + const int& text_mode = 0, + const int& indent = W_FRAME); + + //~CHintBox(); //inherited + int exec(); + + ///define timeout, timeout is enabled if parameter1 > -1 + virtual void setTimeOut(const int& Timeout){timeout = Timeout;}; + + ///scroll handler for text objects: NOTE: exec() must be called ! see also Scroll() + ///scroll up handler, default for the 1st hint item (=0), item id arises from the order of added items with addHintItem(), default we have minimal one item with id=0 + void scroll_up(const uint& hint_id = 0); + ///scroll down handler, default for the 1st hint item (=0), item id arises from the order of added items with addHintItem(), default we have minimal one item with id=0 + void scroll_down(const uint& hint_id = 0); + + ///specialized member to add a hint item, parameter1: UTF8 text that will be showed, parameter2: (optional) textmode, see gui/widget/textbox.h for possible modes, parameter3: (optional) = an icon that will be showed left beside of text + void addHintItem( const std::string& Text, + const int& text_mode = 0, + const std::string& Picon = std::string(), + const u_int8_t& at_page_number = 0, + const fb_pixel_t& color_text = COL_MENUCONTENT_TEXT, + Font* font_text = NULL); + ///add any cc-item to body object, also usable is addWindowItem() to add items to the window body object + void addHintItem(CComponentsItem* cc_Item){obj_content->addCCItem(cc_Item);} + + /*! + * Sets a new text to a hint item, + 2nd parameter expects an item number, default = 0 (1st item). Mostly this should be the only one, but if more than one items are exist, it's possible to select a target item. + 3rd parameter expects modes from CTextBox (default = CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH | CTextBox::CENTER) + AUTO_WIDTH + AUTO_HIGH + SCROLL + CENTER + RIGHT + TOP + BOTTOM + NO_AUTO_LINEBREAK + AUTO_LINEBREAK_NO_BREAKCHARS + 4th parameter font_text expects a font object, if default value = NULL, then g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO] is used + 5th parameter expects value from /gui/color.h or compatible color numbers + 6th parameter expects + FONT_STYLE_REGULAR (default) + FONT_STYLE_BOLD + FONT_STYLE_ITALIC + */ + void setMsgText(const std::string& Text, + const uint& hint_id = 0, + const int& mode = CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH | CTextBox::CENTER, + Font* font_text = NULL, + const fb_pixel_t& color_text = COL_MENUCONTENT_TEXT, + const int& style = CComponentsText::FONT_STYLE_REGULAR); }; // Text is UTF-8 encoded -int ShowHint(const neutrino_locale_t Caption, const char * const Text, const int Width = 450, int timeout = -1, const char * const Icon = NEUTRINO_ICON_INFO); -int ShowHint(const neutrino_locale_t Caption, const neutrino_locale_t Text, const int Width = 450, int timeout = -1, const char * const Icon = NEUTRINO_ICON_INFO); -int ShowHint(const char * const Caption, const char * const Text, const int Width = 450, int timeout = -1, const char * const Icon = NEUTRINO_ICON_INFO); -int ShowHint(const char * const Caption, const neutrino_locale_t Text, const int Width = 450, int timeout = -1, const char * const Icon = NEUTRINO_ICON_INFO); +int ShowHint(const neutrino_locale_t Caption, const char * const Text, const int Width = HINTBOX_MIN_WIDTH, int timeout = HINTBOX_DEFAULT_TIMEOUT, const char * const Icon = NULL, const char * const Picon = NULL, const int& header_buttons = 0); +int ShowHint(const neutrino_locale_t Caption, const neutrino_locale_t Text, const int Width = HINTBOX_MIN_WIDTH, int timeout = HINTBOX_DEFAULT_TIMEOUT, const char * const Icon = NULL, const char * const Picon = NULL, const int& header_buttons = 0); +int ShowHint(const char * const Caption, const char * const Text, const int Width = HINTBOX_MIN_WIDTH, int timeout = HINTBOX_DEFAULT_TIMEOUT, const char * const Icon = NULL, const char * const Picon = NULL, const int& header_buttons = 0); +int ShowHint(const char * const Caption, const neutrino_locale_t Text, const int Width = HINTBOX_MIN_WIDTH, int timeout = HINTBOX_DEFAULT_TIMEOUT, const char * const Icon = NULL, const char * const Picon = NULL, const int& header_buttons = 0); + + + +//! Sub class of CHintBox. Shows a simplified hint as a text hint without header and footer. +/*! +CHint provides a text without header and footer, +optional disable/enable background +*/ + +class CHint : public CHintBox +{ + public: + CHint(const char * const Text, bool show_background = true); + CHint(const neutrino_locale_t Text, bool show_background = true); +}; + +//methods to show simplified hints +int ShowHintS(const neutrino_locale_t Text, int timeout = HINTBOX_DEFAULT_TIMEOUT, bool show_background = true); +int ShowHintS(const char * const Text, int timeout = HINTBOX_DEFAULT_TIMEOUT, bool show_background = true); #endif diff --git a/src/gui/widget/keyboard_input.cpp b/src/gui/widget/keyboard_input.cpp index 72cd73dfc..d6e7341cf 100644 --- a/src/gui/widget/keyboard_input.cpp +++ b/src/gui/widget/keyboard_input.cpp @@ -36,7 +36,7 @@ #include #include -#include +#include #include #include @@ -601,7 +601,7 @@ int CKeyboardInput::exec(CMenuTarget* parent, const std::string &) else if ((msg == CRCInput::RC_home) || (msg == CRCInput::RC_timeout)) { if ((inputString->getValue() != oldval) && - (ShowMsg(name, LOCALE_MESSAGEBOX_DISCARD, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbCancel) == CMessageBox::mbrCancel)) { + (ShowMsg(name, LOCALE_MESSAGEBOX_DISCARD, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbCancel) == CMsgBox::mbrCancel)) { timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]); continue; } diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index bf6d22730..ea416384c 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -338,32 +338,12 @@ int ShowMsg(const std::string &Caption, const std::string & Text, const CMessage return ShowMsg(Caption, Text.c_str(), Default, ShowButtons, Icon, Width, timeout,returnDefaultOnTimeout); } -void DisplayErrorMessage(const char * const ErrorMsg) -{ - ShowMsg(LOCALE_MESSAGEBOX_ERROR, ErrorMsg, CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); -} - -void DisplayErrorMessage(const char * const ErrorMsg, const neutrino_locale_t Caption) -{ - ShowMsg(Caption, ErrorMsg, CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); -} - -void DisplayErrorMessage(const char * const ErrorMsg, const std::string &Caption) -{ - ShowMsg(Caption, ErrorMsg, CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); -} - -void DisplayInfoMessage(const char * const InfoMsg) -{ - ShowMsg(LOCALE_MESSAGEBOX_INFO, InfoMsg, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); -} - -void DisplayInfoMessage(const char * const InfoMsg, const neutrino_locale_t Caption) -{ - ShowMsg(Caption, InfoMsg, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); -} - -void DisplayInfoMessage(const char * const InfoMsg, const std::string &Caption) -{ - ShowMsg(Caption, InfoMsg, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); -} +// void DisplayErrorMessage(const char * const ErrorMsg) +// { +// ShowMsg(LOCALE_MESSAGEBOX_ERROR, ErrorMsg, CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); +// } +// +// void DisplayInfoMessage(const char * const ErrorMsg) +// { +// ShowMsg(LOCALE_MESSAGEBOX_INFO, ErrorMsg, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); +// } diff --git a/src/gui/widget/messagebox.h b/src/gui/widget/messagebox.h index b06892259..8604efe76 100644 --- a/src/gui/widget/messagebox.h +++ b/src/gui/widget/messagebox.h @@ -107,11 +107,13 @@ int ShowMsg(const std::string &Caption, const char * const Text, const CMessageB int ShowMsg(const std::string &Caption, const std::string & Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = 450, const int timeout = -1, bool returnDefaultOnTimeout = false); // UTF-8 int ShowMsg(const std::string &Caption, const neutrino_locale_t Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = 450, const int timeout = -1, bool returnDefaultOnTimeout = false); // UTF-8 +#if 0 void DisplayErrorMessage(const char * const ErrorMsg); // UTF-8 void DisplayErrorMessage(const char * const ErrorMsg, const neutrino_locale_t Caption); // UTF-8 void DisplayErrorMessage(const char * const ErrorMsg, const std::string &Caption); // UTF-8 void DisplayInfoMessage(const char * const InfoMsg); // UTF-8 void DisplayInfoMessage(const char * const InfoMsg, const neutrino_locale_t Caption); // UTF-8 void DisplayInfoMessage(const char * const InfoMsg, const std::string &Caption); // UTF-8 +#endif #endif diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index f6ca7e428..65a926475 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -1,47 +1,28 @@ /* - Neutrino-GUI - DBoxII-Project + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean - Homepage: http://dbox.cyberphoria.org/ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. + Initial implementation as an interface of the CMsgBox class + Copyright (C) 2005 Günther + Günther@tuxbox.berlios.org + Implementation of CComponent Window class. + Copyright (C) 2014-2015 Thilo Graf 'dbt' License: GPL - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - *********************************************************** - - Module Name: msgbox.cpp: . - - Description: Implementation of the CMsgBox class - This class provides a message box using CTextBox. - - Date: Nov 2005 - - Author: Gnther@tuxbox.berlios.org - based on code of Steffen Hehn 'McClean' - - Revision History: - Date Author Change Description - Nov 2005 Gnther initial implementation + along with this program. If not, see . */ #ifdef HAVE_CONFIG_H @@ -49,16 +30,10 @@ #endif #include - -#include "msgbox.h" - -#include #include -#define WINDOW_FRAME_BORDER_WIDTH 4 -#define ADD_FOOT_HEIGHT 20 -#define TEXT_BORDER_WIDTH 8 -#define TITLE_ICON_WIDTH (40 - TEXT_BORDER_WIDTH) +#include "msgbox.h" +#include #define MAX_WINDOW_WIDTH (g_settings.screen_EndX - g_settings.screen_StartX ) #define MAX_WINDOW_HEIGHT (g_settings.screen_EndY - g_settings.screen_StartY - 40) @@ -66,818 +41,481 @@ #define MIN_WINDOW_WIDTH (MAX_WINDOW_WIDTH>>1) #define MIN_WINDOW_HEIGHT 40 -#define DEFAULT_TITLE_FONT g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE] -#define DEFAULT_FOOT_FONT g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT] - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////// -// Function Name: CMsgBox -// Description: -// Parameters: -// Data IN/OUT: -// Return: -// Notes: -////////////////////////////////////////////////////////////////////// -CMsgBox::CMsgBox( const char * text, - Font* fontText, - const int _mode, - const CBox* position, - const char * title, - Font* fontTitle, - const char * icon, - int return_button , - const result_ default_result) +CMsgBox::CMsgBox( const char* Text, + const char* Title, + const char* Icon, + const char* Picon, + const int& Width, + const int& Height, + const int& ShowButtons, + const msg_result_t& Default_result, + const int& Text_mode) : CHintBox( Title, + Text, + Width, + Icon, + Picon, + 0, + Text_mode) { - //TRACE("->CMsgBox::CMsgBox\r\n"); - initVar(); - - if(title != NULL) m_cTitle = title; - if(fontTitle != NULL) m_pcFontTitle = fontTitle; - if(icon != NULL) m_cIcon = icon; - if(position != NULL) m_cBoxFrame = *position; - m_nMode = _mode; - //TRACE(" CMsgBox::cText: %d ,m_cTitle %d,m_nMode %d\t\r\n",strlen(text),m_cTitle.size(),m_nMode); - - if(m_nMode & BORDER) - m_nWindowFrameBorderWidth = WINDOW_FRAME_BORDER_WIDTH; - else - m_nWindowFrameBorderWidth = 0; - - //TRACE(" Mode: "); - //if(_mode & BORDER) TRACE("BORDER "); - //if(_mode & TITLE) TRACE("TITLE "); - //if(_mode & FOOT) TRACE("FOOT "); - //if(_mode & CENTER) TRACE("CENTER"); - //TRACE("\r\n"); - - //TRACE_1(" m_nWindowFrameBorderWidth: \t%d\r\n",m_nWindowFrameBorderWidth); - - - /* Initialise the window frames first */ - initFramesRel(); - - m_pcTextBox = new CTextBox( text, - fontText, - _mode, - &m_cBoxFrameText); - - if(_mode & AUTO_WIDTH || _mode & AUTO_HIGH) - { - /* window might changed in size ...*/ - m_cBoxFrameText = m_pcTextBox->getWindowsPos(); - - m_cBoxFrame.iWidth = m_cBoxFrameText.iWidth + m_nWindowFrameBorderWidth; - m_cBoxFrame.iHeight = m_cBoxFrameText.iHeight + m_cBoxFrameFootRel.iHeight + m_cBoxFrameTitleRel.iHeight + m_nWindowFrameBorderWidth; - - initFramesRel(); - } - - if(_mode & CENTER) - { - m_cBoxFrame.iX = g_settings.screen_StartX + ((g_settings.screen_EndX - g_settings.screen_StartX - m_cBoxFrame.iWidth) >>1); - m_cBoxFrame.iY = g_settings.screen_StartY + ((g_settings.screen_EndY - g_settings.screen_StartY - m_cBoxFrame.iHeight) >>2); - } - - m_nResult = default_result; - m_nFootButtons = return_button; + init(Height, ShowButtons, Default_result); } -////////////////////////////////////////////////////////////////////// -// Function Name: CMsgBox -// Description: -// Parameters: -// Data IN/OUT: -// Return: -// Notes: -////////////////////////////////////////////////////////////////////// -CMsgBox::CMsgBox(const char * text) +CMsgBox::CMsgBox( const char* Text, + const neutrino_locale_t locale_Title, + const char* Icon, + const char* Picon, + const int& Width, + const int& Height, + const int& ShowButtons, + const msg_result_t& Default_result, + const int& Text_mode) : CHintBox( locale_Title, + Text, + Width, + Icon, + Picon, + 0, + Text_mode) { - initVar(); - - m_pcTextBox = new CTextBox( text); - /* Initialise the window frames first */ - initFramesRel(); + init(Height, ShowButtons, Default_result); } -////////////////////////////////////////////////////////////////////// -// Function Name: CMsgBox -// Description: -// Parameters: -// Data IN/OUT: -// Return: -// Notes: -////////////////////////////////////////////////////////////////////// -CMsgBox::CMsgBox() +void CMsgBox::init(const int& Height, const int& ShowButtons, const msg_result_t& Default_result) { - m_pcTextBox = NULL; + dprintf(DEBUG_NORMAL, "[CMsgBox] [%s - %d] \n", __func__, __LINE__); - initVar(); - initFramesRel(); + initTimeOut(); + + //enable footer and add its height + showFooter(true); + ccw_footer->doPaintBg(false); + int h_current = height; + h_current += ccw_footer->getHeight(); + height = max(max(MSGBOX_MIN_HEIGHT, Height), h_current); + + //ensure matching height for screen + height = min(MAX_WINDOW_HEIGHT, height); + width = min(MAX_WINDOW_WIDTH, width); + + //set result + if (Default_result != mbrNone) + result = default_result = Default_result; + + //add and initialize footer buttons with required buttons and basic properties + if (ShowButtons > -1) + mb_show_button = ShowButtons; + initButtons(); } -////////////////////////////////////////////////////////////////////// -// Function Name: ~CMsgBox -// Description: -// Parameters: -// Data IN/OUT: -// Return: -// Notes: -////////////////////////////////////////////////////////////////////// -CMsgBox::~CMsgBox() +void CMsgBox::initTimeOut() { - if (m_pcWindow != NULL) - { - delete m_pcWindow; - m_pcWindow = NULL; - } - - if (m_pcTextBox != NULL) - { - delete m_pcTextBox; - m_pcTextBox = NULL; - } - + timeout = -1; + enable_timeout_result = false; } -////////////////////////////////////////////////////////////////////// -// Function Name: InitVar -// Description: -// Parameters: -// Data IN/OUT: -// Return: -// Notes: -////////////////////////////////////////////////////////////////////// -void CMsgBox::initVar(void) +void CMsgBox::initButtons() { - //TRACE("->CMsgBox::InitVar\r\n"); - m_nResult = mbrYes; - m_cTitle = ""; - m_cIcon = ""; - m_nMode = SCROLL | TITLE | BORDER ; + button_label_s btn; + vector v_buttons; - // set the title varianles - m_pcFontTitle = DEFAULT_TITLE_FONT; - m_nFontTitleHeight = m_pcFontTitle->getHeight(); + //evaluate combinations + if (mb_show_button & mbAll) + mb_show_button = (mbOk|mbYes|mbNo|mbCancel|mbBack); //stupid! only demo + if (mb_show_button & mbOKCancel) + mb_show_button = (mbOk|mbCancel); + if (mb_show_button & mbYesNoCancel) + mb_show_button = (mbYes|mbNo|mbCancel); + if (mb_show_button & mbYesNo) + mb_show_button = (mbYes|mbNo); - // set the foot variables - m_pcFontFoot = DEFAULT_FOOT_FONT; - m_nFontFootHeight = m_pcFontFoot->getHeight(); - m_nFootButtons = 0; - - // set the main frame border width - if(m_nMode & BORDER) - m_nWindowFrameBorderWidth = WINDOW_FRAME_BORDER_WIDTH; - else - m_nWindowFrameBorderWidth = 0; - - // set the main frame to default - m_cBoxFrame.iX = g_settings.screen_StartX + ((g_settings.screen_EndX - g_settings.screen_StartX - MIN_WINDOW_WIDTH) >>1); - m_cBoxFrame.iWidth = MIN_WINDOW_WIDTH; - m_cBoxFrame.iY = g_settings.screen_StartY + ((g_settings.screen_EndY - g_settings.screen_StartY - MIN_WINDOW_HEIGHT) >>2); - m_cBoxFrame.iHeight = MIN_WINDOW_HEIGHT; - - m_pcWindow = NULL; - - //TRACE_1(" m_nWindowFrameBorderWidth: \t%d\r\n",m_nWindowFrameBorderWidth); -} - -////////////////////////////////////////////////////////////////////// -// Function Name: InitFramesRel -// Description: -// Parameters: -// Data IN/OUT: -// Return: -// Notes: -////////////////////////////////////////////////////////////////////// -void CMsgBox::initFramesRel(void) -{ - //TRACE("->CMsgBox::InitFramesRel\r\n"); - // init the title frame - if(m_nMode & TITLE) - { - m_cBoxFrameTitleRel.iX = 0; - m_cBoxFrameTitleRel.iY = 0; - m_cBoxFrameTitleRel.iWidth = m_cBoxFrame.iWidth - m_nWindowFrameBorderWidth; - m_cBoxFrameTitleRel.iHeight = m_nFontTitleHeight + 2; + //assign button text, result values, direct keys and alternate keys + if (mb_show_button & mbOk){ + btn.button = NEUTRINO_ICON_BUTTON_OKAY; + btn.text = BTN_TEXT(mbOk); + btn.directKey = CRCInput::RC_ok; + btn.btn_result = mbrOk; + btn.btn_alias = mbOk; + v_buttons.push_back(btn); } - else - { - m_cBoxFrameTitleRel.iX = 0; - m_cBoxFrameTitleRel.iY = 0; - m_cBoxFrameTitleRel.iHeight = 0; - m_cBoxFrameTitleRel.iWidth = 0; + if (mb_show_button & mbYes){ + btn.button = NEUTRINO_ICON_BUTTON_GREEN; + btn.text = BTN_TEXT(mbYes); + btn.directKey = CRCInput::RC_green; + btn.directKeyAlt = CRCInput::RC_ok; + btn.btn_result = mbrYes; + btn.btn_alias = mbYes; + v_buttons.push_back(btn); + } + if (mb_show_button & mbNo){ + btn.button = NEUTRINO_ICON_BUTTON_RED; + btn.text = BTN_TEXT(mbNo); + btn.directKey = CRCInput::RC_red; + btn.directKeyAlt = CRCInput::RC_home; + btn.btn_result = mbrNo; + btn.btn_alias = mbNo; + v_buttons.push_back(btn); + } + if (mb_show_button & mbCancel){ + btn.button = NEUTRINO_ICON_BUTTON_HOME; + btn.text = BTN_TEXT(mbCancel); + btn.directKey = CRCInput::RC_home; + btn.directKeyAlt = CRCInput::RC_setup; + btn.btn_result = mbrCancel; + btn.btn_alias = mbCancel; + v_buttons.push_back(btn); + } + if (mb_show_button & mbBack){ + btn.button = NEUTRINO_ICON_BUTTON_HOME; + btn.text = BTN_TEXT(mbBack); + btn.directKey = CRCInput::RC_home; + btn.btn_result = mbrBack; + btn.btn_alias = mbBack; + v_buttons.push_back(btn); } - // init the foot frame - if(m_nMode & FOOT) - { - m_cBoxFrameFootRel.iX = 0; - m_cBoxFrameFootRel.iY = m_cBoxFrame.iHeight - m_nFontFootHeight - m_nWindowFrameBorderWidth - ADD_FOOT_HEIGHT; - m_cBoxFrameFootRel.iWidth = m_cBoxFrame.iWidth - m_nWindowFrameBorderWidth; - m_cBoxFrameFootRel.iHeight = m_nFontFootHeight + ADD_FOOT_HEIGHT; - } - else - { - m_cBoxFrameFootRel.iX = 0; - m_cBoxFrameFootRel.iY = 0; - m_cBoxFrameFootRel.iHeight = 0; - m_cBoxFrameFootRel.iWidth = 0; - } + ccw_footer->setButtonLabels(v_buttons, 0, 125); - // init the text frame - m_cBoxFrameText.iY = m_cBoxFrame.iY + m_cBoxFrameTitleRel.iY + m_cBoxFrameTitleRel.iHeight; - m_cBoxFrameText.iX = m_cBoxFrame.iX + m_cBoxFrameTitleRel.iX; - m_cBoxFrameText.iHeight = m_cBoxFrame.iHeight - m_cBoxFrameTitleRel.iHeight - m_cBoxFrameFootRel.iHeight - m_nWindowFrameBorderWidth; - m_cBoxFrameText.iWidth = m_cBoxFrame.iWidth - m_nWindowFrameBorderWidth; -#if 0 - TRACE_1("Frames\r\n\tScren:\t%3d,%3d,%3d,%3d\r\n\tMain:\t%3d,%3d,%3d,%3d\r\n\tText:\t%3d,%3d,%3d,%3d \r\n\tTitle:\t%3d,%3d,%3d,%3d \r\n\tFoot:\t%3d,%3d,%3d,%3d\r\n\r\n", - g_settings.screen_StartX, - g_settings.screen_StartY, - g_settings.screen_EndX, - g_settings.screen_EndY, - m_cBoxFrame.iX, - m_cBoxFrame.iY, - m_cBoxFrame.iWidth, - m_cBoxFrame.iHeight, - m_cBoxFrameText.iX, - m_cBoxFrameText.iY, - m_cBoxFrameText.iWidth, - m_cBoxFrameText.iHeight, - m_cBoxFrameTitleRel.iX, - m_cBoxFrameTitleRel.iY, - m_cBoxFrameTitleRel.iWidth, - m_cBoxFrameTitleRel.iHeight, - m_cBoxFrameFootRel.iX, - m_cBoxFrameFootRel.iY, - m_cBoxFrameFootRel.iWidth, - m_cBoxFrameFootRel.iHeight - ); -#endif -} + //show buttons with frame and background + ccw_footer->showButtonContour(true); -////////////////////////////////////////////////////////////////////// -// Function Name: RefreshFoot -// Description: -// Parameters: -// Data IN/OUT: -// Return: -// Notes: -////////////////////////////////////////////////////////////////////// -void CMsgBox::refreshFoot(void) -{ - uint32_t color, bgcolor; - if( !(m_nMode & FOOT)) return; + //set position of meassage window and refresh window properties + setCenterPos(); + Refresh(); - // draw the background first - m_pcWindow->paintBoxRel( m_cBoxFrameFootRel.iX+m_cBoxFrame.iX, - m_cBoxFrameFootRel.iY+m_cBoxFrame.iY, - m_cBoxFrameFootRel.iWidth, - m_cBoxFrameFootRel.iHeight, - (CFBWindow::color_t)COL_MENUHEAD_PLUS_0, - RADIUS_LARGE, CORNER_BOTTOM); + //set the 1st button as default selected button + ccw_footer->setSelectedButton(0); - //const char* text; - - int MaxButtonTextWidth = m_pcFontFoot->getRenderWidth(g_Locale->getText(LOCALE_MESSAGEBOX_CANCEL)); - int ButtonWidth = 20 + 33 + MaxButtonTextWidth; - int ButtonSpacing = (m_cBoxFrameFootRel.iWidth - 20- (ButtonWidth*3) ) / 2; - int xpos = m_cBoxFrameFootRel.iX; - - // draw Button mbYes - if (m_nFootButtons & mbYes) - { - if (m_nResult == mbrYes) - { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; + //define default selected button from default_result + if (v_buttons.size() > 1){ + for (size_t i = 0; i< v_buttons.size(); i++){ + if (v_buttons[i].btn_result == result){ + ccw_footer->setSelectedButton(i); + break; + } } - else - { - color = COL_MENUCONTENTINACTIVE_TEXT; - bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; - } - m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX + OFFSET_SHADOW, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY + OFFSET_SHADOW, ButtonWidth, m_nFontFootHeight + 4, COL_SHADOW_PLUS_0, RADIUS_MID); - m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, (CFBWindow::color_t)bgcolor, RADIUS_MID); - m_pcWindow->paintBoxFrame(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, 1, COL_SHADOW_PLUS_0, RADIUS_MID); - m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_RED, xpos + 14+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY); - /*m_pcWindow->RenderString(*/ - m_pcFontFoot->RenderString(xpos + 43+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + m_nFontFootHeight + 4 + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth - 53, g_Locale->getText(LOCALE_MESSAGEBOX_YES), (CFBWindow::color_t)color); - } - - xpos += ButtonWidth + ButtonSpacing; - - // draw Button mbNo - if (m_nFootButtons & mbNo) - { - if (m_nResult == mbrNo) - { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } - else - { - color = COL_MENUCONTENTINACTIVE_TEXT; - bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; - } - m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX + OFFSET_SHADOW, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY + OFFSET_SHADOW, ButtonWidth, m_nFontFootHeight + 4, COL_SHADOW_PLUS_0, RADIUS_MID); - m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, (CFBWindow::color_t)bgcolor, RADIUS_MID); - m_pcWindow->paintBoxFrame(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, 1, COL_SHADOW_PLUS_0, RADIUS_MID); - m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, xpos + 14+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY); - /*m_pcWindow->RenderString(*/ - m_pcFontFoot->RenderString(xpos + 43+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + m_nFontFootHeight + 4 + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth- 53, g_Locale->getText(LOCALE_MESSAGEBOX_NO), (CFBWindow::color_t)color); - } - - xpos += ButtonWidth + ButtonSpacing; - - // draw Button mbCancel - if (m_nFootButtons & (mbCancel | mbBack)) - { - if (m_nResult >= mbrCancel) - { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } - else - { - color = COL_MENUCONTENTINACTIVE_TEXT; - bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; - } - m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX + OFFSET_SHADOW, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY + OFFSET_SHADOW, ButtonWidth, m_nFontFootHeight + 4, COL_SHADOW_PLUS_0, RADIUS_MID); - m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, (CFBWindow::color_t)bgcolor, RADIUS_MID); - m_pcWindow->paintBoxFrame(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, 1, COL_SHADOW_PLUS_0, RADIUS_MID); - m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_HOME, xpos+10+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY); - /*m_pcWindow->RenderString(*/ - m_pcFontFoot->RenderString(xpos + 43+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + m_nFontFootHeight + 2 + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth- 53, g_Locale->getText((m_nFootButtons & mbCancel) ? LOCALE_MESSAGEBOX_CANCEL : LOCALE_MESSAGEBOX_BACK), (CFBWindow::color_t)color); } } -////////////////////////////////////////////////////////////////////// -// Function Name: RefreshTitle -// Description: -// Parameters: -// Data IN/OUT: -// Return: -// Notes: -////////////////////////////////////////////////////////////////////// -void CMsgBox::refreshTitle(void) + + +void CMsgBox::enableDefaultResultOnTimeOut(bool enable) { - // first check if title is configured - if( !(m_nMode & TITLE)) return; - - CComponentsHeader header(m_cBoxFrameTitleRel.iX+m_cBoxFrame.iX, - m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY, - m_cBoxFrameTitleRel.iWidth, - m_cBoxFrameTitleRel.iHeight, m_cTitle, m_cIcon); - header.paint(CC_SAVE_SCREEN_NO); -#if 0 - // draw the background - m_pcWindow->paintBoxRel( m_cBoxFrameTitleRel.iX+m_cBoxFrame.iX, - m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY, - m_cBoxFrameTitleRel.iWidth, - m_cBoxFrameTitleRel.iHeight, - (CFBWindow::color_t)COL_MENUHEAD_PLUS_0, - RADIUS_LARGE, CORNER_TOP); - - if (!m_cIcon.empty()) - { - // draw icon and title text - m_pcWindow->paintIcon(m_cIcon.c_str(), m_cBoxFrameTitleRel.iX + 8+m_cBoxFrame.iX, m_cBoxFrameTitleRel.iY + 5+m_cBoxFrame.iY); - /*m_pcWindow->RenderString(*/ - m_pcFontTitle->RenderString( - m_cBoxFrameTitleRel.iX + TITLE_ICON_WIDTH + TEXT_BORDER_WIDTH+m_cBoxFrame.iX, - m_cBoxFrameTitleRel.iHeight+3+m_cBoxFrame.iY, - m_cBoxFrameTitleRel.iWidth - TITLE_ICON_WIDTH + TEXT_BORDER_WIDTH, - m_cTitle.c_str(), - COL_MENUHEAD_TEXT); - } - else - { - // no icon available, just draw the title text - /*m_pcWindow->RenderString(*/ - m_pcFontTitle->RenderString( - m_cBoxFrameTitleRel.iX + TEXT_BORDER_WIDTH+m_cBoxFrame.iX, - m_cBoxFrameTitleRel.iHeight+3+m_cBoxFrame.iY, - m_cBoxFrameTitleRel.iWidth - TEXT_BORDER_WIDTH, - m_cTitle.c_str(), - COL_MENUHEAD_TEXT); - } -#endif + enable_timeout_result = enable; } -////////////////////////////////////////////////////////////////////// -// Function Name: RefreshBorder -// Description: -// Parameters: -// Data IN/OUT: -// Return: -// Notes: -////////////////////////////////////////////////////////////////////// -void CMsgBox::refreshBorder(void) +int CMsgBox::exec() { - if( !(m_nMode & BORDER && m_nWindowFrameBorderWidth > 0)) return; - - //draw bottom shadow - m_pcWindow->paintBoxRel( m_nWindowFrameBorderWidth+m_cBoxFrame.iX, - m_cBoxFrame.iHeight - m_nWindowFrameBorderWidth+m_cBoxFrame.iY - RADIUS_LARGE, - m_cBoxFrame.iWidth - m_nWindowFrameBorderWidth - RADIUS_LARGE, - m_nWindowFrameBorderWidth + RADIUS_LARGE, - COL_SHADOW_PLUS_0, - RADIUS_LARGE, CORNER_BOTTOM_LEFT); - - //draw right shadow - m_pcWindow->paintBoxRel( m_cBoxFrame.iWidth - m_nWindowFrameBorderWidth+m_cBoxFrame.iX - RADIUS_LARGE, - m_nWindowFrameBorderWidth+m_cBoxFrame.iY, - m_nWindowFrameBorderWidth + RADIUS_LARGE, - m_cBoxFrame.iHeight - m_nWindowFrameBorderWidth, - COL_SHADOW_PLUS_0, - RADIUS_LARGE, CORNER_RIGHT); -} - -////////////////////////////////////////////////////////////////////// -// global Functions -////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////// -// Function Name: Hide -// Description: -// Parameters: -// Data IN/OUT: -// Return: -// Notes: -////////////////////////////////////////////////////////////////////// -bool CMsgBox::hide(void) -{ - //TRACE("->CMsgBox::Hide\r\n"); - - if (m_pcWindow == NULL) - { - TRACE(" return -> window does not exists\r\n"); - return (false); - } - if(m_pcTextBox != NULL) - { - m_pcTextBox->hide(); - } - - // delete window - // delete m_pcWindow; - m_pcWindow->paintBackgroundBoxRel(m_cBoxFrame.iX, m_cBoxFrame.iY, m_cBoxFrame.iWidth, m_cBoxFrame.iHeight); - m_pcWindow = NULL; - return (true); -} - -////////////////////////////////////////////////////////////////////// -// Function Name: ScrollPageDown -// Description: -// Parameters: -// Data IN/OUT: -// Return: -// Notes: -////////////////////////////////////////////////////////////////////// -void CMsgBox::scrollPageDown(const int pages) -{ - // send scroll up event to text box if there is one - if(m_pcTextBox != NULL) - { - m_pcTextBox->scrollPageDown(pages); - } - -} - -////////////////////////////////////////////////////////////////////// -// Function Name: ScrollPageUp -// Description: -// Parameters: -// Data IN/OUT: -// Return: -// Notes: -////////////////////////////////////////////////////////////////////// -void CMsgBox::scrollPageUp(const int pages) -{ - // send scroll up event to text box if there is one - if(m_pcTextBox != NULL) - { - m_pcTextBox->scrollPageUp(pages); - } -} - -////////////////////////////////////////////////////////////////////// -// Function Name: Paint -// Description: -// Parameters: -// Data IN/OUT: -// Return: -// Notes: -////////////////////////////////////////////////////////////////////// -bool CMsgBox::paint(void) -{ - /* - * do not paint stuff twice: - * => thread safety needed by movieplayer.cpp: - * one thread calls our paint method, the other one our hide method - * => no memory leaks - */ - //TRACE("->CMsgBox::Paint\r\n"); - - if (m_pcWindow != NULL) - { - TRACE(" return -> window already exists\r\n"); - return (false); - } - - // create new window - //m_pcWindow = new CFBWindow( m_cBoxFrame.iX, m_cBoxFrame.iY, m_cBoxFrame.iWidth, m_cBoxFrame.iHeight); - m_pcWindow = CFrameBuffer::getInstance(); - refresh(); - if(m_pcTextBox != NULL) - { - m_pcTextBox->paint(); - } - return (true); -} - -////////////////////////////////////////////////////////////////////// -// Function Name: Refresh -// Description: -// Parameters: -// Data IN/OUT: -// Return: -// Notes: -////////////////////////////////////////////////////////////////////// -void CMsgBox::refresh(void) -{ - //TRACE("->CMsgBox::Refresh\r\n"); - - if (m_pcWindow == NULL) - { - TRACE(" return -> no window\r\n"); - return; - } - - //re-draw message box window - refreshBorder(); - refreshTitle(); - refreshFoot(); - - //draw body - m_pcWindow->paintBoxRel( m_cBoxFrameText.iX, - m_cBoxFrameText.iY, - m_cBoxFrameText.iWidth, - m_cBoxFrameText.iHeight, - COL_MENUCONTENT_PLUS_0); - - // rep-draw textbox if there is one - if(m_pcTextBox != NULL) - { - //m_pcTextBox->refresh(); - } -} - -////////////////////////////////////////////////////////////////////// -// Function Name: Exec -// Description: -// Parameters: -// Data IN/OUT: -// Return: -// Notes: -////////////////////////////////////////////////////////////////////// -int CMsgBox::exec( int timeout, int returnDefaultOnTimeout) -{ - //TRACE("->CMsgBox::exec\r\n"); -#ifdef VC - int res = 1; - -#else neutrino_msg_t msg; neutrino_msg_data_t data; - int return_button = m_nFootButtons; int res = menu_return::RETURN_REPAINT; - // show message box - paint(); - if (m_pcWindow == NULL) - { - return res; /* out of memory */ - } + ccw_footer->getSelectedButtonObject()->setButtonAlias(mb_show_button); + int selected = ccw_footer->getSelectedButton(); - if ( timeout == -1 ) - timeout = g_settings.timing[SNeutrinoSettings::TIMING_EPG]; - uint64_t timeoutEnd = CRCInput::calcTimeoutEnd( timeout ); + dprintf(DEBUG_NORMAL, "[CMsgBox] [%s - %d] getSelectedButton()= %d\n", __func__, __LINE__,ccw_footer->getSelectedButton()); - bool loop=true; + uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(timeout); + + bool loop = true; while (loop) { g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd ); - if (msg == CRCInput::RC_timeout && returnDefaultOnTimeout) + + //***timeout result*** + if (msg == CRCInput::RC_timeout && timeout > 0) { - // return default + result = enable_timeout_result ? default_result : mbrTimeout; loop = false; } - else if ( ((msg == CRCInput::RC_timeout) || - (msg == (neutrino_msg_t)g_settings.key_channelList_cancel)) && - (return_button & (mbCancel | mbBack))) +#if 0 + else if (((msg == CRCInput::RC_timeout && timeout > 0) || + (msg == (neutrino_msg_t)g_settings.key_channelList_cancel)) && + (mb_show_button & (mbCancel | mbBack))) { - m_nResult = (return_button & mbCancel) ? mbrCancel : mbrBack; + result = (mb_show_button & mbCancel) ? mbrCancel : (mb_show_button & mbOk) ? mbrOk: mbrBack; loop = false; } - else if ((msg == CRCInput::RC_green) && (return_button & mbNo)) - { - m_nResult = mbrNo; - loop = false; - } - else if ((msg == CRCInput::RC_red) && (return_button & mbYes)) - { - m_nResult = mbrYes; - loop = false; - } - else if(msg==CRCInput::RC_right) - { - bool ok = false; - while (!ok) - { - m_nResult = (CMsgBox::result_)((m_nResult + 1) & 3); - ok = m_nFootButtons & (1 << m_nResult); - } - - refreshFoot(); - } +#endif + //***navi buttons for scroll*** else if (msg == CRCInput::RC_up ) { - scrollPageUp(1); + scroll_up(); } else if (msg == CRCInput::RC_down) { - scrollPageDown(1); + scroll_down(); } - else if(msg==CRCInput::RC_left) - { - bool ok = false; - while (!ok) + else if (msg){ + //***navi buttons for button selection*** + if(msg==CRCInput::RC_right || msg==CRCInput::RC_left) { - m_nResult = (CMsgBox::result_)((m_nResult - 1) & 3); - ok = return_button & (1 << m_nResult); - } + if(msg==CRCInput::RC_right){ + ccw_footer->setSelectedButton(selected+1); + mb_show_button = ccw_footer->getSelectedButtonObject()->getButtonAlias(); + } + if(msg==CRCInput::RC_left){ + ccw_footer->setSelectedButton(selected-1); + mb_show_button = ccw_footer->getSelectedButtonObject()->getButtonAlias(); + } + dprintf(DEBUG_INFO, "[CMsgBox] [%s - %d] result = %d, mb_show_button = %d\n", __func__, __LINE__, result, mb_show_button); + selected = ccw_footer->getSelectedButton(); + refreshFoot(); - refreshFoot(); - } - else if(msg == CRCInput::RC_ok) - { - loop = false; - } - else if (CNeutrinoApp::getInstance()->listModeKey(msg)) - { - // do nothing + //refresh timeout on any pressed navi key! This resets current timeout end to the initial value + if (timeout > 0) + timeoutEnd = CRCInput::calcTimeoutEnd(timeout); + } + //***action buttons without preselection*** + for (size_t i = 0; i< ccw_footer->getButtonChainObject()->size(); i++){ + CComponentsButton* btn_action = static_cast(ccw_footer->getButtonChainObject()->getCCItem(i)); + if (msg == btn_action->getButtonDirectKey() || msg == btn_action->getButtonDirectKeyA()){ + result = (msg_result_t)btn_action->getButtonResult(); + dprintf(DEBUG_INFO, "[CMsgBox] [%s - %d] result = %d, mb_show_button = %d\n", __func__, __LINE__, result, mb_show_button); + loop = false; + } + } + //***action button ok with preselected button*** + if ((msg == CRCInput::RC_ok) && (ccw_footer->getSelectedButtonObject()->getButtonAlias() == mb_show_button)){ + result = (msg_result_t)ccw_footer->getSelectedButtonObject()->getButtonResult(); + loop = false; + } + //***ignore*** + else if (CNeutrinoApp::getInstance()->listModeKey(msg)){ + // do nothing //TODO: if passed rc messages are ignored rc messaages: has no effect here too!! + } } else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) { + dprintf(DEBUG_INFO, "[CMsgBox] [%s - %d] messages_return::cancel_all\n", __func__, __LINE__); res = menu_return::RETURN_EXIT_ALL; loop = false; } - } - hide(); -#endif //VC - return res; } -////////////////////////////////////////////////////////////////////// -// Function Name: SetText -// Description: -// Parameters: -// Data IN/OUT: -// Return: -// Notes: -////////////////////////////////////////////////////////////////////// -bool CMsgBox::setText(const std::string* newText) + +void CMsgBox::refreshFoot(void) { - bool lresult = false; - // update text in textbox if there is one - if(m_pcTextBox != NULL && newText != NULL) + ccw_footer->paint(false); +} + + +void CMsgBox::setButtonText(const int& showed_button, const std::string& text) +{ + switch (showed_button) { - if(m_nMode & AUTO_WIDTH || m_nMode & AUTO_HIGH) - { - /* window might changed in size ...*/ - m_cBoxFrameText = m_pcTextBox->getWindowsPos(); + case mbYes: + btn_text_yes = text; + break; + case mbNo: + btn_text_no = text; + break; + case mbCancel: + btn_text_cancel = text; + break; + case mbBack: + btn_text_back = text; + break; + case mbOk: + btn_text_ok = text; + break; + default: + return; + break; + } + initButtons(); +} - m_cBoxFrame.iWidth = m_cBoxFrameText.iWidth + m_nWindowFrameBorderWidth; - m_cBoxFrame.iHeight = m_cBoxFrameText.iHeight + m_cBoxFrameFootRel.iHeight + m_cBoxFrameTitleRel.iHeight + m_nWindowFrameBorderWidth; +inline std::string CMsgBox::BTN_TEXT(const int& showed_button) +{ + string ret = ""; - initFramesRel(); - - // since the frames size has changed, we have to recenter the window again */ - if(m_nMode & CENTER) - { - m_cBoxFrame.iX = g_settings.screen_StartX + ((g_settings.screen_EndX - g_settings.screen_StartX - m_cBoxFrame.iWidth) >>1); - m_cBoxFrame.iY = g_settings.screen_StartY + ((g_settings.screen_EndY - g_settings.screen_StartY - m_cBoxFrame.iHeight) >>1); - } - } - - lresult = m_pcTextBox->setText(newText); + switch (showed_button) + { + case mbYes: + ret = btn_text_yes.empty() ? g_Locale->getText(LOCALE_MESSAGEBOX_YES) : btn_text_yes; + break; + case mbNo: + ret = btn_text_no.empty() ? g_Locale->getText(LOCALE_MESSAGEBOX_NO) : btn_text_no; + break; + case mbCancel: + ret = btn_text_cancel.empty() ? g_Locale->getText(LOCALE_MESSAGEBOX_CANCEL) : btn_text_cancel; + break; + case mbBack: + ret = btn_text_back.empty() ? g_Locale->getText(LOCALE_MESSAGEBOX_BACK) : btn_text_back; + break; + case mbOk: + ret = btn_text_ok.empty() ? g_Locale->getText(LOCALE_MESSAGEBOX_OK) : btn_text_ok; + break; + default: + break; } - return(lresult); + return ret; } -////////////////////////////////////////////////////////////////////// -// Function Name: SetText -// Description: -// Parameters: -// Data IN/OUT: -// Return: -// Notes: -////////////////////////////////////////////////////////////////////// -int CMsgBox::result(void) +int ShowMsg2UTF( const char * const Title, + const char * const Text, + const CMsgBox::msg_result_t Default, + const uint32_t ShowButtons, + const char * const Icon, + const int Width, + const int Timeout, + bool returnDefaultOnTimeout, + const int& Text_mode, + fb_pixel_t color_frame) { - return m_nResult; + CMsgBox msgBox (Text, + Title, + Icon, + NULL, + Width, + MSGBOX_MIN_HEIGHT, + ShowButtons, + Default, + Text_mode); + + if (color_frame != HINTBOX_DEFAULT_FRAME_COLOR){ + msgBox.setFrameThickness(4); + msgBox.setColorFrame(color_frame); + } + + msgBox.enableDefaultResultOnTimeOut(returnDefaultOnTimeout); + msgBox.setTimeOut(Timeout); + msgBox.paint(); + msgBox.exec(); + int res = msgBox.getResult(); + msgBox.hide(); + return res; } -////////////////////////////////////////////////////////////////////// -// Function Name: ShowMsg2UTF -// Description: -// Parameters: -// Data IN/OUT: -// Return: -// Notes: -////////////////////////////////////////////////////////////////////// -int ShowMsg2UTF( const neutrino_locale_t Caption, - const char * const Text, - const CMsgBox::result_ Default, - const uint32_t ShowButtons, - const char * const Icon, - const int Width, - const int timeout, - bool returnDefaultOnTimeout) +int ShowMsg2UTF( const neutrino_locale_t Title, + const char * const Text, + const CMsgBox::msg_result_t Default, + const uint32_t ShowButtons, + const char * const Icon, + const int Width, + const int Timeout, + bool returnDefaultOnTimeout, + const int& Text_mode, + fb_pixel_t color_frame) { - //TRACE("->CMsgBox::ShowTextUTF \r\n"); - - int result = ShowMsg2UTF( g_Locale->getText(Caption), - Text, - Default, - ShowButtons, - Icon, - Width, - timeout, - returnDefaultOnTimeout); + int result = ShowMsg( g_Locale->getText(Title), Text, Default, ShowButtons, Icon, Width, Timeout, returnDefaultOnTimeout, Text_mode, color_frame); return (result); - } -////////////////////////////////////////////////////////////////////// -// Function Name: ShowMsg2UTF -// Description: -// Parameters: -// Data IN/OUT: -// Return: -// Notes: -////////////////////////////////////////////////////////////////////// -int ShowMsg2UTF( const char * const Title, - const char * const Text, - const CMsgBox::result_ Default, - const uint32_t ShowButtons, - const char * const Icon, - const int /*Width*/, - const int timeout, - bool returnDefaultOnTimeout) +//for compatibility +int ShowMsg( const neutrino_locale_t Title, + const char * const Text, + const CMsgBox::msg_result_t Default, + const uint32_t ShowButtons, + const char * const Icon, + const int Width, + const int Timeout, + bool returnDefaultOnTimeout, + const int& Text_mode, + fb_pixel_t color_frame) { - int mode = CMsgBox::SCROLL | - CMsgBox::TITLE | - CMsgBox::FOOT | - CMsgBox::BORDER;// | - //CMsgBox::NO_AUTO_LINEBREAK | - //CMsgBox::CENTER | - //CMsgBox::AUTO_WIDTH | - //CMsgBox::AUTO_HIGH; - CBox position ( g_settings.screen_StartX+30, - g_settings.screen_StartY+30, - g_settings.screen_EndX - g_settings.screen_StartX-60, - g_settings.screen_EndY - g_settings.screen_StartY-60); + int result = ShowMsg2UTF(Title, Text, Default, ShowButtons, Icon, Width, Timeout, returnDefaultOnTimeout, Text_mode, color_frame); - //TRACE("\r\n->ShowTextUTF %s\r\n",Text); - CMsgBox* msgBox = new CMsgBox( Text, - g_Font[SNeutrinoSettings::FONT_TYPE_MENU], - mode, - &position, - Title, - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], - Icon, - ShowButtons, - Default); - - msgBox->exec( timeout, returnDefaultOnTimeout); - - int res = msgBox->result(); - - delete msgBox; - - return res; + return (result); +} + +int ShowMsg( const char * const Title, + const char * const Text, + const CMsgBox::msg_result_t Default, + const uint32_t ShowButtons, + const char * const Icon, + const int Width, + const int Timeout, + bool returnDefaultOnTimeout, + const int& Text_mode, + fb_pixel_t color_frame) +{ + int result = ShowMsg2UTF(Title, Text, Default, ShowButtons, Icon, Width, Timeout, returnDefaultOnTimeout, Text_mode, color_frame); + + return (result); +} + +int ShowMsg( const neutrino_locale_t Title, + const std::string & Text, + const CMsgBox::msg_result_t Default, + const uint32_t ShowButtons, + const char * const Icon, + const int Width, + const int Timeout, + bool returnDefaultOnTimeout, + const int& Text_mode, + fb_pixel_t color_frame) +{ + int result = ShowMsg2UTF(Title, Text.c_str(), Default, ShowButtons, Icon, Width, Timeout, returnDefaultOnTimeout, Text_mode, color_frame); + + return (result); +} + +int ShowMsg( const neutrino_locale_t Title, + const neutrino_locale_t Text, + const CMsgBox::msg_result_t Default, + const uint32_t ShowButtons, + const char * const Icon, + const int Width, + const int Timeout, + bool returnDefaultOnTimeout, + const int& Text_mode, + fb_pixel_t color_frame) +{ + int result = ShowMsg2UTF(g_Locale->getText(Title), g_Locale->getText(Text), Default, ShowButtons, Icon, Width, Timeout, returnDefaultOnTimeout, Text_mode, color_frame); + + return (result); +} + +int ShowMsg( const std::string & Title, + const std::string & Text, + const CMsgBox::msg_result_t Default, + const uint32_t ShowButtons, + const char * const Icon, + const int Width, + const int Timeout, + bool returnDefaultOnTimeout, + const int& Text_mode, + fb_pixel_t color_frame) +{ + int result = ShowMsg2UTF(Title.c_str(), Text.c_str(), Default, ShowButtons, Icon, Width, Timeout, returnDefaultOnTimeout, Text_mode, color_frame); + + return (result); +} + +void DisplayErrorMessage(const char * const ErrorMsg, const neutrino_locale_t& caption, const int& Text_mode) +{ + ShowMsg(caption, ErrorMsg, CMsgBox::mbrCancel, CMsgBox::mbBack, NEUTRINO_ICON_ERROR, 500, -1, false, Text_mode, COL_RED); +} + +void DisplayErrorMessage(const char * const ErrorMsg, const std::string& caption, const int& Text_mode) +{ + ShowMsg(caption, ErrorMsg, CMsgBox::mbrCancel, CMsgBox::mbBack, NEUTRINO_ICON_ERROR, 500, -1, false, Text_mode, COL_RED); +} + +void DisplayErrorMessage(const char * const ErrorMsg, const int& Text_mode) +{ + DisplayErrorMessage(ErrorMsg, LOCALE_MESSAGEBOX_ERROR, Text_mode); +} + +void DisplayInfoMessage(const char * const InfoMsg, const neutrino_locale_t& caption, const int& Text_mode, fb_pixel_t color_frame) +{ + ShowMsg(caption, InfoMsg, CMsgBox::mbrBack, CMsgBox::mbOk, NEUTRINO_ICON_INFO, 500, -1, false, Text_mode, color_frame); +} + +void DisplayInfoMessage(const char * const InfoMsg, const std::string& caption, const int& Text_mode, fb_pixel_t color_frame) +{ + ShowMsg(caption, InfoMsg, CMsgBox::mbrBack, CMsgBox::mbOk, NEUTRINO_ICON_INFO, 500, -1, false, Text_mode, color_frame); +} + +void DisplayInfoMessage(const char * const InfoMsg, const int& Text_mode, fb_pixel_t color_frame) +{ + DisplayInfoMessage(InfoMsg, LOCALE_MESSAGEBOX_INFO, Text_mode, color_frame); } diff --git a/src/gui/widget/msgbox.h b/src/gui/widget/msgbox.h index a30186389..46c9fbd75 100644 --- a/src/gui/widget/msgbox.h +++ b/src/gui/widget/msgbox.h @@ -1,170 +1,272 @@ /* - Neutrino-GUI - DBoxII-Project + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean - Homepage: http://dbox.cyberphoria.org/ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. + Initial implementation as an interface of the CMsgBox class + Copyright (C) 2005 Günther + Günther@tuxbox.berlios.org + Implementation of CComponent Window class. + Copyright (C) 2014-2015 Thilo Graf 'dbt' License: GPL - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - *********************************************************** - - Module Name: msgbox.h . - - Description: interface of the CMsgBox class - - Date: Nov 2005 - - Author: Günther@tuxbox.berlios.org - based on code of Steffen Hehn 'McClean' - - Revision History: - Date Author Change Description - Nov 2005 Günther initial implementation - + along with this program. If not, see . */ -#if !defined(MSGBOX_H) -#define MSGBOX_H +#ifndef __C_MSGBOX__ +#define __C_MSGBOX__ #ifdef HAVE_CONFIG_H #include #endif -#include -#include "textbox.h" +#include "hintbox.h" +#include -#include +#define MSGBOX_MIN_WIDTH HINTBOX_MIN_WIDTH +#define MSGBOX_MIN_HEIGHT HINTBOX_MIN_HEIGHT + 75 -class CMsgBox + +//! Sub class of CHintBox. Shows a window as a messagebox +/*! +CMsgBox provides a small window with header, text and footer +with predefined buttons. +Optional you can add an icon in the header and/or beside left of +text and context buttons on the right site of header. +CMsgBox objects return predefined result values of type msg_result_t. +Button combinations are defined with button_define_t +*/ +class CMsgBox : public CHintBox { public: /* enum definition */ - enum result_ + enum msg_result_t { mbrYes = 0, mbrNo = 1, mbrCancel = 2, - mbrBack = 3 + mbrBack = 3, + mbrOk = 4, + mbrTimeout = 5, + + mbrNone = -1 }; - enum buttons_ + enum button_define_t { - mbYes = 0x01, - mbNo = 0x02, - mbCancel = 0x04, - mbAll = 0x07, - mbBack = 0x08 + mbYes = 0x01, + mbNo = 0x02, + mbCancel = 0x04, + mbBack = 0x08, + mbOk = 0x10, + mbOKCancel = 0x20, + mbYesNoCancel = 0x40, + mbYesNo = 0x80, + mbAll = 0x100, + //unused allign stuff, only for compatibility + mbBtnAlignCenter1 = 0x0400, /* centered, large distances */ + mbBtnAlignCenter2 = 0x0800, /* centered, small distances */ + mbBtnAlignLeft = 0x1000, + mbBtnAlignRight = 0x2000 }; - enum modes + + enum modes //TODO { - AUTO_WIDTH = 0x01, - AUTO_HIGH = 0x02, - SCROLL = 0x04, - TITLE = 0x08, - FOOT = 0x10, - BORDER = 0x20, - CENTER = 0x40, - NO_AUTO_LINEBREAK= 0x80 + AUTO_WIDTH = CTextBox::AUTO_WIDTH, + AUTO_HIGH = CTextBox::AUTO_HIGH, + SCROLL = CTextBox::SCROLL, +// TITLE = 0x08, +// FOOT = 0x10, +// BORDER = 0x20, + CENTER = CTextBox::CENTER, + NO_AUTO_LINEBREAK = CTextBox::NO_AUTO_LINEBREAK }; private: - /* Functions */ - void initVar(void); - void initFramesRel(void); + void init(const int& Height = -1, const int& ShowButtons = -1, const msg_result_t& Default_result = mbrNone); void refreshFoot(void); - void refreshTitle(void); - void refreshText(void); - void refreshBorder(void); + int mb_show_button; - /* Variables */ - std::string m_cIcon; - std::string m_cTitle; + ///current result value of selected button, see also getResult() + msg_result_t result; + ///defined default result, independently from current selected button result, see also setDefaultResult(), getDefaultResult() + msg_result_t default_result; + ///enable/disable default result on timeout + bool enable_timeout_result; + ///initialize basic timeout + void initTimeOut(); - CBox m_cBoxFrame; - CBox m_cBoxFrameText; - CBox m_cBoxFrameTitleRel; - CBox m_cBoxFrameFootRel; + ///alternate button text + std::string btn_text_ok, btn_text_yes, btn_text_no, btn_text_cancel, btn_text_back; + ///assigned button captions + std::string BTN_TEXT(const int& showed_button); - int m_nMode; - - int m_nWindowFrameBorderWidth; - - Font* m_pcFontTitle; - int m_nFontTitleHeight; - - Font* m_pcFontFoot; - int m_nFontFootHeight; - int m_nFootButtons; - - CTextBox* m_pcTextBox; - //CFBWindow* m_pcWindow; - CFrameBuffer * m_pcWindow; - - result_ m_nResult; + void initButtons(); public: /* Constructor */ - virtual ~CMsgBox(); - CMsgBox(); - CMsgBox(const char * text); - CMsgBox( const char * text, - Font* fontText, - const int mode, - const CBox* position, - const char * title, - Font* fontTitle, - const char * icon, - int return_button = mbCancel, - const result_ default_result = mbrCancel); + CMsgBox(const char* Text, + const char* Title = NULL, + const char* Icon = NULL, + const char* Picon = NULL, + const int& Width = MSGBOX_MIN_WIDTH, + const int& Height = MSGBOX_MIN_HEIGHT, + const int& ShowButtons = mbCancel, + const msg_result_t& Default_result = mbrCancel, + const int& Text_mode = CMsgBox::CENTER | CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH | CTextBox::SCROLL); - /* Functions */ - bool paint(void); - bool hide(void); - int exec(int timeout,int returnDefaultOnTimeout = false); - void refresh(void); - void scrollPageDown(const int pages); - void scrollPageUp(const int pages); - int result(void); + CMsgBox(const char* Text, + const neutrino_locale_t locale_Title = NONEXISTANT_LOCALE, + const char* Icon = NULL, + const char* Picon = NULL, + const int& Width = MSGBOX_MIN_WIDTH, + const int& Height = MSGBOX_MIN_HEIGHT, + const int& ShowButtons = mbCancel, + const msg_result_t& Default_result = mbrCancel, + const int& Text_mode = CMsgBox::CENTER | CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH | CTextBox::SCROLL); - bool setText(const std::string* newText); +// ~CMsgBox(); //inherited + int exec(); + + ///returns current result as msg_result_t, result corresponds to the current result value of selected button + msg_result_t getResult(){return result;}; + ///returns current default result as msg_result_t, independently from current selected button result + msg_result_t getDefaultResult(){return default_result;}; + ///sets current default result as msg_result_t, independently from current selected button result + void setDefaultResult(const msg_result_t& Default_result){default_result = Default_result;} + + /*! + Sets the displayed buttons. + This member allows to set and overrides already defined buttons from constructor, + parameter ''ShowButtons'' accepts given types, find under button_define_t enumeration + mbYes + mbNo + mbCancel + mbBack + mbOk + mbOKCancel + mbYesNoCancel + mbYesNo + mbAll + */ + void setShowedButtons(const int& ShowButtons){mb_show_button = ShowButtons; initButtons();} + + ///define timeout, timeout is enabled if parmeter 1 > -1, otherwise it will be disabled, + void setTimeOut(const int& Timeout){timeout = Timeout;}; + ///enable/disable defined timeout, otherwise it will be ignored, parameter 1: bool default = true + void enableDefaultResultOnTimeOut(bool enable = true); + + /*! + Default defined button text is already predefiend with parameter 'ShowButtons' from constructor. + This member allows to define an alternate text for an already defined button, + 1st parameter ''showed button'' accepts + mbYes + mbNo + mbCancel + mbBack + mbOk + others will be ignored! + 2nd parameter sets the new text for button as std::string. + Result values are not touched! + */ + void setButtonText(const int& showed_button, const std::string& text); + +// bool setText(const std::string* newText); }; -extern int ShowMsg2UTF( const neutrino_locale_t Caption, +#define DEFAULT_TEXT_MODE (CMsgBox::CENTER | CMsgBox::AUTO_WIDTH | CMsgBox::AUTO_HIGH) + +int ShowMsg2UTF( const neutrino_locale_t Title, const char * const Text, - const CMsgBox::result_ Default, + const CMsgBox::msg_result_t Default, const uint32_t ShowButtons, const char * const Icon = NULL, - const int Width = 450, - const int timeout = -1, - bool returnDefaultOnTimeout = false); // UTF-8 + const int Width = MSGBOX_MIN_WIDTH, + const int Timeout = -1, + bool returnDefaultOnTimeout = false, + const int& Text_mode = DEFAULT_TEXT_MODE, + fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 -extern int ShowMsg2UTF( const char * const Title, +int ShowMsg2UTF( const char * const Title, const char * const Text, - const CMsgBox::result_ Default, + const CMsgBox::msg_result_t Default, const uint32_t ShowButtons, const char * const Icon = NULL, - const int Width = 450, - const int timeout = -1, - bool returnDefaultOnTimeout = false); // UTF-8 - + const int Width = MSGBOX_MIN_WIDTH, + const int Timeout = -1, + bool returnDefaultOnTimeout = false, + const int& Text_mode = DEFAULT_TEXT_MODE, + fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 +int ShowMsg( const neutrino_locale_t Title, + const char * const Text, + const CMsgBox::msg_result_t Default, + const uint32_t ShowButtons, + const char * const Icon = NULL, + const int Width = MSGBOX_MIN_WIDTH, + const int Timeout = -1, + bool returnDefaultOnTimeout = false, + const int& Text_mode = DEFAULT_TEXT_MODE, + fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 + +int ShowMsg( const char * const Title, + const char * const Text, + const CMsgBox::msg_result_t Default, + const uint32_t ShowButtons, + const char * const Icon = NULL, + const int Width = MSGBOX_MIN_WIDTH, + const int Timeout = -1, + bool returnDefaultOnTimeout = false, + const int& Text_mode = DEFAULT_TEXT_MODE, + fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 + +int ShowMsg( const neutrino_locale_t Title, + const std::string & Text, + const CMsgBox::msg_result_t Default, + const uint32_t ShowButtons, + const char * const Icon = NULL, + const int Width = MSGBOX_MIN_WIDTH, + const int Timeout = -1, + bool returnDefaultOnTimeout = false, + const int& Text_mode = DEFAULT_TEXT_MODE, + fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 + +int ShowMsg( const neutrino_locale_t Title, + const neutrino_locale_t Text, + const CMsgBox::msg_result_t Default, + const uint32_t ShowButtons, + const char * const Icon = NULL, + const int Width = MSGBOX_MIN_WIDTH, + const int Timeout = -1, + bool returnDefaultOnTimeout = false, + const int& Text_mode = DEFAULT_TEXT_MODE, + fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 + +int ShowMsg( const std::string & Title, + const std::string & Text, + const CMsgBox::msg_result_t Default, + const uint32_t ShowButtons, + const char * const Icon = NULL, + const int Width = MSGBOX_MIN_WIDTH, + const int Timeout = -1, + bool returnDefaultOnTimeout = false, + const int& Text_mode = DEFAULT_TEXT_MODE, + fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 + +void DisplayErrorMessage(const char * const ErrorMsg, const int& Text_mode = DEFAULT_TEXT_MODE); // UTF-8 +void DisplayErrorMessage(const char * const ErrorMsg, const neutrino_locale_t& caption, const int& Text_mode = DEFAULT_TEXT_MODE); // UTF-8 +void DisplayErrorMessage(const char * const ErrorMsg, const std::string& caption, const int& Text_mode = DEFAULT_TEXT_MODE); // UTF-8 +void DisplayInfoMessage(const char * const InfoMsg, const int& Text_mode = DEFAULT_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 +void DisplayInfoMessage(const char * const InfoMsg, const neutrino_locale_t& caption, const int& Text_mode = DEFAULT_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 +void DisplayInfoMessage(const char * const InfoMsg, const std::string& caption, const int& Text_mode = DEFAULT_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 #endif diff --git a/src/gui/widget/shellwindow.cpp b/src/gui/widget/shellwindow.cpp index a0602a68d..78fa6d23e 100644 --- a/src/gui/widget/shellwindow.cpp +++ b/src/gui/widget/shellwindow.cpp @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp index b47a99c4e..748683900 100644 --- a/src/gui/widget/stringinput.cpp +++ b/src/gui/widget/stringinput.cpp @@ -38,7 +38,7 @@ #include #include -#include +#include #include @@ -485,7 +485,7 @@ int CStringInput::exec( CMenuTarget* parent, const std::string & ) else if ( (msg==CRCInput::RC_home) || (msg==CRCInput::RC_timeout) ) { if ((*valueString != oldval) && - (ShowMsg(name, LOCALE_MESSAGEBOX_DISCARD, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbCancel) == CMessageBox::mbrCancel)) { + (ShowMsg(name, LOCALE_MESSAGEBOX_DISCARD, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbCancel) == CMsgBox::mbrCancel)) { timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]); continue; } diff --git a/src/gui/widget/stringinput_ext.cpp b/src/gui/widget/stringinput_ext.cpp index 4b4923e00..859fc9588 100644 --- a/src/gui/widget/stringinput_ext.cpp +++ b/src/gui/widget/stringinput_ext.cpp @@ -35,7 +35,7 @@ #include -#include +#include #include #include @@ -235,19 +235,19 @@ int CExtendedInput::exec( CMenuTarget* parent, const std::string & ) else if ( (msg==CRCInput::RC_home) || (msg==CRCInput::RC_timeout) ) { if(*valueString != oldval){ - int erg = ShowMsg(name, LOCALE_MESSAGEBOX_DISCARD, CMessageBox::mbrYes, CMessageBox::mbNo | CMessageBox::mbYes | CMessageBox::mbCancel); - if(erg==CMessageBox::mbrYes){ + int erg = ShowMsg(name, LOCALE_MESSAGEBOX_DISCARD, CMsgBox::mbrYes, CMsgBox::mbNo | CMsgBox::mbYes | CMsgBox::mbCancel); + if(erg==CMsgBox::mbrYes){ *valueString = oldval; loop=false; if(cancel != NULL) *cancel = true; } - else if(erg==CMessageBox::mbrNo){ + else if(erg==CMsgBox::mbrNo){ loop=false; if(cancel != NULL) *cancel = false; } - else if(erg==CMessageBox::mbrCancel){ + else if(erg==CMsgBox::mbrCancel){ timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]); } } else { diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 07187bda3..6ac3c30cf 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -98,7 +98,7 @@ #include "gui/widget/hintbox.h" #include "gui/widget/icons.h" #include "gui/widget/menue.h" -#include "gui/widget/messagebox.h" +#include "gui/widget/msgbox.h" #include "gui/infoclock.h" #include "gui/parentallock_setup.h" #ifdef ENABLE_PIP @@ -2314,7 +2314,7 @@ void CNeutrinoApp::RealRun() #endif g_PluginList->startPlugin("startup"); if (!g_PluginList->getScriptOutput().empty()) { - ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMessageBox::mbrBack,CMessageBox::mbBack,NEUTRINO_ICON_SHELL); + ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_SHELL); } g_RCInput->clearRCMsg(); @@ -3240,14 +3240,14 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) } else if( msg == NeutrinoMessages::ANNOUNCE_SLEEPTIMER) { if( mode != mode_scart && mode != mode_standby) - skipSleepTimer = (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_settings.shutdown_real ? LOCALE_SHUTDOWNTIMER_ANNOUNCE:LOCALE_SLEEPTIMERBOX_ANNOUNCE,CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, true) == CMessageBox::mbrYes); + skipSleepTimer = (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_settings.shutdown_real ? LOCALE_SHUTDOWNTIMER_ANNOUNCE:LOCALE_SLEEPTIMERBOX_ANNOUNCE,CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450, 30, true) == CMsgBox::mbrYes); return messages_return::handled; } else if( msg == NeutrinoMessages::SLEEPTIMER) { if(data) {//INACTIVITY SLEEPTIMER skipShutdownTimer = (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_settings.shutdown_real ? LOCALE_SHUTDOWNTIMER_ANNOUNCE:LOCALE_SLEEPTIMERBOX_ANNOUNCE, - CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, true) == CMessageBox::mbrYes);//FIXME + CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450, 30, true) == CMsgBox::mbrYes);//FIXME if(skipShutdownTimer) { printf("NeutrinoMessages::INACTIVITY SLEEPTIMER: skiping\n"); skipShutdownTimer = false; @@ -3301,7 +3301,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) } else if( msg == NeutrinoMessages::ANNOUNCE_SHUTDOWN) { if( mode != mode_scart ) - skipShutdownTimer = (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_SHUTDOWNTIMER_ANNOUNCE, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 5) == CMessageBox::mbrYes); + skipShutdownTimer = (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_SHUTDOWNTIMER_ANNOUNCE, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450, 5) == CMsgBox::mbrYes); } else if( msg == NeutrinoMessages::SHUTDOWN ) { if(!skipShutdownTimer) { @@ -3319,21 +3319,21 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) } else if (msg == NeutrinoMessages::EVT_POPUP || msg == NeutrinoMessages::EVT_EXTMSG) { if (mode != mode_scart && mode != mode_standby) { - std::string timeout="-1"; + int timeout = HINTBOX_DEFAULT_TIMEOUT; std::string text = (char*)data; std::string::size_type pos; pos = text.find("&timeout=", 0); if (pos != std::string::npos) { - timeout = text.substr( pos+9, text.length()+1 ); + std::string tmp = text.substr( pos+9, text.length()+1 ); text[pos] = '\0'; + timeout = atoi(tmp.c_str()); } if (msg == NeutrinoMessages::EVT_POPUP) - ShowHint(LOCALE_MESSAGEBOX_INFO, text.c_str(), 0, atoi(timeout.c_str())); + ShowHint(LOCALE_MESSAGEBOX_INFO, text.c_str(), 0, timeout); else if (msg == NeutrinoMessages::EVT_EXTMSG) - ShowMsg(LOCALE_MESSAGEBOX_INFO, text, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO, 0, atoi(timeout.c_str())); - + ShowMsg(LOCALE_MESSAGEBOX_INFO, text, CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO, 500, timeout); } delete[] (unsigned char*) data; return messages_return::handled; @@ -3354,7 +3354,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) text[pos] = '\n'; } if( mode != mode_scart ) - ShowMsg(LOCALE_TIMERLIST_TYPE_REMIND, text, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 + ShowMsg(LOCALE_TIMERLIST_TYPE_REMIND, text, CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 delete[] (unsigned char*) data; return messages_return::handled; } @@ -3426,7 +3426,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) else if (msg == NeutrinoMessages::EVT_START_PLUGIN) { g_PluginList->startPlugin((const char *)data); if (!g_PluginList->getScriptOutput().empty()) { - ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMessageBox::mbrBack,CMessageBox::mbBack,NEUTRINO_ICON_SHELL); + ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMsgBox::mbrBack,CMsgBox::mbBack,NEUTRINO_ICON_SHELL); } delete[] (unsigned char*) data; @@ -3440,7 +3440,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) } return messages_return::handled; // ShowHint(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_EXTRA_ZAPIT_SDT_CHANGED), -// CMessageBox::mbrBack,CMessageBox::mbBack, NEUTRINO_ICON_INFO); +// CMsgBox::mbrBack,CMsgBox::mbBack, NEUTRINO_ICON_INFO); } else if (msg == NeutrinoMessages::EVT_HDMI_CEC_VIEW_ON) { if(g_settings.hdmi_cec_view_on) @@ -3480,8 +3480,8 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) CRecordManager::getInstance()->StopAutoRecord(); if(CRecordManager::getInstance()->RecordingStatus() || cYTCache::getInstance()->isActive()) { do_shutdown = - (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_SHUTDOWN_RECORDING_QUERY, CMessageBox::mbrNo, - CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, true) == CMessageBox::mbrYes); + (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_SHUTDOWN_RECORDING_QUERY, CMsgBox::mbrNo, + CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450, 30, true) == CMsgBox::mbrYes); } if(do_shutdown) { @@ -3957,7 +3957,7 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) int returnval = menu_return::RETURN_REPAINT; if(actionKey == "help_recording") { - ShowMsg(LOCALE_SETTINGS_HELP, LOCALE_RECORDINGMENU_HELP, CMessageBox::mbrBack, CMessageBox::mbBack); + ShowMsg(LOCALE_SETTINGS_HELP, LOCALE_RECORDINGMENU_HELP, CMsgBox::mbrBack, CMsgBox::mbBack); } else if(actionKey=="shutdown") { ExitRun(true, 1); @@ -4051,8 +4051,8 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) if (recordingstatus) DisplayErrorMessage(g_Locale->getText(LOCALE_SERVICEMENU_RESTART_REFUSED_RECORDING)); else { - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SERVICEMENU_RESTART_HINT)); - hintBox->paint(); + CHint * hint = new CHint(LOCALE_SERVICEMENU_RESTART_HINT); + hint->paint(); saveSetup(NEUTRINO_SETTINGS_FILE); @@ -4063,7 +4063,7 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) delete g_fontRenderer; delete g_dynFontRenderer; - delete hintBox; + delete hint; stop_daemons(true); stop_video(); @@ -4104,7 +4104,7 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) parent->hide(); std::string text = "Easy menu switched " + string(g_settings.easymenu?"OFF":"ON") + string(", when restart box.\nRestart now?"); - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, text, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_INFO, 0) == CMessageBox::mbrYes) { + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, text, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_INFO, 0) == CMsgBox::mbrYes) { g_settings.easymenu = (g_settings.easymenu == 0) ? 1 : 0; INFO("change easymenu to %d\n", g_settings.easymenu); g_RCInput->postMsg(NeutrinoMessages::REBOOT, 0); diff --git a/src/neutrino_menue.h b/src/neutrino_menue.h index 809466545..a1e37f4d9 100644 --- a/src/neutrino_menue.h +++ b/src/neutrino_menue.h @@ -186,6 +186,7 @@ enum MN_WIDGET_ID MN_WIDGET_ID_TESTMENU, MN_WIDGET_ID_TESTMENU_HARDWARE, MN_WIDGET_ID_TESTMENU_COMPONENTS, + MN_WIDGET_ID_TESTMENU_HINT_MSG_TESTS, //network services MN_WIDGET_ID_NETWORKSETUP_SERVICES, diff --git a/src/system/locals.h b/src/system/locals.h index f66030446..a12ed3ced 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -807,6 +807,7 @@ typedef enum LOCALE_HDD_UMOUNT, LOCALE_HDD_UMOUNT_WARN, LOCALE_HDD_UMOUNTED, + LOCALE_HELP_BOX_TITLE, LOCALE_IMAGEINFO_API, LOCALE_IMAGEINFO_CREATOR, LOCALE_IMAGEINFO_DATE, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 2439efe55..85e4049a1 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -807,6 +807,7 @@ const char * locale_real_names[] = "hdd_umount", "hdd_umount_warn", "hdd_umounted", + "help_box_title", "imageinfo.api", "imageinfo.creator", "imageinfo.date", diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index b27faff65..08d3af362 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -59,7 +59,7 @@ #include // obsolete #include -#include +#include #include #include @@ -518,8 +518,8 @@ int CDataResetNotifier::exec(CMenuTarget* /*parent*/, const std::string& actionK /* no need to confirm if we only remove deleted channels */ if (!delete_removed) { - int result = ShowMsg(msg, g_Locale->getText(LOCALE_RESET_CONFIRM), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo); - if (result != CMessageBox::mbrYes) + int result = ShowMsg(msg, g_Locale->getText(LOCALE_RESET_CONFIRM), CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo); + if (result != CMsgBox::mbrYes) return true; } From 205838789f30f54746ef8076cb416b54e740a0d8 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 16 Apr 2016 20:01:44 +0200 Subject: [PATCH 002/171] CCDraw: try to fix possible data race Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fc2eb68edcbf1c64974adc01a578986d0eef025d Author: Thilo Graf Date: 2016-04-16 (Sat, 16 Apr 2016) --- src/gui/components/cc_draw.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index 92178deb6..ff23c8638 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -277,7 +277,12 @@ class CCDraw : public COSDFader, public CComponentsSignals ///allow/disalows paint of item and its contents, but initialize of other properties are not touched ///this can be understood as a counterpart to isPainted(), but before paint and value of is_painted is modified temporarily till next paint of item //TODO: is this sufficiently? - void allowPaint(bool allow){cc_allow_paint = allow; is_painted = cc_allow_paint ? false : true;} + void allowPaint(bool allow) { + if (allow != cc_allow_paint) + cc_allow_paint = allow; + if (cc_allow_paint) + is_painted = false; + } ///returns visibility mode virtual bool paintAllowed(){return cc_allow_paint;}; From 36d6eeea06546112f248dae8a3594f43a8f7f079 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 18 Aug 2016 10:27:33 +0200 Subject: [PATCH 003/171] CMsgBox: add option to enable/disable button background replaces var name btn_contour for better plausibility Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/be740c155234ec8031ffa89c99be08fb702feea0 Author: Thilo Graf Date: 2016-08-18 (Thu, 18 Aug 2016) --- src/gui/components/cc_frm_footer.cpp | 17 ++++++++--------- src/gui/components/cc_frm_footer.h | 10 ++++++---- src/gui/widget/msgbox.cpp | 7 ++++--- src/gui/widget/msgbox.h | 8 ++++++++ 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 5b6da399e..c0605f4a5 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -83,7 +83,7 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const corner_rad = RADIUS_LARGE; corner_type = CORNER_BOTTOM; - btn_contour = false /*g_settings.theme.Button_gradient*/; //TODO: not implemented at the moment + ccf_enable_button_bg = false /*g_settings.theme.Button_gradient*/; //TODO: not implemented at the moment ccf_btn_font = NULL; chain = NULL; @@ -141,13 +141,15 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont continue; } - CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn_min, (btn_contour ? height-2*fr_thickness : height), txt, icon_name); + CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn_min, (ccf_enable_button_bg ? height-2*fr_thickness : height), txt, icon_name); + btn->setButtonFont(ccf_btn_font); - btn->doPaintBg(btn_contour); + btn->doPaintBg(ccf_enable_button_bg); btn->setButtonDirectKey(content[i].directKey); btn->setButtonDirectKeyA(content[i].directKeyAlt); btn->setButtonResult(content[i].btn_result); btn->setButtonAlias(content[i].btn_alias); + btn->enableShadow(); //set button frames to icon color, predefined for available color buttons if (btn_auto_frame_col){ @@ -163,9 +165,6 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont btn->setColorFrame(f_col); } - if (btn_contour) - btn->setFrameThickness(3, 3); - chain->addCCItem(btn); //set x position of next button object @@ -296,12 +295,12 @@ void CComponentsFooter::setButtonLabel( const char *button_icon, setButtonLabel(button_icon, txt, chain_width, label_width, msg, result_value, alias_value, directKeyAlt); } -void CComponentsFooter::showButtonContour(bool show) +void CComponentsFooter::enableButtonBg(bool enable) { - btn_contour = show; + ccf_enable_button_bg = enable; if (chain) { for (size_t i= 0; i< chain->size(); i++) - chain->getCCItem(i)->doPaintBg(btn_contour); + chain->getCCItem(i)->doPaintBg(ccf_enable_button_bg); } } diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index 053a6d3da..aa0f2a19c 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -70,8 +70,8 @@ class CComponentsFooter : public CComponentsHeader fb_pixel_t color_body, fb_pixel_t color_shadow ); - ///show button frame and background, default false - bool btn_contour; + ///show button with background, default false + bool ccf_enable_button_bg; ///enable/disable button frame in icon color, predefined for red, green, yellow and blue, default disabled bool btn_auto_frame_col; @@ -126,8 +126,10 @@ class CComponentsFooter : public CComponentsHeader const int& alias_value = -1, const neutrino_msg_t& directKeyAlt = CRCInput::RC_nokey); - ///causes show/hide countour of button frame and background, parameter bool show, default= true - void showButtonContour(bool show = true); + ///enables background of buttons, parameter bool show, default= true + void enableButtonBg(bool enable = true); + ///disables background of buttons + void disableButtonBg(){enableButtonBg(false);} ///select a definied button, parameter1 as size_t void setSelectedButton(size_t item_id); diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 65a926475..2175b3d03 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -7,7 +7,7 @@ Günther@tuxbox.berlios.org Implementation of CComponent Window class. - Copyright (C) 2014-2015 Thilo Graf 'dbt' + Copyright (C) 2014-2016 Thilo Graf 'dbt' License: GPL @@ -87,6 +87,7 @@ void CMsgBox::init(const int& Height, const int& ShowButtons, const msg_result_t //enable footer and add its height showFooter(true); + btn_enable_bg = false; ccw_footer->doPaintBg(false); int h_current = height; h_current += ccw_footer->getHeight(); @@ -174,8 +175,8 @@ void CMsgBox::initButtons() ccw_footer->setButtonLabels(v_buttons, 0, 125); - //show buttons with frame and background - ccw_footer->showButtonContour(true); + //show buttons with background + ccw_footer->enableButtonBg(btn_enable_bg); //set position of meassage window and refresh window properties setCenterPos(); diff --git a/src/gui/widget/msgbox.h b/src/gui/widget/msgbox.h index 46c9fbd75..0cf3a8fc9 100644 --- a/src/gui/widget/msgbox.h +++ b/src/gui/widget/msgbox.h @@ -112,6 +112,9 @@ class CMsgBox : public CHintBox ///assigned button captions std::string BTN_TEXT(const int& showed_button); + ///enables/disable button background + bool btn_enable_bg; + void initButtons(); public: /* Constructor */ @@ -181,6 +184,11 @@ class CMsgBox : public CHintBox */ void setButtonText(const int& showed_button, const std::string& text); + ///enables background of buttons, parameter bool show, default= true + void enableButtonBg(bool enable = true); + ///disables background of buttons + void disableButtonBg(){enableButtonBg(false);} + // bool setText(const std::string* newText); }; From e58f8fafd5056cdb175e6bbd20c4275b02e40cd1 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 18 Aug 2016 11:20:45 +0200 Subject: [PATCH 004/171] shadow: paint shadow layer with multiple renderboxes Should help to paint a clean shadow frame Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/307b2763bda66d7bb1295a1ce5da23fad2a87ce0 Author: Thilo Graf Date: 2016-08-18 (Thu, 18 Aug 2016) Origin message was: ------------------ shadow: paint shadow layer with multiple renderboxes Should help to paint a clean shadow frame --- src/gui/components/cc_item.cpp | 53 ++++++++++++++++++++++++---------- src/gui/test_menu.cpp | 6 ++-- 2 files changed, 42 insertions(+), 17 deletions(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 2e2f10891..34656abd6 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -90,31 +90,54 @@ void CComponentsItem::paintInit(bool do_save_bg) bool sh_r = (shadow & CC_SHADOW_ON) || (shadow & CC_SHADOW_RIGHT); bool sh_b = (shadow & CC_SHADOW_ON) || (shadow & CC_SHADOW_BOTTOM); - //if item is bound on a parent form, we must use real x/y values and from parent form as reference + //if item is bound on a parent form,... int ix = x, iy = y; + fb_pixel_t col_shadow_clean = 0; if (cc_parent){ + //we must use real x/y values and from parent form as reference ix = cc_xr; iy = cc_yr; + //we must use color of parent body instead screen background + col_shadow_clean = cc_parent->getColorBody(); } - //handle shadow width - if (width <= sw || height <= sw){ //don't use shadow, if item dimensions too small - dprintf(DEBUG_NORMAL, "\033[33m[CComponentsItem]\t[%s - %d] shadow dimensions too small sw=%d, shadow is disabled set dimension to 0\033[0m\n",__func__, __LINE__, sw); - shadow = CC_SHADOW_OFF; - sw = 0; - } - int isw = sw*2; - int ixsr = ix + width - isw/2; - int iysb = iy + height - isw/2; +// //handle shadow width +// if (width <= sw || height <= sw){ //don't use shadow, if item dimensions too small +// dprintf(DEBUG_NORMAL, "\033[33m[CComponentsItem]\t[%s - %d] shadow dimensions too small sw=%d, shadow is disabled set dimension to 0\033[0m\n",__func__, __LINE__, sw); +// shadow = CC_SHADOW_OFF; +// sw = 0; +// } //init paint layers cc_fbdata_t fbdata[] = { - {true, CC_FBDATA_TYPE_BGSCREEN, ix, iy, width+isw/2, height+isw/2, 0, 0, 0, 0, NULL, NULL, NULL, false}, //buffered bg - {sh_r, CC_FBDATA_TYPE_SHADOW_BOX, ixsr, iy+isw/2, isw, height, col_shadow, corner_rad, corner_type & CORNER_RIGHT, 0, NULL, NULL, NULL, false}, //shadow right - {sh_b, CC_FBDATA_TYPE_SHADOW_BOX, ix+isw/2, iysb, width, isw, col_shadow, corner_rad, corner_type & CORNER_BOTTOM, 0, NULL, NULL, NULL, false}, //shadow bottom - {true, CC_FBDATA_TYPE_BOX, ix+th, iy+th, width-2*th, height-2*th, col_body, rad, corner_type, 0, NULL, NULL, NULL, false}, //body - {true, CC_FBDATA_TYPE_FRAME, ix, iy, width, height, col_frame_cur, corner_rad, corner_type, th, NULL, NULL, NULL, false} //frame + //buffered bg + {true, CC_FBDATA_TYPE_BGSCREEN, ix, iy, width+sw, height+sw, 0, 0, 0, 0, NULL, NULL, NULL, false}, + + //shadow bottom corner left + {sh_b, CC_FBDATA_TYPE_SHADOW_BOX, ix+sw, iy+height-corner_rad, corner_rad+sw, corner_rad+sw, col_shadow, corner_rad, CORNER_BOTTOM_LEFT, 0, NULL, NULL, NULL, false}, + //clean up + {sh_b, CC_FBDATA_TYPE_SHADOW_BOX, ix, iy+height-corner_rad-sw, corner_rad+2*sw, corner_rad+sw, col_shadow_clean, corner_rad, CORNER_BOTTOM_LEFT, 0, NULL, NULL, NULL, false}, + + //shadow bottom corner right + {sh_r, CC_FBDATA_TYPE_SHADOW_BOX, ix+width-corner_rad, iy+height-corner_rad, corner_rad+sw, corner_rad+sw, col_shadow, corner_rad, corner_type & CORNER_BOTTOM_RIGHT, 0, NULL, NULL, NULL, false}, + //clean up + {sh_r, CC_FBDATA_TYPE_SHADOW_BOX, ix+width-corner_rad-sw,iy+height-corner_rad-sw, corner_rad+sw, corner_rad+sw, col_shadow_clean, corner_rad, corner_type & CORNER_BOTTOM_RIGHT, 0, NULL, NULL, NULL, false}, + + //shadow top corner right + {sh_r, CC_FBDATA_TYPE_SHADOW_BOX, ix+width-corner_rad, iy+sw, corner_rad+sw, corner_rad+sw, col_shadow, corner_rad, corner_type & CORNER_TOP_RIGHT, 0, NULL, NULL, NULL, false}, + //clean up + {sh_r, CC_FBDATA_TYPE_SHADOW_BOX, ix+width-corner_rad-sw, iy, corner_rad+sw, corner_rad+2*sw, col_shadow_clean, corner_rad, corner_type & CORNER_TOP_RIGHT, 0, NULL, NULL, NULL, false}, + + //shadow bar bottom + {sh_b, CC_FBDATA_TYPE_SHADOW_BOX, ix+2*sw+corner_rad, iy+height, max(width-2*corner_rad-2*sw,0), sw, col_shadow, 0, CORNER_NONE, 0, NULL, NULL, NULL, false}, + //shadow bar right + {sh_r, CC_FBDATA_TYPE_SHADOW_BOX, ix+width, iy+2*sw+corner_rad, sw, max(height-2*corner_rad-2*sw,0), col_shadow, 0, CORNER_NONE, 0, NULL, NULL, NULL, false}, + + //body box + {true, CC_FBDATA_TYPE_BOX, ix+th, iy+th, width-2*th, height-2*th, col_body, rad, corner_type, 0, NULL, NULL, NULL, false}, + //body frame + {true, CC_FBDATA_TYPE_FRAME, ix, iy, width, height, col_frame_cur, corner_rad, corner_type, th, NULL, NULL, NULL, false} }; for(size_t i =0; i< (sizeof(fbdata) / sizeof(fbdata[0])) ;i++) { diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 332489810..30ce470e6 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -394,8 +394,10 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) return res; } else if (actionKey == "square"){ - if (sq == NULL) - sq = new CComponentsShapeSquare (100, 220, 100, 100, NULL, false); + if (sq == NULL){ + sq = new CComponentsShapeSquare (100, 220, 100, 100, NULL, CC_SHADOW_ON, COL_MENUCONTENT_PLUS_6, COL_MENUCONTENT_PLUS_0, COL_RED); + sq->setCorner(11); + } if (!sq->isPainted()) sq->paint(); From ffdd2a760c1e83e6b3fa64fe2d76e341eed210bd Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 19 Aug 2016 21:19:04 +0200 Subject: [PATCH 005/171] CTestMenu: shadow for circle TODO: not really nice at the moment Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1888189fb306d65543292d268779290add8be823 Author: Thilo Graf Date: 2016-08-19 (Fri, 19 Aug 2016) --- src/gui/test_menu.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 30ce470e6..6d2ad06df 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -369,8 +369,11 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) } #endif else if (actionKey == "button"){ - if (button == NULL) + if (button == NULL){ button = new CComponentsButtonRed(100, 100, 100, 50, "Test"); + button->enableShadow(); + } + if (!button->isPainted()){ if (button->isSelected()) @@ -385,7 +388,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) } else if (actionKey == "circle"){ if (circle == NULL) - circle = new CComponentsShapeCircle (100, 100, 100, NULL, false); + circle = new CComponentsShapeCircle (100, 100, 100, NULL, CC_SHADOW_ON, COL_MENUCONTENT_PLUS_6, COL_MENUCONTENT_PLUS_0, COL_RED); if (!circle->isPainted()) circle->paint(); From 8b1bc5fb655921f92de0582a253f2172bf2bd084 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 20 Aug 2016 20:42:40 +0200 Subject: [PATCH 006/171] CComponentsItem: fix changeing color on select switching of frames expand select mode methodes with paremters for frame properties This should make variables col_frame_sel and fr_thickness_sel superfluous. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3477e28cd7bdec17653ec8f9c53d7b2240d17295 Author: Thilo Graf Date: 2016-08-20 (Sat, 20 Aug 2016) --- src/gui/components/cc_draw.cpp | 17 +------------ src/gui/components/cc_draw.h | 9 ++----- src/gui/components/cc_frm_button.cpp | 2 +- src/gui/components/cc_frm_scrollbar.cpp | 2 +- src/gui/components/cc_item.cpp | 33 +++++++++++++++++-------- src/gui/components/cc_item.h | 10 ++++++-- src/gui/components/cc_types.h | 2 +- src/gui/widget/hintbox.h | 2 +- 8 files changed, 38 insertions(+), 39 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 1296e19d7..90c1f6a39 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -40,10 +40,8 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) col_body = col_body_old = COL_MENUCONTENT_PLUS_0; col_shadow = col_shadow_old = COL_SHADOW_PLUS_0; col_frame = col_frame_old = COL_FRAME_PLUS_0; - col_frame_sel = col_frame_sel_old = COL_MENUCONTENTSELECTED_PLUS_0; fr_thickness = fr_thickness_old = 0; - fr_thickness_sel = fr_thickness_sel_old = 3; corner_type = corner_type_old = CORNER_ALL; corner_rad = corner_rad_old = 0; @@ -116,11 +114,6 @@ inline bool CCDraw::applyDimChanges() fr_thickness_old = fr_thickness; ret = true; } - if (fr_thickness_sel != fr_thickness_sel_old){ - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], dim changes fr_thickness_sel %d != fr_thickness_sel_old %d...\033[0m\n", __func__, __LINE__, fr_thickness_sel, fr_thickness_sel_old); - fr_thickness_old = fr_thickness; - ret = true; - } if (shadow_w != shadow_w_old){ dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], dim changes shadow_w_sel %d != shadow_w_old %d...\033[0m\n", __func__, __LINE__, shadow_w, shadow_w_old); shadow_w_old = shadow_w; @@ -158,11 +151,6 @@ inline bool CCDraw::applyColChanges() col_frame_old = col_frame; ret = true; } - if (col_frame_sel != col_frame_sel_old){ - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], col changes col_frame_sel %d != col_frame_sel_old %d...\033[0m\n", __func__, __LINE__, col_frame_sel, col_frame_sel_old); - col_frame_old = col_frame; - ret = true; - } if (cc_body_gradient_enable != cc_body_gradient_enable_old){ dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], col changes cc_body_gradient_enable %d != cc_body_gradient_enable_old %d...\033[0m\n", __func__, __LINE__, cc_body_gradient_enable, cc_body_gradient_enable_old); cc_body_gradient_enable_old = cc_body_gradient_enable; @@ -218,13 +206,10 @@ inline void CCDraw::setWidth(const int& w) width = w; } -void CCDraw::setFrameThickness(const int& thickness, const int& thickness_sel) +void CCDraw::setFrameThickness(const int& thickness) { fr_thickness = thickness; - if (fr_thickness_sel != thickness_sel) - fr_thickness_sel = thickness_sel; - //ensure enabled frame if frame width > 0 cc_enable_frame = false; if (fr_thickness) diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index ff23c8638..3728db9a9 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -67,13 +67,9 @@ class CCDraw : public COSDFader, public CComponentsSignals fb_pixel_t col_shadow, col_shadow_old; ///property: color of frame fb_pixel_t col_frame, col_frame_old; - ///property: color of frame if component is selected, Note: fr_thickness_sel must be set - fb_pixel_t col_frame_sel, col_frame_sel_old; ///property: frame thickness, see also setFrameThickness() int fr_thickness, fr_thickness_old; - ///property: frame thickness of selected component, see also setFrameThickness() - int fr_thickness_sel, fr_thickness_sel_old; ///property: has corners with definied type, types are defined in /driver/frambuffer.h, without effect, if corner_radius=0 int corner_type, corner_type_old; @@ -210,13 +206,12 @@ class CCDraw : public COSDFader, public CComponentsSignals virtual void getDimensions(int* xpos, int* ypos, int* w, int* h){*xpos=x; *ypos=y; *w=width; *h=height;} ///set frame thickness - virtual void setFrameThickness(const int& thickness, const int& thickness_sel = 3); + virtual void setFrameThickness(const int& thickness); ///return of frame thickness virtual int getFrameThickness(){return fr_thickness;} ///set frame color virtual void setColorFrame(fb_pixel_t color){col_frame = color;} - ///set selected frame color - virtual void setColorFrameSel(fb_pixel_t color){col_frame_sel = color;} + virtual void set2ndColor(fb_pixel_t col_2nd){cc_body_gradient_2nd_col = col_2nd;} ///get frame color diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index 5986bf888..5f2b53b1e 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -188,7 +188,7 @@ void CComponentsButton::initCaption() } //set basic properties - int w_frame = max(fr_thickness, fr_thickness_sel); + int w_frame = fr_thickness; if (cc_btn_capt_obj){ //position and size int x_cap = w_frame; diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index 953892245..9b2aacf3e 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -140,7 +140,7 @@ void CComponentsScrollBar::initSegments() //init segment container if (sb_segments_obj == NULL){ sb_segments_obj = new CComponentsFrmChain(CC_CENTERED, CC_APPEND, w_seg, h_seg_obj, NULL, CC_DIR_Y, this, false); - sb_segments_obj->setFrameThickness(0,0); + sb_segments_obj->setFrameThickness(0/*,0*/); sb_segments_obj->setAppendOffset(0, 3); }else sb_segments_obj->setDimensionsAll(CC_CENTERED, CC_APPEND, w_seg, h_seg_obj); diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 34656abd6..6cebf6ebd 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -72,16 +72,11 @@ void CComponentsItem::paintInit(bool do_save_bg) is_painted = false; //force repaint if required } + //calculate current needed frame thickeness and color, if item selected or not + fb_pixel_t col_frame_cur = col_frame; + int th = fr_thickness; + if (v_fbdata.empty()){ - int th = fr_thickness; - fb_pixel_t col_frame_cur = col_frame; - - //calculate current needed frame thickeness and color, if item selected or not - if (cc_item_selected){ - col_frame_cur = col_frame_sel; - th = max(fr_thickness_sel, fr_thickness); - } - //calculate current needed corner radius for body box, depends of frame thickness int rad = (corner_rad>th) ? corner_rad-th : corner_rad; int sw = (shadow) ? shadow_w : 0; @@ -136,6 +131,7 @@ void CComponentsItem::paintInit(bool do_save_bg) //body box {true, CC_FBDATA_TYPE_BOX, ix+th, iy+th, width-2*th, height-2*th, col_body, rad, corner_type, 0, NULL, NULL, NULL, false}, + //body frame {true, CC_FBDATA_TYPE_FRAME, ix, iy, width, height, col_frame_cur, corner_rad, corner_type, th, NULL, NULL, NULL, false} }; @@ -145,9 +141,18 @@ void CComponentsItem::paintInit(bool do_save_bg) continue; v_fbdata.push_back(fbdata[i]); } - dprintf(DEBUG_DEBUG, "[CComponentsItem] %s:\ncc_item_type: %d\ncc_item_index = %d\nheight = %d\nwidth = %d\n", __func__, cc_item_type, cc_item_index, height, width); } + + //handle frame color for slected/not selected item + if (fr_thickness) { + for(size_t j =0; j< v_fbdata.size() ;j++) { + if ((v_fbdata[j].fbdata_type == CC_FBDATA_TYPE_FRAME)){ + v_fbdata[j].color = col_frame_cur; + v_fbdata[j].frame_thickness = th; + } + } + } paintFbItems(do_save_bg); } @@ -242,3 +247,11 @@ void CComponentsItem::setFocus(bool focus) } cc_has_focus = focus; } + +void CComponentsItem::setSelected(bool selected, const fb_pixel_t& sel_frame_col, const fb_pixel_t& frame_col, const fb_pixel_t& sel_body_col, const fb_pixel_t& body_col, const int& frame_w, const int& sel_frame_w) +{ + cc_item_selected = selected; + fr_thickness = cc_item_selected ? sel_frame_w : frame_w; + col_body = cc_item_selected ? sel_body_col : body_col; + col_frame = cc_item_selected ? sel_frame_col : frame_col; +} diff --git a/src/gui/components/cc_item.h b/src/gui/components/cc_item.h index 30fbf0442..dad19d96e 100644 --- a/src/gui/components/cc_item.h +++ b/src/gui/components/cc_item.h @@ -105,8 +105,14 @@ class CComponentsItem : public CComponents ///syncronizes item colors with current color settings if required, NOTE: overwrites internal values! virtual void syncSysColors(); - ///set select mode, see also col_frame_sel - virtual void setSelected(bool selected){cc_item_selected = selected;}; + ///set select mode + virtual void setSelected(bool selected, + const fb_pixel_t& sel_frame_col = COL_MENUCONTENTSELECTED_PLUS_0, + const fb_pixel_t& frame_col = COL_SHADOW_PLUS_0, + const fb_pixel_t& sel_body_col = COL_MENUCONTENT_PLUS_0, + const fb_pixel_t& body_col = COL_MENUCONTENT_PLUS_0, + const int& frame_w = 3, + const int& sel_frame_w = 3); ///set enable mode, see also cc_item_enabled virtual void setEnable(bool enabled){cc_item_enabled = enabled;}; diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index 6a3490a6a..4a6628ba9 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -30,7 +30,7 @@ #include #include #include - +#include class CComponentsForm; class CComponentsScrollBar; diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index a071824ae..eaf743cb9 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -39,7 +39,7 @@ //frame around hint container as indent #define W_FRAME 15 //frame color around hint/message box -#define HINTBOX_DEFAULT_FRAME_COLOR COL_MENUCONTENT_PLUS_6 +#define HINTBOX_DEFAULT_FRAME_COLOR COL_FRAME //! Sub class of CComponentsWindow. Shows a window as a hintbox with text and optional icon beside of text. /*! From a6f28430c5b83d87ea1848e327146f2bb5e02c06 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 21 Aug 2016 16:12:19 +0200 Subject: [PATCH 007/171] CComponentsFooter: reduced button height for better optical view into footer Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/779c51bd008d4a4c2a0155b22373ff70eaa14b5d Author: Thilo Graf Date: 2016-08-21 (Sun, 21 Aug 2016) --- src/gui/components/cc_frm_footer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index c0605f4a5..b72afbc74 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -141,7 +141,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont continue; } - CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn_min, (ccf_enable_button_bg ? height-2*fr_thickness : height), txt, icon_name); + CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn_min, (ccf_enable_button_bg ? height-2*fr_thickness : height)- 2*shadow_w, txt, icon_name, NULL, false, true, CC_SHADOW_ON); btn->setButtonFont(ccf_btn_font); btn->doPaintBg(ccf_enable_button_bg); @@ -149,7 +149,6 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont btn->setButtonDirectKeyA(content[i].directKeyAlt); btn->setButtonResult(content[i].btn_result); btn->setButtonAlias(content[i].btn_alias); - btn->enableShadow(); //set button frames to icon color, predefined for available color buttons if (btn_auto_frame_col){ From dba17b359c7f1717834f47dc52ff4915a0798a93 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 21 Aug 2016 18:32:14 +0200 Subject: [PATCH 008/171] CComponentsFooter: add member enableButtonShadow() Possibility to pass button properties into button objects Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/363cf101d127c2b1d399e290e11e5630153733e6 Author: Thilo Graf Date: 2016-08-21 (Sun, 21 Aug 2016) --- src/gui/components/cc_frm_footer.cpp | 13 ++++++++++++- src/gui/components/cc_frm_footer.h | 9 ++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index b72afbc74..5c2f5878d 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -72,6 +72,7 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const height = max(h, cch_font->getHeight()); shadow = shadow_mode; + ccf_enable_button_shadow = false; col_frame = color_frame; col_body = color_body; col_shadow = color_shadow; @@ -141,7 +142,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont continue; } - CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn_min, (ccf_enable_button_bg ? height-2*fr_thickness : height)- 2*shadow_w, txt, icon_name, NULL, false, true, CC_SHADOW_ON); + CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn_min, (ccf_enable_button_bg ? height-2*fr_thickness : height)- 2*shadow_w, txt, icon_name, NULL, false, true, ccf_enable_button_shadow); btn->setButtonFont(ccf_btn_font); btn->doPaintBg(ccf_enable_button_bg); @@ -354,3 +355,13 @@ void CComponentsFooter::setButtonText(const uint& btn_id, const std::string& tex else dprintf(DEBUG_NORMAL, "[CComponentsForm] [%s - %d] Error: can't set button text, possible wrong btn_id=%u, item=%p...\n", __func__, __LINE__, btn_id, item); } + + +void CComponentsFooter::enableButtonShadow(int mode, const int& shadow_width, bool force_paint) +{ + ccf_enable_button_shadow = mode; + if (chain){ + for(size_t i=0; isize(); i++) + chain->enableShadow(mode, shadow_width, force_paint); + } +} diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index aa0f2a19c..863ca7cea 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -72,6 +72,8 @@ class CComponentsFooter : public CComponentsHeader ///show button with background, default false bool ccf_enable_button_bg; + ///enable button with shadow, default false + bool ccf_enable_button_shadow; ///enable/disable button frame in icon color, predefined for red, green, yellow and blue, default disabled bool btn_auto_frame_col; @@ -178,7 +180,12 @@ class CComponentsFooter : public CComponentsHeader CC_FOOTER_SIZE_SMALL = 1 }; ///set size of footer, possible values are CC_FOOTER_SIZE_LARGE, CC_FOOTER_SIZE_SMALL - virtual void setSizeMode(const int& size_mode){cch_size_mode = size_mode; initCCItems();}; + virtual void setSizeMode(const int& size_mode){cch_size_mode = size_mode; initCCItems();} + + ///enable and sets shadow properties for embedded buttons + void enableButtonShadow(int mode = CC_SHADOW_ON, const int& shadow_width = RADIUS_SMALL, bool force_paint = false); + ///disable shadow for embedded buttons + void disbaleButtonShadow(){enableButtonShadow(CC_SHADOW_OFF);} }; #endif From a54434519f402fbc8812ac0abc7598dfcb98982f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 27 Aug 2016 12:23:26 +0200 Subject: [PATCH 009/171] cc_types.h: add compatible types shadow types CC_SHADOW_ON is should compatible Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/147246cead516c67901cad7948487a2438a5a57c Author: Thilo Graf Date: 2016-08-27 (Sat, 27 Aug 2016) --- src/gui/components/cc_types.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index 4a6628ba9..5fc909f0e 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -186,10 +186,13 @@ typedef struct cc_string_ext_txt_t #define CC_WIDTH_MIN 16 #define CC_HEIGHT_MIN 16 -#define CC_SHADOW_OFF 0 -#define CC_SHADOW_ON 1 -#define CC_SHADOW_RIGHT 2 -#define CC_SHADOW_BOTTOM 4 +#define CC_SHADOW_OFF 0x0 +#define CC_SHADOW_RIGHT 0x2 +#define CC_SHADOW_BOTTOM 0x4 +#define CC_SHADOW_CORNER_BOTTOM_LEFT 0x8 +#define CC_SHADOW_CORNER_BOTTOM_RIGHT 0x10 +#define CC_SHADOW_CORNER_TOP_RIGHT 0x20 +#define CC_SHADOW_ON CC_SHADOW_RIGHT | CC_SHADOW_BOTTOM | CC_SHADOW_CORNER_BOTTOM_LEFT | CC_SHADOW_CORNER_BOTTOM_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT #define CC_SAVE_SCREEN_YES true #define CC_SAVE_SCREEN_NO false From c759d6ddfb940e29de06c0f74545c902e6f1c8db Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 27 Aug 2016 12:29:32 +0200 Subject: [PATCH 010/171] CComponetnsItem: try to assign shadow areas TODO: possible crashes on some constellations Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/929b5da892bb98b8f466077c426a93556545a04a Author: Thilo Graf Date: 2016-08-27 (Sat, 27 Aug 2016) --- src/gui/components/cc_item.cpp | 100 +++++++++++++++++++++++++-------- 1 file changed, 77 insertions(+), 23 deletions(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 6cebf6ebd..076f743ab 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -78,12 +78,11 @@ void CComponentsItem::paintInit(bool do_save_bg) if (v_fbdata.empty()){ //calculate current needed corner radius for body box, depends of frame thickness - int rad = (corner_rad>th) ? corner_rad-th : corner_rad; - int sw = (shadow) ? shadow_w : 0; + int rad = (th) ? corner_rad-th : corner_rad; + //and ensure max radius < dimensions + rad = min(min(rad, corner_rad), min(width, height)); - //evaluate shadow mode - bool sh_r = (shadow & CC_SHADOW_ON) || (shadow & CC_SHADOW_RIGHT); - bool sh_b = (shadow & CC_SHADOW_ON) || (shadow & CC_SHADOW_BOTTOM); + int sw = (shadow) ? shadow_w : 0; //if item is bound on a parent form,... int ix = x, iy = y; @@ -103,37 +102,92 @@ void CComponentsItem::paintInit(bool do_save_bg) // sw = 0; // } + //evaluate shadow layer parts + //handle shadow corner dimensions + int sh_cdx = rad+sw, sh_cdy = rad+sw; + + //handle shadow positions + //...corner bottom right + int sh_cbr_x = ix+width-sh_cdx+sw; + int sh_cbr_y = iy+height-sh_cdy+sw; + + //...corner top right + int sh_ctr_x = sh_cbr_x; + int sh_ctr_y = iy+sw; + + //...corner bottom left + int sh_cbl_x = ix+sw; + int sh_cbl_y = sh_cbr_y; + + //...bar bottom + int sh_bx = sh_cbl_x+sh_cdx; + int sh_by = iy+height; + int sh_bdx = width-sh_cdx-sh_cdx; + + //...bar right + int sh_rx = ix+width; + int sh_ry = sh_ctr_y+sh_cdy; + int sh_rdy = height-sh_cdy-sh_cdy; + + //corners + bool sh_ctr = (shadow & CC_SHADOW_CORNER_TOP_RIGHT); + bool sh_cbr = (shadow & CC_SHADOW_CORNER_BOTTOM_RIGHT); + bool sh_cbl = (shadow & CC_SHADOW_CORNER_BOTTOM_LEFT); + + //...bars + bool sh_br = (shadow & CC_SHADOW_RIGHT); + printf("<<<<<<<<<< Date: Sat, 27 Aug 2016 12:42:15 +0200 Subject: [PATCH 011/171] CTestMenu: adopt for last changes Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b233c06af3ba18e15d763e38a49f16cf05e5117d Author: Thilo Graf Date: 2016-08-27 (Sat, 27 Aug 2016) --- src/gui/test_menu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 6d2ad06df..03130bc26 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -398,8 +398,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) } else if (actionKey == "square"){ if (sq == NULL){ - sq = new CComponentsShapeSquare (100, 220, 100, 100, NULL, CC_SHADOW_ON, COL_MENUCONTENT_PLUS_6, COL_MENUCONTENT_PLUS_0, COL_RED); - sq->setCorner(11); + sq = new CComponentsShapeSquare (100, 220, 100, 100, NULL, CC_SHADOW_ON, COL_MENUCONTENT_PLUS_6, COL_LIGHT_GRAY, COL_RED); + sq->setCorner(11, CORNER_BOTTOM_LEFT); } if (!sq->isPainted()) From 430086567952dc85e27d5000e62e194aa0de95af Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 30 Aug 2016 11:51:53 +0200 Subject: [PATCH 012/171] Shadow: try to optimize shadow areas * cleanup inner part of box on round corners, frames considered * adopt implementations in some gui classes * some debug lines removed * test menu adopted * try to fix corner caluculation to avoid transparent holes Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a17d61de8c772a4524c84a2ce35f550870527520 Author: Thilo Graf Date: 2016-08-30 (Tue, 30 Aug 2016) --- src/gui/components/cc_item.cpp | 133 ++++++++++++++++----------------- src/gui/infoviewer.cpp | 4 +- src/gui/test_menu.cpp | 4 +- src/gui/upnpbrowser.cpp | 2 +- src/gui/widget/menue.cpp | 2 +- 5 files changed, 72 insertions(+), 73 deletions(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 076f743ab..7e10a52a0 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -74,120 +74,120 @@ void CComponentsItem::paintInit(bool do_save_bg) //calculate current needed frame thickeness and color, if item selected or not fb_pixel_t col_frame_cur = col_frame; - int th = fr_thickness; + int th = cc_enable_frame ? fr_thickness : 0; if (v_fbdata.empty()){ - //calculate current needed corner radius for body box, depends of frame thickness - int rad = (th) ? corner_rad-th : corner_rad; - //and ensure max radius < dimensions - rad = min(min(rad, corner_rad), min(width, height)); + //set current position and dimensions + int ix = x, iy = y, dx = width, dy = height; + + //and ensure sw is not larger than body dimensions, max x% + int sw = (shadow) ? min(shadow_w, min(dx, dy)*50/100) : 0; - int sw = (shadow) ? shadow_w : 0; + //set current needed corner main box radius + int box_rad = corner_rad; + + //and ensure max main box radius < dimensions + if (2*box_rad > dy) + box_rad -= max(0, 2*box_rad-dy); + if (2*box_rad > dx) + box_rad -= max(0, 2*box_rad-dy); + + //Workaround: ensure radius values >= 0, framebuffer methode paintBoxRel() gets confused + box_rad = max(box_rad-th, 0); - //if item is bound on a parent form,... - int ix = x, iy = y; fb_pixel_t col_shadow_clean = 0; + //if item is bound on a parent form,... if (cc_parent){ - //we must use real x/y values and from parent form as reference + //...we must use real x/y values and from parent form as reference ix = cc_xr; iy = cc_yr; - //we must use color of parent body instead screen background + //...we must use color of parent body instead screen background col_shadow_clean = cc_parent->getColorBody(); } -// //handle shadow width -// if (width <= sw || height <= sw){ //don't use shadow, if item dimensions too small -// dprintf(DEBUG_NORMAL, "\033[33m[CComponentsItem]\t[%s - %d] shadow dimensions too small sw=%d, shadow is disabled set dimension to 0\033[0m\n",__func__, __LINE__, sw); -// shadow = CC_SHADOW_OFF; -// sw = 0; -// } + ///evaluate shadow layer parts + //handle general shadow corner dimensions + int sh_cdx = box_rad+sw+th; //width + int sh_cdy = box_rad+sw+th; //height + + //adapt shadow corner dimensions if body dimensions are too small, use an offset if required + int sh_cdx_size_offset, sh_cdy_size_offset = 0; + if (sh_cdy*2 > dy) + sh_cdy_size_offset = sh_cdy*2-dy; + if (sh_cdx*2 > dx) + sh_cdx_size_offset = sh_cdx*2-dx; - //evaluate shadow layer parts - //handle shadow corner dimensions - int sh_cdx = rad+sw, sh_cdy = rad+sw; - //handle shadow positions //...corner bottom right - int sh_cbr_x = ix+width-sh_cdx+sw; - int sh_cbr_y = iy+height-sh_cdy+sw; - + int sh_cbr_x = ix+dx-sh_cdx+sw; + int sh_cbr_y = iy+dy-sh_cdy+sw; + //...corner top right int sh_ctr_x = sh_cbr_x; int sh_ctr_y = iy+sw; - + //...corner bottom left int sh_cbl_x = ix+sw; int sh_cbl_y = sh_cbr_y; - + + //handle general shadow bar dimensions + int sh_bdx = dx-sh_cdx-sh_cdx; + int sh_rdy = dy-sh_cdy-sh_cdy; + //...bar bottom int sh_bx = sh_cbl_x+sh_cdx; - int sh_by = iy+height; - int sh_bdx = width-sh_cdx-sh_cdx; - + int sh_by = iy+dy; + //...bar right - int sh_rx = ix+width; + int sh_rx = ix+dx; int sh_ry = sh_ctr_y+sh_cdy; - int sh_rdy = height-sh_cdy-sh_cdy; - + //corners bool sh_ctr = (shadow & CC_SHADOW_CORNER_TOP_RIGHT); bool sh_cbr = (shadow & CC_SHADOW_CORNER_BOTTOM_RIGHT); bool sh_cbl = (shadow & CC_SHADOW_CORNER_BOTTOM_LEFT); - //...bars + //...shadow bar right bool sh_br = (shadow & CC_SHADOW_RIGHT); - printf("<<<<<<<<<<setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT); }else header->setDimensionsAll(head_x, ChanNameY, head_w, time_height); @@ -470,7 +470,7 @@ void CInfoViewer::paintBody() //set corner and shadow modes, consider virtual zap mode body->setCorner(RADIUS_LARGE, (zap_mode) ? CORNER_BOTTOM : CORNER_NONE); - body->enableShadow(zap_mode ? CC_SHADOW_ON : CC_SHADOW_RIGHT); + body->enableShadow(zap_mode ? CC_SHADOW_ON : CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT); body->setColorBody(g_settings.theme.infobar_gradient_body ? COL_MENUHEAD_PLUS_0 : COL_INFOBAR_PLUS_0); body->enableColBodyGradient(g_settings.theme.infobar_gradient_body, COL_INFOBAR_PLUS_0, g_settings.theme.infobar_gradient_body_direction); diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 03130bc26..9d9b84fd7 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -398,8 +398,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) } else if (actionKey == "square"){ if (sq == NULL){ - sq = new CComponentsShapeSquare (100, 220, 100, 100, NULL, CC_SHADOW_ON, COL_MENUCONTENT_PLUS_6, COL_LIGHT_GRAY, COL_RED); - sq->setCorner(11, CORNER_BOTTOM_LEFT); + sq = new CComponentsShapeSquare (0, 0, 100, 100, NULL, CC_SHADOW_ON, COL_OLIVE, COL_LIGHT_GRAY, COL_RED); + sq->enableFrame(true,1); } if (!sq->isPainted()) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index f6c34630a..3d80069a1 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -989,7 +989,7 @@ void CUpnpBrowserGui::paintDevices() // Head CComponentsHeaderLocalized header(m_x, m_header_y, m_width, m_header_height, LOCALE_UPNPBROWSER_HEAD, NEUTRINO_ICON_UPNP); - header.enableShadow(CC_SHADOW_RIGHT, -1, true); + header.enableShadow( CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); if (CNeutrinoApp::getInstance()->isMuted()) //TODO: consider mute mode on runtime header.addContextButton(NEUTRINO_ICON_BUTTON_MUTE_SMALL); else diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 32533c863..ffb9c478e 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1240,7 +1240,7 @@ void CMenuWidget::paint() // paint head if (header == NULL){ header = new CComponentsHeader(x, y, width + sb_width, hheight, getName(), iconfile); - header->enableShadow(CC_SHADOW_RIGHT); + header->enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT); header->setOffset(10); } header->setColorAll(COL_FRAME_PLUS_0, COL_MENUHEAD_PLUS_0, COL_SHADOW_PLUS_0); From 2e7deeb88bd2f019dbc7d840e00e71c83e1ed25b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 12 Sep 2016 08:28:08 +0200 Subject: [PATCH 013/171] CComponentsItem: remove frame witdth from boxrad calculation This fix possible artefacts on the bottom right corner with frame Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b6185ea78decf04cffcae8d82e2727620bb61f3c Author: Thilo Graf Date: 2016-09-12 (Mon, 12 Sep 2016) --- src/gui/components/cc_item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 7e10a52a0..b3b0ea4b7 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -93,7 +93,7 @@ void CComponentsItem::paintInit(bool do_save_bg) box_rad -= max(0, 2*box_rad-dy); //Workaround: ensure radius values >= 0, framebuffer methode paintBoxRel() gets confused - box_rad = max(box_rad-th, 0); + box_rad = max(box_rad, 0); fb_pixel_t col_shadow_clean = 0; //if item is bound on a parent form,... From 164f91798d1a276a9e4e58c60a043ece02601435 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 14 Sep 2016 10:30:44 +0200 Subject: [PATCH 014/171] CComponentsItem: unused vars commented out Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/eb78743e4a01b3b0bd0a0b044e43a87a5a7ebcd2 Author: Thilo Graf Date: 2016-09-14 (Wed, 14 Sep 2016) --- src/gui/components/cc_item.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index b3b0ea4b7..cfb4a1f81 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -111,12 +111,13 @@ void CComponentsItem::paintInit(bool do_save_bg) int sh_cdy = box_rad+sw+th; //height //adapt shadow corner dimensions if body dimensions are too small, use an offset if required - int sh_cdx_size_offset, sh_cdy_size_offset = 0; + int /*sh_cdx_size_offset,*/ sh_cdy_size_offset = 0; if (sh_cdy*2 > dy) sh_cdy_size_offset = sh_cdy*2-dy; +#if 0 if (sh_cdx*2 > dx) sh_cdx_size_offset = sh_cdx*2-dx; - +#endif //handle shadow positions //...corner bottom right int sh_cbr_x = ix+dx-sh_cdx+sw; From 7179f3d3f03b8c2e2490913102a7e4672264f5b6 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 24 Sep 2016 00:52:59 +0200 Subject: [PATCH 015/171] Try to rework footer * try to fix enableButtonShadow(), seems an init is missing * shadow fixed Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2e631fd0ce2e41251cb1ae84a0b275f26bfd95b2 Author: Thilo Graf Date: 2016-09-24 (Sat, 24 Sep 2016) --- src/gui/components/cc_frm_button.cpp | 28 ++++- src/gui/components/cc_frm_button.h | 6 + src/gui/components/cc_frm_footer.cpp | 151 ++++++++++++++++--------- src/gui/components/cc_frm_footer.h | 10 +- src/gui/components/cc_frm_header.h | 4 +- src/gui/components/cc_item_picture.cpp | 10 +- src/gui/components/cc_item_picture.h | 12 +- src/gui/test_menu.cpp | 7 +- src/gui/widget/msgbox.cpp | 5 +- 9 files changed, 152 insertions(+), 81 deletions(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index 5f2b53b1e..f611d65a4 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -101,7 +101,7 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const width = w; height = h; shadow = shadow_mode; - shadow_w = shadow ? OFFSET_SHADOW/2 : 0; //buttons are mostly small elements, so these elements should have a reasonable shadow width + shadow_w = shadow != CC_SHADOW_OFF ? OFFSET_SHADOW/2 : 0; //buttons are mostly small elements, so these elements should have a reasonable shadow width cc_body_gradient_enable = CC_COLGRAD_OFF/*g_settings.gradiant*/; //TODO: gradient is prepared for use but disabled at the moment till some other parts of gui parts are provide gradient setColBodyGradient(cc_body_gradient_enable/*CColorGradient::gradientLight2Dark*/, CFrameBuffer::gradientVertical, CColorGradient::light); @@ -195,24 +195,34 @@ void CComponentsButton::initCaption() x_cap += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() : 0; int w_cap = width - w_frame - append_x_offset - x_cap - w_frame; - int h_cap = height*65/100 /*- 2*fr_thickness*/; - + int h_cap = (height*75/100) - 2*w_frame; /*NOTE: paint of centered text in y direction without y_offset looks unlovely displaced in y direction especially besides small icons and inside small areas, but text render isn't wrong here, because capitalized chars or long chars like e. 'q', 'y' are considered! Therefore we here need other icons or a hack, that considers some different height values. */ - int y_cap = height/2 - h_cap/2 + w_frame/2; + int y_cap = height/2 - h_cap/2; cc_btn_capt_obj->setDimensionsAll(x_cap, y_cap, w_cap, h_cap); //text and font - if (cc_btn_font == NULL) - cc_btn_font = *cc_btn_dy_font->getDynFont(w_cap, h_cap, cc_btn_capt); + Font* def_font = *cc_btn_dy_font->getDynFont(w_cap, h_cap, cc_btn_capt); + if (cc_btn_font == NULL){ + /* use dynamic font as default font if no font defined */ + cc_btn_font = def_font; + }else{ + /* if button dimension too small, use dynamic font as default font size, this ignores possible defined font + * Otherwise definied font will be used. + */ + if (cc_btn_font->getHeight() > h_cap){ + cc_btn_font = def_font; + } + } cc_btn_capt_obj->setText(cc_btn_capt, CTextBox::NO_AUTO_LINEBREAK, cc_btn_font); cc_btn_capt_obj->forceTextPaint(); //here required; + cc_btn_capt_obj->getCTextBoxObject()->setTextBorderWidth(0,0); //set color cc_btn_capt_obj->setTextColor(this->cc_item_enabled ? cc_btn_capt_col : cc_btn_capt_disable_col); @@ -280,3 +290,9 @@ void CComponentsButton::paint(bool do_save_bg) //paint form contents paintForm(do_save_bg); } + +void CComponentsButton::enableShadow(int mode, const int& shadow_width, bool force_paint) +{ + clear(); + initVarButton(x, y, width, height, cc_btn_capt, cc_btn_icon, cc_parent, cc_item_selected, cc_item_enabled, mode, col_frame, col_body, col_shadow); +} diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index 80653e2be..1235dd0b9 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -195,6 +195,12 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen inline virtual void setButtonAlias(const int& alias_value){cc_btn_alias = alias_value;}; ///returns an alias value from button object, see also cc_btn_alias inline virtual int getButtonAlias(){return cc_btn_alias;}; + + /**1st parameter requires defines CC_SHADOW_ON (default), CC_SHADOW_OFF, CC_SHADOW_BOTTOM or CC_SHADOW_RIGHT, see also cc_types.h + * 2nd parameter defines shadow width, default = defined by system + * 3rd parameter forces paint of shadow layer, default = false, Note: default shadow will paint only on first paint, use 3rd parameter=true ignores this + */ + void enableShadow(int mode = CC_SHADOW_ON, const int& shadow_width = -1, bool force_paint = false); }; //! Sub class of CComponentsButton. diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 5c2f5878d..2e742c663 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -69,10 +69,13 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const width = w == 0 ? frameBuffer->getScreenWidth(true) : w; //init footer height + initCaptionFont(); height = max(h, cch_font->getHeight()); shadow = shadow_mode; - ccf_enable_button_shadow = false; + ccf_enable_button_shadow = false ; + ccf_button_shadow_width = 0; + ccf_button_shadow_force_paint = false; col_frame = color_frame; col_body = color_body; col_shadow = color_shadow; @@ -85,7 +88,7 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const corner_type = CORNER_BOTTOM; ccf_enable_button_bg = false /*g_settings.theme.Button_gradient*/; //TODO: not implemented at the moment - ccf_btn_font = NULL; + ccf_btn_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]; chain = NULL; addContextButton(buttons); @@ -95,46 +98,79 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const void CComponentsFooter::setButtonLabels(const struct button_label_s * const content, const size_t& label_count, const int& chain_width, const int& label_width) { - //define required total width of button group, minimal width is >0, sensless values are nonsens! - int w_chain = chain_width > 0 ? chain_width : width;//TODO: alow and handle only with rational values >0, exit here - if (w_chain < 100){ - dprintf(DEBUG_NORMAL, "[CComponentsFooter] [%s - %d] stupid width of chain: width = %d, values < 100 are nonsens, buttons not painted!\n", __func__, __LINE__, w_chain); - return; + /* clean up before init*/ + if (chain) + chain->clear(); + + /* set general available full basic space for button chain, + * in this case this is footer width + */ + int w_chain = width - 2*cch_offset; + + /* calculate current available space for button container depends + * of already enbedded footer objects. + * If already existing some items then subtract those width from footer width. + * ...so we have the possible usable size for button container. + */ + if(!v_cc_items.empty()){ //FIXME: footer container seems always not empty here, so here j initialized with = 1. I dont't know where it comes from! dbt! + for (size_t j= 1; j< size(); j++) + w_chain -= getCCItem(j)->getWidth(); } - //consider context button group on the right side of footer, if exist then subtract result from chain_width of button container - if (cch_btn_obj) - w_chain -= cch_btn_obj->getWidth(); + /* On defined parameter chain_width + * calculate current available space for button container depends + * of passed chain with parameter + * Consider that chain_width is not too large. + */ + if (chain_width > 0 && chain_width <= w_chain){ + if (chain_width <= w_chain){ + w_chain = chain_width; + } + } - //calculate required position of button container - //consider icon (inherited) width, if exist then set evaluated result as x position for button label container and ... - int x_chain = 0; + /* initialize button container (chain object): this contains all passed (as interleaved) button label items, + * With this container we can work inside footer as primary container (in this context '=this') and the parent for the button label container (chain object). + * Button label container (chain object) itself is concurrent to the parent object for button objects. + */ + int x_chain = width/2 - w_chain/2; if (cch_icon_obj) - x_chain = (cch_icon_obj->getXPos() + cch_offset + cch_icon_obj->getWidth()); - //... reduce also total width for button label container - w_chain -= x_chain; - - //initialize container (chain object) as button label container: this contains all passed (as interleaved) button label items, with this container we can work inside - //footer as primary container (in this context '=this') and the parent for the button label container (chain object), - //button label container (chain object) itself is concurrent the parent object for button objects. + x_chain = cch_offset+cch_icon_obj->getWidth()+cch_offset; if (chain == NULL){ - chain = new CComponentsFrmChain(x_chain, CC_CENTERED, w_chain, height, 0, CC_DIR_X, this, CC_SHADOW_OFF, COL_FRAME_PLUS_0, col_body); + chain = new CComponentsFrmChain(x_chain, 0, w_chain, height, 0, CC_DIR_X, this, CC_SHADOW_OFF, COL_MENUCONTENT_PLUS_6, col_body); + chain->setAppendOffset(0, 0); chain->setCorner(this->corner_rad, this->corner_type); chain->doPaintBg(false); } - if (!chain->empty()) - chain->clear(); - //calculate default static width of button labels inside button object container related to available width of chain object - int w_btn_fix = chain->getWidth() / label_count; - int w_btn_min = min(label_width, w_btn_fix); + /* Calculate usable width of button labels inside button object container + * related to available width of chain object and passed + * label_width parameter. + * Parameter is used as minimal value and will be reduced + * if it is too large. + * Too small label_width parameter will be compensated by + * button objects itself. + */ + int w_offset = int((label_count-1)*cch_offset); + int w_btn = chain->getWidth()/label_count - w_offset; + if (label_width){ + int w_label = label_width; + int w_defined = int(label_width*label_count); + int w_max = chain->getWidth() - w_offset; + while (w_defined > w_max){ + w_label--; + w_defined = int(w_label*label_count) - w_offset; + } + w_btn = w_label; + } - int w_used = 0; - - //generate and add button objects passed from button label content with default width to chain object. + /* generate button objects passed from button label content + * with default width to chain object. + */ + vector v_btns; + int h_btn = height*85/100; for (size_t i= 0; i< label_count; i++){ - string txt = content[i].text; - string icon_name = string(content[i].button); + string txt = content[i].text; + string icon_name = string(content[i].button); //ignore item, if no text and icon are defined; if (txt.empty() && icon_name.empty()){ @@ -142,14 +178,14 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont continue; } - CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn_min, (ccf_enable_button_bg ? height-2*fr_thickness : height)- 2*shadow_w, txt, icon_name, NULL, false, true, ccf_enable_button_shadow); + CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn, /*(ccf_enable_button_bg ? */h_btn-2*fr_thickness/* : height)*/-ccf_button_shadow_width, txt, icon_name, NULL, false, true, ccf_enable_button_shadow); - btn->setButtonFont(ccf_btn_font); btn->doPaintBg(ccf_enable_button_bg); btn->setButtonDirectKey(content[i].directKey); btn->setButtonDirectKeyA(content[i].directKeyAlt); btn->setButtonResult(content[i].btn_result); btn->setButtonAlias(content[i].btn_alias); + btn->setButtonFont(ccf_btn_font); //set button frames to icon color, predefined for available color buttons if (btn_auto_frame_col){ @@ -165,32 +201,35 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont btn->setColorFrame(f_col); } - chain->addCCItem(btn); + v_btns.push_back(btn); - //set x position of next button object - if (i != 0) - btn->setXPos(CC_APPEND); - - //collect used button width inside chain object - w_used += btn->getWidth(); + if (w_btn < btn->getWidth()){ + btn->setWidth(w_btn); + btn->setButtonFont(NULL); + } + + dprintf(DEBUG_NORMAL, "[CComponentsFooter] [%s - %d] button %s [%u] btn->getWidth() = %d w_btn = %d, (chain->getWidth() = %d)\n", __func__, __LINE__, txt.c_str(), i, btn->getWidth(), w_btn, chain->getWidth()); } - //calculate offset between button objects inside chain object - int w_rest = max(w_chain - w_used, 0); - int btn_offset = w_rest / chain->size(); - chain->setAppendOffset(btn_offset, 0); - dprintf(DEBUG_INFO, "[CComponentsFooter] [%s - %d] btn_offset = %d, w_rest = %d, w_chain = %d, w_used = %d, chain->size() = %u\n", __func__, __LINE__, btn_offset, w_rest, w_chain, w_used, chain->size()); + /* add generated button objects to chain object. + */ + if (!v_btns.empty()){ + /*add all buttons into button container*/ + chain->addCCItem(v_btns); - //set x position of 1st button object inside chain, this is centering button objects inside chain - int x_1st_btn = btn_offset/2; - chain->getCCItem(0)->setXPos(x_1st_btn); + /* set position of labels, as centered inside button container*/ + int w_chain_used = 0; + for (size_t a= 0; a< chain->size(); a++) + w_chain_used += chain->getCCItem(a)->getWidth(); + w_chain_used += (chain->size()-1)*cch_offset; - //check used width of generated buttons, if required then use dynamic font, and try to fit buttons into chain container, dynamic font is used if ccf_btn_font==NULL - //NOTE: user should be set not too small window size and not too large fontsize, at some point this possibility will be depleted and it's no more space for readable caption - if (w_used > width && ccf_btn_font != NULL){ - chain->clear(); - ccf_btn_font = NULL; - setButtonLabels(content, label_count, chain_width, label_width); + int x_btn = chain->getWidth()/2 - w_chain_used/2; + chain->getCCItem(0)->setXPos(x_btn); + + for (size_t c= 1; c< chain->size(); c++){ + x_btn += chain->getCCItem(c-1)->getWidth()+ cch_offset; + chain->getCCItem(c)->setXPos(x_btn); + } } } @@ -360,8 +399,10 @@ void CComponentsFooter::setButtonText(const uint& btn_id, const std::string& tex void CComponentsFooter::enableButtonShadow(int mode, const int& shadow_width, bool force_paint) { ccf_enable_button_shadow = mode; + ccf_button_shadow_width = shadow_width; + ccf_button_shadow_force_paint = force_paint; if (chain){ for(size_t i=0; isize(); i++) - chain->enableShadow(mode, shadow_width, force_paint); + chain->getCCItem(i)->enableShadow(ccf_enable_button_shadow, ccf_button_shadow_width, ccf_button_shadow_force_paint); } } diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index 863ca7cea..301a93362 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -72,8 +72,12 @@ class CComponentsFooter : public CComponentsHeader ///show button with background, default false bool ccf_enable_button_bg; - ///enable button with shadow, default false - bool ccf_enable_button_shadow; + ///enable button with shadow mode, default CC_SHADOW_OFF + int ccf_enable_button_shadow; + ///set button shadow button width + int ccf_button_shadow_width; + ///set button shadow button repaint mode + bool ccf_button_shadow_force_paint; ///enable/disable button frame in icon color, predefined for red, green, yellow and blue, default disabled bool btn_auto_frame_col; @@ -183,7 +187,7 @@ class CComponentsFooter : public CComponentsHeader virtual void setSizeMode(const int& size_mode){cch_size_mode = size_mode; initCCItems();} ///enable and sets shadow properties for embedded buttons - void enableButtonShadow(int mode = CC_SHADOW_ON, const int& shadow_width = RADIUS_SMALL, bool force_paint = false); + void enableButtonShadow(int mode = CC_SHADOW_ON, const int& shadow_width = OFFSET_SHADOW/2, bool force_paint = false); ///disable shadow for embedded buttons void disbaleButtonShadow(){enableButtonShadow(CC_SHADOW_OFF);} }; diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index d30280da8..74201268e 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -119,8 +119,8 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen CComponentsHeader(CComponentsForm *parent = NULL); CComponentsHeader( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, - const std::string& caption = "", - const std::string& = "", + const std::string& caption = std::string(), + const std::string& = std::string(), const int& buttons = 0, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index 1fd538ac5..8801834ca 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -247,11 +247,11 @@ void CComponentsPicture::initPosition(int *x_position, int *y_position) } -void CComponentsPicture::getSize(int* width_image, int *height_image) -{ - *width_image = width; - *height_image = height; -} +// void CComponentsPicture::getSize(int* width_image, int *height_image) +// { +// *width_image = width; +// *height_image = height; +// } int CComponentsPicture::getWidth() { diff --git a/src/gui/components/cc_item_picture.h b/src/gui/components/cc_item_picture.h index 3aab7e11b..8d39e73d2 100644 --- a/src/gui/components/cc_item_picture.h +++ b/src/gui/components/cc_item_picture.h @@ -144,12 +144,12 @@ class CComponentsPicture : public CComponentsItem ///returns current assigned image name std::string getPictureName(){return pic_name;} - ///handle image size - virtual void getSize(int* width_image, int *height_image); - ///return width of component - virtual int getWidth(); - ///return height of component - virtual int getHeight(); +// ///handle image size +// void getSize(int* width_image, int *height_image); + ///return width of item + int getWidth(); + ///return height of item + int getHeight(); ///set width of object and image, value >0 causes scale of image, parameter keep_aspect = true causes scaling of height with same aspect, default = false virtual void setWidth(const int& w, bool keep_aspect = false); diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 9d9b84fd7..53fd1b09e 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -370,9 +370,10 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) #endif else if (actionKey == "button"){ if (button == NULL){ - button = new CComponentsButtonRed(100, 100, 100, 50, "Test"); + button = new CComponentsButtonRed(100, 100, 100, 50, "Test", NULL, false, true, CC_SHADOW_OFF); button->enableShadow(); - } + }else + button->disableShadow(); if (!button->isPainted()){ @@ -560,7 +561,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) footer->setIcon(NEUTRINO_ICON_INFO); //add button labels with conventional button label struct - footer->setButtonLabels(TestButtons, TestButtonsCount, 0, footer->getWidth()/6); + footer->setButtonLabels(TestButtons, TestButtonsCount, 0, footer->getWidth()/TestButtonsCount); //also possible: use directly button name and as 2nd parameter string or locale as text // footer->setButtonLabel(NULL, "Test", 0, 250); diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 2175b3d03..0b1feb8fa 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -97,6 +97,8 @@ void CMsgBox::init(const int& Height, const int& ShowButtons, const msg_result_t height = min(MAX_WINDOW_HEIGHT, height); width = min(MAX_WINDOW_WIDTH, width); + shadow = CC_SHADOW_ON; + //set result if (Default_result != mbrNone) result = default_result = Default_result; @@ -175,8 +177,9 @@ void CMsgBox::initButtons() ccw_footer->setButtonLabels(v_buttons, 0, 125); - //show buttons with background + //show buttons with background and shadow ccw_footer->enableButtonBg(btn_enable_bg); + ccw_footer->enableButtonShadow(CC_SHADOW_ON, OFFSET_SHADOW/2, true); //set position of meassage window and refresh window properties setCenterPos(); From 28712698100059d3f065389507312723e32615e9 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 30 Sep 2016 08:27:28 +0200 Subject: [PATCH 016/171] CComponentsForm: add parameters to setSelectedItem() methode Were not passed to items Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/375451f0a6ef6b7dce410dd2e19d7fd58c1e1aeb Author: Thilo Graf Date: 2016-09-30 (Fri, 30 Sep 2016) --- src/gui/components/cc_frm.cpp | 8 ++++---- src/gui/components/cc_frm.h | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 29ab9ba9e..45c086101 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -566,7 +566,7 @@ u_int8_t CComponentsForm::getPageCount() } -void CComponentsForm::setSelectedItem(int item_id) +void CComponentsForm::setSelectedItem(int item_id, const fb_pixel_t& sel_frame_col, const fb_pixel_t& frame_col, const fb_pixel_t& sel_body_col, const fb_pixel_t& body_col, const int& frame_w, const int& sel_frame_w) { size_t count = v_cc_items.size(); int id = item_id; @@ -590,19 +590,19 @@ void CComponentsForm::setSelectedItem(int item_id) } for (size_t i= 0; i< count; i++) - v_cc_items[i]->setSelected(i == (size_t)id); + v_cc_items[i]->setSelected(i == (size_t)id, sel_frame_col, frame_col, sel_body_col, body_col, frame_w, sel_frame_w); OnSelect(); } -void CComponentsForm::setSelectedItem(CComponentsItem* cc_item) +void CComponentsForm::setSelectedItem(CComponentsItem* cc_item, const fb_pixel_t& sel_frame_col, const fb_pixel_t& frame_col, const fb_pixel_t& sel_body_col, const fb_pixel_t& body_col, const int& frame_w, const int& sel_frame_w) { int id = getCCItemId(cc_item); if (id == -1){ dprintf(DEBUG_NORMAL, "[CComponentsForm] [%s - %d] invalid item parameter, no object available\n", __func__,__LINE__); return; } - setSelectedItem(id); + setSelectedItem(id, sel_frame_col, frame_col, sel_body_col, body_col, frame_w, sel_frame_w); } int CComponentsForm::getSelectedItem() diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index 82a1a4df2..44f6b481e 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -145,9 +145,21 @@ class CComponentsForm : public CComponentsItem ///returns pointer to selected item, return value as CComponentsItem*, returns NULL: if is nothing selected virtual CComponentsItem* getSelectedItemObject(); ///select a definied item, parameter1 as size_t - virtual void setSelectedItem(int item_id); + virtual void setSelectedItem( int item_id, + const fb_pixel_t& sel_frame_col = COL_MENUCONTENTSELECTED_PLUS_0, + const fb_pixel_t& frame_col = COL_SHADOW_PLUS_0, + const fb_pixel_t& sel_body_col = COL_MENUCONTENT_PLUS_0, + const fb_pixel_t& body_col = COL_MENUCONTENT_PLUS_0, + const int& frame_w = 3, + const int& sel_frame_w = 3); ///select a definied item, parameter1 as CComponentsItem* - virtual void setSelectedItem(CComponentsItem* cc_item); + virtual void setSelectedItem( CComponentsItem* cc_item, + const fb_pixel_t& sel_frame_col = COL_MENUCONTENTSELECTED_PLUS_0, + const fb_pixel_t& frame_col = COL_SHADOW_PLUS_0, + const fb_pixel_t& sel_body_col = COL_MENUCONTENT_PLUS_0, + const fb_pixel_t& body_col = COL_MENUCONTENT_PLUS_0, + const int& frame_w = 3, + const int& sel_frame_w = 3); ///exec main method, see also sub exec methods virtual int exec(); From 3119fa58e11c30a647046254805b578a18428db3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 30 Sep 2016 08:29:04 +0200 Subject: [PATCH 017/171] cc_frm_button.cpp/cc_frm_footer.cpp: fix passed parameter were not passed through Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e2a1e7dc5b0f565631877031167e87d1c2bba192 Author: Thilo Graf Date: 2016-09-30 (Fri, 30 Sep 2016) --- src/gui/components/cc_frm_button.cpp | 4 +++- src/gui/components/cc_frm_footer.cpp | 15 ++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index f611d65a4..987e07035 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -101,7 +101,7 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const width = w; height = h; shadow = shadow_mode; - shadow_w = shadow != CC_SHADOW_OFF ? OFFSET_SHADOW/2 : 0; //buttons are mostly small elements, so these elements should have a reasonable shadow width + shadow_w = shadow != CC_SHADOW_OFF ? (shadow_w == -1 ? OFFSET_SHADOW/2 : shadow_w) : 0; //buttons are mostly small elements, so these elements should have a reasonable shadow width cc_body_gradient_enable = CC_COLGRAD_OFF/*g_settings.gradiant*/; //TODO: gradient is prepared for use but disabled at the moment till some other parts of gui parts are provide gradient setColBodyGradient(cc_body_gradient_enable/*CColorGradient::gradientLight2Dark*/, CFrameBuffer::gradientVertical, CColorGradient::light); @@ -294,5 +294,7 @@ void CComponentsButton::paint(bool do_save_bg) void CComponentsButton::enableShadow(int mode, const int& shadow_width, bool force_paint) { clear(); + shadow_w = shadow_width; + shadow_force = force_paint; initVarButton(x, y, width, height, cc_btn_capt, cc_btn_icon, cc_parent, cc_item_selected, cc_item_enabled, mode, col_frame, col_body, col_shadow); } diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 2e742c663..b3533e4ef 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -74,7 +74,7 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const shadow = shadow_mode; ccf_enable_button_shadow = false ; - ccf_button_shadow_width = 0; + ccf_button_shadow_width = shadow ? OFFSET_SHADOW/2 : 0; ccf_button_shadow_force_paint = false; col_frame = color_frame; col_body = color_body; @@ -167,7 +167,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont * with default width to chain object. */ vector v_btns; - int h_btn = height*85/100; + int h_btn = /*(ccf_enable_button_bg ? */(height*85/100)-2*fr_thickness/* : height)*/-ccf_button_shadow_width; for (size_t i= 0; i< label_count; i++){ string txt = content[i].text; string icon_name = string(content[i].button); @@ -178,7 +178,9 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont continue; } - CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn, /*(ccf_enable_button_bg ? */h_btn-2*fr_thickness/* : height)*/-ccf_button_shadow_width, txt, icon_name, NULL, false, true, ccf_enable_button_shadow); + int y_btn = chain->getHeight()/2 - h_btn/2; + dprintf(DEBUG_NORMAL, "[CComponentsFooter] [%s - %d] y_btn [%d] ccf_button_shadow_width [%d]\n", __func__, __LINE__, y_btn, ccf_button_shadow_width); + CComponentsButton *btn = new CComponentsButton(0, y_btn, w_btn, h_btn, txt, icon_name, NULL, false, true, ccf_enable_button_shadow); btn->doPaintBg(ccf_enable_button_bg); btn->setButtonDirectKey(content[i].directKey); @@ -346,7 +348,7 @@ void CComponentsFooter::enableButtonBg(bool enable) void CComponentsFooter::setSelectedButton(size_t item_id) { if (chain) - chain->setSelectedItem(item_id); + chain->setSelectedItem(item_id, COL_GREEN, COL_SHADOW_PLUS_0, COL_MENUCONTENT_PLUS_0, COL_MENUCONTENT_PLUS_0, 2, 2); } int CComponentsFooter::getSelectedButton() @@ -402,7 +404,10 @@ void CComponentsFooter::enableButtonShadow(int mode, const int& shadow_width, bo ccf_button_shadow_width = shadow_width; ccf_button_shadow_force_paint = force_paint; if (chain){ - for(size_t i=0; isize(); i++) + for(size_t i=0; isize(); i++){ chain->getCCItem(i)->enableShadow(ccf_enable_button_shadow, ccf_button_shadow_width, ccf_button_shadow_force_paint); + int y_btn = ccf_enable_button_shadow == CC_SHADOW_OFF ? CC_CENTERED : chain->getHeight()/2 - chain->getCCItem(i)->getHeight()/2 - ccf_button_shadow_width; + chain->getCCItem(i)->setYPos(y_btn); + } } } From 0efab9494e37e27f324e64b9bb73416f985d8b25 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 3 Oct 2016 21:33:46 +0200 Subject: [PATCH 018/171] CMsgBox: add colors to debug output Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b272c407d75deb6626882647323e01162b66696d Author: Thilo Graf Date: 2016-10-03 (Mon, 03 Oct 2016) --- src/gui/widget/msgbox.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 0b1feb8fa..c2ba54a88 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -262,7 +262,7 @@ int CMsgBox::exec() ccw_footer->setSelectedButton(selected-1); mb_show_button = ccw_footer->getSelectedButtonObject()->getButtonAlias(); } - dprintf(DEBUG_INFO, "[CMsgBox] [%s - %d] result = %d, mb_show_button = %d\n", __func__, __LINE__, result, mb_show_button); + dprintf(DEBUG_INFO, "\033[32m[CMsgBox] [%s - %d] result = %d, mb_show_button = %d\033[0m\n", __func__, __LINE__, result, mb_show_button); selected = ccw_footer->getSelectedButton(); refreshFoot(); @@ -275,7 +275,7 @@ int CMsgBox::exec() CComponentsButton* btn_action = static_cast(ccw_footer->getButtonChainObject()->getCCItem(i)); if (msg == btn_action->getButtonDirectKey() || msg == btn_action->getButtonDirectKeyA()){ result = (msg_result_t)btn_action->getButtonResult(); - dprintf(DEBUG_INFO, "[CMsgBox] [%s - %d] result = %d, mb_show_button = %d\n", __func__, __LINE__, result, mb_show_button); + dprintf(DEBUG_INFO, "\033[32m[CMsgBox] [%s - %d] result = %d, mb_show_button = %d\033[0m\n", __func__, __LINE__, result, mb_show_button); loop = false; } } @@ -291,7 +291,7 @@ int CMsgBox::exec() } else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) { - dprintf(DEBUG_INFO, "[CMsgBox] [%s - %d] messages_return::cancel_all\n", __func__, __LINE__); + dprintf(DEBUG_INFO, "\033[32m[CMsgBox] [%s - %d] messages_return::cancel_all\033[0m\n", __func__, __LINE__); res = menu_return::RETURN_EXIT_ALL; loop = false; } From 1352603017d8bd97fdaaa3a503e7e78a42f876ed Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 5 Oct 2016 15:17:25 +0200 Subject: [PATCH 019/171] CMsgBox: set some alternate keys to default key values Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3e01cbe1ac16b4e66dfa6154123df03050639822 Author: Thilo Graf Date: 2016-10-05 (Wed, 05 Oct 2016) --- src/gui/widget/msgbox.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index c2ba54a88..0687761a8 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -135,6 +135,7 @@ void CMsgBox::initButtons() btn.button = NEUTRINO_ICON_BUTTON_OKAY; btn.text = BTN_TEXT(mbOk); btn.directKey = CRCInput::RC_ok; + btn.directKeyAlt = btn.directKey; btn.btn_result = mbrOk; btn.btn_alias = mbOk; v_buttons.push_back(btn); @@ -170,6 +171,7 @@ void CMsgBox::initButtons() btn.button = NEUTRINO_ICON_BUTTON_HOME; btn.text = BTN_TEXT(mbBack); btn.directKey = CRCInput::RC_home; + btn.directKeyAlt = btn.directKey; btn.btn_result = mbrBack; btn.btn_alias = mbBack; v_buttons.push_back(btn); @@ -216,7 +218,7 @@ int CMsgBox::exec() int selected = ccw_footer->getSelectedButton(); - dprintf(DEBUG_NORMAL, "[CMsgBox] [%s - %d] getSelectedButton()= %d\n", __func__, __LINE__,ccw_footer->getSelectedButton()); + dprintf(DEBUG_NORMAL, "\033[32m[CMsgBox] [%s - %d] getSelectedButton()= %d\033[0m\n", __func__, __LINE__,ccw_footer->getSelectedButton()); uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(timeout); @@ -262,13 +264,13 @@ int CMsgBox::exec() ccw_footer->setSelectedButton(selected-1); mb_show_button = ccw_footer->getSelectedButtonObject()->getButtonAlias(); } - dprintf(DEBUG_INFO, "\033[32m[CMsgBox] [%s - %d] result = %d, mb_show_button = %d\033[0m\n", __func__, __LINE__, result, mb_show_button); selected = ccw_footer->getSelectedButton(); refreshFoot(); //refresh timeout on any pressed navi key! This resets current timeout end to the initial value if (timeout > 0) timeoutEnd = CRCInput::calcTimeoutEnd(timeout); + dprintf(DEBUG_INFO, "\033[32m[CMsgBox] [%s - %d] result = %d, mb_show_button = %d\033[0m\n", __func__, __LINE__, result, mb_show_button); } //***action buttons without preselection*** for (size_t i = 0; i< ccw_footer->getButtonChainObject()->size(); i++){ From 93e0dd143cb92ac2fe37a5c083ae6fdf664d2031 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 5 Oct 2016 15:18:21 +0200 Subject: [PATCH 020/171] CComponentsFooter: remove debug spam Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ebf2e65b3841b3c33401096517afea1446a5d9ba Author: Thilo Graf Date: 2016-10-05 (Wed, 05 Oct 2016) --- src/gui/components/cc_frm_footer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index b3533e4ef..39fc6411a 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -179,7 +179,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont } int y_btn = chain->getHeight()/2 - h_btn/2; - dprintf(DEBUG_NORMAL, "[CComponentsFooter] [%s - %d] y_btn [%d] ccf_button_shadow_width [%d]\n", __func__, __LINE__, y_btn, ccf_button_shadow_width); + dprintf(DEBUG_INFO, "[CComponentsFooter] [%s - %d] y_btn [%d] ccf_button_shadow_width [%d]\n", __func__, __LINE__, y_btn, ccf_button_shadow_width); CComponentsButton *btn = new CComponentsButton(0, y_btn, w_btn, h_btn, txt, icon_name, NULL, false, true, ccf_enable_button_shadow); btn->doPaintBg(ccf_enable_button_bg); @@ -210,7 +210,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont btn->setButtonFont(NULL); } - dprintf(DEBUG_NORMAL, "[CComponentsFooter] [%s - %d] button %s [%u] btn->getWidth() = %d w_btn = %d, (chain->getWidth() = %d)\n", __func__, __LINE__, txt.c_str(), i, btn->getWidth(), w_btn, chain->getWidth()); + dprintf(DEBUG_INFO, "[CComponentsFooter] [%s - %d] button %s [%u] btn->getWidth() = %d w_btn = %d, (chain->getWidth() = %d)\n", __func__, __LINE__, txt.c_str(), i, btn->getWidth(), w_btn, chain->getWidth()); } /* add generated button objects to chain object. From dabba341773176eaf9d68894d3f6960de0e55b0d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 5 Oct 2016 15:23:07 +0200 Subject: [PATCH 021/171] CComponentsButton: remove clear()-methode and initVarButton() clear() killed all button object with all key values and key properties. So return values of messeage objects was killed. initVarButton() contains Oobjekt intits to already existant object. Bad idea, if we init again or pre init with NULL. Mode pass was missed. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0f6e8e1f5d027c548148fda176f503901d3fd5b3 Author: Thilo Graf Date: 2016-10-05 (Wed, 05 Oct 2016) --- src/gui/components/cc_frm_button.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index 987e07035..216a9879f 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -293,8 +293,7 @@ void CComponentsButton::paint(bool do_save_bg) void CComponentsButton::enableShadow(int mode, const int& shadow_width, bool force_paint) { - clear(); shadow_w = shadow_width; shadow_force = force_paint; - initVarButton(x, y, width, height, cc_btn_capt, cc_btn_icon, cc_parent, cc_item_selected, cc_item_enabled, mode, col_frame, col_body, col_shadow); + shadow = mode; } From 48e9dc11f3815348aa177cb0bc5e25c1d072fb41 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 5 Oct 2016 21:50:13 +0200 Subject: [PATCH 022/171] CCDraw: add private variable col_shadow_clean Should help to control shadow clean up in some constallations Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7266628207f5ab63524929875d762de0772c24db Author: Thilo Graf Date: 2016-10-05 (Wed, 05 Oct 2016) --- src/gui/components/cc_draw.cpp | 1 + src/gui/components/cc_draw.h | 2 ++ src/gui/components/cc_item.cpp | 1 - 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 90c1f6a39..4174e8f81 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -40,6 +40,7 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) col_body = col_body_old = COL_MENUCONTENT_PLUS_0; col_shadow = col_shadow_old = COL_SHADOW_PLUS_0; col_frame = col_frame_old = COL_FRAME_PLUS_0; + col_shadow_clean = 0; fr_thickness = fr_thickness_old = 0; diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index 3728db9a9..d0664b7a4 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -67,6 +67,8 @@ class CCDraw : public COSDFader, public CComponentsSignals fb_pixel_t col_shadow, col_shadow_old; ///property: color of frame fb_pixel_t col_frame, col_frame_old; + ///internal property: color for shadow clean up + fb_pixel_t col_shadow_clean; ///property: frame thickness, see also setFrameThickness() int fr_thickness, fr_thickness_old; diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index cfb4a1f81..3a874b8c2 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -95,7 +95,6 @@ void CComponentsItem::paintInit(bool do_save_bg) //Workaround: ensure radius values >= 0, framebuffer methode paintBoxRel() gets confused box_rad = max(box_rad, 0); - fb_pixel_t col_shadow_clean = 0; //if item is bound on a parent form,... if (cc_parent){ //...we must use real x/y values and from parent form as reference From fcb732f839627b085ec9d58605d0fb8cc613d970 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 5 Oct 2016 21:51:18 +0200 Subject: [PATCH 023/171] CComponentsPicture: use body color as default clean up color Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9668f89db1cc3c10690e3cda2fd550ff36155b49 Author: Thilo Graf Date: 2016-10-05 (Wed, 05 Oct 2016) --- src/gui/components/cc_item_picture.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index 8801834ca..1d22547b9 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -82,6 +82,7 @@ void CComponentsPicture::init( const int &x_pos, const int &y_pos, const int &w, col_frame = color_frame; col_body = color_background; col_shadow = color_shadow; + col_shadow_clean= col_body; do_scale = allow_scale; image_cache = NULL; //image enable_cache = false; From 505b57685bfb2a2013a4af4225247375bfd468fc Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 5 Oct 2016 21:53:28 +0200 Subject: [PATCH 024/171] CMovieBrowser: add current content background color as image backkground Avoids transparent shadow artefacts during repaint of images Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9d09bc36cebb07edb65d2657a4f3cee327276dcb Author: Thilo Graf Date: 2016-10-05 (Wed, 05 Oct 2016) --- src/gui/moviebrowser/mb.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 147db2845..bed284fa9 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1314,7 +1314,8 @@ void CMovieBrowser::refreshMovieInfo(void) lx = m_cBoxFrameInfo.iX + m_cBoxFrameBrowserList.iWidth - flogo_w -14; ly = m_cBoxFrameInfo.iY + (m_cBoxFrameInfo.iHeight-flogo_h)/2; if (pic == NULL){ //TODO: paint custom covers with different ratio, currently only works with default ratio HD 16/9 - pic = new CComponentsPicture(lx, ly, fname, NULL, CC_SHADOW_ON, COL_MENUCONTENTDARK_PLUS_0); + pic = new CComponentsPicture(lx, ly, fname, NULL, CC_SHADOW_ON, COL_MENUCONTENTDARK_PLUS_0, COL_MENUCONTENT_PLUS_0); + if (pic->getHeight() < flogo_h/2){ flogo_h = flogo_h/2; pic->setYPos(m_cBoxFrameInfo.iY + (m_cBoxFrameInfo.iHeight-flogo_h)/2); From cdedefca335fb27252cdd2955b4df3ac7ca375af Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 5 Oct 2016 22:33:14 +0200 Subject: [PATCH 025/171] CMsgBox: use same colors for window body, footer and button container Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/857b494c47f3ee7cc628c918b4767c94a18de124 Author: Thilo Graf Date: 2016-10-05 (Wed, 05 Oct 2016) --- src/gui/widget/msgbox.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 0687761a8..67679e027 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -88,6 +88,7 @@ void CMsgBox::init(const int& Height, const int& ShowButtons, const msg_result_t //enable footer and add its height showFooter(true); btn_enable_bg = false; + ccw_col_footer = ccw_body->getColorBody(); ccw_footer->doPaintBg(false); int h_current = height; h_current += ccw_footer->getHeight(); @@ -178,6 +179,7 @@ void CMsgBox::initButtons() } ccw_footer->setButtonLabels(v_buttons, 0, 125); + ccw_footer->getButtonChainObject()->setColorBody(col_body); //show buttons with background and shadow ccw_footer->enableButtonBg(btn_enable_bg); From 25e64f1bfc53f7f3d443e6cbd80401107b42ed7e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 6 Oct 2016 21:53:11 +0200 Subject: [PATCH 026/171] cc_item.cpp: remove frame width from boxrad In framed boxes, frame radius was too big and was looking bad. Not sure if this is now fixed everywhere (eg. hintboxes) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f62ddcf61d9f1608ea893d5e1ebddf2ea6d0a204 Author: Thilo Graf Date: 2016-10-06 (Thu, 06 Oct 2016) --- src/gui/components/cc_item.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 3a874b8c2..f3be06b96 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -173,7 +173,7 @@ void CComponentsItem::paintInit(bool do_save_bg) //shadow corner bottom right {sh_cbr, CC_FBDATA_TYPE_SHADOW_BOX, sh_cbr_x, sh_cbr_y, sh_cdx, sh_cdy, col_shadow, box_rad, corner_type & CORNER_BOTTOM_RIGHT, 0, NULL, NULL, NULL, false}, //clean up inside body - {sh_cbr, CC_FBDATA_TYPE_SHADOW_BOX, sh_cbr_x-sw-th, sh_cbr_y-sw-th, sh_cdx, sh_cdy, col_shadow_clean, box_rad, corner_type & CORNER_BOTTOM_RIGHT, 0, NULL, NULL, NULL, false}, + {sh_cbr, CC_FBDATA_TYPE_SHADOW_BOX, sh_cbr_x-sw, sh_cbr_y-sw, sh_cdx, sh_cdy, col_shadow_clean, box_rad, corner_type & CORNER_BOTTOM_RIGHT, 0, NULL, NULL, NULL, false}, //shadow bar right {sh_br, CC_FBDATA_TYPE_SHADOW_BOX, sh_rx, sh_ry, sw, sh_rdy, col_shadow, 0, CORNER_NONE, 0, NULL, NULL, NULL, false}, @@ -187,7 +187,7 @@ void CComponentsItem::paintInit(bool do_save_bg) {true, CC_FBDATA_TYPE_BOX, ix+th, iy+th, dx-2*th, dy-2*th, col_body, box_rad, corner_type, 0, NULL, NULL, NULL, false}, //frame - {true, CC_FBDATA_TYPE_FRAME, ix, iy, dx, dy, col_frame_cur, box_rad+th, corner_type, th, NULL, NULL, NULL, false} + {true, CC_FBDATA_TYPE_FRAME, ix, iy, dx, dy, col_frame_cur, box_rad, corner_type, th, NULL, NULL, NULL, false} }; for(size_t i =0; i< (sizeof(fbdata) / sizeof(fbdata[0])) ;i++) { From bab4bd2782c3970d3024d87124836c39bdccd818 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 7 Oct 2016 10:08:33 +0200 Subject: [PATCH 027/171] CComponentsButton: remove enableShadow() from button class is not required Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/03d010fa29612e7a5fb60b180160a160d32817c3 Author: Thilo Graf Date: 2016-10-07 (Fri, 07 Oct 2016) --- src/gui/components/cc_frm_button.cpp | 7 ------- src/gui/components/cc_frm_button.h | 6 ------ 2 files changed, 13 deletions(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index 216a9879f..c20bcf01d 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -290,10 +290,3 @@ void CComponentsButton::paint(bool do_save_bg) //paint form contents paintForm(do_save_bg); } - -void CComponentsButton::enableShadow(int mode, const int& shadow_width, bool force_paint) -{ - shadow_w = shadow_width; - shadow_force = force_paint; - shadow = mode; -} diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index 1235dd0b9..80653e2be 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -195,12 +195,6 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen inline virtual void setButtonAlias(const int& alias_value){cc_btn_alias = alias_value;}; ///returns an alias value from button object, see also cc_btn_alias inline virtual int getButtonAlias(){return cc_btn_alias;}; - - /**1st parameter requires defines CC_SHADOW_ON (default), CC_SHADOW_OFF, CC_SHADOW_BOTTOM or CC_SHADOW_RIGHT, see also cc_types.h - * 2nd parameter defines shadow width, default = defined by system - * 3rd parameter forces paint of shadow layer, default = false, Note: default shadow will paint only on first paint, use 3rd parameter=true ignores this - */ - void enableShadow(int mode = CC_SHADOW_ON, const int& shadow_width = -1, bool force_paint = false); }; //! Sub class of CComponentsButton. From 418611f057c27907911d601c24810d9db156751f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 7 Oct 2016 10:13:32 +0200 Subject: [PATCH 028/171] CComponentsItem: ensure some dimensions for shadow are not < 0 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/59e8a170613b7f10ad50f81e24457fd1fdf2345a Author: Thilo Graf Date: 2016-10-07 (Fri, 07 Oct 2016) --- src/gui/components/cc_item.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index f3be06b96..f26883be7 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -82,6 +82,8 @@ void CComponentsItem::paintInit(bool do_save_bg) //and ensure sw is not larger than body dimensions, max x% int sw = (shadow) ? min(shadow_w, min(dx, dy)*50/100) : 0; + /*ensure shadow is never < 0*/ + sw = max(0, sw); //set current needed corner main box radius int box_rad = corner_rad; @@ -131,7 +133,7 @@ void CComponentsItem::paintInit(bool do_save_bg) int sh_cbl_y = sh_cbr_y; //handle general shadow bar dimensions - int sh_bdx = dx-sh_cdx-sh_cdx; + int sh_bdx = max(0, dx-sh_cdx-sh_cdx); /*ensure value is never < 0*/ int sh_rdy = dy-sh_cdy-sh_cdy; //...bar bottom From a9f00a51b8e6c90b1dffcbe1795d508a1ddb7b25 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 7 Oct 2016 10:33:05 +0200 Subject: [PATCH 029/171] cc_item.cpp: subtract frame width from the inner radius Box Is necessary, because otherwise the frame radius would not match with outside radius This would mean that there are "holes" at the box corners. So now it seems to work. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5bd4903b273479fe18a61cdeb85e30daa24587c5 Author: Thilo Graf Date: 2016-10-07 (Fri, 07 Oct 2016) --- src/gui/components/cc_item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index f26883be7..35d2ec981 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -186,7 +186,7 @@ void CComponentsItem::paintInit(bool do_save_bg) {sh_ctr, CC_FBDATA_TYPE_SHADOW_BOX, sh_ctr_x-sw, sh_ctr_y-sw+th, sh_cdx, sh_cdy-sh_cdy_size_offset+sw, col_shadow_clean, box_rad, corner_type & CORNER_TOP_RIGHT, 0, NULL, NULL, NULL, false}, //main box - {true, CC_FBDATA_TYPE_BOX, ix+th, iy+th, dx-2*th, dy-2*th, col_body, box_rad, corner_type, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, ix+th, iy+th, dx-2*th, dy-2*th, col_body, box_rad-th, corner_type, 0, NULL, NULL, NULL, false}, //frame {true, CC_FBDATA_TYPE_FRAME, ix, iy, dx, dy, col_frame_cur, box_rad, corner_type, th, NULL, NULL, NULL, false} From 6f30f1b2740165eaed864c019fba7d705d88439e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 7 Oct 2016 13:49:55 +0200 Subject: [PATCH 030/171] CComponentsFooter: use different select color for button, if count = 1 TODO: should be configurable. Not all theme color combinations have matched contrasts. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b3e7e49592a4e530e8c3efeabb09963258281f92 Author: Thilo Graf Date: 2016-10-07 (Fri, 07 Oct 2016) --- src/gui/components/cc_frm_footer.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 39fc6411a..bf7e1bf09 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -347,8 +347,12 @@ void CComponentsFooter::enableButtonBg(bool enable) void CComponentsFooter::setSelectedButton(size_t item_id) { - if (chain) - chain->setSelectedItem(item_id, COL_GREEN, COL_SHADOW_PLUS_0, COL_MENUCONTENT_PLUS_0, COL_MENUCONTENT_PLUS_0, 2, 2); + if (chain){ + fb_pixel_t sel_col = COL_MENUCONTENTSELECTED_PLUS_2; + if (chain->size() > 1) + sel_col = COL_MENUCONTENTSELECTED_PLUS_0; //TODO: make it configurable + chain->setSelectedItem(item_id, sel_col, COL_MENUCONTENTSELECTED_PLUS_2, COL_MENUCONTENT_PLUS_0, COL_MENUCONTENT_PLUS_0, 1, 2); + } } int CComponentsFooter::getSelectedButton() From 1cb41d0ba7bcad8d43809419f4fbad8db78f58df Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 7 Oct 2016 13:58:08 +0200 Subject: [PATCH 031/171] CComponentsButton: remake caption size to 85% of button height Better optical matching size. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ce11a3a0dfbc00d75d881533aa689390f79320ee Author: Thilo Graf Date: 2016-10-07 (Fri, 07 Oct 2016) --- src/gui/components/cc_frm_button.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index c20bcf01d..0331a5a75 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -195,7 +195,7 @@ void CComponentsButton::initCaption() x_cap += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() : 0; int w_cap = width - w_frame - append_x_offset - x_cap - w_frame; - int h_cap = (height*75/100) - 2*w_frame; + int h_cap = (height*85/100) - 2*w_frame; /*NOTE: paint of centered text in y direction without y_offset looks unlovely displaced in y direction especially besides small icons and inside small areas, From df41f8f7681d3b4529577c259580eb470f5f856a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 7 Oct 2016 17:10:48 +0200 Subject: [PATCH 032/171] CHintBox: reduce window size for used auto size depends on text content Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3b60a55f594ff8d777208e3eae191e08e51e54eb Author: Thilo Graf Date: 2016-10-07 (Fri, 07 Oct 2016) --- src/gui/widget/hintbox.cpp | 1 + src/gui/widget/hintbox.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 8e669af40..557f87b76 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -215,6 +215,7 @@ void CHintBox::addHintItem(const std::string& Text, const int& text_mode, const //set required font and line size Font* font = font_text == NULL ? g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO] : font_text; + width = max(width, min(font->getRenderWidth(Text), HINTBOX_MIN_WIDTH)); int h_line = font->getHeight(); //init side picon object diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index eaf743cb9..01e46174f 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -32,7 +32,7 @@ #include -#define HINTBOX_MIN_WIDTH 600 +#define HINTBOX_MIN_WIDTH 400 #define HINTBOX_MIN_HEIGHT 125 #define HINTBOX_MAX_HEIGHT 420 #define HINTBOX_DEFAULT_TIMEOUT 5 From ee41a420a43f96d8214e3b0ed559d289ad099d47 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 7 Oct 2016 17:16:01 +0200 Subject: [PATCH 033/171] Helpbox: use current shadow color Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/bd57627b8fcb17f1e98eeee794cb2f4bb563e21c Author: Thilo Graf Date: 2016-10-07 (Fri, 07 Oct 2016) --- src/gui/widget/helpbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/helpbox.cpp b/src/gui/widget/helpbox.cpp index 8d963e8e9..19bf55978 100644 --- a/src/gui/widget/helpbox.cpp +++ b/src/gui/widget/helpbox.cpp @@ -45,7 +45,7 @@ Helpbox::Helpbox( const string& Title, CC_SHADOW_ON, COL_MENUCONTENT_PLUS_6, COL_MENUCONTENT_PLUS_0, - COL_MENUCONTENTDARK_PLUS_0) + COL_SHADOW_PLUS_0) { page = 0; hbox_y = 1; From 9d24f238191792f2ab280b27b6b124ca2d940067 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 9 Oct 2016 14:53:37 +0200 Subject: [PATCH 034/171] Helpbox: use auto sized width for footer button Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3221b7467eb7a0b0ca15bde274da3f64c91c6440 Author: Thilo Graf Date: 2016-10-09 (Sun, 09 Oct 2016) --- src/gui/widget/helpbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/helpbox.cpp b/src/gui/widget/helpbox.cpp index 19bf55978..cea87e3e3 100644 --- a/src/gui/widget/helpbox.cpp +++ b/src/gui/widget/helpbox.cpp @@ -50,7 +50,7 @@ Helpbox::Helpbox( const string& Title, page = 0; hbox_y = 1; setWindowHeaderButtons(CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT); - ccw_footer->setButtonLabel(NEUTRINO_ICON_BUTTON_HOME, LOCALE_MESSAGEBOX_BACK, 0, 150); + ccw_footer->setButtonLabel(NEUTRINO_ICON_BUTTON_HOME, LOCALE_MESSAGEBOX_BACK); hbox_font = default_font_text; if (default_font_text == NULL) From 12c95b76dd3c83c8cbc51a5419c0a79b7653bc1e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 9 Oct 2016 15:07:01 +0200 Subject: [PATCH 035/171] CPersonalizeGui: remove centered text alignment fro helptext Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/87a9a695787a6d9ee11cb5e9d8e4a5ceb4a842b2 Author: Thilo Graf Date: 2016-10-09 (Sun, 09 Oct 2016) --- src/gui/personalize.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/personalize.cpp b/src/gui/personalize.cpp index 243f1584e..053368990 100644 --- a/src/gui/personalize.cpp +++ b/src/gui/personalize.cpp @@ -737,7 +737,7 @@ void CPersonalizeGui::ShowHelpPersonalize() Helpbox helpbox(g_Locale->getText(LOCALE_PERSONALIZE_HELP)); for (int i = (int)LOCALE_PERSONALIZE_HELP_LINE1; i<= (int)LOCALE_PERSONALIZE_HELP_LINE8; i++) - helpbox.addLine(g_Locale->getText((neutrino_locale_t)i), CTextBox::CENTER); + helpbox.addLine(g_Locale->getText((neutrino_locale_t)i)); helpbox.addExitKey(CRCInput::RC_ok); helpbox.show(); From 134c3e53cb99fcf93aed6cd3d19944871561125b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 9 Oct 2016 16:50:48 +0200 Subject: [PATCH 036/171] CMovieHelp: add localized items TODO: add missings locales Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1338ce2b8e51d1e8a2c6fcc239d1a3d632471772 Author: Thilo Graf Date: 2016-10-09 (Sun, 09 Oct 2016) --- data/locale/slovak.locale | 1 + src/gui/moviebrowser/mb_help.h | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/data/locale/slovak.locale b/data/locale/slovak.locale index 9088325c2..ce50da111 100644 --- a/data/locale/slovak.locale +++ b/data/locale/slovak.locale @@ -775,6 +775,7 @@ hdd_statfs_recording len pri nahrávaní hdd_umount Odpojenie hdd_umount_warn Chyba odpájania disku! hdd_umounted Zariadenie odstránené +help_box_title Help imageinfo.api API: imageinfo.creator Vytvoril: imageinfo.date Dátum: diff --git a/src/gui/moviebrowser/mb_help.h b/src/gui/moviebrowser/mb_help.h index b16a1dd47..5e20cd69c 100644 --- a/src/gui/moviebrowser/mb_help.h +++ b/src/gui/moviebrowser/mb_help.h @@ -53,14 +53,16 @@ class CMovieHelp : public CMenuTarget { Helpbox helpbox(g_Locale->getText(LOCALE_HELP_BOX_TITLE)); helpbox.addLine("Standard functions", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 10, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]); + helpbox.addLine(NEUTRINO_ICON_BUTTON_OKAY, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_OKAY), CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); + helpbox.addLine(NEUTRINO_ICON_BUTTON_PLAY, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_PLAY), CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); + helpbox.addLine(NEUTRINO_ICON_BUTTON_MUTE, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_MUTE), CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); helpbox.addSeparatorLine(); - helpbox.addLine(NEUTRINO_ICON_BUTTON_RED, "Change sort", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); - helpbox.addLine(NEUTRINO_ICON_BUTTON_GREEN, "Show filter window", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); - helpbox.addLine(NEUTRINO_ICON_BUTTON_YELLOW, "Changing the active window", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); - helpbox.addLine(NEUTRINO_ICON_BUTTON_BLUE, "Reload recording info", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); - helpbox.addLine(NEUTRINO_ICON_BUTTON_MENU, "Open Moviebrowser menue", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); + helpbox.addLine(NEUTRINO_ICON_BUTTON_RED, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_RED), CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); + helpbox.addLine(NEUTRINO_ICON_BUTTON_GREEN, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_GREEN), CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); + helpbox.addLine(NEUTRINO_ICON_BUTTON_YELLOW, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_YELLOW), CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); + helpbox.addLine(NEUTRINO_ICON_BUTTON_BLUE, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_BLUE), CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); + helpbox.addLine(NEUTRINO_ICON_BUTTON_MENU, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_MENU), CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); helpbox.addLine("+/- Change view", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); - helpbox.addSeparator(); #if 0 helpbox.addPagebreak(); #endif From ba90b113f07a1f457343e591c0fdfd98f4b7f32d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 9 Oct 2016 17:11:43 +0200 Subject: [PATCH 037/171] Helpbox: fix possible transparent holes behind images Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/85797588847cb45ea2b63a23cfbe7cfb0378406b Author: Thilo Graf Date: 2016-10-09 (Sun, 09 Oct 2016) Origin message was: ------------------ Helpbox: fix possible transparent holes behind images --- src/gui/widget/helpbox.cpp | 2 ++ src/gui/widget/hintbox.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/src/gui/widget/helpbox.cpp b/src/gui/widget/helpbox.cpp index cea87e3e3..66cd9d4f2 100644 --- a/src/gui/widget/helpbox.cpp +++ b/src/gui/widget/helpbox.cpp @@ -97,7 +97,9 @@ void Helpbox::addLine(const std::string& icon, const std::string& text, const in if (!icon.empty()){ picon = new CComponentsPicture (0, 0, icon); w_picon = picon->getHeight(); + picon->doPaintBg(false); picon->setYPos(line->getHeight()/2 - w_picon/2); + picon->SetTransparent(CFrameBuffer::TM_BLACK); line->addCCItem(picon); } diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 557f87b76..5584c477e 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -221,6 +221,7 @@ void CHintBox::addHintItem(const std::string& Text, const int& text_mode, const //init side picon object CComponentsPicture *obj_picon = new CComponentsPicture(0, 0, Picon); obj_picon->doPaintBg(false); + obj_picon->SetTransparent(CFrameBuffer::TM_BLACK); int w_picon = obj_picon->getWidth(); //init text item object From 3c1dc9d12369023d552e39f79ccf186ba6699876 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 9 Oct 2016 17:29:59 +0200 Subject: [PATCH 038/171] CHintbox: use default text frame depends from default height and width Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b9d44a3fc8d063e09c3a4d88517af8f3c94cabac Author: Thilo Graf Date: 2016-10-09 (Sun, 09 Oct 2016) --- src/gui/widget/hintbox.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index 01e46174f..b96db3834 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -37,7 +37,7 @@ #define HINTBOX_MAX_HEIGHT 420 #define HINTBOX_DEFAULT_TIMEOUT 5 //frame around hint container as indent -#define W_FRAME 15 +#define W_FRAME std::max(HINTBOX_MIN_WIDTH, HINTBOX_MIN_HEIGHT) * 2/100 //frame color around hint/message box #define HINTBOX_DEFAULT_FRAME_COLOR COL_FRAME From deca218ec8fe4b9ab69436b503ecd4b1c6569a0c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 11 Oct 2016 23:50:25 +0200 Subject: [PATCH 039/171] CHintbox/CMsgBox: add vizualized timeout bar Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/cb3699deb56b9a6163d9b2256ab247080d991876 Author: Thilo Graf Date: 2016-10-11 (Tue, 11 Oct 2016) --- src/gui/widget/hintbox.cpp | 35 ++++++++++++++++++++++++++++++++++- src/gui/widget/hintbox.h | 10 ++++++++-- src/gui/widget/msgbox.cpp | 7 +++---- 3 files changed, 45 insertions(+), 7 deletions(-) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 5584c477e..c483c0df8 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -125,6 +125,7 @@ CHintBox::CHintBox( const char * const Caption, init(g_Locale->getText(Text), Width, string(Picon == NULL ? "" : Picon), header_buttons, text_mode, indent); } + void CHintBox::init(const std::string& Text, const int& Width, const std::string& Picon, const int& header_buttons, const int& text_mode, const int& indent) { lines = 0; @@ -154,10 +155,40 @@ void CHintBox::init(const std::string& Text, const int& Width, const std::string y_hint_obj = 0; h_hint_obj = obj_content->getHeight(); + //initialize timeout bar and its timer + timeout_pb = NULL; + timeout_pb_timer= NULL; + if (!Text.empty()) addHintItem(Text, text_mode, Picon); } +CHintBox::~CHintBox() +{ + if(timeout_pb){ + delete timeout_pb; timeout_pb = NULL; + } + if(timeout_pb_timer){ + delete timeout_pb_timer; timeout_pb_timer = NULL; + } +} + +void CHintBox::showTimeOutBar() +{ + if(timeout_pb){ + timeout_pb->paint0(); + timeout_pb->setValues(timeout_pb->getValue()+1, timeout); + }else{ + timeout_pb = new CProgressBar(); + timeout_pb->setDimensionsAll(ccw_body->getRealXPos(), ccw_body->getRealYPos(), ccw_body->getWidth(), 8); + timeout_pb->setValues(0, timeout); + if (!timeout_pb_timer) + timeout_pb_timer = new CComponentsTimer(1); + timeout_pb_timer->OnTimer.connect(sigc::mem_fun0(this, &CHintBox::showTimeOutBar)); + timeout_pb_timer->startTimer(); + } +} + int CHintBox::exec() { neutrino_msg_t msg; @@ -165,6 +196,9 @@ int CHintBox::exec() int res = messages_return::none; uint64_t timeoutEnd = CRCInput::calcTimeoutEnd( timeout ); + if (timeout > 0) + showTimeOutBar(); + while ( ! ( res & ( messages_return::cancel_info | messages_return::cancel_all ) ) ) { g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd ); @@ -394,7 +428,6 @@ void CHintBox::scroll_down(const uint& hint_id) Scroll(true, hint_id); } - int ShowHint(const char * const Caption, const char * const Text, const int Width, int timeout, const char * const Icon, const char * const Picon, const int& header_buttons) { int res = messages_return::none; diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index b96db3834..b4a7fb357 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -64,6 +64,10 @@ class CHintBox : public CComponentsWindow ///content container object, contains the hint objects, it's a child of body object CComponentsFrmChain *obj_content; + ///timeout bar + CProgressBar *timeout_pb; + CComponentsTimer *timeout_pb_timer; + ///scroll handler, default down and for the 1st hint item (=0), NOTE: exec() must be called! see also scroll_down()/scroll_up() void Scroll(bool down, const uint& hint_id = 0); @@ -115,11 +119,13 @@ class CHintBox : public CComponentsWindow const int& text_mode = 0, const int& indent = W_FRAME); - //~CHintBox(); //inherited + virtual ~CHintBox(); int exec(); ///define timeout, timeout is enabled if parameter1 > -1 - virtual void setTimeOut(const int& Timeout){timeout = Timeout;}; + virtual void setTimeOut(const int& Timeout){timeout = Timeout;} + ///shows timeout as progressbar + void showTimeOutBar(); ///scroll handler for text objects: NOTE: exec() must be called ! see also Scroll() ///scroll up handler, default for the 1st hint item (=0), item id arises from the order of added items with addHintItem(), default we have minimal one item with id=0 diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 67679e027..bee06c37d 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -218,12 +218,11 @@ int CMsgBox::exec() ccw_footer->getSelectedButtonObject()->setButtonAlias(mb_show_button); int selected = ccw_footer->getSelectedButton(); - - - dprintf(DEBUG_NORMAL, "\033[32m[CMsgBox] [%s - %d] getSelectedButton()= %d\033[0m\n", __func__, __LINE__,ccw_footer->getSelectedButton()); - uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(timeout); + if (timeout > 0) + showTimeOutBar(); + bool loop = true; while (loop) { From cc3cf7931fc5146afcab723b2110c6945a3e1119 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 12 Oct 2016 09:13:18 +0200 Subject: [PATCH 040/171] CPictureViewerGui: add helpbox Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/52abf18c2235fa4593149348dd67c40f6111bc7b Author: Thilo Graf Date: 2016-10-12 (Wed, 12 Oct 2016) --- src/gui/pictureviewer.cpp | 42 ++-------------- src/gui/pictureviewer.h | 2 +- src/gui/pictureviewer_help.h | 96 ++++++++++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+), 39 deletions(-) create mode 100644 src/gui/pictureviewer_help.h diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index d7cc78419..7d09f898f 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -61,7 +61,7 @@ // remove this #include -#include +#include #include #include @@ -858,42 +858,8 @@ void CPictureViewerGui::deletePicFile(unsigned int index, bool mode) } } -void CPictureViewerGui::showHelp() +int CPictureViewerGui::showHelp() { - Helpbox helpbox(g_Locale->getText(LOCALE_MESSAGEBOX_INFO)); - helpbox.addLine(g_Locale->getText(LOCALE_PICTUREVIEWER_HELP1)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_OKAY, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP2)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_5, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP3)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_0, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP4)); - helpbox.addPagebreak(); - helpbox.addLine(g_Locale->getText(LOCALE_PICTUREVIEWER_HELP5)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_LEFT, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP6)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_RIGHT, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP7)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_5, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP3)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_HOME, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP8)); -// helpbox.addPagebreak(); -// helpbox.addLine(g_Locale->getText(LOCALE_PICTUREVIEWER_HELP9)); -// helpbox.addLine(NEUTRINO_ICON_BUTTON_OKAY, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP10)); -// helpbox.addLine(NEUTRINO_ICON_BUTTON_LEFT, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP11)); -// helpbox.addLine(NEUTRINO_ICON_BUTTON_RIGHT, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP12)); -// helpbox.addLine(NEUTRINO_ICON_BUTTON_1, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP13)); -// helpbox.addLine(NEUTRINO_ICON_BUTTON_3, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP14)); -// helpbox.addLine(NEUTRINO_ICON_BUTTON_2, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP15)); -// helpbox.addLine(NEUTRINO_ICON_BUTTON_4, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP16)); -// helpbox.addLine(NEUTRINO_ICON_BUTTON_6, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP17)); -// helpbox.addLine(NEUTRINO_ICON_BUTTON_8, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP18)); -// helpbox.addLine(NEUTRINO_ICON_BUTTON_5, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP3)); -// helpbox.addLine(NEUTRINO_ICON_BUTTON_0, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP19)); -// helpbox.addLine(NEUTRINO_ICON_BUTTON_HOME, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP8)); -// if(audioplayer) -// { -// helpbox.addPagebreak(); -// helpbox.addLine(g_Locale->getText(LOCALE_PICTUREVIEWER_HELP30)); -// helpbox.addLine(NEUTRINO_ICON_BUTTON_PLAY, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP31)); -// helpbox.addLine(NEUTRINO_ICON_BUTTON_PAUSE, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP32)); -// helpbox.addLine(NEUTRINO_ICON_BUTTON_STOP, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP33)); -// helpbox.addLine(NEUTRINO_ICON_BUTTON_FORWARD, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP34)); -// helpbox.addLine(NEUTRINO_ICON_BUTTON_BACKWARD, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP35)); -// } - helpbox.show(); + CPictureViewerHelp help(audioplayer); + return help.exec(NULL, ""); } diff --git a/src/gui/pictureviewer.h b/src/gui/pictureviewer.h index 2d5410148..6b17ec2dd 100644 --- a/src/gui/pictureviewer.h +++ b/src/gui/pictureviewer.h @@ -108,7 +108,7 @@ class CPictureViewerGui : public CMenuTarget void endView(); int show(); - void showHelp(); + int showHelp(); void deletePicFile(unsigned int index, bool mode); bool audioplayer; diff --git a/src/gui/pictureviewer_help.h b/src/gui/pictureviewer_help.h new file mode 100644 index 000000000..b82b30445 --- /dev/null +++ b/src/gui/pictureviewer_help.h @@ -0,0 +1,96 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + License: GPL + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + *********************************************************** +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#ifndef _PVIEWER_HELP_H_ +#define _PVIEWER_HELP_H_ + + +#include + +// Class to show Pictureviewer help, to be used by menu +class CPictureViewerHelp : public CMenuTarget +{ + private: + bool audioplayer; + + public: + CPictureViewerHelp(bool enable_audioplayer_help) + { + audioplayer = enable_audioplayer_help; + } + ~CPictureViewerHelp(){}; + + int exec(CMenuTarget* /*parent*/, const std::string & /*actionKey*/) + { + Helpbox helpbox(g_Locale->getText(LOCALE_HELP_BOX_TITLE)); + + helpbox.addLine(g_Locale->getText(LOCALE_PICTUREVIEWER_HELP1), CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 10, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]); + helpbox.addLine(NEUTRINO_ICON_BUTTON_OKAY, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP2)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_5, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP3)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_0, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP4)); + helpbox.addSeparatorLine(); + helpbox.addLine(g_Locale->getText(LOCALE_PICTUREVIEWER_HELP5), CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 10, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]); + helpbox.addLine(NEUTRINO_ICON_BUTTON_LEFT, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP6)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_RIGHT, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP7)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_5, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP3)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_HOME, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP8)); + helpbox.addPagebreak(); + helpbox.addLine(g_Locale->getText(LOCALE_PICTUREVIEWER_HELP9), CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 10, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]); + helpbox.addLine(NEUTRINO_ICON_BUTTON_OKAY, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP10)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_LEFT, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP11)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_RIGHT, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP12)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_1, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP13)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_3, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP14)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_2, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP15)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_4, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP16)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_6, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP17)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_8, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP18)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_5, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP3)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_0, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP19)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_HOME, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP8)); + + if(audioplayer){ + helpbox.addPagebreak(); + helpbox.addLine(g_Locale->getText(LOCALE_PICTUREVIEWER_HELP30)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_PLAY, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP31)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_PAUSE, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP32)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_STOP, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP33)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_FORWARD, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP34)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_BACKWARD, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP35)); + } + + helpbox.addExitKey(CRCInput::RC_ok); + + helpbox.show(); + int ret = helpbox.exec(); + helpbox.hide(); + + return ret; + } +}; + +#endif /*_PVIEWER_HELP_H_*/ + From c9972f68a000bb1359c18ae068bc47591ce231b4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 13 Oct 2016 01:10:39 +0200 Subject: [PATCH 041/171] CHintBox: add space for timeout bar Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c035b2fc150ecd80807e7b0490ad915535ffebc1 Author: Thilo Graf Date: 2016-10-13 (Thu, 13 Oct 2016) --- src/gui/widget/hintbox.cpp | 6 +++--- src/gui/widget/hintbox.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index c483c0df8..84e450e31 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -180,7 +180,7 @@ void CHintBox::showTimeOutBar() timeout_pb->setValues(timeout_pb->getValue()+1, timeout); }else{ timeout_pb = new CProgressBar(); - timeout_pb->setDimensionsAll(ccw_body->getRealXPos(), ccw_body->getRealYPos(), ccw_body->getWidth(), 8); + timeout_pb->setDimensionsAll(ccw_body->getRealXPos(), ccw_body->getRealYPos(), ccw_body->getWidth(), TIMEOUT_BAR_HEIGHT); timeout_pb->setValues(0, timeout); if (!timeout_pb_timer) timeout_pb_timer = new CComponentsTimer(1); @@ -253,7 +253,7 @@ void CHintBox::addHintItem(const std::string& Text, const int& text_mode, const int h_line = font->getHeight(); //init side picon object - CComponentsPicture *obj_picon = new CComponentsPicture(0, 0, Picon); + CComponentsPicture *obj_picon = new CComponentsPicture(0, timeout > 0 ? TIMEOUT_BAR_HEIGHT : 0, Picon); obj_picon->doPaintBg(false); obj_picon->SetTransparent(CFrameBuffer::TM_BLACK); int w_picon = obj_picon->getWidth(); @@ -263,7 +263,7 @@ void CHintBox::addHintItem(const std::string& Text, const int& text_mode, const int w_text_obj = obj_content->getWidth() - w_picon - w_indentation; int h_text_obj = max(h_line, obj_picon->getHeight()); CComponentsText *obj_text = new CComponentsText(x_text_obj, - 0, + timeout > 0 ? TIMEOUT_BAR_HEIGHT : 0, w_text_obj, h_text_obj, Text, diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index b4a7fb357..e8a08fde3 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -40,6 +40,7 @@ #define W_FRAME std::max(HINTBOX_MIN_WIDTH, HINTBOX_MIN_HEIGHT) * 2/100 //frame color around hint/message box #define HINTBOX_DEFAULT_FRAME_COLOR COL_FRAME +#define TIMEOUT_BAR_HEIGHT OFFSET_SHADOW/2 //! Sub class of CComponentsWindow. Shows a window as a hintbox with text and optional icon beside of text. /*! From 3278e0e10312434de8d13b97df43badb1bc82894 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 13 Oct 2016 10:06:18 +0200 Subject: [PATCH 042/171] CComponentsForm: try to fix possible transparent bars Ion enabled frame it's possible we have transparent bars between frame and the last item on window bottom. This should avoid this. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/edd2e48bbe35801acae4cd81cad4a3a488baa3fe Author: Thilo Graf Date: 2016-10-13 (Thu, 13 Oct 2016) --- src/gui/components/cc_frm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 45c086101..3efb2da8b 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -492,7 +492,7 @@ void CComponentsForm::paintCCItems() } //check height and adapt if required - int bottom_frm = (cc_parent ? cc_yr : y) + height - 2*fr_thickness; + int bottom_frm = (cc_parent ? cc_yr : y) + height/* - 2*fr_thickness*/; int bottom_item = cc_item->getRealYPos() + h_item; int h_diff = bottom_item - bottom_frm; int new_h = h_item - h_diff; From 77f953cdbb0920623f97b4fe1be2e4a73317a92b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 14 Oct 2016 00:43:34 +0200 Subject: [PATCH 043/171] CComponentsWindow: prepare possibility to change footer height Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/013cd1f2ccf73d3f643c85cbedbd2f335d60dd21 Author: Thilo Graf Date: 2016-10-14 (Fri, 14 Oct 2016) --- src/gui/components/cc_frm_window.cpp | 7 +++++-- src/gui/components/cc_frm_window.h | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 6d52dd36f..982219e1b 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -126,6 +126,7 @@ void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const y = y_pos; width = w; height = h; + ccw_h_footer = 0; //auto initWindowSize(); initWindowPos(); @@ -216,6 +217,8 @@ void CComponentsWindow::initFooter() //add of footer item happens initCCWItems() //set footer properties if (ccw_footer){ + if (ccw_h_footer) + ccw_footer->setHeight(ccw_h_footer); ccw_footer->setPos(0, cc_yr + height - ccw_footer->getHeight()- fr_thickness); ccw_footer->setWidth(width-2*fr_thickness); ccw_footer->enableShadow(false/*shadow*/); @@ -291,10 +294,10 @@ void CComponentsWindow::initBody() int h_body = height - h_header - h_footer - fr_thickness; int x_body = w_l_sidebar; int w_body = width-2*fr_thickness - w_l_sidebar - w_r_sidebar; - + ccw_body->setDimensionsAll(x_body, h_header, w_body, h_body); ccw_body->doPaintBg(true); - + //handle corner behavior if (!ccw_show_header) ccw_body->setCornerType(CORNER_TOP); diff --git a/src/gui/components/cc_frm_window.h b/src/gui/components/cc_frm_window.h index 6d1807798..ca2fb296e 100644 --- a/src/gui/components/cc_frm_window.h +++ b/src/gui/components/cc_frm_window.h @@ -89,6 +89,8 @@ class CComponentsWindow : public CComponentsForm fb_pixel_t ccw_col_head_text; ///footer bg color fb_pixel_t ccw_col_footer; + ///footer heigh, default defined by footer object itself + int ccw_h_footer; ///footer button font Font* ccw_button_font; From d16159d80aedaafdb920b1fbe6695deb22ea46ab Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 14 Oct 2016 00:47:42 +0200 Subject: [PATCH 044/171] CMsgBox: enlarge footer height Buttons has too small offset to bottom of footer. Framed and shaded buttons are arranged on the top of footer, so we have a larger offset. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d50ef787a2738bcf53763e1650441c26416c266c Author: Thilo Graf Date: 2016-10-14 (Fri, 14 Oct 2016) --- src/gui/widget/msgbox.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index bee06c37d..bf8607f6e 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -87,6 +87,8 @@ void CMsgBox::init(const int& Height, const int& ShowButtons, const msg_result_t //enable footer and add its height showFooter(true); + ccw_h_footer = ccw_footer->getHeight()+OFFSET_INNER_MID; + ccw_footer->setHeight(ccw_h_footer); btn_enable_bg = false; ccw_col_footer = ccw_body->getColorBody(); ccw_footer->doPaintBg(false); From c28b7d4a23326146ac2b525d527f63a1d72e5372 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Oct 2016 21:08:31 +0200 Subject: [PATCH 045/171] CMsgBox: ensure reset of progress value on used key Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3280b44471d54fc9fe32989264eb92543a94e4bd Author: Thilo Graf Date: 2016-10-17 (Mon, 17 Oct 2016) --- src/gui/widget/msgbox.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index bf8607f6e..dfe855cad 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -271,8 +271,10 @@ int CMsgBox::exec() refreshFoot(); //refresh timeout on any pressed navi key! This resets current timeout end to the initial value - if (timeout > 0) + if (timeout > 0){ + timeout_pb->setValues(0, timeout); timeoutEnd = CRCInput::calcTimeoutEnd(timeout); + } dprintf(DEBUG_INFO, "\033[32m[CMsgBox] [%s - %d] result = %d, mb_show_button = %d\033[0m\n", __func__, __LINE__, result, mb_show_button); } //***action buttons without preselection*** From 254d9366c32c8cc0078eb0496f0083e65b9414d0 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Oct 2016 21:10:16 +0200 Subject: [PATCH 046/171] CCDraw: add signals into hide() methode alows to use slots Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/78259c6ec318a7474a84501239b5744126c60c90 Author: Thilo Graf Date: 2016-10-17 (Mon, 17 Oct 2016) --- src/gui/components/cc_draw.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 4174e8f81..1e7372974 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -633,6 +633,7 @@ void CCDraw::paintFbItems(bool do_save_bg) void CCDraw::hide() { + OnBeforeHide(); //restore saved screen background of item if available for(size_t i =0; i< v_fbdata.size() ;i++) { if (v_fbdata[i].fbdata_type == CC_FBDATA_TYPE_BGSCREEN){ @@ -646,6 +647,7 @@ void CCDraw::hide() } is_painted = false; firstPaint = true; + OnAfterHide(); } //erase or paint over rendered objects From 3534f404419860d07cbc7e50816c4834885551f9 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 17 Oct 2016 21:17:01 +0200 Subject: [PATCH 047/171] CComponentsFooter: reduce button height inside footer TODO: more optimization seems required Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/542de648f5cd6c39580032e1f55358969dc261cc Author: Thilo Graf Date: 2016-10-17 (Mon, 17 Oct 2016) --- src/gui/components/cc_frm_footer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index bf7e1bf09..2d777a7b5 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -167,7 +167,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont * with default width to chain object. */ vector v_btns; - int h_btn = /*(ccf_enable_button_bg ? */(height*85/100)-2*fr_thickness/* : height)*/-ccf_button_shadow_width; + int h_btn = /*(ccf_enable_button_bg ? */(height*85/100)-2*fr_thickness-OFFSET_INNER_SMALL/* : height)*/-ccf_button_shadow_width; for (size_t i= 0; i< label_count; i++){ string txt = content[i].text; string icon_name = string(content[i].button); From fc538b20128c3cb9d3aeac6a3e551d106c7de68c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 20 Oct 2016 23:49:09 +0200 Subject: [PATCH 048/171] CComponentsTimer: add support for nano seconds To enable nano mode, parameter is_nano must set to true. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d0dd14040f6b3f8084ff5deeb669a65a7032aa4b Author: Thilo Graf Date: 2016-10-20 (Thu, 20 Oct 2016) --- src/gui/components/cc_timer.cpp | 15 ++++++++++----- src/gui/components/cc_timer.h | 15 ++++++++++----- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/gui/components/cc_timer.cpp b/src/gui/components/cc_timer.cpp index 966d0bcc2..9c8b1aa7b 100644 --- a/src/gui/components/cc_timer.cpp +++ b/src/gui/components/cc_timer.cpp @@ -36,10 +36,11 @@ using namespace std; -CComponentsTimer::CComponentsTimer(const int& interval) +CComponentsTimer::CComponentsTimer(const int& interval, bool is_nano) { tm_thread = 0; tm_interval = interval; + tm_enable_nano = is_nano; sl_stop_timer = sigc::mem_fun(*this, &CComponentsTimer::stopTimer); @@ -59,7 +60,10 @@ void CComponentsTimer::runSharedTimerAction() while(tm_enable && tm_interval > 0) { tm_mutex.lock(); OnTimer(); - mySleep(tm_interval); + if (!tm_enable_nano) + mySleep(tm_interval); + else + usleep((useconds_t)tm_interval); tm_mutex.unlock(); } @@ -142,10 +146,11 @@ bool CComponentsTimer::stopTimer() return false; } -void CComponentsTimer::setTimerInterval(const int& seconds) +void CComponentsTimer::setTimerInterval(const int& interval, bool is_nano) { - if (tm_interval == seconds) + if (tm_interval == interval && tm_enable_nano == is_nano) return; - tm_interval = seconds; + tm_enable_nano = is_nano; + tm_interval = interval; } diff --git a/src/gui/components/cc_timer.h b/src/gui/components/cc_timer.h index a653889c3..530224f40 100644 --- a/src/gui/components/cc_timer.h +++ b/src/gui/components/cc_timer.h @@ -47,6 +47,8 @@ class CComponentsTimer : public sigc::trackable ///refresh interval in seconds int tm_interval; + + bool tm_enable_nano; ///init function to init shared timer action static void* initThreadAction(void *arg); @@ -71,10 +73,12 @@ class CComponentsTimer : public sigc::trackable * @param[in] interval * @li int interval in seconds, default value=1 (1 sec) * If init value for interval > 0, timer starts immediately + * @li bool default = false as seconds mode, true = nano seconds mode * @see * setTimerInterval(); */ - CComponentsTimer(const int& interval = 1); + CComponentsTimer(const int& interval = 1, bool is_nano = false); + ~CComponentsTimer(); /**Starts timer thread @@ -105,15 +109,16 @@ class CComponentsTimer : public sigc::trackable */ bool isRun() const {return tm_thread;}; - /**set interval in seconds - * @param[in] seconds - * @li int + /**set timer interval + * @param[in] interval + * @li int default interval in seconds, if second parameter = true interval is used as nano seconds + * @li bool default = false as seconds mode, true = nano seconds mode * @return * void * @see * tm_interval */ - void setTimerInterval(const int& seconds); + void setTimerInterval(const int& interval, bool is_nano = false); /**Provides a signal handler to receive any function or methode. * Use this in your class where ever you need time controled actions. From 28ba1cbc8632ce5ef1de1af3e6e7b85b4b01726c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 20 Oct 2016 23:53:42 +0200 Subject: [PATCH 049/171] CHintBox: visualize timeoutbar with smooth progress Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4ff7bd8f7ee2d898bea82d366a3e7daf2ed89ed4 Author: Thilo Graf Date: 2016-10-20 (Thu, 20 Oct 2016) --- src/gui/widget/hintbox.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 84e450e31..e8a8aee00 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -177,13 +177,13 @@ void CHintBox::showTimeOutBar() { if(timeout_pb){ timeout_pb->paint0(); - timeout_pb->setValues(timeout_pb->getValue()+1, timeout); + timeout_pb->setValues(timeout_pb->getValue()+1, 100*timeout); }else{ timeout_pb = new CProgressBar(); timeout_pb->setDimensionsAll(ccw_body->getRealXPos(), ccw_body->getRealYPos(), ccw_body->getWidth(), TIMEOUT_BAR_HEIGHT); - timeout_pb->setValues(0, timeout); + timeout_pb->setValues(0, 100*timeout); if (!timeout_pb_timer) - timeout_pb_timer = new CComponentsTimer(1); + timeout_pb_timer = new CComponentsTimer(1, true); timeout_pb_timer->OnTimer.connect(sigc::mem_fun0(this, &CHintBox::showTimeOutBar)); timeout_pb_timer->startTimer(); } From c004c300565080925768c453ca2b2fba94278f35 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 21 Oct 2016 00:10:38 +0200 Subject: [PATCH 050/171] CHintBox: fix text mode pass Rquired in inherited classes Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2952dcc124b6f0c7bcedca1c1a0b8787061c44d8 Author: Thilo Graf Date: 2016-10-21 (Fri, 21 Oct 2016) --- src/gui/widget/hintbox.cpp | 3 ++- src/gui/widget/hintbox.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index e8a8aee00..a75bd1c56 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -131,6 +131,7 @@ void CHintBox::init(const std::string& Text, const int& Width, const std::string lines = 0; timeout = HINTBOX_DEFAULT_TIMEOUT; w_indentation = indent; + hb_text_mode = text_mode; //set required window width and basic height width = max(HINTBOX_MIN_WIDTH, Width); @@ -160,7 +161,7 @@ void CHintBox::init(const std::string& Text, const int& Width, const std::string timeout_pb_timer= NULL; if (!Text.empty()) - addHintItem(Text, text_mode, Picon); + addHintItem(Text, hb_text_mode, Picon); } CHintBox::~CHintBox() diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index e8a08fde3..80f89fa50 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -55,6 +55,7 @@ class CHintBox : public CComponentsWindow int y_hint_obj; int h_hint_obj; int w_indentation; + int hb_text_mode; ///global count of lines uint lines; From c8c22653a17c0d9ef9fc047fe51677c37eefac44 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 21 Oct 2016 09:21:39 +0200 Subject: [PATCH 051/171] CHintBox: ensure remove timeout bar from screen if hintbox object is closed Timeout bar is not embedded like other cc items in this form, therefor is is better to kill this object explicit from screen otherwise it is possible we hab artefacts after closing of hintbox window. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6580c5a54a3bc4d58f7394b497ef032aca5e1c12 Author: Thilo Graf Date: 2016-10-21 (Fri, 21 Oct 2016) Origin message was: ------------------ CHintBox: ensure remove timeout bar from screen if hintbox object is closed Timeout bar is not embedded like other cc items in this form, therefor is is better to kill this object explicit from screen otherwise it is possible we hab artefacts after closing of hintbox window. --- src/gui/widget/hintbox.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index a75bd1c56..a7e3a7d19 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -167,6 +167,7 @@ void CHintBox::init(const std::string& Text, const int& Width, const std::string CHintBox::~CHintBox() { if(timeout_pb){ + timeout_pb->kill(); //ensure cleanup from screen delete timeout_pb; timeout_pb = NULL; } if(timeout_pb_timer){ From 4c8e3c6fd4c9e3813d46e27e1ad89edab8c528d1 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 22 Oct 2016 13:57:46 +0200 Subject: [PATCH 052/171] CTestMenu: ensure remove hintbox from screen after pressed exit button. call of hide() was missed. Use hintbox object on stack. Is completely sufficient here. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/912ca8647ec66083a859a8f34566065d05b9b073 Author: Thilo Graf Date: 2016-10-22 (Sat, 22 Oct 2016) --- src/gui/test_menu.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 53fd1b09e..7120cdfa9 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -283,8 +283,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) neutrino_msg_t msg; neutrino_msg_data_t data; CHintBox * khintBox = NULL; - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, "Press button, or press EXIT to return"); - hintBox->paint(); + CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, "Press button, or press EXIT to return"); + hintBox.paint(); while (1) { g_RCInput->getMsg(&msg, &data, 100); @@ -300,15 +300,15 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) delete khintBox; } khintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, keyname); - hintBox->hide(); + hintBox.hide(); khintBox->paint(); } } if (khintBox) delete khintBox; - - delete hintBox; - + + hintBox.hide(); + return res; } #if 0 //some parts DEPRECATED From 8def652574c4fa93fbd3a1279fbe348df0274c2a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 23 Oct 2016 16:51:46 +0200 Subject: [PATCH 053/171] CHintBox: add doc with doxygen tags Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/969e2fe600bb6096d15db2032f4ad861dc12ff7a Author: Thilo Graf Date: 2016-10-23 (Sun, 23 Oct 2016) --- src/gui/widget/hintbox.h | 196 ++++++++++++++++++++++++++++++++------- 1 file changed, 165 insertions(+), 31 deletions(-) diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index 80f89fa50..49c907e8c 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -8,7 +8,7 @@ Copyright (C) 2008-2009, 2011, 2013 Stefan Seyfried Implementation of CComponent Window class. - Copyright (C) 2014-2015 Thilo Graf 'dbt' + Copyright (C) 2014-2016 Thilo Graf 'dbt' License: GPL @@ -81,10 +81,40 @@ class CHintBox : public CComponentsWindow const int& text_mode, const int& indent); - void ReSize(); + virtual void ReSize(); public: - // Text is UTF-8 encoded + /**CHintBox Constructor + * @param[in] Caption + * @li exepts type neutrino_locale_t with locale entry from /system/locals.h + * @param[in] Text + * @li exepts type const char*, this is the message text inside the window, text is UTF-8 encoded + * @param[in] Width + * @li optional: exepts type int, defines box width, default value = HINTBOX_MIN_WIDTH + * @param[in] Icon + * @li optional: exepts type const char*, defines the icon name on the left side of titlebar, default = NULL (non Icon) + * @param[in] Picon + * @li optional: exepts type const char*, defines the picon name on the left side of message text, default = NULL (non Icon) + * @param[in] header_buttons + * @li optional: exepts type int, defines the icon name on the left side of titlebar, default = 0 (non Icon) + * @see class CComponentsWindow() + * @param[in] text_mode + * @li optional: exepts type int, defines the text modes for embedded text lines + * Possible Modes defined in /gui/widget/textbox.h + * AUTO_WIDTH + * AUTO_HIGH + * SCROLL + * CENTER + * RIGHT + * TOP + * BOTTOM + * NO_AUTO_LINEBREAK + * AUTO_LINEBREAK_NO_BREAKCHARS + * @param[in] indent + * @li optional: exepts type int, defines indent of text + * + * @see classes CComponentsText(), CTextBox() + */ CHintBox( const neutrino_locale_t Caption, const char * const Text, const int Width = HINTBOX_MIN_WIDTH, @@ -94,6 +124,11 @@ class CHintBox : public CComponentsWindow const int& text_mode = 0, const int& indent = W_FRAME); + /**CHintBox Constructor + * @param[in] Caption + * @li exepts type const char* + * @see for other parameters take a look to basic class CHintBox() + */ CHintBox( const char * const Caption, const char * const Text, const int Width = HINTBOX_MIN_WIDTH, @@ -103,6 +138,13 @@ class CHintBox : public CComponentsWindow const int& text_mode = 0, const int& indent = W_FRAME); + /**CHintBox Constructor + * @param[in] Caption + * @li exepts type neutrino_locale_t with locale entry from /system/locals.h + * @param[in] Text + * @li exepts type neutrino_locale_t with locale entry from /system/locals.h + * @see for other parameters take a look to basic class CHintBox() + */ CHintBox( const neutrino_locale_t Caption, const neutrino_locale_t Text, const int Width = HINTBOX_MIN_WIDTH, @@ -112,6 +154,13 @@ class CHintBox : public CComponentsWindow const int& text_mode = 0, const int& indent = W_FRAME); + /**CHintBox Constructor + * @param[in] Caption + * @li exepts type const char* + * @param[in] Text + * @li exepts type neutrino_locale_t with locale entry from /system/locals.h + * @see for other parameters take a look to basic class CHintBox() + */ CHintBox( const char * const Caption, const neutrino_locale_t Text, const int Width = HINTBOX_MIN_WIDTH, @@ -122,48 +171,109 @@ class CHintBox : public CComponentsWindow const int& indent = W_FRAME); virtual ~CHintBox(); + /** + * exec caller + * @return int + */ int exec(); - ///define timeout, timeout is enabled if parameter1 > -1 + /** + * Defines timeout, timeout is enabled if parameter1 > -1 + * @param[in] Timeout as int as seconds + */ virtual void setTimeOut(const int& Timeout){timeout = Timeout;} - ///shows timeout as progressbar + + /** + * enable visualized timeout as progressbar under titelbar + */ void showTimeOutBar(); - ///scroll handler for text objects: NOTE: exec() must be called ! see also Scroll() - ///scroll up handler, default for the 1st hint item (=0), item id arises from the order of added items with addHintItem(), default we have minimal one item with id=0 + /** + * scroll handler for text objects: NOTE: exec() must be called ! + * @param[in] hint_id + * @li optional: exepts type unsigned int, default = 0 + * default for the 1st hint item (=0), item id arises from the order of added items with addHintItem(), default we have minimal one item with id=0 + * @see Scroll() + */ void scroll_up(const uint& hint_id = 0); - ///scroll down handler, default for the 1st hint item (=0), item id arises from the order of added items with addHintItem(), default we have minimal one item with id=0 + + /** + * scroll down handler for text objects: NOTE: exec() must be called ! + * @param[in] hint_id + * @li exepts type unsigned int, default = 0 + * default for the 1st hint item (=0), item id arises from the order of added items with addHintItem(), default we h + * @see Scroll() + */ void scroll_down(const uint& hint_id = 0); - ///specialized member to add a hint item, parameter1: UTF8 text that will be showed, parameter2: (optional) textmode, see gui/widget/textbox.h for possible modes, parameter3: (optional) = an icon that will be showed left beside of text + /** + * Member to add a hint item + * @param[in] Text + * @li exepts type std::string, this is the message text inside the window, text is UTF-8 encoded + * @param[in] text_mode + * @li optional: exepts type int, defines the text modes for embedded text lines + * Possible Modes defined in /gui/widget/textbox.h + * AUTO_WIDTH + * AUTO_HIGH + * SCROLL + * CENTER + * RIGHT + * TOP + * BOTTOM + * NO_AUTO_LINEBREAK + * AUTO_LINEBREAK_NO_BREAKCHARS + * @param[in] Picon + * @li optional: exepts type std::string, defines the picon name on the left side of message text, default = NULL (non Icon) + * @param[in] at_page_number + * @li optional: exepts type int, defines the page number on that this hint will be, default = 0 (first page) + * @param[in] color_text + * @li optional: exepts type fb_pixel_t, defines the text color, default = COL_MENUCONTENT_TEXT + * * @param[in] font_text + * @li optional: exepts type Font*, defines the text font type, default = NULL for system preset for message contents + */ void addHintItem( const std::string& Text, const int& text_mode = 0, const std::string& Picon = std::string(), const u_int8_t& at_page_number = 0, const fb_pixel_t& color_text = COL_MENUCONTENT_TEXT, Font* font_text = NULL); - ///add any cc-item to body object, also usable is addWindowItem() to add items to the window body object + + /** + * Member to add a hint item from specified cc-item type + * @param[in] cc_Item + * @li exepts type CComponentsItem*, allows to add any possible cc-item type + * + * @see /gui/components/cc_types.h + */ void addHintItem(CComponentsItem* cc_Item){obj_content->addCCItem(cc_Item);} - /*! - * Sets a new text to a hint item, - 2nd parameter expects an item number, default = 0 (1st item). Mostly this should be the only one, but if more than one items are exist, it's possible to select a target item. - 3rd parameter expects modes from CTextBox (default = CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH | CTextBox::CENTER) - AUTO_WIDTH - AUTO_HIGH - SCROLL - CENTER - RIGHT - TOP - BOTTOM - NO_AUTO_LINEBREAK - AUTO_LINEBREAK_NO_BREAKCHARS - 4th parameter font_text expects a font object, if default value = NULL, then g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO] is used - 5th parameter expects value from /gui/color.h or compatible color numbers - 6th parameter expects - FONT_STYLE_REGULAR (default) - FONT_STYLE_BOLD - FONT_STYLE_ITALIC + /** + * Sets a text to a hint item. + * @param[in] Text + * @li exepts type std::string, this is the message text inside the hint item, text is UTF-8 encoded + * @param[in] hint_id + * @li optional: exepts type unsigned int, default = 0 for the first or one and only item + * @param[in] text_mode + * @li optional: exepts type int, defines the text modes for embedded text lines + * Possible Modes defined in /gui/widget/textbox.h + * AUTO_WIDTH + * AUTO_HIGH + * SCROLL + * CENTER + * RIGHT + * TOP + * BOTTOM + * NO_AUTO_LINEBREAK + * AUTO_LINEBREAK_NO_BREAKCHARS + * default: CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH | CTextBox::CENTER + * @param[in] color_text + * @li optional: exepts type fb_pixel_t, defines the text color, default = COL_MENUCONTENT_TEXT + * * @param[in] style + * @li optional: exepts type int, defines the text style NOTE: only for dynamic font + * possible styles are: + * FONT_STYLE_REGULAR (default) + * FONT_STYLE_BOLD + * FONT_STYLE_ITALIC */ void setMsgText(const std::string& Text, const uint& hint_id = 0, @@ -173,7 +283,11 @@ class CHintBox : public CComponentsWindow const int& style = CComponentsText::FONT_STYLE_REGULAR); }; -// Text is UTF-8 encoded +/** +* Simplified methodes to show hintboxes on screen +* Text is UTF-8 encoded +* @see for possible parameters take a look to CHintBox() +*/ int ShowHint(const neutrino_locale_t Caption, const char * const Text, const int Width = HINTBOX_MIN_WIDTH, int timeout = HINTBOX_DEFAULT_TIMEOUT, const char * const Icon = NULL, const char * const Picon = NULL, const int& header_buttons = 0); int ShowHint(const neutrino_locale_t Caption, const neutrino_locale_t Text, const int Width = HINTBOX_MIN_WIDTH, int timeout = HINTBOX_DEFAULT_TIMEOUT, const char * const Icon = NULL, const char * const Picon = NULL, const int& header_buttons = 0); int ShowHint(const char * const Caption, const char * const Text, const int Width = HINTBOX_MIN_WIDTH, int timeout = HINTBOX_DEFAULT_TIMEOUT, const char * const Icon = NULL, const char * const Picon = NULL, const int& header_buttons = 0); @@ -190,11 +304,31 @@ optional disable/enable background class CHint : public CHintBox { public: + /**CHint Constructor + * @param[in] Text + * @li exepts type const char*, this is the message text inside the window, text is UTF-8 encoded + * @param[in] show_background + * @li optional: exepts type bool, enable/disable backround paint, default = true + */ CHint(const char * const Text, bool show_background = true); + /**CHint Constructor + * @param[in] Text + * @li exepts type neutrino_locale_t, this is the message text inside the window, text is UTF-8 encoded + * @param[in] show_background + * @li optional: exepts type bool, enable/disable backround paint, default = true + */ CHint(const neutrino_locale_t Text, bool show_background = true); }; -//methods to show simplified hints +/** +* Simplified methodes to show hintboxes without titlebar and footer +* Text is UTF-8 encoded +* @param[in] timeout +* @li optional: exepts type int as seconds, default = HINTBOX_DEFAULT_TIMEOUT (5 sec) +* @param[in] show_background +* @li optional: exepts type bool, enable/disable backround paint, default = true +* @see for possible text parameters take a look to CHintBox() +*/ int ShowHintS(const neutrino_locale_t Text, int timeout = HINTBOX_DEFAULT_TIMEOUT, bool show_background = true); int ShowHintS(const char * const Text, int timeout = HINTBOX_DEFAULT_TIMEOUT, bool show_background = true); From 9dcee01e694f573f894377dded99699e812c48b6 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 23 Oct 2016 17:08:51 +0200 Subject: [PATCH 054/171] CComponentsFooter: optimize select buttons, try to assign better contrast Now it's possible to set parameters for frames and text. Parameters are prdefined for better contrasts in select or default mode. TODO: background modes have no effects at the moment. Here are other things need to be done. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/55ac5815230c2547970901e088a0213c6161c853 Author: Thilo Graf Date: 2016-10-23 (Sun, 23 Oct 2016) --- src/gui/components/cc_frm_footer.cpp | 15 +++++++++++---- src/gui/components/cc_frm_footer.h | 25 +++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 2d777a7b5..8256752cd 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -345,13 +345,20 @@ void CComponentsFooter::enableButtonBg(bool enable) } } -void CComponentsFooter::setSelectedButton(size_t item_id) +void CComponentsFooter::setSelectedButton(size_t item_id, const fb_pixel_t& fr_col, const fb_pixel_t& sel_fr_col, const fb_pixel_t& bg_col, const fb_pixel_t& sel_bg_col, const fb_pixel_t& text_col, const fb_pixel_t& sel_text_col) { if (chain){ - fb_pixel_t sel_col = COL_MENUCONTENTSELECTED_PLUS_2; + for (size_t i= 0; i< chain->size(); i++){ + CComponentsButton *btn = static_cast(chain->getCCItem(i)); + btn->setButtonTextColor(text_col); + } + fb_pixel_t sel_col = fr_col; if (chain->size() > 1) - sel_col = COL_MENUCONTENTSELECTED_PLUS_0; //TODO: make it configurable - chain->setSelectedItem(item_id, sel_col, COL_MENUCONTENTSELECTED_PLUS_2, COL_MENUCONTENT_PLUS_0, COL_MENUCONTENT_PLUS_0, 1, 2); + sel_col = sel_fr_col; //TODO: make it configurable + chain->setSelectedItem(item_id, sel_col, fr_col, sel_bg_col, bg_col, 1, 2); + + if (chain->size() > 1) + getSelectedButtonObject()->setButtonTextColor(sel_text_col); } } diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index 301a93362..7796aac39 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -137,8 +137,29 @@ class CComponentsFooter : public CComponentsHeader ///disables background of buttons void disableButtonBg(){enableButtonBg(false);} - ///select a definied button, parameter1 as size_t - void setSelectedButton(size_t item_id); + /**Select a definied button inside button chain object + * @param[in] item_id + * @li optional: exepts type size_t + * @param[in] fr_col + * @li optional: exepts type fb_pixel_t, as default frame color + * @param[in] sel_fr_col + * @li optional: exepts type fb_pixel_t, as selected frame color + * @param[in] bg_col + * @li optional: exepts type fb_pixel_t, as default background color + * @param[in] sel_bg_col + * @li optional: exepts type fb_pixel_t, as selected background color + * @param[in] text_col + * @li optional: exepts type fb_pixel_t, as default text color + * @param[in] sel_text_col + * @li optional: exepts type fb_pixel_t, as selected text color + */ + void setSelectedButton(size_t item_id, + const fb_pixel_t& fr_col = COL_MENUCONTENTSELECTED_PLUS_2, + const fb_pixel_t& sel_fr_col = COL_MENUCONTENTSELECTED_PLUS_0, + const fb_pixel_t& bg_col = COL_MENUFOOT_PLUS_0, /*TODO disabled at the moment, without effect*/ + const fb_pixel_t& sel_bg_col = COL_MENUCONTENTSELECTED_PLUS_2, /*TODO disabled at the moment, without effect*/ + const fb_pixel_t& text_col = COL_MENUCONTENTDARK_TEXT_PLUS_2, + const fb_pixel_t& sel_text_col = COL_MENUCONTENT_TEXT); ///returns id of select button, return value as int, -1 = nothing is selected int getSelectedButton(); ///returns selected button object, return value as pointer to object, NULL means nothing is selected From 9f8d4b4386cce554f131f8f46e47445ccc6535cd Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 23 Oct 2016 20:40:06 +0200 Subject: [PATCH 055/171] CMsgBox: use default text mode parameter with scroll for all derivatives Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/21e8188b5bf710e9a6305598b728095cf2147558 Author: Thilo Graf Date: 2016-10-23 (Sun, 23 Oct 2016) --- src/gui/widget/msgbox.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gui/widget/msgbox.h b/src/gui/widget/msgbox.h index 0cf3a8fc9..eda0c941d 100644 --- a/src/gui/widget/msgbox.h +++ b/src/gui/widget/msgbox.h @@ -7,7 +7,7 @@ Günther@tuxbox.berlios.org Implementation of CComponent Window class. - Copyright (C) 2014-2015 Thilo Graf 'dbt' + Copyright (C) 2014-2016 Thilo Graf 'dbt' License: GPL @@ -38,6 +38,7 @@ #define MSGBOX_MIN_WIDTH HINTBOX_MIN_WIDTH #define MSGBOX_MIN_HEIGHT HINTBOX_MIN_HEIGHT + 75 +#define DEFAULT_TEXT_MODE (CMsgBox::CENTER | CMsgBox::AUTO_WIDTH | CMsgBox::AUTO_HIGH | CMsgBox::SCROLL) //! Sub class of CHintBox. Shows a window as a messagebox /*! @@ -126,7 +127,7 @@ class CMsgBox : public CHintBox const int& Height = MSGBOX_MIN_HEIGHT, const int& ShowButtons = mbCancel, const msg_result_t& Default_result = mbrCancel, - const int& Text_mode = CMsgBox::CENTER | CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH | CTextBox::SCROLL); + const int& Text_mode = DEFAULT_TEXT_MODE); CMsgBox(const char* Text, const neutrino_locale_t locale_Title = NONEXISTANT_LOCALE, @@ -136,7 +137,7 @@ class CMsgBox : public CHintBox const int& Height = MSGBOX_MIN_HEIGHT, const int& ShowButtons = mbCancel, const msg_result_t& Default_result = mbrCancel, - const int& Text_mode = CMsgBox::CENTER | CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH | CTextBox::SCROLL); + const int& Text_mode = DEFAULT_TEXT_MODE); // ~CMsgBox(); //inherited int exec(); @@ -192,8 +193,6 @@ class CMsgBox : public CHintBox // bool setText(const std::string* newText); }; -#define DEFAULT_TEXT_MODE (CMsgBox::CENTER | CMsgBox::AUTO_WIDTH | CMsgBox::AUTO_HIGH) - int ShowMsg2UTF( const neutrino_locale_t Title, const char * const Text, const CMsgBox::msg_result_t Default, From ebc13d46b341518685c686843f846066122fb6e3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 23 Oct 2016 21:39:17 +0200 Subject: [PATCH 056/171] CHintBox: try to optimize height and width of message window Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a5ce26dfd969765d8cfe09b42abe587fa57632cc Author: Thilo Graf Date: 2016-10-23 (Sun, 23 Oct 2016) --- src/gui/widget/hintbox.cpp | 19 +++++++++++-------- src/gui/widget/hintbox.h | 2 ++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index a7e3a7d19..d5f80d796 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -8,7 +8,7 @@ Copyright (C) 2008-2009, 2011, 2013 Stefan Seyfried Implementation of CComponent Window class. - Copyright (C) 2014-2015 Thilo Graf 'dbt' + Copyright (C) 2014-2016 Thilo Graf 'dbt' License: GPL @@ -133,8 +133,10 @@ void CHintBox::init(const std::string& Text, const int& Width, const std::string w_indentation = indent; hb_text_mode = text_mode; + hb_font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]; + //set required window width and basic height - width = max(HINTBOX_MIN_WIDTH, Width); + width = max(HINTBOX_MIN_WIDTH, max(Width, min(hb_font->getRenderWidth(Text), (int)frameBuffer->getScreenWidth()))); height = max(HINTBOX_MIN_HEIGHT, height); ccw_buttons = header_buttons; @@ -250,9 +252,9 @@ void CHintBox::addHintItem(const std::string& Text, const int& text_mode, const dprintf(DEBUG_INFO, "[CHintBox] [%s - %d] add new hint '%s' %s\n", __func__, __LINE__, Text.c_str(), Picon.c_str()); //set required font and line size - Font* font = font_text == NULL ? g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO] : font_text; - width = max(width, min(font->getRenderWidth(Text), HINTBOX_MIN_WIDTH)); - int h_line = font->getHeight(); + hb_font = !font_text ? hb_font : font_text; + width = max(width, min(hb_font->getRenderWidth(Text), HINTBOX_MIN_WIDTH)); + int h_line = hb_font->getHeight(); //init side picon object CComponentsPicture *obj_picon = new CComponentsPicture(0, timeout > 0 ? TIMEOUT_BAR_HEIGHT : 0, Picon); @@ -270,14 +272,15 @@ void CHintBox::addHintItem(const std::string& Text, const int& text_mode, const h_text_obj, Text, text_mode, - font); + hb_font); //provide the internal textbox object CTextBox *textbox = obj_text->getCTextBoxObject(); int lines_count = textbox->getLines(); - //get required height of text object related to lines count and height of head and footer, if available - int h_required = lines_count * h_line + (ccw_head ? ccw_head->getHeight() : 0) + (ccw_footer ? ccw_footer->getHeight() : 0); + //get required height of text object related to height of current text object, header and footer + int fh_h = (ccw_head ? ccw_head->getHeight() : 0) + (ccw_footer ? ccw_footer->getHeight() : 0) + obj_text->getHeight(); + int h_required = min( max(height,fh_h), (int)frameBuffer->getScreenHeight()) ;//lines_count * h_line + (ccw_head ? ccw_head->getHeight() : 0) + (ccw_footer ? ccw_footer->getHeight() : 0); //set minimal required height height = max(height, min(HINTBOX_MAX_HEIGHT, max(HINTBOX_MIN_HEIGHT, h_required))); diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index 49c907e8c..e7a066161 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -57,6 +57,8 @@ class CHintBox : public CComponentsWindow int w_indentation; int hb_text_mode; + Font* hb_font; + ///global count of lines uint lines; From 5716e576507361214fcd568be4a34bdb1d61f0d0 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 23 Oct 2016 22:39:05 +0200 Subject: [PATCH 057/171] CMsgBox: add doc for CMsgBox Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/527e65df77d7779bdf34fef91939d77bca285ec7 Author: Thilo Graf Date: 2016-10-23 (Sun, 23 Oct 2016) --- src/gui/widget/msgbox.h | 192 ++++++++++++++++++++++++++++++++-------- 1 file changed, 156 insertions(+), 36 deletions(-) diff --git a/src/gui/widget/msgbox.h b/src/gui/widget/msgbox.h index eda0c941d..3c927f0fa 100644 --- a/src/gui/widget/msgbox.h +++ b/src/gui/widget/msgbox.h @@ -118,7 +118,50 @@ class CMsgBox : public CHintBox void initButtons(); public: - /* Constructor */ + /**CMsgBox Constructor + * @param[in] Text + * @li exepts type const char*, this is the message text inside the window, text is UTF-8 encoded + * @param[in] Title + * @li optional: exepts type const char*, default = NULL, this causes default title "Information" + * @param[in] Icon + * @li optional: exepts type const char*, defines the icon name on the left side of titlebar, default = NULL (non Icon) + * @param[in] Picon + * @li optional: exepts type const char*, defines the picon name on the left side of message text, default = NULL (non Icon) + * @param[in] Width + * @li optional: exepts type int, defines box width, default value = MSGBOX_MIN_WIDTH + * @param[in] Height + * @li optional: exepts type int, defines box width, default value = MSGBOX_MIN_HEIGHT + * @param[in] ShowButtons + * @li optional: exepts type int, defines which buttons are available on screen, default value = mbCancel + * @see setShowedButtons() + * @param[in] Default_result + * @li optional: exepts type int, defines default result value, default value = mbrCancel + * possible values are: + * mbrYes = 0, + * mbrNo = 1, + * mbrCancel = 2, + * mbrBack = 3, + * mbrOk = 4, + * mbrTimeout = 5, + * + * mbrNone = -1 + * @see setDefaultResult(), getResult(); getDefaultResult(), enableDefaultResultOnTimeOut() + * @param[in] text_mode + * @li optional: exepts type int, defines the text modes for embedded text lines + * Possible Modes defined in /gui/widget/textbox.h + * AUTO_WIDTH + * AUTO_HIGH + * SCROLL + * CENTER + * RIGHT + * TOP + * BOTTOM + * NO_AUTO_LINEBREAK + * AUTO_LINEBREAK_NO_BREAKCHARS + * NOTE: default parameter to find in macro DEFAULT_TEXT_MODE + * + * @see class CHintBox() + */ CMsgBox(const char* Text, const char* Title = NULL, const char* Icon = NULL, @@ -129,6 +172,50 @@ class CMsgBox : public CHintBox const msg_result_t& Default_result = mbrCancel, const int& Text_mode = DEFAULT_TEXT_MODE); + /**CMsgBox Constructor + * @param[in] Text + * @li exepts type const char*, this is the message text inside the window, text is UTF-8 encoded + * @param[in] Title + * @li optional: exepts type neutrino_locale_t with locale entry from /system/locals.h default = NONEXISTANT_LOCALE, this causes default title "Information" + * @param[in] Icon + * @li optional: exepts type const char*, defines the icon name on the left side of titlebar, default = NULL (non Icon) + * @param[in] Picon + * @li optional: exepts type const char*, defines the picon name on the left side of message text, default = NULL (non Icon) + * @param[in] Width + * @li optional: exepts type int, defines box width, default value = MSGBOX_MIN_WIDTH + * @param[in] Height + * @li optional: exepts type int, defines box width, default value = MSGBOX_MIN_HEIGHT + * @param[in] ShowButtons + * @li optional: exepts type int, defines which buttons are available on screen, default value = mbCancel + * @see setShowedButtons() + * @param[in] Default_result + * @li optional: exepts type int, defines default result value, default value = mbrCancel + * possible values are: + * mbrYes = 0, + * mbrNo = 1, + * mbrCancel = 2, + * mbrBack = 3, + * mbrOk = 4, + * mbrTimeout = 5, + * + * mbrNone = -1 + * @see setDefaultResult(), getResult(); getDefaultResult(), enableDefaultResultOnTimeOut() + * @param[in] text_mode + * @li optional: exepts type int, defines the text modes for embedded text lines + * Possible Modes defined in /gui/widget/textbox.h + * AUTO_WIDTH + * AUTO_HIGH + * SCROLL + * CENTER + * RIGHT + * TOP + * BOTTOM + * NO_AUTO_LINEBREAK + * AUTO_LINEBREAK_NO_BREAKCHARS + * NOTE: default parameter to find in macro DEFAULT_TEXT_MODE + * + * @see class CHintBox() + */ CMsgBox(const char* Text, const neutrino_locale_t locale_Title = NONEXISTANT_LOCALE, const char* Icon = NULL, @@ -140,54 +227,87 @@ class CMsgBox : public CHintBox const int& Text_mode = DEFAULT_TEXT_MODE); // ~CMsgBox(); //inherited - int exec(); + /** + * exec caller + * @return int + */ + int exec(); - ///returns current result as msg_result_t, result corresponds to the current result value of selected button - msg_result_t getResult(){return result;}; - ///returns current default result as msg_result_t, independently from current selected button result - msg_result_t getDefaultResult(){return default_result;}; - ///sets current default result as msg_result_t, independently from current selected button result + /** + * returns current result as msg_result_t, result corresponds to the current result value of selected button + * @return result as int + */ + + msg_result_t getResult(){return result;} + /** + * returns current default result as msg_result_t, independently from current selected button result + * @return result as int + */ + + msg_result_t getDefaultResult(){return default_result;} + /** + * sets current default result as msg_result_t, independently from current selected button result + * @param[in] Default_result + * @li exepts type msg_result_t + */ void setDefaultResult(const msg_result_t& Default_result){default_result = Default_result;} - /*! - Sets the displayed buttons. - This member allows to set and overrides already defined buttons from constructor, - parameter ''ShowButtons'' accepts given types, find under button_define_t enumeration - mbYes - mbNo - mbCancel - mbBack - mbOk - mbOKCancel - mbYesNoCancel - mbYesNo - mbAll + /** + * Sets the displayed buttons. + * This member allows to set and overrides already defined buttons from constructor, + * parameter ''ShowButtons'' accepts given types, find under button_define_t enumeration + * @param[in] ShowButtons + * @li optional: exepts type int, defines which buttons are available on screen, default value = mbCancel + * possible values are: + * mbYes = 0x01, + * mbNo = 0x02, + * mbCancel = 0x04, + * mbBack = 0x08, + * mbOk = 0x10, + * mbOKCancel = 0x20, + * mbYesNoCancel = 0x40, + * mbYesNo = 0x80, + * mbAll = 0x100, + * NOTE: allign parameters are currently not supported, these values are existing for compatibility only! */ void setShowedButtons(const int& ShowButtons){mb_show_button = ShowButtons; initButtons();} - ///define timeout, timeout is enabled if parmeter 1 > -1, otherwise it will be disabled, + /** + * define timeout, timeout is enabled if parmeter 1 > -1, otherwise it will be disabled, + * @param[in] Timeout + * @li exepts type int + */ void setTimeOut(const int& Timeout){timeout = Timeout;}; - ///enable/disable defined timeout, otherwise it will be ignored, parameter 1: bool default = true + + /** + * enable/disable defined timeout, otherwise it will be ignored + * @param[in] enable + * @li exepts type bool, default = true + */ void enableDefaultResultOnTimeOut(bool enable = true); - /*! - Default defined button text is already predefiend with parameter 'ShowButtons' from constructor. - This member allows to define an alternate text for an already defined button, - 1st parameter ''showed button'' accepts - mbYes - mbNo - mbCancel - mbBack - mbOk - others will be ignored! - 2nd parameter sets the new text for button as std::string. - Result values are not touched! + /** + * Default defined button text is already predefiend with parameter 'ShowButtons' from constructor. + * This member allows to define an alternate text for an already defined button, + * Result values are not touched! + * @param[in] showed_button + * @li exepts type int + * @see setShowedButtons() + * @param[in] text + * @li exepts type std::string, sets the new text for button */ void setButtonText(const int& showed_button, const std::string& text); - ///enables background of buttons, parameter bool show, default= true + /** + * enables background of buttons + * @param[in] enable + * @li exepts type bool, default = true + */ void enableButtonBg(bool enable = true); - ///disables background of buttons + + /** + * disables background of buttons + */ void disableButtonBg(){enableButtonBg(false);} // bool setText(const std::string* newText); From 23a56859aa71dc45848d85413438615804c1a22f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 25 Oct 2016 08:53:23 +0200 Subject: [PATCH 058/171] CHintBox: move showTimeOutBar() to protected, add params to enableTimeOutBar() Explicit call of disableTimeOutBar() after exec() is required to ensure we have no timebar opened objects. I'm not shure, but otherwise crashs could be possible. showTimeOutBar() is required for OnTimer(). It doesn't need any parameter. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a80b861cb50d4aa56f6f28f8924171f57477be27 Author: Thilo Graf Date: 2016-10-25 (Tue, 25 Oct 2016) --- src/gui/widget/hintbox.cpp | 24 +++++++++++++++--------- src/gui/widget/hintbox.h | 13 +++++++++++-- src/gui/widget/msgbox.cpp | 2 +- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index d5f80d796..0a0217fca 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -168,17 +168,21 @@ void CHintBox::init(const std::string& Text, const int& Width, const std::string CHintBox::~CHintBox() { - if(timeout_pb){ - timeout_pb->kill(); //ensure cleanup from screen - delete timeout_pb; timeout_pb = NULL; - } - if(timeout_pb_timer){ - delete timeout_pb_timer; timeout_pb_timer = NULL; - } + disableTimeOutBar(); } -void CHintBox::showTimeOutBar() +void CHintBox::enableTimeOutBar(bool enable) { + if(!enable){ + if(timeout_pb_timer){ + delete timeout_pb_timer; timeout_pb_timer = NULL; + } + if(timeout_pb){ + delete timeout_pb; timeout_pb = NULL; + } + return; + } + if(timeout_pb){ timeout_pb->paint0(); timeout_pb->setValues(timeout_pb->getValue()+1, 100*timeout); @@ -201,7 +205,7 @@ int CHintBox::exec() uint64_t timeoutEnd = CRCInput::calcTimeoutEnd( timeout ); if (timeout > 0) - showTimeOutBar(); + enableTimeOutBar(); while ( ! ( res & ( messages_return::cancel_info | messages_return::cancel_all ) ) ) { @@ -244,6 +248,8 @@ int CHintBox::exec() } } } + + disableTimeOutBar(); return res; } diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index e7a066161..3f5a35724 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -84,6 +84,7 @@ class CHintBox : public CComponentsWindow const int& indent); virtual void ReSize(); + void showTimeOutBar(){enableTimeOutBar();} public: /**CHintBox Constructor @@ -186,9 +187,17 @@ class CHintBox : public CComponentsWindow virtual void setTimeOut(const int& Timeout){timeout = Timeout;} /** - * enable visualized timeout as progressbar under titelbar + * enable/disable visualized timeout as progressbar under titlebar + * @param[in] enable + * @li optional: exepts type bool, default = true */ - void showTimeOutBar(); + void enableTimeOutBar(bool enable = true); + + /** + * disable visualized timeout as progressbar + * @see enableTimeOutBar + */ + void disableTimeOutBar(){enableTimeOutBar(false);} /** * scroll handler for text objects: NOTE: exec() must be called ! diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index dfe855cad..0c08d924c 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -223,7 +223,7 @@ int CMsgBox::exec() uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(timeout); if (timeout > 0) - showTimeOutBar(); + enableTimeOutBar(); bool loop = true; while (loop) From 1b71ff63e9ce42be62982a23b63508f1f8d9b254 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 26 Oct 2016 07:46:41 +0200 Subject: [PATCH 059/171] CMsgBox: add missing disableTimeOutBar() addendum to CHintBox: move showTimeOutBar() to protected, add params to enableTimeOutBar() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3a6f9e5ffa69171fc7afa70e7452df220016d51e Author: Thilo Graf Date: 2016-10-26 (Wed, 26 Oct 2016) --- src/gui/widget/msgbox.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 0c08d924c..7ed4f207c 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -304,6 +304,7 @@ int CMsgBox::exec() } } + disableTimeOutBar(); return res; } From 87b0dfa6dfb0318ce3ac93a8b2631522f61b7ef1 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 26 Oct 2016 09:18:29 +0200 Subject: [PATCH 060/171] CNeutrinoApp: add missing hide() Hintbox was not removed from scrren after paint. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ca97793ef0e5e3089654aaa68894255c73289ae3 Author: Thilo Graf Date: 2016-10-26 (Wed, 26 Oct 2016) --- src/neutrino.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 6ac3c30cf..f295fde90 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2681,8 +2681,8 @@ _repeat: } if (channels_changed || favorites_changed || bouquets_changed || channels_init) { neutrino_locale_t loc = channels_init ? LOCALE_SERVICEMENU_RELOAD_HINT : LOCALE_BOUQUETEDITOR_SAVINGCHANGES; - CHintBox* hintBox= new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(loc)); - hintBox->paint(); + CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(loc)); + hintBox.paint(); if (favorites_changed) { g_bouquetManager->saveUBouquets(); @@ -2710,7 +2710,7 @@ _repeat: if(!live_channel_id) live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); adjustToChannelID(live_channel_id);//FIXME what if deleted ? - delete hintBox; + hintBox.hide(); } if (g_settings.easymenu) { CBouquetList * blist = (mode == mode_radio) ? RADIOfavList : TVfavList; From e216fc68241bbcf7c1f665f08acb67b3f9900938 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 26 Oct 2016 10:23:40 +0200 Subject: [PATCH 061/171] Includes: remove unused includes Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e19536fe9933afc9c3c5084012698d1819c50a83 Author: Thilo Graf Date: 2016-10-26 (Wed, 26 Oct 2016) --- src/gui/cam_menu.cpp | 2 +- src/gui/followscreenings.cpp | 2 +- src/gui/lua/luainstance.cpp | 2 +- src/gui/plugins.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/cam_menu.cpp b/src/gui/cam_menu.cpp index da9c5723a..28c195ee5 100644 --- a/src/gui/cam_menu.cpp +++ b/src/gui/cam_menu.cpp @@ -41,7 +41,7 @@ #include #include "widget/icons.h" #include "widget/stringinput.h" -#include "widget/messagebox.h" + #include "widget/progresswindow.h" #include diff --git a/src/gui/followscreenings.cpp b/src/gui/followscreenings.cpp index f8a63edf0..eb77e989c 100644 --- a/src/gui/followscreenings.cpp +++ b/src/gui/followscreenings.cpp @@ -42,7 +42,7 @@ #include #include #include -#include + #include #include diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index e7e0b80bc..ea7eb8bb3 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -30,7 +30,7 @@ #include #include #include -#include + #include #include #include diff --git a/src/gui/plugins.cpp b/src/gui/plugins.cpp index 1a8bb2fee..9f0b5f29e 100644 --- a/src/gui/plugins.cpp +++ b/src/gui/plugins.cpp @@ -58,7 +58,7 @@ #include #include "widget/shellwindow.h" -#include "widget/messagebox.h" + #include #include #include From faa780b9bcd0ac17bb5792c773e0c5db9586de3f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 26 Oct 2016 10:24:24 +0200 Subject: [PATCH 062/171] Clean up: remove unused files Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d2038a499e1380834d5d3b15c34394a557bd5064 Author: Thilo Graf Date: 2016-10-26 (Wed, 26 Oct 2016) --- src/gui/widget/hintboxext.cpp | 378 ---------------------------------- src/gui/widget/hintboxext.h | 90 -------- src/gui/widget/messagebox.cpp | 349 ------------------------------- src/gui/widget/messagebox.h | 119 ----------- 4 files changed, 936 deletions(-) delete mode 100644 src/gui/widget/hintboxext.cpp delete mode 100644 src/gui/widget/hintboxext.h delete mode 100644 src/gui/widget/messagebox.cpp delete mode 100644 src/gui/widget/messagebox.h diff --git a/src/gui/widget/hintboxext.cpp b/src/gui/widget/hintboxext.cpp deleted file mode 100644 index ea89a0f1b..000000000 --- a/src/gui/widget/hintboxext.cpp +++ /dev/null @@ -1,378 +0,0 @@ -/* - Neutrino-GUI - DBoxII-Project - - Copyright (C) 2001 Steffen Hehn 'McClean' - Homepage: http://dbox.cyberphoria.org/ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - - - License: GPL - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - -#include -#include -#include -#include - -#include - -CHintBoxExt::CHintBoxExt(const neutrino_locale_t Caption, const char * const Text, const int Width, const char * const Icon) -{ - m_message = strdup(Text); - - char *begin = strtok(m_message, "\n"); - while (begin != NULL) - { - std::vector oneLine; - std::string s(begin); - DText *d = new DText(s); - oneLine.push_back(d); - m_lines.push_back(oneLine); - begin = strtok(NULL, "\n"); - } - m_bbheight = 0; - init(Caption, "", Width, Icon); -} - -CHintBoxExt::CHintBoxExt(const std::string &CaptionString, const char * const Text, const int Width, const char * const Icon) -{ - m_message = strdup(Text); - - char *begin = strtok(m_message, "\n"); - while (begin != NULL) - { - std::vector oneLine; - std::string s(begin); - DText *d = new DText(s); - oneLine.push_back(d); - m_lines.push_back(oneLine); - begin = strtok(NULL, "\n"); - } - m_bbheight = 0; - init(NONEXISTANT_LOCALE, CaptionString, Width, Icon); -} - -CHintBoxExt::CHintBoxExt(const neutrino_locale_t Caption, ContentLines& lines, const int Width, const char * const Icon) -{ - m_message = NULL; - m_lines = lines; - m_bbheight = 0; - init(Caption, "", Width, Icon); -} - -CHintBoxExt::CHintBoxExt(const std::string &CaptionString, ContentLines& lines, const int Width, const char * const Icon) -{ - m_message = NULL; - m_lines = lines; - m_bbheight = 0; - init(NONEXISTANT_LOCALE, CaptionString, Width, Icon); -} - -CHintBoxExt::~CHintBoxExt(void) -{ - if (m_window != NULL) - { - delete m_window; - m_window = NULL; - } - if (m_message != NULL) { - free(m_message); - - // content has been set using "m_message" so we are responsible to - // delete it - for (ContentLines::iterator it = m_lines.begin(); - it != m_lines.end(); ++it) - { - for (std::vector::iterator it2 = it->begin(); - it2 != it->end(); ++it2) - { - //(*it2)->print(); - delete *it2; - } - } - } -} - -void CHintBoxExt::init(const neutrino_locale_t Caption, const std::string &CaptionString, const int Width, const char * const Icon) -{ - m_width = Width; - int nw = 0; - m_theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); - m_fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); - m_height = m_theight + m_fheight; - m_maxEntriesPerPage = 0; - int maxLineWidth = 0; - int scrollWidth = 0; - textStartX = 0; - bgPainted = false; - - m_caption = Caption; - m_captionString = CaptionString; - - int page = 0; - int line = 0; - int maxWidth = m_width > 0 ? m_width : 0; - int maxOverallHeight = 0; - int screenheight = CFrameBuffer::getInstance()->getScreenHeight() * 9 / 10 - m_bbheight; - m_startEntryOfPage.clear(); - m_startEntryOfPage.push_back(0); - for (ContentLines::iterator it = m_lines.begin(); it!=m_lines.end(); ++it) - { - bool pagebreak = false; - int maxHeight = 0; - int lineWidth = 0; - for (std::vector::iterator item = it->begin(); - item != it->end(); ++item) { - if ((*item)->getHeight() > maxHeight) - maxHeight = (*item)->getHeight(); - lineWidth += (*item)->getWidth(); - if ((*item)->getType() == Drawable::DTYPE_PAGEBREAK) - pagebreak = true; - } - maxLineWidth = std::max(maxLineWidth, lineWidth); - if (lineWidth > maxWidth) - maxWidth = lineWidth; - m_height += maxHeight; - if (m_height > screenheight || pagebreak) { - if (m_height-maxHeight > maxOverallHeight) - maxOverallHeight = m_height - maxHeight; - m_height = m_theight + m_fheight + maxHeight; - if (pagebreak) - m_startEntryOfPage.push_back(line+1); - else - m_startEntryOfPage.push_back(line); - page++; - if (m_maxEntriesPerPage < (m_startEntryOfPage[page] - m_startEntryOfPage[page-1])) - { - m_maxEntriesPerPage = m_startEntryOfPage[page] - m_startEntryOfPage[page-1]; - } - } - else { - if (m_height > maxOverallHeight) - maxOverallHeight = m_height; - m_maxEntriesPerPage = maxOverallHeight / m_fheight; - } - line++; - } - - // if there is only one page m_height is already correct - // but m_maxEntries has not been set - if (m_startEntryOfPage.size() > 1) - { - m_height = maxOverallHeight; - } else { - m_maxEntriesPerPage = line; - } - - m_startEntryOfPage.push_back(line+1); // needed to calculate amount of items on last page - -// for (std::vector::iterator it=m_startEntryOfPage.begin(); -// it!=m_startEntryOfPage.end();it++) -// printf("startentryofpage: %d\n",*it); -// printf("pages: %d, startEntryVec: %d\n",page+1,m_startEntryOfPage.size()-1); -// printf("maxEntries: %d\n", m_maxEntriesPerPage); - - m_width = w_max(maxWidth,OFFSET_SHADOW); - m_currentPage = 0; - m_pages = page + 1; - unsigned int additional_width; - - if (has_scrollbar()) - scrollWidth = 15; - else - scrollWidth = 0; - additional_width = 30 + scrollWidth; - m_width += additional_width; - - if (Icon != NULL) - { - m_iconfile = Icon; - additional_width += 30; - } - else - m_iconfile = ""; - - const char *l_caption = (m_caption == NONEXISTANT_LOCALE) ? m_captionString.c_str() : g_Locale->getText(m_caption); - nw = additional_width + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(l_caption); - - if (nw > m_width) - m_width = nw; - - /* if the output does not fit, make sure we at least - * stay inside the screen... */ - m_width = w_max(m_width ,OFFSET_SHADOW); - if (maxLineWidth + scrollWidth > m_width) - maxLineWidth = m_width - scrollWidth; - - textStartX = (m_width - scrollWidth - maxLineWidth) / 2; - - m_window = NULL; -} - -void CHintBoxExt::paint(bool toround) -{ - if (m_window != NULL) - { - /* - * do not paint stuff twice: - * => thread safety needed by movieplayer.cpp: - * one thread calls our paint method, the other one our hide method - * => no memory leaks - */ - return; - } - - bgPainted = false; - m_window = new CFBWindow(getScreenStartX(m_width + OFFSET_SHADOW), - getScreenStartY(m_height + OFFSET_SHADOW), - m_width + OFFSET_SHADOW, - m_height + OFFSET_SHADOW); - - refresh(toround); -} - -void CHintBoxExt::refresh(bool toround) -{ - if (m_window == NULL) - { - return; - } - - if (!bgPainted) { - // bottom, right shadow - m_window->paintBoxRel(OFFSET_SHADOW, OFFSET_SHADOW, m_width, m_height, COL_SHADOW_PLUS_0, RADIUS_LARGE, toround ? CORNER_ALL : CORNER_BOTTOM | CORNER_TOP_RIGHT); - bgPainted = true; - } - - std::string title_text = (m_caption == NONEXISTANT_LOCALE) ? m_captionString : g_Locale->getText(m_caption); - CComponentsHeader header(m_window->x, m_window->y, m_width, m_theight, title_text, m_iconfile); - header.paint(CC_SAVE_SCREEN_NO); -#if 0 - // title bar - m_window->paintBoxRel(0, 0, m_width, m_theight, (CFBWindow::color_t)COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round - - // icon - int x_offset = 6, icon_space = x_offset, x_text; - const char *title_text = (m_caption == NONEXISTANT_LOCALE) ? m_captionString.c_str() : g_Locale->getText(m_caption); - - if (!m_iconfile.empty()) - { - int w, h; - CFrameBuffer::getInstance()->getIconSize(m_iconfile.c_str(), &w, &h); - icon_space = w + 2*x_offset; - int y_icon = 0+ (m_theight >> 1) - (h >> 1); - m_window->paintIcon(m_iconfile.c_str(), x_offset, y_icon); - x_text = icon_space; - } - else - x_text = x_offset; - - // title text - m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], x_text, m_theight, m_width, title_text, COL_MENUHEAD_TEXT); -#endif - // background of text panel - m_window->paintBoxRel(0, m_theight, m_width, (m_maxEntriesPerPage + 1) * m_fheight, (CFBWindow::color_t)COL_MENUCONTENT_PLUS_0, toround ? RADIUS_LARGE : 0, CORNER_BOTTOM);//round - - int yPos = m_theight + (m_fheight >> 1); - -// for(std::vector::iterator it = m_startEntryOfPage.begin(); -// it != m_startEntryOfPage.end();it++) { -// printf(" %d",*it); -// } -// printf("\n current page: %d lines %d ",m_currentPage, m_lines.size()); -// printf("start %d bis %d\n",m_startEntryOfPage[m_currentPage],m_startEntryOfPage[m_currentPage+1]-1); - -#if 0 - for (ContentLines::iterator it = m_lines.begin() + m_startEntryOfPage[m_currentPage]; - it != m_lines.begin() + m_startEntryOfPage[m_currentPage+1] - && it != m_lines.end(); ++it) -#endif - for (int count = 0; count < (int) m_lines.size(); count++) - { - if ((count >= m_startEntryOfPage[m_currentPage]) && - (count < m_startEntryOfPage[m_currentPage+1])) - { - int xPos = textStartX; - int maxHeight = 0; - for (std::vector::iterator d = m_lines[count].begin(); d != m_lines[count].end(); ++d) - { - // (*d)->print(); - // printf("\n"); - //(*d)->draw(m_window,xPos,yPos,m_width); - (*d)->draw(m_window,xPos,yPos,m_width-20); - xPos += (*d)->getWidth() + 20; - if ((*d)->getHeight() > maxHeight) - maxHeight = (*d)->getHeight(); - } - yPos += maxHeight; - } - } - - if (has_scrollbar()) - { -// yPos = m_theight + (m_fheight >> 1); - yPos = m_theight; - m_window->paintBoxRel(m_width - 15, yPos, 15, m_maxEntriesPerPage * m_fheight, COL_SCROLLBAR_PASSIVE_PLUS_0); - unsigned int marker_size = (m_maxEntriesPerPage * m_fheight) / m_pages; - m_window->paintBoxRel(m_width - 13, yPos + m_currentPage * marker_size, 11, marker_size, COL_SCROLLBAR_ACTIVE_PLUS_0); - } -} - -bool CHintBoxExt::has_scrollbar(void) -{ - return (m_startEntryOfPage.size() > 2); -} - -void CHintBoxExt::scroll_up(void) -{ - if (m_currentPage > 0) - { - m_currentPage--; - refresh(); - } -} - -void CHintBoxExt::scroll_down(void) -{ - if (m_currentPage +1 < m_startEntryOfPage.size()-1) - { - m_currentPage++; - refresh(); - } -} - -void CHintBoxExt::hide(void) -{ - if (m_window != NULL) - { - delete m_window; - m_window = NULL; - } -} diff --git a/src/gui/widget/hintboxext.h b/src/gui/widget/hintboxext.h deleted file mode 100644 index 445c2aaeb..000000000 --- a/src/gui/widget/hintboxext.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - Neutrino-GUI - DBoxII-Project - - Copyright (C) 2001 Steffen Hehn 'McClean' - Homepage: http://dbox.cyberphoria.org/ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - - - License: GPL - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - - -#ifndef __hintboxext__ -#define __hintboxext__ - -#include -#include - -#include -#include - -#include -#include - -class CHintBoxExt -{ - protected: - - CFBWindow * m_window; - - unsigned int m_currentPage; - std::vector m_startEntryOfPage; - int m_maxEntriesPerPage; - int m_pages; - - int m_width; - int m_height; - int m_bbheight; /* a button bar at the bottom? */ - int textStartX; - - int m_fheight; - int m_theight; - neutrino_locale_t m_caption; - std::string m_captionString; - char * m_message; - ContentLines m_lines; - std::string m_iconfile; - bool bgPainted; - - void refresh(bool toround = 1); - - public: - CHintBoxExt(const neutrino_locale_t Caption, const char * const Text, const int Width, const char * const Icon); - CHintBoxExt(const neutrino_locale_t Caption, ContentLines& lines, const int Width = 450, const char * const Icon = NEUTRINO_ICON_INFO); - CHintBoxExt(const std::string &Caption, const char * const Text, const int Width, const char * const Icon); - CHintBoxExt(const std::string &Caption, ContentLines& lines, const int Width = 450, const char * const Icon = NEUTRINO_ICON_INFO); - - ~CHintBoxExt(void); - - void init(const neutrino_locale_t Caption, const std::string &CaptionString, const int Width, const char * const Icon); - - bool has_scrollbar(void); - void scroll_up(void); - void scroll_down(void); - - void paint(bool toround = 1); - void hide(void); -}; - -#endif diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp deleted file mode 100644 index ea416384c..000000000 --- a/src/gui/widget/messagebox.cpp +++ /dev/null @@ -1,349 +0,0 @@ -/* - Neutrino-GUI - DBoxII-Project - - Copyright (C) 2001 Steffen Hehn 'McClean' - Homepage: http://dbox.cyberphoria.org/ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - - - License: GPL - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - -#include -#include -#include -#include - -CMessageBox::CMessageBox(const neutrino_locale_t Caption, const char * const Text, const int Width, const char * const Icon, const CMessageBox::result_ &Default, const uint32_t ShowButtons) : CHintBoxExt(Caption, Text, Width, Icon) -{ - Init(Default, ShowButtons); -} - -CMessageBox::CMessageBox(const neutrino_locale_t Caption, ContentLines& Lines, const int Width, const char * const Icon, const CMessageBox::result_ &Default, const uint32_t ShowButtons) : CHintBoxExt(Caption, Lines, Width, Icon) -{ - Init(Default, ShowButtons); -} - -CMessageBox::CMessageBox(const std::string &Caption, const char * const Text, const int Width, const char * const Icon, const CMessageBox::result_ &Default, const uint32_t ShowButtons) : CHintBoxExt(Caption, Text, Width, Icon) -{ - Init(Default, ShowButtons); -} - -CMessageBox::CMessageBox(const std::string &Caption, ContentLines& Lines, const int Width, const char * const Icon, const CMessageBox::result_ &Default, const uint32_t ShowButtons) : CHintBoxExt(Caption, Lines, Width, Icon) -{ - Init(Default, ShowButtons); -} - -void CMessageBox::Init(const CMessageBox::result_ &Default, const uint32_t ShowButtons) -{ -#define BtnCount 3 - returnDefaultOnTimeout = false; - ButtonSpacing = 15; - int w = 0, h = 0, ih = 0; - i_maxw = 0; - std::string Btns[BtnCount] = {NEUTRINO_ICON_BUTTON_RED, NEUTRINO_ICON_BUTTON_GREEN, NEUTRINO_ICON_BUTTON_HOME}; - for (int i = 0; i < BtnCount; i++) { - CFrameBuffer::getInstance()->getIconSize(Btns[i].c_str(), &w, &h); - ih = std::max(h, ih); - i_maxw = std::max(w, i_maxw); - } - fh = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight(); - b_height = std::max(fh, ih) + 8 + (RADIUS_MID / 2); - m_bbheight = b_height + fh/2 + ButtonSpacing + OFFSET_SHADOW; - result = Default; - b_width = getButtonWidth(); - if (ShowButtons & CMessageBox::mbBtnAlignCenter1) - mbBtnAlign = CMessageBox::mbBtnAlignCenter1; // centered, large distances - else if (ShowButtons & CMessageBox::mbBtnAlignCenter2) - mbBtnAlign = CMessageBox::mbBtnAlignCenter2; // centered, small distances - else if (ShowButtons & CMessageBox::mbBtnAlignLeft) - mbBtnAlign = CMessageBox::mbBtnAlignLeft; - else if (ShowButtons & CMessageBox::mbBtnAlignRight) - mbBtnAlign = CMessageBox::mbBtnAlignRight; - else - mbBtnAlign = CMessageBox::mbBtnAlignCenter1; // or g_settings.mbBtnAlign? ;-) - showbuttons = ShowButtons & 0xFF; - - ButtonCount = 0; - if (showbuttons & mbYes) { - Buttons[ButtonCount].icon = NEUTRINO_ICON_BUTTON_RED; - Buttons[ButtonCount].text = g_Locale->getText(LOCALE_MESSAGEBOX_YES); - ButtonCount++; - } - if (showbuttons & mbNo) { - Buttons[ButtonCount].icon = NEUTRINO_ICON_BUTTON_GREEN; - Buttons[ButtonCount].text = g_Locale->getText(LOCALE_MESSAGEBOX_NO); - ButtonCount++; - } - if (showbuttons & (mbCancel | mbBack | mbOk)) { - Buttons[ButtonCount].icon = NEUTRINO_ICON_BUTTON_HOME; - Buttons[ButtonCount].text = g_Locale->getText((showbuttons & mbCancel) ? LOCALE_MESSAGEBOX_CANCEL : (showbuttons & mbOk) ? LOCALE_MESSAGEBOX_OK : LOCALE_MESSAGEBOX_BACK); - ButtonCount++; - } - - ButtonDistance = ButtonSpacing; - bb_width = b_width * ButtonCount + ButtonDistance * (ButtonCount - 1); - if(bb_width > m_width) - m_width = bb_width; /* FIXME: what if bigger than screen area? */ - else - if (mbBtnAlign == CMessageBox::mbBtnAlignCenter1) - ButtonDistance = (m_width - b_width * ButtonCount) / (ButtonCount + 1); - - /* this is ugly: re-init (CHintBoxExt) to recalculate the number of lines and pages */ - init(m_caption, m_captionString, m_width, m_iconfile.empty() ? NULL : m_iconfile.c_str()); - m_height += m_bbheight; -} - -void CMessageBox::returnDefaultValueOnTimeout(bool returnDefault) -{ - returnDefaultOnTimeout = returnDefault; -} - -int CMessageBox::getButtonWidth() -{ -#define localeMsgCount 5 - neutrino_locale_t localeMsg[localeMsgCount] = {LOCALE_MESSAGEBOX_YES, LOCALE_MESSAGEBOX_NO, LOCALE_MESSAGEBOX_CANCEL, LOCALE_MESSAGEBOX_OK, LOCALE_MESSAGEBOX_BACK}; - int MaxButtonTextWidth = 0; - for (int i = 0; i < localeMsgCount; i++) - MaxButtonTextWidth = std::max(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getRenderWidth(g_Locale->getText(localeMsg[i])), MaxButtonTextWidth); - return MaxButtonTextWidth + i_maxw + 36 + (RADIUS_LARGE / 2); -} - -void CMessageBox::paintButtons() -{ - fb_pixel_t color; - fb_pixel_t bgcolor; - int iw, ih, i; - - int xpos = (m_width - bb_width) / 2; - if (mbBtnAlign == CMessageBox::mbBtnAlignCenter1) - xpos = ButtonDistance; - else if (mbBtnAlign == CMessageBox::mbBtnAlignCenter2) - xpos = (m_width - bb_width) / 2; - else if (mbBtnAlign == CMessageBox::mbBtnAlignLeft) - xpos = ButtonSpacing; - else if (mbBtnAlign == CMessageBox::mbBtnAlignRight) - xpos = m_width - bb_width - ButtonSpacing; - - int ypos = (m_height - m_bbheight) + fh/2; - - m_window->paintBoxRel(0, m_height - m_bbheight, m_width, m_bbheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); - - i = 0; - if (showbuttons & mbYes) { - Buttons[i].def = (result == mbrYes) ? true : false; - i++; - } - if (showbuttons & mbNo) { - Buttons[i].def = (result == mbrNo) ? true : false; - i++; - } - if (showbuttons & (mbCancel | mbBack | mbOk)) - Buttons[i].def = (result >= mbrCancel) ? true : false; - - for (i = 0; i < ButtonCount; i++) { - if (Buttons[i].def) { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } else { - color = COL_MENUCONTENTINACTIVE_TEXT; - bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; - } - CFrameBuffer::getInstance()->getIconSize(Buttons[i].icon, &iw, &ih); - m_window->paintBoxRel(xpos + OFFSET_SHADOW, ypos + OFFSET_SHADOW, b_width, b_height, COL_SHADOW_PLUS_0, RADIUS_MID); - m_window->paintBoxRel(xpos, ypos, b_width, b_height, (CFBWindow::color_t)bgcolor, RADIUS_MID); - m_window->paintBoxFrame(xpos, ypos, b_width, b_height, 1, COL_SHADOW_PLUS_0, RADIUS_MID); - m_window->paintIcon(Buttons[i].icon, xpos + ((b_height - ih) / 2), ypos + ((b_height - ih) / 2), ih); - m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT], xpos + iw + 17, ypos + fh + ((b_height - fh) / 2), - b_width - (iw + 21), Buttons[i].text, (CFBWindow::color_t)color); - xpos += b_width + ButtonDistance; - } -} - -int CMessageBox::exec(int timeout) -{ - neutrino_msg_t msg; - neutrino_msg_data_t data; - - int res = menu_return::RETURN_REPAINT; - - CHintBoxExt::paint(0); - - if (m_window == NULL) - { - return res; /* out of memory */ - } - - paintButtons(); - - if ( timeout == -1 ) - timeout = g_settings.timing[SNeutrinoSettings::TIMING_EPG]; - - uint64_t timeoutEnd = CRCInput::calcTimeoutEnd( timeout ); - - bool loop=true; - while (loop) - { - g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd ); - if (msg == CRCInput::RC_timeout && returnDefaultOnTimeout) - { - // return default - loop = false; - } - else if (((msg == CRCInput::RC_timeout) || - (msg == (neutrino_msg_t)g_settings.key_channelList_cancel)) && - (showbuttons & (mbCancel | mbBack | mbOk))) - { - result = (showbuttons & mbCancel) ? mbrCancel : (showbuttons & mbOk) ? mbrOk: mbrBack; - loop = false; - } - else if ((msg == CRCInput::RC_green) && (showbuttons & mbNo)) - { - result = mbrNo; - loop = false; - } - else if ((msg == CRCInput::RC_red) && (showbuttons & mbYes)) - { - result = mbrYes; - loop = false; - } - else if(msg==CRCInput::RC_right && ButtonCount > 1) - { - bool ok = false; - while (!ok) - { - result = (CMessageBox::result_)((result + 1) & 3); - ok = showbuttons & (1 << result); - } - - paintButtons(); - } - else if (has_scrollbar() && ((msg == CRCInput::RC_up) || (msg == CRCInput::RC_down))) - { - if (msg == CRCInput::RC_up) - { - scroll_up(); - paintButtons(); - } - else - { - scroll_down(); - paintButtons(); - } - } - else if(msg==CRCInput::RC_left && ButtonCount > 1) - { - bool ok = false; - while (!ok) - { - result = (CMessageBox::result_)((result - 1) & 3); - ok = showbuttons & (1 << result); - } - - paintButtons(); - - } - else if(msg == CRCInput::RC_ok) - { - loop = false; - } - else if (CNeutrinoApp::getInstance()->listModeKey(msg) || (msg == CRCInput::RC_spkr)) - { - // do nothing - } - else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) - { - res = menu_return::RETURN_EXIT_ALL; - loop = false; - } - - } - - hide(); - - return res; -} - -int ShowMsg(const neutrino_locale_t Caption, const char * const Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) -{ - std::string tmpText = "msg error"; - if(Text) - tmpText = Text; - CMessageBox* messageBox = new CMessageBox(Caption, tmpText.c_str(), Width, Icon, Default, ShowButtons); - messageBox->returnDefaultValueOnTimeout(returnDefaultOnTimeout); - messageBox->exec(timeout); - int res = messageBox->result; - delete messageBox; - - return res; -} - -int ShowMsg(const std::string &Caption, const char * const Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) -{ - std::string tmpText = "msg error"; - if(Text) - tmpText = Text; - CMessageBox* messageBox = new CMessageBox(Caption, tmpText.c_str(), Width, Icon, Default, ShowButtons); - messageBox->returnDefaultValueOnTimeout(returnDefaultOnTimeout); - messageBox->exec(timeout); - int res = messageBox->result; - delete messageBox; - - return res; -} - -int ShowMsg(const neutrino_locale_t Caption, const neutrino_locale_t Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) -{ - return ShowMsg(Caption, g_Locale->getText(Text), Default, ShowButtons, Icon, Width, timeout, returnDefaultOnTimeout); -} - -int ShowMsg(const std::string &Caption, const neutrino_locale_t Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) -{ - return ShowMsg(Caption, g_Locale->getText(Text), Default, ShowButtons, Icon, Width, timeout, returnDefaultOnTimeout); -} - -int ShowMsg(const neutrino_locale_t Caption, const std::string & Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) -{ - return ShowMsg(Caption, Text.c_str(), Default, ShowButtons, Icon, Width, timeout,returnDefaultOnTimeout); -} - -int ShowMsg(const std::string &Caption, const std::string & Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) -{ - return ShowMsg(Caption, Text.c_str(), Default, ShowButtons, Icon, Width, timeout,returnDefaultOnTimeout); -} - -// void DisplayErrorMessage(const char * const ErrorMsg) -// { -// ShowMsg(LOCALE_MESSAGEBOX_ERROR, ErrorMsg, CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); -// } -// -// void DisplayInfoMessage(const char * const ErrorMsg) -// { -// ShowMsg(LOCALE_MESSAGEBOX_INFO, ErrorMsg, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); -// } diff --git a/src/gui/widget/messagebox.h b/src/gui/widget/messagebox.h deleted file mode 100644 index 8604efe76..000000000 --- a/src/gui/widget/messagebox.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - Neutrino-GUI - DBoxII-Project - - Copyright (C) 2001 Steffen Hehn 'McClean' - Homepage: http://dbox.cyberphoria.org/ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - - - License: GPL - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - - -#ifndef __messagebox__ -#define __messagebox__ - -#include - -#include -#include - -#define MaxButtons 3 - -class CMessageBox : public CHintBoxExt -{ - private: - struct mbButtons - { - bool def; - const char* icon; - const char* text; - }; - struct mbButtons Buttons[MaxButtons]; - - int showbuttons; - bool returnDefaultOnTimeout; - int mbBtnAlign; - int ButtonSpacing, ButtonDistance; - int fh, i_maxw; - int b_height, b_width, bb_width; - int ButtonCount; - - void paintButtons(); - int getButtonWidth(); - - public: - enum result_ - { - mbrYes = 0, - mbrNo = 1, - mbrCancel = 2, - mbrBack = 3, - mbrOk = 4 - } result; - - enum buttons_ - { - mbYes = 0x01, - mbNo = 0x02, - mbCancel = 0x04, - mbAll = 0x07, - mbBack = 0x08, - mbOk = 0x10, - mbBtnAlignCenter1 = 0x0100, /* centered, large distances */ - mbBtnAlignCenter2 = 0x0200, /* centered, small distances */ - mbBtnAlignLeft = 0x0400, - mbBtnAlignRight = 0x0800 - } buttons; - - // Text & Caption are always UTF-8 encoded - CMessageBox(const neutrino_locale_t Caption, const char * const Text, const int Width = 500, const char * const Icon = NULL, const CMessageBox::result_ &Default = mbrYes, const uint32_t ShowButtons = mbAll); - CMessageBox(const std::string &Caption, const char * const Text, const int Width = 500, const char * const Icon = NULL, const CMessageBox::result_ &Default = mbrYes, const uint32_t ShowButtons = mbAll); - CMessageBox(const neutrino_locale_t Caption, ContentLines& Lines, const int Width = 500, const char * const Icon = NULL, const CMessageBox::result_ &Default = mbrYes, const uint32_t ShowButtons = mbAll); - CMessageBox(const std::string &Caption, ContentLines& Lines, const int Width = 500, const char * const Icon = NULL, const CMessageBox::result_ &Default = mbrYes, const uint32_t ShowButtons = mbAll); - - int exec(int timeout = -1); - void returnDefaultValueOnTimeout(bool returnDefault); - - private: - void Init(const CMessageBox::result_ &Default, const uint32_t ShowButtons); -}; - -// Text is always UTF-8 encoded -int ShowMsg(const neutrino_locale_t Caption, const char * const Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = 450, const int timeout = -1, bool returnDefaultOnTimeout = false); // UTF-8 -int ShowMsg(const neutrino_locale_t Caption, const std::string & Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = 450, const int timeout = -1, bool returnDefaultOnTimeout = false); // UTF-8 -int ShowMsg(const neutrino_locale_t Caption, const neutrino_locale_t Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = 450, const int timeout = -1, bool returnDefaultOnTimeout = false); // UTF-8 -int ShowMsg(const std::string &Caption, const char * const Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = 450, const int timeout = -1, bool returnDefaultOnTimeout = false); // UTF-8 -int ShowMsg(const std::string &Caption, const std::string & Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = 450, const int timeout = -1, bool returnDefaultOnTimeout = false); // UTF-8 -int ShowMsg(const std::string &Caption, const neutrino_locale_t Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = 450, const int timeout = -1, bool returnDefaultOnTimeout = false); // UTF-8 - -#if 0 -void DisplayErrorMessage(const char * const ErrorMsg); // UTF-8 -void DisplayErrorMessage(const char * const ErrorMsg, const neutrino_locale_t Caption); // UTF-8 -void DisplayErrorMessage(const char * const ErrorMsg, const std::string &Caption); // UTF-8 -void DisplayInfoMessage(const char * const InfoMsg); // UTF-8 -void DisplayInfoMessage(const char * const InfoMsg, const neutrino_locale_t Caption); // UTF-8 -void DisplayInfoMessage(const char * const InfoMsg, const std::string &Caption); // UTF-8 -#endif - -#endif From b07cc5fa9655fb63efd84263230013c066c24bec Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 27 Oct 2016 12:08:32 +0200 Subject: [PATCH 063/171] CMsgBox: add option for No Yes button arrangement Useful if order of red and green buttons must be changed. Return values are untouched. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f1e4723964daa476a99024485c2725ac38b2341e Author: Thilo Graf Date: 2016-10-27 (Thu, 27 Oct 2016) --- src/gui/widget/msgbox.cpp | 16 ++++++++++++++++ src/gui/widget/msgbox.h | 6 ++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 7ed4f207c..369be51bf 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -179,6 +179,22 @@ void CMsgBox::initButtons() btn.btn_alias = mbBack; v_buttons.push_back(btn); } + if (mb_show_button & mbNoYes){ + btn.button = NEUTRINO_ICON_BUTTON_GREEN; + btn.text = BTN_TEXT(mbNo); + btn.directKey = CRCInput::RC_green; + btn.directKeyAlt = CRCInput::RC_home; + btn.btn_result = mbrNo; + btn.btn_alias = mbNo; + v_buttons.push_back(btn); + btn.button = NEUTRINO_ICON_BUTTON_RED; + btn.text = BTN_TEXT(mbYes); + btn.directKey = CRCInput::RC_red; + btn.directKeyAlt = CRCInput::RC_ok; + btn.btn_result = mbrYes; + btn.btn_alias = mbYes; + v_buttons.push_back(btn); + } ccw_footer->setButtonLabels(v_buttons, 0, 125); ccw_footer->getButtonChainObject()->setColorBody(col_body); diff --git a/src/gui/widget/msgbox.h b/src/gui/widget/msgbox.h index 3c927f0fa..653aa1fed 100644 --- a/src/gui/widget/msgbox.h +++ b/src/gui/widget/msgbox.h @@ -74,7 +74,8 @@ class CMsgBox : public CHintBox mbOKCancel = 0x20, mbYesNoCancel = 0x40, mbYesNo = 0x80, - mbAll = 0x100, + mbNoYes = 0x100, + mbAll = 0x200, //unused allign stuff, only for compatibility mbBtnAlignCenter1 = 0x0400, /* centered, large distances */ mbBtnAlignCenter2 = 0x0800, /* centered, small distances */ @@ -267,7 +268,8 @@ class CMsgBox : public CHintBox * mbOKCancel = 0x20, * mbYesNoCancel = 0x40, * mbYesNo = 0x80, - * mbAll = 0x100, + * mbNoYes = 0x100, + * mbAll = 0x200, * NOTE: allign parameters are currently not supported, these values are existing for compatibility only! */ void setShowedButtons(const int& ShowButtons){mb_show_button = ShowButtons; initButtons();} From e46fc182dd0f97073826d16b887e5ce8d9d918d9 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 27 Oct 2016 12:15:23 +0200 Subject: [PATCH 064/171] CMsgBox: apply order of color buttons like on remote control Ensures unified conventions over gui. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f2b781dd6dda84d64624f981fa56f92ef37438aa Author: Thilo Graf Date: 2016-10-27 (Thu, 27 Oct 2016) --- src/gui/widget/msgbox.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 369be51bf..b9fc55d94 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -143,15 +143,6 @@ void CMsgBox::initButtons() btn.btn_alias = mbOk; v_buttons.push_back(btn); } - if (mb_show_button & mbYes){ - btn.button = NEUTRINO_ICON_BUTTON_GREEN; - btn.text = BTN_TEXT(mbYes); - btn.directKey = CRCInput::RC_green; - btn.directKeyAlt = CRCInput::RC_ok; - btn.btn_result = mbrYes; - btn.btn_alias = mbYes; - v_buttons.push_back(btn); - } if (mb_show_button & mbNo){ btn.button = NEUTRINO_ICON_BUTTON_RED; btn.text = BTN_TEXT(mbNo); @@ -161,6 +152,15 @@ void CMsgBox::initButtons() btn.btn_alias = mbNo; v_buttons.push_back(btn); } + if (mb_show_button & mbYes){ + btn.button = NEUTRINO_ICON_BUTTON_GREEN; + btn.text = BTN_TEXT(mbYes); + btn.directKey = CRCInput::RC_green; + btn.directKeyAlt = CRCInput::RC_ok; + btn.btn_result = mbrYes; + btn.btn_alias = mbYes; + v_buttons.push_back(btn); + } if (mb_show_button & mbCancel){ btn.button = NEUTRINO_ICON_BUTTON_HOME; btn.text = BTN_TEXT(mbCancel); @@ -180,13 +180,6 @@ void CMsgBox::initButtons() v_buttons.push_back(btn); } if (mb_show_button & mbNoYes){ - btn.button = NEUTRINO_ICON_BUTTON_GREEN; - btn.text = BTN_TEXT(mbNo); - btn.directKey = CRCInput::RC_green; - btn.directKeyAlt = CRCInput::RC_home; - btn.btn_result = mbrNo; - btn.btn_alias = mbNo; - v_buttons.push_back(btn); btn.button = NEUTRINO_ICON_BUTTON_RED; btn.text = BTN_TEXT(mbYes); btn.directKey = CRCInput::RC_red; @@ -194,6 +187,13 @@ void CMsgBox::initButtons() btn.btn_result = mbrYes; btn.btn_alias = mbYes; v_buttons.push_back(btn); + btn.button = NEUTRINO_ICON_BUTTON_GREEN; + btn.text = BTN_TEXT(mbNo); + btn.directKey = CRCInput::RC_green; + btn.directKeyAlt = CRCInput::RC_home; + btn.btn_result = mbrNo; + btn.btn_alias = mbNo; + v_buttons.push_back(btn); } ccw_footer->setButtonLabels(v_buttons, 0, 125); From 6354af262f0cb8572e3eaa19f1908ae81af61229 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 27 Oct 2016 12:16:14 +0200 Subject: [PATCH 065/171] CTestMenu: add sample for message box with parameter CMsgBox::mbNoYes Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3d12e059c4e0541f8610cb484f09fc08d2a2623d Author: Thilo Graf Date: 2016-10-27 (Thu, 27 Oct 2016) --- src/gui/test_menu.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 7120cdfa9..14efde7ec 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -784,6 +784,14 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) ShowHint("MsgBox test returns", msg_txt.c_str()); return menu_return::RETURN_REPAINT; } + else if (actionKey == "msgbox_test_no_yes"){ + int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press key! ...", CMsgBox::mbrOk, CMsgBox::mbNoYes, NULL, 500, -1); + + std::string msg_txt = "Return value of MsgBox test is "; + msg_txt += to_string(msgRet); + ShowHint("MsgBox test returns", msg_txt.c_str()); + return menu_return::RETURN_REPAINT; + } else if (actionKey == "msgbox_test_ok"){ int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press ok key! ...", CMsgBox::mbrOk, CMsgBox::mbOk, NULL, 500, -1); @@ -972,6 +980,7 @@ void CTestMenu::showMsgTests(CMenuWidget *widget) widget->addItem(new CMenuSeparator(CMenuSeparator::STRING | CMenuSeparator::LINE, "MsgBox")); widget->addItem(new CMenuForwarder("cancel on timeout", true, NULL, this, "msgbox_test_cancel_timeout")); widget->addItem(new CMenuForwarder("yes no", true, NULL, this, "msgbox_test_yes_no")); + widget->addItem(new CMenuForwarder("no yes", true, NULL, this, "msgbox_test_no_yes")); widget->addItem(new CMenuForwarder("cancel", true, NULL, this, "msgbox_test_cancel")); widget->addItem(new CMenuForwarder("ok", true, NULL, this, "msgbox_test_ok")); widget->addItem(new CMenuForwarder("ok cancel", true, NULL, this, "msgbox_test_ok_cancel")); From b7baafa2e5a8ae6c12d979243ca625c66f2cb194 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 27 Oct 2016 12:16:55 +0200 Subject: [PATCH 066/171] CChannelList: delete with red yes button Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/36896849689c552989cf365984de546a4ed5282a Author: Thilo Graf Date: 2016-10-27 (Thu, 27 Oct 2016) --- src/gui/channellist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 176f34315..c37aa9637 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2631,7 +2631,7 @@ void CChannelList::deleteChannel(bool ask) if (!bouquet || !bouquet->zapitBouquet) return; - if (ask && ShowMsg(LOCALE_FILEBROWSER_DELETE, (*chanlist)[selected]->getName(), CMsgBox::mbrNo, CMsgBox::mbYes|CMsgBox::mbNo)!=CMsgBox::mbrYes) + if (ask && ShowMsg(LOCALE_FILEBROWSER_DELETE, (*chanlist)[selected]->getName(), CMsgBox::mbrYes, CMsgBox::mbNoYes)!=CMsgBox::mbrYes) return; bouquet->zapitBouquet->removeService((*chanlist)[selected]->getChannelID()); From 699d6a311b7a1e4f18e4c126a0bde6610e7a8bf8 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 6 Nov 2016 18:45:01 +0100 Subject: [PATCH 067/171] src/gui/scan_setup.cpp use CHintBox for reloadchannels Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c0ce2a0d3b7f3057054059812cbe6878aff5df7d Author: Jacek Jendrzej Date: 2016-11-06 (Sun, 06 Nov 2016) --- src/gui/scan_setup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index 8fa5dced4..a4aa2599b 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -371,7 +371,7 @@ int CScanSetup::exec(CMenuTarget* parent, const std::string &actionKey) else if(actionKey == "reloadchannels") { printf("[neutrino] CScanSetup::%s reloadchannels...\n", __FUNCTION__); - CHint chb(LOCALE_SERVICEMENU_RELOAD_HINT); + CHintBox chb(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SERVICEMENU_RELOAD_HINT)); chb.paint(); /* save if changed, to make sure NEW/REMOVED/... flags are updated */ CServiceManager::getInstance()->SaveServices(true, true); From 1523582d35e0b0fdf9ddee7fd5c75c3378991317 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 9 Nov 2016 23:46:46 +0100 Subject: [PATCH 068/171] CTextBox: add static function to get count of lines from passed text I'm missing a function that returns current line count outside of a CTextBox object. This could be useful eg. for size calculations before object init etc Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ac8d05f5e1d64756fb37d55c4848402e10246a85 Author: Thilo Graf Date: 2016-11-09 (Wed, 09 Nov 2016) --- src/gui/widget/textbox.cpp | 17 +++++++++++++++++ src/gui/widget/textbox.h | 19 ++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index bbddf0fb4..d337a89b2 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -64,6 +64,7 @@ #ifdef VISUAL_DEBUG #include #endif +#include #define SCROLL_FRAME_WIDTH 10 #define SCROLL_MARKER_BORDER 2 @@ -870,3 +871,19 @@ bool CTextBox::enableSaveScreen(bool mode) return true; } +int CTextBox::getLines(const std::string& text) +{ + if (text.empty()) + return 0; + + std::stringstream s (text); + if (!s) + return 0; + + int count = 0; + std::string line; + while(getline(s, line)) + count++; + + return count; +} diff --git a/src/gui/widget/textbox.h b/src/gui/widget/textbox.h index c062b62e7..e2604063b 100644 --- a/src/gui/widget/textbox.h +++ b/src/gui/widget/textbox.h @@ -201,10 +201,27 @@ class CTextBox : public sigc::trackable inline bool isPainted(void) {if( frameBuffer == NULL) return (false); else return (true);}; inline CBox getWindowsPos(void) {return(m_cFrame);}; inline int getMaxLineWidth(void) {return(m_nMaxTextWidth);}; - inline int getLines(void) {return(m_nNrOfLines);}; + inline int getLinesPerPage(void) {return m_nLinesPerPage;}; inline int getPages(void) {return(m_nNrOfPages);}; inline int getBackGroundRadius(void) {return(m_nBgRadius);}; + + /** + * Returns count of lines of a passed text. + * @param[in] text + * @li exepts type std::string + * @return count of lines as int + * @see getLines() + */ + static int getLines(const std::string& text); + + /** + * Returns count of evaluated lines from an existent CTextBox instance. + * @return count of lines as int + * @see static version getLines() + */ + int getLines(){return(m_nNrOfLines);} + inline void movePosition(int x, int y) {m_cFrame.iX = x; m_cFrame.iY = y;}; int getFontTextHeight(); inline int getTextMode() {return m_nMode;}; From 0704180bf98719678baf96bdc5b766bb3d620963 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 31 Oct 2016 21:38:06 +0100 Subject: [PATCH 069/171] CHintBox: add member to get maximal required width Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4bdd5e11a909fb060b8e43f51049915f2b9192f5 Author: Thilo Graf Date: 2016-10-31 (Mon, 31 Oct 2016) --- src/gui/widget/hintbox.cpp | 7 ++++++- src/gui/widget/hintbox.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 0a0217fca..1ad1b2f87 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -259,7 +259,7 @@ void CHintBox::addHintItem(const std::string& Text, const int& text_mode, const //set required font and line size hb_font = !font_text ? hb_font : font_text; - width = max(width, min(hb_font->getRenderWidth(Text), HINTBOX_MIN_WIDTH)); + width = getMaxWidth(Text, width); int h_line = hb_font->getHeight(); //init side picon object @@ -439,6 +439,11 @@ void CHintBox::scroll_down(const uint& hint_id) Scroll(true, hint_id); } +int CHintBox::getMaxWidth(const string& Text, const int& minWidth) +{ + return max(HINTBOX_MIN_WIDTH, max(minWidth, min(hb_font->getRenderWidth(Text), (int)frameBuffer->getScreenWidth()))); +} + int ShowHint(const char * const Caption, const char * const Text, const int Width, int timeout, const char * const Icon, const char * const Picon, const int& header_buttons) { int res = messages_return::none; diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index 3f5a35724..5cf6b33e4 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -85,6 +85,7 @@ class CHintBox : public CComponentsWindow virtual void ReSize(); void showTimeOutBar(){enableTimeOutBar();} + int getMaxWidth(const std::string& Text, const int& minWidth); public: /**CHintBox Constructor From c337d0449e43184c35019f4f590da69dd98169c0 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 3 Nov 2016 20:10:42 +0100 Subject: [PATCH 070/171] CHintBox/CMsgBox: rework text handling and dynamic size behavior Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e3f51f2c914bbd3f22112c36dacaef5e48892e11 Author: Thilo Graf Date: 2016-11-03 (Thu, 03 Nov 2016) --- src/gui/widget/hintbox.cpp | 191 ++++++++++++------------------------- src/gui/widget/hintbox.h | 28 ++---- src/gui/widget/msgbox.h | 36 +++---- 3 files changed, 87 insertions(+), 168 deletions(-) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 1ad1b2f87..2dfd390a8 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -128,16 +128,14 @@ CHintBox::CHintBox( const char * const Caption, void CHintBox::init(const std::string& Text, const int& Width, const std::string& Picon, const int& header_buttons, const int& text_mode, const int& indent) { - lines = 0; timeout = HINTBOX_DEFAULT_TIMEOUT; w_indentation = indent; - hb_text_mode = text_mode; hb_font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]; //set required window width and basic height - width = max(HINTBOX_MIN_WIDTH, max(Width, min(hb_font->getRenderWidth(Text), (int)frameBuffer->getScreenWidth()))); - height = max(HINTBOX_MIN_HEIGHT, height); + width = getMaxWidth(Text, hb_font, Width); + height = max(HINTBOX_MIN_HEIGHT, min(HINTBOX_MAX_HEIGHT, height)); ccw_buttons = header_buttons; @@ -151,19 +149,14 @@ void CHintBox::init(const std::string& Text, const int& Width, const std::string //disable footer for default showFooter(false); - //add the content container, contains the hint objects - obj_content = new CComponentsFrmChain(CC_CENTERED, CC_CENTERED, ccw_body->getWidth(), ccw_body->getHeight(), NULL, CC_DIR_X, ccw_body); - obj_content->doPaintBg(false); - - y_hint_obj = 0; - h_hint_obj = obj_content->getHeight(); + y_hint_obj = CC_CENTERED; //initialize timeout bar and its timer timeout_pb = NULL; timeout_pb_timer= NULL; if (!Text.empty()) - addHintItem(Text, hb_text_mode, Picon); + addHintItem(Text, text_mode, Picon, COL_MENUCONTENT_TEXT, hb_font); } CHintBox::~CHintBox() @@ -253,135 +246,73 @@ int CHintBox::exec() return res; } -void CHintBox::addHintItem(const std::string& Text, const int& text_mode, const std::string& Picon, const u_int8_t& at_page_number, const fb_pixel_t& color_text, Font* font_text) +void CHintBox::addHintItem(const std::string& Text, const int& text_mode, const std::string& Picon, const fb_pixel_t& color_text, Font* font_text) { - dprintf(DEBUG_INFO, "[CHintBox] [%s - %d] add new hint '%s' %s\n", __func__, __LINE__, Text.c_str(), Picon.c_str()); + /* set required font and line height */ + Font* item_font = !font_text ? hb_font : font_text; - //set required font and line size - hb_font = !font_text ? hb_font : font_text; - width = getMaxWidth(Text, width); - int h_line = hb_font->getHeight(); + /* pre define required info height depends of lines and minimal needed height*/ + int line_breaks = CTextBox::getLines(Text); + int h_font = item_font->getHeight(); + int h_lines = h_font * line_breaks; - //init side picon object - CComponentsPicture *obj_picon = new CComponentsPicture(0, timeout > 0 ? TIMEOUT_BAR_HEIGHT : 0, Picon); - obj_picon->doPaintBg(false); - obj_picon->SetTransparent(CFrameBuffer::TM_BLACK); - int w_picon = obj_picon->getWidth(); + /* get required height depends of possible lines and max height */ + h_hint_obj = min(HINTBOX_MAX_HEIGHT - (ccw_head ? ccw_head->getHeight() : 0), h_lines + 2*w_indentation); - //init text item object - int x_text_obj = (w_picon > 0) ? (w_picon + w_indentation) : 0; - int w_text_obj = obj_content->getWidth() - w_picon - w_indentation; - int h_text_obj = max(h_line, obj_picon->getHeight()); - CComponentsText *obj_text = new CComponentsText(x_text_obj, - timeout > 0 ? TIMEOUT_BAR_HEIGHT : 0, - w_text_obj, - h_text_obj, - Text, - text_mode, - hb_font); - - //provide the internal textbox object - CTextBox *textbox = obj_text->getCTextBoxObject(); - int lines_count = textbox->getLines(); - - //get required height of text object related to height of current text object, header and footer - int fh_h = (ccw_head ? ccw_head->getHeight() : 0) + (ccw_footer ? ccw_footer->getHeight() : 0) + obj_text->getHeight(); - int h_required = min( max(height,fh_h), (int)frameBuffer->getScreenHeight()) ;//lines_count * h_line + (ccw_head ? ccw_head->getHeight() : 0) + (ccw_footer ? ccw_footer->getHeight() : 0); - - //set minimal required height - height = max(height, min(HINTBOX_MAX_HEIGHT, max(HINTBOX_MIN_HEIGHT, h_required))); - - //if have no pre defined text mode: - //more than 1 line or a picon is defined, then do not center text and allow scroll if > 1 lines - if (text_mode == 0){ - if (lines_count == 1) - obj_text->setTextMode(CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH | CTextBox::CENTER); - if (w_picon > 1) - obj_text->setTextMode(CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH); - if (lines_count > 1) - obj_text->setTextMode(CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH | (h_required > HINTBOX_MAX_HEIGHT ? CTextBox::SCROLL : CTextBox::AUTO_HIGH)); - if (lines_count > 1 && w_picon == 0) - obj_text->setTextMode(CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH | CTextBox::CENTER | (h_required > HINTBOX_MAX_HEIGHT ? CTextBox::SCROLL : CTextBox::AUTO_HIGH)); - } - else - obj_text->setTextMode(text_mode); - - //text item object: don't paint background - obj_text->doPaintBg(false); - obj_text->setCorner(corner_rad, corner_type); - - //set text color - obj_text->setTextColor(color_text); - - //calculate height of hint object - if (obj_content->size() == 0){ - if (lines_count == 1){ - h_hint_obj = max(h_hint_obj, h_text_obj); - obj_text->setYPos(CC_CENTERED); - } - else - h_hint_obj = max(h_hint_obj, h_line*lines_count); - } - else{ - if (lines_count == 1){ - h_hint_obj = h_text_obj; - obj_text->setYPos(CC_CENTERED); - } - else - h_hint_obj = h_line*lines_count; + /* add scroll mode if needed */ + int txt_mode = text_mode; + if (h_lines > h_hint_obj){ + txt_mode = text_mode | CTextBox::SCROLL; + ccw_buttons = ccw_buttons | CComponentsHeader::CC_BTN_TOP | CComponentsHeader::CC_BTN_DOWN; } - //init hint container object - if (isPageChanged()) - y_hint_obj = 0; - CComponentsFrmChain *obj_hint = new CComponentsFrmChain( 0+w_indentation, - y_hint_obj, - obj_content->getWidth()-2*w_indentation, - h_hint_obj, - NULL, - CC_DIR_X, - obj_content); + /* define y start position of infobox inside body */ + if(!ccw_body->empty()){ + ccw_body->front()->setYPos(w_indentation); + y_hint_obj += ccw_body->back()->getYPos()+ ccw_body->back()->getHeight(); + } - //don't paint background for hint container - obj_hint->doPaintBg(false); - obj_hint->setCorner(corner_rad, corner_type); - obj_hint->setPageNumber(at_page_number); + /* calcoulation of maximal hintbox height include possible header*/ + height = min(HINTBOX_MAX_HEIGHT, (ccw_head ? ccw_head->getHeight() : 0)+ h_hint_obj); + height = max(height, HINTBOX_MIN_HEIGHT); - //add the created items to obj_hint - obj_hint->addCCItem(obj_picon); - obj_hint->addCCItem(obj_text); + /* get current maximal width and refresh window items TODO: required maximal width*/ + width = getMaxWidth(Text, item_font, width); - //text object obtains the full height of its parent object - obj_text->setHeightP(100); + /* initialize infobox as container for text and possible picon*/ + CComponentsInfoBox *info_box = new CComponentsInfoBox( 0, + y_hint_obj, + width, // FIXME: not critical here but ccw_body->getWidth() != width, this should be the same value! + h_hint_obj, + Text, + txt_mode, + item_font, + ccw_body, + CC_SHADOW_OFF, + color_text); - //if we have only one line and a defined picon, then do centering picon to text on the left site - if (lines_count == 1) - obj_picon->setYPos(CC_CENTERED); + /* define picon and disable bg */ + info_box->setPicture(Picon); + info_box->doPaintBg(false); - //set next y pos for the next hint object - y_hint_obj += h_hint_obj; - - - //recalculate new hintbox height + /* recalculate new hintbox height */ ReSize(); - //set hint box position general to center and refresh window + /* set hint box position general to center and refresh window */ setCenterPos(); - Refresh(); - lines += lines_count; + Refresh(); } void CHintBox::setMsgText(const std::string& Text, const uint& hint_id, const int& mode, Font* font_text, const fb_pixel_t& color_text, const int& style) { uint id = hint_id; - if (hint_id+1 > obj_content->size()){ + if (hint_id+1 > ccw_body->size()){ id = 0; dprintf(DEBUG_NORMAL, "[CHintBox] [%s - %d] mismatching hint_id [%u]...\n", __func__, __LINE__, id); } - CComponentsFrmChain *obj_hint = static_cast(obj_content->getCCItem(id)); - CComponentsText *obj_text = static_cast(obj_hint->getCCItem(1)); + CComponentsInfoBox *obj_text = static_cast(ccw_body->getCCItem(id)); //set required font and line size Font* font = font_text == NULL ? g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO] : font_text; @@ -391,33 +322,29 @@ void CHintBox::setMsgText(const std::string& Text, const uint& hint_id, const in void CHintBox::ReSize() { - int h_content_old = obj_content->getHeight(); - int h_content_new = 0; - for (size_t i= 0; i< obj_content->size(); i++){ - CComponentsItem *item = obj_content->getCCItem(i); - h_content_new += item->getHeight(); + int h = (ccw_head ? ccw_head->getHeight() : 0); + for (size_t i= 0; i< ccw_body->size(); i++){ + CComponentsItem *item = ccw_body->getCCItem(i); + h += item->getHeight(); } - int h_content_diff = h_content_new - h_content_old; - - obj_content->setHeight(h_content_new); - setHeight(height+h_content_diff); + height = min(HINTBOX_MAX_HEIGHT, max(HINTBOX_MIN_HEIGHT, max(height,h))); + Refresh(); } void CHintBox::Scroll(bool down, const uint& hint_id) { uint id = hint_id; - if (hint_id+1 > obj_content->size()){ + if (hint_id+1 > ccw_body->size()){ id = 0; dprintf(DEBUG_NORMAL, "[CHintBox] [%s - %d] mismatching hint_id [%u]...\n", __func__, __LINE__, id); } - CComponentsFrmChain *obj_hint = static_cast(obj_content->getCCItem(id)); - CComponentsText *obj_text = static_cast(obj_hint->getCCItem(1)); + CComponentsInfoBox *obj_text = static_cast(ccw_body->getCCItem(id)); if (obj_text) { - dprintf(DEBUG_INFO, "[CHintBox] [%s - %d] try to scroll %s hint_id [%u]...Text= %s\n", __func__, __LINE__, down ? "down" : "up", id, obj_text->getText().c_str()); - CTextBox* textbox = obj_text->getCTextBoxObject(); + dprintf(DEBUG_DEBUG, "[CHintBox] [%s - %d] try to scroll %s hint_id [%u]...Text= %s\n", __func__, __LINE__, down ? "down" : "up", id, obj_text->getText().c_str()); + CTextBox* textbox = obj_text->cctext->getCTextBoxObject(); if (textbox) { textbox->enableBackgroundPaint(true); if (down) @@ -439,9 +366,9 @@ void CHintBox::scroll_down(const uint& hint_id) Scroll(true, hint_id); } -int CHintBox::getMaxWidth(const string& Text, const int& minWidth) +int CHintBox::getMaxWidth(const string& Text, Font *font, const int& minWidth) { - return max(HINTBOX_MIN_WIDTH, max(minWidth, min(hb_font->getRenderWidth(Text), (int)frameBuffer->getScreenWidth()))); + return max(HINTBOX_MIN_WIDTH, max(minWidth+w_indentation, min(font->getRenderWidth(Text)+w_indentation, (int)frameBuffer->getScreenWidth()))); } int ShowHint(const char * const Caption, const char * const Text, const int Width, int timeout, const char * const Icon, const char * const Picon, const int& header_buttons) diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index 5cf6b33e4..81893eb25 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -32,7 +32,7 @@ #include -#define HINTBOX_MIN_WIDTH 400 +#define HINTBOX_MIN_WIDTH 420 #define HINTBOX_MIN_HEIGHT 125 #define HINTBOX_MAX_HEIGHT 420 #define HINTBOX_DEFAULT_TIMEOUT 5 @@ -42,6 +42,8 @@ #define HINTBOX_DEFAULT_FRAME_COLOR COL_FRAME #define TIMEOUT_BAR_HEIGHT OFFSET_SHADOW/2 +#define DEFAULT_HINTBOX_TEXT_MODE (CTextBox::NO_AUTO_LINEBREAK) + //! Sub class of CComponentsWindow. Shows a window as a hintbox with text and optional icon beside of text. /*! CHintBox provides a small window with header and a text item, @@ -55,19 +57,12 @@ class CHintBox : public CComponentsWindow int y_hint_obj; int h_hint_obj; int w_indentation; - int hb_text_mode; Font* hb_font; - ///global count of lines - uint lines; - ///timeout value, see also setTimeOut() int timeout; - ///content container object, contains the hint objects, it's a child of body object - CComponentsFrmChain *obj_content; - ///timeout bar CProgressBar *timeout_pb; CComponentsTimer *timeout_pb_timer; @@ -85,7 +80,7 @@ class CHintBox : public CComponentsWindow virtual void ReSize(); void showTimeOutBar(){enableTimeOutBar();} - int getMaxWidth(const std::string& Text, const int& minWidth); + int getMaxWidth(const std::string& Text, Font *font, const int& minWidth); public: /**CHintBox Constructor @@ -125,7 +120,7 @@ class CHintBox : public CComponentsWindow const char * const Icon = NULL, const char * const Picon = NULL, const int& header_buttons = 0, - const int& text_mode = 0, + const int& text_mode = DEFAULT_HINTBOX_TEXT_MODE, const int& indent = W_FRAME); /**CHintBox Constructor @@ -139,7 +134,7 @@ class CHintBox : public CComponentsWindow const char * const Icon = NULL, const char * const Picon = NULL, const int& header_buttons = 0, - const int& text_mode = 0, + const int& text_mode = DEFAULT_HINTBOX_TEXT_MODE, const int& indent = W_FRAME); /**CHintBox Constructor @@ -155,7 +150,7 @@ class CHintBox : public CComponentsWindow const char * const Icon = NULL, const char * const Picon = NULL, const int& header_buttons = 0, - const int& text_mode = 0, + const int& text_mode = DEFAULT_HINTBOX_TEXT_MODE, const int& indent = W_FRAME); /**CHintBox Constructor @@ -171,7 +166,7 @@ class CHintBox : public CComponentsWindow const char * const Icon = NULL, const char * const Picon = NULL, const int& header_buttons = 0, - const int& text_mode = 0, + const int& text_mode = DEFAULT_HINTBOX_TEXT_MODE, const int& indent = W_FRAME); virtual ~CHintBox(); @@ -236,17 +231,14 @@ class CHintBox : public CComponentsWindow * AUTO_LINEBREAK_NO_BREAKCHARS * @param[in] Picon * @li optional: exepts type std::string, defines the picon name on the left side of message text, default = NULL (non Icon) - * @param[in] at_page_number - * @li optional: exepts type int, defines the page number on that this hint will be, default = 0 (first page) * @param[in] color_text * @li optional: exepts type fb_pixel_t, defines the text color, default = COL_MENUCONTENT_TEXT * * @param[in] font_text * @li optional: exepts type Font*, defines the text font type, default = NULL for system preset for message contents */ void addHintItem( const std::string& Text, - const int& text_mode = 0, + const int& text_mode = DEFAULT_HINTBOX_TEXT_MODE, const std::string& Picon = std::string(), - const u_int8_t& at_page_number = 0, const fb_pixel_t& color_text = COL_MENUCONTENT_TEXT, Font* font_text = NULL); @@ -257,7 +249,7 @@ class CHintBox : public CComponentsWindow * * @see /gui/components/cc_types.h */ - void addHintItem(CComponentsItem* cc_Item){obj_content->addCCItem(cc_Item);} + void addHintItem(CComponentsItem* cc_Item){ccw_body->addCCItem(cc_Item);} /** * Sets a text to a hint item. diff --git a/src/gui/widget/msgbox.h b/src/gui/widget/msgbox.h index 653aa1fed..028bba5d5 100644 --- a/src/gui/widget/msgbox.h +++ b/src/gui/widget/msgbox.h @@ -38,7 +38,7 @@ #define MSGBOX_MIN_WIDTH HINTBOX_MIN_WIDTH #define MSGBOX_MIN_HEIGHT HINTBOX_MIN_HEIGHT + 75 -#define DEFAULT_TEXT_MODE (CMsgBox::CENTER | CMsgBox::AUTO_WIDTH | CMsgBox::AUTO_HIGH | CMsgBox::SCROLL) +#define DEFAULT_MSGBOX_TEXT_MODE (CMsgBox::CENTER | CMsgBox::AUTO_WIDTH | CMsgBox::AUTO_HIGH) //! Sub class of CHintBox. Shows a window as a messagebox /*! @@ -159,7 +159,7 @@ class CMsgBox : public CHintBox * BOTTOM * NO_AUTO_LINEBREAK * AUTO_LINEBREAK_NO_BREAKCHARS - * NOTE: default parameter to find in macro DEFAULT_TEXT_MODE + * NOTE: default parameter to find in macro DEFAULT_MSGBOX_TEXT_MODE * * @see class CHintBox() */ @@ -171,7 +171,7 @@ class CMsgBox : public CHintBox const int& Height = MSGBOX_MIN_HEIGHT, const int& ShowButtons = mbCancel, const msg_result_t& Default_result = mbrCancel, - const int& Text_mode = DEFAULT_TEXT_MODE); + const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); /**CMsgBox Constructor * @param[in] Text @@ -213,7 +213,7 @@ class CMsgBox : public CHintBox * BOTTOM * NO_AUTO_LINEBREAK * AUTO_LINEBREAK_NO_BREAKCHARS - * NOTE: default parameter to find in macro DEFAULT_TEXT_MODE + * NOTE: default parameter to find in macro DEFAULT_MSGBOX_TEXT_MODE * * @see class CHintBox() */ @@ -225,7 +225,7 @@ class CMsgBox : public CHintBox const int& Height = MSGBOX_MIN_HEIGHT, const int& ShowButtons = mbCancel, const msg_result_t& Default_result = mbrCancel, - const int& Text_mode = DEFAULT_TEXT_MODE); + const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); // ~CMsgBox(); //inherited /** @@ -323,7 +323,7 @@ int ShowMsg2UTF( const neutrino_locale_t Title, const int Width = MSGBOX_MIN_WIDTH, const int Timeout = -1, bool returnDefaultOnTimeout = false, - const int& Text_mode = DEFAULT_TEXT_MODE, + const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 int ShowMsg2UTF( const char * const Title, @@ -334,7 +334,7 @@ int ShowMsg2UTF( const char * const Title, const int Width = MSGBOX_MIN_WIDTH, const int Timeout = -1, bool returnDefaultOnTimeout = false, - const int& Text_mode = DEFAULT_TEXT_MODE, + const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 int ShowMsg( const neutrino_locale_t Title, @@ -345,7 +345,7 @@ int ShowMsg( const neutrino_locale_t Title, const int Width = MSGBOX_MIN_WIDTH, const int Timeout = -1, bool returnDefaultOnTimeout = false, - const int& Text_mode = DEFAULT_TEXT_MODE, + const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 int ShowMsg( const char * const Title, @@ -356,7 +356,7 @@ int ShowMsg( const char * const Title, const int Width = MSGBOX_MIN_WIDTH, const int Timeout = -1, bool returnDefaultOnTimeout = false, - const int& Text_mode = DEFAULT_TEXT_MODE, + const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 int ShowMsg( const neutrino_locale_t Title, @@ -367,7 +367,7 @@ int ShowMsg( const neutrino_locale_t Title, const int Width = MSGBOX_MIN_WIDTH, const int Timeout = -1, bool returnDefaultOnTimeout = false, - const int& Text_mode = DEFAULT_TEXT_MODE, + const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 int ShowMsg( const neutrino_locale_t Title, @@ -378,7 +378,7 @@ int ShowMsg( const neutrino_locale_t Title, const int Width = MSGBOX_MIN_WIDTH, const int Timeout = -1, bool returnDefaultOnTimeout = false, - const int& Text_mode = DEFAULT_TEXT_MODE, + const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 int ShowMsg( const std::string & Title, @@ -389,13 +389,13 @@ int ShowMsg( const std::string & Title, const int Width = MSGBOX_MIN_WIDTH, const int Timeout = -1, bool returnDefaultOnTimeout = false, - const int& Text_mode = DEFAULT_TEXT_MODE, + const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 -void DisplayErrorMessage(const char * const ErrorMsg, const int& Text_mode = DEFAULT_TEXT_MODE); // UTF-8 -void DisplayErrorMessage(const char * const ErrorMsg, const neutrino_locale_t& caption, const int& Text_mode = DEFAULT_TEXT_MODE); // UTF-8 -void DisplayErrorMessage(const char * const ErrorMsg, const std::string& caption, const int& Text_mode = DEFAULT_TEXT_MODE); // UTF-8 -void DisplayInfoMessage(const char * const InfoMsg, const int& Text_mode = DEFAULT_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 -void DisplayInfoMessage(const char * const InfoMsg, const neutrino_locale_t& caption, const int& Text_mode = DEFAULT_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 -void DisplayInfoMessage(const char * const InfoMsg, const std::string& caption, const int& Text_mode = DEFAULT_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 +void DisplayErrorMessage(const char * const ErrorMsg, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); // UTF-8 +void DisplayErrorMessage(const char * const ErrorMsg, const neutrino_locale_t& caption, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); // UTF-8 +void DisplayErrorMessage(const char * const ErrorMsg, const std::string& caption, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); // UTF-8 +void DisplayInfoMessage(const char * const InfoMsg, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 +void DisplayInfoMessage(const char * const InfoMsg, const neutrino_locale_t& caption, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 +void DisplayInfoMessage(const char * const InfoMsg, const std::string& caption, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 #endif From 4a2a66399d3aeddb325e2f349ed9f2b514de000b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 10 Nov 2016 00:30:57 +0100 Subject: [PATCH 071/171] CTextBox: add static function to get largest line of passed text This could be useful eg. for size calculations. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/91c7588aa6bb993e29abee1d374363c3ba7bc566 Author: Thilo Graf Date: 2016-11-10 (Thu, 10 Nov 2016) --- src/gui/widget/textbox.cpp | 18 ++++++++++++++++++ src/gui/widget/textbox.h | 19 ++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index d337a89b2..bbf678e33 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -887,3 +887,21 @@ int CTextBox::getLines(const std::string& text) return count; } + +int CTextBox::getMaxLineWidth(const std::string& text, Font* font) +{ + // if found no linebreak, return pure size only + if (text.find('\n', 0) == std::string::npos) + return font->getRenderWidth(text.c_str()); + + std::stringstream in (text); + if (!in) + return 0; + + int len = 0; + std::string line; + while(getline(in, line)) + len = std::max(len, font->getRenderWidth(line.c_str())); + + return len; +} diff --git a/src/gui/widget/textbox.h b/src/gui/widget/textbox.h index e2604063b..5df0762a7 100644 --- a/src/gui/widget/textbox.h +++ b/src/gui/widget/textbox.h @@ -200,7 +200,6 @@ class CTextBox : public sigc::trackable inline bool isPainted(void) {if( frameBuffer == NULL) return (false); else return (true);}; inline CBox getWindowsPos(void) {return(m_cFrame);}; - inline int getMaxLineWidth(void) {return(m_nMaxTextWidth);}; inline int getLinesPerPage(void) {return m_nLinesPerPage;}; inline int getPages(void) {return(m_nNrOfPages);}; @@ -222,6 +221,24 @@ class CTextBox : public sigc::trackable */ int getLines(){return(m_nNrOfLines);} + /** + * Returns maximal width of passed text + * @param[in] text + * @li exepts type std::string + * @param[in] font + * @li exepts font type object + * @return width of largest line as int + * @see getMaxLineWidth(void) + */ + static int getMaxLineWidth(const std::string& text, Font* font); + + /** + * Returns internal defined maximal line width of an existent CTextBox instance. + * @return width of largest line as int + * @see static version getMaxLineWidth() + */ + int getMaxLineWidth() {return(m_nMaxTextWidth);} + inline void movePosition(int x, int y) {m_cFrame.iX = x; m_cFrame.iY = y;}; int getFontTextHeight(); inline int getTextMode() {return m_nMode;}; From 2f89d7ff7615c881671a03890003fd36f5115772 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 10 Nov 2016 00:34:00 +0100 Subject: [PATCH 072/171] CHintBox: optimize dynamic window width bahavior on different line sizes Width calculation is now depends on largest line of text. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0952efaba4ca66aee0823231150b133d85ca210e Author: Thilo Graf Date: 2016-11-10 (Thu, 10 Nov 2016) --- src/gui/widget/hintbox.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 2dfd390a8..cefbe5448 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -133,12 +133,6 @@ void CHintBox::init(const std::string& Text, const int& Width, const std::string hb_font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]; - //set required window width and basic height - width = getMaxWidth(Text, hb_font, Width); - height = max(HINTBOX_MIN_HEIGHT, min(HINTBOX_MAX_HEIGHT, height)); - - ccw_buttons = header_buttons; - //enable shadow shadow = true; @@ -146,6 +140,12 @@ void CHintBox::init(const std::string& Text, const int& Width, const std::string if (ccw_caption.empty()) showHeader(false); + //set required window width and basic height, consider existent header instance and its caption width + width = getMaxWidth(Text, hb_font, Width); + height = max(HINTBOX_MIN_HEIGHT, min(HINTBOX_MAX_HEIGHT, height)); + + ccw_buttons = header_buttons; + //disable footer for default showFooter(false); @@ -276,7 +276,7 @@ void CHintBox::addHintItem(const std::string& Text, const int& text_mode, const height = min(HINTBOX_MAX_HEIGHT, (ccw_head ? ccw_head->getHeight() : 0)+ h_hint_obj); height = max(height, HINTBOX_MIN_HEIGHT); - /* get current maximal width and refresh window items TODO: required maximal width*/ + /* get current maximal width and refresh window items */ width = getMaxWidth(Text, item_font, width); /* initialize infobox as container for text and possible picon*/ @@ -368,7 +368,7 @@ void CHintBox::scroll_down(const uint& hint_id) int CHintBox::getMaxWidth(const string& Text, Font *font, const int& minWidth) { - return max(HINTBOX_MIN_WIDTH, max(minWidth+w_indentation, min(font->getRenderWidth(Text)+w_indentation, (int)frameBuffer->getScreenWidth()))); + return max(HINTBOX_MIN_WIDTH, max(minWidth+w_indentation, min(CTextBox::getMaxLineWidth(Text, font)+w_indentation, (int)frameBuffer->getScreenWidth()))); } int ShowHint(const char * const Caption, const char * const Text, const int Width, int timeout, const char * const Icon, const char * const Picon, const int& header_buttons) From dbf42b9d5c3096243bb4044858e8f4e630794121 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 10 Nov 2016 00:50:13 +0100 Subject: [PATCH 073/171] CTestMenu: add sample for hintbox with timeout Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/43c1349ffa92a182e8e444c4aef29aab8ad96b7f Author: Thilo Graf Date: 2016-11-10 (Thu, 10 Nov 2016) --- src/gui/test_menu.cpp | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 14efde7ec..b5b1dd772 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -817,27 +817,19 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) return menu_return::RETURN_REPAINT; } else if (actionKey == "footer_key"){ - neutrino_msg_t msg; - neutrino_msg_data_t data; - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, "Footer-Key pressed. Press EXIT to return", 350, NULL, NULL, CComponentsHeader::CC_BTN_EXIT); + CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, "Footer-Key pressed. Press EXIT to return", 350, NULL, NULL, CComponentsHeader::CC_BTN_EXIT); + hintBox.setTimeOut(15); //optional: it is also possible to add more items into the hint box //here some examples: - hintBox->addHintItem(new CComponentsShapeSquare(CC_CENTERED, CC_APPEND, 330, 2, NULL, false, COL_MENUCONTENT_PLUS_6, COL_RED)); - hintBox->addHintItem("- text with left icon", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, NEUTRINO_ICON_HINT_INFO); - hintBox->addHintItem("- text right without an icon", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH | CTextBox::RIGHT); - hintBox->addHintItem("- text right with an icon", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH | CTextBox::RIGHT, NEUTRINO_ICON_HINT_INFO); + hintBox.addHintItem(new CComponentsShapeSquare(CC_CENTERED, CC_APPEND, 330, 2, NULL, false, COL_MENUCONTENT_PLUS_6, COL_RED)); + hintBox.addHintItem("- text with left icon", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, NEUTRINO_ICON_HINT_INFO); + hintBox.addHintItem("- text right without an icon", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH | CTextBox::RIGHT); + hintBox.addHintItem("- text right with an icon", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH | CTextBox::RIGHT, NEUTRINO_ICON_HINT_INFO); - hintBox->paint(); - while (1) - { - g_RCInput->getMsg(&msg, &data, 100); - if (msg == CRCInput::RC_home) - hintBox->hide(); - break; - } - hintBox->hide(); - delete hintBox; + hintBox.paint(); + res = hintBox.exec(); + hintBox.hide(); return res; } From 9ea70e4ea73beb15418d95e9c9729f376a0f0091 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 11 Nov 2016 21:09:25 +0100 Subject: [PATCH 074/171] CHintBox: try to fix truncated chars Last chars were truncated. Indent and titel text were not considered. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7f5a576795c03bb153480ca2b40ba80826d302d3 Author: Thilo Graf Date: 2016-11-11 (Fri, 11 Nov 2016) --- src/gui/widget/hintbox.cpp | 14 ++++++++++---- src/gui/widget/hintbox.h | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index cefbe5448..fe57855e1 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -141,7 +141,7 @@ void CHintBox::init(const std::string& Text, const int& Width, const std::string showHeader(false); //set required window width and basic height, consider existent header instance and its caption width - width = getMaxWidth(Text, hb_font, Width); + width = getMaxWidth(Text, ccw_caption, hb_font, Width); height = max(HINTBOX_MIN_HEIGHT, min(HINTBOX_MAX_HEIGHT, height)); ccw_buttons = header_buttons; @@ -277,7 +277,7 @@ void CHintBox::addHintItem(const std::string& Text, const int& text_mode, const height = max(height, HINTBOX_MIN_HEIGHT); /* get current maximal width and refresh window items */ - width = getMaxWidth(Text, item_font, width); + width = getMaxWidth(Text, ccw_caption, item_font, width); /* initialize infobox as container for text and possible picon*/ CComponentsInfoBox *info_box = new CComponentsInfoBox( 0, @@ -366,9 +366,15 @@ void CHintBox::scroll_down(const uint& hint_id) Scroll(true, hint_id); } -int CHintBox::getMaxWidth(const string& Text, Font *font, const int& minWidth) +int CHintBox::getMaxWidth(const string& Text, const string& Title, Font *font, const int& minWidth) { - return max(HINTBOX_MIN_WIDTH, max(minWidth+w_indentation, min(CTextBox::getMaxLineWidth(Text, font)+w_indentation, (int)frameBuffer->getScreenWidth()))); + int res = max(HINTBOX_MIN_WIDTH, max(minWidth+2*w_indentation, min(CTextBox::getMaxLineWidth(Text, font)+2*w_indentation, (int)frameBuffer->getScreenWidth()))); + if (ccw_show_header){ + initHeader(); + return max(res, ccw_head->getCaptionFont()->getRenderWidth(Title) + 2*w_indentation); + } + + return res; } int ShowHint(const char * const Caption, const char * const Text, const int Width, int timeout, const char * const Icon, const char * const Picon, const int& header_buttons) diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index 81893eb25..510d044c8 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -80,7 +80,7 @@ class CHintBox : public CComponentsWindow virtual void ReSize(); void showTimeOutBar(){enableTimeOutBar();} - int getMaxWidth(const std::string& Text, Font *font, const int& minWidth); + int getMaxWidth(const std::string& Text, const std::string& Title, Font *font, const int& minWidth); public: /**CHintBox Constructor From fac13b98ee07aac8c5a87267af94b4ac2a106bbe Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 11 Nov 2016 21:31:39 +0100 Subject: [PATCH 075/171] CHintbox: enlarge possible max height Better use of available screen size for many lines Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3193fef4c6e236c543f582030c1799071a0e8ad7 Author: Thilo Graf Date: 2016-11-11 (Fri, 11 Nov 2016) --- src/gui/widget/hintbox.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index 510d044c8..f24fa4b24 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -34,7 +34,7 @@ #define HINTBOX_MIN_WIDTH 420 #define HINTBOX_MIN_HEIGHT 125 -#define HINTBOX_MAX_HEIGHT 420 +#define HINTBOX_MAX_HEIGHT 520 #define HINTBOX_DEFAULT_TIMEOUT 5 //frame around hint container as indent #define W_FRAME std::max(HINTBOX_MIN_WIDTH, HINTBOX_MIN_HEIGHT) * 2/100 From 527a5ad0467053dd361eb087bdb7e581b8171278 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 11 Nov 2016 23:10:39 +0100 Subject: [PATCH 076/171] CHintBox: remove center text mode on used picon Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/075917e32d2e65caf551e7954b7d2c93851e0d3f Author: Thilo Graf Date: 2016-11-11 (Fri, 11 Nov 2016) --- src/gui/widget/hintbox.cpp | 7 ++++++- src/gui/widget/hintbox.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index fe57855e1..3851a247f 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -259,8 +259,13 @@ void CHintBox::addHintItem(const std::string& Text, const int& text_mode, const /* get required height depends of possible lines and max height */ h_hint_obj = min(HINTBOX_MAX_HEIGHT - (ccw_head ? ccw_head->getHeight() : 0), h_lines + 2*w_indentation); - /* add scroll mode if needed */ int txt_mode = text_mode; + /* remove CENTER mode if picon defined */ + if (!Picon.empty() && (txt_mode & CTextBox::CENTER)){ + txt_mode &= ~CTextBox::CENTER; + } + + /* add scroll mode if needed */ if (h_lines > h_hint_obj){ txt_mode = text_mode | CTextBox::SCROLL; ccw_buttons = ccw_buttons | CComponentsHeader::CC_BTN_TOP | CComponentsHeader::CC_BTN_DOWN; diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index f24fa4b24..641bb6411 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -42,7 +42,7 @@ #define HINTBOX_DEFAULT_FRAME_COLOR COL_FRAME #define TIMEOUT_BAR_HEIGHT OFFSET_SHADOW/2 -#define DEFAULT_HINTBOX_TEXT_MODE (CTextBox::NO_AUTO_LINEBREAK) +#define DEFAULT_HINTBOX_TEXT_MODE (CTextBox::CENTER) //! Sub class of CComponentsWindow. Shows a window as a hintbox with text and optional icon beside of text. /*! From 5bb70ba9e90bc8965ca6997d4cf0d2aba1b24090 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 12 Nov 2016 14:51:18 +0100 Subject: [PATCH 077/171] CHintBox: update ascII scheme Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/27905b9acfc17751c71646dc1da5a3c4350127e6 Author: Thilo Graf Date: 2016-11-12 (Sat, 12 Nov 2016) --- src/gui/widget/hintbox.cpp | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 3851a247f..eeda08a24 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -38,20 +38,21 @@ -/* - x w - y+-ccw_head----------------------------------------------+ - |icon | caption | buttons |header (ccw_head) - +-ccw_body----------------------------------------------+ - |+-obj_content-----------------------------------------+| - ||+-obj_hint 0----------------------------------------+||body (ccw_body) - h||| obj_picon | obj_text ||| | - ||+---------------------------------------------------+|| +-contents (obj_content) - |+-----------------------------------------------------+| | - +-------------------------------------------------------+ +-hint 0 (obj_hint) default added with new instance of CHintBox - | - | - +-hint n optional added with addHintItem() +/** + x width ccw_head [relevant for CHintBox, CMsgBox. not enabled in CHint class] + + y +---------------------------------------------------------------+/ + |[icon]| caption |[context buttons]| + +===============================================================+ timeout_pb + | + W_FRAME (w_indentation)-----------------------------------+ | + | | | | + height | | [picon] [text] | | ccw_body > container for info box object + | | i n f o b o x (added with addHintItem() | |/ + | | | | + | +-----------------------------------------------------------+ | ccw_footer with buttons [relevant for CMsgBox, not enabled in CHintBox and CHint classes] + + +---------------------------------------------------------------+/ + | ... | + + +---------------------------------------------------------------+ + */ using namespace std; From d1b9a4524a581e0c928b42ecf6056d1317a805e8 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 12 Nov 2016 15:05:05 +0100 Subject: [PATCH 078/171] CFileBrowser: use mbrYes as default selection TODO: Re-evaluate the logic of current used messages with risky actions and adjust the buttons accordingly. Reason: is now as default assigned to green button (traffic light principle), and we use stricktly the order of colors from remote control (r,g,g,b), but in some cases it is useful to assign the button to red for risky actions. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5443cc274c1dd028a33c8197c23d07c2c5dc0e9b Author: Thilo Graf Date: 2016-11-12 (Sat, 12 Nov 2016) --- src/gui/filebrowser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 736fc6b0f..5187baf14 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -800,7 +800,7 @@ bool CFileBrowser::exec(const char * const dirname) _msg << filelist[selected].getFileName(); _msg << " " << g_Locale->getText(LOCALE_FILEBROWSER_DODELETE2); - if (ShowMsg(LOCALE_FILEBROWSER_DELETE, _msg.str(), CMsgBox::mbrNo, CMsgBox::mbYes|CMsgBox::mbNo)==CMsgBox::mbrYes) + if (ShowMsg(LOCALE_FILEBROWSER_DELETE, _msg.str(), CMsgBox::mbrYes, CMsgBox::mbNoYes)==CMsgBox::mbrYes) { std::string n = filelist[selected].Name; recursiveDelete(n.c_str()); From b3b0c90b2c81b4054aef7df05b1b487632c3e361 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 12 Nov 2016 20:40:28 +0100 Subject: [PATCH 079/171] moviebrowser: fix MB_INFO_SPACER's empty content Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/da604fb9a5b5626b02f38d43b1a9f86a30efc7d8 Author: vanhofen Date: 2016-11-12 (Sat, 12 Nov 2016) Origin message was: ------------------ - moviebrowser: fix MB_INFO_SPACER's empty content --- src/gui/moviebrowser/mb.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 42d995daf..7cde3f83e 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3726,6 +3726,8 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite } break; case MB_INFO_SPACER: // = 21, + *item_string=""; + break; case MB_INFO_MAX_NUMBER: // = 22 default: *item_string=""; From 9533a9ba4e9de75c95372336ee4e9551ac358196 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 12 Nov 2016 22:00:12 +0100 Subject: [PATCH 080/171] cc_item_picture: reset keep_aspect variables after use Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/73b97ecd4df690d8283ea706fe4ca4bbc48a0d1f Author: vanhofen Date: 2016-11-12 (Sat, 12 Nov 2016) Origin message was: ------------------ - cc_item_picture: reset keep_aspect variables after use --- src/gui/components/cc_item_picture.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index 89ffaed86..ad3ec018b 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -216,17 +216,21 @@ void CComponentsPicture::initCCItem() * by setters setWidth/setHeight * these steps are required to assign the current image dimensions to item dimensions */ - if (keep_dx_aspect && dy){ + if (keep_dx_aspect && dy) + { float h_ratio = float(height)*100/(float)dy; width = int(h_ratio*(float)dx/100); #ifdef BOXMODEL_APOLLO if (do_scale && (width > 10 || height > 10)) width = GetWidth4FB_HW_ACC(x+fr_thickness, width-2*fr_thickness)+2*fr_thickness; #endif + keep_dx_aspect = false; } - if (keep_dy_aspect && dx){ + if (keep_dy_aspect && dx) + { float w_ratio = float(width)*100/(float)dx; height = int(w_ratio*(float)dy/100); + keep_dy_aspect = false; } //resize image and apply current assigned scale values From af321e4411eca276a5d3815e5ae90bad14055544 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 12 Nov 2016 22:03:05 +0100 Subject: [PATCH 081/171] moviebrowser: limit cover to one third of m_cBoxFrameInfo1 width Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a47a5cd422b2df4180aa0b91bdfc34ba6de6e86c Author: vanhofen Date: 2016-11-12 (Sat, 12 Nov 2016) Origin message was: ------------------ - moviebrowser: limit cover to one third of m_cBoxFrameInfo1 width --- src/gui/moviebrowser/mb.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 7cde3f83e..a021f4ad0 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1402,6 +1402,8 @@ TRACE("[mb]->%s:%d m_movieCover->getHeight(): %d\n", __func__, __LINE__, m_movie m_movieCover->setWidth(0); // force recalculation TRACE("[mb]->%s:%d m_movieCover->getWidth(): %d\n", __func__, __LINE__, m_movieCover->getWidth()); m_movieCover->setHeight(cover_h, true); + if (m_movieCover->getWidth() > movieCoverBox.iWidth/3) + m_movieCover->setWidth(movieCoverBox.iWidth/3, true); // use maximal one third of box width m_movieCover->setXPos(movieCoverBox.iX + movieCoverBox.iWidth - m_movieCover->getWidth() - 2*OFFSET_INNER_MID - OFFSET_SHADOW); m_movieCover->setYPos(movieCoverBox.iY + (movieCoverBox.iHeight - m_movieCover->getHeight())/2); From 7e35a8e7dfc0d186241df19b296e040d33110bef Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 12 Nov 2016 18:24:14 +0100 Subject: [PATCH 082/171] neutrinoyparser: fix string literal warning with newer gcc Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ee5f73c64d802a7c2e14e6380d14a3bfe556acc6 Author: Stefan Seyfried Date: 2016-11-12 (Sat, 12 Nov 2016) --- src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index fbc620122..ce7537673 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -429,7 +429,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: if (channel->getChannelID() == current_channel) yresult += "\n"; - yresult += string_printf("" + yresult += string_printf("" "%d. %s%s" "\n" , channel->getChannelID() @@ -461,7 +461,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: } if (event.eventID) { - yresult += string_printf("" + yresult += string_printf("" "\"Program" "\n" , channel->getChannelID() @@ -469,7 +469,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: ); } - yresult += string_printf("" + yresult += string_printf("" "\"Stream\"" "\n" , channel->getChannelID() From 95e8550dad2928eaa530b88fec466d3532103d4e Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 12 Nov 2016 18:25:06 +0100 Subject: [PATCH 083/171] timermanager: fix -Waddress warning with newer gcc The address of Events (wich is checked against NULL) can never be NULL, because Events is passed by reference. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/053161864373a5a685b2a1c8b20880bf16e114f6 Author: Stefan Seyfried Date: 2016-11-12 (Sat, 12 Nov 2016) --- src/timerd/timermanager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index cfb509c8e..6e17a1c01 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -292,9 +292,10 @@ int CTimerManager::unlockEvents() bool CTimerManager::listEvents(CTimerEventMap &Events) { +/* events is passed as reference and thus its address is never NULL if(!&Events) return false; - + */ Events.clear(); for (CTimerEventMap::iterator pos = events.begin(); pos != events.end(); ++pos) From bff69630e428cc4194908d2c14cf65329d385e4d Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 12 Nov 2016 22:16:42 +0100 Subject: [PATCH 084/171] driver: use newer ffmpeg API Reduce the "deprecated function" warnings a bit when compiling against recent ffmpeg releases. Just the drop-in-replacement "av_packet_unref" which works with both old and new ffmpeg versions. The other stuff needs rewrites which are not compatible with all ffmpeg releases :-( Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7154f36258be3a966e6c10b28b3d6efcc9c914c3 Author: Stefan Seyfried Date: 2016-11-12 (Sat, 12 Nov 2016) --- src/driver/audiodec/ffmpegdec.cpp | 6 +++--- src/driver/record.cpp | 4 ++-- src/driver/streamts.cpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/driver/audiodec/ffmpegdec.cpp b/src/driver/audiodec/ffmpegdec.cpp index a4eb905c1..c97497175 100644 --- a/src/driver/audiodec/ffmpegdec.cpp +++ b/src/driver/audiodec/ffmpegdec.cpp @@ -314,7 +314,7 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state, } if (rpacket.stream_index != best_stream) { - av_free_packet(&rpacket); + av_packet_unref(&rpacket); continue; } @@ -373,7 +373,7 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state, } if (time_played && avc->streams[best_stream]->time_base.den) *time_played = (pts - start_pts) * avc->streams[best_stream]->time_base.num / avc->streams[best_stream]->time_base.den; - av_free_packet(&rpacket); + av_packet_unref(&rpacket); } while (*state!=STOP_REQ && Status==OK); audioDecoder->StopClip(); @@ -381,7 +381,7 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state, swr_free(&swr); av_free(outbuf); - av_free_packet(&rpacket); + av_packet_unref(&rpacket); av_frame_free(&frame); avcodec_close(c); //av_free(avcc); diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 7dd3183ab..ce7076c24 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -2207,7 +2207,7 @@ void CStreamRec::run() AVPacket newpkt = pkt; if (av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY) >= 0) { - av_free_packet(&pkt); + av_packet_unref(&pkt); newpkt.buf = av_buffer_create(newpkt.data, newpkt.size, av_buffer_default_free, NULL, 0); pkt = newpkt; } @@ -2216,7 +2216,7 @@ void CStreamRec::run() pkt.dts = av_rescale_q(pkt.dts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); av_write_frame(ofcx, &pkt); - av_free_packet(&pkt); + av_packet_unref(&pkt); if (pkt.stream_index == stream_index) { total += (double) 1000 * pkt.duration * av_q2d(ifcx->streams[stream_index]->time_base); diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index f293f0e7e..e60f4b88c 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -900,7 +900,7 @@ void CStreamStream::run() AVPacket newpkt = pkt; if (av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY) >= 0) { - av_free_packet(&pkt); + av_packet_unref(&pkt); newpkt.buf = av_buffer_create(newpkt.data, newpkt.size, av_buffer_default_free, NULL, 0); pkt = newpkt; } @@ -909,7 +909,7 @@ void CStreamStream::run() pkt.dts = av_rescale_q(pkt.dts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); av_write_frame(ofcx, &pkt); - av_free_packet(&pkt); + av_packet_unref(&pkt); } av_read_pause(ifcx); From d9758e5c13ab4969d769ae8c70f65b403b704073 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 12 Nov 2016 22:19:33 +0100 Subject: [PATCH 085/171] zapit: fix "comparison is always false" warnings demux Start() Stop() and pesFilter() are bool, so comparing < 0 really does not make sense. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5948f045aa0abb9c5ac1e6d6651c6d4882123bbd Author: Stefan Seyfried Date: 2016-11-12 (Sat, 12 Nov 2016) --- src/zapit/src/zapit.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 432e19e00..375c1f228 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -926,7 +926,7 @@ bool CZapit::ChangeAudioPid(uint8_t index) return false; /* stop demux filter */ - if (audioDemux->Stop() < 0) + if (audioDemux->Stop() == false) return false; /* stop audio playback */ @@ -948,11 +948,11 @@ bool CZapit::ChangeAudioPid(uint8_t index) SetAudioStreamType(currentAudioChannel->audioChannelType); /* set demux filter */ - if (audioDemux->pesFilter(current_channel->getAudioPid()) < 0) + if (audioDemux->pesFilter(current_channel->getAudioPid()) == false) return false; /* start demux filter */ - if (audioDemux->Start() < 0) + if (audioDemux->Start() == false) return false; /* start audio playback */ From ce278342b577cfb8e3664842af783b8e4781fe20 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 13 Nov 2016 15:47:49 +0100 Subject: [PATCH 086/171] CMovieBrowser: unfify and reduce flicker effects of connect line Connectline object can handle hide behavior itself. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5dc6255b433b4ecf3ed12e907e7b81ecc635c2bd Author: Thilo Graf Date: 2016-11-13 (Sun, 13 Nov 2016) --- src/gui/moviebrowser/mb.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index a021f4ad0..4a768d856 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1440,8 +1440,6 @@ void CMovieBrowser::refreshMovieInfo(void) { TRACE("[mb]->%s m_vMovieInfo.size %d\n", __func__, m_vMovieInfo.size()); - hideDetailsLine(); - // clear m_pcInfo1 text before new init m_pcInfo1->clear(); @@ -1502,18 +1500,12 @@ void CMovieBrowser::refreshMovieInfo(void) void CMovieBrowser::hideDetailsLine() { - refreshDetailsLine(-1); + if (m_detailsLine) + m_detailsLine->hide(); } void CMovieBrowser::refreshDetailsLine(int pos) { - if (m_detailsLine) - { - m_detailsLine->kill(); - delete m_detailsLine; - m_detailsLine = NULL; - } - if (pos >= 0) { int fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_LIST]->getHeight(); @@ -1525,8 +1517,10 @@ void CMovieBrowser::refreshDetailsLine(int pos) int ypos2 = m_cBoxFrameInfo1.iY + (m_cBoxFrameInfo1.iHeight/2); if (m_detailsLine == NULL) - m_detailsLine = new CComponentsDetailLine(xpos, ypos1, ypos2, fheight/2, m_cBoxFrameInfo1.iHeight-2*RADIUS_LARGE); - m_detailsLine->paint(false); + m_detailsLine = new CComponentsDetailLine(); + + m_detailsLine->setDimensionsAll(xpos, ypos1, ypos2, fheight/2, m_cBoxFrameInfo1.iHeight-2*RADIUS_LARGE); + m_detailsLine->paint(true); } } From c6851f5bbd42c61176655994900c3149a00be91c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 14 Nov 2016 10:09:34 +0100 Subject: [PATCH 087/171] moviebrowser: add PREVPLAYDATE/RECORDDATE sort buttons to footer Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2f23aaedea8d219f068f569929f26d6804509e34 Author: vanhofen Date: 2016-11-14 (Mon, 14 Nov 2016) Origin message was: ------------------ - moviebrowser: add PREVPLAYDATE/RECORDDATE sort buttons to footer --- src/gui/moviebrowser/mb.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 4a768d856..0a59121f2 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2014,6 +2014,18 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) CMenuWidget m(LOCALE_MOVIEBROWSER_FOOT_SORT, NEUTRINO_ICON_SETTINGS); m.addIntroItems(); + // add PREVPLAYDATE/RECORDDATE sort buttons to footer + m.addKey(CRCInput::RC_red, selector, to_string(MB_INFO_PREVPLAYDATE).c_str()); + m.addKey(CRCInput::RC_green, selector, to_string(MB_INFO_RECORDDATE).c_str()); + + button_label footerButtons[] = { + { NEUTRINO_ICON_BUTTON_RED, LOCALE_MOVIEBROWSER_INFO_PREVPLAYDATE}, + { NEUTRINO_ICON_BUTTON_GREEN, LOCALE_MOVIEBROWSER_INFO_RECORDDATE} + }; + int footerButtonsCount = sizeof(footerButtons) / sizeof(button_label); + + m.setFooter(footerButtons, footerButtonsCount); + // just show sorting options for displayed rows; sorted by rows for (int row = 0; row < MB_MAX_ROWS && row < m_settings.browserRowNr; row++) { @@ -2022,6 +2034,10 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) if (sortBy[i] == NULL) continue; + // already added to footer + if (i == MB_INFO_PREVPLAYDATE || i == MB_INFO_RECORDDATE) + continue; + if (m_settings.browserRowItem[row] == i) m.addItem(new CMenuForwarder(g_Locale->getText(m_localizedItemName[i]), true, NULL, selector, to_string(i).c_str(), CRCInput::convertDigitToKey(directkey++))); } From 4dbaafb40d9e19738eb52fb0b446a7f4c86d0131 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 14 Nov 2016 19:27:09 +0100 Subject: [PATCH 088/171] src/gui/widget/menue.cpp try fix hide info_box (in channellist) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/99c57d30751643342edc9f87720645063ef2e181 Author: Jacek Jendrzej Date: 2016-11-14 (Mon, 14 Nov 2016) --- src/gui/widget/menue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 25b9cc6eb..ad783f396 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1429,7 +1429,7 @@ void CMenuWidget::paintHint(int pos) if (details_line) details_line->hide(); /* clear info box */ - if ((info_box) && (pos < 0)) + if ((info_box) && ((pos < 0) || savescreen)) savescreen ? info_box->hide() : info_box->kill(); if (info_box) hint_painted = info_box->isPainted(); From 66639b877f0ffe6d7f3eecf177071bfbccc5aada Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 14 Nov 2016 22:58:43 +0100 Subject: [PATCH 089/171] followscreenings: allow to turn off followscreenings list Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d6cb1d206f9535c7c9db634e9da8cc36997f94e0 Author: vanhofen Date: 2016-11-14 (Mon, 14 Nov 2016) Origin message was: ------------------ - followscreenings: allow to turn off followscreenings list --- data/locale/deutsch.locale | 2 ++ data/locale/english.locale | 2 ++ src/gui/followscreenings.cpp | 9 +++++---- src/gui/record_setup.cpp | 7 +++++++ src/neutrino.cpp | 2 ++ src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ src/system/settings.h | 1 + 8 files changed, 23 insertions(+), 4 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index c3de46465..60122e160 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1429,6 +1429,7 @@ menu.hint_subchannel_pos Wählen Sie die Anzeigeposition der Unterkanäle aus menu.hint_sw_update Neutrino-HD aktualisieren, Image sichern und wiederherstellen menu.hint_theme Wählen Sie ein vordefiniertes Farbschema, speichern oder laden Sie ihre eigenen Farbschemata menu.hint_timeouts Gibt an, nach welcher Zeit in Sekunden die Menüs oder Infofenster sich automatisch schließen (0 deaktiviert) +menu.hint_timer_followscreenings Zeige Terminauswahl mit Folge-Events zur Timerprogrammierung menu.hint_timers Hinzufügen, entfernen und bearbeiten geplanter Aufnahmen oder anderer Timer menu.hint_timezone Wählen Sie ihre Zeitzone aus menu.hint_tmdb_api_key Geben Sie den TMDb API Schlüssel ein. Eine leere Eingabe schaltet die TMDb-Unterstützung aus @@ -2381,6 +2382,7 @@ timerlist.type.zapto Umschalten timerlist.weekdays Wochentage timerlist.weekdays.hint_1 Mo Di Mi Do Fr Sa So timerlist.weekdays.hint_2 'X'=Timer '-' kein Timer +timersettings.followscreenings Zeige Terminauswahl timersettings.record_safety_time_after Aufnahmeende-Korrektur timersettings.record_safety_time_after.hint_1 Korrekturzeit in Min. (00=aus), die auf die End- timersettings.record_safety_time_after.hint_2 zeit des jeweiligen Timers addiert wird diff --git a/data/locale/english.locale b/data/locale/english.locale index ed16dddb2..5650de51b 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1429,6 +1429,7 @@ menu.hint_subchannel_pos Select subchannels menu position menu.hint_sw_update Update software menu.hint_theme Select pre-defined color theme\nSave or load theme from files menu.hint_timeouts Configure time to hide GUI windows\nin seconds +menu.hint_timer_followscreenings Show selection with followscreenings for timer programming menu.hint_timers Add/Remove/Edit scheduled\nrecording, reminders etc. menu.hint_timezone Select your timezone menu.hint_tmdb_api_key Type your TMDb API key. An empty input disables TMDb support @@ -2381,6 +2382,7 @@ timerlist.type.zapto Zap to timerlist.weekdays Days of the week timerlist.weekdays.hint_1 Mo Tu We Th Fr Sa Su timerlist.weekdays.hint_2 'X'=timer '-' no timer +timersettings.followscreenings Show screening selection timersettings.record_safety_time_after Record stop time correction timersettings.record_safety_time_after.hint_1 Correction time in min. (00=off). This time timersettings.record_safety_time_after.hint_2 will added to stop time of every record timer. diff --git a/src/gui/followscreenings.cpp b/src/gui/followscreenings.cpp index f8a63edf0..8514a5b53 100644 --- a/src/gui/followscreenings.cpp +++ b/src/gui/followscreenings.cpp @@ -66,6 +66,9 @@ CChannelEventList *CFollowScreenings::getFollowScreenings(void) if (e->description != title) continue; followlist.push_back(*e); + + if (followlist.size() == 1 && !g_settings.timer_followscreenings) + break; } } return &followlist; @@ -87,7 +90,7 @@ int CFollowScreenings::exec(CMenuTarget* /*parent*/, const std::string & actionK if (i->eventType == CTimerd::TIMER_RECORD) { if (channel_id == i->channel_id && e->startTime == i->epg_starttime) { Timer.removeTimerEvent(i->eventID); - if (!forwarders.empty()) + if (!forwarders.empty() && followlist.size() > 1) forwarders[ix]->iconName_Info_right = ""; #if 0 else @@ -106,13 +109,11 @@ int CFollowScreenings::exec(CMenuTarget* /*parent*/, const std::string & actionK e->startTime, e->startTime - (ANNOUNCETIME + 120 ), apids, true, e->startTime - (ANNOUNCETIME + 120) > time(NULL), recDir, true) == -1) { //FIXME -- no error handling, but this shouldn't happen ... } else { - if (!forwarders.empty()) + if (!forwarders.empty() && followlist.size() > 1) forwarders[ix]->iconName_Info_right = NEUTRINO_ICON_REC; -#if 0 else ShowMsg(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); -#endif return menu_return::RETURN_REPAINT; } break; // for diff --git a/src/gui/record_setup.cpp b/src/gui/record_setup.cpp index 89a5c714d..e788f2da0 100644 --- a/src/gui/record_setup.cpp +++ b/src/gui/record_setup.cpp @@ -338,6 +338,13 @@ void CRecordSetup::showRecordTimerSetup(CMenuWidget *menu_timersettings) ch->setHint("", LOCALE_MENU_HINT_RECORD_ZAP_PRE_TIME); ch->setNumberFormat(nf); menu_timersettings->addItem(ch); + + menu_timersettings->addItem(GenericMenuSeparatorLine); + + //allow followscreenings + CMenuOptionChooser* followscreenings = new CMenuOptionChooser(LOCALE_TIMERSETTINGS_FOLLOWSCREENINGS, &g_settings.timer_followscreenings, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + followscreenings->setHint("", LOCALE_MENU_HINT_TIMER_FOLLOWSCREENINGS); + menu_timersettings->addItem(followscreenings); } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index a82795d94..4c5b09fc8 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -481,6 +481,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.timer_remotebox_ip.push_back(timer_rb); } } + g_settings.timer_followscreenings = configfile.getInt32( "timer_followscreenings", 1 ); g_settings.infobar_sat_display = configfile.getBool("infobar_sat_display" , true ); g_settings.infobar_show_channeldesc = configfile.getBool("infobar_show_channeldesc" , false ); @@ -1084,6 +1085,7 @@ void CNeutrinoApp::saveSetup(const char * fname) timer_remotebox_itemcount++; } configfile.setInt32 ( "timer_remotebox_ip_count", g_settings.timer_remotebox_ip.size()); + configfile.setInt32 ("timer_followscreenings", g_settings.timer_followscreenings); configfile.setBool("infobar_sat_display" , g_settings.infobar_sat_display ); configfile.setBool("infobar_show_channeldesc" , g_settings.infobar_show_channeldesc ); diff --git a/src/system/locals.h b/src/system/locals.h index cf4336a52..993edda05 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1456,6 +1456,7 @@ typedef enum LOCALE_MENU_HINT_SW_UPDATE, LOCALE_MENU_HINT_THEME, LOCALE_MENU_HINT_TIMEOUTS, + LOCALE_MENU_HINT_TIMER_FOLLOWSCREENINGS, LOCALE_MENU_HINT_TIMERS, LOCALE_MENU_HINT_TIMEZONE, LOCALE_MENU_HINT_TMDB_API_KEY, @@ -2408,6 +2409,7 @@ typedef enum LOCALE_TIMERLIST_WEEKDAYS, LOCALE_TIMERLIST_WEEKDAYS_HINT_1, LOCALE_TIMERLIST_WEEKDAYS_HINT_2, + LOCALE_TIMERSETTINGS_FOLLOWSCREENINGS, LOCALE_TIMERSETTINGS_RECORD_SAFETY_TIME_AFTER, LOCALE_TIMERSETTINGS_RECORD_SAFETY_TIME_AFTER_HINT_1, LOCALE_TIMERSETTINGS_RECORD_SAFETY_TIME_AFTER_HINT_2, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index da28b20bd..a062a9823 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1456,6 +1456,7 @@ const char * locale_real_names[] = "menu.hint_sw_update", "menu.hint_theme", "menu.hint_timeouts", + "menu.hint_timer_followscreenings", "menu.hint_timers", "menu.hint_timezone", "menu.hint_tmdb_api_key", @@ -2408,6 +2409,7 @@ const char * locale_real_names[] = "timerlist.weekdays", "timerlist.weekdays.hint_1", "timerlist.weekdays.hint_2", + "timersettings.followscreenings", "timersettings.record_safety_time_after", "timersettings.record_safety_time_after.hint_1", "timersettings.record_safety_time_after.hint_2", diff --git a/src/system/settings.h b/src/system/settings.h index bf67d66fc..c95d2f25b 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -460,6 +460,7 @@ struct SNeutrinoSettings int recording_startstop_msg; int shutdown_timer_record_type; std::vector timer_remotebox_ip; + int timer_followscreenings; std::string recording_filename_template; int recording_already_found_check; From 3b780688001b2ba8a010816ec46f1409da48061c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 15 Nov 2016 19:00:21 +0100 Subject: [PATCH 090/171] CInfoViewer: add missing shadow for timescale enableShadow() needs enum option. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c8ad32b1e4e0fbd3f037fe8ec24b896c5e65554d Author: Thilo Graf Date: 2016-11-15 (Tue, 15 Nov 2016) --- src/gui/infoviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 50a9e8879..aac4cdc7e 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1755,7 +1755,7 @@ void CInfoViewer::display_Info(const char *current, const char *next, timescale->setDimensionsAll(pb_startx, pb_starty, pb_w, pb_h); timescale->setActiveColor(COL_INFOBAR_PLUS_7); timescale->setPassiveColor(g_settings.infobar_progressbar ? COL_INFOBAR_PLUS_1 : COL_INFOBAR_PLUS_0); - timescale->enableShadow(!g_settings.infobar_progressbar); + timescale->enableShadow(!g_settings.infobar_progressbar ? CC_SHADOW_ON : CC_SHADOW_OFF, OFFSET_SHADOW/2); timescale->setValues(pb_p, pb_w); //printf("paintProgressBar(%d, %d, %d, %d)\n", BoxEndX - pb_w - OFFSET_SHADOW, ChanNameY - (pb_h + 10) , pb_w, pb_h); From bc10689bd74d3d738a5ab101edf90fd1ebd766f2 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Tue, 15 Nov 2016 21:30:12 +0100 Subject: [PATCH 091/171] timermanager: disable autoAdjustToEPG for repeating timers Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b657ef8b3c01e39a6397a85410249e4a7cc2f9b3 Author: TangoCash Date: 2016-11-15 (Tue, 15 Nov 2016) Origin message was: ------------------ - timermanager: disable autoAdjustToEPG for repeating timers --- src/timerd/timermanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 6e17a1c01..12800323c 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1143,7 +1143,7 @@ CTimerEvent_Record::CTimerEvent_Record(time_t announce_Time, time_t alarm_Time, eventInfo.apids = apids; recordingDir = recDir; epgTitle=""; - autoAdjustToEPG = _autoAdjustToEPG; + autoAdjustToEPG = (evrepeat == CTimerd::TIMERREPEAT_ONCE) ? _autoAdjustToEPG : false; recordingSafety = _recordingSafety; CShortEPGData epgdata; if (CEitManager::getInstance()->getEPGidShort(epgID, &epgdata)) From fad0d05a29059572cbc20458e9fd3a98919543e8 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 16 Nov 2016 19:29:19 +0100 Subject: [PATCH 092/171] src/gui/channellist.cpp cancel paint_events thread on hide Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f957bbaa374bc2922e561c66edb33d9e260371f2 Author: Jacek Jendrzej Date: 2016-11-16 (Wed, 16 Nov 2016) --- src/gui/channellist.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index d3653cd80..7c44d5bf4 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -960,14 +960,15 @@ int CChannelList::show() void CChannelList::hide() { + paint_events(-2); // cancel paint_events thread if ((g_settings.channellist_additional == 2) || (previous_channellist_additional == 2)) // with miniTV { if (cc_minitv) delete cc_minitv; cc_minitv = NULL; } - - header->kill(); + if(header) + header->kill(); if (CChannelLogo){ CChannelLogo->kill(); delete CChannelLogo; From 58daceb3cfa9544835db5ad66bb8566e69155d4f Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 16 Feb 2014 13:14:41 +0100 Subject: [PATCH 093/171] disable private copy of the linux dvb headers Move them into subdir private so that they are no longer used by default. They still can be used by extending the include path. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5e1efd222f51b8a676fcba259c8be0a9b1e8b9c6 Author: Stefan Seyfried Date: 2014-02-16 (Sun, 16 Feb 2014) --- src/zapit/include/{ => private}/linux/dvb/audio.h | 0 src/zapit/include/{ => private}/linux/dvb/ca.h | 0 src/zapit/include/{ => private}/linux/dvb/dmx.h | 0 src/zapit/include/{ => private}/linux/dvb/frontend.h | 0 src/zapit/include/{ => private}/linux/dvb/net.h | 0 src/zapit/include/{ => private}/linux/dvb/osd.h | 0 src/zapit/include/{ => private}/linux/dvb/version.h | 0 src/zapit/include/{ => private}/linux/dvb/video.h | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename src/zapit/include/{ => private}/linux/dvb/audio.h (100%) rename src/zapit/include/{ => private}/linux/dvb/ca.h (100%) rename src/zapit/include/{ => private}/linux/dvb/dmx.h (100%) rename src/zapit/include/{ => private}/linux/dvb/frontend.h (100%) rename src/zapit/include/{ => private}/linux/dvb/net.h (100%) rename src/zapit/include/{ => private}/linux/dvb/osd.h (100%) rename src/zapit/include/{ => private}/linux/dvb/version.h (100%) rename src/zapit/include/{ => private}/linux/dvb/video.h (100%) diff --git a/src/zapit/include/linux/dvb/audio.h b/src/zapit/include/private/linux/dvb/audio.h similarity index 100% rename from src/zapit/include/linux/dvb/audio.h rename to src/zapit/include/private/linux/dvb/audio.h diff --git a/src/zapit/include/linux/dvb/ca.h b/src/zapit/include/private/linux/dvb/ca.h similarity index 100% rename from src/zapit/include/linux/dvb/ca.h rename to src/zapit/include/private/linux/dvb/ca.h diff --git a/src/zapit/include/linux/dvb/dmx.h b/src/zapit/include/private/linux/dvb/dmx.h similarity index 100% rename from src/zapit/include/linux/dvb/dmx.h rename to src/zapit/include/private/linux/dvb/dmx.h diff --git a/src/zapit/include/linux/dvb/frontend.h b/src/zapit/include/private/linux/dvb/frontend.h similarity index 100% rename from src/zapit/include/linux/dvb/frontend.h rename to src/zapit/include/private/linux/dvb/frontend.h diff --git a/src/zapit/include/linux/dvb/net.h b/src/zapit/include/private/linux/dvb/net.h similarity index 100% rename from src/zapit/include/linux/dvb/net.h rename to src/zapit/include/private/linux/dvb/net.h diff --git a/src/zapit/include/linux/dvb/osd.h b/src/zapit/include/private/linux/dvb/osd.h similarity index 100% rename from src/zapit/include/linux/dvb/osd.h rename to src/zapit/include/private/linux/dvb/osd.h diff --git a/src/zapit/include/linux/dvb/version.h b/src/zapit/include/private/linux/dvb/version.h similarity index 100% rename from src/zapit/include/linux/dvb/version.h rename to src/zapit/include/private/linux/dvb/version.h diff --git a/src/zapit/include/linux/dvb/video.h b/src/zapit/include/private/linux/dvb/video.h similarity index 100% rename from src/zapit/include/linux/dvb/video.h rename to src/zapit/include/private/linux/dvb/video.h From 51969fed8fe02aa938f33323d00eaf21a5d5f623 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Wed, 16 Nov 2016 20:09:17 +0100 Subject: [PATCH 094/171] timermanager: try fix autoAdjustToEPG for (repeating) timers Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8cb0bef8e156a6398101dacce1b5acb586bb70bd Author: TangoCash Date: 2016-11-16 (Wed, 16 Nov 2016) --- src/timerd/timermanager.cpp | 85 +++++++++++++++++++++++++------------ src/timerd/timermanager.h | 1 + 2 files changed, 59 insertions(+), 27 deletions(-) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 12800323c..a7fecdb5c 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -427,6 +427,38 @@ int CTimerManager::rescheduleEvent(int peventID, time_t announceTime, time_t ala pthread_mutex_unlock(&tm_eventsMutex); return res; } + +int CTimerManager::adjustEvent(int peventID, time_t announceTime, time_t alarmTime, time_t stopTime) +{ + int res = 0; + pthread_mutex_lock(&tm_eventsMutex); + + if(events.find(peventID)!=events.end()) + { + CTimerEvent *event = events[peventID]; + printf("before: EventID: %d - State %d\n",peventID,(int) event->eventState); + time_t now = time(NULL); + if(event->announceTime > 0) + event->announceTime = announceTime; + if (event->announceTime > now) + event->eventState = CTimerd::TIMERSTATE_SCHEDULED; + if(event->alarmTime > 0) + event->alarmTime = alarmTime; + if ((event->alarmTime > now) && (event->announceTime < now)) + event->eventState = CTimerd::TIMERSTATE_PREANNOUNCE; + if(event->stopTime > 0) + event->stopTime = stopTime; + if ((event->stopTime > now) && (event->alarmTime < now)) + event->eventState = CTimerd::TIMERSTATE_ISRUNNING; + m_saveEvents=true; + res = peventID; + printf("after: EventID: %d - State %d\n",peventID,(int) event->eventState); + } + else + res = 0; + pthread_mutex_unlock(&tm_eventsMutex); + return res; +} // --------------------------------------------------------------------------------- void CTimerManager::loadEventsFromConfig() { @@ -1143,7 +1175,7 @@ CTimerEvent_Record::CTimerEvent_Record(time_t announce_Time, time_t alarm_Time, eventInfo.apids = apids; recordingDir = recDir; epgTitle=""; - autoAdjustToEPG = (evrepeat == CTimerd::TIMERREPEAT_ONCE) ? _autoAdjustToEPG : false; + autoAdjustToEPG = _autoAdjustToEPG; recordingSafety = _recordingSafety; CShortEPGData epgdata; if (CEitManager::getInstance()->getEPGidShort(epgID, &epgdata)) @@ -1214,6 +1246,8 @@ void CTimerEvent_Record::announceEvent() //------------------------------------------------------------ void CTimerEvent_Record::stopEvent() { + if (adjustToCurrentEPG()) + return; CTimerd::RecordingStopInfo stopinfo; // Set EPG-ID if not set stopinfo.eventID = eventID; @@ -1306,44 +1340,41 @@ bool CTimerEvent_Record::adjustToCurrentEPG() CChannelEventList evtlist; CEitManager::getInstance()->getEventsServiceKey(eventInfo.channel_id, evtlist); - time_t now = time(NULL); - time_t compare; - int pre, post; CTimerManager::getInstance()->getRecordingSafety(pre, post); - CChannelEventList::iterator first = evtlist.end(); - for (CChannelEventList::iterator e = evtlist.begin(); e != evtlist.end(); ++e) - { - compare = e->startTime; - if (!pre) - compare += e->duration; + time_t _announceTime = announceTime; + time_t _alarmTime = alarmTime; + time_t _stopTime = stopTime; - if (compare <= now) - continue; - if (first == evtlist.end() || first->startTime > e->startTime) - first = e; - if (alarmTime <= e->startTime && e->startTime + (int)e->duration <= stopTime) - return false; + if (recordingSafety) { + _alarmTime += pre; + _stopTime -= post; + } + + // we check for a time in the middle of the recording without considering pre and post + time_t check_time=_alarmTime/2 + _stopTime/2; + for ( CChannelEventList::iterator e= evtlist.begin(); e != evtlist.end(); ++e ) + { + if ( e->startTime <= check_time && (e->startTime + (int)e->duration) >= check_time) + { + _announceTime = e->startTime - (alarmTime - announceTime); + _alarmTime = e->startTime; + _stopTime = e->startTime + e->duration; + break; + } } - if (first == evtlist.end()) - return false; - time_t _announceTime = first->startTime - (alarmTime - announceTime); - time_t _alarmTime = first->startTime; - time_t _stopTime = first->startTime + first->duration; if (recordingSafety) { _alarmTime -= pre; _stopTime += post; } - CTimerEvent_Record *event= new CTimerEvent_Record(_announceTime, _alarmTime, _stopTime, - eventInfo.channel_id, eventInfo.epgID, first->startTime, eventInfo.apids, - CTimerd::TIMERREPEAT_ONCE, 1, recordingDir, recordingSafety, autoAdjustToEPG); - CTimerManager::getInstance()->addEvent(event,false); - setState(CTimerd::TIMERSTATE_HASFINISHED); + if ((_alarmTime != alarmTime) || (_announceTime != announceTime) || (_stopTime != stopTime)) + if (CTimerManager::getInstance()->adjustEvent(eventID, _announceTime, _alarmTime, _stopTime)) + return true; - return true; + return false; } //============================================================= // Zapto Event diff --git a/src/timerd/timermanager.h b/src/timerd/timermanager.h index 188751e45..414ebf28e 100644 --- a/src/timerd/timermanager.h +++ b/src/timerd/timermanager.h @@ -249,6 +249,7 @@ public: int modifyEvent(int eventID, time_t announceTime, time_t alarmTime, time_t stopTime, uint32_t repeatcount, CTimerd::CTimerEventRepeat evrepeat, CTimerd::responseGetTimer& data); int modifyEvent(int eventID, unsigned char apids); int rescheduleEvent(int eventID, time_t announceTime, time_t alarmTime, time_t stopTime); + int adjustEvent(int eventID, time_t announceTime, time_t alarmTime, time_t stopTime); void saveEventsToConfig(); void loadEventsFromConfig(); bool shutdown(); From 24d2ccfea67890481614673f3e7da1f3adbc14c3 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Wed, 16 Nov 2016 20:30:14 +0100 Subject: [PATCH 095/171] make sure the private dvb headers are used on coolstream Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/045587f6eca8b9e67814dfa97f14f1c07e86b3f9 Author: Stefan Seyfried Date: 2016-11-16 (Wed, 16 Nov 2016) --- configure.ac | 4 ++-- lib/sectionsdclient/Makefile.am | 1 + lib/timerdclient/Makefile.am | 1 + src/nhttpd/Makefile.am | 3 ++- src/nhttpd/yhttpd_mods/Makefile.am | 1 + src/timerd/Makefile.am | 1 + src/zapit/lib/Makefile.am | 1 + 7 files changed, 9 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 1f553e6e0..7fd8adc65 100644 --- a/configure.ac +++ b/configure.ac @@ -220,7 +220,7 @@ if test "$BOXTYPE" = "coolstream"; then if test -e ${srcdir}/lib/libcoolstream/nevis_ir.h; then AC_DEFINE(HAVE_COOLSTREAM_NEVIS_IR_H,1,[Define to 1 if you have the header file.]) fi -HWLIB_CFLAGS='-I$(top_srcdir)/lib/libcoolstream' +HWLIB_CFLAGS='-I$(top_srcdir)/lib/libcoolstream -I$(top_srcdir)/src/zapit/include/private' if test "$BOXMODEL" = "apollo"; then if test -e ${srcdir}/lib/libcoolstream2/cs_ir_generic.h; then @@ -229,7 +229,7 @@ fi if test -e ${srcdir}/lib/libcoolstream2/cs_frontpanel.h; then AC_DEFINE(HAVE_COOLSTREAM_CS_FRONTPANEL_H,1,[Define to 1 if you have the header file.]) fi -HWLIB_CFLAGS='-I$(top_srcdir)/lib/libcoolstream2' +HWLIB_CFLAGS='-I$(top_srcdir)/lib/libcoolstream2 -I$(top_srcdir)/src/zapit/include/private' fi fi diff --git a/lib/sectionsdclient/Makefile.am b/lib/sectionsdclient/Makefile.am index 016fb6603..8a322cd07 100644 --- a/lib/sectionsdclient/Makefile.am +++ b/lib/sectionsdclient/Makefile.am @@ -1,4 +1,5 @@ AM_CPPFLAGS = \ + @HWLIB_CFLAGS@ \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src/zapit/include \ -I$(top_srcdir)/lib/connection \ diff --git a/lib/timerdclient/Makefile.am b/lib/timerdclient/Makefile.am index ce2f0f72d..96b51f53b 100644 --- a/lib/timerdclient/Makefile.am +++ b/lib/timerdclient/Makefile.am @@ -1,4 +1,5 @@ AM_CPPFLAGS = \ + @HWLIB_CFLAGS@ \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src/zapit/include \ -I$(top_srcdir)/lib/connection \ diff --git a/src/nhttpd/Makefile.am b/src/nhttpd/Makefile.am index d1aae8bc4..1ea01bff6 100644 --- a/src/nhttpd/Makefile.am +++ b/src/nhttpd/Makefile.am @@ -3,6 +3,7 @@ SUBDIRS = yhttpd_core yhttpd_mods tuxboxapi web AM_CPPFLAGS = -fno-rtti -fno-exceptions -D_FILE_OFFSET_BITS=64 AM_CPPFLAGS += \ + @HWLIB_CFLAGS@ \ -I$(srcdir) \ -I$(top_builddir) \ -I$(top_srcdir) \ @@ -23,4 +24,4 @@ libnhttpd_a_SOURCES = yhttpd.cpp libnhttpd_adir = @CONFIGDIR@ libnhttpd_a_DATA = nhttpd.conf -EXTRA_DIST = nhttpd.conf nhttpd.conf.in \ No newline at end of file +EXTRA_DIST = nhttpd.conf nhttpd.conf.in diff --git a/src/nhttpd/yhttpd_mods/Makefile.am b/src/nhttpd/yhttpd_mods/Makefile.am index 2e748d983..a08445dbd 100644 --- a/src/nhttpd/yhttpd_mods/Makefile.am +++ b/src/nhttpd/yhttpd_mods/Makefile.am @@ -1,4 +1,5 @@ AM_CPPFLAGS = \ + @HWLIB_CFLAGS@ \ -I$(top_builddir) \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src/zapit/include \ diff --git a/src/timerd/Makefile.am b/src/timerd/Makefile.am index 4bbe89fa6..b3c68456f 100644 --- a/src/timerd/Makefile.am +++ b/src/timerd/Makefile.am @@ -1,6 +1,7 @@ AM_CPPFLAGS = -fno-rtti -fno-exceptions -D__STDC_FORMAT_MACROS AM_CPPFLAGS += \ + @HWLIB_CFLAGS@ \ -I$(top_builddir) \ -I$(top_srcdir) \ -I$(top_srcdir)/src \ diff --git a/src/zapit/lib/Makefile.am b/src/zapit/lib/Makefile.am index 2d884b259..e62c50637 100644 --- a/src/zapit/lib/Makefile.am +++ b/src/zapit/lib/Makefile.am @@ -1,6 +1,7 @@ AM_CPPFLAGS = -fno-rtti -fno-exceptions AM_CPPFLAGS += \ + @HWLIB_CFLAGS@ \ -I$(top_builddir) \ -I$(top_srcdir) \ -I$(top_srcdir)/src/zapit/include \ From 0b6c5638ef4bd3d99244ca72d5234988576e5f35 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 17 Nov 2016 01:48:32 +0100 Subject: [PATCH 096/171] moviebrowser: fix input for end mark and lastplay mark Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/86c3655e967d9adbdfcd6b0d34c9c1a47e9e6f95 Author: vanhofen Date: 2016-11-17 (Thu, 17 Nov 2016) Origin message was: ------------------ - moviebrowser: fix input for end mark and lastplay mark --- src/gui/moviebrowser/mb.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 0a59121f2..fc5810c15 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3159,8 +3159,8 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) bookmarkMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_BOOK_CLEAR_ALL, true, NULL, this, "book_clear_all",CRCInput::RC_blue)); bookmarkMenu.addItem(GenericMenuSeparatorLine); bookmarkMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_BOOK_MOVIESTART, true, bookStartIntInput.getValue(), &bookStartIntInput)); - bookmarkMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_BOOK_MOVIEEND, true, bookEndIntInput.getValue(), &bookLastIntInput)); - bookmarkMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_BOOK_LASTMOVIESTOP, true, bookLastIntInput.getValue(), &bookEndIntInput)); + bookmarkMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_BOOK_MOVIEEND, true, bookEndIntInput.getValue(), &bookEndIntInput)); + bookmarkMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_BOOK_LASTMOVIESTOP, true, bookLastIntInput.getValue(), &bookLastIntInput)); bookmarkMenu.addItem(GenericMenuSeparatorLine); for (int li =0 ; li < MI_MOVIE_BOOK_USER_MAX && li < MAX_NUMBER_OF_BOOKMARK_ITEMS; li++) From 65b818f8aac794ba6982a1025123e89e89bc3f7d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 17 Nov 2016 01:48:32 +0100 Subject: [PATCH 097/171] locale: small changes in moviebrowser's bookmark locales Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7a3839c7f596a326c5a0bac9cbb49e219bcef3ae Author: vanhofen Date: 2016-11-17 (Thu, 17 Nov 2016) Origin message was: ------------------ - locale: small changes in moviebrowser's bookmark locales --- data/locale/deutsch.locale | 8 ++++---- data/locale/english.locale | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 60122e160..f68a06067 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1632,7 +1632,7 @@ moviebrowser.book_name Name: moviebrowser.book_new Neue Markierung moviebrowser.book_no_end Keine Endmarkierung gefunden moviebrowser.book_position Position: -moviebrowser.book_type Sprung (<0 zurück, >0 vor): +moviebrowser.book_type Sprung (<0: zurück, >0: vor): moviebrowser.book_type_backward Wiederholung moviebrowser.book_type_forward Überspringen moviebrowser.browser_additional Zusätzliche Informationen @@ -1655,13 +1655,13 @@ moviebrowser.delete_screenshot Lösche Screenshot? moviebrowser.dir Pfad moviebrowser.directories Verzeichnisse moviebrowser.directories_additional Zusätzliche Verzeichnisse -moviebrowser.edit_book Bookmark Ändern +moviebrowser.edit_book Markierung ändern moviebrowser.edit_book_name_info1 Neuer Markierungsname -moviebrowser.edit_book_name_info2 Markierungsname info2 +moviebrowser.edit_book_name_info2 moviebrowser.edit_book_pos_info1 Neue Position (s) moviebrowser.edit_book_pos_info2 moviebrowser.edit_book_type_info1 Neue Sprunglänge (s) -moviebrowser.edit_book_type_info2 <0 zurück , >0 vor, 0: kein +moviebrowser.edit_book_type_info2 <0: zurück, >0: vor, 0: kein moviebrowser.edit_serie Name der Serie moviebrowser.error_no_movies Keine Filme gefunden moviebrowser.filter_off Filter aus diff --git a/data/locale/english.locale b/data/locale/english.locale index 5650de51b..499b67789 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1627,14 +1627,14 @@ moviebrowser.book_clear_all Clear all moviebrowser.book_head Bookmarks moviebrowser.book_lastmoviestop Last play stop: moviebrowser.book_movieend Movie end: -moviebrowser.book_moviestart User Movie start: +moviebrowser.book_moviestart Movie start: moviebrowser.book_name Name: -moviebrowser.book_new New Bookmark -moviebrowser.book_no_end No end bookmark defined +moviebrowser.book_new New bookmark +moviebrowser.book_no_end No end mark defined moviebrowser.book_position Position: -moviebrowser.book_type Jump (<0 back , >0 for): +moviebrowser.book_type Jump (<0: backward, >0: forward): moviebrowser.book_type_backward Repeat -moviebrowser.book_type_forward jump over +moviebrowser.book_type_forward Jump over moviebrowser.browser_additional Additional informations moviebrowser.browser_frame_high Browser height [%] moviebrowser.browser_row_head Row settings @@ -1655,13 +1655,13 @@ moviebrowser.delete_screenshot Delete screenshot? moviebrowser.dir Path moviebrowser.directories Directories moviebrowser.directories_additional Additional directories -moviebrowser.edit_book Bookmark change -moviebrowser.edit_book_name_info1 Enter new Bookmark name -moviebrowser.edit_book_name_info2 book name info2 -moviebrowser.edit_book_pos_info1 Enter new Position (s) +moviebrowser.edit_book Change bookmark +moviebrowser.edit_book_name_info1 Enter new bookmark name +moviebrowser.edit_book_name_info2 +moviebrowser.edit_book_pos_info1 Enter new position (s) moviebrowser.edit_book_pos_info2 moviebrowser.edit_book_type_info1 Enter new jump length (s) -moviebrowser.edit_book_type_info2 <0 back , >0 for, 0: none +moviebrowser.edit_book_type_info2 <0: backward, >0: forward, 0: none moviebrowser.edit_serie Enter name of serie moviebrowser.error_no_movies No movies found moviebrowser.filter_off Filter off From d9b77ffd7b8d86a830770e5d5cfd20d7fb3b20ca Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 17 Nov 2016 01:48:32 +0100 Subject: [PATCH 098/171] moviebrowser: use red key to remove all user bookmarks Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d171038a6e603ffd0dac89681a8f7e7a9dda0554 Author: vanhofen Date: 2016-11-17 (Thu, 17 Nov 2016) Origin message was: ------------------ - moviebrowser: use red key to remove all user bookmarks --- src/gui/moviebrowser/mb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index fc5810c15..2bb550ec3 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3156,7 +3156,7 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) CMenuWidget bookmarkMenu(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER); bookmarkMenu.addIntroItems(LOCALE_MOVIEBROWSER_BOOK_HEAD); - bookmarkMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_BOOK_CLEAR_ALL, true, NULL, this, "book_clear_all",CRCInput::RC_blue)); + bookmarkMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_BOOK_CLEAR_ALL, true, NULL, this, "book_clear_all", CRCInput::RC_red)); bookmarkMenu.addItem(GenericMenuSeparatorLine); bookmarkMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_BOOK_MOVIESTART, true, bookStartIntInput.getValue(), &bookStartIntInput)); bookmarkMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_BOOK_MOVIEEND, true, bookEndIntInput.getValue(), &bookEndIntInput)); From 44c7c41e61add845e2f9e789ce0839478b78c9b1 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 17 Nov 2016 01:48:32 +0100 Subject: [PATCH 099/171] moviebrowser: more clarity in bookmark menu Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/365f36df92153790f355e1c9b1452f7dfec3b999 Author: vanhofen Date: 2016-11-17 (Thu, 17 Nov 2016) Origin message was: ------------------ - moviebrowser: more clarity in bookmark menu --- src/gui/moviebrowser/mb.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 2bb550ec3..449173685 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3165,17 +3165,21 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) for (int li =0 ; li < MI_MOVIE_BOOK_USER_MAX && li < MAX_NUMBER_OF_BOOKMARK_ITEMS; li++) { - CKeyboardInput * pBookNameInput = new CKeyboardInput(LOCALE_MOVIEBROWSER_EDIT_BOOK_NAME_INFO1, &movie_info->bookmarks.user[li].name, 20); - CIntInput *pBookPosIntInput = new CIntInput(LOCALE_MOVIEBROWSER_EDIT_BOOK, (int *)&movie_info->bookmarks.user[li].pos, 20, LOCALE_MOVIEBROWSER_EDIT_BOOK_POS_INFO1, LOCALE_MOVIEBROWSER_EDIT_BOOK_POS_INFO2); - CIntInput *pBookTypeIntInput = new CIntInput(LOCALE_MOVIEBROWSER_EDIT_BOOK, (int *)&movie_info->bookmarks.user[li].length, 20, LOCALE_MOVIEBROWSER_EDIT_BOOK_TYPE_INFO1, LOCALE_MOVIEBROWSER_EDIT_BOOK_TYPE_INFO2); + std::string bookmark_user_name = g_Locale->getText(LOCALE_MOVIEBROWSER_BOOK_NEW); + if (!movie_info->bookmarks.user[li].name.empty()) + bookmark_user_name = movie_info->bookmarks.user[li].name; + + CKeyboardInput *pBookNameInput = new CKeyboardInput(LOCALE_MOVIEBROWSER_EDIT_BOOK, &movie_info->bookmarks.user[li].name, 20, NULL, NULL, LOCALE_MOVIEBROWSER_EDIT_BOOK_NAME_INFO1, LOCALE_MOVIEBROWSER_EDIT_BOOK_NAME_INFO2); + CIntInput *pBookPosIntInput = new CIntInput(LOCALE_MOVIEBROWSER_EDIT_BOOK, (int *)&movie_info->bookmarks.user[li].pos, 5, LOCALE_MOVIEBROWSER_EDIT_BOOK_POS_INFO1, LOCALE_MOVIEBROWSER_EDIT_BOOK_POS_INFO2); + CIntInput *pBookTypeIntInput = new CIntInput(LOCALE_MOVIEBROWSER_EDIT_BOOK, (int *)&movie_info->bookmarks.user[li].length, 20, LOCALE_MOVIEBROWSER_EDIT_BOOK_TYPE_INFO1, LOCALE_MOVIEBROWSER_EDIT_BOOK_TYPE_INFO2); CMenuWidget* pBookItemMenu = new CMenuWidget(LOCALE_MOVIEBROWSER_BOOK_HEAD, NEUTRINO_ICON_MOVIEPLAYER); pBookItemMenu->addItem(GenericMenuSeparator); - pBookItemMenu->addItem(new CMenuDForwarder(LOCALE_MOVIEBROWSER_BOOK_NAME, true, movie_info->bookmarks.user[li].name, pBookNameInput)); + pBookItemMenu->addItem(new CMenuDForwarder(LOCALE_MOVIEBROWSER_BOOK_NAME, true, bookmark_user_name.c_str(), pBookNameInput)); pBookItemMenu->addItem(new CMenuDForwarder(LOCALE_MOVIEBROWSER_BOOK_POSITION, true, pBookPosIntInput->getValue(), pBookPosIntInput)); pBookItemMenu->addItem(new CMenuDForwarder(LOCALE_MOVIEBROWSER_BOOK_TYPE, true, pBookTypeIntInput->getValue(), pBookTypeIntInput)); - bookmarkMenu.addItem(new CMenuDForwarder(movie_info->bookmarks.user[li].name.c_str(), true, pBookPosIntInput->getValue(), pBookItemMenu)); + bookmarkMenu.addItem(new CMenuDForwarder(bookmark_user_name.c_str(), true, pBookPosIntInput->getValue(), pBookItemMenu)); } /********************************************************************/ From 680ef07635be36c29a148013e727972ffc88245e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 17 Nov 2016 10:19:53 +0100 Subject: [PATCH 100/171] moviebrowser: resort movie info menu Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b43145af7c37407b2acb3ac02ed1e70a021a5441 Author: vanhofen Date: 2016-11-17 (Thu, 17 Nov 2016) Origin message was: ------------------ - moviebrowser: resort movie info menu --- src/gui/moviebrowser/mb.cpp | 47 +++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 449173685..522a92eb4 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3225,15 +3225,15 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) strncpy(dirItNr, m_dirNames[movie_info->dirItNr].c_str(),BUFFER_SIZE-1); snprintf(size,BUFFER_SIZE,"%5" PRIu64 "",movie_info->file.Size>>20); - CKeyboardInput titelUserInput(LOCALE_MOVIEBROWSER_INFO_TITLE, &movie_info->epgTitle, (movie_info->epgTitle.empty() || (movie_info->epgTitle.size() < MAX_STRING)) ? MAX_STRING:movie_info->epgTitle.size()); + CKeyboardInput titelUserInput(LOCALE_MOVIEBROWSER_INFO_TITLE, &movie_info->epgTitle, (movie_info->epgTitle.empty() || (movie_info->epgTitle.size() < MAX_STRING)) ? MAX_STRING:movie_info->epgTitle.size()); CKeyboardInput channelUserInput(LOCALE_MOVIEBROWSER_INFO_CHANNEL, &movie_info->channelName, MAX_STRING); CKeyboardInput epgUserInput(LOCALE_MOVIEBROWSER_INFO_INFO1, &movie_info->epgInfo1, 20); CKeyboardInput countryUserInput(LOCALE_MOVIEBROWSER_INFO_PRODCOUNTRY, &movie_info->productionCountry, 11); - CDateInput dateUserDateInput(LOCALE_MOVIEBROWSER_INFO_LENGTH, &movie_info->dateOfLastPlay, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); - CDateInput recUserDateInput(LOCALE_MOVIEBROWSER_INFO_LENGTH, &movie_info->file.Time, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); - CIntInput lengthUserIntInput(LOCALE_MOVIEBROWSER_INFO_LENGTH, (int *)&movie_info->length, 3, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); - CIntInput yearUserIntInput(LOCALE_MOVIEBROWSER_INFO_PRODYEAR, (int *)&movie_info->productionDate, 4, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); + CDateInput dateUserDateInput(LOCALE_MOVIEBROWSER_INFO_LENGTH, &movie_info->dateOfLastPlay); + CDateInput recUserDateInput(LOCALE_MOVIEBROWSER_INFO_LENGTH, &movie_info->file.Time); + CIntInput lengthUserIntInput(LOCALE_MOVIEBROWSER_INFO_LENGTH, (int *)&movie_info->length, 3); + CIntInput yearUserIntInput(LOCALE_MOVIEBROWSER_INFO_PRODYEAR, (int *)&movie_info->productionDate, 4); CMenuOptionNumberChooser *rate = new CMenuOptionNumberChooser(LOCALE_MOVIEBROWSER_INFO_RATING, &movie_info->rating, true, 0, 100, NULL); rate->setNumberFormat(rateFormat); @@ -3241,27 +3241,28 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) CMenuWidget movieInfoMenu(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER); movieInfoMenu.addIntroItems(LOCALE_MOVIEBROWSER_INFO_HEAD); - movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_SAVE, true, NULL, this, "save_movie_info", CRCInput::RC_red)); - movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_HEAD_UPDATE, true, NULL, &movieInfoMenuUpdate, NULL, CRCInput::RC_green)); - movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_BOOK_HEAD, true, NULL, &bookmarkMenu, NULL, CRCInput::RC_blue)); + movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_SAVE, true, NULL, this, "save_movie_info", CRCInput::RC_red)); + movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_HEAD_UPDATE, true, NULL, &movieInfoMenuUpdate, NULL, CRCInput::RC_green)); + movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_BOOK_HEAD, true, NULL, &bookmarkMenu, NULL, CRCInput::RC_blue)); movieInfoMenu.addItem(GenericMenuSeparatorLine); - movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_TITLE, true, movie_info->epgTitle, &titelUserInput,NULL, CRCInput::RC_1)); - movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_SERIE, true, movie_info->serieName, &serieMenu,NULL, CRCInput::RC_2)); - movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_INFO1, (movie_info->epgInfo1.size() <= MAX_STRING) /*true*/, movie_info->epgInfo1, &epgUserInput,NULL, CRCInput::RC_3)); - movieInfoMenu.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR, &movie_info->genreMajor, GENRE_ALL, GENRE_ALL_COUNT, true,NULL, CRCInput::RC_4, "", true)); + movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_TITLE, true, movie_info->epgTitle, &titelUserInput, NULL, CRCInput::RC_1)); + movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_SERIE, true, movie_info->serieName, &serieMenu, NULL, CRCInput::RC_2)); + movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_INFO1, (movie_info->epgInfo1.size() <= MAX_STRING), movie_info->epgInfo1, &epgUserInput, NULL, CRCInput::RC_3)); + movieInfoMenu.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR, &movie_info->genreMajor, GENRE_ALL, GENRE_ALL_COUNT, true, NULL, CRCInput::RC_4, "", true)); + movieInfoMenu.addItem(GenericMenuSeparatorLine); + movieInfoMenu.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_PARENTAL_LOCKAGE, &movie_info->parentalLockAge, MESSAGEBOX_PARENTAL_LOCKAGE_OPTIONS, MESSAGEBOX_PARENTAL_LOCKAGE_OPTION_COUNT, true, NULL, CRCInput::RC_5)); + movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PRODYEAR, true, yearUserIntInput.getValue(), &yearUserIntInput, NULL, CRCInput::RC_6)); + movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PRODCOUNTRY, true, movie_info->productionCountry, &countryUserInput, NULL, CRCInput::RC_7)); + movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_LENGTH, true, lengthUserIntInput.getValue(), &lengthUserIntInput, NULL, CRCInput::RC_8)); + movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_CHANNEL, true, movie_info->channelName, &channelUserInput, NULL, CRCInput::RC_9)); + movieInfoMenu.addItem(GenericMenuSeparatorLine); + movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PATH, false, dirItNr)); + movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PREVPLAYDATE, false, dateUserDateInput.getValue())); + movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_RECORDDATE, false, recUserDateInput.getValue())); + movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_SIZE, false, size)); movieInfoMenu.addItem(GenericMenuSeparatorLine); movieInfoMenu.addItem(rate); - movieInfoMenu.addItem(new CMenuOptionNumberChooser(LOCALE_MOVIEBROWSER_INFO_QUALITY,&movie_info->quality,true,0,3, NULL)); - movieInfoMenu.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_PARENTAL_LOCKAGE, &movie_info->parentalLockAge, MESSAGEBOX_PARENTAL_LOCKAGE_OPTIONS, MESSAGEBOX_PARENTAL_LOCKAGE_OPTION_COUNT, true,NULL, CRCInput::RC_6)); - movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PRODYEAR, true, yearUserIntInput.getValue(), &yearUserIntInput,NULL, CRCInput::RC_7)); - movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PRODCOUNTRY, true, movie_info->productionCountry, &countryUserInput,NULL, CRCInput::RC_8)); - movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_LENGTH, true, lengthUserIntInput.getValue(), &lengthUserIntInput,NULL, CRCInput::RC_9)); - movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_CHANNEL, true, movie_info->channelName, &channelUserInput,NULL, CRCInput::RC_0));//LOCALE_TIMERLIST_CHANNEL - movieInfoMenu.addItem(GenericMenuSeparatorLine); - movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PATH, false, dirItNr)); //LOCALE_TIMERLIST_RECORDING_DIR - movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PREVPLAYDATE, false, dateUserDateInput.getValue()));//LOCALE_FLASHUPDATE_CURRENTVERSIONDATE - movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_RECORDDATE, false, recUserDateInput.getValue()));//LOCALE_FLASHUPDATE_CURRENTVERSIONDATE - movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_SIZE, false, size, NULL)); + movieInfoMenu.addItem(new CMenuOptionNumberChooser(LOCALE_MOVIEBROWSER_INFO_QUALITY, &movie_info->quality, true, 0, 3, NULL)); int res = movieInfoMenu.exec(NULL,""); From 8d52f31f5eb64481e6af3a7e1bfddfb5b336852e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 17 Nov 2016 10:19:53 +0100 Subject: [PATCH 101/171] moviebrowser: resort movie info update menu Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/de27a8a36c5d418abc51da8c5ca6641bb8d7292d Author: vanhofen Date: 2016-11-17 (Thu, 17 Nov 2016) Origin message was: ------------------ - moviebrowser: resort movie info update menu --- src/gui/moviebrowser/mb.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 522a92eb4..b0a5b7d74 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3201,20 +3201,20 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) CMenuWidget movieInfoMenuUpdate(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER); movieInfoMenuUpdate.addIntroItems(LOCALE_MOVIEBROWSER_INFO_HEAD_UPDATE); - movieInfoMenuUpdate.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_SAVE_ALL, true, NULL, this, "save_movie_info_all",CRCInput::RC_red)); + movieInfoMenuUpdate.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_SAVE_ALL, true, NULL, this, "save_movie_info_all", CRCInput::RC_red)); movieInfoMenuUpdate.addItem(GenericMenuSeparatorLine); - movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_UPDATE_IF_DEST_EMPTY_ONLY, (&movieInfoUpdateAllIfDestEmptyOnly), MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL,CRCInput::RC_blue)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_UPDATE_IF_DEST_EMPTY_ONLY, (&movieInfoUpdateAllIfDestEmptyOnly), MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_blue)); movieInfoMenuUpdate.addItem(GenericMenuSeparatorLine); movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_TITLE, &movieInfoUpdateAll[MB_INFO_TITLE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_1)); - movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_INFO1, &movieInfoUpdateAll[MB_INFO_INFO1], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_2)); - movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_SERIE, &movieInfoUpdateAll[MB_INFO_SERIE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_3)); - movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_RATING, &movieInfoUpdateAll[MB_INFO_RATING], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_4)); - movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_QUALITY, &movieInfoUpdateAll[MB_INFO_QUALITY], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_5)); - movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_PARENTAL_LOCKAGE, &movieInfoUpdateAll[MB_INFO_PARENTAL_LOCKAGE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_6)); - movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR, &movieInfoUpdateAll[MB_INFO_MAJOR_GENRE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_7)); - movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_PRODYEAR, &movieInfoUpdateAll[MB_INFO_PRODDATE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_8)); - movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_PRODCOUNTRY, &movieInfoUpdateAll[MB_INFO_COUNTRY], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_9)); - movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_LENGTH, &movieInfoUpdateAll[MB_INFO_LENGTH], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_0)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_SERIE, &movieInfoUpdateAll[MB_INFO_SERIE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_2)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_INFO1, &movieInfoUpdateAll[MB_INFO_INFO1], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_3)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR, &movieInfoUpdateAll[MB_INFO_MAJOR_GENRE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_4)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_PARENTAL_LOCKAGE, &movieInfoUpdateAll[MB_INFO_PARENTAL_LOCKAGE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_5)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_PRODYEAR, &movieInfoUpdateAll[MB_INFO_PRODDATE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_6)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_PRODCOUNTRY, &movieInfoUpdateAll[MB_INFO_COUNTRY], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_7)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_LENGTH, &movieInfoUpdateAll[MB_INFO_LENGTH], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_8)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_RATING, &movieInfoUpdateAll[MB_INFO_RATING], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_9)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_QUALITY, &movieInfoUpdateAll[MB_INFO_QUALITY], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_0)); /********************************************************************/ /** movieInfo ******************************************************/ From ae79dffff4ffa3d56f740da09a669157e0e4c656 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 17 Nov 2016 18:45:59 +0100 Subject: [PATCH 102/171] src/gui/moviebrowser/mb.cpp fix bookmark Menu Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/531ab8f8188d6b82400742b2f19293d224216635 Author: Jacek Jendrzej Date: 2016-11-17 (Thu, 17 Nov 2016) --- src/gui/moviebrowser/mb.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index b0a5b7d74..37b3d9dbe 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3165,9 +3165,8 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) for (int li =0 ; li < MI_MOVIE_BOOK_USER_MAX && li < MAX_NUMBER_OF_BOOKMARK_ITEMS; li++) { - std::string bookmark_user_name = g_Locale->getText(LOCALE_MOVIEBROWSER_BOOK_NEW); - if (!movie_info->bookmarks.user[li].name.empty()) - bookmark_user_name = movie_info->bookmarks.user[li].name; + if (movie_info->bookmarks.user[li].name.empty()) + movie_info->bookmarks.user[li].name = g_Locale->getText(LOCALE_MOVIEBROWSER_BOOK_NEW); CKeyboardInput *pBookNameInput = new CKeyboardInput(LOCALE_MOVIEBROWSER_EDIT_BOOK, &movie_info->bookmarks.user[li].name, 20, NULL, NULL, LOCALE_MOVIEBROWSER_EDIT_BOOK_NAME_INFO1, LOCALE_MOVIEBROWSER_EDIT_BOOK_NAME_INFO2); CIntInput *pBookPosIntInput = new CIntInput(LOCALE_MOVIEBROWSER_EDIT_BOOK, (int *)&movie_info->bookmarks.user[li].pos, 5, LOCALE_MOVIEBROWSER_EDIT_BOOK_POS_INFO1, LOCALE_MOVIEBROWSER_EDIT_BOOK_POS_INFO2); @@ -3175,11 +3174,11 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) CMenuWidget* pBookItemMenu = new CMenuWidget(LOCALE_MOVIEBROWSER_BOOK_HEAD, NEUTRINO_ICON_MOVIEPLAYER); pBookItemMenu->addItem(GenericMenuSeparator); - pBookItemMenu->addItem(new CMenuDForwarder(LOCALE_MOVIEBROWSER_BOOK_NAME, true, bookmark_user_name.c_str(), pBookNameInput)); + pBookItemMenu->addItem(new CMenuDForwarder(LOCALE_MOVIEBROWSER_BOOK_NAME, true, movie_info->bookmarks.user[li].name, pBookNameInput)); pBookItemMenu->addItem(new CMenuDForwarder(LOCALE_MOVIEBROWSER_BOOK_POSITION, true, pBookPosIntInput->getValue(), pBookPosIntInput)); pBookItemMenu->addItem(new CMenuDForwarder(LOCALE_MOVIEBROWSER_BOOK_TYPE, true, pBookTypeIntInput->getValue(), pBookTypeIntInput)); - bookmarkMenu.addItem(new CMenuDForwarder(bookmark_user_name.c_str(), true, pBookPosIntInput->getValue(), pBookItemMenu)); + bookmarkMenu.addItem(new CMenuDForwarder("", true, pBookNameInput->getValue(), pBookItemMenu)); } /********************************************************************/ From 63ec0ce1c3448d6ad343db7f021a2fec942de2d2 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Thu, 17 Nov 2016 21:02:28 +0100 Subject: [PATCH 103/171] fix moviebrowser detailsline Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d3fe4f5e0a73d1a831c15e7aa33e2eab8c641e28 Author: TangoCash Date: 2016-11-17 (Thu, 17 Nov 2016) --- src/gui/moviebrowser/mb.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 37b3d9dbe..a1e3e722b 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2516,6 +2516,8 @@ void CMovieBrowser::onSetGUIWindow(MB_GUI gui) TRACE("[mb]->onSetGUIWindow: gui %d -> %d\n", m_settings.gui, gui); m_settings.gui = gui; + hideDetailsLine(); + m_showMovieInfo = true; if (gui == MB_GUI_MOVIE_INFO) { m_showBrowserFiles = true; @@ -2572,7 +2574,6 @@ void CMovieBrowser::onSetGUIWindow(MB_GUI gui) hideMovieCover(); m_pcInfo2->clear(); } - hideDetailsLine(); m_pcFilter->paint(); onSetFocus(MB_FOCUS_FILTER); From 2e5604e3842e59a03f5d74cb9fe41ecc53a18a4b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 18 Nov 2016 17:46:17 +0100 Subject: [PATCH 104/171] Locales: use generic gui name in messages and windows Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1b4f976c6bb660c4d442c5ab9547565152ce774f Author: Thilo Graf Date: 2016-11-18 (Fri, 18 Nov 2016) --- data/locale/deutsch.locale | 50 +++++++++++++------------- data/locale/english.locale | 24 ++++++------- data/locale/nederlands.locale | 14 ++++---- data/locale/slovak.locale | 16 ++++----- data/locale/unmaintained/czech.locale | 6 ++-- data/locale/unmaintained/polski.locale | 12 +++---- src/gui/imageinfo.cpp | 2 +- src/neutrino.cpp | 7 ++-- 8 files changed, 67 insertions(+), 64 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 27ac2fba7..ab0782e9b 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -321,7 +321,7 @@ colormenu.background Hintergrundfarbe colormenu.clock_textcolor Ziffernfarbe colormenu.contrast_fonts Schriftkontrast colormenu.fade Ein-/Ausblenden -colormenu.font Neutrino-HD Schriftart +colormenu.font Verwendete Schriftart colormenu.font_ttx Teletext Schriftart colormenu.hd_preset LCD colormenu.menucolors Farben @@ -461,7 +461,7 @@ extra.key_timeshift Timeshift extra.key_unlock Entsperrtaste extra.ladirection Breitengrad-Ausrichtung extra.latitude Breitengrad -extra.loadconfig Neutrino-HD Einstellungen: Laden von +extra.loadconfig Einstellungen: Laden von extra.loadkeys Lade Tastenbelegung von extra.lodirection Längengrad-Ausrichtung extra.longitude Längengrad @@ -473,7 +473,7 @@ extra.rotor_swap Rotor dreht Ost/West extra.rounded_corners Eckendarstellung extra.rounded_corners_off eckig extra.rounded_corners_on abgerundet -extra.saveconfig Neutrino-HD Einstellungen: Sichern als +extra.saveconfig Einstellungen: Sichern als extra.savekeys Speichere Tastenbelegung als extra.scrambled_message Verschlüsselung melden extra.show_mute_icon Mute-Icon bei Lautstärke 0 @@ -732,7 +732,7 @@ fontsize.infobar_info Info fontsize.infobar_number Nummer fontsize.infobar_small Klein fontsize.menu Menütext -fontsize.menu_foot Fußleiste (in allen GUI-Elementen) +fontsize.menu_foot Fußleiste (in allen Fenstern) fontsize.menu_hint Menü-Hilfe fontsize.menu_info Menüinfo fontsize.menu_title Menütitel @@ -965,7 +965,7 @@ menu.hint_adzap_setup Einstellungen für den Werbezapper menu.hint_adzap_writedata Schreibe Daten über den Status des Werbezappers nach /tmp/adzap.data menu.hint_aplay Audioplayer menu.hint_aplay_setup Ändern Sie Audioplayer-Einstellungen wie Titel-Anzeige, Startverzeichnis oder Bildschirmschoner. -menu.hint_audio Audio-Ausgang, Dolby Digital und SRS TruVolume Optionen und mehr +menu.hint_audio Audio-Ausgang, Dolby Digital und SRS TruVolume Optionen etc. menu.hint_audio_adjust_vol_ac3 Lautstärkeanpassung für AC3-Tonspuren menu.hint_audio_adjust_vol_clear Alle gespeicherten Werte für AC3- und PCM-Tonspuren löschen menu.hint_audio_adjust_vol_pcm Lautstärkeanpassung für PCM-Tonspuren @@ -1048,7 +1048,7 @@ menu.hint_eventlist_additional Definiert, ob zusätzliche Informationen im Haupt menu.hint_eventlist_epgplus Definiert, ob EPG Plus (Vorschau-Übersicht) mit der EPG-Taste angezeigt werden sollen menu.hint_eventlist_fonts Ändern Sie die Schriftgröße in der Event-Liste menu.hint_eventlist_setup Wählen Sie die Anzeigeoptionen für die Event-Liste -menu.hint_extended Energiespar-, EPG-Speicher- und Lade-Optionen, HDMI-CEC, Startkanal und mehr +menu.hint_extended Energiespar-, EPG-Speicher- und Lade-Optionen, HDMI-CEC, Startkanal etc. menu.hint_factory Zurücksetzen der Box auf Werkseinstellungen.\nDie Box wird danach neu gestartet menu.hint_fade Bei aktivierter Funktion werden die GUI-Fenster 'weich' ein- bzw. ausgeblendet menu.hint_fan_speed Steuerung der Lüftergeschwindigkeit für die CPU @@ -1079,7 +1079,7 @@ menu.hint_inact_timer Ausschalten der Box nach Inaktivität in Minuten.\nDie Box menu.hint_inactive_back Ändern Sie die Hintergrundfarbe für deaktivierte Fensterinhalte menu.hint_inactive_textcolor Ändern Sie die Textfarbe für deaktivierte Fensterinhalte menu.hint_inet_radio Internetradio -menu.hint_info Informationen über das Image, CPU, Arbeitsspeicher und Stream und mehr +menu.hint_info Informationen über das Image, CPU, Arbeitsspeicher und Stream etc. menu.hint_infobar_back Ändern Sie die Hintergrundfarbe für die Infobar menu.hint_infobar_buttons_usertitle Erzwingt die benutzerdefinierten Titel der Farbtasten menu.hint_infobar_casys ein: zeigt alle Aktiven farbig, Mini: einzelnes Symbol ob gesperrt, Diskret: alle Aktiven CA-Systeme @@ -1159,7 +1159,7 @@ menu.hint_key_volumedown Weisen Sie eine Taste für die Reduzierung der Lautstä menu.hint_key_volumeup Weisen Sie eine Taste für die Erhöhung der Lautstärke zu menu.hint_keys Tastenbelegungen und Fernbedienungs-Abstimmung bearbeiten menu.hint_lang_pref Wählen Sie ihre bevorzugten Tonspuren und Untertitel-Sprachen -menu.hint_language Menü-Sprache, Zeitzone, bevorzugte Tonspuren, Untertitel-Sprachen und mehr +menu.hint_language Menü-Sprache, Zeitzone, bevorzugte Tonspuren, Untertitel-Sprachen etc. menu.hint_last_radio Wählen Sie den Start-Sender im Radio-Modus menu.hint_last_tv Wählen Sie den Start-Sender im TV-Modus menu.hint_last_use Speichert den aktuellen Kanal beim Herunterfahren der Box @@ -1168,7 +1168,7 @@ menu.hint_leds_deepstandby Definiert den Status der Power-LEDs im Deep-Standby menu.hint_leds_record Definiert, ob die Power-LEDs blinken sollen, wenn eine Aufnahme aktiv ist menu.hint_leds_standby Definiert den Status der Power-LEDs im Standby menu.hint_leds_tv Definiert den Status der Power-LEDs im TV-Modus -menu.hint_load Laden der Neutrino-HD-Einstellungen aus einer Datei +menu.hint_load Laden der Einstellungen aus einer Datei menu.hint_longkeypress_duration Tasten, die länger als die angegebene Zeit betätigt werden, werden als "langer Tastendruck" behandelt. menu.hint_lua Plugins ausführen menu.hint_make_hdlist Bei aktiver Option wird ein Bouquet namens 'HD' erzeugt, in dem alle HD-Sender zusammengefasst sind @@ -1228,7 +1228,7 @@ menu.hint_net_telnet Aktiviert Telnet auf Ihrer Box menu.hint_net_test Testet die Netzwerkverbindung:\nPing auf Gateway, Name-Server und externe IP-Adressen menu.hint_net_ushare Freigabe verbundener Datenträger über UPnP menu.hint_net_xupnpd Freigabe von Live Channels über UPNP -menu.hint_network IP-Adresse, Gateway, DNS, Zeit-Sync, Netzwerk-Freigaben, Dienste und mehr +menu.hint_network IP-Adresse, Gateway, DNS, Zeit-Sync, Netzwerk-Freigaben, Dienste etc. menu.hint_new_zap_mode Aktiviert Quickzap in der Kanalliste. Nach Betätigen der Mute-Taste wird mit den Hoch/Runter-Tasten direkt umgeschalten menu.hint_next Weiter zum nächsten Menü.\nDie Taste 'Menü' schließt alle Menüs menu.hint_next_brief Weiter zum nächsten Menü @@ -1237,7 +1237,7 @@ menu.hint_opkg Software-Pakete installieren oder vorhandene aktualisieren menu.hint_opkg_feed_addresses_edit Bearbeiten von Feed-Adressen menu.hint_opkg_install_local_package Paket von USB-Stick, SD, Freigabe oder lokalem Ordner installieren. menu.hint_opkg_upgrade Aktualisiert alle installierten Pakete auf die neueste verfügbare Version -menu.hint_osd Farben, Schriftarten, Anzeigegröße, Ansichtsoptionen der Menüs und mehr +menu.hint_osd Farben, Schriftarten, Anzeigegröße, Ansichtsoptionen der Menüs etc. menu.hint_osd_language Wählen Sie ihre Menü-Sprache menu.hint_osd_preset Wählen Sie zwischen Röhren-TV (CRT) oder Flachbildschirm (LCD) menu.hint_osd_timing Einblendzeit, die das OSD auf dem TV angezeigt wird @@ -1304,12 +1304,12 @@ menu.hint_record_zap_pre_time Stellen Sie eine Vorlaufzeit in Minuten für den U menu.hint_recording Aufnahme-, Timeshift- und Timer-Optionen, Einstellung von aufzunehmenden Tonspuren menu.hint_reload_channels Kanallisten neu laden, um Änderungen wirksam zu machen menu.hint_reload_plugins Plugins neu laden, um Änderungen wirksam zu machen -menu.hint_reset Zurücksetzen von Neutrino-HD-Einstellungen auf Standardwerte. Tuner-Einstellungen und Kanäle bleiben erhalten +menu.hint_reset Zurücksetzen der Einstellungen auf Standardwerte. Tuner-Einstellungen und Kanäle bleiben erhalten menu.hint_restore Wiederherstellen von vorher erstellten Sicherungen menu.hint_rotor_swap Tauschen der Rotordrehrichtung Ost/West in den Motor-Einstellungen menu.hint_rounded_corners Aktiviert die Darstellung abgerundeter Ecken für die Menüs menu.hint_save_settings Speichert ihre Einstellungen -menu.hint_saveas Speichern der Neutrino-HD-Einstellungen in eine Datei +menu.hint_saveas Speichern der Einstellungen in eine Datei menu.hint_scan_auto Automatischer Suchlauf ausgewählter Anbieter menu.hint_scan_autoall Automatischer Suchlauf aller ausgewählten Anbieter menu.hint_scan_autoall_select Suchlauf nur in ausgewählten Satelliten @@ -1400,9 +1400,9 @@ menu.hint_screenshot_video Diese Funktion übernimmt das TV-Bild als Hintergrund menu.hint_scripts Shell-Skripte ausführen menu.hint_selected_back Ändern Sie die Hintergrundfarbe für ausgewählte Fensterinhalte menu.hint_selected_text Ändern Sie die Textfarbe für ausgewählte Fensterinhalte -menu.hint_service Sendersuchlauf, Bouquet-Verwaltung, Software-Aktualisierung und mehr +menu.hint_service Sendersuchlauf, Bouquet-Verwaltung, Software-Aktualisierung etc. menu.hint_service_scan Automatischer / manueller Service Suchlauf -menu.hint_settings Konfigurieren von Neutrino-HD,\nNetzwerk, Video, Audio, OSD und mehr +menu.hint_settings Konfigurieren des Systems,\nNetzwerk, Video, Audio, OSD etc. menu.hint_shoutcast_dev_id Geben Sie die SHOUTcast Dev ID ein. Eine leere Eingabe schaltet die SHOUTcast-Unterstützung aus menu.hint_shoutcast_enabled Schaltet die SHOUTcast-Unterstützung ein oder aus menu.hint_show_mute_icon Definiert, ob bei einem Lautstärkewert von 0 das Stumm-Symbol eingeblendet werden soll @@ -1415,7 +1415,7 @@ menu.hint_sleeptimer Zeitschaltuhr auf Ihrer Box aktivieren\nDie Box fährt dann menu.hint_sleeptimer_min Voreinstellung der Zeitschaltuhr auf Ihrer Box menu.hint_sms_channel Wenn es aktiviert ist, können Sie die Nummern-Tasten in der Kanalliste nutzen, um im SMS-Style zu suchen menu.hint_sms_movie Wenn es aktiviert ist, können Sie die Nummern-Tasten im Moviebrowser nutzen, um im SMS-Style zu suchen -menu.hint_soft_restart Neustarten von Neutrino-HD, ohne die Box neu zu starten +menu.hint_soft_restart Neustarten der Benutzeroberfläche, ohne die Box neu zu starten menu.hint_softupdate_check Im Internet nach verfügbaren Updates suchen, herunterladen und installieren menu.hint_softupdate_check_local Lokal nach verfügbaren Updates suchen und installieren menu.hint_softupdate_createimage_menu Sicherung der aktuellen Software inklusive aller Einstellungen @@ -1425,9 +1425,9 @@ menu.hint_softupdate_expert_write Einzelne Partitionen (Splash, Kernel, SystemFS menu.hint_softupdate_settings Das lokale Update-Verzeichnis und die Konfigurationsdatei festlegen menu.hint_standby Receiver in den Standby Modus versetzen menu.hint_start_tostandby Aktiviert den Standby-Modus direkt nach dem Starten der Box -menu.hint_streaminfo Aktuelle Sender-Informationen über PIDs, SNR-Verhältnis, Bitrate und mehr +menu.hint_streaminfo Aktuelle Sender-Informationen über PIDs, SNR-Verhältnis, Bitrate etc. menu.hint_subchannel_pos Wählen Sie die Anzeigeposition der Unterkanäle aus -menu.hint_sw_update Neutrino-HD aktualisieren, Image sichern und wiederherstellen +menu.hint_sw_update System aktualisieren, Image sichern und wiederherstellen menu.hint_theme Wählen Sie ein vordefiniertes Farbschema, speichern oder laden Sie ihre eigenen Farbschemata menu.hint_timeouts Gibt an, nach welcher Zeit in Sekunden die Menüs oder Infofenster sich automatisch schließen (0 deaktiviert) menu.hint_timer_followscreenings Zeige Terminauswahl mit Folge-Events zur Timerprogrammierung @@ -1451,7 +1451,7 @@ menu.hint_vfd_infoline Wählen Sie, was in der Infozeile angezeigt werden soll menu.hint_vfd_notify_rclock Zeigt eine Meldung im Display, wenn bei gesperrter Fernbedienung eine Taste gedrückt wird menu.hint_vfd_scroll Laufschrift im Display ein- oder ausschalten menu.hint_vfd_statusline Wählen Sie, was in der Statuszeile angezeigt werden soll -menu.hint_video Video-Ausgang, Auflösung, Format, Seitenverhältnisse und mehr +menu.hint_video Video-Ausgang, Auflösung, Format, Seitenverhältnisse etc. menu.hint_video_43mode Anzeige-Modus für 4:3-Inhalte auf 16:9-Fernsehern menu.hint_video_analog_mode Wählen Sie den Modus des Ausgangssignals für den CINCH-Anschluss menu.hint_video_brightness Change picture brightness @@ -1886,7 +1886,7 @@ networkmenu.ssid_scan WLAN-Netzwerke suchen networkmenu.ssid_scan_error Keine WLAN-Netzwerke gefunden. networkmenu.ssid_scan_wait WLAN-Netzwerke werden gesucht... networkmenu.test Netzwerk testen -neutrino_starting Neutrino-HD wird gestartet... +neutrino_starting %s %s wird gestartet... nfs.alreadymounted Verzeichnis bereits gemountet. nfs.automount Beim Start mounten nfs.dir Verzeichnis/Freigabe @@ -2256,8 +2256,8 @@ servicemenu.head Service servicemenu.imageinfo Imageinfo servicemenu.reload Kanallisten neu laden servicemenu.reload_hint Kanallisten werden neu geladen,\nbitte warten... -servicemenu.restart Neutrino-HD neu starten -servicemenu.restart_hint Neutrino-HD wird neu gestartet... +servicemenu.restart GUI neu starten +servicemenu.restart_hint GUI wird neu gestartet... servicemenu.restart_refused_recording Aufnahme läuft. Neustart nicht möglich. servicemenu.scants Kanalsuche servicemenu.update Software-Aktualisierung @@ -2267,8 +2267,8 @@ settings.help Hilfe settings.menu_hints Hinweise anzeigen settings.menu_pos Position settings.menus Menüs -settings.missingoptionsconffile Die Neutrino-HD Einstellungen wurden erweitert.\nDie neuen Werte werden auf Standard gesetzt. -settings.noconffile Die Neutrino-HD Einstellungen wurden nicht\ngefunden. Es werden Standardwerte benutzt. +settings.missingoptionsconffile Die Einstellungen wurden erweitert.\nDie neuen Werte werden auf Standard gesetzt. +settings.noconffile Die Einstellungen wurden nicht\ngefunden. Es werden Standardwerte benutzt. settings.pos_bottom_center unten zentriert settings.pos_bottom_left unten links settings.pos_bottom_right unten rechts @@ -2301,7 +2301,7 @@ streaminfo.head Tech. Information streaminfo.not_available nicht verfügbar streaminfo.resolution Auflösung streaminfo.signal Empfangssignal -streaming.busy Ein oder mehrere Aufnahmeprozesse sind aktiv.\nSollte die Aufnahme eigentlich beendet sein,\nschafft ein Neustart von Neutrino-HD Abhilfe. +streaming.busy Ein oder mehrere Aufnahmeprozesse sind aktiv.\nSollte die Aufnahme eigentlich beendet sein,\nschafft ein Neustart der GUI Abhilfe. streaming.dir_not_writable Das Aufnahmeverzeichnis ist nicht beschreibbar.\nAufnahmen sind daher nicht möglich. streaming.overflow Aufnahme-Puffer Überlauf! Bitte ggf. einige Aufnahmen beenden. streaming.slow System oder Datenträger zu langsam! Bitte ggf. einige Aufnahmen beenden. diff --git a/data/locale/english.locale b/data/locale/english.locale index 6b35e7b8e..b27c5d3e1 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -461,7 +461,7 @@ extra.key_timeshift Timeshift extra.key_unlock Unlock key extra.ladirection LaDirection extra.latitude Latitude -extra.loadconfig Neutrino-HD Settings: Load from +extra.loadconfig Settings: Load from extra.loadkeys Load keys from extra.lodirection LoDirection extra.longitude Longitude @@ -473,7 +473,7 @@ extra.rotor_swap Swap rotor east/west extra.rounded_corners Shape of corners extra.rounded_corners_off angular extra.rounded_corners_on rounded -extra.saveconfig Neutrino-HD Settings: Save as +extra.saveconfig Settings: Save as extra.savekeys Save keys as extra.scrambled_message Scrambled Message extra.show_mute_icon mute-icon at volume 0 @@ -1168,7 +1168,7 @@ menu.hint_leds_deepstandby LEDs state in deeps-standby mode menu.hint_leds_record LEDs state when box recording menu.hint_leds_standby LEDs state in soft-standby mode menu.hint_leds_tv Working LEDs state -menu.hint_load Load Neutrino-HD GUI settings from file +menu.hint_load Load GUI settings from file menu.hint_longkeypress_duration A key press will be considered as "long key press" if it's pressed longer than the specified time. menu.hint_lua Run Lua Plugins menu.hint_make_hdlist Auto-create HD channel list based on\nchannel type and name @@ -1245,7 +1245,7 @@ menu.hint_other_fonts Change other font sizes menu.hint_parentallock_changepin Change PIN code menu.hint_parentallock_lockage Select age allowed to watch menu.hint_parentallock_menu Lock menus with pin code -menu.hint_parentallock_prompt Configure when Neutrino-HD will ask you\nfor PIN code +menu.hint_parentallock_prompt Configure when system will ask you\nfor PIN code menu.hint_personalize Enable, disable or Protect menu items\nConfigure color-buttons user menus menu.hint_pictureviewer_defdir Default picture viewer directory menu.hint_pictureviewer_scaling Picture scaling algorithm @@ -1304,12 +1304,12 @@ menu.hint_record_zap_pre_time For ZapTo timers, switch channel\nbefore event sta menu.hint_recording Recording and timeshift options\nTimers safety, audio pids options menu.hint_reload_channels Reload channels from flash menu.hint_reload_plugins Reload plugins from flash -menu.hint_reset Reset Neutrino-HD GUI settings to defaults\nTuner config and channels not affected +menu.hint_reset Reset GUI settings to defaults\nTuner config and channels not affected menu.hint_restore Restore files from selected backup menu.hint_rotor_swap Swap rotor east/west directions\nin motor control menu.hint_rounded_corners Draw round or rectangular windows corners menu.hint_save_settings Save all settings to flash -menu.hint_saveas Save Neutrino-HD GUI settings to file +menu.hint_saveas Save GUI settings to file menu.hint_scan_auto Auto-scan selected provider menu.hint_scan_autoall Scan several selected providers at once menu.hint_scan_autoall_select Add selected satellites to scan @@ -1402,7 +1402,7 @@ menu.hint_selected_back Change selected item background color menu.hint_selected_text Change selected item text color menu.hint_service Tuner setup, service scan,\nbouquet editor, software upgrade menu.hint_service_scan Auto / manual service scan -menu.hint_settings Configure Neutrino-HD\nNetwork, audio, video, OSD and more +menu.hint_settings Configure System\nNetwork, audio, video, OSD and more menu.hint_shoutcast_dev_id Type your SHOUTcast Dev ID. An empty input disables SHOUTcast support menu.hint_shoutcast_enabled Enable or disable SHOUTcast support menu.hint_show_mute_icon Show mute icon, when volume set to 0 @@ -1415,7 +1415,7 @@ menu.hint_sleeptimer Set timer to put your box\nin sleep mode menu.hint_sleeptimer_min Default setting for sleeptimer menu.hint_sms_channel If enabled, numeric buttons in channel list used to search channel in SMS style menu.hint_sms_movie If enabled, numeric buttons in moviebrowser used to search movie in SMS style -menu.hint_soft_restart Restart Neutrino-HD without reboot +menu.hint_soft_restart Restart GUI without reboot menu.hint_softupdate_check Check online update, download and flash firmware menu.hint_softupdate_check_local Select and flash firmware from local file menu.hint_softupdate_createimage_menu Backup of current software, including all settings @@ -1886,7 +1886,7 @@ networkmenu.ssid_scan WLAN network scan networkmenu.ssid_scan_error No WLAN networks are found. networkmenu.ssid_scan_wait WLAN network scan in progress... networkmenu.test Test network now -neutrino_starting Neutrino-HD starting... +neutrino_starting %s %s starting... nfs.alreadymounted directory already mounted nfs.automount Mount on startup nfs.dir directory/share @@ -2267,8 +2267,8 @@ settings.help Help settings.menu_hints Show menu hints settings.menu_pos Menu position settings.menus Menus -settings.missingoptionsconffile The Neutrino-HD settings have been updated.\nNew Options will be set to default. -settings.noconffile No Neutrino-HD settings found.\nUsing defaults. +settings.missingoptionsconffile The settings have been updated.\nNew Options will be set to default. +settings.noconffile No settings found.\nUsing defaults. settings.pos_bottom_center bottom center settings.pos_bottom_left bottom left settings.pos_bottom_right bottom right @@ -2301,7 +2301,7 @@ streaminfo.head Stream-Information streaminfo.not_available not available streaminfo.resolution Resolution streaminfo.signal Receipt signal -streaming.busy One or several recording processes are active.\nIf you encounter this message and no recording is active, please restart Neutrino-HD. +streaming.busy One or several recording processes are active.\nIf you encounter this message and no recording is active, please restart GUI. streaming.dir_not_writable The recording directory is not writable.\nRecording will not work. streaming.overflow Record buffer overflow, consider to stop some records streaming.slow System/hdd too slow, consider to stop some records diff --git a/data/locale/nederlands.locale b/data/locale/nederlands.locale index 5c81c018d..374aa6f8b 100644 --- a/data/locale/nederlands.locale +++ b/data/locale/nederlands.locale @@ -426,7 +426,7 @@ extra.key_timeshift Timeshift extra.key_unlock Ontgrendel toets extra.ladirection LA richting extra.latitude Breedtegraad (latitude) -extra.loadconfig Neutrino-HD Settings: Laden van +extra.loadconfig Settings: Laden van extra.loadkeys Toetsen laden van extra.lodirection LO richting extra.longitude Lengtegraad (Longitude) @@ -438,7 +438,7 @@ extra.rotor_swap Schakelen rotor oost/west extra.rounded_corners Vorm van hoeken extra.rounded_corners_off Rechthoekig extra.rounded_corners_on Rond -extra.saveconfig Neutrino-HD Settings: Opslaan als... +extra.saveconfig Settings: Opslaan als... extra.savekeys Toetsen opslaan extra.scrambled_message Gecodeerd bericht extra.show_mute_icon Weergave Mute icoon wanneer volume niveau 0 is @@ -1081,7 +1081,7 @@ menu.hint_leds_deepstandby LEDs status in deeps-standby mode menu.hint_leds_record LEDs status wanneer een opname gemaakt wordt menu.hint_leds_standby LEDs status in soft-standby mode menu.hint_leds_tv LEDs status indien de ontvanger in werking is -menu.hint_load Laad Neutrino-HD gebruikersinterface \ninstellingen van back-up bestand +menu.hint_load Laad gebruikersinterface \ninstellingen van back-up bestand menu.hint_longkeypress_duration Een toets-indruk wordt gezien als "lange toets indruk" wanneer deze langer is ingedrukt dan de gespecificeerde tijd. menu.hint_lua Start Lua Plugins menu.hint_make_hdlist Automatisch HD kanalenlijst maken \ngebaseerd op kanaaltype en naam @@ -1299,7 +1299,7 @@ menu.hint_selected_back Wijzig achtergrond kleur van het geselecteerde item menu.hint_selected_text Wijzig test kleur van het geselecteerde item menu.hint_service Tuner instellingen, service scan,\nfavorietenlijst editor, software update menu.hint_service_scan Tuner instellingen, service scan -menu.hint_settings Configureer Neutrino-HD\nNetwerk, audio, video, OSD en meer +menu.hint_settings Configureer sytem\nNetwerk, audio, video, OSD en meer menu.hint_show_mute_icon Mute icoon weergeven wanneer volume op 0 staat. menu.hint_shutdown Schakel uw ontvanger in deep standby modus\n geen bevestiging menu.hint_shutdown_count Tijd voordat uw ontvanger in deepstand-by schakelt vanuit soft-standby modus @@ -1308,7 +1308,7 @@ menu.hint_shutdown_rcdelay Deep standby modus inschakelen wanneer de power toets menu.hint_shutdown_real Soft-standby inschakelen indien soft-standby is \nuitgeschakeld schakelt de ontvanger gelijk in deep standby menu.hint_sleeptimer Timer instellen om uw ontvanger in slaapstand te schakelen menu.hint_sleeptimer_min Standaard instelling voor sleeptimer -menu.hint_soft_restart Herstart Neutrino-HD zonder reboot +menu.hint_soft_restart Herstart GUI zonder reboot menu.hint_softupdate_check Controleer online voor updates, download en installeer deze. menu.hint_softupdate_check_local Selecteer en installeer firmware vanaf een lokaal bestand menu.hint_softupdate_createimage_menu Backup van huidige software, inclusief alle instellingen @@ -1722,7 +1722,7 @@ networkmenu.ssid_scan WLAN netwerk scan networkmenu.ssid_scan_error Geen WLAN netwerken gevonden. networkmenu.ssid_scan_wait WLAN netwerk scan is bezig... networkmenu.test Netwerktest uitvoeren -neutrino_starting Een moment geduld a.u.b... +neutrino_starting %s %s starting ... nfs.alreadymounted directory reeds gekoppeld nfs.automount Koppelen tijdens het opstarten nfs.dir directory/locatie @@ -2071,7 +2071,7 @@ settings.menu_hints Menu hints weergeven settings.menu_pos Menu positie settings.menus Menus settings.missingoptionsconffile De instellingen zijn geupdate.\nNieuwe opties zijn standaard ingesteld. -settings.noconffile Geen Neutrino-HD instellingen gevonden.\nGebruikt standaard instellingen. +settings.noconffile Geen instellingen gevonden.\nGebruikt standaard instellingen. settings.pos_bottom_center midden onder settings.pos_bottom_left Links onder settings.pos_bottom_right Rechts onder diff --git a/data/locale/slovak.locale b/data/locale/slovak.locale index 377798975..1f00f767c 100644 --- a/data/locale/slovak.locale +++ b/data/locale/slovak.locale @@ -461,7 +461,7 @@ extra.key_timeshift Časový posun extra.key_unlock Odblokovanie extra.ladirection Umiestnenie zem.šírky extra.latitude Zem.šírka [N/S] -extra.loadconfig Neutrino-HD: Obnoviť nastavenia z... +extra.loadconfig Obnoviť nastavenia z... extra.loadkeys Obnoviť nastavenia kláves z ... extra.lodirection Umiestnenie zem.dľžky extra.longitude Zem.dľžka [E/W] @@ -473,7 +473,7 @@ extra.rotor_swap Vymeniť východ/západ motoru extra.rounded_corners Vzhľad rohov extra.rounded_corners_off hranatý extra.rounded_corners_on zaoblený -extra.saveconfig Neutrino-HD: Uložiť nastavenia do... +extra.saveconfig Uložiť nastavenia do... extra.savekeys Uložiť nastavenia kláves do ... extra.scrambled_message Správa o kódovaní extra.show_mute_icon Ikona umlčania pri hlasitosti 0 @@ -1168,7 +1168,7 @@ menu.hint_leds_deepstandby Stav LED v režime spánku menu.hint_leds_record Stav LED počas nahrávania menu.hint_leds_standby Stav LED v pohotovostnom režime menu.hint_leds_tv Funkčný stav LED -menu.hint_load Načítanie Neutrino-HD nastavení grafického užívateľského rozhrania (GUI) zo súboru +menu.hint_load Načítanie nastavení grafického užívateľského rozhrania (GUI) zo súboru menu.hint_longkeypress_duration Stlačenie klávesy bude vyhodnotené ako "dlhý stisk klávesy" ak bude stlačené dlhšie ako špecifikovaný čas. menu.hint_lua Spustenie doplnkov menu.hint_make_hdlist Automaticky vytvorí HD zoznam kanálov na základe\ntypu kanálu a názvu @@ -1245,7 +1245,7 @@ menu.hint_other_fonts Zmena veľkostí ďaľšieho písma menu.hint_parentallock_changepin Zmena PIN kódu menu.hint_parentallock_lockage Výber povoleného veku pre sledovanie menu.hint_parentallock_menu Zamknutie ponúk s pin kódom -menu.hint_parentallock_prompt Konfigurácia keď sa Neutrino-HD opýta na PIN kód +menu.hint_parentallock_prompt Konfigurácia keď sa system opýta na PIN kód menu.hint_personalize Povolenie/zakázanie alebo Položky menu zabezpečenia\nKonfigurácia farebných tlačidiel užívateľských ponúk menu.hint_pictureviewer_defdir Predvolená zložka prehliadača obrázkov menu.hint_pictureviewer_scaling Algoritmus mierky obrázku @@ -1309,7 +1309,7 @@ menu.hint_restore Obnova konfigurácie a kanálov zo zvolenej zálohy menu.hint_rotor_swap Výmena umiestnenia motora východ/západ v ovládaní motora menu.hint_rounded_corners Kruhové vykreslovanie alebo zaoblené rohy okien menu.hint_save_settings Uloženie všetkých nastavení do pamäte -menu.hint_saveas Uloženie Neutrino-HD nastavení grafického užívateľského rozhrania (GUI) do súboru +menu.hint_saveas Uloženie nastavení grafického užívateľského rozhrania (GUI) do súboru menu.hint_scan_auto Prehľadanie vybraného satelitu menu.hint_scan_autoall Prehľadanie niektorých vybraných satelitov menu.hint_scan_autoall_select Pridá vybrané satelity do prehľadávania @@ -1402,7 +1402,7 @@ menu.hint_selected_back Zmena farby podkladu označenej položky menu.hint_selected_text Zmena farby textu označenej položky menu.hint_service Nastavenie tuneru, vyhľadanie služieb,\núprava buketov, aktualizácia software menu.hint_service_scan Automatické / manuálne vyhľadávanie staníc, FastScan, Test signálu -menu.hint_settings Konfigurácia Neutrino-HD, sieť, zvuk, obraz, OSD a iné +menu.hint_settings Konfigurácia system, sieť, zvuk, obraz, OSD a iné menu.hint_show_mute_icon Zobrazenie ikony umlčania, ak nastavenie hlasitosťi bude 0 menu.hint_shoutcast_dev_id Vložte vaše SHOUTcast údaje. Neuvedením údajov sa vypne podpora SHOUTcast. menu.hint_shoutcast_enabled Povoliť alebo zakázať podporu SHOUTcast @@ -1415,7 +1415,7 @@ menu.hint_sleeptimer Nastavenie časovača pre prechod prijímača do pohotovost menu.hint_sleeptimer_min Prednastavené nastavenia pre časovač vypnutia menu.hint_sms_channel Ak povolené, číselné klávesy v zozname kanálov budú použité pre vyhľadávanie kanálu v štýle SMS menu.hint_sms_movie Ak povolené, číselné klávesy v prehliadači filmov budú použité pre vyhľadávanie filmu v štýle SMS -menu.hint_soft_restart Reštartovanie Neutrino-HD bez rebootu +menu.hint_soft_restart Reštartovanie GUI bez rebootu menu.hint_softupdate_check Kontrola dostupných aktualizácií, stiahnutie a naprogramovanie firmware menu.hint_softupdate_check_local Výber a programovanie firmware z lokálneho súboru menu.hint_softupdate_createimage_menu Zálohovanie aktuálneho firmware vrátane všetkých nastavení @@ -1884,7 +1884,7 @@ networkmenu.ssid_scan Hľadanie WLAN sietí networkmenu.ssid_scan_error Nenájdené WLAN siete networkmenu.ssid_scan_wait Prebieha hľadanie WLAN sietí networkmenu.test Test siete -neutrino_starting Start Neutrino... +neutrino_starting Start %s %s ... nfs.alreadymounted Zložka je už pripojená nfs.automount Pripojiť pri spustení nfs.dir Zložka / Zdielanie diff --git a/data/locale/unmaintained/czech.locale b/data/locale/unmaintained/czech.locale index 11e1e557d..e2858c8cf 100644 --- a/data/locale/unmaintained/czech.locale +++ b/data/locale/unmaintained/czech.locale @@ -1151,7 +1151,7 @@ menu.hint_other_fonts Zmena velikosti další písma menu.hint_parentallock_changepin Změna PIN kódu menu.hint_parentallock_lockage Výběr povoleného věku pro sledování menu.hint_parentallock_menu Zamknutí nabídek s pin kódem -menu.hint_parentallock_prompt Konfigurace když se Neutrino-HD zeptá na PIN kód +menu.hint_parentallock_prompt Konfigurace když se sytem zeptá na PIN kód menu.hint_personalize Povolení / zakázání nebo Položky menu zabezpečení \nKonfigurace barevných tlačítek uživatelských nabídek menu.hint_pictureviewer_defdir Výchozí adresář prohlížeče obrázků menu.hint_pictureviewer_scaling Algoritmus měřítka obrázku @@ -1305,7 +1305,7 @@ menu.hint_selected_back Změna barvy podkladu označené položky menu.hint_selected_text Změna barvy textu označené položky menu.hint_service Nastavení tuneru, vyhledání služeb, \nÚprava buketů, aktualizace software menu.hint_service_scan Nastavení tuneru, vyhledání služeb -menu.hint_settings Konfigurace Neutrino-HD, síť, zvuk, obraz, OSD a jiné +menu.hint_settings Konfigurace system, síť, zvuk, obraz, OSD a jiné menu.hint_show_mute_icon Zobrazení ikony umlčení, pokud nastavení hlasitosti bude 0 menu.hint_shutdown Přepne váš příjmač do spánku \nBez potvrzování menu.hint_shutdown_count Čas přepnutí přijímače do spánku \nz režimu připravenosti @@ -1314,7 +1314,7 @@ menu.hint_shutdown_rcdelay Použije režim spánku, pokud tlačítko zapnutí \n menu.hint_shutdown_real Použije režim připravenosti \nPokud se nepoužije, tlačítko zapnutí přepne příjmač do spánku menu.hint_sleeptimer Nastavení časovače pro přechod vašeho příjmače \ndo režimu připravenosti menu.hint_sleeptimer_min Přednastavené nastavení pro časovač vypnutí -menu.hint_soft_restart Restartování Neutrino-HD bez rebootu +menu.hint_soft_restart Restartování GUI bez rebootu menu.hint_softupdate_check Kontrola dostupných aktualizací, stažení a naprogramování firmware menu.hint_softupdate_check_local Výběr a programování firmware z lokálního souboru menu.hint_softupdate_createimage_menu Zálohování aktuálního firmware včetně všech nastavení diff --git a/data/locale/unmaintained/polski.locale b/data/locale/unmaintained/polski.locale index 080a1a984..305a5b2e1 100644 --- a/data/locale/unmaintained/polski.locale +++ b/data/locale/unmaintained/polski.locale @@ -1082,7 +1082,7 @@ menu.hint_leds_deepstandby LEDs state in deeps-standby mode menu.hint_leds_record LEDs state when box recording menu.hint_leds_standby LEDs state in soft-standby mode menu.hint_leds_tv Working LEDs state -menu.hint_load Load Neutrino-HD GUI settings from file +menu.hint_load Load settings from file menu.hint_longkeypress_duration A key press will be considered as "long key press" if it's pressed longer than the specified time. menu.hint_lua Pluginy Lua menu.hint_make_hdlist Auto-create HD channel list based on\nchannel type and name @@ -1152,7 +1152,7 @@ menu.hint_other_fonts Change other font sizes menu.hint_parentallock_changepin Change PIN code menu.hint_parentallock_lockage Select age allowed to watch menu.hint_parentallock_menu Lock menus with pin code -menu.hint_parentallock_prompt Configure when Neutrino-HD will ask you\nfor PIN code +menu.hint_parentallock_prompt Configure when system will ask you\nfor PIN code menu.hint_personalize Enable, disable or Protect menu items\nConfigure color-buttons user menus menu.hint_pictureviewer_defdir Default picture viewer directory menu.hint_pictureviewer_scaling Picture scaling algorithm @@ -1210,12 +1210,12 @@ menu.hint_record_zap_pre_time For ZapTo timers, switch channel\nbefore event sta menu.hint_recording Recording and timeshift options\nTimers safety, audio pids options menu.hint_reload_channels Reload channels from flash menu.hint_reload_plugins Reload plugins from flash -menu.hint_reset Reset Neutrino-HD GUI settings to defaults\nTuner config and channels not affected +menu.hint_reset Reset GUI settings to defaults\nTuner config and channels not affected menu.hint_restore Restore files from selected backup menu.hint_rotor_swap Swap rotor east/west directions\nin motor control menu.hint_rounded_corners Draw round or rectangular windows corners menu.hint_save_settings Save all settings to flash -menu.hint_saveas Save Neutrino-HD GUI settings to file +menu.hint_saveas Save GUI settings to file menu.hint_scan_auto Auto-scan selected provider menu.hint_scan_autoall Scan several selected providers at once menu.hint_scan_autoall_select Add selected satellites to scan @@ -1306,7 +1306,7 @@ menu.hint_selected_back Change selected item background color menu.hint_selected_text Change selected item text color menu.hint_service Tuner setup, service scan,\nbouquet editor, software upgrade menu.hint_service_scan Auto / manual service scan -menu.hint_settings Configure Neutrino-HD\nNetwork, audio, video, OSD and more +menu.hint_settings Configure system\nNetwork, audio, video, OSD and more menu.hint_show_mute_icon Show mute icon, when volume set to 0 menu.hint_shutdown Put your box in deep standby mode\nNo confirmation menu.hint_shutdown_count Time to put box in deep-standby\nfrom soft-standby mode @@ -1315,7 +1315,7 @@ menu.hint_shutdown_rcdelay Enable deep-standby, if power button\npressed more th menu.hint_shutdown_real Enable soft-standby mode\nIf disabled, power button put box to deep-standby menu.hint_sleeptimer Set timer to put your box\nin sleep mode menu.hint_sleeptimer_min Default setting for sleeptimer -menu.hint_soft_restart Restart Neutrino-HD without reboot +menu.hint_soft_restart Restart GUI without reboot menu.hint_softupdate_check Check online update, download and flash firmware menu.hint_softupdate_check_local Select and flash firmware from local file menu.hint_softupdate_createimage_menu Backup of current software, including all settings diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index c3de0d622..feda1034f 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -292,7 +292,7 @@ void CImageInfo::InitInfoData() struct utsname uts_info; - image_info_t imagename = {LOCALE_IMAGEINFO_IMAGE, config.getString("imagename", "Neutrino-HD")}; + image_info_t imagename = {LOCALE_IMAGEINFO_IMAGE, config.getString("imagename", PACKAGE_NAME)}; v_info.push_back(imagename); image_info_t version = {LOCALE_IMAGEINFO_VERSION, version_string}; v_info.push_back(version); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 44b1472e9..a983575b6 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2039,12 +2039,15 @@ TIMER_START(); g_PicViewer = new CPictureViewer(); CColorSetupNotifier::setPalette(); - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_NEUTRINO_STARTING)); + char start_text [100]; + snprintf(start_text, sizeof(start_text), g_Locale->getText(LOCALE_NEUTRINO_STARTING), PACKAGE_NAME, PACKAGE_VERSION ); + start_text[99] = '\0'; + CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, start_text); hintBox->paint(); CVFD::getInstance()->init(neutrinoFonts->fontDescr.filename.c_str(), neutrinoFonts->fontDescr.name.c_str()); CVFD::getInstance()->Clear(); - CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_NEUTRINO_STARTING)); + CVFD::getInstance()->ShowText(start_text); CVFD::getInstance()->setBacklight(g_settings.backlight_tv); if (!scanSettings.loadSettings(NEUTRINO_SCAN_SETTINGS_FILE)) From 8c23a6d2b0c6784fce2b62feea9c266648d47327 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 18 Nov 2016 17:50:41 +0100 Subject: [PATCH 105/171] src/gui/moviebrowser/mb.cpp fix clean bookmarks Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ce0bb9fcd05a1886a2864985fe95ef79bffd9b7c Author: Jacek Jendrzej Date: 2016-11-18 (Fri, 18 Nov 2016) --- src/gui/moviebrowser/mb.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index a1e3e722b..cdc4e7a7f 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -810,7 +810,7 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) m_movieSelectionHandler->bookmarks.lastPlayStop =0; for (int i = 0; i < MI_MOVIE_BOOK_USER_MAX; i++) { - m_movieSelectionHandler->bookmarks.user[i].name.empty(); + m_movieSelectionHandler->bookmarks.user[i].name = g_Locale->getText(LOCALE_MOVIEBROWSER_BOOK_NEW); m_movieSelectionHandler->bookmarks.user[i].length =0; m_movieSelectionHandler->bookmarks.user[i].pos =0; } @@ -1438,7 +1438,7 @@ void CMovieBrowser::hideMovieCover(void) void CMovieBrowser::refreshMovieInfo(void) { - TRACE("[mb]->%s m_vMovieInfo.size %d\n", __func__, m_vMovieInfo.size()); + TRACE("[mb]->%s m_vMovieInfo.size %d\n", __func__, (int)m_vMovieInfo.size()); // clear m_pcInfo1 text before new init m_pcInfo1->clear(); From 887bc80d8438126d2f1ecf2f9ab448576efbbb91 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 18 Nov 2016 18:17:10 +0100 Subject: [PATCH 106/171] prepare revision, bump version to 3.4.0 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4e3d2c854b7d3631244b12e259a335a6de06f65d Author: Thilo Graf Date: 2016-11-18 (Fri, 18 Nov 2016) --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7fd8adc65..ce09f76b2 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT(tuxbox-neutrino,1.0.1) +AC_INIT(Tuxbox-Neutrino,3.4.0) AM_INIT_AUTOMAKE([1.0.1 nostdinc]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) From da0b9546fb4cff1c98e80837d98a08ddb4a93f6c Mon Sep 17 00:00:00 2001 From: TangoCash Date: Fri, 18 Nov 2016 21:25:38 +0100 Subject: [PATCH 107/171] [timermanager] fix stop recordings Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a21eeea6f050854eed21fccf2b9f46f65ec6fcca Author: TangoCash Date: 2016-11-18 (Fri, 18 Nov 2016) --- src/timerd/timermanager.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index a7fecdb5c..ce6e7b4e0 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1246,8 +1246,6 @@ void CTimerEvent_Record::announceEvent() //------------------------------------------------------------ void CTimerEvent_Record::stopEvent() { - if (adjustToCurrentEPG()) - return; CTimerd::RecordingStopInfo stopinfo; // Set EPG-ID if not set stopinfo.eventID = eventID; From b673a5fd884d3a321a9e88d01a8383399fe949ac Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 18 Nov 2016 17:50:41 +0100 Subject: [PATCH 108/171] src/gui/moviebrowser/mb.cpp fix clean bookmarks Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/534fb3d5fe5a3063957857bc57a4c47b138fdcc1 Author: Jacek Jendrzej Date: 2016-11-18 (Fri, 18 Nov 2016) --- src/gui/moviebrowser/mb.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 9bdf4b642..ab8ac7443 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -810,7 +810,7 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) m_movieSelectionHandler->bookmarks.lastPlayStop =0; for (int i = 0; i < MI_MOVIE_BOOK_USER_MAX; i++) { - m_movieSelectionHandler->bookmarks.user[i].name.empty(); + m_movieSelectionHandler->bookmarks.user[i].name = g_Locale->getText(LOCALE_MOVIEBROWSER_BOOK_NEW); m_movieSelectionHandler->bookmarks.user[i].length =0; m_movieSelectionHandler->bookmarks.user[i].pos =0; } @@ -1438,7 +1438,7 @@ void CMovieBrowser::hideMovieCover(void) void CMovieBrowser::refreshMovieInfo(void) { - TRACE("[mb]->%s m_vMovieInfo.size %d\n", __func__, m_vMovieInfo.size()); + TRACE("[mb]->%s m_vMovieInfo.size %d\n", __func__, (int)m_vMovieInfo.size()); // clear m_pcInfo1 text before new init m_pcInfo1->clear(); From cf09b84e0092309ba3deb474f7e40f3160ced9e8 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Fri, 18 Nov 2016 21:25:38 +0100 Subject: [PATCH 109/171] [timermanager] fix stop recordings Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9d3a48d3c078e2842cc49bd11611854f2ca6bd45 Author: TangoCash Date: 2016-11-18 (Fri, 18 Nov 2016) --- src/timerd/timermanager.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index a7fecdb5c..ce6e7b4e0 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1246,8 +1246,6 @@ void CTimerEvent_Record::announceEvent() //------------------------------------------------------------ void CTimerEvent_Record::stopEvent() { - if (adjustToCurrentEPG()) - return; CTimerd::RecordingStopInfo stopinfo; // Set EPG-ID if not set stopinfo.eventID = eventID; From f5e43c4f77f0cda4fe202a6baa33a36a5b8d75e8 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sat, 19 Nov 2016 11:57:27 +0100 Subject: [PATCH 110/171] [timers] fix start timers Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/de6f90ac2755d6bc0422c0c0f173fa8835200d9b Author: TangoCash Date: 2016-11-19 (Sat, 19 Nov 2016) --- src/timerd/timermanager.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index ce6e7b4e0..9f12a5ff6 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1216,7 +1216,7 @@ CTimerEvent_Record::CTimerEvent_Record(CConfigFile *config, int iId): //------------------------------------------------------------ void CTimerEvent_Record::fireEvent() { - if (adjustToCurrentEPG()) + if ((adjustToCurrentEPG()) && (alarmTime > time(NULL))) return; getEpgId(); CTimerd::RecordingInfo ri=eventInfo; @@ -1232,7 +1232,7 @@ void CTimerEvent_Record::fireEvent() //------------------------------------------------------------ void CTimerEvent_Record::announceEvent() { - if (adjustToCurrentEPG()) + if ((adjustToCurrentEPG()) && (announceTime > time(NULL))) return; Refresh(); CTimerd::RecordingInfo ri=eventInfo; @@ -1368,9 +1368,11 @@ bool CTimerEvent_Record::adjustToCurrentEPG() _stopTime += post; } - if ((_alarmTime != alarmTime) || (_announceTime != announceTime) || (_stopTime != stopTime)) + if ((_alarmTime != alarmTime) || (_announceTime != announceTime) || (_stopTime != stopTime)) { + alarmTime = _alarmTime; announceTime = _announceTime; stopTime = _stopTime; if (CTimerManager::getInstance()->adjustEvent(eventID, _announceTime, _alarmTime, _stopTime)) return true; + } return false; } From 2b5814d4385ef1d984696fcb44d9fefc4d624796 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sat, 19 Nov 2016 18:47:35 +0100 Subject: [PATCH 111/171] deactivate timer epg autoadjust until fixed and tested Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/bf2c9818b038eccff07946bd922d6e82d4eefe2e Author: TangoCash Date: 2016-11-19 (Sat, 19 Nov 2016) --- src/timerd/timermanager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 9f12a5ff6..139ea75d3 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1332,6 +1332,9 @@ void CTimerEvent_Record::Refresh() //------------------------------------------------------------ bool CTimerEvent_Record::adjustToCurrentEPG() { + if (!(access(CONFIGDIR"/.adjust", F_OK) == 0)) + return false; + if (!autoAdjustToEPG) return false; From 5d258a58dded2a131140907bc963693d3b33411f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 19 Nov 2016 23:21:06 +0100 Subject: [PATCH 112/171] CSignalBar: remove offset for signal name and remove right allignment Text have more space, otherwise it's possible it can be truncated. Indent from left site of text don't looks not so good. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/04a75327dd9ad38751b3ced326dd2cd074e803d2 Author: Thilo Graf Date: 2016-11-19 (Sat, 19 Nov 2016) --- src/gui/components/cc_frm_signalbars.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_signalbars.cpp b/src/gui/components/cc_frm_signalbars.cpp index 8677bf3e3..28728c6bf 100644 --- a/src/gui/components/cc_frm_signalbars.cpp +++ b/src/gui/components/cc_frm_signalbars.cpp @@ -175,12 +175,12 @@ void CSignalBar::initSBarName() sb_lbl->doPaintTextBoxBg(!cc_txt_save_screen); sb_lbl->enableTboxSaveScreen(cc_txt_save_screen); - sb_lbl->setText(sb_name, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, sb_font); + sb_lbl->setText(sb_name, CTextBox::NO_AUTO_LINEBREAK, sb_font); //move and set dimensions int lbl_x = sb_vlbl->getXPos()+ sb_vlbl->getWidth(); int lbl_h = sb_vlbl->getHeight(); - sb_lbl->setDimensionsAll(lbl_x, 1, sb_lbl_width- append_x_offset, lbl_h); + sb_lbl->setDimensionsAll(lbl_x, 1, sb_lbl_width/*- append_x_offset*/, lbl_h); //set current text and body color sb_lbl->setTextColor(sb_caption_color); From ae117fae660f29dcacd5ad1aacb1bdd6f260005f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 20 Nov 2016 01:08:14 +0100 Subject: [PATCH 113/171] Messages: add option to change size of message text Include default size and localized setup. TODO: localize for nederlands and slovak, current english only. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4988df1dd97d2282617a6a553d3464e705fb2596 Author: Thilo Graf Date: 2016-11-20 (Sun, 20 Nov 2016) --- data/locale/deutsch.locale | 3 +++ data/locale/english.locale | 3 +++ data/locale/nederlands.locale | 3 +++ data/locale/slovak.locale | 3 +++ src/gui/osd_setup.cpp | 11 ++++++++++- src/gui/widget/hintbox.cpp | 6 +++--- src/system/locals.h | 3 +++ src/system/locals_intern.h | 3 +++ src/system/settings.h | 1 + 9 files changed, 32 insertions(+), 4 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index ab0782e9b..c84063a86 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -703,6 +703,7 @@ fontmenu.eventlist Event-Liste fontmenu.head Schrift fontmenu.infobar Infobar fontmenu.menu Menü +fontmenu.messages Meldungen fontmenu.moviebrowser Moviebrowser fontmenu.other Andere fontmenu.scaling Schriftgrößenfaktor @@ -736,6 +737,7 @@ fontsize.menu_foot Fußleiste (in allen Fenstern) fontsize.menu_hint Menü-Hilfe fontsize.menu_info Menüinfo fontsize.menu_title Menütitel +fontsize.message_text Meldungstext fontsize.moviebrowser_head Überschriften fontsize.moviebrowser_info Info-Fenster fontsize.moviebrowser_list Listen-Einträge @@ -1183,6 +1185,7 @@ menu.hint_menu_fonts Ändern Sie die Schriftgrößen im Menü menu.hint_menu_hints Zeigt Ihnen Hinweise zu den Menüpunkten an. Sie erreichen das auch jederzeit mit der Taste 'Hilfe' menu.hint_menu_pos Legen Sie die Anzeigeposition der Menüs fest menu.hint_menus Wählen Sie die Anzeigeoptionen für die Menüs +menu.hint_message_fonts Anpassen der Schrift in Meldungsfenstern menu.hint_misc_cec HDMI-CEC Optionen menu.hint_misc_channellist Erweiterte Einstellungen für die Kanallisten und Zapping-Einstellungen menu.hint_misc_energy Energieverbrauchs- und Standby-Optionen, verzögertes Ausschalten, setzen bzw. ändern des Inaktivitätstimers diff --git a/data/locale/english.locale b/data/locale/english.locale index b27c5d3e1..b6b6e62f1 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -703,6 +703,7 @@ fontmenu.eventlist Eventlist fontmenu.head Font settings fontmenu.infobar Infobar fontmenu.menu Menu +fontmenu.messages Messages fontmenu.moviebrowser Moviebrowser fontmenu.other Other fontmenu.scaling Global Font Zoom Factor @@ -736,6 +737,7 @@ fontsize.menu_foot Footer (in all GUI elements) fontsize.menu_hint Menu hints fontsize.menu_info Menu Info fontsize.menu_title Menu Title +fontsize.message_text Message Text fontsize.moviebrowser_head Headers fontsize.moviebrowser_info Info window fontsize.moviebrowser_list List items @@ -1183,6 +1185,7 @@ menu.hint_menu_fonts Change menu font sizes menu.hint_menu_hints Show this hints. Also you can switch\nit any time using 'help' button menu.hint_menu_pos Select menu position menu.hint_menus Configure menu options +menu.hint_message_fonts Change message text font sizes menu.hint_misc_cec HDMI-CEC Options menu.hint_misc_channellist HD/New/Removed channel lists\nZap cycle menu.hint_misc_energy Enable soft-standby, delayed shutdown\ninactivity timers diff --git a/data/locale/nederlands.locale b/data/locale/nederlands.locale index 374aa6f8b..2425f75e9 100644 --- a/data/locale/nederlands.locale +++ b/data/locale/nederlands.locale @@ -657,6 +657,7 @@ fontmenu.eventlist Programmalijst fontmenu.head Lettertype instellingen fontmenu.infobar Informatiebalk fontmenu.menu Menu +fontmenu.messages Messages fontmenu.other Andere fontmenu.scaling Globale lettertype Zoom Factor fontmenu.scaling_x Horizontaal (in %) @@ -685,6 +686,7 @@ fontsize.infobar_info Info fontsize.infobar_number Nummer fontsize.infobar_small Klein fontsize.menu Menu tekst +fontsize.message_text Messag Text fontsize.menu_hint Menu hints fontsize.menu_info Menu Info fontsize.menu_title Menu Titel @@ -1095,6 +1097,7 @@ menu.hint_menu_fonts Lettertype grote van menu's aanpassen menu.hint_menu_hints Hints weergeven Show this hints. U kunt tevens gebruik maken van de 'help' toets. menu.hint_menu_pos Selecteer menu positie menu.hint_menus Configureer menu opties +menu.hint_message_fonts Change message text font sizes menu.hint_misc_cec HDMI-CEC Opties menu.hint_misc_channellist HD/Nieuw/Verwijderde kanalen lijst \nZap cyclus menu.hint_misc_energy Softstandby, uitgesteld uitschakelen en inactiviteit timers inschakelen diff --git a/data/locale/slovak.locale b/data/locale/slovak.locale index 1f00f767c..c6c3b1e67 100644 --- a/data/locale/slovak.locale +++ b/data/locale/slovak.locale @@ -703,6 +703,7 @@ fontmenu.eventlist Programový sprievodca fontmenu.head Nastavenie písma fontmenu.infobar Informačná lišta fontmenu.menu Menu +fontmenu.messages Messages fontmenu.moviebrowser Prehliadač filmov fontmenu.other Iné fontmenu.scaling Faktor zoomu globálneho fontu @@ -732,6 +733,7 @@ fontsize.infobar_info Informácia na informačnej lište fontsize.infobar_ng_ecminfo ECM Informácia fontsize.infobar_number Kanál na informačnej lište fontsize.menu Text menu +fontsize.message_text Messagwe Text fontsize.menu_foot Päta (vo všetkých grafických elementoch) fontsize.menu_hint Popis menu fontsize.menu_info Informačné menu @@ -1183,6 +1185,7 @@ menu.hint_menu_fonts Zmena veľkosti písma menu menu.hint_menu_hints Zobrazí túto nápovedu. Taktiež môžno kedykoľvek zmeniť použitím tlačidla ´HELP´. menu.hint_menu_pos Výber umiestnenia menu menu.hint_menus Konfigurácia volieb ponuky +menu.hint_message_fonts Change message text font sizes menu.hint_misc_cec HDMI-CEC voľby menu.hint_misc_channellist HD/Nové/Odstránené zoznamy kanálov, cyklické prepnutie menu.hint_misc_energy Použitie pohotovostného režimu, oneskorené vypnutie\nčasovače neaktivity diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 27e492ed3..aa2403342 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -164,6 +164,13 @@ const SNeutrinoSettings::FONT_TYPES other_font_sizes[] = }; size_t other_font_items = sizeof(other_font_sizes)/sizeof(other_font_sizes[0]); +const SNeutrinoSettings::FONT_TYPES msgtext_font_sizes[] = +{ + SNeutrinoSettings::FONT_TYPE_MESSAGE_TEXT +}; +size_t msgtext_font_items = sizeof(msgtext_font_sizes)/sizeof(msgtext_font_sizes[0]); + + font_sizes_groups font_sizes_groups[] = { {LOCALE_FONTMENU_MENU , menu_font_items , menu_font_sizes , "fontsize.dmen", LOCALE_MENU_HINT_MENU_FONTS }, @@ -172,6 +179,7 @@ font_sizes_groups font_sizes_groups[] = {LOCALE_FONTMENU_EPG , epg_font_items , epg_font_sizes , "fontsize.depg", LOCALE_MENU_HINT_EPG_FONTS }, {LOCALE_FONTMENU_INFOBAR , infobar_font_items , infobar_font_sizes , "fontsize.dinf", LOCALE_MENU_HINT_INFOBAR_FONTS }, {LOCALE_FONTMENU_MOVIEBROWSER,moviebrowser_font_items,moviebrowser_font_sizes,"fontsize.dmbr", LOCALE_MENU_HINT_MOVIEBROWSER_FONTS }, + {LOCALE_FONTMENU_MESSAGES , msgtext_font_items , msgtext_font_sizes , "fontsize.msg", LOCALE_MENU_HINT_MESSAGE_FONTS }, {LOCALE_FONTMENU_OTHER , other_font_items , other_font_sizes , "fontsize.doth", LOCALE_MENU_HINT_OTHER_FONTS } }; #define FONT_GROUP_COUNT (sizeof(font_sizes_groups)/sizeof(font_sizes_groups[0])) @@ -205,7 +213,8 @@ font_sizes_struct neutrino_font[SNeutrinoSettings::FONT_TYPE_COUNT] = {LOCALE_FONTSIZE_MOVIEBROWSER_HEAD , 15, CNeutrinoFonts::FONT_STYLE_REGULAR, 2}, {LOCALE_FONTSIZE_MOVIEBROWSER_LIST , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, {LOCALE_FONTSIZE_MOVIEBROWSER_INFO , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, - {LOCALE_FONTSIZE_SUBTITLES , 25, CNeutrinoFonts::FONT_STYLE_BOLD , 0} + {LOCALE_FONTSIZE_SUBTITLES , 25, CNeutrinoFonts::FONT_STYLE_BOLD , 0}, + {LOCALE_FONTSIZE_MESSAGE_TEXT , 20, CNeutrinoFonts::FONT_STYLE_REGULAR, 1} }; int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index eeda08a24..5cc9085b5 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -36,7 +36,7 @@ #include "hintbox.h" #include - +#define MSG_FONT g_Font[SNeutrinoSettings::FONT_TYPE_MESSAGE_TEXT] /** x width ccw_head [relevant for CHintBox, CMsgBox. not enabled in CHint class] @@ -132,7 +132,7 @@ void CHintBox::init(const std::string& Text, const int& Width, const std::string timeout = HINTBOX_DEFAULT_TIMEOUT; w_indentation = indent; - hb_font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]; + hb_font = MSG_FONT; //enable shadow shadow = true; @@ -321,7 +321,7 @@ void CHintBox::setMsgText(const std::string& Text, const uint& hint_id, const in CComponentsInfoBox *obj_text = static_cast(ccw_body->getCCItem(id)); //set required font and line size - Font* font = font_text == NULL ? g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO] : font_text; + Font* font = font_text == NULL ? MSG_FONT : font_text; if (obj_text) obj_text->setText(Text, mode, font, color_text, style); } diff --git a/src/system/locals.h b/src/system/locals.h index 521bca09c..866567c49 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -730,6 +730,7 @@ typedef enum LOCALE_FONTMENU_HEAD, LOCALE_FONTMENU_INFOBAR, LOCALE_FONTMENU_MENU, + LOCALE_FONTMENU_MESSAGES, LOCALE_FONTMENU_MOVIEBROWSER, LOCALE_FONTMENU_OTHER, LOCALE_FONTMENU_SCALING, @@ -763,6 +764,7 @@ typedef enum LOCALE_FONTSIZE_MENU_HINT, LOCALE_FONTSIZE_MENU_INFO, LOCALE_FONTSIZE_MENU_TITLE, + LOCALE_FONTSIZE_MESSAGE_TEXT, LOCALE_FONTSIZE_MOVIEBROWSER_HEAD, LOCALE_FONTSIZE_MOVIEBROWSER_INFO, LOCALE_FONTSIZE_MOVIEBROWSER_LIST, @@ -1210,6 +1212,7 @@ typedef enum LOCALE_MENU_HINT_MENU_HINTS, LOCALE_MENU_HINT_MENU_POS, LOCALE_MENU_HINT_MENUS, + LOCALE_MENU_HINT_MESSAGE_FONTS, LOCALE_MENU_HINT_MISC_CEC, LOCALE_MENU_HINT_MISC_CHANNELLIST, LOCALE_MENU_HINT_MISC_ENERGY, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 96d6ee949..90954b5c6 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -730,6 +730,7 @@ const char * locale_real_names[] = "fontmenu.head", "fontmenu.infobar", "fontmenu.menu", + "fontmenu.messages", "fontmenu.moviebrowser", "fontmenu.other", "fontmenu.scaling", @@ -763,6 +764,7 @@ const char * locale_real_names[] = "fontsize.menu_hint", "fontsize.menu_info", "fontsize.menu_title", + "fontsize.message_text", "fontsize.moviebrowser_head", "fontsize.moviebrowser_info", "fontsize.moviebrowser_list", @@ -1210,6 +1212,7 @@ const char * locale_real_names[] = "menu.hint_menu_hints", "menu.hint_menu_pos", "menu.hint_menus", + "menu.hint_message_fonts", "menu.hint_misc_cec", "menu.hint_misc_channellist", "menu.hint_misc_energy", diff --git a/src/system/settings.h b/src/system/settings.h index c95d2f25b..f32e10d47 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -683,6 +683,7 @@ struct SNeutrinoSettings FONT_TYPE_MOVIEBROWSER_LIST, FONT_TYPE_MOVIEBROWSER_INFO, FONT_TYPE_SUBTITLES, + FONT_TYPE_MESSAGE_TEXT, FONT_TYPE_COUNT }; From 2b0b1c9f0f70106be07798dc5d4c7a2af1143997 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 20 Nov 2016 01:33:34 +0100 Subject: [PATCH 114/171] CComponentsFooter: add parameter for frame width for selected buttons Frame width was hard coded. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/696989dcf1740b606258617195388ee1f22c95da Author: Thilo Graf Date: 2016-11-20 (Sun, 20 Nov 2016) --- src/gui/components/cc_frm_footer.cpp | 9 +++++++-- src/gui/components/cc_frm_footer.h | 8 +++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 8256752cd..4a1cbfc4e 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -345,7 +345,12 @@ void CComponentsFooter::enableButtonBg(bool enable) } } -void CComponentsFooter::setSelectedButton(size_t item_id, const fb_pixel_t& fr_col, const fb_pixel_t& sel_fr_col, const fb_pixel_t& bg_col, const fb_pixel_t& sel_bg_col, const fb_pixel_t& text_col, const fb_pixel_t& sel_text_col) +void CComponentsFooter::setSelectedButton(size_t item_id, + const fb_pixel_t& fr_col, const fb_pixel_t& sel_fr_col, + const fb_pixel_t& bg_col, const fb_pixel_t& sel_bg_col, + const fb_pixel_t& text_col, const fb_pixel_t& sel_text_col, + const int& frame_width, + const int& sel_frame_width) { if (chain){ for (size_t i= 0; i< chain->size(); i++){ @@ -355,7 +360,7 @@ void CComponentsFooter::setSelectedButton(size_t item_id, const fb_pixel_t& fr_c fb_pixel_t sel_col = fr_col; if (chain->size() > 1) sel_col = sel_fr_col; //TODO: make it configurable - chain->setSelectedItem(item_id, sel_col, fr_col, sel_bg_col, bg_col, 1, 2); + chain->setSelectedItem(item_id, sel_col, fr_col, sel_bg_col, bg_col, frame_width, sel_frame_width); if (chain->size() > 1) getSelectedButtonObject()->setButtonTextColor(sel_text_col); diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index 7796aac39..49bd3fae6 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -152,6 +152,10 @@ class CComponentsFooter : public CComponentsHeader * @li optional: exepts type fb_pixel_t, as default text color * @param[in] sel_text_col * @li optional: exepts type fb_pixel_t, as selected text color + * @param[in] frame_width + * @li optional: exepts type int, default = 1 + * @param[in] sel_frame_width + * @li optional: exepts type int, default = 2 */ void setSelectedButton(size_t item_id, const fb_pixel_t& fr_col = COL_MENUCONTENTSELECTED_PLUS_2, @@ -159,7 +163,9 @@ class CComponentsFooter : public CComponentsHeader const fb_pixel_t& bg_col = COL_MENUFOOT_PLUS_0, /*TODO disabled at the moment, without effect*/ const fb_pixel_t& sel_bg_col = COL_MENUCONTENTSELECTED_PLUS_2, /*TODO disabled at the moment, without effect*/ const fb_pixel_t& text_col = COL_MENUCONTENTDARK_TEXT_PLUS_2, - const fb_pixel_t& sel_text_col = COL_MENUCONTENT_TEXT); + const fb_pixel_t& sel_text_col = COL_MENUCONTENT_TEXT, + const int& frame_width = 1, + const int& sel_frame_width = 2); ///returns id of select button, return value as int, -1 = nothing is selected int getSelectedButton(); ///returns selected button object, return value as pointer to object, NULL means nothing is selected From c35d8b0c26d374ae73279e72aaba128093ee9421 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 20 Nov 2016 14:09:19 +0100 Subject: [PATCH 115/171] CCDraw: add function for blink effect for cc items NOTE: experimental, for examples see CTestMenu class Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/717dec02c53bac3f2625de672189a249aa6aab4b Author: Thilo Graf Date: 2016-11-20 (Sun, 20 Nov 2016) --- src/gui/components/cc_draw.cpp | 46 +++++++++ src/gui/components/cc_draw.h | 44 ++++++++- src/gui/components/cc_item.cpp | 2 +- src/gui/components/cc_item_picture.cpp | 9 ++ src/gui/components/cc_item_picture.h | 3 + src/gui/test_menu.cpp | 129 +++++++++++++++++++------ 6 files changed, 201 insertions(+), 32 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 1e7372974..1e7cd3363 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -32,6 +32,7 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) { frameBuffer = CFrameBuffer::getInstance(); + x = cc_xr = x_old = 0; y = cc_yr = y_old = 0; height = height_old = CC_HEIGHT_MIN; @@ -70,6 +71,9 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) cc_body_gradient_saturation = 0xC0; cc_body_gradient_direction = cc_body_gradient_direction_old = CFrameBuffer::gradientVertical; + cc_draw_timer = NULL; + cc_draw_trigger_slot = sigc::mem_fun0(*this, &CCDraw::paintTrigger); + cc_gradient_bg_cleanup = true; v_fbdata.clear(); @@ -77,6 +81,9 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) CCDraw::~CCDraw() { + if(cc_draw_timer){ + delete cc_draw_timer; cc_draw_timer = NULL; + } clearFbData(); } @@ -718,3 +725,42 @@ void CCDraw::enableShadow(int mode, const int& shadow_width, bool force_paint) shadow_force = force_paint; } +void CCDraw::paintTrigger() +{ + if (!is_painted) + paint1(); + else + hide(); +} + +bool CCDraw::paintBlink(const int& interval, bool is_nano) +{ + if (cc_draw_timer == NULL){ + cc_draw_timer = new CComponentsTimer(interval, is_nano); + if (cc_draw_timer->OnTimer.empty()){ + cc_draw_timer->OnTimer.connect(cc_draw_trigger_slot); + } + } + if (cc_draw_timer) + return cc_draw_timer->isRun(); + + return false; +} + +bool CCDraw::cancelBlink(bool keep_on_screen) +{ + bool res = false; + + if (cc_draw_timer){ + res = cc_draw_timer->stopTimer(); + delete cc_draw_timer; cc_draw_timer = NULL; + } + + if(keep_on_screen) + paint1(); + else + hide(); + + + return res; +} \ No newline at end of file diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index d0664b7a4..463dc62e1 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -27,6 +27,7 @@ #include "cc_types.h" #include "cc_signals.h" +#include "cc_timer.h" #include #include #include @@ -47,7 +48,14 @@ class CCDraw : public COSDFader, public CComponentsSignals ///object: framebuffer object, usable in all sub classes CFrameBuffer * frameBuffer; - + + ///internal draw timer, used for effects + CComponentsTimer *cc_draw_timer; + ///slot for timer event, reserved for cc_draw_timer + sigc::slot0 cc_draw_trigger_slot; + ///paint item with trigger effect + virtual void paintTrigger(); + ///property: x-position on screen, to alter with setPos() or setDimensionsAll(), see also defines CC_APPEND, CC_CENTERED int x, x_old; ///property: y-position on screen, to alter setPos() or setDimensionsAll(), see also defines CC_APPEND, CC_CENTERED @@ -299,10 +307,40 @@ class CCDraw : public COSDFader, public CComponentsSignals ///abstract: paint item, arg: do_save_bg see paintInit() above virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES) = 0; - ///paint item, same like paint(CC_SAVE_SCREEN_YES) but without any argument - virtual void paint1(){paint(CC_SAVE_SCREEN_YES);} ///paint item, same like paint(CC_SAVE_SCREEN_NO) but without any argument virtual void paint0(){paint(CC_SAVE_SCREEN_NO);} + ///paint item, same like paint(CC_SAVE_SCREEN_YES) but without any argument + virtual void paint1(){paint(CC_SAVE_SCREEN_YES);} + + /**paint item with blink effect + * This should work with all cc item types. + * + * @return bool returns true if effect is successful started + * + * @param[in] interval optional, interval time as int, default = 1 + * @param[in] is_nano optional, time mode as bool, default = false means as seconds, true means nano seconds. + * + * @see take a look into test menu class for examples. + * cancelBlink() + * + * NOTE: If you want to use enbedded items from a cc form (e.g. with gettCCItem(ID)) + * you must cast into current item type. e.g.: + * CComponentsItemBla* item = static_cast(form->getCCItem(2)); + * and it's possible you must remove from screen before e.g.: + * item->kill(); + */ + virtual bool paintBlink(const int& interval = 1, bool is_nano = false); + + /**Cancel blink effect + * + * @return bool returns true if effect was successful canceled + * + * @param[in] keep_on_screen optional, exepts bool, default = false. means: item is not repainted after canceled effect + * + * @see take a look into test menu class for examples + * NOTE: Effect must be started with paintBlink() + */ + bool cancelBlink(bool keep_on_screen = false); ///signal on before paint fb layers, called inside paintFbItems() sigc::signal OnBeforePaintLayers; diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 35d2ec981..10147f6cf 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -3,7 +3,7 @@ Copyright (C) 2001 by Steffen Hehn 'McClean' Classes for generic GUI-related components. - Copyright (C) 2012-2015, Thilo Graf 'dbt' + Copyright (C) 2012-2016, Thilo Graf 'dbt' Copyright (C) 2012, Michael Liebmann 'micha-bbg' License: GPL diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index 8299f2469..c18543611 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -349,6 +349,15 @@ bool CComponentsPicture::hasChanges() return ret; } +void CComponentsPicture::paintTrigger() +{ + if (!is_painted && !isPicPainted()) + paint1(); + else + hide(); +} + + CComponentsChannelLogo::CComponentsChannelLogo( const int &x_pos, const int &y_pos, const int &w, const int &h, const std::string& channelName, const uint64_t& channelId, diff --git a/src/gui/components/cc_item_picture.h b/src/gui/components/cc_item_picture.h index 8d39e73d2..435065fc9 100644 --- a/src/gui/components/cc_item_picture.h +++ b/src/gui/components/cc_item_picture.h @@ -81,6 +81,9 @@ class CComponentsPicture : public CComponentsItem ///helper: indicate for reinit bool need_init; + ///paint item with changed paint and hide effect + void paintTrigger(); + void init( const int &x_pos, const int &y_pos, const int &w, const int &h, const std::string& image_name, CComponentsForm *parent, diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index b5b1dd772..64035b72c 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -419,6 +419,32 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) pic->hide(); return res; } + else if (actionKey == "blink"){ + if (sq == NULL) + sq = new CComponentsShapeSquare (0, 0, 100, 100, NULL, CC_SHADOW_ON, COL_OLIVE, COL_LIGHT_GRAY, COL_RED); + + if (sq->paintBlink(500000, true)){ + ShowHint("Testmenu: Blink","Testmenu: Blinking square is running ...", 700, 6); + } + if (sq->cancelBlink()){ + ShowHint("Testmenu: Blink","Testmenu: Blinking square stopped ...", 700, 2); + } + + return res; + } + else if (actionKey == "blink_image"){ + if (pic == NULL) + pic = new CComponentsPicture (100, 100, 200, 100, ICONSDIR "/btn_play.png"); + + if (pic->paintBlink(500000, true)){ + ShowHint("Testmenu: Blink","Testmenu: Blinking image is running ...", 700, 10); + } + if (pic->cancelBlink()){ + ShowHint("Testmenu: Blink","Testmenu: Blinking image stopped ...", 700, 2); + } + + return res; + } else if (actionKey == "channellogo"){ if (chnl_pic == NULL) chnl_pic = new CComponentsChannelLogo(100, 100, "ProSieben", 0); @@ -478,6 +504,23 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) txt->hide(); else txt->paint(); + + return res; + } + else if (actionKey == "blinking_text"){ + if (txt == NULL){ + txt = new CComponentsText(); + txt->setDimensionsAll(100, 100, 250, 100); + txt->setText("This is a text for testing textbox", CTextBox::NO_AUTO_LINEBREAK); + } + + if (txt->paintBlink(500000, true)){ + ShowHint("Testmenu: Blink","Testmenu: Blinking text is running ...", 700, 10); + } + if (txt->cancelBlink()){ + ShowHint("Testmenu: Blink","Testmenu: Blinking text stopped ...", 700, 2); + } + return res; } else if (actionKey == "text_ext"){ @@ -494,6 +537,25 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) text_ext->paint(); return res; } + else if (actionKey == "blinking_text_ext"){ + if (text_ext == NULL){ + text_ext = new CComponentsExtTextForm(); + text_ext->setDimensionsAll(10, 20, 300, 48); + text_ext->setLabelAndText("Label", "Text for demo", g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]); + text_ext->setFrameThickness(2); + // text_ext->setLabelWidthPercent(15/*%*/); + text_ext->paint0(); + static_cast(text_ext->getCCItem(1))->kill(); + } + + if (static_cast(text_ext->getCCItem(1))-> paintBlink(500000, true)){ + ShowHint("Testmenu: Blink","Testmenu: Blinking extended text is running ...", 700, 10); + } + if (text_ext->getTextObject()->cancelBlink()){ + ShowHint("Testmenu: Blink","Testmenu: Blinking extended text stopped ...", 700, 2); + } + return res; + } else if (actionKey == "header"){ int hh = 30;//g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); if (header == NULL){ @@ -599,40 +661,47 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) return res; } else if (actionKey == "iconform"){ - if (iconform == NULL) + if (iconform == NULL){ iconform = new CComponentsIconForm(); - iconform->setColorBody(COL_LIGHT_GRAY); - iconform->setDimensionsAll(100, 100,80/*480*/, 80); - iconform->setFrameThickness(2); - iconform->setColorFrame(COL_WHITE); - iconform->setDirection(CC_DIR_X); - iconform->setAppendOffset(5, 5); + iconform->setColorBody(COL_LIGHT_GRAY); + iconform->setDimensionsAll(100, 100,80/*480*/, 80); + iconform->setFrameThickness(2); + iconform->setColorFrame(COL_WHITE); + iconform->setDirection(CC_DIR_X); + iconform->setAppendOffset(5, 5); - //For existing instances it's recommended - //to remove old items before add new icons, otherwise icons will be appended. - iconform->removeAllIcons(); + //For existing instances it's recommended + //to remove old items before add new icons, otherwise icons will be appended. + iconform->removeAllIcons(); - //you can... - //add icons step by step - iconform->addIcon(NEUTRINO_ICON_INFO); - iconform->addIcon(NEUTRINO_ICON_INFO); - iconform->addIcon(NEUTRINO_ICON_HINT_MEDIA); - //...or - //add icons with vector - std::vector v_icons; - v_icons.push_back(NEUTRINO_ICON_HINT_VIDEO); - v_icons.push_back(NEUTRINO_ICON_HINT_AUDIO); - iconform->addIcon(v_icons); + //you can... + //add icons step by step + iconform->addIcon(NEUTRINO_ICON_INFO); + iconform->addIcon(NEUTRINO_ICON_INFO); + iconform->addIcon(NEUTRINO_ICON_HINT_MEDIA); + //...or + //add icons with vector + std::vector v_icons; + v_icons.push_back(NEUTRINO_ICON_HINT_VIDEO); + v_icons.push_back(NEUTRINO_ICON_HINT_AUDIO); + iconform->addIcon(v_icons); - //insert any icon, here as first (index = 0...n) - iconform->insertIcon(0, NEUTRINO_ICON_HINT_APLAY); -// iconform->setIconAlign(CComponentsIconForm::CC_ICONS_FRM_ALIGN_RIGHT); - - if (iconform->isPainted()) - iconform->hide(); - else{ + //insert any icon, here as first (index = 0...n) + iconform->insertIcon(0, NEUTRINO_ICON_HINT_APLAY); + // iconform->setIconAlign(CComponentsIconForm::CC_ICONS_FRM_ALIGN_RIGHT); iconform->paint(); } + + CComponentsPicture* img = static_cast(iconform->getCCItem(2)); + img->kill(); + + if (img->paintBlink(500000, true)){ + ShowHint("Testmenu: Blink","Testmenu: Blinking image is running ...", 700, 10); + } + if (img->cancelBlink(true)){ + ShowHint("Testmenu: Blink","Testmenu: Blinking image stopped ...", 700, 2); + } + return res; } else if (actionKey == "window"){ @@ -894,15 +963,19 @@ void CTestMenu::showCCTests(CMenuWidget *widget) widget->addItem(new CMenuForwarder("Button", true, NULL, this, "button")); widget->addItem(new CMenuForwarder("Circle", true, NULL, this, "circle")); widget->addItem(new CMenuForwarder("Square", true, NULL, this, "square")); + widget->addItem(new CMenuForwarder("Blinking-Square", true, NULL, this, "blink")); + widget->addItem(new CMenuForwarder("Blinking-Image", true, NULL, this, "blink_image")); widget->addItem(new CMenuForwarder("Picture", true, NULL, this, "picture")); widget->addItem(new CMenuForwarder("Channel-Logo", true, NULL, this, "channellogo")); widget->addItem(new CMenuForwarder("Form", true, NULL, this, "form")); widget->addItem(new CMenuForwarder("Text", true, NULL, this, "text")); + widget->addItem(new CMenuForwarder("Blinking Text", true, NULL, this, "blinking_text")); widget->addItem(new CMenuForwarder("Header", true, NULL, this, "header")); widget->addItem(new CMenuForwarder("Footer", true, NULL, this, "footer")); widget->addItem(new CMenuForwarder("Icon-Form", true, NULL, this, "iconform")); widget->addItem(new CMenuForwarder("Window", true, NULL, this, "window")); widget->addItem(new CMenuForwarder("Text-Extended", true, NULL, this, "text_ext")); + widget->addItem(new CMenuForwarder("Blinking Extended Text", true, NULL, this, "blinking_text_ext")); widget->addItem(new CMenuForwarder("Scrollbar", true, NULL, this, "scrollbar")); } From 33e7afdf8d047daf2f85ad9adb713707e26538fa Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 20 Nov 2016 15:18:45 +0100 Subject: [PATCH 116/171] CComponentsFooter: use minimal frame width as default for buttons Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7567f7de00bf8b6ef6d1967819586dfaea2036e4 Author: Thilo Graf Date: 2016-11-20 (Sun, 20 Nov 2016) --- src/gui/components/cc_frm_footer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index 49bd3fae6..0afd82454 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -165,7 +165,7 @@ class CComponentsFooter : public CComponentsHeader const fb_pixel_t& text_col = COL_MENUCONTENTDARK_TEXT_PLUS_2, const fb_pixel_t& sel_text_col = COL_MENUCONTENT_TEXT, const int& frame_width = 1, - const int& sel_frame_width = 2); + const int& sel_frame_width = 1); ///returns id of select button, return value as int, -1 = nothing is selected int getSelectedButton(); ///returns selected button object, return value as pointer to object, NULL means nothing is selected From 8e1bc39318b2fb63e1d3bc498df58bc3c6f0856c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 20 Nov 2016 15:44:57 +0100 Subject: [PATCH 117/171] CMsgBox: enable button background as default Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/01893dfefc42ba4d0e841fefe4627b5ea856bd52 Author: Thilo Graf Date: 2016-11-20 (Sun, 20 Nov 2016) --- src/gui/widget/msgbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index b9fc55d94..567780794 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -89,7 +89,7 @@ void CMsgBox::init(const int& Height, const int& ShowButtons, const msg_result_t showFooter(true); ccw_h_footer = ccw_footer->getHeight()+OFFSET_INNER_MID; ccw_footer->setHeight(ccw_h_footer); - btn_enable_bg = false; + btn_enable_bg = true; ccw_col_footer = ccw_body->getColorBody(); ccw_footer->doPaintBg(false); int h_current = height; From af471915c967b64ca719d4f4aaf2b0e9c4a596e4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 20 Nov 2016 16:32:37 +0100 Subject: [PATCH 118/171] CComponentsFooter: use select/unselect colors from menues as default Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4b88a244da967fce1d9ca6219afb5c722e322108 Author: Thilo Graf Date: 2016-11-20 (Sun, 20 Nov 2016) --- src/gui/components/cc_frm_footer.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index 0afd82454..4c5239d56 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -160,10 +160,10 @@ class CComponentsFooter : public CComponentsHeader void setSelectedButton(size_t item_id, const fb_pixel_t& fr_col = COL_MENUCONTENTSELECTED_PLUS_2, const fb_pixel_t& sel_fr_col = COL_MENUCONTENTSELECTED_PLUS_0, - const fb_pixel_t& bg_col = COL_MENUFOOT_PLUS_0, /*TODO disabled at the moment, without effect*/ - const fb_pixel_t& sel_bg_col = COL_MENUCONTENTSELECTED_PLUS_2, /*TODO disabled at the moment, without effect*/ - const fb_pixel_t& text_col = COL_MENUCONTENTDARK_TEXT_PLUS_2, - const fb_pixel_t& sel_text_col = COL_MENUCONTENT_TEXT, + const fb_pixel_t& bg_col = COL_MENUCONTENT_PLUS_0, + const fb_pixel_t& sel_bg_col = COL_MENUCONTENTSELECTED_PLUS_0, + const fb_pixel_t& text_col = COL_MENUCONTENT_TEXT, + const fb_pixel_t& sel_text_col = COL_MENUCONTENTSELECTED_TEXT, const int& frame_width = 1, const int& sel_frame_width = 1); ///returns id of select button, return value as int, -1 = nothing is selected From ec132fe91bd1f05e0c56f30f174585991771124c Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sun, 20 Nov 2016 19:24:08 +0100 Subject: [PATCH 119/171] add option to read saved epg data frequently Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6cd5dd8e23f55954070f22c719417d9755dd4f91 Author: TangoCash Date: 2016-11-20 (Sun, 20 Nov 2016) --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + lib/sectionsdclient/sectionsdMsg.h | 1 + lib/sectionsdclient/sectionsdclient.cpp | 1 + lib/sectionsdclient/sectionsdclient.h | 1 + src/eitd/sectionsd.cpp | 24 ++++++++++++++++++-- src/gui/miscsettings_menu.cpp | 30 +++++++++++++++++++++++-- src/gui/miscsettings_menu.h | 1 + src/neutrino.cpp | 6 ++++- src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ src/system/settings.h | 1 + 12 files changed, 66 insertions(+), 5 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index c84063a86..71f8d8023 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1514,6 +1514,7 @@ miscsettings.epg_old_events EPG verwerfen nach (Std.) miscsettings.epg_old_events_hint1 Wie lange abgelaufene EPG-Daten aufheben? miscsettings.epg_old_events_hint2 Angabe in Stunden miscsettings.epg_read Gespeicherte EPG-Daten einlesen +miscsettings.epg_read_frequently EPG regelmäßig einlesen miscsettings.epg_save EPG zwischenspeichern miscsettings.epg_save_frequently EPG regelmäßig speichern miscsettings.epg_save_mode Nur Favoriten diff --git a/data/locale/english.locale b/data/locale/english.locale index b6b6e62f1..4b1e7e87b 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1514,6 +1514,7 @@ miscsettings.epg_old_events EPG remove after (std.) miscsettings.epg_old_events_hint1 How long will EPG-Data be stored after they timed out? miscsettings.epg_old_events_hint2 Set in hours miscsettings.epg_read Restore EPG on boot +miscsettings.epg_read_frequently Restore EPG frequently miscsettings.epg_save Save EPG on shutdown miscsettings.epg_save_frequently Save EPG frequently miscsettings.epg_save_mode Favorites only diff --git a/lib/sectionsdclient/sectionsdMsg.h b/lib/sectionsdclient/sectionsdMsg.h index 9b6b666a4..440feabae 100644 --- a/lib/sectionsdclient/sectionsdMsg.h +++ b/lib/sectionsdclient/sectionsdMsg.h @@ -102,6 +102,7 @@ struct sectionsd // std::string network_ntpserver; // std::string epg_dir; int epg_save_frequently; + int epg_read_frequently; }; }; diff --git a/lib/sectionsdclient/sectionsdclient.cpp b/lib/sectionsdclient/sectionsdclient.cpp index e4dcee4e5..c6be1fac2 100644 --- a/lib/sectionsdclient/sectionsdclient.cpp +++ b/lib/sectionsdclient/sectionsdclient.cpp @@ -207,6 +207,7 @@ void CSectionsdClient::setConfig(const epg_config config) msg->network_ntpenable = config.network_ntpenable; msg->epg_extendedcache = config.epg_extendedcache; msg->epg_save_frequently= config.epg_save_frequently; + msg->epg_read_frequently= config.epg_read_frequently; // config.network_ntpserver: strcpy(&pData[sizeof(sectionsd::commandSetConfig)], config.network_ntpserver.c_str()); // config.epg_dir: diff --git a/lib/sectionsdclient/sectionsdclient.h b/lib/sectionsdclient/sectionsdclient.h index 1f70b01f2..c827d83b5 100644 --- a/lib/sectionsdclient/sectionsdclient.h +++ b/lib/sectionsdclient/sectionsdclient.h @@ -163,6 +163,7 @@ class CSectionsdClient : private CBasicClient int epg_extendedcache; std::string network_ntpserver; int epg_save_frequently; + int epg_read_frequently; std::string epg_dir; } epg_config; diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 91e6b0dfa..e131b423d 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -72,7 +72,7 @@ static bool notify_complete = false; /* period to clean cached sections and force restart sections read */ #define META_HOUSEKEEPING_COUNT (24 * 60 * 60) / HOUSEKEEPING_SLEEP // meta housekeeping after XX housekeepings - every 24h - #define STANDBY_HOUSEKEEPING_COUNT (60 * 60) / HOUSEKEEPING_SLEEP -#define EPG_SAVE_FREQUENTLY_COUNT (60 * 60) / HOUSEKEEPING_SLEEP +#define EPG_SERVICE_FREQUENTLY_COUNT (60 * 60) / HOUSEKEEPING_SLEEP // Timeout bei tcp/ip connections in ms #define READ_TIMEOUT_IN_SECONDS 2 @@ -85,6 +85,7 @@ static bool notify_complete = false; #define TIMEOUTS_EIT_VERSION_WAIT (2 * CHECK_RESTART_DMX_AFTER_TIMEOUTS) static unsigned int epg_save_frequently; +static unsigned int epg_read_frequently; static long secondsToCache; long int secondsExtendedTextCache = 0; static long oldEventsAre; @@ -1126,6 +1127,8 @@ static void commandSetConfig(int connfd, char *data, const unsigned /*dataLength secondsExtendedTextCache = (long)(pmsg->epg_extendedcache)*60L*60L; max_events = pmsg->epg_max_events; epg_save_frequently = pmsg->epg_save_frequently; + epg_read_frequently = pmsg->epg_read_frequently; + unlockEvents(); bool time_wakeup = false; @@ -2093,7 +2096,7 @@ static void *houseKeepingThread(void *) removeOldEvents(oldEventsAre); // alte Events ecount++; - if (ecount == EPG_SAVE_FREQUENTLY_COUNT) + if (ecount == EPG_SERVICE_FREQUENTLY_COUNT) { if (epg_save_frequently > 0) { @@ -2106,6 +2109,22 @@ static void *houseKeepingThread(void *) } writeEventsToFile(d.c_str()); } + if (epg_read_frequently > 0) + { + pthread_t thrInsert; + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + std::string d = epg_dir + "/"; + + printf("[%s]: %s\n",__func__,d.c_str()); + + if (pthread_create (&thrInsert, &attr, insertEventsfromFile, (void *)d.c_str() )) + { + perror("sectionsd: pthread_create()"); + } + pthread_attr_destroy(&attr); + } ecount = 0; } @@ -2163,6 +2182,7 @@ bool CEitManager::Start() oldEventsAre = config.epg_old_events*60L*60L; //hours max_events = config.epg_max_events; epg_save_frequently = config.epg_save_frequently; + epg_read_frequently = config.epg_read_frequently; if (find_executable("ntpdate").empty()){ ntp_system_cmd_prefix = find_executable("ntpd"); diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index e6ce615ca..49bafb4bd 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -69,6 +69,7 @@ CMiscMenue::CMiscMenue() epg_save_standby = NULL; epg_save_frequently = NULL; epg_read = NULL; + epg_read_frequently = NULL; epg_dir = NULL; } @@ -409,12 +410,15 @@ void CMiscMenue::showMiscSettingsMenuEpg(CMenuWidget *ms_epg) epg_save_standby = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE_STANDBY, &g_settings.epg_save_standby, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.epg_save); epg_save_standby->setHint("", LOCALE_MENU_HINT_EPG_SAVE_STANDBY); - epg_save_frequently = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE_FREQUENTLY, &g_settings.epg_save_frequently, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.epg_save, sectionsdConfigNotifier); + epg_save_frequently = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE_FREQUENTLY, &g_settings.epg_save_frequently, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.epg_save, this); epg_save_frequently->setHint("", LOCALE_MENU_HINT_EPG_SAVE_FREQUENTLY); epg_read = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_READ, &g_settings.epg_read, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); epg_read->setHint("", LOCALE_MENU_HINT_EPG_READ); + epg_read_frequently = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_READ_FREQUENTLY, &g_settings.epg_read_frequently, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.epg_read, this); + epg_read_frequently->setHint("", LOCALE_MENU_HINT_EPG_READ_FREQUENTLY); + epg_dir = new CMenuForwarder(LOCALE_MISCSETTINGS_EPG_DIR, (g_settings.epg_save || g_settings.epg_read), g_settings.epg_dir, this, "epgdir"); epg_dir->setHint("", LOCALE_MENU_HINT_EPG_DIR); @@ -462,6 +466,7 @@ void CMiscMenue::showMiscSettingsMenuEpg(CMenuWidget *ms_epg) ms_epg->addItem(epg_save_standby); ms_epg->addItem(epg_save_frequently); ms_epg->addItem(epg_read); + ms_epg->addItem(epg_read_frequently); ms_epg->addItem(epg_dir); ms_epg->addItem(GenericMenuSeparatorLine); ms_epg->addItem(mf); @@ -635,7 +640,28 @@ bool CMiscMenue::changeNotify(const neutrino_locale_t OptionName, void * /*data* } else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_EPG_READ)) { - epg_dir->setActive(g_settings.epg_save || g_settings.epg_read); + epg_read_frequently->setActive(g_settings.epg_read); + epg_dir->setActive(g_settings.epg_read || g_settings.epg_save); + + CNeutrinoApp::getInstance()->SendSectionsdConfig(); + + ret = menu_return::RETURN_REPAINT; + } + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_EPG_READ_FREQUENTLY)) + { + g_settings.epg_read_frequently = g_settings.epg_read ? g_settings.epg_read_frequently : 0; + + CNeutrinoApp::getInstance()->SendSectionsdConfig(); + + ret = menu_return::RETURN_REPAINT; + } + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_EPG_SAVE_FREQUENTLY)) + { + g_settings.epg_save_frequently = g_settings.epg_save ? g_settings.epg_save_frequently : 0; + + CNeutrinoApp::getInstance()->SendSectionsdConfig(); + + ret = menu_return::RETURN_REPAINT; } else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_EPG_SCAN)) { diff --git a/src/gui/miscsettings_menu.h b/src/gui/miscsettings_menu.h index 8e5848ef8..b8bbaa1a7 100644 --- a/src/gui/miscsettings_menu.h +++ b/src/gui/miscsettings_menu.h @@ -45,6 +45,7 @@ class CMiscMenue : public CMenuTarget, CChangeObserver CMenuOptionChooser * epg_save_standby; CMenuOptionChooser * epg_save_frequently; CMenuOptionChooser * epg_read; + CMenuOptionChooser * epg_read_frequently; CMenuOptionChooser * epg_scan; CMenuOptionChooser * tmdb_onoff; CMenuOptionChooser * youtube_onoff; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index a983575b6..d83f98a0b 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -559,8 +559,9 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.epg_save = configfile.getBool("epg_save", false); g_settings.epg_save_standby = configfile.getBool("epg_save_standby", true); - g_settings.epg_save_frequently = configfile.getInt32("epg_save_frequently", false); + g_settings.epg_save_frequently = configfile.getInt32("epg_save_frequently", 0); g_settings.epg_read = configfile.getBool("epg_read", g_settings.epg_save); + g_settings.epg_read_frequently = configfile.getInt32("epg_read_frequently", 0); g_settings.epg_scan = configfile.getInt32("epg_scan", CEpgScan::SCAN_CURRENT); g_settings.epg_scan_mode = configfile.getInt32("epg_scan_mode", CEpgScan::MODE_OFF); // backward-compatible check @@ -1146,6 +1147,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setBool("epg_save_standby", g_settings.epg_save_standby); configfile.setInt32("epg_save_frequently", g_settings.epg_save_frequently); configfile.setBool("epg_read", g_settings.epg_read); + configfile.setInt32("epg_read_frequently", g_settings.epg_read_frequently); configfile.setInt32("epg_scan", g_settings.epg_scan); configfile.setInt32("epg_scan_mode", g_settings.epg_scan_mode); configfile.setInt32("epg_save_mode", g_settings.epg_save_mode); @@ -1839,6 +1841,7 @@ void CNeutrinoApp::MakeSectionsdConfig(CSectionsdClient::epg_config& config) config.epg_max_events = g_settings.epg_max_events; config.epg_extendedcache = g_settings.epg_extendedcache; config.epg_save_frequently = g_settings.epg_save ? g_settings.epg_save_frequently : 0; + config.epg_read_frequently = g_settings.epg_read ? g_settings.epg_read_frequently : 0; config.epg_dir = g_settings.epg_dir; config.network_ntpserver = g_settings.network_ntpserver; config.network_ntprefresh = atoi(g_settings.network_ntprefresh.c_str()); @@ -1857,6 +1860,7 @@ void CNeutrinoApp::InitZapper() struct stat my_stat; g_InfoViewer->start(); + SendSectionsdConfig(); if (g_settings.epg_read) { if(stat(g_settings.epg_dir.c_str(), &my_stat) == 0) g_Sectionsd->readSIfromXML(g_settings.epg_dir.c_str()); diff --git a/src/system/locals.h b/src/system/locals.h index 866567c49..b29341ef7 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1067,6 +1067,7 @@ typedef enum LOCALE_MENU_HINT_EPG_MAX_EVENTS, LOCALE_MENU_HINT_EPG_OLD_EVENTS, LOCALE_MENU_HINT_EPG_READ, + LOCALE_MENU_HINT_EPG_READ_FREQUENTLY, LOCALE_MENU_HINT_EPG_SAVE, LOCALE_MENU_HINT_EPG_SAVE_FREQUENTLY, LOCALE_MENU_HINT_EPG_SAVE_MODE, @@ -1541,6 +1542,7 @@ typedef enum LOCALE_MISCSETTINGS_EPG_OLD_EVENTS_HINT1, LOCALE_MISCSETTINGS_EPG_OLD_EVENTS_HINT2, LOCALE_MISCSETTINGS_EPG_READ, + LOCALE_MISCSETTINGS_EPG_READ_FREQUENTLY, LOCALE_MISCSETTINGS_EPG_SAVE, LOCALE_MISCSETTINGS_EPG_SAVE_FREQUENTLY, LOCALE_MISCSETTINGS_EPG_SAVE_MODE, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 90954b5c6..bf61c27ac 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1067,6 +1067,7 @@ const char * locale_real_names[] = "menu.hint_epg_max_events", "menu.hint_epg_old_events", "menu.hint_epg_read", + "menu.hint_epg_read_frequently", "menu.hint_epg_save", "menu.hint_epg_save_frequently", "menu.hint_epg_save_mode", @@ -1541,6 +1542,7 @@ const char * locale_real_names[] = "miscsettings.epg_old_events_hint1", "miscsettings.epg_old_events_hint2", "miscsettings.epg_read", + "miscsettings.epg_read_frequently", "miscsettings.epg_save", "miscsettings.epg_save_frequently", "miscsettings.epg_save_mode", diff --git a/src/system/settings.h b/src/system/settings.h index f32e10d47..359bbd4af 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -280,6 +280,7 @@ struct SNeutrinoSettings int epg_save_standby; int epg_save_frequently; int epg_read; + int epg_read_frequently; int epg_cache; int epg_old_events; int epg_max_events; From c84691aa502e93e04f3cfa461b32e1ae269c3796 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 20 Nov 2016 22:45:35 +0100 Subject: [PATCH 120/171] CBEBouquetWidget: simplify hintbox calls Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2d9775c36b7f9fc49d3a6ae8af11bc3d3822374e Author: Thilo Graf Date: 2016-11-20 (Sun, 20 Nov 2016) --- src/gui/bedit/bouqueteditor_bouquets.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 28223aa4a..f09ad4a66 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -502,18 +502,16 @@ std::string CBEBouquetWidget::inputName(const char * const defaultName, const ne void CBEBouquetWidget::saveChanges() { - CHintBox* hintBox= new CHintBox(LOCALE_BOUQUETEDITOR_NAME, g_Locale->getText(LOCALE_BOUQUETEDITOR_SAVINGCHANGES), 480); // UTF-8 - hintBox->paint(); + CHintBox hintBox(LOCALE_BOUQUETEDITOR_NAME, g_Locale->getText(LOCALE_BOUQUETEDITOR_SAVINGCHANGES), 480); // UTF-8 + hintBox.paint(); g_Zapit->saveBouquets(); - hintBox->hide(); - delete hintBox; + hintBox.hide(); } void CBEBouquetWidget::discardChanges() { - CHintBox* hintBox= new CHintBox(LOCALE_BOUQUETEDITOR_NAME, g_Locale->getText(LOCALE_BOUQUETEDITOR_DISCARDINGCHANGES), 480); // UTF-8 - hintBox->paint(); + CHintBox hintBox(LOCALE_BOUQUETEDITOR_NAME, g_Locale->getText(LOCALE_BOUQUETEDITOR_DISCARDINGCHANGES), 480); // UTF-8 + hintBox.paint(); g_Zapit->restoreBouquets(); - hintBox->hide(); - delete hintBox; + hintBox.hide(); } From 0e4f2884604f30fc85b8408916b0886a886756c0 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 20 Nov 2016 22:46:49 +0100 Subject: [PATCH 121/171] CFavorites: simplify hintbox calls Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/47b035849023945af39f442ebdc90d47fef66047 Author: Thilo Graf Date: 2016-11-20 (Sun, 20 Nov 2016) --- src/gui/favorites.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/favorites.cpp b/src/gui/favorites.cpp index 041cf35d1..6214ad0f7 100644 --- a/src/gui/favorites.cpp +++ b/src/gui/favorites.cpp @@ -127,14 +127,13 @@ int CFavorites::exec(CMenuTarget* parent, const std::string & actionKey) } #endif - CHintBox* hintBox = new CHintBox(LOCALE_FAVORITES_BOUQUETNAME, g_Locale->getText(LOCALE_FAVORITES_ADDCHANNEL), 380); // UTF-8 + CHintBox hintBox(LOCALE_FAVORITES_BOUQUETNAME, g_Locale->getText(LOCALE_FAVORITES_ADDCHANNEL), 380); // UTF-8 if(!show_list) - hintBox->paint(); + hintBox.paint(); status = addChannelToFavorites(show_list); - hintBox->hide(); - delete hintBox; + hintBox.hide(); // -- Display result From 659afa284a84b185bd23a548187a874706949e1c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 20 Nov 2016 22:49:07 +0100 Subject: [PATCH 122/171] CHDDMenuHandler: simplify and fix hintbox calls Hints were not closed after lost scope. Explicit hide() is required. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/74473d0ebe1976cbc98ae713b10e8630bdbad01a Author: Thilo Graf Date: 2016-11-20 (Sun, 20 Nov 2016) --- src/gui/hdd_menu.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index dcb79167e..8205ddae9 100644 --- a/src/gui/hdd_menu.cpp +++ b/src/gui/hdd_menu.cpp @@ -336,8 +336,8 @@ bool CHDDMenuHandler::waitfordev(std::string dev, int maxwait) void CHDDMenuHandler::showHint(std::string &message) { - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, message.c_str()); - hintBox->paint(); + CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, message.c_str()); + hintBox.paint(); uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(3); neutrino_msg_t msg; @@ -355,7 +355,7 @@ void CHDDMenuHandler::showHint(std::string &message) else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) break; } - delete hintBox; + hintBox.hide(); } void CHDDMenuHandler::setRecordPath(std::string &dev) @@ -482,8 +482,8 @@ int CHDDMenuHandler::exec(CMenuTarget* parent, const std::string &actionkey) if (actionkey[0] == 'm') { for (std::vector::iterator it = hdd_list.begin(); it != hdd_list.end(); ++it) { if (it->devname == dev) { - CHintBox * hintbox = new CHintBox(it->mounted ? LOCALE_HDD_UMOUNT : LOCALE_HDD_MOUNT, it->devname.c_str()); - hintbox->paint(); + CHintBox hintbox(it->mounted ? LOCALE_HDD_UMOUNT : LOCALE_HDD_MOUNT, it->devname.c_str()); + hintbox.paint(); if (it->mounted) umount_dev(it->devname); else @@ -491,7 +491,7 @@ int CHDDMenuHandler::exec(CMenuTarget* parent, const std::string &actionkey) it->mounted = is_mounted(it->devname.c_str()); it->cmf->setOption(it->mounted ? umount : mount); - delete hintbox; + hintbox.hide(); return menu_return::RETURN_REPAINT; } } From 6f502010b0f054dc82b049ce082a387d3e62b359 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 20 Nov 2016 22:50:41 +0100 Subject: [PATCH 123/171] CNetworkSetup: simplify hintbox calls Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f85270f1ed1494baa5116236661c83f78f66239b Author: Thilo Graf Date: 2016-11-20 (Sun, 20 Nov 2016) --- src/gui/network_setup.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/network_setup.cpp b/src/gui/network_setup.cpp index a3b652e36..c6748f23f 100644 --- a/src/gui/network_setup.cpp +++ b/src/gui/network_setup.cpp @@ -578,15 +578,14 @@ void CNetworkSetup::applyNetworkSettings() if (!checkForIP()) return; - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_NETWORKMENU_APPLY_SETTINGS)); // UTF-8 - hintBox->paint(); + CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_NETWORKMENU_APPLY_SETTINGS)); // UTF-8 + hintBox.paint(); networkConfig->stopNetwork(); saveNetworkSettings(); networkConfig->startNetwork(); - hintBox->hide(); - delete hintBox; + hintBox.hide(); } //open a message dialog with buttons, From ac29accd85fe125b31040891483cf6500d6a369d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 20 Nov 2016 22:52:46 +0100 Subject: [PATCH 124/171] CMovieBrowser: simplify and fix hintbox calls Some hints were not closed. Explicit hide() is required. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/bf05d26ae30ca7c7769062dd7d4b1f592bc5febe Author: Thilo Graf Date: 2016-11-20 (Sun, 20 Nov 2016) --- src/gui/moviebrowser/mb.cpp | 38 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index ab8ac7443..495c270ec 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -829,11 +829,11 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) bool onefile = (actionKey == "copy_onefile"); if ((show_mode == MB_SHOW_RECORDS) && (ShowMsg(LOCALE_MESSAGEBOX_INFO, onefile ? LOCALE_MOVIEBROWSER_COPY : LOCALE_MOVIEBROWSER_COPIES, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo) == CMsgBox::mbrYes)) { - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_COPYING); - hintBox->paint(); - sleep(1); - hintBox->hide(); - delete hintBox; + CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_COPYING); + hintBox.paint(); + sleep(1); //??? + hintBox.hide(); + framebuffer->paintBackground(); // clear screen CMovieCut mc; bool res = mc.copyMovie(m_movieSelectionHandler, onefile); @@ -854,11 +854,11 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) #endif if ((show_mode == MB_SHOW_RECORDS) && (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_CUT, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo) == CMsgBox::mbrYes)) { - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_CUTTING); - hintBox->paint(); - sleep(1); - hintBox->hide(); - delete hintBox; + CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_CUTTING); + hintBox.paint(); + sleep(1); //??? + hintBox.hide(); + framebuffer->paintBackground(); // clear screen CMovieCut mc; bool res = mc.cutMovie(m_movieSelectionHandler); @@ -882,12 +882,12 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) { if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_TRUNCATE, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo) == CMsgBox::mbrYes) { - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_TRUNCATING); - hintBox->paint(); + CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_TRUNCATING); + hintBox.paint(); CMovieCut mc; bool res = mc.truncateMovie(m_movieSelectionHandler); - hintBox->hide(); - delete hintBox; + hintBox.hide(); + g_RCInput->clearRCMsg(); if (!res) ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_TRUNCATE_FAILED, CMsgBox::mbrCancel, CMsgBox::mbCancel, NEUTRINO_ICON_ERROR); @@ -1014,7 +1014,7 @@ int CMovieBrowser::exec(const char* path) snprintf(buf, sizeof(buf), format, m_movieSelectionHandler->file.Name.c_str()); CHintBox hintBox(LOCALE_MOVIEBROWSER_YT_CACHE, buf); hintBox.paint(); - sleep(1); + sleep(1); //??? hintBox.hide(); } } @@ -2408,8 +2408,8 @@ bool CMovieBrowser::onDeleteFile(MI_MOVIE_INFO *movieinfo, bool skipAsk) std::string msg = formatDeleteMsg(movieinfo, msgFont, msgBoxWidth); if ((skipAsk || !movieinfo->delAsk) || (ShowMsg(LOCALE_FILEBROWSER_DELETE, msg, CMsgBox::mbrYes, CMsgBox::mbYes|CMsgBox::mbNo, NULL, msgBoxWidth)==CMsgBox::mbrYes)) { - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_MOVIEBROWSER_DELETE_INFO)); - hintBox->paint(); + CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_MOVIEBROWSER_DELETE_INFO)); + hintBox.paint(); delFile(movieinfo->file); std::string cover_file = getScreenshotName(movieinfo->file.Name, S_ISDIR(movieinfo->file.Mode)); @@ -2420,7 +2420,7 @@ bool CMovieBrowser::onDeleteFile(MI_MOVIE_INFO *movieinfo, bool skipAsk) if (m_movieInfo.convertTs2XmlName(file_xml.Name)) unlink(file_xml.Name.c_str()); - delete hintBox; + hintBox.hide(); g_RCInput->clearRCMsg(); TRACE("List size: %d\n", (int)m_vMovieInfo.size()); @@ -3923,7 +3923,7 @@ int CYTCacheSelectorTarget::exec(CMenuTarget* /*parent*/, const std::string & ac snprintf(buf, sizeof(buf), format, movieBrowser->yt_failed[selected - movieBrowser->yt_failed_offset].file.Name.c_str()); CHintBox hintBox(LOCALE_MOVIEBROWSER_YT_CACHE, buf); hintBox.paint(); - sleep(1); + sleep(1); //??? hintBox.hide(); } } else From 8bbe88693f15cf50f74cd7019cfd6982dfe7b4e6 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 20 Nov 2016 22:53:21 +0100 Subject: [PATCH 125/171] COPKGManager: simplify hintbox calls Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/318c64708dc7d445ac54d88f86ebd847ab27edf3 Author: Thilo Graf Date: 2016-11-20 (Sun, 20 Nov 2016) --- src/gui/opkg_manager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index b3df893e8..7c38b5f99 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -491,10 +491,10 @@ bool COPKGManager::checkUpdates(const std::string & package_name, bool show_prog int COPKGManager::doUpdate() { - CHintBox *hb = new CHintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_OPKG_UPDATE_CHECK); - hb->paint(); + CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_OPKG_UPDATE_CHECK); + hintBox.paint(); int r = execCmd(pkg_types[OM_UPDATE], CShellWindow::QUIET); - delete hb; + hintBox.hide(); if (r) { string msg = string(g_Locale->getText(LOCALE_OPKG_FAILURE_UPDATE)); msg += '\n' + tmp_str; From b159cccae6a2c3f69fa25deeb245ad9389dc75e8 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 20 Nov 2016 22:53:53 +0100 Subject: [PATCH 126/171] showFastscanDiseqcSetup: simplify hintbox calls Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/627098d937fd0b398e96d4b591a34530d84f5ec1 Author: Thilo Graf Date: 2016-11-20 (Sun, 20 Nov 2016) --- src/gui/scan_setup.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index a4aa2599b..17017c48f 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -1488,11 +1488,11 @@ void CScanSetup::addScanMenuFastScan(CMenuWidget *fast_ScanMenu) int CScanSetup::showFastscanDiseqcSetup() { - CHintBox * hintbox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SATSETUP_FASTSCAN_AUTO_DISEQC_WAIT)); - hintbox->paint(); + CHintBox hintbox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SATSETUP_FASTSCAN_AUTO_DISEQC_WAIT)); + hintbox.paint(); CServiceScan::getInstance()->TestDiseqcConfig(scansettings.fast_op); - delete hintbox; + hintbox.hide(); CMenuWidget * sat_setup = new CMenuWidget(LOCALE_SATSETUP_DISEQC_INPUT, NEUTRINO_ICON_SETTINGS, width); sat_setup->addIntroItems(); From deb6aec16af6944cd5c0df6ed0fc1f44ffb79dda Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 20 Nov 2016 22:54:51 +0100 Subject: [PATCH 127/171] cTmdb: simplyfy hintbox calls Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/43383329a736d17ed10aa95ea4d0ec4a62af899b Author: Thilo Graf Date: 2016-11-20 (Sun, 20 Nov 2016) --- src/gui/tmdb.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/gui/tmdb.cpp b/src/gui/tmdb.cpp index 0b8556440..e4e65b70a 100644 --- a/src/gui/tmdb.cpp +++ b/src/gui/tmdb.cpp @@ -63,18 +63,15 @@ cTmdb::cTmdb(std::string epgtitle) key = g_settings.tmdb_api_key; #endif - CHintBox* box = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_TMDB_READ_DATA)); - box->paint(); + CHintBox hintbox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_TMDB_READ_DATA)); + hintbox.paint(); std::string lang = Lang2ISO639_1(g_settings.language); GetMovieDetails(lang); if ((minfo.result < 1 || minfo.overview.empty()) && lang != "en") GetMovieDetails("en"); - if (box != NULL) { - box->hide(); - delete box; - } + hintbox.hide(); } cTmdb::~cTmdb() From 4b15828631b73beec823c8f911b984d026137768 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 20 Nov 2016 22:56:33 +0100 Subject: [PATCH 128/171] CUpnpBrowserGui: simplify hintbox calls Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c47d26637b4d93a72c42152980a46306c87fa9cc Author: Thilo Graf Date: 2016-11-20 (Sun, 20 Nov 2016) --- src/gui/upnpbrowser.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 3d80069a1..59221c059 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -245,19 +245,19 @@ bool CUpnpBrowserGui::discoverDevices() if (!m_devices.empty()) return true; - CHintBox *scanBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_UPNPBROWSER_SCANNING)); // UTF-8 - scanBox->paint(); + CHintBox hintbox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_UPNPBROWSER_SCANNING)); // UTF-8 + hintbox.paint(); try { m_devices = m_socket->Discover("urn:schemas-upnp-org:service:ContentDirectory:1"); } catch (std::runtime_error error) { - delete scanBox; + hintbox.hide(); DisplayErrorMessage(error.what()); return false; } - delete scanBox; + hintbox.hide(); if (m_devices.empty()) { DisplayInfoMessage(g_Locale->getText(LOCALE_UPNPBROWSER_NOSERVERS)); From 02ae0963671ad4cc4f7d61111f6c3a734d5959c7 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 20 Nov 2016 22:58:30 +0100 Subject: [PATCH 129/171] CNeutrinoApp: simplify and fix hintbox calls Some hints were not closed after delete. Explicit hide()is required. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5db26ef6646af8f56d04bab1b5c62564e4ae0ddf Author: Thilo Graf Date: 2016-11-20 (Sun, 20 Nov 2016) --- src/neutrino.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index d83f98a0b..c6bc48e70 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2233,6 +2233,7 @@ TIMER_STOP("################################## after all ####################### //flash.enableNotify(false); flash.exec(NULL, "inet"); } + hintBox->hide(); delete hintBox; } RealRun(); @@ -4025,8 +4026,8 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) returnval = menu_return::RETURN_EXIT_ALL; } else if(actionKey=="savesettings") { - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_MAINSETTINGS_SAVESETTINGSNOW_HINT)); // UTF-8 - hintBox->paint(); + CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_MAINSETTINGS_SAVESETTINGSNOW_HINT)); // UTF-8 + hintBox.paint(); saveSetup(NEUTRINO_SETTINGS_FILE); @@ -4038,20 +4039,18 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) //g_Sectionsd->setEventsAreOldInMinutes((unsigned short) (g_settings.epg_old_hours*60)); //g_Sectionsd->setHoursToCache((unsigned short) (g_settings.epg_cache_days*24)); - hintBox->hide(); - delete hintBox; + hintBox.hide(); } else if(actionKey=="recording") { setupRecordingDevice(); } else if(actionKey=="reloadplugins") { - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SERVICEMENU_GETPLUGINS_HINT)); - hintBox->paint(); + CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SERVICEMENU_GETPLUGINS_HINT)); + hintBox.paint(); g_PluginList->loadPlugins(); - hintBox->hide(); - delete hintBox; + hintBox.hide(); } else if(actionKey=="nkplayback" || actionKey=="ytplayback" || actionKey=="tsmoviebrowser" || actionKey=="fileplayback") { frameBuffer->Clear(); @@ -4702,7 +4701,9 @@ void CNeutrinoApp::CheckFastScan(bool standby, bool reload) scanSettings.fst_version = CServiceScan::getInstance()->GetFstVersion(); scanSettings.saveSettings(NEUTRINO_SCAN_SETTINGS_FILE); } - delete fhintbox; + if (fhintbox){ + fhintbox->hide(); delete fhintbox; + } if (standby) CVFD::getInstance()->setMode(CVFD::MODE_STANDBY); } From 2e13b9647e066d6d74707c2a89ae70f4dbbcd57b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 20 Nov 2016 23:14:59 +0100 Subject: [PATCH 130/171] CTestMenu: add form sample Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d6c5bc2d28f047a370fe8dac349ba2ba58cf331b Author: Thilo Graf Date: 2016-11-20 (Sun, 20 Nov 2016) --- src/gui/test_menu.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 64035b72c..c461a9afe 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -494,6 +494,39 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) form->paint(); return res; } + else if (actionKey == "form_blink_item"){ + if (form == NULL){ + form = new CComponentsForm(); + form->setColorBody(COL_DARK_GRAY); + form->setDimensionsAll(100, 100, 250, 100); + form->setFrameThickness(2); + form->setColorFrame(COL_WHITE); + //form->doPaintBg(false); + + CComponentsPicture *ptmp = new CComponentsPicture(10, 10, NEUTRINO_ICON_HINT_INFO); + ptmp->doPaintBg(false); + ptmp->SetTransparent(CFrameBuffer::TM_BLACK); + form->addCCItem(ptmp); + + CComponentsText *text = new CComponentsText(80, 30, 100, 50, "Info"); + text->doPaintBg(false); + form->addCCItem(text); + + form->paint0(); + ptmp->kill(); + } + + if (static_cast(form->getCCItem(0))-> paintBlink(500000, true)){ + ShowHint("Testmenu: Blink","Testmenu: Blinking embedded image ...", 700, 10); + } + if (form->getCCItem(0)->cancelBlink()){ + ShowHint("Testmenu: Blink","Testmenu: Blinking embedded image stopped ...", 700, 2); + } + + form->kill(); + delete form; form = NULL; + return res; + } else if (actionKey == "text"){ if (txt == NULL) txt = new CComponentsText(); @@ -968,6 +1001,7 @@ void CTestMenu::showCCTests(CMenuWidget *widget) widget->addItem(new CMenuForwarder("Picture", true, NULL, this, "picture")); widget->addItem(new CMenuForwarder("Channel-Logo", true, NULL, this, "channellogo")); widget->addItem(new CMenuForwarder("Form", true, NULL, this, "form")); + widget->addItem(new CMenuForwarder("Form with blinking item", true, NULL, this, "form_blink_item")); widget->addItem(new CMenuForwarder("Text", true, NULL, this, "text")); widget->addItem(new CMenuForwarder("Blinking Text", true, NULL, this, "blinking_text")); widget->addItem(new CMenuForwarder("Header", true, NULL, this, "header")); From fb45e1d98ccf9c0cd761dc5ed53aa790f89f4871 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 21 Nov 2016 01:04:22 +0100 Subject: [PATCH 131/171] update: fix evaluation of int newfound Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/88ebe68b39e6448bb12f199f03c0b28a011f146d Author: vanhofen Date: 2016-11-21 (Mon, 21 Nov 2016) Origin message was: ------------------ - update: fix evaluation of int newfound --- src/gui/update.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/update.cpp b/src/gui/update.cpp index 503b6be55..3bb5e4894 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -304,7 +304,7 @@ bool CFlashUpdate::selectHttpImage(void) return false; } if (notify) { - if(!newfound) + if(newfound) ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_NEW_FOUND, CMsgBox::mbrOk, CMsgBox::mbOk, NEUTRINO_ICON_INFO, MSGBOX_MIN_WIDTH, 6 ); #if 0 else From fbec081c11ba126caa7142f0cb4bd36e0da03280 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 21 Nov 2016 07:59:22 +0100 Subject: [PATCH 132/171] locale: fix usage of ellipses Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e836943a4a801fb238d0a256c7763b5869c7fd1f Author: vanhofen Date: 2016-11-21 (Mon, 21 Nov 2016) Origin message was: ------------------ - locale: fix usage of ellipses --- data/locale/deutsch.locale | 66 +++++++++++++++++++------------------- data/locale/english.locale | 56 ++++++++++++++++---------------- 2 files changed, 61 insertions(+), 61 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 71f8d8023..f93224d88 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -189,7 +189,7 @@ audioplayer.playlist_name Dateiname der Playlist audioplayer.playlist_name_hint1 Geben Sie den Dateinamen der Playlist ein audioplayer.playlist_name_hint2 Die Erweiterung .m3u wird automatisch angehängt audioplayer.reading_files Lese die Dateien ein -audioplayer.receiving_list Liste wird empfangen, bitte warten... +audioplayer.receiving_list Liste wird empfangen, bitte warten ... audioplayer.repeat_on Repeatmodus aktivieren audioplayer.rewind schneller Rückl. audioplayer.save_playlist Playlist speichern @@ -400,7 +400,7 @@ eventfinder.search Suche eventfinder.search_all_epg Ganze eventfinder.search_within_epg Suche innerhalb EPG-Daten eventfinder.search_within_list Suche innerhalb Text -eventfinder.searching Suche... +eventfinder.searching Suche ... eventfinder.start_search Suche starten eventlist.additional Zusatzinformationen eventlist.epgplus EPG Plus anzeigen @@ -413,8 +413,8 @@ extra.audio_run_player Audiotaste startet Player extra.auto_delete Automatisch löschen extra.auto_timeshift Autom. Aufnahme, Sek. (0 = deakt.) extra.cache_txt Teletext zwischenspeichern -extra.chadded Der aktuelle Kanal wird dem selektierten Bouquet hinzugefügt...\n -extra.chalreadyinbq Der aktuelle Kanal ist bereits im selektierten Bouquet...\n +extra.chadded Der aktuelle Kanal wird dem selektierten Bouquet hinzugefügt ...\n +extra.chalreadyinbq Der aktuelle Kanal ist bereits im selektierten Bouquet.\n extra.dboxinfo Box-Info extra.dboxinfo_available Frei extra.dboxinfo_boottime Boot @@ -570,14 +570,14 @@ extra.zapit_motor_speed Rotor Drehzeit extra.zapit_scanpids PIDs scannen/nutzen extra.zapit_sdt_changed Kanalliste wird neu geladen. fan_speed CPU-Lüftergeschwindigkeit -favorites.addchannel Der aktuelle Kanal wird dem Bouquet \n"Meine Favoriten" hinzugefügt. \nDie Speicherung benötigt einen Moment... +favorites.addchannel Der aktuelle Kanal wird dem Bouquet \n"Meine Favoriten" hinzugefügt. \nDie Speicherung benötigt einen Moment ... favorites.bouquetname Meine Favoriten -favorites.bqcreated Bouquet "Meine Favoriten" wurde angelegt...\n -favorites.chadded Der aktuelle Kanal wurde Ihren Favoriten hinzugefügt...\n -favorites.chalreadyinbq Der aktuelle Kanal ist bereits in Ihren Favoriten...\n +favorites.bqcreated Bouquet "Meine Favoriten" wurde angelegt.\n +favorites.chadded Der aktuelle Kanal wurde Ihren Favoriten hinzugefügt.\n +favorites.chalreadyinbq Der aktuelle Kanal ist bereits in Ihren Favoriten.\n favorites.copy Kopiere Bouquet zu Favoriten favorites.finalhint \nVersehentlich hinzugefügte Kanäle können mit\nder Bouquetverwaltung korrigiert werden.\n -favorites.menueadd Kanal Favoriten hinzufügen +favorites.menueadd Kanal zu Favoriten hinzufügen favorites.nobouquets Favoriten sind nur mit aktivierten Bouquets möglich. filebrowser.add Hinzufügen filebrowser.delete Löschen @@ -685,7 +685,7 @@ flashupdate.titlereadflash Flash auslesen flashupdate.titlewriteflash Flash schreiben flashupdate.update_with_settings_del_skipped Ordner [%s] kann nicht gelöscht werden. Eintrag wird übersprungen. flashupdate.update_with_settings_error Error Flashspeicher!\n \nIm neuen Image sind nur noch %ld KB (von %ld KB) frei,\ndas ist zu wenig, um einen sicheren Betrieb zu gewährleisten.\n \nDer Vorgang wird abgebrochen! -flashupdate.update_with_settings_processed Image wird bearbeitet... +flashupdate.update_with_settings_processed Image wird bearbeitet ... flashupdate.update_with_settings_skipped Ordner [%s] kann nicht gesichert werden. Eintrag wird übersprungen. flashupdate.update_with_settings_successfully Settingsübernahme erfolgreich.\nDas Image kann jetzt geflasht werden. flashupdate.update_with_settings_warning Warnung Flashspeicher!\n \nIm neuen Image sind nur noch %ld KB (von %ld KB) frei,\ndas ist möglicherweise zu wenig, um einen sicheren Betrieb zu gewährleisten.\n \nSoll der Vorgang trotzdem fortgesetzt werden? @@ -727,7 +727,7 @@ fontsize.eventlist_itemlarge Groß fontsize.eventlist_itemsmall Klein fontsize.eventlist_title Titel fontsize.filebrowser_item Dateibrowsereinträge -fontsize.hint Schriftart wird initialisiert,\nbitte warten... +fontsize.hint Schriftart wird initialisiert,\nbitte warten ... fontsize.infobar_channame Kanalname fontsize.infobar_info Info fontsize.infobar_number Nummer @@ -778,7 +778,7 @@ hdd_not_found Kein Datenträger hdd_removable_device Wechseldatenträger hdd_set_recdir Diesen Datenträger für die Aufnahme nutzen? hdd_settings Laufwerke -hdd_sleep Ausschalten nach... +hdd_sleep Ausschalten nach hdd_slow Langsam hdd_statfs Füllstandsabfrage hdd_statfs_always immer @@ -800,8 +800,8 @@ imageinfo.license Lizenz imageinfo.vcs Git: imageinfo.version Version: inetradio.name Internetradio -infoviewer.epgnotload Informationen noch nicht geladen... -infoviewer.epgwait Warte auf EPG-Informationen... +infoviewer.epgnotload Informationen noch nicht geladen ... +infoviewer.epgwait Warte auf EPG-Informationen ... infoviewer.motor_moving Antennenpositionierung infoviewer.next Später infoviewer.nocurrent Keine Info zu laufendem Programm @@ -811,7 +811,7 @@ infoviewer.now Jetzt infoviewer.selecttime Startzeiten infoviewer.subchan_disp_pos Unterkanalanzeige infoviewer.subchan_infobar Infobar -infoviewer.waittime Warte auf Uhrzeit... +infoviewer.waittime Warte auf Uhrzeit ... ipsetup.hint_1 Benutzen Sie 0..9 oder hoch/runter ipsetup.hint_2 OK speichert, EXIT bricht ab keybindingmenu.RC Fernbedienung abstimmen @@ -865,7 +865,7 @@ keybindingmenu.volumeup Lauter keybindingmenu.zaphistory Zapping-History Bouquet keychooser.head Neue Taste einstellen keychooser.text1 Bitte Taste drücken -keychooser.text2 Zum Abbrechen warten... +keychooser.text2 Zum Abbrechen warten ... keychoosermenu.currentkey Derzeitige Taste keychoosermenu.setnew Neue Taste einstellen keychoosermenu.setnone Keine Taste @@ -901,7 +901,7 @@ ledcontroler.on.all LED1 & LED2 an ledcontroler.on.led1 LED1 an ledcontroler.on.led2 LED2 an livestream.head Livestreams -livestream.read_data Lese Daten... +livestream.read_data Lese Daten ... livestream.resolution Auflösung livestream.scriptpath Script Verzeichnis lua.boolparam_deprecated1 Achtung! @@ -950,7 +950,7 @@ mainsettings.network Netzwerk mainsettings.osd OSD mainsettings.recording Aufnahme mainsettings.savesettingsnow Einstellungen jetzt speichern -mainsettings.savesettingsnow_hint Einstellungen werden jetzt gespeichert,\nbitte warten... +mainsettings.savesettingsnow_hint Einstellungen werden jetzt gespeichert,\nbitte warten ... mainsettings.timezone Zeitzone mainsettings.video Video mbkey.copy_onefile Film kopieren @@ -1655,7 +1655,7 @@ moviebrowser.cut Schneide Sprungmarken aus dem Film? moviebrowser.cut_failed Fehler beim Schneiden. Sind Sprungmarken und genug freier Speicher vorhanden? moviebrowser.cutting Schneide Film, bitte warten ... moviebrowser.delete_all Alle markierten Filme ohne weitere Nachfrage löschen? -moviebrowser.delete_info Lösche Dateien, bitte warten... +moviebrowser.delete_info Lösche Dateien, bitte warten ... moviebrowser.delete_screenshot Lösche Screenshot? moviebrowser.dir Pfad moviebrowser.directories Verzeichnisse @@ -1827,7 +1827,7 @@ movieplayer.chapters Kapitel movieplayer.fileplayback Abspielen (Multiformat) movieplayer.head Movieplayer movieplayer.plugin Movieplayer-Plugin -movieplayer.starting Wiedergabe starten... +movieplayer.starting Wiedergabe starten ... movieplayer.titles Titel movieplayer.toomanybookmarks Sie haben bereits zu viele Lesezeichen angelegt.\nEs muß erst ein anderes gelöscht werden. movieplayer.tshelp1 Stopp @@ -1856,7 +1856,7 @@ mpkey.rewind Rücklauf mpkey.stop Stopp mpkey.subtitle Untertitel mpkey.time Zeitanzeige -networkmenu.apply_settings Änderungen werden übernommen... +networkmenu.apply_settings Änderungen werden übernommen ... networkmenu.apply_settings_now Änderungen jetzt zuweisen? networkmenu.broadcast Broadcast networkmenu.dhcp DHCP @@ -1888,9 +1888,9 @@ networkmenu.show Aktive Einstellungen zeigen networkmenu.ssid Netzwerkname (SSID) networkmenu.ssid_scan WLAN-Netzwerke suchen networkmenu.ssid_scan_error Keine WLAN-Netzwerke gefunden. -networkmenu.ssid_scan_wait WLAN-Netzwerke werden gesucht... +networkmenu.ssid_scan_wait WLAN-Netzwerke werden gesucht ... networkmenu.test Netzwerk testen -neutrino_starting %s %s wird gestartet... +neutrino_starting %s %s wird gestartet ... nfs.alreadymounted Verzeichnis bereits gemountet. nfs.automount Beim Start mounten nfs.dir Verzeichnis/Freigabe @@ -1938,8 +1938,8 @@ opkg.messagebox.size.error Nicht genügend freier Speicher für Paketinstallatio opkg.messagebox.updates.available Aktualisierungen verfügbar! opkg.success.install Installation erfolgreich!\nNeustart von Neutrino kann erforderlich sein. Jetzt neu starten? opkg.title Paketverwaltung -opkg.update.check Prüfe auf Updates... -opkg.update.reading_lists Paketlisten werden eingelesen... +opkg.update.check Prüfe auf Updates ... +opkg.update.reading_lists Paketlisten werden eingelesen ... opkg.upgrade Installierte Pakete aktualisieren opkg.warning_3rdparty_packages Drittanbieter-Pakete könnten Ihr System beschädigen! Sind Sie sicher, dieses Paket zu installieren? options.default Voreinstellungen benutzen @@ -1963,7 +1963,7 @@ parentallock.lockage Sendungen parentallock.lockage12 ab 12 Jahren sperren parentallock.lockage16 ab 16 Jahren sperren parentallock.lockage18 ab 18 Jahren sperren -parentallock.lockedchannel Vorgesperrter Sender... +parentallock.lockedchannel Vorgesperrter Sender parentallock.lockedprogram Gesperrtes Programm (FSK ab %d) parentallock.menu Sicherheits Menü parentallock.never Nie @@ -2062,9 +2062,9 @@ rclock.unlockmsg Fernbedienung reaktiviert recording.already_found %s\nwurde bereits gefunden. Trotzdem aufnehmen? recording.already_found_check Prüfe Aufnahmen recording.is_running Folgende Aufnahme läuft bereits! Neue Aufnahme starten? -recording.start Starte Aufnahme, bitte warten...! +recording.start Starte Aufnahme, bitte warten ... recording.startstop_msg Meldung bei Aufnahme Start/Ende -recording.stop Beende Aufnahme, bitte warten...! +recording.stop Beende Aufnahme, bitte warten ... recording.time_hour Stunde recording.time_hours Stunden recording.time_min Min @@ -2198,7 +2198,7 @@ sc.reset Kartenreset sc.timeout Kartenmenü Timeout sc.waiting Warte auf Antwort scants.abort_body Scanvorgang wirklich abbrechen? -scants.abort_header breche Scan ab... +scants.abort_header Breche Scan ab ... scants.actcable Kabelnetz: scants.acthybrid Hybrid: scants.actsatellite Satellit: @@ -2255,13 +2255,13 @@ screenshot.scale Skalierung screenshot.tv TV-Auflösung screenshot.video Video im Hintergrund servicemenu.getplugins Plugins neu laden -servicemenu.getplugins_hint Plugins werden neu geladen,\nbitte warten... +servicemenu.getplugins_hint Plugins werden neu geladen,\nbitte warten ... servicemenu.head Service servicemenu.imageinfo Imageinfo servicemenu.reload Kanallisten neu laden -servicemenu.reload_hint Kanallisten werden neu geladen,\nbitte warten... +servicemenu.reload_hint Kanallisten werden neu geladen,\nbitte warten ... servicemenu.restart GUI neu starten -servicemenu.restart_hint GUI wird neu gestartet... +servicemenu.restart_hint GUI wird neu gestartet ... servicemenu.restart_refused_recording Aufnahme läuft. Neustart nicht möglich. servicemenu.scants Kanalsuche servicemenu.update Software-Aktualisierung @@ -2408,7 +2408,7 @@ timing.numericzap Umschalten mit Zifferntasten timing.volumebar Lautstärkeanzeige tmdb.api_key TMDb API Schlüssel tmdb.enabled TMDb-Unterstützung -tmdb.read_data Suche TMDB Daten... +tmdb.read_data Suche TMDb-Daten ... unicable.lnb Unicable Eingang unicable.qrg Unicable Frequenz unicable.scr Unicable SCR diff --git a/data/locale/english.locale b/data/locale/english.locale index 4b1e7e87b..042b3988b 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -380,7 +380,7 @@ epgextended.guests Guests epgextended.original_title Original Title epgextended.presenter Presenter epgextended.year_of_production Year of Production -epglist.noevents EPG is not available... +epglist.noevents EPG is not available ... epgviewer.More_Screenings More Screenings on this Channel epgviewer.More_Screenings_short More Screenings epgviewer.age_rating Age rating @@ -400,7 +400,7 @@ eventfinder.search Search eventfinder.search_all_epg whole eventfinder.search_within_epg Search within eventfinder.search_within_list Search within -eventfinder.searching Search for keyword in EPG... +eventfinder.searching Search for keyword in EPG eventfinder.start_search Start Search eventlist.additional Additional informations eventlist.epgplus Show EPG Plus @@ -413,8 +413,8 @@ extra.audio_run_player Audio key start player extra.auto_delete Auto-delete extra.auto_timeshift Auto-record, sec (0 = disable) extra.cache_txt Cache teletext -extra.chadded The current channel has been added to selected bouquet....\n -extra.chalreadyinbq The current channel is already in selected bouquet....\n +extra.chadded The current channel has been added to selected bouquet.\n +extra.chalreadyinbq The current channel is already in selected bouquet.\n extra.dboxinfo Box Info extra.dboxinfo_available Free extra.dboxinfo_boottime Boot @@ -570,11 +570,11 @@ extra.zapit_motor_speed Motor moving speed extra.zapit_scanpids Scan/Use pids extra.zapit_sdt_changed Channels changed, reload settings. fan_speed CPU Fan speed -favorites.addchannel The current channel will be added \nto the bouquet "My Favorites". \n This will take a few seconds... +favorites.addchannel The current channel will be added \nto the bouquet "My Favorites". \n This will take a few seconds ... favorites.bouquetname My Favorites -favorites.bqcreated Bouquet "My Favorites" has been created...\n -favorites.chadded The current channel has been added to your favorites...\n -favorites.chalreadyinbq The current channel is already in your favorites...\n +favorites.bqcreated Bouquet "My Favorites" has been created.\n +favorites.chadded The current channel has been added to your favorites.\n +favorites.chalreadyinbq The current channel is already in your favorites.\n favorites.copy Copy bouquet to Favorites favorites.finalhint \nUse the bouqueteditor to modify your favorites.\n favorites.menueadd add channel to favorites @@ -685,10 +685,10 @@ flashupdate.titlereadflash Reading Flash flashupdate.titlewriteflash Writing Flash flashupdate.update_with_settings_del_skipped Folder [%s] can not be deleted. Entry is skipped. flashupdate.update_with_settings_error Flash Error!\n \nNew Image only has %ld KB (out of %ld KB) left. Not\nenough space to complete this operation.\n \nCanceling operation! -flashupdate.update_with_settings_processed Image is being processed... +flashupdate.update_with_settings_processed Image is being processed ... flashupdate.update_with_settings_skipped Folder [%s] can not be saved. Entry is skipped. flashupdate.update_with_settings_successfully Setting takeover successfully.\nThe image can now be flashed. -flashupdate.update_with_settings_warning Flash Warning!\n \nNew Image only has %ld KB (out of %ld KB) left. Probably not\nenough space to complete this operation...\n \nDo you really want to proceed? +flashupdate.update_with_settings_warning Flash Warning!\n \nNew Image only has %ld KB (out of %ld KB) left. Probably not\nenough space to complete this operation ...\n \nDo you really want to proceed? flashupdate.updatemode Updatemode flashupdate.updatemode_internet internet flashupdate.updatemode_manual from local update directory @@ -727,7 +727,7 @@ fontsize.eventlist_itemlarge Large fontsize.eventlist_itemsmall Small fontsize.eventlist_title Title fontsize.filebrowser_item Filebrowser items -fontsize.hint Initialising font,\nplease wait... +fontsize.hint Initialising font,\nplease wait ... fontsize.infobar_channame Channel name fontsize.infobar_info info fontsize.infobar_number Number @@ -778,7 +778,7 @@ hdd_not_found No HDD found hdd_removable_device Removable device hdd_set_recdir Use device for recording ? hdd_settings Data Storage -hdd_sleep Switch off after... +hdd_sleep Switch off after hdd_slow Slow hdd_statfs Fill level query hdd_statfs_always always @@ -800,8 +800,8 @@ imageinfo.license License imageinfo.vcs Git: imageinfo.version Version: inetradio.name Internetradio -infoviewer.epgnotload EPG not loaded.... -infoviewer.epgwait waiting for EPG... +infoviewer.epgnotload EPG not loaded ... +infoviewer.epgwait waiting for EPG ... infoviewer.motor_moving Antenna positioning infoviewer.next next infoviewer.nocurrent No info for current program available @@ -811,7 +811,7 @@ infoviewer.now now infoviewer.selecttime Timeselection infoviewer.subchan_disp_pos Subchannel display infoviewer.subchan_infobar Full infobar -infoviewer.waittime Waiting for time... +infoviewer.waittime Waiting for time ... ipsetup.hint_1 Use 0..9, or use Up/Down, ipsetup.hint_2 OK saves, Exit aborts keybindingmenu.RC Tune Remote-Control @@ -901,7 +901,7 @@ ledcontroler.on.all Led1 & Led2 on ledcontroler.on.led1 Led1 on ledcontroler.on.led2 Led2 on livestream.head Live streams -livestream.read_data Read data... +livestream.read_data Read data ... livestream.resolution Resolution livestream.scriptpath Script path lua.boolparam_deprecated1 Caution! @@ -950,7 +950,7 @@ mainsettings.network Network mainsettings.osd OSD mainsettings.recording Recording mainsettings.savesettingsnow Save settings now -mainsettings.savesettingsnow_hint Saving settings,\nplease wait... +mainsettings.savesettingsnow_hint Saving settings,\nplease wait ... mainsettings.timezone Timezone mainsettings.video Video mbkey.copy_onefile Copy movie @@ -1655,7 +1655,7 @@ moviebrowser.cut Cut jumps from movie? moviebrowser.cut_failed Cut failed, are there jump bookmarks and enough free space? moviebrowser.cutting Cutting movie, please wait ... moviebrowser.delete_all Delete all selected movies without any questions? -moviebrowser.delete_info Delete files, please wait... +moviebrowser.delete_info Delete files, please wait ... moviebrowser.delete_screenshot Delete screenshot? moviebrowser.dir Path moviebrowser.directories Directories @@ -1827,7 +1827,7 @@ movieplayer.chapters Chapters movieplayer.fileplayback File play movieplayer.head Movieplayer movieplayer.plugin Movieplayer plugin -movieplayer.starting Starting playback... +movieplayer.starting Starting playback ... movieplayer.titles Titles movieplayer.toomanybookmarks There are too many bookmarks.\nYou need to delete one of them first. movieplayer.tshelp1 Stop @@ -1856,7 +1856,7 @@ mpkey.rewind Rewind mpkey.stop Stop mpkey.subtitle Subtitles mpkey.time Show time -networkmenu.apply_settings Changes are applied... +networkmenu.apply_settings Changes are applied networkmenu.apply_settings_now Do you want to apply settings now? networkmenu.broadcast Broadcast networkmenu.dhcp DHCP @@ -1888,9 +1888,9 @@ networkmenu.show Show active Network settings networkmenu.ssid Network name (SSID) networkmenu.ssid_scan WLAN network scan networkmenu.ssid_scan_error No WLAN networks are found. -networkmenu.ssid_scan_wait WLAN network scan in progress... +networkmenu.ssid_scan_wait WLAN network scan in progress ... networkmenu.test Test network now -neutrino_starting %s %s starting... +neutrino_starting %s %s starting ... nfs.alreadymounted directory already mounted nfs.automount Mount on startup nfs.dir directory/share @@ -1938,8 +1938,8 @@ opkg.messagebox.size.error Not enough free memory available for this package! opkg.messagebox.updates.available Updates available! opkg.success.install Install successful!\n restart of Neutrino might be required. Restart now? opkg.title Package Management -opkg.update.check Checking for updates... -opkg.update.reading_lists Reading package lists... +opkg.update.check Checking for updates ... +opkg.update.reading_lists Reading package lists ... opkg.upgrade Upgrade installed packages opkg.warning_3rdparty_packages 3rd party packages could damage your system! Are you sure install this package? options.default Reset to defaults @@ -1963,7 +1963,7 @@ parentallock.lockage lock program parentallock.lockage12 from 12 years up parentallock.lockage16 from 16 years up parentallock.lockage18 from 18 years up -parentallock.lockedchannel Locked sender... +parentallock.lockedchannel Locked sender parentallock.lockedprogram Locked program (from %d years up) parentallock.menu Menu Security parentallock.never never @@ -2062,9 +2062,9 @@ rclock.unlockmsg Remote control unlocked recording.already_found %s\nwas already found. Nevertheless start record? recording.already_found_check Check recordings recording.is_running This channel already recording. Start new record? -recording.start Start recording, please wait...! +recording.start Start recording, please wait ... recording.startstop_msg Message when recording is start/stop -recording.stop Stop recording, please wait...! +recording.stop Stop recording, please wait ... recording.time_hour hour recording.time_hours hours recording.time_min min @@ -2408,7 +2408,7 @@ timing.numericzap Numeric Zap timing.volumebar Volume bar tmdb.api_key TMDb API key tmdb.enabled TMDb support -tmdb.read_data Search TMDB Data... +tmdb.read_data Search TMDb data ... unicable.lnb Unicable Input unicable.qrg Unicable Frequency unicable.scr Unicable SCR From 5b08c6350038f60b1fed8252a5d7d5ed9b39a01c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 21 Nov 2016 08:19:26 +0100 Subject: [PATCH 133/171] locale: fix usage of ampersand; it's not an "and"-replacement Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ed555117780ae0f552d454e300acffbf57a26432 Author: vanhofen Date: 2016-11-21 (Mon, 21 Nov 2016) Origin message was: ------------------ - locale: fix usage of ampersand; it's not an "and"-replacement --- data/locale/deutsch.locale | 12 ++++++------ data/locale/english.locale | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index f93224d88..24b6d67f9 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -80,7 +80,7 @@ GENRE.SHOW.1 Gameshow/Quiz GENRE.SHOW.2 Varietee GENRE.SHOW.3 Talkshow GENRE.SOCIAL_POLITICAL Sozial -GENRE.SOCIAL_POLITICAL.0 Sozial & Politikereignisse/Wirtschaft +GENRE.SOCIAL_POLITICAL.0 Sozial und Politikereignisse/Wirtschaft GENRE.SOCIAL_POLITICAL.1 Magazin/Report/Dokumentation GENRE.SOCIAL_POLITICAL.2 Wirtschaft und Soziales GENRE.SOCIAL_POLITICAL.3 Besondere Menschen @@ -98,7 +98,7 @@ GENRE.SPORTS.7 Motorsport GENRE.SPORTS.8 Wassersport GENRE.SPORTS.9 Wintersport GENRE.TRAVEL_HOBBIES Freizeit -GENRE.TRAVEL_HOBBIES.0 Reise & Freizeit +GENRE.TRAVEL_HOBBIES.0 Reise und Freizeit GENRE.TRAVEL_HOBBIES.1 Reisen und Tourismus GENRE.TRAVEL_HOBBIES.2 Handwerk GENRE.TRAVEL_HOBBIES.3 Motor @@ -896,8 +896,8 @@ ledcontroler.mode.deepstandby Deep-Standby ledcontroler.mode.record Blinke bei Aufnahme ledcontroler.mode.standby Standby ledcontroler.mode.tv TV Betrieb -ledcontroler.off LED1 & LED2 aus -ledcontroler.on.all LED1 & LED2 an +ledcontroler.off LED1 und LED2 aus +ledcontroler.on.all LED1 und LED2 an ledcontroler.on.led1 LED1 an ledcontroler.on.led2 LED2 an livestream.head Livestreams @@ -2466,7 +2466,7 @@ videomenu.brightness Helligkeit videomenu.cinch Cinch videomenu.contrast Kontrast videomenu.dbdr MPEG2 Filter -videomenu.dbdr_both deBlock & deRing +videomenu.dbdr_both deBlock und deRing videomenu.dbdr_deblock deBlock videomenu.dbdr_none aus videomenu.enabled_modes Videosysteme auf der VF-Taste @@ -2521,7 +2521,7 @@ zapit.scantype Service-Auswahl zapit.scantype.all Alle Services zapit.scantype.radio Nur Radio zapit.scantype.tv Nur TV -zapit.scantype.tvradio Nur TV & Radio +zapit.scantype.tvradio Nur TV und Radio zapitsetup.channelmode Start-Kanalliste für TV zapitsetup.channelmode_radio Start-Kanalliste für Radio zapitsetup.head Startkanal-Verwaltung diff --git a/data/locale/english.locale b/data/locale/english.locale index 042b3988b..203c62e5f 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -80,7 +80,7 @@ GENRE.SHOW.1 game show/quiz/contest GENRE.SHOW.2 variety show GENRE.SHOW.3 talk show GENRE.SOCIAL_POLITICAL social -GENRE.SOCIAL_POLITICAL.0 social & politic events / business +GENRE.SOCIAL_POLITICAL.0 social and politic events / business GENRE.SOCIAL_POLITICAL.1 magazines/reports/documentary GENRE.SOCIAL_POLITICAL.2 economics/social advisory GENRE.SOCIAL_POLITICAL.3 remarkable people @@ -98,11 +98,11 @@ GENRE.SPORTS.7 motor sports GENRE.SPORTS.8 water sports GENRE.SPORTS.9 winter sports GENRE.TRAVEL_HOBBIES Leisure -GENRE.TRAVEL_HOBBIES.0 travel & recreation +GENRE.TRAVEL_HOBBIES.0 travel and recreation GENRE.TRAVEL_HOBBIES.1 tourism/travel GENRE.TRAVEL_HOBBIES.2 handicraft GENRE.TRAVEL_HOBBIES.3 motoring -GENRE.TRAVEL_HOBBIES.4 fitness & health +GENRE.TRAVEL_HOBBIES.4 fitness and health GENRE.TRAVEL_HOBBIES.5 cooking GENRE.TRAVEL_HOBBIES.6 advertisement/shopping GENRE.TRAVEL_HOBBIES.7 gardening @@ -896,8 +896,8 @@ ledcontroler.mode.deepstandby Deep Standby ledcontroler.mode.record Blinke in Record ledcontroler.mode.standby Standby ledcontroler.mode.tv TV Mode -ledcontroler.off Led1 & Led2 off -ledcontroler.on.all Led1 & Led2 on +ledcontroler.off Led1 and Led2 off +ledcontroler.on.all Led1 and Led2 on ledcontroler.on.led1 Led1 on ledcontroler.on.led2 Led2 on livestream.head Live streams @@ -2481,8 +2481,8 @@ videomenu.hdmi_cec_standby Enable CEC standby videomenu.hdmi_cec_view_on Enable CEC View on videomenu.hue Hue videomenu.letterbox Letterbox -videomenu.panscan Pan&Scan -videomenu.panscan2 14:9 Pan&Scan +videomenu.panscan Pan & Scan +videomenu.panscan2 14:9 Pan & Scan videomenu.pip PiP setup videomenu.pip_error PiP start failed videomenu.saturation Saturation @@ -2521,7 +2521,7 @@ zapit.scantype scan for services zapit.scantype.all all services zapit.scantype.radio only radio zapit.scantype.tv only tv -zapit.scantype.tvradio tv & radio +zapit.scantype.tvradio tv and radio zapitsetup.channelmode Initial TV channel list zapitsetup.channelmode_radio Initial Radio channel list zapitsetup.head Start Channel Settings From 8f0fb90012bc6fdd12e9148d4de05fb4d37b9339 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 21 Nov 2016 08:36:17 +0100 Subject: [PATCH 134/171] locale: right case for LEDs Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5a39da118d5d535badf6ad5a0b5e2ceb215c2a5e Author: vanhofen Date: 2016-11-21 (Mon, 21 Nov 2016) Origin message was: ------------------ - locale: right case for LEDs --- data/locale/english.locale | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/data/locale/english.locale b/data/locale/english.locale index 203c62e5f..c93dac6f5 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -896,10 +896,10 @@ ledcontroler.mode.deepstandby Deep Standby ledcontroler.mode.record Blinke in Record ledcontroler.mode.standby Standby ledcontroler.mode.tv TV Mode -ledcontroler.off Led1 and Led2 off -ledcontroler.on.all Led1 and Led2 on -ledcontroler.on.led1 Led1 on -ledcontroler.on.led2 Led2 on +ledcontroler.off LED1 and LED2 off +ledcontroler.on.all LED1 and LED2 on +ledcontroler.on.led1 LED1 on +ledcontroler.on.led2 LED2 on livestream.head Live streams livestream.read_data Read data ... livestream.resolution Resolution @@ -1165,7 +1165,7 @@ menu.hint_language OSD language, timezone\nPreffered audio and subtitles languag menu.hint_last_radio Start box on selected channel\nif last mode is Radio menu.hint_last_tv Start box on selected channel\nif last mode is TV menu.hint_last_use Start box on last used channel -menu.hint_leds_blink Blink LEDS in deep-standby +menu.hint_leds_blink Blinking LEDs in deep-standby menu.hint_leds_deepstandby LEDs state in deeps-standby mode menu.hint_leds_record LEDs state when box recording menu.hint_leds_standby LEDs state in soft-standby mode From b2842b1d5c0cdb3fe6edc551a218194f8c0fa7b0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 21 Nov 2016 08:40:06 +0100 Subject: [PATCH 135/171] locale: remove "CST" strings Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d240c625f9936cab22f0ee857f96a892eeb56c99 Author: vanhofen Date: 2016-11-21 (Mon, 21 Nov 2016) Origin message was: ------------------ - locale: remove "CST" strings --- data/locale/deutsch.locale | 2 +- data/locale/english.locale | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 24b6d67f9..d1d52553b 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -2512,7 +2512,7 @@ wizard.setup_easy Einfach wizard.setup_type Installationstyp wizard.setup_type_hint Wählen Sie einfache Grundeinstellungen oder erweiterte Auswahlmöglichkeiten für die Installation wizard.welcome_head Willkommen zur Ersteinrichtung Ihres Receivers! -wizard.welcome_text Wir gratulieren Ihnen zum Kauf Ihrer CST. In den nun folgenden\nSchritten begleiten wir Sie durch die Erstinstallation des Gerätes.\nWir wünschen Ihnen viel Freude mit dem wohl einzigartigsten Receiver!\nBeachten Sie: Ihre CST Set-Top-Box lässt sich bequem per Webinterface\nsteuern, um zum Beispiel die Timer-Verwaltung zu nutzen oder Live-TV im Web-Browser zu schauen.\nAchten Sie darauf, dass Ihre Gerät nicht von aussen zugänglich ist,\nda sonst ein Zugriff über das Internet nicht ausgeschlossen werden kann!\nNächster Schritt? +wizard.welcome_text Wir gratulieren Ihnen zum Kauf Ihrer Set-Top-Box. In den nun folgenden\nSchritten begleiten wir Sie durch die Erstinstallation des Gerätes.\nWir wünschen Ihnen viel Freude mit dem wohl einzigartigsten Receiver!\nBeachten Sie: Ihre Set-Top-Box lässt sich bequem per Webinterface\nsteuern, um zum Beispiel die Timer-Verwaltung zu nutzen oder Live-TV im Web-Browser zu schauen.\nAchten Sie darauf, dass Ihre Gerät nicht von aussen zugänglich ist,\nda sonst ein Zugriff über das Internet nicht ausgeschlossen werden kann!\nNächster Schritt? word.from ab word.in in youtube.dev_id YouTube Dev ID diff --git a/data/locale/english.locale b/data/locale/english.locale index c93dac6f5..2ccad57d7 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2512,7 +2512,7 @@ wizard.setup_easy Easy wizard.setup_type Installation type wizard.setup_type_hint Easy to setup for CanalDigitaal/TéléSAT/TV Vlaanderen providers or simple cable scan wizard.welcome_head Welcome to the Setup Wizard -wizard.welcome_text Next steps will guide you through initial installation of the device.\nImportant: Your CST set-top box can be conveniently controlled\nwith the web interface for timer management or live TV on the Web browser.\nDo not make it accessible to untrusted networks!\nDo you want to continue? +wizard.welcome_text Next steps will guide you through initial installation of the device.\nImportant: Your set-top box can be conveniently controlled\nwith the web interface for timer management or live TV on the Web browser.\nDo not make it accessible to untrusted networks!\nDo you want to continue? word.from from word.in in youtube.dev_id YouTube Dev ID From 0119408b8128b8d56b01fc6fcd5266f43682e017 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 21 Nov 2016 08:53:26 +0100 Subject: [PATCH 136/171] locale: fix "/" usage Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/47a62dd71954a584480faad4627a32f46e97057e Author: vanhofen Date: 2016-11-21 (Mon, 21 Nov 2016) Origin message was: ------------------ - locale: fix "/" usage --- data/locale/deutsch.locale | 12 ++++++------ data/locale/english.locale | 32 ++++++++++++++++---------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index d1d52553b..c4d44cad4 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -30,7 +30,7 @@ GENRE.ARTS.2 Kunstwissenschaft GENRE.ARTS.3 Religion GENRE.ARTS.4 Volkskunst GENRE.ARTS.5 Literatur -GENRE.ARTS.6 Film/ Kino +GENRE.ARTS.6 Film/Kino GENRE.ARTS.7 Experimental Film/Video GENRE.ARTS.8 Rundfunk/Presse GENRE.ARTS.9 Neue Medien @@ -75,7 +75,7 @@ GENRE.NEWS.2 Nachrichtenmagazin GENRE.NEWS.3 Dokumentation GENRE.NEWS.4 Diskussion/Interview/Debatte GENRE.SHOW Show -GENRE.SHOW.0 Show/ Gameshow +GENRE.SHOW.0 Show/Gameshow GENRE.SHOW.1 Gameshow/Quiz GENRE.SHOW.2 Varietee GENRE.SHOW.3 Talkshow @@ -564,7 +564,7 @@ extra.volume_size Höhe der Anzeige extra.west Westen extra.zap_cycle Zap nur in Bouquet extra.zapit_fe_timeout Tuning Timeout -extra.zapit_hvoltage High (13.5/ 18.5) Voltage +extra.zapit_hvoltage High (13.5/18.5) Voltage extra.zapit_make_bouquet Kanalliste auffüllen extra.zapit_motor_speed Rotor Drehzeit extra.zapit_scanpids PIDs scannen/nutzen @@ -1404,7 +1404,7 @@ menu.hint_scripts Shell-Skripte ausführen menu.hint_selected_back Ändern Sie die Hintergrundfarbe für ausgewählte Fensterinhalte menu.hint_selected_text Ändern Sie die Textfarbe für ausgewählte Fensterinhalte menu.hint_service Sendersuchlauf, Bouquet-Verwaltung, Software-Aktualisierung etc. -menu.hint_service_scan Automatischer / manueller Service Suchlauf +menu.hint_service_scan Automatischer und manueller Service Suchlauf menu.hint_settings Konfigurieren des Systems,\nNetzwerk, Video, Audio, OSD etc. menu.hint_shoutcast_dev_id Geben Sie die SHOUTcast Dev ID ein. Eine leere Eingabe schaltet die SHOUTcast-Unterstützung aus menu.hint_shoutcast_enabled Schaltet die SHOUTcast-Unterstützung ein oder aus @@ -1835,7 +1835,7 @@ movieplayer.tshelp10 ca. 10 Minuten zurück movieplayer.tshelp11 ca. 10 Minuten vor movieplayer.tshelp12 Hilfe: http://www.giggo.de/dbox2/movieplayer.html\n movieplayer.tshelp2 Auswahl der Tonspur -movieplayer.tshelp3 Pause/ Weiter +movieplayer.tshelp3 Pause/Weiter movieplayer.tshelp4 Bookmark setzen movieplayer.tshelp5 Zeit einblenden movieplayer.tshelp6 ca. 1 Minute zurück @@ -2311,7 +2311,7 @@ streaming.overflow Aufnahme-Puffer Überlauf! Bitte ggf. einige Aufnahmen beende streaming.slow System oder Datenträger zu langsam! Bitte ggf. einige Aufnahmen beenden. streaming.write_error Die Aufnahme wurde leider abgebrochen,\nda ein Fehler beim Schreiben der Daten auftrat. stringinput.backspace Rücklöschen -stringinput.caps Groß / Klein +stringinput.caps Groß/Klein stringinput.clear Alles löschen stringinput.insert Einfügen stringinput.save Speichern diff --git a/data/locale/english.locale b/data/locale/english.locale index 2ccad57d7..ebaf919c6 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -22,7 +22,7 @@ EPGPlus.swap_mode swap mode EPGPlus.view_mode view mode GENRE.ALL off GENRE.ARTS Arts -GENRE.ARTS.0 arts / culture +GENRE.ARTS.0 arts/culture GENRE.ARTS.1 performing arts GENRE.ARTS.10 arts/culture magazines GENRE.ARTS.11 fashion @@ -35,14 +35,14 @@ GENRE.ARTS.7 experimental film/video GENRE.ARTS.8 broadcasting/press GENRE.ARTS.9 new media GENRE.CHILDRENs_PROGRAMMES children -GENRE.CHILDRENs_PROGRAMMES.0 children / juvenile program +GENRE.CHILDRENs_PROGRAMMES.0 children/juvenile program GENRE.CHILDRENs_PROGRAMMES.1 pre-school children's programmes GENRE.CHILDRENs_PROGRAMMES.2 entertainment programmes for 6 to 14 GENRE.CHILDRENs_PROGRAMMES.3 entertainment programmes for 10 to 16 GENRE.CHILDRENs_PROGRAMMES.4 informational/educational/school programmes GENRE.CHILDRENs_PROGRAMMES.5 cartoons/puppets GENRE.DOCUS_MAGAZINES documentation -GENRE.DOCUS_MAGAZINES.0 documentation / magazine +GENRE.DOCUS_MAGAZINES.0 documentation/magazine GENRE.DOCUS_MAGAZINES.1 nature/animals/environment GENRE.DOCUS_MAGAZINES.2 technology/natural sciences GENRE.DOCUS_MAGAZINES.3 medicine/physiology/psychology @@ -61,7 +61,7 @@ GENRE.MOVIE.6 romance GENRE.MOVIE.7 serious/classical/religious/historical movie/drama GENRE.MOVIE.8 adult movie/drama GENRE.MUSIC_DANCE music -GENRE.MUSIC_DANCE.0 music / ballet / dance +GENRE.MUSIC_DANCE.0 music/ballet/dance GENRE.MUSIC_DANCE.1 rock/pop GENRE.MUSIC_DANCE.2 serious music/classical music GENRE.MUSIC_DANCE.3 folk/traditional music @@ -75,12 +75,12 @@ GENRE.NEWS.2 news magazine GENRE.NEWS.3 documentary GENRE.NEWS.4 discussion/interview/debate GENRE.SHOW Show -GENRE.SHOW.0 Show / Gameshow +GENRE.SHOW.0 Show/Gameshow GENRE.SHOW.1 game show/quiz/contest GENRE.SHOW.2 variety show GENRE.SHOW.3 talk show GENRE.SOCIAL_POLITICAL social -GENRE.SOCIAL_POLITICAL.0 social and politic events / business +GENRE.SOCIAL_POLITICAL.0 social and politic events/business GENRE.SOCIAL_POLITICAL.1 magazines/reports/documentary GENRE.SOCIAL_POLITICAL.2 economics/social advisory GENRE.SOCIAL_POLITICAL.3 remarkable people @@ -721,7 +721,7 @@ fontsize.epg_date EPG Date fontsize.epg_info1 EPG Info 1 fontsize.epg_info2 EPG Info 2 fontsize.epg_title EPG Title -fontsize.eventlist_datetime Date / Time +fontsize.eventlist_datetime Date and time fontsize.eventlist_event Event Info fontsize.eventlist_itemlarge Large fontsize.eventlist_itemsmall Small @@ -869,7 +869,7 @@ keychooser.text2 wait a few seconds for abort keychoosermenu.currentkey current key keychoosermenu.setnew setup new key keychoosermenu.setnone no key -languagesetup.head Language / Timezone +languagesetup.head Language and timezone languagesetup.osd OSD Language languagesetup.select OSD Language lcd_info_line show in infoline @@ -885,7 +885,7 @@ lcdmenu.lcdcontroler Brightness lcdmenu.notify_rclock Notify when RC is locked lcdmenu.scroll Enable text scroll lcdmenu.statusline status line -lcdmenu.statusline.both volume / playtime +lcdmenu.statusline.both volume and playtime lcdmenu.statusline.playtime playtime lcdmenu.statusline.volume volume ledcontroler.backlight Buttons backlight @@ -941,7 +941,7 @@ mainmenu.tvradio_switch TV-Radio Switch mainsettings.audio Audio mainsettings.head Settings mainsettings.keybinding Key Setup -mainsettings.language Language / Timezone +mainsettings.language Language and timezone mainsettings.lcd Front-Panel mainsettings.manage Manage settings mainsettings.misc Extended settings @@ -1012,7 +1012,7 @@ menu.hint_channellist_mode_radio Use the selected channel list mode on startup i menu.hint_channellist_setup Configure channel list GUI options menu.hint_channellist_show_channellogo Show channel logos in channel list menu.hint_channellist_show_channelnumber Show channel number in channel list -menu.hint_channellist_show_empty_favs Show / hide empty bouquets in favorites +menu.hint_channellist_show_empty_favs Show or hide empty bouquets in favorites menu.hint_channellist_show_infobox Show or hide bottom infobox of channellist menu.hint_channels Open channel list menu.hint_ci Conditional access menu\nto setup your CI CAM or embeded Conax card @@ -1065,7 +1065,7 @@ menu.hint_fonts Configure GUI fonts and font sizes menu.hint_foot_back Change GUI footer background color menu.hint_foot_textcolor Change GUI window footer text color menu.hint_games Show list of installed games -menu.hint_hdd Format / check data storage +menu.hint_hdd Format and check data storage menu.hint_hdd_apply Apply sleep/noise parameters menu.hint_hdd_check Check filesystem (fsck) menu.hint_hdd_fmt Select the data storage format @@ -1404,7 +1404,7 @@ menu.hint_scripts Run scripts menu.hint_selected_back Change selected item background color menu.hint_selected_text Change selected item text color menu.hint_service Tuner setup, service scan,\nbouquet editor, software upgrade -menu.hint_service_scan Auto / manual service scan +menu.hint_service_scan Auto and manual service scan menu.hint_settings Configure System\nNetwork, audio, video, OSD and more menu.hint_shoutcast_dev_id Type your SHOUTcast Dev ID. An empty input disables SHOUTcast support menu.hint_shoutcast_enabled Enable or disable SHOUTcast support @@ -1422,7 +1422,7 @@ menu.hint_soft_restart Restart GUI without reboot menu.hint_softupdate_check Check online update, download and flash firmware menu.hint_softupdate_check_local Select and flash firmware from local file menu.hint_softupdate_createimage_menu Backup of current software, including all settings -menu.hint_softupdate_expert Separate partitions from the flash read / write to the flash +menu.hint_softupdate_expert Separate partitions from the flash. Read and write to the flash menu.hint_softupdate_expert_read Separate partitions (U-Boot, Splash, Kernel, SystemFS) from the flash read menu.hint_softupdate_expert_write Separate partitions (Splash, Kernel, SystemFS) write to the flash menu.hint_softupdate_settings The local update directory and the configuration file to set @@ -2177,7 +2177,7 @@ satsetup.minidiseqc Mini-DiSEqC satsetup.motor_pos Rotor position satsetup.nodiseqc no DiSEqC satsetup.reset_numbers Reset channel numbers -satsetup.sat_setup Setup satellites input / LNB +satsetup.sat_setup Setup satellites input and LNB satsetup.satellite Satellite satsetup.select_sat Select satellites satsetup.smatvremote SMATV Remote Tuning @@ -2311,7 +2311,7 @@ streaming.overflow Record buffer overflow, consider to stop some records streaming.slow System/hdd too slow, consider to stop some records streaming.write_error The recording was aborted,\nsince an error occured during the writing process. stringinput.backspace Backspace -stringinput.caps caps / no caps +stringinput.caps Upper/lower stringinput.clear clear all stringinput.insert Insert stringinput.save Save From 7dd360368155379709f886d98fe5934944cbe44a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 21 Nov 2016 09:16:27 +0100 Subject: [PATCH 137/171] locale: use german "usw." instead of "etc." Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fbb6e4c15f9441eec95de6c301a6b11d4beba730 Author: vanhofen Date: 2016-11-21 (Mon, 21 Nov 2016) Origin message was: ------------------ - locale: use german "usw." instead of "etc." --- data/locale/deutsch.locale | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index c4d44cad4..a3465ddea 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -967,7 +967,7 @@ menu.hint_adzap_setup Einstellungen für den Werbezapper menu.hint_adzap_writedata Schreibe Daten über den Status des Werbezappers nach /tmp/adzap.data menu.hint_aplay Audioplayer menu.hint_aplay_setup Ändern Sie Audioplayer-Einstellungen wie Titel-Anzeige, Startverzeichnis oder Bildschirmschoner. -menu.hint_audio Audio-Ausgang, Dolby Digital und SRS TruVolume Optionen etc. +menu.hint_audio Audio-Ausgang, Dolby Digital und SRS TruVolume Optionen usw. menu.hint_audio_adjust_vol_ac3 Lautstärkeanpassung für AC3-Tonspuren menu.hint_audio_adjust_vol_clear Alle gespeicherten Werte für AC3- und PCM-Tonspuren löschen menu.hint_audio_adjust_vol_pcm Lautstärkeanpassung für PCM-Tonspuren @@ -1050,7 +1050,7 @@ menu.hint_eventlist_additional Definiert, ob zusätzliche Informationen im Haupt menu.hint_eventlist_epgplus Definiert, ob EPG Plus (Vorschau-Übersicht) mit der EPG-Taste angezeigt werden sollen menu.hint_eventlist_fonts Ändern Sie die Schriftgröße in der Event-Liste menu.hint_eventlist_setup Wählen Sie die Anzeigeoptionen für die Event-Liste -menu.hint_extended Energiespar-, EPG-Speicher- und Lade-Optionen, HDMI-CEC, Startkanal etc. +menu.hint_extended Energiespar-, EPG-Speicher- und Lade-Optionen, HDMI-CEC, Startkanal usw. menu.hint_factory Zurücksetzen der Box auf Werkseinstellungen.\nDie Box wird danach neu gestartet menu.hint_fade Bei aktivierter Funktion werden die GUI-Fenster 'weich' ein- bzw. ausgeblendet menu.hint_fan_speed Steuerung der Lüftergeschwindigkeit für die CPU @@ -1081,7 +1081,7 @@ menu.hint_inact_timer Ausschalten der Box nach Inaktivität in Minuten.\nDie Box menu.hint_inactive_back Ändern Sie die Hintergrundfarbe für deaktivierte Fensterinhalte menu.hint_inactive_textcolor Ändern Sie die Textfarbe für deaktivierte Fensterinhalte menu.hint_inet_radio Internetradio -menu.hint_info Informationen über das Image, CPU, Arbeitsspeicher und Stream etc. +menu.hint_info Informationen über das Image, CPU, Arbeitsspeicher und Stream usw. menu.hint_infobar_back Ändern Sie die Hintergrundfarbe für die Infobar menu.hint_infobar_buttons_usertitle Erzwingt die benutzerdefinierten Titel der Farbtasten menu.hint_infobar_casys ein: zeigt alle Aktiven farbig, Mini: einzelnes Symbol ob gesperrt, Diskret: alle Aktiven CA-Systeme @@ -1161,7 +1161,7 @@ menu.hint_key_volumedown Weisen Sie eine Taste für die Reduzierung der Lautstä menu.hint_key_volumeup Weisen Sie eine Taste für die Erhöhung der Lautstärke zu menu.hint_keys Tastenbelegungen und Fernbedienungs-Abstimmung bearbeiten menu.hint_lang_pref Wählen Sie ihre bevorzugten Tonspuren und Untertitel-Sprachen -menu.hint_language Menü-Sprache, Zeitzone, bevorzugte Tonspuren, Untertitel-Sprachen etc. +menu.hint_language Menü-Sprache, Zeitzone, bevorzugte Tonspuren, Untertitel-Sprachen usw. menu.hint_last_radio Wählen Sie den Start-Sender im Radio-Modus menu.hint_last_tv Wählen Sie den Start-Sender im TV-Modus menu.hint_last_use Speichert den aktuellen Kanal beim Herunterfahren der Box @@ -1231,7 +1231,7 @@ menu.hint_net_telnet Aktiviert Telnet auf Ihrer Box menu.hint_net_test Testet die Netzwerkverbindung:\nPing auf Gateway, Name-Server und externe IP-Adressen menu.hint_net_ushare Freigabe verbundener Datenträger über UPnP menu.hint_net_xupnpd Freigabe von Live Channels über UPNP -menu.hint_network IP-Adresse, Gateway, DNS, Zeit-Sync, Netzwerk-Freigaben, Dienste etc. +menu.hint_network IP-Adresse, Gateway, DNS, Zeit-Sync, Netzwerk-Freigaben, Dienste usw. menu.hint_new_zap_mode Aktiviert Quickzap in der Kanalliste. Nach Betätigen der Mute-Taste wird mit den Hoch/Runter-Tasten direkt umgeschalten menu.hint_next Weiter zum nächsten Menü.\nDie Taste 'Menü' schließt alle Menüs menu.hint_next_brief Weiter zum nächsten Menü @@ -1240,7 +1240,7 @@ menu.hint_opkg Software-Pakete installieren oder vorhandene aktualisieren menu.hint_opkg_feed_addresses_edit Bearbeiten von Feed-Adressen menu.hint_opkg_install_local_package Paket von USB-Stick, SD, Freigabe oder lokalem Ordner installieren. menu.hint_opkg_upgrade Aktualisiert alle installierten Pakete auf die neueste verfügbare Version -menu.hint_osd Farben, Schriftarten, Anzeigegröße, Ansichtsoptionen der Menüs etc. +menu.hint_osd Farben, Schriftarten, Anzeigegröße, Ansichtsoptionen der Menüs usw. menu.hint_osd_language Wählen Sie ihre Menü-Sprache menu.hint_osd_preset Wählen Sie zwischen Röhren-TV (CRT) oder Flachbildschirm (LCD) menu.hint_osd_timing Einblendzeit, die das OSD auf dem TV angezeigt wird @@ -1403,9 +1403,9 @@ menu.hint_screenshot_video Diese Funktion übernimmt das TV-Bild als Hintergrund menu.hint_scripts Shell-Skripte ausführen menu.hint_selected_back Ändern Sie die Hintergrundfarbe für ausgewählte Fensterinhalte menu.hint_selected_text Ändern Sie die Textfarbe für ausgewählte Fensterinhalte -menu.hint_service Sendersuchlauf, Bouquet-Verwaltung, Software-Aktualisierung etc. +menu.hint_service Sendersuchlauf, Bouquet-Verwaltung, Software-Aktualisierung usw. menu.hint_service_scan Automatischer und manueller Service Suchlauf -menu.hint_settings Konfigurieren des Systems,\nNetzwerk, Video, Audio, OSD etc. +menu.hint_settings Konfigurieren des Systems,\nNetzwerk, Video, Audio, OSD usw. menu.hint_shoutcast_dev_id Geben Sie die SHOUTcast Dev ID ein. Eine leere Eingabe schaltet die SHOUTcast-Unterstützung aus menu.hint_shoutcast_enabled Schaltet die SHOUTcast-Unterstützung ein oder aus menu.hint_show_mute_icon Definiert, ob bei einem Lautstärkewert von 0 das Stumm-Symbol eingeblendet werden soll @@ -1428,7 +1428,7 @@ menu.hint_softupdate_expert_write Einzelne Partitionen (Splash, Kernel, SystemFS menu.hint_softupdate_settings Das lokale Update-Verzeichnis und die Konfigurationsdatei festlegen menu.hint_standby Receiver in den Standby Modus versetzen menu.hint_start_tostandby Aktiviert den Standby-Modus direkt nach dem Starten der Box -menu.hint_streaminfo Aktuelle Sender-Informationen über PIDs, SNR-Verhältnis, Bitrate etc. +menu.hint_streaminfo Aktuelle Sender-Informationen über PIDs, SNR-Verhältnis, Bitrate usw. menu.hint_subchannel_pos Wählen Sie die Anzeigeposition der Unterkanäle aus menu.hint_sw_update System aktualisieren, Image sichern und wiederherstellen menu.hint_theme Wählen Sie ein vordefiniertes Farbschema, speichern oder laden Sie ihre eigenen Farbschemata @@ -1454,7 +1454,7 @@ menu.hint_vfd_infoline Wählen Sie, was in der Infozeile angezeigt werden soll menu.hint_vfd_notify_rclock Zeigt eine Meldung im Display, wenn bei gesperrter Fernbedienung eine Taste gedrückt wird menu.hint_vfd_scroll Laufschrift im Display ein- oder ausschalten menu.hint_vfd_statusline Wählen Sie, was in der Statuszeile angezeigt werden soll -menu.hint_video Video-Ausgang, Auflösung, Format, Seitenverhältnisse etc. +menu.hint_video Video-Ausgang, Auflösung, Format, Seitenverhältnisse usw. menu.hint_video_43mode Anzeige-Modus für 4:3-Inhalte auf 16:9-Fernsehern menu.hint_video_analog_mode Wählen Sie den Modus des Ausgangssignals für den CINCH-Anschluss menu.hint_video_brightness Change picture brightness From d137ca89698eda33bcce7a29b6a69d2b51b66180 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 21 Nov 2016 10:43:27 +0100 Subject: [PATCH 138/171] CComponentsFrmClock: ensure that no radius is defined for inner items Radius is not required for inner segments. TODO: single segment Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/02c6df782c0b423f05e248935db40395fc12e8a7 Author: Thilo Graf Date: 2016-11-21 (Mon, 21 Nov 2016) --- src/gui/components/cc_frm_clock.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index 82c048943..5adcd7b45 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -190,8 +190,8 @@ void CComponentsFrmClock::initCCLockItems() //background paint of item is not required lbl->doPaintBg(false); - //set corner properties of label item - lbl->setCorner(corner_rad-fr_thickness, corner_type); + //preset corner properties of label item + lbl->setCorner(max(0, corner_rad-fr_thickness), corner_type); //set text border to 0 lbl->setTextBorderWidth(0,0); @@ -234,7 +234,7 @@ void CComponentsFrmClock::initCCLockItems() else if (i == v_cc_items.size()-1) lbl->setCornerType(corner_type & CORNER_RIGHT);// last label item else - lbl->setCornerType(0);// inner items + lbl->setCorner(0,CORNER_NONE);// inner items don't need round corners } //extract timestring segment (char) From 3634c26ea19815a23b2ae3bcb8675f77fb02de82 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 21 Nov 2016 10:44:27 +0100 Subject: [PATCH 139/171] CComponentsInfoBox: add methode to get internal picture object Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0d2c612adb72595b27cf9a9106e6bc1931433da7 Author: Thilo Graf Date: 2016-11-21 (Mon, 21 Nov 2016) --- src/gui/components/cc_item_infobox.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/components/cc_item_infobox.h b/src/gui/components/cc_item_infobox.h index d8f2345c5..f82eab80e 100644 --- a/src/gui/components/cc_item_infobox.h +++ b/src/gui/components/cc_item_infobox.h @@ -83,6 +83,8 @@ class CComponentsInfoBox : public CComponentsText void setPicture(const std::string& picture_name); ///set property: path or name of displayed image, parameter as const char* void setPicture(const char* picture_name); + ///retur internal picture object + CComponentsPicture * getPictureObject(){return pic;} ///paint item void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); }; From e2afccba70ae59d4d9ab1d759d684f9d2b3d1786 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 21 Nov 2016 10:53:01 +0100 Subject: [PATCH 140/171] CTextBox: try to fix possible background artefacts in transparent mode supplement to: - textbox: fix box width in round corners mode Radius was always subtracted in all text modes. TODO: value of m_nBgRadius itself is not considered at the moment. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7031dc1da4bf0288795c34511983969314c95367 Author: Thilo Graf Date: 2016-11-21 (Mon, 21 Nov 2016) --- src/gui/widget/textbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index bbf678e33..41ca9e7dc 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -588,7 +588,7 @@ void CTextBox::refreshText(void) //bg variables int ax = m_cFrameTextRel.iX+m_cFrame.iX; int ay = m_cFrameTextRel.iY+m_cFrame.iY; - int dx = m_old_cText != m_cText || m_nNrOfPages>1 ? m_cFrameTextRel.iWidth : m_nMaxTextWidth - m_nBgRadius; + int dx = m_old_cText != m_cText || m_nNrOfPages>1 ? m_cFrameTextRel.iWidth : m_nMaxTextWidth - (m_nMode & SCROLL ? m_nBgRadius : 0); int dy = m_cFrameTextRel.iHeight; //avoid artefacts in transparent cornes From 97b57a783d305feefd92b0a8a93405c75f594e68 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 22 Nov 2016 10:32:10 +0100 Subject: [PATCH 141/171] Messages: try to fix API message handling Passed timeout for messeages an popup's fired by yWeb API was not really ok. For popups now we have a setting with default value of 6 seconds timeout Popups fired with ShowHint() use this as default. Value of 0 and -1 are ignored. Messages fired with ShowMsg() should be fixed and interpret value 0 or -1 as no timeout and will remain on the screen. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8b97f72ed1e1e8ad3430dec98f772f011f5dba27 Author: Thilo Graf Date: 2016-11-22 (Tue, 22 Nov 2016) --- src/gui/widget/hintbox.cpp | 4 ++++ src/gui/widget/hintbox.h | 5 +++-- src/gui/widget/msgbox.cpp | 5 ++++- src/gui/widget/msgbox.h | 14 +++++++------- src/neutrino.cpp | 2 +- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + src/system/settings.h | 4 +++- 8 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 5cc9085b5..172419468 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -196,6 +196,10 @@ int CHintBox::exec() neutrino_msg_t msg; neutrino_msg_data_t data; int res = messages_return::none; + + if (timeout == NO_TIMEOUT || timeout == 0) + timeout = HINTBOX_DEFAULT_TIMEOUT; + uint64_t timeoutEnd = CRCInput::calcTimeoutEnd( timeout ); if (timeout > 0) diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index 641bb6411..310aeb8b2 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -35,7 +35,8 @@ #define HINTBOX_MIN_WIDTH 420 #define HINTBOX_MIN_HEIGHT 125 #define HINTBOX_MAX_HEIGHT 520 -#define HINTBOX_DEFAULT_TIMEOUT 5 +#define HINTBOX_DEFAULT_TIMEOUT g_settings.timing[SNeutrinoSettings::TIMING_POPUP_MESSAGES] +#define NO_TIMEOUT -1 //frame around hint container as indent #define W_FRAME std::max(HINTBOX_MIN_WIDTH, HINTBOX_MIN_HEIGHT) * 2/100 //frame color around hint/message box @@ -328,7 +329,7 @@ class CHint : public CHintBox * Simplified methodes to show hintboxes without titlebar and footer * Text is UTF-8 encoded * @param[in] timeout -* @li optional: exepts type int as seconds, default = HINTBOX_DEFAULT_TIMEOUT (5 sec) +* @li optional: exepts type int as seconds, default = HINTBOX_DEFAULT_TIMEOUT (get from settings) * @param[in] show_background * @li optional: exepts type bool, enable/disable backround paint, default = true * @see for possible text parameters take a look to CHintBox() diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 567780794..a8bc796fd 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -236,6 +236,9 @@ int CMsgBox::exec() ccw_footer->getSelectedButtonObject()->setButtonAlias(mb_show_button); int selected = ccw_footer->getSelectedButton(); + if (timeout == NO_TIMEOUT) + timeout = 0; + uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(timeout); if (timeout > 0) @@ -432,7 +435,7 @@ int ShowMsg2UTF( const neutrino_locale_t Title, const int& Text_mode, fb_pixel_t color_frame) { - int result = ShowMsg( g_Locale->getText(Title), Text, Default, ShowButtons, Icon, Width, Timeout, returnDefaultOnTimeout, Text_mode, color_frame); + int result = ShowMsg2UTF(g_Locale->getText(Title), Text, Default, ShowButtons, Icon, Width, Timeout, returnDefaultOnTimeout, Text_mode, color_frame); return (result); } diff --git a/src/gui/widget/msgbox.h b/src/gui/widget/msgbox.h index 028bba5d5..cd0fd2a44 100644 --- a/src/gui/widget/msgbox.h +++ b/src/gui/widget/msgbox.h @@ -321,7 +321,7 @@ int ShowMsg2UTF( const neutrino_locale_t Title, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = MSGBOX_MIN_WIDTH, - const int Timeout = -1, + const int Timeout = NO_TIMEOUT, bool returnDefaultOnTimeout = false, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 @@ -332,7 +332,7 @@ int ShowMsg2UTF( const char * const Title, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = MSGBOX_MIN_WIDTH, - const int Timeout = -1, + const int Timeout = NO_TIMEOUT, bool returnDefaultOnTimeout = false, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 @@ -343,7 +343,7 @@ int ShowMsg( const neutrino_locale_t Title, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = MSGBOX_MIN_WIDTH, - const int Timeout = -1, + const int Timeout = NO_TIMEOUT, bool returnDefaultOnTimeout = false, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 @@ -354,7 +354,7 @@ int ShowMsg( const char * const Title, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = MSGBOX_MIN_WIDTH, - const int Timeout = -1, + const int Timeout = NO_TIMEOUT, bool returnDefaultOnTimeout = false, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 @@ -365,7 +365,7 @@ int ShowMsg( const neutrino_locale_t Title, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = MSGBOX_MIN_WIDTH, - const int Timeout = -1, + const int Timeout = NO_TIMEOUT, bool returnDefaultOnTimeout = false, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 @@ -376,7 +376,7 @@ int ShowMsg( const neutrino_locale_t Title, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = MSGBOX_MIN_WIDTH, - const int Timeout = -1, + const int Timeout = NO_TIMEOUT, bool returnDefaultOnTimeout = false, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 @@ -387,7 +387,7 @@ int ShowMsg( const std::string & Title, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = MSGBOX_MIN_WIDTH, - const int Timeout = -1, + const int Timeout = NO_TIMEOUT, bool returnDefaultOnTimeout = false, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 diff --git a/src/neutrino.cpp b/src/neutrino.cpp index c6bc48e70..a4eae6220 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3350,7 +3350,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) } else if (msg == NeutrinoMessages::EVT_POPUP || msg == NeutrinoMessages::EVT_EXTMSG) { if (mode != mode_scart && mode != mode_standby) { - int timeout = HINTBOX_DEFAULT_TIMEOUT; + int timeout = NO_TIMEOUT; std::string text = (char*)data; std::string::size_type pos; diff --git a/src/system/locals.h b/src/system/locals.h index b29341ef7..5621aa1e5 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2433,6 +2433,7 @@ typedef enum LOCALE_TIMING_INFOBAR_RADIO, LOCALE_TIMING_MENU, LOCALE_TIMING_NUMERICZAP, + LOCALE_TIMING_POPUP_MESSAGES, LOCALE_TIMING_VOLUMEBAR, LOCALE_TMDB_API_KEY, LOCALE_TMDB_ENABLED, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index bf61c27ac..875066c28 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2433,6 +2433,7 @@ const char * locale_real_names[] = "timing.infobar_radio", "timing.menu", "timing.numericzap", + "timing.popup_messages", "timing.volumebar", "tmdb.api_key", "tmdb.enabled", diff --git a/src/system/settings.h b/src/system/settings.h index 359bbd4af..fbb47ee6e 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -405,6 +405,7 @@ struct SNeutrinoSettings TIMING_VOLUMEBAR = 6, TIMING_FILEBROWSER = 7, TIMING_NUMERICZAP = 8, + TIMING_POPUP_MESSAGES = 9, TIMING_SETTING_COUNT }; @@ -873,7 +874,8 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO { 6, LOCALE_TIMING_INFOBAR_MOVIEPLAYER}, { 3, LOCALE_TIMING_VOLUMEBAR }, { 60, LOCALE_TIMING_FILEBROWSER }, - { 3, LOCALE_TIMING_NUMERICZAP } + { 3, LOCALE_TIMING_NUMERICZAP }, + { 6, LOCALE_TIMING_POPUP_MESSAGES} }; // lcdd From c91143c82d74e8186d8ac282b95c62691fe18336 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 22 Nov 2016 10:44:50 +0100 Subject: [PATCH 142/171] CHintBox: fix missing shadow for popups Must be enabled with enum, bool has no effect. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e46d65fb924621ebae2bee080c1ed85f79eddd54 Author: Thilo Graf Date: 2016-11-22 (Tue, 22 Nov 2016) --- src/gui/widget/hintbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 172419468..5709df99b 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -135,7 +135,7 @@ void CHintBox::init(const std::string& Text, const int& Width, const std::string hb_font = MSG_FONT; //enable shadow - shadow = true; + shadow = CC_SHADOW_ON; //disable disable header if no title has been defined if (ccw_caption.empty()) From 3bed87466a69fec2da2128365c8c20964e5bf180 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 22 Nov 2016 11:01:30 +0100 Subject: [PATCH 143/171] Messages: move window to top of screen User request. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/644063d2c8806898bafb8f2c39ee560800589f39 Author: Thilo Graf Date: 2016-11-22 (Tue, 22 Nov 2016) --- src/gui/widget/hintbox.cpp | 4 ++-- src/gui/widget/msgbox.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 5709df99b..6d64e7fc1 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -309,8 +309,8 @@ void CHintBox::addHintItem(const std::string& Text, const int& text_mode, const ReSize(); /* set hint box position general to center and refresh window */ - setCenterPos(); - + setCenterPos(CC_ALONG_X); + y = frameBuffer->getScreenY() + ((frameBuffer->getScreenHeight() - height) >> 2), Refresh(); } diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index a8bc796fd..e2edcdeed 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -204,7 +204,8 @@ void CMsgBox::initButtons() ccw_footer->enableButtonShadow(CC_SHADOW_ON, OFFSET_SHADOW/2, true); //set position of meassage window and refresh window properties - setCenterPos(); + setCenterPos(CC_ALONG_X); + y = frameBuffer->getScreenY() + ((frameBuffer->getScreenHeight() - height) >> 2), Refresh(); //set the 1st button as default selected button From 0e62dfb5e554ef287b80fbe6ac34bc1f37b39383 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 22 Nov 2016 19:10:01 +0100 Subject: [PATCH 144/171] Sort locale Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b8e314695b5ac5a714f54fbb0033b01c48793d3d Author: Michael Liebmann Date: 2016-11-22 (Tue, 22 Nov 2016) --- data/locale/nederlands.locale | 2 +- data/locale/slovak.locale | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/locale/nederlands.locale b/data/locale/nederlands.locale index 2425f75e9..092ca0fb3 100644 --- a/data/locale/nederlands.locale +++ b/data/locale/nederlands.locale @@ -686,10 +686,10 @@ fontsize.infobar_info Info fontsize.infobar_number Nummer fontsize.infobar_small Klein fontsize.menu Menu tekst -fontsize.message_text Messag Text fontsize.menu_hint Menu hints fontsize.menu_info Menu Info fontsize.menu_title Menu Titel +fontsize.message_text Messag Text fontsize.subtitles Text ondertitels hdd_10min 10 min. hdd_1min 1 min. diff --git a/data/locale/slovak.locale b/data/locale/slovak.locale index c6c3b1e67..c3f774481 100644 --- a/data/locale/slovak.locale +++ b/data/locale/slovak.locale @@ -733,11 +733,11 @@ fontsize.infobar_info Informácia na informačnej lište fontsize.infobar_ng_ecminfo ECM Informácia fontsize.infobar_number Kanál na informačnej lište fontsize.menu Text menu -fontsize.message_text Messagwe Text fontsize.menu_foot Päta (vo všetkých grafických elementoch) fontsize.menu_hint Popis menu fontsize.menu_info Informačné menu fontsize.menu_title Titulok menu +fontsize.message_text Messagwe Text fontsize.moviebrowser_head Hlavičky fontsize.moviebrowser_info Informačné okno fontsize.moviebrowser_list Zoznam položiek @@ -1406,9 +1406,9 @@ menu.hint_selected_text Zmena farby textu označenej položky menu.hint_service Nastavenie tuneru, vyhľadanie služieb,\núprava buketov, aktualizácia software menu.hint_service_scan Automatické / manuálne vyhľadávanie staníc, FastScan, Test signálu menu.hint_settings Konfigurácia system, sieť, zvuk, obraz, OSD a iné -menu.hint_show_mute_icon Zobrazenie ikony umlčania, ak nastavenie hlasitosťi bude 0 menu.hint_shoutcast_dev_id Vložte vaše SHOUTcast údaje. Neuvedením údajov sa vypne podpora SHOUTcast. menu.hint_shoutcast_enabled Povoliť alebo zakázať podporu SHOUTcast +menu.hint_show_mute_icon Zobrazenie ikony umlčania, ak nastavenie hlasitosťi bude 0 menu.hint_shutdown Vypnutie prijímača - bez potvrdzovania menu.hint_shutdown_count Čas prepnutia prijímača z pohotovostného režimu do stavu vypnutia menu.hint_shutdown_menu Prepne prijímač do pohotovostného režimu alebo ho vypne, nastaví časovač vypnutia From 3949bfb5f7aa012889a96d4ded02258490f3db1f Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 22 Nov 2016 19:10:15 +0100 Subject: [PATCH 145/171] Add missing locale - Supplement to commit ec132fe91bd1f05e0c56f30f174585991771124c and 97b57a783d305feefd92b0a8a93405c75f594e68 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ab11919298e1030165ab60334ea597b76c863a75 Author: Michael Liebmann Date: 2016-11-22 (Tue, 22 Nov 2016) Origin message was: ------------------ Add missing locale - Supplement to commit ec132fe91bd1f05e0c56f30f174585991771124c and 97b57a783d305feefd92b0a8a93405c75f594e68 --- data/locale/deutsch.locale | 2 ++ data/locale/english.locale | 2 ++ 2 files changed, 4 insertions(+) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index a3465ddea..fe07f8f8d 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1040,6 +1040,7 @@ menu.hint_epg_fonts Ändern Sie die Schriftgrößen der EPG-Details menu.hint_epg_max_events Maxiale Anzahl der Events im Zwischenspeicher menu.hint_epg_old_events Veraltete EPG-Daten werden nach dieser Zeit (in Stunden) verworfen menu.hint_epg_read Liest nach einem Neustart die EPG-Daten von einem externen Datenträger wieder ein +menu.hint_epg_read_frequently Liest die EPG-Daten in regelmäßigen Abständen von einem externen Datenträger menu.hint_epg_save Speichert die EPG-Daten beim Herunterfahren auf einem externen Datenträger menu.hint_epg_save_frequently Speichert die EPG-Daten in regelmäßigen Abständen auf einem externen Datenträger menu.hint_epg_save_mode Speichert die EPG-Daten nur für Sender, die in die Favoriten aufgenommen sind @@ -2405,6 +2406,7 @@ timing.infobar_movieplayer Infobar (Filmwiedergabe) timing.infobar_radio Infobar (Radiobetrieb) timing.menu Menü timing.numericzap Umschalten mit Zifferntasten +timing.popup_messages Popup Meldungen timing.volumebar Lautstärkeanzeige tmdb.api_key TMDb API Schlüssel tmdb.enabled TMDb-Unterstützung diff --git a/data/locale/english.locale b/data/locale/english.locale index ebaf919c6..fec3ec423 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1040,6 +1040,7 @@ menu.hint_epg_fonts Change EPG details window font sizes menu.hint_epg_max_events Maximum events to cache. After reaching limit\nEPG cache will remove future events menu.hint_epg_old_events Hours after event end time to consider\nevent old and remove it from cache menu.hint_epg_read Read saved EPG data after boot from an external device +menu.hint_epg_read_frequently Read cached EPG data in frequently intervals from an external device menu.hint_epg_save Save cached EPG data to an external device menu.hint_epg_save_frequently Save cached EPG data in frequently intervals to an external device menu.hint_epg_save_mode Cache EPG only for channels present in favorite bouquets @@ -2405,6 +2406,7 @@ timing.infobar_movieplayer Infobar (movie mode) timing.infobar_radio Infobar (radio mode) timing.menu Menu timing.numericzap Numeric Zap +timing.popup_messages Popup messages timing.volumebar Volume bar tmdb.api_key TMDb API key tmdb.enabled TMDb support From 994401432cae3c6063345ca374490146bfaf040e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 23 Nov 2016 09:06:11 +0100 Subject: [PATCH 146/171] CRecordManager: add methode to get internal rec map Useful for access to current record data. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8ba357fcb21b874b41ded1085e355bb25a3084ac Author: Thilo Graf Date: 2016-11-23 (Wed, 23 Nov 2016) --- src/driver/record.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/driver/record.h b/src/driver/record.h index 476f92de8..1683346b3 100644 --- a/src/driver/record.h +++ b/src/driver/record.h @@ -203,6 +203,7 @@ class CRecordManager : public CMenuTarget /*, public CChangeObserver*/ bool StopAutoRecord(bool lock = true); void StopAutoTimer(); bool CheckRecordingId_if_Timeshift(int recid); + recmap_t GetRecordMap()const{return recmap;} MI_MOVIE_INFO * GetMovieInfo(const t_channel_id channel_id, bool timeshift = true); const std::string GetFileName(const t_channel_id channel_id, bool timeshift = true); From 5474e555a8ad3324950ab05bac181eaca6bce9c9 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 23 Nov 2016 10:04:50 +0100 Subject: [PATCH 147/171] CComponentsWindow: remove default values from internal init method Is not really required for this private member. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4e1a3a89dc9c122cc0584505dcf8e5783aeae06e Author: Thilo Graf Date: 2016-11-23 (Wed, 23 Nov 2016) --- src/gui/components/cc_frm_window.cpp | 2 +- src/gui/components/cc_frm_window.h | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 982219e1b..a7c84cba3 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -59,7 +59,7 @@ using namespace std; //sub class CComponentsWindow inherit from CComponentsForm CComponentsWindow::CComponentsWindow(CComponentsForm *parent) { - initVarWindow(0, 0, 800, 600, "", "", parent); + initVarWindow(0, 0, 800, 600, "", "", parent, CC_SHADOW_OFF, COL_FRAME_PLUS_0, COL_MENUCONTENT_PLUS_0, COL_SHADOW_PLUS_0); } CComponentsWindow::CComponentsWindow( const int& x_pos, const int& y_pos, const int& w, const int& h, diff --git a/src/gui/components/cc_frm_window.h b/src/gui/components/cc_frm_window.h index ca2fb296e..7b2f71796 100644 --- a/src/gui/components/cc_frm_window.h +++ b/src/gui/components/cc_frm_window.h @@ -107,14 +107,14 @@ class CComponentsWindow : public CComponentsForm ///initialze all window objects at once void initCCWItems(); ///initialize all attributes - void initVarWindow( const int& x_pos = CC_CENTERED, const int& y_pos = CC_CENTERED, const int& w = 0, const int& h = 0, - const std::string& caption = "", - const std::string& iconname = "", - CComponentsForm *parent = NULL, - int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_FRAME_PLUS_0, - fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + void initVarWindow( const int& x_pos, const int& y_pos, const int& w, const int& h, + const std::string& caption, + const std::string& iconname, + CComponentsForm *parent, + int shadow_mode, + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow); ///initialize width and height void initWindowSize(); ///initialize position From e10e0583ae5af414924d50df0365720c375c9eb4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 23 Nov 2016 10:33:58 +0100 Subject: [PATCH 148/171] CComponentsItem: fix possible negativ value for box radius If frame width > 0 and radius too small, we have an negative value. This should prevent this. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ee4a443c8a4c702b4a2da645fffb4ad3b772dd37 Author: Thilo Graf Date: 2016-11-23 (Wed, 23 Nov 2016) --- src/gui/components/cc_item.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 10147f6cf..d695cbdf1 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -86,7 +86,7 @@ void CComponentsItem::paintInit(bool do_save_bg) sw = max(0, sw); //set current needed corner main box radius - int box_rad = corner_rad; + int box_rad = corner_type ? corner_rad : 0; //and ensure max main box radius < dimensions if (2*box_rad > dy) @@ -186,7 +186,7 @@ void CComponentsItem::paintInit(bool do_save_bg) {sh_ctr, CC_FBDATA_TYPE_SHADOW_BOX, sh_ctr_x-sw, sh_ctr_y-sw+th, sh_cdx, sh_cdy-sh_cdy_size_offset+sw, col_shadow_clean, box_rad, corner_type & CORNER_TOP_RIGHT, 0, NULL, NULL, NULL, false}, //main box - {true, CC_FBDATA_TYPE_BOX, ix+th, iy+th, dx-2*th, dy-2*th, col_body, box_rad-th, corner_type, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, ix+th, iy+th, dx-2*th, dy-2*th, col_body, max(0,box_rad-th), corner_type, 0, NULL, NULL, NULL, false}, //frame {true, CC_FBDATA_TYPE_FRAME, ix, iy, dx, dy, col_frame_cur, box_rad, corner_type, th, NULL, NULL, NULL, false} From 192a9d80ed6fcda940bdea77f1af8f6d1025a68e Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 24 Nov 2016 19:21:14 +0100 Subject: [PATCH 149/171] src/gui/widget/menue.cpp try to fix widget segfault menu with keyboard and background restore Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a8ea7c60d50d39087866df61df56881d44ebdb7e Author: Jacek Jendrzej Date: 2016-11-24 (Thu, 24 Nov 2016) --- src/gui/widget/menue.cpp | 13 +++++++++---- src/gui/widget/menue.h | 2 ++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 3711cb1bd..8a2550ceb 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -622,6 +622,8 @@ void CMenuWidget::Init(const std::string &Icon, const int mwidth, const mn_widge fbutton_width = 0; fbutton_height = 0; nextShortcut = 1; + saveScreen_width = 0; + saveScreen_height = 0; } void CMenuWidget::move(int xoff, int yoff) @@ -1391,17 +1393,18 @@ void CMenuWidget::saveScreen() return; delete[] background; - - background = new fb_pixel_t [full_width * (full_height+fbutton_height)]; + saveScreen_height = full_height+fbutton_height; + saveScreen_width = full_width; + background = new fb_pixel_t [saveScreen_height * saveScreen_width]; if(background) - frameBuffer->SaveScreen(x /*-ConnectLineBox_Width*/, y, full_width, full_height + fbutton_height, background); + frameBuffer->SaveScreen(x /*-ConnectLineBox_Width*/, y, full_width, saveScreen_height, background); } void CMenuWidget::restoreScreen() { if(background) { if(savescreen) - frameBuffer->RestoreScreen(x /*-ConnectLineBox_Width*/, y, full_width, full_height + fbutton_height, background); + frameBuffer->RestoreScreen(x /*-ConnectLineBox_Width*/, y, saveScreen_width, saveScreen_height, background); } } @@ -1411,6 +1414,8 @@ void CMenuWidget::enableSaveScreen(bool enable) if (!enable && background) { delete[] background; background = NULL; + saveScreen_width = 0; + saveScreen_height = 0; } } diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index bc527ed68..61d6691b4 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -494,6 +494,8 @@ class CMenuWidget : public CMenuTarget, public CComponentsSignals CComponentsInfoBox *info_box; int hint_height; CComponentsHeader *header; + unsigned int saveScreen_width ; + unsigned int saveScreen_height; protected: std::string nameString; neutrino_locale_t name; From cf6c9b99d9390e307e66650a0a7da22173118afa Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 24 Nov 2016 21:41:23 +0100 Subject: [PATCH 150/171] enable epg-scan while audioplayer, movieplayer, pictureviewer and upnp-browser runs Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a5bc693282bf38aa8848c5bd871bc8c80b2d71a1 Author: vanhofen Date: 2016-11-24 (Thu, 24 Nov 2016) Origin message was: ------------------ - enable epg-scan while audioplayer, movieplayer, pictureviewer and upnp-browser runs --- src/gui/audioplayer.cpp | 6 +----- src/gui/movieplayer.cpp | 3 --- src/gui/pictureviewer.cpp | 6 ------ src/gui/upnpbrowser.cpp | 5 ----- 4 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index c96652ac9..151165907 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -293,9 +293,6 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_LastMode = CNeutrinoApp::getInstance()->getMode(); CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::CHANGEMODE , NeutrinoMessages::mode_audio ); - // Stop sectionsd - g_Sectionsd->setPauseScanning(true); - puts("[audioplayer.cpp] executing " AUDIOPLAYER_START_SCRIPT "."); if (my_system(AUDIOPLAYER_START_SCRIPT) != 0) perror(AUDIOPLAYER_START_SCRIPT " failed"); @@ -314,8 +311,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) //g_Zapit->unlockPlayBack(); CZapit::getInstance()->EnablePlayback(true); - // Start Sectionsd - g_Sectionsd->setPauseScanning(false); + m_frameBuffer->stopFrame(); CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::CHANGEMODE , m_LastMode ); g_RCInput->postMsg( NeutrinoMessages::SHOW_INFOBAR, 0 ); diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 960022af5..c16c21031 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -221,8 +221,6 @@ void CMoviePlayerGui::cutNeutrino() return; g_Zapit->lockPlayBack(); - if (!isWebTV) - g_Sectionsd->setPauseScanning(true); m_LastMode = (CNeutrinoApp::getInstance()->getMode() /*| NeutrinoMessages::norezap*/); if (isWebTV) @@ -245,7 +243,6 @@ void CMoviePlayerGui::restoreNeutrino() //g_Zapit->unlockPlayBack(); CZapit::getInstance()->EnablePlayback(true); - g_Sectionsd->setPauseScanning(false); printf("%s: restore mode %x\n", __func__, m_LastMode);fflush(stdout); #if 0 diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 7d09f898f..97e335fa1 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -197,9 +197,6 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey) // blank background screen videoDecoder->setBlank(true); - - // Stop Sectionsd - g_Sectionsd->setPauseScanning(true); } // Save and Clear background @@ -217,9 +214,6 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey) if (!audioplayer) { // !!! why? !!! //g_Zapit->unlockPlayBack(); CZapit::getInstance()->EnablePlayback(true); - - // Start Sectionsd - g_Sectionsd->setPauseScanning(false); } // Restore previous background diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 59221c059..92b90d749 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -183,9 +183,6 @@ int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/ // remember last mode m_LastMode=(CNeutrinoApp::getInstance()->getLastMode()); - // Stop sectionsd - g_Sectionsd->setPauseScanning(true); - m_deviceliststart=0; m_selecteddevice=0; timeout = 0; @@ -194,8 +191,6 @@ int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/ stopAudio(); - // Start Sectionsd - g_Sectionsd->setPauseScanning(false); m_frameBuffer->stopFrame(); m_frameBuffer->Clear(); From 77adc62153a686955975db060b661e1967604be4 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 25 Nov 2016 16:45:26 +0100 Subject: [PATCH 151/171] supplement to 192a9d80ed6fcda940bdea77f1af8f6d1025a68e Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/91e0f8070b2578ce56b280b13daf942cfaf2a47b Author: Jacek Jendrzej Date: 2016-11-25 (Fri, 25 Nov 2016) --- src/gui/widget/menue.cpp | 8 ++++++-- src/gui/widget/menue.h | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 8a2550ceb..d0c30166a 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1395,16 +1395,18 @@ void CMenuWidget::saveScreen() delete[] background; saveScreen_height = full_height+fbutton_height; saveScreen_width = full_width; + saveScreen_y = y; + saveScreen_x = x; background = new fb_pixel_t [saveScreen_height * saveScreen_width]; if(background) - frameBuffer->SaveScreen(x /*-ConnectLineBox_Width*/, y, full_width, saveScreen_height, background); + frameBuffer->SaveScreen(saveScreen_x /*-ConnectLineBox_Width*/, saveScreen_y, saveScreen_width, saveScreen_height, background); } void CMenuWidget::restoreScreen() { if(background) { if(savescreen) - frameBuffer->RestoreScreen(x /*-ConnectLineBox_Width*/, y, saveScreen_width, saveScreen_height, background); + frameBuffer->RestoreScreen(saveScreen_x /*-ConnectLineBox_Width*/, saveScreen_y, saveScreen_width, saveScreen_height, background); } } @@ -1416,6 +1418,8 @@ void CMenuWidget::enableSaveScreen(bool enable) background = NULL; saveScreen_width = 0; saveScreen_height = 0; + saveScreen_y = 0; + saveScreen_x = 0; } } diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 61d6691b4..5da3cc3f5 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -496,6 +496,8 @@ class CMenuWidget : public CMenuTarget, public CComponentsSignals CComponentsHeader *header; unsigned int saveScreen_width ; unsigned int saveScreen_height; + unsigned int saveScreen_y; + unsigned int saveScreen_x; protected: std::string nameString; neutrino_locale_t name; From d06eeec388490298142db0f2d2c7412cf6053558 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 25 Nov 2016 18:17:49 +0100 Subject: [PATCH 152/171] src/gui/widget/keyboard_input.cpp -add direkt digikey pressed Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/983d24cd516dcc965dd7333028c8d028ce39d618 Author: Jacek Jendrzej Date: 2016-11-25 (Fri, 25 Nov 2016) --- src/gui/widget/keyboard_input.cpp | 20 ++++++++++++++++++++ src/gui/widget/keyboard_input.h | 2 ++ 2 files changed, 22 insertions(+) diff --git a/src/gui/widget/keyboard_input.cpp b/src/gui/widget/keyboard_input.cpp index 3ff38ab1a..92b5efaeb 100644 --- a/src/gui/widget/keyboard_input.cpp +++ b/src/gui/widget/keyboard_input.cpp @@ -502,6 +502,22 @@ void CKeyboardInput::keyBackspacePressed(void) } } +void CKeyboardInput::keyDigiPressed(const neutrino_msg_t key) +{ + int old_col = scol; + int old_srow = srow; + int digi = CRCInput::getNumericValue(key); + digi = (digi == 0) ? 10 : digi; + srow = 0; + scol = digi; + if (focus == FOCUS_KEY) + paintKey(old_srow, old_col); + + focus = FOCUS_KEY; + paintKey(srow, scol); + NormalKeyPressed(); +} + void CKeyboardInput::insertChar() { int item = inputSize -1; @@ -614,6 +630,10 @@ int CKeyboardInput::exec(CMenuTarget* parent, const std::string &) { switchLayout(); } + else if (CRCInput::isNumeric(msg)) + { + keyDigiPressed(msg); + } else if ((msg == CRCInput::RC_home) || (msg == CRCInput::RC_timeout)) { if ((inputString->getValue() != oldval) && diff --git a/src/gui/widget/keyboard_input.h b/src/gui/widget/keyboard_input.h index 1003e7f39..7af5c1c17 100644 --- a/src/gui/widget/keyboard_input.h +++ b/src/gui/widget/keyboard_input.h @@ -104,6 +104,8 @@ class CKeyboardInput : public CMenuTarget bool force_saveScreen; fb_pixel_t *pixBuf; + void keyDigiPressed(const neutrino_msg_t key); + virtual void init(); virtual void paint(); From 3e4f1b6f3ce526a3dc643040a5340efb1e93d16b Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 27 Nov 2016 21:11:00 +0100 Subject: [PATCH 153/171] CHintBox/CMsgBox: Add default icon for header (NEUTRINO_ICON_INFO) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1d3a047f6b48bef4d036ea4f04f816d66af03787 Author: Michael Liebmann Date: 2016-11-27 (Sun, 27 Nov 2016) --- src/gui/widget/hintbox.h | 13 +++++++------ src/gui/widget/msgbox.h | 8 ++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index 310aeb8b2..4afacb82a 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -44,6 +44,7 @@ #define TIMEOUT_BAR_HEIGHT OFFSET_SHADOW/2 #define DEFAULT_HINTBOX_TEXT_MODE (CTextBox::CENTER) +#define DEFAULT_HEADER_ICON NEUTRINO_ICON_INFO //! Sub class of CComponentsWindow. Shows a window as a hintbox with text and optional icon beside of text. /*! @@ -92,11 +93,11 @@ class CHintBox : public CComponentsWindow * @param[in] Width * @li optional: exepts type int, defines box width, default value = HINTBOX_MIN_WIDTH * @param[in] Icon - * @li optional: exepts type const char*, defines the icon name on the left side of titlebar, default = NULL (non Icon) + * @li optional: exepts type const char*, defines the icon name on the left side of titlebar, default = DEFAULT_HEADER_ICON * @param[in] Picon * @li optional: exepts type const char*, defines the picon name on the left side of message text, default = NULL (non Icon) * @param[in] header_buttons - * @li optional: exepts type int, defines the icon name on the left side of titlebar, default = 0 (non Icon) + * @li optional: exepts type int, defines the icon name on the right side of titlebar, default = 0 (non Icon) * @see class CComponentsWindow() * @param[in] text_mode * @li optional: exepts type int, defines the text modes for embedded text lines @@ -118,7 +119,7 @@ class CHintBox : public CComponentsWindow CHintBox( const neutrino_locale_t Caption, const char * const Text, const int Width = HINTBOX_MIN_WIDTH, - const char * const Icon = NULL, + const char * const Icon = DEFAULT_HEADER_ICON, const char * const Picon = NULL, const int& header_buttons = 0, const int& text_mode = DEFAULT_HINTBOX_TEXT_MODE, @@ -132,7 +133,7 @@ class CHintBox : public CComponentsWindow CHintBox( const char * const Caption, const char * const Text, const int Width = HINTBOX_MIN_WIDTH, - const char * const Icon = NULL, + const char * const Icon = DEFAULT_HEADER_ICON, const char * const Picon = NULL, const int& header_buttons = 0, const int& text_mode = DEFAULT_HINTBOX_TEXT_MODE, @@ -148,7 +149,7 @@ class CHintBox : public CComponentsWindow CHintBox( const neutrino_locale_t Caption, const neutrino_locale_t Text, const int Width = HINTBOX_MIN_WIDTH, - const char * const Icon = NULL, + const char * const Icon = DEFAULT_HEADER_ICON, const char * const Picon = NULL, const int& header_buttons = 0, const int& text_mode = DEFAULT_HINTBOX_TEXT_MODE, @@ -164,7 +165,7 @@ class CHintBox : public CComponentsWindow CHintBox( const char * const Caption, const neutrino_locale_t Text, const int Width = HINTBOX_MIN_WIDTH, - const char * const Icon = NULL, + const char * const Icon = DEFAULT_HEADER_ICON, const char * const Picon = NULL, const int& header_buttons = 0, const int& text_mode = DEFAULT_HINTBOX_TEXT_MODE, diff --git a/src/gui/widget/msgbox.h b/src/gui/widget/msgbox.h index cd0fd2a44..47abd9a54 100644 --- a/src/gui/widget/msgbox.h +++ b/src/gui/widget/msgbox.h @@ -125,7 +125,7 @@ class CMsgBox : public CHintBox * @param[in] Title * @li optional: exepts type const char*, default = NULL, this causes default title "Information" * @param[in] Icon - * @li optional: exepts type const char*, defines the icon name on the left side of titlebar, default = NULL (non Icon) + * @li optional: exepts type const char*, defines the icon name on the left side of titlebar, default = DEFAULT_HEADER_ICON * @param[in] Picon * @li optional: exepts type const char*, defines the picon name on the left side of message text, default = NULL (non Icon) * @param[in] Width @@ -165,7 +165,7 @@ class CMsgBox : public CHintBox */ CMsgBox(const char* Text, const char* Title = NULL, - const char* Icon = NULL, + const char* Icon = DEFAULT_HEADER_ICON, const char* Picon = NULL, const int& Width = MSGBOX_MIN_WIDTH, const int& Height = MSGBOX_MIN_HEIGHT, @@ -179,7 +179,7 @@ class CMsgBox : public CHintBox * @param[in] Title * @li optional: exepts type neutrino_locale_t with locale entry from /system/locals.h default = NONEXISTANT_LOCALE, this causes default title "Information" * @param[in] Icon - * @li optional: exepts type const char*, defines the icon name on the left side of titlebar, default = NULL (non Icon) + * @li optional: exepts type const char*, defines the icon name on the left side of titlebar, default = DEFAULT_HEADER_ICON * @param[in] Picon * @li optional: exepts type const char*, defines the picon name on the left side of message text, default = NULL (non Icon) * @param[in] Width @@ -219,7 +219,7 @@ class CMsgBox : public CHintBox */ CMsgBox(const char* Text, const neutrino_locale_t locale_Title = NONEXISTANT_LOCALE, - const char* Icon = NULL, + const char* Icon = DEFAULT_HEADER_ICON, const char* Picon = NULL, const int& Width = MSGBOX_MIN_WIDTH, const int& Height = MSGBOX_MIN_HEIGHT, From ef014b21124fb55df60eafaee9ea3019dbd94bdb Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 28 Nov 2016 21:18:00 +0100 Subject: [PATCH 154/171] CComponentsText: revert inheritition of CBox, useage as object It has shown, that the positioning and Dimensions calculations are not correct. CBox object must be embedded with frame properties. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9331c59b0e26a8915237faf816aec673169677a1 Author: Thilo Graf Date: 2016-11-28 (Mon, 28 Nov 2016) --- src/gui/components/cc_item_text.cpp | 83 +++++++++++++++++------------ src/gui/components/cc_item_text.h | 8 ++- 2 files changed, 54 insertions(+), 37 deletions(-) diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp index c851a49fa..bf52a4f33 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -86,10 +86,11 @@ void CComponentsText::initVarText( const int x_pos, const int y_pos, const int w ct_text_mode = mode; ct_text_style = font_style; - iX = x = x_old = x_pos; //TODO: equalize inhertited member names - iY = y = y_old = y_pos; - iWidth = width_old = width = w; - iHeight = height_old = height = h; + fr_thickness = 0; + x = x_old = x_pos; + y = y_old = y_pos; + width = width_old = w; + height = height_old = h; /* we need a minimal borderwith of 1px because the edge-smoothing (or fontrenderer?) otherwise will paint single pixels outside the @@ -103,7 +104,7 @@ void CComponentsText::initVarText( const int x_pos, const int y_pos, const int w col_frame = color_frame; col_body = color_body; col_shadow = color_shadow; - fr_thickness = 0; + ct_text_sent = false; ct_paint_textbg = false; ct_force_text_paint = false; @@ -114,6 +115,27 @@ void CComponentsText::initVarText( const int x_pos, const int y_pos, const int w } +void CComponentsText::initCBox() +{ + x = max(0, x); + y = max(0, y); + + int x_box = x + fr_thickness; + int y_box = y + fr_thickness; + + if (cc_parent){ + ct_box.iX = cc_xr; + ct_box.iY = cc_yr; + }else{ + ct_box.iX = x_box; + ct_box.iY = y_box; + } + + ct_box.iWidth = width - 2*fr_thickness; + ct_box.iHeight = height - 2*fr_thickness; +} + + void CComponentsText::initCCText() { //set default font, if is no font definied @@ -121,41 +143,32 @@ void CComponentsText::initCCText() ct_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]; //define height from font size - height = max(height, ct_font->getHeight()); - - //init CBox dimensions - iWidth = width-2*fr_thickness; - iHeight = height-2*fr_thickness; - - //using of real x/y values to paint textbox if this text object is bound in a parent form - if (cc_parent){ - int th_parent_fr = cc_parent->getFrameThickness(); - iX = cc_xr + (x <= th_parent_fr ? th_parent_fr : 0); - iY = cc_yr - (y <= th_parent_fr ? th_parent_fr : 0); - }else{ - iX = x; - iY = y; - } - iX += fr_thickness; - iY += fr_thickness; + int h_tmp = ct_font->getHeight(); + height = max(height, h_tmp-2*fr_thickness); + if (width == 0) + width = max(width, CTextBox::getMaxLineWidth(ct_text, ct_font)-2*fr_thickness); //init textbox + initCBox(); + if (ct_textbox == NULL) ct_textbox = new CTextBox(); - //set text box properties + //set text properties ct_textbox->setTextFont(ct_font); ct_textbox->setTextMode(ct_text_mode); - ct_textbox->setWindowPos(this); + ct_textbox->setTextColor(ct_col_text); + ct_textbox->enableUTF8(ct_utf8_encoded); + + //set text box properties + ct_textbox->setWindowPos(&ct_box); + ct_textbox->setWindowMaxDimensions(ct_box.iWidth, ct_box.iHeight); + ct_textbox->setWindowMinDimensions(ct_box.iWidth, ct_box.iHeight); ct_textbox->setTextBorderWidth(ct_text_Hborder, ct_text_Vborder); ct_textbox->enableBackgroundPaint(ct_paint_textbg && !cc_txt_save_screen); ct_textbox->setBackGroundColor(col_body); - ct_textbox->setBackGroundRadius(corner_rad-fr_thickness, corner_type); - ct_textbox->setTextColor(ct_col_text); - ct_textbox->setWindowMaxDimensions(iWidth, iHeight); - ct_textbox->setWindowMinDimensions(iWidth, iHeight); + ct_textbox->setBackGroundRadius(0/*(corner_type ? corner_rad-fr_thickness : 0), corner_type*/); ct_textbox->enableSaveScreen(cc_txt_save_screen && !ct_paint_textbg); - ct_textbox->enableUTF8(ct_utf8_encoded); //observe behavior of parent form if available bool force_text_paint = ct_force_text_paint; @@ -169,7 +182,7 @@ void CComponentsText::initCCText() #endif //send text to CTextBox object, but force text paint text if force_text_paint option is enabled //this is managed by CTextBox object itself - ct_text_sent = ct_textbox->setText(&ct_text, this->iWidth, force_text_paint); + ct_text_sent = ct_textbox->setText(&ct_text, ct_box.iWidth, force_text_paint); //set current text status, needed by textChanged() if (ct_text_sent){ @@ -180,7 +193,7 @@ void CComponentsText::initCCText() //ensure clean font rendering on transparency background ct_textbox->setTextRenderModeFullBG(!paint_bg); -// dprintf(DEBUG_NORMAL, "[CComponentsText] [%s - %d] init text: %s [x %d x_old %d, y %d y_old %d, w %d, h %d]\n", __func__, __LINE__, ct_text.c_str(), this->x, x_old, this->y, y_old, this->iWidth, this->iHeight); +// dprintf(DEBUG_NORMAL, "[CComponentsText] [%s - %d] ct_text = %s, x = %d , x_old = %d , y = %d , y_old = %d , \nct_box.iWidth = %d , ct_box.iHeight = %d , width = %d , height = %d, corner_rad = %d\n", __func__, __LINE__, ct_text.c_str(), x, x_old, y, y_old, ct_box.iWidth, ct_box.iHeight, width, height, corner_rad); } void CComponentsText::clearCCText() @@ -287,25 +300,25 @@ void CComponentsText::hide() void CComponentsText::setXPos(const int& xpos) { CCDraw::setXPos(xpos); - iX = x; + initCBox(); } void CComponentsText::setYPos(const int& ypos) { CCDraw::setYPos(ypos); - iY = y; + initCBox(); } void CComponentsText::setHeight(const int& h) { CCDraw::setHeight(h); - iHeight = height; + initCBox(); } void CComponentsText::setWidth(const int& w) { CCDraw::setWidth(w); - iWidth = width; + initCBox(); } //small helper to remove excessiv linbreaks diff --git a/src/gui/components/cc_item_text.h b/src/gui/components/cc_item_text.h index dd26f02ad..7bd5f6372 100644 --- a/src/gui/components/cc_item_text.h +++ b/src/gui/components/cc_item_text.h @@ -40,11 +40,12 @@ Handling of text parts based up CTextBox attributes and methodes. CComponentsText provides a interface to the embedded CTextBox object. */ -class CComponentsText : public CCTextScreen, public CComponentsItem, public CBox +class CComponentsText : public CCTextScreen, public CComponentsItem { protected: ///object: CTextBox object CTextBox * ct_textbox; + CBox ct_box; ///object: Fontrenderer object Font * ct_font; ///property: font style @@ -96,6 +97,9 @@ class CComponentsText : public CCTextScreen, public CComponentsItem, public CBox ///initialize all required attributes for text and send to the CTextBox object void initCCText(); + ///init internal CBox object required by CTextBox object + void initCBox(); + ///paint CCItem backckrond (if paint_bg=true), apply initCCText() and send paint() to the CTextBox object void paintText(bool do_save_bg = CC_SAVE_SCREEN_YES); public: @@ -105,7 +109,7 @@ class CComponentsText : public CCTextScreen, public CComponentsItem, public CBox FONT_STYLE_ITALIC = 2 }; - CComponentsText( const int x_pos = 10, const int y_pos = 10, const int w = 150, const int h = 50, + CComponentsText( const int x_pos = 10, const int y_pos = 10, const int w = 0, const int h = 0, std::string text = "", const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL, From fb0f85365a9cf17a265c4827abb3f52d22e2773d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 27 Nov 2016 16:46:51 +0100 Subject: [PATCH 155/171] CComponentsExtTextForm: rework class overloading class CComponentsExtTextFormLocalized is not required. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/31bfb1b383e657e9914a72560919d9cc5a12264d Author: Thilo Graf Date: 2016-11-27 (Sun, 27 Nov 2016) --- src/gui/components/cc_frm_ext_text.cpp | 54 ++++++++++++++++---------- src/gui/components/cc_frm_ext_text.h | 33 ++++++++-------- src/gui/test_menu.cpp | 2 +- 3 files changed, 51 insertions(+), 38 deletions(-) diff --git a/src/gui/components/cc_frm_ext_text.cpp b/src/gui/components/cc_frm_ext_text.cpp index 81354cc6c..645410ead 100644 --- a/src/gui/components/cc_frm_ext_text.cpp +++ b/src/gui/components/cc_frm_ext_text.cpp @@ -34,6 +34,13 @@ using namespace std; +CComponentsExtTextForm::CComponentsExtTextForm(CComponentsForm* parent) +{ + Font* t_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]; + initVarExtTextForm(0, 0, 300, t_font->getHeight(), "", "", t_font, parent, CC_SHADOW_OFF, COL_MENUCONTENTINACTIVE_TEXT, COL_MENUCONTENT_TEXT, COL_FRAME_PLUS_0, COL_MENUCONTENT_PLUS_0, COL_SHADOW_PLUS_0); + initCCTextItems(); +} + CComponentsExtTextForm::CComponentsExtTextForm( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& label_text, const std::string& text, Font* font_text, @@ -47,20 +54,19 @@ CComponentsExtTextForm::CComponentsExtTextForm( const int& x_pos, const int& y_p initCCTextItems(); } -CComponentsExtTextFormLocalized::CComponentsExtTextFormLocalized(const int& x_pos, const int& y_pos, const int& w, const int& h, - const neutrino_locale_t& locale_label_text, const neutrino_locale_t& locale_text, - Font* font_text, - CComponentsForm* parent, - int shadow_mode, - fb_pixel_t label_color, - fb_pixel_t text_color, - fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) - : CComponentsExtTextForm( x_pos, y_pos, w, h, - g_Locale->getText(locale_label_text), g_Locale->getText(locale_text), - font_text, - parent, - shadow_mode, - label_color, text_color, color_frame, color_body, color_shadow){}; +CComponentsExtTextForm::CComponentsExtTextForm( const int& x_pos, const int& y_pos, const int& w, const int& h, + neutrino_locale_t l_text, const std::string& text, + Font* font_text, + CComponentsForm* parent, + int shadow_mode, + fb_pixel_t label_color, + fb_pixel_t text_color, + fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) +{ + initVarExtTextForm(x_pos, y_pos, w, h, (string)g_Locale->getText(l_text), text, font_text, parent, shadow_mode, label_color, text_color, color_frame, color_body, color_shadow); + initCCTextItems(); +} + void CComponentsExtTextForm::initVarExtTextForm(const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& label_text, const std::string& text, @@ -81,9 +87,13 @@ void CComponentsExtTextForm::initVarExtTextForm(const int& x_pos, const int& y_p ccx_percent_label_w = DEF_LABEL_WIDTH_PERCENT; ccx_label_width = ccx_percent_label_w * width/100; ccx_text_width = width-ccx_label_width; - + height = h; - + if (height == 0) + height = DEF_HEIGHT; + + y_text = 0; + ccx_label_text = label_text; ccx_text = text; shadow = shadow_mode; @@ -95,8 +105,11 @@ void CComponentsExtTextForm::initVarExtTextForm(const int& x_pos, const int& y_p ccx_label_obj = NULL; ccx_text_obj = NULL; corner_type = 0; - int dx = 0, dy = DEF_HEIGHT; - ccx_font = font_text == NULL ? *(CNeutrinoFonts::getInstance()->getDynFont(dx, dy)) : g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]; + ccx_font = font_text; + if (ccx_font == NULL){ + int dx = 0, dy = height; + ccx_font = *(CNeutrinoFonts::getInstance()->getDynFont(dx, dy)); + } ccx_label_align = ccx_text_align = CTextBox::NO_AUTO_LINEBREAK; initParent(parent); @@ -120,9 +133,10 @@ void CComponentsExtTextForm::initLabel() //set properties if (ccx_label_obj){ ccx_label_width = (ccx_percent_label_w * width/100); + y_text = height/2 - height-2*fr_thickness; ccx_label_obj->setText(ccx_label_text, ccx_label_align, ccx_font); ccx_label_obj->setTextColor(ccx_label_color); - ccx_label_obj->setDimensionsAll(0, 0, ccx_label_width-2*fr_thickness, height-2*fr_thickness); + ccx_label_obj->setDimensionsAll(0, y_text, ccx_label_width-2*fr_thickness, height-2*fr_thickness); ccx_label_obj->setCorner(this->corner_rad, CORNER_LEFT); } } @@ -146,7 +160,7 @@ void CComponentsExtTextForm::initText() ccx_text_width = width-ccx_label_obj->getWidth(); ccx_text_obj->setText(ccx_text, ccx_text_align, ccx_font); ccx_text_obj->setTextColor(ccx_text_color); - ccx_text_obj->setDimensionsAll(CC_APPEND, 0, ccx_text_width-2*fr_thickness, height-2*fr_thickness); + ccx_text_obj->setDimensionsAll(ccx_label_obj->getWidth(), y_text, ccx_text_width-2*fr_thickness, height-2*fr_thickness); ccx_text_obj->setCorner(this->corner_rad, CORNER_RIGHT); } } diff --git a/src/gui/components/cc_frm_ext_text.h b/src/gui/components/cc_frm_ext_text.h index aa148599f..837eb8c18 100644 --- a/src/gui/components/cc_frm_ext_text.h +++ b/src/gui/components/cc_frm_ext_text.h @@ -51,6 +51,8 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen Font* ccx_font; ///property: percentage val of label width related to full width, causes fit of text automatically into the available remaining size of item, see also setLabelWidthPercent() uint8_t ccx_percent_label_w; + ///centered y position of label and text + int y_text; ///object: label object CComponentsLabel *ccx_label_obj; @@ -79,7 +81,9 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen public: ///advanced constructor for CComponentsExtTextForm, provides parameters for the most required properties, and caption as string - CComponentsExtTextForm( const int& x_pos = 1, const int& y_pos = 1, const int& w = 300, const int& h = 48, + CComponentsExtTextForm(CComponentsForm* parent = NULL); + + CComponentsExtTextForm( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& label_text = "", const std::string& text = "", Font* font_text = NULL, CComponentsForm *parent = NULL, @@ -89,6 +93,17 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + + CComponentsExtTextForm( const int& x_pos, const int& y_pos, const int& w, const int& h, + neutrino_locale_t l_text = NONEXISTANT_LOCALE, const std::string& text = "", + Font* font_text = NULL, + CComponentsForm *parent = NULL, + int shadow_mode = CC_SHADOW_OFF, + fb_pixel_t label_color = COL_MENUCONTENTINACTIVE_TEXT, + fb_pixel_t text_color = COL_MENUCONTENT_TEXT, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, + fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); // ~CComponentsExtTextForm(); //inherited from CComponentsForm ///assigns texts for label and text, parameter as string, parameter Font is optional for required font type, default font is dependently from defined item height @@ -142,20 +157,4 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); }; -class CComponentsExtTextFormLocalized : public CComponentsExtTextForm -{ - public: - ///advanced constructor for CComponentsExtTextForm, provides parameters for the most required properties, and caption as locales - CComponentsExtTextFormLocalized(const int& x_pos = 1, const int& y_pos = 1, const int& w = 300, const int& h = 48, - const neutrino_locale_t& locale_label_text = NONEXISTANT_LOCALE, const neutrino_locale_t& locale_text = NONEXISTANT_LOCALE, - Font* font_text = NULL, - CComponentsForm *parent = NULL, - int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t label_color = COL_MENUCONTENTINACTIVE_TEXT, - fb_pixel_t text_color = COL_MENUCONTENT_TEXT, - fb_pixel_t color_frame = COL_FRAME_PLUS_0, - fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); -}; - #endif diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index c461a9afe..cd4b5116c 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -559,7 +559,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) else if (actionKey == "text_ext"){ if (text_ext == NULL) text_ext = new CComponentsExtTextForm(); - text_ext->setDimensionsAll(10, 20, 300, 48); + text_ext->setDimensionsAll(10, 20, 300, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()); text_ext->setLabelAndText("Label", "Text for demo", g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]); text_ext->setFrameThickness(2); // text_ext->setLabelWidthPercent(15/*%*/); From 8eeb098e005a02d7a405759d34ec5df650c0897c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 27 Nov 2016 21:11:47 +0100 Subject: [PATCH 156/171] CBuildInfo: add missing default font Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/04be1424a768f8bf005bae2292d9bd40ce5e51c8 Author: Thilo Graf Date: 2016-11-27 (Sun, 27 Nov 2016) --- src/gui/buildinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index 3cc94094a..782edc07e 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -45,7 +45,7 @@ void CBuildInfo::initVarBuildInfo() { setCenterPos(); - font = NULL; + font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]; setWindowHeaderButtons(CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT); InitInfoItems(); From 4dcb5f6e88b4e0f69bd27894c02045f70d9dbbd8 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 27 Nov 2016 21:42:25 +0100 Subject: [PATCH 157/171] CTextBox: use CORNER_NONE as default corner mode CORNER_ALL is not the same like CORNER_NONE. Could cause problems in the evaluation. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8142ed47cc8e42c1e2b316023b81bec673c9d9c9 Author: Thilo Graf Date: 2016-11-27 (Sun, 27 Nov 2016) --- src/gui/widget/textbox.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 41ca9e7dc..c1c17ce60 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -186,7 +186,7 @@ void CTextBox::initVar(void) m_nPaintBackground = true; m_SaveScreen = false; m_nBgRadius = m_old_nBgRadius = 0; - m_nBgRadiusType = m_old_nBgRadiusType = CORNER_ALL; + m_nBgRadiusType = m_old_nBgRadiusType = CORNER_NONE; m_cLineArray.clear(); @@ -292,7 +292,7 @@ void CTextBox::initFramesRel(void) m_cFrameTextRel.iX = 0; m_cFrameTextRel.iY = 0; - m_cFrameTextRel.iHeight = m_cFrame.iHeight ; + m_cFrameTextRel.iHeight = m_cFrame.iHeight ; if(m_nMode & SCROLL) { @@ -583,7 +583,7 @@ void CTextBox::refreshText(void) if( frameBuffer == NULL) return; - //TRACE("[CTextBox] m_nCurrentLine: %d, m_nNrOfLines %d, m_cLineArray[m_nCurrentLine]: %s\r\n",m_nCurrentLine, m_nNrOfLines, m_cLineArray[m_nCurrentLine].c_str()); + //TRACE("[CTextBox] m_nCurrentLine: %d, m_nNrOfLines %d, m_cLineArray[m_nCurrentLine]: %s m_nBgRadius: %d\r\n",m_nCurrentLine, m_nNrOfLines, m_cLineArray[m_nCurrentLine].c_str(), m_nBgRadius, m_nBgRadiusType); //bg variables int ax = m_cFrameTextRel.iX+m_cFrame.iX; @@ -688,7 +688,7 @@ void CTextBox::refreshText(void) y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * lines) >> 1); #ifdef VISUAL_DEBUG - frameBuffer->paintBoxRel(m_cFrame.iX, m_cFrame.iY, m_cFrame.iWidth, m_cFrame.iHeight, COL_GREEN); + frameBuffer->paintBoxRel(m_cFrame.iX, m_cFrame.iY, m_cFrame.iWidth, m_cFrame.iHeight, COL_GREEN, m_nBgRadius, m_nBgRadiusType); #endif for(i = m_nCurrentLine; i < m_nNrOfLines && i < m_nCurrentLine + m_nLinesPerPage; i++) @@ -710,7 +710,7 @@ void CTextBox::refreshText(void) #ifdef VISUAL_DEBUG int th = m_nFontTextHeight; - frameBuffer->paintBoxRel(tx, ty-th, tw, th, COL_RED); + frameBuffer->paintBoxRel(tx, ty-th, tw, th, COL_RED, m_nBgRadius, m_nBgRadiusType); #endif //TRACE("[CTextBox] %s Line %d m_cFrame.iX %d m_cFrameTextRel.iX %d\r\n", __FUNCTION__, __LINE__, m_cFrame.iX, m_cFrameTextRel.iX); m_pcFontText->RenderString(tx, ty, tw, m_cLineArray[i].c_str(), m_textColor, 0, m_renderMode | (m_utf8_encoded) ? Font::IS_UTF8 : 0); From 8f1760195a7abfa592ac5331d0a45ea305a0bad8 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 27 Nov 2016 16:50:41 +0100 Subject: [PATCH 158/171] CImageInfo: remove CC_APPEND Should not be used in the future. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9b039f45bc5ad980b445348452b52e7a10be7ec0 Author: Thilo Graf Date: 2016-11-27 (Sun, 27 Nov 2016) --- src/gui/imageinfo.cpp | 17 ++++++++--------- src/gui/imageinfo.h | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index feda1034f..6f946a3ab 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -72,7 +72,7 @@ void CImageInfo::Init(void) item_offset = 10; item_font = NULL; item_height = 0; - + y_tmp = 0; license_txt = ""; v_info.clear(); config.loadConfig(VERSION_FILE); @@ -351,8 +351,9 @@ void CImageInfo::InitInfos() cc_info->setWidth(cc_win->getWidth() - cc_tv->getWidth() - 2*item_offset); //create label and text items + y_tmp = 0; for (size_t i=0; igetWidth(), 0, g_Locale->getText(v_info[i].caption), v_info[i].info_text); + CComponentsExtTextForm *item = new CComponentsExtTextForm(1, y_tmp, cc_info->getWidth(), 0, g_Locale->getText(v_info[i].caption), v_info[i].info_text); item->setLabelWidthPercent(20); if (!item_font){ @@ -363,16 +364,13 @@ void CImageInfo::InitInfos() item->setHeight(item_height); cc_info->setHeight(v_info.size()*item_height); - if ((i == 0) && (item->getYPos() == CC_APPEND)) - item->setYPos(1); - //add ext-text object to window body if (!item->isAdded()) cc_info->addCCItem(item); //add an offset before homepage and license and at the end if (v_info[i].caption == LOCALE_IMAGEINFO_CREATOR || v_info[i].caption == LOCALE_IMAGEINFO_FORUM){ - CComponentsShapeSquare *spacer = new CComponentsShapeSquare(1, CC_APPEND, 1, item_offset); + CComponentsShapeSquare *spacer = new CComponentsShapeSquare(1, y_tmp+=item_offset, 1, item_offset); //spacer ist not visible! spacer->allowPaint(false); cc_info->addCCItem(spacer); @@ -380,6 +378,7 @@ void CImageInfo::InitInfos() int tmp_h = cc_info->getHeight(); cc_info->setHeight(tmp_h + item_offset); } + y_tmp += item->getHeight(); } } @@ -414,7 +413,7 @@ void CImageInfo::InitInfoText(const std::string& text) Font * caption_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]; int caption_height = caption_font->getHeight(); if (cc_sub_caption == NULL) - cc_sub_caption = new CComponentsLabel(cc_info->getXPos(), CC_APPEND, cc_info->getWidth(), caption_height, + cc_sub_caption = new CComponentsLabel(cc_info->getXPos(), y_tmp, cc_info->getWidth(), caption_height, g_Locale->getText(LOCALE_IMAGEINFO_LICENSE), CTextBox::AUTO_WIDTH, item_font); if (!cc_sub_caption->isAdded()) cc_win->addWindowItem(cc_sub_caption); @@ -423,9 +422,9 @@ void CImageInfo::InitInfoText(const std::string& text) int h_txt = h_body - item_offset - cc_info->getHeight() - cc_sub_caption->getHeight() - item_offset; if (cc_lic == NULL) - cc_lic = new CComponentsInfoBox(CC_CENTERED, CC_APPEND, w_body-2*item_offset, h_txt); + cc_lic = new CComponentsInfoBox(CC_CENTERED, y_tmp+=cc_sub_caption->getHeight(), w_body-2*item_offset, h_txt); cc_lic->setSpaceOffset(1); - cc_lic->setText(text, CTextBox::TOP | CTextBox::AUTO_WIDTH | CTextBox::SCROLL, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]); + cc_lic->setText(text, CTextBox::TOP | CTextBox::AUTO_WIDTH | CTextBox::SCROLL, item_font); cc_lic->doPaintTextBoxBg(true); //add text to container diff --git a/src/gui/imageinfo.h b/src/gui/imageinfo.h index a243866b4..9d6e399f8 100644 --- a/src/gui/imageinfo.h +++ b/src/gui/imageinfo.h @@ -50,7 +50,7 @@ class CImageInfo : public CMenuTarget std::string license_txt; Font* item_font; int item_height; - + int y_tmp; std::vector v_info; void Clean(); From b2e71497d8c7414887b9d7c41b6321991e258f9f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 27 Nov 2016 14:29:50 +0100 Subject: [PATCH 159/171] CComponentsFooter: disable gradient for footers This is not really completly implemented for footer at the momemnt, because button objects are still not prepared or tuned for that. If it is enabled, currently it could occur unintentionally background behavior eg.: flickereffects or background display errors in button objects. NOTE: anyway users can enable gradient in theme files and could override this setting. Now here it is globally disabled for footers. If it works right, it will be enabled in future. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/427b65813d9f0df6b05b18407ae70ca966ddd482 Author: Thilo Graf Date: 2016-11-27 (Sun, 27 Nov 2016) Origin message was: ------------------ CComponentsFooter: disable gradient for footers This is not really completly implemented for footer at the momemnt, because button objects are still not prepared or tuned for that. If it is enabled, currently it could occur unintentionally background behavior eg.: flickereffects or background display errors in button objects. NOTE: anyway users can enable gradient in theme files and could override this setting. Now here it is globally disabled for footers. If it works right, it will be enabled in future. --- src/gui/components/cc_frm_footer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 4a1cbfc4e..df899c306 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -79,7 +79,7 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const col_frame = color_frame; col_body = color_body; col_shadow = color_shadow; - cc_body_gradient_enable = cc_body_gradient_enable_old = g_settings.theme.menu_ButtonBar_gradient; //TODO: not complete implemented at the moment + cc_body_gradient_enable = cc_body_gradient_enable_old = CC_COLGRAD_OFF/*g_settings.theme.menu_ButtonBar_gradient*/; //TODO: not complete implemented at the moment cc_body_gradient_direction = CFrameBuffer::gradientVertical; cc_body_gradient_mode = CColorGradient::gradientDark2Light; btn_auto_frame_col = false; From b79c87dcfed7f43c35f987538586c8cc374ead49 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 29 Nov 2016 16:13:47 +0100 Subject: [PATCH 160/171] CComponentsFooter: fix wrong text color with single button in footers * remove size compare If only one button exists, possible new text color would be ignored and wrong Text color was visible with one item. This behavior was observed in message boxes with single buttons (eg OK, or Cancel). Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8bf6b7fb3a5203d734ebabbb79dd19b59736322f Author: Thilo Graf Date: 2016-11-29 (Tue, 29 Nov 2016) --- src/gui/components/cc_frm_footer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index df899c306..9874a122b 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -362,8 +362,7 @@ void CComponentsFooter::setSelectedButton(size_t item_id, sel_col = sel_fr_col; //TODO: make it configurable chain->setSelectedItem(item_id, sel_col, fr_col, sel_bg_col, bg_col, frame_width, sel_frame_width); - if (chain->size() > 1) - getSelectedButtonObject()->setButtonTextColor(sel_text_col); + getSelectedButtonObject()->setButtonTextColor(sel_text_col); } } From e8d7f2503c8d40e247165d3a49879707692d3479 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 29 Nov 2016 16:31:44 +0100 Subject: [PATCH 161/171] CMsgBox: reduce flicker effects with single button Disabled refresh avoids unnecessary repaints with possible flicker effects on pressed navi keys. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d632d6658163365a9ce0f6e1047b9171f03005d7 Author: Thilo Graf Date: 2016-11-29 (Tue, 29 Nov 2016) --- src/gui/widget/msgbox.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index e2edcdeed..51480afa1 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -288,15 +288,19 @@ int CMsgBox::exec() mb_show_button = ccw_footer->getSelectedButtonObject()->getButtonAlias(); } selected = ccw_footer->getSelectedButton(); - refreshFoot(); - //refresh timeout on any pressed navi key! This resets current timeout end to the initial value + //***refresh buttons only if we have more than one button, this avoids unnecessary repaints with possible flicker effects*** + if (ccw_footer->getButtonChainObject()->size()>1) + refreshFoot(); + + //***refresh timeout on any pressed navi key! This resets current timeout end to initial value*** if (timeout > 0){ timeout_pb->setValues(0, timeout); timeoutEnd = CRCInput::calcTimeoutEnd(timeout); } dprintf(DEBUG_INFO, "\033[32m[CMsgBox] [%s - %d] result = %d, mb_show_button = %d\033[0m\n", __func__, __LINE__, result, mb_show_button); } + //***action buttons without preselection*** for (size_t i = 0; i< ccw_footer->getButtonChainObject()->size(); i++){ CComponentsButton* btn_action = static_cast(ccw_footer->getButtonChainObject()->getCCItem(i)); From f9f7c4f11b46938366147ed8a552fd656d1bc18a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 30 Nov 2016 09:17:04 +0100 Subject: [PATCH 162/171] bouqueteditor: fix icon alignment Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8c2301472bbf08463390d843b6e484bc77bb7308 Author: vanhofen Date: 2016-11-30 (Wed, 30 Nov 2016) Origin message was: ------------------ - bouqueteditor: fix icon alignment --- src/gui/bedit/bouqueteditor_bouquets.cpp | 32 ++++++++++++++-------- src/gui/bedit/bouqueteditor_channels.cpp | 10 +++---- src/gui/bedit/bouqueteditor_chanselect.cpp | 10 +++---- 3 files changed, 31 insertions(+), 21 deletions(-) diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index f09ad4a66..9c7017a46 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -97,22 +97,22 @@ void CBEBouquetWidget::paintItem(int pos) if (current < Bouquets->size()) { if ((i_selected) && (state == beMoving)) - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + 5, ypos, iheight); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + OFFSET_INNER_MID, ypos, iheight); if ((*Bouquets)[current]->bHidden) - frameBuffer->paintIcon(NEUTRINO_ICON_HIDDEN, x + 26, ypos, iheight); + frameBuffer->paintIcon(NEUTRINO_ICON_HIDDEN, x + OFFSET_INNER_MID + iconoffset, ypos, iheight); if ((*Bouquets)[current]->bLocked != g_settings.parentallock_defaultlocked) - frameBuffer->paintIcon(NEUTRINO_ICON_LOCK, x + 18 + iconoffset, ypos, iheight); + frameBuffer->paintIcon(NEUTRINO_ICON_LOCK, x + OFFSET_INNER_MID + 2*iconoffset, ypos, iheight); if (!(*Bouquets)[current]->tvChannels.empty() ) { - frameBuffer->paintIcon(NEUTRINO_ICON_VIDEO, x + 20 + 2*iconoffset - 2, ypos, iheight); + frameBuffer->paintIcon(NEUTRINO_ICON_VIDEO, x + OFFSET_INNER_MID + 3*iconoffset, ypos, iheight); } if (!(*Bouquets)[current]->radioChannels.empty()) { - frameBuffer->paintIcon(NEUTRINO_ICON_AUDIO, x + 20+ 3*iconoffset - 4, ypos, iheight); + frameBuffer->paintIcon(NEUTRINO_ICON_AUDIO, x + OFFSET_INNER_MID + 4*iconoffset, ypos, iheight); } - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x +20 + 4*iconoffset, ypos + iheight - (iheight-fheight)/2, width-iconoffset-20, (*Bouquets)[current]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : (*Bouquets)[current]->Name, color); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + 2*OFFSET_INNER_MID + 5*iconoffset, ypos + iheight - (iheight-fheight)/2, width - 3*OFFSET_INNER_MID - 5*iconoffset, (*Bouquets)[current]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : (*Bouquets)[current]->Name, color); } } @@ -203,21 +203,31 @@ int CBEBouquetWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* int icol_w, icol_h; frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_YELLOW, &icol_w, &icol_h); - iheight = std::max(fheight, icol_h+2); + iheight = std::max(fheight, icol_h + OFFSET_INNER_MIN); iconoffset = std::max(iconoffset, icol_w); frameBuffer->getIconSize(NEUTRINO_ICON_LOCK, &icol_w, &icol_h); - iheight = std::max(iheight, icol_h+2); + iheight = std::max(fheight, icol_h + OFFSET_INNER_MIN); iconoffset = std::max(iconoffset, icol_w); frameBuffer->getIconSize(NEUTRINO_ICON_HIDDEN, &icol_w, &icol_h); - iheight = std::max(iheight, icol_h+2); + iheight = std::max(fheight, icol_h + OFFSET_INNER_MIN); + iconoffset = std::max(iconoffset, icol_w); + + frameBuffer->getIconSize(NEUTRINO_ICON_VIDEO, &icol_w, &icol_h); + iheight = std::max(fheight, icol_h + OFFSET_INNER_MIN); + iconoffset = std::max(iconoffset, icol_w); + + frameBuffer->getIconSize(NEUTRINO_ICON_AUDIO, &icol_w, &icol_h); + iheight = std::max(fheight, icol_h + OFFSET_INNER_MIN); iconoffset = std::max(iconoffset, icol_w); width = frameBuffer->getScreenWidthRel(); height = frameBuffer->getScreenHeightRel() - ButtonHeight; - listmaxshow = (height-theight-0)/iheight; - height = theight+0+listmaxshow*iheight; // recalc height + + listmaxshow = (height-theight)/iheight; + height = theight+listmaxshow*iheight; // recalc height + x = getScreenStartX(width); y = getScreenStartY(height + ButtonHeight); diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 38310c319..03f3776d8 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -125,19 +125,19 @@ void CBEChannelWidget::paintItem(int pos) frameBuffer->paintBoxRel(x, ypos, width- 15, iheight, bgcolor, i_radius); if ((current == selected) && (state == beMoving)) { - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + 5, ypos, iheight); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + OFFSET_INNER_MID, ypos, iheight); } if (current < Channels->size()) { if ((*Channels)[current]->bLocked) { - frameBuffer->paintIcon(NEUTRINO_ICON_LOCK, x + 22, ypos, iheight); + frameBuffer->paintIcon(NEUTRINO_ICON_LOCK, x + OFFSET_INNER_MID + iconoffset, ypos, iheight); } //g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10, ypos+ fheight, width- numwidth- 20- 15, (*Channels)[current]->getName(), color); //FIXME numwidth ? we not show chan numbers - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 22 + iconoffset, ypos + iheight - (iheight-fheight)/2, width- iconoffset- 20, (*Channels)[current]->getName(), color); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + 2*OFFSET_INNER_MID + 2*iconoffset, ypos + iheight - (iheight-fheight)/2, width - 3*OFFSET_INNER_MID - 2*iconoffset, (*Channels)[current]->getName(), color); if((*Channels)[current]->scrambled) - frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, x+width- 15 - 28, ypos, fheight); + frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, x + width - 15 - OFFSET_INNER_MID - iconoffset, ypos, fheight); else if (!(*Channels)[current]->getUrl().empty()) - frameBuffer->paintIcon(NEUTRINO_ICON_STREAMING, x+width- 15 - 28, ypos, fheight); + frameBuffer->paintIcon(NEUTRINO_ICON_STREAMING, x + width - 15 - OFFSET_INNER_MID - iconoffset, ypos, fheight); } } diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index 79896b0b1..c60372450 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -135,15 +135,15 @@ void CBEChannelSelectWidget::paintItem(uint32_t itemNr, int paintNr, bool pselec if(itemNr < getItemCount()) { if( isChannelInBouquet(itemNr)) - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, x+10, ypos, iheight); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, x + OFFSET_INNER_MID, ypos, iheight); else - frameBuffer->paintBoxRel(x+10, ypos, iconoffset, iheight, bgcolor); + frameBuffer->paintBoxRel(x + OFFSET_INNER_MID, ypos, iconoffset, iheight, bgcolor); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + 20 + iconoffset, ypos + iheight - (iheight-fheight)/2, width - 20 - iconoffset, Channels[itemNr]->getName(), color); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + 2*OFFSET_INNER_MID + 2*iconoffset, ypos + iheight - (iheight-fheight)/2, width - 3*OFFSET_INNER_MID - 2*iconoffset, Channels[itemNr]->getName(), color); if(Channels[itemNr]->scrambled) - frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, x+width- 15 - 28, ypos, fheight); + frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, x + width - 15 - OFFSET_INNER_MID - iconoffset, ypos, fheight); else if (!Channels[itemNr]->getUrl().empty()) - frameBuffer->paintIcon(NEUTRINO_ICON_STREAMING, x+width- 15 - 28, ypos, fheight); + frameBuffer->paintIcon(NEUTRINO_ICON_STREAMING, x + width - 15 - OFFSET_INNER_MID - iconoffset, ypos, fheight); } } From b15bec5dd60ff707bb2f235202ff515d1cc5538b Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 1 Dec 2016 14:26:39 +0100 Subject: [PATCH 163/171] lua: Fix InfoFunc for displaying information in the movieplayer - Fix for commit 38488e642c7a99e354c2b013af6b953a77516625 - Set Lua api version to 1.66 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1aee964c14809a4008e5ad8ed8f26c984ec2e580 Author: Michael Liebmann Date: 2016-12-01 (Thu, 01 Dec 2016) --- src/gui/lua/lua_api_version.h | 2 +- src/gui/movieplayer.cpp | 54 +++++++++++++++++++++-------------- 2 files changed, 34 insertions(+), 22 deletions(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 9c36a6594..8e72db293 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 65 +#define LUA_API_VERSION_MINOR 66 diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index c16c21031..3680a5573 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1524,13 +1524,38 @@ void CMoviePlayerGui::PlayFileLoop(void) SetPosition(1000 * (hh * 3600 + mm * 60 + ss), true); } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { - if (fromInfoviewer) - { - g_EpgData->show_mp(p_movie_info,GetPosition(),GetDuration()); - fromInfoviewer = false; +#ifdef ENABLE_LUA + if (isLuaPlay && haveLuaInfoFunc) { + CTimeOSD::mode m_mode = FileTime.getMode(); + bool restore = FileTime.IsVisible(); + if (restore) + FileTime.kill(); + CInfoClock::getInstance()->enableInfoClock(false); + + int xres = 0, yres = 0, aspectRatio = 0, framerate = -1; + if (!videoDecoder->getBlank()) { + videoDecoder->getPictureInfo(xres, yres, framerate); + if (yres == 1088) + yres = 1080; + aspectRatio = videoDecoder->getAspectRatio(); + } + CLuaInstVideo::getInstance()->execLuaInfoFunc(luaState, xres, yres, aspectRatio, framerate); + + CInfoClock::getInstance()->enableInfoClock(true); + if (restore) { + FileTime.setMode(m_mode); + FileTime.update(position, duration); + } + + } else { +#endif + if (fromInfoviewer) { + g_EpgData->show_mp(p_movie_info,GetPosition(),GetDuration()); + fromInfoviewer = false; + } + else + callInfoViewer(); } - else - callInfoViewer(); update_lcd = true; clearSubtitle(); } else if (timeshift != TSHIFT_MODE_OFF && (msg == CRCInput::RC_text || msg == CRCInput::RC_epg || msg == NeutrinoMessages::SHOW_EPG)) { @@ -2139,27 +2164,14 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/) cMovieInfo.saveMovieInfo(*p_movie_info); /* save immediately in xml file */ } } - } else if (msg == NeutrinoMessages::SHOW_EPG && (p_movie_info || (isLuaPlay && haveLuaInfoFunc))) { + } else if (msg == NeutrinoMessages::SHOW_EPG && p_movie_info) { CTimeOSD::mode m_mode = FileTime.getMode(); bool restore = FileTime.IsVisible(); if (restore) FileTime.kill(); CInfoClock::getInstance()->enableInfoClock(false); - if (isLuaPlay && haveLuaInfoFunc) { - int xres = 0, yres = 0, aspectRatio = 0, framerate = -1; - if (!videoDecoder->getBlank()) { - videoDecoder->getPictureInfo(xres, yres, framerate); - if (yres == 1088) - yres = 1080; - aspectRatio = videoDecoder->getAspectRatio(); - } -#ifdef ENABLE_LUA - CLuaInstVideo::getInstance()->execLuaInfoFunc(luaState, xres, yres, aspectRatio, framerate); -#endif - } - else if (p_movie_info) - g_EpgData->show_mp(p_movie_info, position, duration); + g_EpgData->show_mp(p_movie_info, position, duration); CInfoClock::getInstance()->enableInfoClock(true); if (restore) { From 23583e07e402bd61c842a6523f29bc3b4e35a170 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 1 Dec 2016 18:21:47 +0100 Subject: [PATCH 164/171] CLuaInstCCText: Add various script functions getLines() getLines(test) setDimensionsAll(x, y, w, h) - Set Lua api version to 1.67 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/15766815439862c17a81ef158d473fc5040ae682 Author: Michael Liebmann Date: 2016-12-01 (Thu, 01 Dec 2016) --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_cc_text.cpp | 60 ++++++++++++++++++++++++++++++----- src/gui/lua/lua_cc_text.h | 2 ++ 3 files changed, 55 insertions(+), 9 deletions(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 8e72db293..28aa21d52 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 66 +#define LUA_API_VERSION_MINOR 67 diff --git a/src/gui/lua/lua_cc_text.cpp b/src/gui/lua/lua_cc_text.cpp index 7e1ea5d36..461164e1a 100644 --- a/src/gui/lua/lua_cc_text.cpp +++ b/src/gui/lua/lua_cc_text.cpp @@ -54,14 +54,16 @@ CLuaCCText *CLuaInstCCText::CCTextCheck(lua_State *L, int n) void CLuaInstCCText::CCTextRegister(lua_State *L) { luaL_Reg meth[] = { - { "new", CLuaInstCCText::CCTextNew }, - { "paint", CLuaInstCCText::CCTextPaint }, - { "hide", CLuaInstCCText::CCTextHide }, - { "setText", CLuaInstCCText::CCTextSetText }, - { "scroll", CLuaInstCCText::CCTextScroll }, - { "setCenterPos", CLuaInstCCText::CCTextSetCenterPos }, - { "enableUTF8", CLuaInstCCText::CCTextEnableUTF8 }, - { "__gc", CLuaInstCCText::CCTextDelete }, + { "new", CLuaInstCCText::CCTextNew }, + { "paint", CLuaInstCCText::CCTextPaint }, + { "hide", CLuaInstCCText::CCTextHide }, + { "setText", CLuaInstCCText::CCTextSetText }, + { "getLines", CLuaInstCCText::CCTextGetLines }, + { "scroll", CLuaInstCCText::CCTextScroll }, + { "setCenterPos", CLuaInstCCText::CCTextSetCenterPos }, + { "enableUTF8", CLuaInstCCText::CCTextEnableUTF8 }, + { "setDimensionsAll", CLuaInstCCText::CCTextSetDimensionsAll }, + { "__gc", CLuaInstCCText::CCTextDelete }, { NULL, NULL } }; @@ -214,6 +216,26 @@ int CLuaInstCCText::CCTextSetText(lua_State *L) return 0; } +int CLuaInstCCText::CCTextGetLines(lua_State *L) +{ + CLuaCCText *D = CCTextCheck(L, 1); + if (!D) return 0; + + lua_Integer lines = 0; + if (lua_gettop(L) == 2) { + const char* Text = luaL_checkstring(L, 2); + lines = (lua_Integer)CTextBox::getLines(Text); + } + else { + CTextBox* ctb = D->ct->getCTextBoxObject(); + if (ctb) + lines = (lua_Integer)ctb->getLines(); + } + + lua_pushinteger(L, lines); + return 1; +} + int CLuaInstCCText::CCTextScroll(lua_State *L) { lua_assert(lua_istable(L,1)); @@ -273,6 +295,28 @@ int CLuaInstCCText::CCTextEnableUTF8(lua_State *L) return 0; } +int CLuaInstCCText::CCTextSetDimensionsAll(lua_State *L) +{ + CLuaCCText *D = CCTextCheck(L, 1); + if (!D) return 0; + lua_Integer x = luaL_checkint(L, 2); + lua_Integer y = luaL_checkint(L, 3); + lua_Integer w = luaL_checkint(L, 4); + lua_Integer h = luaL_checkint(L, 5); + if(x>-1 && y > -1 && w > 1 && h > 1){ + if (h > (lua_Integer)CFrameBuffer::getInstance()->getScreenHeight()) + h = (lua_Integer)CFrameBuffer::getInstance()->getScreenHeight(); + if (w > (lua_Integer)CFrameBuffer::getInstance()->getScreenWidth()) + w = (lua_Integer)CFrameBuffer::getInstance()->getScreenWidth(); + if(x > w) + x = 0; + if(y > h) + y = 0; + D->ct->setDimensionsAll(x,y,w,h); + } + return 0; +} + int CLuaInstCCText::CCTextDelete(lua_State *L) { LUA_DEBUG("CLuaInstCCText::%s %d\n", __func__, lua_gettop(L)); diff --git a/src/gui/lua/lua_cc_text.h b/src/gui/lua/lua_cc_text.h index 67728e533..c0f31d639 100644 --- a/src/gui/lua/lua_cc_text.h +++ b/src/gui/lua/lua_cc_text.h @@ -47,9 +47,11 @@ class CLuaInstCCText static int CCTextPaint(lua_State *L); static int CCTextHide(lua_State *L); static int CCTextSetText(lua_State *L); + static int CCTextGetLines(lua_State *L); static int CCTextScroll(lua_State *L); static int CCTextSetCenterPos(lua_State *L); static int CCTextEnableUTF8(lua_State *L); + static int CCTextSetDimensionsAll(lua_State *L); static int CCTextDelete(lua_State *L); }; From 7fc8a13b2ff715c6824ff110eb2aedc8460c9676 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 1 Dec 2016 22:32:35 +0100 Subject: [PATCH 165/171] CComponentsWindow: fix window body color Color parameter was not passed to body. Parameters in constructor and setters had no effect. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c1ec746321dfccfdb81eae0191f248e4768f293f Author: Thilo Graf Date: 2016-12-01 (Thu, 01 Dec 2016) --- src/gui/components/cc_frm_window.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index a7c84cba3..451d74be3 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -297,6 +297,7 @@ void CComponentsWindow::initBody() ccw_body->setDimensionsAll(x_body, h_header, w_body, h_body); ccw_body->doPaintBg(true); + ccw_body->setColorBody(col_body); //handle corner behavior if (!ccw_show_header) From feac1111eeab0b3d917d65cd0ccc5b361c400226 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 2 Dec 2016 00:15:57 +0100 Subject: [PATCH 166/171] CLuaInstVideo::PlayFile: Infoviewer was not displayed when InfoFunc was set - Fix commit b15bec5dd60ff707bb2f235202ff515d1cc5538b - Set Lua api version to 1.68 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e92df63a4ab2dfa9e90a7729a39cfeab70bfc462 Author: Michael Liebmann Date: 2016-12-02 (Fri, 02 Dec 2016) --- src/gui/lua/lua_api_version.h | 2 +- src/gui/movieplayer.cpp | 51 ++++++++++++++++++----------------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 28aa21d52..54fa105fa 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 67 +#define LUA_API_VERSION_MINOR 68 diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 3680a5573..e6c5b24c4 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1524,38 +1524,41 @@ void CMoviePlayerGui::PlayFileLoop(void) SetPosition(1000 * (hh * 3600 + mm * 60 + ss), true); } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { + if (fromInfoviewer) { #ifdef ENABLE_LUA - if (isLuaPlay && haveLuaInfoFunc) { - CTimeOSD::mode m_mode = FileTime.getMode(); - bool restore = FileTime.IsVisible(); - if (restore) - FileTime.kill(); - CInfoClock::getInstance()->enableInfoClock(false); + if (isLuaPlay && haveLuaInfoFunc) { + CTimeOSD::mode m_mode = FileTime.getMode(); + bool restore = FileTime.IsVisible(); + if (restore) + FileTime.kill(); + CInfoClock::getInstance()->enableInfoClock(false); - int xres = 0, yres = 0, aspectRatio = 0, framerate = -1; - if (!videoDecoder->getBlank()) { - videoDecoder->getPictureInfo(xres, yres, framerate); - if (yres == 1088) - yres = 1080; - aspectRatio = videoDecoder->getAspectRatio(); + int xres = 0, yres = 0, aspectRatio = 0, framerate = -1; + if (!videoDecoder->getBlank()) { + videoDecoder->getPictureInfo(xres, yres, framerate); + if (yres == 1088) + yres = 1080; + aspectRatio = videoDecoder->getAspectRatio(); + } + CLuaInstVideo::getInstance()->execLuaInfoFunc(luaState, xres, yres, aspectRatio, framerate); + fromInfoviewer = false; + + CInfoClock::getInstance()->enableInfoClock(true); + if (restore) { + FileTime.setMode(m_mode); + FileTime.update(position, duration); + } } - CLuaInstVideo::getInstance()->execLuaInfoFunc(luaState, xres, yres, aspectRatio, framerate); - - CInfoClock::getInstance()->enableInfoClock(true); - if (restore) { - FileTime.setMode(m_mode); - FileTime.update(position, duration); - } - - } else { + else { #endif - if (fromInfoviewer) { g_EpgData->show_mp(p_movie_info,GetPosition(),GetDuration()); fromInfoviewer = false; +#ifdef ENABLE_LUA } - else - callInfoViewer(); +#endif } + else + callInfoViewer(); update_lcd = true; clearSubtitle(); } else if (timeshift != TSHIFT_MODE_OFF && (msg == CRCInput::RC_text || msg == CRCInput::RC_epg || msg == NeutrinoMessages::SHOW_EPG)) { From 2bb2b1c977518b67536b686f1fca259f13d5fda7 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 2 Dec 2016 00:16:05 +0100 Subject: [PATCH 167/171] MoviePlayer: Disable InfoClock and FileTime when view movieinfo Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/47ffc7586a41fdcfaee31006cb9fc01757c7bb25 Author: Michael Liebmann Date: 2016-12-02 (Fri, 02 Dec 2016) --- src/gui/movieplayer.cpp | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index e6c5b24c4..a09f6dfe3 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1525,14 +1525,13 @@ void CMoviePlayerGui::PlayFileLoop(void) } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { if (fromInfoviewer) { + CTimeOSD::mode m_mode = FileTime.getMode(); + bool restore = FileTime.IsVisible(); + if (restore) + FileTime.kill(); + CInfoClock::getInstance()->enableInfoClock(false); #ifdef ENABLE_LUA if (isLuaPlay && haveLuaInfoFunc) { - CTimeOSD::mode m_mode = FileTime.getMode(); - bool restore = FileTime.IsVisible(); - if (restore) - FileTime.kill(); - CInfoClock::getInstance()->enableInfoClock(false); - int xres = 0, yres = 0, aspectRatio = 0, framerate = -1; if (!videoDecoder->getBlank()) { videoDecoder->getPictureInfo(xres, yres, framerate); @@ -1541,21 +1540,19 @@ void CMoviePlayerGui::PlayFileLoop(void) aspectRatio = videoDecoder->getAspectRatio(); } CLuaInstVideo::getInstance()->execLuaInfoFunc(luaState, xres, yres, aspectRatio, framerate); - fromInfoviewer = false; - - CInfoClock::getInstance()->enableInfoClock(true); - if (restore) { - FileTime.setMode(m_mode); - FileTime.update(position, duration); - } } else { #endif g_EpgData->show_mp(p_movie_info,GetPosition(),GetDuration()); - fromInfoviewer = false; #ifdef ENABLE_LUA } #endif + fromInfoviewer = false; + CInfoClock::getInstance()->enableInfoClock(true); + if (restore) { + FileTime.setMode(m_mode); + FileTime.update(position, duration); + } } else callInfoViewer(); From f03e2a20ae6f2f3055d8c40bf2550ffd3c437efb Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 1 Dec 2016 22:04:40 +0100 Subject: [PATCH 168/171] Message Timeouts: add possibilty to change timeout for static messages Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9607957e07974b64423b9e3fb6c87266723d0c83 Author: vanhofen Date: 2016-12-01 (Thu, 01 Dec 2016) --- src/gui/widget/msgbox.cpp | 2 +- src/gui/widget/msgbox.h | 1 + src/system/locals.h | 1 + src/system/locals_intern.h | 1 + src/system/settings.h | 4 +++- 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 51480afa1..151a0cc73 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -238,7 +238,7 @@ int CMsgBox::exec() ccw_footer->getSelectedButtonObject()->setButtonAlias(mb_show_button); int selected = ccw_footer->getSelectedButton(); if (timeout == NO_TIMEOUT) - timeout = 0; + timeout = MSGBOX_DEFAULT_TIMEOUT; uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(timeout); diff --git a/src/gui/widget/msgbox.h b/src/gui/widget/msgbox.h index 47abd9a54..5c81dfb33 100644 --- a/src/gui/widget/msgbox.h +++ b/src/gui/widget/msgbox.h @@ -38,6 +38,7 @@ #define MSGBOX_MIN_WIDTH HINTBOX_MIN_WIDTH #define MSGBOX_MIN_HEIGHT HINTBOX_MIN_HEIGHT + 75 +#define MSGBOX_DEFAULT_TIMEOUT g_settings.timing[SNeutrinoSettings::TIMING_STATIC_MESSAGES] #define DEFAULT_MSGBOX_TEXT_MODE (CMsgBox::CENTER | CMsgBox::AUTO_WIDTH | CMsgBox::AUTO_HIGH) //! Sub class of CHintBox. Shows a window as a messagebox diff --git a/src/system/locals.h b/src/system/locals.h index 5621aa1e5..d638c71c3 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2434,6 +2434,7 @@ typedef enum LOCALE_TIMING_MENU, LOCALE_TIMING_NUMERICZAP, LOCALE_TIMING_POPUP_MESSAGES, + LOCALE_TIMING_STATIC_MESSAGES, LOCALE_TIMING_VOLUMEBAR, LOCALE_TMDB_API_KEY, LOCALE_TMDB_ENABLED, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 875066c28..ef44b6316 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2434,6 +2434,7 @@ const char * locale_real_names[] = "timing.menu", "timing.numericzap", "timing.popup_messages", + "timing.static_messages", "timing.volumebar", "tmdb.api_key", "tmdb.enabled", diff --git a/src/system/settings.h b/src/system/settings.h index fbb47ee6e..488bf97a2 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -406,6 +406,7 @@ struct SNeutrinoSettings TIMING_FILEBROWSER = 7, TIMING_NUMERICZAP = 8, TIMING_POPUP_MESSAGES = 9, + TIMING_STATIC_MESSAGES = 10, TIMING_SETTING_COUNT }; @@ -875,7 +876,8 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO { 3, LOCALE_TIMING_VOLUMEBAR }, { 60, LOCALE_TIMING_FILEBROWSER }, { 3, LOCALE_TIMING_NUMERICZAP }, - { 6, LOCALE_TIMING_POPUP_MESSAGES} + { 6, LOCALE_TIMING_POPUP_MESSAGES}, + { 0, LOCALE_TIMING_STATIC_MESSAGES} }; // lcdd From da753e0b802d050b3fabe1fe167dd35bd040b266 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 2 Dec 2016 21:31:04 +0100 Subject: [PATCH 169/171] Messages: add localized osd timeout option for interactive/static messages TODO: add locales for hints Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d6ecaf855b97468e20fe31681b261b0f23798c1a Author: Thilo Graf Date: 2016-12-02 (Fri, 02 Dec 2016) --- data/locale/deutsch.locale | 4 +++- data/locale/english.locale | 2 ++ data/locale/nederlands.locale | 3 +++ data/locale/slovak.locale | 3 +++ src/gui/osd_setup.cpp | 2 +- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + src/system/settings.h | 23 ++++++++++++----------- 8 files changed, 26 insertions(+), 13 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index fe07f8f8d..31f290f1b 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1433,7 +1433,8 @@ menu.hint_streaminfo Aktuelle Sender-Informationen über PIDs, SNR-Verhältnis, menu.hint_subchannel_pos Wählen Sie die Anzeigeposition der Unterkanäle aus menu.hint_sw_update System aktualisieren, Image sichern und wiederherstellen menu.hint_theme Wählen Sie ein vordefiniertes Farbschema, speichern oder laden Sie ihre eigenen Farbschemata -menu.hint_timeouts Gibt an, nach welcher Zeit in Sekunden die Menüs oder Infofenster sich automatisch schließen (0 deaktiviert) +menu.hint_timeouts Anzeigedauer für Menüs oder Infofenster, die sich automatisch schließen (0 deaktiviert) +menu.hint_timeouts_static_messages Anzeigedauer für bestimmte Meldungen mit Benutzerinteraktion menu.hint_timer_followscreenings Zeige Terminauswahl mit Folge-Events zur Timerprogrammierung menu.hint_timers Hinzufügen, entfernen und bearbeiten geplanter Aufnahmen oder anderer Timer menu.hint_timezone Wählen Sie ihre Zeitzone aus @@ -2407,6 +2408,7 @@ timing.infobar_radio Infobar (Radiobetrieb) timing.menu Menü timing.numericzap Umschalten mit Zifferntasten timing.popup_messages Popup Meldungen +timing.static_messages Interaktive Meldungen timing.volumebar Lautstärkeanzeige tmdb.api_key TMDb API Schlüssel tmdb.enabled TMDb-Unterstützung diff --git a/data/locale/english.locale b/data/locale/english.locale index fec3ec423..0772e7e91 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1434,6 +1434,7 @@ menu.hint_subchannel_pos Select subchannels menu position menu.hint_sw_update Update software menu.hint_theme Select pre-defined color theme\nSave or load theme from files menu.hint_timeouts Configure time to hide GUI windows\nin seconds +menu.hint_timeouts_static_messages Timeout for specific messages with user interaction menu.hint_timer_followscreenings Show selection with followscreenings for timer programming menu.hint_timers Add/Remove/Edit scheduled\nrecording, reminders etc. menu.hint_timezone Select your timezone @@ -2407,6 +2408,7 @@ timing.infobar_radio Infobar (radio mode) timing.menu Menu timing.numericzap Numeric Zap timing.popup_messages Popup messages +timing.static_messages Interactive messages timing.volumebar Volume bar tmdb.api_key TMDb API key tmdb.enabled TMDb support diff --git a/data/locale/nederlands.locale b/data/locale/nederlands.locale index 092ca0fb3..6450a1866 100644 --- a/data/locale/nederlands.locale +++ b/data/locale/nederlands.locale @@ -1326,6 +1326,7 @@ menu.hint_subchannel_pos Selecteer menu positie van subkanalen menu.hint_sw_update Update software menu.hint_theme Select voorgedefinieerde thema\n Opslaan of laad thema van bestand menu.hint_timeouts Verberg gebruikers interface na bepaald aantal seconden. +menu.hint_timeouts_static_messages Timeout for specific messages with user interaction menu.hint_timers Toevoegen/Verplaats/Bewerk \ngeplande opnames of timers etc. menu.hint_timezone Selecteer uw tijdzone menu.hint_tools Start tools @@ -2201,6 +2202,8 @@ timing.infobar_radio Infobalk (radio modus) timing.menu Menu timing.numericzap Numeriek Zap timing.volumebar Volume balk +timing.popup_messages Popup messages +timing.static_messages Interactive messages tmdb.read_data Zoeken TMDB data... unicable.lnb Invoer Unicable unicable.qrg Unicable Frequentie diff --git a/data/locale/slovak.locale b/data/locale/slovak.locale index c3f774481..194fb3a84 100644 --- a/data/locale/slovak.locale +++ b/data/locale/slovak.locale @@ -1433,6 +1433,7 @@ menu.hint_subchannel_pos Pozícia menu výberu sub-kanálov menu.hint_sw_update Aktualizácia software menu.hint_theme Výber prednastavených farebných vzhľadov\nUloženie alebo nahranie vzhľadu zo súborov menu.hint_timeouts Konfigurácia času zmiznutia GUI okien\nv sekundách +menu.hint_timeouts_static_messages Timeout for specific messages with user interaction menu.hint_timers Pridanie/Odstránenie/Upravenie plánovaného\nnahrávania, pripomienky atď. menu.hint_timezone Výber časového pásma menu.hint_tmdb_api_key Vložte váš TMDb API kľúč. Neuvedením údajov sa vypne podpora TMDb @@ -2402,6 +2403,8 @@ timing.infobar_radio Stavový riadok (rádio mód) timing.menu Ponuka timing.numericzap Prepínanie číslami timing.volumebar Ukazateľ hlasitosti +timing.popup_messages Popup messages +timing.static_messages Interactive messages tmdb.api_key TMDb API kľúč tmdb.enabled TMDb podpora tmdb.read_data Vyhľadávanie údajov TMDB... diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index aa2403342..aa7e0f0a3 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -1016,7 +1016,7 @@ void COsdSetup::showOsdTimeoutSetup(CMenuWidget* menu_timeout) { CMenuOptionNumberChooser *ch = new CMenuOptionNumberChooser(timing_setting[i].name, &g_settings.timing[i], true, 0, 180); ch->setNumberFormat(nf); - ch->setHint("", LOCALE_MENU_HINT_OSD_TIMING); + ch->setHint("", timing_setting[i].hint); menu_timeout->addItem(ch); } diff --git a/src/system/locals.h b/src/system/locals.h index d638c71c3..94681d367 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1461,6 +1461,7 @@ typedef enum LOCALE_MENU_HINT_SW_UPDATE, LOCALE_MENU_HINT_THEME, LOCALE_MENU_HINT_TIMEOUTS, + LOCALE_MENU_HINT_TIMEOUTS_STATIC_MESSAGES, LOCALE_MENU_HINT_TIMER_FOLLOWSCREENINGS, LOCALE_MENU_HINT_TIMERS, LOCALE_MENU_HINT_TIMEZONE, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index ef44b6316..46b5a0ba0 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1461,6 +1461,7 @@ const char * locale_real_names[] = "menu.hint_sw_update", "menu.hint_theme", "menu.hint_timeouts", + "menu.hint_timeouts_static_messages", "menu.hint_timer_followscreenings", "menu.hint_timers", "menu.hint_timezone", diff --git a/src/system/settings.h b/src/system/settings.h index 488bf97a2..9ae0e8049 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -863,21 +863,22 @@ typedef struct time_settings_t { const int default_timing; const neutrino_locale_t name; + const neutrino_locale_t hint; } time_settings_struct_t; const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_COUNT] = { - { 0, LOCALE_TIMING_MENU }, - { 60, LOCALE_TIMING_CHANLIST }, - { 240, LOCALE_TIMING_EPG }, - { 6, LOCALE_TIMING_INFOBAR }, - { 0, LOCALE_TIMING_INFOBAR_RADIO }, - { 6, LOCALE_TIMING_INFOBAR_MOVIEPLAYER}, - { 3, LOCALE_TIMING_VOLUMEBAR }, - { 60, LOCALE_TIMING_FILEBROWSER }, - { 3, LOCALE_TIMING_NUMERICZAP }, - { 6, LOCALE_TIMING_POPUP_MESSAGES}, - { 0, LOCALE_TIMING_STATIC_MESSAGES} + { 0, LOCALE_TIMING_MENU, LOCALE_MENU_HINT_OSD_TIMING},//TODO: add hint locales + { 60, LOCALE_TIMING_CHANLIST, LOCALE_MENU_HINT_OSD_TIMING}, + { 240, LOCALE_TIMING_EPG, LOCALE_MENU_HINT_OSD_TIMING}, + { 6, LOCALE_TIMING_INFOBAR, LOCALE_MENU_HINT_OSD_TIMING}, + { 0, LOCALE_TIMING_INFOBAR_RADIO, LOCALE_MENU_HINT_OSD_TIMING}, + { 6, LOCALE_TIMING_INFOBAR_MOVIEPLAYER, LOCALE_MENU_HINT_OSD_TIMING}, + { 3, LOCALE_TIMING_VOLUMEBAR, LOCALE_MENU_HINT_OSD_TIMING}, + { 60, LOCALE_TIMING_FILEBROWSER, LOCALE_MENU_HINT_OSD_TIMING}, + { 3, LOCALE_TIMING_NUMERICZAP, LOCALE_MENU_HINT_OSD_TIMING}, + { 6, LOCALE_TIMING_POPUP_MESSAGES, LOCALE_MENU_HINT_OSD_TIMING}, + { 60, LOCALE_TIMING_STATIC_MESSAGES, LOCALE_MENU_HINT_TIMEOUTS_STATIC_MESSAGES} }; // lcdd From bfef4ce934e43c21d2e6e9996afbb1590d61378b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 4 Dec 2016 00:48:32 +0100 Subject: [PATCH 170/171] moviebrowser: fix mute-icon and "Change view" keys in helpbox Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a3b85dd03cae01f58ae7c16fa30cc6bfae40cbcf Author: vanhofen Date: 2016-12-04 (Sun, 04 Dec 2016) Origin message was: ------------------ - moviebrowser: fix mute-icon and "Change view" keys in helpbox --- src/gui/moviebrowser/mb_help.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/moviebrowser/mb_help.h b/src/gui/moviebrowser/mb_help.h index 5e20cd69c..a295c8d12 100644 --- a/src/gui/moviebrowser/mb_help.h +++ b/src/gui/moviebrowser/mb_help.h @@ -55,14 +55,14 @@ class CMovieHelp : public CMenuTarget helpbox.addLine("Standard functions", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 10, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]); helpbox.addLine(NEUTRINO_ICON_BUTTON_OKAY, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_OKAY), CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); helpbox.addLine(NEUTRINO_ICON_BUTTON_PLAY, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_PLAY), CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); - helpbox.addLine(NEUTRINO_ICON_BUTTON_MUTE, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_MUTE), CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); + helpbox.addLine(NEUTRINO_ICON_BUTTON_MUTE_SMALL, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_MUTE), CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); helpbox.addSeparatorLine(); helpbox.addLine(NEUTRINO_ICON_BUTTON_RED, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_RED), CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); helpbox.addLine(NEUTRINO_ICON_BUTTON_GREEN, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_GREEN), CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); helpbox.addLine(NEUTRINO_ICON_BUTTON_YELLOW, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_YELLOW), CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); helpbox.addLine(NEUTRINO_ICON_BUTTON_BLUE, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_BLUE), CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); helpbox.addLine(NEUTRINO_ICON_BUTTON_MENU, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_MENU), CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); - helpbox.addLine("+/- Change view", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); + helpbox.addLine(" Change view", CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, 35, 30); #if 0 helpbox.addPagebreak(); #endif From f4f832d303b06e67235091ce107cf1b70d3c432b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 4 Dec 2016 00:48:32 +0100 Subject: [PATCH 171/171] helpbox: bind gradient of separatorline to user's setting Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/903f2ca74df715f2e5cfc5a615f599042a66b040 Author: vanhofen Date: 2016-12-04 (Sun, 04 Dec 2016) Origin message was: ------------------ - helpbox: bind gradient of separatorline to user's setting --- src/gui/widget/helpbox.cpp | 9 ++++++--- src/gui/widget/helpbox.h | 3 +-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gui/widget/helpbox.cpp b/src/gui/widget/helpbox.cpp index 66cd9d4f2..75969a502 100644 --- a/src/gui/widget/helpbox.cpp +++ b/src/gui/widget/helpbox.cpp @@ -118,7 +118,7 @@ void Helpbox::addLine(const std::string& icon, const std::string& text, const in -void Helpbox::addSeparatorLine(const int& line_space, const int& line_indent, bool enable_gradient) +void Helpbox::addSeparatorLine(const int& line_space, const int& line_indent) { CComponentsItem *pre_item = !ccw_body->empty() ? ccw_body->back() : NULL; //get the last current item @@ -140,8 +140,11 @@ void Helpbox::addSeparatorLine(const int& line_space, const int& line_indent, bo CComponentsShapeSquare *sepline = new CComponentsShapeSquare (0, 0, line->getWidth(), 2); sepline->setYPos(line->getHeight()/2 - sepline->getHeight()/2); sepline->setColorBody(COL_MENUCONTENTINACTIVE_TEXT); - sepline->enableColBodyGradient(enable_gradient); - sepline->setColBodyGradient(CColorGradient::gradientLight2Dark, CFrameBuffer::gradientHorizontal, CColorGradient::light); + if (g_settings.theme.menu_Separator_gradient_enable) + { + sepline->enableColBodyGradient(true); + sepline->setColBodyGradient(CColorGradient::gradientLight2Dark, CFrameBuffer::gradientHorizontal, CColorGradient::light); + } line->addCCItem(sepline); diff --git a/src/gui/widget/helpbox.h b/src/gui/widget/helpbox.h index 86a5aed4b..b59b36050 100644 --- a/src/gui/widget/helpbox.h +++ b/src/gui/widget/helpbox.h @@ -82,8 +82,7 @@ public: ///arg 'line_indent' defines begin of line from left border within body object. ///arg 'enable_gradient' enable/disable gradient, Note: default = true, but gradient is only effected, if global/theme gradient settings are enabled! void addSeparatorLine( const int& line_space = HELPBOX_DEFAULT_LINE_HEIGHT, - const int& line_indent = HELPBOX_DEFAULT_LINE_INDENT, - bool enable_gradient = true); + const int& line_indent = HELPBOX_DEFAULT_LINE_INDENT); ///adds a simple empty separator as horizontal space, arg 'line_space' defines the space of full separator height void addSeparator( const int& line_space = HELPBOX_DEFAULT_LINE_HEIGHT);