2 * Copyright (C) 2013 Canonical, Ltd.
5 * Michael Zanetti <michael.zanetti@canonical.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 3.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20#include "launcherbackend.h"
24LauncherBackend::LauncherBackend(QObject *parent):
28 // TODO: load default pinned ones from default config, instead of hardcoding here...
31 QLatin1String("phone-app.desktop") <<
32 QLatin1String("camera-app.desktop") <<
33 QLatin1String("gallery-app.desktop") <<
34 QLatin1String("facebook-webapp.desktop") <<
35 QLatin1String("webbrowser-app.desktop") <<
36 QLatin1String("twitter-webapp.desktop") <<
37 QLatin1String("gmail-webapp.desktop") <<
38 QLatin1String("ubuntu-weather-app.desktop") <<
39 QLatin1String("notes-app.desktop") <<
40 QLatin1String("ubuntu-calendar-app.desktop");
43LauncherBackend::~LauncherBackend()
48QStringList LauncherBackend::storedApplications() const
53void LauncherBackend::setStoredApplications(const QStringList &appIds)
55 m_storedApps = appIds;
56 // TODO: Cleanup pinned state from settings for apps not in list any more.
59QString LauncherBackend::desktopFile(const QString &appId) const
61 // TODO: return real path instead of this hardcoded one
62 return QLatin1String("/usr/share/applications/") + appId;
65QString LauncherBackend::displayName(const QString &appId) const
67 // TODO: get stuff from desktop files instead this hardcoded map
68 QHash<QString, QString> map;
69 map.insert("phone-app.desktop", "Phone");
70 map.insert("camera-app.desktop", "Camera");
71 map.insert("gallery-app.desktop", "Gallery");
72 map.insert("facebook-webapp.desktop", "Facebook");
73 map.insert("webbrowser-app.desktop", "Browser");
74 map.insert("twitter-webapp.desktop", "Twitter");
75 map.insert("gmail-webapp.desktop", "GMail");
76 map.insert("ubuntu-weather-app.desktop", "Weather");
77 map.insert("notes-app.desktop", "Notes");
78 map.insert("ubuntu-calendar-app.desktop", "Calendar");
79 return map.value(appId);
82QString LauncherBackend::icon(const QString &appId) const
84 // TODO: get stuff from desktop files instead this hardcoded map
85 QHash<QString, QString> map;
86 map.insert("phone-app.desktop", "phone-app");
87 map.insert("camera-app.desktop", "camera");
88 map.insert("gallery-app.desktop", "gallery");
89 map.insert("facebook-webapp.desktop", "facebook");
90 map.insert("webbrowser-app.desktop", "browser");
91 map.insert("twitter-webapp.desktop", "twitter");
92 map.insert("gmail-webapp.desktop", "gmail");
93 map.insert("ubuntu-weather-app.desktop", "weather");
94 map.insert("notes-app.desktop", "notepad");
95 map.insert("ubuntu-calendar-app.desktop", "calendar");
96 return map.value(appId);
99bool LauncherBackend::isPinned(const QString &appId) const
101 // TODO: return app's pinned state from settings
106void LauncherBackend::setPinned(const QString &appId, bool pinned)
108 // TODO: Store pinned state in settings.
113QList<QuickListEntry> LauncherBackend::quickList(const QString &appId) const
115 // TODO: Get static (from .desktop file) and dynamic (from the app itself)
116 // entries and return them here. Frontend related entries (like "Pin to launcher")
117 // don't matter here. This is just the backend part.
118 // TODO: emit quickListChanged() when the dynamic part changes
120 return QList<QuickListEntry>();
123int LauncherBackend::progress(const QString &appId) const
125 // TODO: Return value for progress emblem.
126 // TODO: emit progressChanged() when this value changes.
131int LauncherBackend::count(const QString &appId) const
133 // TODO: Return value for count emblem.
134 // TODO: emit countChanged() when this value changes.
139void LauncherBackend::triggerQuickListAction(const QString &appId, const QString &quickListId)
141 // TODO: execute the given quicklist action
143 Q_UNUSED(quickListId)
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