diff --git a/swad_changelog.h b/swad_changelog.h index 02c8574db..55c9419ba 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -157,13 +157,15 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.62.1 (2016-11-14)" +#define Log_PLATFORM_VERSION "SWAD 16.62.2 (2016-11-14)" #define CSS_FILE "swad16.60.1.css" #define JS_FILE "swad16.46.1.js" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1 /* + Version 16.62.2: Nov 14, 2016 Changes message related to clipboard. + Fixed minor bug when copying all files inside root folder. (207157 lines) Version 16.62.1: Nov 14, 2016 Code refactoring in clipboard. (207151 lines) Version 16.62: Nov 14, 2016 Copy of all files inside root folder is now allowed (root folder not copied). (207165 lines) Version 16.61.8: Nov 14, 2016 Code refactoring in clipboard. (207148 lines) diff --git a/swad_file_browser.c b/swad_file_browser.c index 730800b22..c8f60fef3 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -6600,11 +6600,11 @@ static void Brw_WriteCurrentClipboard (void) extern const char *Txt_course; extern const char *Txt_group; extern const char *Txt_user[Usr_NUM_SEXS]; - extern const char *Txt_all_files; extern const char *Txt_file_folder; extern const char *Txt_file; extern const char *Txt_folder; extern const char *Txt_link; + extern const char *Txt_all_files_inside_the_root_folder; struct Instit Ins; struct Centre Ctr; struct Degree Deg; @@ -6782,8 +6782,9 @@ static void Brw_WriteCurrentClipboard (void) break; } - if (Gbl.FileBrowser.Clipboard.Level) // Is the root folder? + if (Gbl.FileBrowser.Clipboard.Level) // Is the root folder? { + // Not the root folder Brw_GetFileNameToShow (Gbl.FileBrowser.Clipboard.FileBrowser, Gbl.FileBrowser.Clipboard.Level, Gbl.FileBrowser.Clipboard.FileType, @@ -6792,12 +6793,13 @@ static void Brw_WriteCurrentClipboard (void) sprintf (Gbl.Message,"%s: %s, %s %s.", Txt_Copy_source,TxtClipboardZone, TxtFileType[Gbl.FileBrowser.Clipboard.FileType], - FileNameToShow); // It's not the root folder + FileNameToShow); } else + // The root folder sprintf (Gbl.Message,"%s: %s, %s.", Txt_Copy_source,TxtClipboardZone, - Txt_all_files); // It's the root folder + Txt_all_files_inside_the_root_folder); Lay_ShowAlert (Lay_CLIPBOARD,Gbl.Message); } @@ -7761,7 +7763,7 @@ static unsigned Brw_NumLevelsInPath (const char *Path) /*****************************************************************************/ // Return true if the copy has been made successfully, and false if not -static bool Brw_PasteTreeIntoFolder (unsigned Level, +static bool Brw_PasteTreeIntoFolder (unsigned LevelOrg, const char *PathOrg, const char *PathDstInTree, struct Brw_NumObjects *Pasted, @@ -7815,9 +7817,9 @@ static bool Brw_PasteTreeIntoFolder (unsigned Level, Brw_LimitLengthFileNameToShow (FileType,FileNameOrg,FileNameToShow); /***** Construct the name of the destination file or folder *****/ - if (Level == 0) // Origin of copy is the root folder, + if (LevelOrg == 0) // Origin of copy is the root folder, // for example "sha" - // ==> do not copy root folder into destination + // ==> do not copy the root folder itself into destination strcpy (PathDstInTreeWithFile,PathDstInTree); else // Origin of copy is a file or folder inside the root folder // for example "sha/folder1/file1" @@ -7966,7 +7968,7 @@ static bool Brw_PasteTreeIntoFolder (unsigned Level, { sprintf (PathInFolderOrg,"%s/%s",PathOrg,FileList[NumFile]->d_name); /* Recursive call to this function */ - if (!Brw_PasteTreeIntoFolder (Level + 1, + if (!Brw_PasteTreeIntoFolder (LevelOrg + 1, PathInFolderOrg, PathDstInTreeWithFile, Pasted, @@ -7980,7 +7982,9 @@ static bool Brw_PasteTreeIntoFolder (unsigned Level, else Lay_ShowErrorAndExit ("Error while scanning directory."); - if (CopyIsGoingSuccessful) + if (CopyIsGoingSuccessful && + LevelOrg != 0) // When copying all files inside root folder, + // do not count the root folder itself (Pasted->NumFolds)++; } } diff --git a/swad_text.c b/swad_text.c index ee1589e3b..93530e5c0 100644 --- a/swad_text.c +++ b/swad_text.c @@ -2153,25 +2153,25 @@ const char *Txt_all_degrees = "all degrees"; // Necessita de tradução #endif -const char *Txt_all_files = +const char *Txt_all_files_inside_the_root_folder = #if L==1 - "tots els fitxers"; + "tots els arxius dins de la carpeta arrel"; #elif L==2 - "alle Dateien"; + "alle Dateien im Stammordner"; #elif L==3 - "all files"; + "all files inside the root folder"; #elif L==4 - "todos los archivos"; + "todos los archivos dentro de la carpeta raíz"; #elif L==5 - "tous les fichiers"; + "tous les fichiers dans le répertoire racine"; #elif L==6 - "todos los archivos"; // Okoteve traducción + "todos los archivos dentro de la carpeta raíz"; // Okoteve traducción #elif L==7 - "tutti i file"; + "tutti i file all'interno della cartella principale"; #elif L==8 - "wszystkich plików"; + "wszystkie pliki znajdujące się w folderze głównym"; #elif L==9 - "todos os arquivos"; + "todos os arquivos dentro do diretório raiz"; #endif const char *Txt_All_groups =