Action

Search for usage in LXR

Properties

string configFile
 
NewStuffEngine engine
 
Item pageStack
 
Window transientParent
 
int viewMode
 
bool visibleWhenDisabled
 

Signals

void entryEvent (var entry, int event)
 

Public Member Functions

void showHotNewStuff ()
 

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 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
}
}
}
Item 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:70
QString i18n(const char *text, const TYPE &arg...)
See also
NewStuff.Button
Since
5.81

Definition at line 41 of file Action.qml.

Property Documentation

◆ configFile

string Action::configFile
read

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

Definition at line 55 of file Action.qml.

◆ engine

NewStuffEngine 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 76 of file Action.qml.

◆ pageStack

Item 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 70 of file Action.qml.

◆ transientParent

Window Action::transientParent
read

The parent window for the dialog created by invoking the action.

Since
6.1

Definition at line 95 of file Action.qml.

◆ viewMode

int Action::viewMode
read

The view mode of the page spawned by this action, which overrides the default one (ViewMode.Tiles).

This should be set using the NewStuff.Page.ViewMode enum. Note that ViewMode.Icons has been removed, and asking for it will return ViewMode.Tiles.

See also
NewStuff.Page.ViewMode

Definition at line 63 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 88 of file Action.qml.

Member Function Documentation

◆ entryEvent

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

This forwards the entry changed event from the QtQuick engine.

See also
Engine::entryEvent

◆ 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:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sun Nov 17 2024 19:25:28 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.