sharedialog.ui
sharelinkwidget.ui
shareusergroupwidget.ui
- sharewidget.ui
+ shareuserline.ui
sslerrordialog.ui
addcertificatedialog.ui
proxyauthdialog.ui
#include "shareusergroupwidget.h"
#include "ui_shareusergroupwidget.h"
-#include "ui_sharewidget.h"
+#include "ui_shareuserline.h"
#include "account.h"
#include "json.h"
#include "folderman.h"
QSharedPointer<Sharee> currentUser(new Sharee(_account->credentials()->user(), "", Sharee::Type::User));
blacklist << currentUser;
- foreach (auto sw, _ui->scrollArea->findChildren<ShareWidget*>()) {
+ foreach (auto sw, _ui->scrollArea->findChildren<ShareUserLine*>()) {
blacklist << sw->share()->getShareWith();
}
_ui->errorLabel->hide();
continue;
}
- ShareWidget *s = new ShareWidget(share, _maxSharingPermissions, _isFile, _ui->scrollArea);
+ ShareUserLine *s = new ShareUserLine(share, _maxSharingPermissions, _isFile, _ui->scrollArea);
connect(s, SIGNAL(resizeRequested()), this, SLOT(slotAdjustScrollWidgetSize()));
connect(s, SIGNAL(visualDeletionDone()), this, SLOT(getShares()));
layout->addWidget(s);
void ShareUserGroupWidget::slotAdjustScrollWidgetSize()
{
QScrollArea *scrollArea = _ui->scrollArea;
- if (scrollArea->findChildren<ShareWidget*>().count() <= 3) {
+ if (scrollArea->findChildren<ShareUserLine*>().count() <= 3) {
auto minimumSize = scrollArea->widget()->sizeHint();
auto spacing = scrollArea->widget()->layout()->spacing();
minimumSize.rwidth() += spacing;
_ui->shareeLineEdit->setEnabled(true);
}
-ShareWidget::ShareWidget(QSharedPointer<Share> share,
- SharePermissions maxSharingPermissions,
- bool isFile,
- QWidget *parent) :
+ShareUserLine::ShareUserLine(QSharedPointer<Share> share,
+ SharePermissions maxSharingPermissions,
+ bool isFile,
+ QWidget *parent) :
QWidget(parent),
- _ui(new Ui::ShareWidget),
+ _ui(new Ui::ShareUserLine),
_share(share),
_isFile(isFile)
{
}
}
-void ShareWidget::on_deleteShareButton_clicked()
+void ShareUserLine::on_deleteShareButton_clicked()
{
setEnabled(false);
_share->deleteShare();
}
-ShareWidget::~ShareWidget()
+ShareUserLine::~ShareUserLine()
{
delete _ui;
}
-void ShareWidget::slotEditPermissionsChanged()
+void ShareUserLine::slotEditPermissionsChanged()
{
setEnabled(false);
_share->setPermissions(permissions);
}
-void ShareWidget::slotPermissionsChanged()
+void ShareUserLine::slotPermissionsChanged()
{
setEnabled(false);
_share->setPermissions(permissions);
}
-void ShareWidget::slotDeleteAnimationFinished()
+void ShareUserLine::slotDeleteAnimationFinished()
{
emit resizeRequested();
emit visualDeletionDone();
connect(this, SIGNAL(destroyed(QObject*)), parentWidget(), SLOT(repaint()));
}
-void ShareWidget::slotShareDeleted()
+void ShareUserLine::slotShareDeleted()
{
QPropertyAnimation *animation = new QPropertyAnimation(this, "maximumHeight", this);
animation->start();
}
-void ShareWidget::slotPermissionsSet()
+void ShareUserLine::slotPermissionsSet()
{
displayPermissions();
setEnabled(true);
}
-QSharedPointer<Share> ShareWidget::share() const
+QSharedPointer<Share> ShareUserLine::share() const
{
return _share;
}
-void ShareWidget::displayPermissions()
+void ShareUserLine::displayPermissions()
{
auto perm = _share->getPermissions();
namespace Ui {
class ShareUserGroupWidget;
-class ShareWidget;
+class ShareUserLine;
}
class AbstractCredentials;
class ShareManager;
class ShareeModel;
-class ShareWidget : public QWidget
-{
- Q_OBJECT
-
-public:
- explicit ShareWidget(QSharedPointer<Share> Share,
- SharePermissions maxSharingPermissions,
- bool isFile,
- QWidget *parent = 0);
- ~ShareWidget();
-
- QSharedPointer<Share> share() const;
-
-signals:
- void visualDeletionDone();
- void resizeRequested();
-
-private slots:
- void on_deleteShareButton_clicked();
- void slotPermissionsChanged();
- void slotEditPermissionsChanged();
- void slotDeleteAnimationFinished();
-
- void slotShareDeleted();
- void slotPermissionsSet();
-private:
- void displayPermissions();
-
- Ui::ShareWidget *_ui;
- QSharedPointer<Share> _share;
- bool _isFile;
-
- QAction *_permissionCreate;
- QAction *_permissionUpdate;
- QAction *_permissionDelete;
-};
-
-
/**
* @brief The ShareDialog (user/group) class
* @ingroup gui
QProgressIndicator _pi_sharee;
};
+/**
+ * The widget displayed for each user/group share
+ */
+class ShareUserLine : public QWidget
+{
+ Q_OBJECT
+
+public:
+ explicit ShareUserLine(QSharedPointer<Share> Share,
+ SharePermissions maxSharingPermissions,
+ bool isFile,
+ QWidget *parent = 0);
+ ~ShareUserLine();
+
+ QSharedPointer<Share> share() const;
+
+signals:
+ void visualDeletionDone();
+ void resizeRequested();
+
+private slots:
+ void on_deleteShareButton_clicked();
+ void slotPermissionsChanged();
+ void slotEditPermissionsChanged();
+ void slotDeleteAnimationFinished();
+
+ void slotShareDeleted();
+ void slotPermissionsSet();
+private:
+ void displayPermissions();
+
+ Ui::ShareUserLine *_ui;
+ QSharedPointer<Share> _share;
+ bool _isFile;
+
+ QAction *_permissionCreate;
+ QAction *_permissionUpdate;
+ QAction *_permissionDelete;
+};
+
}
#endif // SHAREUSERGROUPWIDGET_H
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>OCC::ShareUserLine</class>
+ <widget class="QWidget" name="OCC::ShareUserLine">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>468</width>
+ <height>64</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <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>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QLabel" name="sharedWith">
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ <property name="textFormat">
+ <enum>Qt::PlainText</enum>
+ </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>15</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QFrame" name="frame">
+ <property name="frameShape">
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="1">
+ <widget class="QCheckBox" name="permissionsEdit">
+ <property name="text">
+ <string>can edit</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0">
+ <widget class="QCheckBox" name="permissionShare">
+ <property name="text">
+ <string>can share</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QToolButton" name="permissionToolButton">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="deleteShareButton">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset theme="user-trash">
+ <normaloff>.</normaloff>.</iconset>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>OCC::ShareWidget</class>
- <widget class="QWidget" name="OCC::ShareWidget">
- <property name="enabled">
- <bool>true</bool>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>468</width>
- <height>64</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Form</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <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>
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
- <widget class="QLabel" name="sharedWith">
- <property name="text">
- <string>TextLabel</string>
- </property>
- <property name="textFormat">
- <enum>Qt::PlainText</enum>
- </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>15</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QFrame" name="frame">
- <property name="frameShape">
- <enum>QFrame::StyledPanel</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Raised</enum>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="1">
- <widget class="QCheckBox" name="permissionsEdit">
- <property name="text">
- <string>can edit</string>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QCheckBox" name="permissionShare">
- <property name="text">
- <string>can share</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QToolButton" name="permissionToolButton">
- <property name="text">
- <string>...</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="deleteShareButton">
- <property name="text">
- <string/>
- </property>
- <property name="icon">
- <iconset theme="user-trash">
- <normaloff>.</normaloff>.</iconset>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>