| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
#pragma once |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#include <QItemSelection> |
| 21 |
#include <QMainWindow> |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
#include "geoifacetypes.h" |
| 26 |
#include "geomodelhelper.h" |
| 27 |
#include "trackmanager.h" |
| 28 |
|
| 29 |
class QCommandLineParser; |
| 30 |
|
| 31 |
using namespace Digikam; |
| 32 |
|
| 33 |
class MarkerModelHelper : public GeoModelHelper |
| 34 |
{ |
| 35 |
Q_OBJECT |
| 36 |
|
| 37 |
public: |
| 38 |
|
| 39 |
explicit MarkerModelHelper(QAbstractItemModel* const itemModel, |
| 40 |
QItemSelectionModel* const itemSelectionModel); |
| 41 |
~MarkerModelHelper() override; |
| 42 |
|
| 43 |
QAbstractItemModel* model() const override; |
| 44 |
QItemSelectionModel* selectionModel() const override; |
| 45 |
PropertyFlags modelFlags() const override; |
| 46 |
bool itemCoordinates(const QModelIndex& index, |
| 47 |
GeoCoordinates* const coordinates) const override; |
| 48 |
void onIndicesMoved(const QList<QPersistentModelIndex>& movedIndices, |
| 49 |
const GeoCoordinates& targetCoordinates, |
| 50 |
const QPersistentModelIndex& targetSnapIndex) override; |
| 51 |
|
| 52 |
private: |
| 53 |
|
| 54 |
QAbstractItemModel* const m_itemModel; |
| 55 |
QItemSelectionModel* const m_itemSelectionModel; |
| 56 |
|
| 57 |
Q_SIGNALS: |
| 58 |
|
| 59 |
void signalMarkersMoved(const QList<QPersistentModelIndex>& movedIndices); |
| 60 |
}; |
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
class MyTrackModelHelper : public QObject |
| 65 |
{ |
| 66 |
Q_OBJECT |
| 67 |
|
| 68 |
public: |
| 69 |
|
| 70 |
explicit MyTrackModelHelper(QAbstractItemModel* const imageItemsModel); |
| 71 |
|
| 72 |
virtual TrackManager::Track::List getTracks() const; |
| 73 |
|
| 74 |
Q_SIGNALS: |
| 75 |
|
| 76 |
void signalModelChanged(); |
| 77 |
|
| 78 |
public Q_SLOTS: |
| 79 |
|
| 80 |
void slotTrackModelChanged(); |
| 81 |
|
| 82 |
private: |
| 83 |
|
| 84 |
TrackManager::Track::List m_tracks; |
| 85 |
QAbstractItemModel* m_itemModel; |
| 86 |
}; |
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
class MainWindow : public QMainWindow |
| 91 |
{ |
| 92 |
Q_OBJECT |
| 93 |
|
| 94 |
public: |
| 95 |
|
| 96 |
explicit MainWindow(QCommandLineParser* const cmdLineArgs, |
| 97 |
QWidget* const parent = nullptr); |
| 98 |
~MainWindow() override; |
| 99 |
|
| 100 |
public Q_SLOTS: |
| 101 |
|
| 102 |
void slotScheduleImagesForLoading(const QList<QUrl>& imagesToSchedule); |
| 103 |
|
| 104 |
protected: |
| 105 |
|
| 106 |
void readSettings(); |
| 107 |
void saveSettings(); |
| 108 |
void closeEvent(QCloseEvent* e) override; |
| 109 |
void createMenus(); |
| 110 |
|
| 111 |
private Q_SLOTS: |
| 112 |
|
| 113 |
void slotFutureResultsReadyAt(int startIndex, int endIndex); |
| 114 |
void slotImageLoadingBunchReady(); |
| 115 |
void slotMarkersMoved(const QList<QPersistentModelIndex>& markerIndices); |
| 116 |
void slotAltitudeRequestsReady(const QList<int>& readyRequests); |
| 117 |
void slotAltitudeLookupDone(); |
| 118 |
void slotAddImages(); |
| 119 |
|
| 120 |
private: |
| 121 |
|
| 122 |
class Private; |
| 123 |
Private* const d = nullptr; |
| 124 |
}; |