mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
added folder selection dialog on first snapshot
This commit is contained in:
parent
6a44ea76e5
commit
890b22426c
2 changed files with 10 additions and 1 deletions
|
@ -44,6 +44,7 @@ const QString URL = "highfidelity_url";
|
|||
|
||||
Setting::Handle<QString> Snapshot::snapshotsLocation("snapshotsLocation",
|
||||
QStandardPaths::writableLocation(QStandardPaths::DesktopLocation));
|
||||
Setting::Handle<bool> Snapshot::hasSetSnapshotsLocation("hasSetSnapshotsLocation", false);
|
||||
|
||||
SnapshotMetaData* Snapshot::parseSnapshotData(QString snapshotPath) {
|
||||
|
||||
|
@ -103,7 +104,14 @@ QFile* Snapshot::savedFileForSnapshot(QImage & shot, bool isTemporary) {
|
|||
const int IMAGE_QUALITY = 100;
|
||||
|
||||
if (!isTemporary) {
|
||||
QString snapshotFullPath = snapshotsLocation.get();
|
||||
QString snapshotFullPath;
|
||||
if (!hasSetSnapshotsLocation.get()) {
|
||||
snapshotFullPath = QFileDialog::getExistingDirectory(nullptr, "Choose Snapshots Directory", snapshotsLocation.get());
|
||||
hasSetSnapshotsLocation.set(true);
|
||||
snapshotsLocation.set(snapshotFullPath);
|
||||
} else {
|
||||
snapshotFullPath = snapshotsLocation.get();
|
||||
}
|
||||
|
||||
if (!snapshotFullPath.endsWith(QDir::separator())) {
|
||||
snapshotFullPath.append(QDir::separator());
|
||||
|
|
|
@ -39,6 +39,7 @@ public:
|
|||
static SnapshotMetaData* parseSnapshotData(QString snapshotPath);
|
||||
|
||||
static Setting::Handle<QString> snapshotsLocation;
|
||||
static Setting::Handle<bool> hasSetSnapshotsLocation;
|
||||
private:
|
||||
static QFile* savedFileForSnapshot(QImage & image, bool isTemporary);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue