--- 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();
|