-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATHRE] attribute action improvements
- add python bindings for attribute actions - support actions as context menu in feature form (ui) - add action types: * generic: commands that should work on all platforms * windows, mac, unix: commands that should work and are only shown on one platform respectively (eg. vim on unix, notepad on windows and textmate on Mac) * python: python strings to be executed instead of a command (eg. qgis.utils.plugins['apluginname'].amethod('[%someattribute%]')) [BUGFIXES] - ogr support for relative filenames fixed - relative filename support also for feature form uis git-svn-id: http://svn.osgeo.org/qgis/trunk@12113 c8812cc2-4d05-0410-92ff-de0c093fc19c
- Loading branch information
jef
committed
Nov 15, 2009
1 parent
095ff72
commit 0322442
Showing
15 changed files
with
407 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
class QgsAction | ||
{ | ||
%TypeHeaderCode | ||
#include "qgsattributeaction.h" | ||
%End | ||
|
||
public: | ||
enum ActionType | ||
{ | ||
Generic, | ||
GenericPython, | ||
Mac, | ||
Windows, | ||
Unix, | ||
}; | ||
|
||
QgsAction( ActionType type, QString name, QString action, bool capture ); | ||
|
||
//! The name of the action | ||
QString name() const; | ||
|
||
//! The action | ||
QString action() const; | ||
|
||
//! The action type | ||
ActionType type() const; | ||
|
||
//! Whether to capture output for display when this action is run | ||
bool capture() const; | ||
|
||
bool runable() const; | ||
}; | ||
|
||
class QgsAttributeAction | ||
{ | ||
%TypeHeaderCode | ||
#include "qgsattributeaction.h" | ||
%End | ||
public: | ||
QgsAttributeAction(); | ||
|
||
//! Destructor | ||
virtual ~QgsAttributeAction(); | ||
|
||
//! Add an action with the given name and action details. | ||
// Will happily have duplicate names and actions. If | ||
// capture is true, when running the action using doAction(), | ||
// any stdout from the process will be captured and displayed in a | ||
// dialog box. | ||
void addAction( QgsAction::ActionType type, QString name, QString action, bool capture = false ); | ||
|
||
/* | ||
//! Does the action using the given values. defaultValueIndex is an | ||
// index into values which indicates which value in the values vector | ||
// is to be used if the action has a default placeholder. | ||
void doAction( int index, const QList< QPair<QString, QString> > &values, | ||
int defaultValueIndex = 0, void *executePython = 0 ); | ||
*/ | ||
|
||
//! Removes all actions | ||
void clearActions(); | ||
|
||
//! Expands the given action, replacing all %'s with the value as | ||
// given. | ||
static QString expandAction( QString action, const QList< QPair<QString, QString> > &values, | ||
uint defaultValueIndex ); | ||
|
||
//! Writes the actions out in XML format | ||
bool writeXML( QDomNode& layer_node, QDomDocument& doc ) const; | ||
|
||
//! Reads the actions in in XML format | ||
bool readXML( const QDomNode& layer_node ); | ||
|
||
//! interface to inherited methods from QList<QgsAction> | ||
const QgsAction &at( int idx ); | ||
const int size(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.