Ticket #6814: 6814-v1.diff
File 6814-v1.diff, 9.9 KB (added by , 14 years ago) |
---|
-
libs/libmythui/mythdialogbox.h
85 85 86 86 signals: 87 87 void Selected(); 88 void Closed( );88 void Closed(QString, int); 89 89 90 90 protected: 91 91 void SendEvent(int res, QString text = "", QVariant data = 0); -
libs/libmythui/mythdialogbox.cpp
144 144 QString action = actions[i]; 145 145 handled = true; 146 146 147 if (action == "ESCAPE" || action == "LEFT" || action == "MENU")147 if (action == "ESCAPE" || action == "LEFT") 148 148 { 149 149 SendEvent(-1); 150 150 Close(); 151 151 } 152 else if (action == "MENU") 153 { 154 SendEvent(-2); 155 Close(); 156 } 152 157 else if (action == "RIGHT") 153 158 { 154 159 MythUIButtonListItem *item = m_buttonList->GetItemCurrent(); … … 189 194 190 195 void MythDialogBox::SendEvent(int res, QString text, QVariant data) 191 196 { 197 emit Closed(m_id, res); 198 192 199 if (!m_retObject) 193 200 return; 194 201 -
programs/mythfrontend/playbackbox.cpp
361 361 362 362 // General m_popupMenu support 363 363 m_popupMenu(NULL), 364 m_doToggleMenu(true), 364 365 // Main Recording List support 365 366 m_progsInDB(0), 366 367 // Other state … … 988 989 989 990 if (usedProgress) 990 991 { 991 usedProgress->SetTotal( freeSpaceTotal);992 usedProgress->SetUsed( freeSpaceUsed);992 usedProgress->SetTotal((int)freeSpaceTotal); 993 usedProgress->SetUsed((int)freeSpaceUsed); 993 994 } 994 995 } 995 996 … … 1856 1857 } 1857 1858 } 1858 1859 1859 void PlaybackBox::popupClosed( )1860 void PlaybackBox::popupClosed(QString which, int result) 1860 1861 { 1861 1862 m_popupMenu = NULL; 1863 1864 if (result == -2) 1865 { 1866 if (!m_doToggleMenu) 1867 { 1868 m_doToggleMenu = true; 1869 return; 1870 } 1871 1872 if (which == "groupmenu") 1873 { 1874 ProgramInfo *pginfo = CurrentItem(); 1875 if (pginfo) 1876 { 1877 m_helper.CheckAvailability(*pginfo, kCheckForMenuAction); 1878 1879 if ((asPendingDelete == pginfo->availableStatus) || 1880 (asPendingDelete == pginfo->availableStatus)) 1881 { 1882 ShowAvailabilityPopup(*pginfo); 1883 } 1884 else 1885 { 1886 ShowActionPopup(*pginfo); 1887 m_doToggleMenu = false; 1888 } 1889 } 1890 } 1891 else if (which == "actionmenu") 1892 { 1893 ShowGroupPopup(); 1894 m_doToggleMenu = false; 1895 } 1896 } 1862 1897 } 1863 1898 1864 void PlaybackBox::Show Menu()1899 void PlaybackBox::ShowGroupPopup() 1865 1900 { 1866 1901 if (m_popupMenu) 1867 1902 return; 1868 1903 1869 QString label = tr(" RecordingList Menu");1904 QString label = tr("Group List Menu"); 1870 1905 1871 1906 ProgramInfo *pginfo = CurrentItem(); 1872 1907 1873 1908 m_popupMenu = new MythDialogBox(label, m_popupStack, "pbbmainmenupopup"); 1874 1909 1875 connect(m_popupMenu, SIGNAL( Exiting()), SLOT(popupClosed()));1910 connect(m_popupMenu, SIGNAL(Closed(QString, int)), SLOT(popupClosed(QString, int))); 1876 1911 1877 1912 if (m_popupMenu->Create()) 1878 1913 m_popupStack->AddScreen(m_popupMenu); … … 1880 1915 { 1881 1916 delete m_popupMenu; 1882 1917 m_popupMenu = NULL; 1918 return; 1883 1919 } 1884 1920 1885 m_popupMenu->SetReturnEvent(this, " slotmenu");1921 m_popupMenu->SetReturnEvent(this, "groupmenu"); 1886 1922 1887 1923 m_popupMenu->AddButton(tr("Change Group Filter"), 1888 1924 SLOT(showGroupFilter())); … … 1914 1950 } 1915 1951 1916 1952 m_popupMenu->AddButton(tr("Help (Status Icons)"), SLOT(showIconHelp())); 1953 1954 #if 0 1955 if (GetFocusWidget() != m_groupList) 1956 { 1957 m_popupMenu->AddButton(tr("Recording Options Menu"), 1958 SLOT(showActionsSelected())); 1959 } 1960 #endif 1917 1961 } 1918 1962 1919 1963 bool PlaybackBox::Play(const ProgramInfo &rec, bool inPlaylist) … … 2233 2277 2234 2278 m_popupMenu = new MythDialogBox(label, m_popupStack, "pbbmainmenupopup"); 2235 2279 2236 connect(m_popupMenu, SIGNAL( Exiting()), SLOT(popupClosed()));2280 connect(m_popupMenu, SIGNAL(Closed(QString, int)), SLOT(popupClosed(QString, int))); 2237 2281 2238 2282 if (m_popupMenu->Create()) 2239 2283 m_popupStack->AddScreen(m_popupMenu); … … 2241 2285 { 2242 2286 delete m_popupMenu; 2243 2287 m_popupMenu = NULL; 2288 return; 2244 2289 } 2245 2290 2246 m_popupMenu->SetReturnEvent(this, " slotmenu");2291 m_popupMenu->SetReturnEvent(this, "deletemenu"); 2247 2292 2248 2293 QString tmpmessage; 2249 2294 const char *tmpslot = NULL; … … 2529 2574 if (!m_popupMenu) 2530 2575 return false; 2531 2576 2532 connect(m_popupMenu, SIGNAL( Exiting()), SLOT(popupClosed()));2577 connect(m_popupMenu, SIGNAL(Closed(QString, int)), SLOT(popupClosed(QString, int))); 2533 2578 2534 2579 if (m_popupMenu->Create()) 2535 2580 { … … 2543 2588 return false; 2544 2589 } 2545 2590 2546 return m_popupMenu;2591 return true; 2547 2592 } 2548 2593 2549 2594 bool PlaybackBox::CreatePopupMenuPlaylist(void) … … 2734 2779 if (!CreatePopupMenu(label, pginfo)) 2735 2780 return; 2736 2781 2782 m_popupMenu->SetReturnEvent(this, "actionmenu"); 2783 2737 2784 if ((asFileNotFound == pginfo.availableStatus) || 2738 2785 (asZeroByte == pginfo.availableStatus)) 2739 2786 { … … 2778 2825 SLOT(showPlayFromPopup()), true); 2779 2826 else 2780 2827 m_popupMenu->AddButton(tr("Play"), SLOT(playSelected())); 2781 2828 2782 2829 if (m_playList.filter(pginfo.MakeUniqueKey()).size()) 2783 2830 m_popupMenu->AddButton(tr("Remove from Playlist"), 2784 2831 SLOT(togglePlayListItem())); 2785 2832 else 2786 2833 m_popupMenu->AddButton(tr("Add to Playlist"), 2787 2834 SLOT(togglePlayListItem())); 2835 if (m_playList.size()) 2836 { 2837 m_popupMenu->AddButton(tr("Playlist options"), 2838 SLOT(showPlaylistPopup()), true); 2839 } 2788 2840 } 2789 2841 2790 2842 if (pginfo.recstatus == rsRecording && … … 2821 2873 m_popupMenu->AddButton(tr("Delete"), SLOT(askDelete())); 2822 2874 } 2823 2875 } 2876 #if 0 2877 m_popupMenu->AddButton(tr("Group List Menu"), 2878 SLOT(ShowGroupPopup())); 2879 #endif 2824 2880 } 2825 2881 2826 2882 QString PlaybackBox::CreateProgramInfoString(const ProgramInfo &pginfo) const … … 3444 3500 3445 3501 if (action == "1" || action == "HELP") 3446 3502 showIconHelp(); 3503 else if (action == "MENU") 3504 { 3505 if (GetFocusWidget() == m_groupList) 3506 ShowGroupPopup(); 3507 else 3508 { 3509 ProgramInfo *pginfo = CurrentItem(); 3510 if (pginfo) 3511 { 3512 m_helper.CheckAvailability( 3513 *pginfo, kCheckForMenuAction); 3514 3515 if ((asPendingDelete == pginfo->availableStatus) || 3516 (asPendingDelete == pginfo->availableStatus)) 3517 { 3518 ShowAvailabilityPopup(*pginfo); 3519 } 3520 else 3521 { 3522 ShowActionPopup(*pginfo); 3523 } 3524 } 3525 } 3526 } 3447 3527 else if (action == "NEXTFAV") 3448 3528 { 3449 3529 if (GetFocusWidget() == m_groupList) … … 3503 3583 deleteSelected(m_recordingList->GetItemCurrent()); 3504 3584 else if (action == "PLAYBACK") 3505 3585 playSelected(m_recordingList->GetItemCurrent()); 3506 else if (action == "INFO") 3507 { 3508 if (GetFocusWidget() != m_groupList) 3509 { 3510 ProgramInfo *pginfo = CurrentItem(); 3511 if (pginfo) 3512 { 3513 m_helper.CheckAvailability( 3514 *pginfo, kCheckForMenuAction); 3515 3516 if ((asPendingDelete == pginfo->availableStatus) || 3517 (asPendingDelete == pginfo->availableStatus)) 3518 { 3519 ShowAvailabilityPopup(*pginfo); 3520 } 3521 else 3522 { 3523 ShowActionPopup(*pginfo); 3524 } 3525 } 3526 } 3527 } 3528 else if (action == "DETAILS") 3586 else if (action == "DETAILS" || action == "INFO") 3529 3587 details(); 3530 3588 else if (action == "CUSTOMEDIT") 3531 3589 customEdit(); -
programs/mythfrontend/playbackbox.h
138 138 139 139 void SwitchList(void); 140 140 141 void ShowGroupPopup(void); 141 142 void customEdit(); 142 143 void upcoming(); 143 144 void details(); … … 169 170 void ShowRecGroupChanger(bool use_playlist = false); 170 171 void ShowPlayGroupChanger(bool use_playlist = false); 171 172 172 void popupClosed( );173 void popupClosed(QString which, int reason); 173 174 174 175 void doPlayFromBeg(); 175 176 void doPlayListRandom(); … … 316 317 317 318 void ScheduleUpdateUIList(void); 318 319 319 void ShowMenu(void);320 321 320 bool CreatePopupMenu(const QString &title); 322 321 bool CreatePopupMenu(const QString &title, const ProgramInfo &pginfo) 323 322 { return CreatePopupMenu(title + CreateProgramInfoString(pginfo)); } … … 385 384 MythDialogBox *m_popupMenu; 386 385 MythScreenStack *m_popupStack; 387 386 388 bool m_ expectingPopup;387 bool m_doToggleMenu; 389 388 390 389 // Recording Group popup support 391 390 QMap<QString,QString> m_recGroupType;