Rework cRecMenuItemText

This commit is contained in:
kamel5 2019-07-18 17:08:21 +02:00
parent 15ce11db5f
commit e31070cd76
3 changed files with 5 additions and 7 deletions

View File

@ -733,13 +733,12 @@ int cRecMenuItemSelectDirectory::GetInitial(void) {
// --- cRecMenuItemText -------------------------------------------------------
cRecMenuItemText::cRecMenuItemText(cString title,
char *initialVal,
int length,
bool active,
char *callback) {
selectable = true;
this->title = title;
value = initialVal;
value = callback;
this->active = active;
this->callback = callback;
height = 3 * font->Height();

View File

@ -343,7 +343,6 @@ private:
void DrawValue(char *newValue);
public:
cRecMenuItemText(cString title,
char *initialVal,
int length,
bool active = false,
char *callback = NULL);

View File

@ -611,7 +611,7 @@ cRecMenuSearchTimer::cRecMenuSearchTimer(const cEvent *event) {
infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem);
strncpy(searchString, event->Title(), TEXTINPUTLENGTH);
AddMenuItemInitial(new cRecMenuItemText(tr("Search Expression:"), searchString, TEXTINPUTLENGTH, false));
AddMenuItemInitial(new cRecMenuItemText(tr("Search Expression:"), TEXTINPUTLENGTH, false, searchString));
AddMenuItemInitial(new cRecMenuItemButtonYesNo(tr("Continue"), tr("Cancel"), rmsSearchTimerOptions, rmsClose, true));
CalculateHeight();
CreatePixmap();
@ -818,7 +818,7 @@ void cRecMenuSearchTimerEdit::CreateMenuItems(void) {
mainMenuItems.clear();
}
mainMenuItems.push_back(new cRecMenuItemText(tr("Search term"), searchString, TEXTINPUTLENGTH, init, searchString));
mainMenuItems.push_back(new cRecMenuItemText(tr("Search term"), TEXTINPUTLENGTH, init, searchString));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Active"), false, &sT.useAsSearchTimer, rmsSearchTimerSave, true));
mainMenuItems.push_back(new cRecMenuItemSelect(tr("Search mode"), searchModes, false, &sT.mode, rmsSearchTimerSave, true));
if (sT.mode == 5) {
@ -1196,7 +1196,7 @@ cRecMenuSearch::cRecMenuSearch(std::string searchString, bool withOptions) {
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText, true);
infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem);
AddMenuItem(new cRecMenuItemText(tr("Search Expression:"), this->searchString, TEXTINPUTLENGTH, false, this->searchString));
AddMenuItem(new cRecMenuItemText(tr("Search Expression:"), TEXTINPUTLENGTH, false, this->searchString));
if (withOptions) {
std::vector<std::string> searchModes;
cTVGuideSearchTimer searchTimer;
@ -1339,7 +1339,7 @@ cRecMenuRecordingSearch::cRecMenuRecordingSearch(std::string search) {
infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem);
AddMenuItem(new cRecMenuItemText(tr("Search Expression:"), searchString, TEXTINPUTLENGTH, false, searchString));
AddMenuItem(new cRecMenuItemText(tr("Search Expression:"), TEXTINPUTLENGTH, false, searchString));
AddMenuItem(new cRecMenuItemButtonYesNo(tr("Perform Search"), tr("Cancel"), rmsRecordingSearchResult, rmsClose, true));
CalculateHeight();
CreatePixmap();