bool Weather::Create() { bool foundtheme = false; // Load the theme for this screen foundtheme = LoadWindowFromXML("weather-ui.xml", "weatherbase", this); if (!foundtheme) { LOG(VB_GENERAL, LOG_ERR, "Missing required window - weatherbase."); return false; } bool err = false; UIUtilE::Assign(this, m_pauseText, "pause_text", &err); UIUtilE::Assign(this, m_headerText, "header", &err); UIUtilE::Assign(this, m_updatedText, "update_text", &err); if (err) { LOG(VB_GENERAL, LOG_ERR, "Window weatherbase is missing required elements."); return false; } if (m_pauseText) { m_pauseText->SetText(tr("Paused")); m_pauseText->Hide(); } return true; }
bool SearchInputDialog::Create(void) { if (!LoadWindowFromXML("schedule-ui.xml", "searchpopup", this)) return false; MythUIText *messageText = NULL; MythUIButton *okButton = NULL; MythUIButton *cancelButton = NULL; bool err = false; UIUtilE::Assign(this, m_textEdit, "input", &err); UIUtilE::Assign(this, messageText, "message", &err); UIUtilE::Assign(this, okButton, "ok", &err); UIUtilW::Assign(this, cancelButton, "cancel"); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'searchpopup'"); return false; } if (cancelButton) connect(cancelButton, SIGNAL(Clicked()), SLOT(Close())); connect(okButton, SIGNAL(Clicked()), SLOT(sendResult())); m_textEdit->SetFilter(m_filter); m_textEdit->SetText(m_defaultValue); m_textEdit->SetPassword(m_isPassword); connect(m_textEdit, SIGNAL(valueChanged()), SLOT(editChanged())); BuildFocusList(); return true; }
bool ProgFinder::Create() { if (!LoadWindowFromXML("schedule-ui.xml", "programfind", this)) return false; bool err = false; UIUtilE::Assign(this, m_alphabetList, "alphabet", &err); UIUtilE::Assign(this, m_showList, "shows", &err); UIUtilE::Assign(this, m_timesList, "times", &err); UIUtilW::Assign(this, m_help1Text, "help1text"); UIUtilW::Assign(this, m_help2Text, "help2text"); UIUtilW::Assign(this, m_searchText, "search"); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'programfind'"); return false; } m_alphabetList->SetLCDTitles(tr("Starts With"), ""); m_showList->SetLCDTitles(tr("Programs"), ""); m_timesList->SetLCDTitles(tr("Times"), "buttontext"); BuildFocusList(); LoadInBackground(); if (m_player) m_player->StartEmbedding(QRect()); return true; }
bool GlobalSetup::Create() { bool foundtheme = false; // Load the theme for this screen foundtheme = LoadWindowFromXML("weather-ui.xml", "global-setup", this); if (!foundtheme) return false; m_timeoutSpinbox = dynamic_cast<MythUISpinBox *> (GetChild("timeout_spinbox")); m_backgroundCheckbox = dynamic_cast<MythUICheckBox *> (GetChild("backgroundcheck")); m_finishButton = dynamic_cast<MythUIButton *> (GetChild("finishbutton")); if (!m_timeoutSpinbox || !m_finishButton || !m_backgroundCheckbox) { LOG(VB_GENERAL, LOG_ERR, "Theme is missing required elements."); return false; } BuildFocusList(); m_finishButton->SetText(tr("Finish")); connect(m_finishButton, SIGNAL(Clicked()), this, SLOT(saveData())); loadData(); return true; }
bool NetEditorBase::Create(void) { // Load the theme for this screen bool foundtheme = LoadWindowFromXML("netvision-ui.xml", "treeeditor", this); if (!foundtheme) return false; bool err = false; UIUtilE::Assign(this, m_grabbers, "grabbers", &err); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'treeeditor'"); return false; } connect(m_grabbers, SIGNAL(itemClicked(MythUIButtonListItem*)), this, SLOT(ToggleItem(MythUIButtonListItem*))); BuildFocusList(); LoadData(); return true; }
/** \fn GalleryWidget::Create() * \brief Initialises and shows the graphical elements * \return True if successful otherwise false */ bool GalleryWidget::Create() { if (!LoadWindowFromXML("image-ui.xml", "slideshow", this)) return false; bool err = false; // Widget for showing the images UIUtilE::Assign(this, m_image1, "first_image", &err); UIUtilE::Assign(this, m_image2, "second_image", &err); UIUtilW::Assign(this, m_status, "status"); // Widgets to show the details to an image UIUtilE::Assign(this, m_infoList, "infolist", &err); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'slideshow'"); return false; } HideFileDetails(); BuildFocusList(); SetFocusWidget(m_image1); m_fileDataList = new QList<ImageMetadata *>(); m_fileDataList->append(new ImageMetadata()); m_fileDataList->append(new ImageMetadata()); m_fileList = new QList<MythUIImage *>(); m_fileList->append(m_image1); m_fileList->append(m_image2); return true; }
bool ZMLivePlayer::Create(void) { // Load the theme for this screen QString winName = m_isMiniPlayer ? "miniplayer" : "zmliveplayer"; if (!LoadWindowFromXML("zoneminder-ui.xml", winName, this)) { LOG(VB_GENERAL, LOG_ERR, QString("Cannot load screen '%1'").arg(winName)); return false; } if (!hideAll()) return false; if (m_isMiniPlayer) { // we only support the single camera layout in the mini player if (!initMonitorLayout(1)) return false; } else { if (!initMonitorLayout(gCoreContext->GetNumSetting("ZoneMinderLiveLayout", 1))) return false; } return true; }
bool SearchEditor::Create(void) { // Load the theme for this screen bool foundtheme = LoadWindowFromXML("netvision-ui.xml", "treeeditor", this); if (!foundtheme) return false; bool err = false; UIUtilE::Assign(this, m_grabbers, "grabbers", &err); if (err) { VERBOSE(VB_IMPORTANT, "Cannot load screen 'treeeditor'"); return false; } connect(m_grabbers, SIGNAL(itemClicked(MythUIButtonListItem*)), this, SLOT(toggleItem(MythUIButtonListItem*))); BuildFocusList(); loadData(); return true; }
bool PlotDialog::Create() { if (!LoadWindowFromXML("video-ui.xml", "descriptionpopup", this)) return false; MythUIText *plotText = nullptr; MythUIButton *okButton = nullptr; bool err = false; UIUtilE::Assign(this, plotText, "description", &err); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'descriptionpopup'"); return false; } UIUtilW::Assign(this, okButton, "ok"); plotText->SetText(m_metadata->GetPlot()); if (okButton) connect(okButton, SIGNAL(Clicked()), SLOT(Close())); BuildFocusList(); return true; }
bool IdleScreen::Create(void) { // Load the theme for this screen bool foundtheme = LoadWindowFromXML("status-ui.xml", "standbymode", this); if (!foundtheme) return false; bool err = false; UIUtilE::Assign(this, m_statusState, "backendstatus", &err); /* currentrecording, nextrecording, conflicts and conflictwarning are optional */ UIUtilW::Assign(this, m_currentRecordings, "currentrecording"); UIUtilW::Assign(this, m_nextRecordings, "nextrecording"); UIUtilW::Assign(this, m_conflictingRecordings, "conflicts"); UIUtilW::Assign(this, m_conflictWarning, "conflictwarning"); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'standbymode'"); return false; } UpdateScheduledList(); return true; }
bool ViewScheduleDiff::Create() { if (!LoadWindowFromXML("schedule-ui.xml", "schedulediff", this)) return false; bool err = false; UIUtilE::Assign(this, m_conflictList, "conflictlist", &err); UIUtilW::Assign(this, m_titleText, "titletext"); UIUtilW::Assign(this, m_noChangesText, "nochanges"); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'schedulediff'"); return false; } connect(m_conflictList, SIGNAL(itemSelected(MythUIButtonListItem*)), SLOT(updateInfo(MythUIButtonListItem*))); connect(m_conflictList, SIGNAL(itemClicked(MythUIButtonListItem*)), SLOT(showStatus(MythUIButtonListItem*))); if (m_titleText) m_titleText->SetText(m_title); BuildFocusList(); LoadInBackground(); return true; }
bool MiniPlayer::Create(void) { bool err = false; // Load the theme for this screen err = LoadWindowFromXML("music-ui.xml", "miniplayer", this); if (!err) return false; // find common widgets available on any view err = CreateCommon(); if (err) { VERBOSE(VB_IMPORTANT, "Cannot load screen 'miniplayer'"); return false; } m_displayTimer->start(10000); BuildFocusList(); return true; }
bool ZMConsole::Create(void) { // Load the theme for this screen bool foundtheme = LoadWindowFromXML("zoneminder-ui.xml", "zmconsole", this); if (!foundtheme) return false; bool err = false; UIUtilE::Assign(this, m_monitor_list, "monitor_list", &err); UIUtilE::Assign(this, m_status_text, "status_text", &err); UIUtilE::Assign(this, m_time_text, "time_text", &err); UIUtilE::Assign(this, m_date_text, "date_text", &err); UIUtilE::Assign(this, m_load_text, "load_text", &err); UIUtilE::Assign(this, m_disk_text, "disk_text", &err); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'zmconsole'"); return false; } BuildFocusList(); SetFocusWidget(m_monitor_list); m_timeTimer->start(TIME_UPDATE_TIME); m_updateTimer->start(100); updateTime(); return true; }
bool ProgDetails::Create(void) { bool foundtheme = false; // Load the theme for this screen foundtheme = LoadWindowFromXML("schedule-ui.xml", "progdetails", this); if (!foundtheme) return false; bool err = false; UIUtilE::Assign(this, m_browser, "browser", &err); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'progdetails'"); return false; } BuildFocusList(); SetFocusWidget(m_browser); float zoom = gCoreContext->GetSetting("ProgDetailsZoom", "1.0").toFloat(); m_browser->SetZoom(zoom); return true; }
bool VisualizerView::Create(void) { bool err = false; // Load the theme for this screen err = LoadWindowFromXML("music-ui.xml", "visualizerview", this); if (!err) return false; // find common widgets available on any view err = CreateCommon(); // find widgets specific to this view if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'lyricsview'"); return false; } BuildFocusList(); return true; }
bool AirPlayPictureScreen::Create(void) { bool foundtheme = false; // Load the theme for this screen // The xml file containing the screen definition is airplay-ui.xml in this // example, the name of the screen in the xml is airplaypicture. This // should make sense when you look at the xml below foundtheme = LoadWindowFromXML("airplay-ui.xml", "airplaypicture", this); if (!foundtheme) // If we cannot load the theme for any reason ... return false; // The xml should contain an <imagetype> named 'picture', if it doesn't // then we cannot display the image and may as well abort m_airplayImage = dynamic_cast<MythUIImage*> (GetChild("picture")); if (!m_airplayImage) return false; // As an illustration let's say the picture includes a description/title or some other metadata // Let's also say that display of this metadata is entirely optional, so we won't fail if the theme // doesn't include 'description' m_airplayText = dynamic_cast<MythUIText*> (GetChild("description")); return true; }
bool EditAlbumartDialog::Create(void) { if (! LoadWindowFromXML("music-ui.xml", "editalbumart", this)) return false; bool err = CreateCommon(); UIUtilE::Assign(this, m_coverartList, "coverartlist", &err); UIUtilE::Assign(this, m_imagetypeText, "imagetypetext", &err); UIUtilE::Assign(this, m_imagefilenameText, "imagefilenametext", &err); UIUtilE::Assign(this, m_coverartImage, "coverartimage", &err); UIUtilE::Assign(this, m_metadataButton, "metadatabutton", &err); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'editalbumart'"); return false; } updateImageGrid(); connect(m_coverartList, SIGNAL(itemSelected(MythUIButtonListItem*)), this, SLOT(gridItemChanged(MythUIButtonListItem*))); connect(m_metadataButton, SIGNAL(Clicked()), SLOT(switchToMetadata())); BuildFocusList(); return true; }
bool MythNewsConfig::Create(void) { QMutexLocker locker(&m_lock); // Load the theme for this screen bool foundtheme = LoadWindowFromXML("news-ui.xml", "config", this); if (!foundtheme) return false; bool err = false; UIUtilE::Assign(this, m_categoriesList, "category", &err); UIUtilE::Assign(this, m_siteList, "sites", &err); UIUtilW::Assign(this, m_helpText, "help", &err); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'config'"); return false; } connect(m_categoriesList, SIGNAL(itemSelected(MythUIButtonListItem*)), this, SLOT(slotCategoryChanged(MythUIButtonListItem*))); connect(m_siteList, SIGNAL(itemClicked(MythUIButtonListItem*)), this, SLOT(toggleItem(MythUIButtonListItem*))); BuildFocusList(); SetFocusWidget(m_categoriesList); loadData(); return true; }
bool LanguageSelection::Create(void) { if (!LoadWindowFromXML("config-ui.xml", "languageselection", this)) return false; bool err = false; UIUtilE::Assign(this, m_languageList, "languages", &err); UIUtilE::Assign(this, m_countryList, "countries", &err); UIUtilE::Assign(this, m_saveButton, "save", &err); UIUtilE::Assign(this, m_cancelButton, "cancel", &err); if (err) { LOG(VB_GENERAL, LOG_ALERT, "Cannot load screen 'languageselection'"); return false; } #if 0 connect(m_countryList, SIGNAL(itemClicked(MythUIButtonListItem*)), SLOT(LocaleClicked(MythUIButtonListItem*))); connect(m_languageList, SIGNAL(itemClicked(MythUIButtonListItem*)), SLOT(LanguageClicked(MythUIButtonListItem*))); #endif connect(m_saveButton, SIGNAL(Clicked()), SLOT(Save())); connect(m_cancelButton, SIGNAL(Clicked()), SLOT(Close())); m_languageList->SetLCDTitles(tr("Preferred language"), ""); m_countryList->SetLCDTitles(tr("Your location"), ""); BuildFocusList(); return true; }
bool CastDialog::Create() { if (!LoadWindowFromXML("video-ui.xml", "castpopup", this)) return false; MythUIButtonList *castList = nullptr; MythUIButton *okButton = nullptr; bool err = false; UIUtilE::Assign(this, castList, "cast", &err); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'castpopup'"); return false; } UIUtilW::Assign(this, okButton, "ok"); if (okButton) connect(okButton, SIGNAL(Clicked()), SLOT(Close())); QStringList cast = GetDisplayCast(*m_metadata); QStringListIterator castIterator(cast); while (castIterator.hasNext()) { new MythUIButtonListItem(castList, castIterator.next()); } BuildFocusList(); return true; }
bool RSSEditPopup::Create(void) { // Load the theme for this screen bool foundtheme = LoadWindowFromXML("netvision-ui.xml", "rsseditpopup", this); if (!foundtheme) return false; bool err = false; UIUtilE::Assign(this, m_urlEdit, "url", &err); UIUtilE::Assign(this, m_titleEdit, "title", &err); UIUtilE::Assign(this, m_descEdit, "description", &err); UIUtilE::Assign(this, m_authorEdit, "author", &err); UIUtilE::Assign(this, m_download, "download", &err); UIUtilE::Assign(this, m_okButton, "ok", &err); UIUtilE::Assign(this, m_cancelButton, "cancel", &err); UIUtilE::Assign(this, m_thumbButton, "preview_browse", &err); UIUtilE::Assign(this, m_thumbImage, "preview", &err); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'rsseditpopup'"); return false; } connect(m_okButton, SIGNAL(Clicked()), this, SLOT(ParseAndSave())); connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(Close())); connect(m_thumbButton, SIGNAL(Clicked()), this, SLOT(DoFileBrowser())); m_urlEdit->SetMaxLength(0); m_titleEdit->SetMaxLength(255); m_descEdit->SetMaxLength(0); m_authorEdit->SetMaxLength(255); if (m_editing) { m_site = findByURL(m_urlText, VIDEO_PODCAST); m_urlEdit->SetText(m_urlText); m_titleEdit->SetText(m_site->GetTitle()); m_descEdit->SetText(m_site->GetDescription()); m_authorEdit->SetText(m_site->GetAuthor()); QString thumb = m_site->GetImage(); if (!thumb.isEmpty()) { m_thumbImage->SetFilename(thumb); m_thumbImage->Load(); } if (m_site->GetDownload() == 1) m_download->SetCheckState(MythUIStateType::Full); } BuildFocusList(); return true; }
bool ImportCoverArtDialog::Create() { if (!LoadWindowFromXML("music-ui.xml", "import_coverart", this)) return false; bool err = false; UIUtilE::Assign(this, m_filenameText, "file", &err); UIUtilE::Assign(this, m_currentText, "position", &err); UIUtilE::Assign(this, m_statusText, "status", &err); UIUtilE::Assign(this, m_destinationText, "destination", &err); UIUtilE::Assign(this, m_coverartImage, "coverart", &err); UIUtilE::Assign(this, m_copyButton, "copy", &err); UIUtilE::Assign(this, m_exitButton, "exit", &err); UIUtilE::Assign(this, m_prevButton, "prev", &err); UIUtilE::Assign(this, m_nextButton, "next", &err); UIUtilE::Assign(this, m_typeList, "type", &err); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'import_coverart'"); return false; } if (m_typeList) { new MythUIButtonListItem(m_typeList, tr("Front Cover"), qVariantFromValue(0)); new MythUIButtonListItem(m_typeList, tr("Back Cover"), qVariantFromValue(1)); new MythUIButtonListItem(m_typeList, tr("CD"), qVariantFromValue(2)); new MythUIButtonListItem(m_typeList, tr("Inlay"), qVariantFromValue(3)); new MythUIButtonListItem(m_typeList, tr("<Unknown>"), qVariantFromValue(4)); connect(m_typeList, SIGNAL(itemSelected(MythUIButtonListItem *)), SLOT(selectorChanged())); } if (m_copyButton) connect(m_copyButton, SIGNAL(Clicked()), this, SLOT(copyPressed())); if (m_exitButton) connect(m_exitButton, SIGNAL(Clicked()), this, SLOT(Close())); if (m_prevButton) connect(m_prevButton, SIGNAL(Clicked()), this, SLOT(prevPressed())); if (m_nextButton) connect(m_nextButton, SIGNAL(Clicked()), this, SLOT(nextPressed())); BuildFocusList(); scanDirectory(); return true; }
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 SearchView::Create(void) { bool err = false; // Load the theme for this screen err = LoadWindowFromXML("music-ui.xml", "searchview", this); if (!err) return false; // find common widgets available on any view err = CreateCommon(); // find widgets specific to this view UIUtilE::Assign(this, m_fieldList, "field_list", &err); UIUtilE::Assign(this, m_criteriaEdit, "criteria_edit", &err); UIUtilW::Assign(this, m_matchesText, "matches_text", &err); UIUtilE::Assign(this, m_tracksList, "tracks_list", &err); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'searchview'"); return false; } BuildFocusList(); SetFocusWidget(m_criteriaEdit); new MythUIButtonListItem(m_fieldList, tr("All Fields"), qVariantFromValue(0)); new MythUIButtonListItem(m_fieldList, tr("Artist"), qVariantFromValue(1)); new MythUIButtonListItem(m_fieldList, tr("Album"), qVariantFromValue(2)); new MythUIButtonListItem(m_fieldList, tr("Title"), qVariantFromValue(3)); new MythUIButtonListItem(m_fieldList, tr("Genre"), qVariantFromValue(4)); //new MythUIButtonListItem(m_fieldList, tr("Tags"), // qVariantFromValue(5)); connect(m_fieldList, SIGNAL(itemSelected(MythUIButtonListItem*)), this, SLOT(fieldSelected(MythUIButtonListItem*))); connect(m_tracksList, SIGNAL(itemClicked(MythUIButtonListItem*)), this, SLOT(trackClicked(MythUIButtonListItem*))); connect(m_tracksList, SIGNAL(itemVisible(MythUIButtonListItem*)), this, SLOT(trackVisible(MythUIButtonListItem*))); connect(m_criteriaEdit, SIGNAL(valueChanged()), this, SLOT(criteriaChanged())); updateTracksList(); 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; }
bool RatingSettings::Create() { bool err = false; // Load the theme for this screen if (!LoadWindowFromXML("musicsettings-ui.xml", "ratingsettings", this)) return false; m_ratingWeight = dynamic_cast<MythUISpinBox *> (GetChild("ratingweight")); m_playCountWeight = dynamic_cast<MythUISpinBox *> (GetChild("playcountweight")); m_lastPlayWeight = dynamic_cast<MythUISpinBox *> (GetChild("lastplayweight")); m_randomWeight = dynamic_cast<MythUISpinBox *> (GetChild("randomweight")); m_saveButton = dynamic_cast<MythUIButton *> (GetChild("save")); m_cancelButton = dynamic_cast<MythUIButton *> (GetChild("cancel")); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'ratingsettings'"); return false; } m_ratingWeight->SetRange(0,100,1); m_ratingWeight->SetValue(gCoreContext->GetNumSetting("IntelliRatingWeight")); m_playCountWeight->SetRange(0,100,1); m_playCountWeight->SetValue(gCoreContext->GetNumSetting("IntelliPlayCountWeight")); m_lastPlayWeight->SetRange(0,100,1); m_lastPlayWeight->SetValue(gCoreContext->GetNumSetting("IntelliLastPlayWeight")); m_randomWeight->SetRange(0,100,1); m_randomWeight->SetValue(gCoreContext->GetNumSetting("IntelliRandomWeight")); m_ratingWeight->SetHelpText(tr("Used in \"Smart\" Shuffle mode. " "This weighting affects how much strength is " "given to your rating of a given track when " "ordering a group of songs.")); m_playCountWeight->SetHelpText(tr("Used in \"Smart\" Shuffle mode. " "This weighting affects how much strength is " "given to how many times a given track has been " "played when ordering a group of songs.")); m_lastPlayWeight->SetHelpText(tr("Used in \"Smart\" Shuffle mode. " "This weighting affects how much strength is " "given to how long it has been since a given " "track was played when ordering a group of songs.")); m_randomWeight->SetHelpText(tr("Used in \"Smart\" Shuffle mode. " "This weighting affects how much strength is " "given to good old (pseudo-)randomness " "when ordering a group of songs.")); m_cancelButton->SetHelpText(tr("Exit without saving settings")); m_saveButton->SetHelpText(tr("Save settings and Exit")); connect(m_saveButton, SIGNAL(Clicked()), this, SLOT(slotSave())); connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(Close())); BuildFocusList(); return true; }
bool ExportNative::Create(void) { bool foundtheme = false; // Load the theme for this screen foundtheme = LoadWindowFromXML("mythnative-ui.xml", "exportnative", this); if (!foundtheme) return false; bool err = false; 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_titleText, "progtitle", &err); UIUtilE::Assign(this, m_datetimeText, "progdatetime", &err); UIUtilE::Assign(this, m_descriptionText, "progdescription", &err); UIUtilE::Assign(this, m_filesizeText, "filesize", &err); UIUtilE::Assign(this, m_nofilesText, "nofiles", &err); UIUtilE::Assign(this, m_sizeBar, "size_bar", &err); UIUtilE::Assign(this, m_archiveButtonList, "archivelist", &err); UIUtilE::Assign(this, m_addrecordingButton, "addrecording_button", &err); UIUtilE::Assign(this, m_addvideoButton, "addvideo_button", &err); UIUtilW::Assign(this, m_maxsizeText, "maxsize"); UIUtilW::Assign(this, m_minsizeText, "minsize"); UIUtilW::Assign(this, m_currsizeText, "currentsize"); UIUtilW::Assign(this, m_currsizeErrText, "currentsize_error"); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'exportnative'"); 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())); getArchiveList(); connect(m_archiveButtonList, SIGNAL(itemSelected(MythUIButtonListItem *)), this, SLOT(titleChanged(MythUIButtonListItem *))); connect(m_addrecordingButton, SIGNAL(Clicked()), this, SLOT(handleAddRecording())); connect(m_addvideoButton, SIGNAL(Clicked()), this, SLOT(handleAddVideo())); BuildFocusList(); SetFocusWidget(m_nextButton); loadConfiguration(); return true; }
bool ZMEvents::Create(void) { bool foundtheme = false; // Load the theme for this screen foundtheme = LoadWindowFromXML("zoneminder-ui.xml", "zmevents", this); if (!foundtheme) return false; bool err = false; UIUtilE::Assign(this, m_eventNoText, "eventno_text", &err); UIUtilE::Assign(this, m_playButton, "play_button", &err); UIUtilE::Assign(this, m_deleteButton, "delete_button", &err); UIUtilE::Assign(this, m_cameraSelector, "camera_selector", &err); UIUtilE::Assign(this, m_dateSelector, "date_selector", &err); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'zmevents'"); return false; } BuildFocusList(); getCameraList(); getDateList(); connect(m_cameraSelector, SIGNAL(itemSelected(MythUIButtonListItem*)), this, SLOT(cameraChanged())); connect(m_dateSelector, SIGNAL(itemSelected(MythUIButtonListItem*)), this, SLOT(dateChanged())); // play button if (m_playButton) { m_playButton->SetText(tr("Play")); connect(m_playButton, SIGNAL(Clicked()), this, SLOT(playPressed())); } // delete button if (m_deleteButton) { m_deleteButton->SetText(tr("Delete")); connect(m_deleteButton, SIGNAL(Clicked()), this, SLOT(deletePressed())); } m_oldestFirst = (gCoreContext->GetNumSetting("ZoneMinderOldestFirst", 1) == 1); m_showContinuous = (gCoreContext->GetNumSetting("ZoneMinderShowContinuous", 0) == 1); getEventList(); setGridLayout(gCoreContext->GetNumSetting("ZoneMinderGridLayout", 1)); return true; }
bool BookmarkEditor::Create() { bool foundtheme = false; // Load the theme for this screen foundtheme = LoadWindowFromXML("browser-ui.xml", "bookmarkeditor", this); if (!foundtheme) return false; m_titleText = dynamic_cast<MythUIText *> (GetChild("title")); if (m_titleText) { if (m_editing) m_titleText->SetText(tr("Edit Bookmark Details")); else m_titleText->SetText(tr("Enter Bookmark Details")); } m_categoryEdit = dynamic_cast<MythUITextEdit *> (GetChild("category")); m_nameEdit = dynamic_cast<MythUITextEdit *> (GetChild("name")); m_urlEdit = dynamic_cast<MythUITextEdit *> (GetChild("url")); m_okButton = dynamic_cast<MythUIButton *> (GetChild("ok")); m_cancelButton = dynamic_cast<MythUIButton *> (GetChild("cancel")); m_findCategoryButton = dynamic_cast<MythUIButton *> (GetChild("findcategory")); if (!m_categoryEdit || !m_nameEdit || !m_urlEdit || !m_okButton || !m_cancelButton || !m_findCategoryButton) { LOG(VB_GENERAL, LOG_ERR, "Theme is missing critical theme elements."); return false; } connect(m_okButton, SIGNAL(Clicked()), this, SLOT(Save())); connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(Exit())); connect(m_findCategoryButton, SIGNAL(Clicked()), this, SLOT(slotFindCategory())); if (m_editing && m_site) { m_categoryEdit->SetText(m_site->category); m_nameEdit->SetText(m_site->name); m_urlEdit->SetText(m_site->url); } BuildFocusList(); SetFocusWidget(m_categoryEdit); return true; }
bool MythNews::Create(void) { QMutexLocker locker(&m_lock); bool foundtheme = false; // Load the theme for this screen foundtheme = LoadWindowFromXML("news-ui.xml", "news", this); if (!foundtheme) return false; bool err = false; UIUtilE::Assign(this, m_sitesList, "siteslist", &err); UIUtilE::Assign(this, m_articlesList, "articleslist", &err); UIUtilE::Assign(this, m_titleText, "title", &err); UIUtilE::Assign(this, m_descText, "description", &err); // these are all optional UIUtilW::Assign(this, m_nositesText, "nosites", &err); UIUtilW::Assign(this, m_updatedText, "updated", &err); UIUtilW::Assign(this, m_thumbnailImage, "thumbnail", &err); UIUtilW::Assign(this, m_enclosureImage, "enclosures", &err); UIUtilW::Assign(this, m_downloadImage, "download", &err); UIUtilW::Assign(this, m_podcastImage, "ispodcast", &err); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'news'"); return false; } if (m_nositesText) { m_nositesText->SetText(tr("You haven't configured MythNews to use any sites.")); m_nositesText->Hide(); } BuildFocusList(); SetFocusWidget(m_sitesList); loadSites(); updateInfoView(m_sitesList->GetItemFirst()); connect(m_sitesList, SIGNAL(itemSelected(MythUIButtonListItem*)), this, SLOT( slotSiteSelected(MythUIButtonListItem*))); connect(m_articlesList, SIGNAL(itemSelected( MythUIButtonListItem*)), this, SLOT( updateInfoView(MythUIButtonListItem*))); connect(m_articlesList, SIGNAL(itemClicked( MythUIButtonListItem*)), this, SLOT( slotViewArticle(MythUIButtonListItem*))); return true; }