Commit 2b4656d6 authored by Stéphane Albert's avatar Stéphane Albert

ENH: (Gui) moved AboutDialog from ::mvd to ::mvd::gui; Moved...

ENH: (Gui) moved AboutDialog from ::mvd to ::mvd::gui; Moved ENHANCED_BAND_NAMES constant from mvd::gui::ColorSetupDialog to mvd::core::AbstractImageModel.
parent b2e28773
......@@ -452,7 +452,7 @@ void
MainWindow
::on_action_About_activated()
{
AboutDialog aboutDialog( this );
gui::AboutDialog aboutDialog( this );
aboutDialog.exec();
}
......
......@@ -51,6 +51,37 @@ namespace mvd
*/
/*****************************************************************************/
/* CONSTANTS */
namespace
{
/**
* \brief Array of enhanced band names that OTB can return.
*
* It is defined (statically) as a constant for translation purposes.
*/
const char*
ENHANCED_BAND_NAMES[ 10 ] = {
QT_TRANSLATE_NOOP( "mvd::AbstractImageModel", "Red" ),
QT_TRANSLATE_NOOP( "mvd::AbstractImageModel", "Green" ),
QT_TRANSLATE_NOOP( "mvd::AbstractImageModel", "Blue" ),
QT_TRANSLATE_NOOP( "mvd::AbstractImageModel", "Yellow" ),
QT_TRANSLATE_NOOP( "mvd::AbstractImageModel", "RedEdge" ),
QT_TRANSLATE_NOOP( "mvd::AbstractImageModel", "Coastal" ),
QT_TRANSLATE_NOOP( "mvd::AbstractImageModel", "NIR" ),
QT_TRANSLATE_NOOP( "mvd::AbstractImageModel", "NIR1" ),
QT_TRANSLATE_NOOP( "mvd::AbstractImageModel", "NIR2" ),
QT_TRANSLATE_NOOP( "mvd::AbstractImageModel", "PAN" ),
};
} // end of anonymous namespace.
/*****************************************************************************/
/* STATIC IMPLEMENTATION SECTION */
/*****************************************************************************/
/* CLASS IMPLEMENTATION SECTION */
......@@ -154,8 +185,10 @@ AbstractImageModel
{
stdBandNames2 = metaDataInterface->GetEnhancedBandNames();
}
catch(itk::ExceptionObject &)
{}
catch( itk::ExceptionObject& exc )
{
qDebug() << exc.what();
}
}
/*
......
......@@ -45,12 +45,6 @@
/*****************************************************************************/
/* MACROS */
/** \brief Indent space when writing XML DOM documents. */
namespace
{
const int XML_INDENT = 2;
}
namespace mvd
{
......@@ -65,7 +59,13 @@ namespace mvd
/*****************************************************************************/
/* CONSTANTS */
/** \brief Indent space when writing XML DOM documents. */
namespace
{
const int XML_INDENT = 2;
}
const char*
DatasetDescriptor::TAG_NAMES[ ELEMENT_COUNT ] =
{
......
......@@ -206,7 +206,7 @@ private slots:
//
// Monteverdi includes (sorted by alphabetic order)
#include "mvdAbstractImageModel.h"
#include "Core/mvdAbstractImageModel.h"
namespace mvd
{
......
......@@ -52,6 +52,9 @@ namespace mvd
/*****************************************************************************/
/* CONSTANTS */
namespace
{
} // end of anonymous namespace.
/*****************************************************************************/
/* STATIC IMPLEMENTATION SECTION */
......
......@@ -60,7 +60,7 @@ namespace mvd
std::string
SystemError::whatString( int err, const std::string& msg )
{
#if 0
/*
// Use Qt's tr() in order for the text string to be translated.
// N.B.: strerror() string may use system locales.
return ToStdString(
......@@ -75,8 +75,8 @@ SystemError::whatString( int err, const std::string& msg )
.arg( msg )
);
*/
#else
std::stringstream sstream( std::ios_base::out );
sstream
......@@ -89,8 +89,6 @@ SystemError::whatString( int err, const std::string& msg )
: " " + msg + "." );
return sstream.str();
#endif
}
/*******************************************************************************/
......
......@@ -37,6 +37,10 @@
namespace mvd
{
namespace gui
{
/*
TRANSLATOR mvd::AboutDialog
......@@ -49,7 +53,7 @@ namespace mvd
AboutDialog
::AboutDialog( QWidget* parent, Qt::WindowFlags flags ) :
QDialog( parent ),
m_UI( new mvd::Ui::AboutDialog() )
m_UI( new mvd::gui::Ui::AboutDialog() )
{
m_UI->setupUi( this );
......@@ -69,4 +73,6 @@ AboutDialog
/*******************************************************************************/
} // end namespace 'gui'
} // end namespace 'mvd'
......@@ -49,6 +49,10 @@ namespace
namespace mvd
{
namespace gui
{
//
// Internal classes pre-declaration.
namespace Ui
......@@ -103,6 +107,8 @@ private:
private slots:
};
} // end namespace 'gui'
} // end namespace 'mvd'
#endif // __mvdAboutDialog_h
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>mvd::AboutDialog</class>
<widget class="QDialog" name="mvd::AboutDialog">
<class>mvd::gui::AboutDialog</class>
<widget class="QDialog" name="mvd::gui::AboutDialog">
<property name="windowModality">
<enum>Qt::ApplicationModal</enum>
</property>
......@@ -9,8 +9,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>413</width>
<height>423</height>
<width>464</width>
<height>487</height>
</rect>
</property>
<property name="sizePolicy">
......@@ -138,7 +138,7 @@
<connection>
<sender>m_CloseButton</sender>
<signal>clicked()</signal>
<receiver>mvd::AboutDialog</receiver>
<receiver>mvd::gui::AboutDialog</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
......
......@@ -19,6 +19,10 @@
#include "Gui/mvdColorSetupWidget.h"
#include "Gui/ui_mvdColorSetupWidget.h"
/*****************************************************************************/
/* INCLUDE SECTION */
//
// Qt includes (sorted by alphabetic order)
//// Must be included before system/custom includes.
......@@ -38,24 +42,38 @@
namespace mvd
{
/*
TRANSLATOR mvd::ColorSetupWidget
Necessary for lupdate to be aware of C++ namespaces.
Context comment for translator.
*/
/*****************************************************************************/
/* CONSTANTS */
namespace
{
/**
*/
const char* QCOMBOBOX_NAMES[] = {
"redComboBox",
"greenComboBox",
"blueComboBox"
};
}
} // end of anonymous namespace.
/*
TRANSLATOR mvd::ColorSetupWidget
Necessary for lupdate to be aware of C++ namespaces.
/*****************************************************************************/
/* STATIC IMPLEMENTATION SECTION */
Context comment for translator.
*/
/*****************************************************************************/
/* CLASS IMPLEMENTATION SECTION */
/*******************************************************************************/
ColorSetupWidget
......@@ -63,24 +81,6 @@ ColorSetupWidget
QWidget( parent, flags ),
m_UI( new mvd::Ui::ColorSetupWidget() )
{
// TODO: Change to static constant see Qt I18n documentation.
// This array is here to statically expose the main enhanced band
// names that OTB can returns for translation purposes.
// TODO: Move const char* ENHANCED_BAND_NAMES[] to common library.
const char*
ENHANCED_BAND_NAME[ 10 ] = {
tr("Red").toLatin1().constData(),
tr("Green").toLatin1().constData(),
tr("Blue").toLatin1().constData(),
tr("Yellow").toLatin1().constData(),
tr("RedEdge").toLatin1().constData(),
tr("Coastal").toLatin1().constData(),
tr("NIR").toLatin1().constData(),
tr("NIR1").toLatin1().constData(),
tr("NIR2").toLatin1().constData(),
tr("PAN").toLatin1().constData(),
};
m_UI->setupUi( this );
}
......@@ -103,6 +103,7 @@ ColorSetupWidget
QStringList itemTexts( components );
// TODO: Move to mvd::core::AbstractImageModel (see ENHANCED_BAND_NAMES[]).
for( int i=0;
i<itemTexts.size();
++ i )
......
......@@ -41,8 +41,12 @@
namespace mvd
{
namespace gui
{
/*
TRANSLATOR mvd::MyWidget
TRANSLATOR mvd::gui::MyWidget
Necessary for lupdate to be aware of C++ namespaces.
......@@ -65,7 +69,7 @@ namespace mvd
MyWidget
::MyWidget( QWidget* parent, Qt::WindowFlags flags ):
QWidget( parent, flags ),
m_UI( new mvd::Ui::MyWidget() )
m_UI( new mvd::gui::Ui::MyWidget() )
{
m_UI->setupUi( this );
}
......@@ -80,4 +84,6 @@ MyWidget
/* SLOTS */
/*******************************************************************************/
} // end namespace 'gui'
} // end namespace 'mvd'
......@@ -57,6 +57,10 @@ namespace
namespace mvd
{
namespace gui
{
//
// Internal classes pre-declaration.
namespace Ui
......@@ -137,9 +141,20 @@ private:
private slots:
};
} // end namespace 'gui'
} // end namespace 'mvd'
/*****************************************************************************/
/* INLINE SECTION */
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::MyWidget</class>
<widget class="QWidget" name="mvd::MyWidget">
<class>mvd::gui::MyWidget</class>
<widget class="QWidget" name="mvd::gui::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