-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqgsattributeactiondialog.h
85 lines (66 loc) · 2.82 KB
/
qgsattributeactiondialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/***************************************************************************
qgsattributeactiondialog.h - attribute action dialog
-------------------
This class creates and manages the Action tab of the Vector Layer
Properties dialog box. Changes made in the dialog box are propagated
back to QgsVectorLayer.
begin : October 2004
copyright : (C) 2004 by Gavin Macaulay
email : gavin at macaulay dot co dot nz
***************************************************************************/
/***************************************************************************
* *
* This program 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. *
* *
***************************************************************************/
#ifndef QGSATTRIBUTEACTIONDIALOG_H
#define QGSATTRIBUTEACTIONDIALOG_H
#include "ui_qgsattributeactiondialogbase.h"
#include "qgsattributetableconfig.h"
#include "qgsaction.h"
#include <QMap>
#include "qgis_app.h"
class QgsActionManager;
class QgsVectorLayer;
class APP_EXPORT QgsAttributeActionDialog: public QWidget, private Ui::QgsAttributeActionDialogBase
{
Q_OBJECT
private:
enum ColumnIndexes
{
Type,
Description,
ShortTitle,
ActionText,
Capture,
ActionScopes
};
public:
QgsAttributeActionDialog( const QgsActionManager &actions,
QWidget *parent = nullptr );
void init( const QgsActionManager &action, const QgsAttributeTableConfig &attributeTableConfig );
QList<QgsAction> actions() const;
bool showWidgetInAttributeTable() const;
QgsAttributeTableConfig::ActionWidgetStyle attributeTableWidgetStyle() const;
private slots:
void moveUp();
void moveDown();
void remove();
void insert();
void addDefaultActions();
void itemDoubleClicked( QTableWidgetItem *item );
void updateButtons();
private:
void insertRow( int row, const QgsAction &action );
void insertRow( int row, QgsAction::ActionType type, const QString &name, const QString &actionText, const QString &iconPath, bool capture, const QString &shortTitle, const QSet<QString> &actionScopes );
void swapRows( int row1, int row2 );
QgsAction rowToAction( int row ) const;
QString textForType( QgsAction::ActionType type );
void rowSelected( int row );
QString uniqueName( QString name );
QgsVectorLayer *mLayer = nullptr;
};
#endif