tageditor/gui/mainwindow.h

95 lines
2.1 KiB
C
Raw Normal View History

#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>
QT_FORWARD_DECLARE_CLASS(QFileSystemModel)
QT_FORWARD_DECLARE_CLASS(QItemSelectionModel)
2016-03-10 22:13:43 +01:00
QT_FORWARD_DECLARE_CLASS(QMutex)
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;
}
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
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
2015-04-22 19:33:53 +02:00
2015-07-27 23:29:30 +02:00
// file browser
2015-04-22 19:33:53 +02:00
QString currentDirectory();
void setCurrentDirectory(const QString &path);
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();
void selectNextFile(QItemSelectionModel *selectionModel, const QModelIndex &currentIndex, 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();
void handleFileStatusChange(bool opened, bool hasTag);
void handleCurrentPathChanged(const QString &currentPath);
2015-04-22 19:33:53 +02: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-03-03 22:21:15 +01:00
void showDbQueryWidget();
2015-04-22 19:33:53 +02:00
private:
2016-03-10 22:13:43 +01:00
QMutex &fileOperationMutex();
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;
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
};
}
#endif // TAGEDITORMAINWINDOW_H