00001 #ifndef SETTINGS_H 00002 #define SETTINGS_H 00003 00004 #include <QRgb> 00005 #include <QSettings> 00006 #include <QFileDialog> 00007 #include <QMessageBox> 00008 #include <QColorDialog> 00009 #include <QDebug> 00010 #include "datadefinitions.h" 00011 00012 class MainWindow; 00013 00014 class Settings : public QObject 00015 { 00016 Q_OBJECT; 00017 00018 public: 00019 Settings(); 00020 Settings(MainWindow *main); 00021 void setMainWindow(MainWindow *main); 00022 00023 bool read(); 00024 bool write(); 00025 00026 /*GENERAL SETTINGS*/ 00027 void setAutomaticCheckForUpdates(const bool &check) { checkautomatically = check; } 00028 bool automaticCheckForUpdates() { return checkautomatically;} 00029 /*GENERAL SETTINGS*/ 00030 00031 /*PROJECT*/ 00032 void setWorkspace(const QDir &d) { workspacedir = d; } 00033 QDir workspace() { return workspacedir; } 00034 QString chooseWorkspacePath(); //calls a Folderchooser and returns the path the user chooses 00035 /*PROJECT*/ 00036 00037 /*COLOR*/ 00038 void setProductionCostsCUColor(const QRgb &pc) { productionCostsCU = pc; } 00039 QRgb productionCostsCUColor() { return productionCostsCU; } 00040 00041 void setProfitCUColor(const QRgb &pr) { profitCU = pr; } 00042 QRgb profitCUColor() { return profitCU;} 00043 00044 void setCommissionCUColor(const QRgb &com) { commissionCU = com; } 00045 QRgb commissionCUColor() { return commissionCU; } 00046 00047 void setTradeDiscountCUColor(const QRgb &tc) { tradeDiscount = tc;} 00048 QRgb tradeDiscountCUColor() { return tradeDiscount; } 00049 00050 void setDiscountCUColor(const QRgb &d) { discountCU = d; } 00051 QRgb discountCUColor() { return discountCU; } 00052 00053 void setSalesTaxCUColor(const QRgb &st) { salesTaxCU = st; } 00054 QRgb salesTaxCUColor() { return salesTaxCU; } 00055 /*COLOR*/ 00056 00057 private: 00058 MainWindow *mainwindow; //needed for setting the right geometries at startup 00059 00060 /*GENERAL SETTINGS*/ 00061 bool checkautomatically; 00062 /*GENERAL SETTINGS*/ 00063 00064 /*PROJECT*/ 00065 QDir workspacedir; 00066 /*PROJECT*/ 00067 00068 /*COLOR*/ 00069 QRgb productionCostsCU; 00070 QRgb profitCU; 00071 QRgb commissionCU; 00072 QRgb tradeDiscount; 00073 QRgb discountCU; 00074 QRgb salesTaxCU; 00075 /*COLOR*/ 00076 }; 00077 00078 #endif