mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-04 18:20:42 +00:00
Add Daily Search Item; searh for any Journal item. notes,bookmarks,weight,feelings
This commit is contained in:
parent
37097ee3ce
commit
c53c22bc90
@ -30,6 +30,7 @@
|
|||||||
#include "dailySearchTab.h"
|
#include "dailySearchTab.h"
|
||||||
#include "SleepLib/day.h"
|
#include "SleepLib/day.h"
|
||||||
#include "SleepLib/profiles.h"
|
#include "SleepLib/profiles.h"
|
||||||
|
#include "SleepLib/journal.h"
|
||||||
#include "daily.h"
|
#include "daily.h"
|
||||||
#include "SleepLib/machine_common.h"
|
#include "SleepLib/machine_common.h"
|
||||||
|
|
||||||
@ -468,6 +469,7 @@ void DailySearchTab::populateControl() {
|
|||||||
|
|
||||||
// Now add events
|
// Now add events
|
||||||
commandList->clear();
|
commandList->clear();
|
||||||
|
addCommandItem(tr("Journal"),ST_JOURNAL);
|
||||||
addCommandItem(tr("Notes"),ST_NOTES);
|
addCommandItem(tr("Notes"),ST_NOTES);
|
||||||
addCommandItem(tr("Notes containing"),ST_NOTES_STRING);
|
addCommandItem(tr("Notes containing"),ST_NOTES_STRING);
|
||||||
addCommandItem(tr("Bookmarks"),ST_BOOKMARKS);
|
addCommandItem(tr("Bookmarks"),ST_BOOKMARKS);
|
||||||
@ -505,6 +507,7 @@ void DailySearchTab::populateControl() {
|
|||||||
void DailySearchTab::setState(STATE newState) {
|
void DailySearchTab::setState(STATE newState) {
|
||||||
STATE prev=state;
|
STATE prev=state;
|
||||||
state = newState;
|
state = newState;
|
||||||
|
//enum STATE { reset , waitForSearchTopic , matching , multpileMatches , waitForStart , autoStart , searching , endOfSeaching , waitForContinue , noDataFound};
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case multpileMatches :
|
case multpileMatches :
|
||||||
break;
|
break;
|
||||||
@ -826,6 +829,47 @@ bool DailySearchTab::matchFind(Match* myMatch ,Day* day, QDate& date, Qt::Alignm
|
|||||||
myMatch->updateMinMaxValues(numDisabled);
|
myMatch->updateMinMaxValues(numDisabled);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ST_JOURNAL :
|
||||||
|
{
|
||||||
|
Session* journal=daily->GetJournalSession(date,false);
|
||||||
|
if (journal) {
|
||||||
|
myMatch->foundString = journal->settings[LastUpdated].toDateTime().toString();
|
||||||
|
myMatch->foundString.append(" ");
|
||||||
|
bool empty =true;
|
||||||
|
if ( journal->settings.contains(Bookmark_Start) ) {
|
||||||
|
if (journal->settings[Bookmark_Start].toList().size()>0) {
|
||||||
|
empty = false;
|
||||||
|
myMatch->foundString.append("B");
|
||||||
|
/* Not reuired.
|
||||||
|
if ( journal->settings.contains(Bookmark_Notes) ) {
|
||||||
|
if (journal->settings[Bookmark_Start].toList().size()>0) {
|
||||||
|
myMatch->foundString.append("n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( journal->settings.contains(Journal_Notes) ) {
|
||||||
|
myMatch->foundString.append("N");
|
||||||
|
empty = false;
|
||||||
|
}
|
||||||
|
if ( journal->settings.contains(Journal_Weight) ) {
|
||||||
|
myMatch->foundString.append("W");
|
||||||
|
empty = false;
|
||||||
|
}
|
||||||
|
if ( journal->settings.contains(Journal_ZombieMeter) ) {
|
||||||
|
myMatch->foundString.append("F");
|
||||||
|
empty = false;
|
||||||
|
}
|
||||||
|
if (empty) {
|
||||||
|
break;
|
||||||
|
myMatch->foundString.append(tr("Empty"));
|
||||||
|
}
|
||||||
|
found=true;
|
||||||
|
alignment=Qt::AlignLeft;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case ST_NOTES :
|
case ST_NOTES :
|
||||||
{
|
{
|
||||||
Session* journal=daily->GetJournalSession(date,false);
|
Session* journal=daily->GetJournalSession(date,false);
|
||||||
@ -1164,6 +1208,11 @@ void DailySearchTab::process_match_info(QString text, int topic) {
|
|||||||
selectInteger->setValue(0);
|
selectInteger->setValue(0);
|
||||||
setoperation(OP_NO_PARMS,displayWhole);
|
setoperation(OP_NO_PARMS,displayWhole);
|
||||||
break;
|
break;
|
||||||
|
case ST_JOURNAL :
|
||||||
|
setResult(DS_ROW_HEADER,1,QDate(),tr("JUmps\nJumps to Date's Notes"));
|
||||||
|
match->nextTab = TW_NOTES ;
|
||||||
|
setoperation( OP_NO_PARMS ,displayString);
|
||||||
|
break;
|
||||||
case ST_NOTES :
|
case ST_NOTES :
|
||||||
setResult(DS_ROW_HEADER,1,QDate(),tr("Note\nJumps to Date's Notes"));
|
setResult(DS_ROW_HEADER,1,QDate(),tr("Note\nJumps to Date's Notes"));
|
||||||
match->nextTab = TW_NOTES ;
|
match->nextTab = TW_NOTES ;
|
||||||
|
@ -47,7 +47,7 @@ class Daily; //forward declaration.
|
|||||||
|
|
||||||
enum ValueMode { invalidValueMode , notUsed , minutesToMs , hoursToMs , hundredths , opWhole , displayWhole , opString , displayString, secondsDisplayString};
|
enum ValueMode { invalidValueMode , notUsed , minutesToMs , hoursToMs , hundredths , opWhole , displayWhole , opString , displayString, secondsDisplayString};
|
||||||
|
|
||||||
enum SearchTopic { ST_NONE , ST_DAYS_SKIPPED , ST_DISABLED_SESSIONS , ST_NOTES , ST_NOTES_STRING , ST_BOOKMARKS , ST_BOOKMARKS_STRING , ST_AHI , ST_SESSION_LENGTH , ST_SESSIONS_QTY , ST_DAILY_USAGE , ST_APNEA_LENGTH , ST_APNEA_ALL , ST_CLEAR , ST_EVENT };
|
enum SearchTopic { ST_NONE , ST_DAYS_SKIPPED , ST_DISABLED_SESSIONS , ST_JOURNAL , ST_NOTES , ST_NOTES_STRING , ST_BOOKMARKS , ST_BOOKMARKS_STRING , ST_AHI , ST_SESSION_LENGTH , ST_SESSIONS_QTY , ST_DAILY_USAGE , ST_APNEA_LENGTH , ST_APNEA_ALL , ST_CLEAR , ST_EVENT };
|
||||||
|
|
||||||
enum OpCode {
|
enum OpCode {
|
||||||
//DO NOT CHANGE NUMERIC OP CODES because THESE VALUES impact compare operations.
|
//DO NOT CHANGE NUMERIC OP CODES because THESE VALUES impact compare operations.
|
||||||
|
Loading…
Reference in New Issue
Block a user