example/FlickrAuthApp/src/baseDialog.cpp
author cgandhi
Thu, 05 Aug 2010 16:46:37 +0530
changeset 17 106a4bfcb866
child 26 83d6a149c755
permissions -rw-r--r--
pushing the flickr auth app and gallery plugins
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
     1
/**
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
     2
* Copyright (c) 2010 Sasken Communication Technologies Ltd.
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
     3
* All rights reserved.
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
     4
* This component and the accompanying materials are made available
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
     5
* under the terms of the "{License}"
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
     6
* which accompanies  this distribution, and is available
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
     7
* at the URL "{LicenseUrl}".
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
     8
*
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
     9
* Initial Contributors:
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    10
* Narasimhulu Kavadapu, Sasken Communication Technologies Ltd - Initial contribution
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    11
*
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    12
* Contributors:
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    13
*
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    14
* Description:
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    15
* Base class of All dialogs
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    16
*/
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    17
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    18
#define EMULATORTESTING
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    19
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    20
#include <QNetworkCookie>
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    21
#include <QNetworkRequest>
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    22
#include <QNetworkReply>
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    23
#include <QWebFrame>
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    24
#include <QFile>
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    25
#include <QDesktopServices>
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    26
#include <QResizeEvent>
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    27
#include <QDebug>
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    28
#include <qmessagebox.h>
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    29
#include <QNetworkAccessManager>
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    30
#include <QPropertyAnimation>
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    31
 #include <qnetworkproxy.h>
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    32
#include <qdesktopwidget.h>
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    33
#include <qapplication.h>
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    34
//#include <qboxlayout.h>
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    35
#include "baseDialog.h"
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    36
#include "sessionSP.h"
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    37
#include "errorCodes.h"
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    38
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    39
static const QString kDefaultTitle = "Connect to Facebook";
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    40
static const QString kStringBoundary = "3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f";
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    41
static const QString kMinitokensuccessURL = "http://m.flickr.com/services/auth/";
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    42
static const QString kInvalidUrl = "http://mlogin.yahoo.com/w/login";
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    43
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    44
static QNetworkAccessManager namanager;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    45
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    46
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    47
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    48
FBDialog::FBDialog() : iSession(FBSession::session()), /*iWebView ( this  ),*/ iIgnorePageLoadCompleteEvent( false )
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    49
{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    50
    createControls();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    51
}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    52
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    53
FBDialog::FBDialog(FBSession* aSession) : iSession ( aSession ), /*iWebView ( this  ) ,*/ iIgnorePageLoadCompleteEvent ( false )
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    54
{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    55
    createControls();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    56
}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    57
void FBDialog::createControls()
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    58
{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    59
	iWebView = new QWebView(this);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    60
    iWebView->page()->setNetworkAccessManager(&namanager);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    61
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    62
    iWebView->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    63
    
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    64
    layout = new QVBoxLayout(this);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    65
    
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    66
    
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    67
    progressbar = new QProgressBar(this);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    68
    
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    69
    layout->addWidget(iWebView);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    70
    layout->addWidget(progressbar);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    71
    
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    72
    setLayout(layout);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    73
    
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    74
    progressbar->setOrientation(Qt::Horizontal);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    75
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    76
  
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    77
    connect( iWebView->page(), SIGNAL(linkClicked(const QUrl &)),
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    78
                    this, SLOT(linkClicked(const QUrl &)));
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    79
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    80
    connect ( iWebView->page(), SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool)));
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    81
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    82
    connect ( iWebView->page(), SIGNAL(loadStarted()), this, SLOT ( loadStarted()));
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    83
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    84
    connect ( iWebView->page(), SIGNAL(loadProgress(int)), this, SLOT ( loadProgress(int)));
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    85
    
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    86
    //connect ( iWebView->page(), SIGNAL(urlChanged ( const QUrl & url )), this, SLOT (urlChanged ( const QUrl & url ) ));
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    87
    
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    88
    connect (iWebView->page()->networkAccessManager(),SIGNAL( authenticationRequired( QNetworkReply*, QAuthenticator*)),this,SLOT( slotAuthenticationRequired( QNetworkReply*, QAuthenticator*)));
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    89
    connect (iWebView->page()->networkAccessManager(),SIGNAL( sslErrors( QNetworkReply*,QList<QSslError>&)),this,SLOT( slotsslErrors( QNetworkReply*,QList<QSslError>&)) );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    90
    connect (iWebView->page()->networkAccessManager(),SIGNAL( proxyAuthenticationRequired(QNetworkProxy&, QAuthenticator*)),this,SLOT( slotproxyAuthenticationRequired(QNetworkProxy&, QAuthenticator*)) );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    91
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    92
}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    93
QString FBDialog::generateURL( const QString& aUrl, const QHash<QString, QString>& aParams) const
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    94
{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    95
    QString url ( aUrl );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    96
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    97
    QStringList pairs;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    98
    QHashIterator<QString, QString> i(aParams);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
    99
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   100
    while (i.hasNext()) {
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   101
        i.next();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   102
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   103
        QUrl url (i.value());
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   104
        QString pair = i.key() + "=" + url.toEncoded();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   105
        pairs << pair.toUtf8();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   106
    }
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   107
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   108
    if (pairs.count())
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   109
    {
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   110
        url = url + "?" + pairs.join("&");
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   111
    }
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   112
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   113
    return url;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   114
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   115
}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   116
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   117
QByteArray FBDialog::generatePostBody (const QHash<QString, QString>& aParams) const
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   118
{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   119
    QByteArray body;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   120
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   121
    if (!aParams.count())
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   122
        return body;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   123
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   124
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   125
    QString endLine = "\r\n--" + kStringBoundary + "\r\n", kStringBoundary;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   126
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   127
    QString tmp = "--" + kStringBoundary + "\r\n";
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   128
    body.append(tmp.toUtf8());
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   129
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   130
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   131
    QHashIterator<QString, QString> i(aParams);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   132
    while (i.hasNext()) {
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   133
        i.next();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   134
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   135
        tmp = "Content-Disposition: form-data; name=\"" + i.key().toUtf8() + "\"\r\n\r\n" ;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   136
        body.append(tmp.toUtf8());
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   137
        body.append(i.value().toUtf8());
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   138
        body.append(endLine.toUtf8());
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   139
    }
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   140
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   141
    return body;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   142
}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   143
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   144
void FBDialog::postDismissCleanup()
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   145
{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   146
    //accept();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   147
    // could also be reject()?
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   148
}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   149
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   150
void FBDialog::dismiss (bool /*aAnimated*/) {
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   151
    dialogWillDisappear();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   152
    iLoadingUrl.clear();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   153
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   154
    //todo: do some animations if aAnimated == true !
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   155
    postDismissCleanup();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   156
}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   157
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   158
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   159
void FBDialog::dismissWithSuccess( bool aSuccess, bool aAnimated)
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   160
{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   161
  if (aSuccess) {
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   162
        emit dialogDidSucceed();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   163
  } else {
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   164
        emit dialogDidCancel();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   165
  }
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   166
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   167
  dismiss(aAnimated);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   168
}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   169
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   170
void FBDialog::dismissWithError (const FBError& aError)
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   171
{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   172
	QMessageBox msgbox;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   173
	QString msg ("Error!Please try again!");
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   174
	msgbox.setText(msg);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   175
}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   176
void FBDialog::slotAuthenticationRequired( QNetworkReply* reply, QAuthenticator* authenticator )
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   177
	{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   178
		QMessageBox msgbox;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   179
		QString msg ("Error!Authentication Required");
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   180
		msgbox.setText(msg);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   181
	}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   182
void FBDialog::slotsslErrors( QNetworkReply* reply, const QList<QSslError>& errors  )
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   183
	{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   184
		QMessageBox msgbox;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   185
		QString msg ("Error!SSL Error");
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   186
		msgbox.setText(msg);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   187
	}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   188
void FBDialog::slotproxyAuthenticationRequired( const QNetworkProxy& proxy, QAuthenticator* authenticator  )
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   189
	{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   190
		QMessageBox msgbox;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   191
		QString msg ("Error!Proxy Authenticatio Required");
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   192
		msgbox.setText(msg);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   193
	}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   194
void FBDialog::cancel()
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   195
{}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   196
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   197
void FBDialog::load() {}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   198
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   199
void FBDialog::show()
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   200
{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   201
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   202
    load();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   203
    showMaximized();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   204
    dialogWillAppear();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   205
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   206
}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   207
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   208
void FBDialog::loadURL(const QString& aUrl, QNetworkAccessManager::Operation aMethod, const QHash<QString, QString>& aGetParams, const QHash<QString, QString>&  aPostParams)
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   209
{   
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   210
    //proxysettings();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   211
    iIgnorePageLoadCompleteEvent = false;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   212
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   213
    QNetworkCookieJar* cookieJar = iWebView->page()->networkAccessManager()->cookieJar();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   214
    QByteArray body;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   215
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   216
   // iLoadingUrl = aUrl;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   217
   iLoadingUrl = generateURL(aUrl, aGetParams);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   218
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   219
    // This "test cookie" is required by login.php, or it complains that you need to enable JavaScript
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   220
    QNetworkCookie testCookie ("test_cookie", "1");
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   221
    testCookie.setDomain ( "www.flickr.com" );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   222
    testCookie.setPath ( "/" );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   223
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   224
    QList<QNetworkCookie> cookieList;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   225
    cookieList.append(testCookie);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   226
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   227
    cookieJar->setCookiesFromUrl ( cookieList, QUrl(iLoadingUrl) );
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   228
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   229
    QUrl url (iLoadingUrl);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   230
    QNetworkRequest request(aUrl);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   231
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   232
    if (aMethod == QNetworkAccessManager::PostOperation)
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   233
    {
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   234
        const QString contentType = "multipart/form-data; boundary=" + kStringBoundary;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   235
        request.setHeader (QNetworkRequest::ContentTypeHeader, contentType);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   236
        body = generatePostBody (aPostParams);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   237
    }
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   238
    
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   239
	proxysettings();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   240
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   241
    
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   242
    qDebug()<< "Check URL : " << iLoadingUrl;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   243
    
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   244
    //iWebView->load ( request, aMethod, body);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   245
    iWebView->load(url);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   246
    qDebug() << "Loading url: " << iLoadingUrl;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   247
}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   248
void FBDialog::proxysettings()
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   249
{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   250
#ifdef EMULATORTESTING
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   251
	qDebug()<<"proxysettings";
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   252
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   253
	// Reading the keys, CSM Stubbed - START
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   254
	QFile file("c://data//DoNotShare.txt");
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   255
	if (!file.open(QIODevice::ReadOnly))
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   256
		{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   257
		qDebug()<<"File to read the windows username and password could not be opened, returning!!!";
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   258
		return;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   259
		}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   260
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   261
	QByteArray arr = file.readAll();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   262
	QList<QByteArray> list = arr.split(' ');
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   263
	file.close();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   264
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   265
	QString username(list[0]);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   266
	QString password(list[1]);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   267
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   268
    QString httpProxy = "10.1.0.214";//ipwproxy.sasken.com
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   269
    QString httpPort = "3128";
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   270
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   271
    QString httpUser =username;/* This could be taken thru an QDialog implmentation to remove the Hard coding */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   272
    QString httpPass =password;/* This could be taken thru an QDialog implmentation to remove the Hard coding */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   273
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   274
    /*==Classes used from Network Module==*/
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   275
    QNetworkProxy proxy;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   276
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   277
    proxy.setType(QNetworkProxy::HttpProxy);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   278
    proxy.setHostName(httpProxy);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   279
    proxy.setPort(httpPort.toInt());
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   280
    proxy.setUser(httpUser);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   281
    proxy.setPassword(httpPass);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   282
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   283
    QNetworkProxy::setApplicationProxy(proxy);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   284
#endif
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   285
}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   286
void FBDialog::dialogWillAppear() {}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   287
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   288
void FBDialog::dialogWillDisappear() {}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   289
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   290
void FBDialog::dialogDidSucceed (const QUrl& /*aUrl*/) {
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   291
  dismissWithSuccess(true,true);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   292
}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   293
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   294
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   295
void FBDialog::linkClicked ( const QUrl & url )
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   296
 {
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   297
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   298
        qDebug() << "Loading the url: " <<  url;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   299
        
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   300
		proxysettings();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   301
        iWebView->load(url);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   302
}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   303
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   304
void FBDialog::loadStarted()
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   305
{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   306
    qDebug() << "Load started: " << iWebView->url();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   307
    progressbar->setVisible(true);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   308
}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   309
void FBDialog::loadProgress(int progress)
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   310
{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   311
	progressbar->setValue(progress);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   312
}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   313
/*void FBDialog::urlChanged ( const QUrl & url )
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   314
	{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   315
		if(url.toString().contains(kInvalidUrl))
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   316
			{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   317
				QUrl newurl(iWebView->url().toString());
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   318
				qDebug()<<"url changed"<<iWebView->url().toString()<<"\n";
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   319
				iWebView->setUrl(newurl);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   320
				iWebView->load(iWebView->url().toString());
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   321
			}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   322
	}*/
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   323
void FBDialog::GetSessionKey(const QUrl& aUrl)
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   324
{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   325
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   326
}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   327
void FBDialog::connectToGetFullToken()
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   328
{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   329
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   330
}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   331
void FBDialog::loadFinished ( bool ok )
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   332
{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   333
    qDebug() << "Load " << (ok ? "" : "un") << "successfull for: " << iWebView->url();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   334
    progressbar->setVisible(false);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   335
    if (ok)
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   336
    {
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   337
        QString url = iWebView->url().toString();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   338
        qDebug() << "Loaded URL " << url;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   339
        qDebug() << "To be compared URL " << kMinitokensuccessURL;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   340
        if(url.compare(kMinitokensuccessURL) == 0)
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   341
        	{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   342
				iWebView->setHidden(true);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   343
				QMessageBox msgbox;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   344
				QString msg ("Complete the Authorization?");
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   345
				msgbox.setText(msg);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   346
				msgbox.exec();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   347
				
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   348
				connectToGetFullToken();				
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   349
				
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   350
        	}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   351
    }
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   352
    else
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   353
    {
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   354
        if (iIgnorePageLoadCompleteEvent)
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   355
            return;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   356
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   357
        FBError err;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   358
        dismissWithError(err);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   359
    }
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents:
diff changeset
   360
}