summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-12-23 17:51:45 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-24 06:35:54 -0800
commit1b8169036fcafc7d7d72548adebfafeb7f65e3de (patch)
tree2d6aa5f5e52bb1953a488ac485174f150e603d1c
parent87febd33be364c3cf6ce9455c383ba4e9f974fd9 (diff)
downloadsubsurface-1b8169036fcafc7d7d72548adebfafeb7f65e3de.tar.gz
Allow subsurface to login with facebook.
This piece of code allows subsurface to login with facebook using the 'Subsurface' app created within facebook for secure reasons. I'm the admin of it currently - but I'll pass it to Dirk as well. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/preferences.cpp9
-rw-r--r--qt-ui/preferences.ui31
2 files changed, 38 insertions, 2 deletions
diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp
index 5f7825c98..7f288ab1f 100644
--- a/qt-ui/preferences.cpp
+++ b/qt-ui/preferences.cpp
@@ -7,6 +7,7 @@
#include <QSortFilterProxyModel>
#include <QShortcut>
#include <QNetworkProxy>
+#include <QWebView>
PreferencesDialog *PreferencesDialog::instance()
{
@@ -25,6 +26,14 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, Qt::WindowFlags f) : QDial
ui.proxyType->addItem(tr("HTTP proxy"), QNetworkProxy::HttpProxy);
ui.proxyType->addItem(tr("SOCKS proxy"), QNetworkProxy::Socks5Proxy);
ui.proxyType->setCurrentIndex(-1);
+
+ // Facebook stuff:
+ QUrl urlLogin("https://www.facebook.com/dialog/oauth?"
+ "client_id=427722490709000"
+ "&redirect_uri=http://www.facebook.com/connect/login_success.html");
+
+ ui.facebookWebView->setUrl(urlLogin);
+
connect(ui.proxyType, SIGNAL(currentIndexChanged(int)), this, SLOT(proxyType_changed(int)));
connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(buttonClicked(QAbstractButton *)));
connect(ui.gflow, SIGNAL(valueChanged(int)), this, SLOT(gflowChanged(int)));
diff --git a/qt-ui/preferences.ui b/qt-ui/preferences.ui
index c021ae872..9611b49d9 100644
--- a/qt-ui/preferences.ui
+++ b/qt-ui/preferences.ui
@@ -6,6 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
+ <width>562</width>
+ <height>718</height>
</rect>
</property>
<property name="windowTitle">
@@ -128,6 +130,11 @@
</iconset>
</property>
</item>
+ <item>
+ <property name="text">
+ <string>Facebook</string>
+ </property>
+ </item>
</widget>
</item>
<item>
@@ -139,7 +146,7 @@
</sizepolicy>
</property>
<property name="currentIndex">
- <number>0</number>
+ <number>5</number>
</property>
<widget class="QWidget" name="page_2">
<layout class="QVBoxLayout" name="verticalLayout_3">
@@ -964,6 +971,19 @@
</item>
</layout>
</widget>
+ <widget class="QWidget" name="page_6">
+ <layout class="QHBoxLayout" name="horizontalLayout_10">
+ <item>
+ <widget class="QWebView" name="facebookWebView">
+ <property name="url">
+ <url>
+ <string>about:blank</string>
+ </url>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
</widget>
</item>
</layout>
@@ -980,6 +1000,13 @@
</item>
</layout>
</widget>
+ <customwidgets>
+ <customwidget>
+ <class>QWebView</class>
+ <extends>QWidget</extends>
+ <header>QtWebKit/QWebView</header>
+ </customwidget>
+ </customwidgets>
<resources/>
<connections>
<connection>
@@ -1320,12 +1347,12 @@
</connection>
</connections>
<buttongroups>
+ <buttongroup name="verticalSpeed"/>
<buttongroup name="buttonGroup_2"/>
<buttongroup name="buttonGroup_3"/>
<buttongroup name="buttonGroup_4"/>
<buttongroup name="buttonGroup_5"/>
<buttongroup name="buttonGroup_6"/>
- <buttongroup name="verticalSpeed"/>
<buttongroup name="buttonGroup"/>
</buttongroups>
</ui>