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("calendar-app.desktop") <<
41 QLatin1String("phone-app.desktop") <<
42 QLatin1String("camera-app.desktop") <<
43 QLatin1String("gallery-app.desktop") <<
44 QLatin1String("facebook-webapp.desktop") <<
45 QLatin1String("webbrowser-app.desktop") <<
46 QLatin1String("twitter-webapp.desktop") <<
47 QLatin1String("gmail-webapp.desktop") <<
48 QLatin1String("ubuntu-weather-app.desktop") <<
49 QLatin1String("notes-app.desktop") <<
50 QLatin1String("calendar-app.desktop");
52 // TODO: get stuff from desktop files instead this hardcoded map
53 m_displayNameMap.insert("phone-app.desktop", "Phone");
54 m_displayNameMap.insert("camera-app.desktop", "Camera");
55 m_displayNameMap.insert("gallery-app.desktop", "Gallery");
56 m_displayNameMap.insert("facebook-webapp.desktop", "Facebook");
57 m_displayNameMap.insert("webbrowser-app.desktop", "Browser");
58 m_displayNameMap.insert("twitter-webapp.desktop", "Twitter");
59 m_displayNameMap.insert("gmail-webapp.desktop", "GMail");
60 m_displayNameMap.insert("ubuntu-weather-app.desktop", "Weather");
61 m_displayNameMap.insert("notes-app.desktop", "Notes");
62 m_displayNameMap.insert("calendar-app.desktop", "Calendar");
64 // TODO: get stuff from desktop files instead this hardcoded map
65 m_iconMap.insert("phone-app.desktop", "phone-app");
66 m_iconMap.insert("camera-app.desktop", "camera");
67 m_iconMap.insert("gallery-app.desktop", "gallery");
68 m_iconMap.insert("facebook-webapp.desktop", "facebook");
69 m_iconMap.insert("webbrowser-app.desktop", "browser");
70 m_iconMap.insert("twitter-webapp.desktop", "twitter");
71 m_iconMap.insert("gmail-webapp.desktop", "gmail");
72 m_iconMap.insert("ubuntu-weather-app.desktop", "weather");
73 m_iconMap.insert("notes-app.desktop", "notepad");
74 m_iconMap.insert("calendar-app.desktop", "calendar");
78LauncherBackend::~LauncherBackend()
83QStringList LauncherBackend::storedApplications() const
88void LauncherBackend::setStoredApplications(const QStringList &appIds)
90 m_storedApps = appIds;
91 // TODO: Cleanup pinned state from settings for apps not in list any more.
94QString LauncherBackend::desktopFile(const QString &appId) const
96 // TODO: return real path instead of this hardcoded one
97 return QLatin1String("/usr/share/applications/") + appId;
100QString LauncherBackend::displayName(const QString &appId) const
102 return m_displayNameMap.value(appId);
105QString LauncherBackend::icon(const QString &appId) const
107 return m_iconMap.value(appId);
110bool LauncherBackend::isPinned(const QString &appId) const
112 // TODO: return app's pinned state from settings
117void LauncherBackend::setPinned(const QString &appId, bool pinned)
119 // TODO: Store pinned state in settings.
124QList<QuickListEntry> LauncherBackend::quickList(const QString &appId) const
126 // TODO: Get static (from .desktop file) and dynamic (from the app itself)
127 // entries and return them here. Frontend related entries (like "Pin to launcher")
128 // don't matter here. This is just the backend part.
129 // TODO: emit quickListChanged() when the dynamic part changes
131 return QList<QuickListEntry>();
134int LauncherBackend::progress(const QString &appId) const
136 // TODO: Return value for progress emblem.
137 // TODO: emit progressChanged() when this value changes.
142int LauncherBackend::count(const QString &appId) const
144 // TODO: Return value for count emblem.
145 // TODO: emit countChanged() when this value changes.
150void LauncherBackend::triggerQuickListAction(const QString &appId, const QString &quickListId)
152 // TODO: execute the given quicklist action
154 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