From 36cfda84bfac0c1325b94e66764656fdc169dd5c Mon Sep 17 00:00:00 2001 From: Sakari Poussa Date: Mon, 19 Oct 2009 23:43:25 +0300 Subject: [PATCH] Added debian packaging More robust data handling when no data Updated TODO list --- TODO | 22 +- data/club-save.xml | 152 ----- data/club.xml | 534 +++++----------- data/save/club.xml | 212 +++++++ data/save/score.xml | 1680 +++++++++++++++++++++++++++++++------------------ data/score-save.xml | 642 ------------------- data/score.xml | 1740 ++++++++++++++++++++------------------------------- data/score.xml~ | 282 --------- debian/changelog | 3 +- debian/changelog~ | 14 - debian/control | 2 +- debian/control~ | 46 -- debian/dirs | 2 +- debian/rules | 10 +- scorecard.pro | 39 +- src/main-window.cpp | 66 +- src/main-window.h | 1 + src/main.cpp | 1 - src/table-model.cpp | 7 +- 19 files changed, 2240 insertions(+), 3215 deletions(-) delete mode 100644 data/club-save.xml delete mode 100644 data/score-save.xml delete mode 100644 data/score.xml~ delete mode 100644 debian/changelog~ delete mode 100644 debian/control~ diff --git a/TODO b/TODO index ec612eb..b3ec2d7 100644 --- a/TODO +++ b/TODO @@ -1,12 +1,20 @@ TODO General: -- Course view -- Stat view -- Settings +for 0.1 +- Sort scores based on date +- New score - first entry does not update + +for 0.2 +- Date picker button +- Course view - sort menu buttons +- Edit course +- Edit score - Delete score - Delete course -- Edit score -- Edit course + +for 0.3 +- Stat view +- Settings TODO Hildon 2.2 @@ -15,6 +23,4 @@ TODO Hildon 2.2 Know issues -- empty data dir causes crash -- new course + new score on that causes crash. Data is okay, issue in - using new data. + - Data on MMC does not work diff --git a/data/club-save.xml b/data/club-save.xml deleted file mode 100644 index 894f1d9..0000000 --- a/data/club-save.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/club.xml b/data/club.xml index 50e8be9..fdd550c 100644 --- a/data/club.xml +++ b/data/club.xml @@ -1,364 +1,174 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/save/club.xml b/data/save/club.xml index 894f1d9..50e8be9 100644 --- a/data/save/club.xml +++ b/data/save/club.xml @@ -149,4 +149,216 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/save/score.xml b/data/save/score.xml index 44628f4..4dfe26a 100644 --- a/data/save/score.xml +++ b/data/save/score.xml @@ -1,622 +1,1062 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/score-save.xml b/data/score-save.xml deleted file mode 100644 index 32240a2..0000000 --- a/data/score-save.xml +++ /dev/null @@ -1,642 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/score.xml b/data/score.xml index 4dfe26a..4eb3fad 100644 --- a/data/score.xml +++ b/data/score.xml @@ -1,1062 +1,682 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/score.xml~ b/data/score.xml~ deleted file mode 100644 index 3126fb3..0000000 --- a/data/score.xml~ +++ /dev/null @@ -1,282 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/debian/changelog b/debian/changelog index d5bccea..2194bcb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,5 +2,4 @@ scorecard (0.1-1) unstable; urgency=low * Initial release - -- Sakari Poussa Sun, 11 Oct 2009 - + -- Sakari Poussa Sun, 11 Oct 2009 08:46:17 +0300 diff --git a/debian/changelog~ b/debian/changelog~ deleted file mode 100644 index 180d9f1..0000000 --- a/debian/changelog~ +++ /dev/null @@ -1,14 +0,0 @@ -qt-maemo-example (0.1-2) unstable; urgency=low - - * Fix Maemo-Icon-26 field in control - * Fix postinstall script - * Remove install script - - -- Antonio Aloisio Fri, 15 Aug 2008 08:46:17 +0300 - -qt-maemo-example (0.1-1) unstable; urgency=low - - * Initial release - - -- Antonio Aloisio Wed, 13 Aug 2008 14:17:22 +0300 - diff --git a/debian/control b/debian/control index 694a4b1..b6445fb 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Standards-Version: 3.7.2 Package: scorecard Architecture: any -Depends: libqt4-core (>= 4.5.3), libqt4-gui (>= 4.5.3), libqt4-xml (>= 4.5.3) +Depends: libqt4-gui (>= 4.5.3~git20090723-0maemo4.1) Description: A simple golf score card application for N900 . Further Information: qt4.garage.maemo.org diff --git a/debian/control~ b/debian/control~ deleted file mode 100644 index d6a39fa..0000000 --- a/debian/control~ +++ /dev/null @@ -1,46 +0,0 @@ -Source: qt-maemo-example -Section: user/other -Priority: optional -Maintainer: Antonio Aloisio -Build-Depends: debhelper (>= 5), libqt4-dev -Standards-Version: 3.7.2 - -Package: qt-maemo-example -Architecture: any -Depends: libqt4-core (>= 4.5.2), libc6 (>= 2.5.0-1), libgcc1 (>= 1:4.2.1), libqt4-gui (>= 4.5.2), libstdc++6 (>= 4.2.1),, hildon-application-manager -Description: A simple Qt text editor - A simple Qt application to test maemo Qt. - You can analize this package in order to - understand how to package a Qt application - for maemo. - . - Further Information: qt4.garage.maemo.org -XB-Maemo-Icon-26: - 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 - RK5CYII= diff --git a/debian/dirs b/debian/dirs index 80507f1..e3ff3fa 100644 --- a/debian/dirs +++ b/debian/dirs @@ -1,2 +1,2 @@ -usr/bin +opt/scorecard usr/share/applications/hildon diff --git a/debian/rules b/debian/rules index 4d4009e..a82bee5 100755 --- a/debian/rules +++ b/debian/rules @@ -1,20 +1,15 @@ #!/usr/bin/make -f # -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -APPNAME := qt-maemo-example +APPNAME := scorecard builddir: mkdir -p builddir builddir/Makefile: builddir - cd builddir && qmake-qt4 PREFIX=/usr ../$(APPNAME).pro + cd builddir && qmake PREFIX=/usr ../$(APPNAME).pro build: build-stamp @@ -23,7 +18,6 @@ build-stamp: builddir/Makefile # Add here commands to compile the package. cd builddir && $(MAKE) - #docbook-to-man debian/$(APPNAME).sgml > $(APPNAME).1 touch $@ diff --git a/scorecard.pro b/scorecard.pro index c9899d7..d29d7fd 100644 --- a/scorecard.pro +++ b/scorecard.pro @@ -1,3 +1,4 @@ +TARGET = bin/scorecard DESTDIR = bin MOC_DIR = moc OBJECTS_DIR = obj @@ -15,7 +16,6 @@ src/score-dialog.h \ src/course-dialog.h \ src/cell-delegate.h \ src/table-model.h \ -src/xml-parser.h \ src/xml-dom-parser.h \ src/data.h \ src/tree-model.h \ @@ -29,9 +29,44 @@ src/score-dialog.cpp \ src/course-dialog.cpp \ src/cell-delegate.cpp \ src/table-model.cpp \ -src/xml-parser.cpp \ src/xml-dom-parser.cpp \ src/data.cpp \ src/tree-model.cpp \ src/tree-item.cpp \ src/tree-widget.cpp + +unix { + #VARIABLES + PREFIX = /opt/scorecard + BINDIR = $$PREFIX/bin + DATADIR = $$PREFIX/data + IMGDIR = $$PREFIX/images + MAEMODIR = /usr/share/applications/hildon + + DEFINES += DATADIR=\\\"$$DATADIR\\\" PKGDATADIR=\\\"$$PKGDATADIR\\\" + + #MAKE INSTALL + INSTALLS += target data desktop iconxpm icon26 icon40 icon64 + + target.path =$$BINDIR + + data.path = $$DATADIR + data.files += data/club.xml + data.files += data/score.xml + + desktop.path = $$MAEMODIR + desktop.files += maemo/scorecard.desktop + + iconxpm.path = $$IMGDIR/pixmap + iconxpm.files += images/scorecard.xpm + + icon26.path = $$IMGDIR/icons/hicolor/26x26/apps + icon26.files += images/scorecard_icon_26x26.png + + icon40.path = $$IMGADIR/icons/hicolor/40x40/apps + icon40.files += images/scorecard_icon_40x40.png + + icon64.path = $$IMGDIR/icons/hicolor/64x64/apps + icon64.files += images/scorecard_icon_64x64.png + +} diff --git a/src/main-window.cpp b/src/main-window.cpp index a1e3488..c235605 100644 --- a/src/main-window.cpp +++ b/src/main-window.cpp @@ -11,15 +11,23 @@ #include "xml-parser.h" #include "xml-dom-parser.h" -QString scoreFile("data/score.xml"); -QString scoreFileWr("data/score-save.xml"); -QString clubFile("data/club.xml"); -QString clubFileWr("data/club-save.xml"); +QString topDir("/opt/scorecard"); +QString mmcDir("/media/mmc1/scorecard"); +QString dataDirName("/data/"); +QString dataDir; +QString imgDir(topDir + "/pixmaps"); +QString scoreFileName("score.xml"); +QString scoreFile; +QString clubFileName("club.xml"); +QString clubFile; +QString logFile("/tmp/scorecard.log"); MainWindow::MainWindow(QMainWindow *parent) : QMainWindow(parent) { resize(800, 480); + loadSettings(); + QWidget *centralWidget = new QWidget(this); // TODO: move to proper function @@ -46,6 +54,37 @@ MainWindow::MainWindow(QMainWindow *parent) : QMainWindow(parent) createMenus(); } +void MainWindow::loadSettings(void) +{ + bool external = false; + +#ifndef Q_WS_HILDON + topDir = "."; +#endif + + QDir mmc(mmcDir); + if (mmc.exists()) + external = true; + + if (external) { + dataDir = mmcDir + dataDirName; + } + else { + dataDir = topDir + dataDirName; + } + scoreFile = dataDir + scoreFileName; + clubFile = dataDir + clubFileName; + + QDir dir(dataDir); + if (!dir.exists()) + if (!dir.mkdir(dataDir)) { + // TODO: mkdir does not work... + qDebug() << "Unable to create: " + dataDir; + return; + } + qDebug() << "Data is at: " + dataDir; +} + void MainWindow::createLayout(QWidget *parent) { buttonLayout = new QVBoxLayout; @@ -325,8 +364,7 @@ void MainWindow::loadScoreFile(QString &fileName, QList &list) ScoreXmlHandler handler(list); if (handler.parse(fileName)) - qDebug() << "Score loaded : " << fileName; - qDebug() << "Score entries : " << list.size(); + qDebug() << "File loaded: " + fileName +" entries : " + list.size(); } void MainWindow::saveScoreFile(QString &fileName, QList &list) @@ -334,8 +372,10 @@ void MainWindow::saveScoreFile(QString &fileName, QList &list) ScoreXmlHandler handler(list); if (handler.save(fileName)) - qDebug() << "Score saved : " << fileName << - " entries : " << list.size(); + // TODO: banner + qDebug() << "File saved : " << fileName << " entries : " << list.size(); + else + qDebug() << "Unable to save : " << fileName; } void MainWindow::loadClubFile(QString &fileName, QList &list) @@ -343,8 +383,7 @@ void MainWindow::loadClubFile(QString &fileName, QList &list) ClubXmlHandler handler(list); if (handler.parse(fileName)) - qDebug() << "Club loaded: " << fileName; - qDebug() << "Club entries : " << list.size(); + qDebug() << "File loaded: " + fileName +" entries : " + list.size(); } void MainWindow::saveClubFile(QString &fileName, QList &list) @@ -352,6 +391,9 @@ void MainWindow::saveClubFile(QString &fileName, QList &list) ClubXmlHandler handler(list); if (handler.save(fileName)) - qDebug() << "Club saved : " << fileName << - " entries : " << list.size(); + // TODO: banner + qDebug() << "File saved : " << fileName << " entries : " << list.size(); + else + qDebug() << "Unable to save : " << fileName; + } diff --git a/src/main-window.h b/src/main-window.h index ca39136..d01907b 100644 --- a/src/main-window.h +++ b/src/main-window.h @@ -42,6 +42,7 @@ private slots: private: + void loadSettings(void); Club *findClub(QString &name); QList scoreList; diff --git a/src/main.cpp b/src/main.cpp index e1f9e23..bc3fad8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,7 +8,6 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - //#define Q_WS_HILDON #ifdef Q_WS_HILDON QStringList keys = QInputContextFactory::keys(); qDebug() << "Input Context Factory keys: " << keys; diff --git a/src/table-model.cpp b/src/table-model.cpp index e973bfb..98bbf18 100644 --- a/src/table-model.cpp +++ b/src/table-model.cpp @@ -153,6 +153,7 @@ QVariant ScoreTableModel::data(const QModelIndex &index, int role) const // COLORS // if (role == Qt::BackgroundRole) { + //if (role == Qt::ForegroundRole) { int par = (course->getPar(index.column() + offset)).toInt(); int shots = (score->getScore(index.column() + offset)).toInt(); @@ -161,12 +162,14 @@ QVariant ScoreTableModel::data(const QModelIndex &index, int role) const // Total score QColor color(Qt::blue); QBrush brush(color); + brush.setStyle(Qt::Dense6Pattern); return brush; } if (col == 9 && row == 2) { // In and Out scores QColor color(Qt::blue); QBrush brush(color); + brush.setStyle(Qt::Dense7Pattern); return brush; } if (index.column() < 9) { @@ -255,9 +258,9 @@ QVariant ScoreTableModel::headerData(int section, Qt::Orientation orientation, i if (section >= 0 && section <= 8) return QString("%1").arg(section+1); else if (section == 9) - return QString("I/O"); + return QString(""); // was: I/O else - return QString("Tot"); + return QString(""); // was: Tot else { switch(section) { case 0: -- 1.7.9.5