| Home · All Namespaces · All Classes |
#include <launcherbutton.h>


Public Member Functions | |
| LauncherButton (const QString &desktopEntryPath=QString(), MWidget *parent=0) | |
| virtual | ~LauncherButton () |
| void | setAction (const LauncherAction &action) |
| Sets the action to launch the application described by the desktop file. | |
| LauncherAction | action () const |
| Returns the action to launch the application described by the desktop file. | |
| QString | desktopEntry () const |
| LauncherButtonModel::State | buttonState () const |
| void | updateFromDesktopEntry (const QString &desktopEntryPath) |
| void | retranslateUi () |
| void | setState (LauncherButtonModel::State state, int progress, const QString &desktopEntryPath) |
| int | operationProgress () const |
Properties | |
| QString | desktopEntryPath |
| LauncherButtonModel::State | buttonState |
| int | operationProgress |
Button widget that can launch an application when its being clicked.
User has to set the target to be launched using setTarget() method and the target type using the setTargetType() method. The target type can be an Application. If the target type is an Application and the target is set this button widget launches the specified application into its own process when the button is clicked.
Definition at line 41 of file launcherbutton.h.
| LauncherButton::LauncherButton | ( | const QString & | desktopEntryPath = QString(), |
|
| MWidget * | parent = 0 | |||
| ) |
Creates a launcher button instance from a MDesktopEntry.
| desktopEntryPath | Path to the desktop entry to create a launcher button from | |
| parent | the parent widget, defaults to NULL |
Definition at line 30 of file launcherbutton.cpp.
:
MButton(parent, new LauncherButtonModel),
windowMonitor(new HomeWindowMonitor)
{
init();
updateFromDesktopEntry(desktopEntryPath);
}
| LauncherButton::~LauncherButton | ( | ) | [virtual] |
| LauncherAction LauncherButton::action | ( | ) | const |
Returns the action to launch the application described by the desktop file.
Definition at line 54 of file launcherbutton.cpp.
{
return model()->action();
}
| LauncherButtonModel::State LauncherButton::buttonState | ( | ) | const |
Returns current button state.
| QString LauncherButton::desktopEntry | ( | ) | const |
Returns the file name of the desktop entry where this launcher button was constructed from.
Definition at line 59 of file launcherbutton.cpp.
{
return model()->desktopEntryFile();
}
| int LauncherButton::operationProgress | ( | ) | const |
Returns progress of button's ongoing operation
| void LauncherButton::retranslateUi | ( | ) |
Handles the language change notification and propagets is to MButton.
Definition at line 94 of file launcherbutton.cpp.
{
if (!desktopEntry().isNull()) {
setText(action().localizedName());
}
MButton::retranslateUi();
}

| void LauncherButton::setAction | ( | const LauncherAction & | action | ) |
Sets the action to launch the application described by the desktop file.
| action | The action to launch the application |
Definition at line 49 of file launcherbutton.cpp.
{
model()->setAction(action);
}
| void LauncherButton::setState | ( | LauncherButtonModel::State | state, | |
| int | progress, | |||
| const QString & | desktopEntryPath | |||
| ) |
Sets the state and progress of a button Progress property is changed only if parameter progress is valid (0..100)
| state | State of a button | |
| progress | Progress of operation | |
| desktopEntryPath | Path to the desktop entry. |
Definition at line 114 of file launcherbutton.cpp.
{
model()->setButtonState(state);
if (progress >= 0 && progress <= 100) {
model()->setOperationProgress(progress);
}
// Override the current desktop entry when changing to broken or installed state
if (state == LauncherButtonModel::Broken || state == LauncherButtonModel::Installed) {
updateFromDesktopEntry(desktopEntryPath);
}
}

| void LauncherButton::updateFromDesktopEntry | ( | const QString & | desktopEntryPath | ) |
Updates button from given desktop entry.
| desktopEntryPath | Path to the desktop entry to update the button from. |
Definition at line 102 of file launcherbutton.cpp.
{
if (!desktopEntryPath.isEmpty()) {
LauncherAction action(desktopEntryPath);
setText(action.localizedName());
model()->setDesktopEntryFile(desktopEntryPath);
setAction(action);
}
}

LauncherButtonModel::State LauncherButton::buttonState [read] |
Definition at line 47 of file launcherbutton.h.
QString LauncherButton::desktopEntryPath [read] |
Definition at line 46 of file launcherbutton.h.
int LauncherButton::operationProgress [read] |
Definition at line 48 of file launcherbutton.h.
| Copyright © 2010 Nokia Corporation | Generated on Thu Nov 4 2010 18:20:42 Doxygen 1.7.1 |
MeeGo Touch |