[Pkg-owncloud-commits] [owncloud-client] 19/164: Default shiboolethwebview to 900x700, remember last size

Sandro Knauß hefee-guest at moszumanska.debian.org
Sun Mar 22 11:55:50 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 99d674c346ea5c854430c76f3b94a6254b2e335e
Author: Daniel Molkentin <danimo at owncloud.com>
Date:   Tue Feb 17 15:28:14 2015 +0100

    Default shiboolethwebview to 900x700, remember last size
    
    Also add host to the title
    
    Addresses #2285
---
 src/libsync/creds/shibboleth/shibbolethwebview.cpp | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/libsync/creds/shibboleth/shibbolethwebview.cpp b/src/libsync/creds/shibboleth/shibbolethwebview.cpp
index 3c914bd..8901885 100644
--- a/src/libsync/creds/shibboleth/shibbolethwebview.cpp
+++ b/src/libsync/creds/shibboleth/shibbolethwebview.cpp
@@ -19,6 +19,7 @@
 #include <QWebPage>
 #include <QMessageBox>
 #include <QNetworkReply>
+#include <QSettings>
 
 #include "creds/shibboleth/shibbolethwebview.h"
 #include "creds/shibbolethcredentials.h"
@@ -26,6 +27,11 @@
 #include "logger.h"
 #include "accessmanager.h"
 #include "theme.h"
+#include "configfile.h"
+
+namespace {
+    const char ShibbolethWebViewGeometryC[] = "ShibbolethWebView/Geometry";
+}
 
 namespace OCC
 {
@@ -39,6 +45,7 @@ ShibbolethWebView::ShibbolethWebView(AccountPtr account, QWidget* parent)
     // no minimize
     setWindowFlags(Qt::Dialog);
     setAttribute(Qt::WA_DeleteOnClose);
+
     QWebPage* page = new QWebPage(this);
     page->setNetworkAccessManager(account->networkAccessManager());
     connect(page, SIGNAL(loadStarted()),
@@ -60,10 +67,18 @@ ShibbolethWebView::ShibbolethWebView(AccountPtr account, QWidget* parent)
     if (shibCookie != QNetworkCookie()) {
         Logger::instance()->postOptionalGuiLog(tr("Reauthentication required"), tr("Your session has expired. You need to re-login to continue to use the client."));
     }
+
+    ConfigFile config;
+    QSettings settings(config.configFile());
+    resize(900, 700); // only effective the first time, later overridden by restoreGeometry
+    restoreGeometry(settings.value(ShibbolethWebViewGeometryC).toByteArray());
 }
 
 ShibbolethWebView::~ShibbolethWebView()
 {
+    ConfigFile config;
+    QSettings settings(config.configFile());
+    settings.setValue(ShibbolethWebViewGeometryC, saveGeometry());
 }
 
 void ShibbolethWebView::onNewCookiesForUrl (const QList<QNetworkCookie>& cookieList, const QUrl& url)
@@ -105,7 +120,7 @@ void ShibbolethWebView::slotLoadFinished(bool success)
     }
 
     if (!title().isNull()) {
-        setWindowTitle(tr("%1 - %2").arg(Theme::instance()->appNameGUI(), title()));
+        setWindowTitle(QString::fromLatin1("%1 - %2 (%3)").arg(Theme::instance()->appNameGUI(), title(), url().host()));
     }
 
     if (!success) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list