00001 #ifndef SETTINGS_H 00002 #define SETTINGS_H 00003 00004 #include <QSettings> 00005 #include <QFileDialog> 00006 #include "datadefinitions.h" 00007 00008 class MainWindow; 00009 00010 class Settings : public QObject 00011 { 00012 Q_OBJECT; 00013 public: 00014 Settings(); 00015 Settings(MainWindow *main); 00016 void setMainWindow(MainWindow *main); 00017 00018 bool read(); 00019 bool write(); 00020 00021 /*GENERAL SETTINGS*/ 00022 00023 00024 void setAutomaticCheckForUpdates(const bool &check) { checkautomatically = check; } 00025 bool automaticCheckForUpdates() { return checkautomatically;} 00026 00027 void setTeacher(const bool &m) { userIsTeacher = m; } 00028 bool teacher() { return userIsTeacher;} 00029 /*GENERAL SETTINGS*/ 00030 00031 void setWorkspace(const QDir &d) { workspacedir = d; } 00032 QDir workspace() { return workspacedir; } 00033 QString chooseWorkspacePath(); //calls a Folderchooser and returns the path the user chooses 00034 00035 void setIntroPage(bool introPage) { printIntroPage = introPage; } 00036 void setEmptySolution(bool emptySolution) { printEmptySolution = emptySolution; } 00037 void setNewPageSolution(bool newPageSolution) { printNewPageSolution = newPageSolution; } 00038 00039 bool introPage() { return printIntroPage; } 00040 bool emptySolution() { return printEmptySolution; } 00041 bool newPageSolution() { return printNewPageSolution; } 00042 00043 private: 00044 MainWindow *mainwindow; //needed for setting the right geometries at startup 00045 00046 /*Updates*/ 00047 bool checkautomatically; 00048 /*UPDATES*/ 00049 00050 /*Mode*/ 00051 bool userIsTeacher; 00052 /*Mode*/ 00053 00054 /*Workspace*/ 00055 QDir workspacedir; 00056 /*Workspace*/ 00057 00058 /*Printing*/ 00059 bool printIntroPage; 00060 bool printEmptySolution; 00061 bool printNewPageSolution; 00062 /*Printing*/ 00063 }; 00064 00065 #endif