Chris@529
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
Chris@529
|
2
|
Chris@529
|
3 /*
|
Chris@529
|
4 Sonic Visualiser
|
Chris@529
|
5 An audio file viewer and annotation editor.
|
Chris@529
|
6 Centre for Digital Music, Queen Mary, University of London.
|
Chris@529
|
7 This file copyright 2007 QMUL.
|
Chris@529
|
8
|
Chris@529
|
9 This program is free software; you can redistribute it and/or
|
Chris@529
|
10 modify it under the terms of the GNU General Public License as
|
Chris@529
|
11 published by the Free Software Foundation; either version 2 of the
|
Chris@529
|
12 License, or (at your option) any later version. See the file
|
Chris@529
|
13 COPYING included with this distribution for more information.
|
Chris@529
|
14 */
|
Chris@529
|
15
|
Chris@1407
|
16 #ifndef SV_INTERACTIVE_FILE_FINDER_H
|
Chris@1407
|
17 #define SV_INTERACTIVE_FILE_FINDER_H
|
Chris@529
|
18
|
Chris@529
|
19 #include "data/fileio/FileFinder.h"
|
Chris@529
|
20
|
Chris@760
|
21 #include <QApplication>
|
Chris@529
|
22 #include <QString>
|
Chris@529
|
23 #include <QObject>
|
Chris@529
|
24
|
Chris@529
|
25 class InteractiveFileFinder : public QObject,
|
Chris@529
|
26 public FileFinder
|
Chris@529
|
27 {
|
Chris@529
|
28 Q_OBJECT
|
Chris@529
|
29
|
Chris@529
|
30 public:
|
Chris@529
|
31 virtual ~InteractiveFileFinder();
|
Chris@529
|
32
|
Chris@760
|
33 /// Specify the extension for this application's session files
|
Chris@760
|
34 /// (without the dot)
|
Chris@760
|
35 void setApplicationSessionExtension(QString extension);
|
Chris@760
|
36
|
Chris@760
|
37 QString getApplicationSessionExtension() const {
|
Chris@760
|
38 return m_sessionExtension;
|
Chris@760
|
39 }
|
Chris@760
|
40
|
Chris@1406
|
41 QString getOpenFileName(FileType type, QString fallbackLocation = "") override;
|
Chris@1406
|
42 QString getSaveFileName(FileType type, QString fallbackLocation = "") override;
|
Chris@1406
|
43 void registerLastOpenedFilePath(FileType type, QString path) override;
|
Chris@529
|
44
|
Chris@1406
|
45 QString find(FileType type, QString location, QString lastKnownLocation = "") override;
|
Chris@529
|
46
|
Chris@831
|
47 static void setParentWidget(QWidget *);
|
Chris@831
|
48
|
Chris@529
|
49 static InteractiveFileFinder *getInstance() { return &m_instance; }
|
Chris@529
|
50
|
Chris@529
|
51 protected:
|
Chris@529
|
52 InteractiveFileFinder();
|
Chris@529
|
53 static InteractiveFileFinder m_instance;
|
Chris@529
|
54
|
Chris@529
|
55 QString findRelative(QString location, QString relativeTo);
|
Chris@529
|
56 QString locateInteractive(FileType type, QString thing);
|
Chris@529
|
57
|
Chris@760
|
58 QString m_sessionExtension;
|
Chris@529
|
59 QString m_lastLocatedLocation;
|
Chris@831
|
60
|
Chris@831
|
61 QWidget *m_parent;
|
Chris@529
|
62 };
|
Chris@529
|
63
|
Chris@529
|
64 #endif
|
Chris@529
|
65
|