diff -u mythgallery/gallerysettings.cpp mythgallery_mods/gallerysettings.cpp
old
|
new
|
|
30 | 30 | return gc; |
31 | 31 | }; |
32 | 32 | |
| 33 | static HostComboBox *MythGallerySortOrder() |
| 34 | { |
| 35 | HostComboBox *gc = new HostComboBox("GallerySortOrder"); |
| 36 | gc->setLabel(QObject::tr("Sort order when browsing")); |
| 37 | gc->addSelection("Name (A-Z alpha)", QString::number(QDir::Name | QDir::DirsFirst | QDir::IgnoreCase)); |
| 38 | gc->addSelection("Reverse Name (Z-A alpha)", QString::number(QDir::Name | QDir::DirsFirst | QDir::IgnoreCase | QDir::Reversed)); |
| 39 | gc->addSelection("Mod Time (earliest first)", QString::number(QDir::Time | QDir::DirsFirst | QDir::IgnoreCase | QDir::Reversed)); |
| 40 | gc->addSelection("Reverse Mod Time (most recent first)", QString::number(QDir::Time | QDir::DirsFirst | QDir::IgnoreCase)); |
| 41 | gc->setHelpText(QObject::tr("This is the sort order for the displayed " |
| 42 | "picture thumbnails.")); |
| 43 | return gc; |
| 44 | }; |
| 45 | |
33 | 46 | static HostLineEdit *MythGalleryMoviePlayerCmd() |
34 | 47 | { |
35 | 48 | HostLineEdit *gc = new HostLineEdit("GalleryMoviePlayerCmd"); |
… |
… |
|
161 | 174 | |
162 | 175 | addChild(MythGalleryDir()); |
163 | 176 | addChild(MythGalleryThumbnailLocation()); |
| 177 | addChild(MythGallerySortOrder()); |
164 | 178 | addChild(MythGalleryImportDirs()); |
165 | 179 | addChild(MythGalleryMoviePlayerCmd()); |
166 | 180 | |
diff -u mythgallery/iconview.cpp mythgallery_mods/iconview.cpp
old
|
new
|
|
92 | 92 | } |
93 | 93 | |
94 | 94 | IconView::IconView(const QString& galleryDir, MythMediaDevice *initialDevice, |
95 | | MythMainWindow* parent, const char* name ) |
| 95 | const int& sortorder, MythMainWindow* parent, |
| 96 | const char* name ) |
96 | 97 | : MythDialog(parent, name) |
97 | 98 | { |
98 | | m_galleryDir = galleryDir; |
| 99 | m_galleryDir = galleryDir; |
| 100 | m_sortorder = sortorder; |
99 | 101 | |
100 | 102 | m_inMenu = false; |
101 | 103 | m_inSubMenu = false; |
… |
… |
|
1450 | 1452 | return; |
1451 | 1453 | |
1452 | 1454 | d.setNameFilter(MEDIA_FILENAMES); |
1453 | | d.setSorting(QDir::Name | QDir::DirsFirst | QDir::IgnoreCase); |
| 1455 | d.setSorting(m_sortorder); |
1454 | 1456 | d.setFilter(QDir::Files | QDir::Dirs | QDir::NoSymLinks | QDir::Readable); |
1455 | 1457 | d.setMatchAllDirs(true); |
1456 | 1458 | const QFileInfoList *list = d.entryInfoList(); |
diff -u mythgallery/iconview.h mythgallery_mods/iconview.h
old
|
new
|
|
66 | 66 | Q_OBJECT |
67 | 67 | public: |
68 | 68 | IconView(const QString& galleryDir, MythMediaDevice *initialDevice, |
69 | | MythMainWindow* parent, const char* name = 0); |
| 69 | const int& sortorder, MythMainWindow* parent, |
| 70 | const char* name = 0); |
70 | 71 | ~IconView(); |
71 | 72 | |
72 | 73 | protected: |
… |
… |
|
122 | 123 | QDict<ThumbItem> m_itemDict; |
123 | 124 | QStringList m_itemMarked; |
124 | 125 | QString m_galleryDir; |
| 126 | int m_sortorder; |
125 | 127 | |
126 | 128 | XMLParse *m_theme; |
127 | 129 | QRect m_menuRect; |
diff -u mythgallery/main.cpp mythgallery_mods/main.cpp
old
|
new
|
|
25 | 25 | void runGallery(void) |
26 | 26 | { |
27 | 27 | gContext->addCurrentLocation("mythgallery"); |
| 28 | int sortorder = gContext->GetNumSetting("GallerySortOrder"); |
28 | 29 | QString startdir = gContext->GetSetting("GalleryDir"); |
29 | 30 | QDir dir(startdir); |
30 | 31 | if (!dir.exists() || !dir.isReadable()) { |
… |
… |
|
36 | 37 | } |
37 | 38 | else |
38 | 39 | { |
39 | | IconView icv(startdir, NULL, gContext->GetMainWindow(), "IconView"); |
| 40 | IconView icv(startdir, NULL, sortorder, gContext->GetMainWindow(), "IconView"); |
40 | 41 | icv.exec(); |
41 | 42 | } |
42 | 43 | gContext->removeCurrentLocation(); |