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,
18  kUserCaption = 3
19 };
20 
21 
24 {
25  Q_OBJECT
26 public:
27  GalleryThumbView(MythScreenStack *parent, const char *name);
28  ~GalleryThumbView() override;
29  bool Create() override; // MythScreenType
30 
31 public slots:
32  void Start();
33  void Close() override; // MythScreenType
35 
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 = "");
64 
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); }
115 
116 private:
117  using IntPair = QPair<int,int>;
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  using ThumbLocation = QPair<MythUIButtonListItem *, int>;
149  QHash<int, ThumbLocation> m_pendingMap;
150 
151  QSet<int> m_thumbExists;
152  bool m_editsAllowed {false};
153 };
154 
155 
156 #endif // GALLERYVIEW_H
GalleryThumbView::FlipVerticalMarked
void FlipVerticalMarked()
Definition: gallerythumbview.h:81
GalleryThumbView::UpdateThumbnail
static void UpdateThumbnail(MythUIButtonListItem *button, const ImagePtrK &im, const QString &url, int index)
Update the buttonlist item with a thumbnail.
Definition: gallerythumbview.cpp:838
kPicAndVideo
@ kPicAndVideo
Show Pictures & Videos.
Definition: imagemanager.h:78
ImagePtrK
QSharedPointer< ImageItemK > ImagePtrK
Definition: imagetypes.h:164
GalleryThumbView::m_scanProgressBar
MythUIProgressBar * m_scanProgressBar
Definition: gallerythumbview.h:128
GalleryThumbView::m_thumbExists
QSet< int > m_thumbExists
Images where thumbnails are known to exist.
Definition: gallerythumbview.h:151
GalleryThumbView::SetCover
void SetCover(bool reset=false)
Set or reset thumbnails to use for a directory cover.
Definition: gallerythumbview.cpp:1790
GalleryThumbView::IntPair
QPair< int, int > IntPair
Definition: gallerythumbview.h:117
GalleryThumbView::m_positionText
MythUIText * m_positionText
Definition: gallerythumbview.h:126
GalleryThumbView::HideMarked
void HideMarked(bool hide=true)
Hide or unhide marked items.
Definition: gallerythumbview.cpp:1595
ImageSlideShowType
ImageSlideShowType
Type of slide show.
Definition: galleryslideview.h:15
GalleryThumbView::MenuPaste
void MenuPaste(MythMenu *mainMenu)
Add a Paste submenu.
Definition: gallerythumbview.cpp:1122
GalleryThumbView::m_imageList
MythUIButtonList * m_imageList
Definition: gallerythumbview.h:120
GalleryThumbView::MakeDir
void MakeDir()
Show dialog to input new directory name.
Definition: gallerythumbview.cpp:1867
GalleryThumbView::SelectZoomWidget
void SelectZoomWidget(int change)
Change buttonlist to use a different size.
Definition: gallerythumbview.cpp:1827
GalleryThumbView::m_scanProgress
QHash< QString, IntPair > m_scanProgress
Last scan updates received from scanners.
Definition: gallerythumbview.h:140
GalleryThumbView::customEvent
void customEvent(QEvent *event) override
Handle custom events.
Definition: gallerythumbview.cpp:353
GalleryThumbView::DirSelectDown
void DirSelectDown()
Goes one directory level down.
Definition: gallerythumbview.cpp:1476
GalleryThumbView::UnmarkAll
void UnmarkAll()
Definition: gallerythumbview.h:86
GalleryThumbView::ShowType
void ShowType(int type=kPicAndVideo)
Show/hide pictures or videos.
Definition: gallerythumbview.cpp:1772
GalleryThumbView::m_infoList
InfoList m_infoList
Image details overlay.
Definition: gallerythumbview.h:137
GalleryThumbView::ShowPassword
void ShowPassword()
Displays dialog to accept password.
Definition: gallerythumbview.cpp:1755
ImageManagerFe::DeviceEvent
void DeviceEvent(MythMediaEvent *event)
Manage events for local devices.
Definition: imagemanager.cpp:2439
GalleryThumbView::FlipHorizontalMarked
void FlipHorizontalMarked()
Definition: gallerythumbview.h:80
GalleryThumbView::mediaEvent
void mediaEvent(MythMediaEvent *event) override
Media/Device status event handler, received from MythMediaMonitor.
Definition: gallerythumbview.h:38
GalleryThumbView::GalleryThumbView
GalleryThumbView(MythScreenStack *parent, const char *name)
Constructor.
Definition: gallerythumbview.cpp:151
MythScreenStack
Definition: mythscreenstack.h:16
GalleryThumbView::FlipVertical
void FlipVertical()
Definition: gallerythumbview.h:76
GalleryThumbView::LoadData
void LoadData(int parent)
Loads & displays images from database.
Definition: gallerythumbview.cpp:623
kDateCaption
@ kDateCaption
Dates.
Definition: gallerythumbview.h:17
GalleryThumbView::m_crumbsText
MythUIText * m_crumbsText
Definition: gallerythumbview.h:122
slots
unsigned int slots[4]
Definition: element.cpp:38
kNoCaption
@ kNoCaption
None.
Definition: gallerythumbview.h:15
GalleryThumbView::m_typeFilterText
MythUIText * m_typeFilterText
Definition: gallerythumbview.h:125
GalleryThumbView::MenuAction
void MenuAction(MythMenu *mainMenu)
Add a Action submenu.
Definition: gallerythumbview.cpp:1187
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
show
static void show(uint8_t *buf, int length)
Definition: ringbuffer.cpp:319
GalleryThumbView::m_hideFilterText
MythUIText * m_hideFilterText
Definition: gallerythumbview.h:124
GalleryThumbView::Import
void Import()
Executes user 'Import command'.
Definition: gallerythumbview.cpp:2133
GalleryThumbView::ZoomIn
void ZoomIn()
Use smaller buttonlist widgets.
Definition: gallerythumbview.cpp:1816
GalleryThumbView::HideHidden
void HideHidden()
Definition: gallerythumbview.h:94
GalleryThumbView::m_menuState
MenuSubjects m_menuState
Current selection/marked files when menu is invoked.
Definition: gallerythumbview.h:145
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
GalleryThumbView::MarkItem
void MarkItem(bool mark=true)
Mark or unmark a single item.
Definition: gallerythumbview.cpp:1494
GalleryThumbView::Create
bool Create() override
Initialises and shows the graphical elements.
Definition: gallerythumbview.cpp:199
GalleryThumbView::MenuMain
void MenuMain()
Shows the main menu when the MENU button was pressed.
Definition: gallerythumbview.cpp:1026
GalleryThumbView::RepeatOff
static void RepeatOff()
Definition: gallerythumbview.h:114
GalleryThumbView::SetUiSelection
void SetUiSelection(MythUIButtonListItem *item)
Updates text widgets for selected item.
Definition: gallerythumbview.cpp:969
GalleryThumbView::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Handle keypresses.
Definition: gallerythumbview.cpp:263
MythUIButtonListItem
Definition: mythuibuttonlist.h:28
ImageFileTransform
ImageFileTransform
Image transformations.
Definition: imagemetadata.h:46
GalleryThumbView::ResetUiSelection
void ResetUiSelection()
Clears all text widgets for selected item.
Definition: gallerythumbview.cpp:946
GalleryThumbView::RotateCCWMarked
void RotateCCWMarked()
Definition: gallerythumbview.h:79
GalleryThumbView::MenuShow
void MenuShow(MythMenu *mainMenu)
Add a Show submenu.
Definition: gallerythumbview.cpp:1304
kPicOnly
@ kPicOnly
Hide videos.
Definition: imagemanager.h:79
GalleryThumbView::ShowSettings
void ShowSettings()
Show configuration screen.
Definition: gallerythumbview.cpp:1635
GalleryThumbView::UpdateScanProgress
void UpdateScanProgress(const QString &scanner, int current, int total)
Update progressbar with scan status.
Definition: gallerythumbview.cpp:865
ImageManagerFe::ClearStorageGroup
static void ClearStorageGroup()
Clear database & thumbnails of Storage Group images.
Definition: imagemanager.cpp:2136
GalleryThumbView::StartScan
void StartScan(bool start=true)
Action scan request.
Definition: gallerythumbview.cpp:1407
MythUIProgressBar
Progress bar widget.
Definition: mythuiprogressbar.h:13
GalleryThumbView::TransformMarked
void TransformMarked(ImageFileTransform tran=kRotateCW)
Apply transform to marked images.
Definition: gallerythumbview.cpp:1558
GalleryThumbView::SelectImage
void SelectImage(int id)
Select item if it is displayed.
Definition: gallerythumbview.cpp:1364
GalleryThumbView::ResetCover
void ResetCover()
Definition: gallerythumbview.h:96
mark
Definition: lang.cpp:20
kNormalSlideShow
@ kNormalSlideShow
Definition: galleryslideview.h:17
GalleryThumbView::m_view
DirectoryView * m_view
List of images comprising the view.
Definition: gallerythumbview.h:136
MythMediaEvent
Definition: mythmedia.h:184
GalleryThumbView::MenuSlideshow
void MenuSlideshow(MythMenu *mainMenu)
Add a Slideshow submenu.
Definition: gallerythumbview.cpp:1253
GalleryThumbView::ClearSgDb
static void ClearSgDb()
Definition: gallerythumbview.h:34
GalleryThumbView::BuildImageList
void BuildImageList()
Displays all images in current view.
Definition: gallerythumbview.cpp:658
GalleryThumbView::StartSlideshow
void StartSlideshow(ImageSlideShowType mode)
Start slideshow screen.
Definition: gallerythumbview.cpp:1419
GalleryThumbView::ShowRenameInput
void ShowRenameInput()
Show dialog to allow input.
Definition: gallerythumbview.cpp:1724
GalleryThumbView::ShowDialog
void ShowDialog(const QString &msg, const QString &event="")
Show a confirmation dialog.
Definition: gallerythumbview.cpp:1707
MenuSubjects
A snapshot of current selection, markings & dir info when menu is invoked.
Definition: galleryviews.h:53
GalleryThumbView::DeleteMarked
void DeleteMarked()
Confirm user deletion of marked files.
Definition: gallerythumbview.cpp:1625
GalleryThumbView::Unhide
void Unhide()
Definition: gallerythumbview.h:89
ImageCaptionType
ImageCaptionType
Type of captions to display.
Definition: gallerythumbview.h:14
GalleryThumbView::m_scanActive
QSet< QString > m_scanActive
Scanners currently scanning.
Definition: gallerythumbview.h:142
GalleryThumbView::RotateCCW
void RotateCCW()
Definition: gallerythumbview.h:74
GalleryThumbView::ZoomOut
void ZoomOut()
Use larger buttonlist widgets.
Definition: gallerythumbview.cpp:1806
GalleryThumbView::ResetExif
void ResetExif()
Definition: gallerythumbview.h:77
GalleryThumbView::ItemClicked
void ItemClicked(MythUIButtonListItem *item)
Action item click.
Definition: gallerythumbview.cpp:1376
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:57
GalleryThumbView::DirSelectUp
bool DirSelectUp()
Goes up one directory level.
Definition: gallerythumbview.cpp:1455
GalleryThumbView::UpdateImageItem
void UpdateImageItem(MythUIButtonListItem *item)
Initialises a single buttonlist item.
Definition: gallerythumbview.cpp:704
GalleryThumbView::ShowDetails
void ShowDetails()
Shows exif info/details about an item.
Definition: gallerythumbview.cpp:1746
GalleryThumbView::CheckThumbnail
QString CheckThumbnail(MythUIButtonListItem *item, const ImagePtrK &im, ImageIdList &request, int index)
Verify thumbnail is known to exist.
Definition: gallerythumbview.cpp:811
GalleryThumbView::FlipHorizontal
void FlipHorizontal()
Definition: gallerythumbview.h:75
GalleryThumbView::m_popupStack
MythScreenStack & m_popupStack
Definition: gallerythumbview.h:134
GalleryThumbView::TransformItem
void TransformItem(ImageFileTransform tran=kRotateCW)
Apply transform to an image.
Definition: gallerythumbview.cpp:1540
GalleryThumbView::RotateCW
void RotateCW()
Definition: gallerythumbview.h:73
GalleryThumbView::m_scanProgressText
MythUIText * m_scanProgressText
Definition: gallerythumbview.h:127
GalleryThumbView::MarkInvertAll
void MarkInvertAll()
Invert all marked items.
Definition: gallerythumbview.cpp:1527
GalleryThumbView::RecursiveSlideshow
void RecursiveSlideshow()
Definition: gallerythumbview.h:71
GalleryThumbView::MarkAll
void MarkAll(bool mark=true)
Mark or unmark all items.
Definition: gallerythumbview.cpp:1512
GalleryThumbView::m_emptyText
MythUIText * m_emptyText
Definition: gallerythumbview.h:123
GalleryThumbView::Move
void Move()
Move marked images to selected dir. If no marked files, use previously marked files....
Definition: gallerythumbview.cpp:2030
MythMenu
Definition: mythdialogbox.h:93
GalleryThumbView::m_mgr
ImageManagerFe & m_mgr
Manages the images.
Definition: gallerythumbview.h:135
galleryviews.h
Provides view datastores for Gallery screens.
kUserCaption
@ kUserCaption
Exif comments.
Definition: gallerythumbview.h:18
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
kFlipVertical
@ kFlipVertical
Reflect about horizontal axis.
Definition: imagemetadata.h:51
GalleryThumbView::Copy
void Copy(bool deleteAfter=false)
Copy marked images to selected dir. If no marked files, use previously marked files....
Definition: gallerythumbview.cpp:1902
GalleryThumbView::m_editsAllowed
bool m_editsAllowed
Edit privileges.
Definition: gallerythumbview.h:152
GalleryThumbView::HidePictures
void HidePictures()
Definition: gallerythumbview.h:98
ImageManagerFe
The image manager for use by Frontends.
Definition: imagemanager.h:457
kRotateCW
@ kRotateCW
Rotate clockwise.
Definition: imagemetadata.h:48
InfoList
The image info/details buttonlist overlay that displays exif tags.
Definition: galleryinfo.h:23
GalleryThumbView::HideItem
void HideItem(bool hide=true)
Hide or unhide item.
Definition: gallerythumbview.cpp:1570
galleryslideview.h
Slideshow screen.
ImageIdList
QList< int > ImageIdList
Definition: imagetypes.h:59
GalleryThumbView::DeleteItem
void DeleteItem()
Confirm user deletion of an item.
Definition: gallerythumbview.cpp:1614
GalleryThumbView::m_zoomWidgets
QList< MythUIButtonList * > m_zoomWidgets
Theme buttonlist widgets implementing zoom levels.
Definition: gallerythumbview.h:131
GalleryThumbView::UnhideMarked
void UnhideMarked()
Definition: gallerythumbview.h:91
GalleryThumbView::~GalleryThumbView
~GalleryThumbView() override
Destructor.
Definition: gallerythumbview.cpp:170
GalleryThumbView::m_zoomLevel
int m_zoomLevel
Definition: gallerythumbview.h:132
GalleryThumbView::RemoveImages
void RemoveImages(const QStringList &ids, bool deleted=true)
Cleanup UI & image caches when a device is removed.
Definition: gallerythumbview.cpp:575
GalleryThumbView::UnmarkItem
void UnmarkItem()
Definition: gallerythumbview.h:84
GalleryThumbView::Slideshow
void Slideshow()
Definition: gallerythumbview.h:70
GalleryThumbView::MenuTransform
void MenuTransform(MythMenu *mainMenu)
Add a Transform submenu.
Definition: gallerythumbview.cpp:1151
kFlipHorizontal
@ kFlipHorizontal
Reflect about vertical axis.
Definition: imagemetadata.h:50
GalleryThumbView::ThumbLocation
QPair< MythUIButtonListItem *, int > ThumbLocation
Definition: gallerythumbview.h:147
GalleryThumbView::m_captionText
MythUIText * m_captionText
Definition: gallerythumbview.h:121
GalleryThumbView::ResetExifMarked
void ResetExifMarked()
Definition: gallerythumbview.h:82
GalleryThumbView::m_pendingMap
QHash< int, ThumbLocation > m_pendingMap
Buttons waiting for thumbnails to be created.
Definition: gallerythumbview.h:149
MythCoreContext::SaveSetting
void SaveSetting(const QString &key, int newValue)
Definition: mythcorecontext.cpp:899
GalleryThumbView::HideVideos
void HideVideos()
Definition: gallerythumbview.h:99
DirectoryView
A datastore of images for display by a screen. Provides an ordered list of dirs & images from a singl...
Definition: galleryviews.h:171
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition: mythuibuttonlist.h:144
kRecursiveSlideShow
@ kRecursiveSlideShow
Definition: galleryslideview.h:18
GalleryThumbView::MenuMarked
void MenuMarked(MythMenu *mainMenu)
Adds a Marking submenu.
Definition: gallerythumbview.cpp:1069
GalleryThumbView::ShowHidden
void ShowHidden(bool show=true)
Show or hide hidden files.
Definition: gallerythumbview.cpp:1688
kNameCaption
@ kNameCaption
Filenames.
Definition: gallerythumbview.h:16
GalleryThumbView::Close
void Close() override
Exit Gallery.
Definition: gallerythumbview.cpp:180
GalleryThumbView::Eject
void Eject()
Remove local device (or Import) from Gallery.
Definition: gallerythumbview.cpp:1885
GalleryThumbView::RotateCWMarked
void RotateCWMarked()
Definition: gallerythumbview.h:78
GalleryThumbView
Thumbnail screen.
Definition: gallerythumbview.h:24
kResetToExif
@ kResetToExif
Reset to Exif value.
Definition: imagemetadata.h:47
kVideoOnly
@ kVideoOnly
Hide pictures.
Definition: imagemanager.h:80
GalleryThumbView::StopScan
void StopScan()
Definition: gallerythumbview.h:104
GalleryThumbView::Start
void Start()
Start Thumbnail screen.
Definition: gallerythumbview.cpp:599
GalleryThumbView::RepeatOn
static void RepeatOn(int on=1)
Definition: gallerythumbview.h:113
kRotateCCW
@ kRotateCCW
Rotate anti-clockwise.
Definition: imagemetadata.h:49