bool SourceSetup::Create() { bool foundtheme = false; // Load the theme for this screen foundtheme = LoadWindowFromXML("weather-ui.xml", "source-setup", this); if (!foundtheme) return false; m_sourceList = dynamic_cast<MythUIButtonList *> (GetChild("srclist")); m_updateSpinbox = dynamic_cast<MythUISpinBox *> (GetChild("update_spinbox")); m_retrieveSpinbox = dynamic_cast<MythUISpinBox *> (GetChild("retrieve_spinbox")); m_finishButton = dynamic_cast<MythUIButton *> (GetChild("finishbutton")); m_sourceText = dynamic_cast<MythUIText *> (GetChild("srcinfo")); if (!m_sourceList || !m_updateSpinbox || !m_retrieveSpinbox || !m_finishButton || !m_sourceText) { LOG(VB_GENERAL, LOG_ERR, "Theme is missing required elements."); return false; } BuildFocusList(); SetFocusWidget(m_sourceList); connect(m_sourceList, SIGNAL(itemSelected(MythUIButtonListItem *)), SLOT(sourceListItemSelected(MythUIButtonListItem *))); #if 0 connect(m_sourceList, SIGNAL(TakingFocus()), this, SLOT(sourceListItemSelected())); #endif // 12 Hour max interval m_updateSpinbox->SetRange(10, 720, 10); connect(m_updateSpinbox, SIGNAL(LosingFocus()), SLOT(updateSpinboxUpdate())); // 2 Minute retrieval timeout max m_retrieveSpinbox->SetRange(10, 120, 5); connect(m_retrieveSpinbox, SIGNAL(LosingFocus()), SLOT(retrieveSpinboxUpdate())); m_finishButton->SetText(tr("Finish")); connect(m_finishButton, SIGNAL(Clicked()), SLOT(saveData())); loadData(); return true; }
MythUITextEdit::MythUITextEdit(MythUIType *parent, const QString &name) : MythUIType(parent, name) { m_Message = ""; m_Filter = FilterNone; m_isPassword = false; m_blinkInterval = 0; m_cursorBlinkRate = 40; m_Position = -1; m_maxLength = 255; m_backgroundState = NULL; m_cursorImage = NULL; m_Text = NULL; m_keyboardPosition = VK_POSBELOWEDIT; connect(this, SIGNAL(TakingFocus()), SLOT(Select())); connect(this, SIGNAL(LosingFocus()), SLOT(Deselect())); m_CanHaveFocus = true; m_initialized = false; m_lastKeyPress.start(); }
void ProgFinder::Init(void) { m_allowKeypress = true; initAlphabetList(); gCoreContext->addListener(this); connect(m_timesList, SIGNAL(itemSelected(MythUIButtonListItem*)), SLOT(updateInfo())); connect(m_timesList, SIGNAL(itemClicked(MythUIButtonListItem*)), SLOT(select())); connect(m_timesList, SIGNAL(LosingFocus()), SLOT(timesListLosingFocus())); connect(m_timesList, SIGNAL(TakingFocus()), SLOT(timesListTakeFocus())); connect(m_alphabetList, SIGNAL(itemSelected(MythUIButtonListItem*)), SLOT(alphabetListItemSelected(MythUIButtonListItem*))); connect(m_alphabetList, SIGNAL(itemClicked(MythUIButtonListItem*)), SLOT(select())); connect(m_showList, SIGNAL(TakingFocus()), SLOT(showListTakeFocus())); connect(m_showList, SIGNAL(itemClicked(MythUIButtonListItem*)), SLOT(select())); m_alphabetList->MoveToNamedPosition("A"); }
bool ArchiveFileSelector::Create(void) { bool foundtheme = false; // Load the theme for this screen foundtheme = LoadWindowFromXML("mythnative-ui.xml", "archivefile_selector", this); if (!foundtheme) return false; bool err = false; UIUtilW::Assign(this, m_titleText, "title"); UIUtilE::Assign(this, m_fileButtonList, "filelist", &err); UIUtilE::Assign(this, m_locationEdit, "location_edit", &err); UIUtilE::Assign(this, m_backButton, "back_button", &err); UIUtilE::Assign(this, m_homeButton, "home_button", &err); UIUtilE::Assign(this, m_nextButton, "next_button", &err); UIUtilE::Assign(this, m_prevButton, "prev_button", &err); UIUtilE::Assign(this, m_cancelButton, "cancel_button", &err); UIUtilE::Assign(this, m_progTitle, "title_text", &err); UIUtilE::Assign(this, m_progSubtitle, "subtitle_text", &err); UIUtilE::Assign(this, m_progStartTime, "starttime_text", &err); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'archivefile_selector'"); return false; } if (m_titleText) m_titleText->SetText(tr("Find File To Import")); connect(m_nextButton, SIGNAL(Clicked()), this, SLOT(nextPressed())); connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(cancelPressed())); connect(m_prevButton, SIGNAL(Clicked()), this, SLOT(prevPressed())); connect(m_locationEdit, SIGNAL(LosingFocus()), this, SLOT(locationEditLostFocus())); m_locationEdit->SetText(m_curDirectory); connect(m_backButton, SIGNAL(Clicked()), this, SLOT(backPressed())); connect(m_homeButton, SIGNAL(Clicked()), this, SLOT(homePressed())); connect(m_fileButtonList, SIGNAL(itemSelected(MythUIButtonListItem *)), this, SLOT(itemSelected(MythUIButtonListItem *))); connect(m_fileButtonList, SIGNAL(itemClicked(MythUIButtonListItem *)), this, SLOT(itemClicked(MythUIButtonListItem *))); BuildFocusList(); SetFocusWidget(m_fileButtonList); updateSelectedList(); updateFileList(); return true; }
bool SelectDestination::Create(void) { bool foundtheme = false; // Load the theme for this screen foundtheme = LoadWindowFromXML("mytharchive-ui.xml", "selectdestination", this); if (!foundtheme) return false; bool err = false; UIUtilE::Assign(this, m_createISOCheck, "makeisoimage_check", &err); UIUtilE::Assign(this, m_doBurnCheck, "burntodvdr_check", &err); UIUtilE::Assign(this, m_doBurnText, "burntodvdr_text", &err); UIUtilE::Assign(this, m_eraseDvdRwCheck, "erasedvdrw_check", &err); UIUtilE::Assign(this, m_eraseDvdRwText, "erasedvdrw_text", &err); UIUtilE::Assign(this, m_nextButton, "next_button", &err); UIUtilE::Assign(this, m_prevButton, "prev_button", &err); UIUtilE::Assign(this, m_cancelButton, "cancel_button", &err); UIUtilE::Assign(this, m_destinationSelector, "destination_selector", &err); UIUtilE::Assign(this, m_destinationText, "destination_text", &err); UIUtilE::Assign(this, m_findButton, "find_button", &err); UIUtilE::Assign(this, m_filenameEdit, "filename_edit", &err); UIUtilE::Assign(this, m_freespaceText, "freespace_text", &err); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'selectdestination'"); return false; } connect(m_nextButton, SIGNAL(Clicked()), this, SLOT(handleNextPage())); connect(m_prevButton, SIGNAL(Clicked()), this, SLOT(handlePrevPage())); connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(handleCancel())); connect(m_destinationSelector, SIGNAL(itemSelected(MythUIButtonListItem*)), this, SLOT(setDestination(MythUIButtonListItem*))); for (int x = 0; x < ArchiveDestinationsCount; x++) { MythUIButtonListItem *item = new MythUIButtonListItem(m_destinationSelector, tr(ArchiveDestinations[x].name)); item->SetData(qVariantFromValue(ArchiveDestinations[x].type)); } connect(m_findButton, SIGNAL(Clicked()), this, SLOT(handleFind())); connect(m_filenameEdit, SIGNAL(LosingFocus()), this, SLOT(filenameEditLostFocus())); BuildFocusList(); SetFocusWidget(m_nextButton); loadConfiguration(); return true; }
void MythUIType::LoseFocus(void) { if (!m_CanHaveFocus || !m_HasFocus) return; emit LosingFocus(); m_HasFocus = false; Refresh(); }
void MythUIButton::Deselect() { if (m_Pushed) return; if (IsEnabled()) SetState("active"); else SetState("disabled"); emit LosingFocus(this); }
/** \fn RawSettingsEditor::Create(void) * \brief Creates the UI screen. */ bool RawSettingsEditor::Create(void) { if (!LoadWindowFromXML("settings-ui.xml", "rawsettingseditor", this)) return false; m_settingsList = dynamic_cast<MythUIButtonList *> (GetChild("settings")); m_saveButton = dynamic_cast<MythUIButton *> (GetChild("save")); m_cancelButton = dynamic_cast<MythUIButton *> (GetChild("cancel")); m_textLabel = dynamic_cast<MythUIText *> (GetChild("label-text")); if (!m_settingsList || !m_textLabel || !m_saveButton || !m_cancelButton) { LOG(VB_GENERAL, LOG_EMERG, "Theme is missing critical theme elements."); return false; } BuildFocusList(); MythUIText *text = dynamic_cast<MythUIText *> (GetChild("heading")); if (text) text->SetText(m_title); MythUIShape *shape = nullptr; for (int i = -8; i <= 8; i++) { text = dynamic_cast<MythUIText *> (GetChild(QString("value%1%2").arg(i >= 0? "+" : "").arg(i))); if (text) m_prevNextTexts[i] = text; shape = dynamic_cast<MythUIShape *> (GetChild(QString("shape%1%2").arg(i >= 0? "+" : "").arg(i))); if (shape) m_prevNextShapes[i] = shape; } m_settingValue = dynamic_cast<MythUITextEdit *> (GetChild("settingvalue")); connect(m_settingsList, SIGNAL(itemSelected(MythUIButtonListItem*)), SLOT(selectionChanged(MythUIButtonListItem*))); connect(m_settingValue, SIGNAL(LosingFocus()), SLOT(valueChanged())); connect(m_saveButton, SIGNAL(Clicked()), this, SLOT(Save())); connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(Close())); LoadInBackground(); return true; }
MythUIButton::MythUIButton(MythUIType *parent, const QString &name) : MythUIType(parent, name) { m_clickTimer = new QTimer(); m_clickTimer->setSingleShot(true); m_Pushed = false; m_Lockable = false; m_Text = NULL; m_BackgroundState = NULL; connect(m_clickTimer, SIGNAL(timeout()), SLOT(UnPush())); connect(this, SIGNAL(TakingFocus()), SLOT(Select())); connect(parent, SIGNAL(LosingFocus()), SLOT(Deselect())); connect(this, SIGNAL(LosingFocus()), SLOT(Deselect())); connect(this, SIGNAL(Enabling()), SLOT(Enable())); connect(this, SIGNAL(Disabling()), SLOT(Disable())); SetCanTakeFocus(true); }
MythUICheckBox::MythUICheckBox(MythUIType *parent, const QString &name) : MythUIType(parent, name) { m_currentCheckState = MythUIStateType::Off; m_state = "active"; m_BackgroundState = m_CheckState = NULL; connect(this, SIGNAL(TakingFocus()), this, SLOT(Select())); connect(this, SIGNAL(LosingFocus()), this, SLOT(Deselect())); connect(this, SIGNAL(Enabling()), this, SLOT(Enable())); connect(this, SIGNAL(Disabling()), this, SLOT(Disable())); SetCanTakeFocus(true); }
bool MythUIFileBrowser::Create() { if (!CopyWindowFromBase(m_widgetName, this)) return false; m_fileList = dynamic_cast<MythUIButtonList *>(GetChild("filelist")); m_locationEdit = dynamic_cast<MythUITextEdit *>(GetChild("location")); m_okButton = dynamic_cast<MythUIButton *>(GetChild("ok")); m_cancelButton = dynamic_cast<MythUIButton *>(GetChild("cancel")); m_backButton = dynamic_cast<MythUIButton *>(GetChild("back")); m_homeButton = dynamic_cast<MythUIButton *>(GetChild("home")); m_previewImage = dynamic_cast<MythUIImage *>(GetChild("preview")); m_infoText = dynamic_cast<MythUIText *>(GetChild("info")); m_filenameText = dynamic_cast<MythUIText *>(GetChild("filename")); m_fullpathText = dynamic_cast<MythUIText *>(GetChild("fullpath")); if (!m_fileList || !m_locationEdit || !m_okButton || !m_cancelButton) { LOG(VB_GENERAL, LOG_ERR, "MythUIFileBrowser: Your theme is missing" " some UI elements! Bailing out."); return false; } connect(m_fileList, SIGNAL(itemClicked(MythUIButtonListItem *)), SLOT(PathClicked(MythUIButtonListItem *))); connect(m_fileList, SIGNAL(itemSelected(MythUIButtonListItem *)), SLOT(PathSelected(MythUIButtonListItem *))); connect(m_locationEdit, SIGNAL(LosingFocus()), SLOT(editLostFocus())); connect(m_okButton, SIGNAL(Clicked()), SLOT(OKPressed())); connect(m_cancelButton, SIGNAL(Clicked()), SLOT(cancelPressed())); if (m_backButton) connect(m_backButton, SIGNAL(Clicked()), SLOT(backPressed())); if (m_homeButton) connect(m_homeButton, SIGNAL(Clicked()), SLOT(homePressed())); BuildFocusList(); updateFileList(); return true; }
MythUIButtonTree::MythUIButtonTree(MythUIType *parent, const QString &name) : MythUIType(parent, name) { m_initialized = false; m_numLists = 1; m_visibleLists = 0; m_currentDepth = m_oldDepth = m_depthOffset = 0; m_rootNode = m_currentNode = NULL; m_listSpacing = 0; m_activeList = NULL; m_activeListID = 0; m_active = true; m_listTemplate = NULL; SetCanTakeFocus(true); connect(this, SIGNAL(TakingFocus()), this, SLOT(Select())); connect(this, SIGNAL(LosingFocus()), this, SLOT(Deselect())); }
bool EditMetadataDialog::Create() { if (!LoadWindowFromXML("video-ui.xml", "edit_metadata", this)) return false; bool err = false; UIUtilE::Assign(this, m_titleEdit, "title_edit", &err); UIUtilE::Assign(this, m_subtitleEdit, "subtitle_edit", &err); UIUtilE::Assign(this, m_playerEdit, "player_edit", &err); UIUtilE::Assign(this, m_seasonSpin, "season", &err); UIUtilE::Assign(this, m_episodeSpin, "episode", &err); UIUtilE::Assign(this, m_categoryList, "category_select", &err); UIUtilE::Assign(this, m_levelList, "level_select", &err); UIUtilE::Assign(this, m_childList, "child_select", &err); UIUtilE::Assign(this, m_browseCheck, "browse_check", &err); UIUtilE::Assign(this, m_watchedCheck, "watched_check", &err); UIUtilE::Assign(this, m_doneButton, "done_button", &err); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'edit_metadata'"); return false; } UIUtilW::Assign(this, m_coverartText, "coverart_text"); UIUtilW::Assign(this, m_screenshotText, "screenshot_text"); UIUtilW::Assign(this, m_bannerText, "banner_text"); UIUtilW::Assign(this, m_fanartText, "fanart_text"); UIUtilW::Assign(this, m_trailerText, "trailer_text"); UIUtilW::Assign(this, m_coverartButton, "coverart_button"); UIUtilW::Assign(this, m_bannerButton, "banner_button"); UIUtilW::Assign(this, m_fanartButton, "fanart_button"); UIUtilW::Assign(this, m_screenshotButton, "screenshot_button"); UIUtilW::Assign(this, m_trailerButton, "trailer_button"); UIUtilW::Assign(this, m_netBannerButton, "net_banner_button"); UIUtilW::Assign(this, m_netFanartButton, "net_fanart_button"); UIUtilW::Assign(this, m_netScreenshotButton, "net_screenshot_button"); UIUtilW::Assign(this, m_netCoverartButton, "net_coverart_button"); UIUtilW::Assign(this, m_taglineEdit, "tagline_edit"); UIUtilW::Assign(this, m_ratingEdit, "rating_edit"); UIUtilW::Assign(this, m_directorEdit, "director_edit"); UIUtilW::Assign(this, m_inetrefEdit, "inetref_edit"); UIUtilW::Assign(this, m_homepageEdit, "homepage_edit"); UIUtilW::Assign(this, m_plotEdit, "description_edit"); UIUtilW::Assign(this, m_yearSpin, "year_spin"); UIUtilW::Assign(this, m_userRatingSpin, "userrating_spin"); UIUtilW::Assign(this, m_lengthSpin, "length_spin"); UIUtilW::Assign(this, m_coverart, "coverart"); UIUtilW::Assign(this, m_screenshot, "screenshot"); UIUtilW::Assign(this, m_banner, "banner"); UIUtilW::Assign(this, m_fanart, "fanart"); fillWidgets(); BuildFocusList(); connect(m_titleEdit, SIGNAL(valueChanged()), SLOT(SetTitle())); m_titleEdit->SetMaxLength(128); connect(m_subtitleEdit, SIGNAL(valueChanged()), SLOT(SetSubtitle())); m_subtitleEdit->SetMaxLength(0); connect(m_playerEdit, SIGNAL(valueChanged()), SLOT(SetPlayer())); if (m_taglineEdit) { connect(m_taglineEdit, SIGNAL(valueChanged()), SLOT(SetTagline())); m_taglineEdit->SetMaxLength(255); } if (m_ratingEdit) { connect(m_ratingEdit, SIGNAL(valueChanged()), SLOT(SetRating())); m_ratingEdit->SetMaxLength(128); } if (m_directorEdit) { connect(m_directorEdit, SIGNAL(valueChanged()), SLOT(SetDirector())); m_directorEdit->SetMaxLength(128); } if (m_inetrefEdit) connect(m_inetrefEdit, SIGNAL(valueChanged()), SLOT(SetInetRef())); if (m_homepageEdit) { connect(m_homepageEdit, SIGNAL(valueChanged()), SLOT(SetHomepage())); m_homepageEdit->SetMaxLength(0); } if (m_plotEdit) { connect(m_plotEdit, SIGNAL(valueChanged()), SLOT(SetPlot())); m_plotEdit->SetMaxLength(0); } connect(m_seasonSpin, SIGNAL(LosingFocus()), SLOT(SetSeason())); connect(m_episodeSpin, SIGNAL(LosingFocus()), SLOT(SetEpisode())); if (m_yearSpin) connect(m_yearSpin, SIGNAL(LosingFocus()), SLOT(SetYear())); if (m_userRatingSpin) connect(m_userRatingSpin, SIGNAL(LosingFocus()), SLOT(SetUserRating())); if (m_lengthSpin) connect(m_lengthSpin, SIGNAL(LosingFocus()), SLOT(SetLength())); connect(m_doneButton, SIGNAL(Clicked()), SLOT(SaveAndExit())); // Find Artwork locally if (m_coverartButton) connect(m_coverartButton, SIGNAL(Clicked()), SLOT(FindCoverArt())); if (m_bannerButton) connect(m_bannerButton, SIGNAL(Clicked()), SLOT(FindBanner())); if (m_fanartButton) connect(m_fanartButton, SIGNAL(Clicked()), SLOT(FindFanart())); if (m_screenshotButton) connect(m_screenshotButton, SIGNAL(Clicked()), SLOT(FindScreenshot())); // Find Artwork on the Internet if (m_netCoverartButton) connect(m_netCoverartButton, SIGNAL(Clicked()), SLOT(FindNetCoverArt())); if (m_netBannerButton) connect(m_netBannerButton, SIGNAL(Clicked()), SLOT(FindNetBanner())); if (m_netFanartButton) connect(m_netFanartButton, SIGNAL(Clicked()), SLOT(FindNetFanart())); if (m_netScreenshotButton) connect(m_netScreenshotButton, SIGNAL(Clicked()), SLOT(FindNetScreenshot())); if (m_trailerButton) connect(m_trailerButton, SIGNAL(Clicked()), SLOT(FindTrailer())); connect(m_browseCheck, SIGNAL(valueChanged()), SLOT(ToggleBrowse())); connect(m_watchedCheck, SIGNAL(valueChanged()), SLOT(ToggleWatched())); connect(m_childList, SIGNAL(itemSelected(MythUIButtonListItem*)), SLOT(SetChild(MythUIButtonListItem*))); connect(m_levelList, SIGNAL(itemSelected(MythUIButtonListItem*)), SLOT(SetLevel(MythUIButtonListItem*))); connect(m_categoryList, SIGNAL(itemSelected(MythUIButtonListItem*)), SLOT(SetCategory(MythUIButtonListItem*))); connect(m_categoryList, SIGNAL(itemClicked(MythUIButtonListItem*)), SLOT(NewCategoryPopup())); return true; }
bool EditMetadataDialog::Create(void) { if (! LoadWindowFromXML("music-ui.xml", "editmetadata", this)) return false; bool err = CreateCommon(); UIUtilE::Assign(this, m_titleEdit, "titleedit", &err); UIUtilE::Assign(this, m_artistEdit, "artistedit", &err); UIUtilE::Assign(this, m_compArtistEdit, "compartistedit", &err); UIUtilE::Assign(this, m_albumEdit, "albumedit", &err); UIUtilE::Assign(this, m_genreEdit, "genreedit", &err); UIUtilE::Assign(this, m_yearSpin, "yearspin", &err); UIUtilE::Assign(this, m_trackSpin, "tracknumspin", &err); UIUtilE::Assign(this, m_searchArtistButton, "searchartistbutton", &err); UIUtilE::Assign(this, m_searchCompArtistButton, "searchcompartistbutton", &err); UIUtilE::Assign(this, m_searchAlbumButton, "searchalbumbutton", &err); UIUtilE::Assign(this, m_searchGenreButton, "searchgenrebutton", &err); UIUtilW::Assign(this, m_artistIcon, "artisticon", &err); UIUtilW::Assign(this, m_albumIcon, "albumicon", &err); UIUtilW::Assign(this, m_genreIcon, "genreicon", &err); UIUtilW::Assign(this, m_ratingState, "ratingstate", &err); UIUtilW::Assign(this, m_ratingSpin, "ratingspin", &err); UIUtilW::Assign(this, m_incRatingButton, "incratingbutton", &err); UIUtilW::Assign(this, m_decRatingButton, "decratingbutton", &err); UIUtilE::Assign(this, m_compilationCheck, "compilationcheck", &err); UIUtilE::Assign(this, m_albumartButton, "albumartbutton", &err); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'editmetadata'"); return false; } m_yearSpin->SetRange(0, 9999, 1); m_trackSpin->SetRange(0, 9999, 1); if (m_ratingSpin) { m_ratingSpin->SetRange(0, 10, 1); connect(m_ratingSpin, SIGNAL(itemSelected(MythUIButtonListItem*)), SLOT(ratingSpinChanged(MythUIButtonListItem*))); } connect(m_artistEdit, SIGNAL(LosingFocus()), SLOT(artistLostFocus())); connect(m_albumEdit, SIGNAL(LosingFocus()), SLOT(albumLostFocus())); connect(m_genreEdit, SIGNAL(LosingFocus()), SLOT(genreLostFocus())); connect(m_searchArtistButton, SIGNAL(Clicked()), SLOT(searchArtist())); connect(m_searchCompArtistButton, SIGNAL(Clicked()), SLOT(searchCompilationArtist())); connect(m_searchAlbumButton, SIGNAL(Clicked()), SLOT(searchAlbum())); connect(m_searchGenreButton, SIGNAL(Clicked()), SLOT(searchGenre())); if (m_incRatingButton && m_decRatingButton) { connect(m_incRatingButton, SIGNAL(Clicked()), SLOT(incRating())); connect(m_decRatingButton, SIGNAL(Clicked()), SLOT(decRating())); } connect(m_compilationCheck, SIGNAL(toggled(bool)), SLOT(checkClicked(bool))); connect(m_albumartButton, SIGNAL(Clicked()), SLOT(switchToAlbumArt())); fillWidgets(); BuildFocusList(); return true; }
bool FileSelector::Create(void) { bool foundtheme = false; // Load the theme for this screen foundtheme = LoadWindowFromXML("mytharchive-ui.xml", "file_selector", this); if (!foundtheme) return false; bool err = false; UIUtilW::Assign(this, m_titleText, "title_text"); UIUtilE::Assign(this, m_fileButtonList, "filelist", &err); UIUtilE::Assign(this, m_locationEdit, "location_edit", &err); UIUtilE::Assign(this, m_backButton, "back_button", &err); UIUtilE::Assign(this, m_homeButton, "home_button", &err); UIUtilE::Assign(this, m_okButton, "ok_button", &err); UIUtilE::Assign(this, m_cancelButton, "cancel_button", &err); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'file_selector'"); return false; } if (m_titleText) { switch (m_selectorType) { case FSTYPE_FILE: m_titleText->SetText(tr("Find File")); break; case FSTYPE_DIRECTORY: m_titleText->SetText(tr("Find Directory")); break; default: m_titleText->SetText(tr("Find Files")); break; } } connect(m_okButton, SIGNAL(Clicked()), this, SLOT(OKPressed())); connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(cancelPressed())); connect(m_locationEdit, SIGNAL(LosingFocus()), this, SLOT(locationEditLostFocus())); m_locationEdit->SetText(m_curDirectory); connect(m_backButton, SIGNAL(Clicked()), this, SLOT(backPressed())); connect(m_homeButton, SIGNAL(Clicked()), this, SLOT(homePressed())); connect(m_fileButtonList, SIGNAL(itemClicked(MythUIButtonListItem *)), this, SLOT(itemClicked(MythUIButtonListItem *))); BuildFocusList(); SetFocusWidget(m_fileButtonList); updateSelectedList(); updateFileList(); return true; }