[Pkg-owncloud-commits] [owncloud-client] 13/171: Share UI: Hide 'allow editing' for files #4211

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Feb 17 09:36:43 UTC 2016


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

hefee-guest pushed a commit to annotated tag upstream/2.1.1+dfsg
in repository owncloud-client.

commit a2eee7e349918e2e7194774ea3399fa937daafd5
Author: Christian Kamm <mail at ckamm.de>
Date:   Tue Dec 8 15:37:17 2015 +0100

    Share UI: Hide 'allow editing' for files #4211
---
 src/gui/sharelinkwidget.cpp  | 19 +++++---------
 src/gui/sharelinkwidget.ui   | 60 +++++++++++++++++++++++++++-----------------
 src/libsync/capabilities.cpp |  1 +
 3 files changed, 44 insertions(+), 36 deletions(-)

diff --git a/src/gui/sharelinkwidget.cpp b/src/gui/sharelinkwidget.cpp
index 5d335b2..39df466 100644
--- a/src/gui/sharelinkwidget.cpp
+++ b/src/gui/sharelinkwidget.cpp
@@ -129,13 +129,9 @@ ShareLinkWidget::ShareLinkWidget(AccountPtr account,
     }
 
     // File can't have public upload set.
-    if (_isFile) {
-        _ui->checkBox_editing->setEnabled(false);
-    } else {
-        if (!_account->capabilities().sharePublicLinkAllowUpload()) {
-            _ui->checkBox_editing->setEnabled(false);
-        }
-    }
+    _ui->widget_editing->setVisible(!_isFile);
+    _ui->checkBox_editing->setEnabled(
+            _account->capabilities().sharePublicLinkAllowUpload());
 
     /*
      * Create the share manager and connect it properly
@@ -268,13 +264,10 @@ void ShareLinkWidget::slotSharesFetched(const QList<QSharedPointer<Share>> &shar
              * Only directories can have public upload set
              * For public links the server sets CREATE and UPDATE permissions.
              */
+            _ui->checkBox_editing->setEnabled(
+                    _account->capabilities().sharePublicLinkAllowUpload());
             if (!_isFile) {
-                _ui->checkBox_editing->setEnabled(true);
-                if (_share->getPublicUpload()) {
-                    _ui->checkBox_editing->setChecked(true);
-                } else {
-                    _ui->checkBox_editing->setChecked(false);
-                }
+                _ui->checkBox_editing->setChecked(_share->getPublicUpload());
             }
 
             setShareLink(_share->getLink().toString());
diff --git a/src/gui/sharelinkwidget.ui b/src/gui/sharelinkwidget.ui
index 71aa051..254d50d 100644
--- a/src/gui/sharelinkwidget.ui
+++ b/src/gui/sharelinkwidget.ui
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>372</width>
-    <height>212</height>
+    <height>237</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -168,28 +168,42 @@
        </layout>
       </item>
       <item row="3" column="0">
-       <layout class="QHBoxLayout" name="horizontalLayout_editing">
-        <item>
-         <widget class="QCheckBox" name="checkBox_editing">
-          <property name="text">
-           <string>Allow editing</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
+       <widget class="QWidget" name="widget_editing" native="true">
+        <layout class="QHBoxLayout" name="horizontalLayout_editing">
+         <property name="leftMargin">
+          <number>0</number>
+         </property>
+         <property name="topMargin">
+          <number>0</number>
+         </property>
+         <property name="rightMargin">
+          <number>0</number>
+         </property>
+         <property name="bottomMargin">
+          <number>0</number>
+         </property>
+         <item>
+          <widget class="QCheckBox" name="checkBox_editing">
+           <property name="text">
+            <string>Allow editing</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </widget>
       </item>
      </layout>
     </widget>
diff --git a/src/libsync/capabilities.cpp b/src/libsync/capabilities.cpp
index f4a0217..a53e00f 100644
--- a/src/libsync/capabilities.cpp
+++ b/src/libsync/capabilities.cpp
@@ -16,6 +16,7 @@
 #include "configfile.h"
 
 #include <QVariantMap>
+#include <QDebug>
 
 namespace OCC {
 

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