MythTV  master
gallerythumbview.h
Go to the documentation of this file.
1 
4 #ifndef GALLERYVIEW_H
5 #define GALLERYVIEW_H
6 
7 #include "galleryslideview.h"
8 #include "galleryviews.h"
9 
10 class DirectoryView;
11 class MythMenu;
12 
15  kNoCaption = 0,
19 };
20 
21 
24 {
25  Q_OBJECT
26 public:
27  GalleryThumbView(MythScreenStack *parent, const char *name);
29  bool Create() override; // MythScreenType
30 
31 public slots:
32  void Start();
33  void Close() override; // MythScreenType
35 
36 private:
37  bool keyPressEvent(QKeyEvent *) override; // MythScreenType
38  void mediaEvent(MythMediaEvent *event) override // MythUIType
39  { m_mgr.DeviceEvent(event); }
40  void customEvent(QEvent *) override; // MythUIType
41  void RemoveImages(const QStringList &ids, bool deleted = true);
42  void BuildImageList();
43  void ResetUiSelection();
47  void UpdateScanProgress(const QString &, int, int);
49  void SelectZoomWidget(int change);
51  ImageIdList &request, int);
52  static void UpdateThumbnail(MythUIButtonListItem *, const ImagePtrK&,
53  const QString &url, int);
54  void MenuMain();
55  void MenuShow(MythMenu *);
56  void MenuMarked(MythMenu *);
57  void MenuPaste(MythMenu *);
58  void MenuTransform(MythMenu *);
59  void MenuAction(MythMenu *);
60  void MenuSlideshow(MythMenu *);
61  bool DirSelectUp();
62  void DirSelectDown();
63  void ShowDialog(const QString&, const QString& = "");
64 
65 private slots:
66  void LoadData(int);
67  void SelectImage(int);
72  void ShowDetails();
83  void MarkItem(bool = true);
84  void UnmarkItem() { MarkItem(false); }
85  void MarkAll(bool = 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 = 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  void RepeatOn(int on = 1) { gCoreContext->SaveSetting("GalleryRepeat", on); }
114  void RepeatOff() { RepeatOn(0); }
115 
116 private:
117  typedef QPair<int,int> IntPair;
118 
119  // Theme widgets
129 
131  QList<MythUIButtonList *> m_zoomWidgets;
132  int m_zoomLevel {0};
133 
136  DirectoryView *m_view {nullptr};
138 
140  QHash<QString, IntPair> m_scanProgress;
142  QSet<QString> m_scanActive;
143 
146 
147  typedef QPair<MythUIButtonListItem *, int> ThumbLocation;
149  QHash<int, ThumbLocation> m_pendingMap;
150 
151  QSet<int> m_thumbExists;
152  bool m_editsAllowed {false};
153 };
154 
155 
156 #endif // GALLERYVIEW_H
void UpdateScanProgress(const QString &, int, int)
Update progressbar with scan status.
ImageSlideShowType
Type of slide show.
void MenuPaste(MythMenu *)
Add a Paste submenu.
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 RepeatOn(int on=1)
void UpdateImageItem(MythUIButtonListItem *)
Initialises a single buttonlist item.
MythUIText * m_typeFilterText
void ShowDialog(const QString &, const QString &="")
Show a confirmation dialog.
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.
void SelectImage(int)
Select item if it is displayed.
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
Provides view datastores for Gallery screens.
Reset to Exif value.
Definition: imagemetadata.h:43
QPair< MythUIButtonListItem *, int > ThumbLocation
void ItemClicked(MythUIButtonListItem *)
Action item click.
void SaveSetting(const QString &key, int newValue)
The image manager for use by Frontends.
Definition: imagemanager.h:452
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.
QPair< int, int > IntPair
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:74
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
MythUIText * m_scanProgressText
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.
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:167
void mediaEvent(MythMediaEvent *event) override
Media/Device status event handler, received from MythMediaMonitor.
GalleryThumbView(MythScreenStack *parent, const char *name)
Constructor.
bool m_editsAllowed
Edit privileges.
static void UpdateThumbnail(MythUIButtonListItem *, const ImagePtrK &, const QString &url, int)
Update the buttonlist item with a thumbnail.
void MarkInvertAll()
Invert all marked items.
void HideItem(bool hide=true)
Hide or unhide item.
Hide videos.
Definition: imagemanager.h:75
ImageFileTransform
Image transformations.
Definition: imagemetadata.h:42
void MenuSlideshow(MythMenu *)
Add a Slideshow submenu.
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:316
void MarkItem(bool=true)
Mark or unmark a single item.
void customEvent(QEvent *) override
Handle custom events.
void MenuMain()
Shows the main menu when the MENU button was pressed.
MythUIText * m_captionText
Reflect about horizontal axis.
Definition: imagemetadata.h:47
void DeleteItem()
Confirm user deletion of an item.
QString CheckThumbnail(MythUIButtonListItem *, const ImagePtrK &, ImageIdList &request, int)
Verify thumbnail is known to exist.
void HideMarked(bool hide=true)
Hide or unhide marked items.
void ResetUiSelection()
Clears all text widgets for selected item.
Filenames.
void ShowSettings()
Show configuration screen.
void MenuShow(MythMenu *)
Add a Show submenu.
const char * name
Definition: ParseText.cpp:328
MythUIProgressBar * m_scanProgressBar
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
void SetUiSelection(MythUIButtonListItem *)
Updates text widgets for selected item.
void MarkAll(bool=true)
Mark or unmark all items.
QSharedPointer< ImageItemK > ImagePtrK
Definition: imagetypes.h:179
void DeviceEvent(MythMediaEvent *event)
Manage events for local devices.
bool keyPressEvent(QKeyEvent *) override
Handle keypresses.
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 MenuMarked(MythMenu *)
Adds a Marking submenu.
MythUIText * m_hideFilterText
void SetCover(bool reset=false)
Set or reset thumbnails to use for a directory cover.
InfoList m_infoList
Image details overlay.
void MenuTransform(MythMenu *)
Add a Transform submenu.
MythUIText * m_positionText
void ZoomOut()
Use larger buttonlist widgets.
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
~GalleryThumbView()
Destructor.
void StartScan(bool start=true)
Action scan request.
QHash< QString, IntPair > m_scanProgress
Last scan updates received from scanners.
ImageCaptionType
Type of captions to display.
void DirSelectDown()
Goes one directory level down.
Rotate anti-clockwise.
Definition: imagemetadata.h:45
void TransformMarked(ImageFileTransform tran=kRotateCW)
Apply transform to marked images.
MythUIText * m_emptyText
void Import()
Executes user 'Import command'.
Reflect about vertical axis.
Definition: imagemetadata.h:46
QList< int > ImageIdList
Definition: imagetypes.h:59
void ZoomIn()
Use smaller buttonlist widgets.
Hide pictures.
Definition: imagemanager.h:76
void ShowRenameInput()
Show dialog to allow input.
Exif comments.
void LoadData(int)
Loads & displays images from database.
Screen in which all other widgets are contained and rendered.
Progress bar widget.
QSet< QString > m_scanActive
Scanners currently scanning.
void ShowType(int=kPicAndVideo)
Show/hide pictures or videos.
void ShowPassword()
Displays dialog to accept password.
Rotate clockwise.
Definition: imagemetadata.h:44
void DeleteMarked()
Confirm user deletion of marked files.
void MenuAction(MythMenu *)
Add a Action submenu.
A snapshot of current selection, markings & dir info when menu is invoked.
Definition: galleryviews.h:49