]> git.sesse.net Git - kdenlive/blobdiff - src/mainwindow.h
Fix issue 254: starting up with project supplied on CLI should not result in 'Untitle...
[kdenlive] / src / mainwindow.h
index dc10b89b6148d05204d1b77ed1de77f6d99c92a1..f629ce8d007562389b7109dbdf0cb0b101836284 100644 (file)
@@ -53,7 +53,9 @@ class Monitor;
 class RecMonitor;
 class CustomTrackView;
 class RenderWidget;
+#ifndef NO_JOGSHUTTLE
 class JogShuttle;
+#endif /* NO_JOGSHUTTLE */
 class DocClipBase;
 class Render;
 
@@ -61,8 +63,16 @@ class MainWindow : public KXmlGuiWindow {
     Q_OBJECT
 
 public:
-    MainWindow(QWidget *parent = 0);
-    void parseProfiles();
+    /** Constructor
+     * \param MltPath path to MLT environment
+     * \param Url Url to open
+     * \param parent Std. widget parent
+     *
+     * 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. */
+    MainWindow(const QString &MltPath = QString(), const KUrl & Url = KUrl(), QWidget *parent = 0);
+    void parseProfiles(const QString &mltPath = QString());
 
     static EffectsList videoEffects;
     static EffectsList audioEffects;
@@ -72,6 +82,8 @@ protected:
     virtual bool queryClose();
     virtual void customEvent(QEvent * e);
     virtual void keyPressEvent(QKeyEvent *ke);
+    /** Override hideEvent to get events when the mainwindow gets hidden */
+    virtual void hideEvent(QHideEvent *e);
     bool eventFilter(QObject *obj, QEvent *ev);
     /**
      * This function is called when it is time for the app to save its
@@ -132,21 +144,24 @@ private:
 
     RenderWidget *m_renderWidget;
 
+#ifndef NO_JOGSHUTTLE
     JogShuttle *m_jogProcess;
+#endif /* NO_JOGSHUTTLE */
 
     KRecentFilesAction *m_fileOpenRecent;
     KAction *m_projectSearch;
     KAction *m_projectSearchNext;
 
-    QAction *m_buttonAudioThumbs;
-    QAction *m_buttonVideoThumbs;
-    QAction *m_buttonShowMarkers;
-    QAction *m_buttonFitZoom;
-    QAction *m_buttonSelectTool;
-    QAction *m_buttonRazorTool;
-    QAction *m_buttonSnap;
+    KAction *m_buttonAudioThumbs;
+    KAction *m_buttonVideoThumbs;
+    KAction *m_buttonShowMarkers;
+    KAction *m_buttonFitZoom;
+    KAction *m_buttonSelectTool;
+    KAction *m_buttonRazorTool;
+    KAction *m_buttonSnap;
     QActionGroup *m_toolGroup;
-    QAction *m_saveAction;
+    KAction *m_saveAction;
+    KAction *m_closeAction;
     QSlider *m_zoomSlider;
     StatusBarMessageLabel *m_messageLabel;
 
@@ -157,8 +172,10 @@ private:
 
     void readOptions();
     void saveOptions();
+#ifndef NO_JOGSHUTTLE
     void activateShuttleDevice();
     void slotShuttleAction(int code);
+#endif /* NO_JOGSHUTTLE */
     void connectDocumentInfo(KdenliveDoc *doc);
     void findAhead();
     void doOpenFile(const KUrl &url, KAutoSaveFile *stale);
@@ -169,7 +186,7 @@ public slots:
     void slotGotProgressInfo(const QString &message, int progress);
 
 private slots:
-    void newFile();
+    void newFile(bool showProjectSettings = true);
     void queryQuit();
     void activateDocument();
     void connectDocument(TrackView*, KdenliveDoc*);
@@ -211,7 +228,9 @@ private slots:
     void slotAddCustomEffect(QAction *result);
     void slotAddTransition(QAction *result);
     void slotAddProjectClip(KUrl url);
+#ifndef NO_JOGSHUTTLE
     void slotShuttleButton(int code);
+#endif /* NO_JOGSHUTTLE */
     void slotShowClipProperties(DocClipBase *clip);
     void slotActivateEffectStackView();
     void slotActivateTransitionView();
@@ -243,6 +262,7 @@ private slots:
 
     void slotSetInPoint();
     void slotSetOutPoint();
+    void configureNotifications();
 };