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("dialer-app.desktop") <<
32 QLatin1String("messaging-app.desktop") <<
33 QLatin1String("address-book-app.desktop") <<
34 QLatin1String("camera-app.desktop") <<
35 QLatin1String("gallery-app.desktop") <<
36 QLatin1String("facebook-webapp.desktop") <<
37 QLatin1String("webbrowser-app.desktop") <<
38 QLatin1String("twitter-webapp.desktop") <<
39 QLatin1String("gmail-webapp.desktop") <<
40 QLatin1String("ubuntu-weather-app.desktop") <<
41 QLatin1String("notes-app.desktop") <<
42 QLatin1String("calendar-app.desktop");
44 // TODO: get stuff from desktop files instead this hardcoded map
45 m_displayNameMap.insert("dialer-app.desktop", "Dialer");
46 m_displayNameMap.insert("messaging-app.desktop", "Messaging");
47 m_displayNameMap.insert("address-book-app.desktop", "Contacts");
48 m_displayNameMap.insert("camera-app.desktop", "Camera");
49 m_displayNameMap.insert("gallery-app.desktop", "Gallery");
50 m_displayNameMap.insert("facebook-webapp.desktop", "Facebook");
51 m_displayNameMap.insert("webbrowser-app.desktop", "Browser");
52 m_displayNameMap.insert("twitter-webapp.desktop", "Twitter");
53 m_displayNameMap.insert("gmail-webapp.desktop", "GMail");
54 m_displayNameMap.insert("ubuntu-weather-app.desktop", "Weather");
55 m_displayNameMap.insert("notes-app.desktop", "Notes");
56 m_displayNameMap.insert("calendar-app.desktop", "Calendar");
58 // TODO: get stuff from desktop files instead this hardcoded map
59 m_iconMap.insert("dialer-app.desktop", "phone-app");
60 m_iconMap.insert("messaging-app.desktop", "messages-app");
61 m_iconMap.insert("address-book-app.desktop", "contacts-app");
62 m_iconMap.insert("camera-app.desktop", "camera");
63 m_iconMap.insert("gallery-app.desktop", "gallery");
64 m_iconMap.insert("facebook-webapp.desktop", "facebook");
65 m_iconMap.insert("webbrowser-app.desktop", "browser");
66 m_iconMap.insert("twitter-webapp.desktop", "twitter");
67 m_iconMap.insert("gmail-webapp.desktop", "gmail");
68 m_iconMap.insert("ubuntu-weather-app.desktop", "weather");
69 m_iconMap.insert("notes-app.desktop", "notepad");
70 m_iconMap.insert("calendar-app.desktop", "calendar");
74LauncherBackend::~LauncherBackend()
79QStringList LauncherBackend::storedApplications() const
84void LauncherBackend::setStoredApplications(const QStringList &appIds)
86 m_storedApps = appIds;
87 // TODO: Cleanup pinned state from settings for apps not in list any more.
90QString LauncherBackend::desktopFile(const QString &appId) const
92 // TODO: return real path instead of this hardcoded one
93 return QLatin1String("/usr/share/applications/") + appId;
96QString LauncherBackend::displayName(const QString &appId) const
98 return m_displayNameMap.value(appId);
101QString LauncherBackend::icon(const QString &appId) const
103 return m_iconMap.value(appId);
106bool LauncherBackend::isPinned(const QString &appId) const
108 // TODO: return app's pinned state from settings
113void LauncherBackend::setPinned(const QString &appId, bool pinned)
115 // TODO: Store pinned state in settings.
120QList<QuickListEntry> LauncherBackend::quickList(const QString &appId) const
122 // TODO: Get static (from .desktop file) and dynamic (from the app itself)
123 // entries and return them here. Frontend related entries (like "Pin to launcher")
124 // don't matter here. This is just the backend part.
125 // TODO: emit quickListChanged() when the dynamic part changes
127 return QList<QuickListEntry>();
130int LauncherBackend::progress(const QString &appId) const
132 // TODO: Return value for progress emblem.
133 // TODO: emit progressChanged() when this value changes.
138int LauncherBackend::count(const QString &appId) const
140 // TODO: Return value for count emblem.
141 // TODO: emit countChanged() when this value changes.
146void LauncherBackend::triggerQuickListAction(const QString &appId, const QString &quickListId)
148 // TODO: execute the given quicklist action
150 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