2 * Copyright 2014-2015 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#include "launcheritem.h"
18#include "quicklistmodel.h"
22LauncherItem::LauncherItem(const QString &appId, const QString &name, const QString &icon, QObject *parent) :
23 LauncherItemInterface(parent),
32 m_countVisible(false),
35 m_quickList(new QuickListModel(this))
37 QuickListEntry nameAction;
38 nameAction.setActionId("launch_item");
39 nameAction.setText(m_name);
40 m_quickList->appendAction(nameAction);
43QString LauncherItem::appId() const
48QString LauncherItem::name() const
53void LauncherItem::setName(const QString &name)
58 entry.setActionId("launch_item");
59 entry.setText(m_name);
60 m_quickList->updateAction(entry);
61 Q_EMIT nameChanged(name);
65QString LauncherItem::icon() const
70void LauncherItem::setIcon(const QString &icon)
74 Q_EMIT iconChanged(icon);
78bool LauncherItem::pinned() const
83void LauncherItem::setPinned(bool pinned)
85 if (m_pinned != pinned) {
87 Q_EMIT pinnedChanged(pinned);
91bool LauncherItem::running() const
96void LauncherItem::setRunning(bool running)
98 if (m_running != running) {
100 Q_EMIT runningChanged(running);
104bool LauncherItem::recent() const
109void LauncherItem::setRecent(bool recent)
111 if (m_recent != recent) {
113 Q_EMIT recentChanged(recent);
117int LauncherItem::progress() const
122void LauncherItem::setProgress(int progress)
124 if (m_progress != progress) {
125 m_progress = progress;
126 Q_EMIT progressChanged(progress);
130int LauncherItem::count() const
135void LauncherItem::setCount(int count)
137 if (m_count != count) {
139 Q_EMIT countChanged(count);
143bool LauncherItem::countVisible() const
145 return m_countVisible;
148void LauncherItem::setCountVisible(bool countVisible)
150 if (m_countVisible != countVisible) {
151 m_countVisible = countVisible;
152 Q_EMIT countVisibleChanged(countVisible);
156bool LauncherItem::focused() const
161void LauncherItem::setFocused(bool focused)
163 if (m_focused != focused) {
165 Q_EMIT focusedChanged(focused);
169bool LauncherItem::alerting() const
174void LauncherItem::setAlerting(bool alerting)
176 if (m_alerting != alerting) {
177 m_alerting = alerting;
178 Q_EMIT alertingChanged(alerting);
182unity::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