#include "common.h"
#include "contactmanager.h"
#include "../error.h"
+#include "ui/facebookloginbrowser.h"
#include "facebookservice/facebookauthentication.h"
#include "gps/gpsposition.h"
#include "map/mapengine.h"
m_contactManager = new ContactManager(this);
m_contactManager->requestContactGuids();
+
+ ///< @todo just for testing the login browser
+ login();
}
SituareEngine::~SituareEngine()
m_geocodingService->requestLocation(location);
}
+void SituareEngine::login()
+{
+ qWarning() << __PRETTY_FUNCTION__;
+
+ FacebookLoginBrowser *browser = m_ui->buildFacebookLoginBrowser();
+ browser->load(QUrl("https://graph.facebook.com/oauth/authorize?client_id=4197c64da2fb6b927236feaea32d7d81&redirect_uri=http://www.facebook.com/connect/login_success.html&display=touch&type=user_agent"));
+}
+
void SituareEngine::loginActionPressed()
{
qDebug() << __PRETTY_FUNCTION__;
*/
void locationSearch(QString location);
+ void login();
+
/**
* @brief Slot to intercept signal when Login/Logout action is pressed
*
/*******************************************************************************
* MEMBER FUNCTIONS AND SLOTS
******************************************************************************/
-
+public:
/**
* @brief Getter for m_loginCredentials
*
const QString ERROR = "Error";
-// Facebook webView font size
-const double FACEBOOK_LOGINPAGE_FONT_SIZE = 1.2;
-
// Facebook callback url indentifiers and setting items
const QString SESSION_KEY = "session_key";
const QString USER_ID = "uid";
ui/zoombutton.cpp \
ui/zoombuttonpanel.cpp \
user/user.cpp \
- ui/listitemcontextbuttonbar.cpp
+ ui/listitemcontextbuttonbar.cpp \
+ ui/facebookloginbrowser.cpp
HEADERS += application.h \
common.h \
coordinates/geocoordinate.h \
ui/zoombutton.h \
ui/zoombuttonpanel.h \
user/user.h \
- ui/listitemcontextbuttonbar.h
+ ui/listitemcontextbuttonbar.h \
+ ui/facebookloginbrowser.h
QT += network \
webkit
DEFINES += QT_NO_DEBUG_OUTPUT
--- /dev/null
+/*
+ Situare - A location system for Facebook
+ Copyright (C) 2010 Ixonos Plc. Authors:
+
+ Sami Rämö - sami.ramo@ixonos.com
+
+ Situare is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ version 2 as published by the Free Software Foundation.
+
+ Situare is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Situare; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ USA.
+*/
+
+#include <QDebug>
+
+#include "facebookloginbrowser.h"
+
+FacebookLoginBrowser::FacebookLoginBrowser(QWidget *parent) :
+ QWebView(parent)
+{
+ qWarning() << __PRETTY_FUNCTION__;
+
+ setWindowFlags(Qt::Dialog);
+ setWindowTitle(tr("Login"));
+}
--- /dev/null
+/*
+ Situare - A location system for Facebook
+ Copyright (C) 2010 Ixonos Plc. Authors:
+
+ Sami Rämö - sami.ramo@ixonos.com
+
+ Situare is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ version 2 as published by the Free Software Foundation.
+
+ Situare is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Situare; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ USA.
+*/
+
+
+#ifndef FACEBOOKLOGINBROWSER_H
+#define FACEBOOKLOGINBROWSER_H
+
+#include <QWebView>
+
+class FacebookLoginBrowser : public QWebView
+{
+ Q_OBJECT
+public:
+ explicit FacebookLoginBrowser(QWidget *parent = 0);
+
+signals:
+
+public slots:
+
+};
+
+#endif // FACEBOOKLOGINBROWSER_H
m_noSearchLabel->show();
m_searchHistoryListView->hide();
m_locationListView->hide();
- }
- else {
+ } else {
m_noSearchLabel->hide();
m_resultsLabel->show();
}
#include "common.h"
#include "error.h"
+#include "facebookloginbrowser.h"
#include "facebookservice/facebookauthentication.h"
#include "friendlistpanel.h"
#include "fullscreenbutton.h"
m_email(), ///< @todo WTF?!?!?!?
m_password(),
m_webView(0),
+ m_facebookLoginBrowser(0),
m_fullScreenButton(0),
m_indicatorButtonPanel(0),
m_mapScale(0),
this, SLOT(mapCenterHorizontalShiftingChanged(int)));
}
+FacebookLoginBrowser* MainWindow::buildFacebookLoginBrowser()
+{
+ qWarning() << __PRETTY_FUNCTION__;
+
+ if (!m_facebookLoginBrowser)
+ m_facebookLoginBrowser = new FacebookLoginBrowser(this);
+
+ m_facebookLoginBrowser->show();
+
+ return m_facebookLoginBrowser;
+}
+
void MainWindow::buildFriendListPanel()
{
qDebug() << __PRETTY_FUNCTION__;
class QWebView;
class FacebookAuthentication;
+class FacebookLoginBrowser;
class FriendListPanel;
class FullScreenButton;
class GeoCoordinate;
* MEMBER FUNCTIONS AND SLOTS
******************************************************************************/
public:
+ FacebookLoginBrowser* buildFacebookLoginBrowser();
+
/**
* @brief Clears cookie jar
*
QWebView *m_webView; ///< Shows facebook login page
+ FacebookLoginBrowser *m_facebookLoginBrowser;
FriendListPanel *m_friendsListPanel; ///< Instance of friends list panel
FullScreenButton *m_fullScreenButton; ///< Instance of the fullscreen toggle button
IndicatorButtonPanel *m_indicatorButtonPanel; ///< Instance of direction indicator button