Ticket #3551: videomanager-browser.patch
File videomanager-browser.patch, 16.5 KB (added by , 17 years ago) |
---|
-
mythvideo/mythvideo/theme-wide/video-ui.xml
diff -Naur ../mythplugins.orig/mythvideo/mythvideo/theme-wide/video-ui.xml mythvideo/mythvideo/theme-wide/video-ui.xml
old new 81 81 </font> 82 82 83 83 <container name="info"> 84 <area> 64,36,1152,280</area>84 <area>264,36,1152,280</area> 85 85 <textarea name="title" draworder="4" align="center"> 86 86 <area>0,0,1152,80</area> 87 87 <font>leadfnt</font> … … 92 92 <value>Director:</value> 93 93 </textarea> 94 94 <textarea name="director" draworder="4"> 95 <area>1 70,75,647,35</area>95 <area>140,75,647,35</area> 96 96 <font>moviedata</font> 97 97 </textarea> 98 98 <textarea name="yrlbl" draworder="4" align="right"> … … 185 185 </image> 186 186 </container> 187 187 188 <font name="dirsel_font" face="Arial"> 189 <color>#33ffff</color> 190 <size>16</size> 191 <bold>yes</bold> 192 </font> 193 194 <container name="dirselector"> 195 <area>0,285,190,348</area> 196 <textarea name="curdir" draworder="4"> 197 <area>20,12,190,35</area> 198 <font>dirsel_font</font> 199 </textarea> 200 <listarea name="directories" draworder="4"> 201 <area>20,37,190,212</area> 202 <fcnfont name="active_font" function="active"></fcnfont> 203 <fcnfont name="inactive_font" function="inactive"></fcnfont> 204 <fcnfont name="active_font" function="selected"></fcnfont> 205 <columnpadding>10</columnpadding> 206 <column number="1" width="190" context="-1"></column> 207 <items>8</items> 208 <image function="selectionbar" filename="cr-selectbar.png" location="-12,-5"></image> 209 <image function="uparrow" filename="uparrow.png" location="750,22"></image> 210 <image function="downarrow" filename="downarrow.png" location="750,195"></image> 211 </listarea> 212 <image name="dirshowinglines" draworder="5" fleximage="no"> 213 <filename>cr-lines.png</filename> 214 <position>0,0</position> 215 <staticsize>190,290</staticsize> 216 </image> 217 </container> 218 188 219 <container name="selector"> 189 <area> 0,336,1280,348</area>220 <area>200,336,1280,348</area> 190 221 <image name="showinglines" draworder="5" fleximage="no"> 191 222 <filename>cr-lines.png</filename> 192 223 <position>0,0</position> -
mythvideo/mythvideo/videomanager.cpp
diff -Naur ../mythplugins.orig/mythvideo/mythvideo/videomanager.cpp mythvideo/mythvideo/videomanager.cpp
old new 263 263 isbusy(false) 264 264 { 265 265 videoDir = gContext->GetSetting("VideoStartupDir"); 266 m_currentDirectory = videoDir; 267 m_currentDirname = "."; 268 m_activeList = MOVIE_LIST; 269 266 270 artDir = gContext->GetSetting("VideoArtworkDir"); 267 271 268 272 VideoFilterSettings video_filter(true, "VideoManager"); 273 269 274 m_video_list->setCurrentVideoFilter(video_filter); 270 275 271 276 m_list_behave.reset(new ListBehaviorManager(0, 272 277 ListBehaviorManager::lbScrollCenter | 273 278 ListBehaviorManager::lbWrapList)); 274 279 m_movie_list_behave.reset(new ListBehaviorManager); 280 281 m_directories_list_behave.reset(new ListBehaviorManager(0, 282 ListBehaviorManager::lbScrollCenter | 283 ListBehaviorManager::lbWrapList)); 275 284 276 285 backup.reset(new QPainter); 277 286 RefreshMovieList(false); … … 311 320 } 312 321 } 313 322 323 container = m_theme->GetSet("dirselector"); 324 if (container) 325 { 326 UIListType *ltype = (UIListType *)container->GetType("directories"); 327 if (ltype) 328 { 329 m_directories_list_behave->setWindowSize(ltype->GetItems()); 330 } 331 } 332 makeDirectoriesList(); 333 334 314 335 bgTransBackup.reset(gContext->LoadScalePixmap("trans-backup.png")); 315 336 if (!bgTransBackup.get()) 316 337 bgTransBackup.reset(new QPixmap()); … … 344 365 else if (m_state == SHOWING_IMDBMANUAL) 345 366 handleIMDBManual(); 346 367 else 347 slotEditMeta(); 348 return; 368 switch (m_activeList) 369 { 370 case MOVIE_LIST: 371 { 372 slotEditMeta(); 373 break; 374 } 375 case MOVIE_DIRLIST: 376 { 377 makeDirectoriesList(); 378 break; 379 } 380 } 381 return; 349 382 } 350 383 else if ((action == "0" || action == "1" || action == "2" || 351 384 action == "3" || action == "4" || action == "5" || … … 410 443 else 411 444 { 412 445 m_video_list->refreshList(false, 0, true); 413 m_list_behave->setItemCount(m_video_list->count()); 446 makeVideoSublist (); 447 m_list_behave->setItemCount(m_videoIndexesList.count()); 414 448 } 415 449 curitem = m_video_list->getVideoListMetadata(m_list_behave->getIndex()); 416 450 updateML = false; … … 864 898 if (r.intersects(listRect) && noUpdate == false) 865 899 { 866 900 updateList(&p); 901 updateDirectoriesList (&p); 867 902 } 868 903 if (r.intersects(infoRect) && noUpdate == false) 869 904 { … … 885 920 } 886 921 } 887 922 923 void VideoManager::makeDirectoriesList() 924 { 925 LayerSet *container = m_theme->GetSet("dirselector"); 926 if (container) 927 { 928 929 UIListType *ltype = (UIListType *)container->GetType("directories"); 930 if (ltype) { 931 QDir dir(m_currentDirectory); 932 933 if (ltype->GetCurrentItem() != -1) { 934 QString dirSelected = ltype->GetItemText(ltype->GetCurrentItem()); 935 dir.cd(dirSelected); 936 } 937 938 m_currentDirectory = dir.path(); 939 m_currentDirname = dir.dirName(); 940 941 m_directoriesList = dir.entryList (QDir::Dirs); 942 m_directoriesList.pop_front(); // Get rid of directory "." 943 944 if (m_currentDirectory == gContext->GetSetting("VideoStartupDir")) 945 { 946 m_currentDirname = "Videothéque"; 947 m_directoriesList.pop_front(); // Get rid of directory ".." 948 } 949 950 m_directories_list_behave->setItemCount(m_directoriesList.count()); 951 952 makeVideoSublist(); 953 update(fullRect); 954 } 955 } 956 } 957 958 void VideoManager::makeVideoSublist() 959 { 960 m_videoIndexesList.clear(); 961 for (unsigned int i = 0; i < m_video_list->count(); i++) 962 { 963 Metadata *meta = m_video_list->getVideoListMetadata(i); 964 QString filename = meta->Filename(); 965 966 QString videoname = filename.section ('/',-1); 967 QString path = filename.section ('/', 0, -2); 968 if ( path == m_currentDirectory ) { 969 m_videoIndexesList.append (i); 970 } 971 } 972 m_list_behave->setItemCount(m_videoIndexesList.count()); 973 } 974 888 975 void VideoManager::updateList(QPainter *p) 889 976 { 890 977 QRect pr = listRect; … … 901 988 ltype->ResetList(); 902 989 ltype->SetActive(true); 903 990 991 //tata 904 992 const ListBehaviorManager::lb_data &lbd = m_list_behave->getData(); 905 993 for (unsigned int i = lbd.begin; i < lbd.end; ++i) 906 994 { 907 Metadata *meta = m_video_list->getVideoListMetadata( i);995 Metadata *meta = m_video_list->getVideoListMetadata(m_videoIndexesList[i]); 908 996 909 997 QString title = meta->Title(); 910 998 QString filename = meta->Filename(); … … 931 1019 ltype->SetDownArrow(lbd.data_below_window); 932 1020 ltype->SetUpArrow(lbd.data_above_window); 933 1021 } 934 935 1022 for (int i = 0; i < 9; ++i) 936 1023 { 937 1024 container->Draw(&tmp, i, 0); … … 1014 1101 p->drawPixmap(pr.topLeft(), pix); 1015 1102 } 1016 1103 1104 void VideoManager::updateDirectoriesList (QPainter *p) 1105 { 1106 QRect pr = dirListRect; 1107 QPixmap pix(pr.size()); 1108 pix.fill(this, pr.topLeft()); 1109 QPainter tmp(&pix); 1110 1111 LayerSet *container = m_theme->GetSet("dirselector"); 1112 if (container) 1113 { 1114 UITextType *ttype = (UITextType *)container->GetType("curdir"); 1115 UIListType *ltype = (UIListType *)container->GetType("directories"); 1116 1117 if (ttype) checkedSetText(ttype, m_currentDirname); 1118 // toto 1119 1120 if (ltype) { 1121 ltype->ResetList(); 1122 ltype->SetActive(true); 1123 1124 const ListBehaviorManager::lb_data &lbd = m_directories_list_behave->getData(); 1125 for (unsigned int i = lbd.begin; i < lbd.end; ++i) 1126 { 1127 ltype->SetItemText(i - lbd.begin, 1, m_directoriesList[i]); 1128 } 1129 ltype->SetItemCurrent(lbd.index); 1130 1131 ltype->SetDownArrow(lbd.data_below_window); 1132 ltype->SetUpArrow(lbd.data_above_window); 1133 } 1134 1135 for (int i = 0; i < 9; ++i) 1136 { 1137 container->Draw(&tmp, i, 0); 1138 } 1139 } 1140 1141 tmp.end(); 1142 1143 p->drawPixmap(pr.topLeft(), pix); 1144 } 1145 1017 1146 void VideoManager::updateInfo(QPainter *p) 1018 1147 { 1019 1148 QRect pr = infoRect; … … 1130 1259 movieListRect = area; 1131 1260 if (container_name == "enterimdb") 1132 1261 imdbEnterRect = area; 1262 if (container_name == "dirselector") 1263 dirListRect = area; 1133 1264 } 1134 1265 1135 1266 void VideoManager::exitWin() … … 1167 1298 1168 1299 void VideoManager::cursorLeft() 1169 1300 { 1301 1302 /* 1170 1303 if (expectingPopup) 1171 1304 cancelPopup(); 1172 1305 else 1173 1306 exitWin(); 1307 */ 1308 1309 if (m_activeList == MOVIE_LIST) m_activeList = MOVIE_DIRLIST; 1310 1174 1311 } 1175 1312 1176 1313 void VideoManager::cursorRight() 1177 1314 { 1315 /* 1178 1316 videoMenu(); 1317 */ 1318 1319 if (m_activeList == MOVIE_DIRLIST) m_activeList = MOVIE_LIST; 1179 1320 } 1180 1321 1181 1322 void VideoManager::cursorDown() … … 1184 1325 { 1185 1326 case SHOWING_MAINWINDOW: 1186 1327 { 1187 m_list_behave->move_down(); 1328 switch (m_activeList) 1329 { 1330 case MOVIE_LIST: 1331 m_list_behave->move_down(); 1332 break; 1333 case MOVIE_DIRLIST: 1334 m_directories_list_behave->move_down(); 1335 break; 1336 } 1188 1337 break; 1189 1338 } 1190 1339 case SHOWING_IMDBLIST: … … 1207 1356 { 1208 1357 case SHOWING_MAINWINDOW: 1209 1358 { 1210 m_list_behave->page_down();1359 if (m_activeList == MOVIE_LIST) m_list_behave->page_down(); 1211 1360 break; 1212 1361 } 1213 1362 case SHOWING_IMDBLIST: … … 1230 1379 { 1231 1380 case SHOWING_MAINWINDOW: 1232 1381 { 1233 m_list_behave->move_up(); 1382 switch (m_activeList) 1383 { 1384 case MOVIE_LIST: 1385 { 1386 m_list_behave->move_up(); 1387 break; 1388 } 1389 case MOVIE_DIRLIST: 1390 { 1391 m_directories_list_behave->move_up(); 1392 break; 1393 } 1394 } 1234 1395 update(fullRect); 1235 1396 break; 1236 1397 } … … 1254 1415 { 1255 1416 case SHOWING_MAINWINDOW: 1256 1417 { 1257 m_list_behave->page_up(); 1258 update(fullRect); 1418 if (m_activeList == MOVIE_LIST) { 1419 m_list_behave->page_up(); 1420 update(fullRect); 1421 } 1259 1422 break; 1260 1423 } 1261 1424 case SHOWING_IMDBLIST: -
mythvideo/mythvideo/videomanager.h
diff -Naur ../mythplugins.orig/mythvideo/mythvideo/videomanager.h mythvideo/mythvideo/videomanager.h
old new 16 16 SHOWING_IMDBLIST, 17 17 SHOWING_IMDBMANUAL 18 18 }; 19 enum ActiveList 20 { 21 MOVIE_LIST = 0, 22 MOVIE_DIRLIST 23 }; 19 24 } 20 25 21 26 class QPainter; … … 85 90 void updateMovieList(QPainter *); 86 91 void updateInfo(QPainter *); 87 92 void updateIMDBEnter(QPainter *); 93 void updateDirectoriesList (QPainter *); 88 94 89 95 void grayOut(QPainter *); 96 void makeDirectoriesList(); 97 void makeVideoSublist(); 90 98 91 99 private: 92 100 bool updateML; 93 101 bool noUpdate; 94 95 102 VideoList *m_video_list; 96 103 97 104 std::auto_ptr<XMLParse> m_theme; … … 113 120 QRect infoRect; 114 121 QRect fullRect; 115 122 QRect imdbEnterRect; 123 QRect dirListRect; 116 124 117 125 QString movieNumber; 118 126 … … 126 134 bool iscopycomplete; 127 135 bool iscopysuccess; 128 136 137 unsigned int m_activeList; // are selecting Video or directory 138 QString m_currentDirectory; // Path of the current directory 139 QString m_currentDirname; // Name of the current directory 140 QStringList m_directoriesList; // List of directories in current directory; 141 QValueList<int> m_videoIndexesList; // List of m_video_list indexes present in current directory 142 129 143 std::auto_ptr<ListBehaviorManager> m_list_behave; 130 144 std::auto_ptr<ListBehaviorManager> m_movie_list_behave; 145 std::auto_ptr<ListBehaviorManager> m_directories_list_behave; 131 146 }; 132 147 133 148 #endif -
mythvideo/mythvideo/video-ui.xml
diff -Naur ../mythplugins.orig/mythvideo/mythvideo/video-ui.xml mythvideo/mythvideo/video-ui.xml
old new 83 83 <container name="background"> 84 84 <image name="filler" draworder="0" fleximage="yes"> 85 85 <filename>cr-background.png</filename> 86 <position> 0,285</position>86 <position>200,285</position> 87 87 <staticsize>800,290</staticsize> 88 88 </image> 89 89 </container> … … 185 185 <font>moviedata</font> 186 186 </textarea> 187 187 </container> 188 189 <font name="dirsel_font" face="Arial"> 190 <color>#33ffff</color> 191 <size>16</size> 192 <bold>yes</bold> 193 </font> 194 195 <container name="dirselector"> 196 <area>0,285,190,320</area> 197 <textarea name="curdir" draworder="4"> 198 <area>20,12,190,35</area> 199 <font>dirsel_font</font> 200 </textarea> 201 <listarea name="directories" draworder="4"> 202 <area>20,37,190,212</area> 203 <fcnfont name="active_font" function="active"></fcnfont> 204 <fcnfont name="inactive_font" function="inactive"></fcnfont> 205 <fcnfont name="active_font" function="selected"></fcnfont> 206 <columnpadding>10</columnpadding> 207 <column number="1" width="190" context="-1"></column> 208 <items>8</items> 209 <image function="selectionbar" filename="cr-selectbar.png" location="-12,-5"></image> 210 <image function="uparrow" filename="uparrow.png" location="750,22"></image> 211 <image function="downarrow" filename="downarrow.png" location="750,195"></image> 212 </listarea> 213 <image name="dirshowinglines" draworder="5" fleximage="no"> 214 <filename>cr-lines.png</filename> 215 <position>0,0</position> 216 <staticsize>190,290</staticsize> 217 </image> 218 </container> 188 219 189 220 <container name="selector"> 190 <area> 0,285,800,320</area>221 <area>200,285,800,320</area> 191 222 <listarea name="listing" draworder="4"> 192 <area>20,12, 760,242</area>223 <area>20,12,560,242</area> 193 224 <fcnfont name="active_font" function="active"></fcnfont> 194 225 <fcnfont name="inactive_font" function="inactive"></fcnfont> 195 226 <fcnfont name="active_font" function="selected"></fcnfont> 196 227 <columnpadding>10</columnpadding> 197 <column number="1" width=" 400" context="-1"></column>198 <column number="2" width=" 200" context="-1"></column>199 <column number="3" width=" 100" context="-1"></column>228 <column number="1" width="300" context="-1"></column> 229 <column number="2" width="150" context="-1"></column> 230 <column number="3" width="75" context="-1"></column> 200 231 <items>8</items> 201 232 <image function="selectionbar" filename="cr-selectbar.png" location="-12,-5"></image> 202 233 <image function="uparrow" filename="uparrow.png" location="750,22"></image> … … 205 236 <image name="showinglines" draworder="5" fleximage="no"> 206 237 <filename>cr-lines.png</filename> 207 238 <position>0,0</position> 208 <staticsize> 800,290</staticsize>239 <staticsize>600,290</staticsize> 209 240 </image> 210 241 <textarea name="keyslbl_one" draworder="4" align="left"> 211 242 <area>15,275,200,30</area> … … 218 249 <value></value> 219 250 </textarea> 220 251 <textarea name="keyslbl_three" draworder="4" align="right"> 221 <area> 580,275,200,30</area>252 <area>350,275,200,30</area> 222 253 <font>keysfont</font> 223 254 <value>INFO - Action Menu</value> 224 255 </textarea>