Entropy Piano Tuner  1.1.3 (documentation not yet complete)
An open-source experimental software for piano tuning by entropy minimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
projectmanagerforqt.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright 2015 Haye Hinrichsen, Christoph Wick
3  *
4  * This file is part of Entropy Piano Tuner.
5  *
6  * Entropy Piano Tuner is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by the
8  * Free Software Foundation, either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * Entropy Piano Tuner is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along with
17  * Entropy Piano Tuner. If not, see http://www.gnu.org/licenses/.
18  *****************************************************************************/
19 
20 #ifndef PROJECTMANAGERFORQT_H
21 #define PROJECTMANAGERFORQT_H
22 
23 #include "../core/adapters/projectmanageradapter.h"
24 #include <QObject>
25 #include <QWidget>
26 
27 class MainWindow;
28 
36 {
37 public:
43  ProjectManagerForQt(MainWindow *mainwindow);
44 
49  virtual ~ProjectManagerForQt();
50 
56  virtual Results editFile() override final;
57 
64  virtual Results askForSaving() override final;
65 
71  virtual FileDialogResult getSavePath(int fileType) override final;
72 
78  virtual FileDialogResult getOpenPath(int fileType) override final;
79 
86  virtual Results share() override final;
87 
92  virtual void showOpenError() override final;
93 
98  virtual void showSaveError() override final;
99 
100 protected:
106  virtual void fillNew(Piano &piano) override final;
107 
112  QString getCurrentPath() const;
113 
118  void setCurrentPath(QString path);
119 
120 
121  QString getFileFilters(int fileTypes, bool addAll) const;
122 
123 private:
126 };
127 
128 #endif // PROJECTMANAGERFORQT_H
ProjectManagerForQt(MainWindow *mainwindow)
Default constructor.
void setCurrentPath(QString path)
Function to set the current path for the file dialog.
virtual void fillNew(Piano &piano) overridefinal
Fills the given Piano with default values and texts.
Implementation of the ProjectManagerAdapter in Qt.
QString getCurrentPath() const
Function to get the current path for the file dialog.
MainWindow * mMainWindow
The main window.
Definition: piano.h:40
virtual Results share() overridefinal
Handle the share button.
virtual void showSaveError() overridefinal
Shows an error message if an error during saving occured.
virtual void showOpenError() overridefinal
Shows an error message if an error during open occured.
Results
Enumeration of the possible outcomes of a typical mouse button.
virtual ~ProjectManagerForQt()
Empty virtual destructor.
virtual Results askForSaving() overridefinal
Displays a standard message box if the user wants to save the changes made.
virtual FileDialogResult getOpenPath(int fileType) overridefinal
Opens a QFileDialog to get a path to open a file.
QString getFileFilters(int fileTypes, bool addAll) const
virtual Results editFile() overridefinal
Opens the EditPianoSheetDialog to edit the piano data sheet.
The main window.
Definition: mainwindow.h:49
virtual FileDialogResult getSavePath(int fileType) overridefinal
Opens a QFileDialog to get a path to save the file to.
Project manager adapter class.