Move "manage project profiles" option to better place (next to profile list in...

Move "manage project profiles" option to better place (next to profile list in settings dialog and project settings)
parent d0ce81d0
......@@ -21,6 +21,7 @@
#include "profilesdialog.h"
#include "encodingprofilesdialog.h"
#include "utils/KoIconUtils.h"
#include "dialogs/profilesdialog.h"
#include "kdenlivesettings.h"
#include "renderer.h"
......@@ -264,6 +265,11 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString>& map
connect(m_configCapture.kcfg_grab_profile, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateGrabProfile()));
connect(m_configCapture.grab_showprofileinfo, SIGNAL(clicked(bool)), m_configCapture.grab_parameters, SLOT(setVisible(bool)));
// Project profile management
m_configProject.manage_profiles->setIcon(KoIconUtils::themedIcon("configure"));
m_configProject.manage_profiles->setToolTip(i18n("Manage Project Profiles"));
connect(m_configProject.manage_profiles, SIGNAL(clicked(bool)), this, SLOT(slotEditProfiles()));
// proxy profile stuff
m_configProject.proxy_showprofileinfo->setIcon(KoIconUtils::themedIcon("help-about"));
m_configProject.proxy_manageprofile->setIcon(KoIconUtils::themedIcon("configure"));
......@@ -1238,6 +1244,14 @@ void KdenliveSettingsDialog::slotReloadBlackMagic()
m_configSdl.kcfg_external_display->setEnabled(KdenliveSettings::decklink_device_found());
}
void KdenliveSettingsDialog::slotEditProfiles()
{
ProfilesDialog *w = new ProfilesDialog;
w->exec();
checkProfile();
delete w;
}
void KdenliveSettingsDialog::slotReloadShuttleDevices()
{
#ifdef USE_JOGSHUTTLE
......
......@@ -81,6 +81,7 @@ private slots:
void slotEditVideo4LinuxProfile();
void slotReloadBlackMagic();
void slotReloadShuttleDevices();
void slotEditProfiles();
private:
KPageWidgetItem *m_page1;
......
......@@ -148,6 +148,11 @@ void ProfilesDialog::accept()
if (askForSave()) QDialog::accept();
}
void ProfilesDialog::reject()
{
if (askForSave()) QDialog::reject();
}
void ProfilesDialog::closeEvent(QCloseEvent *event)
{
if (askForSave()) {
......
......@@ -87,6 +87,7 @@ private slots:
void slotSetDefaultProfile();
void slotProfileEdited();
virtual void accept();
virtual void reject();
private:
Ui::ProfilesDialog_UI m_view;
......
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="kdenlive" version="100" translationDomain="kdenlive">
<kpartgui name="kdenlive" version="101" translationDomain="kdenlive">
<ToolBar name="extraToolBar" >
<text>Extra Toolbar</text>
<Action name="project_render" />
......@@ -197,7 +197,6 @@
<ActionList name="dock_actions" />
</Menu>
<Menu name="settings" >
<Action name="manage_profiles" />
<Action name="get_new_lumas" />
<Action name="get_new_profiles" />
<Action name="get_new_mlt_profiles" />
......
......@@ -1003,7 +1003,6 @@ void MainWindow::setupActions()
addAction("zoom_in", m_zoomIn);
addAction("zoom_out", m_zoomOut);
addAction("manage_profiles", i18n("Manage Project Profiles"), this, SLOT(slotEditProfiles()), KoIconUtils::themedIcon("document-new"));
KNS3::standardAction(i18n("Download New Wipes..."), this, SLOT(slotGetNewLumaStuff()), actionCollection(), "get_new_lumas");
KNS3::standardAction(i18n("Download New Render Profiles..."), this, SLOT(slotGetNewRenderStuff()), actionCollection(), "get_new_profiles");
KNS3::standardAction(i18n("Download New Project Profiles..."), this, SLOT(slotGetNewMltProfileStuff()), actionCollection(), "get_new_mlt_profiles");
......@@ -1347,25 +1346,22 @@ void MainWindow::slotRunWizard()
delete w;
}
void MainWindow::slotEditProfiles()
void MainWindow::slotRefreshProfiles()
{
ProfilesDialog *w = new ProfilesDialog;
if (w->exec() == QDialog::Accepted) {
KdenliveSettingsDialog* d = static_cast <KdenliveSettingsDialog*>(KConfigDialog::exists("settings"));
if (d) {
d->checkProfile();
}
KdenliveSettingsDialog* d = static_cast <KdenliveSettingsDialog*>(KConfigDialog::exists("settings"));
if (d) {
d->checkProfile();
}
delete w;
}
void MainWindow::slotEditProjectSettings()
{
KdenliveDoc *project = pCore->projectManager()->current();
QPoint p = pCore->projectManager()->currentTimeline()->getTracksCount();
QPointer<ProjectSettings> w = new ProjectSettings(project, project->metadata(), pCore->projectManager()->currentTimeline()->projectView()->extractTransitionsLumas(), p.x(), p.y(), project->projectFolder().path(), true, !project->isModified(), this);
connect(w, SIGNAL(disableProxies()), this, SLOT(slotDisableProxies()));
connect(w, SIGNAL(refreshProfiles()), this, SLOT(slotRefreshProfiles()));
if (w->exec() == QDialog::Accepted) {
QString profile = w->selectedProfile();
......
......@@ -265,6 +265,8 @@ public slots:
void slotPreferences(int page = -1, int option = -1);
void connectDocument();
void slotTimelineClipSelected(ClipItem* item, bool raise = true);
/** @brief Reload project profile in config dialog if changed. */
void slotRefreshProfiles();
private slots:
/** @brief Shows the shortcut dialog. */
......@@ -277,7 +279,6 @@ private slots:
void slotUpdateMousePosition(int pos);
void slotUpdateProjectDuration(int pos);
void slotAddEffect(const QDomElement &effect);
void slotEditProfiles();
void slotEditProjectSettings();
/** @brief Turns automatic splitting of audio and video on/off. */
......
......@@ -22,6 +22,7 @@
#include "kdenlivesettings.h"
#include "core.h"
#include "doc/kdenlivedoc.h"
#include "utils/KoIconUtils.h"
#include "titler/titlewidget.h"
#include "effectslist/effectslist.h"
#include "dialogs/profilesdialog.h"
......@@ -45,23 +46,9 @@ ProjectSettings::ProjectSettings(KdenliveDoc *doc, QMap <QString, QString> metad
setupUi(this);
list_search->setTreeWidget(files_list);
QMap <QString, QString> profilesInfo = ProfilesDialog::getProfilesInfo();
QMapIterator<QString, QString> i(profilesInfo);
while (i.hasNext()) {
i.next();
profiles_list->addItem(i.key(), i.value());
}
project_folder->setMode(KFile::Directory);
project_folder->setUrl(QUrl(projectPath));
QString currentProf = KdenliveSettings::current_profile();
for (int i = 0; i < profiles_list->count(); ++i) {
if (profiles_list->itemData(i).toString() == currentProf) {
profiles_list->setCurrentIndex(i);
break;
}
}
loadProfiles();
m_buttonOk = buttonBox->button(QDialogButtonBox::Ok);
//buttonOk->setEnabled(false);
......@@ -121,9 +108,14 @@ ProjectSettings::ProjectSettings(KdenliveDoc *doc, QMap <QString, QString> metad
}
proxy_profile->setCurrentIndex(ix);
slotUpdateProxyParams();
// Project profiles
manage_profiles->setIcon(KoIconUtils::themedIcon("configure"));
manage_profiles->setToolTip(i18n("Manage Project Profiles"));
connect(manage_profiles, SIGNAL(clicked(bool)), this, SLOT(slotEditProfiles()));
// Proxy GUI stuff
proxy_showprofileinfo->setIcon(QIcon::fromTheme("help-about"));
proxy_showprofileinfo->setIcon(KoIconUtils::themedIcon("help-about"));
connect(proxy_profile, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateProxyParams()));
proxyparams->setVisible(false);
proxyparams->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 5);
......@@ -188,8 +180,8 @@ ProjectSettings::ProjectSettings(KdenliveDoc *doc, QMap <QString, QString> metad
connect(add_metadata, SIGNAL(clicked()), this, SLOT(slotAddMetadataField()));
connect(delete_metadata, SIGNAL(clicked()), this, SLOT(slotDeleteMetadataField()));
add_metadata->setIcon(QIcon::fromTheme("list-add"));
delete_metadata->setIcon(QIcon::fromTheme("list-remove"));
add_metadata->setIcon(KoIconUtils::themedIcon("list-add"));
delete_metadata->setIcon(KoIconUtils::themedIcon("list-remove"));
slotUpdateDisplay();
if (doc != NULL) {
......@@ -300,25 +292,25 @@ void ProjectSettings::slotUpdateFiles(bool cacheOnly)
// Setup categories
QTreeWidgetItem *videos = new QTreeWidgetItem(files_list, QStringList() << i18n("Video clips"));
videos->setIcon(0, QIcon::fromTheme("video-x-generic"));
videos->setIcon(0, KoIconUtils::themedIcon("video-x-generic"));
videos->setExpanded(true);
QTreeWidgetItem *sounds = new QTreeWidgetItem(files_list, QStringList() << i18n("Audio clips"));
sounds->setIcon(0, QIcon::fromTheme("audio-x-generic"));
sounds->setIcon(0, KoIconUtils::themedIcon("audio-x-generic"));
sounds->setExpanded(true);
QTreeWidgetItem *images = new QTreeWidgetItem(files_list, QStringList() << i18n("Image clips"));
images->setIcon(0, QIcon::fromTheme("image-x-generic"));
images->setIcon(0, KoIconUtils::themedIcon("image-x-generic"));
images->setExpanded(true);
QTreeWidgetItem *slideshows = new QTreeWidgetItem(files_list, QStringList() << i18n("Slideshow clips"));
slideshows->setIcon(0, QIcon::fromTheme("image-x-generic"));
slideshows->setIcon(0, KoIconUtils::themedIcon("image-x-generic"));
slideshows->setExpanded(true);
QTreeWidgetItem *texts = new QTreeWidgetItem(files_list, QStringList() << i18n("Text clips"));
texts->setIcon(0, QIcon::fromTheme("text-plain"));
texts->setIcon(0, KoIconUtils::themedIcon("text-plain"));
texts->setExpanded(true);
QTreeWidgetItem *playlists = new QTreeWidgetItem(files_list, QStringList() << i18n("Playlist clips"));
playlists->setIcon(0, QIcon::fromTheme("video-mlt-playlist"));
playlists->setIcon(0, KoIconUtils::themedIcon("video-mlt-playlist"));
playlists->setExpanded(true);
QTreeWidgetItem *others = new QTreeWidgetItem(files_list, QStringList() << i18n("Other clips"));
others->setIcon(0, QIcon::fromTheme("unknown"));
others->setIcon(0, KoIconUtils::themedIcon("unknown"));
others->setExpanded(true);
int count = 0;
QStringList allFonts;
......@@ -657,6 +649,33 @@ void ProjectSettings::slotDeleteMetadataField()
if (item) delete item;
}
void ProjectSettings::loadProfiles()
{
profiles_list->clear();
QMap <QString, QString> profilesInfo = ProfilesDialog::getProfilesInfo();
QMapIterator<QString, QString> i(profilesInfo);
while (i.hasNext()) {
i.next();
profiles_list->addItem(i.key(), i.value());
}
QString currentProf = KdenliveSettings::current_profile();
for (int i = 0; i < profiles_list->count(); ++i) {
if (profiles_list->itemData(i).toString() == currentProf) {
profiles_list->setCurrentIndex(i);
break;
}
}
}
void ProjectSettings::slotEditProfiles()
{
ProfilesDialog *w = new ProfilesDialog;
w->exec();
loadProfiles();
emit refreshProfiles();
delete w;
}
......@@ -69,15 +69,19 @@ private slots:
void slotAddMetadataField();
/** @brief Delete current metadata field. */
void slotDeleteMetadataField();
/** @brief Open project profile management dialog. */
void slotEditProfiles();
private:
QPushButton *m_buttonOk;
bool m_savedProject;
QStringList m_lumas;
void loadProfiles();
signals:
/** @brief User deleted proxies, so disable them in project. */
void disableProxies();
void refreshProfiles();
};
......
......@@ -130,6 +130,7 @@ void ProjectManager::newFile(bool showProjectSettings, bool force)
}
} else {
QPointer<ProjectSettings> w = new ProjectSettings(NULL, QMap <QString, QString> (), QStringList(), projectTracks.x(), projectTracks.y(), KdenliveSettings::defaultprojectfolder(), false, true, pCore->window());
connect(w, SIGNAL(refreshProfiles()), pCore->window(), SLOT(slotRefreshProfiles()));
if (w->exec() != QDialog::Accepted) {
delete w;
return;
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>329</width>
<height>332</height>
<width>478</width>
<height>516</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_4">
......@@ -23,6 +23,9 @@
<string>Default Profile</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="1">
<widget class="KComboBox" name="kcfg_profiles_list"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
......@@ -30,10 +33,14 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KComboBox" name="kcfg_profiles_list"/>
<item row="0" column="2">
<widget class="QToolButton" name="manage_profiles">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<item row="1" column="0" colspan="3">
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="label_5">
......@@ -93,7 +100,7 @@
</item>
</layout>
</item>
<item row="2" column="0" colspan="2">
<item row="2" column="0" colspan="3">
<widget class="QLabel" name="p_progressive">
<property name="text">
<string>Interlaced</string>
......@@ -139,7 +146,7 @@
<item row="2" column="0" colspan="5">
<widget class="QGroupBox" name="kcfg_enableproxy">
<property name="title">
<string>Proxy clips</string>
<string>Pro&amp;xy clips</string>
</property>
<property name="checkable">
<bool>true</bool>
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>364</width>
<height>555</height>
<width>498</width>
<height>786</height>
</rect>
</property>
<property name="windowTitle">
......@@ -85,6 +85,13 @@
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="manage_profiles">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
......@@ -241,7 +248,7 @@
<item row="4" column="0" colspan="4">
<widget class="QGroupBox" name="enable_proxy">
<property name="title">
<string>Proxy clips</string>
<string>Prox&amp;y clips</string>
</property>
<property name="checkable">
<bool>true</bool>
......@@ -604,6 +611,7 @@
<class>KUrlRequester</class>
<extends>QFrame</extends>
<header>kurlrequester.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment