dir.setNameFilters(filters);
QStringList result = dir.entryList(QDir::Files);
m_count = result.count();
- m_view.slide_info->setText(i18n("%1 images found", m_count));
+ m_view.slide_info->setText(i18np("1 image found", "%1 images found", m_count));
QDomElement xml = m_clip->toXML();
xml.setAttribute("resource", m_view.clip_path->text() + extension);
int width = 180.0 * KdenliveSettings::project_display_ratio();
int length = m_document->renderer()->mltGetSpaceLength(pos, m_document->tracksCount() - track, true);
//kDebug() << "// GOT LENGT; " << length;
if (length <= 0) {
- emit displayMessage(i18n("You must be in an empty space to remove space (time=%1, track:%2)", m_document->timecode().getTimecodeFromFrames(mapToScene(m_menuPosition).x()), track), ErrorMessage);
+ emit displayMessage(i18n("You must be in an empty space to remove space (time: %1, track:%2)", m_document->timecode().getTimecodeFromFrames(mapToScene(m_menuPosition).x()), track), ErrorMessage);
return;
}
resetSelectionGroup();
QList<QGraphicsItem *> itemList = items();
QUndoCommand *deleteCommand = new QUndoCommand();
- deleteCommand->setText(i18n("Delete timeline clips"));
int count = 0;
for (int i = 0; i < itemList.count(); i++) {
if (itemList.at(i)->type() == AVWIDGET) {
}
}
}
+ deleteCommand->setText(i18np("Delete timeline clip", "Delete timeline clips", count));
if (count == 0) delete deleteCommand;
else m_commandStack->push(deleteCommand);
}
}
scene()->clearSelection();
QUndoCommand *deleteSelected = new QUndoCommand();
- deleteSelected->setText(i18n("Delete selected items"));
- bool resetGroup = false;
+ bool resetGroup = false;
+ int groupCount = 0;
+ int clipCount = 0;
+ int transitionCount = 0;
// expand & destroy groups
for (int i = 0; i < itemList.count(); i++) {
if (itemList.at(i)->type() == GROUPWIDGET) {
+ groupCount++;
QList<QGraphicsItem *> children = itemList.at(i)->childItems();
itemList += children;
QList <ItemInfo> clipInfos;
for (int i = 0; i < itemList.count(); i++) {
if (itemList.at(i)->type() == AVWIDGET) {
+ clipCount++;
ClipItem *item = static_cast <ClipItem *>(itemList.at(i));
if (item->parentItem()) resetGroup = true;
//kDebug()<<"// DELETE CLP AT: "<<item->info().startPos.frames(25);
new AddTimelineClipCommand(this, item->xml(), item->clipProducer(), item->info(), item->effectList(), true, true, deleteSelected);
emit clipItemSelected(NULL);
} else if (itemList.at(i)->type() == TRANSITIONWIDGET) {
+ transitionCount++;
Transition *item = static_cast <Transition *>(itemList.at(i));
//kDebug()<<"// DELETE TRANS AT: "<<item->info().startPos.frames(25);
if (item->parentItem()) resetGroup = true;
emit transitionItemSelected(NULL);
}
}
-
+ if (groupCount > 0 && clipCount == transitionCount == 0)
+ deleteSelected->setText(i18np("Delete selected group", "Delete selected groups", groupCount));
+ else if (clipCount > 0 && groupCount == transitionCount == 0)
+ deleteSelected->setText(i18np("Delete selected clip", "Delete selected clips", clipCount));
+ else if (transitionCount > 0 && groupCount == clipCount == 0)
+ deleteSelected->setText(i18np("Delete selected transition", "Delete selected transitions", transitionCount));
+ else deleteSelected->setText(i18n("Delete selected items"));
m_commandStack->push(deleteSelected);
}
void DocumentChecker::slotDeleteSelected()
{
- if (KMessageBox::warningContinueCancel(this, i18n("This will remove the selected clips from this project"), i18n("Remove clips")) == KMessageBox::Cancel) return;
+ if (KMessageBox::warningContinueCancel(this, i18np("This will remove the selected clip from this project", "This will remove the selected clips from this project", treeWidget->selectedItems().count()), i18n("Remove clips")) == KMessageBox::Cancel) return;
int ix = 0;
QStringList deletedIds;
QTreeWidgetItem *child = treeWidget->topLevelItem(ix);
if (m_renderWidget) {
int waitingJobs = m_renderWidget->waitingJobsCount();
if (waitingJobs > 0) {
- switch (KMessageBox::warningYesNoCancel(this, i18n("You have %1 rendering jobs waiting in the queue.\nWhat do you want to do with these jobs?", waitingJobs), QString(), KGuiItem(i18n("Start them now")), KGuiItem(i18n("Delete them")))) {
+ switch (KMessageBox::warningYesNoCancel(this, i18np("You have 1 rendering job waiting in the queue.\nWhat do you want to do with this job?", "You have %1 rendering jobs waiting in the queue.\nWhat do you want to do with these jobs?", waitingJobs), QString(), KGuiItem(i18n("Start them now")), KGuiItem(i18n("Delete them")))) {
case KMessageBox::Yes :
// create script with waiting jobs and start it
if (m_renderWidget->startWaitingRenderJobs() == false) return false;
profileName = KdenliveSettings::default_profile();
projectFolder = KdenliveSettings::defaultprojectfolder();
} else {
- ProjectSettings *w = new ProjectSettings(projectTracks.x(), projectTracks.y(), KdenliveSettings::defaultprojectfolder(), false, this);
+ ProjectSettings *w = new ProjectSettings(projectTracks.x(), projectTracks.y(), KdenliveSettings::defaultprojectfolder(), false, true, this);
if (w->exec() != QDialog::Accepted) return;
if (!KdenliveSettings::activatetabs()) closeCurrentDocument();
KdenliveSettings::setVideothumbnails(w->enableVideoThumbs());
void MainWindow::slotEditProjectSettings()
{
QPoint p = m_activeDocument->getTracksCount();
- ProjectSettings *w = new ProjectSettings(p.x(), p.y(), m_activeDocument->projectFolder().path(), true, this);
+ ProjectSettings *w = new ProjectSettings(p.x(), p.y(), m_activeDocument->projectFolder().path(), true, !m_activeDocument->isModified(), this);
if (w->exec() == QDialog::Accepted) {
QString profile = w->selectedProfile();
//m_activeDocument->clipManager()->resetProducersList(m_projectMonitor->render->producersList());
if (dar != m_activeDocument->dar()) m_projectList->reloadClipThumbnails();
if (updateFps) m_activeTimeline->updateProjectFps();
-
+ m_activeDocument->setModified(true);
+ m_commandStack->activeStack()->clear();
// We need to desactivate & reactivate monitors to get a refresh
//m_monitorManager->switchMonitors();
}
if (KMessageBox::questionYesNo(this, i18np("Delete clip <b>%2</b>?<br>This will also remove the clip in timeline", "Delete clip <b>%2</b>?<br>This will also remove its %1 clips in timeline", item->numReferences(), item->names().at(1)), i18n("Delete Clip")) != KMessageBox::Yes) return;
} else if (item->isGroup() && item->childCount() > 0) {
int children = item->childCount();
- if (KMessageBox::questionYesNo(this, i18n("Delete folder <b>%2</b>?<br>This will also remove the %1 clips in that folder", children, item->names().at(1)), i18n("Delete Folder")) != KMessageBox::Yes) return;
+ if (KMessageBox::questionYesNo(this, i18np("Delete folder <b>%2</b>?<br>This will also remove the clip in that folder", "Delete folder <b>%2</b>?<br>This will also remove the %1 clips in that folder", children, item->names().at(1)), i18n("Delete Folder")) != KMessageBox::Yes) return;
for (int i = 0; i < children; ++i) {
ProjectItem *child = static_cast <ProjectItem *>(item->child(i));
ids << child->clipId();
#include "profilesdialog.h"
#include <KStandardDirs>
+#include <KMessageBox>
#include <KDebug>
#include <QDir>
+#include <kmessagebox.h>
-ProjectSettings::ProjectSettings(int videotracks, int audiotracks, const QString projectPath, bool readOnlyTracks, QWidget * parent) :
- QDialog(parent)
+ProjectSettings::ProjectSettings(int videotracks, int audiotracks, const QString projectPath, bool readOnlyTracks, bool savedProject, QWidget * parent) :
+ QDialog(parent), m_savedProject(savedProject)
{
- m_view.setupUi(this);
+ setupUi(this);
QMap <QString, QString> profilesInfo = ProfilesDialog::getProfilesInfo();
QMapIterator<QString, QString> i(profilesInfo);
while (i.hasNext()) {
i.next();
- m_view.profiles_list->addItem(i.key(), i.value());
+ profiles_list->addItem(i.key(), i.value());
}
- m_view.project_folder->setMode(KFile::Directory);
- m_view.project_folder->setPath(projectPath);
+ project_folder->setMode(KFile::Directory);
+ project_folder->setUrl(KUrl(projectPath));
QString currentProf = KdenliveSettings::current_profile();
- for (int i = 0; i < m_view.profiles_list->count(); i++) {
- if (m_view.profiles_list->itemData(i).toString() == currentProf) {
- m_view.profiles_list->setCurrentIndex(i);
+ for (int i = 0; i < profiles_list->count(); i++) {
+ if (profiles_list->itemData(i).toString() == currentProf) {
+ profiles_list->setCurrentIndex(i);
break;
}
}
- m_buttonOk = m_view.buttonBox->button(QDialogButtonBox::Ok);
+ m_buttonOk = buttonBox->button(QDialogButtonBox::Ok);
//buttonOk->setEnabled(false);
- m_view.audio_thumbs->setChecked(KdenliveSettings::audiothumbnails());
- m_view.video_thumbs->setChecked(KdenliveSettings::videothumbnails());
- m_view.audio_tracks->setValue(audiotracks);
- m_view.video_tracks->setValue(videotracks);
+ audio_thumbs->setChecked(KdenliveSettings::audiothumbnails());
+ video_thumbs->setChecked(KdenliveSettings::videothumbnails());
+ audio_tracks->setValue(audiotracks);
+ video_tracks->setValue(videotracks);
if (readOnlyTracks) {
- m_view.video_tracks->setEnabled(false);
- m_view.audio_tracks->setEnabled(false);
+ video_tracks->setEnabled(false);
+ audio_tracks->setEnabled(false);
}
slotUpdateDisplay();
- connect(m_view.profiles_list, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateDisplay()));
- connect(m_view.project_folder, SIGNAL(textChanged(const QString &)), this, SLOT(slotUpdateButton(const QString &)));
+ connect(profiles_list, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateDisplay()));
+ connect(project_folder, SIGNAL(textChanged(const QString &)), this, SLOT(slotUpdateButton(const QString &)));
}
+void ProjectSettings::accept()
+{
+ if (!m_savedProject && selectedProfile() != KdenliveSettings::current_profile())
+ if (KMessageBox::warningContinueCancel(this, i18n("Changing the profile of your project cannot be undone.\nIt is recommended to save your project before attempting this operation that might cause some corruption in transitions.\n Are you sure you want to proceed?"), i18n("Confirm profile change")) == KMessageBox::Cancel) return;
+ QDialog::accept();
+}
void ProjectSettings::slotUpdateDisplay()
{
- QString currentProfile = m_view.profiles_list->itemData(m_view.profiles_list->currentIndex()).toString();
+ QString currentProfile = profiles_list->itemData(profiles_list->currentIndex()).toString();
QMap< QString, QString > values = ProfilesDialog::getSettingsFromFile(currentProfile);
- m_view.p_size->setText(values.value("width") + 'x' + values.value("height"));
- m_view.p_fps->setText(values.value("frame_rate_num") + '/' + values.value("frame_rate_den"));
- m_view.p_aspect->setText(values.value("sample_aspect_num") + '/' + values.value("sample_aspect_den"));
- m_view.p_display->setText(values.value("display_aspect_num") + '/' + values.value("display_aspect_den"));
- if (values.value("progressive").toInt() == 0) m_view.p_progressive->setText(i18n("Interlaced"));
- else m_view.p_progressive->setText(i18n("Progressive"));
+ p_size->setText(values.value("width") + 'x' + values.value("height"));
+ p_fps->setText(values.value("frame_rate_num") + '/' + values.value("frame_rate_den"));
+ p_aspect->setText(values.value("sample_aspect_num") + '/' + values.value("sample_aspect_den"));
+ p_display->setText(values.value("display_aspect_num") + '/' + values.value("display_aspect_den"));
+ if (values.value("progressive").toInt() == 0) p_progressive->setText(i18n("Interlaced"));
+ else p_progressive->setText(i18n("Progressive"));
}
void ProjectSettings::slotUpdateButton(const QString &path)
QString ProjectSettings::selectedProfile() const
{
- return m_view.profiles_list->itemData(m_view.profiles_list->currentIndex()).toString();
+ return profiles_list->itemData(profiles_list->currentIndex()).toString();
}
KUrl ProjectSettings::selectedFolder() const
{
- return m_view.project_folder->url();
+ return project_folder->url();
}
QPoint ProjectSettings::tracks()
{
QPoint p;
- p.setX(m_view.video_tracks->value());
- p.setY(m_view.audio_tracks->value());
+ p.setX(video_tracks->value());
+ p.setY(audio_tracks->value());
return p;
}
bool ProjectSettings::enableVideoThumbs() const
{
- return m_view.video_thumbs->isChecked();
+ return video_thumbs->isChecked();
}
bool ProjectSettings::enableAudioThumbs() const
{
- return m_view.audio_thumbs->isChecked();
+ return audio_thumbs->isChecked();
}
#include "projectsettings.moc"
#include "ui_projectsettings_ui.h"
-class ProjectSettings : public QDialog
+class ProjectSettings : public QDialog, public Ui::ProjectSettings_UI
{
Q_OBJECT
public:
- ProjectSettings(int videotracks, int audiotracks, const QString projectPath, bool readOnlyTracks, QWidget * parent = 0);
+ ProjectSettings(int videotracks, int audiotracks, const QString projectPath, bool readOnlyTracks, bool unsavedProject, QWidget * parent = 0);
QString selectedProfile() const;
KUrl selectedFolder() const;
QPoint tracks();
bool enableVideoThumbs() const;
bool enableAudioThumbs() const;
+public slots:
+ virtual void accept();
+
private slots:
void slotUpdateDisplay();
void slotUpdateButton(const QString &path);
private:
- Ui::ProjectSettings_UI m_view;
QPushButton *m_buttonOk;
+ bool m_savedProject;
};
tractor.setAttribute("out", out);
emit durationChanged(out);
- kDebug() << "///////////////////////////// " << out << " \n" << doc.toString() << "\n-------------------------";
+ //kDebug() << "///////////////////////////// " << out << " \n" << doc.toString() << "\n-------------------------";
return doc.toString();
}
m_count = result.count();
if (m_count == 0) m_view.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
else m_view.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
- m_view.label_info->setText(i18n("%1 images found", m_count));
+ m_view.label_info->setText(i18np("1 image found", "%1 images found", m_count));
QListWidgetItem *item;
int i = 0;
KIcon unknownicon("unknown");