[Pkg-owncloud-commits] [owncloud-client] 76/159: More GUI refinements.

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri May 1 13:05:25 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 4a6f4919d78ce76698193594a0a2966885631601
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Thu Mar 26 18:08:06 2015 +0100

    More GUI refinements.
---
 src/gui/sharedialog.cpp | 28 ++++++++++++++++++++++++----
 src/gui/sharedialog.h   |  2 ++
 src/gui/sharedialog.ui  | 10 ++++++++--
 3 files changed, 34 insertions(+), 6 deletions(-)

diff --git a/src/gui/sharedialog.cpp b/src/gui/sharedialog.cpp
index a1d67a0..3662a0a 100644
--- a/src/gui/sharedialog.cpp
+++ b/src/gui/sharedialog.cpp
@@ -21,6 +21,7 @@
 #include "folder.h"
 #include "theme.h"
 #include "syncresult.h"
+#include "configfile.h"
 
 #include "QProgressIndicator.h"
 #include <QBuffer>
@@ -44,6 +45,8 @@ ShareDialog::ShareDialog(AccountPtr account, const QString &sharePath, const QSt
     _resharingAllowed(resharingAllowed)
 {
     setAttribute(Qt::WA_DeleteOnClose);
+    setObjectName("SharingDialog"); // required as group for saveGeometry call
+
     _ui->setupUi(this);
     _ui->pushButton_copy->setIcon(QIcon::fromTheme("edit-copy"));
     _ui->pushButton_copy->setEnabled(false);
@@ -95,9 +98,20 @@ ShareDialog::ShareDialog(AccountPtr account, const QString &sharePath, const QSt
     QString ocDir(_sharePath);
     ocDir.truncate(ocDir.length()-fileName.length());
 
-    _ui->label_sharePath->setText(tr("%1 path: %2").arg(Theme::instance()->appNameGUI()).arg(ocDir));
+    if( ocDir == QLatin1String("/")) {
+        _ui->label_sharePath->setText(QString());
+    } else {
+        if( ocDir.startsWith(QLatin1Char('/')) ) {
+            ocDir = ocDir.mid(1, -1);
+        }
+        if( ocDir.endsWith(QLatin1Char('/')) ) {
+            ocDir.chop(1);
+        }
+        _ui->label_sharePath->setText(tr("Folder: %2").arg(ocDir));
+    }
+
     this->setWindowTitle(tr("%1 Sharing").arg(Theme::instance()->appNameGUI()));
-    _ui->checkBox_password->setText(tr("Set p&assword"));
+    _ui->checkBox_password->setText(tr("P&assword protect"));
     // check if the file is already inside of a synced folder
     if( sharePath.isEmpty() ) {
         // The file is not yet in an ownCloud synced folder. We could automatically
@@ -124,6 +138,12 @@ ShareDialog::ShareDialog(AccountPtr account, const QString &sharePath, const QSt
     _ui->errorLabel->hide();
 }
 
+void ShareDialog::done( int r ) {
+    ConfigFile cfg;
+    cfg.saveGeometry(this);
+    QDialog::done(r);
+}
+
 void ShareDialog::setExpireDate(const QDate &date)
 {
     if( _public_share_id == 0 ) {
@@ -498,8 +518,8 @@ int ShareDialog::checkJsonReturnCode(const QString &reply, QString &message)
 
 void ShareDialog::setShareCheckBoxTitle(bool haveShares)
 {
-    const QString noSharesTitle(tr("Check to &share by public link"));
-    const QString haveSharesTitle(tr("&Shared by public link (uncheck to delete share)"));
+    const QString noSharesTitle(tr("&Share link"));
+    const QString haveSharesTitle(tr("&Share link"));
 
     if( haveShares ) {
         _ui->checkBox_shareLink->setText( haveSharesTitle );
diff --git a/src/gui/sharedialog.h b/src/gui/sharedialog.h
index d713176..c07d1cc 100644
--- a/src/gui/sharedialog.h
+++ b/src/gui/sharedialog.h
@@ -76,6 +76,8 @@ private slots:
     void slotPasswordChanged(const QString& newText);
     void slotPushButtonCopyLinkPressed();
     void slotThumbnailFetched(const int &statusCode, const QByteArray &reply);
+
+    void done( int r );
 private:
     void setShareCheckBoxTitle(bool haveShares);
     void displayError(int code);
diff --git a/src/gui/sharedialog.ui b/src/gui/sharedialog.ui
index 820bb97..e609def 100644
--- a/src/gui/sharedialog.ui
+++ b/src/gui/sharedialog.ui
@@ -68,6 +68,9 @@
    </item>
    <item row="1" column="0">
     <layout class="QHBoxLayout" name="horizontalLayout_shareLink">
+     <property name="topMargin">
+      <number>10</number>
+     </property>
      <item>
       <widget class="QCheckBox" name="checkBox_shareLink">
        <property name="text">
@@ -86,6 +89,9 @@
       <property name="topMargin">
        <number>1</number>
       </property>
+      <property name="rightMargin">
+       <number>0</number>
+      </property>
       <item row="0" column="0">
        <layout class="QHBoxLayout" name="horizontalLayout_3">
         <property name="sizeConstraint">
@@ -116,7 +122,7 @@
         <item>
          <widget class="QPushButton" name="pushButton_copy">
           <property name="text">
-           <string>Copy &Link</string>
+           <string>Copy &link</string>
           </property>
          </widget>
         </item>
@@ -173,7 +179,7 @@
            </sizepolicy>
           </property>
           <property name="text">
-           <string>Set &Password</string>
+           <string>Set &password </string>
           </property>
          </widget>
         </item>

-- 
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