2016-02-29 23:59:46 +01:00
|
|
|
#ifndef TAGEDITORMAINWINDOW_H
|
|
|
|
#define TAGEDITORMAINWINDOW_H
|
2015-04-22 19:33:53 +02:00
|
|
|
|
2015-09-06 20:20:00 +02:00
|
|
|
#include "./filefilterproxymodel.h"
|
|
|
|
#include "./previousvaluehandling.h"
|
2015-04-22 19:33:53 +02:00
|
|
|
|
|
|
|
#include <tagparser/mediafileinfo.h>
|
|
|
|
#include <tagparser/tagvalue.h>
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QByteArray>
|
|
|
|
|
2016-02-29 23:59:46 +01:00
|
|
|
QT_FORWARD_DECLARE_CLASS(QFileSystemModel)
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QItemSelectionModel)
|
2015-04-22 19:33:53 +02:00
|
|
|
|
|
|
|
namespace Media {
|
2016-07-11 21:34:05 +02:00
|
|
|
DECLARE_ENUM_CLASS(TagType, unsigned int);
|
2015-04-22 19:33:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace Dialogs {
|
|
|
|
class AboutDialog;
|
|
|
|
class SettingsDialog;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace QtGui {
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class MainWindow;
|
|
|
|
}
|
|
|
|
|
2016-02-29 23:59:46 +01:00
|
|
|
class TagEditorWidget;
|
2015-04-22 19:33:53 +02:00
|
|
|
class RenameFilesDialog;
|
2016-03-03 22:21:15 +01:00
|
|
|
class DbQueryWidget;
|
2015-04-22 19:33:53 +02:00
|
|
|
|
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2016-09-25 23:59:04 +02:00
|
|
|
Q_PROPERTY(QString currentDirectory READ currentDirectory WRITE setCurrentDirectory)
|
|
|
|
Q_PROPERTY(bool layoutLocked READ isLayoutLocked WRITE setLayoutLocked)
|
2015-04-22 19:33:53 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
explicit MainWindow(QWidget *parent = nullptr);
|
2016-04-21 23:55:22 +02:00
|
|
|
~MainWindow();
|
2015-04-22 19:33:53 +02:00
|
|
|
|
2015-07-27 23:29:30 +02:00
|
|
|
// file browser
|
2016-09-25 23:59:04 +02:00
|
|
|
QString currentDirectory() const;
|
|
|
|
bool isLayoutLocked() const;
|
|
|
|
|
|
|
|
public slots:
|
2015-04-22 19:33:53 +02:00
|
|
|
void setCurrentDirectory(const QString &path);
|
2016-09-25 23:59:04 +02:00
|
|
|
void setLayoutLocked(bool locked);
|
|
|
|
void toggleLayoutLocked();
|
2016-02-29 23:59:46 +01:00
|
|
|
void startParsing(const QString &path);
|
2015-07-27 23:29:30 +02:00
|
|
|
|
2015-04-22 19:33:53 +02:00
|
|
|
protected:
|
2016-01-09 03:38:58 +01:00
|
|
|
bool event(QEvent *event);
|
2015-04-22 19:33:53 +02:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
// file selection
|
|
|
|
void pathEntered();
|
|
|
|
void fileSelected();
|
|
|
|
void selectNextFile();
|
2016-02-29 23:59:46 +01:00
|
|
|
void selectNextFile(QItemSelectionModel *selectionModel, const QModelIndex ¤tIndex, bool notDeeper);
|
|
|
|
void showNextFileNotFound();
|
2015-04-22 19:33:53 +02:00
|
|
|
void showOpenFileDlg();
|
2016-05-01 20:07:04 +02:00
|
|
|
void showSaveAsDlg();
|
2015-04-22 19:33:53 +02:00
|
|
|
void saveFileInformation();
|
2016-02-29 23:59:46 +01:00
|
|
|
void handleFileStatusChange(bool opened, bool hasTag);
|
2016-08-14 22:49:47 +02:00
|
|
|
void handleCurrentPathChanged(const QString &newPath);
|
2015-04-22 19:33:53 +02:00
|
|
|
|
2016-02-29 23:59:46 +01:00
|
|
|
// settings
|
|
|
|
void showSettingsDlg();
|
|
|
|
void applySettingsFromDialog();
|
2015-04-22 19:33:53 +02:00
|
|
|
|
|
|
|
// misc
|
|
|
|
void showAboutDlg();
|
|
|
|
void showRenameFilesDlg();
|
2015-10-14 20:15:10 +02:00
|
|
|
void spawnExternalPlayer();
|
2016-12-01 22:23:01 +01:00
|
|
|
void initDbQueryWidget();
|
2016-10-09 19:44:06 +02:00
|
|
|
void toggleDbQueryWidget();
|
2015-04-22 19:33:53 +02:00
|
|
|
|
|
|
|
private:
|
2016-11-23 21:46:33 +01:00
|
|
|
bool fileOperationOngoing() const;
|
2016-02-29 23:59:46 +01:00
|
|
|
Media::MediaFileInfo &fileInfo();
|
2015-04-22 19:33:53 +02:00
|
|
|
|
|
|
|
// UI
|
|
|
|
std::unique_ptr<Ui::MainWindow> m_ui;
|
|
|
|
// models
|
|
|
|
QFileSystemModel *m_fileModel;
|
|
|
|
FileFilterProxyModel *m_fileFilterModel;
|
2016-08-07 19:59:33 +02:00
|
|
|
bool m_internalFileSelection;
|
2015-04-22 19:33:53 +02:00
|
|
|
// dialogs
|
|
|
|
Dialogs::AboutDialog *m_aboutDlg;
|
|
|
|
Dialogs::SettingsDialog *m_settingsDlg;
|
|
|
|
std::unique_ptr<RenameFilesDialog> m_renameFilesDlg;
|
2016-03-03 22:21:15 +01:00
|
|
|
DbQueryWidget *m_dbQueryWidget;
|
2015-04-22 19:33:53 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-02-29 23:59:46 +01:00
|
|
|
#endif // TAGEDITORMAINWINDOW_H
|