#include <KNotifyConfigWidget>
#include <knewstuff2/engine.h>
#include <knewstuff2/ui/knewstuffaction.h>
+#include <KToolBar>
#include <QTextStream>
#include <QTimer>
setupGUI();
+
/*ScriptingPart* sp = new ScriptingPart(this, QStringList());
guiFactory()->addClient(sp);*/
if (m_clipMonitor) m_clipMonitor->stop();
delete m_effectStack;
delete m_activeTimeline;
+#ifndef Q_WS_MAC
+ // This sometimes causes crash on exit on OS X for some reason.
delete m_projectMonitor;
delete m_clipMonitor;
+#endif
delete m_activeDocument;
delete m_shortcutRemoveFocus;
Mlt::Factory::close();
void MainWindow::slotReloadEffects()
{
- kDebug()<<"START RELOAD; COUNR: "<<m_customEffectsMenu->actions().count();
+ kDebug() << "START RELOAD; COUNR: " << m_customEffectsMenu->actions().count();
m_customEffectsMenu->clear();
- kDebug()<<"START RELOAD; CLR: "<<m_customEffectsMenu->actions().count();
+ kDebug() << "START RELOAD; CLR: " << m_customEffectsMenu->actions().count();
initEffects::parseCustomEffectsFile();
const QStringList effects = customEffects.effectNames();
- kDebug()<<"NEW EFFS: "<<effects;
+ kDebug() << "NEW EFFS: " << effects;
QAction *action;
if (effects.isEmpty()) m_customEffectsMenu->setEnabled(false);
else m_customEffectsMenu->setEnabled(true);
m_statusProgressBar->setMaximumWidth(150);
m_statusProgressBar->setVisible(false);
- QWidget *w = new QWidget;
-
- QHBoxLayout *layout = new QHBoxLayout;
- w->setLayout(layout);
- layout->setContentsMargins(5, 0, 5, 0);
- QToolBar *toolbar = new QToolBar("statusToolBar", this);
-
-
+ KToolBar *toolbar = new KToolBar("statusToolBar", this, Qt::BottomToolBarArea);
+ toolbar->setMovable(false);
m_toolGroup = new QActionGroup(this);
-
- QString style1 = "QToolButton {background-color: rgba(230, 230, 230, 220); border-style: inset; border:1px solid #999999;border-radius: 3px;margin: 0px 3px;padding: 0px;} QToolButton:checked { background-color: rgba(224, 224, 0, 100); border-style: inset; border:1px solid #cc6666;border-radius: 3px;}";
+ statusBar()->setStyleSheet(QString("QStatusBar QLabel {font-size:%1pt;} QStatusBar::item { border: 0px; font-size:%1pt;padding:0px; }").arg(statusBar()->font().pointSize()));
+ QString style1 = "QToolBar { border: 0px } QToolButton {background-color: rgba(230, 230, 230, 220); border-style: inset; border:1px solid #999999;border-radius: 3px;margin: 0px 3px;padding: 0px;} QToolButton:checked { background-color: rgba(224, 224, 0, 100); border-style: inset; border:1px solid #cc6666;border-radius: 3px;}";
m_buttonSelectTool = new KAction(KIcon("kdenlive-select-tool"), i18n("Selection tool"), this);
m_buttonSelectTool->setShortcut(i18nc("Selection tool shortcut", "s"));
toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly);
QWidget * actionWidget;
+ int max = toolbar->iconSizeDefault() + 2;
actionWidget = toolbar->widgetForAction(m_buttonSelectTool);
- actionWidget->setMaximumWidth(24);
- actionWidget->setMinimumHeight(18);
+ actionWidget->setMaximumWidth(max);
+ actionWidget->setMaximumHeight(max - 4);
actionWidget = toolbar->widgetForAction(m_buttonRazorTool);
- actionWidget->setMaximumWidth(24);
- actionWidget->setMinimumHeight(18);
+ actionWidget->setMaximumWidth(max);
+ actionWidget->setMaximumHeight(max - 4);
actionWidget = toolbar->widgetForAction(m_buttonSpacerTool);
- actionWidget->setMaximumWidth(24);
- actionWidget->setMinimumHeight(18);
+ actionWidget->setMaximumWidth(max);
+ actionWidget->setMaximumHeight(max - 4);
toolbar->setStyleSheet(style1);
connect(m_toolGroup, SIGNAL(triggered(QAction *)), this, SLOT(slotChangeTool(QAction *)));
connect(m_buttonFitZoom, SIGNAL(triggered()), this, SLOT(slotFitZoom()));
actionWidget = toolbar->widgetForAction(m_buttonFitZoom);
- actionWidget->setMaximumWidth(24);
- actionWidget->setMinimumHeight(18);
+ actionWidget->setMaximumWidth(max);
+ actionWidget->setMaximumHeight(max - 4);
m_zoomSlider = new QSlider(Qt::Horizontal, this);
m_zoomSlider->setMaximum(13);
m_zoomSlider->setMaximumWidth(150);
m_zoomSlider->setMinimumWidth(100);
-
-#ifdef Q_WS_MAC
- const int contentHeight = QFontMetrics(w->font()).height() + 14;
-#else
- const int contentHeight = QFontMetrics(w->font()).height() + 8;
-#endif
-
- QString style = "QSlider::groove:horizontal { background-color: rgba(230, 230, 230, 220);border: 1px solid #999999;height: 8px;border-radius: 3px;margin-top:3px }";
- style.append("QSlider::handle:horizontal { background-color: white; border: 1px solid #999999;width: 9px;margin: -2px 0;border-radius: 3px; }");
-
- m_zoomSlider->setStyleSheet(style);
-
- //m_zoomSlider->height() + 5;
- statusBar()->setMinimumHeight(contentHeight);
-
-
toolbar->addWidget(m_zoomSlider);
m_buttonVideoThumbs = new KAction(KIcon("kdenlive-show-videothumb"), i18n("Show video thumbnails"), this);
m_buttonSnap->setCheckable(true);
m_buttonSnap->setChecked(KdenliveSettings::snaptopoints());
connect(m_buttonSnap, SIGNAL(triggered()), this, SLOT(slotSwitchSnap()));
- layout->addWidget(toolbar);
-
actionWidget = toolbar->widgetForAction(m_buttonVideoThumbs);
- actionWidget->setMaximumWidth(24);
- actionWidget->setMinimumHeight(18);
+ actionWidget->setMaximumWidth(max);
+ actionWidget->setMaximumHeight(max - 4);
actionWidget = toolbar->widgetForAction(m_buttonAudioThumbs);
- actionWidget->setMaximumWidth(24);
- actionWidget->setMinimumHeight(18);
+ actionWidget->setMaximumWidth(max);
+ actionWidget->setMaximumHeight(max - 4);
actionWidget = toolbar->widgetForAction(m_buttonShowMarkers);
- actionWidget->setMaximumWidth(24);
- actionWidget->setMinimumHeight(18);
+ actionWidget->setMaximumWidth(max);
+ actionWidget->setMaximumHeight(max - 4);
actionWidget = toolbar->widgetForAction(m_buttonSnap);
- actionWidget->setMaximumWidth(24);
- actionWidget->setMinimumHeight(18);
+ actionWidget->setMaximumWidth(max);
+ actionWidget->setMaximumHeight(max - 4);
m_messageLabel = new StatusBarMessageLabel(this);
m_messageLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::MinimumExpanding);
statusBar()->addWidget(m_messageLabel, 10);
statusBar()->addWidget(m_statusProgressBar, 0);
- statusBar()->addPermanentWidget(w);
+ statusBar()->addPermanentWidget(toolbar);
statusBar()->insertPermanentFixedItem("00:00:00:00", ID_TIMELINE_POS);
statusBar()->addPermanentWidget(m_timecodeFormat);
- statusBar()->setMaximumHeight(statusBar()->font().pointSize() * 4);
+ //statusBar()->setMaximumHeight(statusBar()->font().pointSize() * 3);
collection->addAction("select_tool", m_buttonSelectTool);
collection->addAction("razor_tool", m_buttonRazorTool);
m_effectStack->slotClipItemSelected(NULL, 0);
m_transitionConfig->slotTransitionItemSelected(NULL, 0, QPoint(), false);
m_clipMonitor->slotSetXml(NULL, 0);
- m_activeDocument->setProfilePath(profile);
+ bool updateFps = m_activeDocument->setProfilePath(profile);
KdenliveSettings::setCurrent_profile(profile);
KdenliveSettings::setProject_fps(m_activeDocument->fps());
setCaption(m_activeDocument->description(), m_activeDocument->isModified());
m_timelineArea->setTabText(m_timelineArea->currentIndex(), m_activeDocument->description());
//m_activeDocument->clipManager()->resetProducersList(m_projectMonitor->render->producersList());
if (dar != m_activeDocument->dar()) m_projectList->reloadClipThumbnails();
- m_activeTimeline->updateProjectFps();
+ if (updateFps) m_activeTimeline->updateProjectFps();
// We need to desactivate & reactivate monitors to get a refresh
//m_monitorManager->switchMonitors();
{
if (clip->clipType() == TEXT) {
QString titlepath = m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash) + "titles/";
- if (!clip->getProperty("xmltemplate").isEmpty()) {
+ if (!clip->getProperty("resource").isEmpty() && clip->getProperty("xmldata").isEmpty()) {
// template text clip
// Get the list of existing templates
Ui::TemplateClip_UI dia_ui;
dia_ui.setupUi(dia);
int ix = -1;
- const QString templatePath = clip->getProperty("xmltemplate");
+ const QString templatePath = clip->getProperty("resource");
for (int i = 0; i < templateFiles.size(); ++i) {
dia_ui.template_list->comboBox()->addItem(templateFiles.at(i), titlepath + templateFiles.at(i));
if (templatePath == KUrl(titlepath + templateFiles.at(i)).path()) ix = i;
KUrl startDir(titlepath);
dia_ui.template_list->fileDialog()->setUrl(startDir);
dia_ui.description->setText(clip->getProperty("description"));
- dia_ui.clone_clip->setChecked(true);
if (dia->exec() == QDialog::Accepted) {
QString textTemplate = dia_ui.template_list->comboBox()->itemData(dia_ui.template_list->comboBox()->currentIndex()).toString();
if (textTemplate.isEmpty()) textTemplate = dia_ui.template_list->comboBox()->currentText();
if (KUrl(textTemplate).path() != templatePath) {
// The template was changed
- newprops.insert("xmltemplate", textTemplate);
+ newprops.insert("resource", textTemplate);
}
if (dia_ui.description->toPlainText() != clip->getProperty("description")) {
// template modified we need to update xmldata
QString description = newprops.value("description");
if (description.isEmpty()) description = clip->getProperty("description");
- newprops.insert("xmldata", m_projectList->generateTemplateXml(newtemplate, description).toString());
- if (dia_ui.normal_clip->isChecked()) {
- // Switch clip to normal clip
- newprops.insert("xmltemplate", QString());
- }
+ else newprops.insert("templatetext", description);
+ //newprops.insert("xmldata", m_projectList->generateTemplateXml(newtemplate, description).toString());
+
EditClipCommand *command = new EditClipCommand(m_projectList, clip->getId(), clip->properties(), newprops, true);
m_activeDocument->commandStack()->push(command);
}
doc.setContent(clip->getProperty("xmldata"));
dia_ui->setXml(doc);
if (dia_ui->exec() == QDialog::Accepted) {
- QRect rect = dia_ui->renderedRect();
QMap <QString, QString> newprops;
newprops.insert("xmldata", dia_ui->xml().toString());
newprops.insert("out", QString::number(dia_ui->duration()));
- newprops.insert("frame_size", QString::number(rect.width()) + 'x' + QString::number(rect.height()));
EditClipCommand *command = new EditClipCommand(m_projectList, clip->getId(), clip->properties(), newprops, true);
m_activeDocument->commandStack()->push(command);
m_activeTimeline->projectView()->slotUpdateClip(clip->getId());