Exemple #1
0
KraftDocHeaderEdit::KraftDocHeaderEdit( QWidget *parent )
  : KraftDocEdit( parent )
{
  QVBoxLayout *topLayout = new QVBoxLayout;
  setLayout( topLayout );
  mDocHeaderEdit = new Ui::DocHeaderEdit;
  QWidget *w = new QWidget;
  mDocHeaderEdit->setupUi( w );
  topLayout->addWidget( w );

  mDocHeaderEdit->mButtLang->setIcon(KIcon("preferences-desktop-locale"));

  connect( mDocHeaderEdit->m_cbType, SIGNAL( activated( int ) ),
    SLOT( slotModified() ) );
  connect( mDocHeaderEdit->m_cbType, SIGNAL( textChanged( const QString & ) ),
    SLOT( slotModified() ) );
  connect( mDocHeaderEdit->m_dateEdit, SIGNAL( changed( QDate ) ),
    SLOT( slotModified() ) );
  connect( mDocHeaderEdit->m_postAddressEdit, SIGNAL( textChanged() ),
    SLOT( slotModified() ) );
  connect( mDocHeaderEdit->m_letterHead, SIGNAL( activated( int ) ),
    SLOT( slotModified() ) );
  connect( mDocHeaderEdit->m_letterHead, SIGNAL( textChanged( const QString & ) ),
    SLOT( slotModified() ) );
  connect( mDocHeaderEdit->m_teEntry, SIGNAL( textChanged() ),
    SLOT( slotModified() ) );
  connect( mDocHeaderEdit->m_whiteboardEdit, SIGNAL( textChanged() ),
    SLOT( slotModified() ) );

  connect( mDocHeaderEdit->pb_pickAddressee, SIGNAL(clicked()), SIGNAL(pickAddressee()));

  setTitle( i18n( "Document Header" ) );
  setColor( "#9af0ff" );
}
void Preferences::createFontPage()
{
  // font parms page

  QWidget *w = new QWidget(this);
  Q3VBoxLayout *vbox = new Q3VBoxLayout(w);

  Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 3);
  grid->setMargin(5);
  grid->setSpacing(5);
  grid->setColStretch(1, 1);
  grid->setColStretch(2, 2);

  vbox->insertStretch(-1, 1);

  // plot font
  QLabel *label = new QLabel(tr("Plot Font"), w);
  grid->addWidget(label, 0, 0);

  plotFontButton = new FontButton(w, plotFont);
  grid->addWidget(plotFontButton, 0, 1);
  connect(plotFontButton, SIGNAL(valueChanged()), this, SLOT(slotModified()));

  // app font
  label = new QLabel(tr("App Font"), w);
  grid->addWidget(label, 1, 0);

  appFontButton = new FontButton(w, appFont);
  grid->addWidget(appFontButton, 1, 1);
  connect(appFontButton, SIGNAL(valueChanged()), this, SLOT(slotModified()));

  addTab(w, tr("Fonts"));

}
/**
 * Class constructor.
 * @param	nPage	The initial page to show
 * @param	pParent	The parent widget
 * @param	szName	The widget's name
 */
PreferencesDlg::PreferencesDlg(uint nPage, QWidget* pParent, 
	const char* szName) :
	KPageDialog(pParent),
	m_lDlgPageItems(QList<KPageWidgetItem*>())
{
	KVBox* pFrame;
	KPageWidgetItem *item;

	// Setup KPageDialog sub-widget
	setFaceType(KPageDialog::List);
	setCaption(i18n("Preferences"));
	setButtons(KDialog::Default | KDialog::Ok | KDialog::Apply | KDialog::Cancel);
	setDefaultButton(KDialog::Ok);
	setObjectName(szName);
	QDialog::setModal(false);

	// Create and add the "Frontend" page
	pFrame = new KVBox();
	item = addPage(pFrame, i18n("Programs"));
	item->setHeader(i18n("Paths to back-end programmes"));
	item->setIcon(KIcon("preferences-desktop-default-applications", KIconLoader::global()));
	m_lDlgPageItems << item;
	m_pPrefFrontend = new PrefFrontend(pFrame);

	// Create and add the "Colours" page
	pFrame = new KVBox();
	item = addPage(pFrame, i18n("Colours"));
	item->setHeader(i18n("Window colours"));
	item->setIcon(KIcon("preferences-desktop-color", KIconLoader::global()));
	m_lDlgPageItems << item;
	m_pPrefColor = new PrefColor(pFrame);

	// Create and add the "Fonts" page
	pFrame = new KVBox();
	item = addPage(pFrame, i18n("Fonts"));
	item->setHeader(i18n("Window fonts"));
	item->setIcon(KIcon("preferences-desktop-font", KIconLoader::global()));
	m_lDlgPageItems << item;
	m_pPrefFont = new PrefFont(pFrame);

	// Create and add the "Options" page
	pFrame = new KVBox();
	item = addPage(pFrame, i18n("Options"));
	item->setHeader(i18n("Misc. Options"));
	item->setIcon(KIcon("configure", KIconLoader::global()));
	m_lDlgPageItems << item;
	m_pPrefOpt = new PrefOpt(pFrame);

	// Make sure the "Apply" button is initially disabled
	enableButtonApply(false);

	// Enable the "Apply" button when a parameter changes its value
	connect(m_pPrefFrontend, SIGNAL(modified()), this, SLOT(slotModified()));
	connect(m_pPrefColor, SIGNAL(modified()), this, SLOT(slotModified()));
	connect(m_pPrefFont, SIGNAL(modified()), this, SLOT(slotModified()));
	connect(m_pPrefOpt, SIGNAL(modified()), this, SLOT(slotModified()));

	// Show the ( new ) current page
	setCurrentPage(m_lDlgPageItems[nPage]);
}
void ImageDescEditTab::slotPickLabelChanged(int pickId)
{
    d->hub.setPickLabel(pickId);
    // no handling for MetadataDisjoint needed for pick label,
    // we set it to 0 when disjoint, see below
    slotModified();
}
void ImageDescEditTab::slotColorLabelChanged(int colorId)
{
    d->hub.setColorLabel(colorId);
    // no handling for MetadataDisjoint needed for color label,
    // we set it to 0 when disjoint, see below
    slotModified();
}
void ImageDescEditTab::slotRatingChanged(int rating)
{
    d->hub.setRating(rating);
    // no handling for MetadataDisjoint needed for rating,
    // we set it to 0 when disjoint, see below
    slotModified();
}
Exemple #7
0
KraftDocFooterEdit::KraftDocFooterEdit( QWidget *parent )
  : KraftDocEdit( parent ),
  mDocFooterEdit( 0 ),
  mCustomGreetingIndex(-1)
{
  QVBoxLayout *topLayout = new QVBoxLayout;
  Q_ASSERT( parent );
  setLayout( topLayout );

  mDocFooterEdit = new Ui::DocFooterEdit;
  QWidget *w = new QWidget;
  mDocFooterEdit->setupUi(w);
  topLayout->addWidget(w);

  mDocFooterEdit->m_cbGreeting->insertItems(-1, KraftDB::self()->wordList( "greeting" ) );

  connect( mDocFooterEdit->m_cbGreeting, SIGNAL( activated( int ) ),
           SLOT( slotModified() ) );
  connect( mDocFooterEdit->m_cbGreeting, SIGNAL(currentIndexChanged(int)),
           this, SLOT(slotGreeterIndexChanged(int)));
  connect( mDocFooterEdit->m_cbGreeting, SIGNAL(editTextChanged(QString)),
           this, SLOT(slotGreeterEditTextChanged(QString)));
  connect( mDocFooterEdit->m_teSummary, SIGNAL( textChanged() ),
           SLOT( slotModified() ) );

  setTitle( i18n( "Document Footer" ) );
  setColor( "#f0ff9a" );
}
void ImageDescEditTab::slotTemplateSelected()
{
    d->hub.setMetadataTemplate(d->templateSelector->getTemplate());
    d->templateViewer->setTemplate(d->templateSelector->getTemplate());
    setMetadataWidgetStatus(d->hub.templateStatus(), d->templateSelector);
    slotModified();
}
void Preferences::createColorPage()
{
  // colors parms page

  QWidget *w = new QWidget(this);
  Q3VBoxLayout *vbox = new Q3VBoxLayout(w);

  Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 3);
  grid->setMargin(5);
  grid->setSpacing(5);
  grid->setColStretch(1, 1);
  grid->setColStretch(2, 2);

  vbox->insertStretch(-1, 1);

  // background color
  QLabel *label = new QLabel(tr("Chart Background"), w);
  grid->addWidget(label, 0, 0);

  backgroundColorButton = new ColorButton(w, backgroundColor);
  grid->addWidget(backgroundColorButton, 0, 1);
  backgroundColorButton->setColorButton();
  connect(backgroundColorButton, SIGNAL(valueChanged()), this, SLOT(slotModified()));

  // border color
  label = new QLabel(tr("Chart Border"), w);
  grid->addWidget(label, 1, 0);

  borderColorButton = new ColorButton(w, borderColor);
  grid->addWidget(borderColorButton, 1, 1);
  borderColorButton->setColorButton();
  connect(borderColorButton, SIGNAL(valueChanged()), this, SLOT(slotModified()));

  // grid color
  label = new QLabel(tr("Chart Grid"), w);
  grid->addWidget(label, 2, 0);

  gridColorButton = new ColorButton(w, gridColor);
  grid->addWidget(gridColorButton, 2, 1);
  gridColorButton->setColorButton();
  connect(gridColorButton, SIGNAL(valueChanged()), this, SLOT(slotModified()));

  //FIXME: add adjustment possibility for prefered CO-colors.
  // in this way to add a spinbox to set the amount of colors too

  addTab(w, tr("Colors"));
}
bool cs8UserTypeModel::add(const QString &aliasName, const QString &path, const bool autoLoad)
{
    cs8UserType * alias = new cs8UserType(aliasName, path, autoLoad);
    connect (alias,SIGNAL(modified()),this,SLOT(slotModified()));
    m_aliasList.append(alias);
    reset();
    return true;
}
Exemple #11
0
void ImageDescEditTab::slotTitleChanged()
{
    CaptionsMap titles;

    titles.fromAltLangMap(d->titleEdit->values());
    d->hub.setTitles(titles);
    setMetadataWidgetStatus(d->hub.titlesStatus(), d->titleEdit);
    slotModified();
}
void KSPhrase::slotAddExplanation()
{
  if(!KSData::instance()->getType())
  {
    new KListViewItem(m_mainWidget->explanationList, i18n("Type an explanation."), i18n("Type an example."));
  }
  else
  {
    new KListViewItem(m_mainWidget->explanationList, i18n("Type an explanation for the first language."), i18n("Type an example for the first language."), i18n("Type an explanation for the second language."), i18n("Type an example for the second language."));
  }
  slotModified();
}
void KSPhrase::slotRemoveFamily()
{
  //Add the word to the deleted list.
  m_deletedFamily << m_mainWidget->selectedFamilyList->currentItem()->text(0);

  //Put the word back to the available list.
  m_mainWidget->availableFamilyList->insertItem(m_mainWidget->selectedFamilyList->currentItem());

  //delete m_mainWidget->selectedFamilyList->currentItem();

  slotModified();
}
void KSPhrase::slotAddFamily()
{
  //Remove a allready existing word in the delete list.
  for(QStringList::iterator count = m_deletedFamily.begin(); count != m_deletedFamily.end(); count++)
  {
    if(*count == m_mainWidget->availableFamilyList->currentItem()->text(0))
    {
      m_deletedFamily.remove(count);
      break;
    }
  }

  //m_mainWidget->availableFamilyList->addFilter(static_cast <KSListViewItem*> (m_mainWidget->availableFamilyList->currentItem())->getId().toInt());

  //Put the word to the selected list.
  m_mainWidget->selectedFamilyList->insertItem(m_mainWidget->availableFamilyList->currentItem());

  slotModified();
}
void KSPhrase::slotRemoveAntonym()
{
  //Add the word to the deleted list.
  m_deletedAntonyms << m_mainWidget->selectedAntonymList->currentItem()->text(0);
  //KSListViewItem *temp=static_cast<KSListViewItem*> (m_mainWidget->selectedAntonymList->currentItem());

  /*m_mainWidget->availableSynonymList->delFilter(static_cast <KSListViewItem*> (m_mainWidget->selectedAntonymList->currentItem())->getId().toInt());
  m_mainWidget->availableAntonymList->delFilter(static_cast <KSListViewItem*> (m_mainWidget->selectedAntonymList->currentItem())->getId().toInt());*/

  //Temporarily we save the reference to the word. And convert :)
  KSListViewItem *tempWord = static_cast<KSListViewItem*> (m_mainWidget->selectedAntonymList->currentItem());

  //Put the word back to the available lists.
  new KSListViewItem(m_mainWidget->availableSynonymList, tempWord->text(0), tempWord->getId(), tempWord->getSearch());
  m_mainWidget->availableAntonymList->insertItem(m_mainWidget->selectedAntonymList->currentItem());

  //delete m_mainWidget->selectedAntonymList->currentItem();
  slotModified();
}
Exemple #16
0
void ImageDescEditTab::slotTagStateChanged(Album* album, Qt::CheckState checkState)
{
    TAlbum* const tag = dynamic_cast<TAlbum*>(album);

    if (!tag || d->ignoreTagChanges)
    {
        return;
    }

    switch (checkState)
    {
        case Qt::Checked:
            d->hub.setTag(tag->id());
            break;
        default:
            d->hub.setTag(tag->id(), DisjointMetadata::MetadataInvalid);
            break;
    }

    slotModified();
}
Exemple #17
0
void KraftDocFooterEdit::slotGreeterEditTextChanged(const QString& newText)
{
    QComboBox *greeterCombo = qobject_cast<QComboBox*>(mDocFooterEdit->m_cbGreeting);
    if( !greeterCombo ) return;
    kDebug() << "II Combo box text changed to" << newText << "in" << greeterCombo;

    const QStringList texts = KraftDB::self()->wordList("greeting");
    int indx = greeterCombo->currentIndex();
    if( !texts.contains(newText)) {
        if( mCustomGreetingIndex == -1 ) {
            // no custom Entry yet
            greeterCombo->insertItem(0, newText);
            mCustomGreetingIndex = 0;
        }
        indx = mCustomGreetingIndex;
    }
    greeterCombo->setItemText(indx, newText);
    greeterCombo->setCurrentIndex(indx);

    mGreeting = newText;
    slotModified();
}
Exemple #18
0
PMShell::PMShell( const KURL& url )
      : PMDockMainWindow( 0, "mainwindow" )
{
   setPluginLoadingMode( DoNotLoadPlugins );
   setInstance( PMFactory::instance( ), false );

   m_pPart = new PMPart( this, "part", this, "part", true, this );
   m_pPart->setReadWrite( ); // read-write mode
   m_viewNumber = 0;
   m_objectsToDelete.setAutoDelete( true );

   if (!initialGeometrySet())
      resize(800,600);

   setupActions( );

   restoreOptions( );

   setupView( );
   setXMLFile( "kpovmodelershell.rc" );
   createGUI( m_pPart );

   //guiFactory( )->addClient( m_pPart );
   m_pStatusBar = statusBar( );
   m_pStatusBar->insertItem( " ", c_statusBarInfo, 1 );
   m_pStatusBar->insertItem( "" , c_statusBarControlPoints );

   KConfig* config = instance( )->config( );
   config->setGroup( "Appearance" );
   applyMainWindowSettings( config );

   if( !url.isEmpty( ) )
      openURL( url );

   setCaption( url.prettyURL( ) );
   connect( m_pPart, SIGNAL( modified( ) ), SLOT( slotModified( ) ) );
   connect( m_pPart, SIGNAL( controlPointMessage( const QString& ) ),
            SLOT( slotControlPointMsg( const QString& ) ) );
}
void KSPhrase::slotAddSynonym()
{
  //Remove a allready existing word in the delete list.
  for(QStringList::iterator count = m_deletedSynonyms.begin(); count != m_deletedSynonyms.end(); count++)
  {
    if(*count == m_mainWidget->availableSynonymList->currentItem()->text(0))
    {
      m_deletedSynonyms.remove(count);
      break;
    }
  }

  //Delete the word from the available list in the antonym section.
  delete m_mainWidget->availableAntonymList->findItem(m_mainWidget->availableSynonymList->currentItem()->text(0), 0);

  /*m_mainWidget->availableSynonymList->addFilter(static_cast <KSListViewItem*> (m_mainWidget->availableSynonymList->currentItem())->getId().toInt());
  m_mainWidget->availableAntonymList->addFilter(static_cast <KSListViewItem*> (m_mainWidget->availableSynonymList->currentItem())->getId().toInt());*/

  //Put the word to the selected list.
  m_mainWidget->selectedSynonymList->insertItem(m_mainWidget->availableSynonymList->currentItem());

  slotModified();
}
Exemple #20
0
KraftDocHeaderEdit::KraftDocHeaderEdit( QWidget *parent )
  : KraftDocEdit( parent )
{
  QVBoxLayout *topLayout = new QVBoxLayout;
  setLayout( topLayout );
  mDocHeaderEdit = new Ui::DocHeaderEdit;
  QWidget *w = new QWidget;
  mDocHeaderEdit->setupUi( w );
  topLayout->addWidget( w );

  mDocHeaderEdit->mButtLang->setIcon(QIcon::fromTheme("preferences-desktop-locale"));

  connect( mDocHeaderEdit->m_cbType, SIGNAL( currentIndexChanged(int)),
           SLOT( slotModified() ) );
  connect( mDocHeaderEdit->m_dateEdit, SIGNAL( dateChanged( QDate ) ),
           SLOT( slotModified() ) );
  connect( mDocHeaderEdit->m_postAddressEdit, SIGNAL( textChanged() ),
           SLOT( slotModified() ) );
  connect( mDocHeaderEdit->m_letterHead, SIGNAL( currentTextChanged(QString)),
           SLOT(slotModified() ) );
  connect( mDocHeaderEdit->m_teEntry, SIGNAL( textChanged() ),
           SLOT( slotModified() ) );
  connect( mDocHeaderEdit->m_whiteboardEdit, SIGNAL( textChanged() ),
           SLOT( slotModified() ) );
  connect( mDocHeaderEdit->mProjectLabelEdit, SIGNAL( textChanged(QString) ),
           SLOT(slotModified() ) );
  connect( mDocHeaderEdit->pb_pickAddressee, SIGNAL(clicked()), SIGNAL(pickAddressee()));

  setTitle( i18n( "Document Header" ) );
  setColor( "#9af0ff" );

  // if the Akonadi-Backend is down, just show a text
  QScopedPointer<AddressProvider> addressProvider;
  addressProvider.reset(new AddressProvider);
  if( !addressProvider->backendUp() ) {
      mDocHeaderEdit->pb_pickAddressee->hide();
      mDocHeaderEdit->m_labName->setText( i18n("Manually set in address field."));
  }
}
Exemple #21
0
ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidget * parent) :
    QDialog(parent),
    m_clip(clip),
    m_tc(tc),
    m_fps(fps),
    m_count(0),
    m_clipNeedsRefresh(false),
    m_clipNeedsReLoad(false)
{
    setAttribute(Qt::WA_DeleteOnClose, true);
    setFont(KGlobalSettings::toolBarFont());
    m_view.setupUi(this);
    
    // force transparency is only for group properties, so hide it
    m_view.clip_force_transparency->setHidden(true);
    m_view.clip_transparency->setHidden(true);
    
    KUrl url = m_clip->fileURL();
    m_view.clip_path->setText(url.path());
    m_view.clip_description->setText(m_clip->description());
    connect(m_view.clip_description, SIGNAL(textChanged(QString)), this, SLOT(slotModified()));

    QMap <QString, QString> props = m_clip->properties();
    m_view.clip_force_out->setHidden(true);
    m_view.clip_out->setHidden(true);
    
    // New display aspect ratio support
    if (props.contains("force_aspect_num") && props.value("force_aspect_num").toInt() > 0 &&
        props.contains("force_aspect_den") && props.value("force_aspect_den").toInt() > 0) {
        m_view.clip_force_ar->setChecked(true);
        m_view.clip_ar_num->setEnabled(true);
        m_view.clip_ar_den->setEnabled(true);
        m_view.clip_ar_num->setValue(props.value("force_aspect_num").toInt());
        m_view.clip_ar_den->setValue(props.value("force_aspect_den").toInt());
    }
    // Legacy support for pixel aspect ratio
    else if (props.contains("force_aspect_ratio") && props.value("force_aspect_ratio").toDouble() > 0) {
        m_view.clip_force_ar->setChecked(true);
        m_view.clip_ar_num->setEnabled(true);
        m_view.clip_ar_den->setEnabled(true);
        if (props.contains("frame_size")) {
            int width = props.value("force_aspect_ratio").toDouble() * props.value("frame_size").section('x', 0, 0).toInt();
            int height = props.value("frame_size").section('x', 1, 1).toInt();
            if (width > 0 && height > 0) {
                if ((width / height * 100) == 133) {
                    width = 4;
                    height = 3;
                }
                else if (int(width / height * 100) == 177) {
                    width = 16;
                    height = 9;
                }
                m_view.clip_ar_num->setValue(width);
                m_view.clip_ar_den->setValue(height);
            }
        }
    }
    connect(m_view.clip_force_ar, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
    connect(m_view.clip_ar_num, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));
    connect(m_view.clip_ar_den, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));

    if (props.contains("force_fps") && props.value("force_fps").toDouble() > 0) {
        m_view.clip_force_framerate->setChecked(true);
        m_view.clip_framerate->setEnabled(true);
        m_view.clip_framerate->setValue(props.value("force_fps").toDouble());
    }
    connect(m_view.clip_force_framerate, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
    connect(m_view.clip_framerate, SIGNAL(valueChanged(double)), this, SLOT(slotModified()));

    if (props.contains("force_progressive")) {
        m_view.clip_force_progressive->setChecked(true);
        m_view.clip_progressive->setEnabled(true);
        m_view.clip_progressive->setValue(props.value("force_progressive").toInt());
    }
    connect(m_view.clip_force_progressive, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
    connect(m_view.clip_progressive, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));

    m_view.clip_fieldorder->addItem(i18n("Bottom first"), 0);
    m_view.clip_fieldorder->addItem(i18n("Top first"), 1);
    if (props.contains("force_tff")) {
        m_view.clip_force_fieldorder->setChecked(true);
        m_view.clip_fieldorder->setEnabled(true);
        m_view.clip_fieldorder->setCurrentIndex(props.value("force_tff").toInt());
    }
    connect(m_view.clip_force_fieldorder, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
    connect(m_view.clip_fieldorder, SIGNAL(currentIndexChanged(int)), this, SLOT(slotModified()));
    
    if (props.contains("threads") && props.value("threads").toInt() != 1) {
        m_view.clip_force_threads->setChecked(true);
        m_view.clip_threads->setEnabled(true);
        m_view.clip_threads->setValue(props.value("threads").toInt());
    }
    connect(m_view.clip_force_threads, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
    connect(m_view.clip_threads, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));

    if (props.contains("video_index") && props.value("video_index").toInt() != 0) {
        m_view.clip_force_vindex->setChecked(true);
        m_view.clip_vindex->setEnabled(true);
        m_view.clip_vindex->setValue(props.value("video_index").toInt());
    }
    connect(m_view.clip_force_vindex, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
    connect(m_view.clip_vindex, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));

    if (props.contains("audio_index") && props.value("audio_index").toInt() != 0) {
        m_view.clip_force_aindex->setChecked(true);
        m_view.clip_aindex->setEnabled(true);
        m_view.clip_aindex->setValue(props.value("audio_index").toInt());
    }
    connect(m_view.clip_force_aindex, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
    connect(m_view.clip_aindex, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));

    if (props.contains("audio_max")) {
        m_view.clip_aindex->setMaximum(props.value("audio_max").toInt());
    }

    if (props.contains("video_max")) {
        m_view.clip_vindex->setMaximum(props.value("video_max").toInt());
    }
    
    m_view.clip_colorspace->addItem(ProfilesDialog::getColorspaceDescription(601), 601);
    m_view.clip_colorspace->addItem(ProfilesDialog::getColorspaceDescription(709), 709);
    m_view.clip_colorspace->addItem(ProfilesDialog::getColorspaceDescription(240), 240);
    if (props.contains("force_colorspace")) {
        m_view.clip_force_colorspace->setChecked(true);
        m_view.clip_colorspace->setEnabled(true);
        m_view.clip_colorspace->setCurrentIndex(m_view.clip_colorspace->findData(props.value("force_colorspace").toInt()));
    } else if (props.contains("colorspace")) {
        m_view.clip_colorspace->setCurrentIndex(m_view.clip_colorspace->findData(props.value("colorspace").toInt()));
    }
    connect(m_view.clip_force_colorspace, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
    connect(m_view.clip_colorspace, SIGNAL(currentIndexChanged(int)), this, SLOT(slotModified()));
    
    if (props.contains("full_luma")) {
        m_view.clip_full_luma->setChecked(true);
    }
    connect(m_view.clip_full_luma, SIGNAL(toggled(bool)), this, SLOT(slotModified()));

    // Check for Metadata
    QMap<QString, QString> meta = m_clip->metadata();
    QMap<QString, QString>::const_iterator i = meta.constBegin();
    while (i != meta.constEnd()) {
        QTreeWidgetItem *metaitem = new QTreeWidgetItem(m_view.metadata_list);
        metaitem->setText(0, i.key()); //i18n(i.key().section('.', 2, 3).toUtf8().data()));
        metaitem->setText(1, i.value());
        ++i;
    }

    connect(m_view.clip_force_ar, SIGNAL(toggled(bool)), m_view.clip_ar_num, SLOT(setEnabled(bool)));
    connect(m_view.clip_force_ar, SIGNAL(toggled(bool)), m_view.clip_ar_den, SLOT(setEnabled(bool)));
    connect(m_view.clip_force_framerate, SIGNAL(toggled(bool)), m_view.clip_framerate, SLOT(setEnabled(bool)));
    connect(m_view.clip_force_progressive, SIGNAL(toggled(bool)), m_view.clip_progressive, SLOT(setEnabled(bool)));
    connect(m_view.clip_force_fieldorder, SIGNAL(toggled(bool)), m_view.clip_fieldorder, SLOT(setEnabled(bool)));
    connect(m_view.clip_force_threads, SIGNAL(toggled(bool)), m_view.clip_threads, SLOT(setEnabled(bool)));
    connect(m_view.clip_force_vindex, SIGNAL(toggled(bool)), m_view.clip_vindex, SLOT(setEnabled(bool)));
    connect(m_view.clip_force_aindex, SIGNAL(toggled(bool)), m_view.clip_aindex, SLOT(setEnabled(bool)));
    connect(m_view.clip_force_colorspace, SIGNAL(toggled(bool)), m_view.clip_colorspace, SLOT(setEnabled(bool)));

    if (props.contains("audiocodec"))
        new QTreeWidgetItem(m_view.clip_aproperties, QStringList() << i18n("Audio codec") << props.value("audiocodec"));

    if (props.contains("channels"))
        new QTreeWidgetItem(m_view.clip_aproperties, QStringList() << i18n("Channels") << props.value("channels"));

    if (props.contains("frequency"))
        new QTreeWidgetItem(m_view.clip_aproperties, QStringList() << i18n("Frequency") << props.value("frequency"));
    

    CLIPTYPE t = m_clip->clipType();
    
    if (props.contains("proxy") && props.value("proxy") != "-") {
        KFileItem f(KFileItem::Unknown, KFileItem::Unknown, KUrl(props.value("proxy")), true);
        QFrame* line = new QFrame();
        line->setFrameShape(QFrame::HLine);
        line->setFrameShadow(QFrame::Sunken);
        m_proxyContainer = new QFrame();
        m_proxyContainer->setFrameShape(QFrame::NoFrame);
        QHBoxLayout *l = new QHBoxLayout;
        l->addWidget(new QLabel(i18n("Proxy clip: %1", KIO::convertSize(f.size()))));
        l->addStretch(5);
        QPushButton *pb = new QPushButton(i18n("Delete proxy"));
        l->addWidget(pb);
        connect(pb, SIGNAL(clicked()), this, SLOT(slotDeleteProxy()));
        m_proxyContainer->setLayout(l);
        if (t == IMAGE) {
            m_view.tab_image->layout()->addWidget(line);
            m_view.tab_image->layout()->addWidget(m_proxyContainer);
        }
        else if (t == AUDIO) {
            m_view.tab_audio->layout()->addWidget(line);
            m_view.tab_audio->layout()->addWidget(m_proxyContainer);
        }
        else {
            m_view.tab_video->layout()->addWidget(line);
            m_view.tab_video->layout()->addWidget(m_proxyContainer);
        }
    }
    
    if (t != AUDIO && t != AV) {
        m_view.clip_force_aindex->setEnabled(false);
    }

    if (t != VIDEO && t != AV) {
        m_view.clip_force_vindex->setEnabled(false);
    }

    if (t == IMAGE) {
        m_view.tabWidget->removeTab(SLIDETAB);
        m_view.tabWidget->removeTab(COLORTAB);
        m_view.tabWidget->removeTab(AUDIOTAB);
        m_view.tabWidget->removeTab(VIDEOTAB);
        if (props.contains("frame_size"))
            m_view.image_size->setText(props.value("frame_size"));
        if (props.contains("transparency"))
            m_view.image_transparency->setChecked(props.value("transparency").toInt());
        connect(m_view.image_transparency, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
        int width = 180.0 * KdenliveSettings::project_display_ratio();
        if (width % 2 == 1) width++;
        m_view.clip_thumb->setPixmap(QPixmap(url.path()).scaled(QSize(width, 180), Qt::KeepAspectRatio));
    } else if (t == COLOR) {
XMPEditWidget::XMPEditWidget(MetadataEditDialog* const parent)
    : KPageWidget(parent), d(new XMPEditWidgetPrivate)
{
    d->dlg       = parent;

    d->contentPage   = new XMPContent(this);
    d->page_content  = addPage(d->contentPage, i18n("Content"));
    d->page_content->setHeader(i18n("<qt>Content Information<br/>"
                     "<i>Use this panel to describe the visual content of the image</i></qt>"));
    d->page_content->setIcon(KIcon("draw-text"));

    d->originPage  = new XMPOrigin(this);
    d->page_origin = addPage(d->originPage, i18n("Origin"));
    d->page_origin->setHeader(i18n("<qt>Origin Information<br/>"
                    "<i>Use this panel for formal descriptive information about the image</i></qt>"));
    d->page_origin->setIcon(KIcon("document-properties"));

    d->creditsPage  = new XMPCredits(this);
    d->page_credits = addPage(d->creditsPage, i18n("Credits"));
    d->page_credits->setHeader(i18n("<qt>Credit Information<br/>"
                     "<i>Use this panel to record copyright information about the image</i></qt>"));
    d->page_credits->setIcon(KIcon("view-pim-contacts"));

    d->subjectsPage  = new XMPSubjects(this);
    d->page_subjects = addPage(d->subjectsPage, i18n("Subjects"));
    d->page_subjects->setHeader(i18n("<qt>Subject Information<br/>"
                      "<i>Use this panel to record subject information about the image</i></qt>"));
    d->page_subjects->setIcon(KIcon("feed-subscribe"));

    d->keywordsPage  = new XMPKeywords(this);
    d->page_keywords = addPage(d->keywordsPage, i18n("Keywords"));
    d->page_keywords->setHeader(i18n("<qt>Keyword Information<br/>"
                      "<i>Use this panel to record keywords relevant to the image</i></qt>"));
    d->page_keywords->setIcon(KIcon("bookmarks"));

    d->categoriesPage  = new XMPCategories(this);
    d->page_categories = addPage(d->categoriesPage, i18n("Categories"));
    d->page_categories->setHeader(i18n("<qt>Category Information<br/>"
                        "<i>Use this panel to record categories relevant to the image</i></qt>"));
    d->page_categories->setIcon(KIcon("folder"));

    d->statusPage  = new XMPStatus(this);
    d->page_status = addPage(d->statusPage, i18n("Status"));
    d->page_status->setHeader(i18n("<qt>Status Information<br/>"
                    "<i>Use this panel to record workflow information</i></qt>"));
    d->page_status->setIcon(KIcon("view-pim-tasks"));

    d->propertiesPage  = new XMPProperties(this);
    d->page_properties = addPage(d->propertiesPage, i18n("Properties"));
    d->page_properties->setHeader(i18n("<qt>Status Properties<br/>"
                      "<i>Use this panel to record workflow properties</i></qt>"));
    d->page_properties->setIcon(KIcon("draw-freehand"));

    // ------------------------------------------------------------

    connect(d->contentPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->propertiesPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->originPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->subjectsPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->keywordsPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->categoriesPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->creditsPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->statusPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    // ------------------------------------------------------------

    readSettings();
    slotItemChanged();
}
Exemple #23
0
IPTCEditWidget::IPTCEditWidget(MetadataEditDialog* const parent)
    : DConfigDlgWdg(parent),
      d(new Private)
{
    d->dlg           = parent;

    d->contentPage   = new IPTCContent(this);
    d->page_content  = addPage(d->contentPage, i18n("Content"));
    d->page_content->setIcon(QIcon::fromTheme(QLatin1String("help-contents")));

    d->originPage  = new IPTCOrigin(this);
    d->page_origin = addPage(d->originPage, i18n("Origin"));
    d->page_origin->setIcon(QIcon::fromTheme(QLatin1String("applications-internet")));

    d->creditsPage  = new IPTCCredits(this);
    d->page_credits = addPage(d->creditsPage, i18n("Credits"));
    d->page_credits->setIcon(QIcon::fromTheme(QLatin1String("view-pim-contacts")));

    d->subjectsPage  = new IPTCSubjects(this);
    d->page_subjects = addPage(d->subjectsPage, i18n("Subjects"));
    d->page_subjects->setIcon(QIcon::fromTheme(QLatin1String("feed-subscribe")));

    d->keywordsPage  = new IPTCKeywords(this);
    d->page_keywords = addPage(d->keywordsPage, i18n("Keywords"));
    d->page_keywords->setIcon(QIcon::fromTheme(QLatin1String("bookmarks")));

    d->categoriesPage  = new IPTCCategories(this);
    d->page_categories = addPage(d->categoriesPage, i18n("Categories"));
    d->page_categories->setIcon(QIcon::fromTheme(QLatin1String("folder-image")));

    d->statusPage  = new IPTCStatus(this);
    d->page_status = addPage(d->statusPage, i18n("Status"));
    d->page_status->setIcon(QIcon::fromTheme(QLatin1String("view-pim-tasks")));

    d->propertiesPage  = new IPTCProperties(this);
    d->page_properties = addPage(d->propertiesPage, i18n("Properties"));
    d->page_properties->setIcon(QIcon::fromTheme(QLatin1String("draw-freehand")));

    d->envelopePage  = new IPTCEnvelope(this);
    d->page_envelope = addPage(d->envelopePage, i18n("Envelope"));
    d->page_envelope->setIcon(QIcon::fromTheme(QLatin1String("view-pim-mail")));

    // ---------------------------------------------------------------

    connect(d->contentPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->propertiesPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->subjectsPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->keywordsPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->categoriesPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->creditsPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->statusPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->originPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->envelopePage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    // ------------------------------------------------------------

    readSettings();
    slotItemChanged();
}
Exemple #24
0
void KraftDocFooterEdit::slotGreeterIndexChanged(int newIndex)
{
    mGreeting = mDocFooterEdit->m_cbGreeting->itemText(newIndex);
    slotModified();
}
Exemple #25
0
void ImageDescEditTab::slotCommentChanged()
{
    d->hub.setComments(d->captionsEdit->values());
    setMetadataWidgetStatus(d->hub.commentsStatus(), d->captionsEdit);
    slotModified();
}
void KLFLibEntryEditor::displayEntries(const QList<KLFLibEntry>& entrylist)
{
  // refresh the display label's glow effect
  /** \bug .... find a better way to synchronize config values like this. ....... */
  u->lblPreview->setGlowEffect(klfconfig.UI.glowEffect);
  u->lblPreview->setGlowEffectColor(klfconfig.UI.glowEffectColor);
  u->lblPreview->setGlowEffectRadius(klfconfig.UI.glowEffectRadius);

  u->cbxCategory->lineEdit()->setReadOnly(!pInputEnabled);
  u->cbxTags->lineEdit()->setReadOnly(!pInputEnabled);
  if (entrylist.size() == 0) {
    u->lblPreview->display(QImage(":/pics/nopreview.png"), QImage(), false);
    u->txtPreviewLatex->setText(tr("[ No Item Selected ]"));
    u->cbxCategory->setEditText(tr("[ No Item Selected ]"));
    u->cbxTags->setEditText(tr("[ No Item Selected ]"));
    //    u->lblStylePreview->setText(tr("[ No Item Selected ]"));
    u->cbxCategory->setEnabled(false);
    u->cbxTags->setEnabled(false);
    u->btnApplyChanges->setEnabled(false);
    u->btnRestoreStyle->setEnabled(false);
    pCurrentStyle = KLFStyle();
    displayStyle(false, KLFStyle());
    u->lblStyMathMode->setText(tr("[ No Item Selected ]"));
    u->txtStyPreamble->setPlainText(tr("[ No Item Selected ]"));
    slotModified(false);
    return;
  }
  if (entrylist.size() == 1) {
    KLFLibEntry e = entrylist[0];
    QImage img = e.preview();
    u->lblPreview->display(img, img, true);
    u->txtPreviewLatex->setText(e.latex());
    u->cbxCategory->setEditText(e.category());
    u->cbxTags->setEditText(e.tags());
    pCurrentStyle = e.style();
    //    u->lblStylePreview->setText(prettyPrintStyle(pCurrentStyle));
    u->cbxCategory->setEnabled(true);
    u->cbxTags->setEnabled(true);
    u->btnApplyChanges->setEnabled(pInputEnabled && true);
    u->btnRestoreStyle->setEnabled(true); // NOT pInputEnabled && : not true input
    displayStyle(true, pCurrentStyle);
    slotModified(false);
    return;
  }
  // multiple items selected
  u->lblPreview->display(QImage(":/pics/nopreview.png"), QImage(), false);
  u->txtPreviewLatex->setText(tr("[ %n Items Selected ]", 0, entrylist.size()));
  u->cbxTags->setEditText(tr("[ Multiple Items Selected ]"));
  // if all elements have same category and style, display them, otherwise set
  // the respective field empty
  QString cat;
  bool allsamestyle = true;
  KLFStyle style;
  int k;
  for (k = 0; k < entrylist.size(); ++k) {
    QString thiscat = entrylist[k].category();
    KLFStyle thisstyle = entrylist[k].style();
    if (k == 0) {
      cat = thiscat;
      style = thisstyle;
      allsamestyle = true;
      continue;
    }
    if ( !cat.isEmpty() && thiscat != cat ) {
      cat = "";
    }
    if ( allsamestyle && !(style == thisstyle) ) {
      allsamestyle = false;
    }
  }
  u->cbxCategory->setEditText(cat);
  if ( allsamestyle ) {
    pCurrentStyle = style;
    displayStyle(true, pCurrentStyle);
    u->btnRestoreStyle->setEnabled(true); // NOT pInputEnabled && : not true input
  } else {
    pCurrentStyle = KLFStyle();
    displayStyle(false, KLFStyle());
    u->lblStyMathMode->setText(tr("[ Different Styles ]"));
    u->txtStyPreamble->setPlainText(tr("[ Different Styles ]"));
    u->btnRestoreStyle->setEnabled(false);
  }

  u->cbxCategory->setEnabled(pInputEnabled && true);
  u->cbxTags->setEnabled(pInputEnabled && false);
  u->btnApplyChanges->setEnabled(pInputEnabled && true);
  slotModified(false);
}
void KSPhrase::slotRemoveExplanation()
{
  m_mainWidget->explanationList->takeItem(m_mainWidget->explanationList->currentItem());
  slotModified();
}
Exemple #28
0
allIPTCEditWidget::allIPTCEditWidget(QWidget* parent, KUrl::List urls, Interface* iface)
              : KPageWidget(parent), d(new allIPTCEditWidgetPrivate)
{
    d->urls      = urls;
    d->interface = iface;
    d->currItem  = d->urls.begin();
 
    // ---------------------------------------------------------------

    d->contentPage   = new IPTCContent(this);
    d->page_content  = addPage(d->contentPage, i18n("Content"));
    d->page_content->setHeader(i18n("<qt>Content Information<br/>"
                     "<i>Use this panel to describe the visual content of the image</i></qt>"));
    d->page_content->setIcon(KIcon("help-contents"));

    d->originPage  = new IPTCOrigin(this);
    d->page_origin = addPage(d->originPage, i18n("Origin"));
    d->page_origin->setHeader(i18n("<qt>Origin Information<br/>"
                    "<i>Use this panel for formal descriptive information about the image</i></qt>"));
    d->page_origin->setIcon(KIcon("applications-internet"));

    d->creditsPage  = new IPTCCredits(this);
    d->page_credits = addPage(d->creditsPage, i18n("Credits"));
    d->page_credits->setHeader(i18n("<qt>Credit Information<br/>"
                     "<i>Use this panel to record copyright information about the image</i></qt>"));
    d->page_credits->setIcon(KIcon("view-pim-contacts"));

    d->subjectsPage  = new IPTCSubjects(this);
    d->page_subjects = addPage(d->subjectsPage, i18n("Subjects"));
    d->page_subjects->setHeader(i18n("<qt>Subject Information<br/>"
                      "<i>Use this panel to record subject information about the image</i></qt>"));
    d->page_subjects->setIcon(KIcon("feed-subscribe"));

    d->keywordsPage  = new IPTCKeywords(this);
    d->page_keywords = addPage(d->keywordsPage, i18n("Keywords"));
    d->page_keywords->setHeader(i18n("<qt>Keyword Information<br/>"
                      "<i>Use this panel to record keywords relevant to the image</i></qt>"));
    d->page_keywords->setIcon(KIcon("bookmarks"));

    d->categoriesPage  = new IPTCCategories(this);
    d->page_categories = addPage(d->categoriesPage, i18n("Categories"));
    d->page_categories->setHeader(i18n("<qt>Category Information<br/>"
                        "<i>Use this panel to record categories relevant to the image</i></qt>"));
    d->page_categories->setIcon(KIcon("folder-image"));

    d->statusPage  = new IPTCStatus(this);
    d->page_status = addPage(d->statusPage, i18n("Status"));
    d->page_status->setHeader(i18n("<qt>Status Information<br/>"
                    "<i>Use this panel to record workflow information</i></qt>"));
    d->page_status->setIcon(KIcon("view-pim-tasks"));

    d->propertiesPage  = new IPTCProperties(this);
    d->page_properties = addPage(d->propertiesPage, i18n("Properties"));
    d->page_properties->setHeader(i18n("<qt>Status Properties<br/>"
                      "<i>Use this panel to record workflow properties</i></qt>"));
    d->page_properties->setIcon(KIcon("draw-freehand"));

    d->envelopePage  = new IPTCEnvelope(this);
    d->page_envelope = addPage(d->envelopePage, i18n("Envelope"));
    d->page_envelope->setHeader(i18n("<qt>Envelope Information<br/>"
                      "<i>Use this panel to record editorial details</i></qt>"));
    d->page_envelope->setIcon(KIcon("view-pim-mail"));

    // ---------------------------------------------------------------

    connect(d->contentPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->propertiesPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->subjectsPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->keywordsPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->categoriesPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->creditsPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->statusPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->originPage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    connect(d->envelopePage, SIGNAL(signalModified()),
            this, SLOT(slotModified()));

    // ------------------------------------------------------------

    readSettings();
    slotItemChanged();
}
Exemple #29
0
void ImageDescEditTab::slotDateTimeChanged(const QDateTime& dateTime)
{
    d->hub.setDateTime(dateTime);
    setMetadataWidgetStatus(d->hub.dateTimeStatus(), d->dateTimeEdit);
    slotModified();
}