2007-12-01 10:47:15 +00:00
|
|
|
/*
|
2020-06-15 17:42:37 +02:00
|
|
|
Copyright 2006-2020 The QElectroTech Team
|
2007-12-01 10:47:15 +00:00
|
|
|
This file is part of QElectroTech.
|
|
|
|
|
|
|
|
QElectroTech is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
QElectroTech is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2007-02-26 22:42:46 +00:00
|
|
|
#ifndef ELEMENTS_PANEL_WIDGET_H
|
2007-04-09 02:56:47 +00:00
|
|
|
#define ELEMENTS_PANEL_WIDGET_H
|
2016-05-25 15:12:01 +00:00
|
|
|
|
2007-04-09 02:56:47 +00:00
|
|
|
#include "elementspanel.h"
|
2016-05-25 15:12:01 +00:00
|
|
|
|
2007-04-09 02:56:47 +00:00
|
|
|
/**
|
2020-07-24 22:44:10 +02:00
|
|
|
@brief The ElementsPanelWidget class
|
|
|
|
This class embeds an elements panel under a toolbar
|
|
|
|
providing various actions to manage elements.
|
2012-11-09 21:09:24 +00:00
|
|
|
@see ElementsPanel
|
2007-04-09 02:56:47 +00:00
|
|
|
*/
|
|
|
|
class ElementsPanelWidget : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
|
2012-11-09 21:09:24 +00:00
|
|
|
// constructors, destructor
|
2007-04-09 02:56:47 +00:00
|
|
|
public:
|
2017-08-05 02:06:59 +00:00
|
|
|
ElementsPanelWidget(QWidget * = nullptr);
|
2017-08-05 02:10:01 +00:00
|
|
|
~ElementsPanelWidget() override;
|
2007-04-12 03:13:13 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
ElementsPanelWidget(const ElementsPanelWidget &);
|
2007-04-09 02:56:47 +00:00
|
|
|
|
2012-11-09 21:09:24 +00:00
|
|
|
// attributes
|
2007-04-09 02:56:47 +00:00
|
|
|
private:
|
|
|
|
ElementsPanel *elements_panel;
|
2013-02-03 19:25:02 +00:00
|
|
|
QAction *open_directory, *copy_path;
|
2020-07-24 22:44:32 +02:00
|
|
|
QAction *prj_activate,
|
|
|
|
*prj_close,
|
|
|
|
*prj_edit_prop,
|
|
|
|
*prj_prop_diagram,
|
|
|
|
*prj_add_diagram,
|
|
|
|
*prj_del_diagram,
|
|
|
|
*prj_move_diagram_up,
|
|
|
|
*prj_move_diagram_top,
|
|
|
|
*prj_move_diagram_down,
|
|
|
|
*prj_move_diagram_upx10,
|
|
|
|
*prj_move_diagram_downx10;
|
2010-12-24 21:00:11 +00:00
|
|
|
QAction *tbt_add, *tbt_edit, *tbt_remove;
|
2007-10-28 16:03:18 +00:00
|
|
|
QMenu *context_menu;
|
2007-12-29 15:00:30 +00:00
|
|
|
QLineEdit *filter_textfield;
|
2007-04-09 02:56:47 +00:00
|
|
|
|
2012-11-09 21:09:24 +00:00
|
|
|
// methods
|
2007-04-09 02:56:47 +00:00
|
|
|
public:
|
2007-04-12 03:13:13 +00:00
|
|
|
inline ElementsPanel &elementsPanel() const;
|
2007-04-09 02:56:47 +00:00
|
|
|
|
2009-04-03 19:30:25 +00:00
|
|
|
signals:
|
2012-06-25 06:27:24 +00:00
|
|
|
void requestForProject(QETProject *);
|
2009-04-03 19:30:25 +00:00
|
|
|
void requestForNewDiagram(QETProject *);
|
|
|
|
void requestForProjectClosing(QETProject *);
|
|
|
|
void requestForProjectPropertiesEdition(QETProject *);
|
|
|
|
void requestForDiagramPropertiesEdition(Diagram *);
|
|
|
|
void requestForDiagramDeletion(Diagram *);
|
2010-02-28 16:13:45 +00:00
|
|
|
void requestForDiagramMoveUp(Diagram *);
|
|
|
|
void requestForDiagramMoveDown(Diagram *);
|
2015-03-04 06:00:25 +00:00
|
|
|
void requestForDiagramMoveUpTop(Diagram *);
|
2014-12-14 17:01:11 +00:00
|
|
|
void requestForDiagramMoveUpx10(Diagram *);
|
|
|
|
void requestForDiagramMoveDownx10(Diagram *);
|
2009-04-03 19:30:25 +00:00
|
|
|
|
2007-04-09 02:56:47 +00:00
|
|
|
public slots:
|
2013-02-03 19:25:02 +00:00
|
|
|
void openDirectoryForSelectedItem();
|
|
|
|
void copyPathForSelectedItem();
|
2008-01-19 19:19:11 +00:00
|
|
|
void reloadAndFilter();
|
2012-06-25 06:27:24 +00:00
|
|
|
void activateProject();
|
2009-04-03 19:30:25 +00:00
|
|
|
void closeProject();
|
|
|
|
void editProjectProperties();
|
|
|
|
void editDiagramProperties();
|
|
|
|
void newDiagram();
|
|
|
|
void deleteDiagram();
|
2010-02-28 16:13:45 +00:00
|
|
|
void moveDiagramUp();
|
|
|
|
void moveDiagramDown();
|
2015-03-04 06:00:25 +00:00
|
|
|
void moveDiagramUpTop();
|
2014-12-14 17:01:11 +00:00
|
|
|
void moveDiagramUpx10();
|
|
|
|
void moveDiagramDownx10();
|
2010-12-24 21:00:11 +00:00
|
|
|
void addTitleBlockTemplate();
|
|
|
|
void editTitleBlockTemplate();
|
|
|
|
void removeTitleBlockTemplate();
|
2007-08-28 21:17:11 +00:00
|
|
|
void updateButtons();
|
2007-10-28 16:03:18 +00:00
|
|
|
void handleContextMenu(const QPoint &);
|
2012-02-06 21:21:43 +00:00
|
|
|
void filterEdited(const QString &);
|
2016-05-13 15:00:22 +00:00
|
|
|
|
|
|
|
protected:
|
2020-07-24 22:44:32 +02:00
|
|
|
void keyPressEvent (QKeyEvent *e) override;
|
2009-04-03 19:30:25 +00:00
|
|
|
|
|
|
|
private:
|
2012-02-06 21:21:43 +00:00
|
|
|
QString previous_filter_;
|
2007-04-09 02:56:47 +00:00
|
|
|
};
|
2007-04-12 03:13:13 +00:00
|
|
|
|
|
|
|
/**
|
2020-07-24 22:44:10 +02:00
|
|
|
@brief ElementsPanelWidget::elementsPanel
|
2012-11-09 21:09:24 +00:00
|
|
|
@return The elements panel embedded within this widget.
|
2007-04-12 03:13:13 +00:00
|
|
|
*/
|
2020-09-07 22:03:40 +02:00
|
|
|
inline ElementsPanel &ElementsPanelWidget::elementsPanel() const
|
|
|
|
{
|
2007-04-12 03:13:13 +00:00
|
|
|
return(*elements_panel);
|
|
|
|
}
|
|
|
|
|
2007-02-26 22:42:46 +00:00
|
|
|
#endif
|