Ticket #5338: mythvideo_watched.patch
File mythvideo_watched.patch, 41.6 KB (added by , 16 years ago) |
---|
-
mythvideo/theme/default/video-ui.xml
159 159 <font>moviedata</font> 160 160 </textarea> 161 161 162 163 <textarea name="watchlbl" draworder="4" align="right"> 164 <area>500,165,170,35</area> 165 <font>labels</font> 166 <value>Watched:</value> 167 </textarea> 168 169 <textarea name="watchable" draworder="4"> 170 <area>680,165,100,35</area> 171 <font>moviedata</font> 172 </textarea> 173 162 174 <textarea name="lenlbl" draworder="4"> 163 175 <area>20,135,150,35</area> 164 176 <font>labels</font> … … 1149 1161 <value>Include while Browsing:</value> 1150 1162 </textarea> 1151 1163 1152 <textarea name="coverart_text_label" draworder="0" align="right">1164 <textarea name="watched_text" draworder="0" align="right"> 1153 1165 <area>50,400,250,40</area> 1154 1166 <font>display</font> 1167 <value>Mark as Watched:</value> 1168 </textarea> 1169 1170 1171 <textarea name="coverart_text_label" draworder="0" align="right"> 1172 <area>50,450,250,40</area> 1173 <font>display</font> 1155 1174 <value>Cover Art:</value> 1156 1175 </textarea> 1157 1176 1158 1177 <textarea name="player_text" draworder="0" align="right"> 1159 <area>50,4 45,250,40</area>1178 <area>50,495,250,40</area> 1160 1179 <font>display</font> 1161 1180 <value>Unique Player Command:</value> 1162 1181 </textarea> … … 1208 1227 <image function="unchecked_high" filename="unchecked_high.png"></image> 1209 1228 </checkbox> 1210 1229 1230 <checkbox name="watched_check" draworder="0"> 1231 <position>310,395</position> 1232 <image function="checked" filename="checked.png"></image> 1233 <image function="unchecked" filename="unchecked.png"></image> 1234 <image function="checked_high" filename="checked_high.png"></image> 1235 <image function="unchecked_high" filename="unchecked_high.png"></image> 1236 </checkbox> 1237 1211 1238 <pushbutton name="coverart_button" draworder="0"> 1212 <position>310, 395</position>1239 <position>310,445</position> 1213 1240 <image function="on" filename="blankbutton_on.png"></image> 1214 1241 <image function="off" filename="blankbutton_off.png"></image> 1215 1242 <image function="pushed" filename="blankbutton_pushed.png"></image> 1216 1243 </pushbutton> 1217 1244 1218 1245 <textarea name="coverart_text" draworder="0" align="left"> 1219 <area>350,4 00,250,40</area>1246 <area>350,445,250,40</area> 1220 1247 <font>display</font> 1221 1248 <value>/path/to/the/thing.jpg</value> 1222 1249 </textarea> 1223 1250 1224 1251 <remoteedit name="player" draworder="0"> 1225 <area>310,4 45,300,40</area>1252 <area>310,495,300,40</area> 1226 1253 <font>display</font> 1227 1254 </remoteedit> 1228 1255 1229 1256 <textbutton name="done_button" draworder="0"> 1230 <position>310,5 05</position>1257 <position>310,535</position> 1231 1258 <font>display</font> 1232 1259 <image function="on" filename="mv_large_text_button_on.png"></image> 1233 1260 <image function="off" filename="mv_large_text_button_off.png"></image> … … 1372 1399 <value>Browse :</value> 1373 1400 </textarea> 1374 1401 1375 <textarea name=" inetref_text" draworder="0" align="right">1402 <textarea name="watched_text" draworder="0" align="right"> 1376 1403 <area>50,344,320,34</area> 1377 1404 <font>display</font> 1405 <value>Watched :</value> 1406 </textarea> 1407 1408 <textarea name="inetref_text" draworder="0" align="right"> 1409 <area>50,378,320,34</area> 1410 <font>display</font> 1378 1411 <value>InetRef :</value> 1379 1412 </textarea> 1380 1413 1381 1414 <textarea name="coverfile_text" draworder="0" align="right"> 1382 <area>50, 378,320,34</area>1415 <area>50,416,320,34</area> 1383 1416 <font>display</font> 1384 1417 <value>Cover File :</value> 1385 1418 </textarea> 1386 1419 1387 1420 <textarea name="orderby_text" draworder="0" align="right"> 1388 <area>50,4 16,320,34</area>1421 <area>50,450,320,34</area> 1389 1422 <font>display</font> 1390 1423 <value>Sort by :</value> 1391 1424 </textarea> … … 1456 1489 <image function="pushed" filename="leftright_pushed.png"></image> 1457 1490 </selector> 1458 1491 1459 <selector name=" inetref_select" draworder="0">1492 <selector name="watched_select" draworder="0"> 1460 1493 <area>380,342,300,34</area> 1461 1494 <font>display</font> 1462 1495 <image function="on" filename="leftright_on.png"></image> … … 1464 1497 <image function="pushed" filename="leftright_pushed.png"></image> 1465 1498 </selector> 1466 1499 1467 <selector name=" coverfile_select" draworder="0">1500 <selector name="inetref_select" draworder="0"> 1468 1501 <area>380,376,300,34</area> 1469 1502 <font>display</font> 1470 1503 <image function="on" filename="leftright_on.png"></image> … … 1472 1505 <image function="pushed" filename="leftright_pushed.png"></image> 1473 1506 </selector> 1474 1507 1475 <selector name=" orderby_select" draworder="0">1508 <selector name="coverfile_select" draworder="0"> 1476 1509 <area>380,414,300,34</area> 1477 1510 <font>display</font> 1478 1511 <image function="on" filename="leftright_on.png"></image> … … 1480 1513 <image function="pushed" filename="leftright_pushed.png"></image> 1481 1514 </selector> 1482 1515 1516 <selector name="orderby_select" draworder="0"> 1517 <area>380,448,300,34</area> 1518 <font>display</font> 1519 <image function="on" filename="leftright_on.png"></image> 1520 <image function="off" filename="leftright_off.png"></image> 1521 <image function="pushed" filename="leftright_pushed.png"></image> 1522 </selector> 1523 1483 1524 <textbutton name="done_button" draworder="0"> 1484 <position> 250,448</position>1525 <position>050,482</position> 1485 1526 <font>display</font> 1486 1527 <image function="on" filename="mv_large_text_button_on.png"></image> 1487 1528 <image function="off" filename="mv_large_text_button_off.png"></image> … … 1489 1530 </textbutton> 1490 1531 1491 1532 <textbutton name="save_button" draworder="0"> 1492 <position> 250,505</position>1533 <position>400,482</position> 1493 1534 <font>display</font> 1494 1535 <image function="on" filename="mv_large_text_button_on.png"></image> 1495 1536 <image function="off" filename="mv_large_text_button_off.png"></image> -
mythvideo/theme/default-wide/video-ui.xml
161 161 <font>moviedata</font> 162 162 </textarea> 163 163 164 165 <textarea name="watchlbl" draworder="4" align="right"> 166 <area>822,165,240,35</area> 167 <font>labels</font> 168 <value>Watched:</value> 169 </textarea> 170 171 <textarea name="watchable" draworder="4"> 172 <area>1077,165,75,35</area> 173 <font>moviedata</font> 174 </textarea> 175 164 176 <textarea name="lenlbl" draworder="4" align="right"> 165 177 <area>0,135,155,35</area> 166 178 <font>labels</font> … … 1158 1170 <value>Include while Browsing:</value> 1159 1171 </textarea> 1160 1172 1161 <textarea name="coverart_text_label" draworder="0" align="right">1173 <textarea name="watched_text" draworder="0" align="right"> 1162 1174 <area>0,400,400,40</area> 1163 1175 <font>display</font> 1176 <value>Mark as Watched:</value> 1177 </textarea> 1178 1179 1180 <textarea name="coverart_text_label" draworder="0" align="right"> 1181 <area>0,450,400,40</area> 1182 <font>display</font> 1164 1183 <value>Cover Art:</value> 1165 1184 </textarea> 1166 1185 1167 1186 <textarea name="player_text" draworder="0" align="right"> 1168 <area>0, 445,400,40</area>1187 <area>0,550,400,40</area> 1169 1188 <font>display</font> 1170 1189 <value>Unique Player Command:</value> 1171 1190 </textarea> … … 1217 1236 <image function="unchecked_high" filename="unchecked_high.png"></image> 1218 1237 </checkbox> 1219 1238 1239 <checkbox name="watched_check" draworder="0"> 1240 <position>410,395</position> 1241 <image function="checked" filename="checked.png"></image> 1242 <image function="unchecked" filename="unchecked.png"></image> 1243 <image function="checked_high" filename="checked_high.png"></image> 1244 <image function="unchecked_high" filename="unchecked_high.png"></image> 1245 </checkbox> 1246 1220 1247 <pushbutton name="coverart_button" draworder="0"> 1221 <position>410, 395</position>1248 <position>410,450</position> 1222 1249 <image function="on" filename="blankbutton_on.png"></image> 1223 1250 <image function="off" filename="blankbutton_off.png"></image> 1224 1251 <image function="pushed" filename="blankbutton_pushed.png"></image> 1225 1252 </pushbutton> 1226 1253 1227 1254 <textarea name="coverart_text" draworder="0" align="left"> 1228 <area>452, 400,572,40</area>1255 <area>452,500,572,40</area> 1229 1256 <font>display</font> 1230 1257 <value>/path/to/the/thing.jpg</value> 1231 1258 </textarea> 1232 1259 1233 1260 <remoteedit name="player" draworder="0"> 1234 <area>410, 445,614,40</area>1261 <area>410,550,614,40</area> 1235 1262 <font>display</font> 1236 1263 </remoteedit> 1237 1264 1238 1265 <textbutton name="done_button" draworder="0"> 1239 <position>410,59 8</position>1266 <position>410,590</position> 1240 1267 <font>display</font> 1241 1268 <image function="on" filename="mv_large_text_button_on.png"></image> 1242 1269 <image function="off" filename="mv_large_text_button_off.png"></image> … … 1381 1408 <value>Browse :</value> 1382 1409 </textarea> 1383 1410 1384 <textarea name=" inetref_text" draworder="0" align="right">1411 <textarea name="watched_text" draworder="0" align="right"> 1385 1412 <area>0,420,572,40</area> 1386 1413 <font>display</font> 1414 <value>Watched :</value> 1415 </textarea> 1416 1417 <textarea name="inetref_text" draworder="0" align="right"> 1418 <area>0,460,572,40</area> 1419 <font>display</font> 1387 1420 <value>InetRef :</value> 1388 1421 </textarea> 1389 1422 1390 1423 <textarea name="coverfile_text" draworder="0" align="right"> 1391 <area>0, 460,572,40</area>1424 <area>0,500,572,40</area> 1392 1425 <font>display</font> 1393 1426 <value>Cover File :</value> 1394 1427 </textarea> 1395 1428 1396 1429 <textarea name="orderby_text" draworder="0" align="right"> 1397 <area>0,5 00,572,40</area>1430 <area>0,540,572,40</area> 1398 1431 <font>display</font> 1399 1432 <value>Sort by :</value> 1400 1433 </textarea> … … 1465 1498 <image function="pushed" filename="leftright_pushed.png"></image> 1466 1499 </selector> 1467 1500 1468 <selector name=" inetref_select" draworder="0">1501 <selector name="watched_select" draworder="0"> 1469 1502 <area>580,420,300,40</area> 1470 1503 <font>display</font> 1471 1504 <image function="on" filename="leftright_on.png"></image> … … 1473 1506 <image function="pushed" filename="leftright_pushed.png"></image> 1474 1507 </selector> 1475 1508 1476 <selector name=" coverfile_select" draworder="0">1509 <selector name="inetref_select" draworder="0"> 1477 1510 <area>580,460,300,40</area> 1478 1511 <font>display</font> 1479 1512 <image function="on" filename="leftright_on.png"></image> … … 1481 1514 <image function="pushed" filename="leftright_pushed.png"></image> 1482 1515 </selector> 1483 1516 1484 <selector name=" orderby_select" draworder="0">1517 <selector name="coverfile_select" draworder="0"> 1485 1518 <area>580,500,300,40</area> 1486 1519 <font>display</font> 1487 1520 <image function="on" filename="leftright_on.png"></image> … … 1489 1522 <image function="pushed" filename="leftright_pushed.png"></image> 1490 1523 </selector> 1491 1524 1525 <selector name="orderby_select" draworder="0"> 1526 <area>580,540,300,40</area> 1527 <font>display</font> 1528 <image function="on" filename="leftright_on.png"></image> 1529 <image function="off" filename="leftright_off.png"></image> 1530 <image function="pushed" filename="leftright_pushed.png"></image> 1531 </selector> 1532 1492 1533 <textbutton name="done_button" draworder="0"> 1493 <position> 426,540</position>1534 <position>226,600</position> 1494 1535 <font>display</font> 1495 1536 <image function="on" filename="mv_large_text_button_on.png"></image> 1496 1537 <image function="off" filename="mv_large_text_button_off.png"></image> … … 1498 1539 </textbutton> 1499 1540 1500 1541 <textbutton name="save_button" draworder="0"> 1501 <position> 426,604</position>1542 <position>636,600</position> 1502 1543 <font>display</font> 1503 1544 <image function="on" filename="mv_large_text_button_on.png"></image> 1504 1545 <image function="off" filename="mv_large_text_button_off.png"></image> -
mythvideo/mythvideo/videodlg.h
42 42 void slotViewPlot(); 43 43 void slotViewCast(); 44 44 void slotDoFilter(); 45 void slotToggleWatched(); 45 46 void exitWin(); 46 47 virtual void slotParentalLevelChanged(); 47 48 virtual void slotWatchVideo(); -
mythvideo/mythvideo/metadatalistmanager.cpp
116 116 const QString BaseMetadataQuery( 117 117 "SELECT title, director, plot, rating, year, userrating," 118 118 "length, filename, showlevel, coverfile, inetref, childid," 119 "browse, playcommand, category, intid FROM videometadata");119 "browse, playcommand, category, intid, watched FROM videometadata"); 120 120 121 121 query.prepare(BaseMetadataQuery); 122 122 -
mythvideo/mythvideo/metadata.cpp
2 2 #include <qdir.h> 3 3 #include <qfileinfo.h> 4 4 #include <qregexp.h> 5 #include <stdio.h> 5 6 6 7 #include <cmath> 7 8 … … 95 96 const QString &plot, float userrating, 96 97 const QString &rating, int length, 97 98 int id, ParentalLevel::Level showlevel, int categoryID, 98 int childID, bool browse, 99 int childID, bool browse, bool watched, 99 100 const QString &playcommand, const QString &category, 100 101 const genre_list &genres, 101 102 const country_list &countries, … … 106 107 m_genres(genres), m_countries(countries), m_cast(cast), 107 108 m_filename(filename), m_coverfile(coverfile), 108 109 m_categoryID(categoryID), m_childID(childID), m_year(year), 109 m_length(length), m_showlevel(showlevel), m_browse(browse), m_ id(id),110 m_length(length), m_showlevel(showlevel), m_browse(browse), m_watched(watched) , m_id(id), 110 111 m_userrating(userrating) 111 112 { 112 113 VideoCategory::getCategory().get(m_categoryID, m_category); … … 146 147 m_length = rhs.m_length; 147 148 m_showlevel = rhs.m_showlevel; 148 149 m_browse = rhs.m_browse; 150 m_watched = rhs.m_watched; 149 151 m_id = rhs.m_id; 150 152 m_userrating = rhs.m_userrating; 151 153 … … 256 258 bool getBrowse() const { return m_browse; } 257 259 void setBrowse(bool browse) { m_browse = browse; } 258 260 261 bool getWatched() const { return m_watched; } 262 void setWatched(bool watched) { m_watched = watched; } 263 264 265 266 259 267 unsigned int getID() const { return m_id; } 260 268 void setID(int id) { m_id = id; } 261 269 … … 303 311 int m_length; 304 312 ParentalLevel::Level m_showlevel; 305 313 bool m_browse; 314 bool m_watched; 306 315 unsigned int m_id; // videometadata.intid 307 316 float m_userrating; 308 317 … … 404 413 Metadata::FilenameToTitle(m_filename), VIDEO_YEAR_DEFAULT, 405 414 VIDEO_INETREF_DEFAULT, VIDEO_DIRECTOR_DEFAULT, 406 415 VIDEO_PLOT_DEFAULT, 0.0, VIDEO_RATING_DEFAULT, 0, m_id, 407 ParentalLevel::plLowest, 0, -1, true, "", "",416 ParentalLevel::plLowest, 0, -1, true, false, "", "", 408 417 Metadata::genre_list(), Metadata::country_list(), Metadata::cast_list()); 409 418 tmp.m_prefix = m_prefix; 410 419 tmp.m_flat_index = m_flat_index; … … 492 501 m_playcommand = query.value(13).toString(); 493 502 m_categoryID = query.value(14).toInt(); 494 503 m_id = query.value(15).toInt(); 495 504 m_watched = query.value(16).toBool(); 496 505 VideoCategory::getCategory().get(m_categoryID, m_category); 497 506 498 507 // Genres … … 531 540 if (inserting) 532 541 { 533 542 m_browse = gContext->GetNumSetting("VideoNewBrowsable", 1); 543 // watched is default not set 544 m_watched = 0; 534 545 535 546 query.prepare("INSERT INTO videometadata (title,director,plot," 536 547 "rating,year,userrating,length,filename,showlevel," 537 "coverfile,inetref,browse ) VALUES (:TITLE, :DIRECTOR, "548 "coverfile,inetref,browse,watched) VALUES (:TITLE, :DIRECTOR, " 538 549 ":PLOT, :RATING, :YEAR, :USERRATING, :LENGTH, " 539 ":FILENAME, :SHOWLEVEL, :COVERFILE, :INETREF, :BROWSE )");550 ":FILENAME, :SHOWLEVEL, :COVERFILE, :INETREF, :BROWSE, :WATCHED)"); 540 551 541 552 } 542 553 else … … 546 557 "year = :YEAR, userrating = :USERRATING, " 547 558 "length = :LENGTH, filename = :FILENAME, " 548 559 "showlevel = :SHOWLEVEL, coverfile = :COVERFILE, " 549 "inetref = :INETREF, browse = :BROWSE, "560 "inetref = :INETREF, browse = :BROWSE, watched = :WATCHED, " 550 561 "playcommand = :PLAYCOMMAND, childid = :CHILDID, " 551 562 "category = :CATEGORY WHERE intid = :INTID"); 552 563 … … 568 579 query.bindValue(":COVERFILE", m_coverfile.utf8()); 569 580 query.bindValue(":INETREF", m_inetref.utf8()); 570 581 query.bindValue(":BROWSE", m_browse); 582 query.bindValue(":WATCHED", m_watched); 571 583 572 584 if (!query.exec() || !query.isActive()) 573 585 { … … 905 917 const QString &plot, float userrating, 906 918 const QString &rating, int length, 907 919 int id, ParentalLevel::Level showlevel, int categoryID, 908 int childID, bool browse, 920 int childID, bool browse,bool watched, 909 921 const QString &playcommand, const QString &category, 910 922 const genre_list &genres, 911 923 const country_list &countries, 912 924 const cast_list &cast) 913 925 { 926 914 927 m_imp = new MetadataImp(filename, coverfile, title, year, inetref, director, 915 928 plot, userrating, rating, length, id, showlevel, 916 categoryID, childID, browse, playcommand, category,929 categoryID, childID, browse, watched, playcommand, category, 917 930 genres, countries, cast); 918 931 } 919 932 … … 1088 1101 m_imp->setBrowse(browse); 1089 1102 } 1090 1103 1104 bool Metadata::Watched() const 1105 { 1106 return m_imp->getWatched(); 1107 } 1108 1109 void Metadata::setWatched(bool watched) 1110 { 1111 m_imp->setWatched(watched); 1112 } 1113 1091 1114 const QString &Metadata::PlayCommand() const 1092 1115 { 1093 1116 return m_imp->getPlayCommand(); -
mythvideo/mythvideo/videofilter.h
35 35 kFilterInetRefChanged = (1 << 8), 36 36 kFilterCoverFileChanged = (1 << 9), 37 37 kFilterParentalLevelChanged = (1 << 10), 38 kFilterCastChanged = (1 << 11) 38 kFilterCastChanged = (1 << 11), 39 kFilterWatchedChanged = (1 << 12) 39 40 }; 40 41 41 42 public: … … 125 126 orderby = lorderby; 126 127 } 127 128 129 int getWatched() const {return watched; } 130 void setWatched(int lwatched) 131 { 132 m_changed_state |= kFilterWatchedChanged; 133 watched = lwatched; 134 } 135 136 128 137 ParentalLevel::Level getParentalLevel() const { return m_parental_level; } 129 138 void setParentalLevel(ParentalLevel::Level parental_level) 130 139 { … … 162 171 int runtime; 163 172 int userrating; 164 173 int browse; 174 int watched; 165 175 int m_inetref; 166 176 int m_coverfile; 167 177 ordering orderby; … … 236 246 void setInetRef(int new_inetref); 237 247 void setCoverFile(int new_coverfile); 238 248 void setOrderby(int new_orderby); 249 void setWatched(int new_watched); 239 250 240 251 private: 241 252 void update_numvideo(); … … 244 255 // GUI Stuff 245 256 // 246 257 UISelectorType *browse_select; 258 UISelectorType *watched_select; 247 259 UISelectorType *orderby_select; 248 260 UISelectorType *year_select; 249 261 UISelectorType *userrating_select; … … 256 268 UITextButtonType *done_button; 257 269 UITextType *numvideos_text; 258 270 271 259 272 UISelectorType *m_intetref_select; 260 273 UISelectorType *m_coverfile_select; 261 274 -
mythvideo/mythvideo/dbcheck.cpp
13 13 const QString lastMythDVDDBVersion = "1002"; 14 14 const QString lastMythVideoVersion = "1010"; 15 15 16 const QString currentDatabaseVersion = "101 6";16 const QString currentDatabaseVersion = "1017"; 17 17 18 18 19 const QString OldMythVideoVersionName = "VideoDBSchemaVer"; 19 20 const QString OldMythDVDVersionName = "DVDDBSchemaVer"; 20 21 … … 646 647 "ALTER TABLE videometadata MODIFY inetref VARCHAR(255) NOT NULL;"; 647 648 performActualUpdate(updates, "1016", dbver, MythVideoVersionName); 648 649 } 650 651 if (dbver == "1016") 652 { 653 QStringList updates; 654 updates += 655 "ALTER TABLE videometadata ADD watched BOOL NOT NULL DEFAULT 0;"; 656 performActualUpdate(updates, "1017", dbver, MythVideoVersionName); 657 } 658 659 649 660 } 650 661 } 651 662 -
mythvideo/mythvideo/videotree.cpp
36 36 UITextType *m_coverfile; 37 37 UITextType *m_child_id; 38 38 UITextType *m_browseable; 39 UITextType *m_watchable; 39 40 UITextType *m_category; 40 41 UITextType *m_level; 41 42 … … 48 49 video_file(NULL), video_plot(NULL), video_cast(NULL), video_player(NULL), 49 50 pl_value(NULL), video_poster(NULL), m_director(NULL), m_rating(NULL), 50 51 m_inetref(NULL), m_year(NULL), m_userrating(NULL), m_length(NULL), 51 m_coverfile(NULL), m_child_id(NULL), m_browseable(NULL) ,52 m_coverfile(NULL), m_child_id(NULL), m_browseable(NULL) , m_watchable(NULL), 52 53 m_category(NULL), m_level(NULL) 53 54 { 54 55 m_use_arrow_accel = gContext->GetNumSetting("UseArrowAccels", 1); … … 99 100 assign(vt, m_coverfile, "coverfile", false); 100 101 assign(vt, m_child_id, "child_id", false); 101 102 assign(vt, m_browseable, "browseable", false); 103 assign(vt, m_watchable, "watchable", false); 102 104 assign(vt, m_category, "category", false); 103 105 assign(vt, m_level, "level", false); 104 106 } … … 124 126 checkedSetText(m_coverfile, ""); 125 127 checkedSetText(m_child_id, ""); 126 128 checkedSetText(m_browseable, ""); 129 checkedSetText(m_watchable, ""); 127 130 checkedSetText(m_category, ""); 128 131 checkedSetText(m_level, ""); 129 132 } … … 168 171 checkedSetText(m_coverfile, item->CoverFile()); 169 172 checkedSetText(m_child_id, QString::number(item->ChildID())); 170 173 checkedSetText(m_browseable, getDisplayBrowse(item->Browse())); 174 checkedSetText(m_watchable, getDisplayWatched(item->Watched())); 171 175 checkedSetText(m_category, item->Category()); 172 176 checkedSetText(m_level, QString::number(item->ShowLevel())); 173 177 } … … 460 464 SLOT(slotWatchVideo())); 461 465 popup->addButton(tr("View Full Plot"), this, SLOT(slotViewPlot())); 462 466 popup->addButton(tr("View Cast"), this, SLOT(slotViewCast())); 467 popup->addButton(tr("Toggle Watched"), this, SLOT(ToggleWatched())); 463 468 } 464 469 else 465 470 { … … 469 474 SLOT(slotVideoBrowser())); 470 475 popup->addButton(tr("Switch to Gallery View"), this, 471 476 SLOT(slotVideoGallery())); 477 popup->addButton(tr("Toggle Watched"), this, SLOT(ToggleWatched())); 478 479 472 480 } 473 481 474 482 popup->addButton(tr("Cancel"), this, SLOT(slotDoCancel())); … … 555 563 } 556 564 } 557 565 566 void VideoTree::ToggleWatched() 567 { 568 cancelPopup(); 569 570 if (curitem) 571 { 572 curitem->setWatched(!curitem->Watched()); 573 curitem->updateDatabase(); 574 575 buildVideoList(); 576 577 } 578 else 579 { 580 VERBOSE(VB_IMPORTANT, QString("no item to toggle watched")); 581 } 582 } 583 584 558 585 void VideoTree::slotWatchVideo() 559 586 { 560 587 cancelPopup(); -
mythvideo/mythvideo/videoutils.cpp
108 108 return browse ? QObject::tr("Yes") : QObject::tr("No"); 109 109 } 110 110 111 QString getDisplayWatched(bool watched) 112 { 113 return watched ? QObject::tr("Yes") : QObject::tr("No"); 114 } 115 116 117 111 118 bool isDefaultCoverFile(const QString &coverfile) 112 119 { 113 120 return coverfile == VIDEO_COVERFILE_DEFAULT || -
mythvideo/mythvideo/videogallery.h
31 31 void exitWin(); 32 32 void slotChangeView(); 33 33 void handleVideoSelect(); 34 void handleToggleWatched(); 34 35 35 36 protected: 36 37 ~VideoGallery() {} // use deleteLater instead for thread safety -
mythvideo/mythvideo/editmetadata.h
50 50 void toggleChild(bool yes_or_no); 51 51 void setChild(int new_child); 52 52 void toggleBrowse(bool yes_or_no); 53 void toggleWatched(bool yes_or_no); 53 54 void findCoverArt(); 54 55 55 56 private: … … 68 69 UICheckBoxType *child_check; 69 70 UISelectorType *child_select; 70 71 UICheckBoxType *browse_check; 72 UICheckBoxType *watched_check; 71 73 UIPushButtonType *coverart_button; 72 74 UITextType *coverart_text; 73 75 UITextButtonType *done_button; -
mythvideo/mythvideo/videodlg.cpp
124 124 if (!(m_type & DLG_TREE)) 125 125 buttons.push_back(popup->addButton(tr("Switch to List View"), this, 126 126 SLOT(slotVideoTree()))); 127 128 if(!(m_type)) 129 buttons.push_back(popup->addButton(tr("Toggle Watched"), this, 130 SLOT(slotToggleWatched()))); 127 131 128 132 return buttons.size() ? buttons[0] : NULL; 129 133 } … … 267 271 fetchVideos(); 268 272 } 269 273 274 275 276 void VideoDialog::slotToggleWatched() 277 { 278 cancelPopup(); 279 280 curitem->setWatched(!curitem->Watched()); 281 282 curitem->updateDatabase(); 283 284 fetchVideos(); 285 286 287 288 } 289 290 270 291 void VideoDialog::exitWin() 271 292 { 272 293 emit accept(); -
mythvideo/mythvideo/videomanager.cpp
1225 1225 QString::number(item->ChildID())); 1226 1226 checkedSetText(m_container, "browseable", 1227 1227 getDisplayBrowse(item->Browse())); 1228 checkedSetText(m_container, "watchable", 1229 getDisplayWatched(item->Watched())); 1228 1230 checkedSetText(m_container, "category", item->Category()); 1229 1231 checkedSetText(m_container, "level", 1230 1232 QString::number(item->ShowLevel())); … … 1263 1265 void SigItemEdit(); 1264 1266 void SigItemDelete(); 1265 1267 void SigItemToggleBrowseable(); 1268 void SigItemToggleWatched(); 1266 1269 void SigItemChangeParental(int); 1267 1270 void SigDoFilter(); 1268 1271 void SigDoMenu(); … … 1324 1327 emit SigItemDelete(); 1325 1328 else if (action == "BROWSE") 1326 1329 emit SigItemToggleBrowseable(); 1330 else if (action == "WATCHED") 1331 emit SigItemToggleWatched(); 1327 1332 else if (action == "INCPARENT") 1328 1333 emit SigItemChangeParental(1); 1329 1334 else if (action == "DECPARENT") … … 1931 1936 SLOT(DoRemoveVideo())); 1932 1937 connect(m_list_handler, SIGNAL(SigItemToggleBrowseable()), 1933 1938 SLOT(DoToggleBrowseable())); 1939 connect(m_list_handler, SIGNAL(SigItemToggleWatched()), 1940 SLOT(DoToggleWatched())); 1934 1941 connect(m_list_handler, SIGNAL(SigItemChangeParental(int)), 1935 1942 SLOT(OnParentalChange(int))); 1936 1943 connect(m_list_handler, SIGNAL(SigDoFilter()), … … 2205 2212 SLOT(DoResetMetadata())); 2206 2213 m_popup->addButton(tr("Toggle Browseable"), this, 2207 2214 SLOT(DoToggleBrowseable())); 2215 m_popup->addButton(tr("Toggle Watched"), this, 2216 SLOT(DoToggleWatched())); 2208 2217 m_popup->addButton(tr("Remove Video"), this, 2209 2218 SLOT(DoRemoveVideo())); 2210 2219 } … … 2238 2247 } 2239 2248 } 2240 2249 2250 void DoToggleWatched() 2251 { 2252 CancelPopup(); 2253 2254 Metadata *item = m_list_handler->GetCurrentItem(); 2255 if (item) 2256 { 2257 item->setWatched(!item->Watched()); 2258 item->updateDatabase(); 2259 2260 RefreshVideoList(false); 2261 OnSelectedItemChange(); 2262 } 2263 } 2264 2241 2265 void OnParentalChange(int amount); 2242 2266 2243 2267 // called when the list selection changed -
mythvideo/mythvideo/videobrowser.cpp
132 132 SLOT(slotWatchVideo())); 133 133 popup->addButton(tr("View Full Plot"), this, SLOT(slotViewPlot())); 134 134 popup->addButton(tr("View Cast"), this, SLOT(slotViewCast())); 135 popup->addButton(tr("Toggle Watched"), this, SLOT(slotToggleWatched())); 136 135 137 } 136 138 else 137 139 { … … 330 332 QString::number(curitem->ChildID())); 331 333 checkedSetText(container, "browseable", 332 334 getDisplayBrowse(curitem->Browse())); 335 checkedSetText(container, "watchable", 336 getDisplayWatched(curitem->Watched())); 333 337 checkedSetText(container, "category", curitem->Category()); 334 338 checkedSetText(container, "level", 335 339 QString::number(curitem->ShowLevel())); -
mythvideo/mythvideo/videofilter.cpp
55 55 kBrowseFilterAll = -1 56 56 }; 57 57 58 59 enum WatchedFilter { 60 kWatchedFilterAll = -1 61 }; 62 63 58 64 enum InetRefFilter { 59 65 kInetRefFilterAll = -1, 60 66 kInetRefFilterUnknown = 0 … … 73 79 category(kCategoryFilterAll), genre(kGenreFilterAll), 74 80 country(kCountryFilterAll), cast(kCastFilterAll), 75 81 year(kYearFilterAll), runtime(kRuntimeFilterAll), 76 userrating(kUserRatingFilterAll), browse(kBrowseFilterAll), 82 userrating(kUserRatingFilterAll), browse(kBrowseFilterAll), watched(kWatchedFilterAll), 77 83 m_inetref(kInetRefFilterAll), m_coverfile(kCoverFileFilterAll), 78 84 orderby(kOrderByTitle), m_parental_level(ParentalLevel::plNone), 79 85 m_changed_state(0) … … 103 109 kUserRatingFilterAll); 104 110 browse = gContext->GetNumSetting(QString("%1Browse").arg(prefix), 105 111 kBrowseFilterAll); 112 watched = gContext->GetNumSetting(QString("%1Watched").arg(prefix), 113 kWatchedFilterAll); 106 114 m_inetref = gContext->GetNumSetting(QString("%1InetRef").arg(prefix), 107 115 kInetRefFilterAll); 108 116 m_coverfile = gContext->GetNumSetting(QString("%1CoverFile") … … 172 180 browse = rhs.browse; 173 181 } 174 182 183 if (watched != rhs.watched) 184 { 185 m_changed_state |= kFilterWatchedChanged; 186 watched = rhs.watched; 187 } 188 175 189 if (m_inetref != rhs.m_inetref) 176 190 { 177 191 m_changed_state |= kFilterInetRefChanged; … … 209 223 gContext->SaveSetting(QString("%1Runtime").arg(prefix), runtime); 210 224 gContext->SaveSetting(QString("%1Userrating").arg(prefix), userrating); 211 225 gContext->SaveSetting(QString("%1Browse").arg(prefix), browse); 226 gContext->SaveSetting(QString("%1Watched").arg(prefix), watched); 212 227 gContext->SaveSetting(QString("%1InetRef").arg(prefix), m_inetref); 213 228 gContext->SaveSetting(QString("%1CoverFile").arg(prefix), m_coverfile); 214 229 gContext->SaveSetting(QString("%1Orderby").arg(prefix), orderby); … … 311 326 matches = mdata.Browse() == browse; 312 327 } 313 328 329 if (matches && watched != kWatchedFilterAll) 330 { 331 matches = mdata.Watched() == watched; 332 } 333 314 334 if (matches && m_inetref != kInetRefFilterAll) 315 335 { 316 336 matches = mdata.InetRef() == VIDEO_INETREF_DEFAULT; … … 406 426 const VideoList &video_list, 407 427 const char *name_) : 408 428 MythThemedDialog(parent_, window_name, theme_filename, name_), 409 browse_select(0), orderby_select(0), year_select(0), userrating_select(0),429 browse_select(0),watched_select(0), orderby_select(0), year_select(0), userrating_select(0), 410 430 category_select(0), country_select(0), genre_select(0), cast_select(0), 411 431 runtime_select(0), save_button(0), done_button(0), numvideos_text(0), 412 432 m_intetref_select(0), m_coverfile_select(0), m_fsp(fsp), … … 600 620 browse_select->setToItem(m_settings.getBrowse()); 601 621 } 602 622 623 if (watched_select) 624 { 625 watched_select->addItem(kWatchedFilterAll, QObject::tr("All")); 626 watched_select->addItem(1, QObject::tr("Yes")); 627 watched_select->addItem(0, QObject::tr("No")); 628 watched_select->setToItem(m_settings.getWatched()); 629 } 630 631 632 603 633 if (m_intetref_select) 604 634 { 605 635 m_intetref_select->addItem(kInetRefFilterAll, QObject::tr("All")); … … 675 705 widget_testset(currentSelector, focused, runtime_select); 676 706 widget_testset(currentSelector, focused, userrating_select); 677 707 widget_testset(currentSelector, focused, browse_select); 708 widget_testset(currentSelector, focused, watched_select); 678 709 widget_testset(currentSelector, focused, m_intetref_select); 679 710 widget_testset(currentSelector, focused, m_coverfile_select); 680 711 widget_testset(currentSelector, focused, orderby_select); … … 777 808 update_numvideo(); 778 809 } 779 810 811 void VideoFilterDialog::setWatched(int new_watched) 812 { 813 m_settings.setWatched(new_watched); 814 update_numvideo(); 815 } 816 780 817 void VideoFilterDialog::setInetRef(int new_inetref) 781 818 { 782 819 m_settings.setInetRef(new_inetref); … … 838 875 connect(browse_select, SIGNAL(pushed(int)), 839 876 this, SLOT(setBrowse(int))); 840 877 878 watched_select = getUISelectorType("watched_select"); 879 if (watched_select) 880 connect(watched_select, SIGNAL(pushed(int)), 881 this, SLOT(setWatched(int))); 882 841 883 m_intetref_select = getUISelectorType("inetref_select"); 842 884 if (m_intetref_select) 843 885 connect(m_intetref_select, SIGNAL(pushed(int)), -
mythvideo/mythvideo/videoselected.cpp
280 280 QString::number(m_item->ChildID())); 281 281 checkedSetText(container, "browseable", 282 282 getDisplayBrowse(m_item->Browse())); 283 checkedSetText(container, "watchable", 284 getDisplayWatched(m_item->Watched())); 283 285 checkedSetText(container, "category", m_item->Category()); 284 286 checkedSetText(container, "level", 285 287 QString::number(m_item->ShowLevel())); -
mythvideo/mythvideo/metadata.h
62 62 ParentalLevel::Level showlevel = ParentalLevel::plLowest, 63 63 int categoryID = 0, 64 64 int childID = -1, bool browse = true, 65 bool watched = false, 65 66 const QString &playcommand = "", const QString &category = "", 66 67 const genre_list &genres = genre_list(), 67 68 const country_list &countries = country_list(), … … 116 117 bool Browse() const; 117 118 void setBrowse(bool browse); 118 119 120 bool Watched() const; 121 void setWatched(bool watched); 122 119 123 const QString &PlayCommand() const; 120 124 void setPlayCommand(const QString &playCommand); 121 125 -
mythvideo/mythvideo/editmetadata.cpp
48 48 child_check = NULL; 49 49 child_select = NULL; 50 50 browse_check = NULL; 51 watched_check = NULL; 51 52 coverart_button = NULL; 52 53 coverart_text = NULL; 53 54 done_button = NULL; … … 195 196 196 197 if (browse_check) browse_check->setState(working_metadata->Browse()); 197 198 checkedSetText(coverart_text, working_metadata->CoverFile()); 199 if (watched_check) watched_check->setState(working_metadata->Watched()); 200 checkedSetText(coverart_text, working_metadata->CoverFile()); 198 201 if (player_editor) player_editor->setText(working_metadata->PlayCommand()); 199 202 } 200 203 … … 391 394 working_metadata->setBrowse(yes_or_no); 392 395 } 393 396 397 void EditMetadataDialog::toggleWatched(bool yes_or_no) 398 { 399 working_metadata->setWatched(yes_or_no); 400 } 401 402 394 403 void EditMetadataDialog::findCoverArt() 395 404 { 396 405 QString new_coverart_file; … … 478 487 this, SLOT(toggleBrowse(bool))); 479 488 } 480 489 490 watched_check = getUICheckBoxType("watched_check"); 491 if (watched_check) 492 { 493 connect(watched_check, SIGNAL(pushed(bool)), 494 this, SLOT(toggleWatched(bool))); 495 } 496 481 497 coverart_button = getUIPushButtonType("coverart_button"); 482 498 if (coverart_button) 483 499 { -
mythvideo/mythvideo/videogallery.cpp
503 503 popup->addButton(tr("View Cast"), this, SLOT(slotViewCast())); 504 504 popup->addButton(tr("View Details"), this, 505 505 SLOT(handleVideoSelect())); 506 popup->addButton(tr("Toggle Watched"), this, 507 SLOT(slotToggleWatched())); 506 508 509 507 510 } 508 511 else 509 512 { … … 836 839 delete selected; 837 840 } 838 841 842 843 844 845 846 839 847 bool VideoGallery::handleSelect() 840 848 { 841 849 bool handled = true; -
mythvideo/mythvideo/videotree.h
33 33 void slotViewCast(); 34 34 void slotDoFilter(); 35 35 void slotWatchVideo(); 36 void ToggleWatched(); 36 37 37 38 void handleTreeListSelection(int node_int); 38 39 void handleTreeListEntry(int node_int); … … 45 46 void cancelPopup(); 46 47 void doMenu(bool info); 47 48 49 50 48 51 private: 49 52 MythPopupBox *popup; 50 53 bool expectingPopup; -
mythvideo/mythvideo/videoutils.h
22 22 QString getDisplayUserRating(float userrating); 23 23 QString getDisplayLength(int length); 24 24 QString getDisplayBrowse(bool browse); 25 QString getDisplayWatched(bool watched); 25 26 26 27 bool isDefaultCoverFile(const QString &coverfile); 27 28