From: Sakari Poussa Date: Wed, 14 Oct 2009 20:35:19 +0000 (+0300) Subject: Added up, down, next buttons to course dialog. X-Git-Url: http://git.maemo.org/git/?p=scorecard;a=commitdiff_plain;h=2b9837a82b94cc3311fafdf6cd18a38fb7c9f1f3 Added up, down, next buttons to course dialog. --- diff --git a/Makefile b/Makefile deleted file mode 100644 index 90c9878..0000000 --- a/Makefile +++ /dev/null @@ -1,336 +0,0 @@ -############################################################################# -# Makefile for building: bin/scorecard -# Generated by qmake (2.01a) (Qt 4.5.3) on: Tue Oct 13 22:10:00 2009 -# Project: scorecard.pro -# Template: app -# Command: /usr/bin/qmake -unix -o Makefile scorecard.pro -############################################################################# - -####### Compiler, tools and options - -CC = gcc -CXX = g++ -DEFINES = -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -CFLAGS = -pipe -g -O0 -D_REENTRANT -Wall -W $(DEFINES) -CXXFLAGS = -pipe -Wno-return-type -g -g -O0 -D_REENTRANT -Wall -W $(DEFINES) -INCPATH = -I/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/linux-g++-opengl -I. -I/targets/FREMANTLE_X86/usr/include/qt4/QtCore -I/targets/FREMANTLE_X86/usr/include/qt4/QtGui -I/targets/FREMANTLE_X86/usr/include/qt4/QtXml -I/targets/FREMANTLE_X86/usr/include/qt4 -Imoc -LINK = g++ -LFLAGS = -LIBS = $(SUBLIBS) -L/usr/lib -Wl,-rpath-link=/usr/lib -lQtXml -lQtGui -lQtCore -lpthread -AR = ar cqs -RANLIB = -QMAKE = /usr/bin/qmake -TAR = tar -cf -COMPRESS = gzip -9f -COPY = cp -f -SED = sed -COPY_FILE = $(COPY) -COPY_DIR = $(COPY) -r -INSTALL_FILE = install -m 644 -p -INSTALL_DIR = $(COPY_DIR) -INSTALL_PROGRAM = install -m 755 -p -DEL_FILE = rm -f -SYMLINK = ln -sf -DEL_DIR = rmdir -MOVE = mv -f -CHK_DIR_EXISTS= test -d -MKDIR = mkdir -p - -####### Output directory - -OBJECTS_DIR = obj/ - -####### Files - -SOURCES = src/main.cpp \ - src/main-window.cpp \ - 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 moc/moc_main-window.cpp \ - moc/moc_score-dialog.cpp \ - moc/moc_course-dialog.cpp \ - moc/moc_cell-delegate.cpp \ - moc/moc_table-model.cpp \ - moc/moc_tree-model.cpp \ - moc/moc_tree-widget.cpp -OBJECTS = obj/main.o \ - obj/main-window.o \ - obj/score-dialog.o \ - obj/course-dialog.o \ - obj/cell-delegate.o \ - obj/table-model.o \ - obj/xml-parser.o \ - obj/xml-dom-parser.o \ - obj/data.o \ - obj/tree-model.o \ - obj/tree-item.o \ - obj/tree-widget.o \ - obj/moc_main-window.o \ - obj/moc_score-dialog.o \ - obj/moc_course-dialog.o \ - obj/moc_cell-delegate.o \ - obj/moc_table-model.o \ - obj/moc_tree-model.o \ - obj/moc_tree-widget.o -DIST = /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/g++.conf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/unix.conf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/linux.conf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/qconfig.pri \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_functions.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_config.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/exclusive_builds.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_pre.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/debug.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_post.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/unix/thread.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/moc.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/warn_on.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/resources.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/uic.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/yacc.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/lex.prf \ - scorecard.pro -QMAKE_TARGET = scorecard -DESTDIR = bin/ -TARGET = bin/scorecard - -first: all -####### Implicit rules - -.SUFFIXES: .o .c .cpp .cc .cxx .C - -.cpp.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" - -.cc.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" - -.cxx.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" - -.C.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" - -.c.o: - $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" - -####### Build rules - -all: Makefile $(TARGET) - -$(TARGET): $(OBJECTS) - @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/ - $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) - -Makefile: scorecard.pro /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/linux-g++-opengl/qmake.conf /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/g++.conf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/unix.conf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/linux.conf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/qconfig.pri \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_functions.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_config.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/exclusive_builds.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_pre.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/debug.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_post.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/unix/thread.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/moc.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/warn_on.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/resources.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/uic.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/yacc.prf \ - /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/lex.prf \ - /usr/lib/libQtXml.prl \ - /usr/lib/libQtGui.prl \ - /usr/lib/libQtCore.prl - $(QMAKE) -unix -o Makefile scorecard.pro -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/g++.conf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/unix.conf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/linux.conf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/qconfig.pri: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_functions.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_config.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/exclusive_builds.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_pre.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/debug.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_post.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/unix/thread.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/moc.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/warn_on.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/resources.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/uic.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/yacc.prf: -/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/lex.prf: -/usr/lib/libQtXml.prl: -/usr/lib/libQtGui.prl: -/usr/lib/libQtCore.prl: -qmake: FORCE - @$(QMAKE) -unix -o Makefile scorecard.pro - -dist: - @$(CHK_DIR_EXISTS) obj/scorecard1.0.0 || $(MKDIR) obj/scorecard1.0.0 - $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/scorecard1.0.0/ && $(COPY_FILE) --parents src/main-window.h 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 src/tree-item.h src/tree-widget.h obj/scorecard1.0.0/ && $(COPY_FILE) --parents src/main.cpp src/main-window.cpp 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 obj/scorecard1.0.0/ && (cd `dirname obj/scorecard1.0.0` && $(TAR) scorecard1.0.0.tar scorecard1.0.0 && $(COMPRESS) scorecard1.0.0.tar) && $(MOVE) `dirname obj/scorecard1.0.0`/scorecard1.0.0.tar.gz . && $(DEL_FILE) -r obj/scorecard1.0.0 - - -clean:compiler_clean - -$(DEL_FILE) $(OBJECTS) - -$(DEL_FILE) *~ core *.core - - -####### Sub-libraries - -distclean: clean - -$(DEL_FILE) $(TARGET) - -$(DEL_FILE) Makefile - - -mocclean: compiler_moc_header_clean compiler_moc_source_clean - -mocables: compiler_moc_header_make_all compiler_moc_source_make_all - -compiler_moc_header_make_all: moc/moc_main-window.cpp moc/moc_score-dialog.cpp moc/moc_course-dialog.cpp moc/moc_cell-delegate.cpp moc/moc_table-model.cpp moc/moc_tree-model.cpp moc/moc_tree-widget.cpp -compiler_moc_header_clean: - -$(DEL_FILE) moc/moc_main-window.cpp moc/moc_score-dialog.cpp moc/moc_course-dialog.cpp moc/moc_cell-delegate.cpp moc/moc_table-model.cpp moc/moc_tree-model.cpp moc/moc_tree-widget.cpp -moc/moc_main-window.cpp: src/data.h \ - src/table-model.h \ - src/tree-model.h \ - src/tree-item.h \ - src/main-window.h - /usr/bin/moc $(DEFINES) $(INCPATH) src/main-window.h -o moc/moc_main-window.cpp - -moc/moc_score-dialog.cpp: src/data.h \ - src/score-dialog.h - /usr/bin/moc $(DEFINES) $(INCPATH) src/score-dialog.h -o moc/moc_score-dialog.cpp - -moc/moc_course-dialog.cpp: src/course-dialog.h - /usr/bin/moc $(DEFINES) $(INCPATH) src/course-dialog.h -o moc/moc_course-dialog.cpp - -moc/moc_cell-delegate.cpp: src/cell-delegate.h - /usr/bin/moc $(DEFINES) $(INCPATH) src/cell-delegate.h -o moc/moc_cell-delegate.cpp - -moc/moc_table-model.cpp: src/data.h \ - src/table-model.h - /usr/bin/moc $(DEFINES) $(INCPATH) src/table-model.h -o moc/moc_table-model.cpp - -moc/moc_tree-model.cpp: src/tree-item.h \ - src/data.h \ - src/tree-model.h - /usr/bin/moc $(DEFINES) $(INCPATH) src/tree-model.h -o moc/moc_tree-model.cpp - -moc/moc_tree-widget.cpp: src/tree-widget.h - /usr/bin/moc $(DEFINES) $(INCPATH) src/tree-widget.h -o moc/moc_tree-widget.cpp - -compiler_rcc_make_all: -compiler_rcc_clean: -compiler_image_collection_make_all: qmake_image_collection.cpp -compiler_image_collection_clean: - -$(DEL_FILE) qmake_image_collection.cpp -compiler_moc_source_make_all: -compiler_moc_source_clean: -compiler_uic_make_all: -compiler_uic_clean: -compiler_yacc_decl_make_all: -compiler_yacc_decl_clean: -compiler_yacc_impl_make_all: -compiler_yacc_impl_clean: -compiler_lex_make_all: -compiler_lex_clean: -compiler_clean: compiler_moc_header_clean - -####### Compile - -obj/main.o: src/main.cpp src/main-window.h \ - src/data.h \ - src/table-model.h \ - src/tree-model.h \ - src/tree-item.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/main.o src/main.cpp - -obj/main-window.o: src/main-window.cpp src/main-window.h \ - src/data.h \ - src/table-model.h \ - src/tree-model.h \ - src/tree-item.h \ - src/score-dialog.h \ - src/course-dialog.h \ - src/tree-widget.h \ - src/xml-parser.h \ - src/xml-dom-parser.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/main-window.o src/main-window.cpp - -obj/score-dialog.o: src/score-dialog.cpp src/score-dialog.h \ - src/data.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/score-dialog.o src/score-dialog.cpp - -obj/course-dialog.o: src/course-dialog.cpp src/course-dialog.h \ - src/cell-delegate.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/course-dialog.o src/course-dialog.cpp - -obj/cell-delegate.o: src/cell-delegate.cpp src/cell-delegate.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/cell-delegate.o src/cell-delegate.cpp - -obj/table-model.o: src/table-model.cpp src/table-model.h \ - src/data.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/table-model.o src/table-model.cpp - -obj/xml-parser.o: src/xml-parser.cpp src/xml-parser.h \ - src/data.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/xml-parser.o src/xml-parser.cpp - -obj/xml-dom-parser.o: src/xml-dom-parser.cpp src/xml-dom-parser.h \ - src/data.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/xml-dom-parser.o src/xml-dom-parser.cpp - -obj/data.o: src/data.cpp src/data.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/data.o src/data.cpp - -obj/tree-model.o: src/tree-model.cpp src/tree-model.h \ - src/tree-item.h \ - src/data.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/tree-model.o src/tree-model.cpp - -obj/tree-item.o: src/tree-item.cpp src/tree-item.h \ - src/data.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/tree-item.o src/tree-item.cpp - -obj/tree-widget.o: src/tree-widget.cpp src/tree-widget.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/tree-widget.o src/tree-widget.cpp - -obj/moc_main-window.o: moc/moc_main-window.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_main-window.o moc/moc_main-window.cpp - -obj/moc_score-dialog.o: moc/moc_score-dialog.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_score-dialog.o moc/moc_score-dialog.cpp - -obj/moc_course-dialog.o: moc/moc_course-dialog.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_course-dialog.o moc/moc_course-dialog.cpp - -obj/moc_cell-delegate.o: moc/moc_cell-delegate.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_cell-delegate.o moc/moc_cell-delegate.cpp - -obj/moc_table-model.o: moc/moc_table-model.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_table-model.o moc/moc_table-model.cpp - -obj/moc_tree-model.o: moc/moc_tree-model.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_tree-model.o moc/moc_tree-model.cpp - -obj/moc_tree-widget.o: moc/moc_tree-widget.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_tree-widget.o moc/moc_tree-widget.cpp - -####### Install - -install: FORCE - -uninstall: FORCE - -FORCE: - diff --git a/TODO b/TODO index eb1e36b..ec612eb 100644 --- a/TODO +++ b/TODO @@ -1,12 +1,20 @@ -General: +TODO General: -- New course - selection dialog - Course view - Stat view - Settings +- Delete score +- Delete course +- Edit score +- Edit course -Hildon 2.2 +TODO Hildon 2.2 - Date picker for the score dialog - Replace LineEdit w/ HildonEntry - \ No newline at end of file + + +Know issues +- empty data dir causes crash +- new course + new score on that causes crash. Data is okay, issue in + using new data. diff --git a/bin/data/club-save.xml b/bin/data/club-save.xml deleted file mode 100644 index 894f1d9..0000000 --- a/bin/data/club-save.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bin/data/club.xml b/bin/data/club.xml deleted file mode 100644 index 894f1d9..0000000 --- a/bin/data/club.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bin/data/save/club.xml b/bin/data/save/club.xml deleted file mode 100644 index 480d26e..0000000 --- a/bin/data/save/club.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bin/data/save/score.xml b/bin/data/save/score.xml deleted file mode 100644 index 44628f4..0000000 --- a/bin/data/save/score.xml +++ /dev/null @@ -1,622 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bin/data/score-save.xml b/bin/data/score-save.xml deleted file mode 100644 index 32240a2..0000000 --- a/bin/data/score-save.xml +++ /dev/null @@ -1,642 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bin/data/score.xml b/bin/data/score.xml deleted file mode 100644 index 7405258..0000000 --- a/bin/data/score.xml +++ /dev/null @@ -1,842 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bin/data/score.xml~ b/bin/data/score.xml~ deleted file mode 100644 index 3126fb3..0000000 --- a/bin/data/score.xml~ +++ /dev/null @@ -1,282 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/club.xml b/data/club.xml index 36a1546..9f3974b 100644 --- a/data/club.xml +++ b/data/club.xml @@ -251,4 +251,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/score.xml b/data/score.xml index 8403b89..df2b7e8 100644 --- a/data/score.xml +++ b/data/score.xml @@ -959,4 +959,24 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/src/course-dialog.cpp b/src/course-dialog.cpp index 2ea1d05..781c1cb 100644 --- a/src/course-dialog.cpp +++ b/src/course-dialog.cpp @@ -68,22 +68,31 @@ void CourseSelectDialog::next(void) } } +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + CourseDialog::CourseDialog(QWidget *parent) : QDialog(parent) { resize(800, 400); + QWidget *centralWidget = new QWidget(this); + createTable(); - createLabel(); + createButton(); - createLayout(this); + createLayout(centralWidget); } void CourseDialog::createLayout(QWidget *parent) { - leftLayout = new QVBoxLayout(parent); + leftLayout = new QVBoxLayout; leftLayout->addWidget(table); - rightLayout = new QVBoxLayout(parent); + rightLayout = new QVBoxLayout; + rightLayout->addWidget(pushButtonUp); + rightLayout->addWidget(pushButtonDown); + rightLayout->addWidget(pushButtonNext); rightLayout->addStretch(); rightLayout->addWidget(pushButtonFinish); @@ -93,13 +102,16 @@ void CourseDialog::createLayout(QWidget *parent) setLayout(mainLayout); } -void CourseDialog::createLabel(QWidget *parent) +void CourseDialog::createButton(QWidget *parent) { - clubLabel = new QLabel(tr("Club")); - courseLabel = new QLabel(tr("Course")); - - clubEdit = new QLineEdit; - courseEdit = new QLineEdit; + pushButtonUp = new QPushButton(tr("+")); + connect(pushButtonUp, SIGNAL(clicked()), this, SLOT(up())); + + pushButtonDown = new QPushButton(tr("-")); + connect(pushButtonDown, SIGNAL(clicked()), this, SLOT(down())); + + pushButtonNext = new QPushButton(tr("Next")); + connect(pushButtonNext, SIGNAL(clicked()), this, SLOT(next())); pushButtonFinish = new QPushButton(tr("Finish")); connect(pushButtonFinish, SIGNAL(clicked()), this, SLOT(finish())); @@ -107,7 +119,7 @@ void CourseDialog::createLabel(QWidget *parent) void CourseDialog::createTable(QWidget *parent) { - table = new QTableWidget(rows, cols, parent); + table = new QTableWidget(ROWS, COLS, parent); QStringList headers; headers << "" << "Par" << "HCP" << "Len" << "" << "Par" << "HCP" << "Len"; @@ -121,8 +133,8 @@ void CourseDialog::createTable(QWidget *parent) table->verticalHeader()->setResizeMode(QHeaderView::Stretch); for (int i=0; i<18; i++) { - QTableWidgetItem *par = new QTableWidgetItem(""); - QTableWidgetItem *hcp = new QTableWidgetItem(""); + QTableWidgetItem *par = new QTableWidgetItem("4"); + QTableWidgetItem *hcp = new QTableWidgetItem("9"); QTableWidgetItem *len = new QTableWidgetItem(""); QTableWidgetItem *holeNum = new QTableWidgetItem(QString::number(i+1)); @@ -149,6 +161,63 @@ void CourseDialog::createTable(QWidget *parent) } } +void CourseDialog::up(void) +{ + QTableWidgetItem *item = table->currentItem(); + + if (!item) + return; + + int i = (item->text()).toInt(); + QVariant value(i+1); + item->setData(Qt::DisplayRole, value); +} + +void CourseDialog::down(void) +{ + QTableWidgetItem *item = table->currentItem(); + + if (!item) + return; + + int i = (item->text()).toInt(); + QVariant value(i-1); + item->setData(Qt::DisplayRole, value); +} + +void CourseDialog::next(void) +{ + if (table) { + QTableWidgetItem *item = table->currentItem(); + moveToNextCell(item); + //setDefaultScore(table); + } +} + +void CourseDialog::moveToNextCell(QTableWidgetItem *item) +{ + if (!item) + return; + + QTableWidget *table = item->tableWidget(); + + if (!table) + return; + + int row = table->currentRow(); + int col = table->currentColumn(); + + if (col < (COLS-1)) { + col++; + } + else if (col == (COLS-1)) { + col = 0; + row = (row == ROW_PAR_2) ? ROW_PAR : ROW_PAR_2; + } + //qDebug() << "new cell: " << row << "/" << col; + table->setCurrentCell(row, col); +} + void CourseDialog::results(QVector &par, QVector &hcp, QVector &len) diff --git a/src/course-dialog.h b/src/course-dialog.h index 92e3980..c983088 100644 --- a/src/course-dialog.h +++ b/src/course-dialog.h @@ -51,24 +51,28 @@ class CourseDialog: public QDialog void results(QVector &, QVector &, QVector &); bool validate(); - public slots: + private slots: + void up(void); + void down(void); + void next(void); void finish(void); private: enum { ROW_HOLE = 0, ROW_PAR = 1, ROW_HCP = 2, ROW_LEN = 3, ROW_HOLE_2 = 4, ROW_PAR_2 = 5, ROW_HCP_2 = 6, ROW_LEN_2 = 7}; - enum { rows = 8, cols = 9, separator_row = 3 }; + enum { ROWS = 8, COLS = 9, separator_row = 3 }; void createTable(QWidget *parent = 0); - void createLabel(QWidget *parent = 0); + void createButton(QWidget *parent = 0); void createLayout(QWidget *parent = 0); + void moveToNextCell(QTableWidgetItem *item); // Widgets QTableWidget *table; - QLabel *clubLabel; - QLabel *courseLabel; - QLineEdit *clubEdit; - QLineEdit *courseEdit; + + QPushButton *pushButtonUp; + QPushButton *pushButtonDown; + QPushButton *pushButtonNext; QPushButton *pushButtonFinish; // Layouts diff --git a/src/score-dialog.cpp b/src/score-dialog.cpp index 64eb517..357e688 100644 --- a/src/score-dialog.cpp +++ b/src/score-dialog.cpp @@ -13,8 +13,6 @@ SelectDialog::SelectDialog(QWidget *parent) : QDialog(parent) void SelectDialog::createLayout(QWidget *parent) { - labelClub = new QLabel(tr("Club")); - labelCourse = new QLabel(tr("Course")); listClub = new QListWidget(parent); lineEditDate = new QLineEdit; pushButtonNext = new QPushButton(tr("Next")); @@ -133,7 +131,6 @@ void ScoreDialog::createLayout(QWidget *parent) QHBoxLayout *mainLayout = new QHBoxLayout(parent); mainLayout->addLayout(leftLayout); mainLayout->addLayout(rightLayout); - setLayout(mainLayout); } @@ -148,16 +145,10 @@ void ScoreDialog::createTable(QWidget *parent) QStringList headers; headers << "" << "Par" << "HCP" << "Score" << "" << "Par" << "HCP" << "Score"; table->setVerticalHeaderLabels(headers); - - //connect(table, SIGNAL(itemChanged(QTableWidgetItem *)), this, SLOT(itemChanged(QTableWidgetItem *))); - //connect(table, SIGNAL(itemPressed(QTableWidgetItem *)), this, SLOT(itemChanged(QTableWidgetItem *))); } void ScoreDialog::createButton(QWidget *parent) { - pushButtonFinish = new QPushButton(tr("Finish")); - connect(pushButtonFinish, SIGNAL(clicked()), this, SLOT(finish())); - pushButtonUp = new QPushButton(tr("+")); connect(pushButtonUp, SIGNAL(clicked()), this, SLOT(up())); @@ -166,6 +157,9 @@ void ScoreDialog::createButton(QWidget *parent) pushButtonNext = new QPushButton(tr("Next")); connect(pushButtonNext, SIGNAL(clicked()), this, SLOT(next())); + + pushButtonFinish = new QPushButton(tr("Finish")); + connect(pushButtonFinish, SIGNAL(clicked()), this, SLOT(finish())); } void ScoreDialog::init(Course *course) @@ -230,28 +224,28 @@ void ScoreDialog::setDefaultScore(QTableWidget *table) } } -void ScoreDialog::moveToNextCell(QTableWidgetItem *item) +void ScoreDialog::up(void) { + QTableWidgetItem *item = table->currentItem(); + if (!item) return; - QTableWidget *table = item->tableWidget(); + int i = (item->text()).toInt(); + QVariant value(i+1); + item->setData(Qt::DisplayRole, value); +} - if (!table) - return; +void ScoreDialog::down(void) +{ + QTableWidgetItem *item = table->currentItem(); - int row = table->currentRow(); - int col = table->currentColumn(); + if (!item) + return; - if (col < (COLS-1)) { - col++; - } - else if (col == (COLS-1)) { - col = 0; - row = (row == ROW_SCORE_2) ? ROW_SCORE : ROW_SCORE_2; - } - //qDebug() << "new cell: " << row << "/" << col; - table->setCurrentCell(row, col); + int i = (item->text()).toInt(); + QVariant value(i-1); + item->setData(Qt::DisplayRole, value); } void ScoreDialog::next(void) @@ -263,32 +257,28 @@ void ScoreDialog::next(void) } } -void ScoreDialog::up(void) +void ScoreDialog::moveToNextCell(QTableWidgetItem *item) { - QTableWidgetItem *item = table->currentItem(); - if (!item) return; - int i = (item->text()).toInt(); - QVariant value(i+1); - item->setData(Qt::DisplayRole, value); -} - -void ScoreDialog::down(void) -{ - QTableWidgetItem *item = table->currentItem(); + QTableWidget *table = item->tableWidget(); - if (!item) + if (!table) return; - int i = (item->text()).toInt(); - QVariant value(i-1); - item->setData(Qt::DisplayRole, value); -} + int row = table->currentRow(); + int col = table->currentColumn(); -void ScoreDialog::itemChanged(QTableWidgetItem *item) -{ + if (col < (COLS-1)) { + col++; + } + else if (col == (COLS-1)) { + col = 0; + row = (row == ROW_SCORE_2) ? ROW_SCORE : ROW_SCORE_2; + } + //qDebug() << "new cell: " << row << "/" << col; + table->setCurrentCell(row, col); } void ScoreDialog::results(QVector &scores) diff --git a/src/score-dialog.h b/src/score-dialog.h index 3d7a2eb..8b3defd 100644 --- a/src/score-dialog.h +++ b/src/score-dialog.h @@ -57,12 +57,10 @@ public: bool validate(void); private slots: - void itemChanged(QTableWidgetItem *item); - void moveToNextCell(QTableWidgetItem *item); - void finish(void); void up(void); void down(void); void next(void); + void finish(void); private: @@ -70,6 +68,7 @@ private: void createButton(QWidget *parent = 0); void createLayout(QWidget *parent = 0); void setDefaultScore(QTableWidget *table); + void moveToNextCell(QTableWidgetItem *item); enum { ROWS = 8, COLS = 9 }; enum { ROW_HOLE = 0, ROW_PAR = 1, ROW_HCP = 2, ROW_SCORE = 3,