Skip to content

Commit

Permalink
master merged, conflicts resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
joern274 committed Jun 27, 2024
2 parents d379840 + 1acdb1a commit 803f7a6
Show file tree
Hide file tree
Showing 53 changed files with 2,302 additions and 1,152 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ All notable changes to this project will be documented in this file.
* added delete module action and shortcut
* added entries for context menu
* adapted appearance for menu content tree, selection details tree, grouping content tree (same model for all)
* refactored view widget
* changed appearance from tabular view to tree view
* added 'directory' elements to organize and manage groups of views
* added drag'n drop feature allowing to relocate views or directories to another branch in the tree
* added column for view ID
* added functions to Python GUI API to create, modify and delete views and directories
* added UNDO functionality for create/delete view and directory actions
* fixed sort-by-column feature. The tree is not sorted at program start thus showing elements in 'natural' order.
* refactored search bar
* changed appearance of search bar to be more intuitive
* added menu for extended options - e.g. option to search in selected columns only
Expand Down Expand Up @@ -65,7 +73,6 @@ All notable changes to this project will be documented in this file.
* added support for Ubuntu 24.04 LTS
* added INIT field declaration to FF-gate-types in example library
* added drag'n drop feature allowing to move several nodes in graph view at same time
* added functions to Python GUI API to create, modify and delete views
* added GUI PluginParameter type `ComboBox` for parameters that can be requested from plugin
* added GUI PluginParameter types `Module` and `Gated` for parameters that can be requested from plugin
* added `Show content` button to `Groupings` widget to show content of grouping as a list
Expand Down
2 changes: 2 additions & 0 deletions plugins/gui/include/gui/basic_tree_model/base_tree_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ namespace hal
*/
BaseTreeItem* getRootItem() const;

void insertChildItem(BaseTreeItem* childItem, BaseTreeItem* parentItem = nullptr, int row = -1);

protected:
RootTreeItem* mRootItem;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#include "hal_core/defines.h"

#include "gui/graph_widget/contexts/graph_context.h"
#include "gui/context_manager_widget/models/context_table_model.h"
#include "gui/context_manager_widget/models/context_table_proxy_model.h"
#include "gui/context_manager_widget/models/context_tree_model.h"
#include "gui/context_manager_widget/models/context_proxy_model.h"
#include "gui/searchbar/searchbar.h"
#include "gui/settings/settings_items/settings_item_keybind.h"

Expand All @@ -40,6 +40,8 @@
#include <QTableView>
#include <QPushButton>
#include <QMenu>
#include <QTreeView>



namespace hal
Expand All @@ -60,6 +62,7 @@ namespace hal
Q_OBJECT
Q_PROPERTY(QString disabledIconStyle READ disabledIconStyle WRITE setDisabledIconStyle)
Q_PROPERTY(QString newViewIconPath READ newViewIconPath WRITE setNewViewIconPath)
Q_PROPERTY(QString newDirIconPath READ newDirIconPath WRITE setNewDirIconPath)
Q_PROPERTY(QString newViewIconStyle READ newViewIconStyle WRITE setNewViewIconStyle)
Q_PROPERTY(QString renameIconPath READ renameIconPath WRITE setRenameIconPath)
Q_PROPERTY(QString renameIconStyle READ renameIconStyle WRITE setRenameIconStyle)
Expand All @@ -84,7 +87,7 @@ namespace hal
ContextManagerWidget(GraphTabWidget* tab_view, QWidget* parent = nullptr);

/**
* Selects the given context if possible (if it is indeed in the widget's ContextTableModel).
* Selects the given context if possible (if it is indeed in the widget's ContextTreeModel).
*
* @param context - The context to select.
*/
Expand All @@ -97,11 +100,28 @@ namespace hal
*/
GraphContext* getCurrentContext();

/**
* Get the currently selected directory in the table.
*
* @return The ContextTreeItem.
*/
ContextTreeItem* getCurrentItem();

/**
* Opens the currently selected GraphContext in hal's GraphTabWidget
*/
void handleOpenContextClicked();

/**
* Handle double clicked
*/
void handleItemDoubleClicked(const QModelIndex &proxyIndex);

/**
* Handle clicked
*/
void handleItemClicked(const QModelIndex &proxyIndex);

/**
* Initializes the Toolbar of the ContextManagerWidget.
*
Expand All @@ -119,6 +139,7 @@ namespace hal
///@{
QString disabledIconStyle() const;
QString newViewIconPath() const;
QString newDirIconPath() const;
QString newViewIconStyle() const;
QString renameIconPath() const;
QString renameIconStyle() const;
Expand All @@ -139,6 +160,7 @@ namespace hal
void setDisabledIconStyle(const QString &path);
void setNewViewIconPath(const QString &path);
void setNewViewIconStyle(const QString &style);
void setNewDirIconPath(const QString &path);
void setRenameIconPath(const QString &path);
void setRenameIconStyle(const QString &style);
void setDeleteIconPath(const QString &path);
Expand Down Expand Up @@ -167,30 +189,48 @@ namespace hal
*/
void updateSearchIcon();

/**
* Q_SLOT to select the Directory.
*/
void selectDirectory(ContextTreeItem* item);

void handleRowsInserted(const QModelIndex &parent, int first, int last);

private Q_SLOTS:

void handleDeleteShortcutOnFocusChanged(QWidget* oldWidget, QWidget* newWidget);
void handleFocusChanged(QWidget* oldWidget, QWidget* newWidget);
void handleCreateContextClicked();
void handleCreateDirectoryClicked();
void handleRenameClicked();
void handleDuplicateContextClicked();
void handleDeleteClicked();

void handleContextMenuRequest(const QPoint& point);
void handleSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);

private:
GraphTabWidget* mTabView;

QTableView* mContextTableView;
ContextTableModel* mContextTableModel;
ContextTableProxyModel* mContextTableProxyModel;
QTreeView* mContextTreeView;
ContextTreeModel* mContextTreeModel;
ContextProxyModel* mContextTreeProxyModel;

Searchbar* mSearchbar;

QString mDisabledIconStyle;

QAction* mNewDirectoryAction;

QAction* mNewViewAction;
QString mNewViewIconPath;
QString mNewDirIconPath;
QString mNewViewIconStyle;

QAction* mRenameAction;
QString mRenameIconPath;
QString mRenameIconStyle;


QAction* mDuplicateAction;
QString mDuplicateIconPath;
QString mDuplicateIconStyle;
Expand All @@ -209,14 +249,6 @@ namespace hal

QShortcut* mShortCutDeleteItem;

void handleCreateContextClicked();
void handleRenameContextClicked();
void handleDuplicateContextClicked();
void handleDeleteContextClicked();

void handleContextMenuRequest(const QPoint& point);
void handleSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);

void setToolbarButtonsEnabled(bool enabled);

void toggleSearchbar();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@

#include <QRegularExpression>
#include <QSortFilterProxyModel>
#include <QMimeData>

namespace hal
{
/**
* @ingroup utility_widgets-context
* @brief A proxy model to filter the ContextTableModel by a given string.
*/
class ContextTableProxyModel : public SearchProxyModel
class ContextProxyModel : public SearchProxyModel
{
Q_OBJECT

Expand All @@ -47,7 +48,7 @@ namespace hal
*
* @param parent - The widget's parent.
*/
ContextTableProxyModel(QObject* parent = nullptr);
ContextProxyModel(QObject* parent = nullptr);

/**
* Determines if the index specified by the row and its parent should be displayed
Expand All @@ -60,6 +61,11 @@ namespace hal
*/
bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override;

QStringList mimeTypes() const override;
QMimeData* mimeData(const QModelIndexList &indexes) const override;
bool dropMimeData(const QMimeData *mimeData, Qt::DropAction action, int row, int column, const QModelIndex &parent) override;
bool canDropMimeData(const QMimeData *mimeData, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override;

public Q_SLOTS:

/**
Expand All @@ -74,13 +80,13 @@ namespace hal
protected:

/**
* Defines the compare criteria of 2 data entries (might be defined for each column specifically).
* Defines the compare criteria of tree entries (might be defined for each column specifically).
*
* @param left - The first entry.
* @param right - The seconds entry.
* @return True if left < right, False otherwise.
*/
bool lessThan(const QModelIndex& left, const QModelIndex& right) const override;
bool lessThan(const QModelIndex& left, const QModelIndex& right) const override;

};
} // namespace hal

This file was deleted.

Loading

0 comments on commit 803f7a6

Please sign in to comment.