From c670b9c47f3a6488b357ec8a040e9625bce3bbb4 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 21 Oct 2016 10:47:37 +0200 Subject: [PATCH] moviebrowser: add possibility to add spacers to moviebrowser Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/75a2665b8780ee8d625fe970666ef418bdb0c884 Author: vanhofen Date: 2016-10-21 (Fri, 21 Oct 2016) Origin message was: ------------------ - moviebrowser: add possibility to add spacers to moviebrowser --- data/locale/deutsch.locale | 2 ++ data/locale/english.locale | 2 ++ src/gui/moviebrowser/mb.cpp | 12 +++++++++--- src/gui/moviebrowser/mb_functions.h | 11 +++-------- src/gui/moviebrowser/mb_types.h | 9 +++------ src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ 7 files changed, 23 insertions(+), 17 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index fc15ae55b..00d20b221 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1714,6 +1714,7 @@ moviebrowser.info_rating Bewertung moviebrowser.info_recorddate Aufnahmedatum moviebrowser.info_serie Serie moviebrowser.info_size Dateigröße (MB) +moviebrowser.info_spacer Abstandshalter moviebrowser.info_title Titel moviebrowser.info_videoformat Bildformat moviebrowser.last_play_max_items Zeilen 'zuletzt aufgenommen' @@ -1764,6 +1765,7 @@ moviebrowser.short_rating Vote moviebrowser.short_recorddate Datum moviebrowser.short_serie Serie moviebrowser.short_size Größe +moviebrowser.short_spacer moviebrowser.short_title Titel moviebrowser.start_head Film starten von Position: moviebrowser.start_record_start Aufnahmestart diff --git a/data/locale/english.locale b/data/locale/english.locale index 3ef0ab02c..3c0a9f71b 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1714,6 +1714,7 @@ moviebrowser.info_rating Rating moviebrowser.info_recorddate Record date moviebrowser.info_serie Serie moviebrowser.info_size File size (MB) +moviebrowser.info_spacer Spacer moviebrowser.info_title Titel moviebrowser.info_videoformat Picture moviebrowser.last_play_max_items Number of lines last play @@ -1764,6 +1765,7 @@ moviebrowser.short_rating Vote moviebrowser.short_recorddate Date moviebrowser.short_serie Serie moviebrowser.short_size MB +moviebrowser.short_spacer moviebrowser.short_title Title moviebrowser.start_head Start movie from: moviebrowser.start_record_start Movie start diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index c63dfdcb2..fe136c50b 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -31,6 +31,7 @@ based on code of Steffen Hehn 'McClean' (C) 2009-2014 Stefan Seyfried + (C) 2016 Sven Hoefer outsourced: (C) 2016, Thilo Graf 'dbt' @@ -89,7 +90,7 @@ typedef struct dirent64 dirent_struct; #define NUMBER_OF_MOVIES_LAST 40 // This is the number of movies shown in last recored and last played list #define MOVIE_SMSKEY_TIMEOUT 800 -#define MESSAGEBOX_BROWSER_ROW_ITEM_COUNT 21 +#define MESSAGEBOX_BROWSER_ROW_ITEM_COUNT 22 const CMenuOptionChooser::keyval MESSAGEBOX_BROWSER_ROW_ITEM[MESSAGEBOX_BROWSER_ROW_ITEM_COUNT] = { { MB_INFO_FILENAME, LOCALE_MOVIEBROWSER_INFO_FILENAME }, @@ -112,7 +113,8 @@ const CMenuOptionChooser::keyval MESSAGEBOX_BROWSER_ROW_ITEM[MESSAGEBOX_BROWSER_ { MB_INFO_AUDIO, LOCALE_MOVIEBROWSER_INFO_AUDIO }, { MB_INFO_LENGTH, LOCALE_MOVIEBROWSER_INFO_LENGTH }, { MB_INFO_SIZE, LOCALE_MOVIEBROWSER_INFO_SIZE }, - { MB_INFO_RATING, LOCALE_MOVIEBROWSER_INFO_RATING } + { MB_INFO_RATING, LOCALE_MOVIEBROWSER_INFO_RATING }, + { MB_INFO_SPACER, LOCALE_MOVIEBROWSER_INFO_SPACER } }; #define MESSAGEBOX_YES_NO_OPTIONS_COUNT 2 @@ -170,6 +172,7 @@ const neutrino_locale_t m_localizedItemName[MB_INFO_MAX_NUMBER+1] = LOCALE_MOVIEBROWSER_SHORT_LENGTH, LOCALE_MOVIEBROWSER_SHORT_SIZE, LOCALE_MOVIEBROWSER_SHORT_RATING, + LOCALE_MOVIEBROWSER_SHORT_SPACER, NONEXISTANT_LOCALE }; @@ -195,6 +198,7 @@ const neutrino_locale_t m_localizedItemName[MB_INFO_MAX_NUMBER+1] = #define MB_ROW_WIDTH_LENGTH 10 #define MB_ROW_WIDTH_SIZE 12 #define MB_ROW_WIDTH_RATING 5 +#define MB_ROW_WIDTH_SPACER 1 const int m_defaultRowWidth[MB_INFO_MAX_NUMBER+1] = { @@ -219,6 +223,7 @@ const int m_defaultRowWidth[MB_INFO_MAX_NUMBER+1] = MB_ROW_WIDTH_LENGTH, MB_ROW_WIDTH_SIZE, MB_ROW_WIDTH_RATING, + MB_ROW_WIDTH_SPACER, 0 //MB_ROW_WIDTH_MAX_NUMBER }; static MI_MOVIE_INFO* playing_info; @@ -3439,7 +3444,8 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite *item_string = str_tmp; } break; - case MB_INFO_MAX_NUMBER: // = 21 + case MB_INFO_SPACER: // = 21, + case MB_INFO_MAX_NUMBER: // = 22 default: *item_string=""; result = false; diff --git a/src/gui/moviebrowser/mb_functions.h b/src/gui/moviebrowser/mb_functions.h index 4c0ce19b1..a5fd547d3 100644 --- a/src/gui/moviebrowser/mb_functions.h +++ b/src/gui/moviebrowser/mb_functions.h @@ -31,6 +31,7 @@ based on code of Steffen Hehn 'McClean' (C) 2009-2014 Stefan Seyfried + (C) 2016 Sven Hoefer outsourced: (C) 2016, Thilo Graf 'dbt' @@ -39,13 +40,9 @@ #ifndef __MB_FUNCTIONS__ #define __MB_FUNCTIONS__ - #include "mb_types.h" #include - - - void strReplace(std::string& orig, const char* fstr, const std::string &rstr); static std::string rateFormat(int i) @@ -135,7 +132,6 @@ bool sortByDir(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) else return a->dirItNr < b->dirItNr; } - bool sortByLastPlay(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) { if (sortDirection) @@ -167,9 +163,8 @@ bool (* const sortBy[MB_INFO_MAX_NUMBER+1])(const MI_MOVIE_INFO* a, const MI_MOV NULL, //MB_INFO_LENGTH = 18, &sortBySize, //MB_INFO_SIZE = 19, &sortByRating, //MB_INFO_RATING = 20, - NULL //MB_INFO_MAX_NUMBER = 21 + NULL, //MB_INFO_SPACER = 21, + NULL //MB_INFO_MAX_NUMBER = 22 }; - - #endif /*__MB_FUNCTIONS__*/ diff --git a/src/gui/moviebrowser/mb_types.h b/src/gui/moviebrowser/mb_types.h index e8c62c087..b260d0ec7 100644 --- a/src/gui/moviebrowser/mb_types.h +++ b/src/gui/moviebrowser/mb_types.h @@ -31,19 +31,17 @@ based on code of Steffen Hehn 'McClean' (C) 2009-2014 Stefan Seyfried + (C) 2016 Sven Hoefer outsourced: (C) 2016, Thilo Graf 'dbt' */ - #include #ifndef __MB_TYPES__ #define __MB_TYPES__ - - /* !!!! Do NOT change the order of the enum, just add items at the end !!!! */ typedef enum { @@ -68,10 +66,10 @@ typedef enum MB_INFO_LENGTH = 18, MB_INFO_SIZE = 19, MB_INFO_RATING = 20, - MB_INFO_MAX_NUMBER = 21 // MUST be allways the last item in the list + MB_INFO_SPACER = 21, + MB_INFO_MAX_NUMBER = 22 // MUST be allways the last item in the list }MB_INFO_ITEM; - typedef enum { MB_DIRECTION_AUTO = 0, @@ -121,7 +119,6 @@ typedef enum MB_GUI_MAX_NUMBER = 5 // MUST be allways the last item in the list }MB_GUI; - typedef enum { MB_PARENTAL_LOCK_OFF = 0, diff --git a/src/system/locals.h b/src/system/locals.h index a80e31df8..1def8f162 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1741,6 +1741,7 @@ typedef enum LOCALE_MOVIEBROWSER_INFO_RECORDDATE, LOCALE_MOVIEBROWSER_INFO_SERIE, LOCALE_MOVIEBROWSER_INFO_SIZE, + LOCALE_MOVIEBROWSER_INFO_SPACER, LOCALE_MOVIEBROWSER_INFO_TITLE, LOCALE_MOVIEBROWSER_INFO_VIDEOFORMAT, LOCALE_MOVIEBROWSER_LAST_PLAY_MAX_ITEMS, @@ -1791,6 +1792,7 @@ typedef enum LOCALE_MOVIEBROWSER_SHORT_RECORDDATE, LOCALE_MOVIEBROWSER_SHORT_SERIE, LOCALE_MOVIEBROWSER_SHORT_SIZE, + LOCALE_MOVIEBROWSER_SHORT_SPACER, LOCALE_MOVIEBROWSER_SHORT_TITLE, LOCALE_MOVIEBROWSER_START_HEAD, LOCALE_MOVIEBROWSER_START_RECORD_START, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index d759559ab..62c654dab 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1741,6 +1741,7 @@ const char * locale_real_names[] = "moviebrowser.info_recorddate", "moviebrowser.info_serie", "moviebrowser.info_size", + "moviebrowser.info_spacer", "moviebrowser.info_title", "moviebrowser.info_videoformat", "moviebrowser.last_play_max_items", @@ -1791,6 +1792,7 @@ const char * locale_real_names[] = "moviebrowser.short_recorddate", "moviebrowser.short_serie", "moviebrowser.short_size", + "moviebrowser.short_spacer", "moviebrowser.short_title", "moviebrowser.start_head", "moviebrowser.start_record_start",