1 | Index: mythmusic/mythmusic/playbackbox.cpp |
---|
2 | =================================================================== |
---|
3 | --- mythmusic/mythmusic/playbackbox.cpp (revision 14491) |
---|
4 | +++ mythmusic/mythmusic/playbackbox.cpp (working copy) |
---|
5 | @@ -49,7 +49,13 @@ |
---|
6 | playlist_tree = NULL; |
---|
7 | playlist_popup = NULL; |
---|
8 | progress = NULL; |
---|
9 | - |
---|
10 | + |
---|
11 | +//added by Anthony D'Alberto to support back button |
---|
12 | + back_button = NULL; |
---|
13 | + menu_button = NULL; |
---|
14 | + exec_button = NULL; |
---|
15 | +//end of added section |
---|
16 | + |
---|
17 | isplaying = false; |
---|
18 | tree_is_done = false; |
---|
19 | first_playlist_check = true; |
---|
20 | @@ -226,6 +232,28 @@ |
---|
21 | |
---|
22 | // Ready to go. Let's update the foreground just to be safe. |
---|
23 | |
---|
24 | +//added by Anthony D'Alberto to support back button |
---|
25 | + back_button = getUIPushButtonType("backbutton"); |
---|
26 | + menu_button = getUIPushButtonType("menubutton"); |
---|
27 | + exec_button = getUIPushButtonType("execbutton"); |
---|
28 | + |
---|
29 | + if (back_button!= NULL) |
---|
30 | + connect(back_button, SIGNAL(pushed()), this, SLOT(back())); |
---|
31 | + else |
---|
32 | + back_button = NULL; |
---|
33 | + |
---|
34 | + if(menu_button != NULL) |
---|
35 | + connect(menu_button, SIGNAL(pushed()), this, SLOT(Menu())); |
---|
36 | + else |
---|
37 | + menu_button = NULL; |
---|
38 | + |
---|
39 | + if(exec_button != NULL) |
---|
40 | + connect(exec_button, SIGNAL(pushed()), this, SLOT(Run())); |
---|
41 | + else |
---|
42 | + exec_button = NULL; |
---|
43 | + |
---|
44 | +//end of added section |
---|
45 | + |
---|
46 | updateForeground(); |
---|
47 | |
---|
48 | if (class LCD *lcd = LCD::Get()) |
---|
49 | @@ -588,6 +616,47 @@ |
---|
50 | } |
---|
51 | } |
---|
52 | |
---|
53 | +//added by Anthony D'Alberto to support back button (and mouse presses) |
---|
54 | +//Adding the mouse press handler was necessary since the |
---|
55 | +//music_tree_list is not able to take focus. |
---|
56 | +// |
---|
57 | +void PlaybackBoxMusic::mousePressEvent(QMouseEvent *e) |
---|
58 | +{ |
---|
59 | + int iReturnValue; |
---|
60 | + //this is necessary if the music_tree_list is not able |
---|
61 | + //to take focus |
---|
62 | + iReturnValue = music_tree_list->mousePressHandler(e); |
---|
63 | + |
---|
64 | + if(iReturnValue >= 0) |
---|
65 | + { |
---|
66 | + //the mouse was pressed in the tree control |
---|
67 | + e->accept(); |
---|
68 | + |
---|
69 | + } |
---|
70 | + else |
---|
71 | + { |
---|
72 | + MythThemedDialog::mousePressEvent(e); |
---|
73 | + } |
---|
74 | +} |
---|
75 | + |
---|
76 | +void PlaybackBoxMusic::back() |
---|
77 | +{ |
---|
78 | + keyPressEvent(new QKeyEvent(QEvent::KeyPress, 4096, 27, 0)); |
---|
79 | +} |
---|
80 | + |
---|
81 | +void PlaybackBoxMusic::Menu() |
---|
82 | +{ |
---|
83 | + showMenu(); |
---|
84 | +} |
---|
85 | + |
---|
86 | +void PlaybackBoxMusic::Run() |
---|
87 | +{ |
---|
88 | + printf("Exec button\n"); |
---|
89 | + |
---|
90 | +} |
---|
91 | + |
---|
92 | +//end of added section |
---|
93 | + |
---|
94 | void PlaybackBoxMusic::showMenu() |
---|
95 | { |
---|
96 | if (playlist_popup) |
---|
97 | @@ -629,6 +698,10 @@ |
---|
98 | playlist_popup->addButton(tr("Tracks from current Year"), this, |
---|
99 | SLOT(byYear())); |
---|
100 | } |
---|
101 | + |
---|
102 | + //Added by Anthiny D'Alberto to support mouswe |
---|
103 | + playlist_popup->addButton(tr("Cancel"), this, SLOT(closePlaylistPopup())); |
---|
104 | + //end of added section |
---|
105 | |
---|
106 | playlist_popup->ShowPopup(this, SLOT(closePlaylistPopup())); |
---|
107 | |
---|
108 | @@ -2312,6 +2385,7 @@ |
---|
109 | QButton *button = popup->addButton(tr("Replace")); |
---|
110 | popup->addButton(tr("Insert after current track")); |
---|
111 | popup->addButton(tr("Append to end")); |
---|
112 | + |
---|
113 | button->setFocus(); |
---|
114 | |
---|
115 | QLabel *splitter = popup->addLabel(" ", MythPopupBox::Small); |
---|
116 | @@ -2344,14 +2418,14 @@ |
---|
117 | { |
---|
118 | case 0: |
---|
119 | insertOption = PL_REPLACE; |
---|
120 | - break; |
---|
121 | + break; |
---|
122 | case 1: |
---|
123 | insertOption = PL_INSERTAFTERCURRENT; |
---|
124 | - break; |
---|
125 | + break; |
---|
126 | case 2: |
---|
127 | - insertOption = PL_INSERTATEND; |
---|
128 | - break; |
---|
129 | - } |
---|
130 | + insertOption = PL_INSERTATEND; |
---|
131 | + break; |
---|
132 | + } |
---|
133 | |
---|
134 | bRemoveDups = dupsCheck->isChecked(); |
---|
135 | |
---|
136 | Index: mythmusic/mythmusic/cdrip.h |
---|
137 | =================================================================== |
---|
138 | --- mythmusic/mythmusic/cdrip.h (revision 14491) |
---|
139 | +++ mythmusic/mythmusic/cdrip.h (working copy) |
---|
140 | @@ -120,6 +120,9 @@ |
---|
141 | void searchArtist(void); |
---|
142 | void searchAlbum(void); |
---|
143 | void searchGenre(void); |
---|
144 | +//added by Anthony D'Alberto to support back button |
---|
145 | + void back(); |
---|
146 | +//end of added section |
---|
147 | |
---|
148 | private: |
---|
149 | void wireupTheme(void); |
---|
150 | @@ -151,6 +154,10 @@ |
---|
151 | UIPushButtonType *m_searchAlbumButton; |
---|
152 | UIPushButtonType *m_searchGenreButton; |
---|
153 | |
---|
154 | +//added by Anthony D'Alberto to support the back button |
---|
155 | + UIPushButtonType *back_button; |
---|
156 | +//end of added section |
---|
157 | + |
---|
158 | int m_currentTrack; |
---|
159 | int m_totalTracks; |
---|
160 | vector<RipTrack*> *m_tracks; |
---|
161 | Index: mythmusic/mythmusic/music-ui.xml |
---|
162 | =================================================================== |
---|
163 | --- mythmusic/mythmusic/music-ui.xml (revision 14491) |
---|
164 | +++ mythmusic/mythmusic/music-ui.xml (working copy) |
---|
165 | @@ -819,6 +819,7 @@ |
---|
166 | </textbutton> |
---|
167 | |
---|
168 | </container> |
---|
169 | + |
---|
170 | </window> |
---|
171 | |
---|
172 | <window name="cdripper"> |
---|
173 | Index: mythmusic/mythmusic/directoryfinder.cpp |
---|
174 | =================================================================== |
---|
175 | --- mythmusic/mythmusic/directoryfinder.cpp (revision 14491) |
---|
176 | +++ mythmusic/mythmusic/directoryfinder.cpp (working copy) |
---|
177 | @@ -20,6 +20,10 @@ |
---|
178 | :MythThemedDialog(parent, "directory_finder", "music-", name) |
---|
179 | { |
---|
180 | m_curDirectory = startDir; |
---|
181 | +//Added by Anthony D'Alberto to support back button |
---|
182 | + back_button = NULL; |
---|
183 | +//end of added section |
---|
184 | + |
---|
185 | wireUpTheme(); |
---|
186 | } |
---|
187 | |
---|
188 | @@ -174,6 +178,17 @@ |
---|
189 | QTimer::singleShot(100, this, SLOT(done(int))); |
---|
190 | } |
---|
191 | |
---|
192 | +//Added by Anthony D'Alberto to support back button |
---|
193 | + back_button = getUIPushButtonType("backbutton"); |
---|
194 | + |
---|
195 | + if(back_button) |
---|
196 | + connect(back_button, SIGNAL(pushed()), this, SLOT(back())); |
---|
197 | + else |
---|
198 | + back_button = NULL; |
---|
199 | + |
---|
200 | + connect(m_fileList, SIGNAL(itemClicked(UIListBtnTypeItem*)), this, SLOT(ItemClicked(UIListBtnTypeItem*)) ); |
---|
201 | +//end of added section |
---|
202 | + |
---|
203 | // load pixmaps |
---|
204 | m_directoryPixmap = gContext->LoadScalePixmap("mm_folder.png"); |
---|
205 | |
---|
206 | @@ -286,3 +301,37 @@ |
---|
207 | |
---|
208 | m_fileList->refresh(); |
---|
209 | } |
---|
210 | + |
---|
211 | +//Added by Anthony D'Alberto to support mouse press |
---|
212 | +void DirectoryFinder::ItemClicked(UIListBtnTypeItem* item) |
---|
213 | +{ |
---|
214 | + static bool boUpdate=true; |
---|
215 | + //copy of the key press handler |
---|
216 | + |
---|
217 | + int index = (intptr_t) item->getData(); |
---|
218 | + |
---|
219 | + if (m_directoryList[index] == "..") |
---|
220 | + { |
---|
221 | + // move up on directory |
---|
222 | + int pos = m_curDirectory.findRev('/'); |
---|
223 | + if (pos > 0) |
---|
224 | + m_curDirectory = m_curDirectory.left(pos); |
---|
225 | + else |
---|
226 | + m_curDirectory = "/"; |
---|
227 | + } |
---|
228 | + else |
---|
229 | + { |
---|
230 | + if (!m_curDirectory.endsWith("/")) |
---|
231 | + m_curDirectory += "/"; |
---|
232 | + |
---|
233 | + m_curDirectory += m_directoryList[index]; |
---|
234 | + } |
---|
235 | + |
---|
236 | + updateFileList(); |
---|
237 | +} |
---|
238 | + |
---|
239 | +void DirectoryFinder::back() |
---|
240 | +{ |
---|
241 | + keyPressEvent(new QKeyEvent(QEvent::KeyPress, 4096, 27, 0)); |
---|
242 | +} |
---|
243 | +//end of added section |
---|
244 | Index: mythmusic/mythmusic/cdrip.cpp |
---|
245 | =================================================================== |
---|
246 | --- mythmusic/mythmusic/cdrip.cpp (revision 14491) |
---|
247 | +++ mythmusic/mythmusic/cdrip.cpp (working copy) |
---|
248 | @@ -405,6 +405,10 @@ |
---|
249 | { |
---|
250 | m_CDdevice = device; |
---|
251 | |
---|
252 | +//added by Anthony D'Alberto to support back button |
---|
253 | + back_button = NULL; |
---|
254 | +//end of added section |
---|
255 | + |
---|
256 | #ifndef _WIN32 |
---|
257 | // if the MediaMonitor is running stop it |
---|
258 | m_mediaMonitorActive = false; |
---|
259 | @@ -541,6 +545,14 @@ |
---|
260 | |
---|
261 | m_trackList = (UIListType*) getUIObject("track_list"); |
---|
262 | |
---|
263 | +//added by Anthony D'Alberto to support back button |
---|
264 | + back_button = getUIPushButtonType("backbutton"); |
---|
265 | + if(back_button) |
---|
266 | + { |
---|
267 | + connect(back_button, SIGNAL(pushed()), this, SLOT(back())); |
---|
268 | + } |
---|
269 | +//end of added section |
---|
270 | + |
---|
271 | buildFocusList(); |
---|
272 | assignFirstFocus(); |
---|
273 | } |
---|
274 | @@ -808,6 +820,7 @@ |
---|
275 | bool Ripper::isNewTune(const QString& artist, const QString& album, const QString& title) |
---|
276 | { |
---|
277 | |
---|
278 | + |
---|
279 | QString matchartist = artist; |
---|
280 | QString matchalbum = album; |
---|
281 | QString matchtitle = title; |
---|
282 | @@ -905,6 +918,7 @@ |
---|
283 | MythContext::DBError("Delete Track", deleteQuery); |
---|
284 | } |
---|
285 | } |
---|
286 | + |
---|
287 | } |
---|
288 | |
---|
289 | // static function to create a filename based on the metadata information |
---|
290 | @@ -1603,3 +1617,10 @@ |
---|
291 | m_ripperThread = new CDRipperThread(this, m_CDdevice, m_tracks, m_quality); |
---|
292 | m_ripperThread->start(); |
---|
293 | } |
---|
294 | + |
---|
295 | +//added by Anthony D'Alberto to support back button |
---|
296 | +void Ripper::back() |
---|
297 | +{ |
---|
298 | + keyPressEvent(new QKeyEvent(QEvent::KeyPress, 4096, 27,0)); |
---|
299 | +} |
---|
300 | +//end of added section |
---|
301 | Index: mythmusic/mythmusic/databasebox.h |
---|
302 | =================================================================== |
---|
303 | --- mythmusic/mythmusic/databasebox.h (revision 14491) |
---|
304 | +++ mythmusic/mythmusic/databasebox.h (working copy) |
---|
305 | @@ -48,7 +48,14 @@ |
---|
306 | void dealWithTracks(PlaylistItem *item_ptr); |
---|
307 | void setCDTitle(const QString& title); |
---|
308 | void fillCD(void); |
---|
309 | - |
---|
310 | + |
---|
311 | +//Added by Anthony D'Alberto to support back button |
---|
312 | + public slots: |
---|
313 | + void back(); |
---|
314 | + void Menu(); |
---|
315 | + void ItemClicked(int iMsg); |
---|
316 | +//end of added section |
---|
317 | + |
---|
318 | protected slots: |
---|
319 | void selected(UIListGenericTree *); |
---|
320 | void entered(UIListTreeType *, UIListGenericTree *); |
---|
321 | @@ -119,6 +126,12 @@ |
---|
322 | QStringList treelevels; |
---|
323 | |
---|
324 | QPtrList<UITextType> m_lines; |
---|
325 | + |
---|
326 | +//Added by Anthony D'Alberto to support back button |
---|
327 | + UIPushButtonType *back_button; |
---|
328 | + UIPushButtonType *menu_button; |
---|
329 | +//end of added section |
---|
330 | + |
---|
331 | }; |
---|
332 | |
---|
333 | #endif |
---|
334 | Index: mythmusic/mythmusic/directoryfinder.h |
---|
335 | =================================================================== |
---|
336 | --- mythmusic/mythmusic/directoryfinder.h (revision 14491) |
---|
337 | +++ mythmusic/mythmusic/directoryfinder.h (working copy) |
---|
338 | @@ -41,6 +41,12 @@ |
---|
339 | void homePressed(); |
---|
340 | void locationEditLostFocus(); |
---|
341 | |
---|
342 | +//Added by Anthony D'Alberto to support the back button |
---|
343 | + public slots: |
---|
344 | + void back(); |
---|
345 | + void ItemClicked(UIListBtnTypeItem* item); |
---|
346 | +//end of added section |
---|
347 | + |
---|
348 | private: |
---|
349 | void updateFileList(); |
---|
350 | void updateSelectedList(); |
---|
351 | @@ -62,6 +68,10 @@ |
---|
352 | UITextButtonType *m_homeButton; |
---|
353 | |
---|
354 | QPixmap *m_directoryPixmap; |
---|
355 | + |
---|
356 | +//Added by Anthony D'Alberto to support back button |
---|
357 | + UIPushButtonType *back_button; |
---|
358 | +//end of added section |
---|
359 | }; |
---|
360 | |
---|
361 | #endif |
---|
362 | Index: mythmusic/mythmusic/databasebox.cpp |
---|
363 | =================================================================== |
---|
364 | --- mythmusic/mythmusic/databasebox.cpp (revision 14491) |
---|
365 | +++ mythmusic/mythmusic/databasebox.cpp (working copy) |
---|
366 | @@ -32,6 +32,11 @@ |
---|
367 | the_playlists = all_playlists; |
---|
368 | active_playlist = NULL; |
---|
369 | |
---|
370 | +//Added by Anthony D'Alberto to support back button |
---|
371 | + back_button = NULL; |
---|
372 | + menu_button = NULL; |
---|
373 | +//end of added section |
---|
374 | + |
---|
375 | if (!music_ptr) |
---|
376 | { |
---|
377 | VERBOSE(VB_IMPORTANT, "We are not going to get very far with a null " |
---|
378 | @@ -133,6 +138,24 @@ |
---|
379 | fill_list_timer = new QTimer(this); |
---|
380 | connect(fill_list_timer, SIGNAL(timeout()), this, SLOT(keepFilling())); |
---|
381 | fill_list_timer->start(20); |
---|
382 | + |
---|
383 | +//Added by Anthony D'Alberto to support back button |
---|
384 | + back_button = getUIPushButtonType("backbutton"); |
---|
385 | + menu_button = getUIPushButtonType("menubutton"); |
---|
386 | + |
---|
387 | + if(back_button) |
---|
388 | + connect(back_button, SIGNAL(pushed()), this, SLOT(back())); |
---|
389 | + else |
---|
390 | + back_button = NULL; |
---|
391 | + |
---|
392 | + if(menu_button) |
---|
393 | + connect(menu_button, SIGNAL(pushed()), this, SLOT(Menu())); |
---|
394 | + else |
---|
395 | + menu_button = NULL; |
---|
396 | + |
---|
397 | + connect(tree, SIGNAL(itemClicked(int)), this, SLOT(ItemClicked(int))); |
---|
398 | +//end of added section |
---|
399 | + |
---|
400 | } |
---|
401 | |
---|
402 | DatabaseBox::~DatabaseBox() |
---|
403 | @@ -797,6 +820,9 @@ |
---|
404 | |
---|
405 | playlist_popup->addButton(tr("Rename This Playlist"), this, |
---|
406 | SLOT(renamePlaylist())); |
---|
407 | + //added by Anthony D'Alberto to support mouse |
---|
408 | + playlist_popup->addButton(tr("Cancel"), this, SLOT(closePlaylistPopup())); |
---|
409 | + //end of added section |
---|
410 | |
---|
411 | playlist_popup->ShowPopup(this, SLOT(closePlaylistPopup())); |
---|
412 | |
---|
413 | @@ -822,6 +848,7 @@ |
---|
414 | active_popup = new MythPopupBox(gContext->GetMainWindow(), |
---|
415 | "active_popup"); |
---|
416 | active_pl_edit = new MythRemoteLineEdit(active_popup); |
---|
417 | + |
---|
418 | active_popup->addWidget(active_pl_edit); |
---|
419 | active_pl_edit->setFocus(); |
---|
420 | |
---|
421 | @@ -834,6 +861,11 @@ |
---|
422 | QButton *pb = active_popup->addButton(tr("Save Back to Playlist Tree"), |
---|
423 | this, SLOT(popBackPlaylist())); |
---|
424 | |
---|
425 | +//added by Anthony D'Alberto to support mouse |
---|
426 | + active_popup->addButton(tr("Cancel"), this, SLOT(closeActivePopup())); |
---|
427 | +//end of added section |
---|
428 | + |
---|
429 | + |
---|
430 | // CD writing |
---|
431 | |
---|
432 | bool cdwriter = false; |
---|
433 | @@ -860,6 +892,10 @@ |
---|
434 | active_popup->addButton(tr("Clear CD-RW Disk"), this, |
---|
435 | SLOT(BlankCDRW())); |
---|
436 | |
---|
437 | + //added by Anthony D'Alberto to support mouse |
---|
438 | + active_popup->addButton(tr("Cancel"), this, SLOT(closeActivePopup())); |
---|
439 | + //end of added section |
---|
440 | + |
---|
441 | double size_in_MB = 0.0; |
---|
442 | double size_in_sec = 0.0; |
---|
443 | active_playlist->computeSize(size_in_MB, size_in_sec); |
---|
444 | @@ -1332,3 +1368,29 @@ |
---|
445 | delete decoder; |
---|
446 | } |
---|
447 | |
---|
448 | +//Added by Anthony D'Alberto to support mouse press |
---|
449 | +void DatabaseBox::back() |
---|
450 | +{ |
---|
451 | + keyPressEvent(new QKeyEvent(QEvent::KeyPress, 4096, 27, 0)); |
---|
452 | +} |
---|
453 | + |
---|
454 | +void DatabaseBox::Menu() |
---|
455 | +{ |
---|
456 | + UIListGenericTree *curItem; |
---|
457 | + curItem = tree->GetCurrentPosition(); |
---|
458 | + doMenus(curItem); |
---|
459 | +} |
---|
460 | + |
---|
461 | +void DatabaseBox::ItemClicked(int iMsg) |
---|
462 | +{ |
---|
463 | + UIListGenericTree *curItem; |
---|
464 | + |
---|
465 | + if((iMsg & ClickCheck) == ClickCheck) |
---|
466 | + { |
---|
467 | + curItem = tree->GetCurrentPosition(); |
---|
468 | + if(curItem) |
---|
469 | + selected(curItem); |
---|
470 | + } |
---|
471 | + |
---|
472 | +} |
---|
473 | +//end of added section |
---|
474 | Index: mythmusic/mythmusic/importmusic.h |
---|
475 | =================================================================== |
---|
476 | --- mythmusic/mythmusic/importmusic.h (revision 14491) |
---|
477 | +++ mythmusic/mythmusic/importmusic.h (working copy) |
---|
478 | @@ -69,6 +69,12 @@ |
---|
479 | void setTitleWordCaps(void); |
---|
480 | void setTitleInitialCap(void); |
---|
481 | |
---|
482 | +//Added by Anthony D'Alberto to support back button |
---|
483 | + void back(); |
---|
484 | +//end of added section |
---|
485 | + |
---|
486 | + protected slots: |
---|
487 | + |
---|
488 | private: |
---|
489 | void keyPressEvent(QKeyEvent *e); |
---|
490 | void wireUpTheme(); |
---|
491 | @@ -130,6 +136,11 @@ |
---|
492 | int m_defaultYear; |
---|
493 | int m_defaultRating; |
---|
494 | bool m_haveDefaults; |
---|
495 | + |
---|
496 | +//Added by Anthony D'Alberto to support back button |
---|
497 | + UIPushButtonType *back_button; |
---|
498 | +//end of added section |
---|
499 | + |
---|
500 | }; |
---|
501 | |
---|
502 | /////////////////////////////////////////////////////////////////////////////// |
---|
503 | Index: mythmusic/mythmusic/playbackbox.h |
---|
504 | =================================================================== |
---|
505 | --- mythmusic/mythmusic/playbackbox.h (revision 14491) |
---|
506 | +++ mythmusic/mythmusic/playbackbox.h (working copy) |
---|
507 | @@ -41,6 +41,10 @@ |
---|
508 | |
---|
509 | bool onMediaEvent(MythMediaDevice *pDev); |
---|
510 | |
---|
511 | +//added by Anthony D'Alberto to support back button |
---|
512 | + void mousePressEvent(QMouseEvent *e); |
---|
513 | +//end of added section |
---|
514 | + |
---|
515 | public slots: |
---|
516 | |
---|
517 | void play(); |
---|
518 | @@ -94,6 +98,11 @@ |
---|
519 | void showSearchDialog(); |
---|
520 | bool getInsertPLOptions(InsertPLOption &insertOption, |
---|
521 | PlayPLOption &playOption, bool &bRemoveDups); |
---|
522 | +//added by Anthony D'Alberto to support back button |
---|
523 | + void back(); |
---|
524 | + void Menu(); |
---|
525 | + void Run(); |
---|
526 | +//end of added section |
---|
527 | |
---|
528 | signals: |
---|
529 | |
---|
530 | @@ -239,6 +248,12 @@ |
---|
531 | UITextButtonType *pledit_button; |
---|
532 | UITextButtonType *vis_button; |
---|
533 | |
---|
534 | +//added by Anthony D'Alberto to support back button |
---|
535 | + UIPushButtonType *back_button; |
---|
536 | + UIPushButtonType *menu_button; |
---|
537 | + UIPushButtonType *exec_button; |
---|
538 | +//end of added section |
---|
539 | + |
---|
540 | MythProgressDialog *progress; |
---|
541 | enum { kProgressNone, kProgressMusic } progress_type; |
---|
542 | }; |
---|
543 | Index: mythmusic/mythmusic/importmusic.cpp |
---|
544 | =================================================================== |
---|
545 | --- mythmusic/mythmusic/importmusic.cpp (revision 14491) |
---|
546 | +++ mythmusic/mythmusic/importmusic.cpp (working copy) |
---|
547 | @@ -109,6 +109,10 @@ |
---|
548 | m_defaultRating = 0; |
---|
549 | m_haveDefaults = false; |
---|
550 | |
---|
551 | +//added by Anthony D'Alberto to support back button |
---|
552 | + back_button = NULL; |
---|
553 | +//end of added section |
---|
554 | + |
---|
555 | wireUpTheme(); |
---|
556 | assignFirstFocus(); |
---|
557 | m_somethingWasImported = false; |
---|
558 | @@ -352,6 +356,16 @@ |
---|
559 | connect(m_prev_button, SIGNAL(pushed()), this, SLOT(prevPressed())); |
---|
560 | } |
---|
561 | |
---|
562 | +//Added by Anthony D'Alberto to support back button |
---|
563 | + back_button = getUIPushButtonType("backbutton"); |
---|
564 | + |
---|
565 | + if(back_button) |
---|
566 | + connect(back_button, SIGNAL(pushed()), this, SLOT(back())); |
---|
567 | + else |
---|
568 | + back_button = NULL; |
---|
569 | + |
---|
570 | +//end of added section |
---|
571 | + |
---|
572 | buildFocusList(); |
---|
573 | } |
---|
574 | |
---|
575 | @@ -458,6 +472,7 @@ |
---|
576 | |
---|
577 | void ImportMusicDialog::prevPressed() |
---|
578 | { |
---|
579 | + |
---|
580 | if (m_currentTrack > 0) |
---|
581 | { |
---|
582 | m_currentTrack--; |
---|
583 | @@ -929,6 +944,13 @@ |
---|
584 | dialog.exec(); |
---|
585 | } |
---|
586 | |
---|
587 | +//Added by Anthony D'Alberto to support mouse press |
---|
588 | +void ImportMusicDialog::back() |
---|
589 | +{ |
---|
590 | + keyPressEvent(new QKeyEvent(QEvent::KeyPress, 4096, 27, 0)); |
---|
591 | +} |
---|
592 | +//end of added section |
---|
593 | + |
---|
594 | /////////////////////////////////////////////////////////////////////////////// |
---|
595 | |
---|
596 | ImportCoverArtDialog::ImportCoverArtDialog(const QString &sourceDir, Metadata *metadata, |
---|
597 | Index: mythvideo/mythvideo/dvdripbox.h |
---|
598 | =================================================================== |
---|
599 | --- mythvideo/mythvideo/dvdripbox.h (revision 14491) |
---|
600 | +++ mythvideo/mythvideo/dvdripbox.h (working copy) |
---|
601 | @@ -115,6 +115,10 @@ |
---|
602 | void checkDisc(); |
---|
603 | void cancelJob(); |
---|
604 | void toggleCancel(); |
---|
605 | + |
---|
606 | +//Added by Anthony D'Alberto to support back button and mouse press |
---|
607 | + void back(); |
---|
608 | +//end of added section |
---|
609 | |
---|
610 | private: |
---|
611 | |
---|
612 | @@ -153,6 +157,10 @@ |
---|
613 | UIPushButtonType *prevjob_button; |
---|
614 | UITextButtonType *ripscreen_button; |
---|
615 | UITextButtonType *cancel_button; |
---|
616 | + |
---|
617 | +//Added by Anthony D'ALberto to support back button |
---|
618 | + UIPushButtonType *back_button; |
---|
619 | +//end of added section |
---|
620 | }; |
---|
621 | |
---|
622 | |
---|
623 | Index: mythvideo/mythvideo/videomanager.h |
---|
624 | =================================================================== |
---|
625 | --- mythvideo/mythvideo/videomanager.h (revision 14491) |
---|
626 | +++ mythvideo/mythvideo/videomanager.h (working copy) |
---|
627 | @@ -41,6 +41,13 @@ |
---|
628 | void slotDoFilter(); |
---|
629 | void slotToggleBrowseable(); |
---|
630 | |
---|
631 | +//added by Anthony D'Alberto to support mouse presses |
---|
632 | + void back(); |
---|
633 | + void Menu(); |
---|
634 | + void MoveUp(); |
---|
635 | + void MoveDown(); |
---|
636 | +//end of added section |
---|
637 | + |
---|
638 | protected slots: |
---|
639 | void videoMenu(); |
---|
640 | |
---|
641 | @@ -59,6 +66,10 @@ |
---|
642 | void keyPressEvent(QKeyEvent *e); |
---|
643 | void doWaitBackground(QPainter &p, const QString &titleText); |
---|
644 | |
---|
645 | +//added by Anthony D'Alberto to support mouse presses |
---|
646 | + void mousePressEvent(QMouseEvent *e); |
---|
647 | +//end of added section |
---|
648 | + |
---|
649 | private slots: |
---|
650 | void num(const QString &text); |
---|
651 | void copyFinished(QNetworkOperation *op); |
---|
652 | @@ -128,6 +139,13 @@ |
---|
653 | |
---|
654 | std::auto_ptr<ListBehaviorManager> m_list_behave; |
---|
655 | std::auto_ptr<ListBehaviorManager> m_movie_list_behave; |
---|
656 | + |
---|
657 | +//added by Anthony D'Alberto to support back button |
---|
658 | + UIPushButtonType *back_button; |
---|
659 | + UIPushButtonType *MenuButton; |
---|
660 | + UIPushButtonType *Up; |
---|
661 | + UIPushButtonType *Down; |
---|
662 | +//end of added sectionm |
---|
663 | }; |
---|
664 | |
---|
665 | #endif |
---|
666 | Index: mythvideo/mythvideo/videolist.h |
---|
667 | =================================================================== |
---|
668 | --- mythvideo/mythvideo/videolist.h (revision 14491) |
---|
669 | +++ mythvideo/mythvideo/videolist.h (working copy) |
---|
670 | @@ -55,6 +55,8 @@ |
---|
671 | |
---|
672 | private: |
---|
673 | class VideoListImp *m_imp; |
---|
674 | + |
---|
675 | + |
---|
676 | }; |
---|
677 | |
---|
678 | #endif // VIDEOLIST_H |
---|
679 | Index: mythvideo/mythvideo/videobrowser.h |
---|
680 | =================================================================== |
---|
681 | --- mythvideo/mythvideo/videobrowser.h (revision 14491) |
---|
682 | +++ mythvideo/mythvideo/videobrowser.h (working copy) |
---|
683 | @@ -20,6 +20,14 @@ |
---|
684 | |
---|
685 | void slotParentalLevelChanged(); |
---|
686 | |
---|
687 | +//added by Anthony D'Alberto to support touchscreen |
---|
688 | + void back(); |
---|
689 | + void Up(); |
---|
690 | + void Down(); |
---|
691 | + void PlaySel(); |
---|
692 | + void Menu(); |
---|
693 | +//end of added section |
---|
694 | + |
---|
695 | protected: |
---|
696 | void parseContainer(QDomElement &element); |
---|
697 | void paintEvent(QPaintEvent *); |
---|
698 | @@ -27,6 +35,10 @@ |
---|
699 | void doMenu(bool info = false); |
---|
700 | void fetchVideos(); |
---|
701 | |
---|
702 | +//added by Anthony D'Alberto to support mouse press |
---|
703 | + void mousePressEvent(QMouseEvent *e); |
---|
704 | +//end of added section |
---|
705 | + |
---|
706 | private: |
---|
707 | QPixmap getPixmap(QString &level); |
---|
708 | void jumpToSelection(int amount); |
---|
709 | @@ -46,6 +58,14 @@ |
---|
710 | |
---|
711 | QRect infoRect; |
---|
712 | QRect browsingRect; |
---|
713 | + |
---|
714 | +//Added by Anthony D'Alberto to support buttons |
---|
715 | + UIPushButtonType *back_button; |
---|
716 | + UIPushButtonType *UpButton; |
---|
717 | + UIPushButtonType *DnButton; |
---|
718 | + UIPushButtonType *PlayButton; |
---|
719 | + UIPushButtonType *MenuButton; |
---|
720 | +//end of added section |
---|
721 | }; |
---|
722 | |
---|
723 | #endif |
---|
724 | Index: mythvideo/mythvideo/videotree.cpp |
---|
725 | =================================================================== |
---|
726 | --- mythvideo/mythvideo/videotree.cpp (revision 14491) |
---|
727 | +++ mythvideo/mythvideo/videotree.cpp (working copy) |
---|
728 | @@ -217,6 +217,11 @@ |
---|
729 | popup(NULL), expectingPopup(false), curitem(NULL), m_video_list(video_list), |
---|
730 | video_tree_root(NULL), m_exit_type(0) |
---|
731 | { |
---|
732 | +//added by Anthony D'Alberto to support back button |
---|
733 | + back_button = NULL; |
---|
734 | + MenuButton = NULL; |
---|
735 | +//end of added section |
---|
736 | + |
---|
737 | m_imp.reset(new VideoTreeImp); |
---|
738 | |
---|
739 | current_parental_level = |
---|
740 | @@ -236,6 +241,21 @@ |
---|
741 | VideoFilterSettings video_filter(true, "VideoTree"); |
---|
742 | m_video_list->setCurrentVideoFilter(video_filter); |
---|
743 | |
---|
744 | +//added by Anthony D'Alberto to support back button |
---|
745 | + back_button=getUIPushButtonType("backbutton"); |
---|
746 | + MenuButton = getUIPushButtonType("menubutton"); |
---|
747 | + |
---|
748 | + if(back_button) |
---|
749 | + connect(back_button, SIGNAL(pushed()), this, SLOT(back())); |
---|
750 | + else |
---|
751 | + back_button = NULL; |
---|
752 | + |
---|
753 | + if(MenuButton) |
---|
754 | + connect(MenuButton, SIGNAL(pushed()), this, SLOT(Menu())); |
---|
755 | + else |
---|
756 | + MenuButton = NULL; |
---|
757 | +//end of added section |
---|
758 | + |
---|
759 | buildVideoList(); |
---|
760 | |
---|
761 | if (m_imp->m_remember_position) |
---|
762 | @@ -580,3 +600,41 @@ |
---|
763 | setExitType(SCREEN_EXIT_VIA_JUMP); |
---|
764 | gContext->GetMainWindow()->JumpTo(location); |
---|
765 | } |
---|
766 | + |
---|
767 | +//added by Anthony D'Alberto to support mouse press |
---|
768 | + |
---|
769 | +void VideoTree::mousePressEvent(QMouseEvent *e) |
---|
770 | +{ |
---|
771 | + if(back_button) |
---|
772 | + { |
---|
773 | + if(back_button->getScreenArea().contains(e->x(), e->y())) |
---|
774 | + { |
---|
775 | + back_button->push(); |
---|
776 | + e->accept(); |
---|
777 | + return; |
---|
778 | + } |
---|
779 | + } |
---|
780 | + |
---|
781 | + if(MenuButton) |
---|
782 | + { |
---|
783 | + if(MenuButton->getScreenArea().contains(e->x(), e->y())) |
---|
784 | + { |
---|
785 | + MenuButton->push(); |
---|
786 | + e->accept(); |
---|
787 | + return; |
---|
788 | + } |
---|
789 | + } |
---|
790 | + |
---|
791 | + m_imp->video_tree_list->mousePressHandler(e); |
---|
792 | +} |
---|
793 | + |
---|
794 | +void VideoTree::back() |
---|
795 | +{ |
---|
796 | + keyPressEvent(new QKeyEvent(QEvent::KeyPress, 4096, 27, 0)); |
---|
797 | +} |
---|
798 | + |
---|
799 | +void VideoTree::Menu() |
---|
800 | +{ |
---|
801 | + doMenu(false); |
---|
802 | +} |
---|
803 | +//end of added section |
---|
804 | Index: mythvideo/mythvideo/videogallery.h |
---|
805 | =================================================================== |
---|
806 | --- mythvideo/mythvideo/videogallery.h (revision 14491) |
---|
807 | +++ mythvideo/mythvideo/videogallery.h (working copy) |
---|
808 | @@ -32,6 +32,10 @@ |
---|
809 | void slotChangeView(); |
---|
810 | void handleVideoSelect(); |
---|
811 | |
---|
812 | +//added by Anthony D'Alberto to support back button |
---|
813 | + void back(); |
---|
814 | +//end of added section |
---|
815 | + |
---|
816 | protected: |
---|
817 | virtual void parseContainer(QDomElement &element); |
---|
818 | virtual void fetchVideos(); |
---|
819 | @@ -43,6 +47,10 @@ |
---|
820 | void handleUpDirSelect(); |
---|
821 | bool goBack(); |
---|
822 | |
---|
823 | +//Added by Anthony D'Alberto to support back button |
---|
824 | + void mousePressEvent(QMouseEvent *e); |
---|
825 | +//end of added section |
---|
826 | + |
---|
827 | private: |
---|
828 | void LoadIconWindow(); |
---|
829 | |
---|
830 | @@ -87,6 +95,10 @@ |
---|
831 | |
---|
832 | GenericTree *video_tree_root; |
---|
833 | GenericTree *where_we_are; |
---|
834 | + |
---|
835 | +//Added by Anthony D'Alberto to support mouse press |
---|
836 | + UIPushButtonType *back_button; |
---|
837 | +//end of added section |
---|
838 | }; |
---|
839 | |
---|
840 | #endif |
---|
841 | Index: mythvideo/mythvideo/dvdripbox.cpp |
---|
842 | =================================================================== |
---|
843 | --- mythvideo/mythvideo/dvdripbox.cpp (revision 14491) |
---|
844 | +++ mythvideo/mythvideo/dvdripbox.cpp (working copy) |
---|
845 | @@ -1035,6 +1035,19 @@ |
---|
846 | connect(cancel_button, SIGNAL(pushed()), this, SLOT(cancelJob())); |
---|
847 | cancel_button->SetContext(-2); |
---|
848 | } |
---|
849 | + |
---|
850 | +//Added by Anthony D'Alberto to support back button |
---|
851 | + back_button = getUIPushButtonType("backbutton"); |
---|
852 | + if(back_button) |
---|
853 | + { |
---|
854 | + connect(back_button, SIGNAL(pushed()), this, SLOT(back())); |
---|
855 | + } |
---|
856 | + else |
---|
857 | + { |
---|
858 | + back_button = NULL; |
---|
859 | + } |
---|
860 | +//end of added section |
---|
861 | + |
---|
862 | } |
---|
863 | |
---|
864 | DVDRipBox::~DVDRipBox(void) |
---|
865 | @@ -1047,3 +1060,10 @@ |
---|
866 | jobs.clear(); |
---|
867 | } |
---|
868 | |
---|
869 | +//Added by Anthony D'Alberto to support back button |
---|
870 | +void DVDRipBox::back() |
---|
871 | +{ |
---|
872 | + keyPressEvent(new QKeyEvent(QEvent::KeyPress, 4096, 27, 0)); |
---|
873 | +} |
---|
874 | +//end of added section |
---|
875 | + |
---|
876 | Index: mythvideo/mythvideo/videomanager.cpp |
---|
877 | =================================================================== |
---|
878 | --- mythvideo/mythvideo/videomanager.cpp (revision 14491) |
---|
879 | +++ mythvideo/mythvideo/videomanager.cpp (working copy) |
---|
880 | @@ -262,6 +262,14 @@ |
---|
881 | m_state(SHOWING_MAINWINDOW), popup(NULL), expectingPopup(false), |
---|
882 | isbusy(false) |
---|
883 | { |
---|
884 | + |
---|
885 | +//added by Anthony D'Alberto to support mouse buttons |
---|
886 | + back_button = NULL; |
---|
887 | + MenuButton = NULL; |
---|
888 | + Up = NULL; |
---|
889 | + Down = NULL; |
---|
890 | +//end of added section |
---|
891 | + |
---|
892 | videoDir = gContext->GetSetting("VideoStartupDir"); |
---|
893 | artDir = gContext->GetSetting("VideoArtworkDir"); |
---|
894 | |
---|
895 | @@ -289,8 +297,9 @@ |
---|
896 | if (container) |
---|
897 | { |
---|
898 | UIListType *ltype = (UIListType *)container->GetType("listing"); |
---|
899 | + |
---|
900 | if (ltype) |
---|
901 | - { |
---|
902 | + { |
---|
903 | m_list_behave->setWindowSize(ltype->GetItems()); |
---|
904 | } |
---|
905 | } |
---|
906 | @@ -311,10 +320,43 @@ |
---|
907 | } |
---|
908 | } |
---|
909 | |
---|
910 | + |
---|
911 | bgTransBackup.reset(gContext->LoadScalePixmap("trans-backup.png")); |
---|
912 | if (!bgTransBackup.get()) |
---|
913 | bgTransBackup.reset(new QPixmap()); |
---|
914 | |
---|
915 | +//added by Anthony D'Alberto to support buttons |
---|
916 | + container=m_theme->GetSet("btn"); |
---|
917 | + if(container) |
---|
918 | + { |
---|
919 | + back_button = (UIPushButtonType *) container->GetType("backbutton"); |
---|
920 | + MenuButton = (UIPushButtonType *) container->GetType("menubutton"); |
---|
921 | + Up = (UIPushButtonType *) container->GetType("upbutton"); |
---|
922 | + Down = (UIPushButtonType *) container->GetType("downbutton"); |
---|
923 | + |
---|
924 | + if(back_button) |
---|
925 | + connect(back_button, SIGNAL(pushed()), this, SLOT(back())); |
---|
926 | + else |
---|
927 | + back_button = NULL; |
---|
928 | + |
---|
929 | + if(MenuButton) |
---|
930 | + connect(MenuButton, SIGNAL(pushed()),this, SLOT(Menu())); |
---|
931 | + else |
---|
932 | + MenuButton=NULL; |
---|
933 | + |
---|
934 | + if(Up) |
---|
935 | + connect(Up, SIGNAL(pushed()),this, SLOT(MoveUp())); |
---|
936 | + else |
---|
937 | + Up=NULL; |
---|
938 | + |
---|
939 | + if(Down) |
---|
940 | + connect(Down, SIGNAL(pushed()),this, SLOT(MoveDown())); |
---|
941 | + else |
---|
942 | + Down=NULL; |
---|
943 | + } |
---|
944 | + |
---|
945 | +//end of added section |
---|
946 | + |
---|
947 | updateBackground(); |
---|
948 | |
---|
949 | setNoErase(); |
---|
950 | @@ -883,6 +925,21 @@ |
---|
951 | updateMovieList(&p); |
---|
952 | } |
---|
953 | } |
---|
954 | + |
---|
955 | +//added by Anthony D'Alberto to support button redraws |
---|
956 | + if(back_button) |
---|
957 | + back_button->Draw(&p, 0, 0); //back_button->getScreenArea().left(), back_button->getScreenArea().top()); |
---|
958 | + |
---|
959 | + if(MenuButton) |
---|
960 | + MenuButton->Draw(&p, 0, 0); |
---|
961 | + |
---|
962 | + if(Up) |
---|
963 | + Up->Draw(&p, 0, 0); |
---|
964 | + |
---|
965 | + if(Down) |
---|
966 | + Down->Draw(&p, 0, 0); |
---|
967 | + |
---|
968 | +//end of added section |
---|
969 | } |
---|
970 | |
---|
971 | void VideoManager::updateList(QPainter *p) |
---|
972 | @@ -1657,3 +1714,70 @@ |
---|
973 | RefreshMovieList(false); |
---|
974 | update(infoRect); |
---|
975 | } |
---|
976 | + |
---|
977 | + |
---|
978 | +//added by Anthony D'Alberto to support mouse presses |
---|
979 | +void VideoManager::mousePressEvent(QMouseEvent *e) |
---|
980 | +{ |
---|
981 | + if(back_button) |
---|
982 | + { |
---|
983 | + if(back_button->getScreenArea().contains(e->x(), e->y())) |
---|
984 | + { |
---|
985 | + back_button->push(); |
---|
986 | + e->accept(); |
---|
987 | + return; |
---|
988 | + } |
---|
989 | + } |
---|
990 | + |
---|
991 | + if(MenuButton) |
---|
992 | + { |
---|
993 | + if(MenuButton->getScreenArea().contains(e->x(), e->y())) |
---|
994 | + { |
---|
995 | + MenuButton->push(); |
---|
996 | + e->accept(); |
---|
997 | + return; |
---|
998 | + } |
---|
999 | + } |
---|
1000 | + |
---|
1001 | + if(Up) |
---|
1002 | + { |
---|
1003 | + if(Up->getScreenArea().contains(e->x(), e->y())) |
---|
1004 | + { |
---|
1005 | + Up->push(); |
---|
1006 | + e->accept(); |
---|
1007 | + return; |
---|
1008 | + } |
---|
1009 | + } |
---|
1010 | + |
---|
1011 | + if(Down) |
---|
1012 | + { |
---|
1013 | + if(Down->getScreenArea().contains(e->x(), e->y())) |
---|
1014 | + { |
---|
1015 | + Down->push(); |
---|
1016 | + e->accept(); |
---|
1017 | + return; |
---|
1018 | + } |
---|
1019 | + } |
---|
1020 | +} |
---|
1021 | + |
---|
1022 | +void VideoManager::back() |
---|
1023 | +{ |
---|
1024 | + keyPressEvent(new QKeyEvent(QEvent::KeyPress, 4096, 27, 0)); |
---|
1025 | +} |
---|
1026 | + |
---|
1027 | +void VideoManager::Menu() |
---|
1028 | +{ |
---|
1029 | + videoMenu(); |
---|
1030 | +} |
---|
1031 | + |
---|
1032 | +void VideoManager::MoveUp() |
---|
1033 | +{ |
---|
1034 | + cursorUp(); |
---|
1035 | +} |
---|
1036 | + |
---|
1037 | +void VideoManager::MoveDown() |
---|
1038 | +{ |
---|
1039 | + cursorDown(); |
---|
1040 | +} |
---|
1041 | +//end of added section |
---|
1042 | + |
---|
1043 | Index: mythvideo/mythvideo/videolist.cpp |
---|
1044 | =================================================================== |
---|
1045 | --- mythvideo/mythvideo/videolist.cpp (revision 14491) |
---|
1046 | +++ mythvideo/mythvideo/videolist.cpp (working copy) |
---|
1047 | @@ -633,6 +633,7 @@ |
---|
1048 | return m_imp->Delete(video_id); |
---|
1049 | } |
---|
1050 | |
---|
1051 | + |
---|
1052 | ////////////////////////////// |
---|
1053 | // VideoListImp |
---|
1054 | ////////////////////////////// |
---|
1055 | @@ -1184,3 +1185,5 @@ |
---|
1056 | dirhandler dh(directory, prefix, metalist, fl, false); |
---|
1057 | ScanVideoDirectory(directory->getFQPath(), &dh, ext_list, m_ListUnknown); |
---|
1058 | } |
---|
1059 | + |
---|
1060 | + |
---|
1061 | Index: mythvideo/mythvideo/videobrowser.cpp |
---|
1062 | =================================================================== |
---|
1063 | --- mythvideo/mythvideo/videobrowser.cpp (revision 14491) |
---|
1064 | +++ mythvideo/mythvideo/videobrowser.cpp (working copy) |
---|
1065 | @@ -17,6 +17,15 @@ |
---|
1066 | VideoDialog(DLG_BROWSER, lparent, "browser", lname, video_list), |
---|
1067 | inData(0), m_state(0) |
---|
1068 | { |
---|
1069 | + |
---|
1070 | +//added by Anthony D'Alberto to support buttons |
---|
1071 | + back_button = NULL; |
---|
1072 | + UpButton = NULL; |
---|
1073 | + DnButton = NULL; |
---|
1074 | + PlayButton = NULL; |
---|
1075 | + MenuButton = NULL; |
---|
1076 | +//end of added section |
---|
1077 | + |
---|
1078 | setFlatList(true); |
---|
1079 | |
---|
1080 | setFileBrowser(gContext->GetNumSetting("VideoBrowserNoDB", 0)); |
---|
1081 | @@ -26,6 +35,46 @@ |
---|
1082 | if (!bgTransBackup.get()) |
---|
1083 | bgTransBackup.reset(new QPixmap()); |
---|
1084 | |
---|
1085 | +//added by Anthony D'Alberto to support mouse buttons |
---|
1086 | + LayerSet *container = NULL; |
---|
1087 | + container=theme->GetSet("btn"); |
---|
1088 | + if(container) |
---|
1089 | + { |
---|
1090 | + back_button=(UIPushButtonType *)(container->GetType("backbutton")); |
---|
1091 | + UpButton = (UIPushButtonType *)(container->GetType("upbutton")); |
---|
1092 | + DnButton = (UIPushButtonType *)(container->GetType("dnbutton")); |
---|
1093 | + PlayButton = (UIPushButtonType *)(container->GetType("playbutton")); |
---|
1094 | + MenuButton = (UIPushButtonType *)(container->GetType("menubutton")); |
---|
1095 | + } |
---|
1096 | + |
---|
1097 | + if(back_button) |
---|
1098 | + connect(back_button, SIGNAL(pushed()),this, SLOT(back())); |
---|
1099 | + else |
---|
1100 | + back_button = NULL; |
---|
1101 | + |
---|
1102 | + if(UpButton) |
---|
1103 | + connect(UpButton, SIGNAL(pushed()), this, SLOT(Up())); |
---|
1104 | + else |
---|
1105 | + UpButton = NULL; |
---|
1106 | + |
---|
1107 | + if(DnButton) |
---|
1108 | + connect(DnButton, SIGNAL(pushed()), this, SLOT(Down())); |
---|
1109 | + else |
---|
1110 | + DnButton = NULL; |
---|
1111 | + |
---|
1112 | + if(PlayButton) |
---|
1113 | + connect(PlayButton, SIGNAL(pushed()), this, SLOT(PlaySel())); |
---|
1114 | + else |
---|
1115 | + PlayButton = NULL; |
---|
1116 | + |
---|
1117 | + if(MenuButton) |
---|
1118 | + connect(MenuButton, SIGNAL(pushed()), this, SLOT(Menu())); |
---|
1119 | + else |
---|
1120 | + MenuButton = NULL; |
---|
1121 | + |
---|
1122 | + |
---|
1123 | +//end of added section |
---|
1124 | + |
---|
1125 | setNoErase(); |
---|
1126 | |
---|
1127 | fetchVideos(); |
---|
1128 | @@ -174,6 +223,35 @@ |
---|
1129 | allowPaint = false; |
---|
1130 | updatePlayWait(&p); |
---|
1131 | } |
---|
1132 | + |
---|
1133 | +//added by Anthony D'Alberto to support on screen buttons |
---|
1134 | + if(back_button) |
---|
1135 | + { |
---|
1136 | + back_button->Draw(&p, 0, 0); |
---|
1137 | + } |
---|
1138 | + |
---|
1139 | + if(UpButton) |
---|
1140 | + { |
---|
1141 | + UpButton->Draw(&p, 0, 0); |
---|
1142 | + } |
---|
1143 | + |
---|
1144 | + if(DnButton) |
---|
1145 | + { |
---|
1146 | + DnButton->Draw(&p, 0, 0); |
---|
1147 | + } |
---|
1148 | + |
---|
1149 | + if(PlayButton) |
---|
1150 | + { |
---|
1151 | + PlayButton->Draw(&p, 0, 0); |
---|
1152 | + } |
---|
1153 | + |
---|
1154 | + if(MenuButton) |
---|
1155 | + { |
---|
1156 | + MenuButton->Draw(&p, 0, 0); |
---|
1157 | + } |
---|
1158 | + |
---|
1159 | +//end of added section |
---|
1160 | + |
---|
1161 | } |
---|
1162 | |
---|
1163 | void VideoBrowser::updatePlayWait(QPainter *p) |
---|
1164 | @@ -391,3 +469,85 @@ |
---|
1165 | if (container_name == "browsing") |
---|
1166 | browsingRect = area; |
---|
1167 | } |
---|
1168 | + |
---|
1169 | +//added by Anthony D'Alberto to support the touchscreen |
---|
1170 | +void VideoBrowser::mousePressEvent(QMouseEvent *e) |
---|
1171 | +{ |
---|
1172 | + |
---|
1173 | + if(back_button) |
---|
1174 | + { |
---|
1175 | + if(back_button->getScreenArea().contains(e->x(), e->y())) |
---|
1176 | + { |
---|
1177 | + back_button->push(); |
---|
1178 | + e->accept(); |
---|
1179 | + return; |
---|
1180 | + } |
---|
1181 | + } |
---|
1182 | + |
---|
1183 | + if(UpButton) |
---|
1184 | + { |
---|
1185 | + if(UpButton->getScreenArea().contains(e->x(), e->y())) |
---|
1186 | + { |
---|
1187 | + UpButton->push(); |
---|
1188 | + e->accept(); |
---|
1189 | + return; |
---|
1190 | + } |
---|
1191 | + } |
---|
1192 | + |
---|
1193 | + if(DnButton) |
---|
1194 | + { |
---|
1195 | + if(DnButton->getScreenArea().contains(e->x(), e->y())) |
---|
1196 | + { |
---|
1197 | + DnButton->push(); |
---|
1198 | + e->accept(); |
---|
1199 | + return; |
---|
1200 | + } |
---|
1201 | + } |
---|
1202 | + |
---|
1203 | + if(PlayButton) |
---|
1204 | + { |
---|
1205 | + if(PlayButton->getScreenArea().contains(e->x(), e->y())) |
---|
1206 | + { |
---|
1207 | + PlayButton->push(); |
---|
1208 | + e->accept(); |
---|
1209 | + return; |
---|
1210 | + } |
---|
1211 | + } |
---|
1212 | + |
---|
1213 | + if(MenuButton) |
---|
1214 | + { |
---|
1215 | + if(MenuButton->getScreenArea().contains(e->x(), e->y())) |
---|
1216 | + { |
---|
1217 | + MenuButton->push(); |
---|
1218 | + e->accept(); |
---|
1219 | + return; |
---|
1220 | + } |
---|
1221 | + } |
---|
1222 | + |
---|
1223 | +} |
---|
1224 | + |
---|
1225 | +void VideoBrowser::back() |
---|
1226 | +{ |
---|
1227 | + keyPressEvent(new QKeyEvent(QEvent::KeyPress, 4096, 27, 0)); |
---|
1228 | +} |
---|
1229 | + |
---|
1230 | +void VideoBrowser::Up() |
---|
1231 | +{ |
---|
1232 | + jumpSelection(1); |
---|
1233 | +} |
---|
1234 | + |
---|
1235 | +void VideoBrowser::Down() |
---|
1236 | +{ |
---|
1237 | + jumpSelection(-1); |
---|
1238 | +} |
---|
1239 | + |
---|
1240 | +void VideoBrowser::PlaySel() |
---|
1241 | +{ |
---|
1242 | + playVideo(curitem); |
---|
1243 | +} |
---|
1244 | + |
---|
1245 | +void VideoBrowser::Menu() |
---|
1246 | +{ |
---|
1247 | + doMenu(false); |
---|
1248 | +} |
---|
1249 | +//end of added section |
---|
1250 | \ No newline at end of file |
---|
1251 | Index: mythvideo/mythvideo/videogallery.cpp |
---|
1252 | =================================================================== |
---|
1253 | --- mythvideo/mythvideo/videogallery.cpp (revision 14491) |
---|
1254 | +++ mythvideo/mythvideo/videogallery.cpp (working copy) |
---|
1255 | @@ -48,6 +48,22 @@ |
---|
1256 | updateBackground(); |
---|
1257 | |
---|
1258 | setNoErase(); |
---|
1259 | + |
---|
1260 | +//added by Anthony D'Alberto to support back button |
---|
1261 | + back_button = NULL; |
---|
1262 | + LayerSet *container = NULL; |
---|
1263 | + container=theme->GetSet("btn"); |
---|
1264 | + if(container) |
---|
1265 | + { |
---|
1266 | + back_button=(UIPushButtonType *)(container->GetType("backbutton")); |
---|
1267 | + } |
---|
1268 | + |
---|
1269 | + if(back_button) |
---|
1270 | + connect(back_button, SIGNAL(pushed()),this, SLOT(back())); |
---|
1271 | + else |
---|
1272 | + back_button = NULL; |
---|
1273 | + |
---|
1274 | +//end of added section |
---|
1275 | } |
---|
1276 | |
---|
1277 | void VideoGallery::keyPressEvent(QKeyEvent *e) |
---|
1278 | @@ -212,6 +228,13 @@ |
---|
1279 | if (r.intersects(arrowsRect)) |
---|
1280 | updateArrows(&p); |
---|
1281 | |
---|
1282 | +//Added by Anthony D'Alberto to support back button |
---|
1283 | + if(back_button) |
---|
1284 | + { |
---|
1285 | + back_button->Draw(&p, 0, 0); |
---|
1286 | + } |
---|
1287 | +//end of added section |
---|
1288 | + |
---|
1289 | MythDialog::paintEvent(e); |
---|
1290 | } |
---|
1291 | |
---|
1292 | @@ -871,3 +894,24 @@ |
---|
1293 | else if (container_name == "arrows") |
---|
1294 | arrowsRect = area; |
---|
1295 | } |
---|
1296 | + |
---|
1297 | +//Added by Anthony D'Alberto to support back button |
---|
1298 | +void VideoGallery::mousePressEvent(QMouseEvent *e) |
---|
1299 | +{ |
---|
1300 | + |
---|
1301 | + if(back_button) |
---|
1302 | + { |
---|
1303 | + if(back_button->getScreenArea().contains(e->x(), e->y())) |
---|
1304 | + { |
---|
1305 | + back_button->push(); |
---|
1306 | + e->accept(); |
---|
1307 | + return; |
---|
1308 | + } |
---|
1309 | + } |
---|
1310 | +} |
---|
1311 | + |
---|
1312 | +void VideoGallery::back() |
---|
1313 | +{ |
---|
1314 | + keyPressEvent(new QKeyEvent(QEvent::KeyPress, 4096, 27, 0)); |
---|
1315 | +} |
---|
1316 | +//end of added section |
---|
1317 | Index: mythvideo/mythvideo/videotree.h |
---|
1318 | =================================================================== |
---|
1319 | --- mythvideo/mythvideo/videotree.h (revision 14491) |
---|
1320 | +++ mythvideo/mythvideo/videotree.h (working copy) |
---|
1321 | @@ -37,12 +37,21 @@ |
---|
1322 | void playVideo(int node_number); |
---|
1323 | void setParentalLevel(int which_level); |
---|
1324 | |
---|
1325 | +//added by Anthony D'Alberto to support back button |
---|
1326 | + void back(); |
---|
1327 | + void Menu(); |
---|
1328 | +//end of added sectionm |
---|
1329 | + |
---|
1330 | protected: |
---|
1331 | void keyPressEvent(QKeyEvent *e); |
---|
1332 | bool createPopup(); |
---|
1333 | void cancelPopup(); |
---|
1334 | void doMenu(bool info); |
---|
1335 | |
---|
1336 | +//added by Anthony D'Alberto to support mouse press |
---|
1337 | + void mousePressEvent(QMouseEvent *e); |
---|
1338 | +//end of added section |
---|
1339 | + |
---|
1340 | private: |
---|
1341 | MythPopupBox *popup; |
---|
1342 | bool expectingPopup; |
---|
1343 | @@ -60,6 +69,11 @@ |
---|
1344 | void jumpTo(const QString &location); |
---|
1345 | void setExitType(int exit_type) { m_exit_type = exit_type; } |
---|
1346 | std::auto_ptr<VideoTreeImp> m_imp; |
---|
1347 | + |
---|
1348 | +//added by Anthony D'Alberto to support back button |
---|
1349 | + UIPushButtonType *back_button; |
---|
1350 | + UIPushButtonType *MenuButton; |
---|
1351 | +//end of added section |
---|
1352 | }; |
---|
1353 | |
---|
1354 | #endif |
---|