K3b::FillStatusDisplay::FillStatusDisplay( K3b::Doc* doc, QWidget *parent ) : QFrame(parent) { d = new Private; d->doc = doc; d->displayWidget = new K3b::FillStatusDisplayWidget( doc, this ); d->buttonMenu = new QToolButton( this ); d->buttonMenu->setIcon( QIcon::fromTheme( "configure" ) ); d->buttonMenu->setAutoRaise( true ); d->buttonMenu->setToolTip( i18n( "Set medium size" ) ); connect( d->buttonMenu, SIGNAL(clicked()), this, SLOT(slotMenuButtonClicked()) ); QHBoxLayout* layout = new QHBoxLayout( this ); layout->setSpacing( frameWidth() ); layout->setContentsMargins( frameWidth(), frameWidth(), frameWidth(), frameWidth() ); layout->addWidget( d->displayWidget, 1, Qt::AlignVCenter ); layout->addWidget( d->buttonMenu ); setupPopupMenu(); connect( d->doc, SIGNAL(changed()), this, SLOT(slotDocChanged()) ); connect( &d->updateTimer, SIGNAL(timeout()), this, SLOT(slotUpdateDisplay()) ); connect( k3bappcore->mediaCache(), SIGNAL(mediumChanged(K3b::Device::Device*)), this, SLOT(slotMediumChanged(K3b::Device::Device*)) ); slotLoadUserDefaults(); }
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())); }
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())); }
ProjectSettings::ProjectSettings(KdenliveDoc *doc, QMap <QString, QString> metadata, const QStringList &lumas, int videotracks, int audiotracks, const QString &projectPath, bool readOnlyTracks, bool savedProject, QWidget * parent) : QDialog(parent), m_savedProject(savedProject), m_lumas(lumas) { setupUi(this); list_search->setTreeWidget(files_list); project_folder->setMode(KFile::Directory); project_folder->setUrl(QUrl(projectPath)); loadProfiles(); manage_profiles->setIcon(KoIconUtils::themedIcon(QStringLiteral("configure"))); manage_profiles->setToolTip(i18n("Manage project profiles")); connect(manage_profiles, SIGNAL(clicked(bool)), this, SLOT(slotEditProfiles())); m_buttonOk = buttonBox->button(QDialogButtonBox::Ok); //buttonOk->setEnabled(false); audio_thumbs->setChecked(KdenliveSettings::audiothumbnails()); video_thumbs->setChecked(KdenliveSettings::videothumbnails()); audio_tracks->setValue(audiotracks); video_tracks->setValue(videotracks); connect(generate_proxy, SIGNAL(toggled(bool)), proxy_minsize, SLOT(setEnabled(bool))); connect(generate_imageproxy, SIGNAL(toggled(bool)), proxy_imageminsize, SLOT(setEnabled(bool))); QString currentProf; if (doc) { currentProf = KdenliveSettings::current_profile(); enable_proxy->setChecked(doc->getDocumentProperty(QStringLiteral("enableproxy")).toInt()); generate_proxy->setChecked(doc->getDocumentProperty(QStringLiteral("generateproxy")).toInt()); proxy_minsize->setValue(doc->getDocumentProperty(QStringLiteral("proxyminsize")).toInt()); m_proxyparameters = doc->getDocumentProperty(QStringLiteral("proxyparams")); generate_imageproxy->setChecked(doc->getDocumentProperty(QStringLiteral("generateimageproxy")).toInt()); proxy_imageminsize->setValue(doc->getDocumentProperty(QStringLiteral("proxyimageminsize")).toInt()); m_proxyextension = doc->getDocumentProperty(QStringLiteral("proxyextension")); } else { currentProf = KdenliveSettings::default_profile(); enable_proxy->setChecked(KdenliveSettings::enableproxy()); generate_proxy->setChecked(KdenliveSettings::generateproxy()); proxy_minsize->setValue(KdenliveSettings::proxyminsize()); m_proxyparameters = KdenliveSettings::proxyparams(); generate_imageproxy->setChecked(KdenliveSettings::generateimageproxy()); proxy_imageminsize->setValue(KdenliveSettings::proxyimageminsize()); m_proxyextension = KdenliveSettings::proxyextension(); } // Select profile for (int i = 0; i < profiles_list->count(); ++i) { if (profiles_list->itemData(i).toString() == currentProf) { profiles_list->setCurrentIndex(i); break; } } proxy_minsize->setEnabled(generate_proxy->isChecked()); proxy_imageminsize->setEnabled(generate_imageproxy->isChecked()); loadProxyProfiles(); // Proxy GUI stuff proxy_showprofileinfo->setIcon(KoIconUtils::themedIcon(QStringLiteral("help-about"))); proxy_showprofileinfo->setToolTip(i18n("Show default profile parameters")); proxy_manageprofile->setIcon(KoIconUtils::themedIcon(QStringLiteral("configure"))); proxy_manageprofile->setToolTip(i18n("Manage proxy profiles")); connect(proxy_manageprofile, SIGNAL(clicked(bool)), this, SLOT(slotManageEncodingProfile())); proxy_profile->setToolTip(i18n("Select default proxy profile")); connect(proxy_profile, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateProxyParams())); proxyparams->setVisible(false); proxyparams->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 5); connect(proxy_showprofileinfo, SIGNAL(clicked(bool)), proxyparams, SLOT(setVisible(bool))); if (readOnlyTracks) { video_tracks->setEnabled(false); audio_tracks->setEnabled(false); } // Metadata list QTreeWidgetItem *item = new QTreeWidgetItem(metadata_list, QStringList() << i18n("Title")); item->setData(0, Qt::UserRole, QStringLiteral("meta.attr.title.markup")); if (metadata.contains(QStringLiteral("meta.attr.title.markup"))) { item->setText(1, metadata.value(QStringLiteral("meta.attr.title.markup"))); metadata.remove(QStringLiteral("meta.attr.title.markup")); } item->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsEnabled); item = new QTreeWidgetItem(metadata_list, QStringList() << i18n("Author")); item->setData(0, Qt::UserRole, QStringLiteral("meta.attr.author.markup")); if (metadata.contains(QStringLiteral("meta.attr.author.markup"))) { item->setText(1, metadata.value(QStringLiteral("meta.attr.author.markup"))); metadata.remove(QStringLiteral("meta.attr.author.markup")); } else if (metadata.contains(QStringLiteral("meta.attr.artist.markup"))) { item->setText(0, i18n("Artist")); item->setData(0, Qt::UserRole, QStringLiteral("meta.attr.artist.markup")); item->setText(1, metadata.value(QStringLiteral("meta.attr.artist.markup"))); metadata.remove(QStringLiteral("meta.attr.artist.markup")); } item->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsEnabled); item = new QTreeWidgetItem(metadata_list, QStringList() << i18n("Copyright")); item->setData(0, Qt::UserRole, QStringLiteral("meta.attr.copyright.markup")); if (metadata.contains(QStringLiteral("meta.attr.copyright.markup"))) { item->setText(1, metadata.value(QStringLiteral("meta.attr.copyright.markup"))); metadata.remove(QStringLiteral("meta.attr.copyright.markup")); } item->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsEnabled); item = new QTreeWidgetItem(metadata_list, QStringList() << i18n("Year")); item->setData(0, Qt::UserRole, QStringLiteral("meta.attr.year.markup")); if (metadata.contains(QStringLiteral("meta.attr.year.markup"))) { item->setText(1, metadata.value(QStringLiteral("meta.attr.year.markup"))); metadata.remove(QStringLiteral("meta.attr.year.markup")); } else if (metadata.contains(QStringLiteral("meta.attr.date.markup"))) { item->setText(0, i18n("Date")); item->setData(0, Qt::UserRole, QStringLiteral("meta.attr.date.markup")); item->setText(1, metadata.value(QStringLiteral("meta.attr.date.markup"))); metadata.remove(QStringLiteral("meta.attr.date.markup")); } item->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsEnabled); QMap<QString, QString>::const_iterator meta = metadata.constBegin(); while (meta != metadata.constEnd()) { item = new QTreeWidgetItem(metadata_list, QStringList() << meta.key().section('.', 2,2)); item->setData(0, Qt::UserRole, meta.key()); item->setText(1, meta.value()); item->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsEnabled); ++meta; } connect(add_metadata, SIGNAL(clicked()), this, SLOT(slotAddMetadataField())); connect(delete_metadata, SIGNAL(clicked()), this, SLOT(slotDeleteMetadataField())); add_metadata->setIcon(KoIconUtils::themedIcon(QStringLiteral("list-add"))); delete_metadata->setIcon(KoIconUtils::themedIcon(QStringLiteral("list-remove"))); slotUpdateDisplay(); if (doc != NULL) { slotUpdateFiles(); connect(clear_cache, SIGNAL(clicked()), this, SLOT(slotClearCache())); connect(delete_unused, SIGNAL(clicked()), this, SLOT(slotDeleteUnused())); connect(delete_proxies, SIGNAL(clicked()), this, SLOT(slotDeleteProxies())); } else tabWidget->widget(1)->setEnabled(false); connect(profiles_list, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateDisplay())); connect(project_folder, SIGNAL(textChanged(QString)), this, SLOT(slotUpdateButton(QString))); connect(button_export, SIGNAL(clicked()), this, SLOT(slotExportToText())); // Delete unused files is not implemented delete_unused->setVisible(false); }