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"
25LauncherItem::LauncherItem(const QString &appId, const QString &name, const QString &icon, QObject *parent) :
26 LauncherItemInterface(parent),
35 m_countVisible(false),
37 m_quickList(new QuickListModel(this))
39 QuickListEntry nameAction;
40 nameAction.setText(m_name);
41 m_quickList->appendAction(nameAction);
42 QuickListEntry pinningAction;
43 pinningAction.setActionId("pin_item");
44 pinningAction.setText(gettext("Pin shortcut"));
45 m_quickList->appendAction(pinningAction);
48QString LauncherItem::appId() const
53QString LauncherItem::name() const
58void LauncherItem::setName(const QString &name)
62 Q_EMIT nameChanged(name);
66QString LauncherItem::icon() const
71void LauncherItem::setIcon(const QString &icon)
75 Q_EMIT iconChanged(icon);
79bool LauncherItem::pinned() const
84void LauncherItem::setPinned(bool pinned)
86 if (m_pinned != pinned) {
89 entry.setActionId("pin_item");
90 entry.setText(pinned ? gettext("Unpin shortcut") : gettext("Pin shortcut"));
91 m_quickList->updateAction(entry);
92 Q_EMIT pinnedChanged(pinned);
96bool LauncherItem::running() const
101void LauncherItem::setRunning(bool running)
103 if (m_running != running) {
105 Q_EMIT runningChanged(running);
109bool LauncherItem::recent() const
114void LauncherItem::setRecent(bool recent)
116 if (m_recent != recent) {
118 Q_EMIT recentChanged(recent);
122int LauncherItem::progress() const
127void LauncherItem::setProgress(int progress)
129 if (m_progress != progress) {
130 m_progress = progress;
131 Q_EMIT progressChanged(progress);
135int LauncherItem::count() const
140void LauncherItem::setCount(int count)
142 if (m_count != count) {
144 Q_EMIT countChanged(count);
148bool LauncherItem::countVisible() const
150 return m_countVisible;
153void LauncherItem::setCountVisible(bool countVisible)
155 if (m_countVisible != countVisible) {
156 m_countVisible = countVisible;
157 Q_EMIT countVisibleChanged(countVisible);
161bool LauncherItem::focused() const
166void LauncherItem::setFocused(bool focused)
168 if (m_focused != focused) {
170 Q_EMIT focusedChanged(focused);
174unity::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