Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit 10c35f28 authored by Frédéric Larue's avatar Frédéric Larue
Browse files

Buttons added for controlling the project data view.

parent 1e62c5ab
......@@ -377,6 +377,14 @@ void UIDataWidget::launchExport()
}
void UIDataWidget::editSelectedDataName()
{
QList<QTreeWidgetItem*> selected = selectedItems();
if( selected.size() == 1 )
editItem( selected.front(), 0 );
}
void UIDataWidget::keyPressEvent( QKeyEvent *evt )
{
switch( evt->key() )
......@@ -434,3 +442,44 @@ QList<GenericUIData*> UIDataWidget::selectedData( const QList<QString>& typeFilt
return mng;
}
void UIDataWidget::expandCollapseSelectedData()
{
for( auto selected : selectedItems() )
if( selected->isExpanded() )
forAllItemsInSubTree( (UIDataWidgetItem*) selected, [&]( UIDataWidgetItem *item )
{
collapseItem( item );
} );
else
forAllItemsInSubTree( (UIDataWidgetItem*) selected, [&]( UIDataWidgetItem *item )
{
expandItem( item );
} );
}
void UIDataWidget::selectSubTrees()
{
for( auto selected : selectedItems() )
forAllItemsInSubTree( (UIDataWidgetItem*) selected, [&]( UIDataWidgetItem *item )
{
item->setSelected( true );
} );
}
void UIDataWidget::selectSameTypesAsSelected()
{
QSet< QString > selectedTypes;
for( auto selected : selectedItems() )
selectedTypes.insert( ((UIDataWidgetItem*) selected)->getUIData()->GetTypeString() );
forAllTreeItems( [&]( UIDataWidgetItem *item )
{
if( selectedTypes.contains(item->getUIData()->GetTypeString()) )
item->setSelected( true );
} );
}
......@@ -80,6 +80,10 @@ public slots:
void updateContentBegin();
void updateContentEnd();
void updateSelection( GenericUIData *d, Qt::KeyboardModifiers modifiers );
void editSelectedDataName();
void expandCollapseSelectedData();
void selectSubTrees();
void selectSameTypesAsSelected();
private slots:
void updateDataCollapseState( QTreeWidgetItem* clickedItem );
......
......@@ -222,6 +222,15 @@ void UIMainWindow::init()
initializeCentralWidgetStack();
setViewerMode( DISPLAY_DOF_3D );
connect( ui->projectViewButtonCollapseAll, SIGNAL(clicked(bool)), ui->tableCurrentProjContent, SLOT(collapseAll()) );
connect( ui->projectViewButtonExpandAll, SIGNAL(clicked(bool)), ui->tableCurrentProjContent, SLOT(expandAll()) );
connect( ui->projectViewButtonExpandSelected, SIGNAL(clicked(bool)), ui->tableCurrentProjContent, SLOT(expandCollapseSelectedData()) );
connect( ui->projectViewButtonSelectAll, SIGNAL(clicked(bool)), ui->tableCurrentProjContent, SLOT(selectAll()) );
connect( ui->projectViewButtonSelectTree, SIGNAL(clicked(bool)), ui->tableCurrentProjContent, SLOT(selectSubTrees()) );
connect( ui->projectViewButtonSelectByType, SIGNAL(clicked(bool)), ui->tableCurrentProjContent, SLOT(selectSameTypesAsSelected()) );
connect( ui->projectViewButtonRemove, SIGNAL(clicked(bool)), this, SLOT(removeFromCurrentProject()) );
connect( ui->projectViewButtonRename, SIGNAL(clicked(bool)), ui->tableCurrentProjContent, SLOT(editSelectedDataName()) );
connect( ui->actionLoadImage, SIGNAL(triggered()), this, SLOT(addToCurrentProject()) );
connect( ui->actionNewProject, SIGNAL(triggered()), this, SLOT(newProject()) );
connect( ui->actionSaveProject, SIGNAL(triggered()), this, SLOT(saveCurrentProject()) );
......
......@@ -13,6 +13,14 @@
<file>resources/animationStop.png</file>
<file>resources/animationStepFwd.png</file>
<file>resources/animationStepBwd.png</file>
<file>resources/projectViewIcon_Rename.png</file>
<file>resources/projectViewIcon_CollapseAll.png</file>
<file>resources/projectViewIcon_ExpandAll.png</file>
<file>resources/projectViewIcon_ExpandSelected.png</file>
<file>resources/projectViewIcon_Remove.png</file>
<file>resources/projectViewIcon_SelectAll.png</file>
<file>resources/projectViewIcon_SelectTree.png</file>
<file>resources/projectViewIcon_SelectByType.png</file>
</qresource>
<qresource prefix="/AboutLicences">
<file>resources/AboutLicences/ArrowLeft.png</file>
......
......@@ -44,7 +44,7 @@
<x>0</x>
<y>0</y>
<width>1198</width>
<height>17</height>
<height>21</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
......@@ -172,7 +172,7 @@
<x>0</x>
<y>0</y>
<width>384</width>
<height>301</height>
<height>316</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
......@@ -230,27 +230,344 @@
</widget>
</item>
<item>
<widget class="UIDataWidget" name="tableCurrentProjContent">
<property name="acceptDrops">
<bool>true</bool>
<layout class="QGridLayout" name="gridLayout_2">
<property name="horizontalSpacing">
<number>4</number>
</property>
<property name="alternatingRowColors">
<bool>false</bool>
<property name="verticalSpacing">
<number>1</number>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<column>
<property name="text">
<string>Name</string>
</property>
</column>
<column>
<property name="text">
<string>Type</string>
</property>
</column>
</widget>
<item row="0" column="0">
<widget class="QPushButton" name="projectViewButtonCollapseAll">
<property name="minimumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Collapse all</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="mainapp.qrc">
<normaloff>:/images/resources/projectViewIcon_CollapseAll.png</normaloff>:/images/resources/projectViewIcon_CollapseAll.png</iconset>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QPushButton" name="projectViewButtonSelectTree">
<property name="minimumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Select item sub-trees</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="mainapp.qrc">
<normaloff>:/images/resources/projectViewIcon_SelectTree.png</normaloff>:/images/resources/projectViewIcon_SelectTree.png</iconset>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="projectViewButtonExpandSelected">
<property name="minimumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Collapse/Expand selected items</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="mainapp.qrc">
<normaloff>:/images/resources/projectViewIcon_ExpandSelected.png</normaloff>:/images/resources/projectViewIcon_ExpandSelected.png</iconset>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="QPushButton" name="projectViewButtonSelectByType">
<property name="minimumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Select all of same type [Alt+Left click]</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="mainapp.qrc">
<normaloff>:/images/resources/projectViewIcon_SelectByType.png</normaloff>:/images/resources/projectViewIcon_SelectByType.png</iconset>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="projectViewButtonExpandAll">
<property name="minimumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Expand all</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="mainapp.qrc">
<normaloff>:/images/resources/projectViewIcon_ExpandAll.png</normaloff>:/images/resources/projectViewIcon_ExpandAll.png</iconset>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" colspan="11">
<widget class="UIDataWidget" name="tableCurrentProjContent">
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="alternatingRowColors">
<bool>false</bool>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<column>
<property name="text">
<string>Name</string>
</property>
</column>
<column>
<property name="text">
<string>Type</string>
</property>
</column>
</widget>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="projectViewButtonSelectAll">
<property name="minimumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Select all [Ctrl+A]</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="mainapp.qrc">
<normaloff>:/images/resources/projectViewIcon_SelectAll.png</normaloff>:/images/resources/projectViewIcon_SelectAll.png</iconset>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="10">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="9">
<widget class="QPushButton" name="projectViewButtonRename">
<property name="minimumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Rename selected item [F2]</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="mainapp.qrc">
<normaloff>:/images/resources/projectViewIcon_Rename.png</normaloff>:/images/resources/projectViewIcon_Rename.png</iconset>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="8">
<widget class="QPushButton" name="projectViewButtonRemove">
<property name="minimumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Remove selected items [Suppr]</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="mainapp.qrc">
<normaloff>:/images/resources/projectViewIcon_Remove.png</normaloff>:/images/resources/projectViewIcon_Remove.png</iconset>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="7">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
......@@ -312,7 +629,7 @@
<x>0</x>
<y>0</y>
<width>384</width>
<height>372</height>
<height>344</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
......
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