Merge lp:~mardy/ubuntu-system-settings-online-accounts/window-raising into lp:~mardy/ubuntu-system-settings-online-accounts/master

Proposed by Alberto Mardegan
Status: Merged
Merged at revision: 120
Proposed branch: lp:~mardy/ubuntu-system-settings-online-accounts/window-raising
Merge into: lp:~mardy/ubuntu-system-settings-online-accounts/master
Diff against target: 100 lines (+35/-3)
3 files modified
src/panel-request.cpp (+6/-0)
src/provider-request.cpp (+10/-0)
system-settings-plugin/plugin.cpp (+19/-3)
To merge this branch: bzr merge lp:~mardy/ubuntu-system-settings-online-accounts/window-raising
Reviewer Review Type Date Requested Status
David Barth (community) Approve
Justin McPherson Pending
Alberto Mardegan Pending
Review via email: mp+221528@code.launchpad.net

Description of the change

When processing completes, raise the caller application

Under unity8, use QDesktopServices to raise the application which invoked OA. Also, avoid queuing requests to open OA from the System Settings.

To post a comment you must log in.
Revision history for this message
David Barth (dbarth) wrote :

The workarounds are fine. Hopefully they won't be needed for long.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/panel-request.cpp'
--- src/panel-request.cpp 2014-05-09 10:52:01 +0000
+++ src/panel-request.cpp 2014-05-30 11:54:13 +0000
@@ -23,6 +23,8 @@
23#include "globals.h"23#include "globals.h"
24#include "panel-request.h"24#include "panel-request.h"
2525
26#include <QDesktopServices>
27#include <QGuiApplication>
26#include <QStandardPaths>28#include <QStandardPaths>
27#include <QQmlContext>29#include <QQmlContext>
28#include <QQmlEngine>30#include <QQmlEngine>
@@ -101,6 +103,10 @@
101103
102 if (!visible) {104 if (!visible) {
103 q->setResult(QVariantMap());105 q->setResult(QVariantMap());
106 /* FIXME HACK: remove when window reparenting is implemented */
107 if (QGuiApplication::platformName().startsWith("ubuntu")) {
108 QDesktopServices::openUrl(QUrl("application:///ubuntu-system-settings.desktop"));
109 }
104 }110 }
105}111}
106112
107113
=== modified file 'src/provider-request.cpp'
--- src/provider-request.cpp 2014-02-03 10:27:39 +0000
+++ src/provider-request.cpp 2014-05-30 11:54:13 +0000
@@ -24,6 +24,8 @@
24#include "globals.h"24#include "globals.h"
25#include "provider-request.h"25#include "provider-request.h"
2626
27#include <QDesktopServices>
28#include <QGuiApplication>
27#include <QQmlContext>29#include <QQmlContext>
28#include <QQmlEngine>30#include <QQmlEngine>
29#include <QQuickItem>31#include <QQuickItem>
@@ -133,6 +135,14 @@
133135
134 if (!visible) {136 if (!visible) {
135 q->setResult(QVariantMap());137 q->setResult(QVariantMap());
138 /* FIXME HACK: remove when window reparenting is implemented */
139 QString profile =
140 m_applicationInfo.value(QStringLiteral("profile")).toString();
141 if (QGuiApplication::platformName().startsWith("ubuntu") &&
142 !profile.isEmpty()) {
143 QDesktopServices::openUrl(
144 QUrl(QString("application:///%1.desktop").arg(profile)));
145 }
136 }146 }
137}147}
138148
139149
=== modified file 'system-settings-plugin/plugin.cpp'
--- system-settings-plugin/plugin.cpp 2013-09-09 10:56:53 +0000
+++ system-settings-plugin/plugin.cpp 2014-05-30 11:54:13 +0000
@@ -36,13 +36,20 @@
36 QQmlComponent *pageComponent(QQmlEngine *engine,36 QQmlComponent *pageComponent(QQmlEngine *engine,
37 QObject *parent = 0) Q_DECL_OVERRIDE;37 QObject *parent = 0) Q_DECL_OVERRIDE;
3838
39private Q_SLOTS:
40 void onFinished();
41
39private:42private:
40 OnlineAccountsClient::Setup m_setup;43 OnlineAccountsClient::Setup m_setup;
44 bool m_isOpen;
41};45};
4246
43Item::Item(const QVariantMap &staticData, QObject *parent):47Item::Item(const QVariantMap &staticData, QObject *parent):
44 ItemBase(staticData, parent)48 ItemBase(staticData, parent),
49 m_isOpen(false)
45{50{
51 QObject::connect(&m_setup, SIGNAL(finished()),
52 this, SLOT(onFinished()));
46}53}
4754
48Item::~Item()55Item::~Item()
@@ -54,11 +61,20 @@
54{61{
55 Q_UNUSED(engine);62 Q_UNUSED(engine);
56 Q_UNUSED(parent);63 Q_UNUSED(parent);
57 qDebug() << "Opening Online Accounts";64
58 m_setup.exec();65 if (!m_isOpen) {
66 qDebug() << "Opening Online Accounts";
67 m_isOpen = true;
68 m_setup.exec();
69 }
59 return 0;70 return 0;
60}71}
6172
73void Item::onFinished()
74{
75 m_isOpen = false;
76}
77
62Plugin::Plugin():78Plugin::Plugin():
63 QObject()79 QObject()
64{80{

Subscribers

People subscribed via source and target branches

to all changes: