2 * Copyright 2013 Canonical Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 * Michael Zanetti <michael.zanetti@canonical.com>
20#include "launcheritem.h"
21#include "quicklistmodel.h"
23LauncherItem::LauncherItem(const QString &appId, const QString &name, const QString &icon, QObject *parent) :
24 LauncherItemInterface(parent),
34 m_quickList(new QuickListModel(this))
36 QuickListEntry nameAction;
37 nameAction.setText(m_name);
38 m_quickList->appendAction(nameAction);
39 QuickListEntry pinningAction;
40 pinningAction.setActionId("pin_item");
41 pinningAction.setText("Pin to Launcher");
42 m_quickList->appendAction(pinningAction);
45QString LauncherItem::appId() const
50QString LauncherItem::name() const
55QString LauncherItem::icon() const
60bool LauncherItem::pinned() const
65void LauncherItem::setPinned(bool pinned)
67 if (m_pinned != pinned) {
70 entry.setActionId("pin_item");
71 entry.setText(pinned ? "Remove from Launcher": "Pin to Launcher");
72 m_quickList->updateAction(entry);
73 Q_EMIT pinnedChanged(pinned);
77bool LauncherItem::running() const
82void LauncherItem::setRunning(bool running)
84 if (m_running != running) {
86 Q_EMIT runningChanged(running);
90bool LauncherItem::recent() const
95void LauncherItem::setRecent(bool recent)
97 if (m_recent != recent) {
99 Q_EMIT recentChanged(recent);
103int LauncherItem::progress() const
108void LauncherItem::setProgress(int progress)
110 if (m_progress != progress) {
111 m_progress = progress;
112 Q_EMIT progressChanged(progress);
116int LauncherItem::count() const
121void LauncherItem::setCount(int count)
123 if (m_count != count) {
125 Q_EMIT countChanged(count);
129bool LauncherItem::focused() const
134void LauncherItem::setFocused(bool focused)
136 if (m_focused != focused) {
138 Q_EMIT focusedChanged(focused);
142unity::shell::launcher::QuickListModelInterface *LauncherItem::quickList() const
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list