on xenial help sign in
initial work to get the appmanager integrated with the launcher
81d910bMichael Zanetti
Shell.qml+9
@@ -108,6 +108,15 @@ FocusScope {
108 // potentially only in connection with a notification
108 // potentially only in connection with a notification
109 greeter.hide();
109 greeter.hide();
110 shell.activateApplication(desktopFile);
110 shell.activateApplication(desktopFile);
111+
112+ }
113+
114+ onMainStageFocusedApplicationChanged: {
115+ var app = applicationManager.mainStageFocusedApplication
116+ print("***********************************focusing app", app);
117+ print("**************************************appId", app.icon, app.desktopFile);
118+
119+ LauncherModel.applicationFocused(app.desktopFile);
111 }
120 }
112 }
121 }
113
122
plugins/Unity/Launcher/launchermodel.cpp+23
@@ -184,6 +184,29 @@ void LauncherModel::setUser(const QString &username)
184 m_backend->setUser(username);
184 m_backend->setUser(username);
185}
185}
186
186
187+void LauncherModel::applicationFocused(const QString &appId)
188+{
189+ int index = findApplication(appId);
190+
191+ if (index >= 0) {
192+ // TODO: Mark application as focued
193+ } else {
194+ // FIXME: The backend does not yet support this stuff
195+ // and currently the appId still is the desktopFile
196+ //QString desktopFile = m_backend->desktopFile(appId);
197+ QString desktopFile = appId;
198+
199+ QString appName = m_backend->displayName(appId);
200+ QString icon = m_backend->icon(appId);
201+
202+ LauncherItem *item = new LauncherItem(appId, desktopFile, appName, icon);
203+ beginInsertRows(QModelIndex(), m_list.count(), m_list.count());
204+ m_list.append(item);
205+ endInsertRows();
206+ storeAppList();
207+ }
208+}
209+
187void LauncherModel::storeAppList()
210void LauncherModel::storeAppList()
188{
211{
189 QStringList appIds;
212 QStringList appIds;
plugins/Unity/Launcher/launchermodel.h+1
@@ -49,6 +49,7 @@ public:
49 Q_INVOKABLE void requestRemove(const QString &appId);
49 Q_INVOKABLE void requestRemove(const QString &appId);
50 Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex);
50 Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex);
51 Q_INVOKABLE void setUser(const QString &username);
51 Q_INVOKABLE void setUser(const QString &username);
52+ Q_INVOKABLE void applicationFocused(const QString &appId);
52
53
53private:
54private:
54 void storeAppList();
55 void storeAppList();