MythTV  master
Go to the documentation of this file.
7 #include "galleryslideview.h"
8 #include "galleryviews.h"
10 class DirectoryView;
11 class MythMenu;
15  kNoCaption = 0,
19 };
24 {
26 public:
27  GalleryThumbView(MythScreenStack *parent, const char *name);
28  ~GalleryThumbView() override;
29  bool Create() override; // MythScreenType
31 public slots:
32  void Start();
33  void Close() override; // MythScreenType
36 private:
37  bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
38  void mediaEvent(MythMediaEvent *event) override // MythUIType
39  { m_mgr.DeviceEvent(event); }
40  void customEvent(QEvent *event) override; // MythUIType
41  void RemoveImages(const QStringList &ids, bool deleted = true);
42  void BuildImageList();
43  void ResetUiSelection();
47  void UpdateScanProgress(const QString &scanner, int current, int total);
49  void SelectZoomWidget(int change);
50  QString CheckThumbnail(MythUIButtonListItem *item, const ImagePtrK &im,
51  ImageIdList &request, int index);
52  static void UpdateThumbnail(MythUIButtonListItem *button, const ImagePtrK &im,
53  const QString &url, int index);
54  void MenuMain();
55  void MenuShow(MythMenu *mainMenu);
56  void MenuMarked(MythMenu *mainMenu);
57  void MenuPaste(MythMenu *mainMenu);
58  void MenuTransform(MythMenu *mainMenu);
59  void MenuAction(MythMenu *mainMenu);
60  void MenuSlideshow(MythMenu *mainMenu);
61  bool DirSelectUp();
62  void DirSelectDown();
63  void ShowDialog(const QString &msg, const QString &event = "");
65 private slots:
66  void LoadData(int parent);
67  void SelectImage(int id);
72  void ShowDetails();
83  void MarkItem(bool mark = true);
84  void UnmarkItem() { MarkItem(false); }
85  void MarkAll(bool mark = true);
86  void UnmarkAll() { MarkAll(false); }
87  void MarkInvertAll();
88  void HideItem(bool hide = true);
89  void Unhide() { HideItem(false); }
90  void HideMarked(bool hide = true);
91  void UnhideMarked() { HideMarked(false); }
92  void ShowRenameInput();
93  void ShowHidden(bool show = true);
94  void HideHidden() { ShowHidden(false); }
95  void SetCover(bool reset = false);
96  void ResetCover() { SetCover(true); }
97  void ShowType(int type = kPicAndVideo);
100  void ZoomIn();
101  void ZoomOut();
102  void ShowSettings();
103  void StartScan(bool start = true);
104  void StopScan() { StartScan(false); }
105  void DeleteItem();
106  void DeleteMarked();
107  void Import();
108  void MakeDir();
109  void Eject();
110  void Copy(bool deleteAfter = false);
111  void Move();
112  void ShowPassword();
113  static void RepeatOn(int on = 1) { gCoreContext->SaveSetting("GalleryRepeat", on); }
114  static void RepeatOff() { RepeatOn(0); }
116 private:
117  using IntPair = QPair<int,int>;
119  // Theme widgets
131  QList<MythUIButtonList *> m_zoomWidgets;
132  int m_zoomLevel {0};
136  DirectoryView *m_view {nullptr};
140  QHash<QString, IntPair> m_scanProgress;
142  QSet<QString> m_scanActive;
147  using ThumbLocation = QPair<MythUIButtonListItem *, int>;
149  QHash<int, ThumbLocation> m_pendingMap;
151  QSet<int> m_thumbExists;
152  bool m_editsAllowed {false};
153 };
156 #endif // GALLERYVIEW_H
void SelectImage(int id)
Select item if it is displayed.
Type of slide show.
ImageManagerFe & m_mgr
Manages the images.
MenuSubjects m_menuState
Current selection/marked files when menu is invoked.
unsigned int slots[4]
Definition: element.c:38
MythUIText * m_crumbsText
void MenuShow(MythMenu *mainMenu)
Add a Show submenu.
~GalleryThumbView() override
MythUIText * m_typeFilterText
void Close() override
Exit Gallery.
The image info/details buttonlist overlay that displays exif tags.
Definition: galleryinfo.h:22
DirectoryView * m_view
List of images comprising the view.
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
Provides view datastores for Gallery screens.
void UpdateImageItem(MythUIButtonListItem *item)
Initialises a single buttonlist item.
Reset to Exif value.
Definition: imagemetadata.h:47
void SaveSetting(const QString &key, int newValue)
The image manager for use by Frontends.
Definition: imagemanager.h:456
void RemoveImages(const QStringList &ids, bool deleted=true)
Cleanup UI & image caches when a device is removed.
bool Create() override
Initialises and shows the graphical elements.
QSet< int > m_thumbExists
Images where thumbnails are known to exist.
static void ClearStorageGroup()
Clear database & thumbnails of Storage Group images.
QList< MythUIButtonList * > m_zoomWidgets
Theme buttonlist widgets implementing zoom levels.
void TransformItem(ImageFileTransform tran=kRotateCW)
Apply transform to an image.
Show Pictures & Videos.
Definition: imagemanager.h:78
void ShowDialog(const QString &msg, const QString &event="")
Show a confirmation dialog.
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: lang.c:20
MythUIText * m_scanProgressText
void customEvent(QEvent *event) override
Handle custom events.
void Eject()
Remove local device (or Import) from Gallery.
void Move()
Move marked images to selected dir. If no marked files, use previously marked files....
void ShowDetails()
Shows exif info/details about an item.
QPair< int, int > IntPair
void ItemClicked(MythUIButtonListItem *item)
Action item click.
QSharedPointer< ImageItemK > ImagePtrK
Definition: imagetypes.h:172
static void RepeatOn(int on=1)
QHash< int, ThumbLocation > m_pendingMap
Buttons waiting for thumbnails to be created.
void Start()
Start Thumbnail screen.
A datastore of images for display by a screen. Provides an ordered list of dirs & images from a singl...
Definition: galleryviews.h:170
void mediaEvent(MythMediaEvent *event) override
Media/Device status event handler, received from MythMediaMonitor.
GalleryThumbView(MythScreenStack *parent, const char *name)
bool m_editsAllowed
Edit privileges.
void MarkInvertAll()
Invert all marked items.
void HideItem(bool hide=true)
Hide or unhide item.
Hide videos.
Definition: imagemanager.h:79
void MarkAll(bool mark=true)
Mark or unmark all items.
QPair< MythUIButtonListItem *, int > ThumbLocation
Image transformations.
Definition: imagemetadata.h:46
Thumbnail screen.
void Copy(bool deleteAfter=false)
Copy marked images to selected dir. If no marked files, use previously marked files....
static void show(uint8_t *buf, int length)
Definition: ringbuffer.c:318
void LoadData(int parent)
Loads & displays images from database.
static void UpdateThumbnail(MythUIButtonListItem *button, const ImagePtrK &im, const QString &url, int index)
Update the buttonlist item with a thumbnail.
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
void MenuMain()
Shows the main menu when the MENU button was pressed.
static void RepeatOff()
MythUIText * m_captionText
Reflect about horizontal axis.
Definition: imagemetadata.h:51
void DeleteItem()
Confirm user deletion of an item.
void HideMarked(bool hide=true)
Hide or unhide marked items.
void ResetUiSelection()
Clears all text widgets for selected item.
void MenuMarked(MythMenu *mainMenu)
Adds a Marking submenu.
void ShowSettings()
Show configuration screen.
MythUIProgressBar * m_scanProgressBar
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
void DeviceEvent(MythMediaEvent *event)
Manage events for local devices.
MythUIButtonList * m_imageList
void SelectZoomWidget(int change)
Change buttonlist to use a different size.
void StartSlideshow(ImageSlideShowType mode)
Start slideshow screen.
void BuildImageList()
Displays all images in current view.
void MenuTransform(MythMenu *mainMenu)
Add a Transform submenu.
MythUIText * m_hideFilterText
void SetCover(bool reset=false)
Set or reset thumbnails to use for a directory cover.
QList< int > ImageIdList
Definition: imagetypes.h:59
void MenuAction(MythMenu *mainMenu)
Add a Action submenu.
InfoList m_infoList
Image details overlay.
MythUIText * m_positionText
void ZoomOut()
Use larger buttonlist widgets.
static void ClearSgDb()
Slideshow screen.
bool DirSelectUp()
Goes up one directory level.
void MakeDir()
Show dialog to input new directory name.
void ShowHidden(bool show=true)
Show or hide hidden files.
MythScreenStack & m_popupStack
void UpdateScanProgress(const QString &scanner, int current, int total)
Update progressbar with scan status.
void StartScan(bool start=true)
Action scan request.
QHash< QString, IntPair > m_scanProgress
Last scan updates received from scanners.
Type of captions to display.
void DirSelectDown()
Goes one directory level down.
Rotate anti-clockwise.
Definition: imagemetadata.h:49
void TransformMarked(ImageFileTransform tran=kRotateCW)
Apply transform to marked images.
void ShowType(int type=kPicAndVideo)
Show/hide pictures or videos.
MythUIText * m_emptyText
void Import()
Executes user 'Import command'.
Reflect about vertical axis.
Definition: imagemetadata.h:50
void ZoomIn()
Use smaller buttonlist widgets.
QString CheckThumbnail(MythUIButtonListItem *item, const ImagePtrK &im, ImageIdList &request, int index)
Verify thumbnail is known to exist.
Hide pictures.
Definition: imagemanager.h:80
void ShowRenameInput()
Show dialog to allow input.
Exif comments.
Screen in which all other widgets are contained and rendered.
Progress bar widget.
QSet< QString > m_scanActive
Scanners currently scanning.
void ShowPassword()
Displays dialog to accept password.
void MenuPaste(MythMenu *mainMenu)
Add a Paste submenu.
void MenuSlideshow(MythMenu *mainMenu)
Add a Slideshow submenu.
Rotate clockwise.
Definition: imagemetadata.h:48
void DeleteMarked()
Confirm user deletion of marked files.
void MarkItem(bool mark=true)
Mark or unmark a single item.
void SetUiSelection(MythUIButtonListItem *item)
Updates text widgets for selected item.
bool keyPressEvent(QKeyEvent *event) override
Handle keypresses.
A snapshot of current selection, markings & dir info when menu is invoked.
Definition: galleryviews.h:52