MainWindow.h 4.13 KB
Newer Older
Ludovic Fauvet's avatar
Ludovic Fauvet committed
1
/*****************************************************************************
2
 * MainWindow.h: VLMC MainWindow
Ludovic Fauvet's avatar
Ludovic Fauvet committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
 *****************************************************************************
 * Copyright (C) 2008-2009 the VLMC team
 *
 * Authors: Ludovic Fauvet <etix@l0cal.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QApplication>
27
#include <QSlider>
28 29
#include <QToolButton>
#include <QButtonGroup>
30

31
#include "vlmc.h"
Ludovic Fauvet's avatar
Ludovic Fauvet committed
32
#include "ui_MainWindow.h"
33

Ludovic Fauvet's avatar
Ludovic Fauvet committed
34 35 36 37 38 39
class Timeline;
class PreviewWidget;
class Settings;
class ProjectWizard;
class ImportController;
class WorkflowFileRenderer;
40

Ludovic Fauvet's avatar
Ludovic Fauvet committed
41 42 43
class MainWindow : public QMainWindow
{
    Q_OBJECT
Ludovic Fauvet's avatar
Ludovic Fauvet committed
44
    Q_DISABLE_COPY( MainWindow )
Ludovic Fauvet's avatar
Ludovic Fauvet committed
45 46

public:
47

Ludovic Fauvet's avatar
Ludovic Fauvet committed
48
    explicit MainWindow( QWidget *parent = 0 );
49
    void registerWidgetInWindowMenu( QDockWidget* widget );
50
    ~MainWindow();
Ludovic Fauvet's avatar
Ludovic Fauvet committed
51

Ludovic Fauvet's avatar
Ludovic Fauvet committed
52 53 54 55
public slots:
    void        zoomIn();
    void        zoomOut();

Ludovic Fauvet's avatar
Ludovic Fauvet committed
56
protected:
57 58
    virtual void    changeEvent( QEvent *e );
    virtual void    closeEvent( QCloseEvent* e );
Ludovic Fauvet's avatar
Ludovic Fauvet committed
59 60

private:
61
    void        initializeDockWidgets( void );
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
62
    void        setupLibrary();
63
    void        createStatusBar();
64
    void        createGlobalPreferences();
65
    void        createProjectPreferences();
66
    void        initializeMenuKeyboardShortcut();
67 68 69
#ifdef DEBUG_CRASHHANDLER
    void        setupCrashTester();
#endif
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
70 71 72 73 74 75 76
    /**
     *  \brief  Will check if vlmc closed nicely or crashed.
     *          If so, the emergency backup will be opened.
     *  \return true if a project was restored. If so, the wizzard should
     *          not be opened.
     */
    bool        restoreSession();
77

78 79 80
    Ui::MainWindow          m_ui;
    QSlider*                m_zoomSlider;
    Timeline*               m_timeline;
81 82
    PreviewWidget*          m_clipPreview;
    PreviewWidget*          m_projectPreview;
83
    WorkflowFileRenderer*   m_renderer;
84
    Settings*               m_globalPreferences;
85
    Settings*               m_DefaultProjectPreferences;
86
    Settings*               m_projectPreferences;
87
    ProjectWizard*          m_pWizard;
88
    ImportController*       m_importController;
Ludovic Fauvet's avatar
Ludovic Fauvet committed
89 90

private slots:
91 92 93 94 95 96 97 98 99 100
    void                    on_actionBypass_effects_engine_toggled(bool );
    void                    on_actionFullscreen_triggered( bool checked );
    void                    on_actionQuit_triggered();
    void                    on_actionAbout_triggered();
    void                    on_actionPreferences_triggered();
    void                    on_actionTranscode_triggered();
    void                    on_actionRender_triggered();
    void                    on_actionNew_Project_triggered();
    void                    on_actionLoad_Project_triggered();
    void                    on_actionSave_triggered();
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
101
    void                    on_actionSave_As_triggered();
102 103
    void                    on_actionHelp_triggered();
    void                    on_actionProject_Preferences_triggered();
104
    void                    on_actionClose_Project_triggered();
105
    void                    on_actionCrash_triggered();
106
    void                    on_actionImport_triggered();
107
    void                    toolButtonClicked( int id );
108
    void                    projectUpdated( const QString& projectName, bool savedStatus );
109
    void                    keyboardShortcutChanged( const QString&, const QString& );
110 111 112

signals:
    void translateDockWidgetTitle();
113
    void toolChanged( ToolButtons );
114

115
};
Ludovic Fauvet's avatar
Ludovic Fauvet committed
116 117

#endif // MAINWINDOW_H