Ticket #8787: statusbox.patch
File statusbox.patch, 3.0 KB (added by , 14 years ago) |
---|
-
mythtv/programs/mythfrontend/statusbox.cpp
51 51 m_timeFormat = gCoreContext->GetSetting("TimeFormat", "h:mm AP"); 52 52 m_timeDateFormat = QString("%1 %2").arg(m_timeFormat).arg(m_dateFormat); 53 53 54 m_currentExpIndex = -1; 55 54 56 m_minLevel = gCoreContext->GetNumSetting("LogDefaultView",5); 55 57 56 58 m_iconState = NULL; … … 438 440 ProgramInfo* rec = qVariantValue<ProgramInfo*>(dce->GetData()); 439 441 if (!rec) 440 442 return; 443 444 m_currentExpIndex = m_logList->GetCurrentPos(); 445 m_currentExpItem = *rec; 441 446 442 447 if ((buttonnum == 0) && rec->QueryIsDeleteCandidate()) 443 448 { … … 1283 1288 int liveTVCount(0); 1284 1289 long long deletedGroupSize(0); 1285 1290 int deletedGroupCount(0); 1291 1292 bool matchedCurrentItem = false; 1293 bool itemSelected = false; 1294 int selectionOffset = -1; 1286 1295 1287 1296 vector<ProgramInfo *>::iterator it; 1288 1297 for (it = m_expList.begin(); it != m_expList.end(); ++it) … … 1343 1352 detailInfo += "\n" + pginfo->toString(ProgramInfo::kTitleSubtitle, " - "); 1344 1353 1345 1354 AddLogLine(contentLine, detailInfo); 1355 1356 // If the previously selected item still exists in the list and its recording group hasn't 1357 // changed, then leave it selected. 1358 if (!matchedCurrentItem && m_currentExpItem.IsSameRecording(*pginfo)) 1359 { 1360 int index = m_logList->GetCount() - 1; 1361 if (m_currentExpItem.GetRecordingGroup() == pginfo->GetRecordingGroup()) 1362 { 1363 m_logList->SetItemCurrent(index); 1364 itemSelected = true; 1365 } 1366 else if (index <= m_currentExpIndex) 1367 { 1368 selectionOffset = 0; 1369 } 1370 matchedCurrentItem = true; 1371 } 1346 1372 } 1347 1373 1374 // If the previously selected item has been removed or moved to a different section of the list 1375 // select the item that preceded it. 1376 if (!itemSelected && m_currentExpIndex > 0) 1377 { 1378 m_logList->SetItemCurrent(m_currentExpIndex + selectionOffset); 1379 } 1380 1381 m_currentExpIndex = -1; 1348 1382 } 1349 1383 1350 1384 /* vim: set expandtab tabstop=4 shiftwidth=4: */ -
mythtv/programs/mythfrontend/statusbox.h
6 6 using namespace std; 7 7 8 8 #include "mythscreentype.h" 9 #include "programinfo.h" 9 10 10 11 class ProgramInfo; 11 12 class MythUIText; … … 62 63 recprof2bps_t recordingProfilesBPS; 63 64 64 65 vector<ProgramInfo *> m_expList; 66 ProgramInfo m_currentExpItem; 67 int m_currentExpIndex; 65 68 66 69 MythScreenStack *m_popupStack; 67 70