add button to lock group edits

This commit is contained in:
garak 2024-01-12 15:48:51 -05:00
parent abc433bc78
commit b620e3d816
6 changed files with 58 additions and 11 deletions

View file

@ -89,8 +89,8 @@
</property>
<property name="icon">
<iconset resource="../resources/images.qrc">
<normaloff>:/icons/folder_eye_closed.ico</normaloff>
<normalon>:/icons/folder_eye_open.ico</normalon>
<normaloff>:/icons/folder_eye_open.ico</normaloff>
<normalon>:/icons/folder_eye_closed.ico</normalon>
</iconset>
</property>
<property name="popupMode">
@ -144,6 +144,31 @@
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_EnableDisable_EditGroups">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Toggle editability of group folders&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../resources/images.qrc">
<normaloff>:/icons/lock_edit.ico</normaloff>
<normalon>:/icons/unlock_edit.ico</normalon>
</iconset>
</property>
<property name="popupMode">
<enum>QToolButton::InstantPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
@ -249,8 +274,8 @@
</property>
<property name="icon">
<iconset resource="../resources/images.qrc">
<normaloff>:/icons/folder_eye_closed.ico</normaloff>
<normalon>:/icons/folder_eye_open.ico</normalon>
<normaloff>:/icons/folder_eye_open.ico</normaloff>
<normalon>:/icons/folder_eye_closed.ico</normalon>
</iconset>
</property>
<property name="popupMode">
@ -409,8 +434,8 @@
</property>
<property name="icon">
<iconset resource="../resources/images.qrc">
<normaloff>:/icons/folder_eye_closed.ico</normaloff>
<normalon>:/icons/folder_eye_open.ico</normalon>
<normaloff>:/icons/folder_eye_open.ico</normaloff>
<normalon>:/icons/folder_eye_closed.ico</normalon>
</iconset>
</property>
<property name="popupMode">

View file

@ -282,6 +282,7 @@ private slots:
void on_toolButton_HideShow_Groups_clicked();
void on_toolButton_ExpandAll_Groups_clicked();
void on_toolButton_CollapseAll_Groups_clicked();
void on_toolButton_EnableDisable_EditGroups_clicked();
void on_toolButton_HideShow_Areas_clicked();
void on_toolButton_ExpandAll_Areas_clicked();
void on_toolButton_CollapseAll_Areas_clicked();

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View file

@ -18,6 +18,8 @@
<file>icons/folder_map_opened.ico</file>
<file>icons/folder_map.ico</file>
<file>icons/folder.ico</file>
<file>icons/lock_edit.ico</file>
<file>icons/unlock_edit.ico</file>
<file>icons/map_edited.ico</file>
<file>icons/map_opened.ico</file>
<file>icons/map.ico</file>

View file

@ -1179,11 +1179,12 @@ bool MainWindow::populateMapList() {
ui->layoutList->setModel(layoutListProxyModel);
/// !TODO
ui->mapList->setSelectionMode(QAbstractItemView::ExtendedSelection);
ui->mapList->setDragEnabled(true);
ui->mapList->setAcceptDrops(true);
ui->mapList->setDropIndicatorShown(true);
ui->mapList->setDragDropMode(QAbstractItemView::InternalMove);
// ui->mapList->setSelectionMode(QAbstractItemView::ExtendedSelection);
// ui->mapList->setDragEnabled(true);
// ui->mapList->setAcceptDrops(true);
// ui->mapList->setDropIndicatorShown(true);
// ui->mapList->setDragDropMode(QAbstractItemView::InternalMove);
on_toolButton_EnableDisable_EditGroups_clicked();
return success;
}
@ -2852,6 +2853,24 @@ void MainWindow::on_toolButton_CollapseAll_Groups_clicked() {
}
}
void MainWindow::on_toolButton_EnableDisable_EditGroups_clicked() {
if (this->ui->toolButton_EnableDisable_EditGroups->isChecked()) {
ui->mapList->setSelectionMode(QAbstractItemView::ExtendedSelection);
ui->mapList->setDragEnabled(true);
ui->mapList->setAcceptDrops(true);
ui->mapList->setDropIndicatorShown(true);
ui->mapList->setDragDropMode(QAbstractItemView::InternalMove);
ui->mapList->setEditTriggers(QAbstractItemView::DoubleClicked | QAbstractItemView::EditKeyPressed);
} else {
ui->mapList->setSelectionMode(QAbstractItemView::NoSelection);
ui->mapList->setDragEnabled(false);
ui->mapList->setAcceptDrops(false);
ui->mapList->setDropIndicatorShown(false);
ui->mapList->setDragDropMode(QAbstractItemView::NoDragDrop);
ui->mapList->setEditTriggers(QAbstractItemView::NoEditTriggers);
}
}
void MainWindow::on_toolButton_HideShow_Areas_clicked() {
if (ui->areaList) {
this->areaListProxyModel->toggleHideEmpty();