mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 05:15:40 +03:00
Set busy cursor when doing page loading in browser.
This commit is contained in:
parent
a875b46a80
commit
87cb2a7114
2 changed files with 25 additions and 2 deletions
|
@ -11,6 +11,7 @@
|
|||
* for more details.
|
||||
*/
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include <QNetworkCookie>
|
||||
#include <QWebFrame>
|
||||
|
@ -29,8 +30,12 @@ void ShibbolethWebView::setup(const QUrl& url, ShibbolethCookieJar* jar)
|
|||
QWebPage* page = new QWebPage(this);
|
||||
|
||||
jar->setParent(this);
|
||||
connect (jar, SIGNAL (newCookiesForUrl (QList<QNetworkCookie>, QUrl)),
|
||||
this, SLOT (onNewCookiesForUrl (QList<QNetworkCookie>, QUrl)));
|
||||
connect(jar, SIGNAL (newCookiesForUrl (QList<QNetworkCookie>, QUrl)),
|
||||
this, SLOT (onNewCookiesForUrl (QList<QNetworkCookie>, QUrl)));
|
||||
connect(page, SIGNAL(loadStarted()),
|
||||
this, SLOT(slotLoadStarted()));
|
||||
connect(page, SIGNAL(loadFinished(bool)),
|
||||
this, SLOT(slotLoadFinished()));
|
||||
|
||||
nm->setCookieJar(jar);
|
||||
page->setNetworkAccessManager(nm);
|
||||
|
@ -44,6 +49,11 @@ ShibbolethWebView::ShibbolethWebView(const QUrl& url, QWidget* parent)
|
|||
setup(url, new ShibbolethCookieJar(this));
|
||||
}
|
||||
|
||||
ShibbolethWebView::~ShibbolethWebView()
|
||||
{
|
||||
slotLoadFinished();
|
||||
}
|
||||
|
||||
ShibbolethWebView::ShibbolethWebView(const QUrl& url, ShibbolethCookieJar* jar, QWidget* parent)
|
||||
: QWebView(parent)
|
||||
{
|
||||
|
@ -81,4 +91,14 @@ void ShibbolethWebView::hideEvent(QHideEvent* event)
|
|||
QWebView::hideEvent(event);
|
||||
}
|
||||
|
||||
void ShibbolethWebView::slotLoadStarted()
|
||||
{
|
||||
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||
}
|
||||
|
||||
void ShibbolethWebView::slotLoadFinished()
|
||||
{
|
||||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
|
||||
} // ns Mirall
|
||||
|
|
|
@ -32,6 +32,7 @@ class ShibbolethWebView : public QWebView
|
|||
public:
|
||||
ShibbolethWebView(const QUrl& url, QWidget* parent = 0);
|
||||
ShibbolethWebView(const QUrl& url, ShibbolethCookieJar* jar, QWidget* parent = 0);
|
||||
~ShibbolethWebView();
|
||||
|
||||
protected:
|
||||
void hideEvent(QHideEvent* event);
|
||||
|
@ -43,6 +44,8 @@ Q_SIGNALS:
|
|||
|
||||
private Q_SLOTS:
|
||||
void onNewCookiesForUrl(const QList<QNetworkCookie>& cookieList, const QUrl& url);
|
||||
void slotLoadStarted();
|
||||
void slotLoadFinished();
|
||||
|
||||
private:
|
||||
void setup(const QUrl& url, ShibbolethCookieJar* jar);
|
||||
|
|
Loading…
Reference in a new issue