Introduce user mode (Basic and Pro)
[scorecard] / src / score-common.h
1 /*
2  * Copyright (C) 2009 Sakari Poussa
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, version 2.
7  */
8 #ifndef SCORE_COMMON_H
9 #define SCORE_COMMON_H
10
11 #include <QColor>
12
13 static QString settingsGroup("Settings");
14 static QString settingsHcp("hcp");
15 static QString settingsHomeClub("home-club");
16 static QString settingsSortOrder("sort-order");
17 static QString settingsUserMode("user-mode");
18 static QString settingsDefaultCourses("default-courses");
19
20 #ifndef WANT_DEBUG
21 #define TRACE
22 #else
23 #include <QDebug>
24 #define TRACE qDebug()<<QString("[%1] %2(): %3").arg(__FILE__).arg(__func__).arg(__LINE__);
25 #endif
26
27 static int fontSize = 20;
28
29 class AppSettings {
30 public:
31     QVariant hcp;
32     QVariant homeClub;
33     QVariant sortOrder;
34     QVariant defaultCourses;
35     QVariant userMode;
36 };
37
38 class ScoreColor
39 {
40  public:
41     static QColor holeBg()      { return Qt::white;                }
42     static QColor holeFg()      { return Qt::yellow;               }
43     static QColor birdie()      { return Qt::yellow;               }
44     static QColor par()         { return Qt::green;                }
45     static QColor bogey()       { return Qt::cyan;                 }
46     static QColor doubleBogey() { return Qt::red;                  }
47     static QColor bad()         { return Qt::red;                  }
48     static QColor subTotal()    { return Qt::white;                }
49     static QColor total()       { return Qt::white;                }
50 }; 
51
52 static QString statStyleSheet("QTableView {color : white;}");
53 static QString defaultStyleSheet("QTableView {"
54                                  "background-color: white;"
55                                  "color : gray;"
56                                  "border: solid green;"
57                                  "}"
58                                  "QHeaderView::section {"
59                                  "color : white;"
60                                  "border: solid green;"
61                                  "}");
62 #if 0
63 "QAbstractItemView::item[role=\"header\"]{"
64 "background : orange;"
65 "color : yellow;"
66 "border: solid green;"
67 "font-size : 16px;"
68 "}"
69 "QAbstractItemView::item"
70 "background : orange;"
71 "color : white;"
72 "border: solid green;"
73 "font-size : 16px;"
74 "}"
75 "QTableView {"
76 "alternate-background-color: yellow;"
77 "background-color: red;"
78 "color : blue;"
79 "border: solid green;"
80 "gridline-color: green;"
81 "}"
82 #endif
83 #endif