-
Notifications
You must be signed in to change notification settings - Fork 817
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Claudio Cambra <[email protected]>
- Loading branch information
1 parent
e9a0e38
commit 9e006d5
Showing
4 changed files
with
18 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
/* | ||
* Copyright (C) by Roeland Jago Douma <[email protected]> | ||
* Copyright (C) 2015 by Klaas Freitag <[email protected]> | ||
* Copyright (C) 2022 by Claudio Cambra <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -15,35 +14,24 @@ | |
|
||
#include "ui_internallinkwidget.h" | ||
#include "internallinkwidget.h" | ||
#include "account.h" | ||
#include "accountstate.h" | ||
#include "folderman.h" | ||
#include "theme.h" | ||
#include "elidedlabel.h" | ||
|
||
#include "QProgressIndicator.h" | ||
#include <QBuffer> | ||
#include <QClipboard> | ||
#include <QFileInfo> | ||
#include <QDesktopServices> | ||
#include <QMessageBox> | ||
#include <QMenu> | ||
#include <QTextEdit> | ||
#include <QToolButton> | ||
#include <QPropertyAnimation> | ||
|
||
namespace OCC { | ||
|
||
Q_LOGGING_CATEGORY(lcInternalLink, "nextcloud.gui.internaklink", QtInfoMsg) | ||
|
||
InternalLinkWidget::InternalLinkWidget(AccountPtr account, | ||
const QString &sharePath, | ||
const QString &localPath, | ||
QWidget *parent) | ||
: QWidget(parent) | ||
, _ui(new Ui::InternalLinkWidget) | ||
, _account(account) | ||
, _sharePath(sharePath) | ||
, _localPath(localPath) | ||
{ | ||
_ui->setupUi(this); | ||
|
@@ -73,14 +61,6 @@ InternalLinkWidget::InternalLinkWidget(AccountPtr account, | |
_ui->internalLinkProgressIndicator->startAnimation(); | ||
|
||
connect(_ui->copyInternalLinkButton, &QPushButton::clicked, this, &InternalLinkWidget::slotCopyInternalLink); | ||
|
||
_ui->errorLabel->hide(); | ||
|
||
// check if the file is already inside of a synced folder | ||
if (sharePath.isEmpty()) { | ||
qCWarning(lcInternalLink) << "Unable to share files not in a sync folder."; | ||
return; | ||
} | ||
} | ||
|
||
InternalLinkWidget::~InternalLinkWidget() | ||
|
@@ -108,12 +88,6 @@ void InternalLinkWidget::slotCopyInternalLink(const bool clicked) const | |
QApplication::clipboard()->setText(_internalUrl); | ||
} | ||
|
||
void InternalLinkWidget::displayError(const QString &errMsg) | ||
{ | ||
_ui->errorLabel->setText(errMsg); | ||
_ui->errorLabel->show(); | ||
} | ||
|
||
void InternalLinkWidget::slotStyleChanged() | ||
{ | ||
customizeStyle(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
/* | ||
* Copyright (C) by Roeland Jago Douma <[email protected]> | ||
* Copyright (C) 2015 by Klaas Freitag <[email protected]> | ||
* Copyright (C) 2022 by Claudio Cambra <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -17,32 +16,17 @@ | |
#define INTERNALLINKWIDGET_H | ||
|
||
#include "accountfwd.h" | ||
#include "sharepermissions.h" | ||
|
||
#include "QProgressIndicator.h" | ||
#include <QDialog> | ||
#include <QSharedPointer> | ||
#include <QList> | ||
#include <QToolButton> | ||
#include <QHBoxLayout> | ||
#include <QLabel> | ||
#include <QLineEdit> | ||
#include <QWidgetAction> | ||
|
||
class QMenu; | ||
class QTableWidgetItem; | ||
|
||
namespace OCC { | ||
|
||
namespace Ui { | ||
class InternalLinkWidget; | ||
} | ||
|
||
class AbstractCredentials; | ||
class SyncResult; | ||
class LinkShare; | ||
class Share; | ||
class ElidedLabel; | ||
|
||
/** | ||
* @brief The ShareDialog class | ||
* @ingroup gui | ||
|
@@ -53,7 +37,6 @@ class InternalLinkWidget : public QWidget | |
|
||
public: | ||
explicit InternalLinkWidget(AccountPtr account, | ||
const QString &sharePath, | ||
const QString &localPath, | ||
QWidget *parent = nullptr); | ||
~InternalLinkWidget() override; | ||
|
@@ -69,13 +52,10 @@ private slots: | |
void slotCopyInternalLink(const bool clicked) const; | ||
|
||
private: | ||
void displayError(const QString &errMsg); | ||
|
||
void customizeStyle(); | ||
|
||
Ui::InternalLinkWidget *_ui; | ||
AccountPtr _account; | ||
QString _sharePath; | ||
QString _localPath; | ||
QString _internalUrl; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters