Go to the documentation of this file.
6 #include <QApplication>
20 #define LOC QString("Thumbview: ")
37 LOG(VB_GENERAL, LOG_INFO, QString(
"Executing \"%1\"").
arg(cmd));
41 LOG(VB_GENERAL, LOG_INFO, QString(
" ...with result %1").
arg(
m_result));
75 auto add_size = [](
int t,
const ImagePtrK & im){
return t + im->m_size; };
76 int total = std::accumulate(keys.cbegin(), keys.cend(), 0, add_size);
79 #if QT_VERSION < QT_VERSION_CHECK(5,10,0)
82 QString newPath =
m_files.value(im);
83 #elif QT_VERSION < QT_VERSION_CHECK(5,15,0)
84 for (
auto it =
m_files.constKeyValueBegin();
85 it !=
m_files.constKeyValueEnd(); it++)
88 QString newPath = (*it).second;
90 for (
auto it =
m_files.constKeyValueBegin();
91 it !=
m_files.constKeyValueEnd(); it++)
94 QString newPath = it->second;
99 QString message = QString(
"%1 %2\n%3")
100 .arg(
action, QFileInfo(im->m_url).fileName(),
104 QApplication::postEvent(
m_dialog, pue);
107 LOG(VB_FILE, LOG_INFO, QString(
"%2 %3 -> %4")
118 LOG(VB_GENERAL, LOG_ERR,
119 QString(
"%1: Failed to copy/move %2 -> %3")
123 progressSize += im->m_size;
131 QApplication::postEvent(
m_dialog, pue);
154 std::this_thread::sleep_for(std::chrono::milliseconds(1));
155 QCoreApplication::processEvents();
186 LOG(VB_GUI, LOG_DEBUG,
LOC +
"Exiting Gallery");
196 LOG(VB_GUI, LOG_DEBUG,
LOC +
"Closing Gallery");
224 QString name = QString(
"images%1").arg(zoom++);
236 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Screen 'Gallery' is missing 'images0'");
239 LOG(VB_GUI, LOG_DEBUG,
LOC + QString(
"Screen 'Gallery' found %1 zoom levels")
245 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Cannot load 'Info buttonlist'");
285 for (
int i = 0; i < actions.size() && !handled; i++)
287 QString
action = actions[i];
292 else if (
action ==
"INFO")
294 else if (
action ==
"ZOOMIN")
296 else if (
action ==
"ZOOMOUT")
298 else if (
action ==
"ROTRIGHT")
300 else if (
action ==
"ROTLEFT")
302 else if (
action ==
"FLIPHORIZONTAL")
304 else if (
action ==
"FLIPVERTICAL")
306 else if (
action ==
"COVER")
323 else if (
action ==
"PLAY")
325 else if (
action ==
"RECURSIVESHOW")
328 if (im && im->IsDirectory())
331 else if (
action ==
"MARK")
372 auto *me =
dynamic_cast<MythEvent *
>(event);
376 const QString& mesg = me->
Message();
377 QStringList extra = me->ExtraDataList();
380 QStringList
token = mesg.split(
' ');
384 if (
token[0] ==
"IMAGE_METADATA")
386 int id = extra[0].toInt();
389 if (selected && selected->m_id ==
id)
392 else if (
token[0] ==
"THUMB_AVAILABLE")
394 int id = extra[0].toInt();
400 QList<ThumbLocation> affected =
m_pendingMap.values(
id);
403 if (affected.isEmpty())
406 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
407 QString(
"Rx %1 : %2").
arg(
token[0], extra.join(
",")));
416 int index = location.second;
426 else if (
token[0] ==
"IMAGE_DB_CHANGED")
429 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
430 QString(
"Rx %1 : %2").
arg(
token[0], extra.join(
",")));
432 if (!extra.isEmpty())
434 #if QT_VERSION < QT_VERSION_CHECK(5,14,0)
435 QStringList idDeleted =
436 extra[0].split(
",", QString::SkipEmptyParts);
438 QStringList idDeleted =
439 extra[0].split(
",", Qt::SkipEmptyParts);
444 if (extra.size() >= 2)
446 #if QT_VERSION < QT_VERSION_CHECK(5,14,0)
447 QStringList idChanged =
448 extra[1].split(
",", QString::SkipEmptyParts);
450 QStringList idChanged =
451 extra[1].split(
",", Qt::SkipEmptyParts);
459 else if (
token[0] ==
"IMAGE_DEVICE_CHANGED")
462 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
463 QString(
"Rx %1 : %2").
arg(
token[0], extra.join(
",")));
470 for (
const QString & url : qAsConst(extra))
476 else if (
token[0] ==
"IMAGE_SCAN_STATUS" && extra.size() == 3)
486 QString resultid = dce->GetId();
487 int buttonnum = dce->GetResult();
489 if (resultid ==
"FileRename")
491 QString newName = dce->GetResultText();
500 else if (resultid ==
"MakeDir")
505 QString name = dce->GetResultText();
506 QString err = name.contains(
"/")
514 else if (resultid ==
"SlideOrderMenu")
520 case 0: slideOrder =
kOrdered;
break;
521 case 1: slideOrder =
kShuffle;
break;
522 case 2: slideOrder =
kRandom;
break;
526 LOG(VB_FILE, LOG_DEBUG,
LOC + QString(
"Order %1").
arg(slideOrder));
528 else if (resultid ==
"ImageCaptionMenu")
542 else if (resultid ==
"DirCaptionMenu")
555 else if (resultid ==
"Password")
557 QString password = dce->GetResultText();
560 else if (buttonnum == 1)
570 else if (resultid ==
"ConfirmDeleteMarked")
591 for (
const QString &
id : qAsConst(ids))
599 for (
const QString & url : qAsConst(urls))
601 LOG(VB_FILE, LOG_DEBUG,
LOC +
602 QString(
"Clearing image cache of '%1'").
arg(url));
618 if (message.size() == 4 && message[0] ==
"OK")
662 "Scan storage group using menu,\n"
663 "or insert/mount local media.\n"));
682 for (
const ImagePtrK & im : qAsConst(nodes))
690 QVariant::fromValue(im));
692 item->setCheckable(
true);
704 item->DisplayState(
"upfolder",
"parenttype");
706 else if (im == selected)
730 if (im->m_dirCount > 0)
733 .arg(im->m_fileCount).arg(im->m_dirCount),
738 item->
SetText(QString::number(im->m_fileCount),
"childcount");
741 item->
DisplayState(im->IsDevice() ?
"device" :
"subfolder",
"buttontype");
757 QString hideState = (im->m_isHidden) ?
"hidden" :
"visible";
763 im->IsFile() ?
"GalleryImageCaption"
764 :
"GalleryDirCaption");
786 if (im->m_thumbNails.size() == 1)
798 for (
int index = 0; index < im->m_thumbNails.size(); ++index)
802 thumbMap.insert(QString(
"thumbimage%1").
arg(index), url);
804 if (!thumbMap.isEmpty())
809 if (!request.isEmpty())
828 ThumbPair thumb(im->m_thumbNails.at(index));
829 int id = thumb.first;
856 if (im->m_thumbNails.size() == 1)
863 default: button->
SetImage(url,
"folderimage");
break;
868 button->
SetImage(url, QString(
"thumbimage%1").
arg(index));
888 LOG(VB_GUI, LOG_DEBUG,
LOC + QString(
"Scan Finished %1 %2/%3")
930 LOG(VB_GUI, LOG_DEBUG,
LOC + QString(
"Scan Started %1 %2/%3")
943 currentAgg +=
scan.first;
944 totalAgg +=
scan.second;
1001 if (im->IsFile() || im->IsDevice())
1004 if (!im->m_comment.isEmpty())
1005 text << im->m_comment;
1021 case kPicOnly : text = tr(
"Pictures");
break;
1022 case kVideoOnly : text = tr(
"Videos");
break;
1043 auto *
menu =
new MythMenu(tr(
"Gallery Options"),
this,
"mainmenu");
1072 if (popup->Create())
1125 if (
menu->IsEmpty())
1144 if (files.isEmpty())
1146 if (files.isEmpty())
1149 QString
title = tr(
"%L1 marked").arg(files.size());
1180 mainMenu->
AddItem(tr(
"Transforms"),
nullptr,
menu);
1192 mainMenu->
AddItem(tr(
"Transforms"),
nullptr,
menu);
1224 menu =
new MythMenu(selected->m_baseName,
this,
"actionmenu");
1229 if (selected->m_isHidden)
1238 else if (selected->m_userThumbnail)
1243 if (selected->IsDirectory()
1253 if (selected->IsDevice() && selected->IsLocal())
1256 if (
menu->IsEmpty())
1274 case kShuffle : ordering = tr(
"Shuffled");
break;
1275 case kRandom : ordering = tr(
"Random");
break;
1276 case kSeasonal : ordering = tr(
"Seasonal");
break;
1278 case kOrdered : ordering = tr(
"Ordered");
break;
1281 auto *
menu =
new MythMenu(tr(
"Slideshow") +
" (" + ordering +
")",
1282 this,
"SlideshowMenu");
1296 auto *orderMenu =
new MythMenu(tr(
"Slideshow Order"),
this,
"SlideOrderMenu");
1298 orderMenu->AddItem(tr(
"Ordered"),
nullptr,
nullptr, order ==
kOrdered);
1299 orderMenu->AddItem(tr(
"Shuffled"),
nullptr,
nullptr, order ==
kShuffle);
1300 orderMenu->AddItem(tr(
"Random"),
nullptr,
nullptr, order ==
kRandom);
1301 orderMenu->AddItem(tr(
"Seasonal"),
nullptr,
nullptr, order ==
kSeasonal);
1303 menu->AddItem(tr(
"Change Order"),
nullptr, orderMenu);
1310 mainMenu->
AddItem(tr(
"Slideshow"),
nullptr,
menu);
1320 auto *
menu =
new MythMenu(tr(
"Show Options"),
this,
"showmenu");
1333 auto *captionMenu =
new MythMenu(tr(
"Image Captions"),
this,
1334 "ImageCaptionMenu");
1338 captionMenu->AddItem(tr(
"Comment"),
nullptr,
nullptr,
show ==
kUserCaption);
1339 captionMenu->AddItem(tr(
"None"),
nullptr,
nullptr,
show ==
kNoCaption);
1341 menu->AddItem(tr(
"Image Captions"),
nullptr, captionMenu);
1344 captionMenu =
new MythMenu(tr(
"Directory Captions"),
this,
"DirCaptionMenu");
1348 captionMenu->AddItem(tr(
"None"),
nullptr,
nullptr,
show ==
kNoCaption);
1350 menu->AddItem(tr(
"Directory Captions"),
nullptr, captionMenu);
1366 ? tr(
"Show Details") : tr(
"Hide Details");
1442 if (slide->Create())
1450 if (selected->IsDirectory())
1453 slide->Start(mode, selected->m_id);
1458 slide->Start(mode, selected->m_parentId, selected->m_id);
1474 LOG(VB_GUI, LOG_DEBUG,
LOC +
1475 QString(
"Going up from %1").
arg(im->m_filePath));
1495 LOG(VB_GUI, LOG_DEBUG,
LOC +
1496 QString(
"Going down to %1").
arg(im->m_filePath));
1560 ids.append(im->m_id);
1641 ShowDialog(tr(
"Do you want to delete all marked files ?"),
1642 "ConfirmDeleteMarked");
1725 if (popup->Create())
1727 popup->SetReturnEvent(
this, event);
1743 QString msg = tr(
"Enter a new name:");
1746 if (popup->Create())
1748 popup->SetReturnEvent(
this,
"FileRename");
1771 QString msg = tr(
"Enter password:");
1773 if (popup->Create())
1775 popup->SetReturnEvent(
this,
"Password");
1884 tr(
"Enter name of new directory"),
1886 if (popup->Create())
1888 popup->SetReturnEvent(
this,
"MakeDir");
1920 if (!destDir || destDir->IsFile())
1925 if (markedIds.isEmpty())
1928 if (markedIds.isEmpty())
1940 if (dirs.isEmpty() && files.isEmpty())
1948 ImagePtrK aChild = dirs.isEmpty() ? files[0] : dirs[0];
1951 int basePathSize = aChild->m_filePath.size() - aChild->m_baseName.size();
1956 for (
const ImagePtr & im : qAsConst(files))
1960 im->m_filePath.mid(basePathSize));
1963 destDir->IsLocal()));
1986 if (!failed.isEmpty())
1987 ShowOkPopup(tr(
"Failed to copy %L1/%Ln file(s)",
nullptr, transfers.size())
1988 .arg(failed.size()));
1991 for (
const ImagePtrK & im : qAsConst(failed))
1992 transfers.remove(im);
1997 QStringList dirPaths;
1998 for (
const ImagePtr & im : qAsConst(dirs))
2000 QString relPath = im->m_filePath.mid(basePathSize);
2002 dirPaths << relPath;
2009 newImages.append(im);
2013 if (!dirPaths.isEmpty())
2016 if (!newImages.isEmpty())
2026 for (
const ImagePtrK & im : qAsConst(newImages))
2048 if (!destDir || destDir->IsFile())
2053 if (markedIds.isEmpty())
2056 if (markedIds.isEmpty())
2087 int basePathSize = aChild->m_filePath.size() - aChild->m_baseName.size();
2088 QString parentPath = aChild->m_filePath.left(basePathSize);
2092 for (
const QSharedPointer<ImageItem> & im : qAsConst(images))
2096 im->m_filePath.mid(basePathSize));
2122 if (!failed.isEmpty())
2123 ShowOkPopup(tr(
"Failed to move %L1/%Ln file(s)",
nullptr, transfers.size())
2124 .arg(failed.size()));
2127 for (
const ImagePtrK & im : qAsConst(failed))
2128 transfers.remove(im);
2130 if (!transfers.isEmpty())
2135 for (
const ImagePtrK & im : qAsConst(moved))
2152 ShowOkPopup(tr(
"Failed to create temporary directory."));
2158 cmd.replace(
"%TMPDIR%", path);
2162 ShowBusyPopup(tr(
"Running Import command.\nPlease wait..."));
2177 LOG(VB_GENERAL, LOG_ERR,
LOC + err);
void FlipVerticalMarked()
static void UpdateThumbnail(MythUIButtonListItem *button, const ImagePtrK &im, const QString &url, int index)
Update the buttonlist item with a thumbnail.
@ kPicAndVideo
Show Pictures & Videos.
QSharedPointer< ImageItemK > ImagePtrK
MythScreenStack * GetMainStack()
void Display(ImageItemK &im, const QStringList &tagStrings)
Build list of metadata tags.
int GetImages(const ImageIdList &ids, ImageList &files, ImageList &dirs) const
Returns images (local or remote but not a combination)
static Type MythEventMessage
void start(QThread::Priority p=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
uint myth_system(const QString &command, uint flags, uint timeout)
MythUIBusyDialog * ShowBusyPopup(const QString &message)
MythUIProgressBar * m_scanProgressBar
QSet< int > m_thumbExists
Images where thumbnails are known to exist.
QPair< int, int > IntPair
long long copy(QFile &dst, QFile &src, uint block_size)
Copies src file to dst file.
static QString ConstructPath(const QString &path, const QString &name)
Assembles a canonical file path without corrupting its absolute/relative nature.
void CreateThumbnails(const ImageIdList &ids, bool forFolder)
Create thumbnails or verify that they already exist.
MythUIText * m_positionText
QString GetPosition() const
Get positional status.
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
static void error(const char *str,...)
Q_DECLARE_TR_FUNCTIONS(FileTransferWorker)
ImageSlideShowType
Type of slide show.
void MenuPaste(MythMenu *mainMenu)
Add a Paste submenu.
MythUIButtonList * m_imageList
QString CreateImages(int destId, const ImageListK &images)
Copies database images (but not the files themselves).
void MakeDir()
Show dialog to input new directory name.
void SelectZoomWidget(int change)
Change buttonlist to use a different size.
QString ScanImagesAction(bool start, bool local=false)
Handle scanner start/stop commands.
QString BuildTransferUrl(const QString &path, bool local) const
Generate Myth URL for a local or remote path.
QHash< QString, IntPair > m_scanProgress
Last scan updates received from scanners.
void customEvent(QEvent *event) override
Handle custom events.
void DirSelectDown()
Goes one directory level down.
void Mark(int id, bool mark)
Mark/unmark an image/dir.
InfoList m_infoList
Image details overlay.
QString MakeDir(int parent, const QStringList &names, bool rescan=true)
Create directories.
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
@ kDirectory
A device sub directory.
void ShowPassword()
Displays dialog to accept password.
This class is used as a container for messages.
void FlipHorizontalMarked()
static QString IgnoreDirs(const QString &excludes)
Set directories to ignore during scans of the storage group.
GalleryThumbView(MythScreenStack *parent, const char *name)
Constructor.
arg(title).arg(filename).arg(doDelete))
void LoadData(int parent)
Loads & displays images from database.
TransferMap m_files
Maps source filepath to destination filepath.
void run() override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
@ kNoInfo
Details not displayed.
MythUIText * m_crumbsText
void Update(const ImagePtrK &im)
Populates available exif details for the current image/dir.
MythUIText * m_typeFilterText
QString HideFiles(bool hidden, const ImageIdList &ids)
Hide/unhide images.
void MenuAction(MythMenu *mainMenu)
Add a Action submenu.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
void RunProlog(void)
Sets up a thread, call this if you reimplement run().
void SetDateFormat(const QString &format)
Screen in which all other widgets are contained and rendered.
static void show(uint8_t *buf, int length)
@ kSeasonal
Biased random selection so that images are more likely to appear on anniversaries.
MythUIText * m_hideFilterText
void Import()
Executes user 'Import command'.
ImagePtrK GetParent() const
void SetVisibility(bool showHidden)
void ZoomIn()
Use smaller buttonlist widgets.
void DoHideItem(bool hide=true)
Hide or unhide item.
TransferThread(TransferMap files, bool move, MythUIProgressDialog *dialog)
MenuSubjects m_menuState
Current selection/marked files when menu is invoked.
static MythThemedMenu * menu
QMap< ImagePtrK, QString > TransferMap
void CloseDevices(int devId=DEVICE_INVALID, bool eject=false)
bool Select(int id, int fallback=0)
Selects first occurrence of an image.
def scan(profile, smoonURL, gate)
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
const QString & Message() const
bool Create() override
Initialises and shows the graphical elements.
QString ChangeOrientation(ImageFileTransform transform, const ImageIdList &ids)
Apply an orientation transform to images.
MythUIType * GetFocusWidget(void) const
void MenuMain()
Shows the main menu when the MENU button was pressed.
void MarkAll()
Mark all images/dirs.
QHash< QString, QString > InfoMap
void addListener(QObject *listener)
Add a listener to the observable.
void SetUiSelection(MythUIButtonListItem *item)
Updates text widgets for selected item.
bool keyPressEvent(QKeyEvent *event) override
Handle keypresses.
void DoSetCover(bool reset=false)
Set or reset thumbnails to use for a directory cover.
Worker thread for copying/moving files.
bool m_move
Copy if false, Move if true.
Worker thread for running import.
void ResetUiSelection()
Clears all text widgets for selected item.
void Toggle(const ImagePtrK &im)
Toggle infolist state for an image. Focusable widgets toggle between Basic & Full info....
void MenuShow(MythMenu *mainMenu)
Add a Show submenu.
void ShowSettings()
Show configuration screen.
void SetSortOrder(int order, int dirOrder)
void UpdateScanProgress(const QString &scanner, int current, int total)
Update progressbar with scan status.
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
bool SetFocusWidget(MythUIType *widget=nullptr)
void TransformMarked(ImageFileTransform tran=kRotateCW)
Apply transform to marked images.
Basic menu dialog, message and a list of options.
void SelectImage(int id)
Select item if it is displayed.
void DoShowHidden(bool show=true)
Show or hide hidden files.
static QString FormatSize(int sizeKib)
DirectoryView * m_view
List of images comprising the view.
void BuildFocusList(void)
Implements Gallery Thumbnail screen.
void MenuSlideshow(MythMenu *mainMenu)
Add a Slideshow submenu.
@ kShuffle
Each image appears exactly once, but in random order.
void BuildImageList()
Displays all images in current view.
void GetDescendants(const ImageIdList &ids, ImageList &files, ImageList &dirs) const
Return all (local or remote) images that are direct children of a dir.
void StartSlideshow(ImageSlideShowType mode)
Start slideshow screen.
void ShowRenameInput()
Show dialog to allow input.
void ShowDialog(const QString &msg, const QString &event="")
Show a confirmation dialog.
ImageListK GetAllNodes() const
Get all images/dirs in view.
void InvertMarked()
Mark all unmarked items, unmark all marked items.
void RemoveFromCacheByFile(const QString &File)
void DeleteMarked()
Confirm user deletion of marked files.
QList< ImagePtrK > ImageListK
void RunEpilog(void)
Cleans up a thread's resources, call this if you reimplement run().
ImageCaptionType
Type of captions to display.
QSet< QString > m_scanActive
Scanners currently scanning.
QString GetCachedThumbUrl(int id) const
static QString LongDateOf(const ImagePtrK &im)
Return a timestamp/datestamp for an image or dir.
bool GetVisibility() const
void ZoomOut()
Use larger buttonlist widgets.
bool isFinished(void) const
ImagePtrK GetSelected() const
Get current selection.
QString SetCover(int parent, int cover)
Set image to use as a cover thumbnail(s)
void ItemClicked(MythUIButtonListItem *item)
Action item click.
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
InfoVisibleState GetState() const
static bool IsLocalId(int id)
Determine image type (local/remote) from its id. Root/Gallery is remote.
void DoHideMarked(bool hide=true)
Hide or unhide marked items.
bool DirSelectUp()
Goes up one directory level.
void UpdateImageItem(MythUIButtonListItem *item)
Initialises a single buttonlist item.
void ShowDetails()
Shows exif info/details about an item.
QString CheckThumbnail(MythUIButtonListItem *item, const ImagePtrK &im, ImageIdList &request, int index)
Verify thumbnail is known to exist.
static bool CopyFile(const QString &src, const QString &dst, bool overwrite=false, bool verify=false)
MythScreenStack & m_popupStack
QMultiHash< int, ThumbLocation > m_pendingMap
Buttons waiting for thumbnails to be created.
QVector< ImagePtr > ImageList
int GetNumSetting(const QString &key, int defaultval=0)
void TransformItem(ImageFileTransform tran=kRotateCW)
Apply transform to an image.
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
MythUIText * m_scanProgressText
void MarkInvertAll()
Invert all marked items.
bool LoadFromDb(int parentId) override
Populate view from database as images/subdirs of a directory. View is ordered: Parent dir,...
bool GetBoolSetting(const QString &key, bool defaultval=false)
void RecursiveSlideshow()
bool Hide()
Remove infolist from display.
QSet< ImagePtrK > ImageSet
void Move()
Move marked images to selected dir. If no marked files, use previously marked files....
QString MoveDbImages(const ImagePtrK &destDir, ImageListK &images, const QString &srcPath)
Moves database images (but not the files themselves).
ImageManagerFe & m_mgr
Manages the images.
@ kUserCaption
Exif comments.
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
QSharedPointer< ImageItem > ImagePtr
bool m_editsAllowed
Edit privileges.
Dialog asking for user confirmation. Ok and optional Cancel button.
void SetType(int showType)
The image manager for use by Frontends.
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
static void WaitUntilDone(MThread &worker)
Runs a worker thread and waits for it to finish.
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
void DoMarkAll(bool mark=true)
Mark or unmark all items.
int GetResult(void) const
QString CrumbName(ImageItemK &im, bool getPath=false) const
Return a displayable name (with optional path) for an image.
virtual void SetText(const QString &text)
virtual void SetVisible(bool visible)
static bool MoveFile(const QString &src, const QString &dst, bool overwrite=false)
This is a wrapper around QThread that does several additional things.
void DeleteItem()
Confirm user deletion of an item.
MenuSubjects GetMenuSubjects()
Determine current selection, markings & various info to support menu display.
QList< MythUIButtonList * > m_zoomWidgets
Theme buttonlist widgets implementing zoom levels.
MythMainWindow * GetMythMainWindow(void)
SlideOrderType
Order of images in slideshow.
~GalleryThumbView() override
Destructor.
void ClearCache()
Clears UI cache.
void RemoveImages(const QStringList &ids, bool deleted=true)
Cleanup UI & image caches when a device is removed.
void Clear(bool resetParent=true)
Resets view.
ShellThread(QString cmd, QString path)
QString objectName(void) const
MythScreenStack * GetStack(const QString &Stackname)
void DoShowType(int type)
Show/hide pictures or videos.
QStringList RemoveImage(int id, bool deleted=false)
Clear file/dir and all its ancestors from UI cache so that ancestor thumbnails are recalculated....
void DoMarkItem(bool mark)
Mark or unmark a single item.
void MenuTransform(MythMenu *mainMenu)
Add a Transform submenu.
QString GetHostName(void)
QPair< int, QString > ThumbPair
@ kOrdered
Ordered as per user setting GallerySortOrder.
QPair< MythUIButtonListItem *, int > ThumbLocation
QString DeleteFiles(const ImageIdList &ids)
Delete images.
MythUIText * m_captionText
void DoScanAction(bool start)
Action scan request.
bool Create(bool focusable)
Initialise buttonlist from XML.
Provides Gallery configuration screens.
Dialog prompting the user to enter a text string.
void SaveSetting(const QString &key, int newValue)
A datastore of images for display by a screen. Provides an ordered list of dirs & images from a singl...
@ kDevice
Storage Group and local mounted media.
MythUIHelper * GetMythUI()
bool IsMarked(int id) const
void SetVisible(bool visible) override
void ClearMarked()
Unmark all items.
void MenuMarked(MythMenu *mainMenu)
Adds a Marking submenu.
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
@ kRandom
Random selection from view. An image may be absent or appear multiple times.
void Close() override
Exit Gallery.
static QStringList ScanQuery()
Returns storage group scanner status.
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
QString RenameFile(const ImagePtrK &im, const QString &name)
Rename an image.
QString ShortDateOf(const ImagePtrK &im) const
Return a short datestamp for thumbnail captions.
void Eject()
Remove local device (or Import) from Gallery.
void removeListener(QObject *listener)
Remove a listener to the observable.
void run() override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
t<< doc.toString(4);f.close();LOG(VB_JOBQUEUE, LOG_INFO, "Copying video file");bool res=copyFile(filename, saveDirectory+title+"/"+baseName);if(!res) return 0;if(QFile::exists(filename+".png")) { LOG(VB_JOBQUEUE, LOG_INFO, "Copying preview image");res=copyFile(filename+".png", saveDirectory+title+"/"+baseName+".png");if(!res) return 0;} LOG(VB_JOBQUEUE, LOG_INFO, "Item Archived OK");return 1;}int NativeArchive::exportVideo(QDomElement &itemNode, const QString &saveDirectory){ QString dbVersion=gCoreContext-> GetSetting("DBSchemaVer", "")
void SaveBoolSetting(const QString &key, bool newValue)
MythUIProgressDialog * m_dialog
Images for which copy/move failed.
@ kCloneDir
A device sub dir comprised from multiple SG dirs.
@ kVideoOnly
Hide pictures.
QString GetSetting(const QString &key, const QString &defaultval="")
void Start()
Start Thumbnail screen.
bool DetectLocalDevices()
Detect and scan local devices.