1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

When selecting a folder for a recording or timer, it is now possible to open a folder even if it doesn't contain any subfolders

This commit is contained in:
Klaus Schmidinger 2017-12-15 13:43:00 +01:00
parent 05bfa4b476
commit 477fb7dc20
31 changed files with 23 additions and 104 deletions

View File

@ -3294,6 +3294,8 @@ Matthias Senzel <matthias.senzel@t-online.de>
for reporting problem with locking the Recordings list in the cutting process for reporting problem with locking the Recordings list in the cutting process
for suggesting to change the log message ""ERROR: copying directory '%s' to '%s' ended for suggesting to change the log message ""ERROR: copying directory '%s' to '%s' ended
prematurely" from "error" to "info" prematurely" from "error" to "info"
for suggesting to allow opening a folder when selecting a folder for a recording or
timer, even if it doesn't contain any subfolders
Marek Nazarko <mnazarko@gmail.com> Marek Nazarko <mnazarko@gmail.com>
for translating OSD texts to the Polish language for translating OSD texts to the Polish language

View File

@ -9162,7 +9162,7 @@ Video Disk Recorder Revision History
a subdirectory. a subdirectory.
- SVDRP peering can now be limited to the default SVDRP host (see MANUAL for details). - SVDRP peering can now be limited to the default SVDRP host (see MANUAL for details).
2017-12-14: Version 2.3.9 2017-12-15: Version 2.3.9
- Updated the Italian OSD texts (thanks to Diego Pierotto). - Updated the Italian OSD texts (thanks to Diego Pierotto).
- Updated the Finnish OSD texts (thanks to Rolf Ahrenberg). - Updated the Finnish OSD texts (thanks to Rolf Ahrenberg).
@ -9239,3 +9239,5 @@ Video Disk Recorder Revision History
- Changed the log message ""ERROR: copying directory '%s' to '%s' ended prematurely" from - Changed the log message ""ERROR: copying directory '%s' to '%s' ended prematurely" from
"error" to "info", because any actual error would have already been reported before this "error" to "info", because any actual error would have already been reported before this
(suggested by Matthias Senzel). (suggested by Matthias Senzel).
- When selecting a folder for a recording or timer, it is now possible to open a folder
even if it doesn't contain any subfolders (suggested by Matthias Senzel).

37
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: menu.c 4.52 2017/12/14 10:32:41 kls Exp $ * $Id: menu.c 4.53 2017/12/15 13:27:20 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -656,6 +656,7 @@ class cMenuFolderItem : public cOsdItem {
private: private:
cNestedItem *folder; cNestedItem *folder;
public: public:
virtual void Set(void);
cMenuFolderItem(cNestedItem *Folder); cMenuFolderItem(cNestedItem *Folder);
cNestedItem *Folder(void) { return folder; } cNestedItem *Folder(void) { return folder; }
}; };
@ -664,8 +665,15 @@ cMenuFolderItem::cMenuFolderItem(cNestedItem *Folder)
:cOsdItem(Folder->Text()) :cOsdItem(Folder->Text())
{ {
folder = Folder; folder = Folder;
if (folder->SubItems()) Set();
}
void cMenuFolderItem::Set(void)
{
if (folder->SubItems() && folder->SubItems()->Count())
SetText(cString::sprintf("%s...", folder->Text())); SetText(cString::sprintf("%s...", folder->Text()));
else
SetText(folder->Text());
} }
// --- cMenuEditFolder ------------------------------------------------------- // --- cMenuEditFolder -------------------------------------------------------
@ -675,7 +683,6 @@ private:
cList<cNestedItem> *list; cList<cNestedItem> *list;
cNestedItem *folder; cNestedItem *folder;
char name[PATH_MAX]; char name[PATH_MAX];
int subFolder;
eOSState Confirm(void); eOSState Confirm(void);
public: public:
cMenuEditFolder(const char *Dir, cList<cNestedItem> *List, cNestedItem *Folder = NULL); cMenuEditFolder(const char *Dir, cList<cNestedItem> *List, cNestedItem *Folder = NULL);
@ -689,13 +696,10 @@ cMenuEditFolder::cMenuEditFolder(const char *Dir, cList<cNestedItem> *List, cNes
SetMenuCategory(mcFolder); SetMenuCategory(mcFolder);
list = List; list = List;
folder = Folder; folder = Folder;
if (folder) { if (folder)
strn0cpy(name, folder->Text(), sizeof(name)); strn0cpy(name, folder->Text(), sizeof(name));
subFolder = folder->SubItems() != NULL;
}
else { else {
*name = 0; *name = 0;
subFolder = 0;
cRemote::Put(kRight, true); // go right into string editing mode cRemote::Put(kRight, true); // go right into string editing mode
} }
if (!isempty(Dir)) { if (!isempty(Dir)) {
@ -704,7 +708,6 @@ cMenuEditFolder::cMenuEditFolder(const char *Dir, cList<cNestedItem> *List, cNes
Add(DirItem); Add(DirItem);
} }
Add(new cMenuEditStrItem( tr("Name"), name, sizeof(name))); Add(new cMenuEditStrItem( tr("Name"), name, sizeof(name)));
Add(new cMenuEditBoolItem(tr("Sub folder"), &subFolder));
} }
cString cMenuEditFolder::GetFolder(void) cString cMenuEditFolder::GetFolder(void)
@ -728,12 +731,10 @@ eOSState cMenuEditFolder::Confirm(void)
return osContinue; return osContinue;
} }
} }
if (folder) { if (folder)
folder->SetText(name); folder->SetText(name);
folder->SetSubItems(subFolder);
}
else else
list->Add(folder = new cNestedItem(name, subFolder)); list->Add(folder = new cNestedItem(name));
return osEnd; return osEnd;
} }
@ -791,12 +792,8 @@ void cMenuFolder::SetHelpKeys(void)
if (HasSubMenu()) if (HasSubMenu())
return; return;
int NewHelpKeys = 0; int NewHelpKeys = 0;
if (firstFolder) { if (firstFolder)
if (cMenuFolderItem *Folder = (cMenuFolderItem *)Get(Current())) { NewHelpKeys = 1;
if (Folder->Folder()->SubItems())
NewHelpKeys = 1;
}
}
if (NewHelpKeys != helpKeys) { if (NewHelpKeys != helpKeys) {
helpKeys = NewHelpKeys; helpKeys = NewHelpKeys;
SetHelp(NewHelpKeys > 0 ? tr("Button$Open") : NULL, tr("Button$New"), firstFolder ? tr("Button$Delete") : NULL, firstFolder ? tr("Button$Edit") : NULL); SetHelp(NewHelpKeys > 0 ? tr("Button$Open") : NULL, tr("Button$New"), firstFolder ? tr("Button$Delete") : NULL, firstFolder ? tr("Button$Edit") : NULL);
@ -885,8 +882,10 @@ eOSState cMenuFolder::Select(bool Open)
if (firstFolder) { if (firstFolder) {
cMenuFolderItem *Folder = (cMenuFolderItem *)Get(Current()); cMenuFolderItem *Folder = (cMenuFolderItem *)Get(Current());
if (Folder) { if (Folder) {
if (Open && Folder->Folder()->SubItems()) if (Open) {
Folder->Folder()->SetSubItems(true);
return AddSubMenu(new cMenuFolder(Title(), Folder->Folder()->SubItems(), nestedItemList, !isempty(dir) ? *cString::sprintf("%s%c%s", *dir, FOLDERDELIMCHAR, Folder->Folder()->Text()) : Folder->Folder()->Text())); return AddSubMenu(new cMenuFolder(Title(), Folder->Folder()->SubItems(), nestedItemList, !isempty(dir) ? *cString::sprintf("%s%c%s", *dir, FOLDERDELIMCHAR, Folder->Folder()->Text()) : Folder->Folder()->Text()));
}
else else
return osEnd; return osEnd;
} }

View File

@ -615,9 +615,6 @@ msgstr "تحرير مجلد"
msgid "New folder" msgid "New folder"
msgstr "مجلد جديد" msgstr "مجلد جديد"
msgid "Sub folder"
msgstr "مجلد فرعى"
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "المجلد موجود بالفعل" msgstr "المجلد موجود بالفعل"

View File

@ -614,9 +614,6 @@ msgstr "Modificar carpeta"
msgid "New folder" msgid "New folder"
msgstr "Nova carpeta" msgstr "Nova carpeta"
msgid "Sub folder"
msgstr "Sub carpeta"
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "La carpeta ja existeix!" msgstr "La carpeta ja existeix!"

View File

@ -614,9 +614,6 @@ msgstr "Změna složky"
msgid "New folder" msgid "New folder"
msgstr "Nová složka" msgstr "Nová složka"
msgid "Sub folder"
msgstr "Podsložka"
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "Složka již existuje!" msgstr "Složka již existuje!"

View File

@ -611,9 +611,6 @@ msgstr ""
msgid "New folder" msgid "New folder"
msgstr "" msgstr ""
msgid "Sub folder"
msgstr ""
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "" msgstr ""

View File

@ -612,9 +612,6 @@ msgstr "Verzeichnis editieren"
msgid "New folder" msgid "New folder"
msgstr "Neues Verzeichnis" msgstr "Neues Verzeichnis"
msgid "Sub folder"
msgstr "Unterverzeichnis"
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "Verzeichnisname existiert bereits!" msgstr "Verzeichnisname existiert bereits!"

View File

@ -611,9 +611,6 @@ msgstr ""
msgid "New folder" msgid "New folder"
msgstr "" msgstr ""
msgid "Sub folder"
msgstr ""
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "" msgstr ""

View File

@ -612,9 +612,6 @@ msgstr "Modificar carpeta"
msgid "New folder" msgid "New folder"
msgstr "Nueva carpeta" msgstr "Nueva carpeta"
msgid "Sub folder"
msgstr "Sub carpeta"
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "¡La carpeta ya existe!" msgstr "¡La carpeta ya existe!"

View File

@ -611,9 +611,6 @@ msgstr "Muuda kausta"
msgid "New folder" msgid "New folder"
msgstr "Uus kaust" msgstr "Uus kaust"
msgid "Sub folder"
msgstr "Uus alamkaust"
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "Sellenimeline kaust juba olemas!" msgstr "Sellenimeline kaust juba olemas!"

View File

@ -615,9 +615,6 @@ msgstr "Muokkaa kansiota"
msgid "New folder" msgid "New folder"
msgstr "Uusi kansio" msgstr "Uusi kansio"
msgid "Sub folder"
msgstr "Alikansio"
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "Kansio on jo olemassa!" msgstr "Kansio on jo olemassa!"

View File

@ -622,9 +622,6 @@ msgstr "Modifier le dossier"
msgid "New folder" msgid "New folder"
msgstr "Nouveau dossier" msgstr "Nouveau dossier"
msgid "Sub folder"
msgstr "Sous-dossier"
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "Ce nom de dossier existe déjà !" msgstr "Ce nom de dossier existe déjà !"

View File

@ -613,9 +613,6 @@ msgstr ""
msgid "New folder" msgid "New folder"
msgstr "" msgstr ""
msgid "Sub folder"
msgstr ""
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "" msgstr ""

View File

@ -616,9 +616,6 @@ msgstr "Könyvtár szerkesztése"
msgid "New folder" msgid "New folder"
msgstr "Új könyvtár" msgstr "Új könyvtár"
msgid "Sub folder"
msgstr "Alkönyvtár"
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "Ez a könyvtárnév már létezik!" msgstr "Ez a könyvtárnév már létezik!"

View File

@ -617,9 +617,6 @@ msgstr "Modifica cartella"
msgid "New folder" msgid "New folder"
msgstr "Nuova cartella" msgstr "Nuova cartella"
msgid "Sub folder"
msgstr "Sotto cartella"
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "Nome cartella già esistente!" msgstr "Nome cartella già esistente!"

View File

@ -611,9 +611,6 @@ msgstr "Koreguoti katalogą"
msgid "New folder" msgid "New folder"
msgstr "Naujas katalogas" msgstr "Naujas katalogas"
msgid "Sub folder"
msgstr "Pakatalogis"
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "Toks katalogo vardas jau egzistuoja!" msgstr "Toks katalogo vardas jau egzistuoja!"

View File

@ -612,9 +612,6 @@ msgstr "Уреди директориум"
msgid "New folder" msgid "New folder"
msgstr "Нов директориум" msgstr "Нов директориум"
msgid "Sub folder"
msgstr "Поддиректориум"
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "Името веќе постои" msgstr "Името веќе постои"

View File

@ -617,9 +617,6 @@ msgstr "Bewerk map"
msgid "New folder" msgid "New folder"
msgstr "Nieuwe map" msgstr "Nieuwe map"
msgid "Sub folder"
msgstr "Submap"
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "Map bestaat al" msgstr "Map bestaat al"

View File

@ -612,9 +612,6 @@ msgstr ""
msgid "New folder" msgid "New folder"
msgstr "" msgstr ""
msgid "Sub folder"
msgstr ""
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "" msgstr ""

View File

@ -614,9 +614,6 @@ msgstr "Edutuj katalog"
msgid "New folder" msgid "New folder"
msgstr "Nowy katalog" msgstr "Nowy katalog"
msgid "Sub folder"
msgstr "Podkatalog"
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "Taka nazwa katalogu juz istnieje" msgstr "Taka nazwa katalogu juz istnieje"

View File

@ -612,9 +612,6 @@ msgstr "Editar pasta"
msgid "New folder" msgid "New folder"
msgstr "Nova pasta" msgstr "Nova pasta"
msgid "Sub folder"
msgstr "Subpasta"
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "Nome da pasta já existe!" msgstr "Nome da pasta já existe!"

View File

@ -613,9 +613,6 @@ msgstr "Editează directorul"
msgid "New folder" msgid "New folder"
msgstr "Director nou" msgstr "Director nou"
msgid "Sub folder"
msgstr "Sub-director"
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "Un director cu acelaşi nume există!" msgstr "Un director cu acelaşi nume există!"

View File

@ -612,9 +612,6 @@ msgstr "Редакция директории"
msgid "New folder" msgid "New folder"
msgstr "Новая директория" msgstr "Новая директория"
msgid "Sub folder"
msgstr "поддиректория"
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "Директория уже существует!" msgstr "Директория уже существует!"

View File

@ -612,9 +612,6 @@ msgstr "Upravi
msgid "New folder" msgid "New folder"
msgstr "Nový zlo¾ka" msgstr "Nový zlo¾ka"
msgid "Sub folder"
msgstr "Pod zlo¾ka"
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "Názov zlo¾ky u¾ existuje!" msgstr "Názov zlo¾ky u¾ existuje!"

View File

@ -612,9 +612,6 @@ msgstr "Uredi direktorij"
msgid "New folder" msgid "New folder"
msgstr "Nov direktorij" msgstr "Nov direktorij"
msgid "Sub folder"
msgstr "Pod direktorij"
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "Ime direktorija ¾e obstaja" msgstr "Ime direktorija ¾e obstaja"

View File

@ -612,9 +612,6 @@ msgstr "Izmeni direktorijum"
msgid "New folder" msgid "New folder"
msgstr "Novi direktorijum" msgstr "Novi direktorijum"
msgid "Sub folder"
msgstr "Poddirektorijum"
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "Naziv direktorijuma veæ postoji!" msgstr "Naziv direktorijuma veæ postoji!"

View File

@ -616,9 +616,6 @@ msgstr "Redigera mapp"
msgid "New folder" msgid "New folder"
msgstr "Ny mapp" msgstr "Ny mapp"
msgid "Sub folder"
msgstr "Undermapp"
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "Mappnamnet finns redan!" msgstr "Mappnamnet finns redan!"

View File

@ -611,9 +611,6 @@ msgstr ""
msgid "New folder" msgid "New folder"
msgstr "" msgstr ""
msgid "Sub folder"
msgstr ""
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "" msgstr ""

View File

@ -612,9 +612,6 @@ msgstr "Редагувати теку"
msgid "New folder" msgid "New folder"
msgstr "Нова тека" msgstr "Нова тека"
msgid "Sub folder"
msgstr "Підтека"
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "Назва теки вже існує!" msgstr "Назва теки вже існує!"

View File

@ -613,9 +613,6 @@ msgstr "编辑文件夹"
msgid "New folder" msgid "New folder"
msgstr "新文件夹" msgstr "新文件夹"
msgid "Sub folder"
msgstr "子文件夹"
msgid "Folder name already exists!" msgid "Folder name already exists!"
msgstr "文件夹名称已经存在!" msgstr "文件夹名称已经存在!"