mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 21:15:55 +03:00
Confirm External Storage: adjust the notification message
We need to forward the information that the folder is an external storage for the notification message. Issue: https://github.com/owncloud/client/pull/5340#issuecomment-274878023
This commit is contained in:
parent
ed7416098e
commit
38cf459b3e
7 changed files with 54 additions and 64 deletions
|
@ -104,7 +104,8 @@ Folder::Folder(const FolderDefinition& definition,
|
|||
connect(_engine.data(), SIGNAL(transmissionProgress(ProgressInfo)), this, SLOT(slotTransmissionProgress(ProgressInfo)));
|
||||
connect(_engine.data(), SIGNAL(itemCompleted(const SyncFileItem &, const PropagatorJob &)),
|
||||
this, SLOT(slotItemCompleted(const SyncFileItem &, const PropagatorJob &)));
|
||||
connect(_engine.data(), SIGNAL(newBigFolder(QString)), this, SLOT(slotNewBigFolderDiscovered(QString)));
|
||||
connect(_engine.data(), SIGNAL(newBigFolder(QString,bool)),
|
||||
this, SLOT(slotNewBigFolderDiscovered(QString,bool)));
|
||||
connect(_engine.data(), SIGNAL(seenLockedFile(QString)), FolderMan::instance(), SLOT(slotSyncOnceFileUnlocks(QString)));
|
||||
connect(_engine.data(), SIGNAL(aboutToPropagate(SyncFileItemVector&)),
|
||||
SLOT(slotLogPropagationStart()));
|
||||
|
@ -930,7 +931,7 @@ void Folder::slotItemCompleted(const SyncFileItem &item, const PropagatorJob& jo
|
|||
emit ProgressDispatcher::instance()->itemCompleted(alias(), item, job);
|
||||
}
|
||||
|
||||
void Folder::slotNewBigFolderDiscovered(const QString &newF)
|
||||
void Folder::slotNewBigFolderDiscovered(const QString &newF, bool isExternal)
|
||||
{
|
||||
auto newFolder = newF;
|
||||
if (!newFolder.endsWith(QLatin1Char('/'))) {
|
||||
|
@ -955,9 +956,11 @@ void Folder::slotNewBigFolderDiscovered(const QString &newF)
|
|||
journal->setSelectiveSyncList(SyncJournalDb::SelectiveSyncUndecidedList, undecidedList);
|
||||
emit newBigFolderDiscovered(newFolder);
|
||||
}
|
||||
QString message = tr("A new folder larger than %1 MB has been added: %2.\n"
|
||||
"Please go in the settings to select it if you wish to download it.")
|
||||
.arg(ConfigFile().newBigFolderSizeLimit().second).arg(newF);
|
||||
QString message = !isExternal ?
|
||||
(tr("A new folder larger than %1 MB has been added: %2.\n")
|
||||
.arg(ConfigFile().newBigFolderSizeLimit().second).arg(newF))
|
||||
: (tr("A folder from an external storage has been added.\n"));
|
||||
message += tr("Please go in the settings to select it if you wish to download it.");
|
||||
|
||||
auto logger = Logger::instance();
|
||||
logger->postOptionalGuiLog(Theme::instance()->appNameGUI(), message);
|
||||
|
|
|
@ -290,7 +290,7 @@ private slots:
|
|||
|
||||
void slotEmitFinishedDelayed();
|
||||
|
||||
void slotNewBigFolderDiscovered(const QString &);
|
||||
void slotNewBigFolderDiscovered(const QString &, bool isExternal);
|
||||
|
||||
void slotLogPropagationStart();
|
||||
|
||||
|
|
|
@ -52,34 +52,32 @@
|
|||
<property name="title">
|
||||
<string>Advanced</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1" colspan="2">
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>555</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QPushButton" name="ignoredFilesButton">
|
||||
<property name="text">
|
||||
<string>Edit &Ignored Files</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>555</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="crashreporterCheckBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>S&how crash reporter</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="3">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="newFolderLimitCheckBox">
|
||||
|
@ -123,37 +121,26 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="ignoredFilesButton">
|
||||
<property name="text">
|
||||
<string>Edit &Ignored Files</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="3">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="newExternalStorage">
|
||||
<property name="text">
|
||||
<string>Ask for confirmation before synchronizing external storages</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="crashreporterCheckBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>S&how crash reporter</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -99,7 +99,7 @@ bool DiscoveryJob::checkSelectiveSyncNewFolder(const QString& path, const char *
|
|||
return false;
|
||||
}
|
||||
|
||||
emit newBigFolder(path);
|
||||
emit newBigFolder(path, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,7 @@ bool DiscoveryJob::checkSelectiveSyncNewFolder(const QString& path, const char *
|
|||
|
||||
if (result >= limit) {
|
||||
// we tell the UI there is a new folder
|
||||
emit newBigFolder(path);
|
||||
emit newBigFolder(path, false);
|
||||
return true;
|
||||
} else {
|
||||
// it is not too big, put it in the white list (so we will not do more query for the children)
|
||||
|
|
|
@ -229,7 +229,7 @@ signals:
|
|||
void doGetSizeSignal(const QString &path, qint64 *result);
|
||||
|
||||
// A new folder was discovered and was not synced because of the confirmation feature
|
||||
void newBigFolder(const QString &folder);
|
||||
void newBigFolder(const QString &folder, bool isExternal);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -835,8 +835,8 @@ void SyncEngine::startSync()
|
|||
connect(discoveryJob, SIGNAL(folderDiscovered(bool,QString)),
|
||||
this, SIGNAL(folderDiscovered(bool,QString)));
|
||||
|
||||
connect(discoveryJob, SIGNAL(newBigFolder(QString)),
|
||||
this, SIGNAL(newBigFolder(QString)));
|
||||
connect(discoveryJob, SIGNAL(newBigFolder(QString,bool)),
|
||||
this, SIGNAL(newBigFolder(QString,bool)));
|
||||
|
||||
|
||||
// This is used for the DiscoveryJob to be able to request the main thread/
|
||||
|
|
|
@ -143,7 +143,7 @@ signals:
|
|||
void aboutToRestoreBackup(bool *restore);
|
||||
|
||||
// A new folder was discovered and was not synced because of the confirmation feature
|
||||
void newBigFolder(const QString &folder);
|
||||
void newBigFolder(const QString &folder, bool isExternal);
|
||||
|
||||
/** Emitted when propagation has problems with a locked file.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue