- Start documenting code.
- Reindent and cleanup.
svn path=/trunk/kdenlive/; revision=4432
if (par.attribute("opacity") == "false") {
label_opacity->setHidden(true);
spinTransp->setHidden(true);
- } else if(par.attribute("opacity") == "nonzero") {
+ } else if (par.attribute("opacity") == "nonzero") {
spinTransp->setMinimum(1);
}
char *tmp = (char *) qstrdup(val.toUtf8().data());
aboutData.addAuthor(ki18n("Ray Lehtiniemi"), ki18n("Bug fixing, etc."), "rayl@mail.com");
aboutData.addAuthor(ki18n("Dan Dennedy"), ki18n("Bug fixing, etc."), "dan@dennedy.org");
aboutData.addAuthor(ki18n("Simon A. Eugster"), ki18n("Bug fixing, etc."), "simon.eu@gmail.com");
- aboutData.addAuthor(ki18n("Alberto Villa"), ki18n("Bug fixing, logo, etc."), "avilla@FreeBSD.org");
+ aboutData.addAuthor(ki18n("Alberto Villa"), ki18n("Bug fixing, logo, etc."), "avilla@FreeBSD.org");
aboutData.addAuthor(ki18n("Jason Wood"), ki18n("Original KDE 3 version author (not active anymore)"), "jasonwood@blueyonder.co.uk");
aboutData.setHomepage("http://kdenlive.org");
aboutData.setCustomAuthorText(ki18n("Please report bugs to http://kdenlive.org/mantis"), ki18n("Please report bugs to <a href=\"http://kdenlive.org/mantis\">http://kdenlive.org/mantis</a>"));
}
}
-
void MainWindow::parseProfiles(const QString &mltPath)
{
- // kDebug()<<" + + YOUR MLT INSTALL WAS FOUND IN: "<< MLT_PREFIX <<endl;
-
//KdenliveSettings::setDefaulttmpfolder();
if (!mltPath.isEmpty()) {
KdenliveSettings::setMltpath(mltPath + "/share/mlt/profiles/");
if (KdenliveSettings::mltpath().isEmpty()) {
KdenliveSettings::setMltpath(QString(MLT_PREFIX) + QString("/share/mlt/profiles/"));
}
+
if (KdenliveSettings::rendererpath().isEmpty() || KdenliveSettings::rendererpath().endsWith("inigo")) {
QString meltPath = QString(MLT_PREFIX) + QString("/bin/melt");
if (!QFile::exists(meltPath))
meltPath = KStandardDirs::findExe("melt");
KdenliveSettings::setRendererpath(meltPath);
}
+
+ if (KdenliveSettings::rendererpath().isEmpty()) {
+ // Cannot find the MLT melt renderer, ask for location
+ KUrlRequesterDialog *getUrl = new KUrlRequesterDialog(QString(), i18n("Cannot find the melt program required for rendering (part of MLT)"), this);
+ if (getUrl->exec() == QDialog::Rejected) {
+ ::exit(0);
+ }
+ KUrl rendererPath = getUrl->selectedUrl();
+ delete getUrl;
+ if (rendererPath.isEmpty()) ::exit(0);
+ KdenliveSettings::setRendererpath(rendererPath.path());
+ }
+
QStringList profilesFilter;
profilesFilter << "*";
QStringList profilesList = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
-
if (profilesList.isEmpty()) {
// Cannot find MLT path, try finding melt
QString profilePath = KdenliveSettings::rendererpath();
if (!profilePath.isEmpty()) {
profilePath = profilePath.section('/', 0, -3);
KdenliveSettings::setMltpath(profilePath + "/share/mlt/profiles/");
- QStringList profilesList = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
+ profilesList = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
}
-
if (profilesList.isEmpty()) {
// Cannot find the MLT profiles, ask for location
- KUrlRequesterDialog *getUrl = new KUrlRequesterDialog(KdenliveSettings::mltpath(), i18n("Cannot find your Mlt profiles, please give the path"), this);
+ KUrlRequesterDialog *getUrl = new KUrlRequesterDialog(KdenliveSettings::mltpath(), i18n("Cannot find your MLT profiles, please give the path"), this);
getUrl->fileDialog()->setMode(KFile::Directory);
if (getUrl->exec() == QDialog::Rejected) {
::exit(0);
delete getUrl;
if (mltPath.isEmpty()) ::exit(0);
KdenliveSettings::setMltpath(mltPath.path(KUrl::AddTrailingSlash));
- QStringList profilesList = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
- }
- }
-
- if (KdenliveSettings::rendererpath().isEmpty()) {
- // Cannot find the MLT melt renderer, ask for location
- KUrlRequesterDialog *getUrl = new KUrlRequesterDialog(QString(), i18n("Cannot find the melt program required for rendering (part of Mlt)"), this);
- if (getUrl->exec() == QDialog::Rejected) {
- ::exit(0);
+ profilesList = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
}
- KUrl rendererPath = getUrl->selectedUrl();
- delete getUrl;
- if (rendererPath.isEmpty()) ::exit(0);
- KdenliveSettings::setRendererpath(rendererPath.path());
}
kDebug() << "RESULTING MLT PATH: " << KdenliveSettings::mltpath();
- // Parse MLT profiles to build a list of available video formats
+ // Parse again MLT profiles to build a list of available video formats
if (profilesList.isEmpty()) parseProfiles();
}
/** Gets called when the window gets hidden */
void MainWindow::hideEvent(QHideEvent */*event*/)
{
- // kDebug() << "I was hidden";
- // issue http://www.kdenlive.org/mantis/view.php?id=231
- if (isMinimized()) {
- // kDebug() << "I am minimized";
- if (m_monitorManager) m_monitorManager->stopActiveMonitor();
- }
+ if (isMinimized())
+ if (m_monitorManager)
+ m_monitorManager->stopActiveMonitor();
}
bool MainWindow::eventFilter(QObject *obj, QEvent *event)
Q_CLASSINFO("D-Bus Interface", "org.kdenlive.MainWindow")
public:
- /** Constructor
- * \param MltPath path to MLT environment
- * \param Url Url to open
- * \param parent Std. widget parent
+
+ /** @brief Initialises the main window.
+ * @param MltPath (optional) path to MLT environment
+ * @param Url (optional) file to open
+ *
+ * If Url is present, it will be opened, otherwhise, if openlastproject is
+ * set, latest project will be opened. If no file is open after trying this,
+ * a default new file will be created. */
+ explicit MainWindow(const QString &MltPath = QString(),
+ const KUrl &Url = KUrl(), QWidget *parent = 0);
+
+ /** @brief Locates the MLT environment.
+ * @param mltPath (optional) path to MLT environment
*
- * The constructor inits the main window. If Url is present, it will be opened.
- * If Url is not present, and openLastproject is set, last project will be set
- * If no file is open after trying this, a default "newfile" will be created. */
- explicit MainWindow(const QString &MltPath = QString(), const KUrl & Url = KUrl(), QWidget *parent = 0);
+ * It tries to set the paths of the MLT profiles and renderer, using
+ * mltPath, MLT_PREFIX, searching for the binary `melt`, or asking to the
+ * user. It doesn't fill any list of profiles, while its name suggests so. */
void parseProfiles(const QString &mltPath = QString());
static EffectsList videoEffects;
static EffectsList customEffects;
static EffectsList transitions;
protected:
+
+ /** @brief Closes the window.
+ * @return false if the user presses "Cancel" on a confirmation dialog or
+ * the operation requested (starting waiting jobs or saving file) fails,
+ * true otherwise */
virtual bool queryClose();
- virtual void customEvent(QEvent * e);
+
+ /** @brief Reports a message in the status bar when an error occurs. */
+ virtual void customEvent(QEvent *e);
+
+ /** @brief Enables live search in the timeline. */
virtual void keyPressEvent(QKeyEvent *ke);
- /** Override hideEvent to get events when the mainwindow gets hidden */
+
+ /** @brief Stops the active monitor when the window gets hidden. */
virtual void hideEvent(QHideEvent *e);
+
+ /** @brief Filters key events to the live search. */
bool eventFilter(QObject *obj, QEvent *ev);
- /**
- * This function is called when it is time for the app to save its
- * properties for session management purposes.
- */
+
+ /** @brief Saves the file and the window properties when saving the session. */
virtual void saveProperties(KConfigGroup &config);
- /**
- * This function is called when this app is restored. The KConfig
- * object points to the session management config file that was saved
- * with @ref saveProperties
- */
+ /** @brief Restores the window and the file when a session is loaded. */
virtual void readProperties(const KConfigGroup &config);
private:
QMenu *m_timelineContextTransitionMenu;
KUrl m_startUrl;
- /**
- * Shortcut to remove the focus of any element. Allows to get out
- * of e.g. text input fields and to press another shortcut.
- */
+ /** @brief Shortcut to remove the focus from any element.
+ *
+ * It allows to get out of e.g. text input fields and to press another
+ * shortcut. */
QShortcut* m_shortcutRemoveFocus;
RenderWidget *m_renderWidget;
void slotRevert();
void slotShutdown();
void slotUpdateTrackInfo();
- /** \brief Change color scheme */
+ /** @brief Changes the color scheme. */
void slotChangePalette(QAction *action, const QString &themename = QString());
void slotSwitchMonitors();
void slotCheckRenderStatus();