diff --git a/swad_changelog.h b/swad_changelog.h index 1f31db463..275a73d4a 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -448,10 +448,11 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 18.117.2 (2019-04-21)" +#define Log_PLATFORM_VERSION "SWAD 18.117.3 (2019-04-21)" #define CSS_FILE "swad18.112.1.css" #define JS_FILE "swad18.116.5.js" /* + Version 18.117.3: Apr 21, 2019 Changed the behaviour of pasting a file/folder in file browser. (242633 lines) Version 18.117.2: Apr 21, 2019 Changed the behaviour of copying a file/folder in file browser. (242650 lines) Version 18.117.1: Apr 21, 2019 Changed the behaviour of removing a file/folder in file browser. (242647 lines) Version 18.117: Apr 21, 2019 Changed the behaviour of hiding/showing a file browser row. (242698 lines) diff --git a/swad_file_browser.c b/swad_file_browser.c index fb7ccaa0f..e95308461 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -1259,14 +1259,14 @@ static bool Brw_WriteRowFileBrowser (unsigned Level,const char *RowId, const char *FileName); static void Brw_PutIconsRemoveCopyPaste (unsigned Level, const char PathInTree[PATH_MAX + 1], - const char *FileName,const char *FileNameToShow); + const char *FileName); static bool Brw_CheckIfCanPasteIn (unsigned Level); static void Brw_PutIconRemove (const char PathInTree[PATH_MAX + 1], const char *FileName); static void Brw_PutIconCopy (const char PathInTree[PATH_MAX + 1], const char *FileName); static void Brw_PutIconPaste (unsigned Level,const char PathInTree[PATH_MAX + 1], - const char *FileName,const char *FileNameToShow); + const char *FileName); static void Brw_IndentAndWriteIconExpandContract (unsigned Level, const char *FileBrowserId,const char *RowId, Brw_IconTree_t IconThisRow, @@ -5587,7 +5587,7 @@ static bool Brw_WriteRowFileBrowser (unsigned Level,const char *RowId, Gbl.FileBrowser.ICanEditFileOrFolder = Brw_CheckIfICanEditFileOrFolder (Level); /* Put icons to remove, copy and paste */ - Brw_PutIconsRemoveCopyPaste (Level,PathInTree,FileName,FileNameToShow); + Brw_PutIconsRemoveCopyPaste (Level,PathInTree,FileName); } /***** Indentation depending on level, icon, and file/folder name *****/ @@ -5708,7 +5708,7 @@ void Brw_SetFullPathInTree (const char PathInTreeUntilFileOrFolder[PATH_MAX + 1] static void Brw_PutIconsRemoveCopyPaste (unsigned Level, const char PathInTree[PATH_MAX + 1], - const char *FileName,const char *FileNameToShow) + const char *FileName) { /***** Icon to remove folder, file or link *****/ Brw_PutIconRemove (PathInTree,FileName); @@ -5717,7 +5717,7 @@ static void Brw_PutIconsRemoveCopyPaste (unsigned Level, Brw_PutIconCopy (PathInTree,FileName); /***** Icon to paste *****/ - Brw_PutIconPaste (Level,PathInTree,FileName,FileNameToShow); + Brw_PutIconPaste (Level,PathInTree,FileName); } /*****************************************************************************/ @@ -5822,9 +5822,8 @@ static void Brw_PutIconCopy (const char PathInTree[PATH_MAX + 1], /*****************************************************************************/ static void Brw_PutIconPaste (unsigned Level,const char PathInTree[PATH_MAX + 1], - const char *FileName,const char *FileNameToShow) + const char *FileName) { - extern const char *Txt_Paste_in_X; extern const char *Txt_Copy_not_allowed; fprintf (Gbl.F.Out,"",Gbl.RowEvenOdd); @@ -5835,15 +5834,10 @@ static void Brw_PutIconPaste (unsigned Level,const char PathInTree[PATH_MAX + 1] if (Brw_CheckIfCanPasteIn (Level)) { /***** Form to paste the content of the clipboard *****/ - Frm_StartForm (Brw_ActPaste[Gbl.FileBrowser.Type]); - Brw_PutParamsFileBrowser (Brw_ActPaste[Gbl.FileBrowser.Type], - PathInTree,FileName, - Brw_IS_FOLDER,-1L); - snprintf (Gbl.Title,sizeof (Gbl.Title), - Txt_Paste_in_X, - FileNameToShow); - Ico_PutIconLink ("paste.svg",Gbl.Title); - Frm_EndForm (); + Brw_PathInTree = PathInTree; + Brw_FileName = FileName; + Ico_PutContextualIconToPaste (Brw_ActPaste[Gbl.FileBrowser.Type], + Brw_PutImplicitParamsFileBrowser); } else /* Icon to paste inactive */ diff --git a/swad_icon.c b/swad_icon.c index 4dbf71711..b46cbf4dd 100644 --- a/swad_icon.c +++ b/swad_icon.c @@ -297,6 +297,15 @@ void Ico_PutContextualIconToCopy (Act_Action_t NextAction,void (*FuncParams) (vo Txt_Copy); } +void Ico_PutContextualIconToPaste (Act_Action_t NextAction,void (*FuncParams) (void)) + { + extern const char *Txt_Paste; + + Lay_PutContextualLinkOnlyIcon (NextAction,NULL,FuncParams, + "paste.svg", + Txt_Paste); + } + /*****************************************************************************/ /**************** Show an icon inside a div (without text) *******************/ /*****************************************************************************/ diff --git a/swad_icon.h b/swad_icon.h index 17ca11b90..f84d9ab3b 100644 --- a/swad_icon.h +++ b/swad_icon.h @@ -66,6 +66,7 @@ void Ico_PutContextualIconToUnhide (Act_Action_t NextAction,const char *Anchor,v void Ico_PutContextualIconToHide (Act_Action_t NextAction,const char *Anchor,void (*FuncParams) (void)); void Ico_PutContextualIconToPrint (Act_Action_t NextAction,void (*FuncParams) (void)); void Ico_PutContextualIconToCopy (Act_Action_t NextAction,void (*FuncParams) (void)); +void Ico_PutContextualIconToPaste (Act_Action_t NextAction,void (*FuncParams) (void)); void Ico_PutDivIcon (const char *DivClass,const char *Icon,const char *Title); void Ico_PutDivIconLink (const char *DivClass,const char *Icon,const char *Title); diff --git a/swad_text.c b/swad_text.c index f22f2d3a2..7dba46640 100644 --- a/swad_text.c +++ b/swad_text.c @@ -28385,27 +28385,6 @@ const char *Txt_Paste = "Colar"; #endif -const char *Txt_Paste_in_X = // Warning: it is very important to include %s in the following sentences -#if L==1 // ca - "Pegar en %s"; // Necessita traduccio -#elif L==2 // de - "Einfügen an %s"; -#elif L==3 // en - "Paste in %s"; -#elif L==4 // es - "Pegar en %s"; -#elif L==5 // fr - "Coller dans %s"; -#elif L==6 // gn - "Pegar en %s"; // Okoteve traducción -#elif L==7 // it - "Incolla in %s"; -#elif L==8 // pl - "Wklej w %s"; -#elif L==9 // pt - "Colar em %s"; -#endif - const char *Txt_PERCENT_of_users = #if L==1 // ca "% de usuarios"; // Necessita traduccio