OSSP CVS Repository

ossp - Check-in [4063]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 4063
Date: 2003-Feb-20 18:08:43 (local)
2003-Feb-20 17:08:43 (UTC)
User:ms
Branch:
Comment: Added checkmarks to menus, so user knows how many weeks and months report.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/as_reportpanel.cpp      1.5 -> 1.6     20 inserted, 8 deleted

ossp-pkg/as/as-gui/as_reportpanel.cpp 1.5 -> 1.6

--- as_reportpanel.cpp   2003/02/20 16:51:05     1.5
+++ as_reportpanel.cpp   2003/02/20 17:08:43     1.6
@@ -127,6 +127,8 @@
     m_pWeekpop->insertItem(tr("Three weeks"), this, SLOT(reportWeeks(int)));
     m_pWeekpop->insertItem(tr("Four weeks"), this, SLOT(reportWeeks(int)));
     m_pWeekpop->insertItem(tr("N... weeks"), this, SLOT(reportWeeks(int)));
+    m_pWeekpop->setCheckable(true);
+    m_pWeekpop->setItemChecked(m_pWeekpop->idAt(m_nWeeks - 1), true);
     m_pWeeklybutt->setPopup(m_pWeekpop);
     m_pWeeklybutt->setPopupDelay(TITRAQ_POPUPMSECS);
 
@@ -139,6 +141,8 @@
     m_pMonthpop->insertItem(tr("Three months"), this, SLOT(reportMonths(int)));
     m_pMonthpop->insertItem(tr("Four months"), this, SLOT(reportMonths(int)));
     m_pMonthpop->insertItem(tr("N... months"), this, SLOT(reportMonths(int)));
+    m_pMonthpop->setCheckable(true);
+    m_pMonthpop->setItemChecked(m_pMonthpop->idAt(m_nMonths - 1), true);
     m_pMonthlybutt->setPopup(m_pMonthpop);
     m_pMonthlybutt->setPopupDelay(TITRAQ_POPUPMSECS);
 
@@ -208,9 +212,16 @@
     // Menu index, first item is always 0
     int nIndex = m_pWeekpop->indexOf(nMenuid);
 
+    // Set the button in case from a menu selection
+    m_pWeekmonthgroup->setButton(TITRAQ_REPORTWEEK);
+
     // Update m_nWeeks only if user prefers a different number
-    if (nIndex >= 0)
+    if (nIndex >= 0) {
+        int nLastid = m_pWeekpop->idAt(m_nWeeks - 1);
         m_nWeeks = nIndex + 1;
+        m_pWeekpop->setItemChecked(nLastid, false);
+        m_pWeekpop->setItemChecked(nMenuid, true);
+    }
 
     // User selected N... to indicate an arbitrary number
     if (nIndex == m_pWeekpop->count() - 1) {
@@ -218,9 +229,6 @@
         Unimp.doMbox();
     }
 
-    // Set the button in case we arrived from a menu selection
-    m_pWeekmonthgroup->setButton(TITRAQ_REPORTWEEK);
-
     // Clear data window and write header out
     m_pBrowser->setUpdatesEnabled(false);
     m_pBrowser->clear();
@@ -241,9 +249,16 @@
     // Menu index, first item is always 0
     int nIndex = m_pMonthpop->indexOf(nMenuid);
 
+    // Set the button in case from a menu selection
+    m_pWeekmonthgroup->setButton(TITRAQ_REPORTMONTH);
+
     // Update m_nMonths only if user prefers a different number
-    if (nIndex >= 0)
+    if (nIndex >= 0) {
+        int nLastid = m_pMonthpop->idAt(m_nMonths - 1);
         m_nMonths = nIndex + 1;
+        m_pMonthpop->setItemChecked(nLastid, false);
+        m_pMonthpop->setItemChecked(nMenuid, true);
+    }
 
     // User selected N... to indicate an arbitrary number
     if (nIndex == m_pMonthpop->count() - 1) {
@@ -251,9 +266,6 @@
         Unimp.doMbox();
     }
 
-    // Set the button in case we arrived from a menu selection
-    m_pWeekmonthgroup->setButton(TITRAQ_REPORTMONTH);
-
     // Clear data window and write header out
     m_pBrowser->setUpdatesEnabled(false);
     m_pBrowser->clear();

CVSTrac 2.0.1