Commit 981e8541 authored by Stéphane Albert's avatar Stéphane Albert

ENH: Created DatabaseBrowserWidget/Controller classes.

parent ae58b1d8
......@@ -81,6 +81,8 @@ DatabaseModel
{
}
#if 0
/*******************************************************************************/
bool
DatabaseModel
......@@ -90,7 +92,6 @@ DatabaseModel
}
/*******************************************************************************/
#if 0
void
DatabaseModel
......
......@@ -112,9 +112,9 @@ public:
//
// AbstractModel overrides.
#if 0
bool IsModified() const;
#if 0
void ClearModified();
#endif
......
......@@ -12,6 +12,8 @@ set( Common_Gui_SOURCES
mvdColorDynamicsWidget.cxx
mvdColorSetupController.cxx
mvdColorSetupWidget.cxx
mvdDatabaseBrowserController.cxx
mvdDatabaseBrowserWidget.cxx
mvdDatasetCreationProgressDialog.cxx
mvdGLImageWidget.cxx
mvdGui.cxx
......@@ -39,6 +41,8 @@ set( Common_Gui_HEADERS_MOC
mvdColorDynamicsWidget.h
mvdColorSetupController.h
mvdColorSetupWidget.h
mvdDatabaseBrowserController.h
mvdDatabaseBrowserWidget.h
mvdDatasetCreationProgressDialog.h
mvdGLImageWidget.h
# mvdGui.h
......@@ -56,14 +60,15 @@ set( Common_Gui_HEADERS_MOC
# Qt designer UI files
set( Common_Gui_FORMS
mvdAboutDialog.ui
mvdApplicationsToolBox.ui
mvdColorBandDynamicsWidget.ui
mvdColorDynamicsWidget.ui
mvdColorSetupWidget.ui
mvdDatabaseBrowserWidget.ui
mvdDatasetCreationProgressDialog.ui
mvdMyWidget.ui
mvdStatusBarWidget.ui
mvdVideoColorToolBox.ui
mvdApplicationsToolBox.ui
)
# Qt resources
......
/*=========================================================================
Program: Monteverdi2
Language: C++
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See Copyright.txt for details.
Monteverdi2 is distributed under the CeCILL licence version 2. See
Licence_CeCILL_V2-en.txt or
http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt for more details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "Gui/mvdDatabaseBrowserController.h"
/*****************************************************************************/
/* INCLUDE SECTION */
//
// Qt includes (sorted by alphabetic order)
//// Must be included before system/custom includes.
//
// System includes (sorted by alphabetic order)
//
// ITK includes (sorted by alphabetic order)
//
// OTB includes (sorted by alphabetic order)
//
// Monteverdi includes (sorted by alphabetic order)
#include "Core/mvdDatabaseModel.h"
//
#include "Gui/mvdDatabaseBrowserWidget.h"
namespace mvd
{
/*
TRANSLATOR mvd::DatabaseBrowserController
Necessary for lupdate to be aware of C++ namespaces.
Context comment for translator.
*/
/*****************************************************************************/
/* CLASS IMPLEMENTATION SECTION */
/*******************************************************************************/
DatabaseBrowserController
::DatabaseBrowserController( DatabaseBrowserWidget* widget, QObject* parent ) :
AbstractModelController( widget, parent )
{
}
/*******************************************************************************/
DatabaseBrowserController
::~DatabaseBrowserController()
{
}
/*******************************************************************************/
void
DatabaseBrowserController
::Connect( AbstractModel* model )
{
DatabaseBrowserWidget* widget = GetWidget< DatabaseBrowserWidget >();
}
/*******************************************************************************/
void
DatabaseBrowserController
::Disconnect( AbstractModel* model )
{
DatabaseBrowserWidget* widget = GetWidget< DatabaseBrowserWidget >();
}
/*******************************************************************************/
void
DatabaseBrowserController
::ResetWidget()
{
// Reset widget.
// ResetFoo();
// Signal model has been updated.
emit ModelUpdated();
}
/*******************************************************************************/
void
DatabaseBrowserController
::ResetFoo()
{
//
// Access widget.
DatabaseBrowserWidget* widget = GetWidget< DatabaseBrowserWidget >();
//
// Access model.
DatabaseModel* model = GetModel< DatabaseModel >();
assert( model!=NULL );
// Block this controller's signals to prevent display refreshes
// but let let widget(s) signal their changes so linked values
// will be correctly updated.
this->blockSignals( true );
{
// Block widget's signals...
//...but force call to valueChanged() slot to force refresh.
widget->blockSignals( true );
{
// TODO: Fill in widget.
}
widget->blockSignals( false );
}
this->blockSignals( false );
}
/*******************************************************************************/
/* SLOTS */
/*******************************************************************************/
} // end namespace 'mvd'
/*=========================================================================
Program: Monteverdi2
Language: C++
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See Copyright.txt for details.
Monteverdi2 is distributed under the CeCILL licence version 2. See
Licence_CeCILL_V2-en.txt or
http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt for more details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __mvdDatabaseBrowserController_h
#define __mvdDatabaseBrowserController_h
//
// Configuration include.
//// Included at first position before any other ones.
#include "ConfigureMonteverdi2.h"
/*****************************************************************************/
/* INCLUDE SECTION */
//
// Qt includes (sorted by alphabetic order)
//// Must be included before system/custom includes.
//
// System includes (sorted by alphabetic order)
//
// ITK includes (sorted by alphabetic order)
//
// OTB includes (sorted by alphabetic order)
//
// Monteverdi includes (sorted by alphabetic order)
#include "mvdAbstractModelController.h"
#include "mvdGui.h"
/*****************************************************************************/
/* PRE-DECLARATION SECTION */
//
// External classes pre-declaration.
namespace
{
}
namespace mvd
{
//
// Internal classes pre-declaration.
class DatabaseBrowserWidget;
/*****************************************************************************/
/* CLASS DEFINITION SECTION */
/**
* \class DatabaseBrowserController
*
* \brief Color-setup widget controller for VectorImageModel objects.
*/
class Monteverdi2_EXPORT DatabaseBrowserController :
public AbstractModelController
{
/*-[ QOBJECT SECTION ]-----------------------------------------------------*/
Q_OBJECT;
/*-[ PUBLIC SECTION ]------------------------------------------------------*/
//
// Public methods.
public:
/**
* \brief Constructor.
*
* \param widget Controlled widget.
* \param parent Parent QObject of this QObject.
*/
DatabaseBrowserController( DatabaseBrowserWidget* widget,
QObject* parent =NULL );
/**
* \brief Destructor.
*/
virtual ~DatabaseBrowserController();
/*-[ SIGNALS SECTION ]-----------------------------------------------------*/
//
// Signals.
signals:
/*-[ PROTECTED SECTION ]---------------------------------------------------*/
//
// Protected methods.
protected:
//
// AbstractModelController overrides.
virtual void Connect( AbstractModel* );
virtual void ResetWidget();
virtual void Disconnect( AbstractModel* );
//
// Protected attributes.
protected:
/*-[ PRIVATE SECTION ]-----------------------------------------------------*/
//
// Private methods.
private:
/**
*/
void ResetFoo();
//
// Private attributes.
private:
/*-[ PRIVATE SLOTS SECTION ]-----------------------------------------------*/
//
// Slots.
private slots:
};
} // end namespace 'mvd'.
/*****************************************************************************/
/* INLINE SECTION */
namespace mvd
{
} // end namespace 'mvd'
#endif // __mvdDatabaseBrowserController_h
/*=========================================================================
Program: Monteverdi2
Language: C++
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See Copyright.txt for details.
Monteverdi2 is distributed under the CeCILL licence version 2. See
Licence_CeCILL_V2-en.txt or
http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt for more details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "Gui/mvdDatabaseBrowserWidget.h"
#include "Gui/ui_mvdDatabaseBrowserWidget.h"
/*****************************************************************************/
/* INCLUDE SECTION */
//
// Qt includes (sorted by alphabetic order)
//// Must be included before system/custom includes.
//
// System includes (sorted by alphabetic order)
//
// ITK includes (sorted by alphabetic order)
//
// OTB includes (sorted by alphabetic order)
//
// Monteverdi includes (sorted by alphabetic order)
namespace mvd
{
/*
TRANSLATOR mvd::DatabaseBrowserWidget
Necessary for lupdate to be aware of C++ namespaces.
Context comment for translator.
*/
/*****************************************************************************/
/* CONSTANTS */
/*****************************************************************************/
/* STATIC IMPLEMENTATION SECTION */
/*****************************************************************************/
/* CLASS IMPLEMENTATION SECTION */
/*******************************************************************************/
DatabaseBrowserWidget
::DatabaseBrowserWidget( QWidget* parent, Qt::WindowFlags flags ):
QWidget( parent, flags ),
m_UI( new mvd::Ui::DatabaseBrowserWidget() )
{
m_UI->setupUi( this );
}
/*******************************************************************************/
DatabaseBrowserWidget
::~DatabaseBrowserWidget()
{
}
/*******************************************************************************/
/* SLOTS */
/*******************************************************************************/
} // end namespace 'mvd'
/*=========================================================================
Program: Monteverdi2
Language: C++
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See Copyright.txt for details.
Monteverdi2 is distributed under the CeCILL licence version 2. See
Licence_CeCILL_V2-en.txt or
http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt for more details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __mvdDatabaseBrowserWidget_h
#define __mvdDatabaseBrowserWidget_h
//
// Configuration include.
//// Included at first position before any other ones.
#include "ConfigureMonteverdi2.h"
/*****************************************************************************/
/* INCLUDE SECTION */
//
// Qt includes (sorted by alphabetic order)
//// Must be included before system/custom includes.
#include <QtGui>
//
// System includes (sorted by alphabetic order)
//
// ITK includes (sorted by alphabetic order)
//
// OTB includes (sorted by alphabetic order)
//
// Monteverdi includes (sorted by alphabetic order)
/*****************************************************************************/
/* PRE-DECLARATION SECTION */
//
// External classes pre-declaration.
namespace
{
}
namespace mvd
{
//
// Internal classes pre-declaration.
namespace Ui
{
class DatabaseBrowserWidget;
};
/*****************************************************************************/
/* CLASS DEFINITION SECTION */
/**
* \class DatabaseBrowserWidget
*
* \brief Widget template skeleton to copy-paste when adding a new
* widget class.
*/
class Monteverdi2_EXPORT DatabaseBrowserWidget :
public QWidget
{
/*-[ QOBJECT SECTION ]-----------------------------------------------------*/
Q_OBJECT;
/*-[ PUBLIC SECTION ]------------------------------------------------------*/
//
// Public methods.
public:
/** \brief Constructor. */
DatabaseBrowserWidget( QWidget* parent =NULL, Qt::WindowFlags flags =0 );
/** \brief Destructor. */
virtual ~DatabaseBrowserWidget();
/*-[ PUBLIC SLOTS SECTION ]------------------------------------------------*/
//
// Public SLOTS.
public slots:
/*-[ SIGNALS SECTION ]-----------------------------------------------------*/
//
// Signals.
signals:
/*-[ PROTECTED SECTION ]---------------------------------------------------*/
//
// Protected methods.
protected:
/*-[ PRIVATE SECTION ]-----------------------------------------------------*/
//
// Protected attributes.
protected:
//
// Private methods.
private:
//
// Private attributes.
private:
/**
* \brief uic generated.
*/
Ui::DatabaseBrowserWidget* m_UI;
/*-[ PRIVATE SLOTS SECTION ]-----------------------------------------------*/
//
// Slots.
private slots:
};
} // end namespace 'mvd'
/*****************************************************************************/
/* INLINE SECTION */
namespace mvd
{
} // end namespace 'mvd'
#endif // __mvdDatabaseBrowserWidget_h
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>mvd::DatabaseBrowserWidget</class>
<widget class="QWidget" name="mvd::DatabaseBrowserWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>300</width>
<height>200</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<property name="locale">
<locale language="C" country="AnyCountry"/>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTreeWidget" name="treeWidget">
<column>
<property name="text">
<string>Name</string>
</property>
</column>
<item>
<property name="text">
<string>Dataset(s)</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
......@@ -42,11 +42,8 @@
namespace mvd
{
namespace gui
{
/*
TRANSLATOR mvd::gui::MyWidget
TRANSLATOR mvd::MyWidget
Necessary for lupdate to be aware of C++ namespaces.
......@@ -69,7 +66,7 @@ namespace gui
MyWidget
::MyWidget( QWidget* parent, Qt::WindowFlags flags ):
QWidget( parent, flags ),
m_UI( new mvd::gui::Ui::MyWidget() )
m_UI( new mvd::Ui::MyWidget() )
{
m_UI->setupUi( this );
}
......@@ -84,6 +81,4 @@ MyWidget
/* SLOTS */
/*******************************************************************************/
} // end namespace 'gui'
} // end namespace 'mvd'
......@@ -58,9 +58,6 @@ namespace
namespace mvd
{
namespace gui
{
//
// Internal classes pre-declaration.
namespace Ui
......@@ -141,8 +138,6 @@ private:
private slots:
};
} // end namespace 'gui'
} // end namespace 'mvd'
/*****************************************************************************/
......@@ -150,11 +145,6 @@ private slots:
namespace mvd
{
namespace gui
{
} // end namespace 'gui'
} // end namespace 'mvd'
#endif // __mvdMyWidget_h
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>mvd::gui::MyWidget</class>
<widget class="QWidget" name="mvd::gui::MyWidget">
<class>mvd::MyWidget</class>
<widget class="QWidget" name="mvd::MyWidget">
<property name="geometry">
<rect>
<x>0</x>
......
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