Action

Search for usage in LXR

Inheritance diagram for Action:

Properties

QtObject _private
 
var changedEntries
 
string configFile
 
QtObject engine
 
QtObject pageStack
 
int viewMode
 
bool visibleWhenDisabled
 
- Properties inherited from org::kde::kirigami::Action
list< QtObject > __children
 
alias children
 
Component displayComponent
 
int displayHint
 
bool expandible
 
alias iconName
 
alias iconSource
 
bool separator
 
string tooltip
 
bool visible
 
var visibleChildren
 

Signals

void entryEvent (QtObject entry, int event)
 

Public Member Functions

void showEntryDetails (providerId, entryId)
 
void showHotNewStuff ()
 
- Public Member Functions inherited from org::kde::kirigami::Action
void displayHintSet (hint)
 
- Public Member Functions inherited from QtQuick.Controls.Action
void toggle (source)
 
 toggled (checked)
 
 toggled (source)
 
void trigger (source)
 
void trigger (source)
 
 triggered (source)
 
 triggered (source)
 

Detailed Description

An action which when triggered will open a NewStuff.Dialog or a NewStuff.Page, depending on settings.

This component is equivalent to the old Button component, but functions in more modern applications

The following is a simple example of how to use this Action to show wallpapers from the KDE Store, on a system where Plasma has been installed (and consequently the wallpaper knsrc file is available). This also shows how to make the action push a page to a pageStack rather than opening a dialog:

import org.kde.newstuff 1.91 as NewStuff
NewStuff.Action {
configFile: "wallpaper.knsrc"
text: i18n("&Get New Wallpapers...")
pageStack: applicationWindow().pageStack
onEntryEvent: function(entry, event) {
if (event === NewStuff.Entry.StatusChangedEvent) {
// A entry was installed, updated or removed
} else if (event === NewStuff.Entry.AdoptedEvent) {
// The "AdoptionCommand" from the knsrc file was run for the given entry.
// This should not require refreshing the data for the model
}
}
}
See also
NewStuff.Button
Since
5.81

Definition at line 40 of file Action.qml.

Property Documentation

◆ _private

QtObject Action::_private
read
Remarks
This property is read-only

Definition at line 109 of file Action.qml.

◆ changedEntries

var Action::changedEntries
read

Contains the entries which have been changed.

Note
This is cleared when the page is shown, so the changed entries are those changed since the page was opened most recently (rather than the lifetime of the instance of the Action component)
Deprecated:
Since 5.82, use entryEvent instead

Definition at line 81 of file Action.qml.

◆ configFile

string Action::configFile
read

The configuration file to use for the Page created by this action.

Definition at line 54 of file Action.qml.

◆ engine

QtObject Action::engine
read

The engine which handles the content in this Action This will be null until the action has been triggered the first time.

Remarks
This property is read-only

Definition at line 73 of file Action.qml.

◆ pageStack

QtObject Action::pageStack
read

If this is set, the action will push a NewStuff.Page onto this page stack (and request it is made visible if triggered again).

If you do not set this property, the action will spawn a NewStuff.Dialog instead.

Note
If you are building a KCM, set this to your kcm object.

Definition at line 67 of file Action.qml.

◆ viewMode

int Action::viewMode
read

The default view mode of the page spawned by this action.

This should be set using the NewStuff.Page.ViewMode enum

See also
NewStuff.Page.ViewMode

Definition at line 60 of file Action.qml.

◆ visibleWhenDisabled

bool Action::visibleWhenDisabled
read

If this is true (default is false), the action will be shown when the Kiosk settings are such that Get Hot New Stuff is disallowed (and any other time enabled is set to false).

Usually you would want to leave this alone, but occasionally you may have a reason to leave a action in place that the user is unable to enable.

Definition at line 102 of file Action.qml.

Member Function Documentation

◆ entryEvent

void Action::entryEvent ( QtObject  entry,
int  event 
)
signal

This forwards the entry changed event from the QtQuick engine.

See also
Engine::entryEvent

◆ showEntryDetails()

void Action::showEntryDetails ( providerId  ,
entryId   
)

Show the details page for a specific entry.

If you call this function before the engine initialisation has been completed, the action itself will be postponed until that has happened.

Parameters
providerIdThe provider ID for the entry you wish to show details for
entryIdThe unique ID for the entry you wish to show details for
Since
5.79

◆ showHotNewStuff()

void Action::showHotNewStuff ( )

Show the page/dialog (same as activating the action), if allowed by the Kiosk settings.


The documentation for this class was generated from the following file:
string configFile
The configuration file to use for the Page created by this action.
Definition: Action.qml:54
QString i18n(const char *text, const TYPE &arg...)
QtObject pageStack
If this is set, the action will push a NewStuff.Page onto this page stack (and request it is made vis...
Definition: Action.qml:67
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat May 21 2022 03:54:57 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.