Search for usage in LXR

org::kde::newstuff::Action Class Reference

Inherits Action.


QtObject _private
var changedEntries
string configFile
QtObject engine
QtObject pageStack
int viewMode
bool visibleWhenDisabled


void entryEvent (QtObject entry, int event)

Public Member Functions

void showEntryDetails (providerId, entryId)
void showHotNewStuff ()

Detailed Description

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

1.81 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.81 as NewStuff
NewStuff.Action {
configFile: "wallpaper.knsrc"
text: i18n("&Get New Wallpapers...")
pageStack: applicationWindow().pageStack
function() onEntryEvent(entry, event) {
// do something depending on the type of event or the entry you are given
// such as updating the item in your own model representing that entry,
// or adding or removing the item. Try and avoid reloading full models.
See also

Definition at line 39 of file Action.qml.

Property Documentation

QtObject org::kde::newstuff::Action::_private
This property is read-only

Definition at line 108 of file Action.qml.

var org::kde::newstuff::Action::changedEntries

Contains the entries which have been changed.

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)
Since 5.82, use entryEvent instead

Definition at line 80 of file Action.qml.

string org::kde::newstuff::Action::configFile

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

Definition at line 53 of file Action.qml.

QtObject org::kde::newstuff::Action::engine

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

This property is read-only

Definition at line 72 of file Action.qml.

QtObject org::kde::newstuff::Action::pageStack

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.

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

Definition at line 66 of file Action.qml.

int org::kde::newstuff::Action::viewMode

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

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

See also

Definition at line 59 of file Action.qml.

bool org::kde::newstuff::Action::visibleWhenDisabled

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

Member Function Documentation

void org::kde::newstuff::Action::entryEvent ( QtObject  entry,
int  event 

This forwards the entry changed event from the QtQuick engine.

See also
void org::kde::newstuff::Action::showEntryDetails ( providerId  ,

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.

providerIdThe provider ID for the entry you wish to show details for
entryIdThe unique ID for the entry you wish to show details for
void org::kde::newstuff::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-2021 The KDE developers.
Generated on Mon Oct 18 2021 22:43:10 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.