mirror of
https://github.com/chylex/Nextcloud-Desktop.git
synced 2026-04-03 18:11:32 +02:00
Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14a25f9d3f | ||
|
|
4e777aae33 | ||
|
|
5a84452102 | ||
|
|
8aa75ba4a4 | ||
|
|
2f24172bac | ||
|
|
10fba886dc | ||
|
|
046d955f5c | ||
|
|
d0d362664b | ||
|
|
f841450dae | ||
|
|
1fccb23442 | ||
|
|
bfd50ffcd0 | ||
|
|
4f2a171913 | ||
|
|
005d70a73c | ||
|
|
592291cbcb | ||
|
|
7236bd7dd4 | ||
|
|
c02d5f41a5 | ||
|
|
5a7cd815ab | ||
|
|
c2c01bccfc | ||
|
|
fb4728c7ee | ||
|
|
f34621578e | ||
|
|
5e50b1f1fd | ||
|
|
9b62104f30 | ||
|
|
86e42a9cf0 |
16
ChangeLog
16
ChangeLog
@@ -1,5 +1,21 @@
|
||||
ChangeLog
|
||||
=========
|
||||
|
||||
version 1.4.2 (release 2013-10-18 ), csync 0.90.4 required
|
||||
|
||||
* Do not show the warning icon in the tray (#944)
|
||||
* Fix manual proxy support when switching (#1016)
|
||||
* Add folder column to detailed sync protocol (#1037)
|
||||
* Fix possible endless loop in inotify (#1041)
|
||||
* Do not elide the progress text (#1049)
|
||||
* Fix high CPU load (#1073)
|
||||
* Reconnect if network is unavailable after startup (#1080)
|
||||
* Ensure paused folder stays paused when syncing with more than one folder (#1083)
|
||||
* Don't show desktop notification when the user doesn't want to (#1093)
|
||||
* System tray: Avoid quick flickering up of the ok-icon for the sync prepare state
|
||||
* Progress: Do not show progress if nothing is transmitted
|
||||
* Progress: Show number of deletes.
|
||||
|
||||
version 1.4.1 (release 2013-09-24 ), csync 0.90.1 required
|
||||
|
||||
* Translation and documentation fixes.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
set( VERSION_MAJOR 1 )
|
||||
set( VERSION_MINOR 4 )
|
||||
set( VERSION_PATCH 1 )
|
||||
set( VERSION_PATCH 2 )
|
||||
set( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX}")
|
||||
set( SOVERSION 0 )
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
#include <QMessageBox>
|
||||
#include <QAction>
|
||||
#include <QKeySequence>
|
||||
#include <QIcon>
|
||||
#include <QVariant>
|
||||
|
||||
namespace Mirall {
|
||||
|
||||
@@ -50,7 +52,8 @@ static const char progressBarStyleC[] =
|
||||
|
||||
AccountSettings::AccountSettings(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::AccountSettings)
|
||||
ui(new Ui::AccountSettings),
|
||||
_wasDisabledBefore(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
@@ -216,7 +219,7 @@ void AccountSettings::folderToModelItem( QStandardItem *item, Folder *f )
|
||||
item->setData( f->nativePath(), FolderStatusDelegate::FolderPathRole );
|
||||
item->setData( f->secondPath(), FolderStatusDelegate::FolderSecondPathRole );
|
||||
item->setData( f->alias(), FolderStatusDelegate::FolderAliasRole );
|
||||
item->setData( f->syncEnabled(), FolderStatusDelegate::FolderSyncEnabled );
|
||||
item->setData( f->userSyncEnabled() && f->syncEnabled(), FolderStatusDelegate::FolderSyncEnabled );
|
||||
|
||||
SyncResult res = f->syncResult();
|
||||
SyncResult::Status status = res.status();
|
||||
@@ -225,12 +228,21 @@ void AccountSettings::folderToModelItem( QStandardItem *item, Folder *f )
|
||||
|
||||
Theme *theme = Theme::instance();
|
||||
item->setData( theme->statusHeaderText( status ), Qt::ToolTipRole );
|
||||
if( f->syncEnabled() ) {
|
||||
item->setData( theme->syncStateIcon( status ), FolderStatusDelegate::FolderStatusIconRole );
|
||||
if( f->syncEnabled() && f->userSyncEnabled() ) {
|
||||
if( status == SyncResult::SyncPrepare ) {
|
||||
if( _wasDisabledBefore ) {
|
||||
// if the folder was disabled before, set the sync icon
|
||||
item->setData( theme->syncStateIcon( SyncResult::SyncRunning), FolderStatusDelegate::FolderStatusIconRole );
|
||||
} // we keep the previous icon for the SyncPrepare state.
|
||||
} else {
|
||||
// kepp the previous icon for the prepare phase.
|
||||
item->setData( theme->syncStateIcon( status ), FolderStatusDelegate::FolderStatusIconRole );
|
||||
}
|
||||
} else {
|
||||
item->setData( theme->folderDisabledIcon( ), FolderStatusDelegate::FolderStatusIconRole ); // size 48 before
|
||||
item->setData( theme->folderDisabledIcon( ), FolderStatusDelegate::FolderStatusIconRole ); // size 48 before
|
||||
_wasDisabledBefore = false;
|
||||
}
|
||||
item->setData( theme->statusHeaderText( status ), FolderStatusDelegate::FolderStatus );
|
||||
item->setData( theme->statusHeaderText( status ), FolderStatusDelegate::FolderStatus );
|
||||
|
||||
if( errorList.isEmpty() ) {
|
||||
if( (status == SyncResult::Error ||
|
||||
@@ -433,7 +445,11 @@ void AccountSettings::slotEnableCurrentFolder()
|
||||
if ( f->isBusy() && terminate )
|
||||
folderMan->terminateSyncProcess( alias );
|
||||
|
||||
folderMan->slotEnableFolder( alias, !folderEnabled );
|
||||
folderMan->slotGuiPauseFolder( alias, !folderEnabled );
|
||||
|
||||
// keep state for the icon setting.
|
||||
if( !folderEnabled ) _wasDisabledBefore = true;
|
||||
|
||||
slotUpdateFolderState (f);
|
||||
// set the button text accordingly.
|
||||
slotFolderActivated( selected );
|
||||
@@ -573,7 +589,7 @@ void AccountSettings::slotProgressProblem(const QString& folder, const Progress:
|
||||
|
||||
void AccountSettings::slotSetProgress(const QString& folder, const Progress::Info &progress )
|
||||
{
|
||||
// qDebug() << "================================> Progress for folder " << folder << " file " << file << ": "<< p1;
|
||||
// qDebug() << "================================> Progress for folder " << folder << " progress " << Progress::asResultString(progress.kind);
|
||||
QStandardItem *item = itemForFolder( folder );
|
||||
qint64 prog1 = progress.current_file_bytes;
|
||||
qint64 prog2 = progress.file_size;
|
||||
@@ -587,6 +603,11 @@ void AccountSettings::slotSetProgress(const QString& folder, const Progress::Inf
|
||||
qDebug() << "================================> INVALID Progress for folder " << folder;
|
||||
return;
|
||||
}
|
||||
if( (progress.kind == Progress::StartSync || progress.kind == Progress::EndSync)
|
||||
&& progress.overall_file_count == 0 ) {
|
||||
// do not show progress if nothing is transmitted.
|
||||
return;
|
||||
}
|
||||
|
||||
QString itemFileName = shortenFilename(folder, progress.current_file);
|
||||
QString syncFileProgressString;
|
||||
|
||||
@@ -101,7 +101,7 @@ private:
|
||||
QHash<QStandardItem*, QTimer*> _hideProgressTimers;
|
||||
QString _kindContext;
|
||||
QStringList _generalErrors;
|
||||
|
||||
bool _wasDisabledBefore;
|
||||
};
|
||||
|
||||
} // namespace Mirall
|
||||
|
||||
@@ -104,6 +104,7 @@ Application::Application(int &argc, char **argv) :
|
||||
_recentActionsMenu(0),
|
||||
_theme(Theme::instance()),
|
||||
_logBrowser(0),
|
||||
_startupNetworkError(false),
|
||||
_logExpire(0),
|
||||
_showLogWindow(false),
|
||||
_logFlush(false),
|
||||
@@ -155,15 +156,17 @@ Application::Application(int &argc, char **argv) :
|
||||
}
|
||||
#endif
|
||||
|
||||
// connect(_networkMgr, SIGNAL(onlineStateChanged(bool)), SLOT(slotCheckConnection()));
|
||||
|
||||
MirallConfigFile cfg;
|
||||
_theme->setSystrayUseMonoIcons(cfg.monoIcons());
|
||||
connect (_theme, SIGNAL(systrayUseMonoIconsChanged(bool)), SLOT(slotUseMonoIconsChanged(bool)));
|
||||
|
||||
setupActions();
|
||||
setupSystemTray();
|
||||
slotSetupProxy();
|
||||
|
||||
folderMan->setupFolders();
|
||||
slotSetupProxy(); // folders have to be defined first.
|
||||
|
||||
// startup procedure.
|
||||
QTimer::singleShot( 0, this, SLOT( slotCheckConnection() ));
|
||||
@@ -255,8 +258,6 @@ void Application::slotConnectionValidatorResult(ConnectionValidator::Status stat
|
||||
FolderMan *folderMan = FolderMan::instance();
|
||||
qDebug() << "######## Connection and Credentials are ok!";
|
||||
folderMan->setSyncEnabled(true);
|
||||
_tray->setIcon( _theme->syncStateIcon( SyncResult::NotYetStarted, true ) );
|
||||
_tray->show();
|
||||
|
||||
int cnt = folderMan->map().size();
|
||||
slotShowOptionalTrayMessage(tr("%1 Sync Started").arg(_theme->appNameGUI()),
|
||||
@@ -270,6 +271,8 @@ void Application::slotConnectionValidatorResult(ConnectionValidator::Status stat
|
||||
FolderMan::instance()->setSyncEnabled(false);
|
||||
|
||||
_startupFail = _conValidator->errors();
|
||||
_startupNetworkError = _conValidator->networkError();
|
||||
QTimer::singleShot(30*1000, this, SLOT(slotCheckConnection()));
|
||||
}
|
||||
computeOverallSyncStatus();
|
||||
setupContextMenu();
|
||||
@@ -514,6 +517,7 @@ void Application::slotSetupProxy()
|
||||
|
||||
switch(proxyType) {
|
||||
case QNetworkProxy::NoProxy:
|
||||
QNetworkProxyFactory::setUseSystemConfiguration(false);
|
||||
QNetworkProxy::setApplicationProxy(QNetworkProxy::NoProxy);
|
||||
break;
|
||||
case QNetworkProxy::DefaultProxy:
|
||||
@@ -521,10 +525,12 @@ void Application::slotSetupProxy()
|
||||
break;
|
||||
case QNetworkProxy::Socks5Proxy:
|
||||
proxy.setType(QNetworkProxy::Socks5Proxy);
|
||||
QNetworkProxyFactory::setUseSystemConfiguration(false);
|
||||
QNetworkProxy::setApplicationProxy(proxy);
|
||||
break;
|
||||
case QNetworkProxy::HttpProxy:
|
||||
proxy.setType(QNetworkProxy::HttpProxy);
|
||||
QNetworkProxyFactory::setUseSystemConfiguration(false);
|
||||
QNetworkProxy::setApplicationProxy(proxy);
|
||||
break;
|
||||
default:
|
||||
@@ -832,7 +838,12 @@ void Application::computeOverallSyncStatus()
|
||||
// if there have been startup problems, show an error message.
|
||||
if( !_startupFail.isEmpty() ) {
|
||||
trayMessage = _startupFail.join(QLatin1String("\n"));
|
||||
QIcon statusIcon = _theme->syncStateIcon( SyncResult::Error, true );
|
||||
QIcon statusIcon;
|
||||
if (_startupNetworkError) {
|
||||
statusIcon = _theme->syncStateIcon( SyncResult::NotYetStarted, true );
|
||||
} else {
|
||||
statusIcon = _theme->syncStateIcon( SyncResult::Error, true );
|
||||
}
|
||||
_tray->setIcon( statusIcon );
|
||||
_tray->setToolTip(trayMessage);
|
||||
} else {
|
||||
|
||||
@@ -140,6 +140,7 @@ private:
|
||||
QString _logFile;
|
||||
QString _logDirectory;
|
||||
QStringList _startupFail;
|
||||
bool _startupNetworkError;
|
||||
|
||||
int _logExpire;
|
||||
bool _showLogWindow;
|
||||
|
||||
@@ -28,7 +28,8 @@ ConnectionValidator::ConnectionValidator(QObject *parent) :
|
||||
|
||||
ConnectionValidator::ConnectionValidator(const QString& connection, QObject *parent)
|
||||
: QObject(parent),
|
||||
_connection(connection)
|
||||
_connection(connection),
|
||||
_networkError(QNetworkReply::NoError)
|
||||
{
|
||||
ownCloudInfo::instance()->setCustomConfigHandle(_connection);
|
||||
}
|
||||
@@ -38,6 +39,11 @@ QStringList ConnectionValidator::errors() const
|
||||
return _errors;
|
||||
}
|
||||
|
||||
bool ConnectionValidator::networkError() const
|
||||
{
|
||||
return _networkError;
|
||||
}
|
||||
|
||||
QString ConnectionValidator::statusString( Status stat ) const
|
||||
{
|
||||
QString re;
|
||||
@@ -130,6 +136,7 @@ void ConnectionValidator::slotNoStatusFound(QNetworkReply *reply)
|
||||
this, SLOT(slotNoStatusFound(QNetworkReply*)));
|
||||
|
||||
_errors.append( reply->errorString() );
|
||||
_networkError = (reply->error() != QNetworkReply::NoError);
|
||||
emit connectionResult( StatusNotFound );
|
||||
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ public:
|
||||
};
|
||||
|
||||
QStringList errors() const;
|
||||
bool networkError() const;
|
||||
|
||||
void checkConnection();
|
||||
|
||||
@@ -64,6 +65,7 @@ protected slots:
|
||||
private:
|
||||
QStringList _errors;
|
||||
QString _connection;
|
||||
bool _networkError;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ QString CSyncThread::csyncErrorToString( CSYNC_ERROR_CODE err, const char *errSt
|
||||
}
|
||||
|
||||
if( errString ) {
|
||||
errStr += tr("<br/>Backend Message: ")+QString::fromUtf8(errString);
|
||||
errStr += tr(" Backend Message: ")+QString::fromUtf8(errString);
|
||||
}
|
||||
return errStr;
|
||||
|
||||
|
||||
@@ -50,10 +50,13 @@ Folder::Folder(const QString &alias, const QString &path, const QString& secondP
|
||||
, _secondPath(secondPath)
|
||||
, _alias(alias)
|
||||
, _enabled(true)
|
||||
, _userSyncEnabled(true)
|
||||
, _thread(0)
|
||||
, _csync(0)
|
||||
, _csyncError(false)
|
||||
, _csyncUnavail(false)
|
||||
, _wipeDb(false)
|
||||
, _proxyDirty(true)
|
||||
, _csync_ctx(0)
|
||||
{
|
||||
qsrand(QTime::currentTime().msec());
|
||||
@@ -198,16 +201,32 @@ void Folder::setSyncEnabled( bool doit )
|
||||
{
|
||||
_enabled = doit;
|
||||
|
||||
if( doit ) {
|
||||
if( doit && userSyncEnabled() ) {
|
||||
// qDebug() << "Syncing enabled on folder " << name();
|
||||
_pollTimer.start();
|
||||
_watcher->clearPendingEvents(); // FIXME 1.5: Why isn't that happening in setEventsEnabled?
|
||||
_watcher->setEventsEnabled(true);
|
||||
_timeSinceLastSync.restart();
|
||||
} else {
|
||||
// do not stop or start the watcher here, that is done internally by
|
||||
// folder class. Even if the watcher fires, the folder does not
|
||||
// schedule itself because it checks the var. _enabled before.
|
||||
_pollTimer.stop();
|
||||
_watcher->setEventsEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
bool Folder::userSyncEnabled()
|
||||
{
|
||||
return _userSyncEnabled;
|
||||
}
|
||||
|
||||
void Folder::slotSetSyncUserEnabled( bool enable )
|
||||
{
|
||||
_userSyncEnabled = enable;
|
||||
setSyncEnabled( syncEnabled() ); // no change on the system enable flag.
|
||||
}
|
||||
|
||||
void Folder::setSyncState(SyncResult::Status state)
|
||||
{
|
||||
_syncResult.setStatus(state);
|
||||
@@ -220,11 +239,15 @@ SyncResult Folder::syncResult() const
|
||||
|
||||
void Folder::evaluateSync(const QStringList &/*pathList*/)
|
||||
{
|
||||
if( !_enabled ) {
|
||||
if( !syncEnabled() ) {
|
||||
qDebug() << "*" << alias() << "sync skipped, disabled!";
|
||||
return;
|
||||
}
|
||||
|
||||
if( !userSyncEnabled() ) {
|
||||
qDebug() << "*" << alias() << "sync skipped, user disabled!";
|
||||
return;
|
||||
}
|
||||
_syncResult.setStatus( SyncResult::NotYetStarted );
|
||||
_syncResult.clearErrors();
|
||||
emit scheduleToSync( alias() );
|
||||
@@ -235,8 +258,9 @@ void Folder::slotPollTimerTimeout()
|
||||
{
|
||||
qDebug() << "* Polling" << alias() << "for changes. (time since next sync:" << (_timeSinceLastSync.elapsed() / 1000) << "s)";
|
||||
|
||||
// Force sync if the last sync is a long time ago or if there was a serious problem.
|
||||
if (quint64(_timeSinceLastSync.elapsed()) > MirallConfigFile().forceSyncInterval() ||
|
||||
_syncResult.status() != SyncResult::Success ) {
|
||||
!(_syncResult.status() == SyncResult::Success || _syncResult.status() == SyncResult::Problem)) {
|
||||
qDebug() << "** Force Sync now";
|
||||
evaluateSync(QStringList());
|
||||
} else {
|
||||
@@ -289,7 +313,7 @@ void Folder::bubbleUpSyncResult()
|
||||
foreach (const SyncFileItem &item, _syncResult.syncFileItemVector() ) {
|
||||
if( item._instruction == CSYNC_INSTRUCTION_ERROR ) {
|
||||
slotCSyncError( tr("File %1: %2").arg(item._file).arg(item._errorString) );
|
||||
logger->postGuiLog(tr("File %1").arg(item._file), item._errorString);
|
||||
logger->postOptionalGuiLog(tr("File %1").arg(item._file), item._errorString);
|
||||
|
||||
} else {
|
||||
if (item._dir == SyncFileItem::Down) {
|
||||
@@ -340,25 +364,25 @@ void Folder::bubbleUpSyncResult()
|
||||
if (newItems > 0) {
|
||||
QString file = QDir::toNativeSeparators(firstItemNew._file);
|
||||
if (newItems == 1)
|
||||
logger->postGuiLog(tr("New file available"), tr("'%1' has been synced to this machine.").arg(file));
|
||||
logger->postOptionalGuiLog(tr("New file available"), tr("'%1' has been synced to this machine.").arg(file));
|
||||
else
|
||||
logger->postGuiLog(tr("New files available"), tr("'%1' and %n other file(s) have been synced to this machine.",
|
||||
logger->postOptionalGuiLog(tr("New files available"), tr("'%1' and %n other file(s) have been synced to this machine.",
|
||||
"", newItems-1).arg(file));
|
||||
}
|
||||
if (removedItems > 0) {
|
||||
QString file = QDir::toNativeSeparators(firstItemDeleted._file);
|
||||
if (removedItems == 1)
|
||||
logger->postGuiLog(tr("File removed"), tr("'%1' has been removed.").arg(file));
|
||||
logger->postOptionalGuiLog(tr("File removed"), tr("'%1' has been removed.").arg(file));
|
||||
else
|
||||
logger->postGuiLog(tr("Files removed"), tr("'%1' and %n other file(s) have been removed.",
|
||||
logger->postOptionalGuiLog(tr("Files removed"), tr("'%1' and %n other file(s) have been removed.",
|
||||
"", removedItems-1).arg(file));
|
||||
}
|
||||
if (updatedItems > 0) {
|
||||
QString file = QDir::toNativeSeparators(firstItemUpdated._file);
|
||||
if (updatedItems == 1)
|
||||
logger->postGuiLog(tr("File updated"), tr("'%1' has been updated.").arg(file));
|
||||
logger->postOptionalGuiLog(tr("File updated"), tr("'%1' has been updated.").arg(file));
|
||||
else
|
||||
logger->postGuiLog(tr("Files updated"), tr("'%1' and %n other file(s) have been updated.",
|
||||
logger->postOptionalGuiLog(tr("Files updated"), tr("'%1' and %n other file(s) have been updated.",
|
||||
"", updatedItems-1).arg(file));
|
||||
}
|
||||
}
|
||||
@@ -400,7 +424,7 @@ void Folder::slotThreadTreeWalkResult(const SyncFileItemVector& items)
|
||||
|
||||
void Folder::slotCatchWatcherError(const QString& error)
|
||||
{
|
||||
Logger::instance()->postGuiLog(tr("Error"), error);
|
||||
Logger::instance()->postOptionalGuiLog(tr("Error"), error);
|
||||
}
|
||||
|
||||
void Folder::slotTerminateSync()
|
||||
@@ -433,6 +457,7 @@ void Folder::slotTerminateSync()
|
||||
_csyncError = true;
|
||||
qDebug() << "-> CSync Terminated!";
|
||||
slotCSyncFinished();
|
||||
setSyncEnabled(false);
|
||||
}
|
||||
|
||||
// This removes the csync File database if the sync folder definition is removed
|
||||
@@ -500,10 +525,21 @@ void Folder::setProxy()
|
||||
csync_set_module_property(_csync_ctx, "proxy_user", proxy.user().toUtf8().data() );
|
||||
csync_set_module_property(_csync_ctx, "proxy_pwd" , proxy.password().toUtf8().data() );
|
||||
|
||||
FolderMan::instance()->setDirtyProxy(false);
|
||||
setProxyDirty(false);
|
||||
} else {
|
||||
qDebug() << "WRN: Unable to set Proxy without csync-ctx!";
|
||||
}
|
||||
}
|
||||
|
||||
void Folder::setProxyDirty(bool value)
|
||||
{
|
||||
_proxyDirty = value;
|
||||
}
|
||||
|
||||
bool Folder::proxyDirty()
|
||||
{
|
||||
return _proxyDirty;
|
||||
}
|
||||
|
||||
const char* Folder::proxyTypeToCStr(QNetworkProxy::ProxyType type)
|
||||
{
|
||||
@@ -539,7 +575,7 @@ void Folder::startSync(const QStringList &pathList)
|
||||
QMetaObject::invokeMethod(this, "slotCSyncFinished", Qt::QueuedConnection);
|
||||
return;
|
||||
}
|
||||
} else if (FolderMan::instance()->isDirtyProxy()) {
|
||||
} else if (proxyDirty()) {
|
||||
setProxy();
|
||||
}
|
||||
|
||||
@@ -613,10 +649,13 @@ void Folder::slotCsyncUnavailable()
|
||||
|
||||
void Folder::slotCSyncFinished()
|
||||
{
|
||||
qDebug() << "-> CSync Finished slot with error " << _csyncError;
|
||||
_watcher->setEventsEnabledDelayed(2000);
|
||||
_pollTimer.start();
|
||||
_timeSinceLastSync.restart();
|
||||
qDebug() << "-> CSync Finished slot for" << alias() << "with error" << _csyncError;
|
||||
if( syncEnabled() && userSyncEnabled() ) {
|
||||
qDebug() << "Sync is enabled - starting the polltimer again.";
|
||||
_watcher->setEventsEnabledDelayed(2000);
|
||||
_pollTimer.start();
|
||||
_timeSinceLastSync.restart();
|
||||
}
|
||||
|
||||
bubbleUpSyncResult();
|
||||
|
||||
|
||||
@@ -150,6 +150,16 @@ public slots:
|
||||
*/
|
||||
void startSync(const QStringList &pathList = QStringList());
|
||||
|
||||
void setProxyDirty(bool value);
|
||||
bool proxyDirty();
|
||||
|
||||
/**
|
||||
* @brief slotSetSyncUserEnabled - slot that sets the enable/disable flag from the GUI
|
||||
* @param enable
|
||||
*/
|
||||
void slotSetSyncUserEnabled( bool enable );
|
||||
bool userSyncEnabled();
|
||||
|
||||
private slots:
|
||||
void slotCSyncStarted();
|
||||
void slotCSyncError(const QString& );
|
||||
@@ -194,6 +204,7 @@ protected:
|
||||
QString _configFile;
|
||||
QFileSystemWatcher *_pathWatcher;
|
||||
bool _enabled;
|
||||
bool _userSyncEnabled; // enabled by user interaction?
|
||||
FolderWatcher *_watcher;
|
||||
SyncResult _syncResult;
|
||||
QThread *_thread;
|
||||
@@ -202,6 +213,7 @@ protected:
|
||||
bool _csyncError;
|
||||
bool _csyncUnavail;
|
||||
bool _wipeDb;
|
||||
bool _proxyDirty;
|
||||
Progress::Kind _progressKind;
|
||||
QTimer _pollTimer;
|
||||
QString _lastEtag;
|
||||
|
||||
@@ -37,8 +37,7 @@ FolderMan* FolderMan::_instance = 0;
|
||||
|
||||
FolderMan::FolderMan(QObject *parent) :
|
||||
QObject(parent),
|
||||
_syncEnabled( true ),
|
||||
_dirtyProxy( true )
|
||||
_syncEnabled( true )
|
||||
{
|
||||
// if QDir::mkpath would not be so stupid, I would not need to have this
|
||||
// duplication of folderConfigPath() here
|
||||
@@ -270,7 +269,7 @@ Folder* FolderMan::setupFolderFromConfigFile(const QString &file) {
|
||||
return folder;
|
||||
}
|
||||
|
||||
void FolderMan::slotEnableFolder( const QString& alias, bool enable )
|
||||
void FolderMan::slotGuiPauseFolder( const QString& alias, bool enable )
|
||||
{
|
||||
if( ! _folderMap.contains( alias ) ) {
|
||||
qDebug() << "!! Can not enable alias " << alias << ", can not be found in folderMap.";
|
||||
@@ -279,7 +278,7 @@ void FolderMan::slotEnableFolder( const QString& alias, bool enable )
|
||||
|
||||
Folder *f = _folderMap[alias];
|
||||
if( f ) {
|
||||
f->setSyncEnabled(enable);
|
||||
f->slotSetSyncUserEnabled(enable);
|
||||
f->evaluateSync(QStringList());
|
||||
}
|
||||
}
|
||||
@@ -391,8 +390,8 @@ void FolderMan::slotScheduleFolderSync()
|
||||
if( _folderMap.contains( alias ) ) {
|
||||
ownCloudInfo::instance()->getQuotaRequest("/");
|
||||
Folder *f = _folderMap[alias];
|
||||
_currentSyncFolder = alias;
|
||||
if (f->syncEnabled()) {
|
||||
if( f->syncEnabled() ) {
|
||||
_currentSyncFolder = alias;
|
||||
f->startSync( QStringList() );
|
||||
}
|
||||
}
|
||||
@@ -521,6 +520,14 @@ bool FolderMan::startFromScratch( const QString& localFolder )
|
||||
return false;
|
||||
}
|
||||
|
||||
void FolderMan::setDirtyProxy(bool value)
|
||||
{
|
||||
foreach( Folder *f, _folderMap.values() ) {
|
||||
f->setProxyDirty(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SyncResult FolderMan::accountStatus(const QList<Folder*> &folders)
|
||||
{
|
||||
SyncResult overallResult(SyncResult::Undefined);
|
||||
@@ -546,6 +553,7 @@ SyncResult FolderMan::accountStatus(const QList<Folder*> &folders)
|
||||
case SyncResult::Unavailable:
|
||||
overallResult.setStatus( SyncResult::Unavailable );
|
||||
break;
|
||||
case SyncResult::Problem:
|
||||
case SyncResult::Success:
|
||||
if( overallResult.status() == SyncResult::Undefined )
|
||||
overallResult.setStatus( SyncResult::Success );
|
||||
@@ -557,10 +565,7 @@ SyncResult FolderMan::accountStatus(const QList<Folder*> &folders)
|
||||
if ( overallResult.status() != SyncResult::Error )
|
||||
overallResult.setStatus( SyncResult::SetupError );
|
||||
break;
|
||||
case SyncResult::Problem:
|
||||
if ( overallResult.status() != SyncResult::Problem )
|
||||
overallResult.setStatus( SyncResult::Problem );
|
||||
break;
|
||||
|
||||
// no default case on purpose, check compiler warnings
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ signals:
|
||||
|
||||
public slots:
|
||||
void slotRemoveFolder( const QString& );
|
||||
void slotEnableFolder( const QString&, bool );
|
||||
void slotGuiPauseFolder( const QString&, bool );
|
||||
|
||||
void slotFolderSyncStarted();
|
||||
void slotFolderSyncFinished( const SyncResult& );
|
||||
@@ -109,8 +109,7 @@ public slots:
|
||||
|
||||
void slotScheduleAllFolders();
|
||||
|
||||
bool isDirtyProxy() { return _dirtyProxy; }
|
||||
void setDirtyProxy(bool value = true) { _dirtyProxy = value; }
|
||||
void setDirtyProxy(bool value = true);
|
||||
|
||||
private slots:
|
||||
// slot to add a folder to the syncing queue
|
||||
|
||||
@@ -251,8 +251,8 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
|
||||
painter->save();
|
||||
|
||||
// Sizes-Text
|
||||
QRect octetRect = subFm.boundingRect( overallString );
|
||||
int progressTextWidth = octetRect.width();
|
||||
QRect octetRect = progressFm.boundingRect( overallString );
|
||||
int progressTextWidth = octetRect.width() + 2;
|
||||
|
||||
// Overall Progress Bar.
|
||||
QRect pBRect;
|
||||
@@ -281,8 +281,7 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
|
||||
overallProgressRect.setWidth( progressTextWidth );
|
||||
painter->setFont(progressFont);
|
||||
|
||||
QString elidedText = progressFm.elidedText(overallString, Qt::ElideLeft, overallProgressRect.width());
|
||||
painter->drawText( overallProgressRect, Qt::AlignRight+Qt::AlignVCenter, elidedText);
|
||||
painter->drawText( overallProgressRect, Qt::AlignRight+Qt::AlignVCenter, overallString);
|
||||
// painter->drawRect(overallProgressRect);
|
||||
|
||||
// Individual File Progress
|
||||
@@ -291,7 +290,7 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
|
||||
fileRect.setLeft( iconRect.left());
|
||||
fileRect.setWidth(overallWidth);
|
||||
fileRect.setHeight(fileNameTextHeight);
|
||||
elidedText = progressFm.elidedText(itemString, Qt::ElideLeft, fileRect.width());
|
||||
QString elidedText = progressFm.elidedText(itemString, Qt::ElideLeft, fileRect.width());
|
||||
|
||||
painter->drawText( fileRect, Qt::AlignLeft+Qt::AlignVCenter, elidedText);
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ void FolderWatcher::addIgnoreListFile( const QString& file )
|
||||
|
||||
while (!infile.atEnd()) {
|
||||
QString line = QString::fromLocal8Bit( infile.readLine() ).trimmed();
|
||||
if( !line.startsWith( QLatin1Char('#') ) && line.isEmpty() ) {
|
||||
if( !(line.startsWith( QLatin1Char('#') ) || line.isEmpty()) ) {
|
||||
_ignores.append(line);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +132,16 @@ void FolderWatcherPrivate::slotINotifyEvent(int mask, int /*cookie*/, const QStr
|
||||
//qDebug() << cookie << " OTHER " << mask << " :" << path;
|
||||
}
|
||||
|
||||
foreach (const QString& pattern, _parent->ignores()) {
|
||||
QStringList ignores = _parent->ignores();
|
||||
|
||||
if( path.endsWith(".csync_journal.db.ctmp") ||
|
||||
path.endsWith(".csync_journal.db.ctmp-journal") ||
|
||||
path.endsWith(".csync_journal.db")) {
|
||||
qDebug() << " ** Inotify ignored for " <<path;
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (const QString& pattern, ignores) {
|
||||
QRegExp regexp(pattern);
|
||||
regexp.setPatternSyntax(QRegExp::Wildcard);
|
||||
|
||||
|
||||
@@ -88,6 +88,7 @@ void INotify::slotActivated(int /*fd*/)
|
||||
// with the help of watch descriptor, retrieve, corresponding INotify
|
||||
if (event == NULL) {
|
||||
qDebug() << "NULL event";
|
||||
i += sizeof(struct inotify_event);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ ItemProgressDialog::ItemProgressDialog(Application*, QWidget *parent) :
|
||||
connect(ProgressDispatcher::instance(), SIGNAL(progressSyncProblem(const QString&,const Progress::SyncProblem&)),
|
||||
this, SLOT(slotProgressErrors(const QString&, const Progress::SyncProblem&)));
|
||||
|
||||
// Adjust copyToClipboard() when making changes here!
|
||||
QStringList header;
|
||||
header << tr("Time");
|
||||
header << tr("File");
|
||||
@@ -210,13 +211,16 @@ void ItemProgressDialog::copyToClipboard()
|
||||
int topLevelItems = _ui->_treeWidget->topLevelItemCount();
|
||||
for (int i = 0; i < topLevelItems; i++) {
|
||||
QTreeWidgetItem *child = _ui->_treeWidget->topLevelItem(i);
|
||||
// time stamp
|
||||
ts << left << qSetFieldWidth(10)
|
||||
ts << left
|
||||
// time stamp
|
||||
<< qSetFieldWidth(10)
|
||||
<< child->data(0,Qt::DisplayRole).toString()
|
||||
// file name
|
||||
<< qSetFieldWidth(64)
|
||||
<< child->data(1,Qt::DisplayRole).toString()
|
||||
<< qSetFieldWidth(0) << ' '
|
||||
// folder
|
||||
<< qSetFieldWidth(15)
|
||||
<< child->data(2, Qt::DisplayRole).toString()
|
||||
// action
|
||||
<< qSetFieldWidth(15)
|
||||
<< child->data(3, Qt::DisplayRole).toString()
|
||||
|
||||
@@ -171,11 +171,17 @@ void ProgressDispatcher::setProgressInfo(const QString& folder, const Progress::
|
||||
} else {
|
||||
if( newProgress.kind == Progress::StartSync ) {
|
||||
_recentProblems.clear();
|
||||
_timer.start();
|
||||
}
|
||||
if( newProgress.kind == Progress::EndSync ) {
|
||||
newProgress.overall_current_bytes = newProgress.overall_transmission_size;
|
||||
newProgress.current_file_no = newProgress.overall_file_count;
|
||||
_currentAction.remove(newProgress.folder);
|
||||
qint64 msecs = _timer.elapsed();
|
||||
|
||||
qDebug()<< "[PROGRESS] progressed " << newProgress.overall_transmission_size
|
||||
<< " bytes in " << newProgress.overall_file_count << " files"
|
||||
<< " in msec " << msecs;
|
||||
}
|
||||
if( newProgress.kind == Progress::EndDownload ||
|
||||
newProgress.kind == Progress::EndUpload ||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <QHash>
|
||||
#include <QTime>
|
||||
#include <QQueue>
|
||||
#include <QElapsedTimer>
|
||||
|
||||
namespace Mirall {
|
||||
|
||||
@@ -116,6 +117,8 @@ private:
|
||||
QList<Progress::SyncProblem> _recentProblems;
|
||||
|
||||
QHash<QString, Progress::Kind> _currentAction;
|
||||
|
||||
QElapsedTimer _timer;
|
||||
static ProgressDispatcher* _instance;
|
||||
};
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Enter the url of the ownCloud you want to connect to (without http or https).</string>
|
||||
<string>Enter the URL of the server that you want to connect to (without http or https).</string>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>https://...</string>
|
||||
|
||||
@@ -41,7 +41,7 @@ OwncloudSetupPage::OwncloudSetupPage()
|
||||
|
||||
Theme *theme = Theme::instance();
|
||||
setTitle(WizardCommon::titleTemplate().arg(tr("Connect to %1").arg(theme->appNameGUI())));
|
||||
setSubTitle(WizardCommon::subTitleTemplate().arg(tr("Setup ownCloud server")));
|
||||
setSubTitle(WizardCommon::subTitleTemplate().arg(tr("Setup %1 server").arg(theme->appNameGUI())));
|
||||
|
||||
registerField( QLatin1String("OCUrl*"), _ui.leUrl );
|
||||
|
||||
@@ -227,7 +227,8 @@ void OwncloudSetupPage::setConfigExists( bool config )
|
||||
_configExists = config;
|
||||
|
||||
if (config == true) {
|
||||
setSubTitle(WizardCommon::subTitleTemplate().arg(tr("Update ownCloud server")));
|
||||
setSubTitle(WizardCommon::subTitleTemplate().arg(tr("Update %1 server")
|
||||
.arg(Theme::instance()->appNameGUI())));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,8 @@ void OwncloudWizardResultPage::initializePage()
|
||||
text = tr("Your entire account is synced to the local folder <i>%1</i>")
|
||||
.arg(QDir::toNativeSeparators(localFolder));
|
||||
} else {
|
||||
text = tr("ownCloud folder <i>%1</i> is synced to local folder <i>%2</i>")
|
||||
text = tr("%1 folder <i>%1</i> is synced to local folder <i>%2</i>")
|
||||
.arg(Theme::instance()->appNameGUI())
|
||||
.arg(_remoteFolder).arg(QDir::toNativeSeparators(localFolder));
|
||||
}
|
||||
_ui.localFolderLabel->setText( text );
|
||||
|
||||
Reference in New Issue
Block a user