head 1.120; access; symbols AS_AFTER_RESTRUCTURING:1.37; locks; strict; comment @// @; 1.120 date 2004.08.24.21.39.27; author ms; state Exp; branches; next 1.119; 1.119 date 2004.08.20.17.47.07; author ms; state Exp; branches; next 1.118; 1.118 date 2004.05.27.21.48.40; author ms; state Exp; branches; next 1.117; 1.117 date 2004.05.27.21.42.26; author ms; state Exp; branches; next 1.116; 1.116 date 2003.11.20.11.31.20; author ms; state Exp; branches; next 1.115; 1.115 date 2003.03.05.15.23.33; author ms; state Exp; branches; next 1.114; 1.114 date 2003.02.28.17.13.25; author ms; state Exp; branches; next 1.113; 1.113 date 2003.02.27.13.57.47; author ms; state Exp; branches; next 1.112; 1.112 date 2003.02.21.23.42.09; author ms; state Exp; branches; next 1.111; 1.111 date 2003.02.21.10.11.35; author ms; state Exp; branches; next 1.110; 1.110 date 2003.02.20.16.47.18; author ms; state Exp; branches; next 1.109; 1.109 date 2003.02.17.17.18.24; author ms; state Exp; branches; next 1.108; 1.108 date 2003.02.17.13.38.22; author ms; state Exp; branches; next 1.107; 1.107 date 2003.02.14.19.27.03; author ms; state Exp; branches; next 1.106; 1.106 date 2003.02.14.17.31.54; author ms; state Exp; branches; next 1.105; 1.105 date 2003.02.14.09.18.25; author ms; state Exp; branches; next 1.104; 1.104 date 2003.02.13.21.12.36; author ms; state Exp; branches; next 1.103; 1.103 date 2003.02.13.19.49.02; author ms; state Exp; branches; next 1.102; 1.102 date 2003.02.12.19.40.17; author ms; state Exp; branches; next 1.101; 1.101 date 2003.02.12.19.33.05; author ms; state Exp; branches; next 1.100; 1.100 date 2003.02.12.17.47.51; author ms; state Exp; branches; next 1.99; 1.99 date 2003.02.11.14.19.57; author ms; state Exp; branches; next 1.98; 1.98 date 2003.02.06.15.55.01; author ms; state Exp; branches; next 1.97; 1.97 date 2003.02.04.19.30.31; author ms; state Exp; branches; next 1.96; 1.96 date 2003.02.03.14.12.08; author ms; state Exp; branches; next 1.95; 1.95 date 2003.02.03.11.15.48; author ms; state Exp; branches; next 1.94; 1.94 date 2003.02.03.10.57.57; author ms; state Exp; branches; next 1.93; 1.93 date 2003.02.03.10.46.13; author ms; state Exp; branches; next 1.92; 1.92 date 2003.01.30.23.48.00; author ms; state Exp; branches; next 1.91; 1.91 date 2003.01.30.22.02.41; author ms; state Exp; branches; next 1.90; 1.90 date 2003.01.30.16.51.45; author ms; state Exp; branches; next 1.89; 1.89 date 2003.01.30.14.36.00; author ms; state Exp; branches; next 1.88; 1.88 date 2003.01.29.17.05.31; author ms; state Exp; branches; next 1.87; 1.87 date 2003.01.28.17.33.55; author ms; state Exp; branches; next 1.86; 1.86 date 2003.01.28.16.42.10; author ms; state Exp; branches; next 1.85; 1.85 date 2003.01.28.16.41.15; author ms; state Exp; branches; next 1.84; 1.84 date 2003.01.24.18.22.03; author ms; state Exp; branches; next 1.83; 1.83 date 2003.01.24.16.32.18; author ms; state Exp; branches; next 1.82; 1.82 date 2003.01.22.23.57.01; author ms; state Exp; branches; next 1.81; 1.81 date 2003.01.22.11.36.53; author ms; state Exp; branches; next 1.80; 1.80 date 2003.01.16.08.26.29; author ms; state Exp; branches; next 1.79; 1.79 date 2002.12.20.17.42.10; author ms; state Exp; branches; next 1.78; 1.78 date 2002.12.20.15.13.52; author ms; state Exp; branches; next 1.77; 1.77 date 2002.12.20.13.25.04; author ms; state Exp; branches; next 1.76; 1.76 date 2002.12.19.20.46.26; author ms; state Exp; branches; next 1.75; 1.75 date 2002.12.18.14.50.58; author ms; state Exp; branches; next 1.74; 1.74 date 2002.12.16.17.13.17; author ms; state Exp; branches; next 1.73; 1.73 date 2002.12.16.16.23.36; author ms; state Exp; branches; next 1.72; 1.72 date 2002.12.16.16.05.57; author ms; state Exp; branches; next 1.71; 1.71 date 2002.12.16.14.07.59; author ms; state Exp; branches; next 1.70; 1.70 date 2002.12.16.12.11.40; author ms; state Exp; branches; next 1.69; 1.69 date 2002.12.16.09.58.34; author ms; state Exp; branches; next 1.68; 1.68 date 2002.12.13.23.42.37; author ms; state Exp; branches; next 1.67; 1.67 date 2002.12.13.21.25.32; author ms; state Exp; branches; next 1.66; 1.66 date 2002.12.13.20.50.18; author ms; state Exp; branches; next 1.65; 1.65 date 2002.12.13.17.44.42; author ms; state Exp; branches; next 1.64; 1.64 date 2002.12.12.21.24.07; author ms; state Exp; branches; next 1.63; 1.63 date 2002.12.12.20.52.13; author ms; state Exp; branches; next 1.62; 1.62 date 2002.12.12.18.48.16; author ms; state Exp; branches; next 1.61; 1.61 date 2002.12.12.17.14.49; author ms; state Exp; branches; next 1.60; 1.60 date 2002.12.12.16.20.15; author ms; state Exp; branches; next 1.59; 1.59 date 2002.12.12.13.20.43; author ms; state Exp; branches; next 1.58; 1.58 date 2002.12.12.12.45.46; author ms; state Exp; branches; next 1.57; 1.57 date 2002.12.12.12.19.48; author ms; state Exp; branches; next 1.56; 1.56 date 2002.12.11.16.00.47; author ms; state Exp; branches; next 1.55; 1.55 date 2002.12.10.14.23.58; author ms; state Exp; branches; next 1.54; 1.54 date 2002.12.10.12.06.56; author ms; state Exp; branches; next 1.53; 1.53 date 2002.12.10.00.00.57; author ms; state Exp; branches; next 1.52; 1.52 date 2002.12.09.16.44.37; author ms; state Exp; branches; next 1.51; 1.51 date 2002.12.05.18.03.53; author ms; state Exp; branches; next 1.50; 1.50 date 2002.12.05.14.51.29; author ms; state Exp; branches; next 1.49; 1.49 date 2002.12.05.10.33.25; author ms; state Exp; branches; next 1.48; 1.48 date 2002.12.04.17.34.02; author ms; state Exp; branches; next 1.47; 1.47 date 2002.12.04.17.31.20; author ms; state Exp; branches; next 1.46; 1.46 date 2002.12.04.16.17.02; author ms; state Exp; branches; next 1.45; 1.45 date 2002.12.04.15.50.29; author ms; state Exp; branches; next 1.44; 1.44 date 2002.12.04.14.50.08; author ms; state Exp; branches; next 1.43; 1.43 date 2002.12.04.11.41.55; author ms; state Exp; branches; next 1.42; 1.42 date 2002.12.04.11.34.08; author ms; state Exp; branches; next 1.41; 1.41 date 2002.12.03.19.07.55; author ms; state Exp; branches; next 1.40; 1.40 date 2002.12.03.18.46.25; author ms; state Exp; branches; next 1.39; 1.39 date 2002.12.03.17.05.11; author ms; state Exp; branches; next 1.38; 1.38 date 2002.12.02.13.25.36; author ms; state Exp; branches; next 1.37; 1.37 date 2002.11.28.20.44.36; author ms; state Exp; branches; next 1.36; 1.36 date 2002.11.28.17.04.18; author ms; state Exp; branches; next 1.35; 1.35 date 2002.11.28.10.31.33; author ms; state Exp; branches; next 1.34; 1.34 date 2002.11.27.23.07.38; author ms; state Exp; branches; next 1.33; 1.33 date 2002.11.27.22.44.48; author ms; state Exp; branches; next 1.32; 1.32 date 2002.11.27.18.40.15; author ms; state Exp; branches; next 1.31; 1.31 date 2002.11.27.17.13.13; author ms; state Exp; branches; next 1.30; 1.30 date 2002.11.27.17.11.06; author ms; state Exp; branches; next 1.29; 1.29 date 2002.11.26.23.26.07; author ms; state Exp; branches; next 1.28; 1.28 date 2002.11.26.22.22.53; author ms; state Exp; branches; next 1.27; 1.27 date 2002.11.26.21.28.57; author ms; state Exp; branches; next 1.26; 1.26 date 2002.11.26.21.18.48; author ms; state Exp; branches; next 1.25; 1.25 date 2002.11.26.20.38.19; author ms; state Exp; branches; next 1.24; 1.24 date 2002.11.26.20.25.16; author ms; state Exp; branches; next 1.23; 1.23 date 2002.11.26.19.41.17; author ms; state Exp; branches; next 1.22; 1.22 date 2002.11.26.19.33.37; author ms; state Exp; branches; next 1.21; 1.21 date 2002.11.26.19.09.58; author ms; state Exp; branches; next 1.20; 1.20 date 2002.11.26.17.23.51; author ms; state Exp; branches; next 1.19; 1.19 date 2002.11.26.14.15.05; author ms; state Exp; branches; next 1.18; 1.18 date 2002.11.26.14.10.32; author ms; state Exp; branches; next 1.17; 1.17 date 2002.11.25.16.23.35; author ms; state Exp; branches; next 1.16; 1.16 date 2002.11.25.15.45.06; author ms; state Exp; branches; next 1.15; 1.15 date 2002.11.25.11.40.07; author ms; state Exp; branches; next 1.14; 1.14 date 2002.11.25.11.23.35; author ms; state Exp; branches; next 1.13; 1.13 date 2002.11.24.20.39.31; author ms; state Exp; branches; next 1.12; 1.12 date 2002.11.24.18.03.24; author ms; state Exp; branches; next 1.11; 1.11 date 2002.11.24.17.56.54; author ms; state Exp; branches; next 1.10; 1.10 date 2002.11.22.21.14.27; author ms; state Exp; branches; next 1.9; 1.9 date 2002.11.22.19.42.25; author ms; state Exp; branches; next 1.8; 1.8 date 2002.11.21.15.37.08; author ms; state Exp; branches; next 1.7; 1.7 date 2002.11.20.19.37.27; author ms; state Exp; branches; next 1.6; 1.6 date 2002.11.20.11.06.32; author ms; state Exp; branches; next 1.5; 1.5 date 2002.11.19.20.29.08; author ms; state Exp; branches; next 1.4; 1.4 date 2002.11.19.19.42.14; author ms; state Exp; branches; next 1.3; 1.3 date 2002.11.19.08.17.44; author ms; state Exp; branches; next 1.2; 1.2 date 2002.11.18.23.34.17; author ms; state Exp; branches; next 1.1; 1.1 date 2002.11.18.22.31.12; author ms; state Exp; branches; next ; desc @@ 1.120 log @Connect valueChanged() signal to capture dirty data messages correctly. @ text @// // 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 // // 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/. // // Permission to use, copy, modify, and distribute this software for // any purpose with or without fee is hereby granted, provided that // the above copyright notice and this permission notice appear in all // copies. // // THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF // USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT // OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. // // as_assist.cpp: ISO C++ implementation // // Qt style headers #include #include #include #include #include #include // Qt general headers #include #include #include #include #include #include #include #include #include #include #include #include // User interface #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[] #include "as_gfx/fileopen.xpm" // static const char *s_kpcFileopen_xpm[] #include "as_gfx/filesave.xpm" // static const char *s_kpcFilesave_xpm[] #include "as_gfx/filesaved.xpm" // static const char *s_kpcDfilesave_xpm[] #include "as_gfx/cut.xpm" // static const char *s_kpcCut_xpm[] #include "as_gfx/cutd.xpm" // static const char *s_kpcDcut_xpm[] #include "as_gfx/copy.xpm" // static const char *s_kpcCopy_xpm[] #include "as_gfx/copyd.xpm" // static const char *s_kpcDcopy_xpm[] #include "as_gfx/paste.xpm" // static const char *s_kpcPaste_xpm[] #include "as_gfx/pasted.xpm" // static const char *s_kpcDcaste_xpm[] #include "as_gfx/rowadd.xpm" // static const char *s_kpcRowadd_xpm[] #include "as_gfx/rowdel.xpm" // static const char *s_kpcRowdel_xpm[] #include "as_gfx/rowaddd.xpm" // static const char *s_kpcDrowadd_xpm[] #include "as_gfx/rowdeld.xpm" // static const char *s_kpcDrowdel_xpm[] #include "as_gfx/osspicon.xpm" // static const char *s_kpcOsspicon_xpm[] #include "as_gfx/whatsthis.xpm" // static const char *s_kpcWhatsthis_xpm[] #include "as_gfx/statok.xpm" // static const char *s_kpcStatokay_xpm[] #include "as_gfx/staterr.xpm" // static const char *s_kpcStaterror_xpm[] #include "as_gfx/statwrn.xpm" // static const char *s_kpcStatwarn_xpm[] #include "as_gfx/statvoid.xpm" // static const char *s_kpcStatvoid_xpm[] #include "as_gfx/refresh.xpm" // static const char *s_kpcRefresh_xpm[] #include "as_gfx/refreshd.xpm" // static const char *s_kpcDrefresh_xpm[] #include "as_gfx/sync.xpm" // static const char *s_kpcSync_xpm[] #include "as_gfx/syncd.xpm" // static const char *s_kpcDsync_xpm[] #include "as_gfx/report.xpm" // static const char *s_kpcReport_xpm[] #include "as_gfx/reportd.xpm" // static const char *s_kpcDreport_xpm[] #include "as_gfx/prefs.xpm" // static const char *s_kpcPrefs_xpm[] // // Construct the preferences // void Titraqform::setupPrefs(void) { // 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(); // Bootstrap a user preferences object from operating system info m_pPrefs = new Preferences(Homedir + QChar('/') + QString::fromLocal8Bit(TITRAQ_PREFNAME), QString::fromLocal8Bit(TITRAQ_APPTITLE), QString::fromLocal8Bit(TITRAQ_PREFVER)); if (!m_pPrefs->fileState()) { // No file was found, so assume a null state if (!Homedir.isEmpty()) m_pPrefs->setString(TITRAQ_PREFHOME, Homedir); else m_pPrefs->setString(TITRAQ_PREFHOME, TITRAQ_DEFHOME); if (!Username.isEmpty()) m_pPrefs->setString(TITRAQ_PREFUSER, Username); else m_pPrefs->setString(TITRAQ_PREFUSER, TITRAQ_DEFUSER); m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLECDE); m_pPrefs->setString(TITRAQ_PREFACCOUNTS, TITRAQ_DEFACCOUNTS); m_pPrefs->setString(TITRAQ_PREFASDIR, TITRAQ_DEFASDIR); m_pPrefs->setString(TITRAQ_PREFVIEW, TITRAQ_DEFVIEW); m_pPrefs->setNumber(TITRAQ_PREFSORTCOL, TITRAQ_DEFSORTCOL); m_pPrefs->setBool(TITRAQ_PREFSORTDIR, TITRAQ_DEFSORTDIR); m_pPrefs->setString(TITRAQ_PREFREMOTELOG, TITRAQ_DEFREMOTELOG); m_pPrefs->setString(TITRAQ_PREFLOCALLOG, TITRAQ_DEFLOCALLOG); m_pPrefs->setString(TITRAQ_PREFCORBHOST, TITRAQ_DEFCORBHOST); m_pPrefs->setString(TITRAQ_PREFSOAPHOST, TITRAQ_DEFSOAPHOST); m_pPrefs->setBool(TITRAQ_PREFCORBON, TITRAQ_DEFCORBON); m_pPrefs->setBool(TITRAQ_PREFSOAPON, TITRAQ_DEFSOAPON); m_pPrefs->setBool(TITRAQ_PREFBAKON, TITRAQ_DEFBAKON); m_pPrefs->setBool(TITRAQ_PREFEXTENDON, TITRAQ_DEFEXTENDON); m_pPrefs->setBool(TITRAQ_PREFDETAILON, TITRAQ_DEFDETAILON); m_pPrefs->setBool(TITRAQ_PREFSIGNATON, TITRAQ_DEFSIGNATON); m_pPrefs->setNumber(TITRAQ_PREFREPORTYPE, TITRAQ_DEFREPORTYPE); m_pPrefs->setNumber(TITRAQ_PREFREPORTWEEKS, TITRAQ_DEFREPORTWEEKS); m_pPrefs->setNumber(TITRAQ_PREFREPORTMONTHS, TITRAQ_DEFREPORTMONTHS); m_pPrefs->setNumber(TITRAQ_PREFLIGHTRED, TITRAQ_DEFLIGHTRED); m_pPrefs->setNumber(TITRAQ_PREFLIGHTGREEN, TITRAQ_DEFLIGHTGREEN); m_pPrefs->setNumber(TITRAQ_PREFLIGHTBLUE, TITRAQ_DEFLIGHTBLUE); m_pPrefs->setNumber(TITRAQ_PREFDARKRED, TITRAQ_DEFDARKRED); 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); cerr << trUtf8("Created new preferences file ") << Homedir << QChar('/') << QString::fromLocal8Bit(TITRAQ_PREFNAME) << endl; } // Use the preferred configuration values to initialize titraq switch (m_pPrefs->getNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLECDE)) { case TITRAQ_STYLECDE: qApp->setStyle(new QCDEStyle); break; case TITRAQ_STYLESGI: 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_STYLEMSOFT: qApp->setStyle(new QWindowsStyle); break; default: qApp->setStyle(new QCDEStyle); break; } } // // Construct various actions // void Titraqform::setupActions(void) { QIconSet Saveiset, Cutiset, Copyiset, Pasteiset; QIconSet Rowaddiset, Rowdeliset, Refreshiset; QIconSet 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); // 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)); // File new action m_pFilenewact = new QAction(trUtf8("New File"), QPixmap(s_kpcFilenew_xpm), trUtf8("&New"), CTRL+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())); const char *kszFilenewtext = "

" "Click this button to make a " "blank file. You can also " "select the New command from " "the File menu.

"; 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"); if (m_pFileopenact == NULL) // Sanity check throw Genexcept("Main window file open action creation failed."); connect(m_pFileopenact, SIGNAL(activated()), SLOT(openDoc())); const char *kszFileopentext = "

" "Click this button to open a " "new file. You can also select " "the Open command from the " "File menu.

"; m_pFileopenact->setWhatsThis(kszFileopentext); // File save current action m_pFilesaveact = new QAction(trUtf8("Save File"), Saveiset, trUtf8("&Save"), CTRL+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())); const char *kszFilesavetext = "

" "Click this button to save " "the file you are editing. You will be " "prompted for a file name. You can also " "select the Save command from " "the File menu.

"; m_pFilesaveact->setWhatsThis(kszFilesavetext); // File save selected action m_pFilesaveasact = new QAction(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"); 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"); 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"); if (m_pCutact == NULL) // Sanity check throw Genexcept("Main window cut edit action creation failed."); connect(m_pCutact, SIGNAL(activated()), SLOT(cutEntry())); const char *kszCuttext = "

" "Click this button to cut an entry. " "You can also select the Cut command " "from the Edit menu.

"; m_pCutact->setWhatsThis(kszCuttext); // Copy action m_pCopyact = new QAction(trUtf8("Copy"), Copyiset, trUtf8("&Copy"), CTRL+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())); const char *kszCopytext = "

" "Click this button to copy an entry. " "You can also select the Copy command " "from the Edit menu.

"; m_pCopyact->setWhatsThis(kszCopytext); // Paste action m_pPasteact = new QAction(trUtf8("Paste"), Pasteiset, trUtf8("&Paste"), CTRL+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())); const char *kszPastetext = "

" "Click this button to paste an entry. " "You can also select the Paste command " "from the Edit menu.

"; m_pPasteact->setWhatsThis(kszPastetext); // Add data row action m_pAddrowact = new QAction(trUtf8("Add Entry"), Rowaddiset, trUtf8("&Add entry"), 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())); const char *kszAddrowtext = "

" "Click this button to add a new entry. " "You can also select the Add command " "from the Edit menu.

"; m_pAddrowact->setWhatsThis(kszAddrowtext); // Delete data row action m_pDelrowact = new QAction(trUtf8("Delete Entry"), Rowdeliset, trUtf8("&Delete entry"), 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())); const char *kszDelrowtext = "

" "Click this button to delete a entry. " "You can also select the Delete command " "from the Edit menu.

"; m_pDelrowact->setWhatsThis(kszDelrowtext); // Refresh data display action m_pRefreshact = new QAction(trUtf8("Refresh Display"), Refreshiset, trUtf8("&Refresh display"), CTRL+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())); const char *kszRefreshtext = "

" "Click this button to refresh the display. " "You can also select the Refresh command " "from the View menu.

"; 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"); if (m_pSyncact == NULL) // Sanity check throw Genexcept("Main window synchronize RPC action creation failed."); connect(m_pSyncact, SIGNAL(activated()), SLOT(syncIiop())); connect(m_pSyncact, SIGNAL(activated()), SLOT(syncSoap())); const char *kszSynctext = "

" "Click this button to synchronize the data. " "Your changed entries will be sent to the server. " "You can also select the Synchronize command " "from the Report menu.

"; 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"); if (m_pReportact == NULL) // Sanity check throw Genexcept("Main window local report action creation failed."); connect(m_pReportact, SIGNAL(activated()), SLOT(genReport())); const char *kszReporttext = "

" "Click this button to report your data. " "A local report will be generated for you to view. " "You can also select the Local Report command " "from the Report menu.

"; 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"); if (m_pPrefsact == NULL) // Sanity check throw Genexcept("Main window preferences panel action creation failed."); connect(m_pPrefsact, SIGNAL(activated()), SLOT(configPrefs())); const char *kszPrefstext = "

" "Click this button to edit the preferences. " "You can then apply, accept, or cancel your changes. " "You can also select the Preferences command " "from the Edit menu.

"; m_pPrefsact->setWhatsThis(kszPrefstext); } // // Construct the menu bar // void Titraqform::setupMenubar(void) { int nMenuid = 0; // Used to store id during menu item creation m_pMenubar = menuBar(); // Grab menu bar owned by QMainWindow if (m_pMenubar == NULL) // Sanity check throw Genexcept("Main window menu bar nonexistant."); // // Make an easter egg ;-) // 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); if (pFilepopup == NULL) // Sanity check throw Genexcept("Main window file popup creation failed."); m_pMenubar->insertItem(trUtf8("&File"), pFilepopup); m_pFilenewact->addTo(pFilepopup); m_pFileopenact->addTo(pFilepopup); pFilepopup->insertSeparator(); m_pFilecloseact->addTo(pFilepopup); pFilepopup->insertSeparator(); m_pFilesaveact->addTo(pFilepopup); m_pFilesaveasact->addTo(pFilepopup); pFilepopup->insertSeparator(); m_pFilequitact->addTo(pFilepopup); // Construct and populate the edit menu with subitems QPopupMenu *pEditpopup = new QPopupMenu(this); if (pEditpopup == NULL) // Sanity check throw Genexcept("Main window edit popup creation failed."); m_pMenubar->insertItem(trUtf8("&Edit"), pEditpopup); m_pCutact->addTo(pEditpopup); m_pCopyact->addTo(pEditpopup); m_pPasteact->addTo(pEditpopup); pEditpopup->insertSeparator(); m_pAddrowact->addTo(pEditpopup); m_pDelrowact->addTo(pEditpopup); pEditpopup->insertSeparator(); 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); // Give the new menus krass attributes m_pTbarspopup->insertTearOffHandle(); m_pTbarspopup->setCheckable(true); m_pColspopup->insertTearOffHandle(); m_pColspopup->setCheckable(true); // Major sanity check wrapped in one call if (!(m_pViewpopup && m_pTbarspopup && m_pColspopup)) throw Genexcept("Main window view popups creation failed."); // Populate the view menu with subitems m_pMenubar->insertItem(trUtf8("&View"), m_pViewpopup); m_pViewpopup->insertItem(trUtf8("&Normal"), this, SLOT(normalView())); nMenuid = m_pViewpopup->insertItem(trUtf8("&Editing"), this, SLOT(editingView())); m_pViewpopup->setItemEnabled(nMenuid, false); nMenuid = m_pViewpopup->insertItem(trUtf8("&Timing"), this, SLOT(timingView())); m_pViewpopup->setItemEnabled(nMenuid, false); m_pViewpopup->insertSeparator(); m_pRefreshact->addTo(m_pViewpopup); // Refresh action m_pViewpopup->insertSeparator(); m_pViewpopup->insertItem(trUtf8("&Toolbars"), m_pTbarspopup); nMenuid = m_pTbarspopup->insertItem(trUtf8("&File"), this, SLOT(showFilebar())); m_pTbarspopup->setItemChecked(nMenuid, true); nMenuid = m_pTbarspopup->insertItem(trUtf8("&Edit"), this, SLOT(showEditbar())); m_pTbarspopup->setItemChecked(nMenuid, true); nMenuid = m_pTbarspopup->insertItem(trUtf8("&View"), this, SLOT(showViewbar())); m_pTbarspopup->setItemChecked(nMenuid, true); nMenuid = m_pTbarspopup->insertItem(trUtf8("&Prefs"), this, SLOT(showPrefsbar())); m_pTbarspopup->setItemChecked(nMenuid, true); nMenuid = m_pTbarspopup->insertItem(trUtf8("&Whats"), this, SLOT(showWhatsbar())); m_pTbarspopup->setItemChecked(nMenuid, true); m_pViewpopup->insertItem(trUtf8("&Columns"), m_pColspopup); nMenuid = m_pColspopup->insertItem(trUtf8("&Status"), this, SLOT(showStatcol())); m_pColspopup->setItemChecked(nMenuid, true); nMenuid = m_pColspopup->insertItem(trUtf8("&Line"), this, SLOT(showLinecol())); m_pColspopup->setItemChecked(nMenuid, true); nMenuid = m_pColspopup->insertItem(trUtf8("&User"), this, SLOT(showUsercol())); m_pColspopup->setItemChecked(nMenuid, true); nMenuid = m_pColspopup->insertItem(trUtf8("&GUID"), this, SLOT(showGuidcol())); m_pColspopup->setItemChecked(nMenuid, true); nMenuid = m_pColspopup->insertItem(trUtf8("&CRC"), this, SLOT(showCrccol())); m_pColspopup->setItemChecked(nMenuid, true); nMenuid = m_pColspopup->insertItem(trUtf8("&Rev"), this, SLOT(showRevcol())); m_pColspopup->setItemChecked(nMenuid, true); nMenuid = m_pColspopup->insertItem(trUtf8("&Date"), this, SLOT(showDatecol())); m_pColspopup->setItemChecked(nMenuid, true); nMenuid = m_pColspopup->insertItem(trUtf8("&Start"), this, SLOT(showStartcol())); m_pColspopup->setItemChecked(nMenuid, true); nMenuid = m_pColspopup->insertItem(trUtf8("&Finish"), this, SLOT(showFinishcol())); m_pColspopup->setItemChecked(nMenuid, true); nMenuid = m_pColspopup->insertItem(trUtf8("&Amount"), this, SLOT(showAmountcol())); m_pColspopup->setItemChecked(nMenuid, true); nMenuid = m_pColspopup->insertItem(trUtf8("&Task"), this, SLOT(showTaskcol())); m_pColspopup->setItemChecked(nMenuid, true); nMenuid = m_pColspopup->insertItem(trUtf8("&Remark"), this, SLOT(showRemarkcol())); m_pColspopup->setItemChecked(nMenuid, true); // Construct and populate the report menu with subitems QPopupMenu *pReportpopup = new QPopupMenu(this); if (pReportpopup == NULL) // Sanity check throw Genexcept("Main window report popup creation failed."); m_pMenubar->insertItem(trUtf8("&Report"), pReportpopup); #if defined HAVE_MICO || defined HAVE_ESOAP m_pSyncact->addTo(pReportpopup); m_pSyncact->setEnabled(m_pPrefs->getBool(TITRAQ_PREFCORBON, TITRAQ_DEFCORBON) | m_pPrefs->getBool(TITRAQ_PREFSOAPON, TITRAQ_DEFSOAPON)); #endif // defined HAVE_MICO || defined HAVE_ESOAP m_pReportact->addTo(pReportpopup); // Pad spacing to force help menu to appear far right m_pMenubar->insertSeparator(); // Construct and populate the help menu with subitems QPopupMenu *pHelppopup = new QPopupMenu(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->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); } // // Construct the tool bars // void Titraqform::setupToolbars(void) { // Construct and populate the file tool bar m_pFiletools = new QToolBar("Toolfile", this, 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_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); 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_pCutact->addTo(m_pEdittools); m_pCopyact->addTo(m_pEdittools); m_pPasteact->addTo(m_pEdittools); m_pEdittools->addSeparator(); m_pAddrowact->addTo(m_pEdittools); m_pDelrowact->addTo(m_pEdittools); // Construct and populate the view tool bar m_pViewtools = new QToolBar("Toolview", this, 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_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); 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_pPrefsact->addTo(m_pPrefstools); // Construct and populate the lonely whatsthis tool bar m_pWhatstools = new QToolBar("Toolwhats", this, 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 } // // Construct the central frame // void Titraqform::setupCentralwidget(void) { // Create a central frame and associated layout for QMainWindow m_pCenframe = new QFrame(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); 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 // Major sanity check wrapped in one call if (!(m_pMainlayout && m_pPackagelayout && m_pEditlayout)) throw Genexcept("Main window layout creation failed."); // Specify ordering of the layouts m_pMainlayout->addLayout(m_pPackagelayout); m_pMainlayout->addLayout(m_pEditlayout); } // // Construct the status bar // void Titraqform::setupStatusbar(void) { m_pStatbar = statusBar(); // Grab status bar owned by QMainWindow if (m_pStatbar == NULL) // Sanity check throw Genexcept("Main window status bar nonexistant."); } // // Construct the table // void Titraqform::setupTable(void) { // Create, configure, and setup the table itself m_pMaintable = new TiTable(m_pPrefs, m_pCenframe, "Maintable"); if (m_pMaintable == NULL) // Sanity check throw Genexcept("Main window table creation failed."); m_pMaintable->setNumCols(TITRAQ_IDXTAIL); 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->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); m_pMaintable->horizontalHeader()->setClickEnabled(true); // Allow click signals m_pMaintable->horizontalHeader()->setTracking(false); // No continuous tracking m_pMaintable->setColumnStretchable(TITRAQ_IDXTAIL - 1, true); // Allow for user determined data sorting and use saved values m_pMaintable->setSortcol((int)m_pPrefs->getNumber(TITRAQ_PREFSORTCOL, TITRAQ_DEFSORTCOL)); m_pMaintable->setSortdir(m_pPrefs->getBool(TITRAQ_PREFSORTDIR, TITRAQ_DEFSORTDIR)); m_pMaintable->setSorting(true); // Table header row m_pTablehead = m_pMaintable->horizontalHeader(); m_pMaintable->setHScrollBarMode(QScrollView::AlwaysOff); m_pTablehead->setLabel(TITRAQ_IDXSTATUS, QObject::trUtf8("Stat"), m_pPrefs->getNumber(TITRAQ_PREFSTATCOLWIDTH, TITRAQ_DEFSTATCOLWIDTH)); m_pMaintable->setColumnReadOnly (TITRAQ_IDXSTATUS, true); m_pTablehead->setLabel(TITRAQ_IDXLINE, QObject::trUtf8("Line"), m_pPrefs->getNumber(TITRAQ_PREFLCOLWIDTH, TITRAQ_DEFLCOLWIDTH)); m_pMaintable->setColumnReadOnly (TITRAQ_IDXLINE, true); m_pTablehead->setLabel(TITRAQ_IDXUSER, QObject::trUtf8("User"), m_pPrefs->getNumber(TITRAQ_PREFUCOLWIDTH, TITRAQ_DEFUCOLWIDTH)); m_pTablehead->setLabel(TITRAQ_IDXGUID, QObject::trUtf8("GUID"), m_pPrefs->getNumber(TITRAQ_PREFGCOLWIDTH, TITRAQ_DEFGCOLWIDTH)); m_pMaintable->setColumnReadOnly (TITRAQ_IDXGUID, true); m_pTablehead->setLabel(TITRAQ_IDXCRC, QObject::trUtf8("CRC"), m_pPrefs->getNumber(TITRAQ_PREFCCOLWIDTH, TITRAQ_DEFCCOLWIDTH)); m_pMaintable->setColumnReadOnly (TITRAQ_IDXCRC, true); m_pTablehead->setLabel(TITRAQ_IDXREV, QObject::trUtf8("Rev"), m_pPrefs->getNumber(TITRAQ_PREFREVCOLWIDTH, TITRAQ_DEFREVCOLWIDTH)); m_pMaintable->setColumnReadOnly (TITRAQ_IDXREV, true); m_pTablehead->setLabel(TITRAQ_IDXDATE, QObject::trUtf8("Date"), m_pPrefs->getNumber(TITRAQ_PREFDCOLWIDTH, TITRAQ_DEFDCOLWIDTH)); m_pTablehead->setLabel(TITRAQ_IDXSTART, QObject::trUtf8("Begin"), m_pPrefs->getNumber(TITRAQ_PREFSTARTCOLWIDTH, TITRAQ_DEFSTARTCOLWIDTH)); m_pTablehead->setLabel(TITRAQ_IDXFINISH, QObject::trUtf8("End"), m_pPrefs->getNumber(TITRAQ_PREFFCOLWIDTH, TITRAQ_DEFFCOLWIDTH)); m_pTablehead->setLabel(TITRAQ_IDXAMOUNT, QObject::trUtf8("Amount"), m_pPrefs->getNumber(TITRAQ_PREFACOLWIDTH, TITRAQ_DEFACOLWIDTH)); m_pTablehead->setLabel(TITRAQ_IDXTASK, QObject::trUtf8("Task"), m_pPrefs->getNumber(TITRAQ_PREFTCOLWIDTH, TITRAQ_DEFTCOLWIDTH)); m_pTablehead->setLabel(TITRAQ_IDXREMARK, QObject::trUtf8("Remark")); m_pPackagelayout->addWidget(m_pMaintable); // Finally add the damn table // Table update signals connect(m_pMaintable, SIGNAL(currentChanged(int, int)), SLOT(updEdit(int, int))); connect(m_pMaintable, SIGNAL(clicked(int, int, int, const QPoint&)), SLOT(onClick(int, int, int, const QPoint&))); connect(m_pMaintable, SIGNAL(doubleClicked(int, int, int, const QPoint&)), SLOT(inplaceEdit(int, int, int, const QPoint&))); connect(m_pTablehead, SIGNAL(sizeChange(int, int, int)), SLOT(updSizes(int, int, int))); connect(m_pMaintable, SIGNAL(textEdited(int, int)), SLOT(dataChanged(int, int))); connect(m_pMaintable, SIGNAL(valueChanged(int, int)), SLOT(dataChanged(int, int))); } // // Construct the bottom edit widgets // void Titraqform::setupEditlay(void) { // QSpacerItem Pad(TITRAQ_SPACING / 2, 0, QSizePolicy::Fixed); // m_pEditlayout->addWidget(&Pad); // Padd left side of control layout // Make the status edit m_pStatusedit = new QLabel(m_pCenframe, "Status"); if (m_pStatusedit == NULL) // Sanity check throw Genexcept("Main window status edit creation failed."); m_pStatusedit->setPixmap(QPixmap(s_kpcStatvoid_xpm)); // Placeholder // Whatsthis info for the item status edit 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); QToolTip::add(m_pStatusedit, trUtf8("Status Indicator")); m_pEditlayout->addWidget(m_pStatusedit); // Finally add the item status edit // Make the line number edit m_pLineedit = new QLineEdit(m_pCenframe, "Lineno"); if (m_pLineedit == NULL) // Sanity check throw Genexcept("Main window line number edit creation failed."); m_pLineedit->setFrameShape(QLineEdit::LineEditPanel); m_pLineedit->setFrameShadow(QLineEdit::Sunken); m_pLineedit->setFrame(true); m_pLineedit->setReadOnly(true); m_pLineedit->setEnabled(false); m_pLineedit->setAlignment(Qt::AlignRight); // Whatsthis info for the line number edit const char *kszLinenotext = "The line number helps identify " "an entry when a warning or error message " "appears."; QWhatsThis::add(m_pLineedit, kszLinenotext); QToolTip::add(m_pLineedit, trUtf8("Line Number")); m_pEditlayout->addWidget(m_pLineedit); // Finally add the line number edit // Make the user edit m_pUseredit = new QLineEdit(m_pCenframe, "User"); if (m_pUseredit == NULL) // Sanity check throw Genexcept("Main window user edit creation failed."); m_pUseredit->setFrameShape(QLineEdit::LineEditPanel); m_pUseredit->setFrameShadow(QLineEdit::Sunken); m_pUseredit->setFrame(true); m_pUseredit->setReadOnly(false); m_pUseredit->setEnabled(false); // Whatsthis info for the user edit 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); QToolTip::add(m_pUseredit, trUtf8("User Name")); m_pEditlayout->addWidget(m_pUseredit); // Finally add the user edit // Make the GUID edit m_pGuidedit = new QLineEdit(m_pCenframe, "Guid"); if (m_pGuidedit == NULL) // Sanity check throw Genexcept("Main window GUID edit creation failed."); m_pGuidedit->setFrameShape(QLineEdit::LineEditPanel); m_pGuidedit->setFrameShadow(QLineEdit::Sunken); m_pGuidedit->setFrame(true); m_pGuidedit->setReadOnly(true); m_pGuidedit->setEnabled(false); // Whatsthis info for the GUID edit 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); QToolTip::add(m_pGuidedit, trUtf8("GUID")); m_pEditlayout->addWidget(m_pGuidedit); // Finally add the GUID edit // Make the CRC edit m_pCrcedit = new QLineEdit(m_pCenframe, "Crc"); if (m_pCrcedit == NULL) // Sanity check throw Genexcept("Main window CRC edit creation failed."); m_pCrcedit->setFrameShape(QLineEdit::LineEditPanel); m_pCrcedit->setFrameShadow(QLineEdit::Sunken); m_pCrcedit->setFrame(true); m_pCrcedit->setReadOnly(true); m_pCrcedit->setEnabled(false); // Whatsthis info for the CRC edit 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); QToolTip::add(m_pCrcedit, trUtf8("CRC")); m_pEditlayout->addWidget(m_pCrcedit); // Finally add the CRC edit // Make the revision edit m_pRevedit = new QLineEdit(m_pCenframe, "Revision"); if (m_pRevedit == NULL) // Sanity check throw Genexcept("Main window revision edit creation failed."); m_pRevedit->setFrameShape(QLineEdit::LineEditPanel); m_pRevedit->setFrameShadow(QLineEdit::Sunken); m_pRevedit->setFrame(true); m_pRevedit->setReadOnly(true); m_pRevedit->setEnabled(false); // Whatsthis info for the revision edit 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); QToolTip::add(m_pRevedit, trUtf8("Revision")); m_pEditlayout->addWidget(m_pRevedit); // Finally add the revision edit // Make the date selector m_pDateedit = new Daydatedit(QDate::currentDate(), m_pCenframe, "Date"); if (m_pDateedit == NULL) // Sanity check throw Genexcept("Main window date edit creation failed."); // Spew errors // Configure attributes m_pDateedit->setOrder(QDateEdit::YMD); m_pDateedit->setAutoAdvance(true); m_pDateedit->setSeparator(trUtf8("-")); m_pDateedit->setEnabled(false); // Whatsthis info for the date editor 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); 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"); 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->setAutoAdvance(true); m_pStarttime->setEnabled(false); // Whatsthis info for the time editor 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); 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"); 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->setAutoAdvance(true); m_pEndtime->setEnabled(false); // Whatsthis info for the time editor 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); QToolTip::add(m_pEndtime, trUtf8("Task Ending Time")); m_pEditlayout->addWidget(m_pEndtime); // Finally add the end editor // // Make the total time amount selector // m_pAmount = new QTimeEdit(m_pCenframe, "TotalAmount"); // if (m_pAmount == NULL) // Sanity check // throw Genexcept("Main window amount creation failed."); // Spew errors // // // Configure attributes // m_pAmount->setDisplay(QTimeEdit::Hours | QTimeEdit::Minutes); // m_pAmount->setAutoAdvance(true); // m_pAmount->setEnabled(false); // Make the amount selector m_pAmount = new ASTimeEdit(m_pCenframe, "TotalAmount"); if (m_pAmount == NULL) // Sanity check throw Genexcept("Main window amount creation failed."); // Spew errors // Whatsthis info for the amount editor 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); 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 // Construct a stringlist just to hold task values m_pTaskentries = new QStringList; if (m_pTaskentries == NULL) // Sanity check throw Genexcept("Main window task entries creation failed."); // Populate the stringlist with fresh accounts, taken from filename in prefs QString Asdir = m_pPrefs->getString(TITRAQ_PREFACCOUNTS, TITRAQ_DEFACCOUNTS); if (Asdir.startsWith(TITRAQ_HOMEDIRTOK)) Asdir = QDir::homeDirPath() + Asdir.remove(0, QString(TITRAQ_HOMEDIRTOK).length() - 1); QFile Filetemp(Asdir); this->loadAccounts(Filetemp); // Load account helper method // Make the combobox task edit m_pTasks = new QComboBox(true, m_pCenframe, "Tasks"); if (m_pTasks == NULL) // Sanity check throw Genexcept("Main window task edit creation failed."); m_pTasks->insertStringList(*m_pTaskentries); m_pTasks->setCurrentText(NULL); m_pTasks->setSizeLimit(TITRAQ_ACCTBOXHEIGHT); m_pTasks->setAutoCompletion(true); m_pTasks->setDuplicatesEnabled(false); m_pTasks->setEnabled(false); // m_pTasks->setEditable(false); // Only idiots define noneditable and autocompletion // Add an auto scroll bar if possible under current GUI style if (m_pTasks->listBox()) { // Motif style has no list box 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()->sort(); } // Whatsthis info for the task editor 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); QToolTip::add(m_pTasks, trUtf8("Task Selector")); m_pEditlayout->addWidget(m_pTasks); // Finally add the task edit // Make the Remark line m_pRemark = new QLineEdit(m_pCenframe, "Remark"); if (m_pRemark == NULL) // Sanity check throw Genexcept("Main window remark line creation failed."); m_pRemark->setFrameShape(QLineEdit::LineEditPanel); m_pRemark->setFrameShadow(QLineEdit::Sunken); m_pRemark->setFrame(true); m_pRemark->setReadOnly(false); m_pRemark->setEnabled(false); // Whatsthis info for the remark line 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); QToolTip::add(m_pRemark, trUtf8("Remark Line")); m_pEditlayout->addWidget(m_pRemark); // Finally add the remark line // Start edit controls off at right size this->updSizes(TITRAQ_IDXALLCTRLS, -1, -1); // Validate data just as it is being entered connect(m_pDateedit, SIGNAL(valueChanged(const QDate &)), SLOT(validateRow(void))); connect(m_pStarttime, SIGNAL(valueChanged(const QTime &)), SLOT(validateRow(void))); connect(m_pEndtime, SIGNAL(valueChanged(const QTime &)), SLOT(validateRow(void))); connect(m_pAmount, SIGNAL(valueChanged(const QTime &)), SLOT(validateRow(void))); connect(m_pTasks, SIGNAL(textChanged(const QString &)), SLOT(validateRow(void))); connect(m_pRemark, SIGNAL(textChanged(const QString &)), SLOT(validateRow(void))); // Signals sent between table cells and corresponding edit control widgets connect(m_pLineedit, SIGNAL(textChanged(const QString &)), SLOT(updateLine(const QString &))); connect(m_pUseredit, SIGNAL(textChanged(const QString &)), SLOT(updateUser(const QString &))); connect(m_pGuidedit, SIGNAL(textChanged(const QString &)), SLOT(updateGuid(const QString &))); connect(m_pCrcedit, SIGNAL(textChanged(const QString &)), SLOT(updateCrc(const QString &))); connect(m_pRevedit, SIGNAL(textChanged(const QString &)), SLOT(updateRev(const QString &))); connect(m_pDateedit, SIGNAL(valueChanged(const QDate &)), SLOT(updateDate(const QDate &))); connect(m_pStarttime, SIGNAL(valueChanged(const QTime &)), SLOT(updateStart(const QTime &))); connect(m_pEndtime, SIGNAL(valueChanged(const QTime &)), SLOT(updateFinish(const QTime &))); connect(m_pAmount, SIGNAL(valueChanged(const QTime &)), SLOT(updateAmount(const QTime &))); connect(m_pTasks, SIGNAL(textChanged(const QString &)), SLOT(updateTask(const QString &))); connect(m_pRemark, SIGNAL(textChanged(const QString &)), SLOT(updateRemark(const QString &))); // Correctly update checksum and revision fields also connect(m_pUseredit, SIGNAL(textChanged(const QString &)), SLOT(calcCrc(void))); connect(m_pDateedit, SIGNAL(valueChanged(const QDate &)), SLOT(calcCrc(void))); connect(m_pStarttime, SIGNAL(valueChanged(const QTime &)), SLOT(calcCrc(void))); connect(m_pEndtime, SIGNAL(valueChanged(const QTime &)), SLOT(calcCrc(void))); connect(m_pAmount, SIGNAL(valueChanged(const QTime &)), SLOT(calcCrc(void))); connect(m_pTasks, SIGNAL(textChanged(const QString &)), SLOT(calcCrc(void))); connect(m_pRemark, SIGNAL(textChanged(const QString &)), SLOT(calcCrc(void))); } // // Arrange and configure columns // void Titraqform::setupColumns(void) { // Handle column view handling presets and defaults if (!m_pPrefs->getBool(TITRAQ_PREFSTATCOLON, TITRAQ_DEFSTATCOLON)) showStatcol(); if (!m_pPrefs->getBool(TITRAQ_PREFLCOLON, TITRAQ_DEFLCOLON)) showLinecol(); if (!m_pPrefs->getBool(TITRAQ_PREFUCOLON, TITRAQ_DEFUCOLON)) showUsercol(); if (!m_pPrefs->getBool(TITRAQ_PREFGCOLON, TITRAQ_DEFGCOLON)) showGuidcol(); if (!m_pPrefs->getBool(TITRAQ_PREFCCOLON, TITRAQ_DEFCCOLON)) showCrccol(); if (!m_pPrefs->getBool(TITRAQ_PREFREVCOLON, TITRAQ_DEFREVCOLON)) showRevcol(); if (!m_pPrefs->getBool(TITRAQ_PREFDCOLON, TITRAQ_DEFDCOLON)) showDatecol(); if (!m_pPrefs->getBool(TITRAQ_PREFSTARTCOLON, TITRAQ_DEFSTARTCOLON)) showStartcol(); if (!m_pPrefs->getBool(TITRAQ_PREFFCOLON, TITRAQ_DEFFCOLON)) showFinishcol(); if (!m_pPrefs->getBool(TITRAQ_PREFACOLON, TITRAQ_DEFACOLON)) showAmountcol(); if (!m_pPrefs->getBool(TITRAQ_PREFTCOLON, TITRAQ_DEFTCOLON)) showTaskcol(); if (!m_pPrefs->getBool(TITRAQ_PREFREMCOLON, TITRAQ_DEFREMCOLON)) showRemarkcol(); // Handle tool bar view handling presets and defaults if (!m_pPrefs->getBool(TITRAQ_PREFFILEBAR, TITRAQ_DEFFILEBAR)) { m_pFiletools->hide(); m_pTbarspopup->setItemChecked(m_pTbarspopup->idAt(TITRAQ_IDXFILEBAR), false); } if (!m_pPrefs->getBool(TITRAQ_PREFEDITBAR, TITRAQ_DEFEDITBAR)) { m_pEdittools->hide(); m_pTbarspopup->setItemChecked(m_pTbarspopup->idAt(TITRAQ_IDXEDITBAR), false); } if (!m_pPrefs->getBool(TITRAQ_PREFVIEWBAR, TITRAQ_DEFVIEWBAR)) { m_pViewtools->hide(); m_pTbarspopup->setItemChecked(m_pTbarspopup->idAt(TITRAQ_IDXVIEWBAR), false); } if (!m_pPrefs->getBool(TITRAQ_PREFPREFBAR, TITRAQ_DEFPREFBAR)) { m_pPrefstools->hide(); m_pTbarspopup->setItemChecked(m_pTbarspopup->idAt(TITRAQ_IDXPREFBAR), false); } if (!m_pPrefs->getBool(TITRAQ_PREFWHATBAR, TITRAQ_DEFWHATBAR)) { m_pWhatstools->hide(); m_pTbarspopup->setItemChecked(m_pTbarspopup->idAt(TITRAQ_IDXWHATBAR), false); } } // // [En|dis]able most ui pieces to suit or restrict user // void Titraqform::enableIface(bool bTurned) { // FIXME: Does not belong here, so relocate if (bTurned) // Turn off the interface m_pDateedit->setDayfocus(); // Default focus is on day else { // Turn on the interface m_pMaintable->setNumRows(0); // Remove table data m_pStatusedit->setPixmap(QPixmap(s_kpcStatvoid_xpm)); } // Enable or disable the widgets m_pMaintable->setEnabled(bTurned); m_pLineedit->setEnabled(bTurned); m_pUseredit->setEnabled(bTurned); m_pGuidedit->setEnabled(bTurned); m_pCrcedit->setEnabled(bTurned); m_pRevedit->setEnabled(bTurned); m_pDateedit->setEnabled(bTurned); m_pStarttime->setEnabled(bTurned); m_pEndtime->setEnabled(bTurned); m_pAmount->setEnabled(bTurned); m_pTasks->setEnabled(bTurned); m_pRemark->setEnabled(bTurned); // Enable or disable the actions m_pFilesaveact->setEnabled(bTurned); m_pFilesaveasact->setEnabled(bTurned); m_pFilecloseact->setEnabled(bTurned); m_pAddrowact->setEnabled(bTurned); m_pDelrowact->setEnabled(bTurned); m_pRefreshact->setEnabled(bTurned); m_pCutact->setEnabled(bTurned); m_pCopyact->setEnabled(bTurned); m_pPasteact->setEnabled(bTurned); m_pReportact->setEnabled(bTurned); #if defined HAVE_MICO || defined HAVE_ESOAP if (bTurned) m_pSyncact->setEnabled(m_pPrefs->getBool(TITRAQ_PREFCORBON, TITRAQ_DEFCORBON) | m_pPrefs->getBool(TITRAQ_PREFSOAPON, TITRAQ_DEFSOAPON)); else m_pSyncact->setEnabled(false); #endif // defined HAVE_MICO || defined HAVE_ESOAP // Unconditional settings m_pMaintable->setDirty(false); // Reset to clean data } // // Parse command line arguments for an existing filename, and // open it to edit the intended (but optional) initial data // void Titraqform::loadInit(void) { // If the user gives a filename argument to the shell, then open that file int nNumargs = qApp->argc(); // Holds the number of cmd arguments int nValid = 0; // Holds the return value QFile Initial; // Initial event data file if (nNumargs > 1) { // Warm up a nice cascade, to set my mind on four weeks of vacation for (int nIter = 1; nIter < nNumargs; nIter++) { // Salad in New Zealand if (QChar(*qApp->argv()[nIter]) != '-') { // Bunuelos in Colombia try { this->setFilename(qApp->argv()[nIter]); // Store inital filename Initial.setName(*this->getFilename()); // Initial file to load if (Initial.exists(*getFilename()) && validateData(Initial)) { this->loadData(Initial); // Pass to helper method enableIface(true); // Turn on the lights m_pStatbar->message(trUtf8("Loaded document ") + *this->getFilename()); } else // The inital file name does not correspond to a file m_pStatbar->message(trUtf8(QString("The file ") + *this->getFilename() + QString(" does not exist."))); } catch (Genexcept& Genex) { Genex.reportErr(); } } } } else m_pStatbar->message(trUtf8("Ready")); // Signal a ready condition } @ 1.119 log @Unload validation of personal data file from load logic, move new validation block to validateData, change all cases of preexisting validateData to new name validateRow, test for valid data from now on before calling loadData, and place read data file error strings in constants header. @ text @d677 1 @ 1.118 log @Modernize copyright text in source and graphic headers. @ text @d935 6 a940 6 connect(m_pDateedit, SIGNAL(valueChanged(const QDate &)), SLOT(validateData(void))); connect(m_pStarttime, SIGNAL(valueChanged(const QTime &)), SLOT(validateData(void))); connect(m_pEndtime, SIGNAL(valueChanged(const QTime &)), SLOT(validateData(void))); connect(m_pAmount, SIGNAL(valueChanged(const QTime &)), SLOT(validateData(void))); connect(m_pTasks, SIGNAL(textChanged(const QString &)), SLOT(validateData(void))); connect(m_pRemark, SIGNAL(textChanged(const QString &)), SLOT(validateData(void))); d1086 1 a1086 1 if (Initial.exists(*getFilename())) { @ 1.117 log @Correct file names in source headers. @ text @d3 4 a6 4 // Copyright (c) 2002-2003 The OSSP Project (http://www.ossp.org/) // Copyright (c) 2002-2003 Ralf S. Engelschall // Copyright (c) 2002-2003 Michael Schloh von Bennewitz // Copyright (c) 2002-2003 Cable & Wireless Telecommunications Services GmbH @ 1.116 log @Handle the time consuming bureaucracy of changing a company name. @ text @d29 1 a29 1 // titassist.cpp: ISO C++ implementation @ 1.115 log @Write documentation and make relevant buildconf changes. @ text @a3 1 // Copyright (c) 2002-2003 Cable & Wireless Deutschland (http://www.cw.com/de/) d6 1 @ 1.114 log @Improved dynamic calculation of fixed accounts combobox frame size. @ text @d506 1 a506 1 pHelppopup->insertItem(trUtf8("About &AS-GUI"), this, SLOT(aboutTitraq())); @ 1.113 log @Hook in new help contents browser logic on activation of helpContents signal. @ text @d890 1 d897 4 a900 1 if (m_pTasks->listBox()) // Motif style has no list box d902 2 a903 1 // m_pTasks->setMinimumWidth(m_pTasks->listBox()->maxItemWidth()); @ 1.112 log @Added detailed listing and signature prefs, with linkage to public accessors. @ text @d504 1 a504 2 nMenuid = pHelppopup->insertItem(trUtf8("&Contents"), this, SLOT(helpContents()), Key_F1); pHelppopup->setItemEnabled(nMenuid, false); @ 1.111 log @Implemented user-defined row shading colours, acessible in preferences panel and elsewhere. @ text @d132 2 @ 1.110 log @Add new report generation preferences to initialization phase. @ text @d135 6 d615 1 a615 1 m_pMaintable = new TiTable(m_pCenframe, "Maintable"); @ 1.109 log @Implemented a local report action, and inserted local reporting logic in the report menu and view toolbar using new class Reportpanel. @ text @d132 3 @ 1.108 log @Begin coding a new time widget that allows unnatural time values. @ text @d88 2 d170 2 a171 1 QIconSet Rowaddiset, Rowdeliset, Refreshiset, Synciset; d190 2 d205 1 d343 12 d483 1 a483 2 nMenuid = pReportpopup->insertItem(trUtf8("&Local Report"), this, SLOT(genReport())); pReportpopup->setItemEnabled(nMenuid, false); d541 1 d1041 1 @ 1.107 log @Added logic to include prefs pixmap in both menu and toolbar, removed optional 'this' parameter from all calls to connect(), ripped out more header includes from monolithic interface header, made call of prefs panel an instance of class QAction, changed .bak file message text in class Prefpanel, and renamed default RPC hosts to show what a proper format is. @ text @d820 9 a828 4 // Make the total time amount selector m_pAmount = new QTimeEdit(m_pCenframe, "TotalAmount"); if (m_pAmount == NULL) // Sanity check throw Genexcept("Main window amount creation failed."); // Spew errors d830 2 a831 7 // Configure attributes m_pAmount->setDisplay(QTimeEdit::Hours | QTimeEdit::Minutes); m_pAmount->setAutoAdvance(true); m_pAmount->setEnabled(false); /* // Make the amount selector m_pAmount = new AmountBox(TITRAQ_MINAMOUNT, TITRAQ_MAXAMOUNT, TITRAQ_STEPAMOUNT, m_pCenframe, "Amount"); a834 6 // Configure attributes m_pAmount->setButtonSymbols(QSpinBox::PlusMinus); m_pAmount->setSuffix(trUtf8(" Mins")); m_pAmount->setEnabled(false); // m_pAmount->setSpecialValueText(trUtf8("In progress"));*/ d841 1 @ 1.106 log @Moved preference data application from panel items to own method, added applyPrefs logic, and a new proxy method to handle applied signals, and reorganized file incusion in throughout to loosen source file coupling. @ text @d44 1 d47 2 d50 2 a54 1 #include "as_gui.h" // Main classes d88 1 d200 1 d206 1 a206 1 connect(m_pFilenewact, SIGNAL(activated()), this, SLOT(newDoc())); d218 1 a218 1 connect(m_pFileopenact, SIGNAL(activated()), this, SLOT(openDoc())); d230 1 a230 1 connect(m_pFilesaveact, SIGNAL(activated()), this, SLOT(saveFile())); d243 1 a243 1 connect(m_pFilesaveasact, SIGNAL(activated()), this, SLOT(saveAs())); d250 1 a250 1 connect(m_pFilecloseact, SIGNAL(activated()), this, SLOT(close())); d256 1 a256 1 connect(m_pFilequitact, SIGNAL(activated()), this, SLOT(quitApp())); d262 1 a262 1 connect(m_pCutact, SIGNAL(activated()), this, SLOT(cutEntry())); d273 1 a273 1 connect(m_pCopyact, SIGNAL(activated()), this, SLOT(copyEntry())); d284 1 a284 1 connect(m_pPasteact, SIGNAL(activated()), this, SLOT(pasteEntry())); d295 1 a295 1 connect(m_pAddrowact, SIGNAL(activated()), this, SLOT(addEntry())); d306 1 a306 1 connect(m_pDelrowact, SIGNAL(activated()), this, SLOT(delEntry())); d317 1 a317 1 connect(m_pRefreshact, SIGNAL(activated()), this, SLOT(refreshDisplay())); d328 2 a329 2 connect(m_pSyncact, SIGNAL(activated()), this, SLOT(syncIiop())); connect(m_pSyncact, SIGNAL(activated()), this, SLOT(syncSoap())); d336 12 d361 2 a362 2 // Make an easter egg ;-) QToolTip::add(m_pMenubar, QRect(0, 0, 2, 2), "Easter Egg"); d391 1 a391 1 pEditpopup->insertItem("Preferences...", this, SLOT(configPrefs())); d425 2 d526 9 d644 5 a648 5 connect(m_pMaintable, SIGNAL(currentChanged(int, int)), this, SLOT(updEdit(int, int))); connect(m_pMaintable, SIGNAL(clicked(int, int, int, const QPoint&)), this, SLOT(onClick(int, int, int, const QPoint&))); connect(m_pMaintable, SIGNAL(doubleClicked(int, int, int, const QPoint&)), this, SLOT(inplaceEdit(int, int, int, const QPoint&))); connect(m_pTablehead, SIGNAL(sizeChange(int, int, int)), this, SLOT(updSizes(int, int, int))); connect(m_pMaintable, SIGNAL(textEdited(int, int)), this, SLOT(dataChanged(int, int))); d907 6 a912 6 connect(m_pDateedit, SIGNAL(valueChanged(const QDate &)), this, SLOT(validateData(void))); connect(m_pStarttime, SIGNAL(valueChanged(const QTime &)), this, SLOT(validateData(void))); connect(m_pEndtime, SIGNAL(valueChanged(const QTime &)), this, SLOT(validateData(void))); connect(m_pAmount, SIGNAL(valueChanged(const QTime &)), this, SLOT(validateData(void))); connect(m_pTasks, SIGNAL(textChanged(const QString &)), this, SLOT(validateData(void))); connect(m_pRemark, SIGNAL(textChanged(const QString &)), this, SLOT(validateData(void))); d915 11 a925 11 connect(m_pLineedit, SIGNAL(textChanged(const QString &)), this, SLOT(updateLine(const QString &))); connect(m_pUseredit, SIGNAL(textChanged(const QString &)), this, SLOT(updateUser(const QString &))); connect(m_pGuidedit, SIGNAL(textChanged(const QString &)), this, SLOT(updateGuid(const QString &))); connect(m_pCrcedit, SIGNAL(textChanged(const QString &)), this, SLOT(updateCrc(const QString &))); connect(m_pRevedit, SIGNAL(textChanged(const QString &)), this, SLOT(updateRev(const QString &))); connect(m_pDateedit, SIGNAL(valueChanged(const QDate &)), this, SLOT(updateDate(const QDate &))); connect(m_pStarttime, SIGNAL(valueChanged(const QTime &)), this, SLOT(updateStart(const QTime &))); connect(m_pEndtime, SIGNAL(valueChanged(const QTime &)), this, SLOT(updateFinish(const QTime &))); connect(m_pAmount, SIGNAL(valueChanged(const QTime &)), this, SLOT(updateAmount(const QTime &))); connect(m_pTasks, SIGNAL(textChanged(const QString &)), this, SLOT(updateTask(const QString &))); connect(m_pRemark, SIGNAL(textChanged(const QString &)), this, SLOT(updateRemark(const QString &))); d928 7 a934 7 connect(m_pUseredit, SIGNAL(textChanged(const QString &)), this, SLOT(calcCrc(void))); connect(m_pDateedit, SIGNAL(valueChanged(const QDate &)), this, SLOT(calcCrc(void))); connect(m_pStarttime, SIGNAL(valueChanged(const QTime &)), this, SLOT(calcCrc(void))); connect(m_pEndtime, SIGNAL(valueChanged(const QTime &)), this, SLOT(calcCrc(void))); connect(m_pAmount, SIGNAL(valueChanged(const QTime &)), this, SLOT(calcCrc(void))); connect(m_pTasks, SIGNAL(textChanged(const QString &)), this, SLOT(calcCrc(void))); connect(m_pRemark, SIGNAL(textChanged(const QString &)), this, SLOT(calcCrc(void))); d980 4 @ 1.105 log @Get rid of double newline, add the synchronize action button to the view toolbar where it belongs, and remove the separator between the columns and views selectors. @ text @d53 5 @ 1.104 log @Remove default event file insert, and instead default to event directory. @ text @a403 1 m_pViewpopup->insertSeparator(); d499 1 @ 1.103 log @Lots of small changes and improvements to RPC options, menus, and action, resulting in better usability and more stable RPC functionality. @ text @d108 1 a108 1 m_pPrefs->setString(TITRAQ_PREFASFILE, TITRAQ_DEFASFILE); @ 1.102 log @Fixed typo. @ text @d189 1 a189 2 QMimeSourceFactory::defaultFactory()->setPixmap("synciiop", QPixmap(s_kpcSync_xpm)); QMimeSourceFactory::defaultFactory()->setPixmap("syncsoap", QPixmap(s_kpcSync_xpm)); d192 1 a192 1 m_pFilenewact = new QAction(trUtf8("New File"), QPixmap(s_kpcFilenew_xpm), trUtf8("&New..."), CTRL+Key_N, this, "New"); d313 12 a324 27 #ifdef HAVE_MICO // Syncronize data with remote server over IIOP action m_pSynciiopact = new QAction(trUtf8("Synchronize over IIOP"), Synciset, trUtf8("&Synchronize IIOP"), CTRL+Key_E, this, "Synchronizeiiop"); if (m_pSynciiopact == NULL) // Sanity check throw Genexcept("Main window synchronize IIOP action creation failed."); connect(m_pSynciiopact, SIGNAL(activated()), this, SLOT(syncIiop())); const char *kszSynciioptext = "

" "Click this button to synchronize the data. " "Your changed entries will be sent to the server. " "You can also select the Synchronize command " "from the Report menu.

"; m_pSynciiopact->setWhatsThis(kszSynciioptext); #endif // HAVE_MICO #ifdef HAVE_ESOAP // Syncronize data with remote server over SOAP action m_pSyncsoapact = new QAction(trUtf8("Synchronize over SOAP"), Synciset, trUtf8("&Synchronize SOAP"), CTRL+Key_E, this, "Synchronizesoap"); if (m_pSyncsoapact == NULL) // Sanity check throw Genexcept("Main window synchronize SOAP action creation failed."); connect(m_pSyncsoapact, SIGNAL(activated()), this, SLOT(syncSoap())); const char *kszSyncsoaptext = "

" "Click this button to synchronize the data. " "Your changed entries will be sent to the server. " "You can also select the Synchronize command " "from the Report menu.

"; m_pSyncsoapact->setWhatsThis(kszSyncsoaptext); #endif // HAVE_ESOAP d387 1 a387 2 nMenuid = m_pViewpopup->insertItem(trUtf8("&Normal"), this, SLOT(normalView())); m_pViewpopup->setItemEnabled(nMenuid, false); d436 5 a440 12 #ifdef HAVE_MICO #define HAS_RPC m_pSynciiopact->addTo(pReportpopup); #endif // HAVE_MICO #ifdef HAVE_ESOAP #define HAS_RPC m_pSyncsoapact->addTo(pReportpopup); #endif // HAVE_ESOAP #ifdef HAS_RPC // We only want to add a separator if its needed pReportpopup->insertSeparator(); #endif // HAS_RPC d990 7 a996 6 #ifdef HAVE_MICO m_pSynciiopact->setEnabled(bTurned); #endif // HAVE_MICO #ifdef HAVE_ESOAP m_pSyncsoapact->setEnabled(bTurned); #endif // HAVE_ESOAP @ 1.101 log @Completed working logic of preferences class Panel. @ text @d118 1 a118 1 m_pPrefs->setBool(TITRAQ_PREFBACKON, TITRAQ_DEFBACKON); @ 1.100 log @Fix typo. @ text @d105 2 a108 1 m_pPrefs->setNumber(TITRAQ_PREFSTYLE, TITRAQ_STYLECDE); d114 6 @ 1.99 log @Hard coded left alignment into task table items, made amount control appearance and behaviour consistent with amount table items, and split remote host name and switches out of prefs panel paths page to its own remote page. @ text @d100 1 a100 1 m_pPrefs->setString(TITRAQ_PREFHOME, TITRAQ_DEFUSER); @ 1.98 log @Begin treating quit op on an edited doc as a special case to avoid loss. @ text @d803 11 a813 1 // Make the amount selector d822 1 a822 1 // m_pAmount->setSpecialValueText(trUtf8("In progress")); d893 1 a893 1 connect(m_pAmount, SIGNAL(valueChanged(const QString &)), this, SLOT(validateData(void))); d906 1 a906 1 connect(m_pAmount, SIGNAL(valueChanged(const QString &)), this, SLOT(updateAmount(const QString &))); d915 1 a915 1 connect(m_pAmount, SIGNAL(valueChanged(const QString &)), this, SLOT(calcCrc(void))); @ 1.97 log @Implemented auto field completion for start and finish and auto subtraction for amount, added period for GUID replacement, and added version text to widget labels. @ text @d239 1 a239 2 connect(m_pFilequitact, SIGNAL(activated()), this, SLOT(close())); connect(m_pFilequitact, SIGNAL(activated()), qApp, SLOT(quit())); @ 1.96 log @Back out logic to recognize '-', '+', and '=' as separator symbols. @ text @d880 8 a899 8 // Validate data just as it is being entered connect(m_pDateedit, SIGNAL(valueChanged(const QDate &)), this, SLOT(validateData(void))); connect(m_pStarttime, SIGNAL(valueChanged(const QTime &)), this, SLOT(validateData(void))); connect(m_pEndtime, SIGNAL(valueChanged(const QTime &)), this, SLOT(validateData(void))); connect(m_pAmount, SIGNAL(valueChanged(const QString &)), this, SLOT(validateData(void))); connect(m_pTasks, SIGNAL(textChanged(const QString &)), this, SLOT(validateData(void))); connect(m_pRemark, SIGNAL(textChanged(const QString &)), this, SLOT(validateData(void))); @ 1.95 log @Improve edit control [en|dis]ablement condition, and remove pixmap. @ text @d757 1 a757 1 m_pDateedit->setSeparator(trUtf8(".")); @ 1.94 log @Extra help for beginning users. @ text @d967 3 a969 1 if (!bTurned) // Turn off the interface d971 2 a972 2 else // Turn on the interface m_pDateedit->setDayfocus(); // Default focus is on day a1005 1 this->updEdit(m_pMaintable->currentRow()); // Update edit controls @ 1.93 log @Fix tool labels, after finding another left over inconsistency. @ text @d629 1 @ 1.92 log @Fixed open document but empty timesheet debug text spew bug, and improved user interface by adding more clue messages and denying flawed ops. @ text @d473 1 a473 1 pHelppopup->insertItem(trUtf8("About &Titraq"), this, SLOT(aboutTitraq())); @ 1.91 log @Fixed dirty data double check on implicit save ops, fixed close event method, and plugged holes where no exception handling existed for an except condition. @ text @d276 1 a276 1 m_pAddrowact = new QAction(trUtf8("Add Row"), Rowaddiset, trUtf8("&Add row"), Key_Insert, this, "Addrow"); d278 1 a278 1 throw Genexcept("Main window add row action creation failed."); d281 1 a281 1 "Click this button to add a new row. " d287 1 a287 1 m_pDelrowact = new QAction(trUtf8("Delete Row"), Rowdeliset, trUtf8("&Delete row"), Key_Delete, this, "Delrow"); d289 1 a289 1 throw Genexcept("Main window delete row action creation failed."); d292 1 a292 1 "Click this button to delete a row. " d652 1 a652 1 "to warn, and a red symbol for flawed entries."; @ 1.90 log @Use a new aggregate class User to prefer user data from environment to that of underlying system. @ text @d1021 13 a1033 6 this->setFilename(qApp->argv()[nIter]); // Store inital filename Initial.setName(*this->getFilename()); // Initial file to load if (Initial.exists(*getFilename())) { this->loadData(Initial); // Pass to helper method enableIface(true); // Turn on the lights m_pStatbar->message(trUtf8("Loaded document ") + *this->getFilename()); a1034 2 else // The inital file name does not correspond to a file m_pStatbar->message(trUtf8(QString("The file ") + *this->getFilename() + QString(" does not exist."))); @ 1.89 log @Day date section focus is the default value, and happily removed a hackful zero date placeholder. @ text @a31 8 // For username research #if defined(Q_OS_WIN32) #include #else #include #include #endif // #if defined(Q_OS_WIN32) d52 1 d86 4 a89 29 QString Username, Homedir; // Start the show by getting the username #if defined(Q_OS_WIN32) { DWORD dwWinusernamesize = sizeof(dwWinusernamesize); #if defined(UNICODE) TCHAR szWinusername[UNLEN + 1]; // UNLEN is defined in lmcons.h GetUserName(szWinusername, &dwWinusernamesize); Username = qt_winQString(szWinusername); #else // Not unicode char szWinusername[UNLEN + 1]; // UNLEN is defined in lmcons.h GetUserNameA(szWinusername, &dwWinusernamesize); Username = QString::fromLocal8Bit(szWinusername); } #endif // #if defined(UNICODE) #else // Not windows { //#include // char *szUser = NULL; // szUser = cuserid(); // Username = QString::fromLocal8Bit(szUser); char *szLogin = getlogin(); passwd *pUserpwd = getpwnam(szLogin); Homedir = QString::fromLocal8Bit(pUserpwd->pw_dir); Username = QString::fromLocal8Bit(szLogin); } #endif // #if defined(Q_OS_WIN32) @ 1.88 log @Fixed the scroll before show bug, causing a bad data screen position. @ text @d781 1 a781 2 m_pDateedit = new QDateEdit(m_pCenframe, "Date"); m_pDatezero = new QDate(m_pDateedit->date()); // Hack to store empty date d998 1 a998 1 if (!bTurned) d1000 2 @ 1.87 log @Fix the initial data loading a little more, and remove the logic from the first level gui object. @ text @d1039 2 a1040 2 // Check command line arguments, and parse for an existing filename // Returns the number of unhandled arguments, possibly multiple filenames d1042 1 a1042 1 int Titraqform::setupCmdargs(void) d1046 2 a1047 1 int nRet = 0; // Holds the return value d1053 8 a1060 4 if (QFile::exists(*getFilename())) return ++nRet; // Handled the filename else ++nRet; a1062 2 if (nRet > 0) return -1; // Return a general initial file error d1064 1 a1064 10 return nRet; // Return the number of unhandled arguments } // // Opens an inital event data file if one exists // void Titraqform::setupInitdata(int nFilearg) { // Logic left over from setupCmdargs to help decide what our cmd parsing did if (nFilearg == 0) // Args handled, no initial file a1065 10 else if (nFilearg > 0) { // Args handled, found initial file QFile Initial; // Initial event data file to edit Initial.setName(*this->getFilename()); // Initial file to load this->loadData(Initial); // Pass to helper method enableIface(true); // Turn on the lights m_pStatbar->message(trUtf8("Loaded document ") + *this->getFilename()); } else // The inital file name does not correspond to a file m_pStatbar->message(trUtf8(QString("The file ") + *this->getFilename() + QString(" does not exist."))); @ 1.86 log @Remove output to standard out, to leave terminal session clean again. @ text @d1046 1 a1046 2 int nRet = qApp->argc() - 1; // Holds the return value QFile Initial; // Initial event data file to edit d1051 5 a1055 10 if (QFile::exists(qApp->argv()[nIter])) { this->setFilename(qApp->argv()[nIter]); // Store inital filename Initial.setName(*this->getFilename()); // Initial file to load this->loadData(Initial); // Pass to helper method enableIface(true); // Turn on the lights m_pStatbar->message(trUtf8("Loaded document ") + *this->getFilename(), 4000); m_pMaintable->ensureCellVisible(m_pMaintable->currentRow(), 0); } else // The inital file name does not correspond to a file m_pStatbar->message(trUtf8(QString("The file ") + qApp->argv()[nIter] + QString(" does not exist."))); d1058 2 d1062 20 @ 1.85 log @Implemented initial file loading by shell argument, and cleaned up some other small problems. @ text @d1060 1 a1060 2 else { // The inital file name does not correspond to a file // qWarning((QString("The file ") + qApp->argv()[nIter] + QString(" does not exist.")).ascii()); a1061 1 } @ 1.84 log @Made file and directory handling more generic. @ text @d214 2 d346 1 a346 1 const char *kszSynciioptext = "

" d360 1 a360 1 const char *kszSyncsoaptext = "

" d1036 32 @ 1.83 log @Implemented checksum in all forms, and implemented a revision management system that is so primitive that I commented it out until further design. @ text @d55 1 d841 1 a841 1 m_pAmount->setSuffix(trUtf8(" Minutes")); d859 5 a863 2 QFile Filetemp(m_pPrefs->getString(TITRAQ_PREFACCOUNTS, TITRAQ_PREFACCOUNTS)); this->loadAccounts(Filetemp); // Load account helper method @ 1.82 log @Made CORBA and/or SOAP connections options of autoconf, so remote reporting is compiled into the client only when desired. @ text @a657 1 connect(m_pMaintable, SIGNAL(currentChanged(int, int)), this, SLOT(validateData(int, int))); a659 2 connect(m_pMaintable, SIGNAL(valueChanged(int, int)), this, SLOT(dataChanged(int, int))); connect(m_pMaintable, SIGNAL(valueChanged(int, int)), this, SLOT(validateData(int, int))); d918 17 @ 1.81 log @Use a more orthogonal solution for control updates on add and paste operations. @ text @d337 1 d349 1 d351 1 d363 1 d476 2 d479 3 d483 3 d487 1 d1006 1 d1008 2 d1011 1 @ 1.80 log @Add GUI cod framework, graphics, and stub methods for server syncrhonization. @ text @d997 1 a997 1 this->updEdit(m_pMaintable->currentRow(), 0); // Update edit controls @ 1.79 log @Fixed sorting and added sort direction handling. @ text @d83 2 d182 1 a182 1 QIconSet Rowaddiset, Rowdeliset, Refreshiset; d199 2 d216 1 a216 1 if (m_pFilenewact == NULL) // Sanity check d273 1 a273 1 if (m_pCutact == NULL) // Sanity check d284 1 a284 1 if (m_pCopyact == NULL) // Sanity check d295 1 a295 1 if (m_pPasteact == NULL) // Sanity check d306 1 a306 1 if (m_pAddrowact == NULL) // Sanity check d317 1 a317 1 if (m_pDelrowact == NULL) // Sanity check d328 1 a328 1 if (m_pRefreshact == NULL) // Sanity check d336 24 d467 11 d993 2 @ 1.78 log @Fixed data loading bug, causing overwriting of last row with first row's data. @ text @d138 2 a139 1 m_pPrefs->setNumber(TITRAQ_PREFSORT, TITRAQ_DEFSORT); d564 4 @ 1.77 log @Added missing tooltip and whatsthis info for task edit control, reorganized others. @ text @d921 1 d951 2 a952 2 this->updEdit(0, 0); // Update edit controls m_pMaintable->setDirty(false); // Reset to clean data @ 1.76 log @Added full close document and disable handling, added new dimmed icons for showing disabled state, fixed status edit control pixmap redraw, fixed remaining edit pixmap on old data, fixed get/set empy Rowdata for cut/copy/paste ops, fixed member filename corruption and data loss problem, optimized addRow and pasteRow graphic drawing, added better file name handling by accessors, and streamlined widget enablement logic in slots. @ text @a622 2 QToolTip::add(m_pStatusedit, trUtf8("Status Item")); m_pEditlayout->addWidget(m_pStatusedit); // Finally add the item status edit d629 2 a641 2 QToolTip::add(m_pLineedit, trUtf8("Line Number")); m_pEditlayout->addWidget(m_pLineedit); // Finally add the line number edit d648 2 a659 2 QToolTip::add(m_pUseredit, trUtf8("User Name")); m_pEditlayout->addWidget(m_pUseredit); // Finally add the user edit d666 2 a677 2 QToolTip::add(m_pGuidedit, trUtf8("GUID")); m_pEditlayout->addWidget(m_pGuidedit); // Finally add the GUID edit d684 2 a695 2 QToolTip::add(m_pCrcedit, trUtf8("CRC")); m_pEditlayout->addWidget(m_pCrcedit); // Finally add the CRC edit d702 2 a713 2 QToolTip::add(m_pRevedit, trUtf8("Revision")); m_pEditlayout->addWidget(m_pRevedit); // Finally add the revision edit d720 2 a734 3 m_pEditlayout->addWidget(m_pDateedit); // Finally add the date editor QToolTip::add(m_pDateedit, trUtf8("Task Date")); d740 2 a752 3 m_pEditlayout->addWidget(m_pStarttime); // Finally add the start editor QToolTip::add(m_pStarttime, trUtf8("Task Starting Time")); d758 2 a770 3 m_pEditlayout->addWidget(m_pEndtime); // Finally add the end editor QToolTip::add(m_pEndtime, trUtf8("Task Ending Time")); d776 2 a789 3 m_pEditlayout->addWidget(m_pAmount); // Finally add the amount editor QToolTip::add(m_pAmount, trUtf8("Task Amount")); d795 2 d827 2 a839 2 QToolTip::add(m_pRemark, trUtf8("Remark Line")); m_pEditlayout->addWidget(m_pRemark); // Finally add the remark line d846 2 @ 1.75 log @Fixed row shade logic and moved dirty flag to TiTable class. @ text @a57 1 #include "as_except.h" // Exception classes d64 1 d66 1 d68 1 d70 1 d73 2 d82 1 d178 19 d234 1 a234 1 m_pFilesaveact = new QAction(trUtf8("Save File"), QPixmap(s_kpcFilesave_xpm), trUtf8("&Save"), CTRL+Key_S, this, "Save"); d248 1 a248 1 if (m_pFilesaveasact == NULL) // Sanity check d264 1 d267 1 a267 1 m_pCutact = new QAction(trUtf8("Cut"), QPixmap(s_kpcCut_xpm), trUtf8("&Cut"), CTRL+Key_X, this, "Cut"); d278 1 a278 1 m_pCopyact = new QAction(trUtf8("Copy"), QPixmap(s_kpcCopy_xpm), trUtf8("&Copy"), CTRL+Key_C, this, "Copy"); d289 1 a289 1 m_pPasteact = new QAction(trUtf8("Paste"), QPixmap(s_kpcPaste_xpm), trUtf8("&Paste"), CTRL+Key_V, this, "Paste"); d300 1 a300 1 m_pAddrowact = new QAction(trUtf8("Add Row"), QPixmap(s_kpcRowadd_xpm), trUtf8("&Add row"), Key_Insert, this, "Addrow"); d311 1 a311 1 m_pDelrowact = new QAction(trUtf8("Delete Row"), QPixmap(s_kpcRowdel_xpm), trUtf8("&Delete row"), Key_Delete, this, "Delrow"); d322 1 a322 1 m_pRefreshact = new QAction(trUtf8("Refresh Display"), QPixmap(s_kpcRefresh_xpm), trUtf8("&Refresh display"), CTRL+Key_R, this, "Refresh"); d516 1 a516 1 setCentralWidget(m_pCenframe); d547 1 a547 1 // The table itself d552 1 a553 1 m_pMaintable->setEnabled(false); // Table starts disabled a555 1 m_pMaintable->setCurrentCell(-1, 0); // Initial row value -1 d916 38 @ 1.74 log @Preserve user preferred sort order and don't set dirty flag on renumber ops. @ text @d579 1 a579 1 connect(m_pMaintable, SIGNAL(valueChanged(int, int)), this, SLOT(dataChanged(void))); d581 1 a581 1 connect(m_pMaintable, SIGNAL(textEdited(void)), this, SLOT(dataChanged(void))); @ 1.73 log @Add missing view switch menu item, and use a slightly better display rendering algorythm. @ text @d132 1 @ 1.72 log @Implemented joined column sorting. Implemented refreshDisplay, and add action to appropriate edit and view menus. @ text @d380 2 @ 1.71 log @Now read preferences from a configuration file in the current user's home directory by default. @ text @d76 1 d136 2 a137 1 cerr << trUtf8("Created new preferences file ") << Homedir + QChar('/') + QString::fromLocal8Bit(TITRAQ_PREFNAME) << endl; d181 1 d293 11 d373 2 d457 9 d535 1 a535 1 m_pMaintable->setSorting(false); d879 4 @ 1.70 log @Removed hardcoded tasks, implemented dynamic account loading, renamed conf file, corrected comment and empty line handling in load ops. @ text @d36 1 d83 1 a83 1 QString Username; d93 1 a93 1 #else // not unicode d99 1 a99 1 #else // not windows d105 5 a109 1 Username = QString::fromLocal8Bit(getlogin()); d113 5 a117 1 m_pPrefs = new Preferences(TITRAQ_PREFNAME, TITRAQ_APPTITLE, TITRAQ_PREFVER); d119 4 d135 1 a135 1 cerr << trUtf8("Created new preferences file ./") << trUtf8(TITRAQ_PREFNAME) << endl; d552 1 @ 1.69 log @Fine tune before adding conf file location search, and fix a whitespace bug. @ text @d114 1 d740 3 a742 10 // Populate the stringlist with fresh tasks *m_pTaskentries << trUtf8("titraq") << trUtf8("opgui") << trUtf8("email") << trUtf8("admin") << trUtf8("pmod") << trUtf8("psod") << trUtf8("brainstorming") << trUtf8("communication") << trUtf8("evaluation") << trUtf8("holiday") << trUtf8("implementation") << trUtf8("maintainance") << trUtf8("prepare") << trUtf8("perform") << trUtf8("visit") << trUtf8("meeting") << trUtf8("troubleshooting") << trUtf8("weekly"); @ 1.68 log @Smooth out transition from closed to open document state, and add placeholding pixmap. Fixed row add and paste logic to include initialization and validation. Implement cut and past of user data. Fix cut and paste line feed bug. Disable edit controls until first document is created. @ text @d121 1 a121 1 cerr << trUtf8("Created new preferences file ") << trUtf8(TITRAQ_PREFNAME) << endl; d496 1 a496 1 m_pMaintable->setSorting(true); @ 1.67 log @Better initialization by disabling edit controls until a new document. @ text @d74 1 d485 1 d496 1 a496 1 m_pMaintable->setSorting(false); d553 2 @ 1.66 log @Implemented basic validation logic, reflected by pixmaps in both table and edit control. @ text @a550 1 m_pStatusedit->setPixmap(QPixmap(s_kpcStatwarn_xpm)); a563 1 m_pLineedit->setText(trUtf8("0")); d568 1 a582 1 m_pUseredit->setText(m_pPrefs->getString(TITRAQ_PREFUSER, TITRAQ_DEFUSER)); d587 1 a600 1 m_pGuidedit->setText(trUtf8(".")); d605 1 a618 1 m_pCrcedit->setText(trUtf8(".")); d623 1 a636 1 m_pRevedit->setText(trUtf8(".")); d641 1 d661 1 d680 1 d699 1 d718 1 d754 1 a771 1 m_pRemark->setText(trUtf8("Happy birthday to Ralf")); d776 1 @ 1.65 log @Fix display of initialized cells, initialize new cells, and add a shift tab event handler. @ text @d71 3 d532 1 d548 1 a548 1 m_pStatusedit = new QLineEdit(m_pCenframe, "Status"); d551 1 a551 5 m_pStatusedit->setText(trUtf8("0")); m_pStatusedit->setFrameShape(QLineEdit::LineEditPanel); m_pStatusedit->setFrameShadow(QLineEdit::Sunken); m_pStatusedit->setFrame(true); m_pStatusedit->setReadOnly(true); a785 1 connect(m_pStatusedit, SIGNAL(textChanged(const QString &)), this, SLOT(updateStatus(const QString &))); @ 1.64 log @Disabled normal view menu item, and other finishes. @ text @d678 1 d681 1 a681 1 m_pEditlayout->addWidget(m_pStarttime); // Finally add the start editor d692 2 a693 2 if (m_pEndtime == NULL) // Sanity check throw Genexcept("Main window end time creation failed."); // Spew errors d695 5 a699 1 m_pEditlayout->addWidget(m_pEndtime); // Finally add the end editor @ 1.63 log @Many layout and preference changes to support more flexibility. @ text @d334 2 a335 1 m_pViewpopup->insertItem(trUtf8("&Normal"), this, SLOT(normalView())); @ 1.62 log @Moved methods from as_util to as_dataop, corrected load empty field validation, use new bitmaps for validation. @ text @d495 2 a496 1 m_pTablehead->setLabel(TITRAQ_IDXSTATUS, QObject::trUtf8("Stat"), 24); d498 2 a499 1 m_pTablehead->setLabel(TITRAQ_IDXLINE, QObject::trUtf8("Line"), 32); d501 4 a504 2 m_pTablehead->setLabel(TITRAQ_IDXUSER, QObject::trUtf8("User"), 32); m_pTablehead->setLabel(TITRAQ_IDXGUID, QObject::trUtf8("GUID"), 36); d506 2 a507 1 m_pTablehead->setLabel(TITRAQ_IDXCRC, QObject::trUtf8("CRC"), 32); d509 2 a510 1 m_pTablehead->setLabel(TITRAQ_IDXREV, QObject::trUtf8("Rev"), 32); d512 10 a521 5 m_pTablehead->setLabel(TITRAQ_IDXDATE, QObject::trUtf8("Date"), 94); m_pTablehead->setLabel(TITRAQ_IDXSTART, QObject::trUtf8("Begin"), 80); m_pTablehead->setLabel(TITRAQ_IDXFINISH, QObject::trUtf8("End"), 80); m_pTablehead->setLabel(TITRAQ_IDXAMOUNT, QObject::trUtf8("Amount"), 98); m_pTablehead->setLabel(TITRAQ_IDXTASK, QObject::trUtf8("Task"), 96); d800 1 a800 1 if (!m_pPrefs->getBool(TITRAQ_PREFSTATCOL, TITRAQ_DEFSTATCOL)) d802 1 a802 1 if (!m_pPrefs->getBool(TITRAQ_PREFLCOL, TITRAQ_DEFLCOL)) d804 1 a804 1 if (!m_pPrefs->getBool(TITRAQ_PREFUCOL, TITRAQ_DEFUCOL)) d806 1 a806 1 if (!m_pPrefs->getBool(TITRAQ_PREFGCOL, TITRAQ_DEFGCOL)) d808 1 a808 1 if (!m_pPrefs->getBool(TITRAQ_PREFCCOL, TITRAQ_DEFCCOL)) d810 1 a810 1 if (!m_pPrefs->getBool(TITRAQ_PREFREVCOL, TITRAQ_DEFREVCOL)) d812 1 a812 1 if (!m_pPrefs->getBool(TITRAQ_PREFDCOL, TITRAQ_DEFDCOL)) d814 1 a814 1 if (!m_pPrefs->getBool(TITRAQ_PREFSTARTCOL, TITRAQ_DEFSTARTCOL)) d816 1 a816 1 if (!m_pPrefs->getBool(TITRAQ_PREFFCOL, TITRAQ_DEFFCOL)) d818 1 a818 1 if (!m_pPrefs->getBool(TITRAQ_PREFACOL, TITRAQ_DEFACOL)) d820 1 a820 1 if (!m_pPrefs->getBool(TITRAQ_PREFTCOL, TITRAQ_DEFTCOL)) d822 1 a822 1 if (!m_pPrefs->getBool(TITRAQ_PREFREMCOL, TITRAQ_DEFREMCOL)) d825 1 @ 1.61 log @Added groovey valid check mark graphic for status column, and process line numbers during load operation. @ text @d558 1 @ 1.60 log @Fix closure on clean state bug in a better way. @ text @d495 1 a495 1 m_pTablehead->setLabel(TITRAQ_IDXSTATUS, QObject::trUtf8("Stat"), 32); @ 1.59 log @Implement connections for matrix text fields with edit control widgets. @ text @d519 2 a520 1 connect(m_pMaintable, SIGNAL(valueChanged(int, int)), this, SLOT(dataChanged(int, int))); @ 1.58 log @Implement persistent toolbar preferences. @ text @d496 1 d498 1 d501 1 d503 1 d505 1 d592 1 a592 1 m_pGuidedit->setReadOnly(false); d610 1 a610 1 m_pCrcedit->setReadOnly(false); d628 1 a628 1 m_pRevedit->setReadOnly(false); d766 7 a772 1 // Signals d807 1 a807 1 if (!m_pPrefs->getBool(TITRAQ_PREFFCOL, TITRAQ_DEFFCOL)) @ 1.57 log @Load column view preferences on init, and save them on exit. @ text @d393 1 a393 1 // Construct the file tool bar d395 1 a395 1 void Titraqform::setupFiletools(void) d800 13 @ 1.56 log @Add line number and status columns. Make all columns ausblendbar. Activate column menu selectors. @ text @d769 32 @ 1.55 log @Now all data fields are in the view table as well. @ text @d350 1 a350 1 m_pColspopup->setItemEnabled(nMenuid, false); d352 1 a352 1 m_pColspopup->setItemEnabled(nMenuid, false); d354 1 a354 1 m_pColspopup->setItemEnabled(nMenuid, false); d356 1 a356 1 m_pColspopup->setItemEnabled(nMenuid, false); d358 1 a358 1 m_pColspopup->setItemEnabled(nMenuid, false); d360 1 a360 1 m_pColspopup->setItemEnabled(nMenuid, false); d362 1 a362 1 m_pColspopup->setItemEnabled(nMenuid, false); d364 1 a364 1 m_pColspopup->setItemEnabled(nMenuid, false); d366 1 a366 1 m_pColspopup->setItemEnabled(nMenuid, false); d368 1 a368 1 m_pColspopup->setItemEnabled(nMenuid, false); d370 1 a370 1 m_pColspopup->setItemEnabled(nMenuid, false); d372 1 a372 1 m_pColspopup->setItemEnabled(nMenuid, false); d495 2 d501 1 a501 1 m_pTablehead->setLabel(TITRAQ_IDXDATE, QObject::trUtf8("Date"), 90); d524 36 @ 1.54 log @In order to prepare for missing data format implementations, replace last globals with constants, remove unused constants, and remove incomplete task truncating until a better solution is found. @ text @d33 1 a33 1 #if defined(Q_WS_WIN) d37 1 a37 1 #endif d349 2 d353 2 d357 1 a357 1 nMenuid = m_pColspopup->insertItem(trUtf8("&Date"), this, SLOT(showDatecol())); d359 1 a359 1 nMenuid = m_pColspopup->insertItem(trUtf8("&User"), this, SLOT(showUsercol())); d361 1 a361 1 nMenuid = m_pColspopup->insertItem(trUtf8("&Task"), this, SLOT(showTaskcol())); d369 2 d495 4 d523 72 d696 1 a696 1 // Whatsthis info for the remark line @ 1.53 log @Changed key bindings and exit without save logic, removed error messages on new document generation. @ text @d472 1 a472 1 m_pMaintable->setNumCols(g_knCols); d481 1 a481 1 m_pMaintable->horizontalHeader()->setClickEnabled(true); // No click signals d483 1 a483 1 m_pMaintable->setColumnStretchable(g_knCols - 1, true); @ 1.52 log @Disable help menu until implemented, simplify click condition, and adjust autoconf requirements. @ text @d216 1 a216 1 connect(m_pFilequitact, SIGNAL(activated()), qApp, SLOT(quit())); d252 1 a252 1 m_pAddrowact = new QAction(trUtf8("Add Row"), QPixmap(s_kpcRowadd_xpm), trUtf8("&Add row"), CTRL+Key_A, this, "Addrow"); d263 1 a263 1 m_pDelrowact = new QAction(trUtf8("Delete Row"), QPixmap(s_kpcRowdel_xpm), trUtf8("&Delete row"), CTRL+Key_D, this, "Delrow"); @ 1.51 log @Completed dirty data state conditionals. @ text @d376 2 a377 1 pHelppopup->insertItem(trUtf8("&Contents"), this, SLOT(helpContents()), Key_F1); @ 1.50 log @Flush dirty state saving changes without considering broken build. @ text @d178 1 a178 1 connect(m_pFileopenact, SIGNAL(activated()), this, SLOT(chooseFile())); @ 1.49 log @Small fixes, and take UUID generation out of build configuration. @ text @d501 1 a501 1 // connect(m_pMaintable, SIGNAL(valueChanged(int, int)), this, SLOT(tableChanged(int, int))); @ 1.48 log @Replace magic numbers with abstract constants. @ text @d81 1 a81 1 #if defined(Q_WS_WIN) d102 1 a102 1 #endif // #if defined(Q_WS_WIN) @ 1.47 log @Fix event handling problem with TiTable, and explicitly state scope of method calls in TiTable. @ text @d488 6 a493 6 m_pTablehead->setLabel(0, QObject::trUtf8("Date"), 90); m_pTablehead->setLabel(1, QObject::trUtf8("Begin"), 80); m_pTablehead->setLabel(2, QObject::trUtf8("End"), 80); m_pTablehead->setLabel(3, QObject::trUtf8("Amount"), 98); m_pTablehead->setLabel(4, QObject::trUtf8("Task"), 96); m_pTablehead->setLabel(5, QObject::trUtf8("Remark")); @ 1.46 log @Implement missing action accelerators. @ text @d500 1 a500 1 connect(m_pMaintable->horizontalHeader(), SIGNAL(sizeChange(int, int, int)), this, SLOT(updSizes(int, int, int))); @ 1.45 log @Repair windows username logic, and consider using cuserid(3) instead of getlogin(2) for better portability and robustness. @ text @d219 1 a219 1 m_pCutact = new QAction(trUtf8("Cut"), QPixmap(s_kpcCut_xpm), trUtf8("&Cut"), 0, this, "Cut"); d230 1 a230 1 m_pCopyact = new QAction(trUtf8("Copy"), QPixmap(s_kpcCopy_xpm), trUtf8("&Copy"), 0, this, "Copy"); d241 1 a241 1 m_pPasteact = new QAction(trUtf8("Paste"), QPixmap(s_kpcPaste_xpm), trUtf8("&Paste"), 0, this, "Paste"); d252 1 a252 1 m_pAddrowact = new QAction(trUtf8("Add Row"), QPixmap(s_kpcRowadd_xpm), trUtf8("&Add row"), 0, this, "Addrow"); d263 1 a263 1 m_pDelrowact = new QAction(trUtf8("Delete Row"), QPixmap(s_kpcRowdel_xpm), trUtf8("&Delete row"), 0, this, "Delrow"); d349 1 a349 1 nMenuid = m_pColspopup->insertItem(trUtf8("&Line number"), this, SLOT(showLinecol())); d359 1 a359 1 nMenuid = m_pColspopup->insertItem(trUtf8("&Start time"), this, SLOT(showStartcol())); d361 1 a361 1 nMenuid = m_pColspopup->insertItem(trUtf8("&Finish time"), this, SLOT(showFinishcol())); d363 1 a363 1 nMenuid = m_pColspopup->insertItem(trUtf8("&Amount time"), this, SLOT(showAmountcol())); @ 1.44 log @Fix row add logic, and automatically fill in date and time values. @ text @d82 2 a83 1 DWORD winUserNameSize = sizeof(winUserName); d85 18 a102 10 TCHAR winUserName[UNLEN + 1]; // UNLEN is defined in lmcons.h GetUserName(winUserName, &winUserNameSize); userName = qt_winQString(winUserName); #endif // #if defined(UNICODE) char winUserName[UNLEN + 1]; // UNLEN is defined in lmcons.h GetUserNameA(winUserName, &winUserNameSize); userName = QString::fromLocal8Bit(winUserName); #else // #if defined(Q_WS_WIN) Username = QString::fromLocal8Bit(getlogin()); #endif @ 1.43 log @Correct startup window and widget size defaults. @ text @d596 2 @ 1.42 log @Correct dynamic refresh behaviour of table data from edit widgets. @ text @d479 4 a482 4 m_pTablehead->setLabel(0, QObject::trUtf8("Date"), 94); m_pTablehead->setLabel(1, QObject::trUtf8("Begin"), 86); m_pTablehead->setLabel(2, QObject::trUtf8("End"), 86); m_pTablehead->setLabel(3, QObject::trUtf8("Amount"), 96); @ 1.41 log @Implement rudimentary bottom widget edit connections to main table text cells. @ text @d633 1 a633 1 connect(m_pAmount, SIGNAL(valueChanged(int)), this, SLOT(updateAmount(int))); @ 1.40 log @Add windows and unix logic to retreive current user name, and apply it in preferences, loading, and saving data. @ text @d629 7 a635 6 // // Signals // connect(m_pDateedit, SIGNAL(valueChanged(const QDate &date)), this, SLOT(updateDate())); // connect(m_pStarttime, SIGNAL(valueChanged(const QTime &time)), this, SLOT(updateStart())); // connect(m_pEndtime, SIGNAL(valueChanged(const QTime &time)), this, SLOT(updateFinish())); // connect(m_pAmount, SIGNAL(valueChanged(int value), this, SLOT(updateAmount())); // connect(m_pTasks, SIGNAL(textChanged(const QString &string), this, SLOT(updateTask())); @ 1.39 log @Added TiTable object to MOC Mapping, added normal view menu again, added ugly edition state member flag, fixed double click table header resize bug, added auto advance in place edit feature. @ text @d32 7 d78 17 d96 5 a100 1 if (!m_pPrefs->fileState()) { // No file was found, so assume a null state @ 1.38 log @Logic changes to correct the buildconf after CVS restructure. @ text @d297 3 a299 1 m_pViewpopup->insertItem(trUtf8("&Editing"), this, SLOT(editingView())); @ 1.37 log @Massive build configuration preparation, added boilerplate header text, and cleaned up whitespace. @ text @d49 3 a51 3 #include "titraq.h" // Main classes #include "titrex.h" // Exception classes #include "titamount.h" // AmountBox class d54 10 a63 10 #include "gfx/filenew.xpm" // static const char *s_kpcFilenew_xpm[] #include "gfx/fileopen.xpm" // static const char *s_kpcFileopen_xpm[] #include "gfx/filesave.xpm" // static const char *s_kpcFilesave_xpm[] #include "gfx/cut.xpm" // static const char *s_kpcCut_xpm[] #include "gfx/copy.xpm" // static const char *s_kpcCopy_xpm[] #include "gfx/paste.xpm" // static const char *s_kpcPaste_xpm[] #include "gfx/rowadd.xpm" // static const char *s_kpcRowadd_xpm[] #include "gfx/rowdel.xpm" // static const char *s_kpcRowdel_xpm[] #include "gfx/osspicon.xpm" // static const char *s_kpcOsspicon_xpm[] #include "gfx/whatsthis.xpm" // static const char *s_kpcWhatsthis_xpm[] @ 1.36 log @Small corrections to toolbar and buildconf, and remember task aliases. @ text @d1 31 d367 1 a367 1 m_pEdittools->setOpaqueMoving(true); @ 1.35 log @Column adjustment. @ text @d350 1 a350 1 m_pWhatstools->setOpaqueMoving(true); @ 1.34 log @Fixed current file save logic, smoothed edit controls, and corrected name of edition layout. @ text @d325 1 a325 1 m_pFiletools->setOpaqueMoving(true); d418 4 a421 4 m_pTablehead->setLabel(0, QObject::trUtf8("Date"), 76); m_pTablehead->setLabel(1, QObject::trUtf8("Begin"), 48); m_pTablehead->setLabel(2, QObject::trUtf8("End"), 48); m_pTablehead->setLabel(3, QObject::trUtf8("Amount"), 48); @ 1.33 log @Added eventhandler to catch illegal double clicks, minimized layout of edition controls, changes to slot arrangement. @ text @d371 1 a371 2 m_pDatelayout = new QHBoxLayout(0, 0, TITRAQ_SPACING, "Datelayout"); // For dates m_pTasklayout = new QHBoxLayout(0, 0, TITRAQ_SPACING, "Tasklayout"); // For tasks d374 1 a374 1 if (!(m_pMainlayout && m_pPackagelayout && m_pDatelayout && m_pTasklayout)) d379 1 a379 2 m_pMainlayout->addLayout(m_pDatelayout); m_pMainlayout->addLayout(m_pTasklayout); d440 1 a440 1 // m_pDatelayout->addWidget(&Pad); // Padd left side of control layout d453 1 a453 1 m_pDatelayout->addWidget(m_pDateedit); // Finally add the date editor d470 1 a470 1 m_pDatelayout->addWidget(m_pStarttime); // Finally add the start editor d484 1 a484 1 m_pDatelayout->addWidget(m_pEndtime); // Finally add the end editor d503 1 a503 1 m_pDatelayout->addWidget(m_pAmount); // Finally add the amount editor d545 1 a545 1 m_pDatelayout->addWidget(m_pTasks); // Finally add the task edit d557 1 a557 1 m_pDatelayout->addWidget(m_pRemark); // Finally add the remark line @ 1.32 log @Implement in place editing, with intuitive error safety features. @ text @d275 1 a275 1 nMenuid = m_pTbarspopup->insertItem(trUtf8("&Whats this"), this, SLOT(showWhatsbar())); d369 4 a372 4 m_pMainlayout = new QVBoxLayout(m_pCenframe, 10, 6, "Mainlayout"); // For layouts m_pPackagelayout = new QVBoxLayout(0, 0, 6, "Packagelayout"); // For table m_pDatelayout = new QHBoxLayout(0, 0, 6, "Datelayout"); // For dates m_pTasklayout = new QHBoxLayout(0, 0, 6, "Tasklayout"); // For tasks d406 1 a406 1 m_pMaintable->setSelectionMode(QTable::SingleRow); // Multi row selection d412 2 d432 1 d441 3 d514 1 a514 1 // Populate the stringlist with fresh tasks d518 2 d538 2 a539 2 // Fix the minimum width, and add an auto scroll bar to it if (m_pTasks->listBox()) { // Motif style has no list box d541 1 a541 2 m_pTasks->setMinimumWidth(m_pTasks->listBox()->maxItemWidth()); } d547 1 a547 1 m_pTasklayout->addWidget(m_pTasks); // Finally add the task edit d559 1 a559 1 m_pTasklayout->addWidget(m_pRemark); // Finally add the remark line d567 2 a568 15 // Tuple push button confirm m_pConfirmbutton = new QPushButton(m_pCenframe, "Confirmbutton"); if (m_pConfirmbutton == NULL) // Sanity check throw Genexcept("Main window confirm button creation failed."); m_pConfirmbutton->setCursor(QCursor(13)); m_pConfirmbutton->setPaletteBackgroundColor(QColor(206, 192, 176)); m_pConfirmbutton->setText(trUtf8("&Confirm")); QToolTip::add(m_pConfirmbutton, trUtf8("Confirm Editing")); connect(m_pConfirmbutton, SIGNAL(clicked()), this, SLOT(confirmEdit())); m_pTasklayout->addWidget(m_pConfirmbutton); // Finally add the confirm button // Whatsthis info for the confirm button const char *kszConfirmtext = "Confirm any row edition by " "finally clicking on this button."; QWhatsThis::add(m_pConfirmbutton, kszConfirmtext); @ 1.31 log @Really add the class this time, and fix a syntax error. @ text @d429 1 a429 1 // connect(m_pMaintable, SIGNAL(doubleClicked(int, int, int, const QPoint&)), this, SLOT(updEdit(int, int))); @ 1.30 log @Add class TiTable just to override normal cell highlighting, and correct delete entry button label. @ text @d400 1 a400 1 m_pMaintable = new Titable(m_pCenframe, "Maintable"); @ 1.29 log @Implemented edition controls, corrected amount formatting, and corrected file format saving. @ text @d195 1 a195 1 m_pDelrowact = new QAction(trUtf8("Del Row"), QPixmap(s_kpcRowdel_xpm), trUtf8("&Delete row"), 0, this, "Delrow"); d400 1 a400 1 m_pMaintable = new QTable(m_pCenframe, "Maintable"); @ 1.28 log @Corrected add row on empty table special case, and added an ugly hack to allow for invalid zero dates. @ text @a428 1 // connect(m_pMaintable, SIGNAL(clicked(int, int, int, const QPoint&)), this, SLOT(updEdit(int, int))); d459 1 a459 1 m_pStarttime = new QTimeEdit(QTime::currentTime(), m_pCenframe, "StartTime"); d476 1 a476 1 m_pEndtime = new QTimeEdit(QTime::currentTime(), m_pCenframe, "EndTime"); d577 5 a581 5 // m_pDateedit->valueChanged(const QDate &date); // m_pStarttime->valueChanged(const QTime &time); // m_pEndtime->valueChanged(const QTime &time); // m_pAmount->valueChanged(int value); // m_pTasks->textChanged(const QString &string); @ 1.27 log @Fix help text. @ text @d407 1 d440 2 a441 2 QDate Sylvestre(2002, 12, 31); m_pDateedit = new QDateEdit(Sylvestre, m_pCenframe, "Date"); d450 1 a450 1 m_pDatelayout->addWidget(m_pDateedit); // Finally add the date editor d566 1 @ 1.26 log @Doch, use a push button to confirm edition of a task tuple. @ text @d453 3 a455 3 const char *kszDateedit = trUtf8("Edit the task date by clicking on" " the year, month, or day, and then changing their" " values with the arrow buttons."); d470 3 a472 3 const char *kszStarttime = trUtf8("Edit the task starting time by clicking on" " the hour and minute, and then changing their" " values with the arrow buttons."); d484 3 a486 3 const char *kszEndtime = trUtf8("Edit the task ending time by clicking on" " the hour and minute, and then changing their" " values with the arrow buttons."); d503 3 a505 3 const char *kszAmount = trUtf8("Edit the task amount by clicking on" " the amount, and then changing its" " value with the arrow buttons."); d536 5 a540 2 // Finally add the task edit m_pTasklayout->addWidget(m_pTasks); d555 3 a557 3 const char *kszRemarktext = trUtf8("Edit the task remarks by clicking on" " this line control and typing the remarks you" " have about the task."); d571 2 a572 2 const char *kszConfirmtext = trUtf8("Confirm any row edition by " "finally clicking on this button."); @ 1.25 log @Remove all push button widgets, since the enhanced edit tool has the same functionality built in. Also remove the writeData callback, to favor a better approach. @ text @d218 1 a218 1 QToolTip::add(m_pMenubar, QRect(0, 0, 2, 2), "Easter egg"); d556 15 @ 1.24 log @Toolbar showing and hiding on demand. @ text @a203 11 // Write data action m_pWritedataact = new QAction(trUtf8("Write Data"), trUtf8("&Write data"), 0, this, "Writedata"); if (m_pWritedataact == NULL) // Sanity check throw Genexcept("Main window write data action creation failed."); connect(m_pWritedataact, SIGNAL(activated()), this, SLOT(writeEntry())); const char *kszWritedatatext = "

" "Click this button to write out " "your accounting data. You can also select the " "Save command from the File menu.

"; m_pWritedataact->setWhatsThis(kszWritedatatext); d368 1 a368 1 // Layout controls for table, editing widgets, and buttons a372 1 m_pControllayout = new QHBoxLayout(0, 0, 6, "Controllayout"); // For buttons d375 1 a375 1 if (!(m_pMainlayout && m_pPackagelayout && m_pDatelayout && m_pTasklayout && m_pControllayout)) a381 1 m_pMainlayout->addLayout(m_pControllayout); a430 5 // // Button action signals // connect(AddPushButton, SIGNAL(clicked()), this, SLOT(AddRow())); // connect(DeletePushButton, SIGNAL(clicked()), this, SLOT(DelRow())); // connect(WritePushButton, SIGNAL(clicked()), this, SLOT(accept())); a562 48 } // // Construct the buttons // void Titraqform::setupButtons(void) { // Tuple push button add m_pAddbutton = new QPushButton(m_pCenframe, "AddButton"); if (m_pAddbutton == NULL) // Sanity check throw Genexcept("Main window add button creation failed."); m_pAddbutton->setCursor(QCursor(13)); m_pAddbutton->setText(trUtf8("&Add")); QToolTip::add(m_pAddbutton, trUtf8("Add Entry")); connect(m_pAddbutton, SIGNAL(clicked()), this, SLOT(addEntry())); m_pControllayout->addWidget(m_pAddbutton); // Tuple push button delete m_pDeletebutton = new QPushButton(m_pCenframe, "Deletebutton"); if (m_pDeletebutton == NULL) // Sanity check throw Genexcept("Main window delete button creation failed."); m_pDeletebutton->setCursor(QCursor(13)); m_pDeletebutton->setText(trUtf8("&Delete")); m_pDeletebutton->setFlat(false); QToolTip::add(m_pDeletebutton, trUtf8("Delete Entry")); connect(m_pDeletebutton, SIGNAL(clicked()), this, SLOT(delEntry())); m_pControllayout->addWidget(m_pDeletebutton); // Tuple push button write m_pWritebutton = new QPushButton(m_pCenframe, "Writebutton"); if (m_pWritebutton == NULL) // Sanity check throw Genexcept("Main window write button creation failed."); m_pWritebutton->setCursor(QCursor(13)); m_pWritebutton->setText(trUtf8("&Write")); QToolTip::add(m_pWritebutton, trUtf8("Write Entry")); connect(m_pWritebutton, SIGNAL(clicked()), this, SLOT(writeEntry())); m_pControllayout->addWidget(m_pWritebutton); // Tuple push button quit m_pQuitbutton = new QPushButton(m_pCenframe, "Quitbutton"); if (m_pQuitbutton == NULL) // Sanity check throw Genexcept("Main window quit button creation failed."); m_pQuitbutton->setCursor(QCursor(13)); m_pQuitbutton->setText(trUtf8("&Quit")); m_pQuitbutton->setFlat(false); QToolTip::add(m_pQuitbutton, trUtf8("Quit titraq")); connect(m_pQuitbutton, SIGNAL(clicked()), qApp, SLOT(quit())); m_pControllayout->addWidget(m_pQuitbutton); @ 1.23 log @Better looking whatsthis boxes. @ text @d260 10 a269 8 // Construct the view menu QPopupMenu *pViewpopup = new QPopupMenu(this); QPopupMenu *pTbarspopup = new QPopupMenu(this); pTbarspopup->insertTearOffHandle(); pTbarspopup->setCheckable(true); QPopupMenu *pColspopup = new QPopupMenu(this); pColspopup->insertTearOffHandle(); pColspopup->setCheckable(true); d272 1 a272 1 if (!(pViewpopup && pTbarspopup && pColspopup)) d276 32 a307 32 m_pMenubar->insertItem(trUtf8("&View"), pViewpopup); pViewpopup->insertItem(trUtf8("&Editing"), this, SLOT(editingView())); nMenuid = pViewpopup->insertItem(trUtf8("&Timing"), this, SLOT(timingView())); pViewpopup->setItemEnabled(nMenuid, false); pViewpopup->insertSeparator(); pViewpopup->insertItem(trUtf8("&Toolbars"), pTbarspopup); nMenuid = pTbarspopup->insertItem(trUtf8("&File"), this, SLOT(showFilebar())); pTbarspopup->setItemChecked(nMenuid, true); nMenuid = pTbarspopup->insertItem(trUtf8("&Edit"), this, SLOT(showEditbar())); pTbarspopup->setItemChecked(nMenuid, true); nMenuid = pTbarspopup->insertItem(trUtf8("&Whats this"), this, SLOT(showWhatsbar())); pTbarspopup->setItemChecked(nMenuid, true); pViewpopup->insertSeparator(); pViewpopup->insertItem(trUtf8("&Columns"), pColspopup); nMenuid = pColspopup->insertItem(trUtf8("&Line number"), this, SLOT(showLinecol())); pColspopup->setItemEnabled(nMenuid, false); nMenuid = pColspopup->insertItem(trUtf8("&GUID"), this, SLOT(showGuidcol())); pColspopup->setItemEnabled(nMenuid, false); nMenuid = pColspopup->insertItem(trUtf8("&Date"), this, SLOT(showDatecol())); pColspopup->setItemEnabled(nMenuid, false); nMenuid = pColspopup->insertItem(trUtf8("&User"), this, SLOT(showUsercol())); pColspopup->setItemEnabled(nMenuid, false); nMenuid = pColspopup->insertItem(trUtf8("&Task"), this, SLOT(showTaskcol())); pColspopup->setItemEnabled(nMenuid, false); nMenuid = pColspopup->insertItem(trUtf8("&Start time"), this, SLOT(showStartcol())); pColspopup->setItemEnabled(nMenuid, false); nMenuid = pColspopup->insertItem(trUtf8("&Finish time"), this, SLOT(showFinishcol())); pColspopup->setItemEnabled(nMenuid, false); nMenuid = pColspopup->insertItem(trUtf8("&Amount time"), this, SLOT(showAmountcol())); pColspopup->setItemEnabled(nMenuid, false); nMenuid = pColspopup->insertItem(trUtf8("&Remark"), this, SLOT(showRemarkcol())); pColspopup->setItemEnabled(nMenuid, false); d336 2 d347 2 d361 2 @ 1.22 log @Improved date and time processing and validation, including missing or defaults values. @ text @d100 3 a102 3 "Click this button to make
a " "blank file. You can also
" "select the New command
from " d112 3 a114 3 "Click this button to open
a " "new file. You can also select
" "the Open command from the
" d124 4 a127 4 "Click this button to save
" "the file you are editing. You
will be " "prompted for a file
name. You can also " "select
the Save command from
" d156 1 a156 1 "Click this button to cut an entry." d167 1 a167 1 "Click this button to copy an entry." d178 1 a178 1 "Click this button to paste an entry." d189 1 a189 1 "Click this button to add a new row." d200 1 a200 1 "Click this button to delete a row." d211 3 a213 3 "Click this button to write out your accounting data." "You can also select the Save command " "from the File menu.

"; @ 1.21 log @Corrected add entry logic, and implemented remove entry logic. @ text @d507 1 a507 1 m_pAmount->setSpecialValueText(trUtf8("In progress")); @ 1.20 log @Add several missing edit actions, icons for them, and restructure view menu according to thl+ms mui+gui brainstorming. @ text @d411 1 a411 1 m_pMaintable->setSelectionMode(QTable::MultiRow); // Multi row selection @ 1.19 log @Reformat hardcoded task entries. @ text @d26 5 d88 5 d140 1 a140 1 if (m_pFilecloseact == NULL) // Sanity check d146 1 a146 1 if (m_pFilequitact == NULL) // Sanity check d150 33 d184 2 a185 2 m_pAddrowact = new QAction(trUtf8("Add Row"), trUtf8("Add &row"), 0, this, "Addrow"); if (m_pAddrowact == NULL) // Sanity check d188 1 a188 1 const char *kszAddrowtext = "

" d195 2 a196 2 m_pDeleterowact = new QAction(trUtf8("Add Row"), trUtf8("Add &row"), 0, this, "Deleterow"); if (m_pDeleterowact == NULL) // Sanity check d198 2 a199 2 connect(m_pDeleterowact, SIGNAL(activated()), this, SLOT(delEntry())); const char *kszDeleterowtext = "

" d203 1 a203 1 m_pDeleterowact->setWhatsThis(kszDeleterowtext); d206 2 a207 2 m_pWritedataact = new QAction(trUtf8("Add Row"), trUtf8("Add &row"), 0, this, "Writedata"); if (m_pWritedataact == NULL) // Sanity check d222 2 d251 3 a253 3 pEditpopup->insertItem("Cu&t", this, SLOT(cut()), CTRL+Key_X); pEditpopup->insertItem("&Copy", this, SLOT(copy()), CTRL+Key_C); pEditpopup->insertItem("&Paste", this, SLOT(paste()), CTRL+Key_V); d255 2 a256 3 pEditpopup->insertItem("&Add", this, SLOT(addEntry()), CTRL+Key_A); pEditpopup->insertItem("&Delete", this, SLOT(delEntry()), Key_Delete); pEditpopup->insertItem("Select &All", this, SLOT(selAll()), CTRL+Key_A); d260 1 a260 1 // Construct and populate the view menu with subitems d262 12 a273 2 if (pViewpopup == NULL) // Sanity check throw Genexcept("Main window view popup creation failed."); a274 1 pViewpopup->insertItem(trUtf8("&Normal"), this, SLOT(normalView())); d276 30 a305 1 pViewpopup->insertItem(trUtf8("&Timing"), this, SLOT(timingView())); a336 1 QWhatsThis::whatsThisButton(m_pFiletools); // Preconfigured whats this button d343 13 @ 1.18 log @Add edit toolbar to eventually replace bottom button matrix, and correct edit control update logic to avoid needlessly updating controls from empty fields. @ text @d428 9 a436 1 *m_pTaskentries << trUtf8("titraq") << trUtf8("opgui") << trUtf8("email") << trUtf8("admin") << trUtf8("pmod") << trUtf8("psod") << trUtf8("meeting") << trUtf8("training"); @ 1.17 log @Correct table data selection handling. @ text @d247 15 a261 9 // Construct and populate the main tool bar m_pToolbar = new QToolBar("Toolfile", this, DockTop); if (m_pToolbar == NULL) // Sanity check throw Genexcept("Main window tool bar creation failed."); m_pToolbar->setLabel(trUtf8("File Ops")); m_pFilenewact->addTo(m_pToolbar); m_pFileopenact->addTo(m_pToolbar); m_pFilesaveact->addTo(m_pToolbar); QWhatsThis::whatsThisButton(m_pToolbar); // Preconfigured whats this button @ 1.16 log @Add AmountBox class to introduce missing functionality from QSpinBox, and implement most edit control updates. @ text @d331 7 a337 3 connect(m_pMaintable, SIGNAL(clicked(int, int, int, const QPoint&)), this, SLOT(updEdit(int, int))); // connect(table, SIGNAL(currentChanged(int, int)), this, SLOT(currentChanged(int, int))); // connect(table, SIGNAL(valueChanged(int, int)), this, SLOT(valueChanged(int, int))); @ 1.15 log @Connection of edit signals to prototype. @ text @d18 1 a18 1 #include "titraq.h" d20 1 d349 6 a355 1 d368 4 a372 1 d385 1 a386 1 d396 1 a396 1 m_pAmount = new QSpinBox(m_pCenframe, "Amount"); a398 1 m_pDatelayout->addWidget(m_pAmount); // Finally add the amount editor d400 6 d454 7 @ 1.14 log @Fix alignment and editing style problem. @ text @d329 7 @ 1.13 log @Improve new preference object handling. @ text @d311 1 @ 1.12 log @Remove debug code. @ text @d1 9 a9 1 // Qt headers d30 1 a30 1 // Construct the menu bar d32 1 a32 1 void Titraqform::setupMenubar(void) d34 11 a44 3 m_pMenubar = menuBar(); // Grab menu bar owned by QMainWindow if (m_pMenubar == NULL) // Sanity check throw Genexcept("Main window menu bar nonexistant."); d46 24 a69 57 // Make an easter egg ;-) QToolTip::add(m_pMenubar, QRect(0, 0, 2, 2), "Easter egg"); // Construct and populate the file menu with actions QPopupMenu *pFilepopup = new QPopupMenu(this); if (pFilepopup == NULL) // Sanity check throw Genexcept("Main window file popup creation failed."); m_pMenubar->insertItem(trUtf8("&File"), pFilepopup); m_pFilenewact->addTo(pFilepopup); m_pFileopenact->addTo(pFilepopup); pFilepopup->insertSeparator(); m_pFilecloseact->addTo(pFilepopup); pFilepopup->insertSeparator(); m_pFilesaveact->addTo(pFilepopup); m_pFilesaveasact->addTo(pFilepopup); pFilepopup->insertSeparator(); m_pFilequitact->addTo(pFilepopup); // Construct and populate the edit menu with subitems QPopupMenu *pEditpopup = new QPopupMenu(this); if (pEditpopup == NULL) // Sanity check throw Genexcept("Main window edit popup creation failed."); m_pMenubar->insertItem(trUtf8("&Edit"), pEditpopup); pEditpopup->insertItem("Cu&t", this, SLOT(cut()), CTRL+Key_X); pEditpopup->insertItem("&Copy", this, SLOT(copy()), CTRL+Key_C); pEditpopup->insertItem("&Paste", this, SLOT(paste()), CTRL+Key_V); pEditpopup->insertSeparator(); pEditpopup->insertItem("&Add", this, SLOT(addEntry()), CTRL+Key_A); pEditpopup->insertItem("&Delete", this, SLOT(delEntry()), Key_Delete); pEditpopup->insertItem("Select &All", this, SLOT(selAll()), CTRL+Key_A); pEditpopup->insertSeparator(); pEditpopup->insertItem("Preferences...", this, SLOT(configPrefs())); // Construct and populate the view menu with subitems QPopupMenu *pViewpopup = new QPopupMenu(this); if (pViewpopup == NULL) // Sanity check throw Genexcept("Main window view popup creation failed."); m_pMenubar->insertItem(trUtf8("&View"), pViewpopup); pViewpopup->insertItem(trUtf8("&Normal"), this, SLOT(normalView())); pViewpopup->insertItem(trUtf8("&Editing"), this, SLOT(editingView())); pViewpopup->insertItem(trUtf8("&Timing"), this, SLOT(timingView())); // Pad spacing to force help menu to appear far right m_pMenubar->insertSeparator(); // Construct and populate the help menu with subitems QPopupMenu *pHelppopup = new QPopupMenu(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->insertSeparator(); pHelppopup->insertItem(trUtf8("About &Titraq"), 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); d174 68 a479 15 } // // 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 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); } @ 1.11 log @Add a DOM based configuration file. @ text @a8 2 #include a437 1 std::cout << "Executing if" << std::endl; @ 1.10 log @Improved account table viewing and movement, fixed whatsthis text and images, refitted columns to new text dimensions. @ text @d9 2 d431 16 @ 1.9 log @Added exceptions to data ops, completed main static file loading logic, and removed hard coded table limits. @ text @d105 5 a109 4 const char *kszFilenewtext = trUtf8("

" "Click this button to make a blank file." "You can also select the New command " "from the File menu.

"); d117 5 a121 4 const char *kszFileopentext = trUtf8("

" "Click this button to open a new file." "You can also select the Open command " "from the File menu.

"); d129 6 a134 5 const char *kszFilesavetext = trUtf8("

" "Click this button to save the file you " "are editing. You will be prompted for a file name.\n" "You can also select the Save command " "from the File menu.

"); d161 1 a161 1 const char *kszAddrowtext = trUtf8("

" d163 2 a164 2 "You can also select the Add row command " "from the Accounting menu.

"); d172 1 a172 1 const char *kszDeleterowtext = trUtf8("

" d174 2 a175 2 "You can also select the Delete row command " "from the Accounting menu.

"); d183 1 a183 1 const char *kszWritedatatext = trUtf8("

" d185 2 a186 2 "You can also select the Write data command " "from the Accounting menu.

"); d262 1 a262 1 m_pMaintable->horizontalHeader()->setResizeEnabled(false); d269 5 a273 5 m_pTablehead->setLabel(0, QObject::trUtf8("Date"), 96); m_pTablehead->setLabel(1, QObject::trUtf8("Begin"), 80); m_pTablehead->setLabel(2, QObject::trUtf8("End"), 80); m_pTablehead->setLabel(3, QObject::trUtf8("Amount"), 52); m_pTablehead->setLabel(4, QObject::trUtf8("Task"), 70); @ 1.8 log @Consistency fix, and repair slots for opening and saving to local files. @ text @a252 1 m_pMaintable->setNumRows(g_knRows); d261 1 a261 1 m_pMaintable->setSorting(true); d273 1 a273 5 // // Make a generic table item for all rows // for (int i = 0; i < g_knRows; ++i) // m_pMaintable->setItem(i, 0, new QTableItem(m_pMaintable, QTableItem::WhenCurrent, NULL)); m_pPackagelayout->addWidget(m_pMaintable); // Finally add the damn table @ 1.7 log @Fix some object allocations, and wonder why the compiler allowed a second definition for each class member? @ text @d115 1 a115 1 connect(m_pFileopenact, SIGNAL(activated()), this, SLOT(choose())); d126 1 a126 1 connect(m_pFilesaveact, SIGNAL(activated()), this, SLOT(save())); @ 1.6 log @Save time and resources by loading pixmaps on demand only. Removed some icons to unclutter the screen estate. @ text @d288 1 a288 1 QDateEdit *m_pDateedit = new QDateEdit(Sylvestre, m_pCenframe, "Date"); d302 1 a302 1 QTimeEdit *m_pStarttime = new QTimeEdit(QTime::currentTime(), m_pCenframe, "StartTime"); d316 1 a316 1 QTimeEdit *m_pEndtime = new QTimeEdit(QTime::currentTime(), m_pCenframe, "EndTime"); d330 1 a330 1 QSpinBox *m_pAmount = new QSpinBox(m_pCenframe, "Amount"); d350 1 a350 1 QComboBox *m_pTasks = new QComboBox(true, m_pCenframe, "Tasks"); @ 1.5 log @Added edit and view drop down menus, enhanced existing ones. @ text @a13 4 #include "gfx/cwlogo.xpm" // static const char *s_kpcCwlogo_xpm[] #include "gfx/osspicon.xpm" // static const char *s_kpcOsspicon_xpm[] #include "gfx/ossplogo.xpm" // static const char *s_kpcOssplogo_xpm[] #include "gfx/qticon.xpm" // static const char *s_kpcQticon_xpm[] d17 1 a21 21 // Construct the icon images // void Titraqform::setupIcons(void) { // Initialize icon images m_pCwlogo = new QImage(s_kpcCwlogo_xpm); m_pOsspicon = new QImage(s_kpcOsspicon_xpm); m_pOssplogo = new QImage(s_kpcOssplogo_xpm); m_pQticon = new QImage(s_kpcQticon_xpm); m_pNewicon = new QImage(s_kpcFilenew_xpm); m_pOpenicon = new QImage(s_kpcFileopen_xpm); m_pSaveicon = new QImage(s_kpcFilesave_xpm); m_pWhatsicon = new QImage(s_kpcWhatsthis_xpm); // Lets test out our sanity if (!(m_pOsspicon && m_pQticon && m_pNewicon && m_pNewicon && \ m_pOpenicon && m_pSaveicon && m_pWhatsicon)) throw Genexcept("Main window icon creation failed."); } // d80 1 a80 1 pHelppopup->insertItem(trUtf8("&About"), this, SLOT(about()), Key_F1); d82 3 a84 2 pHelppopup->insertItem(QPixmap(*m_pOsspicon), trUtf8("About &OSSP"), this, SLOT(aboutOSSP())); pHelppopup->insertItem(QPixmap(*m_pQticon), trUtf8("About &Qt"), this, SLOT(aboutQt())); d86 1 a86 1 pHelppopup->insertItem(QPixmap(*m_pWhatsicon), trUtf8("What's &This"), this, SLOT(whatsThis()), SHIFT+Key_F1); d94 6 a104 1 QMimeSourceFactory::defaultFactory()->setPixmap("filenew", m_pFilenewact->iconSet().pixmap()); a115 1 QMimeSourceFactory::defaultFactory()->setPixmap("fileopen", m_pFileopenact->iconSet().pixmap()); a126 1 QMimeSourceFactory::defaultFactory()->setPixmap("filesave", m_pFilesaveact->iconSet().pixmap()); d154 1 a154 1 m_pAddrowact = new QAction(trUtf8("Add Row"), QPixmap(s_kpcOssplogo_xpm), trUtf8("Add &row"), 0, this, "Addrow"); a157 1 QMimeSourceFactory::defaultFactory()->setPixmap("ossplogo", m_pAddrowact->iconSet().pixmap()); d165 1 a165 1 m_pDeleterowact = new QAction(trUtf8("Add Row"), QPixmap(s_kpcOssplogo_xpm), trUtf8("Add &row"), 0, this, "Deleterow"); a168 1 QMimeSourceFactory::defaultFactory()->setPixmap("ossplogo", m_pDeleterowact->iconSet().pixmap()); d176 1 a176 1 m_pWritedataact = new QAction(trUtf8("Add Row"), QPixmap(s_kpcOssplogo_xpm), trUtf8("Add &row"), 0, this, "Writedata"); a179 1 QMimeSourceFactory::defaultFactory()->setPixmap("ossplogo", m_pWritedataact->iconSet().pixmap()); @ 1.4 log @Radical optimization of widget initialization and refresh. Removal of excess baggage in daily table. Addition of editing section. Apply new image logic. Reworked layouts. Improved task selection. @ text @d72 24 d118 1 a118 1 m_pFilenewact = new QAction(trUtf8("New File"), QPixmap(s_kpcFilenew_xpm), trUtf8("&New"), CTRL+Key_N, this, "New"); d130 1 a130 1 m_pFileopenact = new QAction(trUtf8("Open File"), QPixmap(s_kpcFileopen_xpm), trUtf8("&Open"), CTRL+Key_O, this, "Open"); d155 1 a155 1 m_pFilesaveasact = new QAction(trUtf8("Save File As"), trUtf8("Save &as"), 0, this, "SaveAs"); d168 1 a168 1 m_pFilequitact = new QAction(trUtf8("Exit"), trUtf8("&Exit"), CTRL+Key_Q, this, "Exit"); @ 1.3 log @Add CW logo and rework message boxes under the help menu. @ text @a3 2 #include #include d6 1 d14 2 a15 1 #include "gfx/cw.xpm" // static const char *s_kpcCw_xpm[] d17 1 a17 1 #include "gfx/qtlogo.xpm" // static const char *s_kpcQtlogo_xpm[] d30 4 a33 3 m_pCwicon = new QImage(s_kpcCwlogo_xpm); m_pOsspicon = new QImage(s_kpcOssplogo_xpm); m_pQticon = new QImage(s_kpcQtlogo_xpm); d215 1 a215 1 // Layout controls for table, buttons, and status line d218 2 d222 2 a223 1 if (!(m_pMainlayout && m_pMainlayout && m_pMainlayout)) // Sanity check d228 2 d254 2 a255 2 m_pMaintable->setReadOnly(false); // Not read only m_pMaintable->setColumnMovingEnabled(true); // Ctrl-drag of headers d260 2 a261 1 m_pMaintable->setColumnStretchable(5, true); d265 1 a271 6 m_pTablehead->setMovingEnabled(true); // Icon image items QPixmap Osspminipix(QPixmap(m_pOsspicon->scaleHeight(m_pMaintable->rowHeight(6)))); m_pMaintable->setItem(0, 0, new QTableItem(m_pMaintable, QTableItem::Never, "OSSP trac")); m_pMaintable->setPixmap(0, 0, Osspminipix); d274 2 a275 2 // for (int i = 1; i < knRows; ++i) // m_pMaintable->setItem(i, 0, new QTableItem(m_pMaintable, QTableItem::Always, ("Enter"))); d277 2 a278 6 // Make the date selector for all rows for (int i = 1; i < g_knRows; ++i) { QDate *pSylvestre = new QDate(2002, 12, 31); QDateEdit *pDateEdit = new QDateEdit(*pSylvestre, m_pMaintable, "Date"); m_pMaintable->setCellWidget(i, 0, pDateEdit); } d280 61 a340 17 // Make the time start selector for all rows for (int i = 0; i < g_knRows; ++i) { QTimeEdit *pStart = new QTimeEdit(QTime::currentTime(), m_pMaintable, "Start"); m_pMaintable->setCellWidget(i, 1, pStart); } // Make the time end selector for all rows for (int i = 0; i < g_knRows; ++i) { QTimeEdit *pEnd = new QTimeEdit(QTime::currentTime(), m_pMaintable, "End"); m_pMaintable->setCellWidget(i, 2, pEnd); } // Make the amount selector for all rows for (int i = 0; i < g_knRows; ++i) { QSpinBox *pAmount = new QSpinBox(m_pMaintable, "Amount"); m_pMaintable->setCellWidget(i, 3, pAmount); } d342 1 a342 1 // Populate the task stringlist d348 12 a359 7 // Make the combobox items for all rows for (int i = 0; i < g_knRows; ++i) { QComboBox *pTasks = new QComboBox(true, m_pMaintable, "Tasks"); pTasks->insertStringList(*m_pTaskentries); pTasks->setCurrentText(NULL); pTasks->setAutoCompletion(true); m_pMaintable->setCellWidget(i, 4, pTasks); d362 2 a363 25 // // Make the listbox for all rows // for (int i = 0; i < knRows; ++i) { // QListBox *pTasks = new QListBox(m_pMaintable, "Tasks"); // pTasks->insertStringList(*pTaskentries); // pTasks->setCurrentItem(i % 8); // m_pMaintable->setCellWidget(i, 4, pTasks); // } // // Populate a listbox for the task combobox // QListBox *pListasks = new QListBox(m_pMaintable); // pListasks->insertItem("titraq"); // pListasks->insertItem("opgui"); // pListasks->insertItem("email"); // pListasks->insertItem("admin"); // pListasks->insertItem("pmod"); // pListasks->insertItem("psod"); // pListasks->insertItem("meeting"); // pListasks->insertItem("training"); // // Make the combobox items for all rows // for (int i = 0; i < knRows; ++i) { // QComboTableItem *pTasks = new QComboTableItem(m_pMaintable, *m_pTaskentries, false); // pTasks->setCurrentItem(i % 8); // m_pMaintable->setItem(i, 4, pTasks); // } d365 17 a381 26 m_pPackagelayout->addWidget(m_pMaintable); // Finally add the damn table } // // Construct the bottom output line // void Titraqform::setupOutput(void) { // Bottom output line m_pStatus = new QLineEdit(m_pCenframe, "Status"); if (m_pStatus == NULL) // Sanity check throw Genexcept("Main window status output creation failed."); m_pStatus->setText(trUtf8("Happy birthday to Ralf")); m_pStatus->setFrameShape(QLineEdit::LineEditPanel); m_pStatus->setFrameShadow(QLineEdit::Sunken); m_pStatus->setFrame(true); m_pStatus->setReadOnly(true); QToolTip::add(m_pStatus, trUtf8("Status Line")); m_pPackagelayout->addWidget(m_pStatus); // Finally add the status bar // Whatsthis info for the output line const char *kszStatouttext = trUtf8("

" "This line shows the current row of your accounting data." " You can also change the data in place, or above " "from the Accounting table."); QWhatsThis::add(m_pStatus, kszStatouttext); @ 1.2 log @Put this pig to bed, after some more restructuring, handling improvements, and display optimization. @ text @d15 1 d30 1 @ 1.1 log @Move methods assiting in construction of the GUI to titassist. @ text @d13 2 d69 3 d200 1 a200 11 // Construct the status bar // void Titraqform::setupStatusbar(void) { m_pStatbar = statusBar(); // Grab status bar owned by QMainWindow if (m_pStatbar == NULL) // Sanity check throw Genexcept("Main window status bar nonexistant."); } // // Construct the central widget d226 10 d339 1 a339 1 m_pPackagelayout->addWidget(m_pMaintable); // Finally add the damn table d357 1 a357 1 m_pPackagelayout->addWidget(m_pStatus); @