diff -r e8292658d5b3 -r c1941114ca88 as_assist.cpp --- a/as_assist.cpp Fri Nov 28 14:20:00 2008 +0100 +++ b/as_assist.cpp Fri Dec 05 23:14:02 2008 +0100 @@ -1,12 +1,12 @@ // // OSSP asgui - Accounting system graphical user interface -// Copyright (c) 2002-2004 The OSSP Project (http://www.ossp.org/) -// Copyright (c) 2002-2004 Ralf S. Engelschall -// Copyright (c) 2002-2004 Michael Schloh von Bennewitz -// Copyright (c) 2002-2004 Cable & Wireless Telecommunications Services GmbH +// Copyright (c) 2002-2008 The OSSP Project (http://www.ossp.org/) +// Copyright (c) 2002-2008 Ralf S. Engelschall +// Copyright (c) 2002-2008 Michael Schloh von Bennewitz +// Copyright (c) 2002-2008 Cable & Wireless Telecommunications Services GmbH // // This file is part of OSSP asgui, an accounting system graphical user -// interface which can be found at http://www.ossp.org/pkg/tool/asgui/. +// interface which can be found at http://asgui.europalab.com/. // // Permission to use, copy, modify, and distribute this software for // any purpose with or without fee is hereby granted, provided that @@ -29,21 +29,29 @@ // as_assist.cpp: ISO C++ implementation // +#define QT3_SUPPORT + +#include + // Qt style headers #include -#include +#include +#include #include -#include -#include +#include +#include +#include #include +#include +#include // Qt general headers #include -#include +#include #include -#include +#include #include -#include +#include #include #include #include @@ -51,6 +59,14 @@ #include #include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include + // User interface #include "as_amount.h" // AmountBox class #include "as_user.h" // User class @@ -97,8 +113,8 @@ { // Can't bootstrap until we know who is using our tool, so find out User Localuser = User(); - QString Username = Localuser.getName(); - QString Homedir = Localuser.getHomedir(); + QString Username = QString::fromStdString(Localuser.getName()); + QString Homedir = QString::fromStdString(Localuser.getHomedir()); // Bootstrap a user preferences object from operating system info m_pPrefs = new Preferences(Homedir + QChar('/') + @@ -141,7 +157,7 @@ m_pPrefs->setNumber(TITRAQ_PREFDARKGREEN, TITRAQ_DEFDARKGREEN); m_pPrefs->setNumber(TITRAQ_PREFDARKBLUE, TITRAQ_DEFDARKBLUE); m_pPrefs->flush(); // Write the new conf file - QTextStream cerr(stderr, IO_WriteOnly); + Q3TextStream cerr(stderr, QIODevice::WriteOnly); cerr << trUtf8("Created new preferences file ") << Homedir << QChar('/') << QString::fromLocal8Bit(TITRAQ_PREFNAME) << endl; } @@ -151,18 +167,18 @@ case TITRAQ_STYLECDE: qApp->setStyle(new QCDEStyle); break; - case TITRAQ_STYLESGI: - qApp->setStyle(new QSGIStyle); - break; + //case TITRAQ_STYLESGI: // SGI Style is unsupported + // qApp->setStyle(new QSGIStyle); + // break; case TITRAQ_STYLEMOTIF: qApp->setStyle(new QMotifStyle); break; - case TITRAQ_STYLEMPLUS: - qApp->setStyle(new QMotifPlusStyle); - break; - case TITRAQ_STYLEPLAT: - qApp->setStyle(new QPlatinumStyle); - break; + //case TITRAQ_STYLEMPLUS: // MotifPlus Style is unsupported + // qApp->setStyle(new QMotifPlusStyle); + // break; + //case TITRAQ_STYLEPLAT: // Platinum Style is unsupported + // qApp->setStyle(new QPlatinumStyle); + // break; case TITRAQ_STYLEMSOFT: qApp->setStyle(new QWindowsStyle); break; @@ -177,47 +193,47 @@ // void Titraqform::setupActions(void) { - QIconSet Saveiset, Cutiset, Copyiset, Pasteiset; - QIconSet Rowaddiset, Rowdeliset, Refreshiset; - QIconSet Synciset, Reportiset; + QIcon Saveiset, Cutiset, Copyiset, Pasteiset; + QIcon Rowaddiset, Rowdeliset, Refreshiset; + QIcon Synciset, Reportiset; // Construct iconsets to use later for multistate action images - Saveiset.setPixmap(QPixmap(s_kpcFilesave_xpm), QIconSet::Automatic, QIconSet::Normal); - Saveiset.setPixmap(QPixmap(s_kpcDfilesave_xpm), QIconSet::Automatic, QIconSet::Disabled); - Cutiset.setPixmap(QPixmap(s_kpcCut_xpm), QIconSet::Automatic, QIconSet::Normal); - Cutiset.setPixmap(QPixmap(s_kpcDcut_xpm), QIconSet::Automatic, QIconSet::Disabled); - Copyiset.setPixmap(QPixmap(s_kpcCopy_xpm), QIconSet::Automatic, QIconSet::Normal); - Copyiset.setPixmap(QPixmap(s_kpcDcopy_xpm), QIconSet::Automatic, QIconSet::Disabled); - Pasteiset.setPixmap(QPixmap(s_kpcPaste_xpm), QIconSet::Automatic, QIconSet::Normal); - Pasteiset.setPixmap(QPixmap(s_kpcDpaste_xpm), QIconSet::Automatic, QIconSet::Disabled); - Rowaddiset.setPixmap(QPixmap(s_kpcRowadd_xpm), QIconSet::Automatic, QIconSet::Normal); - Rowaddiset.setPixmap(QPixmap(s_kpcDrowadd_xpm), QIconSet::Automatic, QIconSet::Disabled); - Rowdeliset.setPixmap(QPixmap(s_kpcRowdel_xpm), QIconSet::Automatic, QIconSet::Normal); - Rowdeliset.setPixmap(QPixmap(s_kpcDrowdel_xpm), QIconSet::Automatic, QIconSet::Disabled); - Refreshiset.setPixmap(QPixmap(s_kpcRefresh_xpm), QIconSet::Automatic, QIconSet::Normal); - Refreshiset.setPixmap(QPixmap(s_kpcDrefresh_xpm), QIconSet::Automatic, QIconSet::Disabled); - Synciset.setPixmap(QPixmap(s_kpcSync_xpm), QIconSet::Automatic, QIconSet::Normal); - Synciset.setPixmap(QPixmap(s_kpcDsync_xpm), QIconSet::Automatic, QIconSet::Disabled); - Reportiset.setPixmap(QPixmap(s_kpcReport_xpm), QIconSet::Automatic, QIconSet::Normal); - Reportiset.setPixmap(QPixmap(s_kpcDreport_xpm), QIconSet::Automatic, QIconSet::Disabled); + Saveiset.setPixmap(QPixmap(s_kpcFilesave_xpm), QIcon::Automatic, QIcon::Normal); + Saveiset.setPixmap(QPixmap(s_kpcDfilesave_xpm), QIcon::Automatic, QIcon::Disabled); + Cutiset.setPixmap(QPixmap(s_kpcCut_xpm), QIcon::Automatic, QIcon::Normal); + Cutiset.setPixmap(QPixmap(s_kpcDcut_xpm), QIcon::Automatic, QIcon::Disabled); + Copyiset.setPixmap(QPixmap(s_kpcCopy_xpm), QIcon::Automatic, QIcon::Normal); + Copyiset.setPixmap(QPixmap(s_kpcDcopy_xpm), QIcon::Automatic, QIcon::Disabled); + Pasteiset.setPixmap(QPixmap(s_kpcPaste_xpm), QIcon::Automatic, QIcon::Normal); + Pasteiset.setPixmap(QPixmap(s_kpcDpaste_xpm), QIcon::Automatic, QIcon::Disabled); + Rowaddiset.setPixmap(QPixmap(s_kpcRowadd_xpm), QIcon::Automatic, QIcon::Normal); + Rowaddiset.setPixmap(QPixmap(s_kpcDrowadd_xpm), QIcon::Automatic, QIcon::Disabled); + Rowdeliset.setPixmap(QPixmap(s_kpcRowdel_xpm), QIcon::Automatic, QIcon::Normal); + Rowdeliset.setPixmap(QPixmap(s_kpcDrowdel_xpm), QIcon::Automatic, QIcon::Disabled); + Refreshiset.setPixmap(QPixmap(s_kpcRefresh_xpm), QIcon::Automatic, QIcon::Normal); + Refreshiset.setPixmap(QPixmap(s_kpcDrefresh_xpm), QIcon::Automatic, QIcon::Disabled); + Synciset.setPixmap(QPixmap(s_kpcSync_xpm), QIcon::Automatic, QIcon::Normal); + Synciset.setPixmap(QPixmap(s_kpcDsync_xpm), QIcon::Automatic, QIcon::Disabled); + Reportiset.setPixmap(QPixmap(s_kpcReport_xpm), QIcon::Automatic, QIcon::Normal); + Reportiset.setPixmap(QPixmap(s_kpcDreport_xpm), QIcon::Automatic, QIcon::Disabled); // First associate the graphics with MIME types - QMimeSourceFactory::defaultFactory()->setPixmap("osspicon", QPixmap(s_kpcOsspicon_xpm)); - QMimeSourceFactory::defaultFactory()->setPixmap("filenew", QPixmap(s_kpcFilenew_xpm)); - QMimeSourceFactory::defaultFactory()->setPixmap("fileopen", QPixmap(s_kpcFileopen_xpm)); - QMimeSourceFactory::defaultFactory()->setPixmap("filesave", QPixmap(s_kpcFilesave_xpm)); - QMimeSourceFactory::defaultFactory()->setPixmap("cut", QPixmap(s_kpcCut_xpm)); - QMimeSourceFactory::defaultFactory()->setPixmap("copy", QPixmap(s_kpcCopy_xpm)); - QMimeSourceFactory::defaultFactory()->setPixmap("paste", QPixmap(s_kpcPaste_xpm)); - QMimeSourceFactory::defaultFactory()->setPixmap("rowadd", QPixmap(s_kpcRowadd_xpm)); - QMimeSourceFactory::defaultFactory()->setPixmap("rowdel", QPixmap(s_kpcRowdel_xpm)); - QMimeSourceFactory::defaultFactory()->setPixmap("refresh", QPixmap(s_kpcRefresh_xpm)); - QMimeSourceFactory::defaultFactory()->setPixmap("syncrpc", QPixmap(s_kpcSync_xpm)); - QMimeSourceFactory::defaultFactory()->setPixmap("locreport", QPixmap(s_kpcReport_xpm)); - QMimeSourceFactory::defaultFactory()->setPixmap("prefs", QPixmap(s_kpcPrefs_xpm)); + Q3MimeSourceFactory::defaultFactory()->setPixmap("osspicon", QPixmap(s_kpcOsspicon_xpm)); + Q3MimeSourceFactory::defaultFactory()->setPixmap("filenew", QPixmap(s_kpcFilenew_xpm)); + Q3MimeSourceFactory::defaultFactory()->setPixmap("fileopen", QPixmap(s_kpcFileopen_xpm)); + Q3MimeSourceFactory::defaultFactory()->setPixmap("filesave", QPixmap(s_kpcFilesave_xpm)); + Q3MimeSourceFactory::defaultFactory()->setPixmap("cut", QPixmap(s_kpcCut_xpm)); + Q3MimeSourceFactory::defaultFactory()->setPixmap("copy", QPixmap(s_kpcCopy_xpm)); + Q3MimeSourceFactory::defaultFactory()->setPixmap("paste", QPixmap(s_kpcPaste_xpm)); + Q3MimeSourceFactory::defaultFactory()->setPixmap("rowadd", QPixmap(s_kpcRowadd_xpm)); + Q3MimeSourceFactory::defaultFactory()->setPixmap("rowdel", QPixmap(s_kpcRowdel_xpm)); + Q3MimeSourceFactory::defaultFactory()->setPixmap("refresh", QPixmap(s_kpcRefresh_xpm)); + Q3MimeSourceFactory::defaultFactory()->setPixmap("syncrpc", QPixmap(s_kpcSync_xpm)); + Q3MimeSourceFactory::defaultFactory()->setPixmap("locreport", QPixmap(s_kpcReport_xpm)); + Q3MimeSourceFactory::defaultFactory()->setPixmap("prefs", QPixmap(s_kpcPrefs_xpm)); // File new action - m_pFilenewact = new QAction(trUtf8("New File"), QPixmap(s_kpcFilenew_xpm), trUtf8("&New"), CTRL+Key_N, this, "New"); + m_pFilenewact = new Q3Action(trUtf8("New File"), QPixmap(s_kpcFilenew_xpm), trUtf8("&New"), Qt::CTRL+Qt::Key_N, this, "New"); if (m_pFilenewact == NULL) // Sanity check throw Genexcept("Main window file new action creation failed."); connect(m_pFilenewact, SIGNAL(activated()), SLOT(newDoc())); @@ -229,7 +245,7 @@ m_pFilenewact->setWhatsThis(kszFilenewtext); // File open action - m_pFileopenact = new QAction(trUtf8("Open File"), QPixmap(s_kpcFileopen_xpm), trUtf8("&Open..."), CTRL+Key_O, this, "Open"); + m_pFileopenact = new Q3Action(trUtf8("Open File"), QPixmap(s_kpcFileopen_xpm), trUtf8("&Open..."), Qt::CTRL+Qt::Key_O, this, "Open"); if (m_pFileopenact == NULL) // Sanity check throw Genexcept("Main window file open action creation failed."); connect(m_pFileopenact, SIGNAL(activated()), SLOT(openDoc())); @@ -241,7 +257,7 @@ m_pFileopenact->setWhatsThis(kszFileopentext); // File save current action - m_pFilesaveact = new QAction(trUtf8("Save File"), Saveiset, trUtf8("&Save"), CTRL+Key_S, this, "Save"); + m_pFilesaveact = new Q3Action(trUtf8("Save File"), Saveiset, trUtf8("&Save"), Qt::CTRL+Qt::Key_S, this, "Save"); if (m_pFilesaveact == NULL) // Sanity check throw Genexcept("Main window file save action creation failed."); connect(m_pFilesaveact, SIGNAL(activated()), SLOT(saveFile())); @@ -254,26 +270,26 @@ m_pFilesaveact->setWhatsThis(kszFilesavetext); // File save selected action - m_pFilesaveasact = new QAction(trUtf8("Save File As"), trUtf8("Save &As..."), 0, this, "SaveAs"); + m_pFilesaveasact = new Q3Action(trUtf8("Save File As"), trUtf8("Save &As..."), 0, this, "SaveAs"); if (m_pFilesaveasact == NULL) // Sanity check throw Genexcept("Main window file save as action creation failed."); connect(m_pFilesaveasact, SIGNAL(activated()), SLOT(saveAs())); m_pFilesaveasact->setWhatsThis(kszFilesavetext); // File close current action - m_pFilecloseact = new QAction(trUtf8("Close"), trUtf8("&Close"), CTRL+Key_W, this, "Close"); + m_pFilecloseact = new Q3Action(trUtf8("Close"), trUtf8("&Close"), Qt::CTRL+Qt::Key_W, this, "Close"); if (m_pFilecloseact == NULL) // Sanity check throw Genexcept("Main window file close action creation failed."); connect(m_pFilecloseact, SIGNAL(activated()), SLOT(close())); // File quit action - m_pFilequitact = new QAction(trUtf8("Exit"), trUtf8("E&xit"), CTRL+Key_Q, this, "Exit"); + m_pFilequitact = new Q3Action(trUtf8("Exit"), trUtf8("E&xit"), Qt::CTRL+Qt::Key_Q, this, "Exit"); if (m_pFilequitact == NULL) // Sanity check throw Genexcept("Main window file quit action creation failed."); connect(m_pFilequitact, SIGNAL(activated()), SLOT(quitApp())); // Cut action - m_pCutact = new QAction(trUtf8("Cut"), Cutiset, trUtf8("&Cut"), CTRL+Key_X, this, "Cut"); + m_pCutact = new Q3Action(trUtf8("Cut"), Cutiset, trUtf8("&Cut"), Qt::CTRL+Qt::Key_X, this, "Cut"); if (m_pCutact == NULL) // Sanity check throw Genexcept("Main window cut edit action creation failed."); connect(m_pCutact, SIGNAL(activated()), SLOT(cutEntry())); @@ -284,7 +300,7 @@ m_pCutact->setWhatsThis(kszCuttext); // Copy action - m_pCopyact = new QAction(trUtf8("Copy"), Copyiset, trUtf8("&Copy"), CTRL+Key_C, this, "Copy"); + m_pCopyact = new Q3Action(trUtf8("Copy"), Copyiset, trUtf8("&Copy"), Qt::CTRL+Qt::Key_C, this, "Copy"); if (m_pCopyact == NULL) // Sanity check throw Genexcept("Main window copy edit action creation failed."); connect(m_pCopyact, SIGNAL(activated()), SLOT(copyEntry())); @@ -295,7 +311,7 @@ m_pCopyact->setWhatsThis(kszCopytext); // Paste action - m_pPasteact = new QAction(trUtf8("Paste"), Pasteiset, trUtf8("&Paste"), CTRL+Key_V, this, "Paste"); + m_pPasteact = new Q3Action(trUtf8("Paste"), Pasteiset, trUtf8("&Paste"), Qt::CTRL+Qt::Key_V, this, "Paste"); if (m_pPasteact == NULL) // Sanity check throw Genexcept("Main window paste edit action creation failed."); connect(m_pPasteact, SIGNAL(activated()), SLOT(pasteEntry())); @@ -306,7 +322,7 @@ m_pPasteact->setWhatsThis(kszPastetext); // Add data row action - m_pAddrowact = new QAction(trUtf8("Add Entry"), Rowaddiset, trUtf8("&Add entry"), Key_Insert, this, "Addentry"); + m_pAddrowact = new Q3Action(trUtf8("Add Entry"), Rowaddiset, trUtf8("&Add entry"), Qt::Key_Insert, this, "Addentry"); if (m_pAddrowact == NULL) // Sanity check throw Genexcept("Main window add entry action creation failed."); connect(m_pAddrowact, SIGNAL(activated()), SLOT(addEntry())); @@ -317,7 +333,7 @@ m_pAddrowact->setWhatsThis(kszAddrowtext); // Delete data row action - m_pDelrowact = new QAction(trUtf8("Delete Entry"), Rowdeliset, trUtf8("&Delete entry"), Key_Delete, this, "Delentry"); + m_pDelrowact = new Q3Action(trUtf8("Delete Entry"), Rowdeliset, trUtf8("&Delete entry"), Qt::Key_Delete, this, "Delentry"); if (m_pDelrowact == NULL) // Sanity check throw Genexcept("Main window delete entry action creation failed."); connect(m_pDelrowact, SIGNAL(activated()), SLOT(delEntry())); @@ -328,7 +344,7 @@ m_pDelrowact->setWhatsThis(kszDelrowtext); // Refresh data display action - m_pRefreshact = new QAction(trUtf8("Refresh Display"), Refreshiset, trUtf8("&Refresh display"), CTRL+Key_R, this, "Refresh"); + m_pRefreshact = new Q3Action(trUtf8("Refresh Display"), Refreshiset, trUtf8("&Refresh display"), Qt::CTRL+Qt::Key_R, this, "Refresh"); if (m_pRefreshact == NULL) // Sanity check throw Genexcept("Main window refresh action creation failed."); connect(m_pRefreshact, SIGNAL(activated()), SLOT(refreshDisplay())); @@ -339,7 +355,7 @@ m_pRefreshact->setWhatsThis(kszRefreshtext); // Syncronize data with remote server over IIOP or SOAP action - m_pSyncact = new QAction(trUtf8("Synchronize with server"), Synciset, trUtf8("&Synchronize"), CTRL+Key_E, this, "Synchronize"); + m_pSyncact = new Q3Action(trUtf8("Synchronize with server"), Synciset, trUtf8("&Synchronize"), Qt::CTRL+Qt::Key_E, this, "Synchronize"); if (m_pSyncact == NULL) // Sanity check throw Genexcept("Main window synchronize RPC action creation failed."); connect(m_pSyncact, SIGNAL(activated()), SLOT(syncIiop())); @@ -352,7 +368,7 @@ m_pSyncact->setWhatsThis(kszSynctext); // Local report generation action - m_pReportact = new QAction(trUtf8("Generate a local report"), Reportiset, trUtf8("&Report"), CTRL+Key_T, this, "LocalReport"); + m_pReportact = new Q3Action(trUtf8("Generate a local report"), Reportiset, trUtf8("&Report"), Qt::CTRL+Qt::Key_T, this, "LocalReport"); if (m_pReportact == NULL) // Sanity check throw Genexcept("Main window local report action creation failed."); connect(m_pReportact, SIGNAL(activated()), SLOT(genReport())); @@ -364,7 +380,7 @@ m_pReportact->setWhatsThis(kszReporttext); // Offer a formatted preferences panel for intuitive prefs object editing - m_pPrefsact = new QAction(trUtf8("Edit the preferences"), QPixmap(s_kpcPrefs_xpm), trUtf8("P&references..."), CTRL+Key_F, this, "Prefspanel"); + m_pPrefsact = new Q3Action(trUtf8("Edit the preferences"), QPixmap(s_kpcPrefs_xpm), trUtf8("P&references..."), Qt::CTRL+Qt::Key_F, this, "Prefspanel"); if (m_pPrefsact == NULL) // Sanity check throw Genexcept("Main window preferences panel action creation failed."); connect(m_pPrefsact, SIGNAL(activated()), SLOT(configPrefs())); @@ -391,7 +407,7 @@ // QToolTip::add(m_pMenubar, QRect(0, 0, 2, 2), trUtf8("Easter Egg")); // Construct and populate the file menu with actions - QPopupMenu *pFilepopup = new QPopupMenu(this); + Q3PopupMenu *pFilepopup = new Q3PopupMenu(this); if (pFilepopup == NULL) // Sanity check throw Genexcept("Main window file popup creation failed."); m_pMenubar->insertItem(trUtf8("&File"), pFilepopup); @@ -406,7 +422,7 @@ m_pFilequitact->addTo(pFilepopup); // Construct and populate the edit menu with subitems - QPopupMenu *pEditpopup = new QPopupMenu(this); + Q3PopupMenu *pEditpopup = new Q3PopupMenu(this); if (pEditpopup == NULL) // Sanity check throw Genexcept("Main window edit popup creation failed."); m_pMenubar->insertItem(trUtf8("&Edit"), pEditpopup); @@ -420,9 +436,9 @@ m_pPrefsact->addTo(pEditpopup); // Construct the view menu and submenus - m_pViewpopup = new QPopupMenu(this); - m_pTbarspopup = new QPopupMenu(this); - m_pColspopup = new QPopupMenu(this); + m_pViewpopup = new Q3PopupMenu(this); + m_pTbarspopup = new Q3PopupMenu(this); + m_pColspopup = new Q3PopupMenu(this); // Give the new menus krass attributes m_pTbarspopup->insertTearOffHandle(); @@ -482,7 +498,7 @@ m_pColspopup->setItemChecked(nMenuid, true); // Construct and populate the report menu with subitems - QPopupMenu *pReportpopup = new QPopupMenu(this); + Q3PopupMenu *pReportpopup = new Q3PopupMenu(this); if (pReportpopup == NULL) // Sanity check throw Genexcept("Main window report popup creation failed."); m_pMenubar->insertItem(trUtf8("&Report"), pReportpopup); @@ -497,17 +513,17 @@ m_pMenubar->insertSeparator(); // Construct and populate the help menu with subitems - QPopupMenu *pHelppopup = new QPopupMenu(this); + Q3PopupMenu *pHelppopup = new Q3PopupMenu(this); if (pHelppopup == NULL) // Sanity check throw Genexcept("Main window help popup creation failed."); m_pMenubar->insertItem(trUtf8("&Help"), pHelppopup); - pHelppopup->insertItem(trUtf8("&Contents"), this, SLOT(helpContents()), Key_F1); + pHelppopup->insertItem(trUtf8("&Contents"), this, SLOT(helpContents()), Qt::Key_F1); pHelppopup->insertSeparator(); pHelppopup->insertItem(trUtf8("About &as-gui"), this, SLOT(aboutTitraq())); pHelppopup->insertItem(trUtf8("About &OSSP"), this, SLOT(aboutOSSP())); pHelppopup->insertItem(trUtf8("About &Qt"), this, SLOT(aboutQt())); pHelppopup->insertSeparator(); - pHelppopup->insertItem(QPixmap(s_kpcWhatsthis_xpm), trUtf8("What's &This"), this, SLOT(whatsThis()), SHIFT+Key_F1); + pHelppopup->insertItem(QPixmap(s_kpcWhatsthis_xpm), trUtf8("What's &This"), this, SLOT(whatsThis()), Qt::SHIFT+Qt::Key_F1); } // @@ -516,23 +532,23 @@ void Titraqform::setupToolbars(void) { // Construct and populate the file tool bar - m_pFiletools = new QToolBar("Toolfile", this, DockTop); + m_pFiletools = new Q3ToolBar("Toolfile", this, Qt::DockTop); if (m_pFiletools == NULL) // Sanity check throw Genexcept("File tool bar creation failed."); m_pFiletools->setLabel(trUtf8("File Ops")); m_pFiletools->setOpaqueMoving(false); - m_pFiletools->setCloseMode(QDockWindow::Never); + m_pFiletools->setCloseMode(Q3DockWindow::Never); m_pFilenewact->addTo(m_pFiletools); m_pFileopenact->addTo(m_pFiletools); m_pFilesaveact->addTo(m_pFiletools); // Construct and populate the edit tool bar - m_pEdittools = new QToolBar("Tooledit", this, DockTop); + m_pEdittools = new Q3ToolBar("Tooledit", this, Qt::DockTop); if (m_pEdittools == NULL) // Sanity check throw Genexcept("Edit tool bar creation failed."); m_pEdittools->setLabel(trUtf8("Edit Ops")); m_pEdittools->setOpaqueMoving(false); - m_pEdittools->setCloseMode(QDockWindow::Never); + m_pEdittools->setCloseMode(Q3DockWindow::Never); m_pCutact->addTo(m_pEdittools); m_pCopyact->addTo(m_pEdittools); m_pPasteact->addTo(m_pEdittools); @@ -541,33 +557,33 @@ m_pDelrowact->addTo(m_pEdittools); // Construct and populate the view tool bar - m_pViewtools = new QToolBar("Toolview", this, DockTop); + m_pViewtools = new Q3ToolBar("Toolview", this, Qt::DockTop); if (m_pViewtools == NULL) // Sanity check throw Genexcept("View tool bar creation failed."); m_pViewtools->setLabel(trUtf8("View Ops")); m_pViewtools->setOpaqueMoving(false); - m_pViewtools->setCloseMode(QDockWindow::Never); + m_pViewtools->setCloseMode(Q3DockWindow::Never); m_pRefreshact->addTo(m_pViewtools); m_pReportact->addTo(m_pViewtools); m_pSyncact->addTo(m_pViewtools); // Construct and populate the lonely preferences tool bar - m_pPrefstools = new QToolBar("Preferences", this, DockTop); + m_pPrefstools = new Q3ToolBar("Preferences", this, Qt::DockTop); if (m_pPrefstools == NULL) // Sanity check throw Genexcept("Prefs tool bar creation failed."); m_pPrefstools->setLabel(trUtf8("Preferences editor")); m_pPrefstools->setOpaqueMoving(false); - m_pPrefstools->setCloseMode(QDockWindow::Never); + m_pPrefstools->setCloseMode(Q3DockWindow::Never); m_pPrefsact->addTo(m_pPrefstools); // Construct and populate the lonely whatsthis tool bar - m_pWhatstools = new QToolBar("Toolwhats", this, DockTop); + m_pWhatstools = new Q3ToolBar("Toolwhats", this, Qt::DockTop); if (m_pWhatstools == NULL) // Sanity check throw Genexcept("Whats this tool bar creation failed."); m_pWhatstools->setLabel(trUtf8("Whats this")); m_pWhatstools->setOpaqueMoving(false); - m_pWhatstools->setCloseMode(QDockWindow::Never); - QWhatsThis::whatsThisButton(m_pWhatstools); // Preconfigured whats this button + m_pWhatstools->setCloseMode(Q3DockWindow::Never); + Q3WhatsThis::whatsThisButton(m_pWhatstools); // Preconfigured whats this button } // @@ -576,17 +592,17 @@ void Titraqform::setupCentralwidget(void) { // Create a central frame and associated layout for QMainWindow - m_pCenframe = new QFrame(this, "Centralframe"); + m_pCenframe = new Q3Frame(this, "Centralframe"); if (m_pCenframe == NULL) // Sanity check throw Genexcept("Main window central frame creation failed."); - m_pCenframe->setFrameShape(QFrame::StyledPanel); - m_pCenframe->setFrameShadow(QFrame::Sunken); + m_pCenframe->setFrameShape(Q3Frame::StyledPanel); + m_pCenframe->setFrameShadow(Q3Frame::Sunken); this->setCentralWidget(m_pCenframe); // Layout controls for table, editing widgets - m_pMainlayout = new QVBoxLayout(m_pCenframe, TITRAQ_MARGIN, TITRAQ_SPACING, "Mainlayout"); // For layouts - m_pPackagelayout = new QVBoxLayout(0, 0, TITRAQ_SPACING, "Packagelayout"); // For table - m_pEditlayout = new QHBoxLayout(0, 0, TITRAQ_SPACING, "Editlayout"); // For edits + m_pMainlayout = new Q3VBoxLayout(m_pCenframe, TITRAQ_MARGIN, TITRAQ_SPACING, "Mainlayout"); // For layouts + m_pPackagelayout = new Q3VBoxLayout(0, 0, TITRAQ_SPACING, "Packagelayout"); // For table + m_pEditlayout = new Q3HBoxLayout(0, 0, TITRAQ_SPACING, "Editlayout"); // For edits // Major sanity check wrapped in one call if (!(m_pMainlayout && m_pPackagelayout && m_pEditlayout)) @@ -620,8 +636,8 @@ m_pMaintable->setDirty(false); // Reset data to clean state m_pMaintable->setReadOnly(true); // Table is read only m_pMaintable->setColumnMovingEnabled(false); // Ctrl-drag disabled - m_pMaintable->setSelectionMode(QTable::MultiRow); // Multi row selection - m_pMaintable->setFocusStyle(QTable::FollowStyle); // How cells are drawn + m_pMaintable->setSelectionMode(Q3Table::MultiRow); // Multi row selection + m_pMaintable->setFocusStyle(Q3Table::FollowStyle); // How cells are drawn m_pMaintable->setLeftMargin(0); // Get rid of the vertical header m_pMaintable->verticalHeader()->hide(); // by hiding it with a margin of 0 m_pMaintable->horizontalHeader()->setResizeEnabled(true); @@ -636,7 +652,7 @@ // Table header row m_pTablehead = m_pMaintable->horizontalHeader(); - m_pMaintable->setHScrollBarMode(QScrollView::AlwaysOff); + m_pMaintable->setHScrollBarMode(Q3ScrollView::AlwaysOff); m_pTablehead->setLabel(TITRAQ_IDXSTATUS, QObject::trUtf8("Stat"), m_pPrefs->getNumber(TITRAQ_PREFSTATCOLWIDTH, TITRAQ_DEFSTATCOLWIDTH)); m_pMaintable->setColumnReadOnly (TITRAQ_IDXSTATUS, true); @@ -696,7 +712,7 @@ const char *kszStatustext = "The item status shows a green " "symbol for valid entries, a yellow symbol " "for warning, and a red symbol for flawed entries."; - QWhatsThis::add(m_pStatusedit, kszStatustext); + Q3WhatsThis::add(m_pStatusedit, kszStatustext); QToolTip::add(m_pStatusedit, trUtf8("Status Indicator")); m_pEditlayout->addWidget(m_pStatusedit); // Finally add the item status edit @@ -715,7 +731,7 @@ const char *kszLinenotext = "The line number helps identify " "an entry when a warning or error message " "appears."; - QWhatsThis::add(m_pLineedit, kszLinenotext); + Q3WhatsThis::add(m_pLineedit, kszLinenotext); QToolTip::add(m_pLineedit, trUtf8("Line Number")); m_pEditlayout->addWidget(m_pLineedit); // Finally add the line number edit @@ -733,7 +749,7 @@ const char *kszUsertext = "Edit the user name by clicking " "on this control and typing the user name " "you want to account."; - QWhatsThis::add(m_pUseredit, kszUsertext); + Q3WhatsThis::add(m_pUseredit, kszUsertext); QToolTip::add(m_pUseredit, trUtf8("User Name")); m_pEditlayout->addWidget(m_pUseredit); // Finally add the user edit @@ -751,7 +767,7 @@ const char *kszGuidtext = "Edit the GUID by clicking " "on this control and typing the GUID " "corresponding to this account item."; - QWhatsThis::add(m_pGuidedit, kszGuidtext); + Q3WhatsThis::add(m_pGuidedit, kszGuidtext); QToolTip::add(m_pGuidedit, trUtf8("GUID")); m_pEditlayout->addWidget(m_pGuidedit); // Finally add the GUID edit @@ -769,7 +785,7 @@ const char *kszCrctext = "Edit the CRC by clicking " "on this control and typing the new " "value for this account item."; - QWhatsThis::add(m_pCrcedit, kszCrctext); + Q3WhatsThis::add(m_pCrcedit, kszCrctext); QToolTip::add(m_pCrcedit, trUtf8("CRC")); m_pEditlayout->addWidget(m_pCrcedit); // Finally add the CRC edit @@ -787,7 +803,7 @@ const char *kszRevtext = "Edit the revision by clicking " "on this control and typing the new value " "for this account type."; - QWhatsThis::add(m_pRevedit, kszRevtext); + Q3WhatsThis::add(m_pRevedit, kszRevtext); QToolTip::add(m_pRevedit, trUtf8("Revision")); m_pEditlayout->addWidget(m_pRevedit); // Finally add the revision edit @@ -797,7 +813,7 @@ throw Genexcept("Main window date edit creation failed."); // Spew errors // Configure attributes - m_pDateedit->setOrder(QDateEdit::YMD); + m_pDateedit->setOrder(Q3DateEdit::YMD); m_pDateedit->setAutoAdvance(true); m_pDateedit->setSeparator(trUtf8("-")); m_pDateedit->setEnabled(false); @@ -806,17 +822,17 @@ const char *kszDateedit = "Edit the task date by clicking on " "the year, month, or day, and then changing their " "values with the arrow buttons."; - QWhatsThis::add(m_pDateedit, kszDateedit); + Q3WhatsThis::add(m_pDateedit, kszDateedit); QToolTip::add(m_pDateedit, trUtf8("Task Date")); m_pEditlayout->addWidget(m_pDateedit); // Finally add the date editor // Make the start time selector - m_pStarttime = new QTimeEdit(m_pCenframe, "StartTime"); + m_pStarttime = new Q3TimeEdit(m_pCenframe, "StartTime"); if (m_pStarttime == NULL) // Sanity check throw Genexcept("Main window start time creation failed."); // Spew errors // Configure attributes - m_pStarttime->setDisplay(QTimeEdit::Hours | QTimeEdit::Minutes); + m_pStarttime->setDisplay(Q3TimeEdit::Hours | Q3TimeEdit::Minutes); m_pStarttime->setAutoAdvance(true); m_pStarttime->setEnabled(false); @@ -824,17 +840,17 @@ const char *kszStarttime = "Edit the task starting time by clicking on " "the hour and minute, and then changing their " "values with the arrow buttons."; - QWhatsThis::add(m_pStarttime, kszStarttime); + Q3WhatsThis::add(m_pStarttime, kszStarttime); QToolTip::add(m_pStarttime, trUtf8("Task Starting Time")); m_pEditlayout->addWidget(m_pStarttime); // Finally add the start editor // Make the end time selector - m_pEndtime = new QTimeEdit(m_pCenframe, "EndTime"); + m_pEndtime = new Q3TimeEdit(m_pCenframe, "EndTime"); if (m_pEndtime == NULL) // Sanity check throw Genexcept("Main window end time creation failed."); // Spew errors // Configure attributes - m_pEndtime->setDisplay(QTimeEdit::Hours | QTimeEdit::Minutes); + m_pEndtime->setDisplay(Q3TimeEdit::Hours | Q3TimeEdit::Minutes); m_pEndtime->setAutoAdvance(true); m_pEndtime->setEnabled(false); @@ -842,7 +858,7 @@ const char *kszEndtime = "Edit the task ending time by clicking on " "the hour and minute, and then changing their " "values with the arrow buttons."; - QWhatsThis::add(m_pEndtime, kszEndtime); + Q3WhatsThis::add(m_pEndtime, kszEndtime); QToolTip::add(m_pEndtime, trUtf8("Task Ending Time")); m_pEditlayout->addWidget(m_pEndtime); // Finally add the end editor @@ -865,7 +881,7 @@ const char *kszAmount = "Edit the task amount by clicking on " "the amount, and then changing its " "value with the arrow buttons."; - QWhatsThis::add(m_pAmount, kszAmount); + Q3WhatsThis::add(m_pAmount, kszAmount); QToolTip::add(m_pAmount, trUtf8("Task Amount")); m_pAmount->setEnabled(false); // Don't enable until it's ready m_pEditlayout->addWidget(m_pAmount); // Finally add the amount editor @@ -883,7 +899,7 @@ this->loadAccounts(Filetemp); // Load account helper method // Make the combobox task edit - m_pTasks = new QComboBox(true, m_pCenframe, "Tasks"); + m_pTasks = new Q3ComboBox(true, m_pCenframe, "Tasks"); if (m_pTasks == NULL) // Sanity check throw Genexcept("Main window task edit creation failed."); m_pTasks->insertStringList(*m_pTaskentries); @@ -899,7 +915,7 @@ int nPopupwidth = m_pTasks->listBox()->maxItemWidth(); nPopupwidth += m_pTasks->listBox()->horizontalScrollBar()->height(); m_pTasks->listBox()->setFixedWidth(nPopupwidth); - m_pTasks->listBox()->setHScrollBarMode(QScrollView::Auto); + m_pTasks->listBox()->setHScrollBarMode(Q3ScrollView::Auto); m_pTasks->listBox()->sort(); } @@ -907,7 +923,7 @@ const char *kszTasktext = "Choose a task account by clicking on " "this box, and choosing whichever item most " "closely resembles your task."; - QWhatsThis::add(m_pTasks, kszTasktext); + Q3WhatsThis::add(m_pTasks, kszTasktext); QToolTip::add(m_pTasks, trUtf8("Task Selector")); m_pEditlayout->addWidget(m_pTasks); // Finally add the task edit @@ -925,7 +941,7 @@ const char *kszRemarktext = "Edit the task remarks by clicking on " "this line control and typing the remarks you " "have about the task."; - QWhatsThis::add(m_pRemark, kszRemarktext); + Q3WhatsThis::add(m_pRemark, kszRemarktext); QToolTip::add(m_pRemark, trUtf8("Remark Line")); m_pEditlayout->addWidget(m_pRemark); // Finally add the remark line