예제 #1
0
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;
}
예제 #2
0
void EditMetadataDialog::wireUpTheme()
{
    artist_edit = getUIRemoteEditType("artist_edit");
    if (artist_edit)
    {
        artist_edit->createEdit(this);
        connect(artist_edit, SIGNAL(loosingFocus()), this, SLOT(editLostFocus()));
    }

    compilation_artist_edit = getUIRemoteEditType("compilation_artist_edit");
    if (compilation_artist_edit)
    {
        compilation_artist_edit->createEdit(this);
        connect(compilation_artist_edit, SIGNAL(loosingFocus()), this, SLOT(editLostFocus()));
    }

    album_edit = getUIRemoteEditType("album_edit");
    if (album_edit)
    {
        album_edit->createEdit(this);
        connect(album_edit, SIGNAL(loosingFocus()), this, SLOT(editLostFocus()));
    }

    title_edit = getUIRemoteEditType("title_edit");
    if (title_edit)
    {
        title_edit->createEdit(this);
        connect(title_edit, SIGNAL(loosingFocus()), this, SLOT(editLostFocus()));
    }

    genre_edit = getUIRemoteEditType("genre_edit");
    if (genre_edit)
    {
        genre_edit->createEdit(this);
        connect(genre_edit, SIGNAL(loosingFocus()), this, SLOT(editLostFocus()));
    }

    year_edit = getUIRemoteEditType("year_edit");
    if (year_edit)
    {
        year_edit->createEdit(this);
        connect(year_edit, SIGNAL(loosingFocus()), this, SLOT(editLostFocus()));
    }

    track_edit = getUIRemoteEditType("track_edit");
    if (track_edit)
    {
        track_edit->createEdit(this);
        connect(track_edit, SIGNAL(loosingFocus()), this, SLOT(editLostFocus()));
    }

    lastplay_text = getUITextType("lastplay_text");
    playcount_text = getUITextType("playcount_text");
    filename_text = getUITextType("filename_text");
    rating_image = getUIRepeatedImageType("rating_image");

    compilation_check = getUICheckBoxType("compilation_check");
    if (compilation_check)
    {
        connect(compilation_check, SIGNAL(pushed(bool)), this, SLOT(checkClicked(bool)));
    }

    searchartist_button = getUIPushButtonType("searchartist_button");
    if (searchartist_button)
    {
        connect(searchartist_button, SIGNAL(pushed()), this, SLOT(searchArtist()));
    }

    searchcompilation_artist_button = getUIPushButtonType("searchcompilation_artist_button");
    if (searchcompilation_artist_button)
    {
        connect(searchcompilation_artist_button, SIGNAL(pushed()), this, SLOT(searchCompilationArtist()));
    }

    searchalbum_button = getUIPushButtonType("searchalbum_button");
    if (searchalbum_button)
    {
        connect(searchalbum_button, SIGNAL(pushed()), this, SLOT(searchAlbum()));
    }

    searchgenre_button = getUIPushButtonType("searchgenre_button");
    if (searchgenre_button)
    {
        connect(searchgenre_button, SIGNAL(pushed()), this, SLOT(searchGenre()));
    }

    metadata_button = getUITextButtonType("metadata_button");
    if (metadata_button)
    {
        metadata_button->setText(tr("Track Info."));
        connect(metadata_button, SIGNAL(pushed()), this, SLOT(switchToMetadata()));
    }

    albumart_button = getUITextButtonType("albumart_button");
    if (albumart_button)
    {
        albumart_button->setText(tr("Album Art"));
        connect(albumart_button, SIGNAL(pushed()), this, SLOT(switchToAlbumArt()));
    }

    dbstatistics_button = getUITextButtonType("dbstats_button");
    if (dbstatistics_button)
    {
        dbstatistics_button->setText(tr("Statistics"));
        connect(dbstatistics_button, SIGNAL(pushed()), this, SLOT(switchToDBStats()));
    }

    done_button = getUITextButtonType("done_button");
    if (done_button)
    {
        done_button->setText(tr("Done"));
        connect(done_button, SIGNAL(pushed()), this, SLOT(showSaveMenu()));
    }

    coverart_image = getUIImageType("coverart_image");
    coverart_grid = getUIImageGridType("coverart_grid");
    if (coverart_grid)
    {
        connect(coverart_grid, SIGNAL(itemChanged(ImageGridItem *)),
                this, SLOT(gridItemChanged(ImageGridItem *)));
    }

    imagetype_text = getUITextType("imagetype_text");
    imagefilename_text = getUITextType("imagefilename_text");

    rating_button = getUISelectorType("rating_button");
    if (rating_button)
    {

    }

    buildFocusList();
}