From: Jouko Kylmäoja Date: Tue, 11 May 2010 12:47:21 +0000 (+0300) Subject: Initial commit X-Git-Url: https://vcs.maemo.org/git/?p=golf-scorecard;a=commitdiff_plain;h=811c1e0f554a4298955bad5cd11959267713e5ff Initial commit --- 811c1e0f554a4298955bad5cd11959267713e5ff diff --git a/golfscorecard.pro b/golfscorecard.pro new file mode 100644 index 0000000..3569111 --- /dev/null +++ b/golfscorecard.pro @@ -0,0 +1,29 @@ +# ------------------------------------------------- +# Project created by QtCreator 2010-04-13T16:47:30 +# ------------------------------------------------- +QT += xml +TARGET = golfscorecard +TEMPLATE = app +SOURCES += main.cpp \ + mainwindow.cpp \ + newround.cpp \ + xmlparser.cpp \ + datahandling.cpp \ + basicscorecard.cpp \ + pcmanagement.cpp \ + playermanagement.cpp +HEADERS += mainwindow.h \ + newround.h \ + xmlparser.h \ + datahandling.h \ + player.h \ + courses.h \ + basicscorecard.h \ + pcmanagement.h \ + playermanagement.h +FORMS += mainwindow.ui \ + newround.ui \ + basicscorecard.ui \ + pcmanagement.ui \ + playermanagement.ui +RESOURCES += resources.qrc diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..6b7fea7 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,143 @@ +############################################################################# +# Makefile for building: golfscorecard +# Generated by qmake (2.01a) (Qt 4.6.2) on: pe 30. huhti 00:49:00 2010 +# Project: golfscorecard.pro +# Template: app +# Command: c:\qt\2010.02.1\qt\bin\qmake.exe -spec c:\Qt\2010.02.1\qt\mkspecs\win32-g++ -win32 CONFIG+=release -o Makefile golfscorecard.pro +############################################################################# + +first: release +install: release-install +uninstall: release-uninstall +MAKEFILE = Makefile +QMAKE = c:\qt\2010.02.1\qt\bin\qmake.exe +DEL_FILE = del +CHK_DIR_EXISTS= if not exist +MKDIR = mkdir +COPY = copy /y +COPY_FILE = $(COPY) +COPY_DIR = xcopy /s /q /y /i +INSTALL_FILE = $(COPY_FILE) +INSTALL_PROGRAM = $(COPY_FILE) +INSTALL_DIR = $(COPY_DIR) +DEL_FILE = del +SYMLINK = +DEL_DIR = rmdir +MOVE = move +CHK_DIR_EXISTS= if not exist +MKDIR = mkdir +SUBTARGETS = \ + release \ + debug + +release: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release +release-make_default: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release +release-make_first: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release first +release-all: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release all +release-clean: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release clean +release-distclean: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release distclean +release-install: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release install +release-uninstall: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release uninstall +debug: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug +debug-make_default: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug +debug-make_first: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug first +debug-all: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug all +debug-clean: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug clean +debug-distclean: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug distclean +debug-install: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug install +debug-uninstall: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug uninstall + +Makefile: golfscorecard.pro c:/Qt/2010.02.1/qt/mkspecs/win32-g++/qmake.conf c:/Qt/2010.02.1/qt/mkspecs/qconfig.pri \ + c:/Qt/2010.02.1/qt/mkspecs/features/qt_functions.prf \ + c:/Qt/2010.02.1/qt/mkspecs/features/qt_config.prf \ + c:/Qt/2010.02.1/qt/mkspecs/features/exclusive_builds.prf \ + c:/Qt/2010.02.1/qt/mkspecs/features/default_pre.prf \ + c:/Qt/2010.02.1/qt/mkspecs/features/win32/default_pre.prf \ + c:/Qt/2010.02.1/qt/mkspecs/features/release.prf \ + c:/Qt/2010.02.1/qt/mkspecs/features/debug_and_release.prf \ + c:/Qt/2010.02.1/qt/mkspecs/features/default_post.prf \ + c:/Qt/2010.02.1/qt/mkspecs/features/win32/default_post.prf \ + c:/Qt/2010.02.1/qt/mkspecs/features/win32/rtti.prf \ + c:/Qt/2010.02.1/qt/mkspecs/features/win32/exceptions.prf \ + c:/Qt/2010.02.1/qt/mkspecs/features/win32/stl.prf \ + c:/Qt/2010.02.1/qt/mkspecs/features/shared.prf \ + c:/Qt/2010.02.1/qt/mkspecs/features/warn_on.prf \ + c:/Qt/2010.02.1/qt/mkspecs/features/qt.prf \ + c:/Qt/2010.02.1/qt/mkspecs/features/win32/thread.prf \ + c:/Qt/2010.02.1/qt/mkspecs/features/moc.prf \ + c:/Qt/2010.02.1/qt/mkspecs/features/win32/windows.prf \ + c:/Qt/2010.02.1/qt/mkspecs/features/resources.prf \ + c:/Qt/2010.02.1/qt/mkspecs/features/uic.prf \ + c:/Qt/2010.02.1/qt/mkspecs/features/yacc.prf \ + c:/Qt/2010.02.1/qt/mkspecs/features/lex.prf \ + c:/Qt/2010.02.1/qt/mkspecs/features/include_source_dir.prf \ + c:/Qt/2010.02.1/qt/lib/qtmain.prl + $(QMAKE) -spec c:\Qt\2010.02.1\qt\mkspecs\win32-g++ -win32 CONFIG+=release -o Makefile golfscorecard.pro +c:\Qt\2010.02.1\qt\mkspecs\qconfig.pri: +c:\Qt\2010.02.1\qt\mkspecs\features\qt_functions.prf: +c:\Qt\2010.02.1\qt\mkspecs\features\qt_config.prf: +c:\Qt\2010.02.1\qt\mkspecs\features\exclusive_builds.prf: +c:\Qt\2010.02.1\qt\mkspecs\features\default_pre.prf: +c:\Qt\2010.02.1\qt\mkspecs\features\win32\default_pre.prf: +c:\Qt\2010.02.1\qt\mkspecs\features\release.prf: +c:\Qt\2010.02.1\qt\mkspecs\features\debug_and_release.prf: +c:\Qt\2010.02.1\qt\mkspecs\features\default_post.prf: +c:\Qt\2010.02.1\qt\mkspecs\features\win32\default_post.prf: +c:\Qt\2010.02.1\qt\mkspecs\features\win32\rtti.prf: +c:\Qt\2010.02.1\qt\mkspecs\features\win32\exceptions.prf: +c:\Qt\2010.02.1\qt\mkspecs\features\win32\stl.prf: +c:\Qt\2010.02.1\qt\mkspecs\features\shared.prf: +c:\Qt\2010.02.1\qt\mkspecs\features\warn_on.prf: +c:\Qt\2010.02.1\qt\mkspecs\features\qt.prf: +c:\Qt\2010.02.1\qt\mkspecs\features\win32\thread.prf: +c:\Qt\2010.02.1\qt\mkspecs\features\moc.prf: +c:\Qt\2010.02.1\qt\mkspecs\features\win32\windows.prf: +c:\Qt\2010.02.1\qt\mkspecs\features\resources.prf: +c:\Qt\2010.02.1\qt\mkspecs\features\uic.prf: +c:\Qt\2010.02.1\qt\mkspecs\features\yacc.prf: +c:\Qt\2010.02.1\qt\mkspecs\features\lex.prf: +c:\Qt\2010.02.1\qt\mkspecs\features\include_source_dir.prf: +c:\Qt\2010.02.1\qt\lib\qtmain.prl: +qmake: qmake_all FORCE + @$(QMAKE) -spec c:\Qt\2010.02.1\qt\mkspecs\win32-g++ -win32 CONFIG+=release -o Makefile golfscorecard.pro + +qmake_all: FORCE + +make_default: release-make_default debug-make_default FORCE +make_first: release-make_first debug-make_first FORCE +all: release-all debug-all FORCE +clean: release-clean debug-clean FORCE +distclean: release-distclean debug-distclean FORCE + -$(DEL_FILE) Makefile + +release-mocclean: $(MAKEFILE).Release + $(MAKE) -f $(MAKEFILE).Release mocclean +debug-mocclean: $(MAKEFILE).Debug + $(MAKE) -f $(MAKEFILE).Debug mocclean +mocclean: release-mocclean debug-mocclean + +release-mocables: $(MAKEFILE).Release + $(MAKE) -f $(MAKEFILE).Release mocables +debug-mocables: $(MAKEFILE).Debug + $(MAKE) -f $(MAKEFILE).Debug mocables +mocables: release-mocables debug-mocables +FORCE: + +$(MAKEFILE).Release: Makefile +$(MAKEFILE).Debug: Makefile diff --git a/src/Makefile.Debug b/src/Makefile.Debug new file mode 100644 index 0000000..29b4ca5 --- /dev/null +++ b/src/Makefile.Debug @@ -0,0 +1,295 @@ +############################################################################# +# Makefile for building: golfscorecard +# Generated by qmake (2.01a) (Qt 4.6.2) on: pe 30. huhti 00:48:59 2010 +# Project: golfscorecard.pro +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +DEFINES = -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN +CFLAGS = -g -Wall $(DEFINES) +CXXFLAGS = -g -frtti -fexceptions -mthreads -Wall $(DEFINES) +INCPATH = -I"c:\Qt\2010.02.1\qt\include\QtCore" -I"c:\Qt\2010.02.1\qt\include\QtGui" -I"c:\Qt\2010.02.1\qt\include\QtXml" -I"c:\Qt\2010.02.1\qt\include" -I"c:\Qt\2010.02.1\qt\include\ActiveQt" -I"debug" -I"." -I"c:\Qt\2010.02.1\qt\mkspecs\win32-g++" +LINK = g++ +LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows +LIBS = -L"c:\Qt\2010.02.1\qt\lib" -lmingw32 -lqtmaind -lQtXmld4 -lQtGuid4 -lQtCored4 +QMAKE = c:\qt\2010.02.1\qt\bin\qmake.exe +IDC = c:\Qt\2010.02.1\qt\bin\idc.exe +IDL = midl +ZIP = zip -r -9 +DEF_FILE = +RES_FILE = +COPY = copy /y +COPY_FILE = $(COPY) +COPY_DIR = xcopy /s /q /y /i +DEL_FILE = del +DEL_DIR = rmdir +MOVE = move +CHK_DIR_EXISTS= if not exist +MKDIR = mkdir +INSTALL_FILE = $(COPY_FILE) +INSTALL_PROGRAM = $(COPY_FILE) +INSTALL_DIR = $(COPY_DIR) + +####### Output directory + +OBJECTS_DIR = debug + +####### Files + +SOURCES = main.cpp \ + mainwindow.cpp \ + newround.cpp \ + xmlparser.cpp \ + datahandling.cpp \ + basicscorecard.cpp \ + pcmanagement.cpp \ + playermanagement.cpp debug\moc_mainwindow.cpp \ + debug\moc_newround.cpp \ + debug\moc_xmlparser.cpp \ + debug\moc_datahandling.cpp \ + debug\moc_basicscorecard.cpp \ + debug\moc_pcmanagement.cpp \ + debug\moc_playermanagement.cpp \ + debug\qrc_resources.cpp +OBJECTS = debug/main.o \ + debug/mainwindow.o \ + debug/newround.o \ + debug/xmlparser.o \ + debug/datahandling.o \ + debug/basicscorecard.o \ + debug/pcmanagement.o \ + debug/playermanagement.o \ + debug/moc_mainwindow.o \ + debug/moc_newround.o \ + debug/moc_xmlparser.o \ + debug/moc_datahandling.o \ + debug/moc_basicscorecard.o \ + debug/moc_pcmanagement.o \ + debug/moc_playermanagement.o \ + debug/qrc_resources.o +DIST = +QMAKE_TARGET = golfscorecard +DESTDIR = debug\ #avoid trailing-slash linebreak +TARGET = golfscorecard.exe +DESTDIR_TARGET = debug\golfscorecard.exe + +####### Implicit rules + +.SUFFIXES: .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: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + +first: all +all: Makefile.Debug $(DESTDIR_TARGET) + +$(DESTDIR_TARGET): ui_mainwindow.h ui_newround.h ui_basicscorecard.h ui_pcmanagement.h ui_playermanagement.h $(OBJECTS) + $(LINK) $(LFLAGS) -o $(DESTDIR_TARGET) object_script.golfscorecard.Debug $(LIBS) + + +qmake: FORCE + @$(QMAKE) -spec c:\Qt\2010.02.1\qt\mkspecs\win32-g++ -win32 CONFIG+=release -o Makefile.Debug golfscorecard.pro + +dist: + $(ZIP) golfscorecard.zip $(SOURCES) $(DIST) golfscorecard.pro c:\Qt\2010.02.1\qt\mkspecs\qconfig.pri c:\Qt\2010.02.1\qt\mkspecs\features\qt_functions.prf c:\Qt\2010.02.1\qt\mkspecs\features\qt_config.prf c:\Qt\2010.02.1\qt\mkspecs\features\exclusive_builds.prf c:\Qt\2010.02.1\qt\mkspecs\features\default_pre.prf c:\Qt\2010.02.1\qt\mkspecs\features\win32\default_pre.prf c:\Qt\2010.02.1\qt\mkspecs\features\debug.prf c:\Qt\2010.02.1\qt\mkspecs\features\debug_and_release.prf c:\Qt\2010.02.1\qt\mkspecs\features\default_post.prf c:\Qt\2010.02.1\qt\mkspecs\features\win32\default_post.prf c:\Qt\2010.02.1\qt\mkspecs\features\build_pass.prf c:\Qt\2010.02.1\qt\mkspecs\features\win32\rtti.prf c:\Qt\2010.02.1\qt\mkspecs\features\win32\exceptions.prf c:\Qt\2010.02.1\qt\mkspecs\features\win32\stl.prf c:\Qt\2010.02.1\qt\mkspecs\features\shared.prf c:\Qt\2010.02.1\qt\mkspecs\features\warn_on.prf c:\Qt\2010.02.1\qt\mkspecs\features\qt.prf c:\Qt\2010.02.1\qt\mkspecs\features\win32\thread.prf c:\Qt\2010.02.1\qt\mkspecs\features\moc.prf c:\Qt\2010.02.1\qt\mkspecs\features\win32\windows.prf c:\Qt\2010.02.1\qt\mkspecs\features\resources.prf c:\Qt\2010.02.1\qt\mkspecs\features\uic.prf c:\Qt\2010.02.1\qt\mkspecs\features\yacc.prf c:\Qt\2010.02.1\qt\mkspecs\features\lex.prf c:\Qt\2010.02.1\qt\mkspecs\features\include_source_dir.prf c:\Qt\2010.02.1\qt\lib\qtmaind.prl HEADERS RESOURCES IMAGES SOURCES OBJECTIVE_SOURCES FORMS YACCSOURCES YACCSOURCES LEXSOURCES + +clean: compiler_clean + -$(DEL_FILE) debug\main.o debug\mainwindow.o debug\newround.o debug\xmlparser.o debug\datahandling.o debug\basicscorecard.o debug\pcmanagement.o debug\playermanagement.o debug\moc_mainwindow.o debug\moc_newround.o debug\moc_xmlparser.o debug\moc_datahandling.o debug\moc_basicscorecard.o debug\moc_pcmanagement.o debug\moc_playermanagement.o debug\qrc_resources.o + +distclean: clean + -$(DEL_FILE) $(DESTDIR_TARGET) + -$(DEL_FILE) Makefile.Debug + +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: debug/moc_mainwindow.cpp debug/moc_newround.cpp debug/moc_xmlparser.cpp debug/moc_datahandling.cpp debug/moc_basicscorecard.cpp debug/moc_pcmanagement.cpp debug/moc_playermanagement.cpp +compiler_moc_header_clean: + -$(DEL_FILE) debug\moc_mainwindow.cpp debug\moc_newround.cpp debug\moc_xmlparser.cpp debug\moc_datahandling.cpp debug\moc_basicscorecard.cpp debug\moc_pcmanagement.cpp debug\moc_playermanagement.cpp +debug/moc_mainwindow.cpp: mainwindow.h + C:/Qt/2010.02.1/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 mainwindow.h -o debug\moc_mainwindow.cpp + +debug/moc_newround.cpp: datahandling.h \ + player.h \ + courses.h \ + newround.h + C:/Qt/2010.02.1/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 newround.h -o debug\moc_newround.cpp + +debug/moc_xmlparser.cpp: xmlparser.h + C:/Qt/2010.02.1/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 xmlparser.h -o debug\moc_xmlparser.cpp + +debug/moc_datahandling.cpp: player.h \ + courses.h \ + datahandling.h + C:/Qt/2010.02.1/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 datahandling.h -o debug\moc_datahandling.cpp + +debug/moc_basicscorecard.cpp: datahandling.h \ + player.h \ + courses.h \ + basicscorecard.h + C:/Qt/2010.02.1/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 basicscorecard.h -o debug\moc_basicscorecard.cpp + +debug/moc_pcmanagement.cpp: pcmanagement.h + C:/Qt/2010.02.1/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 pcmanagement.h -o debug\moc_pcmanagement.cpp + +debug/moc_playermanagement.cpp: playermanagement.h + C:/Qt/2010.02.1/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 playermanagement.h -o debug\moc_playermanagement.cpp + +compiler_rcc_make_all: debug/qrc_resources.cpp +compiler_rcc_clean: + -$(DEL_FILE) debug\qrc_resources.cpp +debug/qrc_resources.cpp: resources.qrc \ + images/new-player.png \ + images/golf-icon.png \ + images/arrow-left-icon.png \ + images/edit-player.png \ + images/edit-course.png \ + images/arrow-right-icon_2.png \ + images/arrow-up-icon.png \ + images/new-course.png \ + images/arrow-down-icon.png \ + images/stats-icon.png \ + images/golf-icon_2.png \ + images/arrow-right-icon.png \ + images/course-icon.png + c:\Qt\2010.02.1\qt\bin\rcc.exe -name resources resources.qrc -o debug\qrc_resources.cpp + +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: ui_mainwindow.h ui_newround.h ui_basicscorecard.h ui_pcmanagement.h ui_playermanagement.h +compiler_uic_clean: + -$(DEL_FILE) ui_mainwindow.h ui_newround.h ui_basicscorecard.h ui_pcmanagement.h ui_playermanagement.h +ui_mainwindow.h: mainwindow.ui + c:\Qt\2010.02.1\qt\bin\uic.exe mainwindow.ui -o ui_mainwindow.h + +ui_newround.h: newround.ui + c:\Qt\2010.02.1\qt\bin\uic.exe newround.ui -o ui_newround.h + +ui_basicscorecard.h: basicscorecard.ui + c:\Qt\2010.02.1\qt\bin\uic.exe basicscorecard.ui -o ui_basicscorecard.h + +ui_pcmanagement.h: pcmanagement.ui + c:\Qt\2010.02.1\qt\bin\uic.exe pcmanagement.ui -o ui_pcmanagement.h + +ui_playermanagement.h: playermanagement.ui + c:\Qt\2010.02.1\qt\bin\uic.exe playermanagement.ui -o ui_playermanagement.h + +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 compiler_rcc_clean compiler_uic_clean + + + +####### Compile + +debug/main.o: main.cpp mainwindow.h \ + datahandling.h \ + player.h \ + courses.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\main.o main.cpp + +debug/mainwindow.o: mainwindow.cpp mainwindow.h \ + ui_mainwindow.h \ + newround.h \ + datahandling.h \ + player.h \ + courses.h \ + pcmanagement.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\mainwindow.o mainwindow.cpp + +debug/newround.o: newround.cpp newround.h \ + datahandling.h \ + player.h \ + courses.h \ + ui_newround.h \ + xmlparser.h \ + basicscorecard.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\newround.o newround.cpp + +debug/xmlparser.o: xmlparser.cpp xmlparser.h \ + datahandling.h \ + player.h \ + courses.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\xmlparser.o xmlparser.cpp + +debug/datahandling.o: datahandling.cpp datahandling.h \ + player.h \ + courses.h \ + newround.h \ + xmlparser.h \ + basicscorecard.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\datahandling.o datahandling.cpp + +debug/basicscorecard.o: basicscorecard.cpp basicscorecard.h \ + datahandling.h \ + player.h \ + courses.h \ + ui_basicscorecard.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\basicscorecard.o basicscorecard.cpp + +debug/pcmanagement.o: pcmanagement.cpp pcmanagement.h \ + ui_pcmanagement.h \ + mainwindow.h \ + playermanagement.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\pcmanagement.o pcmanagement.cpp + +debug/playermanagement.o: playermanagement.cpp playermanagement.h \ + ui_playermanagement.h \ + pcmanagement.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\playermanagement.o playermanagement.cpp + +debug/moc_mainwindow.o: debug/moc_mainwindow.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\moc_mainwindow.o debug\moc_mainwindow.cpp + +debug/moc_newround.o: debug/moc_newround.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\moc_newround.o debug\moc_newround.cpp + +debug/moc_xmlparser.o: debug/moc_xmlparser.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\moc_xmlparser.o debug\moc_xmlparser.cpp + +debug/moc_datahandling.o: debug/moc_datahandling.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\moc_datahandling.o debug\moc_datahandling.cpp + +debug/moc_basicscorecard.o: debug/moc_basicscorecard.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\moc_basicscorecard.o debug\moc_basicscorecard.cpp + +debug/moc_pcmanagement.o: debug/moc_pcmanagement.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\moc_pcmanagement.o debug\moc_pcmanagement.cpp + +debug/moc_playermanagement.o: debug/moc_playermanagement.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\moc_playermanagement.o debug\moc_playermanagement.cpp + +debug/qrc_resources.o: debug/qrc_resources.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\qrc_resources.o debug\qrc_resources.cpp + +####### Install + +install: FORCE + +uninstall: FORCE + +FORCE: + diff --git a/src/Makefile.Release b/src/Makefile.Release new file mode 100644 index 0000000..11ce188 --- /dev/null +++ b/src/Makefile.Release @@ -0,0 +1,295 @@ +############################################################################# +# Makefile for building: golfscorecard +# Generated by qmake (2.01a) (Qt 4.6.2) on: pe 30. huhti 00:48:57 2010 +# Project: golfscorecard.pro +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +DEFINES = -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN +CFLAGS = -O2 -Wall $(DEFINES) +CXXFLAGS = -O2 -frtti -fexceptions -mthreads -Wall $(DEFINES) +INCPATH = -I"c:\Qt\2010.02.1\qt\include\QtCore" -I"c:\Qt\2010.02.1\qt\include\QtGui" -I"c:\Qt\2010.02.1\qt\include\QtXml" -I"c:\Qt\2010.02.1\qt\include" -I"c:\Qt\2010.02.1\qt\include\ActiveQt" -I"release" -I"." -I"c:\Qt\2010.02.1\qt\mkspecs\win32-g++" +LINK = g++ +LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows +LIBS = -L"c:\Qt\2010.02.1\qt\lib" -lmingw32 -lqtmain -lQtXml4 -lQtGui4 -lQtCore4 +QMAKE = c:\qt\2010.02.1\qt\bin\qmake.exe +IDC = c:\Qt\2010.02.1\qt\bin\idc.exe +IDL = midl +ZIP = zip -r -9 +DEF_FILE = +RES_FILE = +COPY = copy /y +COPY_FILE = $(COPY) +COPY_DIR = xcopy /s /q /y /i +DEL_FILE = del +DEL_DIR = rmdir +MOVE = move +CHK_DIR_EXISTS= if not exist +MKDIR = mkdir +INSTALL_FILE = $(COPY_FILE) +INSTALL_PROGRAM = $(COPY_FILE) +INSTALL_DIR = $(COPY_DIR) + +####### Output directory + +OBJECTS_DIR = release + +####### Files + +SOURCES = main.cpp \ + mainwindow.cpp \ + newround.cpp \ + xmlparser.cpp \ + datahandling.cpp \ + basicscorecard.cpp \ + pcmanagement.cpp \ + playermanagement.cpp release\moc_mainwindow.cpp \ + release\moc_newround.cpp \ + release\moc_xmlparser.cpp \ + release\moc_datahandling.cpp \ + release\moc_basicscorecard.cpp \ + release\moc_pcmanagement.cpp \ + release\moc_playermanagement.cpp \ + release\qrc_resources.cpp +OBJECTS = release/main.o \ + release/mainwindow.o \ + release/newround.o \ + release/xmlparser.o \ + release/datahandling.o \ + release/basicscorecard.o \ + release/pcmanagement.o \ + release/playermanagement.o \ + release/moc_mainwindow.o \ + release/moc_newround.o \ + release/moc_xmlparser.o \ + release/moc_datahandling.o \ + release/moc_basicscorecard.o \ + release/moc_pcmanagement.o \ + release/moc_playermanagement.o \ + release/qrc_resources.o +DIST = +QMAKE_TARGET = golfscorecard +DESTDIR = release\ #avoid trailing-slash linebreak +TARGET = golfscorecard.exe +DESTDIR_TARGET = release\golfscorecard.exe + +####### Implicit rules + +.SUFFIXES: .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: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + +first: all +all: Makefile.Release $(DESTDIR_TARGET) + +$(DESTDIR_TARGET): ui_mainwindow.h ui_newround.h ui_basicscorecard.h ui_pcmanagement.h ui_playermanagement.h $(OBJECTS) + $(LINK) $(LFLAGS) -o $(DESTDIR_TARGET) object_script.golfscorecard.Release $(LIBS) + + +qmake: FORCE + @$(QMAKE) -spec c:\Qt\2010.02.1\qt\mkspecs\win32-g++ -win32 CONFIG+=release -o Makefile.Release golfscorecard.pro + +dist: + $(ZIP) golfscorecard.zip $(SOURCES) $(DIST) golfscorecard.pro c:\Qt\2010.02.1\qt\mkspecs\qconfig.pri c:\Qt\2010.02.1\qt\mkspecs\features\qt_functions.prf c:\Qt\2010.02.1\qt\mkspecs\features\qt_config.prf c:\Qt\2010.02.1\qt\mkspecs\features\exclusive_builds.prf c:\Qt\2010.02.1\qt\mkspecs\features\default_pre.prf c:\Qt\2010.02.1\qt\mkspecs\features\win32\default_pre.prf c:\Qt\2010.02.1\qt\mkspecs\features\release.prf c:\Qt\2010.02.1\qt\mkspecs\features\debug_and_release.prf c:\Qt\2010.02.1\qt\mkspecs\features\default_post.prf c:\Qt\2010.02.1\qt\mkspecs\features\win32\default_post.prf c:\Qt\2010.02.1\qt\mkspecs\features\build_pass.prf c:\Qt\2010.02.1\qt\mkspecs\features\win32\rtti.prf c:\Qt\2010.02.1\qt\mkspecs\features\win32\exceptions.prf c:\Qt\2010.02.1\qt\mkspecs\features\win32\stl.prf c:\Qt\2010.02.1\qt\mkspecs\features\shared.prf c:\Qt\2010.02.1\qt\mkspecs\features\warn_on.prf c:\Qt\2010.02.1\qt\mkspecs\features\qt.prf c:\Qt\2010.02.1\qt\mkspecs\features\win32\thread.prf c:\Qt\2010.02.1\qt\mkspecs\features\moc.prf c:\Qt\2010.02.1\qt\mkspecs\features\win32\windows.prf c:\Qt\2010.02.1\qt\mkspecs\features\resources.prf c:\Qt\2010.02.1\qt\mkspecs\features\uic.prf c:\Qt\2010.02.1\qt\mkspecs\features\yacc.prf c:\Qt\2010.02.1\qt\mkspecs\features\lex.prf c:\Qt\2010.02.1\qt\mkspecs\features\include_source_dir.prf c:\Qt\2010.02.1\qt\lib\qtmain.prl HEADERS RESOURCES IMAGES SOURCES OBJECTIVE_SOURCES FORMS YACCSOURCES YACCSOURCES LEXSOURCES + +clean: compiler_clean + -$(DEL_FILE) release\main.o release\mainwindow.o release\newround.o release\xmlparser.o release\datahandling.o release\basicscorecard.o release\pcmanagement.o release\playermanagement.o release\moc_mainwindow.o release\moc_newround.o release\moc_xmlparser.o release\moc_datahandling.o release\moc_basicscorecard.o release\moc_pcmanagement.o release\moc_playermanagement.o release\qrc_resources.o + +distclean: clean + -$(DEL_FILE) $(DESTDIR_TARGET) + -$(DEL_FILE) Makefile.Release + +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: release/moc_mainwindow.cpp release/moc_newround.cpp release/moc_xmlparser.cpp release/moc_datahandling.cpp release/moc_basicscorecard.cpp release/moc_pcmanagement.cpp release/moc_playermanagement.cpp +compiler_moc_header_clean: + -$(DEL_FILE) release\moc_mainwindow.cpp release\moc_newround.cpp release\moc_xmlparser.cpp release\moc_datahandling.cpp release\moc_basicscorecard.cpp release\moc_pcmanagement.cpp release\moc_playermanagement.cpp +release/moc_mainwindow.cpp: mainwindow.h + C:/Qt/2010.02.1/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 mainwindow.h -o release\moc_mainwindow.cpp + +release/moc_newround.cpp: datahandling.h \ + player.h \ + courses.h \ + newround.h + C:/Qt/2010.02.1/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 newround.h -o release\moc_newround.cpp + +release/moc_xmlparser.cpp: xmlparser.h + C:/Qt/2010.02.1/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 xmlparser.h -o release\moc_xmlparser.cpp + +release/moc_datahandling.cpp: player.h \ + courses.h \ + datahandling.h + C:/Qt/2010.02.1/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 datahandling.h -o release\moc_datahandling.cpp + +release/moc_basicscorecard.cpp: datahandling.h \ + player.h \ + courses.h \ + basicscorecard.h + C:/Qt/2010.02.1/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 basicscorecard.h -o release\moc_basicscorecard.cpp + +release/moc_pcmanagement.cpp: pcmanagement.h + C:/Qt/2010.02.1/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 pcmanagement.h -o release\moc_pcmanagement.cpp + +release/moc_playermanagement.cpp: playermanagement.h + C:/Qt/2010.02.1/qt/bin\moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 playermanagement.h -o release\moc_playermanagement.cpp + +compiler_rcc_make_all: release/qrc_resources.cpp +compiler_rcc_clean: + -$(DEL_FILE) release\qrc_resources.cpp +release/qrc_resources.cpp: resources.qrc \ + images/new-player.png \ + images/golf-icon.png \ + images/arrow-left-icon.png \ + images/edit-player.png \ + images/edit-course.png \ + images/arrow-right-icon_2.png \ + images/arrow-up-icon.png \ + images/new-course.png \ + images/arrow-down-icon.png \ + images/stats-icon.png \ + images/golf-icon_2.png \ + images/arrow-right-icon.png \ + images/course-icon.png + c:\Qt\2010.02.1\qt\bin\rcc.exe -name resources resources.qrc -o release\qrc_resources.cpp + +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: ui_mainwindow.h ui_newround.h ui_basicscorecard.h ui_pcmanagement.h ui_playermanagement.h +compiler_uic_clean: + -$(DEL_FILE) ui_mainwindow.h ui_newround.h ui_basicscorecard.h ui_pcmanagement.h ui_playermanagement.h +ui_mainwindow.h: mainwindow.ui + c:\Qt\2010.02.1\qt\bin\uic.exe mainwindow.ui -o ui_mainwindow.h + +ui_newround.h: newround.ui + c:\Qt\2010.02.1\qt\bin\uic.exe newround.ui -o ui_newround.h + +ui_basicscorecard.h: basicscorecard.ui + c:\Qt\2010.02.1\qt\bin\uic.exe basicscorecard.ui -o ui_basicscorecard.h + +ui_pcmanagement.h: pcmanagement.ui + c:\Qt\2010.02.1\qt\bin\uic.exe pcmanagement.ui -o ui_pcmanagement.h + +ui_playermanagement.h: playermanagement.ui + c:\Qt\2010.02.1\qt\bin\uic.exe playermanagement.ui -o ui_playermanagement.h + +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 compiler_rcc_clean compiler_uic_clean + + + +####### Compile + +release/main.o: main.cpp mainwindow.h \ + datahandling.h \ + player.h \ + courses.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\main.o main.cpp + +release/mainwindow.o: mainwindow.cpp mainwindow.h \ + ui_mainwindow.h \ + newround.h \ + datahandling.h \ + player.h \ + courses.h \ + pcmanagement.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\mainwindow.o mainwindow.cpp + +release/newround.o: newround.cpp newround.h \ + datahandling.h \ + player.h \ + courses.h \ + ui_newround.h \ + xmlparser.h \ + basicscorecard.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\newround.o newround.cpp + +release/xmlparser.o: xmlparser.cpp xmlparser.h \ + datahandling.h \ + player.h \ + courses.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\xmlparser.o xmlparser.cpp + +release/datahandling.o: datahandling.cpp datahandling.h \ + player.h \ + courses.h \ + newround.h \ + xmlparser.h \ + basicscorecard.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\datahandling.o datahandling.cpp + +release/basicscorecard.o: basicscorecard.cpp basicscorecard.h \ + datahandling.h \ + player.h \ + courses.h \ + ui_basicscorecard.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\basicscorecard.o basicscorecard.cpp + +release/pcmanagement.o: pcmanagement.cpp pcmanagement.h \ + ui_pcmanagement.h \ + mainwindow.h \ + playermanagement.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\pcmanagement.o pcmanagement.cpp + +release/playermanagement.o: playermanagement.cpp playermanagement.h \ + ui_playermanagement.h \ + pcmanagement.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\playermanagement.o playermanagement.cpp + +release/moc_mainwindow.o: release/moc_mainwindow.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\moc_mainwindow.o release\moc_mainwindow.cpp + +release/moc_newround.o: release/moc_newround.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\moc_newround.o release\moc_newround.cpp + +release/moc_xmlparser.o: release/moc_xmlparser.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\moc_xmlparser.o release\moc_xmlparser.cpp + +release/moc_datahandling.o: release/moc_datahandling.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\moc_datahandling.o release\moc_datahandling.cpp + +release/moc_basicscorecard.o: release/moc_basicscorecard.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\moc_basicscorecard.o release\moc_basicscorecard.cpp + +release/moc_pcmanagement.o: release/moc_pcmanagement.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\moc_pcmanagement.o release\moc_pcmanagement.cpp + +release/moc_playermanagement.o: release/moc_playermanagement.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\moc_playermanagement.o release\moc_playermanagement.cpp + +release/qrc_resources.o: release/qrc_resources.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\qrc_resources.o release\qrc_resources.cpp + +####### Install + +install: FORCE + +uninstall: FORCE + +FORCE: + diff --git a/src/basicscorecard.cpp b/src/basicscorecard.cpp new file mode 100644 index 0000000..4fd9090 --- /dev/null +++ b/src/basicscorecard.cpp @@ -0,0 +1,538 @@ +#include "basicscorecard.h" +#include "ui_basicscorecard.h" +#include "datahandling.h" +#include "courses.h" +#include + +BasicScorecard::BasicScorecard(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::BasicScorecard) +{ + ui->setupUi(this); + currentCourse = 1; + loadPlayers(); + loadCourses(); + hideNotNeededFields(); + drawPlayers(); + displayCourseData(); + calculateHcpsPerCourse(); +} + +void BasicScorecard::loadPlayers() +{ + datahandling *CAPData = datahandling::instance(); + + players << CAPData->selectedPlayers; + qDebug() << players; + + for(int i = 0; i < players.count(); i++) + { + for(int j = 0; j < 19; j++) + { + scores[i][j] = 0; + hcpPerCourse[i][j] = 0; + } + } + + for(int i = 0; i < players.count(); i++) + { + hcp[i] = CAPData->selectedPlayersHandicap[i].toInt(); + qDebug() << hcp[i]; + } + + for(int y = 0; y < 19; y++) + { + hcpOrder[y] = 0; + } + + + +} + +void BasicScorecard::drawPlayers() +{ + if(players.count() >= 1 ) + { + ui->label_leaderboardPlayer1->setText(players[0]); + ui->label_player1->setText(players[0]); + } + if(players.count() >= 2) + { + ui->label_leaderboardPlayer2->setText(players[1]); + ui->label_player2->setText(players[1]); + } + if(players.count() >= 3) + { + ui->label_leaderboardPlayer3->setText(players[2]); + ui->label_player3->setText(players[2]); + } + if(players.count() >= 4) + { + ui->label_leaderboardPlayer4->setText(players[3]); + ui->label_player4->setText(players[3]); + } +} + +void BasicScorecard::saveShots() +{ + if(players.count() >= 1 ) + scores[0][currentCourse] = ui->label_player1_score->text().toInt(); + if(players.count() >= 2 ) + scores[1][currentCourse] = ui->label_player2_score->text().toInt(); + if(players.count() >= 3 ) + scores[2][currentCourse] = ui->label_player3_score->text().toInt(); + if(players.count() >= 4 ) + scores[3][currentCourse] = ui->label_player4_score->text().toInt(); +} + +void BasicScorecard::loadShots() +{ + if(players.count() >= 1 ) + ui->label_player1_score->setText(QString::number(scores[0][currentCourse])); + if(players.count() >= 2 ) + ui->label_player2_score->setText(QString::number(scores[1][currentCourse])); + if(players.count() >= 3 ) + ui->label_player3_score->setText(QString::number(scores[2][currentCourse])); + if(players.count() >= 4 ) + ui->label_player4_score->setText(QString::number(scores[3][currentCourse])); +} + +void BasicScorecard::loadCourses() +{ + datahandling *CAPData = datahandling::instance(); + + const QList& holeData_2 = CAPData->getHoleData(); + const QList& whiteTee_2 = CAPData->getWhiteTee(); + const QList& yellowTee_2 = CAPData->getYellowTee(); + const QList& blueTee_2 = CAPData->getBlueTee(); + const QList& redTee_2 = CAPData->getRedTee(); + + courseDataName << ""; + courseDataPar << ""; + courseDataHcp << ""; + courseDataWhite << ""; + courseDataYellow << ""; + courseDataRed << ""; + courseDataBlue << ""; + + foreach(holeData hD, holeData_2) + { + courseDataName.push_back(hD.m_id); + courseDataPar.push_back(hD.m_par); + courseDataHcp.push_back(hD.m_hcp); + } + + foreach(whiteTee wT, whiteTee_2) + { + courseDataWhite.push_back(wT.m_length); + } + + foreach(yellowTee yT, yellowTee_2) + { + courseDataYellow.push_back(yT.m_length); + } + + foreach(blueTee bT, blueTee_2) + { + courseDataBlue.push_back(bT.m_length); + } + + foreach(redTee rT, redTee_2) + { + courseDataRed.push_back(rT.m_length); + } +} + +void BasicScorecard::displayCourseData() +{ + ui->label_course->setText(courseDataName[currentCourse]); + ui->label_par->setText(courseDataPar[currentCourse]); + ui->label_hcp->setText(courseDataHcp[currentCourse]); + ui->label_white->setText(courseDataWhite[currentCourse]); + ui->label_yellow->setText(courseDataYellow[currentCourse]); + ui->label_red->setText(courseDataRed[currentCourse]); + ui->label_blue->setText(courseDataBlue[currentCourse]); + + for(int i = 0; i < players.count(); i++) + { + qDebug() << hcpPerCourse[i][currentCourse]; + } + qDebug() << "----------"; + +} + +void BasicScorecard::updateLeaderboard() +{ + int sp[4]; + int hcpsp[4]; + int order[4]; + int flag[4]; + int flag2[4]; + int set = 0; + + for(int i = 0; i < 4; i++) + { + sp[i] = 0; + hcpsp[i] = 0; + order[i] = 0; + flag[i] = 0; + flag2[i] = 0; + } + + for(int i = 0; i < players.count(); i++) + { + for(int j = 1; j < 19; j++) + { + if(scores[i][j] != 0) + { + sp[i] = sp[i] + (scores[i][j] - courseDataPar[j].toInt()); + hcpsp[i] = hcpsp[i] + (scores[i][j] - hcpPerCourse[i][j] - courseDataPar[j].toInt()); + } + } + } + + QList list; + for(int i = 0; i < players.count(); i++) + { + list.append(sp[i]); + } + + qSort(list); + + for(int i = 0; i < players.count(); i++) + { + order[i] = (int)list.takeFirst(); + } + + for(int i = 0; i < players.count(); i++) + { + for(int j = 0; j < players.count(); j++) + { + if((order[i] == sp[j])) + { + if(flag[0] != 1 && set == 0 && flag2[j] == 0) + { + flag[0] = 1; + set = 1; + + if(j == 0) + flag2[0] = 1; + else if(j == 1 && players.count() >= 2) + flag2[1] = 1; + else if(j == 2 && players.count() >= 3) + flag2[2] = 1; + else if(j == 3 && players.count() >= 4) + flag2[3] = 1; + + + ui->label_leaderboardPlayer1->setText(players[j]); + + if(sp[j] > 0) + ui->label_leaderboardPlayer1_2->setText("+"+QString::number(sp[j])); + else if (sp[j] == 0) + ui->label_leaderboardPlayer1_2->setText("PAR"); + else + ui->label_leaderboardPlayer1_2->setText(QString::number(sp[j])); + + if(hcpsp[j] > 0) + ui->label_leaderboardPlayer1_3->setText("+"+QString::number(hcpsp[j])); + else if (hcpsp[j] == 0) + ui->label_leaderboardPlayer1_3->setText("PAR"); + else + ui->label_leaderboardPlayer1_3->setText(QString::number(hcpsp[j])); + } + else if(flag[1] != 1 && set == 0 && flag2[j] == 0 && players.count() >= 2) + { + flag[1] = 1; + set = 1; + + if(j == 0) + flag2[0] = 1; + else if(j == 1 && players.count() >= 2) + flag2[1] = 1; + else if(j == 2 && players.count() >= 3) + flag2[2] = 1; + else if(j == 3 && players.count() >= 4) + flag2[3] = 1; + + ui->label_leaderboardPlayer2->setText(players[j]); + + if(sp[j] > 0) + ui->label_leaderboardPlayer2_2->setText("+"+QString::number(sp[j])); + else if (sp[j] == 0) + ui->label_leaderboardPlayer2_2->setText("PAR"); + else + ui->label_leaderboardPlayer2_2->setText(QString::number(sp[j])); + + if(hcpsp[j] > 0) + ui->label_leaderboardPlayer2_3->setText("+"+QString::number(hcpsp[j])); + else if (hcpsp[j] == 0) + ui->label_leaderboardPlayer2_3->setText("PAR"); + else + ui->label_leaderboardPlayer2_3->setText(QString::number(hcpsp[j])); + } + else if(flag[2] != 1 && set == 0 && flag2[j] == 0 && players.count() >= 3) + { + flag[2] = 1; + set = 1; + + if(j == 0) + flag2[0] = 1; + else if(j == 1 && players.count() >= 2) + flag2[1] = 1; + else if(j == 2 && players.count() >= 3) + flag2[2] = 1; + else if(j == 3 && players.count() >= 4) + flag2[3] = 1; + + ui->label_leaderboardPlayer3->setText(players[j]); + + if(sp[j] > 0) + ui->label_leaderboardPlayer3_2->setText("+"+QString::number(sp[j])); + else if (sp[j] == 0) + ui->label_leaderboardPlayer3_2->setText("PAR"); + else + ui->label_leaderboardPlayer3_2->setText(QString::number(sp[j])); + + if(hcpsp[j] > 0) + ui->label_leaderboardPlayer3_3->setText("+"+QString::number(hcpsp[j])); + else if (hcpsp[j] == 0) + ui->label_leaderboardPlayer3_3->setText("PAR"); + else + ui->label_leaderboardPlayer3_3->setText(QString::number(hcpsp[j])); + } + else if(flag[3] != 1 && set == 0 && flag2[j] == 0 && players.count() >= 4) + { + flag[3] = 1; + set = 1; + + if(j == 0) + flag2[0] = 1; + else if(j == 1 && players.count() >= 2) + flag2[1] = 1; + else if(j == 2 && players.count() >= 3) + flag2[2] = 1; + else if(j == 3 && players.count() >= 4) + flag2[3] = 1; + + ui->label_leaderboardPlayer4->setText(players[j]); + + if(sp[j] > 0) + ui->label_leaderboardPlayer4_2->setText("+"+QString::number(sp[j])); + else if (sp[j] == 0) + ui->label_leaderboardPlayer4_2->setText("PAR"); + else + ui->label_leaderboardPlayer4_2->setText(QString::number(sp[j])); + + if(hcpsp[j] > 0) + ui->label_leaderboardPlayer4_3->setText("+"+QString::number(hcpsp[j])); + else if (hcpsp[j] == 0) + ui->label_leaderboardPlayer4_3->setText("PAR"); + else + ui->label_leaderboardPlayer4_3->setText(QString::number(hcpsp[j])); + } + set = 0; + } + } + } +} + +void BasicScorecard::calculateHcpsPerCourse() +{ + int temp = 1; + bool found = false; + + for(int i = 1; i < 19; i++) + { + for(int j = 1; j < 19; j++) + { + if(courseDataHcp[j].toInt() == temp && found == false) + { + hcpOrder[i] = j; + temp++; + found = true; + } + + } + found = false; + } + int k=1; + int temp2; + for(int j = 0; j < players.count(); j++) + { + for(int i = 0; i < hcp[j]; i++) + { + if(k == 19) + k = 1; + temp2 = hcpOrder[k]; + hcpPerCourse[j][temp2]++; + k++; + } + k=1; + } +} + +void BasicScorecard::on_player1_up_clicked() +{ + int temp; + temp = ui->label_player1_score->text().toInt(); + if(temp < 99) + temp++; + ui->label_player1_score->setText(QString::number(temp)); +} + +void BasicScorecard::on_player1_down_clicked() +{ + int temp; + temp = ui->label_player1_score->text().toInt(); + if(temp > 0) + temp--; + ui->label_player1_score->setText(QString::number(temp)); +} + +void BasicScorecard::on_player2_up_clicked() +{ + int temp; + temp = ui->label_player2_score->text().toInt(); + if(temp < 99) + temp++; + ui->label_player2_score->setText(QString::number(temp)); +} + +void BasicScorecard::on_player2_down_clicked() +{ + int temp; + temp = ui->label_player2_score->text().toInt(); + if(temp > 0) + temp--; + ui->label_player2_score->setText(QString::number(temp)); +} + +void BasicScorecard::on_player3_up_clicked() +{ + int temp; + temp = ui->label_player3_score->text().toInt(); + if(temp < 99) + temp++; + ui->label_player3_score->setText(QString::number(temp)); +} + +void BasicScorecard::on_player3_down_clicked() +{ + int temp; + temp = ui->label_player3_score->text().toInt(); + if(temp > 0) + temp--; + ui->label_player3_score->setText(QString::number(temp)); +} + +void BasicScorecard::on_player4_up_clicked() +{ + int temp; + temp = ui->label_player4_score->text().toInt(); + if(temp < 99) + temp++; + ui->label_player4_score->setText(QString::number(temp)); +} + +void BasicScorecard::on_player4_down_clicked() +{ + int temp; + temp = ui->label_player4_score->text().toInt(); + if(temp > 0) + temp--; + ui->label_player4_score->setText(QString::number(temp)); +} + +void BasicScorecard::on_pushButton_nextCourse_clicked() +{ + saveShots(); + + if(currentCourse < 18) + currentCourse++; + else + currentCourse = 1; + + loadShots(); + displayCourseData(); + updateLeaderboard(); + +} + + +void BasicScorecard::on_pushButton_prevCourse_clicked() +{ + saveShots(); + + if(currentCourse > 1) + currentCourse--; + else + currentCourse = 18; + + loadShots(); + displayCourseData(); + updateLeaderboard(); +} + +void BasicScorecard::on_courseMap_clicked() +{ + +} + +void BasicScorecard::hideNotNeededFields() +{ + if(players.count() == 1) + { + ui->label_player2->setText(""); + ui->label_player2_score->setText("");; + ui->player2_down->setHidden(true); + ui->player2_up->setHidden(true); + ui->label_leaderboardPlayer2->setHidden(true); + ui->label_leaderboardPlayer2_2->setHidden(true); + ui->label_leaderboardPlayer2_3->setHidden(true); + + ui->label_player3->setText(""); + ui->label_player3_score->setText("");; + ui->player3_down->setHidden(true); + ui->player3_up->setHidden(true); + ui->label_leaderboardPlayer3->setHidden(true); + ui->label_leaderboardPlayer3_2->setHidden(true); + ui->label_leaderboardPlayer3_3->setHidden(true); + + ui->label_player4->setText(""); + ui->label_player4_score->setText("");; + ui->player4_down->setHidden(true); + ui->player4_up->setHidden(true); + ui->label_leaderboardPlayer4->setHidden(true); + ui->label_leaderboardPlayer4_2->setHidden(true); + ui->label_leaderboardPlayer4_3->setHidden(true); + } + else if(players.count() == 2) + { + ui->label_player3->setText(""); + ui->label_player3_score->setText("");; + ui->player3_down->setHidden(true); + ui->player3_up->setHidden(true); + ui->label_leaderboardPlayer3->setHidden(true); + ui->label_leaderboardPlayer3_2->setHidden(true); + ui->label_leaderboardPlayer3_3->setHidden(true); + + ui->label_player4->setText(""); + ui->label_player4_score->setText("");; + ui->player4_down->setHidden(true); + ui->player4_up->setHidden(true); + ui->label_leaderboardPlayer4->setHidden(true); + ui->label_leaderboardPlayer4_2->setHidden(true); + ui->label_leaderboardPlayer4_3->setHidden(true); + } + else if(players.count() == 3) + { + ui->label_player4->setText(""); + ui->label_player4_score->setText("");; + ui->player4_down->setHidden(true); + ui->player4_up->setHidden(true); + ui->label_leaderboardPlayer4->setHidden(true); + ui->label_leaderboardPlayer4_2->setHidden(true); + ui->label_leaderboardPlayer4_3->setHidden(true); + } +} diff --git a/src/basicscorecard.h b/src/basicscorecard.h new file mode 100644 index 0000000..6f2ae47 --- /dev/null +++ b/src/basicscorecard.h @@ -0,0 +1,58 @@ +#ifndef BASICSCORECARD_H +#define BASICSCORECARD_H + +#include +#include "datahandling.h" + +namespace Ui { + class BasicScorecard; +} + +class BasicScorecard : public QMainWindow { + Q_OBJECT +public: + BasicScorecard(QWidget *parent = 0); + +private: + Ui::BasicScorecard *ui; + + void loadPlayers(); + void drawPlayers(); + void saveShots(); + void loadShots(); + void loadCourses(); + void displayCourseData(); + void updateLeaderboard(); + void calculateHcpsPerCourse(); + void hideNotNeededFields(); + + QStringList players; + int scores[4][19]; + int hcp[4]; + int hcpPerCourse[4][19]; + int currentCourse; + int hcpOrder[19]; + + QStringList courseDataName; + QStringList courseDataPar; + QStringList courseDataHcp; + QStringList courseDataWhite; + QStringList courseDataYellow; + QStringList courseDataRed; + QStringList courseDataBlue; + +private slots: + void on_courseMap_clicked(); + void on_pushButton_prevCourse_clicked(); + void on_pushButton_nextCourse_clicked(); + void on_player4_down_clicked(); + void on_player4_up_clicked(); + void on_player3_down_clicked(); + void on_player3_up_clicked(); + void on_player2_down_clicked(); + void on_player2_up_clicked(); + void on_player1_down_clicked(); + void on_player1_up_clicked(); +}; + +#endif // BASICSCORECARD_H diff --git a/src/basicscorecard.ui b/src/basicscorecard.ui new file mode 100644 index 0000000..b02fc43 --- /dev/null +++ b/src/basicscorecard.ui @@ -0,0 +1,1427 @@ + + + BasicScorecard + + + + 0 + 0 + 800 + 480 + + + + BasicScorecard + + + + + + 0 + 0 + 320 + 175 + + + + QFrame#frame_leaderboard +{ + border: 2px solid; + border-color: rgb(255, 255, 0); + + background-color: rgb(0, 0, 0); +} + + + QFrame::StyledPanel + + + QFrame::Raised + + + 1 + + + 0 + + + + + 9 + 0 + 181 + 30 + + + + + 11 + 75 + true + true + + + + QLabel#label_leaderboardHeader +{ + color: white; +} + + + LEADERBOARD + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + 9 + 30 + 181 + 30 + + + + + 11 + false + + + + QLabel#label_leaderboardPlayer1 +{ + color: white; +} + + + PLAYER 1 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + + + + 9 + 60 + 181 + 30 + + + + + 11 + false + + + + QLabel#label_leaderboardPlayer2 +{ + color: white; +} + + + PLAYER 2 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + + + + 10 + 90 + 181 + 30 + + + + + 11 + false + + + + QLabel#label_leaderboardPlayer3 +{ + color: white; +} + + + PLAYER 3 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + + + + 9 + 120 + 181 + 30 + + + + + 11 + false + + + + QLabel#label_leaderboardPlayer4 +{ + color: white; +} + + + PLAYER 4 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + + + + 190 + 0 + 61 + 30 + + + + + 11 + 75 + true + true + + + + QLabel#label_leaderboardHeader_2 +{ + color: white; +} + + + S + + + Qt::AlignCenter + + + + + + 251 + 0 + 61 + 30 + + + + + 11 + 75 + true + true + + + + QLabel#label_leaderboardHeader_3 +{ + color: white; +} + + + HCP + + + Qt::AlignCenter + + + + + + 190 + 30 + 61 + 30 + + + + + 11 + false + + + + QLabel#label_leaderboardPlayer1_2 +{ + color: white; +} + + + PAR + + + Qt::AlignCenter + + + + + + 250 + 30 + 61 + 30 + + + + + 11 + false + + + + QLabel#label_leaderboardPlayer1_3 +{ + color: white; +} + + + PAR + + + Qt::AlignCenter + + + + + + 190 + 60 + 61 + 30 + + + + + 11 + false + + + + QLabel#label_leaderboardPlayer2_2 +{ + color: white; +} + + + PAR + + + Qt::AlignCenter + + + + + + 250 + 60 + 61 + 30 + + + + + 11 + false + + + + QLabel#label_leaderboardPlayer2_3 +{ + color: white; +} + + + PAR + + + Qt::AlignCenter + + + + + + 190 + 90 + 61 + 30 + + + + + 11 + false + + + + QLabel#label_leaderboardPlayer3_2 +{ + color: white; +} + + + PAR + + + Qt::AlignCenter + + + + + + 250 + 90 + 61 + 30 + + + + + 11 + false + + + + QLabel#label_leaderboardPlayer3_3 +{ + color: white; +} + + + PAR + + + Qt::AlignCenter + + + + + + 190 + 120 + 61 + 30 + + + + + 11 + false + + + + QLabel#label_leaderboardPlayer4_2 +{ + color: white; +} + + + PAR + + + Qt::AlignCenter + + + + + + 250 + 120 + 61 + 30 + + + + + 11 + false + + + + QLabel#label_leaderboardPlayer4_3 +{ + color: white; +} + + + PAR + + + Qt::AlignCenter + + + + + + + 0 + 349 + 800 + 71 + + + + QFrame#frame_icons +{ + border-color: rgb(255, 255, 0); + + background-color: rgb(0, 0, 0); + +} + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 10 + 10 + 111 + 51 + + + + + + + + :/new/images/images/arrow-left-icon.png + + + + + 55 + 55 + + + + true + + + + + + 680 + 10 + 111 + 51 + + + + + + + + :/new/images/images/arrow-right-icon_2.png + + + + + 55 + 55 + + + + true + + + + + + + 0 + 174 + 320 + 175 + + + + QFrame#frame_courseInformation +{ + border: 2px solid; + border-color: rgb(255, 255, 0); + + background-color: rgb(0, 0, 0); + +} + + + QFrame::StyledPanel + + + QFrame::Raised + + + 1 + + + 0 + + + + + 10 + 10 + 91 + 81 + + + + + 44 + 75 + true + + + + QLabel#label_course +{ + color: white; + border: 2px solid; + border-color: rgb(255, 255, 255); + +} + + + 1 + + + Qt::AlignCenter + + + + + + 110 + 10 + 61 + 21 + + + + QFrame#frame_white +{ + background-color: rgb(255, 255, 255); +} + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + 110 + 40 + 61 + 21 + + + + QFrame#frame_yellow +{ + + background-color: rgb(255, 255, 0); +} + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + 180 + 10 + 61 + 21 + + + + + 13 + 75 + true + + + + QLabel#label_white +{ + color: white; +} + + + 350 + + + + + + 180 + 40 + 61 + 21 + + + + + 13 + 75 + true + + + + QLabel#label_yellow +{ + color: white; +} + + + 323 + + + + + + 180 + 100 + 61 + 21 + + + + + 13 + 75 + true + + + + QLabel#label_red +{ + color: white; +} + + + 298 + + + + + + 110 + 100 + 61 + 21 + + + + QFrame#frame_red +{ + + background-color: rgb(255, 0, 0); +} + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + 180 + 70 + 61 + 21 + + + + + 13 + 75 + true + + + + QLabel#label_blue +{ + color: white; +} + + + 256 + + + + + + 110 + 70 + 61 + 21 + + + + QFrame#frame_blue +{ + + background-color: rgb(0, 0, 255); +} + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + 70 + 100 + 41 + 21 + + + + + 18 + 75 + true + + + + QLabel#label_par +{ + color: white; +} + + + 4 + + + + + + 10 + 100 + 51 + 21 + + + + + 18 + 75 + true + + + + QLabel#label_par_const +{ + color: white; +} + + + PAR + + + + + + 70 + 130 + 41 + 21 + + + + + 18 + 75 + true + + + + QLabel#label_hcp +{ + color: white; +} + + + 13 + + + + + + 10 + 130 + 51 + 21 + + + + + 18 + 75 + true + + + + QLabel#label_hcp_const +{ + color: white; +} + + + HCP + + + + + + 230 + 20 + 81 + 61 + + + + + + + + :/new/images/images/golf-icon_2.png + + + + + 80 + 80 + + + + true + + + + + + + 320 + 0 + 120 + 30 + + + + QLabel#label_player1 +{ + border: 2px solid; + border-color: rgb(255, 255, 0); + color: white; + background-color: rgb(0, 0, 0); +} + + + Player 1 + + + Qt::AlignCenter + + + true + + + + + + 440 + 0 + 120 + 30 + + + + QLabel#label_player2 +{ + border: 2px solid; + border-color: rgb(255, 255, 0); + color: white; + background-color: rgb(0, 0, 0); +} + + + Player 2 + + + Qt::AlignCenter + + + true + + + + + + 560 + 0 + 120 + 30 + + + + QLabel#label_player3 +{ + border: 2px solid; + border-color: rgb(255, 255, 0); + color: white; + background-color: rgb(0, 0, 0); +} + + + Player 3 + + + Qt::AlignCenter + + + true + + + + + + 680 + 0 + 120 + 30 + + + + QLabel#label_player4 +{ + border: 2px solid; + border-color: rgb(255, 255, 0); + color: white; + background-color: rgb(0, 0, 0); +} + + + Player 4 + + + Qt::AlignCenter + + + true + + + + + + 320 + 30 + 121 + 319 + + + + + 45 + + + + QLabel#label_player1_score +{ + border: 2px solid; + border-color: rgb(255, 255, 0); + color: white; + background-color: rgb(0, 0, 0); +} + + + 0 + + + Qt::AlignCenter + + + + + + 440 + 30 + 121 + 319 + + + + + 45 + + + + QLabel#label_player2_score +{ + border: 2px solid; + border-color: rgb(255, 255, 0); + color: white; + background-color: rgb(0, 0, 0); +} + + + 0 + + + Qt::AlignCenter + + + + + + 560 + 30 + 121 + 319 + + + + + 45 + + + + QLabel#label_player3_score +{ + border: 2px solid; + border-color: rgb(255, 255, 0); + color: white; + background-color: rgb(0, 0, 0); +} + + + 0 + + + Qt::AlignCenter + + + + + + 680 + 30 + 121 + 319 + + + + + 45 + + + + QLabel#label_player4_score +{ + border: 2px solid; + border-color: rgb(255, 255, 0); + color: white; + background-color: rgb(0, 0, 0); +} + + + 0 + + + Qt::AlignCenter + + + + + + 330 + 60 + 101 + 71 + + + + + + + + :/new/images/images/arrow-up-icon.png + + + + + 64 + 64 + + + + true + + + + + + 330 + 250 + 101 + 71 + + + + + + + + :/new/images/images/arrow-down-icon.png + + + + + 64 + 64 + + + + true + + + + + + 450 + 250 + 101 + 71 + + + + + + + + :/new/images/images/arrow-down-icon.png + + + + + 64 + 64 + + + + true + + + + + + 570 + 250 + 101 + 71 + + + + + + + + :/new/images/images/arrow-down-icon.png + + + + + 64 + 64 + + + + true + + + + + + 690 + 250 + 101 + 71 + + + + + + + + :/new/images/images/arrow-down-icon.png + + + + + 64 + 64 + + + + true + + + + + + 450 + 60 + 101 + 71 + + + + + + + + :/new/images/images/arrow-up-icon.png + + + + + 64 + 64 + + + + true + + + + + + 570 + 60 + 101 + 71 + + + + + + + + :/new/images/images/arrow-up-icon.png + + + + + 64 + 64 + + + + true + + + + + + 690 + 60 + 101 + 71 + + + + + + + + :/new/images/images/arrow-up-icon.png + + + + + 64 + 64 + + + + true + + + + + + + 0 + 0 + 800 + 20 + + + + + + TopToolBarArea + + + false + + + + + + + + diff --git a/src/courses.h b/src/courses.h new file mode 100644 index 0000000..72bf213 --- /dev/null +++ b/src/courses.h @@ -0,0 +1,145 @@ +#ifndef COURSES_H +#define COURSES_H + +#include + +struct course { + course(QString name,QString file) : + m_name(name),m_file(file) + { + } + + QString m_name; + QString m_file; +}; + +struct courseData { + courseData(QString name, QString par, double latitude, double longitude, QString country, QString city) : + m_name(name), m_par(par), m_latitude(latitude), m_longitude(longitude), m_country(country), m_city(city) + { + } + + QString m_name; + QString m_par; + double m_latitude; + double m_longitude; + QString m_country; + QString m_city; +}; + +struct courseCrMale { + courseCrMale(double white, double yellow, double blue, double red) : + m_white(white), m_yellow(yellow), m_blue(blue), m_red(red) + { + } + + double m_white; + double m_yellow; + double m_blue; + double m_red; + +}; + +struct courseCrFemale { + courseCrFemale(double yellow, double blue, double red) : + m_yellow(yellow), m_blue(blue), m_red(red) + { + } + + double m_yellow; + double m_blue; + double m_red; +}; + +struct courseSlopeMale { + courseSlopeMale(double white, double yellow, double blue, double red) : + m_white(white), m_yellow(yellow), m_blue(blue), m_red(red) + { + } + + double m_white; + double m_yellow; + double m_blue; + double m_red; +}; + +struct courseSlopeFemale { + courseSlopeFemale(double yellow, double blue, double red) : + m_yellow(yellow), m_blue(blue), m_red(red) + { + } + + double m_yellow; + double m_blue; + double m_red; +}; + +struct holeData { + holeData(QString id, QString hcp, QString par, QString map_uri) : + m_id(id), m_hcp(hcp), m_par(par), m_map_uri(map_uri) + { + } + + QString m_id; + QString m_hcp; + QString m_par; + QString m_map_uri; + +}; + +struct whiteTee { + whiteTee(QString length, double latitude, double longitude) : + m_length(length), m_latitude(latitude), m_longitude(longitude) + { + } + + QString m_length; + double m_latitude; + double m_longitude; +}; + +struct yellowTee { + yellowTee(QString length, double latitude, double longitude) : + m_length(length), m_latitude(latitude), m_longitude(longitude) + { + } + + QString m_length; + double m_latitude; + double m_longitude; +}; + +struct blueTee { + blueTee(QString length, double latitude, double longitude) : + m_length(length), m_latitude(latitude), m_longitude(longitude) + { + } + + QString m_length; + double m_latitude; + double m_longitude; +}; + +struct redTee { + redTee(QString length, double latitude, double longitude) : + m_length(length), m_latitude(latitude), m_longitude(longitude) + { + } + + QString m_length; + double m_latitude; + double m_longitude; +}; + +struct greenInfo { + greenInfo(double latitude, double longitude) : + m_latitude(latitude), m_longitude(longitude) + { + } + + double m_latitude; + double m_longitude; +}; + + +#endif // COURSES_H diff --git a/src/datahandling.cpp b/src/datahandling.cpp new file mode 100644 index 0000000..87b6f45 --- /dev/null +++ b/src/datahandling.cpp @@ -0,0 +1,300 @@ +#include "datahandling.h" +#include "newround.h" +#include "xmlparser.h" +#include "basicscorecard.h" +#include + +datahandling::datahandling() +{ + +} + +const QList& datahandling::getPlayers() +{ + return m_players; +} + +void datahandling::addPlayer(QString name,QString hcp,QString gender) +{ + m_players.push_back(player(name,hcp,gender)); +} + +const QList& datahandling::getCourses() +{ + return m_courses; +} + +void datahandling::addCourses(QString name, QString file) +{ + m_courses.push_back(course(name, file)); +} + +const QList& datahandling::getCourseData() +{ + return m_courseData; +} + +void datahandling::addCourseData(QString name, QString par, double latitude, double longitude, QString country, QString city) +{ + m_courseData.push_back(courseData(name, par, latitude, longitude, country, city)); +} + +const QList& datahandling::getCourseCrMale() +{ + return m_courseCrMale; +} + +void datahandling::addCourseCrMale(double white, double yellow, double blue, double red) +{ + m_courseCrMale.push_back(courseCrMale(white, yellow, blue, red)); +} + +const QList& datahandling::getCourseCrFemale() +{ + return m_courseCrFemale; +} + +void datahandling::addCourseCrFemale(double yellow, double blue, double red) +{ + m_courseCrFemale.push_back(courseCrFemale(yellow, blue, red)); +} + +const QList& datahandling::getCourseSlopeMale() +{ + return m_courseSlopeMale; +} + +void datahandling::addCourseSlopeMale(double white, double yellow, double blue, double red) +{ + m_courseSlopeMale.push_back(courseSlopeMale(white, yellow, blue, red)); +} + +const QList& datahandling::getCourseSlopeFemale() +{ + return m_courseSlopeFemale; +} + +void datahandling::addCourseSlopeFemale(double yellow, double blue, double red) +{ + m_courseSlopeFemale.push_back(courseSlopeFemale(yellow, blue, red)); +} + +const QList& datahandling::getHoleData() +{ + return m_holeData; +} + +void datahandling::addHoleData(QString id, QString hcp, QString par, QString map_uri) +{ + m_holeData.push_back(holeData(id, hcp, par, map_uri)); +} + +const QList& datahandling::getWhiteTee() +{ + return m_whiteTee; +} + +void datahandling::addWhiteTee(QString length, double latitude, double longitude) +{ + m_whiteTee.push_back(whiteTee(length, latitude, longitude)); +} + +const QList& datahandling::getYellowTee() +{ + return m_yellowTee; +} + +void datahandling::addYellowTee(QString length, double latitude, double longitude) +{ + m_yellowTee.push_back(yellowTee(length, latitude, longitude)); +} + +const QList& datahandling::getBlueTee() +{ + return m_blueTee; +} + +void datahandling::addBlueTee(QString length, double latitude, double longitude) +{ + m_blueTee.push_back(blueTee(length, latitude, longitude)); +} + +const QList& datahandling::getRedTee() +{ + return m_redTee; +} + +void datahandling::addRedTee(QString length, double latitude, double longitude) +{ + m_redTee.push_back(redTee(length, latitude, longitude)); +} + +const QList& datahandling::getGreenInfo() +{ + return m_greenInfo; +} + +void datahandling::addGreenInfo(double latitude, double longitude) +{ + m_greenInfo.push_back(greenInfo(latitude, longitude)); +} + +void datahandling::clearData() +{ + m_players.clear(); + m_courses.clear(); +} + +datahandling* datahandling::instance() +{ + if (m_instance==0) + m_instance = new datahandling(); + + return (m_instance); +} + +void datahandling::calculateHandicaps() +{ + double cr[4]; + double fcr[3]; + double slope[4]; + double fslope[3]; + int par=0; + QStringList temp; + + for(int i = 0; i < 4; i++) + { + cr[i] = 0; + slope[i] = 0; + } + + for(int i = 0; i < 3; i++) + { + fcr[i] = 0; + fslope[i] = 0; + } + + + this->selectedPlayersHandicap.clear(); + + foreach(courseData cD,this->m_courseData) + { + temp.push_back(cD.m_par); + par = temp[0].toInt(); + } + + temp.clear(); + + foreach(courseCrMale crM, this->m_courseCrMale) + { + cr[0] = (double)crM.m_white; + cr[1] = (double)crM.m_yellow; + cr[2] = (double)crM.m_blue; + cr[3] = (double)crM.m_red; + } + + temp.clear(); + + foreach(courseSlopeMale sM, this->m_courseSlopeMale) + { + slope[0] = sM.m_white; + slope[1] = sM.m_yellow; + slope[2] = sM.m_blue; + slope[3] = sM.m_red; + } + + temp.clear(); + + foreach(courseCrFemale crF, this->m_courseCrFemale) + { + fcr[0] = crF.m_yellow; + fcr[1] = crF.m_blue; + fcr[2] = crF.m_red; + } + + temp.clear(); + + foreach(courseSlopeFemale sF, this->m_courseSlopeFemale) + { + fslope[0] = sF.m_yellow; + fslope[1] = sF.m_blue; + fslope[2] = sF.m_red; + } + + for(int i = 0; i < this->selectedPlayers.count(); i++) + { + int handicap; + if(QString::compare(this->selectedPlayersTee[i], "White", Qt::CaseInsensitive) == 0 && + QString::compare(this->selectedPlayersGender[i], "male", Qt::CaseInsensitive) == 0) + { + + handicap = this->selectedPlayersHcp[i].toDouble() * (double)(slope[0] / 113) + (double)(cr[0] - par) + 0.5; + selectedPlayersHandicap << QString::number(handicap); + qDebug() << "Male White: " << handicap; + qDebug() << "Slope: " << slope[0] << " CR: " << cr[0]; + + } + else if(QString::compare(this->selectedPlayersTee[i], "Yellow", Qt::CaseInsensitive) == 0 && + QString::compare(this->selectedPlayersGender[i], "male", Qt::CaseInsensitive) == 0) + { + handicap = this->selectedPlayersHcp[i].toDouble() * (double)(slope[1] / 113) + (double)(cr[1] - par) + 0.5; + selectedPlayersHandicap << QString::number(handicap); + qDebug() << "Male Yellow: " << handicap; + + } + else if(QString::compare(this->selectedPlayersTee[i], "Blue", Qt::CaseInsensitive) == 0 && + QString::compare(this->selectedPlayersGender[i], "male", Qt::CaseInsensitive) == 0) + { + handicap = this->selectedPlayersHcp[i].toDouble() * (double)(slope[2] / 113) + (double)(cr[2] - par) + 0.5; + selectedPlayersHandicap << QString::number(handicap); + qDebug() << "Male Blue: " << handicap; + + } + else if(QString::compare(this->selectedPlayersTee[i], "Red", Qt::CaseInsensitive) == 0 && + QString::compare(this->selectedPlayersGender[i], "male", Qt::CaseInsensitive) == 0) + { + handicap = this->selectedPlayersHcp[i].toDouble() * (double)(slope[3] / 113) + (double)(cr[3] - par) + 0.5; + selectedPlayersHandicap << QString::number(handicap); + qDebug() << "Male Red: " << handicap; + + } + + if(QString::compare(this->selectedPlayersTee[i], "White", Qt::CaseInsensitive) == 0 && + QString::compare(this->selectedPlayersGender[i], "female", Qt::CaseInsensitive) == 0) + { + + handicap = this->selectedPlayersHcp[i].toDouble() * (double)(fslope[0] / 113) + (double)(fcr[0] - par) + 0.5; + selectedPlayersHandicap << QString::number(handicap); + qDebug() << "Female White: " << handicap; + + } + else if(QString::compare(this->selectedPlayersTee[i], "Yellow", Qt::CaseInsensitive) == 0 && + QString::compare(this->selectedPlayersGender[i], "female", Qt::CaseInsensitive) == 0) + { + handicap = this->selectedPlayersHcp[i].toDouble() * (double)(fslope[0] / 113) + (double)(fcr[0] - par) + 0.5; + selectedPlayersHandicap << QString::number(handicap); + qDebug() << "Female Yellow: " << handicap; + + } + else if(QString::compare(this->selectedPlayersTee[i], "Blue", Qt::CaseInsensitive) == 0 && + QString::compare(this->selectedPlayersGender[i], "female", Qt::CaseInsensitive) == 0) + { + handicap = this->selectedPlayersHcp[i].toDouble() * (double)(fslope[1] / 113) + (double)(fcr[1] - par) + 0.5; + selectedPlayersHandicap << QString::number(handicap); + qDebug() << "Female Blue: " << handicap; + + } + else if(QString::compare(this->selectedPlayersTee[i], "Red", Qt::CaseInsensitive) == 0 && + QString::compare(this->selectedPlayersGender[i], "female", Qt::CaseInsensitive) == 0) + { + handicap = this->selectedPlayersHcp[i].toDouble() * (double)(fslope[2] / 113) + (double)(fcr[2] - par) + 0.5; + selectedPlayersHandicap << QString::number(handicap); + qDebug() << "Female Red: " << handicap; + + } + + + } +} + + diff --git a/src/datahandling.h b/src/datahandling.h new file mode 100644 index 0000000..7e843d1 --- /dev/null +++ b/src/datahandling.h @@ -0,0 +1,91 @@ +#ifndef DATAHANDLING_H +#define DATAHANDLING_H + +#include +#include +#include "player.h" +#include "courses.h" + +class datahandling : public QMainWindow +{ + Q_OBJECT + +public: + static datahandling* instance(); + + const QList& getPlayers(); + void addPlayer(QString name,QString hcp,QString gender); + + const QList& getCourses(); + void addCourses(QString name, QString file); + + const QList& getCourseData(); + void addCourseData(QString name, QString par, double latitude, double longitude, QString country, QString city); + + const QList& getCourseCrMale(); + void addCourseCrMale(double white, double yellow, double blue, double red); + + const QList& getCourseCrFemale(); + void addCourseCrFemale(double yellow, double blue, double red); + + const QList& getCourseSlopeMale(); + void addCourseSlopeMale(double white, double yellow, double blue, double red); + + const QList& getCourseSlopeFemale(); + void addCourseSlopeFemale(double yellow, double blue, double red); + + const QList& getHoleData(); + void addHoleData(QString id, QString hcp, QString par, QString map_uri); + + const QList& getWhiteTee(); + void addWhiteTee(QString length, double latitude, double longitude); + + const QList& getYellowTee(); + void addYellowTee(QString length, double latitude, double longitude); + + const QList& getBlueTee(); + void addBlueTee(QString length, double latitude, double longitude); + + const QList& getRedTee(); + void addRedTee(QString length, double latitude, double longitude); + + const QList& getGreenInfo(); + void addGreenInfo(double latitude, double longitude); + + void calculateHandicaps(); + + void clearData(); + + QString selectedCourse; + + QStringList selectedPlayers; + QStringList selectedPlayersHcp; + QStringList selectedPlayersTee; + QStringList selectedPlayersHandicap; + QStringList selectedPlayersGender; + +private: + static datahandling* m_instance; + datahandling(); + QList m_players; + QList m_courses; + QList m_courseData; + QList m_courseCrMale; + QList m_courseCrFemale; + QList m_courseSlopeMale; + QList m_courseSlopeFemale; + QList m_holeData; + QList m_whiteTee; + QList m_yellowTee; + QList m_blueTee; + QList m_redTee; + QList m_greenInfo; + + + + +}; + + + +#endif // DATAHANDLING_H diff --git a/src/images/Add-icon.png b/src/images/Add-icon.png new file mode 100644 index 0000000..17eefcc Binary files /dev/null and b/src/images/Add-icon.png differ diff --git a/src/images/YaST-icon.png b/src/images/YaST-icon.png new file mode 100644 index 0000000..47e9415 Binary files /dev/null and b/src/images/YaST-icon.png differ diff --git a/src/images/arrow-down-icon.png b/src/images/arrow-down-icon.png new file mode 100644 index 0000000..208a57d Binary files /dev/null and b/src/images/arrow-down-icon.png differ diff --git a/src/images/arrow-left-icon.png b/src/images/arrow-left-icon.png new file mode 100644 index 0000000..6c50df1 Binary files /dev/null and b/src/images/arrow-left-icon.png differ diff --git a/src/images/arrow-right-icon.png b/src/images/arrow-right-icon.png new file mode 100644 index 0000000..4b6ec8d Binary files /dev/null and b/src/images/arrow-right-icon.png differ diff --git a/src/images/arrow-right-icon_2.png b/src/images/arrow-right-icon_2.png new file mode 100644 index 0000000..854df89 Binary files /dev/null and b/src/images/arrow-right-icon_2.png differ diff --git a/src/images/arrow-up-icon.png b/src/images/arrow-up-icon.png new file mode 100644 index 0000000..acc72cd Binary files /dev/null and b/src/images/arrow-up-icon.png differ diff --git a/src/images/course-icon.png b/src/images/course-icon.png new file mode 100644 index 0000000..ff02ccc Binary files /dev/null and b/src/images/course-icon.png differ diff --git a/src/images/edit-course.png b/src/images/edit-course.png new file mode 100644 index 0000000..1ea33d8 Binary files /dev/null and b/src/images/edit-course.png differ diff --git a/src/images/edit-player.png b/src/images/edit-player.png new file mode 100644 index 0000000..9ce7dd8 Binary files /dev/null and b/src/images/edit-player.png differ diff --git a/src/images/golf-icon.png b/src/images/golf-icon.png new file mode 100644 index 0000000..f636e89 Binary files /dev/null and b/src/images/golf-icon.png differ diff --git a/src/images/golf-icon_2.png b/src/images/golf-icon_2.png new file mode 100644 index 0000000..5011253 Binary files /dev/null and b/src/images/golf-icon_2.png differ diff --git a/src/images/new-course.png b/src/images/new-course.png new file mode 100644 index 0000000..6ffcbfa Binary files /dev/null and b/src/images/new-course.png differ diff --git a/src/images/new-player.png b/src/images/new-player.png new file mode 100644 index 0000000..0880b32 Binary files /dev/null and b/src/images/new-player.png differ diff --git a/src/images/person-icon.png b/src/images/person-icon.png new file mode 100644 index 0000000..eb13e46 Binary files /dev/null and b/src/images/person-icon.png differ diff --git a/src/images/stats-icon.png b/src/images/stats-icon.png new file mode 100644 index 0000000..09b77e8 Binary files /dev/null and b/src/images/stats-icon.png differ diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..4774d97 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,14 @@ +#include +#include "mainwindow.h" +#include "datahandling.h" + + +datahandling* datahandling::m_instance = 0; + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + MainWindow w; + w.show(); + return a.exec(); +} diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp new file mode 100644 index 0000000..9260e8f --- /dev/null +++ b/src/mainwindow.cpp @@ -0,0 +1,41 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" +#include "newround.h" +#include "pcmanagement.h" + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::MainWindow) +{ + ui->setupUi(this); +} + +MainWindow::~MainWindow() +{ + delete ui; +} + +void MainWindow::changeEvent(QEvent *e) +{ + QMainWindow::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: + break; + } +} + +void MainWindow::on_newRoundButton_clicked() +{ + newround *newRound = new newround(); + newRound->show(); +} + +void MainWindow::on_courseEditorButton_clicked() +{ + PCManagement *pcManagement = new PCManagement(); + pcManagement->show(); + this->hide(); +} diff --git a/src/mainwindow.h b/src/mainwindow.h new file mode 100644 index 0000000..5716aef --- /dev/null +++ b/src/mainwindow.h @@ -0,0 +1,27 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +namespace Ui { + class MainWindow; +} + +class MainWindow : public QMainWindow { + Q_OBJECT +public: + MainWindow(QWidget *parent = 0); + ~MainWindow(); + +protected: + void changeEvent(QEvent *e); + +private: + Ui::MainWindow *ui; + +private slots: + void on_courseEditorButton_clicked(); + void on_newRoundButton_clicked(); +}; + +#endif // MAINWINDOW_H diff --git a/src/mainwindow.ui b/src/mainwindow.ui new file mode 100644 index 0000000..31f09b3 --- /dev/null +++ b/src/mainwindow.ui @@ -0,0 +1,190 @@ + + + MainWindow + + + + 0 + 0 + 800 + 480 + + + + Golf Scorecard + + + + + + + + + 100 + 140 + 128 + 128 + + + + + + + + :/new/images/images/golf-icon.png:/new/images/images/golf-icon.png + + + + 128 + 128 + + + + true + + + + + + 320 + 140 + 128 + 128 + + + + + + + + :/new/images/images/course-icon.png:/new/images/images/course-icon.png + + + + 128 + 128 + + + + true + + + + + + 550 + 140 + 128 + 128 + + + + + + + + :/new/images/images/stats-icon.png:/new/images/images/stats-icon.png + + + + 128 + 128 + + + + true + + + + + + 100 + 280 + 131 + 41 + + + + + 19 + + + + Play! + + + Qt::AlignHCenter|Qt::AlignTop + + + + + + 300 + 280 + 191 + 81 + + + + + 19 + + + + Player & Course Management + + + Qt::AlignHCenter|Qt::AlignTop + + + true + + + + + + 550 + 280 + 131 + 41 + + + + + 19 + + + + Stats + + + Qt::AlignHCenter|Qt::AlignTop + + + + + + + 0 + 0 + 800 + 20 + + + + + + TopToolBarArea + + + false + + + + + + + + + + diff --git a/src/newround.cpp b/src/newround.cpp new file mode 100644 index 0000000..a328717 --- /dev/null +++ b/src/newround.cpp @@ -0,0 +1,269 @@ +#include "newround.h" +#include "ui_newround.h" +#include "datahandling.h" +#include "xmlparser.h" +#include "basicscorecard.h" +#include + +#include + + +newround::newround(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::newround) +{ + ui->setupUi(this); + + ui->comboBox_player2->setHidden(true); + ui->comboBox_player3->setHidden(true); + ui->comboBox_player4->setHidden(true); + + ui->hcp_player2->setHidden(true); + ui->hcp_player3->setHidden(true); + ui->hcp_player4->setHidden(true); + + ui->tee_player2->setHidden(true); + ui->tee_player3->setHidden(true); + ui->tee_player4->setHidden(true); + + datahandling *playerAndCourseData = datahandling::instance(); + xmlparser *Parser = new xmlparser(); + + playerAndCourseData->clearData(); + Parser->loadPlayerXMLFile(); + Parser->loadCourseXMLFile(); + + const QList& players = playerAndCourseData->getPlayers(); + const QList& courses = playerAndCourseData->getCourses(); + + QStringList player_namelist; + + foreach(player plr,players) + { + player_namelist.push_back(plr.m_name); + hcps.push_back(plr.m_hcp); + } + + foreach(course crs, courses) + { + courseNames.push_back(crs.m_name); + courseFiles.push_back(crs.m_file); + } + + ui->comboBox_player1->addItems(player_namelist); + ui->comboBox_player2->addItems(player_namelist); + ui->comboBox_player3->addItems(player_namelist); + ui->comboBox_player4->addItems(player_namelist); + ui->comboBox_course->addItems(courseNames); +} + + + +void newround::on_checkBox_player1_toggled(bool checked) +{ + if(checked) + { + ui->comboBox_player1->setHidden(true); + ui->hcp_player1->setHidden(true); + ui->tee_player1->setHidden(true); + ui->comboBox_player1->setHidden(false); + ui->hcp_player1->setHidden(false); + ui->tee_player1->setHidden(false); + } + if(!checked) + { + ui->comboBox_player1->setHidden(true); + ui->hcp_player1->setHidden(true); + ui->tee_player1->setHidden(true); + ui->comboBox_player1->setHidden(true); + ui->hcp_player1->setHidden(true); + ui->tee_player1->setHidden(true); + } +} + +void newround::on_checkBox_player2_toggled(bool checked) +{ + if(checked) + { + ui->comboBox_player2->setEnabled(true); + ui->hcp_player2->setEnabled(true); + ui->tee_player2->setEnabled(true); + ui->comboBox_player2->setHidden(false); + ui->hcp_player2->setHidden(false); + ui->tee_player2->setHidden(false); + + } + if(!checked) + { + ui->comboBox_player2->setDisabled(true); + ui->hcp_player2->setDisabled(true); + ui->tee_player2->setDisabled(true); + ui->comboBox_player2->setHidden(true); + ui->hcp_player2->setHidden(true); + ui->tee_player2->setHidden(true); + + } +} + +void newround::on_checkBox_player3_toggled(bool checked) +{ + if(checked) + { + ui->comboBox_player3->setEnabled(true); + ui->hcp_player3->setEnabled(true); + ui->tee_player3->setEnabled(true); + ui->comboBox_player3->setHidden(false); + ui->hcp_player3->setHidden(false); + ui->tee_player3->setHidden(false); + + } + if(!checked) + { + ui->comboBox_player3->setDisabled(true); + ui->hcp_player3->setDisabled(true); + ui->tee_player3->setDisabled(true); + ui->comboBox_player3->setHidden(true); + ui->hcp_player3->setHidden(true); + ui->tee_player3->setHidden(true); + + } +} + +void newround::on_checkBox_player4_toggled(bool checked) +{ + if(checked) + { + ui->comboBox_player4->setEnabled(true); + ui->hcp_player4->setEnabled(true); + ui->tee_player4->setEnabled(true); + ui->comboBox_player4->setHidden(false); + ui->hcp_player4->setHidden(false); + ui->tee_player4->setHidden(false); + + } + if(!checked) + { + ui->comboBox_player4->setDisabled(true); + ui->hcp_player4->setDisabled(true); + ui->tee_player4->setDisabled(true); + ui->comboBox_player4->setHidden(true); + ui->hcp_player4->setHidden(true); + ui->tee_player4->setHidden(true); + + } +} + +void newround::on_comboBox_player1_currentIndexChanged(int index) +{ + for(int i = 0; i < hcps.length(); i++) + { + if(index == i) + ui->hcp_player1->setPlainText(hcps[index]); + } +} + +void newround::on_comboBox_player2_currentIndexChanged(int index) +{ + for(int i = 0; i < hcps.length(); i++) + { + if(index == i) + ui->hcp_player2->setPlainText(hcps[index]); + } +} + +void newround::on_comboBox_player3_currentIndexChanged(int index) +{ + for(int i = 0; i < hcps.length(); i++) + { + if(index == i) + ui->hcp_player3->setPlainText(hcps[index]); + } +} + +void newround::on_comboBox_player4_currentIndexChanged(int index) +{ + for(int i = 0; i < hcps.length(); i++) + { + if(index == i) + ui->hcp_player4->setPlainText(hcps[index]); + } +} + +void newround::on_pushButton_continue_clicked() +{ + datahandling *playerAndCourseData = datahandling::instance(); + xmlparser *Parser = new xmlparser(); + int courseIndex; + + courseIndex = ui->comboBox_course->currentIndex(); + playerAndCourseData->selectedCourse = courseFiles[courseIndex]; + + Parser->parseSelectedCourse(); + saveSelectedPlayers(); + playerAndCourseData->calculateHandicaps(); + + BasicScorecard *basicscorecard = new BasicScorecard(); + QMessageBox msgBox; + msgBox.setText("Do you want to start a round?"); + msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); + int ret = msgBox.exec(); + switch (ret) + { + case QMessageBox::Yes: + basicscorecard->show(); + this->hide(); + break; + case QMessageBox::No: + break; + } +} + +void newround::saveSelectedPlayers() +{ + datahandling *playerAndCourseData = datahandling::instance(); + const QList& players = playerAndCourseData->getPlayers(); + QStringList gender; + + playerAndCourseData->selectedPlayers.clear(); + playerAndCourseData->selectedPlayersHcp.clear(); + playerAndCourseData->selectedPlayersTee.clear(); + playerAndCourseData->selectedPlayersGender.clear(); + + foreach(player plr,players) + { + gender.push_back(plr.m_gender); + } + + if(ui->checkBox_player1->isChecked()) + { + playerAndCourseData->selectedPlayers << ui->comboBox_player1->currentText(); + playerAndCourseData->selectedPlayersHcp << ui->hcp_player1->toPlainText(); + playerAndCourseData->selectedPlayersTee << ui->tee_player1->currentText(); + playerAndCourseData->selectedPlayersGender << gender[ui->comboBox_player1->currentIndex()]; + } + if(ui->checkBox_player2->isChecked()) + { + playerAndCourseData->selectedPlayers << ui->comboBox_player2->currentText(); + playerAndCourseData->selectedPlayersHcp << ui->hcp_player2->toPlainText(); + playerAndCourseData->selectedPlayersTee << ui->tee_player2->currentText(); + playerAndCourseData->selectedPlayersGender << gender[ui->comboBox_player2->currentIndex()]; + + } + if(ui->checkBox_player3->isChecked()) + { + playerAndCourseData->selectedPlayers << ui->comboBox_player3->currentText(); + playerAndCourseData->selectedPlayersHcp << ui->hcp_player3->toPlainText(); + playerAndCourseData->selectedPlayersTee << ui->tee_player3->currentText(); + playerAndCourseData->selectedPlayersGender << gender[ui->comboBox_player3->currentIndex()]; + + } + if(ui->checkBox_player4->isChecked()) + { + playerAndCourseData->selectedPlayers << ui->comboBox_player4->currentText(); + playerAndCourseData->selectedPlayersHcp << ui->hcp_player4->toPlainText(); + playerAndCourseData->selectedPlayersTee << ui->tee_player4->currentText(); + playerAndCourseData->selectedPlayersGender << gender[ui->comboBox_player4->currentIndex()]; + + } +} + diff --git a/src/newround.h b/src/newround.h new file mode 100644 index 0000000..56e6699 --- /dev/null +++ b/src/newround.h @@ -0,0 +1,36 @@ +#ifndef NEWROUND_H +#define NEWROUND_H + +#include +#include "datahandling.h" + +namespace Ui { + class newround; +} + +class newround : public QMainWindow +{ + Q_OBJECT +public: + newround(QWidget *parent = 0); + +private: + Ui::newround *ui; + QStringList hcps; + QStringList courseNames; + QStringList courseFiles; + void saveSelectedPlayers(); + +private slots: + void on_pushButton_continue_clicked(); + void on_comboBox_player4_currentIndexChanged(int index); + void on_comboBox_player3_currentIndexChanged(int index); + void on_comboBox_player2_currentIndexChanged(int index); + void on_comboBox_player1_currentIndexChanged(int index); + void on_checkBox_player4_toggled(bool checked); + void on_checkBox_player3_toggled(bool checked); + void on_checkBox_player2_toggled(bool checked); + void on_checkBox_player1_toggled(bool checked); +}; + +#endif // NEWROUND_H diff --git a/src/newround.ui b/src/newround.ui new file mode 100644 index 0000000..62ef7e1 --- /dev/null +++ b/src/newround.ui @@ -0,0 +1,589 @@ + + + newround + + + + 0 + 0 + 800 + 480 + + + + Select Players & Course + + + + + + 0 + 0 + 801 + 441 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 140 + 0 + 171 + 31 + + + + + 20 + 75 + true + true + + + + PLAYERS + + + + + + 10 + 50 + 121 + 50 + + + + + 20 + + + + + + + true + + + + + + 10 + 110 + 121 + 50 + + + + + 20 + + + + + + + + + + 10 + 170 + 121 + 50 + + + + + 20 + + + + + + + + + + 10 + 230 + 121 + 50 + + + + + 20 + + + + + + + + + true + + + + 140 + 50 + 320 + 50 + + + + + + true + + + + 140 + 110 + 320 + 50 + + + + + + true + + + + 140 + 170 + 320 + 50 + + + + + + true + + + + 140 + 230 + 320 + 50 + + + + + + true + + + + 480 + 50 + 120 + 50 + + + + + 20 + 75 + true + + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + + + + + + true + + + + 610 + 50 + 180 + 50 + + + + + 22 + 75 + true + + + + + White + + + + + Yellow + + + + + Blue + + + + + Red + + + + + + true + + + + 480 + 110 + 120 + 50 + + + + + 20 + 75 + true + + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + + + true + + + + 480 + 170 + 120 + 50 + + + + + 20 + 75 + true + + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + + + true + + + + 480 + 230 + 120 + 50 + + + + + 20 + 75 + true + + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + + + true + + + + 610 + 110 + 180 + 50 + + + + + 22 + 75 + true + + + + + White + + + + + Yellow + + + + + Blue + + + + + Red + + + + + + true + + + + 610 + 170 + 180 + 50 + + + + + 22 + 75 + true + + + + + White + + + + + Yellow + + + + + Blue + + + + + Red + + + + + + true + + + + 610 + 230 + 180 + 50 + + + + + 22 + 75 + true + + + + + White + + + + + Yellow + + + + + Blue + + + + + Red + + + + + + + 0 + 0 + 171 + 31 + + + + + 20 + 75 + true + true + + + + ACTIVE + + + + + + 480 + 0 + 121 + 31 + + + + + 20 + 75 + true + true + + + + HCP + + + + + + 610 + 0 + 121 + 31 + + + + + 20 + 75 + true + true + + + + TEE + + + + + + 0 + 330 + 240 + 50 + + + + + 20 + 75 + true + false + true + + + + SELECT COURSE: + + + + + true + + + + 240 + 330 + 320 + 50 + + + + + + + 650 + 300 + 141 + 111 + + + + + + + + :/new/images/images/arrow-right-icon.png:/new/images/images/arrow-right-icon.png + + + + 128 + 128 + + + + true + + + + + + + + 0 + 0 + 800 + 20 + + + + + + + + + + diff --git a/src/object_script.golfscorecard.Debug b/src/object_script.golfscorecard.Debug new file mode 100644 index 0000000..0e3c255 --- /dev/null +++ b/src/object_script.golfscorecard.Debug @@ -0,0 +1,18 @@ +INPUT( +./debug\main.o +./debug\mainwindow.o +./debug\newround.o +./debug\xmlparser.o +./debug\datahandling.o +./debug\basicscorecard.o +./debug\pcmanagement.o +./debug\playermanagement.o +./debug\moc_mainwindow.o +./debug\moc_newround.o +./debug\moc_xmlparser.o +./debug\moc_datahandling.o +./debug\moc_basicscorecard.o +./debug\moc_pcmanagement.o +./debug\moc_playermanagement.o +./debug\qrc_resources.o +); diff --git a/src/object_script.golfscorecard.Release b/src/object_script.golfscorecard.Release new file mode 100644 index 0000000..cd8a637 --- /dev/null +++ b/src/object_script.golfscorecard.Release @@ -0,0 +1,18 @@ +INPUT( +./release\main.o +./release\mainwindow.o +./release\newround.o +./release\xmlparser.o +./release\datahandling.o +./release\basicscorecard.o +./release\pcmanagement.o +./release\playermanagement.o +./release\moc_mainwindow.o +./release\moc_newround.o +./release\moc_xmlparser.o +./release\moc_datahandling.o +./release\moc_basicscorecard.o +./release\moc_pcmanagement.o +./release\moc_playermanagement.o +./release\qrc_resources.o +); diff --git a/src/pcmanagement.cpp b/src/pcmanagement.cpp new file mode 100644 index 0000000..dd6943f --- /dev/null +++ b/src/pcmanagement.cpp @@ -0,0 +1,25 @@ +#include "pcmanagement.h" +#include "ui_pcmanagement.h" +#include "mainwindow.h" +#include "playermanagement.h" + +PCManagement::PCManagement(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::PCManagement) +{ + ui->setupUi(this); +} + +void PCManagement::on_prevWindowButton_clicked() +{ + MainWindow *mw = new MainWindow(); + mw->show(); + this->hide(); +} + +void PCManagement::on_addPlayerButton_clicked() +{ + playermanagement *pm = new playermanagement(); + pm->show(); + this->hide(); +} diff --git a/src/pcmanagement.h b/src/pcmanagement.h new file mode 100644 index 0000000..af3f528 --- /dev/null +++ b/src/pcmanagement.h @@ -0,0 +1,25 @@ +#ifndef PCMANAGEMENT_H +#define PCMANAGEMENT_H + +#include + +namespace Ui { + class PCManagement; +} + +class PCManagement : public QMainWindow +{ + Q_OBJECT + +public: + PCManagement(QWidget *parent = 0); + +private: + Ui::PCManagement *ui; + +private slots: + void on_addPlayerButton_clicked(); + void on_prevWindowButton_clicked(); +}; + +#endif // PCMANAGEMENT_H diff --git a/src/pcmanagement.ui b/src/pcmanagement.ui new file mode 100644 index 0000000..57f1577 --- /dev/null +++ b/src/pcmanagement.ui @@ -0,0 +1,246 @@ + + + PCManagement + + + + 0 + 0 + 800 + 480 + + + + Course & Player Management + + + + + + 170 + 30 + 128 + 128 + + + + + + + + :/new/images/images/new-player.png:/new/images/images/new-player.png + + + + 128 + 128 + + + + true + + + + + + 170 + 220 + 128 + 128 + + + + + + + + :/new/images/images/edit-player.png:/new/images/images/edit-player.png + + + + 128 + 128 + + + + true + + + + + + 500 + 30 + 128 + 128 + + + + + + + + :/new/images/images/new-course.png:/new/images/images/new-course.png + + + + 128 + 128 + + + + true + + + + + + 500 + 220 + 128 + 128 + + + + + + + + :/new/images/images/edit-course.png:/new/images/images/edit-course.png + + + + 128 + 128 + + + + true + + + + + + 160 + 170 + 151 + 31 + + + + + 14 + + + + Create Player + + + Qt::AlignHCenter|Qt::AlignTop + + + + + + 160 + 360 + 151 + 31 + + + + + 14 + + + + Edit Player + + + Qt::AlignHCenter|Qt::AlignTop + + + + + + 490 + 170 + 151 + 31 + + + + + 14 + + + + Create Course + + + Qt::AlignHCenter|Qt::AlignTop + + + + + + 490 + 360 + 151 + 31 + + + + + 14 + + + + Edit Course + + + Qt::AlignHCenter|Qt::AlignTop + + + + + + 10 + 360 + 64 + 64 + + + + + + + + :/new/images/images/arrow-left-icon.png:/new/images/images/arrow-left-icon.png + + + + 64 + 64 + + + + true + + + + + + + 0 + 0 + 800 + 20 + + + + + + + + diff --git a/src/player.h b/src/player.h new file mode 100644 index 0000000..8c26984 --- /dev/null +++ b/src/player.h @@ -0,0 +1,17 @@ +#ifndef PLAYER_H +#define PLAYER_H + +#include + +struct player { + player(QString name,QString hcp,QString gender) : + m_name(name),m_hcp(hcp),m_gender(gender) + { + } + + QString m_name; + QString m_hcp; + QString m_gender; +}; + +#endif // PLAYER_H diff --git a/src/playermanagement.cpp b/src/playermanagement.cpp new file mode 100644 index 0000000..a4f002d --- /dev/null +++ b/src/playermanagement.cpp @@ -0,0 +1,121 @@ +#include "playermanagement.h" +#include "ui_playermanagement.h" +#include "pcmanagement.h" + +#include +#include +#include +#include + +#include + +#define N900 + +playermanagement::playermanagement(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::playermanagement) +{ + ui->setupUi(this); + fileName = (QCoreApplication::applicationDirPath() + "/xml/players/playerdata.xml"); + + #ifdef N900 + fileName = "/opt/GolfScorecard/xml/players/playerdata.xml"; + #endif +} + +playermanagement::~playermanagement() +{ + delete ui; +} + +void playermanagement::changeEvent(QEvent *e) +{ + QMainWindow::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: + break; + } +} + +void playermanagement::on_saveAndContinue_clicked() +{ + if(!ui->fullName->toPlainText().isEmpty() && !ui->hcp->toPlainText().isEmpty()) + { + + if (fileName.isEmpty()){ + QMessageBox::warning(this, tr("Player file"), + tr("EMPTY! Cannot read file.")); + + } + + QFile file(fileName); + + if (!file.open(QFile::ReadOnly | QFile::Text)) { + QMessageBox::warning(this, tr("Player file"), + tr("Cannot read file %1:\n%2.") + .arg(fileName) + .arg(file.errorString())); + + } + + QDomDocument doc("Players"); + + if( !doc.setContent( &file ) ) + { + file.close(); + QMessageBox::warning(this, tr("Parsing failed"), tr("Parsing failed totally")); + } + file.close(); + + file.remove(fileName); + + QDomElement root = doc.documentElement(); + if( root.tagName() != "players" ) + QMessageBox::warning(this, tr("No root found!"), tr("There was no root in XML found!")); + + QDomElement tag = doc.createElement("player"); + tag.setAttribute("name", ui->fullName->toPlainText()); + tag.setAttribute("gender", ui->gender_comboBox->currentText()); + tag.setAttribute("hcp", ui->hcp->toPlainText()); + root.appendChild(tag); + + qDebug() << doc.toString(); + + if (!file.open(QFile::WriteOnly | QFile::Text)) { + QMessageBox::warning(this, tr("Player file"), + tr("Cannot read file %1:\n%2.") + .arg(fileName) + .arg(file.errorString())); + + } + + QTextStream ts( &file ); + ts << doc.toString(); + + file.close(); + + QMessageBox msgBox; + msgBox.setText("Player created!"); + msgBox.exec(); + + PCManagement *pcm = new PCManagement(); + pcm->show(); + this->hide(); + } + else + { + QMessageBox msgBox; + msgBox.setText("You have not filled all fields!"); + msgBox.exec(); + } +} + +void playermanagement::on_prevWindowButton_clicked() +{ + PCManagement *pcm = new PCManagement(); + pcm->show(); + this->hide(); +} diff --git a/src/playermanagement.h b/src/playermanagement.h new file mode 100644 index 0000000..9ab802e --- /dev/null +++ b/src/playermanagement.h @@ -0,0 +1,28 @@ +#ifndef PLAYERMANAGEMENT_H +#define PLAYERMANAGEMENT_H + +#include + +namespace Ui { + class playermanagement; +} + +class playermanagement : public QMainWindow { + Q_OBJECT +public: + playermanagement(QWidget *parent = 0); + ~playermanagement(); + +protected: + void changeEvent(QEvent *e); + +private: + Ui::playermanagement *ui; + QString fileName; + +private slots: + void on_prevWindowButton_clicked(); + void on_saveAndContinue_clicked(); +}; + +#endif // PLAYERMANAGEMENT_H diff --git a/src/playermanagement.ui b/src/playermanagement.ui new file mode 100644 index 0000000..c6ee002 --- /dev/null +++ b/src/playermanagement.ui @@ -0,0 +1,206 @@ + + + playermanagement + + + + 0 + 0 + 800 + 480 + + + + Player Management + + + + + + 0 + 0 + 801 + 441 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 50 + 130 + 161 + 41 + + + + + 22 + + + + FULL NAME + + + + + + 50 + 190 + 161 + 41 + + + + + 22 + + + + GENDER: + + + + + + 50 + 250 + 161 + 41 + + + + + 22 + + + + HCP: + + + + + + 220 + 120 + 541 + 61 + + + + + 18 + + + + + + + 220 + 240 + 181 + 61 + + + + + 18 + + + + + + + 220 + 190 + 181 + 41 + + + + + Male + + + + + Female + + + + + + + 720 + 360 + 64 + 64 + + + + + + + + :/new/images/images/arrow-right-icon_2.png:/new/images/images/arrow-right-icon_2.png + + + + 64 + 64 + + + + true + + + + + + 10 + 360 + 64 + 64 + + + + + + + + :/new/images/images/arrow-left-icon.png:/new/images/images/arrow-left-icon.png + + + + 64 + 64 + + + + true + + + + + + + + 0 + 0 + 800 + 20 + + + + + + + + + + diff --git a/src/resources.qrc b/src/resources.qrc new file mode 100644 index 0000000..b55db82 --- /dev/null +++ b/src/resources.qrc @@ -0,0 +1,17 @@ + + + images/stats-icon.png + images/course-icon.png + images/golf-icon.png + images/arrow-right-icon.png + images/golf-icon_2.png + images/arrow-down-icon.png + images/arrow-left-icon.png + images/arrow-right-icon_2.png + images/arrow-up-icon.png + images/new-player.png + images/edit-course.png + images/edit-player.png + images/new-course.png + + diff --git a/src/ui_basicscorecard.h b/src/ui_basicscorecard.h new file mode 100644 index 0000000..318c091 --- /dev/null +++ b/src/ui_basicscorecard.h @@ -0,0 +1,656 @@ +/******************************************************************************** +** Form generated from reading UI file 'basicscorecard.ui' +** +** Created: Sun 18. Apr 23:30:11 2010 +** by: Qt User Interface Compiler version 4.6.2 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_BASICSCORECARD_H +#define UI_BASICSCORECARD_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_BasicScorecard +{ +public: + QWidget *centralWidget; + QFrame *frame_leaderboard; + QLabel *label_leaderboardHeader; + QLabel *label_leaderboardPlayer1; + QLabel *label_leaderboardPlayer2; + QLabel *label_leaderboardPlayer3; + QLabel *label_leaderboardPlayer4; + QLabel *label_leaderboardHeader_2; + QLabel *label_leaderboardHeader_3; + QLabel *label_leaderboardPlayer1_2; + QLabel *label_leaderboardPlayer1_3; + QLabel *label_leaderboardPlayer2_2; + QLabel *label_leaderboardPlayer2_3; + QLabel *label_leaderboardPlayer3_2; + QLabel *label_leaderboardPlayer3_3; + QLabel *label_leaderboardPlayer4_2; + QLabel *label_leaderboardPlayer4_3; + QFrame *frame_icons; + QPushButton *pushButton_prevCourse; + QPushButton *pushButton_nextCourse; + QFrame *frame_courseInformation; + QLabel *label_course; + QFrame *frame_white; + QFrame *frame_yellow; + QLabel *label_white; + QLabel *label_yellow; + QLabel *label_red; + QFrame *frame_red; + QLabel *label_blue; + QFrame *frame_blue; + QLabel *label_par; + QLabel *label_par_const; + QLabel *label_hcp; + QLabel *label_hcp_const; + QPushButton *courseMap; + QLabel *label_player1; + QLabel *label_player2; + QLabel *label_player3; + QLabel *label_player4; + QLabel *label_player1_score; + QLabel *label_player2_score; + QLabel *label_player3_score; + QLabel *label_player4_score; + QPushButton *player1_up; + QPushButton *player1_down; + QPushButton *player2_down; + QPushButton *player3_down; + QPushButton *player4_down; + QPushButton *player2_up; + QPushButton *player3_up; + QPushButton *player4_up; + QMenuBar *menuBar; + QToolBar *mainToolBar; + QStatusBar *statusBar; + + void setupUi(QMainWindow *BasicScorecard) + { + if (BasicScorecard->objectName().isEmpty()) + BasicScorecard->setObjectName(QString::fromUtf8("BasicScorecard")); + BasicScorecard->resize(800, 480); + centralWidget = new QWidget(BasicScorecard); + centralWidget->setObjectName(QString::fromUtf8("centralWidget")); + frame_leaderboard = new QFrame(centralWidget); + frame_leaderboard->setObjectName(QString::fromUtf8("frame_leaderboard")); + frame_leaderboard->setGeometry(QRect(0, 0, 320, 175)); + frame_leaderboard->setStyleSheet(QString::fromUtf8("QFrame#frame_leaderboard\n" +"{\n" +" border: 2px solid;\n" +" border-color: rgb(255, 255, 0);\n" +" \n" +" background-color: rgb(0, 0, 0);\n" +"}")); + frame_leaderboard->setFrameShape(QFrame::StyledPanel); + frame_leaderboard->setFrameShadow(QFrame::Raised); + frame_leaderboard->setLineWidth(1); + frame_leaderboard->setMidLineWidth(0); + label_leaderboardHeader = new QLabel(frame_leaderboard); + label_leaderboardHeader->setObjectName(QString::fromUtf8("label_leaderboardHeader")); + label_leaderboardHeader->setGeometry(QRect(9, 0, 181, 30)); + QFont font; + font.setPointSize(11); + font.setBold(true); + font.setUnderline(true); + font.setWeight(75); + label_leaderboardHeader->setFont(font); + label_leaderboardHeader->setStyleSheet(QString::fromUtf8("QLabel#label_leaderboardHeader\n" +"{\n" +" color: white;\n" +"}")); + label_leaderboardHeader->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter); + label_leaderboardPlayer1 = new QLabel(frame_leaderboard); + label_leaderboardPlayer1->setObjectName(QString::fromUtf8("label_leaderboardPlayer1")); + label_leaderboardPlayer1->setGeometry(QRect(9, 30, 181, 30)); + QFont font1; + font1.setPointSize(11); + font1.setUnderline(false); + label_leaderboardPlayer1->setFont(font1); + label_leaderboardPlayer1->setStyleSheet(QString::fromUtf8("QLabel#label_leaderboardPlayer1\n" +"{\n" +" color: white;\n" +"}")); + label_leaderboardPlayer1->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter); + label_leaderboardPlayer1->setWordWrap(true); + label_leaderboardPlayer2 = new QLabel(frame_leaderboard); + label_leaderboardPlayer2->setObjectName(QString::fromUtf8("label_leaderboardPlayer2")); + label_leaderboardPlayer2->setGeometry(QRect(9, 60, 181, 30)); + label_leaderboardPlayer2->setFont(font1); + label_leaderboardPlayer2->setStyleSheet(QString::fromUtf8("QLabel#label_leaderboardPlayer2\n" +"{\n" +" color: white;\n" +"}")); + label_leaderboardPlayer2->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter); + label_leaderboardPlayer2->setWordWrap(true); + label_leaderboardPlayer3 = new QLabel(frame_leaderboard); + label_leaderboardPlayer3->setObjectName(QString::fromUtf8("label_leaderboardPlayer3")); + label_leaderboardPlayer3->setGeometry(QRect(10, 90, 181, 30)); + label_leaderboardPlayer3->setFont(font1); + label_leaderboardPlayer3->setStyleSheet(QString::fromUtf8("QLabel#label_leaderboardPlayer3\n" +"{\n" +" color: white;\n" +"}")); + label_leaderboardPlayer3->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter); + label_leaderboardPlayer3->setWordWrap(true); + label_leaderboardPlayer4 = new QLabel(frame_leaderboard); + label_leaderboardPlayer4->setObjectName(QString::fromUtf8("label_leaderboardPlayer4")); + label_leaderboardPlayer4->setGeometry(QRect(9, 120, 181, 30)); + label_leaderboardPlayer4->setFont(font1); + label_leaderboardPlayer4->setStyleSheet(QString::fromUtf8("QLabel#label_leaderboardPlayer4\n" +"{\n" +" color: white;\n" +"}")); + label_leaderboardPlayer4->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter); + label_leaderboardPlayer4->setWordWrap(true); + label_leaderboardHeader_2 = new QLabel(frame_leaderboard); + label_leaderboardHeader_2->setObjectName(QString::fromUtf8("label_leaderboardHeader_2")); + label_leaderboardHeader_2->setGeometry(QRect(190, 0, 61, 30)); + label_leaderboardHeader_2->setFont(font); + label_leaderboardHeader_2->setStyleSheet(QString::fromUtf8("QLabel#label_leaderboardHeader_2\n" +"{\n" +" color: white;\n" +"}")); + label_leaderboardHeader_2->setAlignment(Qt::AlignCenter); + label_leaderboardHeader_3 = new QLabel(frame_leaderboard); + label_leaderboardHeader_3->setObjectName(QString::fromUtf8("label_leaderboardHeader_3")); + label_leaderboardHeader_3->setGeometry(QRect(251, 0, 61, 30)); + label_leaderboardHeader_3->setFont(font); + label_leaderboardHeader_3->setStyleSheet(QString::fromUtf8("QLabel#label_leaderboardHeader_3\n" +"{\n" +" color: white;\n" +"}")); + label_leaderboardHeader_3->setAlignment(Qt::AlignCenter); + label_leaderboardPlayer1_2 = new QLabel(frame_leaderboard); + label_leaderboardPlayer1_2->setObjectName(QString::fromUtf8("label_leaderboardPlayer1_2")); + label_leaderboardPlayer1_2->setGeometry(QRect(190, 30, 61, 30)); + label_leaderboardPlayer1_2->setFont(font1); + label_leaderboardPlayer1_2->setStyleSheet(QString::fromUtf8("QLabel#label_leaderboardPlayer1_2\n" +"{\n" +" color: white;\n" +"}")); + label_leaderboardPlayer1_2->setAlignment(Qt::AlignCenter); + label_leaderboardPlayer1_3 = new QLabel(frame_leaderboard); + label_leaderboardPlayer1_3->setObjectName(QString::fromUtf8("label_leaderboardPlayer1_3")); + label_leaderboardPlayer1_3->setGeometry(QRect(250, 30, 61, 30)); + label_leaderboardPlayer1_3->setFont(font1); + label_leaderboardPlayer1_3->setStyleSheet(QString::fromUtf8("QLabel#label_leaderboardPlayer1_3\n" +"{\n" +" color: white;\n" +"}")); + label_leaderboardPlayer1_3->setAlignment(Qt::AlignCenter); + label_leaderboardPlayer2_2 = new QLabel(frame_leaderboard); + label_leaderboardPlayer2_2->setObjectName(QString::fromUtf8("label_leaderboardPlayer2_2")); + label_leaderboardPlayer2_2->setGeometry(QRect(190, 60, 61, 30)); + label_leaderboardPlayer2_2->setFont(font1); + label_leaderboardPlayer2_2->setStyleSheet(QString::fromUtf8("QLabel#label_leaderboardPlayer2_2\n" +"{\n" +" color: white;\n" +"}")); + label_leaderboardPlayer2_2->setAlignment(Qt::AlignCenter); + label_leaderboardPlayer2_3 = new QLabel(frame_leaderboard); + label_leaderboardPlayer2_3->setObjectName(QString::fromUtf8("label_leaderboardPlayer2_3")); + label_leaderboardPlayer2_3->setGeometry(QRect(250, 60, 61, 30)); + label_leaderboardPlayer2_3->setFont(font1); + label_leaderboardPlayer2_3->setStyleSheet(QString::fromUtf8("QLabel#label_leaderboardPlayer2_3\n" +"{\n" +" color: white;\n" +"}")); + label_leaderboardPlayer2_3->setAlignment(Qt::AlignCenter); + label_leaderboardPlayer3_2 = new QLabel(frame_leaderboard); + label_leaderboardPlayer3_2->setObjectName(QString::fromUtf8("label_leaderboardPlayer3_2")); + label_leaderboardPlayer3_2->setGeometry(QRect(190, 90, 61, 30)); + label_leaderboardPlayer3_2->setFont(font1); + label_leaderboardPlayer3_2->setStyleSheet(QString::fromUtf8("QLabel#label_leaderboardPlayer3_2\n" +"{\n" +" color: white;\n" +"}")); + label_leaderboardPlayer3_2->setAlignment(Qt::AlignCenter); + label_leaderboardPlayer3_3 = new QLabel(frame_leaderboard); + label_leaderboardPlayer3_3->setObjectName(QString::fromUtf8("label_leaderboardPlayer3_3")); + label_leaderboardPlayer3_3->setGeometry(QRect(250, 90, 61, 30)); + label_leaderboardPlayer3_3->setFont(font1); + label_leaderboardPlayer3_3->setStyleSheet(QString::fromUtf8("QLabel#label_leaderboardPlayer3_3\n" +"{\n" +" color: white;\n" +"}")); + label_leaderboardPlayer3_3->setAlignment(Qt::AlignCenter); + label_leaderboardPlayer4_2 = new QLabel(frame_leaderboard); + label_leaderboardPlayer4_2->setObjectName(QString::fromUtf8("label_leaderboardPlayer4_2")); + label_leaderboardPlayer4_2->setGeometry(QRect(190, 120, 61, 30)); + label_leaderboardPlayer4_2->setFont(font1); + label_leaderboardPlayer4_2->setStyleSheet(QString::fromUtf8("QLabel#label_leaderboardPlayer4_2\n" +"{\n" +" color: white;\n" +"}")); + label_leaderboardPlayer4_2->setAlignment(Qt::AlignCenter); + label_leaderboardPlayer4_3 = new QLabel(frame_leaderboard); + label_leaderboardPlayer4_3->setObjectName(QString::fromUtf8("label_leaderboardPlayer4_3")); + label_leaderboardPlayer4_3->setGeometry(QRect(250, 120, 61, 30)); + label_leaderboardPlayer4_3->setFont(font1); + label_leaderboardPlayer4_3->setStyleSheet(QString::fromUtf8("QLabel#label_leaderboardPlayer4_3\n" +"{\n" +" color: white;\n" +"}")); + label_leaderboardPlayer4_3->setAlignment(Qt::AlignCenter); + frame_icons = new QFrame(centralWidget); + frame_icons->setObjectName(QString::fromUtf8("frame_icons")); + frame_icons->setGeometry(QRect(0, 349, 800, 71)); + frame_icons->setStyleSheet(QString::fromUtf8("QFrame#frame_icons\n" +"{\n" +" border-color: rgb(255, 255, 0);\n" +" \n" +" background-color: rgb(0, 0, 0);\n" +"\n" +"}")); + frame_icons->setFrameShape(QFrame::StyledPanel); + frame_icons->setFrameShadow(QFrame::Raised); + pushButton_prevCourse = new QPushButton(frame_icons); + pushButton_prevCourse->setObjectName(QString::fromUtf8("pushButton_prevCourse")); + pushButton_prevCourse->setGeometry(QRect(10, 10, 111, 51)); + QIcon icon; + icon.addFile(QString::fromUtf8(":/new/images/images/arrow-left-icon.png"), QSize(), QIcon::Normal, QIcon::On); + pushButton_prevCourse->setIcon(icon); + pushButton_prevCourse->setIconSize(QSize(55, 55)); + pushButton_prevCourse->setFlat(true); + pushButton_nextCourse = new QPushButton(frame_icons); + pushButton_nextCourse->setObjectName(QString::fromUtf8("pushButton_nextCourse")); + pushButton_nextCourse->setGeometry(QRect(680, 10, 111, 51)); + QIcon icon1; + icon1.addFile(QString::fromUtf8(":/new/images/images/arrow-right-icon_2.png"), QSize(), QIcon::Normal, QIcon::On); + pushButton_nextCourse->setIcon(icon1); + pushButton_nextCourse->setIconSize(QSize(55, 55)); + pushButton_nextCourse->setFlat(true); + frame_courseInformation = new QFrame(centralWidget); + frame_courseInformation->setObjectName(QString::fromUtf8("frame_courseInformation")); + frame_courseInformation->setGeometry(QRect(0, 174, 320, 175)); + frame_courseInformation->setStyleSheet(QString::fromUtf8("QFrame#frame_courseInformation\n" +"{\n" +" border: 2px solid;\n" +" border-color: rgb(255, 255, 0);\n" +" \n" +" background-color: rgb(0, 0, 0);\n" +"\n" +"}")); + frame_courseInformation->setFrameShape(QFrame::StyledPanel); + frame_courseInformation->setFrameShadow(QFrame::Raised); + frame_courseInformation->setLineWidth(1); + frame_courseInformation->setMidLineWidth(0); + label_course = new QLabel(frame_courseInformation); + label_course->setObjectName(QString::fromUtf8("label_course")); + label_course->setGeometry(QRect(10, 10, 91, 81)); + QFont font2; + font2.setPointSize(44); + font2.setBold(true); + font2.setWeight(75); + label_course->setFont(font2); + label_course->setStyleSheet(QString::fromUtf8("QLabel#label_course\n" +"{\n" +" color: white;\n" +" border: 2px solid;\n" +" border-color: rgb(255, 255, 255);\n" +" \n" +"}")); + label_course->setAlignment(Qt::AlignCenter); + frame_white = new QFrame(frame_courseInformation); + frame_white->setObjectName(QString::fromUtf8("frame_white")); + frame_white->setGeometry(QRect(110, 10, 61, 21)); + frame_white->setStyleSheet(QString::fromUtf8("QFrame#frame_white\n" +"{\n" +" background-color: rgb(255, 255, 255);\n" +"}")); + frame_white->setFrameShape(QFrame::StyledPanel); + frame_white->setFrameShadow(QFrame::Raised); + frame_yellow = new QFrame(frame_courseInformation); + frame_yellow->setObjectName(QString::fromUtf8("frame_yellow")); + frame_yellow->setGeometry(QRect(110, 40, 61, 21)); + frame_yellow->setStyleSheet(QString::fromUtf8("QFrame#frame_yellow\n" +"{\n" +" \n" +" background-color: rgb(255, 255, 0);\n" +"}")); + frame_yellow->setFrameShape(QFrame::StyledPanel); + frame_yellow->setFrameShadow(QFrame::Raised); + label_white = new QLabel(frame_courseInformation); + label_white->setObjectName(QString::fromUtf8("label_white")); + label_white->setGeometry(QRect(180, 10, 61, 21)); + QFont font3; + font3.setPointSize(13); + font3.setBold(true); + font3.setWeight(75); + label_white->setFont(font3); + label_white->setStyleSheet(QString::fromUtf8("QLabel#label_white\n" +"{\n" +" color: white;\n" +"}")); + label_yellow = new QLabel(frame_courseInformation); + label_yellow->setObjectName(QString::fromUtf8("label_yellow")); + label_yellow->setGeometry(QRect(180, 40, 61, 21)); + label_yellow->setFont(font3); + label_yellow->setStyleSheet(QString::fromUtf8("QLabel#label_yellow\n" +"{\n" +" color: white;\n" +"}")); + label_red = new QLabel(frame_courseInformation); + label_red->setObjectName(QString::fromUtf8("label_red")); + label_red->setGeometry(QRect(180, 100, 61, 21)); + label_red->setFont(font3); + label_red->setStyleSheet(QString::fromUtf8("QLabel#label_red\n" +"{\n" +" color: white;\n" +"}")); + frame_red = new QFrame(frame_courseInformation); + frame_red->setObjectName(QString::fromUtf8("frame_red")); + frame_red->setGeometry(QRect(110, 100, 61, 21)); + frame_red->setStyleSheet(QString::fromUtf8("QFrame#frame_red\n" +"{\n" +" \n" +" background-color: rgb(255, 0, 0);\n" +"}")); + frame_red->setFrameShape(QFrame::StyledPanel); + frame_red->setFrameShadow(QFrame::Raised); + label_blue = new QLabel(frame_courseInformation); + label_blue->setObjectName(QString::fromUtf8("label_blue")); + label_blue->setGeometry(QRect(180, 70, 61, 21)); + label_blue->setFont(font3); + label_blue->setStyleSheet(QString::fromUtf8("QLabel#label_blue\n" +"{\n" +" color: white;\n" +"}")); + frame_blue = new QFrame(frame_courseInformation); + frame_blue->setObjectName(QString::fromUtf8("frame_blue")); + frame_blue->setGeometry(QRect(110, 70, 61, 21)); + frame_blue->setStyleSheet(QString::fromUtf8("QFrame#frame_blue\n" +"{\n" +" \n" +" background-color: rgb(0, 0, 255);\n" +"}")); + frame_blue->setFrameShape(QFrame::StyledPanel); + frame_blue->setFrameShadow(QFrame::Raised); + label_par = new QLabel(frame_courseInformation); + label_par->setObjectName(QString::fromUtf8("label_par")); + label_par->setGeometry(QRect(70, 100, 41, 21)); + QFont font4; + font4.setPointSize(18); + font4.setBold(true); + font4.setWeight(75); + label_par->setFont(font4); + label_par->setStyleSheet(QString::fromUtf8("QLabel#label_par\n" +"{\n" +" color: white;\n" +"}")); + label_par_const = new QLabel(frame_courseInformation); + label_par_const->setObjectName(QString::fromUtf8("label_par_const")); + label_par_const->setGeometry(QRect(10, 100, 51, 21)); + label_par_const->setFont(font4); + label_par_const->setStyleSheet(QString::fromUtf8("QLabel#label_par_const\n" +"{\n" +" color: white;\n" +"}")); + label_hcp = new QLabel(frame_courseInformation); + label_hcp->setObjectName(QString::fromUtf8("label_hcp")); + label_hcp->setGeometry(QRect(70, 130, 41, 21)); + label_hcp->setFont(font4); + label_hcp->setStyleSheet(QString::fromUtf8("QLabel#label_hcp\n" +"{\n" +" color: white;\n" +"}")); + label_hcp_const = new QLabel(frame_courseInformation); + label_hcp_const->setObjectName(QString::fromUtf8("label_hcp_const")); + label_hcp_const->setGeometry(QRect(10, 130, 51, 21)); + label_hcp_const->setFont(font4); + label_hcp_const->setStyleSheet(QString::fromUtf8("QLabel#label_hcp_const\n" +"{\n" +" color: white;\n" +"}")); + courseMap = new QPushButton(frame_courseInformation); + courseMap->setObjectName(QString::fromUtf8("courseMap")); + courseMap->setGeometry(QRect(230, 20, 81, 61)); + QIcon icon2; + icon2.addFile(QString::fromUtf8(":/new/images/images/golf-icon_2.png"), QSize(), QIcon::Normal, QIcon::On); + courseMap->setIcon(icon2); + courseMap->setIconSize(QSize(80, 80)); + courseMap->setFlat(true); + label_player1 = new QLabel(centralWidget); + label_player1->setObjectName(QString::fromUtf8("label_player1")); + label_player1->setGeometry(QRect(320, 0, 120, 30)); + label_player1->setStyleSheet(QString::fromUtf8("QLabel#label_player1\n" +"{\n" +" border: 2px solid;\n" +" border-color: rgb(255, 255, 0);\n" +" color: white;\n" +" background-color: rgb(0, 0, 0);\n" +"}")); + label_player1->setAlignment(Qt::AlignCenter); + label_player1->setWordWrap(true); + label_player2 = new QLabel(centralWidget); + label_player2->setObjectName(QString::fromUtf8("label_player2")); + label_player2->setGeometry(QRect(440, 0, 120, 30)); + label_player2->setStyleSheet(QString::fromUtf8("QLabel#label_player2\n" +"{\n" +" border: 2px solid;\n" +" border-color: rgb(255, 255, 0);\n" +" color: white;\n" +" background-color: rgb(0, 0, 0);\n" +"}")); + label_player2->setAlignment(Qt::AlignCenter); + label_player2->setWordWrap(true); + label_player3 = new QLabel(centralWidget); + label_player3->setObjectName(QString::fromUtf8("label_player3")); + label_player3->setGeometry(QRect(560, 0, 120, 30)); + label_player3->setStyleSheet(QString::fromUtf8("QLabel#label_player3\n" +"{\n" +" border: 2px solid;\n" +" border-color: rgb(255, 255, 0);\n" +" color: white;\n" +" background-color: rgb(0, 0, 0);\n" +"}")); + label_player3->setAlignment(Qt::AlignCenter); + label_player3->setWordWrap(true); + label_player4 = new QLabel(centralWidget); + label_player4->setObjectName(QString::fromUtf8("label_player4")); + label_player4->setGeometry(QRect(680, 0, 120, 30)); + label_player4->setStyleSheet(QString::fromUtf8("QLabel#label_player4\n" +"{\n" +" border: 2px solid;\n" +" border-color: rgb(255, 255, 0);\n" +" color: white;\n" +" background-color: rgb(0, 0, 0);\n" +"}")); + label_player4->setAlignment(Qt::AlignCenter); + label_player4->setWordWrap(true); + label_player1_score = new QLabel(centralWidget); + label_player1_score->setObjectName(QString::fromUtf8("label_player1_score")); + label_player1_score->setGeometry(QRect(320, 30, 121, 319)); + QFont font5; + font5.setPointSize(45); + label_player1_score->setFont(font5); + label_player1_score->setStyleSheet(QString::fromUtf8("QLabel#label_player1_score\n" +"{\n" +" border: 2px solid;\n" +" border-color: rgb(255, 255, 0);\n" +" color: white;\n" +" background-color: rgb(0, 0, 0);\n" +"}")); + label_player1_score->setAlignment(Qt::AlignCenter); + label_player2_score = new QLabel(centralWidget); + label_player2_score->setObjectName(QString::fromUtf8("label_player2_score")); + label_player2_score->setGeometry(QRect(440, 30, 121, 319)); + label_player2_score->setFont(font5); + label_player2_score->setStyleSheet(QString::fromUtf8("QLabel#label_player2_score\n" +"{\n" +" border: 2px solid;\n" +" border-color: rgb(255, 255, 0);\n" +" color: white;\n" +" background-color: rgb(0, 0, 0);\n" +"}")); + label_player2_score->setAlignment(Qt::AlignCenter); + label_player3_score = new QLabel(centralWidget); + label_player3_score->setObjectName(QString::fromUtf8("label_player3_score")); + label_player3_score->setGeometry(QRect(560, 30, 121, 319)); + label_player3_score->setFont(font5); + label_player3_score->setStyleSheet(QString::fromUtf8("QLabel#label_player3_score\n" +"{\n" +" border: 2px solid;\n" +" border-color: rgb(255, 255, 0);\n" +" color: white;\n" +" background-color: rgb(0, 0, 0);\n" +"}")); + label_player3_score->setAlignment(Qt::AlignCenter); + label_player4_score = new QLabel(centralWidget); + label_player4_score->setObjectName(QString::fromUtf8("label_player4_score")); + label_player4_score->setGeometry(QRect(680, 30, 121, 319)); + label_player4_score->setFont(font5); + label_player4_score->setStyleSheet(QString::fromUtf8("QLabel#label_player4_score\n" +"{\n" +" border: 2px solid;\n" +" border-color: rgb(255, 255, 0);\n" +" color: white;\n" +" background-color: rgb(0, 0, 0);\n" +"}")); + label_player4_score->setAlignment(Qt::AlignCenter); + player1_up = new QPushButton(centralWidget); + player1_up->setObjectName(QString::fromUtf8("player1_up")); + player1_up->setGeometry(QRect(330, 60, 101, 71)); + QIcon icon3; + icon3.addFile(QString::fromUtf8(":/new/images/images/arrow-up-icon.png"), QSize(), QIcon::Normal, QIcon::On); + player1_up->setIcon(icon3); + player1_up->setIconSize(QSize(64, 64)); + player1_up->setFlat(true); + player1_down = new QPushButton(centralWidget); + player1_down->setObjectName(QString::fromUtf8("player1_down")); + player1_down->setGeometry(QRect(330, 250, 101, 71)); + QIcon icon4; + icon4.addFile(QString::fromUtf8(":/new/images/images/arrow-down-icon.png"), QSize(), QIcon::Normal, QIcon::On); + player1_down->setIcon(icon4); + player1_down->setIconSize(QSize(64, 64)); + player1_down->setFlat(true); + player2_down = new QPushButton(centralWidget); + player2_down->setObjectName(QString::fromUtf8("player2_down")); + player2_down->setGeometry(QRect(450, 250, 101, 71)); + player2_down->setIcon(icon4); + player2_down->setIconSize(QSize(64, 64)); + player2_down->setFlat(true); + player3_down = new QPushButton(centralWidget); + player3_down->setObjectName(QString::fromUtf8("player3_down")); + player3_down->setGeometry(QRect(570, 250, 101, 71)); + player3_down->setIcon(icon4); + player3_down->setIconSize(QSize(64, 64)); + player3_down->setFlat(true); + player4_down = new QPushButton(centralWidget); + player4_down->setObjectName(QString::fromUtf8("player4_down")); + player4_down->setGeometry(QRect(690, 250, 101, 71)); + player4_down->setIcon(icon4); + player4_down->setIconSize(QSize(64, 64)); + player4_down->setFlat(true); + player2_up = new QPushButton(centralWidget); + player2_up->setObjectName(QString::fromUtf8("player2_up")); + player2_up->setGeometry(QRect(450, 60, 101, 71)); + player2_up->setIcon(icon3); + player2_up->setIconSize(QSize(64, 64)); + player2_up->setFlat(true); + player3_up = new QPushButton(centralWidget); + player3_up->setObjectName(QString::fromUtf8("player3_up")); + player3_up->setGeometry(QRect(570, 60, 101, 71)); + player3_up->setIcon(icon3); + player3_up->setIconSize(QSize(64, 64)); + player3_up->setFlat(true); + player4_up = new QPushButton(centralWidget); + player4_up->setObjectName(QString::fromUtf8("player4_up")); + player4_up->setGeometry(QRect(690, 60, 101, 71)); + player4_up->setIcon(icon3); + player4_up->setIconSize(QSize(64, 64)); + player4_up->setFlat(true); + BasicScorecard->setCentralWidget(centralWidget); + menuBar = new QMenuBar(BasicScorecard); + menuBar->setObjectName(QString::fromUtf8("menuBar")); + menuBar->setGeometry(QRect(0, 0, 800, 20)); + BasicScorecard->setMenuBar(menuBar); + mainToolBar = new QToolBar(BasicScorecard); + mainToolBar->setObjectName(QString::fromUtf8("mainToolBar")); + BasicScorecard->addToolBar(Qt::TopToolBarArea, mainToolBar); + statusBar = new QStatusBar(BasicScorecard); + statusBar->setObjectName(QString::fromUtf8("statusBar")); + BasicScorecard->setStatusBar(statusBar); + + retranslateUi(BasicScorecard); + + QMetaObject::connectSlotsByName(BasicScorecard); + } // setupUi + + void retranslateUi(QMainWindow *BasicScorecard) + { + BasicScorecard->setWindowTitle(QApplication::translate("BasicScorecard", "BasicScorecard", 0, QApplication::UnicodeUTF8)); + label_leaderboardHeader->setText(QApplication::translate("BasicScorecard", "LEADERBOARD", 0, QApplication::UnicodeUTF8)); + label_leaderboardPlayer1->setText(QApplication::translate("BasicScorecard", "PLAYER 1", 0, QApplication::UnicodeUTF8)); + label_leaderboardPlayer2->setText(QApplication::translate("BasicScorecard", "PLAYER 2", 0, QApplication::UnicodeUTF8)); + label_leaderboardPlayer3->setText(QApplication::translate("BasicScorecard", "PLAYER 3", 0, QApplication::UnicodeUTF8)); + label_leaderboardPlayer4->setText(QApplication::translate("BasicScorecard", "PLAYER 4", 0, QApplication::UnicodeUTF8)); + label_leaderboardHeader_2->setText(QApplication::translate("BasicScorecard", "S", 0, QApplication::UnicodeUTF8)); + label_leaderboardHeader_3->setText(QApplication::translate("BasicScorecard", "HCP", 0, QApplication::UnicodeUTF8)); + label_leaderboardPlayer1_2->setText(QApplication::translate("BasicScorecard", "PAR", 0, QApplication::UnicodeUTF8)); + label_leaderboardPlayer1_3->setText(QApplication::translate("BasicScorecard", "PAR", 0, QApplication::UnicodeUTF8)); + label_leaderboardPlayer2_2->setText(QApplication::translate("BasicScorecard", "PAR", 0, QApplication::UnicodeUTF8)); + label_leaderboardPlayer2_3->setText(QApplication::translate("BasicScorecard", "PAR", 0, QApplication::UnicodeUTF8)); + label_leaderboardPlayer3_2->setText(QApplication::translate("BasicScorecard", "PAR", 0, QApplication::UnicodeUTF8)); + label_leaderboardPlayer3_3->setText(QApplication::translate("BasicScorecard", "PAR", 0, QApplication::UnicodeUTF8)); + label_leaderboardPlayer4_2->setText(QApplication::translate("BasicScorecard", "PAR", 0, QApplication::UnicodeUTF8)); + label_leaderboardPlayer4_3->setText(QApplication::translate("BasicScorecard", "PAR", 0, QApplication::UnicodeUTF8)); + pushButton_prevCourse->setText(QString()); + pushButton_nextCourse->setText(QString()); + label_course->setText(QApplication::translate("BasicScorecard", "1", 0, QApplication::UnicodeUTF8)); + label_white->setText(QApplication::translate("BasicScorecard", "350", 0, QApplication::UnicodeUTF8)); + label_yellow->setText(QApplication::translate("BasicScorecard", "323", 0, QApplication::UnicodeUTF8)); + label_red->setText(QApplication::translate("BasicScorecard", "298", 0, QApplication::UnicodeUTF8)); + label_blue->setText(QApplication::translate("BasicScorecard", "256", 0, QApplication::UnicodeUTF8)); + label_par->setText(QApplication::translate("BasicScorecard", "4", 0, QApplication::UnicodeUTF8)); + label_par_const->setText(QApplication::translate("BasicScorecard", "PAR", 0, QApplication::UnicodeUTF8)); + label_hcp->setText(QApplication::translate("BasicScorecard", "13", 0, QApplication::UnicodeUTF8)); + label_hcp_const->setText(QApplication::translate("BasicScorecard", "HCP", 0, QApplication::UnicodeUTF8)); + courseMap->setText(QString()); + label_player1->setText(QApplication::translate("BasicScorecard", "Player 1", 0, QApplication::UnicodeUTF8)); + label_player2->setText(QApplication::translate("BasicScorecard", "Player 2", 0, QApplication::UnicodeUTF8)); + label_player3->setText(QApplication::translate("BasicScorecard", "Player 3", 0, QApplication::UnicodeUTF8)); + label_player4->setText(QApplication::translate("BasicScorecard", "Player 4", 0, QApplication::UnicodeUTF8)); + label_player1_score->setText(QApplication::translate("BasicScorecard", "0", 0, QApplication::UnicodeUTF8)); + label_player2_score->setText(QApplication::translate("BasicScorecard", "0", 0, QApplication::UnicodeUTF8)); + label_player3_score->setText(QApplication::translate("BasicScorecard", "0", 0, QApplication::UnicodeUTF8)); + label_player4_score->setText(QApplication::translate("BasicScorecard", "0", 0, QApplication::UnicodeUTF8)); + player1_up->setText(QString()); + player1_down->setText(QString()); + player2_down->setText(QString()); + player3_down->setText(QString()); + player4_down->setText(QString()); + player2_up->setText(QString()); + player3_up->setText(QString()); + player4_up->setText(QString()); + } // retranslateUi + +}; + +namespace Ui { + class BasicScorecard: public Ui_BasicScorecard {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_BASICSCORECARD_H diff --git a/src/ui_mainwindow.h b/src/ui_mainwindow.h new file mode 100644 index 0000000..261d050 --- /dev/null +++ b/src/ui_mainwindow.h @@ -0,0 +1,128 @@ +/******************************************************************************** +** Form generated from reading UI file 'mainwindow.ui' +** +** Created: Wed 28. Apr 21:12:42 2010 +** by: Qt User Interface Compiler version 4.6.2 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_MAINWINDOW_H +#define UI_MAINWINDOW_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_MainWindow +{ +public: + QWidget *centralWidget; + QPushButton *newRoundButton; + QPushButton *courseEditorButton; + QPushButton *statsButton; + QLabel *label; + QLabel *label_2; + QLabel *label_3; + QMenuBar *menuBar; + QToolBar *mainToolBar; + QStatusBar *statusBar; + + void setupUi(QMainWindow *MainWindow) + { + if (MainWindow->objectName().isEmpty()) + MainWindow->setObjectName(QString::fromUtf8("MainWindow")); + MainWindow->resize(800, 480); + MainWindow->setStyleSheet(QString::fromUtf8("")); + centralWidget = new QWidget(MainWindow); + centralWidget->setObjectName(QString::fromUtf8("centralWidget")); + newRoundButton = new QPushButton(centralWidget); + newRoundButton->setObjectName(QString::fromUtf8("newRoundButton")); + newRoundButton->setGeometry(QRect(100, 140, 128, 128)); + QIcon icon; + icon.addFile(QString::fromUtf8(":/new/images/images/golf-icon.png"), QSize(), QIcon::Normal, QIcon::Off); + newRoundButton->setIcon(icon); + newRoundButton->setIconSize(QSize(128, 128)); + newRoundButton->setFlat(true); + courseEditorButton = new QPushButton(centralWidget); + courseEditorButton->setObjectName(QString::fromUtf8("courseEditorButton")); + courseEditorButton->setGeometry(QRect(320, 140, 128, 128)); + QIcon icon1; + icon1.addFile(QString::fromUtf8(":/new/images/images/course-icon.png"), QSize(), QIcon::Normal, QIcon::Off); + courseEditorButton->setIcon(icon1); + courseEditorButton->setIconSize(QSize(128, 128)); + courseEditorButton->setFlat(true); + statsButton = new QPushButton(centralWidget); + statsButton->setObjectName(QString::fromUtf8("statsButton")); + statsButton->setGeometry(QRect(550, 140, 128, 128)); + QIcon icon2; + icon2.addFile(QString::fromUtf8(":/new/images/images/stats-icon.png"), QSize(), QIcon::Normal, QIcon::Off); + statsButton->setIcon(icon2); + statsButton->setIconSize(QSize(128, 128)); + statsButton->setFlat(true); + label = new QLabel(centralWidget); + label->setObjectName(QString::fromUtf8("label")); + label->setGeometry(QRect(100, 280, 131, 41)); + QFont font; + font.setPointSize(19); + label->setFont(font); + label->setAlignment(Qt::AlignHCenter|Qt::AlignTop); + label_2 = new QLabel(centralWidget); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setGeometry(QRect(300, 280, 191, 81)); + label_2->setFont(font); + label_2->setAlignment(Qt::AlignHCenter|Qt::AlignTop); + label_2->setWordWrap(true); + label_3 = new QLabel(centralWidget); + label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setGeometry(QRect(550, 280, 131, 41)); + label_3->setFont(font); + label_3->setAlignment(Qt::AlignHCenter|Qt::AlignTop); + MainWindow->setCentralWidget(centralWidget); + menuBar = new QMenuBar(MainWindow); + menuBar->setObjectName(QString::fromUtf8("menuBar")); + menuBar->setGeometry(QRect(0, 0, 800, 20)); + MainWindow->setMenuBar(menuBar); + mainToolBar = new QToolBar(MainWindow); + mainToolBar->setObjectName(QString::fromUtf8("mainToolBar")); + MainWindow->addToolBar(Qt::TopToolBarArea, mainToolBar); + statusBar = new QStatusBar(MainWindow); + statusBar->setObjectName(QString::fromUtf8("statusBar")); + MainWindow->setStatusBar(statusBar); + + retranslateUi(MainWindow); + + QMetaObject::connectSlotsByName(MainWindow); + } // setupUi + + void retranslateUi(QMainWindow *MainWindow) + { + MainWindow->setWindowTitle(QApplication::translate("MainWindow", "Golf Scorecard", 0, QApplication::UnicodeUTF8)); + newRoundButton->setText(QString()); + courseEditorButton->setText(QString()); + statsButton->setText(QString()); + label->setText(QApplication::translate("MainWindow", "Play!", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("MainWindow", "Player & Course Management", 0, QApplication::UnicodeUTF8)); + label_3->setText(QApplication::translate("MainWindow", "Stats", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class MainWindow: public Ui_MainWindow {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_MAINWINDOW_H diff --git a/src/ui_newround.h b/src/ui_newround.h new file mode 100644 index 0000000..ff23433 --- /dev/null +++ b/src/ui_newround.h @@ -0,0 +1,274 @@ +/******************************************************************************** +** Form generated from reading UI file 'newround.ui' +** +** Created: Wed 28. Apr 22:35:27 2010 +** by: Qt User Interface Compiler version 4.6.2 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_NEWROUND_H +#define UI_NEWROUND_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_newround +{ +public: + QWidget *centralwidget; + QFrame *frame; + QLabel *label_players; + QCheckBox *checkBox_player1; + QCheckBox *checkBox_player2; + QCheckBox *checkBox_player3; + QCheckBox *checkBox_player4; + QComboBox *comboBox_player1; + QComboBox *comboBox_player2; + QComboBox *comboBox_player3; + QComboBox *comboBox_player4; + QPlainTextEdit *hcp_player1; + QComboBox *tee_player1; + QPlainTextEdit *hcp_player2; + QPlainTextEdit *hcp_player3; + QPlainTextEdit *hcp_player4; + QComboBox *tee_player2; + QComboBox *tee_player3; + QComboBox *tee_player4; + QLabel *label_active; + QLabel *label_hcp; + QLabel *label_tee; + QLabel *label_course; + QComboBox *comboBox_course; + QPushButton *pushButton_continue; + QMenuBar *menubar; + QStatusBar *statusbar; + + void setupUi(QMainWindow *newround) + { + if (newround->objectName().isEmpty()) + newround->setObjectName(QString::fromUtf8("newround")); + newround->resize(800, 480); + centralwidget = new QWidget(newround); + centralwidget->setObjectName(QString::fromUtf8("centralwidget")); + frame = new QFrame(centralwidget); + frame->setObjectName(QString::fromUtf8("frame")); + frame->setGeometry(QRect(0, 0, 801, 441)); + frame->setFrameShape(QFrame::StyledPanel); + frame->setFrameShadow(QFrame::Raised); + label_players = new QLabel(frame); + label_players->setObjectName(QString::fromUtf8("label_players")); + label_players->setGeometry(QRect(140, 0, 171, 31)); + QFont font; + font.setPointSize(20); + font.setBold(true); + font.setUnderline(true); + font.setWeight(75); + label_players->setFont(font); + checkBox_player1 = new QCheckBox(frame); + checkBox_player1->setObjectName(QString::fromUtf8("checkBox_player1")); + checkBox_player1->setGeometry(QRect(10, 50, 121, 50)); + QFont font1; + font1.setPointSize(20); + checkBox_player1->setFont(font1); + checkBox_player1->setChecked(true); + checkBox_player2 = new QCheckBox(frame); + checkBox_player2->setObjectName(QString::fromUtf8("checkBox_player2")); + checkBox_player2->setGeometry(QRect(10, 110, 121, 50)); + checkBox_player2->setFont(font1); + checkBox_player3 = new QCheckBox(frame); + checkBox_player3->setObjectName(QString::fromUtf8("checkBox_player3")); + checkBox_player3->setGeometry(QRect(10, 170, 121, 50)); + checkBox_player3->setFont(font1); + checkBox_player4 = new QCheckBox(frame); + checkBox_player4->setObjectName(QString::fromUtf8("checkBox_player4")); + checkBox_player4->setGeometry(QRect(10, 230, 121, 50)); + checkBox_player4->setFont(font1); + comboBox_player1 = new QComboBox(frame); + comboBox_player1->setObjectName(QString::fromUtf8("comboBox_player1")); + comboBox_player1->setEnabled(true); + comboBox_player1->setGeometry(QRect(140, 50, 320, 50)); + comboBox_player2 = new QComboBox(frame); + comboBox_player2->setObjectName(QString::fromUtf8("comboBox_player2")); + comboBox_player2->setEnabled(true); + comboBox_player2->setGeometry(QRect(140, 110, 320, 50)); + comboBox_player3 = new QComboBox(frame); + comboBox_player3->setObjectName(QString::fromUtf8("comboBox_player3")); + comboBox_player3->setEnabled(true); + comboBox_player3->setGeometry(QRect(140, 170, 320, 50)); + comboBox_player4 = new QComboBox(frame); + comboBox_player4->setObjectName(QString::fromUtf8("comboBox_player4")); + comboBox_player4->setEnabled(true); + comboBox_player4->setGeometry(QRect(140, 230, 320, 50)); + hcp_player1 = new QPlainTextEdit(frame); + hcp_player1->setObjectName(QString::fromUtf8("hcp_player1")); + hcp_player1->setEnabled(true); + hcp_player1->setGeometry(QRect(480, 50, 120, 50)); + QFont font2; + font2.setPointSize(20); + font2.setBold(true); + font2.setWeight(75); + hcp_player1->setFont(font2); + hcp_player1->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + hcp_player1->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + tee_player1 = new QComboBox(frame); + tee_player1->setObjectName(QString::fromUtf8("tee_player1")); + tee_player1->setEnabled(true); + tee_player1->setGeometry(QRect(610, 50, 180, 50)); + QFont font3; + font3.setPointSize(22); + font3.setBold(true); + font3.setWeight(75); + tee_player1->setFont(font3); + hcp_player2 = new QPlainTextEdit(frame); + hcp_player2->setObjectName(QString::fromUtf8("hcp_player2")); + hcp_player2->setEnabled(true); + hcp_player2->setGeometry(QRect(480, 110, 120, 50)); + hcp_player2->setFont(font2); + hcp_player2->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + hcp_player2->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + hcp_player3 = new QPlainTextEdit(frame); + hcp_player3->setObjectName(QString::fromUtf8("hcp_player3")); + hcp_player3->setEnabled(true); + hcp_player3->setGeometry(QRect(480, 170, 120, 50)); + hcp_player3->setFont(font2); + hcp_player3->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + hcp_player3->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + hcp_player4 = new QPlainTextEdit(frame); + hcp_player4->setObjectName(QString::fromUtf8("hcp_player4")); + hcp_player4->setEnabled(true); + hcp_player4->setGeometry(QRect(480, 230, 120, 50)); + hcp_player4->setFont(font2); + hcp_player4->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + hcp_player4->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + tee_player2 = new QComboBox(frame); + tee_player2->setObjectName(QString::fromUtf8("tee_player2")); + tee_player2->setEnabled(true); + tee_player2->setGeometry(QRect(610, 110, 180, 50)); + tee_player2->setFont(font3); + tee_player3 = new QComboBox(frame); + tee_player3->setObjectName(QString::fromUtf8("tee_player3")); + tee_player3->setEnabled(true); + tee_player3->setGeometry(QRect(610, 170, 180, 50)); + tee_player3->setFont(font3); + tee_player4 = new QComboBox(frame); + tee_player4->setObjectName(QString::fromUtf8("tee_player4")); + tee_player4->setEnabled(true); + tee_player4->setGeometry(QRect(610, 230, 180, 50)); + tee_player4->setFont(font3); + label_active = new QLabel(frame); + label_active->setObjectName(QString::fromUtf8("label_active")); + label_active->setGeometry(QRect(0, 0, 171, 31)); + label_active->setFont(font); + label_hcp = new QLabel(frame); + label_hcp->setObjectName(QString::fromUtf8("label_hcp")); + label_hcp->setGeometry(QRect(480, 0, 121, 31)); + label_hcp->setFont(font); + label_tee = new QLabel(frame); + label_tee->setObjectName(QString::fromUtf8("label_tee")); + label_tee->setGeometry(QRect(610, 0, 121, 31)); + label_tee->setFont(font); + label_course = new QLabel(frame); + label_course->setObjectName(QString::fromUtf8("label_course")); + label_course->setGeometry(QRect(0, 330, 240, 50)); + QFont font4; + font4.setPointSize(20); + font4.setBold(true); + font4.setUnderline(false); + font4.setWeight(75); + font4.setKerning(true); + label_course->setFont(font4); + comboBox_course = new QComboBox(frame); + comboBox_course->setObjectName(QString::fromUtf8("comboBox_course")); + comboBox_course->setEnabled(true); + comboBox_course->setGeometry(QRect(240, 330, 320, 50)); + pushButton_continue = new QPushButton(frame); + pushButton_continue->setObjectName(QString::fromUtf8("pushButton_continue")); + pushButton_continue->setGeometry(QRect(650, 300, 141, 111)); + QIcon icon; + icon.addFile(QString::fromUtf8(":/new/images/images/arrow-right-icon.png"), QSize(), QIcon::Normal, QIcon::Off); + pushButton_continue->setIcon(icon); + pushButton_continue->setIconSize(QSize(128, 128)); + pushButton_continue->setFlat(true); + newround->setCentralWidget(centralwidget); + menubar = new QMenuBar(newround); + menubar->setObjectName(QString::fromUtf8("menubar")); + menubar->setGeometry(QRect(0, 0, 800, 20)); + newround->setMenuBar(menubar); + statusbar = new QStatusBar(newround); + statusbar->setObjectName(QString::fromUtf8("statusbar")); + newround->setStatusBar(statusbar); + + retranslateUi(newround); + + QMetaObject::connectSlotsByName(newround); + } // setupUi + + void retranslateUi(QMainWindow *newround) + { + newround->setWindowTitle(QApplication::translate("newround", "Select Players & Course", 0, QApplication::UnicodeUTF8)); + label_players->setText(QApplication::translate("newround", "PLAYERS", 0, QApplication::UnicodeUTF8)); + checkBox_player1->setText(QString()); + checkBox_player2->setText(QString()); + checkBox_player3->setText(QString()); + checkBox_player4->setText(QString()); + hcp_player1->setPlainText(QString()); + tee_player1->clear(); + tee_player1->insertItems(0, QStringList() + << QApplication::translate("newround", "White", 0, QApplication::UnicodeUTF8) + << QApplication::translate("newround", "Yellow", 0, QApplication::UnicodeUTF8) + << QApplication::translate("newround", "Blue", 0, QApplication::UnicodeUTF8) + << QApplication::translate("newround", "Red", 0, QApplication::UnicodeUTF8) + ); + tee_player2->clear(); + tee_player2->insertItems(0, QStringList() + << QApplication::translate("newround", "White", 0, QApplication::UnicodeUTF8) + << QApplication::translate("newround", "Yellow", 0, QApplication::UnicodeUTF8) + << QApplication::translate("newround", "Blue", 0, QApplication::UnicodeUTF8) + << QApplication::translate("newround", "Red", 0, QApplication::UnicodeUTF8) + ); + tee_player3->clear(); + tee_player3->insertItems(0, QStringList() + << QApplication::translate("newround", "White", 0, QApplication::UnicodeUTF8) + << QApplication::translate("newround", "Yellow", 0, QApplication::UnicodeUTF8) + << QApplication::translate("newround", "Blue", 0, QApplication::UnicodeUTF8) + << QApplication::translate("newround", "Red", 0, QApplication::UnicodeUTF8) + ); + tee_player4->clear(); + tee_player4->insertItems(0, QStringList() + << QApplication::translate("newround", "White", 0, QApplication::UnicodeUTF8) + << QApplication::translate("newround", "Yellow", 0, QApplication::UnicodeUTF8) + << QApplication::translate("newround", "Blue", 0, QApplication::UnicodeUTF8) + << QApplication::translate("newround", "Red", 0, QApplication::UnicodeUTF8) + ); + label_active->setText(QApplication::translate("newround", "ACTIVE", 0, QApplication::UnicodeUTF8)); + label_hcp->setText(QApplication::translate("newround", "HCP", 0, QApplication::UnicodeUTF8)); + label_tee->setText(QApplication::translate("newround", "TEE", 0, QApplication::UnicodeUTF8)); + label_course->setText(QApplication::translate("newround", "SELECT COURSE:", 0, QApplication::UnicodeUTF8)); + pushButton_continue->setText(QString()); + } // retranslateUi + +}; + +namespace Ui { + class newround: public Ui_newround {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_NEWROUND_H diff --git a/src/ui_pcmanagement.h b/src/ui_pcmanagement.h new file mode 100644 index 0000000..ce08b80 --- /dev/null +++ b/src/ui_pcmanagement.h @@ -0,0 +1,148 @@ +/******************************************************************************** +** Form generated from reading UI file 'pcmanagement.ui' +** +** Created: Thu 29. Apr 00:07:28 2010 +** by: Qt User Interface Compiler version 4.6.2 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_PCMANAGEMENT_H +#define UI_PCMANAGEMENT_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_PCManagement +{ +public: + QWidget *centralwidget; + QPushButton *addPlayerButton; + QPushButton *editPlayerButton; + QPushButton *addCourseButton; + QPushButton *editCourseButton; + QLabel *label; + QLabel *label_2; + QLabel *label_3; + QLabel *label_4; + QPushButton *prevWindowButton; + QMenuBar *menubar; + QStatusBar *statusbar; + + void setupUi(QMainWindow *PCManagement) + { + if (PCManagement->objectName().isEmpty()) + PCManagement->setObjectName(QString::fromUtf8("PCManagement")); + PCManagement->resize(800, 480); + centralwidget = new QWidget(PCManagement); + centralwidget->setObjectName(QString::fromUtf8("centralwidget")); + addPlayerButton = new QPushButton(centralwidget); + addPlayerButton->setObjectName(QString::fromUtf8("addPlayerButton")); + addPlayerButton->setGeometry(QRect(170, 30, 128, 128)); + QIcon icon; + icon.addFile(QString::fromUtf8(":/new/images/images/new-player.png"), QSize(), QIcon::Normal, QIcon::Off); + addPlayerButton->setIcon(icon); + addPlayerButton->setIconSize(QSize(128, 128)); + addPlayerButton->setFlat(true); + editPlayerButton = new QPushButton(centralwidget); + editPlayerButton->setObjectName(QString::fromUtf8("editPlayerButton")); + editPlayerButton->setGeometry(QRect(170, 220, 128, 128)); + QIcon icon1; + icon1.addFile(QString::fromUtf8(":/new/images/images/edit-player.png"), QSize(), QIcon::Normal, QIcon::Off); + editPlayerButton->setIcon(icon1); + editPlayerButton->setIconSize(QSize(128, 128)); + editPlayerButton->setFlat(true); + addCourseButton = new QPushButton(centralwidget); + addCourseButton->setObjectName(QString::fromUtf8("addCourseButton")); + addCourseButton->setGeometry(QRect(500, 30, 128, 128)); + QIcon icon2; + icon2.addFile(QString::fromUtf8(":/new/images/images/new-course.png"), QSize(), QIcon::Normal, QIcon::Off); + addCourseButton->setIcon(icon2); + addCourseButton->setIconSize(QSize(128, 128)); + addCourseButton->setFlat(true); + editCourseButton = new QPushButton(centralwidget); + editCourseButton->setObjectName(QString::fromUtf8("editCourseButton")); + editCourseButton->setGeometry(QRect(500, 220, 128, 128)); + QIcon icon3; + icon3.addFile(QString::fromUtf8(":/new/images/images/edit-course.png"), QSize(), QIcon::Normal, QIcon::Off); + editCourseButton->setIcon(icon3); + editCourseButton->setIconSize(QSize(128, 128)); + editCourseButton->setFlat(true); + label = new QLabel(centralwidget); + label->setObjectName(QString::fromUtf8("label")); + label->setGeometry(QRect(160, 170, 151, 31)); + QFont font; + font.setPointSize(14); + label->setFont(font); + label->setAlignment(Qt::AlignHCenter|Qt::AlignTop); + label_2 = new QLabel(centralwidget); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setGeometry(QRect(160, 360, 151, 31)); + label_2->setFont(font); + label_2->setAlignment(Qt::AlignHCenter|Qt::AlignTop); + label_3 = new QLabel(centralwidget); + label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setGeometry(QRect(490, 170, 151, 31)); + label_3->setFont(font); + label_3->setAlignment(Qt::AlignHCenter|Qt::AlignTop); + label_4 = new QLabel(centralwidget); + label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setGeometry(QRect(490, 360, 151, 31)); + label_4->setFont(font); + label_4->setAlignment(Qt::AlignHCenter|Qt::AlignTop); + prevWindowButton = new QPushButton(centralwidget); + prevWindowButton->setObjectName(QString::fromUtf8("prevWindowButton")); + prevWindowButton->setGeometry(QRect(10, 360, 64, 64)); + QIcon icon4; + icon4.addFile(QString::fromUtf8(":/new/images/images/arrow-left-icon.png"), QSize(), QIcon::Normal, QIcon::Off); + prevWindowButton->setIcon(icon4); + prevWindowButton->setIconSize(QSize(64, 64)); + prevWindowButton->setFlat(true); + PCManagement->setCentralWidget(centralwidget); + menubar = new QMenuBar(PCManagement); + menubar->setObjectName(QString::fromUtf8("menubar")); + menubar->setGeometry(QRect(0, 0, 800, 20)); + PCManagement->setMenuBar(menubar); + statusbar = new QStatusBar(PCManagement); + statusbar->setObjectName(QString::fromUtf8("statusbar")); + PCManagement->setStatusBar(statusbar); + + retranslateUi(PCManagement); + + QMetaObject::connectSlotsByName(PCManagement); + } // setupUi + + void retranslateUi(QMainWindow *PCManagement) + { + PCManagement->setWindowTitle(QApplication::translate("PCManagement", "Course & Player Management", 0, QApplication::UnicodeUTF8)); + addPlayerButton->setText(QString()); + editPlayerButton->setText(QString()); + addCourseButton->setText(QString()); + editCourseButton->setText(QString()); + label->setText(QApplication::translate("PCManagement", "Create Player", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("PCManagement", "Edit Player", 0, QApplication::UnicodeUTF8)); + label_3->setText(QApplication::translate("PCManagement", "Create Course", 0, QApplication::UnicodeUTF8)); + label_4->setText(QApplication::translate("PCManagement", "Edit Course", 0, QApplication::UnicodeUTF8)); + prevWindowButton->setText(QString()); + } // retranslateUi + +}; + +namespace Ui { + class PCManagement: public Ui_PCManagement {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_PCMANAGEMENT_H diff --git a/src/ui_playermanagement.h b/src/ui_playermanagement.h new file mode 100644 index 0000000..78266a7 --- /dev/null +++ b/src/ui_playermanagement.h @@ -0,0 +1,138 @@ +/******************************************************************************** +** Form generated from reading UI file 'playermanagement.ui' +** +** Created: Thu 29. Apr 00:07:28 2010 +** by: Qt User Interface Compiler version 4.6.2 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_PLAYERMANAGEMENT_H +#define UI_PLAYERMANAGEMENT_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_playermanagement +{ +public: + QWidget *centralwidget; + QFrame *frame; + QLabel *label; + QLabel *label_2; + QLabel *label_3; + QPlainTextEdit *fullName; + QPlainTextEdit *hcp; + QComboBox *gender_comboBox; + QPushButton *saveAndContinue; + QPushButton *prevWindowButton; + QMenuBar *menubar; + QStatusBar *statusbar; + + void setupUi(QMainWindow *playermanagement) + { + if (playermanagement->objectName().isEmpty()) + playermanagement->setObjectName(QString::fromUtf8("playermanagement")); + playermanagement->resize(800, 480); + centralwidget = new QWidget(playermanagement); + centralwidget->setObjectName(QString::fromUtf8("centralwidget")); + frame = new QFrame(centralwidget); + frame->setObjectName(QString::fromUtf8("frame")); + frame->setGeometry(QRect(0, 0, 801, 441)); + frame->setFrameShape(QFrame::StyledPanel); + frame->setFrameShadow(QFrame::Raised); + label = new QLabel(frame); + label->setObjectName(QString::fromUtf8("label")); + label->setGeometry(QRect(50, 130, 161, 41)); + QFont font; + font.setPointSize(22); + label->setFont(font); + label_2 = new QLabel(frame); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setGeometry(QRect(50, 190, 161, 41)); + label_2->setFont(font); + label_3 = new QLabel(frame); + label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setGeometry(QRect(50, 250, 161, 41)); + label_3->setFont(font); + fullName = new QPlainTextEdit(frame); + fullName->setObjectName(QString::fromUtf8("fullName")); + fullName->setGeometry(QRect(220, 120, 541, 61)); + QFont font1; + font1.setPointSize(18); + fullName->setFont(font1); + hcp = new QPlainTextEdit(frame); + hcp->setObjectName(QString::fromUtf8("hcp")); + hcp->setGeometry(QRect(220, 240, 181, 61)); + hcp->setFont(font1); + gender_comboBox = new QComboBox(frame); + gender_comboBox->setObjectName(QString::fromUtf8("gender_comboBox")); + gender_comboBox->setGeometry(QRect(220, 190, 181, 41)); + saveAndContinue = new QPushButton(frame); + saveAndContinue->setObjectName(QString::fromUtf8("saveAndContinue")); + saveAndContinue->setGeometry(QRect(720, 360, 64, 64)); + QIcon icon; + icon.addFile(QString::fromUtf8(":/new/images/images/arrow-right-icon_2.png"), QSize(), QIcon::Normal, QIcon::Off); + saveAndContinue->setIcon(icon); + saveAndContinue->setIconSize(QSize(64, 64)); + saveAndContinue->setFlat(true); + prevWindowButton = new QPushButton(frame); + prevWindowButton->setObjectName(QString::fromUtf8("prevWindowButton")); + prevWindowButton->setGeometry(QRect(10, 360, 64, 64)); + QIcon icon1; + icon1.addFile(QString::fromUtf8(":/new/images/images/arrow-left-icon.png"), QSize(), QIcon::Normal, QIcon::Off); + prevWindowButton->setIcon(icon1); + prevWindowButton->setIconSize(QSize(64, 64)); + prevWindowButton->setFlat(true); + playermanagement->setCentralWidget(centralwidget); + menubar = new QMenuBar(playermanagement); + menubar->setObjectName(QString::fromUtf8("menubar")); + menubar->setGeometry(QRect(0, 0, 800, 20)); + playermanagement->setMenuBar(menubar); + statusbar = new QStatusBar(playermanagement); + statusbar->setObjectName(QString::fromUtf8("statusbar")); + playermanagement->setStatusBar(statusbar); + + retranslateUi(playermanagement); + + QMetaObject::connectSlotsByName(playermanagement); + } // setupUi + + void retranslateUi(QMainWindow *playermanagement) + { + playermanagement->setWindowTitle(QApplication::translate("playermanagement", "Player Management", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("playermanagement", "FULL NAME", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("playermanagement", "GENDER:", 0, QApplication::UnicodeUTF8)); + label_3->setText(QApplication::translate("playermanagement", "HCP:", 0, QApplication::UnicodeUTF8)); + gender_comboBox->clear(); + gender_comboBox->insertItems(0, QStringList() + << QApplication::translate("playermanagement", "Male", 0, QApplication::UnicodeUTF8) + << QApplication::translate("playermanagement", "Female", 0, QApplication::UnicodeUTF8) + ); + saveAndContinue->setText(QString()); + prevWindowButton->setText(QString()); + } // retranslateUi + +}; + +namespace Ui { + class playermanagement: public Ui_playermanagement {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_PLAYERMANAGEMENT_H diff --git a/src/xml/courses/coursedata.xml b/src/xml/courses/coursedata.xml new file mode 100644 index 0000000..a6b696c --- /dev/null +++ b/src/xml/courses/coursedata.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/xml/courses/coursedata_example.xml b/src/xml/courses/coursedata_example.xml new file mode 100644 index 0000000..b6d5cae --- /dev/null +++ b/src/xml/courses/coursedata_example.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/xml/courses/sankivaara-sanki.xml b/src/xml/courses/sankivaara-sanki.xml new file mode 100644 index 0000000..89d2346 --- /dev/null +++ b/src/xml/courses/sankivaara-sanki.xml @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/xml/players/playerdata.xml b/src/xml/players/playerdata.xml new file mode 100644 index 0000000..1b8ba82 --- /dev/null +++ b/src/xml/players/playerdata.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/xmlparser.cpp b/src/xmlparser.cpp new file mode 100644 index 0000000..c3944f4 --- /dev/null +++ b/src/xmlparser.cpp @@ -0,0 +1,245 @@ +#include "xmlparser.h" +#include "datahandling.h" + +#include +#include +#include +#include + +#include + +#define N900 + +xmlparser::xmlparser() +{ + fileName = (QCoreApplication::applicationDirPath() + "/xml/players/playerdata.xml"); + fileNameCourses = (QCoreApplication::applicationDirPath() + "/xml/courses/coursedata.xml"); + + #ifdef N900 + fileName = "/opt/GolfScorecard/xml/players/playerdata.xml"; + fileNameCourses = "/opt/GolfScorecard/xml/courses/coursedata.xml"; + #endif +} + +void xmlparser::loadPlayerXMLFile() +{ + datahandling *playerdata = datahandling::instance(); + + if (fileName.isEmpty()){ + QMessageBox::warning(this, tr("Player file"), + tr("EMPTY! Cannot read file.")); + + } + + QFile file(fileName); + + if (!file.open(QFile::ReadOnly | QFile::Text)) { + QMessageBox::warning(this, tr("Player file"), + tr("Cannot read file %1:\n%2.") + .arg(fileName) + .arg(file.errorString())); + + } + + QDomDocument doc("Players"); + + if( !doc.setContent( &file ) ) + { + file.close(); + QMessageBox::warning(this, tr("Parsing failed"), tr("Parsing failed totally")); + } + file.close(); + + QDomElement root = doc.documentElement(); + if( root.tagName() != "players" ) + QMessageBox::warning(this, tr("No root found!"), tr("There was no root in XML found!")); + + QDomElement child = root.firstChildElement("player"); + while (!child.isNull()) + { + playerdata->addPlayer(child.attribute("name",""),child.attribute("hcp",""),child.attribute("gender", "")); + child = child.nextSiblingElement("player"); + } +} + +void xmlparser::loadCourseXMLFile() +{ + datahandling *coursedata = datahandling::instance(); + + if (fileNameCourses.isEmpty()){ + QMessageBox::warning(this, tr("Course file"), + tr("EMPTY! Cannot read file.")); + + } + + QFile file(fileNameCourses); + + if (!file.open(QFile::ReadOnly | QFile::Text)) { + QMessageBox::warning(this, tr("Course file"), + tr("Cannot read file %1:\n%2.") + .arg(fileNameCourses) + .arg(file.errorString())); + + } + + QDomDocument doc("Courses"); + + if( !doc.setContent( &file ) ) + { + file.close(); + QMessageBox::warning(this, tr("Parsing failed"), tr("Parsing failed totally")); + } + file.close(); + + QDomElement root = doc.documentElement(); + if( root.tagName() != "courses" ) + QMessageBox::warning(this, tr("No root found!"), tr("There was no root in XML found!")); + + QDomElement child = root.firstChildElement("course"); + while (!child.isNull()) + { + coursedata->addCourses(child.attribute("name", ""), child.attribute("course_file", "")); + child = child.nextSiblingElement("course"); + } +} + +void xmlparser::parseSelectedCourse() +{ + datahandling *coursedata = datahandling::instance(); + QString selectedCourse = (QCoreApplication::applicationDirPath() + "/xml/courses/" + coursedata->selectedCourse); + + #ifdef N900 + selectedCourse = ("/opt/GolfScorecard/xml/courses/" + coursedata->selectedCourse); + #endif + + if (selectedCourse.isEmpty()){ + QMessageBox::warning(this, tr("Course file"), + tr("EMPTY! Cannot read file.")); + + } + + QFile file(selectedCourse); + + if (!file.open(QFile::ReadOnly | QFile::Text)) { + QMessageBox::warning(this, tr("Course file"), + tr("Cannot read file %1:\n%2.") + .arg(selectedCourse) + .arg(file.errorString())); + } + + QDomDocument doc("Courses"); + + if( !doc.setContent( &file ) ) + { + file.close(); + QMessageBox::warning(this, tr("Parsing failed"), tr("Parsing failed totally")); + } + file.close(); + + QDomElement root = doc.documentElement(); + if( root.tagName() != "courses" ) + QMessageBox::warning(this, tr("No root found!"), tr("There was no root in XML found!")); + + QDomElement course = root.firstChildElement("course"); + QDomElement cr = course.firstChildElement("cr"); + QDomElement male = cr.firstChildElement("male"); + QDomElement female = cr.firstChildElement("female"); + QDomElement slope = course.firstChildElement("slope"); + QDomElement hole = course.firstChildElement("hole"); + + QDomElement white = hole.firstChildElement("white"); + QDomElement yellow = hole.firstChildElement("yellow"); + QDomElement blue = hole.firstChildElement("blue"); + QDomElement red = hole.firstChildElement("red"); + QDomElement green = hole.firstChildElement("green"); + + + + while (!course.isNull()) + { + coursedata->addCourseData(course.attribute("name", ""), course.attribute("par", ""), + course.attribute("latitude", "").toDouble(), course.attribute("longitude", "").toDouble(), + course.attribute("country", ""), course.attribute("city", "")); + while (!cr.isNull()) + { + while (!male.isNull()) + { + coursedata->addCourseCrMale(male.attribute("white", "").toDouble(), male.attribute("yellow", "").toDouble(), + male.attribute("blue", "").toDouble(), male.attribute("red", "").toDouble()); + male = male.nextSiblingElement("male"); + } + + while (!female.isNull()) + { + coursedata->addCourseCrFemale(female.attribute("yellow", "").toDouble(), + female.attribute("blue", "").toDouble(), female.attribute("red", "").toDouble()); + female = female.nextSiblingElement("female"); + } + cr = cr.nextSiblingElement("cr"); + } + + male = slope.firstChildElement("male"); + female = slope.firstChildElement("female"); + + while (!slope.isNull()) + { + while (!male.isNull()) + { + coursedata->addCourseSlopeMale(male.attribute("white", "").toDouble(), male.attribute("yellow", "").toDouble(), + male.attribute("blue", "").toDouble(), male.attribute("red", "").toDouble()); + male = male.nextSiblingElement("male"); + } + + while (!female.isNull()) + { + coursedata->addCourseSlopeFemale(female.attribute("yellow", "").toDouble(), + female.attribute("blue", "").toDouble(), female.attribute("red", "").toDouble()); + female = female.nextSiblingElement("female"); + } + slope = slope.nextSiblingElement("slope"); + } + + while (!hole.isNull()) + { + coursedata->addHoleData(hole.attribute("id", ""), hole.attribute("hcp", ""), + hole.attribute("par", ""), hole.attribute("map_uri", "")); + while (!white.isNull()) + { + coursedata->addWhiteTee(white.attribute("length", ""), + white.attribute("latitude", "").toDouble(), white.attribute("longitude", "").toDouble()); + white = white.nextSiblingElement("white"); + } + while (!yellow.isNull()) + { + coursedata->addYellowTee(yellow.attribute("length", ""), + yellow.attribute("latitude", "").toDouble(), yellow.attribute("longitude", "").toDouble()); + yellow = yellow.nextSiblingElement("yellow"); + } + while (!blue.isNull()) + { + coursedata->addBlueTee(blue.attribute("length", ""), + blue.attribute("latitude", "").toDouble(), blue.attribute("longitude", "").toDouble()); + blue = blue.nextSiblingElement("blue"); + } + while (!red.isNull()) + { + coursedata->addRedTee(red.attribute("length", ""), + red.attribute("latitude", "").toDouble(), red.attribute("longitude", "").toDouble()); + red = red.nextSiblingElement("red"); + } + while (!green.isNull()) + { + coursedata->addGreenInfo(green.attribute("latitude", "").toDouble(), green.attribute("longitude", "").toDouble()); + green = green.nextSiblingElement("green"); + } + + hole = hole.nextSiblingElement("hole"); + white = hole.firstChildElement("white"); + yellow = hole.firstChildElement("yellow"); + blue = hole.firstChildElement("blue"); + red = hole.firstChildElement("red"); + green = hole.firstChildElement("green"); + } + course = course.nextSiblingElement("course"); + } +} diff --git a/src/xmlparser.h b/src/xmlparser.h new file mode 100644 index 0000000..2f13bea --- /dev/null +++ b/src/xmlparser.h @@ -0,0 +1,18 @@ +#ifndef XMLPARSER_H +#define XMLPARSER_H + +#include + +class xmlparser : public QMainWindow +{ + Q_OBJECT +public: + xmlparser(); + void loadPlayerXMLFile(); + void loadCourseXMLFile(); + void parseSelectedCourse(); + QString fileName; + QString fileNameCourses; +}; + +#endif // XMLPARSER_H