Index: ossp-pkg/as/as-gui/Makefile.in RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/Makefile.in,v rcsdiff -q -kk '-r1.14' '-r1.15' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/Makefile.in,v' 2>/dev/null --- Makefile.in 2002/11/22 11:46:32 1.14 +++ Makefile.in 2002/11/24 17:56:54 1.15 @@ -65,9 +65,9 @@ TARGET_PROGS = titraq TARGET_MANS = titraq.1 titraq.conf.5 -SRCS = main.cpp titraq.cpp titassist.cpp titslot.cpp tidatops.cpp titrex.cpp generic.cpp titraq_version.c +SRCS = main.cpp titraq.cpp titassist.cpp titslot.cpp tidatops.cpp titrex.cpp generic.cpp prefs.cpp titraq_version.c -OBJS = main.o titraq.o titassist.o titslot.o tidatops.o titrex.o generic.o titraq_version.o +OBJS = main.o titraq.o titassist.o titslot.o tidatops.o titrex.o generic.o prefs.o titraq_version.o GRAFX = gfx/ossplogo.xpm Index: ossp-pkg/as/as-gui/TODO RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/TODO,v rcsdiff -q -kk '-r1.11' '-r1.12' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/TODO,v' 2>/dev/null --- TODO 2002/11/22 21:14:27 1.11 +++ TODO 2002/11/24 17:56:54 1.12 @@ -20,6 +20,9 @@ Report errors in all slot code Add preferences file format XML Read username from Betriebsysteme +Rework error handling in prefs +Generally maintain Preference class + Implement missing interface methods Dreams ------ Index: ossp-pkg/as/as-gui/as_assist.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_assist.cpp,v rcsdiff -q -kk '-r1.10' '-r1.11' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_assist.cpp,v' 2>/dev/null --- as_assist.cpp 2002/11/22 21:14:27 1.10 +++ as_assist.cpp 2002/11/24 17:56:54 1.11 @@ -6,6 +6,8 @@ #include #include +#include + // User interface #include "titraq.h" #include "titrex.h" // Exception classes @@ -427,3 +429,19 @@ connect(m_pQuitbutton, SIGNAL(clicked()), qApp, SLOT(quit())); m_pControllayout->addWidget(m_pQuitbutton); } + +// +// Construct the preferences +// +void Titraqform::setupPrefs(void) +{ + m_pPrefs = new Preferences(TITRAQ_PREFNAME, TITRAQ_APPTITLE, TITRAQ_PREFVER); + if (m_pPrefs->fileState()) { // No file was found, so create a new one +std::cout << "Executing if" << std::endl; + m_pPrefs->setString(TITRAQ_PREFASFILE, TITRAQ_DEFASFILE); + m_pPrefs->setString(TITRAQ_PREFSTYLE, TITRAQ_DEFSTYLE); + m_pPrefs->setString(TITRAQ_PREFVIEW, TITRAQ_DEFVIEW); + m_pPrefs->setString(TITRAQ_PREFREMOTELOG, TITRAQ_DEFREMOTELOG); + m_pPrefs->setString(TITRAQ_PREFLOCALLOG, TITRAQ_DEFLOCALLOG); + } +} Index: ossp-pkg/as/as-gui/as_gui.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.cpp,v rcsdiff -q -kk '-r1.17' '-r1.18' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.cpp,v' 2>/dev/null --- as_gui.cpp 2002/11/20 11:06:32 1.17 +++ as_gui.cpp 2002/11/24 17:56:54 1.18 @@ -46,6 +46,7 @@ setupTable(); setupEditlay(); setupButtons(); + setupPrefs(); } catch (Genexcept& Genex) { Genex.reportErr(); Index: ossp-pkg/as/as-gui/as_gui.h RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.h,v rcsdiff -q -kk '-r1.18' '-r1.19' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.h,v' 2>/dev/null --- as_gui.h 2002/11/22 19:42:25 1.18 +++ as_gui.h 2002/11/24 17:56:54 1.19 @@ -16,6 +16,9 @@ #include #include +#include "prefs.h" +#include "titconst.h" + // Intentional no operation #define TITRAQ_NOP ((void)0) @@ -33,6 +36,9 @@ Titraqform(QWidget *pParent = 0, const char *kszName = 0, WFlags Flags = 0); ~Titraqform(void); + // Top level members + Preferences *m_pPrefs; + // Main application actions QAction *m_pFilenewact, *m_pFileopenact; QAction *m_pFilesaveact, *m_pFilesaveasact; @@ -118,6 +124,7 @@ void setupEditlay(void); // Editing lay void setupButtons(void); // Push button widgets void setupPieces(void); // Assemble widget pieces + void setupPrefs(void); // Preferences // Data processing void loadData(QFile &); // Load accounting data from file