Exemplo n.º 1
0
ProfilesDialog::ProfilesDialog(QWidget * parent) :
    QDialog(parent),
    m_profileIsModified(false),
    m_isCustomProfile(false)
{
    m_view.setupUi(this);

    // Fill colorspace list (see mlt_profile.h)
    m_view.colorspace->addItem(getColorspaceDescription(601), 601);
    m_view.colorspace->addItem(getColorspaceDescription(709), 709);
    m_view.colorspace->addItem(getColorspaceDescription(240), 240);
    m_view.colorspace->addItem(getColorspaceDescription(0), 0);

    QStringList profilesFilter;
    profilesFilter << "*";

    m_view.button_delete->setIcon(QIcon::fromTheme("trash-empty"));
    m_view.button_delete->setToolTip(i18n("Delete profile"));
    m_view.button_save->setIcon(QIcon::fromTheme("document-save"));
    m_view.button_save->setToolTip(i18n("Save profile"));
    m_view.button_create->setIcon(QIcon::fromTheme("document-new"));
    m_view.button_create->setToolTip(i18n("Create new profile"));

    fillList();
    slotUpdateDisplay();
    connect(m_view.profiles_list, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateDisplay()));
    connect(m_view.button_create, SIGNAL(clicked()), this, SLOT(slotCreateProfile()));
    connect(m_view.button_save, SIGNAL(clicked()), this, SLOT(slotSaveProfile()));
    connect(m_view.button_delete, SIGNAL(clicked()), this, SLOT(slotDeleteProfile()));
    connect(m_view.button_default, SIGNAL(clicked()), this, SLOT(slotSetDefaultProfile()));

    connect(m_view.description, SIGNAL(textChanged(QString)), this, SLOT(slotProfileEdited()));
    connect(m_view.frame_num, SIGNAL(valueChanged(int)), this, SLOT(slotProfileEdited()));
    connect(m_view.frame_den, SIGNAL(valueChanged(int)), this, SLOT(slotProfileEdited()));
    connect(m_view.aspect_num, SIGNAL(valueChanged(int)), this, SLOT(slotProfileEdited()));
    connect(m_view.aspect_den, SIGNAL(valueChanged(int)), this, SLOT(slotProfileEdited()));
    connect(m_view.display_num, SIGNAL(valueChanged(int)), this, SLOT(slotProfileEdited()));
    connect(m_view.display_den, SIGNAL(valueChanged(int)), this, SLOT(slotProfileEdited()));
    connect(m_view.progressive, SIGNAL(stateChanged(int)), this, SLOT(slotProfileEdited()));
    connect(m_view.size_h, SIGNAL(valueChanged(int)), this, SLOT(slotProfileEdited()));
    connect(m_view.size_w, SIGNAL(valueChanged(int)), this, SLOT(slotProfileEdited()));
}
Exemplo n.º 2
0
KonqProfileDlg::KonqProfileDlg( KonqViewManager *manager, const QString & preselectProfile, QWidget *parent )
: KDialog( parent )
, d( new KonqProfileDlgPrivate( manager, this ) )
{
  d->layout()->setMargin( 0 );
  setMainWidget( d );

  setObjectName( QLatin1String( "konq_profile_dialog" ) );
  setModal( true );
  setCaption( i18nc( "@title:window", "Profile Management" ) );
  setButtons( Close | BTN_RENAME | BTN_DELETE | BTN_SAVE );
  setDefaultButton( BTN_SAVE );
  setButtonGuiItem( BTN_RENAME, KGuiItem( i18n( "&Rename Profile" ) ) );
  setButtonGuiItem( BTN_DELETE, KGuiItem( i18n( "&Delete Profile" ), "edit-delete" ) );
  setButtonGuiItem( BTN_SAVE, KStandardGuiItem::save() );

  d->m_pProfileNameLineEdit->setFocus();

  connect( d->m_pListView, SIGNAL(itemChanged(QListWidgetItem*)),
            SLOT(slotItemRenamed(QListWidgetItem*)) );

  loadAllProfiles( preselectProfile );
  d->m_pListView->setMinimumSize( d->m_pListView->sizeHint() );

  d->m_cbSaveURLs->setChecked( KonqSettings::saveURLInProfile() );

  connect( d->m_pListView, SIGNAL(itemSelectionChanged()),
           this, SLOT(slotSelectionChanged()) );

  connect( d->m_pProfileNameLineEdit, SIGNAL(textChanged(QString)),
           this, SLOT(slotTextChanged(QString)) );

  enableButton( BTN_RENAME, d->m_pListView->currentItem() != 0 );
  enableButton( BTN_DELETE, d->m_pListView->currentItem() != 0 );

  connect( this,SIGNAL(user1Clicked()),SLOT(slotRenameProfile()));
  connect( this,SIGNAL(user2Clicked()),SLOT(slotDeleteProfile()));
  connect( this,SIGNAL(user3Clicked()),SLOT(slotSave()));

  resize( sizeHint() );
}
Exemplo n.º 3
0
ProfilesDialog::ProfilesDialog(QWidget * parent) :
        QDialog(parent),
        m_profileIsModified(false),
        m_isCustomProfile(false)
{
    m_view.setupUi(this);

    QStringList profilesFilter;
    profilesFilter << "*";

    m_view.button_delete->setIcon(KIcon("trash-empty"));
    m_view.button_delete->setToolTip(i18n("Delete profile"));
    m_view.button_save->setIcon(KIcon("document-save"));
    m_view.button_save->setToolTip(i18n("Save profile"));
    m_view.button_create->setIcon(KIcon("document-new"));
    m_view.button_create->setToolTip(i18n("Create new profile"));

    fillList();
    slotUpdateDisplay();
    connect(m_view.profiles_list, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateDisplay()));
    connect(m_view.button_create, SIGNAL(clicked()), this, SLOT(slotCreateProfile()));
    connect(m_view.button_save, SIGNAL(clicked()), this, SLOT(slotSaveProfile()));
    connect(m_view.button_delete, SIGNAL(clicked()), this, SLOT(slotDeleteProfile()));
    connect(m_view.button_default, SIGNAL(clicked()), this, SLOT(slotSetDefaultProfile()));

    connect(m_view.description, SIGNAL(textChanged(const QString &)), this, SLOT(slotProfileEdited()));
    connect(m_view.frame_num, SIGNAL(valueChanged(int)), this, SLOT(slotProfileEdited()));
    connect(m_view.frame_den, SIGNAL(valueChanged(int)), this, SLOT(slotProfileEdited()));
    connect(m_view.aspect_num, SIGNAL(valueChanged(int)), this, SLOT(slotProfileEdited()));
    connect(m_view.aspect_den, SIGNAL(valueChanged(int)), this, SLOT(slotProfileEdited()));
    connect(m_view.display_num, SIGNAL(valueChanged(int)), this, SLOT(slotProfileEdited()));
    connect(m_view.display_den, SIGNAL(valueChanged(int)), this, SLOT(slotProfileEdited()));
    connect(m_view.progressive, SIGNAL(stateChanged(int)), this, SLOT(slotProfileEdited()));
    connect(m_view.size_h, SIGNAL(valueChanged(int)), this, SLOT(slotProfileEdited()));
    connect(m_view.size_w, SIGNAL(valueChanged(int)), this, SLOT(slotProfileEdited()));
}