25#define LOC QString("Thumbview: ")
31 std::ranges::copy_if(std::as_const(comment), std::back_inserter(result),
32 [](QChar x) {
return x.isPrint(); } );
51 LOG(VB_GENERAL, LOG_INFO, QString(
"Executing \"%1\"").arg(cmd));
55 LOG(VB_GENERAL, LOG_INFO, QString(
" ...with result %1").arg(
m_result));
90 auto add_size = [](
int t,
const ImagePtrK & im){
return t + im->m_size; };
91 int total = std::accumulate(keys.cbegin(), keys.cend(), 0, add_size);
94 for (
auto it =
m_files.constKeyValueBegin();
95 it !=
m_files.constKeyValueEnd(); it++)
98 QString newPath = it->second;
102 QString message = QString(
"%1 %2\n%3")
103 .arg(
action, QFileInfo(im->m_url).fileName(),
107 QApplication::postEvent(
m_dialog, pue);
110 LOG(VB_FILE, LOG_INFO, QString(
"%2 %3 -> %4")
111 .arg(
action, im->m_url, newPath));
121 LOG(VB_GENERAL, LOG_ERR,
122 QString(
"%1: Failed to copy/move %2 -> %3")
126 progressSize += im->m_size;
134 QApplication::postEvent(
m_dialog, pue);
157 std::this_thread::sleep_for(1ms);
158 QCoreApplication::processEvents();
176 m_editsAllowed(
gCoreContext->GetSetting(
"GalleryPassword").isEmpty())
189 LOG(VB_GUI, LOG_DEBUG,
LOC +
"Exiting Gallery");
199 LOG(VB_GUI, LOG_DEBUG,
LOC +
"Closing Gallery");
224 QString name = QString(
"images%1").arg(zoom++);
229 widget->SetVisible(
false);
231 name = QString(
"images%1").arg(zoom++);
237 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Screen 'Gallery' is missing 'images0'");
240 LOG(VB_GUI, LOG_DEBUG,
LOC + QString(
"Screen 'Gallery' found %1 zoom levels")
246 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Cannot load 'Info buttonlist'");
286 for (
int i = 0; i < actions.size() && !handled; i++)
288 const QString&
action = actions[i];
295 else if (
action ==
"INFO")
299 else if (
action ==
"ZOOMIN")
303 else if (
action ==
"ZOOMOUT")
307 else if (
action ==
"ROTRIGHT")
311 else if (
action ==
"ROTLEFT")
315 else if (
action ==
"FLIPHORIZONTAL")
319 else if (
action ==
"FLIPVERTICAL")
323 else if (
action ==
"COVER")
340 else if (
action ==
"PLAY")
344 else if (
action ==
"RECURSIVESHOW")
347 if (im && im->IsDirectory())
350 else if (
action ==
"MARK")
393 auto *me =
dynamic_cast<MythEvent *
>(event);
397 const QString& mesg = me->
Message();
398 QStringList extra = me->ExtraDataList();
401 QStringList token = mesg.split(
' ');
405 if (token[0] ==
"IMAGE_METADATA")
407 int id = extra[0].toInt();
410 if (selected && selected->m_id ==
id)
413 else if (token[0] ==
"THUMB_AVAILABLE")
415 int id = extra[0].toInt();
421 QList<ThumbLocation> affected =
m_pendingMap.values(
id);
424 if (affected.isEmpty())
427 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
428 QString(
"Rx %1 : %2").arg(token[0], extra.join(
",")));
434 for (
const ThumbLocation & location : std::as_const(affected))
437 int index = location.second;
447 else if (token[0] ==
"IMAGE_DB_CHANGED")
450 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
451 QString(
"Rx %1 : %2").arg(token[0], extra.join(
",")));
453 if (!extra.isEmpty())
455 QStringList idDeleted =
456 extra[0].split(
",", Qt::SkipEmptyParts);
459 if (extra.size() >= 2)
461 QStringList idChanged =
462 extra[1].split(
",", Qt::SkipEmptyParts);
469 else if (token[0] ==
"IMAGE_DEVICE_CHANGED")
472 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
473 QString(
"Rx %1 : %2").arg(token[0], extra.join(
",")));
480 for (
const QString & url : std::as_const(extra))
486 else if (token[0] ==
"IMAGE_SCAN_STATUS" && extra.size() == 3)
496 QString resultid = dce->GetId();
497 int buttonnum = dce->GetResult();
499 if (resultid ==
"FileRename")
501 QString newName = dce->GetResultText();
510 else if (resultid ==
"MakeDir")
515 QString name = dce->GetResultText();
516 QString err = name.contains(
"/")
524 else if (resultid ==
"SlideOrderMenu")
530 case 0: slideOrder =
kOrdered;
break;
531 case 1: slideOrder =
kShuffle;
break;
532 case 2: slideOrder =
kRandom;
break;
536 LOG(VB_FILE, LOG_DEBUG,
LOC + QString(
"Order %1").arg(slideOrder));
538 else if (resultid ==
"ImageCaptionMenu")
552 else if (resultid ==
"DirCaptionMenu")
565 else if (resultid ==
"Password")
567 QString password = dce->GetResultText();
570 else if (buttonnum == 1)
580 else if (resultid ==
"ConfirmDeleteMarked")
603 for (
const QString &
id : std::as_const(ids))
611 for (
const QString & url : std::as_const(urls))
613 LOG(VB_FILE, LOG_DEBUG,
LOC +
614 QString(
"Clearing image cache of '%1'").arg(url));
630 if (message.size() == 4 && message[0] ==
"OK")
674 "Scan storage group using menu,\n"
675 "or insert/mount local media.\n"));
694 for (
const ImagePtrK & im : std::as_const(nodes))
702 QVariant::fromValue(im));
704 item->setCheckable(
true);
716 item->DisplayState(
"upfolder",
"parenttype");
718 else if (im == selected)
744 if (im->m_dirCount > 0)
747 .arg(im->m_fileCount).arg(im->m_dirCount),
752 item->
SetText(QString::number(im->m_fileCount),
"childcount");
755 item->
DisplayState(im->IsDevice() ?
"device" :
"subfolder",
"buttontype");
771 QString hideState = (im->m_isHidden) ?
"hidden" :
"visible";
777 im->IsFile() ?
"GalleryImageCaption"
778 :
"GalleryDirCaption");
800 if (im->m_thumbNails.size() == 1)
812 for (
int index = 0; index < im->m_thumbNails.size(); ++index)
816 thumbMap.insert(QString(
"thumbimage%1").arg(index), url);
818 if (!thumbMap.isEmpty())
823 if (!request.isEmpty())
842 ThumbPair thumb(im->m_thumbNails.at(index));
843 int id = thumb.first;
870 if (im->m_thumbNails.size() == 1)
877 default: button->
SetImage(url,
"folderimage");
break;
883 button->
SetImage(url, QString(
"thumbimage%1").arg(index));
904 LOG(VB_GUI, LOG_DEBUG,
LOC + QString(
"Scan Finished %1 %2/%3")
905 .arg(scanner).arg(
current).arg(total));
946 LOG(VB_GUI, LOG_DEBUG,
LOC + QString(
"Scan Started %1 %2/%3")
947 .arg(scanner).arg(
current).arg(total));
959 currentAgg +=
scan.first;
960 totalAgg +=
scan.second;
1017 if (im->IsFile() || im->IsDevice())
1021 if (!comment.isEmpty())
1038 case kPicOnly : text = tr(
"Pictures");
break;
1039 case kVideoOnly : text = tr(
"Videos");
break;
1060 auto *
menu =
new MythMenu(tr(
"Gallery Options"),
this,
"mainmenu");
1089 if (popup->Create())
1142 if (
menu->IsEmpty())
1161 if (files.isEmpty())
1163 if (files.isEmpty())
1166 QString title = tr(
"%L1 marked").arg(files.size());
1197 mainMenu->
AddItem(tr(
"Transforms"),
nullptr,
menu);
1209 mainMenu->
AddItem(tr(
"Transforms"),
nullptr,
menu);
1241 menu =
new MythMenu(selected->m_baseName,
this,
"actionmenu");
1246 if (selected->m_isHidden)
1255 else if (selected->m_userThumbnail)
1262 if (selected->IsDirectory()
1272 if (selected->IsDevice() && selected->IsLocal())
1275 if (
menu->IsEmpty())
1293 case kShuffle : ordering = tr(
"Shuffled");
break;
1294 case kRandom : ordering = tr(
"Random");
break;
1295 case kSeasonal : ordering = tr(
"Seasonal");
break;
1297 case kOrdered : ordering = tr(
"Ordered");
break;
1300 auto *
menu =
new MythMenu(tr(
"Slideshow") +
" (" + ordering +
")",
1301 this,
"SlideshowMenu");
1317 auto *orderMenu =
new MythMenu(tr(
"Slideshow Order"),
this,
"SlideOrderMenu");
1319 orderMenu->AddItem(tr(
"Ordered"),
nullptr,
nullptr, order ==
kOrdered);
1320 orderMenu->AddItem(tr(
"Shuffled"),
nullptr,
nullptr, order ==
kShuffle);
1321 orderMenu->AddItem(tr(
"Random"),
nullptr,
nullptr, order ==
kRandom);
1322 orderMenu->AddItem(tr(
"Seasonal"),
nullptr,
nullptr, order ==
kSeasonal);
1324 menu->AddItem(tr(
"Change Order"),
nullptr, orderMenu);
1331 mainMenu->
AddItem(tr(
"Slideshow"),
nullptr,
menu);
1341 auto *
menu =
new MythMenu(tr(
"Show Options"),
this,
"showmenu");
1356 auto *captionMenu =
new MythMenu(tr(
"Image Captions"),
this,
1357 "ImageCaptionMenu");
1361 captionMenu->AddItem(tr(
"Comment"),
nullptr,
nullptr,
show ==
kUserCaption);
1362 captionMenu->AddItem(tr(
"None"),
nullptr,
nullptr,
show ==
kNoCaption);
1364 menu->AddItem(tr(
"Image Captions"),
nullptr, captionMenu);
1367 captionMenu =
new MythMenu(tr(
"Directory Captions"),
this,
"DirCaptionMenu");
1371 captionMenu->AddItem(tr(
"None"),
nullptr,
nullptr,
show ==
kNoCaption);
1373 menu->AddItem(tr(
"Directory Captions"),
nullptr, captionMenu);
1389 ? tr(
"Show Details") : tr(
"Hide Details");
1465 if (slide->Create())
1473 if (selected->IsDirectory())
1476 slide->Start(mode, selected->m_id);
1481 slide->Start(mode, selected->m_parentId, selected->m_id);
1499 LOG(VB_GUI, LOG_DEBUG,
LOC +
1500 QString(
"Going up from %1").arg(im->m_filePath));
1520 LOG(VB_GUI, LOG_DEBUG,
LOC +
1521 QString(
"Going down to %1").arg(im->m_filePath));
1585 ids.append(im->m_id);
1666 ShowDialog(tr(
"Do you want to delete all marked files ?"),
1667 "ConfirmDeleteMarked");
1750 if (popup->Create())
1752 popup->SetReturnEvent(
this, event);
1770 QString msg = tr(
"Enter a new name:");
1773 if (popup->Create())
1775 popup->SetReturnEvent(
this,
"FileRename");
1800 QString msg = tr(
"Enter password:");
1802 if (popup->Create())
1804 popup->SetReturnEvent(
this,
"Password");
1914 tr(
"Enter name of new directory"),
1916 if (popup->Create())
1918 popup->SetReturnEvent(
this,
"MakeDir");
1952 if (!destDir || destDir->IsFile())
1957 if (markedIds.isEmpty())
1960 if (markedIds.isEmpty())
1972 if (dirs.isEmpty() && files.isEmpty())
1980 ImagePtrK aChild = dirs.isEmpty() ? files[0] : dirs[0];
1983 int basePathSize = aChild->m_filePath.size() - aChild->m_baseName.size();
1988 for (
const ImagePtr & im : std::as_const(files))
1992 im->m_filePath.mid(basePathSize));
1995 destDir->IsLocal()));
2020 if (!failed.isEmpty())
2021 ShowOkPopup(tr(
"Failed to copy %L1/%Ln file(s)",
nullptr, transfers.size())
2022 .arg(failed.size()));
2025 for (
const ImagePtrK & im : std::as_const(failed))
2026 transfers.remove(im);
2031 QStringList dirPaths;
2032 for (
const ImagePtr & im : std::as_const(dirs))
2034 QString relPath = im->m_filePath.mid(basePathSize);
2036 dirPaths << relPath;
2043 newImages.append(im);
2047 if (!dirPaths.isEmpty())
2050 if (!newImages.isEmpty())
2060 for (
const ImagePtrK & im : std::as_const(newImages))
2082 if (!destDir || destDir->IsFile())
2087 if (markedIds.isEmpty())
2090 if (markedIds.isEmpty())
2115 if (!dirs.isEmpty())
2117 if (!files.isEmpty())
2125 int basePathSize = aChild->m_filePath.size() - aChild->m_baseName.size();
2126 QString parentPath = aChild->m_filePath.left(basePathSize);
2130 for (
const QSharedPointer<ImageItem> & im : std::as_const(images))
2134 im->m_filePath.mid(basePathSize));
2162 if (!failed.isEmpty())
2163 ShowOkPopup(tr(
"Failed to move %L1/%Ln file(s)",
nullptr, transfers.size())
2164 .arg(failed.size()));
2167 for (
const ImagePtrK & im : std::as_const(failed))
2168 transfers.remove(im);
2170 if (!transfers.isEmpty())
2175 for (
const ImagePtrK & im : std::as_const(moved))
2192 ShowOkPopup(tr(
"Failed to create temporary directory."));
2198 cmd.replace(
"%TMPDIR%", path);
2202 ShowBusyPopup(tr(
"Running Import command.\nPlease wait..."));
2217 LOG(VB_GENERAL, LOG_ERR,
LOC + err);
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
static const Type kEventType
A datastore of images for display by a screen. Provides an ordered list of dirs & images from a singl...
ImagePtrK GetParent() const
QString GetPosition() const
Get positional status.
void ClearMarked()
Unmark all items.
void Clear(bool resetParent=true)
Resets view.
MenuSubjects GetMenuSubjects()
Determine current selection, markings & various info to support menu display.
bool IsMarked(int id) const
void MarkAll()
Mark all images/dirs.
bool LoadFromDb(int parentId) override
Populate view from database as images/subdirs of a directory. View is ordered: Parent dir,...
void ClearCache()
Clears UI cache.
QStringList RemoveImage(int id, bool deleted=false)
Clear file/dir and all its ancestors from UI cache so that ancestor thumbnails are recalculated....
void InvertMarked()
Mark all unmarked items, unmark all marked items.
void Mark(int id, bool mark)
Mark/unmark an image/dir.
bool Select(int id, int fallback=0)
Selects first occurrence of an image.
ImagePtrK GetSelected() const
Get current selection.
ImageListK GetAllNodes() const
Get all images/dirs in view.
QString GetCachedThumbUrl(int id) const
void ShowDialog(const QString &msg, const QString &event="")
Show a confirmation dialog.
void ShowSettings()
Show configuration screen.
bool Create() override
Initialises and shows the graphical elements.
DirectoryView * m_view
List of images comprising the view.
static void UpdateThumbnail(MythUIButtonListItem *button, const ImagePtrK &im, const QString &url, int index)
Update the buttonlist item with a thumbnail.
void DirSelectDown()
Goes one directory level down.
void DoScanAction(bool start)
Action scan request.
void DoMarkAll(bool mark=true)
Mark or unmark all items.
void SelectImage(int id)
Select item if it is displayed.
MythUIText * m_crumbsText
~GalleryThumbView() override
Destructor.
MythUIText * m_typeFilterText
QPair< int, int > IntPair
bool m_editsAllowed
Edit privileges.
void DoMarkItem(bool mark)
Mark or unmark a single item.
void DoShowHidden(bool show=true)
Show or hide hidden files.
void MenuMain()
Shows the main menu when the MENU button was pressed.
void MenuTransform(MythMenu *mainMenu)
Add a Transform submenu.
void Start()
Start Thumbnail screen.
bool keyPressEvent(QKeyEvent *event) override
Handle keypresses.
void MenuSlideshow(MythMenu *mainMenu)
Add a Slideshow submenu.
void ZoomOut()
Use larger buttonlist widgets.
void LoadData(int parent)
Loads & displays images from database.
MythUIProgressBar * m_scanProgressBar
MythScreenStack & m_popupStack
void ResetUiSelection()
Clears all text widgets for selected item.
void TransformItem(ImageFileTransform tran=kRotateCW)
Apply transform to an image.
QPair< MythUIButtonListItem *, int > ThumbLocation
void FlipHorizontalMarked()
void DoSetCover(bool reset=false)
Set or reset thumbnails to use for a directory cover.
void DoHideMarked(bool hide=true)
Hide or unhide marked items.
MythUIText * m_hideFilterText
void customEvent(QEvent *event) override
Handle custom events.
void Move()
Move marked images to selected dir. If no marked files, use previously marked files....
void Close() override
Exit Gallery.
void RemoveImages(const QStringList &ids, bool deleted=true)
Cleanup UI & image caches when a device is removed.
void DoHideItem(bool hide=true)
Hide or unhide item.
void ZoomIn()
Use smaller buttonlist widgets.
void MakeDir()
Show dialog to input new directory name.
QHash< QString, IntPair > m_scanProgress
Last scan updates received from scanners.
void MenuMarked(MythMenu *mainMenu)
Adds a Marking submenu.
void SetUiSelection(MythUIButtonListItem *item)
Updates text widgets for selected item.
void Eject()
Remove local device (or Import) from Gallery.
void TransformMarked(ImageFileTransform tran=kRotateCW)
Apply transform to marked images.
void MenuPaste(MythMenu *mainMenu)
Add a Paste submenu.
ImageManagerFe & m_mgr
Manages the images.
MythUIText * m_captionText
void DeleteItem()
Confirm user deletion of an item.
QSet< QString > m_scanActive
Scanners currently scanning.
GalleryThumbView(MythScreenStack *parent, const char *name)
Constructor.
void Import()
Executes user 'Import command'.
bool DirSelectUp()
Goes up one directory level.
static void DoRepeat(int on)
MenuSubjects m_menuState
Current selection/marked files when menu is invoked.
void MenuAction(MythMenu *mainMenu)
Add a Action submenu.
void ShowPassword()
Displays dialog to accept password.
void BuildImageList()
Displays all images in current view.
QMultiHash< int, ThumbLocation > m_pendingMap
Buttons waiting for thumbnails to be created.
MythUIText * m_scanProgressText
void MarkInvertAll()
Invert all marked items.
void RecursiveSlideshow()
void DoShowType(int type)
Show/hide pictures or videos.
MythUIButtonList * m_imageList
void ItemClicked(MythUIButtonListItem *item)
Action item click.
void StartSlideshow(ImageSlideShowType mode)
Start slideshow screen.
MythUIText * m_positionText
InfoList m_infoList
Image details overlay.
void DeleteMarked()
Confirm user deletion of marked files.
void UpdateImageItem(MythUIButtonListItem *item)
Initialises a single buttonlist item.
QSet< int > m_thumbExists
Images where thumbnails are known to exist.
void FlipVerticalMarked()
void SelectZoomWidget(int change)
Change buttonlist to use a different size.
QList< MythUIButtonList * > m_zoomWidgets
Theme buttonlist widgets implementing zoom levels.
void ShowRenameInput()
Show dialog to allow input.
void UpdateScanProgress(const QString &scanner, int current, int total)
Update progressbar with scan status.
QString CheckThumbnail(MythUIButtonListItem *item, const ImagePtrK &im, ImageIdList &request, int index)
Verify thumbnail is known to exist.
void ShowDetails()
Shows exif info/details about an item.
void MenuShow(MythMenu *mainMenu)
Add a Show submenu.
static QString FormatSize(int sizeKib)
void GetDescendants(const ImageIdList &ids, ImageList &files, ImageList &dirs) const
Return all (local or remote) images that are direct children of a dir.
bool GetVisibility() const
void SetType(int showType)
void SetVisibility(bool showHidden)
void SetSortOrder(int order, int dirOrder)
int GetImages(const ImageIdList &ids, ImageList &files, ImageList &dirs) const
Returns images (local or remote but not a combination)
static bool IsLocalId(int id)
Determine image type (local/remote) from its id. Root/Gallery is remote.
The image manager for use by Frontends.
QString ShortDateOf(const ImagePtrK &im) const
Return a short datestamp for thumbnail captions.
QString ChangeOrientation(ImageFileTransform transform, const ImageIdList &ids)
Apply an orientation transform to images.
QString CreateImages(int destId, const ImageListK &images)
Copies database images (but not the files themselves).
QString MoveDbImages(const ImagePtrK &destDir, ImageListK &images, const QString &srcPath)
Moves database images (but not the files themselves).
QString CrumbName(ImageItemK &im, bool getPath=false) const
Return a displayable name (with optional path) for an image.
static QString LongDateOf(const ImagePtrK &im)
Return a timestamp/datestamp for an image or dir.
static QString ConstructPath(const QString &path, const QString &name)
Assembles a canonical file path without corrupting its absolute/relative nature.
static QStringList ScanQuery()
Returns storage group scanner status.
QString DeleteFiles(const ImageIdList &ids)
Delete images.
QString MakeDir(int parent, const QStringList &names, bool rescan=true)
Create directories.
QString SetCover(int parent, int cover)
Set image to use as a cover thumbnail(s)
QString HideFiles(bool hidden, const ImageIdList &ids)
Hide/unhide images.
void CloseDevices(int devId=DEVICE_INVALID, bool eject=false)
static QString IgnoreDirs(const QString &excludes)
Set directories to ignore during scans of the storage group.
void CreateThumbnails(const ImageIdList &ids, bool forFolder)
Create thumbnails or verify that they already exist.
QString ScanImagesAction(bool start, bool local=false)
Handle scanner start/stop commands.
void SetDateFormat(const QString &format)
QString BuildTransferUrl(const QString &path, bool local) const
Generate Myth URL for a local or remote path.
QString RenameFile(const ImagePtrK &im, const QString &name)
Rename an image.
bool DetectLocalDevices()
Detect and scan local devices.
void Display(ImageItemK &im, const QStringList &tagStrings)
Build list of metadata tags.
void Update(const ImagePtrK &im)
Populates available exif details for the current image/dir.
InfoVisibleState GetState() const
bool Hide()
Remove infolist from display.
void Toggle(const ImagePtrK &im)
Toggle infolist state for an image. Focusable widgets toggle between Basic & Full info....
bool Create(bool focusable)
Initialise buttonlist from XML.
This is a wrapper around QThread that does several additional things.
void RunProlog(void)
Sets up a thread, call this if you reimplement run().
bool isFinished(void) const
void start(QThread::Priority p=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
void RunEpilog(void)
Cleans up a thread's resources, call this if you reimplement run().
QString objectName(void) const
Dialog asking for user confirmation.
void SaveBoolSetting(const QString &key, bool newValue)
QString GetHostName(void)
void SaveSetting(const QString &key, int newValue)
QString GetSetting(const QString &key, const QString &defaultval="")
int GetNumSetting(const QString &key, int defaultval=0)
bool GetBoolSetting(const QString &key, bool defaultval=false)
Basic menu dialog, message and a list of options.
This class is used as a container for messages.
const QString & Message() const
static const Type kMythEventMessage
MythScreenStack * GetMainStack()
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
MythScreenStack * GetStack(const QString &Stackname)
void addListener(QObject *listener)
Add a listener to the observable.
void removeListener(QObject *listener)
Remove a listener to the observable.
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Screen in which all other widgets are contained and rendered.
void BuildFocusList(void)
MythUIType * GetFocusWidget(void) const
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
bool SetFocusWidget(MythUIType *widget=nullptr)
Dialog prompting the user to enter a text string.
void SetVisible(bool visible) override
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
virtual void SetText(const QString &text)
void RemoveFromCacheByFile(const QString &File)
virtual void SetVisible(bool visible)
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
static bool CopyFile(const QString &src, const QString &dst, bool overwrite=false, bool verify=false)
static bool MoveFile(const QString &src, const QString &dst, bool overwrite=false)
Worker thread for running import.
void run() override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
ShellThread(QString cmd, QString path)
int GetResult(void) const
Worker thread for copying/moving files.
bool m_move
Copy if false, Move if true.
MythUIProgressDialog * m_dialog
Images for which copy/move failed.
QSet< ImagePtrK > ImageSet
TransferThread(TransferMap files, bool move, MythUIProgressDialog *dialog)
void run() override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
Q_DECLARE_TR_FUNCTIONS(FileTransferWorker)
QMap< ImagePtrK, QString > TransferMap
TransferMap m_files
Maps source filepath to destination filepath.
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
Provides Gallery configuration screens.
@ kNoInfo
Details not displayed.
ImageSlideShowType
Type of slide show.
static void WaitUntilDone(MThread &worker)
Runs a worker thread and waits for it to finish.
static QString clean_comment(const QString &comment)
Implements Gallery Thumbnail screen.
ImageCaptionType
Type of captions to display.
@ kUserCaption
Exif comments.
SlideOrderType
Order of images in slideshow.
@ kSeasonal
Biased random selection so that images are more likely to appear on anniversaries.
@ kShuffle
Each image appears exactly once, but in random order.
@ kRandom
Random selection from view. An image may be absent or appear multiple times.
@ kOrdered
Ordered as per user setting GallerySortOrder.
@ kVideoOnly
Hide pictures.
@ kPicAndVideo
Show Pictures & Videos.
QVector< ImagePtr > ImageList
QList< ImagePtrK > ImageListK
QSharedPointer< ImageItemK > ImagePtrK
QPair< int, QString > ThumbPair
static constexpr int GALLERY_DB_ID
static constexpr int PHOTO_DB_ID
@ kDevice
Storage Group and local mounted media.
@ kCloneDir
A device sub dir comprised from multiple SG dirs.
@ kDirectory
A device sub directory.
QSharedPointer< ImageItem > ImagePtr
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythMainWindow * GetMythMainWindow(void)
MythUIBusyDialog * ShowBusyPopup(const QString &message)
uint myth_system(const QString &command, uint flags, std::chrono::seconds timeout)
static MythThemedMenu * menu
QHash< QString, QString > InfoMap
MythUIHelper * GetMythUI()
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
MBASE_PUBLIC long long copy(QFile &dst, QFile &src, uint block_size=0)
Copies src file to dst file.
def scan(profile, smoonURL, gate)
static void show(uint8_t *buf, int length)
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)