Commit 1dc2c2cf authored by Stéphane Albert's avatar Stéphane Albert

ENH: Derived Application/Catalogue/MainWindow from...

ENH: Derived Application/Catalogue/MainWindow from Code/Common/Gui/I18nMainWindow; Disabled inactive menu items (File/Open, Edit/Preferences, View/Quicklook|Color setup|Color dynamics).
parent d8c00795
......@@ -67,12 +67,10 @@ namespace mvd
/*****************************************************************************/
MainWindow
::MainWindow( QWidget* parent, Qt::WindowFlags flags ) :
QMainWindow( parent, flags ),
I18nMainWindow( parent, flags ),
m_UI( new mvd::Ui::MainWindow() )
{
m_UI->setupUi( this );
Initialize();
}
/*****************************************************************************/
......@@ -84,22 +82,18 @@ MainWindow
/*****************************************************************************/
void
MainWindow
::Initialize()
::virtual_SetupUI()
{
setObjectName( "mvd::MainWindow" );
setWindowTitle( PROJECT_NAME );
// add the needed docks
InitializeDockWidgets();
// add needed widget to the status bar
InitializeStatusBar();
}
/*****************************************************************************/
void
MainWindow
::InitializeStatusBar()
::virtual_ConnectUI()
{
}
......@@ -110,24 +104,23 @@ MainWindow
{
}
/*****************************************************************************/
/* SLOTS */
/*****************************************************************************/
void
MainWindow::closeEvent( QCloseEvent* event )
MainWindow
::OnAboutToChangeModel( const AbstractModel* model )
{
assert( event!=NULL );
qDebug() << "MainWindow::closeEvent(" << event << ")";
qDebug() << "MainWindow:" << this << "::OnAboutToChangeModel(" << model << ")";
}
/*****************************************************************************/
/* SLOTS */
/*****************************************************************************/
void
MainWindow
::on_action_Quit_triggered()
::OnModelChanged( AbstractModel* model )
{
close();
qDebug() << "MainWindow:" << this << "::OnModelChanged(" << model << ")";
}
} // end namespace 'mvd'
......@@ -32,7 +32,6 @@
//
// Qt includes (sorted by alphabetic order)
//// Must be included before system/custom includes.
#include <QtGui>
//
// System includes (sorted by alphabetic order)
......@@ -46,6 +45,8 @@
//
// Monteverdi includes (sorted by alphabetic order)
#include "Core/mvdTypes.h"
//
#include "Gui/mvdI18nMainWindow.h"
/*****************************************************************************/
......@@ -76,7 +77,7 @@ class MainWindow;
* \brief The application main-widow widget.
*/
class Monteverdi2_EXPORT MainWindow
: public QMainWindow
: public I18nMainWindow
{
/*-[ QOBJECT SECTION ]-----------------------------------------------------*/
......@@ -111,14 +112,35 @@ signals:
protected:
//
// QMainWindow overrides.
// I18nMainWindow overrides.
/**
*/
virtual void virtual_SetupUI();
/**
*/
virtual void virtual_ConnectUI();
void closeEvent( QCloseEvent* event );
//
// Protected attributes.
protected:
/*-[ PROTECTED SLOTS SECTION ]---------------------------------------------*/
//
// Protected slots.
protected slots:
/**
*/
virtual void OnAboutToChangeModel( const AbstractModel* );
/**
*/
virtual void OnModelChanged( AbstractModel* );
/*-[ PRIVATE SECTION ]-----------------------------------------------------*/
//
......@@ -129,15 +151,10 @@ private:
//
// Private methods.
private:
/** */
void Initialize();
/** */
void InitializeDockWidgets();
/** */
void InitializeStatusBar();
//
// Private attributes.
private:
......@@ -152,12 +169,6 @@ private:
// Private slots.
private slots:
/**
* \brief Qt auto-connected slot which is called when File/Quit menu
* action is activated.
*/
void on_action_Quit_triggered();
};
} // end namespace 'mvd'
......
......@@ -23,7 +23,7 @@
<x>0</x>
<y>0</y>
<width>800</width>
<height>23</height>
<height>25</height>
</rect>
</property>
<widget class="QMenu" name="menu_File">
......@@ -84,6 +84,9 @@
</property>
</action>
<action name="action_Open">
<property name="enabled">
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="mvdMainWindow.qrc">
<normaloff>:/icons/action_Open_Icon</normaloff>:/icons/action_Open_Icon</iconset>
......@@ -113,6 +116,9 @@
</property>
</action>
<action name="action_Preferences">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Prefere&amp;nces</string>
</property>
......@@ -124,6 +130,9 @@
<property name="checked">
<bool>true</bool>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Quicklook</string>
</property>
......@@ -138,6 +147,9 @@
<property name="checked">
<bool>true</bool>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Video color setup</string>
</property>
......@@ -152,6 +164,9 @@
<property name="checked">
<bool>true</bool>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Video color dynamics</string>
</property>
......
......@@ -105,10 +105,10 @@ signals:
//
// Protected methods.
protected:
/** \brief Constructor. */
I18nMainWindow( QWidget* Parent =0, Qt::WindowFlags flags =0 );
/**
*/
virtual void virtual_SetupUI() =0;
......@@ -116,7 +116,7 @@ protected:
/**
*/
virtual void virtual_ConnectUI() =0;
//
// QMainWindow overrides.
......@@ -126,6 +126,20 @@ protected:
// Protected attributes.
protected:
/*-[ PROTECTED SLOTS SECTION ]---------------------------------------------*/
//
// Protected slots.
protected slots:
/**
*/
virtual void OnAboutToChangeModel( const AbstractModel* ) =0;
/**
*/
virtual void OnModelChanged( AbstractModel* ) =0;
/*-[ PRIVATE SECTION ]-----------------------------------------------------*/
//
......@@ -182,14 +196,6 @@ private slots:
*/
void on_action_About_activated();
/**
*/
virtual void OnAboutToChangeModel( const AbstractModel* ) =0;
/**
*/
virtual void OnModelChanged( AbstractModel* ) =0;
};
} // end namespace 'mvd'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment