diff --git a/forms/mainwindow.ui b/forms/mainwindow.ui index 244f1b29..92bf0b13 100644 --- a/forms/mainwindow.ui +++ b/forms/mainwindow.ui @@ -89,8 +89,8 @@ - :/icons/folder_eye_closed.ico - :/icons/folder_eye_open.ico + :/icons/folder_eye_open.ico + :/icons/folder_eye_closed.ico @@ -144,6 +144,31 @@ + + + + <html><head/><body><p>Toggle editability of group folders</p></body></html> + + + + + + + :/icons/lock_edit.ico + :/icons/unlock_edit.ico + + + + QToolButton::InstantPopup + + + true + + + true + + + @@ -249,8 +274,8 @@ - :/icons/folder_eye_closed.ico - :/icons/folder_eye_open.ico + :/icons/folder_eye_open.ico + :/icons/folder_eye_closed.ico @@ -409,8 +434,8 @@ - :/icons/folder_eye_closed.ico - :/icons/folder_eye_open.ico + :/icons/folder_eye_open.ico + :/icons/folder_eye_closed.ico diff --git a/include/mainwindow.h b/include/mainwindow.h index 4a5d5777..536f659c 100644 --- a/include/mainwindow.h +++ b/include/mainwindow.h @@ -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(); diff --git a/resources/icons/lock_edit.ico b/resources/icons/lock_edit.ico new file mode 100644 index 00000000..f30f4249 Binary files /dev/null and b/resources/icons/lock_edit.ico differ diff --git a/resources/icons/unlock_edit.ico b/resources/icons/unlock_edit.ico new file mode 100644 index 00000000..85a99e98 Binary files /dev/null and b/resources/icons/unlock_edit.ico differ diff --git a/resources/images.qrc b/resources/images.qrc index 8131040a..792c5705 100644 --- a/resources/images.qrc +++ b/resources/images.qrc @@ -18,6 +18,8 @@ icons/folder_map_opened.ico icons/folder_map.ico icons/folder.ico + icons/lock_edit.ico + icons/unlock_edit.ico icons/map_edited.ico icons/map_opened.ico icons/map.ico diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 1c7da36c..b609be59 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -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();