Пример #1
0
MetadataDialog::MetadataDialog(UAVObject::Metadata mdata, QWidget *parent) :
    QDialog(parent),
    resetDefaults_flag(false),
    saveMetadata_flag(false)
{
    m_mdata = &mdata;

    metadata_editor.setupUi(this);

    // In case GCS is not in expert mode, hide the apply button
    ExtensionSystem::PluginManager *pm=ExtensionSystem::PluginManager::instance();
    Core::Internal::GeneralSettings *settings=pm->getObject<Core::Internal::GeneralSettings>();
    if(!settings->useExpertMode())
        metadata_editor.bnApplyMetadata->setVisible(false);

    // Set comboboxes
    metadata_editor.cmbFlightTelemetryMode->addItem("Periodic", UAVObject::UPDATEMODE_PERIODIC);
    metadata_editor.cmbFlightTelemetryMode->addItem("Throttled", UAVObject::UPDATEMODE_THROTTLED);
    metadata_editor.cmbFlightTelemetryMode->addItem("On Change", UAVObject::UPDATEMODE_ONCHANGE);
    metadata_editor.cmbFlightTelemetryMode->addItem("Manual", UAVObject::UPDATEMODE_MANUAL);

    metadata_editor.cmbGCSTelemetryMode->addItem("Periodic", UAVObject::UPDATEMODE_PERIODIC);
    metadata_editor.cmbGCSTelemetryMode->addItem("Throttled", UAVObject::UPDATEMODE_THROTTLED);
    metadata_editor.cmbGCSTelemetryMode->addItem("On Change", UAVObject::UPDATEMODE_ONCHANGE);
    metadata_editor.cmbGCSTelemetryMode->addItem("Manual", UAVObject::UPDATEMODE_MANUAL);

    // Connect the before setting any signals
    connect(metadata_editor.bnApplyMetadata, SIGNAL(clicked()), this, SLOT(saveApplyMetadata()));
    connect(metadata_editor.bnSaveMetadata, SIGNAL(clicked()), this, SLOT(saveApplyMetadata()));
    connect(metadata_editor.bnCancel, SIGNAL(clicked()), this, SLOT(cancelChanges()));
    connect(metadata_editor.bnResetToDefaults, SIGNAL(clicked()), this, SLOT(resetMetadataToDefaults()));

    // Fill buttons and check boxes
    fillWidgets();
}
Пример #2
0
void ImportMusicDialog::startScan()
{
    MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
    MythUIBusyDialog *busy = 
            new MythUIBusyDialog(QObject::tr("Searching for music files"),
                                     popupStack,
                                     "scanbusydialog");

    if (busy->Create())
    {
        popupStack->AddScreen(busy, false);
    }
    else
    {
        delete busy;
        busy = NULL;
    }
    FileScannerThread *scanner = new FileScannerThread(this);
    scanner->start();

    while (!scanner->isFinished())
    {
        usleep(500);
        qApp->processEvents();
    }

    delete scanner;

    m_currentTrack = 0;
    fillWidgets();

    if (busy)
        busy->Close();
}
Пример #3
0
void ImportMusicDialog::setTrack(void)
{
    Metadata *data = m_tracks->at(m_currentTrack)->metadata;
    data->setTrack(data->Track() + 100);

    fillWidgets();
}
Пример #4
0
void ImportMusicDialog::setTitleWordCaps(void)
{
    Metadata *data = m_tracks->at(m_currentTrack)->metadata;
    QString title = data->Title();
    bool bInWord = false;

    for (int x = 0; x < title.length(); x++)
    {
        if (title[x].isSpace())
            bInWord = false;
        else
        {
            if (title[x].isLetter())
            {
                if (!bInWord)
                {
                    title[x] = title[x].toUpper();
                    bInWord = true;
                }
                else
                    title[x] = title[x].toLower();
            }
        }
    }

    data->setTitle(title);
    fillWidgets();
}
Пример #5
0
void ImportMusicDialog::addAllNewPressed()
{
    if (m_tracks->size() == 0)
        return;

    m_currentTrack = 0;
    int newCount = 0;

    while (m_currentTrack < (int) m_tracks->size())
    {
        fillWidgets();
        qApp->processEvents();

        if (m_tracks->at(m_currentTrack)->isNewTune)
        {
            addPressed();
            newCount++;
        }

        qApp->processEvents();

        m_currentTrack++;
    }

    m_currentTrack--;

    ShowOkPopup(tr("%1 new tracks were added to the database").arg(newCount));
}
Пример #6
0
void ImportMusicDialog::nextPressed()
{
    if (m_currentTrack < (int) m_tracks->size() - 1)
    {
        m_currentTrack++;
        fillWidgets();
    }
}
Пример #7
0
void ImportMusicDialog::prevPressed()
{
    if (m_currentTrack > 0)
    {
        m_currentTrack--;
        fillWidgets();
    }
}
Пример #8
0
void ImportMusicDialog::metadataChanged(void)
{
    Metadata *editMeta = m_tracks->at(m_currentTrack)->metadata;
    m_tracks->at(m_currentTrack)->metadataHasChanged = true;
    m_tracks->at(m_currentTrack)->isNewTune =
        Ripper::isNewTune(editMeta->Artist(), editMeta->Album(), editMeta->Title());
    fillWidgets();
}
Пример #9
0
void EditMetadataDialog::incRating(bool up_or_down)
{
    if (up_or_down)
        m_metadata->incRating();
    else
        m_metadata->decRating();

    fillWidgets();
}
Пример #10
0
void ImportMusicDialog::setCompilationArtist(void)
{
    if (!m_haveDefaults)
        return;

    Metadata *data = m_tracks->at(m_currentTrack)->metadata;
    data->setCompilationArtist(m_defaultCompArtist);

    fillWidgets();
}
Пример #11
0
void ImportMusicDialog::setGenre(void)
{
    if (!m_haveDefaults)
        return;

    Metadata *data = m_tracks->at(m_currentTrack)->metadata;
    data->setGenre(m_defaultGenre);

    fillWidgets();
}
Пример #12
0
bool ImportMusicDialog::Create()
{
    if (!LoadWindowFromXML("music-ui.xml", "import_music", this))
        return false;

    bool err = false;
    UIUtilE::Assign(this, m_locationEdit,    "location", &err);
    UIUtilE::Assign(this, m_locationButton,  "directoryfinder", &err);
    UIUtilE::Assign(this, m_scanButton,      "scan", &err);
    UIUtilE::Assign(this, m_coverartButton,  "coverart", &err);
    UIUtilE::Assign(this, m_filenameText,    "filename", &err);
    UIUtilE::Assign(this, m_compartistText,  "compartist", &err);
    UIUtilE::Assign(this, m_artistText,      "artist", &err);
    UIUtilE::Assign(this, m_albumText,       "album", &err);
    UIUtilE::Assign(this, m_titleText,       "title", &err);
    UIUtilE::Assign(this, m_genreText,       "genre", &err);
    UIUtilE::Assign(this, m_yearText,        "year", &err);
    UIUtilE::Assign(this, m_trackText,       "track", &err);
    UIUtilE::Assign(this, m_currentText,     "position", &err);
    UIUtilE::Assign(this, m_statusText,      "status", &err);
    UIUtilE::Assign(this, m_compilationCheck,"compilation", &err);
    UIUtilE::Assign(this, m_playButton,      "play", &err);
    UIUtilE::Assign(this, m_nextnewButton,   "nextnew", &err);
    UIUtilE::Assign(this, m_addButton,       "add", &err);
    UIUtilE::Assign(this, m_addallnewButton, "addallnew", &err);
    UIUtilE::Assign(this, m_nextButton,      "next", &err);
    UIUtilE::Assign(this, m_prevButton,      "prev", &err);

    if (err)
    {
        LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'import_music'");
        return false;
    }

    connect(m_prevButton, SIGNAL(Clicked()), SLOT(prevPressed()));
    connect(m_locationButton, SIGNAL(Clicked()), SLOT(locationPressed()));
    connect(m_scanButton, SIGNAL(Clicked()), SLOT(startScan()));
    connect(m_coverartButton, SIGNAL(Clicked()), SLOT(coverArtPressed()));
    connect(m_playButton, SIGNAL(Clicked()), SLOT(playPressed()));
    connect(m_nextnewButton, SIGNAL(Clicked()), SLOT(nextNewPressed()));
    connect(m_addButton, SIGNAL(Clicked()), SLOT(addPressed()));
    connect(m_addallnewButton, SIGNAL(Clicked()), SLOT(addAllNewPressed()));
    connect(m_nextButton, SIGNAL(Clicked()), SLOT(nextPressed()));

    fillWidgets();

    BuildFocusList();

    m_locationEdit->SetText(gCoreContext->GetSetting("MythMusicLastImportDir", "/"));

    return true;
}
Пример #13
0
void EditMetadataDialog::searchCompilationArtist()
{
    QString s;

    searchList = Metadata::fillFieldList("compilation_artist");

    s = m_metadata->CompilationArtist();
    if (showList(tr("Select a Compilation Artist"), s))
    {
        m_metadata->setCompilationArtist(s);
        fillWidgets();
    }
}
Пример #14
0
void ImportMusicDialog::setAlbum(void)
{
    if (!m_haveDefaults)
        return;

    Metadata *data = m_tracks->at(m_currentTrack)->metadata;
    data->setAlbum(m_defaultAlbum);

    m_tracks->at(m_currentTrack)->isNewTune = Ripper::isNewTune(
            data->Artist(), data->Album(), data->Title());

    fillWidgets();
}
Пример #15
0
void EditMetadataDialog::searchAlbum()
{
    QString s;

    searchList = Metadata::fillFieldList("album");

    s = m_metadata->Album();
    if (showList(tr("Select an Album"), s))
    {
        m_metadata->setAlbum(s);
        fillWidgets();
    }
}
Пример #16
0
PrefCharacter::PrefCharacter(QWidget *parent, KActionCollection * ac) : QWidget(parent)
{
  setupUi(this);
  m_actionCollection = ac;

  connect(CharacterTree, SIGNAL(itemSelectionChanged()), this, SLOT(slotCharListSelectionChanged()));
  connect(btnCharacter, SIGNAL(clicked()), this, SLOT(slotSelectSpecChar()));

  fillWidgets();
  updateWidgets();

  m_dlgSpecChar = 0;
}
Пример #17
0
bool EditRomInfoDialog::Create()
{
    if (!LoadWindowFromXML("game-ui.xml", "edit_metadata", this))
        return false;

    bool err = false;
    UIUtilE::Assign(this, m_gamenameEdit, "title_edit", &err);
    UIUtilE::Assign(this, m_genreEdit, "genre_edit", &err);
    UIUtilE::Assign(this, m_yearEdit, "year_edit", &err);
    UIUtilE::Assign(this, m_countryEdit, "country_edit", &err);
    UIUtilE::Assign(this, m_plotEdit, "description_edit", &err);
    UIUtilE::Assign(this, m_publisherEdit, "publisher_edit", &err);

    UIUtilE::Assign(this, m_favoriteCheck, "favorite_check", &err);

    UIUtilE::Assign(this, m_screenshotButton, "screenshot_button", &err);
    UIUtilE::Assign(this, m_screenshotText, "screenshot_text", &err);
    UIUtilE::Assign(this, m_fanartButton, "fanart_button", &err);
    UIUtilE::Assign(this, m_fanartText, "fanart_text", &err);
    UIUtilE::Assign(this, m_boxartButton, "coverart_button", &err);
    UIUtilE::Assign(this, m_boxartText, "coverart_text", &err);

    UIUtilE::Assign(this, m_doneButton, "done_button", &err);

    if (err)
    {
        VERBOSE(VB_IMPORTANT, "Cannot load screen 'edit_metadata'");
        return false;
    }

    fillWidgets();

    BuildFocusList();

    connect(m_gamenameEdit, SIGNAL(valueChanged()), SLOT(SetGamename()));
    connect(m_genreEdit, SIGNAL(valueChanged()), SLOT(SetGenre()));
    connect(m_yearEdit, SIGNAL(valueChanged()), SLOT(SetYear()));
    connect(m_countryEdit, SIGNAL(valueChanged()), SLOT(SetCountry()));
    connect(m_plotEdit, SIGNAL(valueChanged()), SLOT(SetPlot()));
    connect(m_publisherEdit, SIGNAL(valueChanged()), SLOT(SetPublisher()));

    connect(m_favoriteCheck, SIGNAL(valueChanged()), SLOT(ToggleFavorite()));

    connect(m_screenshotButton, SIGNAL(Clicked()), SLOT(FindScreenshot()));
    connect(m_fanartButton, SIGNAL(Clicked()), SLOT(FindFanart()));
    connect(m_boxartButton, SIGNAL(Clicked()), SLOT(FindBoxart()));

    connect(m_doneButton, SIGNAL(Clicked()), SLOT(SaveAndExit()));
 
    return true;
}
Пример #18
0
void ImportMusicDialog::nextNewPressed()
{
    if (m_tracks->size() == 0)
        return;

    uint track = m_currentTrack + 1;
    while (track < m_tracks->size())
    {
        if (m_tracks->at(track)->isNewTune)
        {
            m_currentTrack = track;
            fillWidgets();
            break;
        }
        track++;
    }
}
Пример #19
0
EditMetadataDialog::EditMetadataDialog(Metadata       *source_metadata,
                                       MythMainWindow *parent,
                                       const QString  &window_name,
                                       const QString  &theme_filename,
                                       const char     *name)
    : MythThemedDialog(parent, window_name, theme_filename, name)
{
    // make a copy so we can abandon changes
    m_metadata = new Metadata(*source_metadata);
    m_sourceMetadata = source_metadata;
    albumArt = new AlbumArtImages(m_metadata);
    metadataOnly = false;
    setContext(1);
    wireUpTheme();
    fillWidgets();
    assignFirstFocus();
}
Пример #20
0
void EditMetadataDialog::searchGenre()
{
    QString s;

    // load genre list
    /*
    searchList.clear();
    for (int x = 0; x < genre_table_size; x++)
        searchList.push_back(QString(genre_table[x]));
    searchList.sort();
    */
    searchList = Metadata::fillFieldList("genre");

    s = m_metadata->Genre();
    if (showList(tr("Select a Genre"), s))
    {
        m_metadata->setGenre(s);
        fillWidgets();
    }

}
Пример #21
0
void ImportMusicDialog::setTitleInitialCap(void)
{
    Metadata *data = m_tracks->at(m_currentTrack)->metadata;
    QString title = data->Title();
    bool bFoundCap = false;

    for (int x = 0; x < title.length(); x++)
    {
        if (title[x].isLetter())
        {
            if (bFoundCap == false)
            {
                title[x] = title[x].toUpper();
                bFoundCap = true;
            }
            else
                title[x] = title[x].toLower();
        }
    }

    data->setTitle(title);
    fillWidgets();
}
Пример #22
0
VisualizationsEditor::VisualizationsEditor(const QString &currentSelection,
                                           MythMainWindow *parent, const char *name)
    : MythDialog(parent, name)
{
    Q3VBoxLayout *vbox = new Q3VBoxLayout(this, (int)(20 * wmult));
    Q3HBoxLayout *hbox = new Q3HBoxLayout(vbox, (int)(10 * wmult));

    // Window title
    QString message = tr("Visualizations");
    QLabel *label = new QLabel(message, this);
    label->setBackgroundOrigin(WindowOrigin);
    QFont font = label->font();
    font.setPointSize(int (font.pointSize() * 1.5));
    font.setBold(true);
    label->setFont(font);
    label->setPaletteForegroundColor(QColor("yellow"));
    label->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
    hbox->addWidget(label);

    hbox = new Q3HBoxLayout(vbox, (int)(10 * wmult));
    label = new QLabel(tr("Selected Visualizations"), this);
    label->setBackgroundOrigin(WindowOrigin);
    label->setAlignment(Qt::AlignLeft | Qt::AlignBottom);
    hbox->addWidget(label);

    label = new QLabel(tr("Available Visualizations"), this);
    label->setBackgroundOrigin(WindowOrigin);
    label->setAlignment(Qt::AlignLeft | Qt::AlignBottom);
    hbox->addWidget(label);

    // selected listview
    hbox = new Q3HBoxLayout(vbox, (int)(10 * wmult));
    selectedList = new Q3MythListView(this);
    selectedList->addColumn(tr("Name"));
    selectedList->addColumn(tr("Provider"));
    selectedList->setSorting(-1);         // disable sorting
    selectedList->setSelectionMode(Q3ListView::Single);
    connect(selectedList, SIGNAL(currentChanged(Q3ListViewItem *)),
            this, SLOT(selectedChanged(Q3ListViewItem *)));
    connect(selectedList, SIGNAL(spacePressed(Q3ListViewItem *)),
            this, SLOT(selectedOnSelect(Q3ListViewItem *)));
    connect(selectedList, SIGNAL(returnPressed(Q3ListViewItem *)),
            this, SLOT(selectedOnSelect(Q3ListViewItem *)));
    selectedList->installEventFilter(this);
    hbox->addWidget(selectedList);

    // available listview
    availableList = new Q3MythListView(this);
    availableList->addColumn(tr("Name"));
    availableList->addColumn(tr("Provider"));
    availableList->setSorting(0);
    connect(availableList, SIGNAL(currentChanged(Q3ListViewItem *)),
            this, SLOT(availableChanged(Q3ListViewItem *)));
    connect(availableList, SIGNAL(spacePressed(Q3ListViewItem *)),
            this, SLOT(availableOnSelect(Q3ListViewItem *)));
    connect(availableList, SIGNAL(returnPressed(Q3ListViewItem *)),
            this, SLOT(availableOnSelect(Q3ListViewItem *)));
    availableList->installEventFilter(this);

    hbox->addWidget(availableList);


    hbox = new Q3HBoxLayout(vbox, (int)(10 * wmult));
    MythPushButton *button = new MythPushButton( this, "Program" );
    button->setBackgroundOrigin(WindowOrigin);
    button->setText( tr( "Move Up" ) );
    button->setEnabled(true);
    connect(button, SIGNAL(clicked()), this, SLOT(upClicked()));
    hbox->addWidget(button);

    button = new MythPushButton( this, "Program" );
    button->setBackgroundOrigin(WindowOrigin);
    button->setText( tr( "Move Down" ) );
    button->setEnabled(true);
    connect(button, SIGNAL(clicked()), this, SLOT(downClicked()));
    hbox->addWidget(button);

    // fake labels used as spacers
    label = new QLabel(" ", this);
    label->setBackgroundOrigin(WindowOrigin);
    hbox->addWidget(label);

    label = new QLabel(" ", this);
    label->setBackgroundOrigin(WindowOrigin);
    hbox->addWidget(label);


    //OK Button
    hbox = new Q3HBoxLayout(vbox, (int)(10 * wmult));
    button = new MythPushButton( this, "Program" );
    button->setBackgroundOrigin(WindowOrigin);
    button->setText( tr( "OK" ) );
    button->setEnabled(true);
    hbox->addWidget(button);
    connect(button, SIGNAL(clicked()), this, SLOT(okClicked()));

    //Cancel Button
    button = new MythPushButton( this, "Program" );
    button->setBackgroundOrigin(WindowOrigin);
    button->setText( tr( "Cancel" ) );
    button->setEnabled(true);
    hbox->addWidget(button);
    connect(button, SIGNAL(clicked()), this, SLOT(cancelClicked()));

    availableList->setFocus();

    fillWidgets(currentSelection);
}
Пример #23
0
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;
}
Пример #24
0
void ImportMusicDialog::addPressed()
{
    if (m_tracks->size() == 0)
        return;

    Metadata *meta = m_tracks->at(m_currentTrack)->metadata;

    // is the current track a new file?
    if (m_tracks->at(m_currentTrack)->isNewTune)
    {
        // get the save filename - this also creates the correct directory stucture
        QString saveFilename = Ripper::filenameFromMetadata(meta);

        // we need to manually copy the file extension
        QFileInfo fi(meta->Filename());
        saveFilename += "." + fi.suffix();

        // copy the file to the new location
        if (!copyFile(meta->Filename(), saveFilename))
        {
            ShowOkPopup(tr("Copy Failed\nCould not copy file to: %1")
                                                        .arg(saveFilename));
            return;
        }

        meta->setFilename(saveFilename);

        // do we need to update the tags?
        if (m_tracks->at(m_currentTrack)->metadataHasChanged)
        {
            Decoder *decoder = Decoder::create(saveFilename, NULL, NULL, true);
            if (decoder)
            {
                decoder->commitMetadata(meta);
                delete decoder;
            }
        }

        // update the database
        meta->dumpToDatabase();

        // read any embedded images from the tag
        MetaIO *tagger = meta->getTagger();
        if (tagger && tagger->supportsEmbeddedImages())
        {
            AlbumArtList artList = tagger->getAlbumArtList(meta->Filename());
            meta->setEmbeddedAlbumArt(artList);
            meta->getAlbumArtImages()->dumpToDatabase();
        }

        m_somethingWasImported = true;

        m_tracks->at(m_currentTrack)->isNewTune = Ripper::isNewTune(
                meta->Artist(), meta->Album(), meta->Title());

        // update the UI
        fillWidgets();
    }
    else
        ShowOkPopup(tr("This track is already in the database"));
}
Пример #25
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;
}
Пример #26
0
bool VideoFilterDialog::Create()
{
    if (!LoadWindowFromXML("video-ui.xml", "filter", this))
        return false;

    bool err = false;
    UIUtilE::Assign(this, m_textfilter, "textfilter_input", &err);
    UIUtilE::Assign(this, m_yearList, "year_select", &err);
    UIUtilE::Assign(this, m_userratingList, "userrating_select", &err);
    UIUtilE::Assign(this, m_categoryList, "category_select", &err);
    UIUtilE::Assign(this, m_countryList, "country_select", &err);
    UIUtilE::Assign(this, m_genreList, "genre_select", &err);
    UIUtilE::Assign(this, m_castList, "cast_select", &err);
    UIUtilE::Assign(this, m_runtimeList, "runtime_select", &err);
    UIUtilE::Assign(this, m_browseList, "browse_select", &err);
    UIUtilE::Assign(this, m_watchedList, "watched_select", &err);
    UIUtilE::Assign(this, m_inetrefList, "inetref_select", &err);
    UIUtilE::Assign(this, m_coverfileList, "coverfile_select", &err);
    UIUtilE::Assign(this, m_orderbyList, "orderby_select", &err);

    UIUtilE::Assign(this, m_doneButton, "done_button", &err);
    UIUtilE::Assign(this, m_saveButton, "save_button", &err);

    UIUtilE::Assign(this, m_numvideosText, "numvideos_text", &err);

    if (err)
    {
        LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'filter'");
        return false;
    }

    BuildFocusList();

    fillWidgets();
    update_numvideo();

    connect(m_yearList, SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(SetYear(MythUIButtonListItem*)));
    connect(m_userratingList, SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(SetUserRating(MythUIButtonListItem*)));
    connect(m_categoryList, SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(SetCategory(MythUIButtonListItem*)));
    connect(m_countryList, SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(setCountry(MythUIButtonListItem*)));
    connect(m_genreList,SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(setGenre(MythUIButtonListItem*)));
    connect(m_castList,SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(SetCast(MythUIButtonListItem*)));
    connect(m_runtimeList, SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(setRunTime(MythUIButtonListItem*)));
    connect(m_browseList, SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(SetBrowse(MythUIButtonListItem*)));
    connect(m_watchedList, SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(SetWatched(MythUIButtonListItem*)));
    connect(m_inetrefList, SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(SetInetRef(MythUIButtonListItem*)));
    connect(m_coverfileList, SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(SetCoverFile(MythUIButtonListItem*)));
    connect(m_orderbyList, SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(setOrderby(MythUIButtonListItem*)));
    connect(m_textfilter, SIGNAL(valueChanged()),
            SLOT(setTextFilter()));

    connect(m_saveButton, SIGNAL(Clicked()), SLOT(saveAsDefault()));
    connect(m_doneButton, SIGNAL(Clicked()), SLOT(saveAndExit()));

    return true;
}