Entropy Piano Tuner
1.1.3 (documentation not yet complete)
An open-source experimental software for piano tuning by entropy minimization
|
Implementation of the ProjectManagerAdapter in Qt. More...
#include <projectmanagerforqt.h>
Public Member Functions | |
ProjectManagerForQt (MainWindow *mainwindow) | |
Default constructor. More... | |
virtual | ~ProjectManagerForQt () |
Empty virtual destructor. More... | |
virtual Results | editFile () overridefinal |
Opens the EditPianoSheetDialog to edit the piano data sheet. More... | |
virtual Results | askForSaving () overridefinal |
Displays a standard message box if the user wants to save the changes made. More... | |
virtual FileDialogResult | getSavePath (int fileType) overridefinal |
Opens a QFileDialog to get a path to save the file to. More... | |
virtual FileDialogResult | getOpenPath (int fileType) overridefinal |
Opens a QFileDialog to get a path to open a file. More... | |
virtual Results | share () overridefinal |
Handle the share button. More... | |
virtual void | showOpenError () overridefinal |
Shows an error message if an error during open occured. More... | |
virtual void | showSaveError () overridefinal |
Shows an error message if an error during saving occured. More... | |
Public Member Functions inherited from ProjectManagerAdapter | |
ProjectManagerAdapter () | |
Constructor. More... | |
virtual | ~ProjectManagerAdapter () |
Empty destructor. More... | |
void | init (Core *core) |
Initialize the project management adapter. More... | |
void | setCallback (FileChangesCallback *cb) |
Set a callback function for file changes. More... | |
bool | hasChangesInFile () const |
const std::string & | getCurrentFilePath () const |
Results | onNewFile () |
New-file menu response. More... | |
Results | onSaveFile () |
Results | onSaveFileAs () |
Results | onOpenFile () |
bool | onQuit () |
Results | onEditFile () |
Results | onShare () |
Results | onExport () |
Results | saveFile (const std::string &path, piano::FileType type) |
Results | openFile (const std::string &path, bool cached=false) |
Protected Member Functions | |
virtual void | fillNew (Piano &piano) overridefinal |
Fills the given Piano with default values and texts. More... | |
QString | getCurrentPath () const |
Function to get the current path for the file dialog. More... | |
void | setCurrentPath (QString path) |
Function to set the current path for the file dialog. More... | |
QString | getFileFilters (int fileTypes, bool addAll) const |
Protected Member Functions inherited from ProjectManagerAdapter | |
virtual void | handleMessage (MessagePtr m) override |
message listener callback More... | |
void | setChangesInFile (bool b) |
change the state of mChangesInFile and notify the listener More... | |
Private Attributes | |
MainWindow * | mMainWindow |
The main window. More... | |
Additional Inherited Members | |
Public Types inherited from ProjectManagerAdapter | |
enum | Results { R_CANCELED, R_YES, R_NO, R_ACCEPTED } |
Enumeration of the possible outcomes of a typical mouse button. More... | |
Protected Attributes inherited from ProjectManagerAdapter | |
Core * | mCore |
the core More... | |
PianoFile | mPianoFile |
the piano file More... | |
Implementation of the ProjectManagerAdapter in Qt.
The class will use a QFileDialog to open and close files. It will open the EditPianoSheetDialog to edit the piano data sheet.
Definition at line 35 of file projectmanagerforqt.h.
ProjectManagerForQt::ProjectManagerForQt | ( | MainWindow * | mainwindow | ) |
Default constructor.
mainwindow | : Pointer to the MainWindow |
Definition at line 39 of file projectmanagerforqt.cpp.
|
virtual |
Empty virtual destructor.
Definition at line 45 of file projectmanagerforqt.cpp.
|
finaloverridevirtual |
Displays a standard message box if the user wants to save the changes made.
Implements ProjectManagerAdapter.
Definition at line 62 of file projectmanagerforqt.cpp.
|
finaloverridevirtual |
Opens the EditPianoSheetDialog to edit the piano data sheet.
Implements ProjectManagerAdapter.
Definition at line 51 of file projectmanagerforqt.cpp.
|
finaloverrideprotectedvirtual |
Fills the given Piano with default values and texts.
piano | : The piano where to store the data to |
Implements ProjectManagerAdapter.
Definition at line 146 of file projectmanagerforqt.cpp.
|
protected |
Function to get the current path for the file dialog.
Definition at line 167 of file projectmanagerforqt.cpp.
|
protected |
Definition at line 178 of file projectmanagerforqt.cpp.
|
finaloverridevirtual |
Opens a QFileDialog to get a path to open a file.
Implements ProjectManagerAdapter.
Definition at line 104 of file projectmanagerforqt.cpp.
|
finaloverridevirtual |
Opens a QFileDialog to get a path to save the file to.
Implements ProjectManagerAdapter.
Definition at line 79 of file projectmanagerforqt.cpp.
|
protected |
Function to set the current path for the file dialog.
path | The absolute file path |
Definition at line 172 of file projectmanagerforqt.cpp.
|
finaloverridevirtual |
Handle the share button.
It will call a native java method on android for sharing.
Implements ProjectManagerAdapter.
Definition at line 124 of file projectmanagerforqt.cpp.
|
finaloverridevirtual |
Shows an error message if an error during open occured.
Implements ProjectManagerAdapter.
Definition at line 159 of file projectmanagerforqt.cpp.
|
finaloverridevirtual |
Shows an error message if an error during saving occured.
Implements ProjectManagerAdapter.
Definition at line 163 of file projectmanagerforqt.cpp.
|
private |
The main window.
Definition at line 125 of file projectmanagerforqt.h.