Esempio n. 1
0
void VLCProfileSelector::editProfile( const QString& qs, const QString& value )
{
    /* Create the Profile Editor */
    VLCProfileEditor *editor = new VLCProfileEditor( qs, value, this );

    /* Show it */
    if( QDialog::Accepted == editor->exec() )
    {
        /* New Profile */
        if( qs.isEmpty() )
            profileBox->addItem( editor->name, QVariant( editor->transcodeValue() ) );
        /* Update old profile */
        else
        {
            /* Look for the profile */
            int i_profile = profileBox->findText( qs );
            assert( i_profile != -1 );
            profileBox->setItemText( i_profile, editor->name );
            profileBox->setItemData( i_profile, editor->transcodeValue() );
            /* Force mrl recreation */
            updateOptions( i_profile );
        }
    }
    delete editor;

    saveProfiles();
    emit optionsChanged();
}
Esempio n. 2
0
void ProfileWrangler::removeProfile()
{
    m_profiles.erase(m_profiles.begin() + m_curr_profile_index);
    
    saveProfiles();
    loadProfiles();
}
void ProfileManager::createActions()
{
  connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
  connect(saveButton, SIGNAL(clicked()), this, SLOT(saveProfiles()));
  connect(sourceBrowseButton, SIGNAL(clicked()), this, SLOT(browseSrc()));
  connect(destinationBrowseButton, SIGNAL(clicked()), this, SLOT(browseDest()));

  connect(nameField, SIGNAL(textChanged(const QString&)), this, SLOT(checkFilled()));
  connect(sourceField, SIGNAL(textChanged(const QString&)), this, SLOT(checkFilled()));
  connect(destinationField, SIGNAL(textChanged(const QString&)), this, SLOT(checkFilled()));
}
Esempio n. 4
0
void ProfileWrangler::removeProfile(std::shared_ptr<Profile> old_profile)
{
    for(size_t pos = 0; pos < m_profiles.size(); ++pos)
    {
        if(m_profiles[pos] == old_profile)
        {
			cout << "found profile to delete" << endl;
            m_profiles.erase(m_profiles.begin() + (int)pos);
        }
    }
    
    saveProfiles();
    loadProfiles();
}
Esempio n. 5
0
void VLCProfileSelector::deleteProfile()
{
    profileBox->removeItem( profileBox->currentIndex() );
    saveProfiles();
}
Esempio n. 6
0
void ProfileWrangler::addProfile(Profile new_profile)
{
    m_profiles.push_back(std::make_shared<Profile>(new_profile));
    saveProfiles();
    loadProfiles();
}
Esempio n. 7
0
void ProfileWrangler::addProfile(std::shared_ptr<Profile> new_profile)
{
    m_profiles.push_back(new_profile);
    saveProfiles();
    loadProfiles();
}