--- as_slot.cpp 2003/02/11 14:19:57 1.117
+++ as_slot.cpp 2003/02/12 19:33:05 1.118
@@ -1106,15 +1106,77 @@
//
void Titraqform::configPrefs(void)
{
- Prefpanel *pUserpanel = NULL;
+ QString Templine; // Used for preferences resetting
+ Prefpanel *pUserpanel = NULL; // The user preferences panel itself
// Create a new preferences panel window
pUserpanel = new Prefpanel(this, "Userprefpanel");
- // Handle panel modality
+ // Set default values to appear in initialized panel widgets
+ pUserpanel->setAccounts(m_pPrefs->getString(TITRAQ_PREFACCOUNTS, TITRAQ_DEFACCOUNTS));
+ pUserpanel->setEvents(m_pPrefs->getString(TITRAQ_PREFASFILE, TITRAQ_DEFASFILE));
+ pUserpanel->setUser(m_pPrefs->getString(TITRAQ_PREFUSER, TITRAQ_DEFUSER));
+ pUserpanel->setHome(m_pPrefs->getString(TITRAQ_PREFHOME, TITRAQ_DEFHOME));
+ pUserpanel->setCorbahost(m_pPrefs->getString(TITRAQ_PREFCORBHOST, TITRAQ_DEFCORBHOST));
+ pUserpanel->setSoaphost(m_pPrefs->getString(TITRAQ_PREFSOAPHOST, TITRAQ_DEFSOAPHOST));
+ pUserpanel->setCorbaon(m_pPrefs->getBool(TITRAQ_PREFCORBON, TITRAQ_DEFCORBON));
+ pUserpanel->setSoapon(m_pPrefs->getBool(TITRAQ_PREFSOAPON, TITRAQ_DEFSOAPON));
+ pUserpanel->setBackon(m_pPrefs->getBool(TITRAQ_PREFBAKON, TITRAQ_DEFBAKON));
+ pUserpanel->setExtendon(m_pPrefs->getBool(TITRAQ_PREFEXTENDON, TITRAQ_DEFEXTENDON));
+
+ // Set default style which can be more complicated due to mapping...
+ switch (m_pPrefs->getNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLECDE)) {
+ case TITRAQ_STYLECDE:
+ pUserpanel->setStyle(TITRAQ_STRCDE);
+ break;
+ case TITRAQ_STYLESGI:
+ pUserpanel->setStyle(TITRAQ_STRSGI);
+ break;
+ case TITRAQ_STYLEMOTIF:
+ pUserpanel->setStyle(TITRAQ_STRMOTIF);
+ break;
+ case TITRAQ_STYLEMPLUS:
+ pUserpanel->setStyle(TITRAQ_STRMPLUS);
+ break;
+ case TITRAQ_STYLEPLAT:
+ pUserpanel->setStyle(TITRAQ_STRPLAT);
+ break;
+ case TITRAQ_STYLEMSOFT:
+ pUserpanel->setStyle(TITRAQ_STRMSOFT);
+ break;
+ default:
+ pUserpanel->setStyle(TITRAQ_STRCDE); // My personal favourite ;-)
+ break;
+ }
+
+ // Modal panel handler
if (pUserpanel->exec() == QDialog::Accepted) {
-// pvData = pUserpanel->getData();
-// setPrefs(pvData);
+ m_pPrefs->setString(TITRAQ_PREFACCOUNTS, pUserpanel->getAccounts());
+ m_pPrefs->setString(TITRAQ_PREFASFILE, 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());
+
+ // Get the selected style which can be more complicated due to mapping...
+ if (pUserpanel->getStyle() == TITRAQ_STRCDE)
+ m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLECDE);
+ else if (pUserpanel->getStyle() == TITRAQ_STRSGI)
+ m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLESGI);
+ else if (pUserpanel->getStyle() == TITRAQ_STRMOTIF)
+ m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEMOTIF);
+ else if (pUserpanel->getStyle() == TITRAQ_STRMPLUS)
+ m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEMPLUS);
+ else if (pUserpanel->getStyle() == TITRAQ_STRPLAT)
+ m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEPLAT);
+ else if (pUserpanel->getStyle() == TITRAQ_STRMSOFT)
+ m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLEMSOFT);
+ else // My personal favourite ;-)
+ m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLECDE);
}
delete pUserpanel;
}
|