-
Notifications
You must be signed in to change notification settings - Fork 670
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update remove all dialog to use AccountModalWidget
- Loading branch information
1 parent
06e612f
commit a83446c
Showing
6 changed files
with
194 additions
and
34 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
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
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright (C) by Hannah von Reth <hannah.vonreth@owncloud.com> | ||
* | ||
* 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 | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* for more details. | ||
*/ | ||
#include "removeallfileswidget.h" | ||
#include "ui_removeallfileswidget.h" | ||
|
||
#include "resources/resources.h" | ||
|
||
using namespace OCC; | ||
|
||
RemoveAllFilesWidget::RemoveAllFilesWidget(SyncFileItem::Direction direction, const QString &path, QWidget *parent) | ||
: QWidget(parent) | ||
, ui(new Ui::RemoveAllFilesWidget) | ||
{ | ||
ui->setupUi(this); | ||
|
||
ui->trashIcon->setPixmap(Resources::getCoreIcon(QStringLiteral("delete")).pixmap({128, 128})); | ||
if (direction == SyncFileItem::Down) { | ||
ui->label->setText(tr("All files in the sync folder '%1' folder were deleted on the server.\n" | ||
"These deletes will be synchronized to your local sync folder, making such files " | ||
"unavailable unless you have a right to restore. \n" | ||
"If you decide to keep the files, they will be re-synced with the server if you have rights to do so.\n" | ||
"If you decide to delete the files, they will be unavailable to you, unless you are the owner.") | ||
.arg(path)); | ||
} else { | ||
ui->label->setText(tr("All the files in your local sync folder '%1' were deleted. These deletes will be " | ||
"synchronized with your server, making such files unavailable unless restored.\n" | ||
"Are you sure you want to sync those actions with the server?\n" | ||
"If this was an accident and you decide to keep your files, they will be re-synced from the server.") | ||
.arg(path)); | ||
} | ||
} | ||
|
||
RemoveAllFilesWidget::~RemoveAllFilesWidget() | ||
{ | ||
delete ui; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (C) by Hannah von Reth <hannah.vonreth@owncloud.com> | ||
* | ||
* 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 | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* for more details. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "gui/accountmodalwidget.h" | ||
#include "libsync/syncfileitem.h" | ||
|
||
#include <QWidget> | ||
|
||
namespace OCC { | ||
|
||
namespace Ui { | ||
class RemoveAllFilesWidget; | ||
} | ||
|
||
|
||
class RemoveAllFilesWidget : public QWidget | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit RemoveAllFilesWidget(SyncFileItem::Direction direction, const QString &path, QWidget *parent = nullptr); | ||
~RemoveAllFilesWidget(); | ||
|
||
private: | ||
Ui::RemoveAllFilesWidget *ui; | ||
}; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>OCC::RemoveAllFilesWidget</class> | ||
<widget class="QWidget" name="OCC::RemoveAllFilesWidget"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>400</width> | ||
<height>300</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Form</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<spacer name="verticalSpacer"> | ||
<property name="orientation"> | ||
<enum>Qt::Vertical</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>20</width> | ||
<height>40</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<layout class="QGridLayout" name="gridLayout"> | ||
<item row="0" column="0"> | ||
<widget class="QLabel" name="trashIcon"> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="maximumSize"> | ||
<size> | ||
<width>128</width> | ||
<height>128</height> | ||
</size> | ||
</property> | ||
<property name="text"> | ||
<string/> | ||
</property> | ||
<property name="pixmap"> | ||
<pixmap resource="../../../../../../../_/30b36579/owncloud-client/src/resources/client.qrc">:/client/resources/light/delete.svg</pixmap> | ||
</property> | ||
<property name="scaledContents"> | ||
<bool>true</bool> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignCenter</set> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="label"> | ||
<property name="text"> | ||
<string>TextLabel</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<spacer name="verticalSpacer_2"> | ||
<property name="orientation"> | ||
<enum>Qt::Vertical</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>20</width> | ||
<height>40</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources> | ||
<include location="../../../../../../../_/30b36579/owncloud-client/src/resources/client.qrc"/> | ||
</resources> | ||
<connections/> | ||
</ui> |