[Pkg-owncloud-commits] [owncloud-client] 74/159: ShareDialog: Some GUI rework requested by Jan.

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri May 1 13:05:24 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 1240a8163d41fea97f332121d1e367ea3fdfa560
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Thu Mar 26 16:51:31 2015 +0100

    ShareDialog: Some GUI rework requested by Jan.
---
 src/gui/sharedialog.cpp |  35 ++++----
 src/gui/sharedialog.ui  | 211 ++++++++++++++++++++++++++----------------------
 2 files changed, 134 insertions(+), 112 deletions(-)

diff --git a/src/gui/sharedialog.cpp b/src/gui/sharedialog.cpp
index b57f36a..bbcf05b 100644
--- a/src/gui/sharedialog.cpp
+++ b/src/gui/sharedialog.cpp
@@ -84,24 +84,20 @@ ShareDialog::ShareDialog(AccountPtr account, const QString &sharePath, const QSt
     QIcon icon = icon_provider.icon(f_info);
     _ui->label_icon->setPixmap(icon.pixmap(40,40));
 
-    QString name;
-    if( f_info.isDir() ) {
-        name = tr("Share Directory");
-    } else {
-        name = tr("Share File");
-    }
-    _ui->groupBox->setTitle(name);
-
-    QString lPath(_localPath);
-    if( lPath.length() > 50) {
-        lPath = QLatin1String("...")+lPath.right(50);
-    }
-    _ui->label_name->setText(tr("Local path: %1").arg(lPath));
+    QFileInfo lPath(_localPath);
+    QString fileName = lPath.fileName();
+    _ui->label_name->setText(tr("%1").arg(fileName));
+    QFont f( _ui->label_name->font());
+    f.setPointSize( f.pointSize() * 1.4 );
+    _ui->label_name->setFont( f );
 
     _ui->label_sharePath->setWordWrap(true);
-    _ui->label_sharePath->setText(tr("%1 path: %2").arg(Theme::instance()->appNameGUI()).arg(_sharePath));
+    QString ocDir(_sharePath);
+    ocDir.truncate(ocDir.length()-fileName.length());
+
+    _ui->label_sharePath->setText(tr("%1 path: %2").arg(Theme::instance()->appNameGUI()).arg(ocDir));
     this->setWindowTitle(tr("%1 Sharing").arg(Theme::instance()->appNameGUI()));
-    _ui->label_password->setText(tr("Set p&assword"));
+    _ui->checkBox_password->setText(tr("Set p&assword"));
     // 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
@@ -336,7 +332,12 @@ void ShareDialog::setShareLink( const QString& url )
     // FIXME: shorten the url for output.
     const QUrl realUrl(url);
     if( realUrl.isValid() ) {
-        const QString u = QString("<a href=\"%1\">%2</a>").arg(realUrl.toString(QUrl::None)).arg(url);
+        QFontMetrics fm( _ui->_labelShareLink->font() );
+        int linkLengthPixel = _ui->_labelShareLink->width();
+
+        QString elidedUrl = fm.elidedText(url, Qt::ElideRight, linkLengthPixel);
+
+        const QString u = QString("<a href=\"%1\">%2</a>").arg(realUrl.toString(QUrl::None)).arg(elidedUrl);
         _ui->_labelShareLink->setText(u);
         _shareUrl = url;
         _ui->pushButton_copy->setEnabled(true);
@@ -407,7 +408,7 @@ void ShareDialog::slotCreateShareFetched(const QString &reply)
         // there needs to be a password
         _ui->checkBox_password->setChecked(true);
         _ui->checkBox_password->setVisible(false);
-        _ui->label_password->setText(tr("Public sh&aring requires a password:"));
+        _ui->checkBox_password->setText(tr("Public sh&aring requires a password:"));
         _ui->lineEdit_password->setFocus();
         _ui->widget_shareLink->show();
 
diff --git a/src/gui/sharedialog.ui b/src/gui/sharedialog.ui
index c3194b0..820bb97 100644
--- a/src/gui/sharedialog.ui
+++ b/src/gui/sharedialog.ui
@@ -6,20 +6,65 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>403</width>
-    <height>296</height>
+    <width>372</width>
+    <height>241</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string>Share NewDocument.odt</string>
   </property>
-  <layout class="QGridLayout" name="gridLayout_4">
-   <item row="4" column="0">
-    <widget class="QLabel" name="errorLabel">
-     <property name="text">
-      <string>TextLabel</string>
-     </property>
-    </widget>
+  <layout class="QGridLayout" name="gridLayout_3">
+   <item row="0" column="0" colspan="2">
+    <layout class="QGridLayout" name="gridLayout">
+     <item row="0" column="0" rowspan="2">
+      <widget class="QLabel" name="label_icon">
+       <property name="text">
+        <string>TextLabel</string>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="1">
+      <widget class="QLabel" name="label_name">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="font">
+        <font>
+         <weight>75</weight>
+         <bold>true</bold>
+        </font>
+       </property>
+       <property name="text">
+        <string>share label</string>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="2" rowspan="2">
+      <widget class="QProgressIndicator" name="pi_share" native="true"/>
+     </item>
+     <item row="1" column="1">
+      <widget class="QLabel" name="label_sharePath">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="font">
+        <font>
+         <weight>50</weight>
+         <bold>false</bold>
+        </font>
+       </property>
+       <property name="text">
+        <string>ownCloud Path:</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
    </item>
    <item row="1" column="0">
     <layout class="QHBoxLayout" name="horizontalLayout_shareLink">
@@ -34,9 +79,12 @@
    </item>
    <item row="2" column="0" colspan="2">
     <widget class="QWidget" name="widget_shareLink" native="true">
-     <layout class="QGridLayout" name="gridLayout_3">
+     <layout class="QGridLayout" name="gridLayout_2">
+      <property name="leftMargin">
+       <number>20</number>
+      </property>
       <property name="topMargin">
-       <number>0</number>
+       <number>1</number>
       </property>
       <item row="0" column="0">
        <layout class="QHBoxLayout" name="horizontalLayout_3">
@@ -79,30 +127,36 @@
         <item>
          <widget class="QCheckBox" name="checkBox_password">
           <property name="sizePolicy">
-           <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+           <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
             <horstretch>0</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
           </property>
           <property name="text">
-           <string/>
+           <string>Set password</string>
           </property>
          </widget>
         </item>
         <item>
-         <widget class="QLabel" name="label_password">
-          <property name="text">
-           <string>Set p&assword</string>
+         <spacer name="horizontalSpacer_3">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
           </property>
-          <property name="buddy">
-           <cstring>checkBox_password</cstring>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
           </property>
-         </widget>
+         </spacer>
         </item>
        </layout>
       </item>
       <item row="2" column="0">
-       <layout class="QHBoxLayout" name="horizontalLayout_14">
+       <layout class="QHBoxLayout" name="horizontalLayout">
+        <property name="leftMargin">
+         <number>20</number>
+        </property>
         <item>
          <widget class="QLineEdit" name="lineEdit_password">
           <property name="echoMode">
@@ -112,6 +166,12 @@
         </item>
         <item>
          <widget class="QPushButton" name="pushButton_setPassword">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
           <property name="text">
            <string>Set &Password</string>
           </property>
@@ -120,7 +180,10 @@
        </layout>
       </item>
       <item row="3" column="0">
-       <layout class="QHBoxLayout" name="horizontalLayout">
+       <layout class="QHBoxLayout" name="horizontalLayout_2">
+        <property name="leftMargin">
+         <number>0</number>
+        </property>
         <item>
          <widget class="QCheckBox" name="checkBox_expire">
           <property name="text">
@@ -140,80 +203,6 @@
      </layout>
     </widget>
    </item>
-   <item row="5" column="0">
-    <widget class="QDialogButtonBox" name="buttonBox">
-     <property name="standardButtons">
-      <set>QDialogButtonBox::Close</set>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="0" colspan="2">
-    <widget class="QGroupBox" name="groupBox">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="title">
-      <string>Share Info</string>
-     </property>
-     <layout class="QGridLayout" name="gridLayout_2">
-      <item row="0" column="0">
-       <layout class="QGridLayout" name="gridLayout">
-        <item row="0" column="0" rowspan="2">
-         <widget class="QLabel" name="label_icon">
-          <property name="text">
-           <string>TextLabel</string>
-          </property>
-         </widget>
-        </item>
-        <item row="0" column="1">
-         <widget class="QLabel" name="label_name">
-          <property name="sizePolicy">
-           <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
-            <horstretch>0</horstretch>
-            <verstretch>0</verstretch>
-           </sizepolicy>
-          </property>
-          <property name="font">
-           <font>
-            <weight>75</weight>
-            <bold>true</bold>
-           </font>
-          </property>
-          <property name="text">
-           <string>share label</string>
-          </property>
-         </widget>
-        </item>
-        <item row="0" column="2" rowspan="2">
-         <widget class="QProgressIndicator" name="pi_share" native="true"/>
-        </item>
-        <item row="1" column="1">
-         <widget class="QLabel" name="label_sharePath">
-          <property name="sizePolicy">
-           <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
-            <horstretch>0</horstretch>
-            <verstretch>0</verstretch>
-           </sizepolicy>
-          </property>
-          <property name="font">
-           <font>
-            <weight>50</weight>
-            <bold>false</bold>
-           </font>
-          </property>
-          <property name="text">
-           <string>ownCloud Path:</string>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </item>
-     </layout>
-    </widget>
-   </item>
    <item row="3" column="1">
     <spacer name="verticalSpacer">
      <property name="orientation">
@@ -227,7 +216,39 @@
      </property>
     </spacer>
    </item>
+   <item row="4" column="0">
+    <widget class="QLabel" name="errorLabel">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>TextLabel</string>
+     </property>
+    </widget>
+   </item>
+   <item row="5" column="0" colspan="2">
+    <widget class="QDialogButtonBox" name="buttonBox">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="standardButtons">
+      <set>QDialogButtonBox::Close</set>
+     </property>
+    </widget>
+   </item>
   </layout>
+  <zorder>errorLabel</zorder>
+  <zorder>widget_shareLink</zorder>
+  <zorder>buttonBox</zorder>
+  <zorder>checkBox_password</zorder>
+  <zorder>layoutWidget</zorder>
+  <zorder>verticalSpacer</zorder>
  </widget>
  <layoutdefault spacing="6" margin="11"/>
  <customwidgets>

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