// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include "HYDROGUI_StricklerTableDlg.h"
-
-#include "HYDROGUI_Module.h"
-#include "HYDROGUI_Tool.h"
-#include "HYDROGUI_LineEditDoubleValidator.h"
-#include "HYDROData_StricklerTable.h"
-
-#include <LightApp_Application.h>
-
-#include <SUIT_Session.h>
-#include <SUIT_ResourceMgr.h>
+#include <HYDROGUI_StricklerTableDlg.h>
+#include <HYDROGUI_LineEditDoubleValidator.h>
+#include <HYDROGUI_Tool.h>
+#include <HYDROData_StricklerTable.h>
#include <SUIT_FileDlg.h>
-#include <SUIT_Desktop.h>
-#include <SUIT_MessageBox.h>
-
+#ifndef LIGHT_MODE
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#endif
+#include <QBoxLayout>
+#include <QColorDialog>
#include <QGroupBox>
-#include <QLineEdit>
-#include <QToolButton>
-#include <QLayout>
+#include <QHeaderView>
#include <QLabel>
+#include <QLineEdit>
+#include <QPainter>
#include <QTableWidget>
-#include <QHeaderView>
-#include <QColorDialog>
+#include <QToolButton>
HYDROGUI_ColorDelegate::HYDROGUI_ColorDelegate( QWidget* theParent )
{
: HYDROGUI_InputPanel( theModule, theTitle ),
myType( theType )
{
- SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
-
QString fileGroupTitle = theType == Export ? tr( "EXPORT_STRICKLER_TABLE_FILE" ) : tr( "IMPORT_STRICKLER_TABLE_FILE" );
// Import Strickler table from file
myFileName->setReadOnly( true );
QToolButton* aBrowseBtn = new QToolButton( aFileNameGroup );
+#ifndef LIGHT_MODE
+ SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
aBrowseBtn->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "BROWSE_ICO" ) ) );
+#endif
QBoxLayout* aFileNameLayout = new QHBoxLayout( aFileNameGroup );
aFileNameLayout->setMargin( 5 );
myName = new QLineEdit( aNameGroup );
QGroupBox* aAttrNameGroup = new QGroupBox( tr( "STRICKLER_TABLE_ATTR_NAME" ), this );
+ aAttrNameGroup->setVisible( theType == Edit );
QLabel* aAttrNameLabel = new QLabel( tr( "ATTR_NAME" ), aAttrNameGroup );
myAttrName = new QLineEdit( aAttrNameGroup );
myTable->horizontalHeader()->setResizeMode( 1, QHeaderView::ResizeToContents );
myTable->horizontalHeader()->setResizeMode( 2, QHeaderView::ResizeToContents );
myTable->horizontalHeader()->setResizeMode( 3, QHeaderView::Stretch );
+ myTable->horizontalHeader()->setMinimumSectionSize( 50 );
myTable->verticalHeader()->setResizeMode( QHeaderView::ResizeToContents );
void HYDROGUI_StricklerTableDlg::onRemoveCoefficient()
{
QList<int> aRows;
- QModelIndexList aSelectedIndexes = myTable->selectionModel()->selectedRows();
+ QModelIndexList aSelectedIndexes = myTable->selectionModel()->selectedIndexes();
foreach ( const QModelIndex& anIndex, aSelectedIndexes ) {
- aRows << anIndex.row();
+ int aRowIndex = anIndex.row();
+ if ( !aRows.contains( aRowIndex ) )
+ aRows << aRowIndex;
}
removeRows( aRows );
*/
void HYDROGUI_StricklerTableDlg::onSelectionChanged()
{
- QModelIndexList aSelectedIndexes = myTable->selectionModel()->selectedRows();
+ QModelIndexList aSelectedIndexes = myTable->selectionModel()->selectedIndexes();
myRemoveBtn->setEnabled( aSelectedIndexes.count() > 0 );
}