Index: ossp-pkg/as/as-gui/TODO RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/TODO,v rcsdiff -q -kk '-r1.86' '-r1.87' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/TODO,v' 2>/dev/null --- TODO 2003/02/13 18:22:32 1.86 +++ TODO 2003/02/14 17:31:54 1.87 @@ -39,6 +39,8 @@ Check for outdated config file version Make status bar message, qWarning, qDebug, and Popup messages consistent For which purposes do messages go in each category? +Label methods and parameters throughout as const ... const, use & +Yank out all #include from headers, replace with class ...; protos Bugs (? = unverified) --------------------- 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.105' '-r1.106' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_assist.cpp,v' 2>/dev/null --- as_assist.cpp 2003/02/14 09:18:25 1.105 +++ as_assist.cpp 2003/02/14 17:31:54 1.106 @@ -50,6 +50,11 @@ #include "as_gui.h" // Main classes #include "as_amount.h" // AmountBox class #include "as_user.h" // User class +#include "as_const.h" // Application constants +#include "as_table.h" // Class TiTable +#include "as_pref.h" // Class Preferences +#include "as_panel.h" // Class Prefpanel +#include "as_datedit.h" // Class Daydateedit // Icon pixel maps #include "as_gfx/filenew.xpm" // static const char *s_kpcFilenew_xpm[] Index: ossp-pkg/as/as-gui/as_dataop.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_dataop.cpp,v rcsdiff -q -kk '-r1.47' '-r1.48' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_dataop.cpp,v' 2>/dev/null --- as_dataop.cpp 2003/02/11 22:17:17 1.47 +++ as_dataop.cpp 2003/02/14 17:31:54 1.48 @@ -40,9 +40,11 @@ // User interface #include "as_gui.h" // Main classes +#include "as_const.h" // Application constants #include "as_tableitem.h" // For class RtTableItem #include "as_crc.h" // For quality strings #include "as_uuid.h" // UUID classes +#include "as_table.h" // TiTable class // Icon pixel maps #include "as_gfx/statok.xpm" // static const char *s_kpcStatokay_xpm[] 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.39' '-r1.40' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.cpp,v' 2>/dev/null --- as_gui.cpp 2003/02/04 19:30:31 1.39 +++ as_gui.cpp 2003/02/14 17:31:54 1.40 @@ -32,6 +32,9 @@ // User interface #include "as_gui.h" // Main classes #include "as_except.h" // Exception classes +#include "as_table.h" // Class TiTable +#include "as_const.h" // Application constants +#include "as_pref.h" // Class Preferences // 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.73' '-r1.74' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.h,v' 2>/dev/null --- as_gui.h 2003/02/13 19:49:02 1.73 +++ as_gui.h 2003/02/14 17:31:54 1.74 @@ -53,17 +53,19 @@ #endif #include "as_except.h" // Exception classes -#include "as_const.h" // For general constants -#include "as_pref.h" // For class Preferences -#include "as_amount.h" // For class AmountBox -#include "as_table.h" // For class TiTable -#include "as_datedit.h" // For class Daydatedit // Version information #define _AS_VERSION_CPP_AS_HEADER_ #include "as_version.cpp" #undef _AS_VERSION_CPP_AS_HEADER_ +// Method prototypes +// class AmountBox; // Warning: Might be replaced with QTimeEdit +class Daydatedit; +class TiTable; +class Preferences; +class Prefpanel; + // Intentional no operation #define TITRAQ_NOP ((void)0) @@ -290,6 +292,8 @@ void showRemarkcol(void); // View menu show Remarks column void genReport(void); // Generate a local formatted report void savePrefs(void); // Save user preferences + void applyPrefs(void); // Apply preferences from applied() + void applyPrefs(Prefpanel *); // Apply preferences from accept() protected: // Application main events Index: ossp-pkg/as/as-gui/as_panel.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_panel.cpp,v rcsdiff -q -kk '-r1.7' '-r1.8' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_panel.cpp,v' 2>/dev/null --- as_panel.cpp 2003/02/13 22:05:30 1.7 +++ as_panel.cpp 2003/02/14 17:31:55 1.8 @@ -208,11 +208,11 @@ m_pVlayout->addLayout(m_pButtlay); // Connect our signals to slots, accept() and reject() are Qt implicit - connect(m_pOkaybutton, SIGNAL(clicked()), this, SLOT(accept())); - connect(m_pApplybutton, SIGNAL(clicked()), this, SLOT(apply())); - connect(m_pCancelbutton, SIGNAL(clicked()), this, SLOT(reject())); - connect(m_pCorbacheck, SIGNAL(toggled(bool)), this, SLOT(enableCorba(bool))); - connect(m_pSoapcheck, SIGNAL(toggled(bool)), this, SLOT(enableSoap(bool))); + connect(m_pOkaybutton, SIGNAL(clicked(void)), SLOT(accept(void))); + connect(m_pApplybutton, SIGNAL(clicked(void)), SIGNAL(applied(void))); + connect(m_pCancelbutton, SIGNAL(clicked(void)), SLOT(reject(void))); + connect(m_pCorbacheck, SIGNAL(toggled(bool)), SLOT(enableCorba(bool))); + connect(m_pSoapcheck, SIGNAL(toggled(bool)), SLOT(enableSoap(bool))); this->textChange(); this->resize(QSize(400, 264).expandedTo(minimumSizeHint())); } @@ -272,12 +272,3 @@ // QToolTip::add(m_pSwitchgroup, tr("Tooltip for Switchbox", "Comment for toolTip Switchbox")); // QWhatsThis::add(m_pSwitchgroup, tr("Whatsthis for Switchbutton", "Comment for whatsThis Switchbox")); } - -// -// Applies changes user selected from this class -// -void Prefpanel::apply(void) -{ - Prototype Unimp; - Unimp.doMbox(); -} Index: ossp-pkg/as/as-gui/as_panel.h RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_panel.h,v rcsdiff -q -kk '-r1.7' '-r1.8' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_panel.h,v' 2>/dev/null --- as_panel.h 2003/02/13 18:22:32 1.7 +++ as_panel.h 2003/02/14 17:31:55 1.8 @@ -128,9 +128,11 @@ protected slots: virtual void textChange(void); - void apply(void); void enableCorba(bool bOn) {m_pCorbaline->setEnabled(bOn);}; void enableSoap(bool bOn) {m_pSoapline->setEnabled(bOn);}; + +signals: + void applied(void); }; #endif // PREFPANEL_H Index: ossp-pkg/as/as-gui/as_slot.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_slot.cpp,v rcsdiff -q -kk '-r1.124' '-r1.125' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_slot.cpp,v' 2>/dev/null --- as_slot.cpp 2003/02/14 09:18:25 1.124 +++ as_slot.cpp 2003/02/14 17:31:55 1.125 @@ -50,14 +50,17 @@ // User interface #include "as_gui.h" // Main classes +#include "as_const.h" // Application constants #include "as_except.h" // Exception classes #include "as_tableitem.h" // For our custom table items #include "as_generic.h" // Generic classes #include "as_uuid.h" // UUID classes #include "as_datedit.h" // Derived from QDateEdit #include "as_crc.h" // Useful Qualistring class +#include "as_pref.h" // For Preferences class #include "as_panel.h" // For Prefpanel class #include "as_sfile.h" // For Simplefile class +#include "as_table.h" // For TiTable class // RPC headers #ifdef HAVE_ESOAP @@ -1123,6 +1126,7 @@ // Create a new preferences panel window pUserpanel = new Prefpanel(this, "Userprefpanel"); + connect(pUserpanel, SIGNAL(applied(void)), SLOT(applyPrefs(void))); // Set default values to appear in initialized panel widgets pUserpanel->setAccounts(m_pPrefs->getString(TITRAQ_PREFACCOUNTS, TITRAQ_DEFACCOUNTS)); @@ -1172,53 +1176,10 @@ } // Modal panel handler - if (pUserpanel->exec() == QDialog::Accepted) { - m_pPrefs->setString(TITRAQ_PREFACCOUNTS, pUserpanel->getAccounts()); - m_pPrefs->setString(TITRAQ_PREFASDIR, pUserpanel->getEvents()); - m_pPrefs->setString(TITRAQ_PREFUSER, pUserpanel->getUser()); - m_pPrefs->setString(TITRAQ_PREFHOME, pUserpanel->getHome()); - m_pPrefs->setString(TITRAQ_PREFCORBHOST, pUserpanel->getCorbahost()); - m_pPrefs->setString(TITRAQ_PREFSOAPHOST, pUserpanel->getSoaphost()); - m_pPrefs->setBool(TITRAQ_PREFCORBON, pUserpanel->getCorbaon()); - m_pPrefs->setBool(TITRAQ_PREFSOAPON, pUserpanel->getSoapon()); - m_pPrefs->setBool(TITRAQ_PREFBAKON, pUserpanel->getBackon()); - m_pPrefs->setBool(TITRAQ_PREFEXTENDON, pUserpanel->getExtendon()); - - // Dim the lights if no RPC transports are available - if (this->isOpen()) - m_pSyncact->setEnabled(m_pPrefs->getBool(TITRAQ_PREFCORBON, TITRAQ_DEFCORBON) - | m_pPrefs->getBool(TITRAQ_PREFSOAPON, TITRAQ_DEFSOAPON)); - else - m_pSyncact->setEnabled(false); + if (pUserpanel->exec() == QDialog::Accepted) + this->applyPrefs(pUserpanel); - // Get the selected style which can be more complicated due to mapping... - if (pUserpanel->getStyle() == TITRAQ_STRCDE) { - m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLECDE); - qApp->setStyle(new QCDEStyle); - } - else if (pUserpanel->getStyle() == TITRAQ_STRSGI) { - m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLESGI); - qApp->setStyle(new QSGIStyle); - } - else if (pUserpanel->getStyle() == TITRAQ_STRMOTIF) { - m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEMOTIF); - qApp->setStyle(new QMotifStyle); - } - else if (pUserpanel->getStyle() == TITRAQ_STRMPLUS) { - m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEMPLUS); - qApp->setStyle(new QMotifPlusStyle); - } - else if (pUserpanel->getStyle() == TITRAQ_STRPLAT) { - m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEPLAT); - qApp->setStyle(new QPlatinumStyle); - } - else if (pUserpanel->getStyle() == TITRAQ_STRMSOFT) { - m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEMSOFT); - qApp->setStyle(new QWindowsStyle); - } - else // My personal favourite ;-) - m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLECDE); - } + // Dispose Panel object delete pUserpanel; } @@ -1890,3 +1851,64 @@ { QMessageBox::aboutQt(this, QString(TITRAQ_APPTITLE) + ' ' + asgui_version.v_short); } + +// +// Apply preference values from a signal emitting object +// +void Titraqform::applyPrefs(void) +{ + Prefpanel *pPan = (Prefpanel *)QObject::sender(); + this->applyPrefs(pPan); +} + +// +// Accept preference values from a inbound Panel object +// +void Titraqform::applyPrefs(Prefpanel *pPrefpanel) +{ + m_pPrefs->setString(TITRAQ_PREFACCOUNTS, pPrefpanel->getAccounts()); + m_pPrefs->setString(TITRAQ_PREFASDIR, pPrefpanel->getEvents()); + m_pPrefs->setString(TITRAQ_PREFUSER, pPrefpanel->getUser()); + m_pPrefs->setString(TITRAQ_PREFHOME, pPrefpanel->getHome()); + m_pPrefs->setString(TITRAQ_PREFCORBHOST, pPrefpanel->getCorbahost()); + m_pPrefs->setString(TITRAQ_PREFSOAPHOST, pPrefpanel->getSoaphost()); + m_pPrefs->setBool(TITRAQ_PREFCORBON, pPrefpanel->getCorbaon()); + m_pPrefs->setBool(TITRAQ_PREFSOAPON, pPrefpanel->getSoapon()); + m_pPrefs->setBool(TITRAQ_PREFBAKON, pPrefpanel->getBackon()); + m_pPrefs->setBool(TITRAQ_PREFEXTENDON, pPrefpanel->getExtendon()); + + // Dim the lights if no RPC transports are available + if (this->isOpen()) + m_pSyncact->setEnabled(m_pPrefs->getBool(TITRAQ_PREFCORBON, TITRAQ_DEFCORBON) + | m_pPrefs->getBool(TITRAQ_PREFSOAPON, TITRAQ_DEFSOAPON)); + else + m_pSyncact->setEnabled(false); + + // Get the selected style which can be more complicated due to mapping... + if (pPrefpanel->getStyle() == TITRAQ_STRCDE) { + m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLECDE); + qApp->setStyle(new QCDEStyle); + } + else if (pPrefpanel->getStyle() == TITRAQ_STRSGI) { + m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLESGI); + qApp->setStyle(new QSGIStyle); + } + else if (pPrefpanel->getStyle() == TITRAQ_STRMOTIF) { + m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEMOTIF); + qApp->setStyle(new QMotifStyle); + } + else if (pPrefpanel->getStyle() == TITRAQ_STRMPLUS) { + m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEMPLUS); + qApp->setStyle(new QMotifPlusStyle); + } + else if (pPrefpanel->getStyle() == TITRAQ_STRPLAT) { + m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEPLAT); + qApp->setStyle(new QPlatinumStyle); + } + else if (pPrefpanel->getStyle() == TITRAQ_STRMSOFT) { + m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEMSOFT); + qApp->setStyle(new QWindowsStyle); + } + else // My personal favourite ;-) + m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLECDE); +} Index: ossp-pkg/as/as-gui/as_table.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_table.cpp,v rcsdiff -q -kk '-r1.20' '-r1.21' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_table.cpp,v' 2>/dev/null --- as_table.cpp 2002/12/20 18:19:12 1.20 +++ as_table.cpp 2003/02/14 17:31:55 1.21 @@ -32,6 +32,8 @@ #include #include "as_gui.h" +#include "as_const.h" +#include "as_table.h" // Implements an event filter for catching header double click events