diff options
author | Klaas Freitag <freitag@owncloud.com> | 2015-03-26 20:08:06 +0300 |
---|---|---|
committer | Klaas Freitag <freitag@owncloud.com> | 2015-04-07 14:38:01 +0300 |
commit | 4a6f4919d78ce76698193594a0a2966885631601 (patch) | |
tree | 4ac210ece7deb8ddbbeb51b6be27a0ebe03e05df /src | |
parent | b98040c7d5322b6b7ca1e9e0faf1118ce6da72bf (diff) |
More GUI refinements.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/sharedialog.cpp | 28 | ||||
-rw-r--r-- | src/gui/sharedialog.h | 2 | ||||
-rw-r--r-- | 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 a1d67a03e..3662a0a4f 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 d71317662..c07d1cc9a 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 820bb97f6..e609def12 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> |