mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 23:28:14 +03:00
Merge branch 'csync_lgpl' into propagator-ng
Conflicts: src/mirall/csyncthread.cpp src/mirall/csyncthread.h src/mirall/folder.cpp src/mirall/progressdispatcher.h src/mirall/syncfileitem.h
This commit is contained in:
commit
24af9f38f4
62 changed files with 12853 additions and 17532 deletions
|
@ -1,6 +1,6 @@
|
|||
set( VERSION_MAJOR 1 )
|
||||
set( VERSION_MINOR 4 )
|
||||
set( VERSION_PATCH 0 )
|
||||
set( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX}beta1")
|
||||
set( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX}beta2")
|
||||
set( SOVERSION 0 )
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ if(SPHINX_FOUND)
|
|||
# apt-get install texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
|
||||
add_custom_target(doc-latex ${SPHINX_EXECUTABLE}
|
||||
-q -c . -b latex
|
||||
-d ${SPHINX_CACHE_DIR}
|
||||
-d ${SPHINX_CACHE_DIR}/latex
|
||||
-D latex_logo=${LATEX_LOGO}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${SPHINX_PDF_DIR} )
|
||||
|
@ -41,7 +41,7 @@ if(SPHINX_FOUND)
|
|||
if (EXISTS ${QT_QCOLLECTIONGENERATOR_EXECUTABLE})
|
||||
add_custom_target( doc-qch-sphinx ${SPHINX_EXECUTABLE}
|
||||
-q -c . -b qthelp
|
||||
-d ${SPHINX_CACHE_DIR}
|
||||
-d ${SPHINX_CACHE_DIR}/qthelp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${SPHINX_QCH_DIR} )
|
||||
add_custom_target( doc-qch ${QT_QCOLLECTIONGENERATOR_EXECUTABLE}
|
||||
|
@ -54,12 +54,12 @@ if(SPHINX_FOUND)
|
|||
endif()
|
||||
add_custom_target( doc-html ${SPHINX_EXECUTABLE}
|
||||
-q -c . -b html
|
||||
-d ${SPHINX_CACHE_DIR}
|
||||
-d ${SPHINX_CACHE_DIR}/html
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${SPHINX_HTML_DIR} )
|
||||
add_custom_target( doc-man ${SPHINX_EXECUTABLE}
|
||||
-q -c . -b man
|
||||
-d ${SPHINX_CACHE_DIR}
|
||||
-d ${SPHINX_CACHE_DIR}/man
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${SPHINX_MAN_DIR} )
|
||||
|
||||
|
@ -71,7 +71,7 @@ if(SPHINX_FOUND)
|
|||
add_custom_target( doc-chm-sphinx ${SPHINX_EXECUTABLE}
|
||||
-q -c . -b htmlhelp
|
||||
-D html_theme=basic
|
||||
-d ${SPHINX_CACHE_DIR}
|
||||
-d ${SPHINX_CACHE_DIR}/htmlhelp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${SPHINX_HTMLHELP_DIR} )
|
||||
add_custom_target( doc-chm pushd ${SPHINX_HTMLHELP_DIR}; ${MSHTML_COMPILER} *.hhp; popd
|
||||
|
|
153
doc/Makefile
153
doc/Makefile
|
@ -1,153 +0,0 @@
|
|||
# Makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line.
|
||||
SPHINXOPTS =
|
||||
SPHINXBUILD = sphinx-build
|
||||
PAPER =
|
||||
BUILDDIR = _build
|
||||
|
||||
# Internal variables.
|
||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
||||
PAPEROPT_letter = -D latex_paper_size=letter
|
||||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
# the i18n builder cannot share the environment and doctrees with the others
|
||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
|
||||
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
|
||||
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
@echo " html to make standalone HTML files"
|
||||
@echo " dirhtml to make HTML files named index.html in directories"
|
||||
@echo " singlehtml to make a single large HTML file"
|
||||
@echo " pickle to make pickle files"
|
||||
@echo " json to make JSON files"
|
||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
||||
@echo " qthelp to make HTML files and a qthelp project"
|
||||
@echo " devhelp to make HTML files and a Devhelp project"
|
||||
@echo " epub to make an epub"
|
||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
||||
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
||||
@echo " text to make text files"
|
||||
@echo " man to make manual pages"
|
||||
@echo " texinfo to make Texinfo files"
|
||||
@echo " info to make Texinfo files and run them through makeinfo"
|
||||
@echo " gettext to make PO message catalogs"
|
||||
@echo " changes to make an overview of all changed/added/deprecated items"
|
||||
@echo " linkcheck to check all external links for integrity"
|
||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
||||
|
||||
clean:
|
||||
-rm -rf $(BUILDDIR)/*
|
||||
|
||||
html:
|
||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||
|
||||
dirhtml:
|
||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
||||
|
||||
singlehtml:
|
||||
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
||||
|
||||
pickle:
|
||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
||||
@echo
|
||||
@echo "Build finished; now you can process the pickle files."
|
||||
|
||||
json:
|
||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
||||
@echo
|
||||
@echo "Build finished; now you can process the JSON files."
|
||||
|
||||
htmlhelp:
|
||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
||||
|
||||
qthelp:
|
||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/OwncloudDocumentation.qhcp"
|
||||
@echo "To view the help file:"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/OwncloudDocumentation.qhc"
|
||||
|
||||
devhelp:
|
||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
||||
@echo
|
||||
@echo "Build finished."
|
||||
@echo "To view the help file:"
|
||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/OwncloudDocumentation"
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/OwncloudDocumentation"
|
||||
@echo "# devhelp"
|
||||
|
||||
epub:
|
||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
||||
@echo
|
||||
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
||||
|
||||
latex:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo
|
||||
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
||||
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
||||
"(use \`make latexpdf' here to do that automatically)."
|
||||
|
||||
latexpdf:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through pdflatex..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
text:
|
||||
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
||||
@echo
|
||||
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
||||
|
||||
man:
|
||||
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
||||
@echo
|
||||
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
||||
|
||||
texinfo:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo
|
||||
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
|
||||
@echo "Run \`make' in that directory to run these through makeinfo" \
|
||||
"(use \`make info' here to do that automatically)."
|
||||
|
||||
info:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo "Running Texinfo files through makeinfo..."
|
||||
make -C $(BUILDDIR)/texinfo info
|
||||
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
||||
|
||||
gettext:
|
||||
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
||||
@echo
|
||||
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
||||
|
||||
changes:
|
||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
||||
@echo
|
||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
||||
|
||||
linkcheck:
|
||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
||||
@echo
|
||||
@echo "Link check complete; look for any errors in the above output " \
|
||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
||||
|
||||
doctest:
|
||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
||||
@echo "Testing of doctests in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/doctest/output.txt."
|
|
@ -5,3 +5,4 @@ Exec=@APPLICATION_EXECUTABLE@
|
|||
Name=@APPLICATION_NAME@ desktop sync client
|
||||
GenericName=Folder Sync
|
||||
Icon=@APPLICATION_SHORTNAME@
|
||||
Keywords=@APPLICATION_NAME@;syncing;file;sharing
|
||||
|
|
14
src/main.cpp
14
src/main.cpp
|
@ -23,7 +23,12 @@ int main(int argc, char **argv)
|
|||
|
||||
Mirall::Application app(argc, argv);
|
||||
app.initialize();
|
||||
|
||||
|
||||
if( app.giveHelp() ) {
|
||||
app.showHelp();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// if the application is already running, notify it.
|
||||
if( app.isRunning() ) {
|
||||
QStringList args = app.arguments();
|
||||
|
@ -43,11 +48,6 @@ int main(int argc, char **argv)
|
|||
.arg(Mirall::Theme::instance()->appNameGUI()));
|
||||
}
|
||||
}
|
||||
// if help requested, show on command line and exit.
|
||||
if( ! app.giveHelp() ) {
|
||||
return app.exec();
|
||||
} else {
|
||||
app.showHelp();
|
||||
}
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
|
|
|
@ -33,9 +33,21 @@
|
|||
#include <QDesktopServices>
|
||||
#include <QListWidgetItem>
|
||||
#include <QMessageBox>
|
||||
#include <QAction>
|
||||
#include <QKeySequence>
|
||||
|
||||
namespace Mirall {
|
||||
|
||||
static const char progressBarStyleC[] =
|
||||
"QProgressBar {"
|
||||
"border: 2px solid grey;"
|
||||
"border-radius: 5px;"
|
||||
"text-align: center;"
|
||||
"}"
|
||||
"QProgressBar::chunk {"
|
||||
"background-color: %1; width: 1px;"
|
||||
"}";
|
||||
|
||||
AccountSettings::AccountSettings(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::AccountSettings),
|
||||
|
@ -46,6 +58,7 @@ AccountSettings::AccountSettings(QWidget *parent) :
|
|||
_model = new FolderStatusModel;
|
||||
_model->setParent(this);
|
||||
FolderStatusDelegate *delegate = new FolderStatusDelegate;
|
||||
delegate->setParent(this);
|
||||
|
||||
ui->_folderList->setItemDelegate( delegate );
|
||||
ui->_folderList->setModel( _model );
|
||||
|
@ -53,13 +66,16 @@ AccountSettings::AccountSettings(QWidget *parent) :
|
|||
ui->_folderList->setEditTriggers( QAbstractItemView::NoEditTriggers );
|
||||
|
||||
ui->_ButtonRemove->setEnabled(false);
|
||||
ui->_ButtonReset->setEnabled(false);
|
||||
ui->_ButtonEnable->setEnabled(false);
|
||||
ui->_ButtonInfo->setEnabled(false);
|
||||
ui->_ButtonAdd->setEnabled(true);
|
||||
|
||||
QAction *resetFolderAction = new QAction(this);
|
||||
resetFolderAction->setShortcut(QKeySequence(Qt::Key_F5));
|
||||
connect(resetFolderAction, SIGNAL(triggered()), SLOT(slotResetCurrentFolder()));
|
||||
addAction(resetFolderAction);
|
||||
|
||||
connect(ui->_ButtonRemove, SIGNAL(clicked()), this, SLOT(slotRemoveCurrentFolder()));
|
||||
connect(ui->_ButtonReset, SIGNAL(clicked()), this, SLOT(slotResetCurrentFolder()));
|
||||
connect(ui->_ButtonEnable, SIGNAL(clicked()), this, SLOT(slotEnableCurrentFolder()));
|
||||
connect(ui->_ButtonInfo, SIGNAL(clicked()), this, SLOT(slotInfoAboutCurrentFolder()));
|
||||
connect(ui->_ButtonAdd, SIGNAL(clicked()), this, SLOT(slotAddFolder()));
|
||||
|
@ -69,6 +85,8 @@ AccountSettings::AccountSettings(QWidget *parent) :
|
|||
connect(ui->_folderList, SIGNAL(clicked(QModelIndex)), SLOT(slotFolderActivated(QModelIndex)));
|
||||
connect(ui->_folderList, SIGNAL(doubleClicked(QModelIndex)),SLOT(slotDoubleClicked(QModelIndex)));
|
||||
|
||||
QColor color = palette().highlight().color();
|
||||
ui->quotaProgressBar->setStyleSheet(QString::fromLatin1(progressBarStyleC).arg(color.name()));
|
||||
ownCloudInfo *ocInfo = ownCloudInfo::instance();
|
||||
slotUpdateQuota(ocInfo->lastQuotaTotalBytes(), ocInfo->lastQuotaUsedBytes());
|
||||
connect(ocInfo, SIGNAL(quotaUpdated(qint64,qint64)), SLOT(slotUpdateQuota(qint64,qint64)));
|
||||
|
@ -85,8 +103,6 @@ void AccountSettings::slotFolderActivated( const QModelIndex& indx )
|
|||
bool state = indx.isValid();
|
||||
|
||||
ui->_ButtonRemove->setEnabled( state );
|
||||
ui->_ButtonReset->setEnabled( state );
|
||||
ui->_ButtonReset->setEnabled( state );
|
||||
ui->_ButtonEnable->setEnabled( state );
|
||||
ui->_ButtonInfo->setEnabled( state );
|
||||
|
||||
|
@ -139,6 +155,7 @@ void AccountSettings::slotFolderWizardAccepted()
|
|||
folderMan->slotScheduleAllFolders();
|
||||
emit folderChanged();
|
||||
}
|
||||
buttonsSetEnabled();
|
||||
}
|
||||
|
||||
void AccountSettings::slotFolderWizardRejected()
|
||||
|
@ -184,7 +201,6 @@ void AccountSettings::buttonsSetEnabled()
|
|||
bool isSelected = selected.isValid();
|
||||
|
||||
ui->_ButtonEnable->setEnabled(isSelected);
|
||||
ui->_ButtonReset->setEnabled(isSelected);
|
||||
ui->_ButtonRemove->setEnabled(isSelected);
|
||||
ui->_ButtonInfo->setEnabled(isSelected);
|
||||
}
|
||||
|
@ -206,7 +222,11 @@ void AccountSettings::folderToModelItem( QStandardItem *item, Folder *f )
|
|||
SyncResult res = f->syncResult();
|
||||
SyncResult::Status status = res.status();
|
||||
|
||||
QString errors = res.errorStrings().join(QLatin1String("<br/>"));
|
||||
QStringList errorList = res.errorStrings();
|
||||
QString errors;
|
||||
if( ! errorList.isEmpty() ) {
|
||||
errors = res.errorStrings().join(QLatin1String("<br/>"));
|
||||
}
|
||||
|
||||
Theme *theme = Theme::instance();
|
||||
item->setData( theme->statusHeaderText( status ), Qt::ToolTipRole );
|
||||
|
@ -218,6 +238,12 @@ void AccountSettings::folderToModelItem( QStandardItem *item, Folder *f )
|
|||
item->setData( theme->statusHeaderText( status ), FolderStatusDelegate::FolderStatus );
|
||||
item->setData( errors, FolderStatusDelegate::FolderErrorMsg );
|
||||
|
||||
if( errors.isEmpty() && (status == SyncResult::Error ||
|
||||
status == SyncResult::SetupError ||
|
||||
status == SyncResult::Unavailable )) {
|
||||
item->setData( theme->statusHeaderText(status), FolderStatusDelegate::FolderErrorMsg);
|
||||
}
|
||||
|
||||
bool ongoing = false;
|
||||
item->setData( QVariant(res.warnCount()), FolderStatusDelegate::WarningCount );
|
||||
if( status == SyncResult::SyncRunning ) {
|
||||
|
@ -259,8 +285,10 @@ void AccountSettings::slotResetCurrentFolder()
|
|||
QString alias = _model->data( selected, FolderStatusDelegate::FolderAliasRole ).toString();
|
||||
int ret = QMessageBox::question( 0, tr("Confirm Folder Reset"),
|
||||
tr("<p>Do you really want to reset folder <i>%1</i> and rebuild your client database?</p>"
|
||||
"<p><b>Note:</b> While no files will be removed, this can cause significant data "
|
||||
"traffic and take several minutes to hours, depending on the size of the folder.</p>").arg(alias),
|
||||
"<p><b>Note:</b> This function is designed for maintenance purposes only. "
|
||||
"No files will be removed, but this can cause significant data traffic and "
|
||||
"take several minutes or hours to complete, depending on the size of the folder. "
|
||||
"Only use this option if advised by your administrator.</p>").arg(alias),
|
||||
QMessageBox::Yes|QMessageBox::No );
|
||||
if( ret == QMessageBox::Yes ) {
|
||||
FolderMan *folderMan = FolderMan::instance();
|
||||
|
@ -306,9 +334,10 @@ void AccountSettings::setFolderList( const Folder::Map &folders )
|
|||
slotAddFolder( f );
|
||||
}
|
||||
|
||||
QModelIndex idx = _model->index(0, 0);
|
||||
if (idx.isValid())
|
||||
QModelIndex idx = _model->index(0, 0);
|
||||
if (idx.isValid()) {
|
||||
ui->_folderList->setCurrentIndex(idx);
|
||||
}
|
||||
buttonsSetEnabled();
|
||||
|
||||
}
|
||||
|
@ -394,11 +423,6 @@ void AccountSettings::slotUpdateFolderState( Folder *folder )
|
|||
item = _model->item( ++row );
|
||||
}
|
||||
|
||||
#if 0
|
||||
if( !_fileItemDialog.isNull() && _fileItemDialog->isVisible() ) {
|
||||
_fileItemDialog->setSyncResult( FolderMan::instance()->syncResult(folder) );
|
||||
}
|
||||
#endif
|
||||
if( item ) {
|
||||
folderToModelItem( item, folder );
|
||||
} else {
|
||||
|
@ -424,7 +448,9 @@ void AccountSettings::slotOCInfo( const QString& url, const QString& versionStr,
|
|||
qDebug() << "#-------# oC found on " << url;
|
||||
/* enable the open button */
|
||||
ui->connectLabel->setOpenExternalLinks(true);
|
||||
ui->connectLabel->setText( tr("Connected to <a href=\"%1\">%1</a>.").arg(url) );
|
||||
QUrl safeUrl(url);
|
||||
safeUrl.setPassword(QString()); // Remove the password from the URL to avoid showing it in the UI
|
||||
ui->connectLabel->setText( tr("Connected to <a href=\"%1\">%2</a>.").arg(url, safeUrl.toString()) );
|
||||
ui->connectLabel->setToolTip( tr("Version: %1 (%2)").arg(versionStr).arg(version));
|
||||
ui->_ButtonAdd->setEnabled(true);
|
||||
|
||||
|
@ -648,10 +674,12 @@ void AccountSettings::slotUpdateQuota(qint64 total, qint64 used)
|
|||
ui->quotaProgressBar->setEnabled(true);
|
||||
// workaround the label only accepting ints (which may be only 32 bit wide)
|
||||
ui->quotaProgressBar->setMaximum(100);
|
||||
ui->quotaProgressBar->setValue(round(used/(double)total * 100));
|
||||
int qVal = qRound(used/(double)total * 100);
|
||||
if( qVal > 100 ) qVal = 100;
|
||||
ui->quotaProgressBar->setValue(qVal);
|
||||
QString usedStr = Utility::octetsToString(used);
|
||||
QString totalStr = Utility::octetsToString(total);
|
||||
ui->quotaLabel->setText(tr("You are using %1 of your available %2 storage.").arg(usedStr, totalStr));
|
||||
ui->quotaLabel->setText(tr("%1 of %2 in use.").arg(usedStr, totalStr));
|
||||
}
|
||||
|
||||
void AccountSettings::slotIgnoreFilesEditor()
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>607</width>
|
||||
<height>385</height>
|
||||
<height>382</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -30,16 +30,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="removeAccountButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Remove Account</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="modifyAccountButton">
|
||||
<property name="text">
|
||||
|
@ -82,19 +72,6 @@
|
|||
</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>
|
||||
<item>
|
||||
<widget class="QPushButton" name="_ButtonRemove">
|
||||
<property name="text">
|
||||
|
@ -102,13 +79,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="_ButtonReset">
|
||||
<property name="text">
|
||||
<string>Reset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
|
|
|
@ -113,11 +113,12 @@ Application::Application(int &argc, char **argv) :
|
|||
setWindowIcon( _theme->applicationIcon() );
|
||||
|
||||
parseOptions(arguments());
|
||||
setupTranslations();
|
||||
setupLogBrowser();
|
||||
//no need to waste time;
|
||||
if ( _helpOnly ) return;
|
||||
|
||||
setupLogBrowser();
|
||||
setupTranslations();
|
||||
|
||||
connect( this, SIGNAL(messageReceived(QString)), SLOT(slotParseOptions(QString)));
|
||||
connect( Logger::instance(), SIGNAL(guiLog(QString,QString)),
|
||||
this, SLOT(slotShowTrayMessage(QString,QString)));
|
||||
|
@ -418,8 +419,8 @@ void Application::setupLogBrowser()
|
|||
// might be called from second instance
|
||||
if (!_logBrowser) {
|
||||
// init the log browser.
|
||||
_logBrowser = new LogBrowser;
|
||||
qInstallMsgHandler( mirallLogCatcher );
|
||||
_logBrowser = new LogBrowser;
|
||||
// ## TODO: allow new log name maybe?
|
||||
if (!_logDirectory.isEmpty()) {
|
||||
enterNextLogFile();
|
||||
|
@ -551,9 +552,9 @@ void Application::rebuildRecentMenus()
|
|||
_recentActionsMenu->addAction(tr("No items synced recently"));
|
||||
} else {
|
||||
QListIterator<Progress::Info> i(progressInfoList);
|
||||
i.toBack();
|
||||
while(i.hasPrevious()) {
|
||||
Progress::Info info = i.previous();
|
||||
|
||||
while(i.hasNext()) {
|
||||
Progress::Info info = i.next();
|
||||
QString kindStr = Progress::asResultString(info.kind);
|
||||
QString timeStr = info.timestamp.toString("hh:mm");
|
||||
|
||||
|
|
|
@ -67,97 +67,100 @@ CSyncThread::~CSyncThread()
|
|||
|
||||
//Convert an error code from csync to a user readable string.
|
||||
// Keep that function thread safe as it can be called from the sync thread or the main thread
|
||||
QString CSyncThread::csyncErrorToString( CSYNC_ERROR_CODE err )
|
||||
QString CSyncThread::csyncErrorToString(CSYNC_STATUS )
|
||||
{
|
||||
QString errStr;
|
||||
|
||||
switch( err ) {
|
||||
case CSYNC_ERR_NONE:
|
||||
case CSYNC_STATUS_OK:
|
||||
errStr = tr("Success.");
|
||||
break;
|
||||
case CSYNC_ERR_LOG:
|
||||
errStr = tr("CSync Logging setup failed.");
|
||||
break;
|
||||
case CSYNC_ERR_LOCK:
|
||||
case CSYNC_STATUS_NO_LOCK:
|
||||
errStr = tr("CSync failed to create a lock file.");
|
||||
break;
|
||||
case CSYNC_ERR_STATEDB_LOAD:
|
||||
case CSYNC_STATUS_STATEDB_LOAD_ERROR:
|
||||
errStr = tr("CSync failed to load the state db.");
|
||||
break;
|
||||
case CSYNC_ERR_MODULE:
|
||||
case CSYNC_STATUS_STATEDB_WRITE_ERROR:
|
||||
errStr = tr("CSync failed to write the state db.");
|
||||
break;
|
||||
case CSYNC_STATUS_NO_MODULE:
|
||||
errStr = tr("<p>The %1 plugin for csync could not be loaded.<br/>Please verify the installation!</p>").arg(Theme::instance()->appNameGUI());
|
||||
break;
|
||||
case CSYNC_ERR_TIMESKEW:
|
||||
case CSYNC_STATUS_TIMESKEW:
|
||||
errStr = tr("The system time on this client is different than the system time on the server. "
|
||||
"Please use a time synchronization service (NTP) on the server and client machines "
|
||||
"so that the times remain the same.");
|
||||
break;
|
||||
case CSYNC_ERR_FILESYSTEM:
|
||||
case CSYNC_STATUS_FILESYSTEM_UNKNOWN:
|
||||
errStr = tr("CSync could not detect the filesystem type.");
|
||||
break;
|
||||
case CSYNC_ERR_TREE:
|
||||
case CSYNC_STATUS_TREE_ERROR:
|
||||
errStr = tr("CSync got an error while processing internal trees.");
|
||||
break;
|
||||
case CSYNC_ERR_MEM:
|
||||
case CSYNC_STATUS_MEMORY_ERROR:
|
||||
errStr = tr("CSync failed to reserve memory.");
|
||||
break;
|
||||
case CSYNC_ERR_PARAM:
|
||||
case CSYNC_STATUS_PARAM_ERROR:
|
||||
errStr = tr("CSync fatal parameter error.");
|
||||
break;
|
||||
case CSYNC_ERR_UPDATE:
|
||||
case CSYNC_STATUS_UPDATE_ERROR:
|
||||
errStr = tr("CSync processing step update failed.");
|
||||
break;
|
||||
case CSYNC_ERR_RECONCILE:
|
||||
case CSYNC_STATUS_RECONCILE_ERROR:
|
||||
errStr = tr("CSync processing step reconcile failed.");
|
||||
break;
|
||||
case CSYNC_ERR_PROPAGATE:
|
||||
case CSYNC_STATUS_PROPAGATE_ERROR:
|
||||
errStr = tr("CSync processing step propagate failed.");
|
||||
break;
|
||||
case CSYNC_ERR_ACCESS_FAILED:
|
||||
case CSYNC_STATUS_REMOTE_ACCESS_ERROR:
|
||||
errStr = tr("<p>The target directory does not exist.</p><p>Please check the sync setup.</p>");
|
||||
break;
|
||||
case CSYNC_ERR_REMOTE_CREATE:
|
||||
case CSYNC_ERR_REMOTE_STAT:
|
||||
case CSYNC_STATUS_REMOTE_CREATE_ERROR:
|
||||
case CSYNC_STATUS_REMOTE_STAT_ERROR:
|
||||
errStr = tr("A remote file can not be written. Please check the remote access.");
|
||||
break;
|
||||
case CSYNC_ERR_LOCAL_CREATE:
|
||||
case CSYNC_ERR_LOCAL_STAT:
|
||||
case CSYNC_STATUS_LOCAL_CREATE_ERROR:
|
||||
case CSYNC_STATUS_LOCAL_STAT_ERROR:
|
||||
errStr = tr("The local filesystem can not be written. Please check permissions.");
|
||||
break;
|
||||
case CSYNC_ERR_PROXY:
|
||||
case CSYNC_STATUS_PROXY_ERROR:
|
||||
errStr = tr("CSync failed to connect through a proxy.");
|
||||
break;
|
||||
case CSYNC_ERR_LOOKUP:
|
||||
case CSYNC_STATUS_PROXY_AUTH_ERROR:
|
||||
errStr = tr("CSync could not authenticate at the proxy.");
|
||||
break;
|
||||
case CSYNC_STATUS_LOOKUP_ERROR:
|
||||
errStr = tr("CSync failed to lookup proxy or server.");
|
||||
break;
|
||||
case CSYNC_ERR_AUTH_SERVER:
|
||||
case CSYNC_STATUS_SERVER_AUTH_ERROR:
|
||||
errStr = tr("CSync failed to authenticate at the %1 server.").arg(Theme::instance()->appNameGUI());
|
||||
break;
|
||||
case CSYNC_ERR_AUTH_PROXY:
|
||||
errStr = tr("CSync failed to authenticate at the proxy.");
|
||||
break;
|
||||
case CSYNC_ERR_CONNECT:
|
||||
case CSYNC_STATUS_CONNECT_ERROR:
|
||||
errStr = tr("CSync failed to connect to the network.");
|
||||
break;
|
||||
case CSYNC_ERR_TIMEOUT:
|
||||
case CSYNC_STATUS_TIMEOUT:
|
||||
errStr = tr("A network connection timeout happend.");
|
||||
break;
|
||||
case CSYNC_ERR_HTTP:
|
||||
case CSYNC_STATUS_HTTP_ERROR:
|
||||
errStr = tr("A HTTP transmission error happened.");
|
||||
break;
|
||||
case CSYNC_ERR_PERM:
|
||||
case CSYNC_STATUS_PERMISSION_DENIED:
|
||||
errStr = tr("CSync failed due to not handled permission deniend.");
|
||||
break;
|
||||
case CSYNC_ERR_NOT_FOUND:
|
||||
case CSYNC_STATUS_NOT_FOUND:
|
||||
errStr = tr("CSync failed to find a specific file.");
|
||||
break;
|
||||
case CSYNC_ERR_EXISTS:
|
||||
case CSYNC_STATUS_FILE_EXISTS:
|
||||
errStr = tr("CSync tried to create a directory that already exists.");
|
||||
break;
|
||||
case CSYNC_ERR_NOSPC:
|
||||
case CSYNC_STATUS_OUT_OF_SPACE:
|
||||
errStr = tr("CSync: No space on %1 server available.").arg(Theme::instance()->appNameGUI());
|
||||
break;
|
||||
case CSYNC_ERR_UNSPEC:
|
||||
case CSYNC_STATUS_QUOTA_EXCEEDED:
|
||||
errStr = tr("CSync: No space on %1 server available.").arg(Theme::instance()->appNameGUI());
|
||||
break;
|
||||
case CSYNC_STATUS_UNSUCCESSFUL:
|
||||
errStr = tr("CSync unspecified error.");
|
||||
|
||||
default:
|
||||
|
@ -294,20 +297,19 @@ int CSyncThread::treewalkFinalize(TREE_WALK_FILE* file)
|
|||
}
|
||||
|
||||
void CSyncThread::handleSyncError(CSYNC *ctx, const char *state) {
|
||||
CSYNC_ERROR_CODE err = csync_get_error( ctx );
|
||||
const char *errMsg = csync_get_error_string( ctx );
|
||||
QString errStr = csyncErrorToString(err);
|
||||
err = csync_get_status( ctx );
|
||||
const char *errMsg = csync_get_status_string( ctx );
|
||||
QString errStr = csyncErrorToString(CSYNC_STATUS(err));
|
||||
if( errMsg ) {
|
||||
errStr += QLatin1String("<br/>");
|
||||
errStr += QString::fromUtf8(errMsg);
|
||||
}
|
||||
qDebug() << " #### ERROR during "<< state << ": " << errStr;
|
||||
switch (err) {
|
||||
case CSYNC_ERR_SERVICE_UNAVAILABLE:
|
||||
case CSYNC_ERR_CONNECT:
|
||||
|
||||
if( CSYNC_STATUS_IS_EQUAL( err, CSYNC_STATUS_SERVICE_UNAVAILABLE ) ||
|
||||
CSYNC_STATUS_IS_EQUAL( err, CSYNC_STATUS_CONNECT_ERROR )) {
|
||||
emit csyncUnavailable();
|
||||
break;
|
||||
default:
|
||||
} else {
|
||||
emit csyncError(errStr);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
CSyncThread(CSYNC *, const QString &localPath, const QString &remotePath);
|
||||
~CSyncThread();
|
||||
|
||||
static QString csyncErrorToString( CSYNC_ERROR_CODE);
|
||||
static QString csyncErrorToString( CSYNC_STATUS);
|
||||
|
||||
Q_INVOKABLE void startSync();
|
||||
|
||||
|
|
|
@ -35,8 +35,7 @@
|
|||
|
||||
namespace Mirall {
|
||||
|
||||
void csyncLogCatcher(CSYNC */*ctx*/,
|
||||
int /*verbosity*/,
|
||||
void csyncLogCatcher(int /*verbosity*/,
|
||||
const char */*function*/,
|
||||
const char *buffer,
|
||||
void */*userdata*/)
|
||||
|
@ -70,10 +69,6 @@ Folder::Folder(const QString &alias, const QString &path, const QString& secondP
|
|||
|
||||
_syncResult.setStatus( SyncResult::NotYetStarted );
|
||||
|
||||
ServerActionNotifier *notifier = new ServerActionNotifier(this);
|
||||
connect(this, SIGNAL(syncFinished(SyncResult)), this, SLOT(slotSyncFinished(SyncResult)));
|
||||
connect(this, SIGNAL(syncFinished(SyncResult)), notifier, SLOT(slotSyncFinished(SyncResult)));
|
||||
|
||||
// check if the local path exists
|
||||
checkLocalPath();
|
||||
|
||||
|
@ -96,8 +91,8 @@ bool Folder::init()
|
|||
slotCSyncError(tr("Unable to create csync-context"));
|
||||
_csync_ctx = 0;
|
||||
} else {
|
||||
csync_set_log_callback( _csync_ctx, csyncLogCatcher );
|
||||
csync_set_log_verbosity(_csync_ctx, 11);
|
||||
csync_set_log_callback( csyncLogCatcher );
|
||||
csync_set_log_level( 11 );
|
||||
|
||||
MirallConfigFile cfgFile;
|
||||
csync_set_config_dir( _csync_ctx, cfgFile.configPath().toUtf8() );
|
||||
|
@ -107,9 +102,9 @@ bool Folder::init()
|
|||
cfgFile.getCredentials()->syncContextPreInit(_csync_ctx);
|
||||
|
||||
if( csync_init( _csync_ctx ) < 0 ) {
|
||||
qDebug() << "Could not initialize csync!" << csync_get_error(_csync_ctx) << csync_get_error_string(_csync_ctx);
|
||||
QString errStr = CSyncThread::csyncErrorToString(csync_get_error(_csync_ctx));
|
||||
const char *errMsg = csync_get_error_string(_csync_ctx);
|
||||
qDebug() << "Could not initialize csync!" << csync_get_status(_csync_ctx) << csync_get_status_string(_csync_ctx);
|
||||
QString errStr = CSyncThread::csyncErrorToString(CSYNC_STATUS(csync_get_status(_csync_ctx)));
|
||||
const char *errMsg = csync_get_status_string(_csync_ctx);
|
||||
if( errMsg ) {
|
||||
errStr += QLatin1String("<br/>");
|
||||
errStr += QString::fromUtf8(errMsg);
|
||||
|
@ -281,14 +276,85 @@ void Folder::slotChanged(const QStringList &pathList)
|
|||
evaluateSync(pathList);
|
||||
}
|
||||
|
||||
void Folder::slotSyncFinished(const SyncResult &result)
|
||||
void Folder::bubbleUpSyncResult()
|
||||
{
|
||||
_watcher->setEventsEnabledDelayed(2000);
|
||||
_pollTimer.start();
|
||||
_timeSinceLastSync.restart();
|
||||
// count new, removed and updated items
|
||||
int newItems = 0;
|
||||
int removedItems = 0;
|
||||
int updatedItems = 0;
|
||||
int ignoredItems = 0;
|
||||
|
||||
qDebug() << "OO folder slotSyncFinished: result: " << int(result.status());
|
||||
emit syncStateChange();
|
||||
SyncFileItem firstItemNew;
|
||||
SyncFileItem firstItemDeleted;
|
||||
SyncFileItem firstItemUpdated;
|
||||
|
||||
Logger *logger = Logger::instance();
|
||||
|
||||
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);
|
||||
|
||||
} else {
|
||||
if (item._dir == SyncFileItem::Down) {
|
||||
switch (item._instruction) {
|
||||
case CSYNC_INSTRUCTION_NEW:
|
||||
newItems++;
|
||||
if (firstItemNew.isEmpty())
|
||||
firstItemNew = item;
|
||||
break;
|
||||
case CSYNC_INSTRUCTION_REMOVE:
|
||||
removedItems++;
|
||||
if (firstItemDeleted.isEmpty())
|
||||
firstItemDeleted = item;
|
||||
break;
|
||||
case CSYNC_INSTRUCTION_UPDATED:
|
||||
updatedItems++;
|
||||
if (firstItemUpdated.isEmpty())
|
||||
firstItemUpdated = item;
|
||||
break;
|
||||
case CSYNC_INSTRUCTION_ERROR:
|
||||
qDebug() << "Got Instruction ERROR. " << _syncResult.errorString();
|
||||
break;
|
||||
default:
|
||||
// nothing.
|
||||
break;
|
||||
}
|
||||
} else if( item._dir == SyncFileItem::None ) { // ignored files counting.
|
||||
if( item._instruction == CSYNC_INSTRUCTION_IGNORE ) {
|
||||
ignoredItems++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_syncResult.setWarnCount(ignoredItems);
|
||||
|
||||
qDebug() << "OO folder slotSyncFinished: result: " << int(_syncResult.status());
|
||||
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));
|
||||
else
|
||||
logger->postGuiLog(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));
|
||||
else
|
||||
logger->postGuiLog(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));
|
||||
else
|
||||
logger->postGuiLog(tr("Files updated"), tr("'%1' and %n other file(s) have been updated.",
|
||||
"", updatedItems-1).arg(file));
|
||||
}
|
||||
}
|
||||
|
||||
void Folder::slotLocalPathChanged( const QString& dir )
|
||||
|
@ -538,10 +604,14 @@ void Folder::slotCsyncUnavailable()
|
|||
void Folder::slotCSyncFinished()
|
||||
{
|
||||
qDebug() << "-> CSync Finished slot with error " << _csyncError;
|
||||
_watcher->setEventsEnabledDelayed(2000);
|
||||
_pollTimer.start();
|
||||
_timeSinceLastSync.restart();
|
||||
|
||||
bubbleUpSyncResult();
|
||||
|
||||
if (_csyncError) {
|
||||
_syncResult.setStatus(SyncResult::Error);
|
||||
|
||||
qDebug() << " ** error Strings: " << _errors;
|
||||
_syncResult.setErrorStrings( _errors );
|
||||
qDebug() << " * owncloud csync thread finished with error";
|
||||
|
@ -557,6 +627,7 @@ void Folder::slotCSyncFinished()
|
|||
if( _thread && _thread->isRunning() ) {
|
||||
_thread->quit();
|
||||
}
|
||||
emit syncStateChange();
|
||||
ownCloudInfo::instance()->getQuotaRequest("/");
|
||||
emit syncFinished( _syncResult );
|
||||
}
|
||||
|
@ -589,79 +660,6 @@ void Folder::slotTransmissionProgress(const Progress::Info& progress)
|
|||
ProgressDispatcher::instance()->setProgressInfo(alias(), newInfo);
|
||||
}
|
||||
|
||||
ServerActionNotifier::ServerActionNotifier(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void ServerActionNotifier::slotSyncFinished(const SyncResult &result)
|
||||
{
|
||||
SyncFileItemVector items = result.syncFileItemVector();
|
||||
if (items.count() == 0)
|
||||
return;
|
||||
|
||||
int newItems = 0;
|
||||
int removedItems = 0;
|
||||
int updatedItems = 0;
|
||||
SyncFileItem firstItemNew;
|
||||
SyncFileItem firstItemDeleted;
|
||||
SyncFileItem firstItemUpdated;
|
||||
foreach (const SyncFileItem &item, items) {
|
||||
if (item._dir == SyncFileItem::Down) {
|
||||
switch (item._instruction) {
|
||||
case CSYNC_INSTRUCTION_NEW:
|
||||
newItems++;
|
||||
if (firstItemNew.isEmpty())
|
||||
firstItemNew = item;
|
||||
break;
|
||||
case CSYNC_INSTRUCTION_REMOVE:
|
||||
removedItems++;
|
||||
if (firstItemDeleted.isEmpty())
|
||||
firstItemDeleted = item;
|
||||
break;
|
||||
case CSYNC_INSTRUCTION_UPDATED:
|
||||
updatedItems++;
|
||||
if (firstItemUpdated.isEmpty())
|
||||
firstItemUpdated = item;
|
||||
break;
|
||||
case CSYNC_INSTRUCTION_ERROR:
|
||||
qDebug() << "Got Instruction ERROR. " << result.errorString();
|
||||
break;
|
||||
default:
|
||||
// nothing.
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Logger *logger = Logger::instance();
|
||||
|
||||
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));
|
||||
else
|
||||
logger->postGuiLog(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));
|
||||
else
|
||||
logger->postGuiLog(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));
|
||||
else
|
||||
logger->postGuiLog(tr("Files updated"), tr("'%1' and %n other file(s) have been updated.",
|
||||
"", updatedItems-1).arg(file));
|
||||
}
|
||||
}
|
||||
|
||||
void Folder::slotAboutToRemoveAllFiles(SyncFileItem::Direction direction, bool *cancel)
|
||||
{
|
||||
QString msg = direction == SyncFileItem::Down ?
|
||||
|
|
|
@ -53,17 +53,6 @@ typedef enum SyncFileStatus_s {
|
|||
STATUS_UPDATED
|
||||
} SyncFileStatus;
|
||||
|
||||
class ServerActionNotifier : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ServerActionNotifier(QObject *parent = 0);
|
||||
public slots:
|
||||
void slotSyncFinished(const SyncResult &result);
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
class Folder : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -140,7 +129,6 @@ signals:
|
|||
void scheduleToSync( const QString& );
|
||||
|
||||
public slots:
|
||||
void slotSyncFinished(const SyncResult &);
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -190,6 +178,8 @@ protected:
|
|||
void setProxy();
|
||||
const char* proxyTypeToCStr(QNetworkProxy::ProxyType type);
|
||||
|
||||
void bubbleUpSyncResult();
|
||||
|
||||
/**
|
||||
* Starts a sync (calling startSync)
|
||||
* if the policies allow for it
|
||||
|
|
|
@ -212,6 +212,7 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
|
|||
|
||||
int h = iconRect.bottom();
|
||||
if( !errorText.isEmpty() ) {
|
||||
h += aliasMargin;
|
||||
QRect errorRect = localPathRect;
|
||||
errorRect.setLeft( iconRect.left());
|
||||
errorRect.setTop( h );
|
||||
|
@ -222,10 +223,6 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
|
|||
painter->setPen( QColor(0xaa, 0xaa, 0xaa));
|
||||
painter->drawRoundedRect( errorRect, 4, 4 );
|
||||
|
||||
QIcon warnIcon(":/mirall/resources/warning-16");
|
||||
QPoint warnPos(errorRect.left()+aliasMargin/2, errorRect.top()+aliasMargin/2);
|
||||
painter->drawPixmap( warnPos, warnIcon.pixmap(QSize(16,16)));
|
||||
|
||||
painter->setPen( Qt::white );
|
||||
painter->setFont(errorFont);
|
||||
QRect errorTextRect = errorRect;
|
||||
|
@ -246,7 +243,7 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
|
|||
// Sync File Progress Bar: Show it if syncFile is not empty.
|
||||
if( !overallString.isEmpty()) {
|
||||
int fileNameTextHeight = subFm.boundingRect(tr("File")).height();
|
||||
int barHeight = fileNameTextHeight;
|
||||
int barHeight = qMax(fileNameTextHeight, aliasFm.height()+2); ;
|
||||
int overallWidth = option.rect.width()-2*aliasMargin;
|
||||
|
||||
painter->save();
|
||||
|
@ -263,6 +260,7 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
|
|||
pBRect.setWidth( overallWidth - progressTextWidth - margin );
|
||||
|
||||
QStyleOptionProgressBarV2 pBarOpt;
|
||||
|
||||
pBarOpt.state = option.state | QStyle::State_Horizontal;
|
||||
pBarOpt.minimum = 0;
|
||||
pBarOpt.maximum = 100;
|
||||
|
@ -283,6 +281,7 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
|
|||
|
||||
QString elidedText = progressFm.elidedText(overallString, Qt::ElideLeft, overallProgressRect.width());
|
||||
painter->drawText( overallProgressRect, Qt::AlignRight+Qt::AlignVCenter, elidedText);
|
||||
// painter->drawRect(overallProgressRect);
|
||||
|
||||
// Individual File Progress
|
||||
QRect fileRect;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>423</width>
|
||||
<height>226</height>
|
||||
<height>155</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -22,7 +22,7 @@
|
|||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>349</width>
|
||||
<height>83</height>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>520</width>
|
||||
<height>367</height>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -190,7 +190,7 @@
|
|||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>102</height>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "mirall/mirallconfigfile.h"
|
||||
|
||||
#include <QNetworkProxy>
|
||||
#include <QDir>
|
||||
|
||||
namespace Mirall {
|
||||
|
||||
|
@ -49,6 +50,16 @@ GeneralSettings::GeneralSettings(QWidget *parent) :
|
|||
|
||||
// misc
|
||||
connect(_ui->monoIconsCheckBox, SIGNAL(toggled(bool)), SLOT(saveMiscSettings()));
|
||||
|
||||
// OEM themes are not obliged to ship mono icons, so there
|
||||
// is no point in offering an option
|
||||
QString themeDir = QString::fromLatin1(":/mirall/theme/1%1/")
|
||||
.arg(Theme::instance()->systrayIconFlavor(true));
|
||||
if (QDir(themeDir).exists())
|
||||
{
|
||||
_ui->monoIconsCheckBox->setVisible(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
GeneralSettings::~GeneralSettings()
|
||||
|
|
|
@ -23,16 +23,6 @@
|
|||
|
||||
#include "ui_itemprogressdialog.h"
|
||||
|
||||
#define TYPE_SUCCESS 1
|
||||
#define TYPE_CONFLICT 2
|
||||
#define TYPE_NEW 3
|
||||
#define TYPE_DELETED 4
|
||||
#define TYPE_ERROR 5
|
||||
#define TYPE_RENAME 6
|
||||
#define TYPE_IGNORE 7
|
||||
|
||||
#define FILE_TYPE 100
|
||||
|
||||
namespace Mirall {
|
||||
|
||||
ItemProgressDialog::ItemProgressDialog(Application*, QWidget *parent) :
|
||||
|
@ -50,14 +40,16 @@ ItemProgressDialog::ItemProgressDialog(Application*, QWidget *parent) :
|
|||
this, SLOT(slotProgressErrors(const QString&, const Progress::SyncProblem&)));
|
||||
|
||||
QStringList header;
|
||||
header << tr("Folder/Time");
|
||||
header << tr("Time");
|
||||
header << tr("File");
|
||||
header << tr("Folder");
|
||||
header << tr("Action");
|
||||
header << tr("Size");
|
||||
|
||||
_ui->_treeWidget->setHeaderLabels( header );
|
||||
|
||||
_ui->_treeWidget->setColumnWidth(1, 180);
|
||||
_ui->_treeWidget->setColumnCount(5);
|
||||
_ui->_treeWidget->setRootIsDecorated(false);
|
||||
|
||||
connect(this, SIGNAL(guiLog(QString,QString)), Logger::instance(), SIGNAL(guiLog(QString,QString)));
|
||||
|
||||
|
@ -70,51 +62,25 @@ ItemProgressDialog::ItemProgressDialog(Application*, QWidget *parent) :
|
|||
|
||||
void ItemProgressDialog::setSyncResultStatus(const SyncResult& result )
|
||||
{
|
||||
QString folderMessage;
|
||||
|
||||
SyncResult::Status syncStatus = result.status();
|
||||
switch( syncStatus ) {
|
||||
case SyncResult::Undefined:
|
||||
folderMessage = tr( "Undefined Folder State" );
|
||||
break;
|
||||
case SyncResult::NotYetStarted:
|
||||
folderMessage = tr( "The folder waits to start syncing." );
|
||||
break;
|
||||
case SyncResult::SyncPrepare:
|
||||
folderMessage = tr( "Determining which files to sync." );
|
||||
break;
|
||||
case SyncResult::Unavailable:
|
||||
folderMessage = tr( "Server is currently not available." );
|
||||
break;
|
||||
case SyncResult::SyncRunning:
|
||||
folderMessage = tr("Sync is running.");
|
||||
break;
|
||||
case SyncResult::Success:
|
||||
folderMessage = tr("Last Sync was successful.");
|
||||
break;
|
||||
case SyncResult::Error:
|
||||
folderMessage = tr( "Syncing Error." );
|
||||
break;
|
||||
case SyncResult::SetupError:
|
||||
folderMessage = tr( "Setup Error." );
|
||||
break;
|
||||
case SyncResult::Problem:
|
||||
folderMessage = tr( "Sync success, but warnings on individual files.");
|
||||
break;
|
||||
default:
|
||||
folderMessage = tr( "Undefined Error State." );
|
||||
}
|
||||
|
||||
_ui->_timelabel->setText(tr("%1").arg(folderMessage));
|
||||
|
||||
if( result.errorStrings().count() ) {
|
||||
if( result.errorStrings().count() ) {
|
||||
_ui->_errorLabel->setVisible(true);
|
||||
_ui->_errorLabel->setTextFormat(Qt::RichText);
|
||||
|
||||
QString errStr;
|
||||
foreach( QString err, result.errorStrings() ) {
|
||||
errStr.append(QString("<p>%1</p>").arg(err));
|
||||
QStringList errors = result.errorStrings();
|
||||
int cnt = errors.size();
|
||||
bool appendDots = false;
|
||||
if( cnt > 3 ) {
|
||||
cnt = 3;
|
||||
appendDots = true;
|
||||
}
|
||||
|
||||
for( int i = 0; i < cnt; i++) {
|
||||
errStr.append(QString("%1<br/>").arg(errors.at(i)));
|
||||
}
|
||||
if( appendDots ) {
|
||||
errStr.append(QString("..."));
|
||||
}
|
||||
_ui->_errorLabel->setText(errStr);
|
||||
} else {
|
||||
_ui->_errorLabel->setText(QString::null);
|
||||
|
@ -127,16 +93,9 @@ void ItemProgressDialog::setSyncResult( const SyncResult& result )
|
|||
{
|
||||
setSyncResultStatus(result);
|
||||
|
||||
if(result.status() != SyncResult::Success ) {
|
||||
return;
|
||||
}
|
||||
|
||||
const QString& folder = result.folder();
|
||||
qDebug() << "Setting sync result for folder " << folder;
|
||||
|
||||
QTreeWidgetItem *folderItem = findFolderItem(folder);
|
||||
if( ! folderItem ) return;
|
||||
|
||||
SyncFileItemVector::const_iterator i;
|
||||
const SyncFileItemVector& items = result.syncFileItemVector();
|
||||
QDateTime dt = QDateTime::currentDateTime();
|
||||
|
@ -144,30 +103,54 @@ void ItemProgressDialog::setSyncResult( const SyncResult& result )
|
|||
for (i = items.begin(); i != items.end(); ++i) {
|
||||
const SyncFileItem& item = *i;
|
||||
QString errMsg;
|
||||
if( item._instruction == CSYNC_INSTRUCTION_IGNORE ) {
|
||||
QString tooltip;
|
||||
// handle ignored files here.
|
||||
|
||||
if( item._instruction == CSYNC_INSTRUCTION_IGNORE
|
||||
|| item._instruction == CSYNC_INSTRUCTION_CONFLICT ) {
|
||||
QStringList columns;
|
||||
QString timeStr = timeString(dt);
|
||||
QString longTimeStr = timeString(dt, QLocale::LongFormat);
|
||||
|
||||
columns << timeStr;
|
||||
columns << item._file;
|
||||
if( item._type == SyncFileItem::File ) {
|
||||
errMsg = tr("File ignored.");
|
||||
} else if( item._type == SyncFileItem::Directory ){
|
||||
errMsg = tr("Directory ignored.");
|
||||
} else if( item._type == SyncFileItem::SoftLink ) {
|
||||
errMsg = tr("Soft Link ignored.");
|
||||
columns << folder;
|
||||
if( item._instruction == CSYNC_INSTRUCTION_IGNORE) {
|
||||
if( item._type == SyncFileItem::File ) {
|
||||
errMsg = tr("File ignored.");
|
||||
tooltip = tr("The file was ignored because it is listed in the clients ignore list\n"
|
||||
"or the filename contains characters that are not syncable\nin a cross platform "
|
||||
"environment.");
|
||||
} else if( item._type == SyncFileItem::Directory ){
|
||||
errMsg = tr("Directory ignored.");
|
||||
tooltip = tr("The directory was ignored because it is listed in the clients\nignore list "
|
||||
"or the directory name contains\ncharacters that are not syncable in a cross "
|
||||
"platform environment.");
|
||||
} else if( item._type == SyncFileItem::SoftLink ) {
|
||||
errMsg = tr("Soft Link ignored.");
|
||||
tooltip = tr("Softlinks break the semantics of synchronization.\nPlease do not "
|
||||
"use them in synced directories.");
|
||||
} else {
|
||||
errMsg = tr("Ignored.");
|
||||
}
|
||||
} else if( item._instruction == CSYNC_INSTRUCTION_CONFLICT ) {
|
||||
errMsg = tr("Conflict file.");
|
||||
tooltip = tr("The file was changed on server and local repository and as a result it\n"
|
||||
"created a so called conflict. The local change is copied to the conflict\n"
|
||||
"file while the file from the server side is available under the original\n"
|
||||
"name");
|
||||
} else {
|
||||
errMsg = tr("Ignored.");
|
||||
Q_ASSERT(!"unhandled instruction.");
|
||||
}
|
||||
columns << errMsg;
|
||||
|
||||
QTreeWidgetItem *twitem = new QTreeWidgetItem(folderItem, columns);
|
||||
QTreeWidgetItem *twitem = new QTreeWidgetItem(columns);
|
||||
twitem->setData(0, ErrorIndicatorRole, QVariant(true) );
|
||||
twitem->setToolTip(0, longTimeStr);
|
||||
twitem->setToolTip(3, tooltip);
|
||||
twitem->setIcon(0, Theme::instance()->syncStateIcon(SyncResult::Problem, true));
|
||||
_ui->_treeWidget->addTopLevelItem(twitem);
|
||||
|
||||
Q_UNUSED(twitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -181,7 +164,6 @@ void ItemProgressDialog::setupList()
|
|||
bool haveSyncResult = false;
|
||||
|
||||
foreach( Folder *f, map.values() ) {
|
||||
findFolderItem(f->alias());
|
||||
if( f->syncResult().syncTime() > dt ) {
|
||||
dt = f->syncResult().syncTime();
|
||||
lastResult = f->syncResult();
|
||||
|
@ -207,11 +189,6 @@ void ItemProgressDialog::setupList()
|
|||
slotProgressErrors(prob.folder, prob);
|
||||
folderHash[prob.folder] = 1;
|
||||
}
|
||||
|
||||
foreach( const QString& folder, folderHash.keys() ) {
|
||||
decorateFolderItem(folder);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ItemProgressDialog::~ItemProgressDialog()
|
||||
|
@ -259,69 +236,21 @@ void ItemProgressDialog::accept()
|
|||
QDialog::accept();
|
||||
}
|
||||
|
||||
void ItemProgressDialog::decorateFolderItem( const QString& folder )
|
||||
void ItemProgressDialog::cleanErrors( const QString& /* folder */ ) // FIXME: Use the folder to detect which errors can be deleted.
|
||||
{
|
||||
QTreeWidgetItem *folderItem = findFolderItem(folder);
|
||||
if( ! folderItem ) return;
|
||||
int errorCnt = 0;
|
||||
_problemCounter = 0;
|
||||
QList<QTreeWidgetItem*> wipeList;
|
||||
|
||||
int childCnt = folderItem->childCount();
|
||||
for( int cnt = 0; cnt < childCnt; cnt++ ) {
|
||||
bool isErrorItem = folderItem->child(cnt)->data(0, ErrorIndicatorRole).toBool();
|
||||
if( isErrorItem ) {
|
||||
errorCnt++;
|
||||
int itemCnt = _ui->_treeWidget->topLevelItemCount();
|
||||
|
||||
for( int cnt = 0; cnt < itemCnt; cnt++ ) {
|
||||
QTreeWidgetItem *item = _ui->_treeWidget->topLevelItem(cnt);
|
||||
bool isErrorItem = item->data(0, ErrorIndicatorRole).toBool();
|
||||
if( isErrorItem ) {
|
||||
wipeList.append(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( errorCnt == 0 ) {
|
||||
folderItem->setIcon(0, Theme::instance()->syncStateIcon(SyncResult::Success));
|
||||
} else {
|
||||
// FIXME: Set a soft error icon here.
|
||||
folderItem->setIcon(0, Theme::instance()->syncStateIcon(SyncResult::Problem));
|
||||
}
|
||||
}
|
||||
|
||||
QTreeWidgetItem *ItemProgressDialog::createFolderItem(const QString& folder)
|
||||
{
|
||||
QStringList strings;
|
||||
strings.append(folder);
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem( _ui->_treeWidget, strings );
|
||||
item->setFirstColumnSpanned(true);
|
||||
item->setExpanded(true);
|
||||
return item;
|
||||
}
|
||||
|
||||
QTreeWidgetItem *ItemProgressDialog::findFolderItem( const QString& folder )
|
||||
{
|
||||
QTreeWidgetItem *folderItem;
|
||||
|
||||
if( folder.isEmpty() ) return NULL;
|
||||
|
||||
if( !_folderItems.contains(folder)) {
|
||||
_folderItems[folder] = createFolderItem(folder);
|
||||
_ui->_treeWidget->addTopLevelItem(_folderItems[folder]);
|
||||
}
|
||||
folderItem = _folderItems[folder];
|
||||
|
||||
return folderItem;
|
||||
}
|
||||
|
||||
void ItemProgressDialog::cleanErrors( const QString& folder )
|
||||
{
|
||||
_problemCounter = 0;
|
||||
QList<QTreeWidgetItem*> wipeList;
|
||||
|
||||
QTreeWidgetItem *folderItem = findFolderItem(folder);
|
||||
if( ! folderItem ) return;
|
||||
|
||||
int childCnt = folderItem->childCount();
|
||||
for( int cnt = 0; cnt < childCnt; cnt++ ) {
|
||||
bool isErrorItem = folderItem->child(cnt)->data(0, ErrorIndicatorRole).toBool();
|
||||
if( isErrorItem ) {
|
||||
wipeList.append(folderItem->child(cnt));
|
||||
}
|
||||
}
|
||||
qDeleteAll(wipeList.begin(), wipeList.end());
|
||||
qDeleteAll(wipeList.begin(), wipeList.end());
|
||||
}
|
||||
|
||||
QString ItemProgressDialog::timeString(QDateTime dt, QLocale::FormatType format) const
|
||||
|
@ -344,41 +273,39 @@ QString ItemProgressDialog::timeString(QDateTime dt, QLocale::FormatType format)
|
|||
|
||||
void ItemProgressDialog::slotProgressErrors( const QString& folder, const Progress::SyncProblem& problem )
|
||||
{
|
||||
QTreeWidgetItem *folderItem;
|
||||
|
||||
folderItem = findFolderItem(folder);
|
||||
if( !folderItem ) return;
|
||||
|
||||
QStringList columns;
|
||||
QString timeStr = timeString(problem.timestamp);
|
||||
QString longTimeStr = timeString(problem.timestamp, QLocale::LongFormat);
|
||||
|
||||
columns << timeStr;
|
||||
columns << problem.current_file;
|
||||
columns << folder;
|
||||
QString errMsg = tr("Problem: %1").arg(problem.error_message);
|
||||
#if 0
|
||||
if( problem.error_code == 507 ) {
|
||||
errMsg = tr("No more storage space available on server.");
|
||||
}
|
||||
#endif
|
||||
columns << errMsg;
|
||||
// FIXME: Show the error code if available.
|
||||
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem(folderItem, columns);
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem(columns);
|
||||
item->setData(0, ErrorIndicatorRole, QVariant(true) );
|
||||
item->setIcon(0, Theme::instance()->syncStateIcon(SyncResult::Problem, true));
|
||||
// Maybe we should not set the error icon for all problems but distinguish
|
||||
// by error_code. A quota problem is considered an error, others might not??
|
||||
item->setIcon(0, Theme::instance()->syncStateIcon(SyncResult::Error, true));
|
||||
item->setToolTip(0, longTimeStr);
|
||||
_ui->_treeWidget->addTopLevelItem(item);
|
||||
Q_UNUSED(item);
|
||||
}
|
||||
|
||||
void ItemProgressDialog::slotProgressInfo( const QString& folder, const Progress::Info& progress )
|
||||
{
|
||||
QTreeWidgetItem *folderItem;
|
||||
folderItem = findFolderItem(folder);
|
||||
if( !folderItem ) return;
|
||||
|
||||
if( progress.kind == Progress::StartSync ) {
|
||||
cleanErrors( folder );
|
||||
folderItem->setIcon(0, Theme::instance()->syncStateIcon(SyncResult::SyncRunning));
|
||||
}
|
||||
|
||||
if( progress.kind == Progress::EndSync ) {
|
||||
decorateFolderItem( folder );
|
||||
// decorateFolderItem( folder );
|
||||
}
|
||||
|
||||
// Ingore other events than finishing an individual up- or download.
|
||||
|
@ -392,11 +319,13 @@ void ItemProgressDialog::slotProgressInfo( const QString& folder, const Progress
|
|||
|
||||
columns << timeStr;
|
||||
columns << progress.current_file;
|
||||
columns << progress.folder;
|
||||
columns << Progress::asResultString(progress.kind);
|
||||
columns << Utility::octetsToString( progress.file_size );
|
||||
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem(folderItem, columns);
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem(columns);
|
||||
item->setToolTip(0, longTimeStr);
|
||||
_ui->_treeWidget->addTopLevelItem(item);
|
||||
Q_UNUSED(item);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,13 +55,9 @@ signals:
|
|||
|
||||
private:
|
||||
void setSyncResultStatus(const SyncResult& result );
|
||||
QTreeWidgetItem *createFolderItem(const QString& folder);
|
||||
QTreeWidgetItem *findFolderItem( const QString& folder );
|
||||
void cleanErrors( const QString& folder );
|
||||
void decorateFolderItem( const QString& folder );
|
||||
QString timeString(QDateTime dt, QLocale::FormatType format = QLocale::NarrowFormat) const;
|
||||
|
||||
QHash<QString, QTreeWidgetItem*> _folderItems;
|
||||
const int ErrorIndicatorRole;
|
||||
Ui::ItemProgressDialog *_ui;
|
||||
int _problemCounter;
|
||||
|
|
|
@ -67,13 +67,6 @@
|
|||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="_timelabel">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="_errorLabel">
|
||||
<property name="text">
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <QCoreApplication>
|
||||
#include <QDebug>
|
||||
#include <QSettings>
|
||||
#include <QAction>
|
||||
|
||||
#include "mirall/mirallconfigfile.h"
|
||||
#include "mirall/logger.h"
|
||||
|
@ -45,11 +46,6 @@ LogWidget::LogWidget(QWidget *parent)
|
|||
font.setFamily(QLatin1String("Courier New"));
|
||||
font.setFixedPitch(true);
|
||||
document()->setDefaultFont( font );
|
||||
|
||||
MirallConfigFile cfg;
|
||||
int lines = cfg.maxLogLines();
|
||||
// qDebug() << "# ## Have " << lines << " Loglines!";
|
||||
document()->setMaximumBlockCount( lines );
|
||||
}
|
||||
|
||||
// ==============================================================================
|
||||
|
@ -57,8 +53,7 @@ LogWidget::LogWidget(QWidget *parent)
|
|||
LogBrowser::LogBrowser(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
_logWidget( new LogWidget(parent) ),
|
||||
_doFileFlush(false),
|
||||
_logstream(0)
|
||||
_doFileFlush(false)
|
||||
{
|
||||
setObjectName("LogBrowser"); // for save/restoreGeometry()
|
||||
setWindowTitle(tr("Log Output"));
|
||||
|
@ -118,8 +113,17 @@ LogBrowser::LogBrowser(QWidget *parent) :
|
|||
// Direct connection for log comming from this thread, and queued for the one in a different thread
|
||||
connect(Logger::instance(), SIGNAL(newLog(QString)),this,SLOT(slotNewLog(QString)), Qt::AutoConnection);
|
||||
|
||||
QAction *showLogWindow = new QAction(this);
|
||||
showLogWindow->setShortcut(QKeySequence("F12"));
|
||||
connect(showLogWindow, SIGNAL(triggered()), SLOT(close()));
|
||||
addAction(showLogWindow);
|
||||
|
||||
MirallConfigFile cfg;
|
||||
cfg.restoreGeometry(this);
|
||||
int lines = cfg.maxLogLines();
|
||||
// qDebug() << "# ## Have " << lines << " Loglines!";
|
||||
_logWidget->document()->setMaximumBlockCount( lines );
|
||||
|
||||
}
|
||||
|
||||
LogBrowser::~LogBrowser()
|
||||
|
@ -143,9 +147,16 @@ void LogBrowser::setLogFile( const QString & name, bool flush )
|
|||
if( _logstream ) {
|
||||
_logFile.close();
|
||||
}
|
||||
_logFile.setFileName( name );
|
||||
|
||||
if(!_logFile.open(QIODevice::WriteOnly)) {
|
||||
bool openSucceeded = false;
|
||||
if (name == QLatin1String("-")) {
|
||||
openSucceeded = _logFile.open(1, QIODevice::WriteOnly);
|
||||
} else {
|
||||
_logFile.setFileName( name );
|
||||
openSucceeded = _logFile.open(QIODevice::WriteOnly);
|
||||
}
|
||||
|
||||
if(!openSucceeded) {
|
||||
QMessageBox::warning(
|
||||
this,
|
||||
tr("Error"),
|
||||
|
|
|
@ -94,12 +94,20 @@ MirallConfigFile::MirallConfigFile( const QString& appendix, bool useOldConfig )
|
|||
|
||||
void MirallConfigFile::setConfDir(const QString &value)
|
||||
{
|
||||
if( value.isEmpty() ) return;
|
||||
QString dirPath = value;
|
||||
if( dirPath.isEmpty() ) return;
|
||||
|
||||
QFileInfo fi(value);
|
||||
QFileInfo fi(dirPath);
|
||||
if ( !fi.exists() && !fi.isAbsolute() ) {
|
||||
QDir::current().mkdir(dirPath);
|
||||
QDir dir = QDir::current();
|
||||
dir.cd(dirPath);
|
||||
fi.setFile(dir.path());
|
||||
}
|
||||
if( fi.exists() && fi.isDir() ) {
|
||||
qDebug() << "** Using custom config dir " << value;
|
||||
_confDir=value;
|
||||
dirPath = fi.absoluteFilePath();
|
||||
qDebug() << "** Using custom config dir " << dirPath;
|
||||
_confDir=dirPath;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ void NetworkSettings::loadBWLimitSettings()
|
|||
if ( uploadLimit >= 1 ) {
|
||||
_ui->uploadLimitRadioButton->setChecked(true);
|
||||
} else if (uploadLimit == 0){
|
||||
_ui->noDownloadLimitRadioButton->setChecked(true);
|
||||
_ui->noUploadLimitRadioButton->setChecked(true);
|
||||
} else {
|
||||
_ui->autoUploadLimitRadioButton->setChecked(true);
|
||||
}
|
||||
|
|
|
@ -138,7 +138,10 @@ QNetworkReply* ownCloudInfo::mkdirRequest( const QString& dir )
|
|||
qDebug() << "OCInfo Making dir " << dir;
|
||||
_authAttempts = 0;
|
||||
QNetworkRequest req;
|
||||
req.setUrl( QUrl( webdavUrl(_connection) + dir ) );
|
||||
QUrl url = QUrl(webdavUrl(_connection));
|
||||
url.setEncodedPath(url.encodedPath()+QUrl::toPercentEncoding(dir, "/"));
|
||||
|
||||
req.setUrl( url );
|
||||
QNetworkReply *reply = davRequest("MKCOL", req, 0);
|
||||
|
||||
// remember the confighandle used for this request
|
||||
|
@ -296,7 +299,7 @@ void ownCloudInfo::slotGetDirectoryListingFinished()
|
|||
currentItem = reader.readElementText();
|
||||
} else if (name == QLatin1String("collection") &&
|
||||
!currentItem.isEmpty()) {
|
||||
folders.append(currentItem);
|
||||
folders.append(QUrl::fromEncoded(currentItem.toLatin1()).path());
|
||||
currentItem.clear();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,8 +47,11 @@ OwncloudSetupWizard::OwncloudSetupWizard(QObject* parent) :
|
|||
this, SLOT(slotConnectToOCUrl( const QString& )));
|
||||
connect( _ocWizard, SIGNAL(createLocalAndRemoteFolders(QString, QString)),
|
||||
this, SLOT(slotCreateLocalAndRemoteFolders(QString, QString)));
|
||||
connect( _ocWizard, SIGNAL(finished(int)),this,SLOT(slotAssistantFinished(int)));
|
||||
|
||||
/* basicSetupFinished might be called from a reply from the network.
|
||||
slotAssistantFinished might destroy the temporary QNetworkAccessManager.
|
||||
Therefore Qt::QueuedConnection is required */
|
||||
connect( _ocWizard, SIGNAL(basicSetupFinished(int)),
|
||||
this, SLOT(slotAssistantFinished(int)), Qt::QueuedConnection);
|
||||
connect( _ocWizard, SIGNAL(clearPendingRequests()),
|
||||
this, SLOT(slotClearPendingRequests()));
|
||||
}
|
||||
|
@ -241,15 +244,10 @@ void OwncloudSetupWizard::testOwnCloudConnect()
|
|||
// write a temporary config.
|
||||
QDateTime now = QDateTime::currentDateTime();
|
||||
|
||||
// remove a possibly existing custom config.
|
||||
if( ! _configHandle.isEmpty() ) {
|
||||
// remove the old config file.
|
||||
MirallConfigFile oldConfig( _configHandle );
|
||||
oldConfig.cleanupCustomConfig();
|
||||
if( _configHandle.isEmpty() ) {
|
||||
_configHandle = now.toString(QLatin1String("MMddyyhhmmss"));
|
||||
}
|
||||
|
||||
_configHandle = now.toString(QLatin1String("MMddyyhhmmss"));
|
||||
|
||||
MirallConfigFile cfgFile( _configHandle, true );
|
||||
QString url = _ocWizard->field(QLatin1String("OCUrl")).toString();
|
||||
if( url.isEmpty() ) return;
|
||||
|
@ -484,8 +482,6 @@ void OwncloudSetupWizard::slotAssistantFinished( int result )
|
|||
// first terminate sync jobs.
|
||||
folderMan->terminateSyncProcess();
|
||||
|
||||
folderMan->unloadAllFolders();
|
||||
|
||||
bool startFromScratch = _ocWizard->field( "OCSyncFromScratch" ).toBool();
|
||||
if( startFromScratch ) {
|
||||
// first try to rename (backup) the current local dir.
|
||||
|
@ -505,10 +501,6 @@ void OwncloudSetupWizard::slotAssistantFinished( int result )
|
|||
}
|
||||
}
|
||||
}
|
||||
// save the user credentials and afterwards clear the cred store.
|
||||
if( acceptCfg ) {
|
||||
cfg.acceptCustomConfig();
|
||||
}
|
||||
|
||||
// Now write the resulting folder definition if folder names are set.
|
||||
if( acceptCfg && urlHasChanged ) {
|
||||
|
@ -524,6 +516,11 @@ void OwncloudSetupWizard::slotAssistantFinished( int result )
|
|||
qDebug() << "User interrupted change of configuration.";
|
||||
}
|
||||
}
|
||||
|
||||
// save the user credentials and afterwards clear the cred store.
|
||||
if( acceptCfg ) {
|
||||
cfg.acceptCustomConfig();
|
||||
}
|
||||
}
|
||||
|
||||
// clear the custom config handle
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include <QObject>
|
||||
#include <QMetaType>
|
||||
#include <QDebug>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
namespace Mirall {
|
||||
|
||||
|
@ -28,35 +28,35 @@ QString Progress::asResultString( Kind kind )
|
|||
switch(kind) {
|
||||
case Download:
|
||||
case EndDownload:
|
||||
re = QObject::tr("Download");
|
||||
re = QCoreApplication::translate( "progress", "Download");
|
||||
break;
|
||||
case Upload:
|
||||
re = QObject::tr("Upload");
|
||||
re = QCoreApplication::translate( "progress", "Upload");
|
||||
break;
|
||||
case Context:
|
||||
re = QObject::tr("Context");
|
||||
re = QCoreApplication::translate( "progress", "Context" );
|
||||
break;
|
||||
case Inactive:
|
||||
re = QObject::tr("Inactive");
|
||||
re = QCoreApplication::translate( "progress", "Inactive");
|
||||
break;
|
||||
case StartDownload:
|
||||
re = QObject::tr("Download");
|
||||
re = QCoreApplication::translate( "progress", "Download");
|
||||
break;
|
||||
case StartUpload:
|
||||
case EndUpload:
|
||||
re = QObject::tr("Upload");
|
||||
re = QCoreApplication::translate( "progress", "Upload");
|
||||
break;
|
||||
case StartSync:
|
||||
re = QObject::tr("Start");
|
||||
re = QCoreApplication::translate( "progress", "Start");
|
||||
break;
|
||||
case EndSync:
|
||||
re = QObject::tr("Finished");
|
||||
re = QCoreApplication::translate( "progress", "Finished");
|
||||
break;
|
||||
case StartDelete:
|
||||
re = QObject::tr("For deletion");
|
||||
re = QCoreApplication::translate( "progress", "For deletion");
|
||||
break;
|
||||
case EndDelete:
|
||||
re = QObject::tr("deleted");
|
||||
re = QCoreApplication::translate( "progress", "deleted");
|
||||
break;
|
||||
default:
|
||||
Q_ASSERT(false);
|
||||
|
@ -71,40 +71,40 @@ QString Progress::asActionString( Kind kind )
|
|||
|
||||
switch(kind) {
|
||||
case Download:
|
||||
re = QObject::tr("downloading");
|
||||
re = QCoreApplication::translate( "progress", "downloading");
|
||||
break;
|
||||
case Upload:
|
||||
re = QObject::tr("uploading");
|
||||
re = QCoreApplication::translate( "progress", "uploading");
|
||||
break;
|
||||
case Context:
|
||||
re = QObject::tr("Context");
|
||||
re = QCoreApplication::translate( "progress", "Context");
|
||||
break;
|
||||
case Inactive:
|
||||
re = QObject::tr("inactive");
|
||||
re = QCoreApplication::translate( "progress", "inactive");
|
||||
break;
|
||||
case StartDownload:
|
||||
re = QObject::tr("downloading");
|
||||
re = QCoreApplication::translate( "progress", "downloading");
|
||||
break;
|
||||
case StartUpload:
|
||||
re = QObject::tr("uploading");
|
||||
re = QCoreApplication::translate( "progress", "uploading");
|
||||
break;
|
||||
case EndDownload:
|
||||
re = QObject::tr("downloading");
|
||||
re = QCoreApplication::translate( "progress", "downloading");
|
||||
break;
|
||||
case EndUpload:
|
||||
re = QObject::tr("uploading");
|
||||
re = QCoreApplication::translate( "progress", "uploading");
|
||||
break;
|
||||
case StartSync:
|
||||
re = QObject::tr("starting");
|
||||
re = QCoreApplication::translate( "progress", "starting");
|
||||
break;
|
||||
case EndSync:
|
||||
re = QObject::tr("finished");
|
||||
re = QCoreApplication::translate( "progress", "finished");
|
||||
break;
|
||||
case StartDelete:
|
||||
re = QObject::tr("delete");
|
||||
re = QCoreApplication::translate( "progress", "delete");
|
||||
break;
|
||||
case EndDelete:
|
||||
re = QObject::tr("deleted");
|
||||
re = QCoreApplication::translate( "progress", "deleted");
|
||||
break;
|
||||
default:
|
||||
Q_ASSERT(false);
|
||||
|
@ -121,7 +121,7 @@ ProgressDispatcher* ProgressDispatcher::instance() {
|
|||
|
||||
ProgressDispatcher::ProgressDispatcher(QObject *parent) :
|
||||
QObject(parent),
|
||||
_problemQueueSize(50)
|
||||
_QueueSize(50)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -158,13 +158,14 @@ void ProgressDispatcher::setProgressInfo(const QString& folder, const Progress::
|
|||
Progress::SyncProblem err;
|
||||
err.folder = folder;
|
||||
err.current_file = newProgress.current_file;
|
||||
// its really
|
||||
err.error_message = QString::fromLocal8Bit( (const char*)newProgress.file_size );
|
||||
err.error_code = newProgress.file_size;
|
||||
err.error_code = newProgress.current_file_bytes;
|
||||
err.timestamp = QDateTime::currentDateTime();
|
||||
|
||||
_recentProblems.enqueue( err );
|
||||
if( _recentProblems.size() > _problemQueueSize ) {
|
||||
_recentProblems.dequeue();
|
||||
_recentProblems.prepend( err );
|
||||
if( _recentProblems.size() > _QueueSize ) {
|
||||
_recentProblems.removeLast();
|
||||
}
|
||||
emit progressSyncProblem( folder, err );
|
||||
} else {
|
||||
|
@ -176,9 +177,13 @@ void ProgressDispatcher::setProgressInfo(const QString& folder, const Progress::
|
|||
newProgress.current_file_no = newProgress.overall_file_count;
|
||||
_currentAction.remove(newProgress.folder);
|
||||
}
|
||||
if( newProgress.kind == Progress::EndDownload || newProgress.kind == Progress::EndUpload ||
|
||||
if( newProgress.kind == Progress::EndDownload ||
|
||||
newProgress.kind == Progress::EndUpload ||
|
||||
newProgress.kind == Progress::EndDelete ) {
|
||||
_recentChanges.enqueue(newProgress);
|
||||
_recentChanges.prepend(newProgress);
|
||||
if( _recentChanges.size() > _QueueSize ) {
|
||||
_recentChanges.removeLast();
|
||||
}
|
||||
}
|
||||
// store the last real action to help clients that start during
|
||||
// the Context-phase of an upload or download.
|
||||
|
|
|
@ -25,9 +25,8 @@ namespace Mirall {
|
|||
/**
|
||||
* @brief The FolderScheduler class schedules folders for sync
|
||||
*/
|
||||
class Progress
|
||||
namespace Progress
|
||||
{
|
||||
public:
|
||||
enum Kind {
|
||||
Invalid,
|
||||
StartSync,
|
||||
|
@ -72,9 +71,9 @@ public:
|
|||
QDateTime timestamp;
|
||||
};
|
||||
|
||||
static QString asActionString( Kind );
|
||||
static QString asResultString( Kind );
|
||||
};
|
||||
QString asActionString( Kind );
|
||||
QString asResultString( Kind );
|
||||
}
|
||||
|
||||
/**
|
||||
* @file progressdispatcher.h
|
||||
|
@ -115,9 +114,9 @@ protected:
|
|||
|
||||
private:
|
||||
ProgressDispatcher(QObject* parent = 0);
|
||||
const int _problemQueueSize;
|
||||
QQueue<Progress::Info> _recentChanges;
|
||||
QQueue<Progress::SyncProblem> _recentProblems;
|
||||
const int _QueueSize;
|
||||
QList<Progress::Info> _recentChanges;
|
||||
QList<Progress::SyncProblem> _recentProblems;
|
||||
|
||||
QHash<QString, Progress::Kind> _currentAction;
|
||||
static ProgressDispatcher* _instance;
|
||||
|
|
|
@ -46,7 +46,11 @@ SettingsDialog::SettingsDialog(Application *app, QWidget *parent) :
|
|||
_ui->setupUi(this);
|
||||
setObjectName("Settings"); // required as group for saveGeometry call
|
||||
|
||||
setWindowTitle(tr("%1 Settings").arg(Theme::instance()->appNameGUI()));
|
||||
setWindowTitle(tr("%1").arg(Theme::instance()->appNameGUI()));
|
||||
|
||||
_accountSettings = new AccountSettings(this);
|
||||
addAccount(tr("Account"), _accountSettings);
|
||||
slotUpdateAccountState();
|
||||
|
||||
QIcon generalIcon(QLatin1String(":/mirall/resources/settings.png"));
|
||||
QListWidgetItem *general = new QListWidgetItem(generalIcon, tr("General"), _ui->labelWidget);
|
||||
|
@ -66,14 +70,9 @@ SettingsDialog::SettingsDialog(Application *app, QWidget *parent) :
|
|||
|
||||
//connect(generalSettings, SIGNAL(resizeToSizeHint()), SLOT(resizeToSizeHint()));
|
||||
|
||||
_accountSettings = new AccountSettings(this);
|
||||
addAccount(tr("Account"), _accountSettings);
|
||||
slotUpdateAccountState();
|
||||
|
||||
connect( app, SIGNAL(folderStateChanged(Folder*)), _accountSettings, SLOT(slotUpdateFolderState(Folder*)));
|
||||
connect( app, SIGNAL(folderStateChanged(Folder*)), SLOT(slotUpdateAccountState()));
|
||||
|
||||
connect( _accountSettings, SIGNAL(addASync()), app, SLOT(slotFolderAdded()) );
|
||||
connect( _accountSettings, SIGNAL(folderChanged()), app, SLOT(slotFoldersChanged()));
|
||||
connect( _accountSettings, SIGNAL(openFolderAlias(const QString&)),
|
||||
app, SLOT(slotFolderOpenAction(QString)));
|
||||
|
@ -84,7 +83,7 @@ SettingsDialog::SettingsDialog(Application *app, QWidget *parent) :
|
|||
connect( ProgressDispatcher::instance(), SIGNAL(progressSyncProblem(QString,Progress::SyncProblem)),
|
||||
_accountSettings, SLOT(slotProgressProblem(QString,Progress::SyncProblem)) );
|
||||
|
||||
_ui->labelWidget->setCurrentRow(_ui->labelWidget->row(general));
|
||||
_ui->labelWidget->setCurrentRow(_ui->labelWidget->row(_accountItem));
|
||||
|
||||
connect(_ui->labelWidget, SIGNAL(currentRowChanged(int)),
|
||||
_ui->stack, SLOT(setCurrentIndex(int)));
|
||||
|
@ -92,6 +91,11 @@ SettingsDialog::SettingsDialog(Application *app, QWidget *parent) :
|
|||
QPushButton *closeButton = _ui->buttonBox->button(QDialogButtonBox::Close);
|
||||
connect(closeButton, SIGNAL(pressed()), SLOT(accept()));
|
||||
|
||||
QAction *showLogWindow = new QAction(this);
|
||||
showLogWindow->setShortcut(QKeySequence("F12"));
|
||||
connect(showLogWindow, SIGNAL(triggered()), app, SLOT(slotOpenLogBrowser()));
|
||||
addAction(showLogWindow);
|
||||
|
||||
MirallConfigFile cfg;
|
||||
cfg.restoreGeometry(this);
|
||||
}
|
||||
|
|
|
@ -45,28 +45,33 @@ QString Theme::statusHeaderText( SyncResult::Status status ) const
|
|||
|
||||
switch( status ) {
|
||||
case SyncResult::Undefined:
|
||||
resultStr = QObject::tr("Status undefined");
|
||||
resultStr = QCoreApplication::translate("theme", "Status undefined");
|
||||
break;
|
||||
case SyncResult::NotYetStarted:
|
||||
resultStr = QObject::tr("Waiting to start sync");
|
||||
resultStr = QCoreApplication::translate("theme", "Waiting to start sync");
|
||||
break;
|
||||
case SyncResult::SyncRunning:
|
||||
resultStr = QObject::tr("Sync is running");
|
||||
resultStr = QCoreApplication::translate("theme", "Sync is running");
|
||||
break;
|
||||
case SyncResult::Success:
|
||||
resultStr = QObject::tr("Sync Success");
|
||||
resultStr = QCoreApplication::translate("theme", "Sync Success");
|
||||
break;
|
||||
case SyncResult::Problem:
|
||||
resultStr = QObject::tr("Sync Success, problems with individual files.");
|
||||
resultStr = QCoreApplication::translate("theme", "Sync Success, problems with individual files.");
|
||||
break;
|
||||
case SyncResult::Error:
|
||||
resultStr = QObject::tr("Sync Error - Click info button for details.");
|
||||
resultStr = QCoreApplication::translate("theme", "Sync Error - Click info button for details.");
|
||||
break;
|
||||
case SyncResult::SetupError:
|
||||
resultStr = QObject::tr( "Setup Error" );
|
||||
resultStr = QCoreApplication::translate("theme", "Setup Error" );
|
||||
break;
|
||||
default:
|
||||
resultStr = QObject::tr("Status undefined");
|
||||
case SyncResult::Unavailable:
|
||||
resultStr = QCoreApplication::translate("theme", "The server is currently unavailable" );
|
||||
break;
|
||||
case SyncResult::SyncPrepare:
|
||||
resultStr = QCoreApplication::translate("theme", "Preparing to sync" );
|
||||
break;
|
||||
|
||||
}
|
||||
return resultStr;
|
||||
}
|
||||
|
@ -94,12 +99,8 @@ QIcon Theme::trayFolderIcon( const QString& backend ) const
|
|||
QIcon Theme::themeIcon( const QString& name, bool sysTray ) const
|
||||
{
|
||||
QString flavor;
|
||||
if (sysTray && _mono) {
|
||||
#ifdef Q_OS_MAC
|
||||
flavor = QLatin1String("black");
|
||||
#else
|
||||
flavor = QLatin1String("white");
|
||||
#endif
|
||||
if (sysTray) {
|
||||
flavor = systrayIconFlavor(_mono);
|
||||
} else {
|
||||
flavor = QLatin1String("colored");
|
||||
}
|
||||
|
@ -158,6 +159,21 @@ QString Theme::defaultClientFolder() const
|
|||
return appName();
|
||||
}
|
||||
|
||||
QString Theme::systrayIconFlavor(bool mono) const
|
||||
{
|
||||
QString flavor;
|
||||
if (mono) {
|
||||
#ifdef Q_OS_MAC
|
||||
flavor = QLatin1String("black");
|
||||
#else
|
||||
flavor = QLatin1String("white");
|
||||
#endif
|
||||
} else {
|
||||
flavor = QLatin1String("colored");
|
||||
}
|
||||
return flavor;
|
||||
}
|
||||
|
||||
void Theme::setSystrayUseMonoIcons(bool mono)
|
||||
{
|
||||
_mono = mono;
|
||||
|
|
|
@ -119,6 +119,8 @@ public:
|
|||
*/
|
||||
virtual QString enforcedLocale() const { return QString::null; }
|
||||
|
||||
/** colored, white or black */
|
||||
QString systrayIconFlavor(bool mono) const;
|
||||
|
||||
/**
|
||||
* Override to use a string or a custom image name.
|
||||
|
|
|
@ -54,6 +54,7 @@ OwncloudAdvancedSetupPage::OwncloudAdvancedSetupPage()
|
|||
setupCustomization();
|
||||
|
||||
connect( _ui.pbSelectLocalFolder, SIGNAL(clicked()), SLOT(slotSelectFolder()));
|
||||
setButtonText(QWizard::NextButton, tr("Connect..."));
|
||||
}
|
||||
|
||||
void OwncloudAdvancedSetupPage::setupCustomization()
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>821</width>
|
||||
<height>647</height>
|
||||
<width>484</width>
|
||||
<height>342</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
|
|
@ -40,8 +40,24 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Server &Address</string>
|
||||
|
@ -51,7 +67,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<item>
|
||||
<widget class="Utils::FancyLineEdit" name="leUrl">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
|
@ -67,6 +83,22 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
|
|
@ -46,11 +46,13 @@ OwncloudWizard::OwncloudWizard(QWidget *parent)
|
|||
_setupLog(),
|
||||
_configExists(false)
|
||||
{
|
||||
setPage(WizardCommon::Page_ServerSetup, _setupPage );
|
||||
setPage(WizardCommon::Page_ServerSetup, _setupPage);
|
||||
setPage(WizardCommon::Page_HttpCreds, _httpCredsPage);
|
||||
setPage(WizardCommon::Page_ShibbolethCreds, _shibbolethCredsPage);
|
||||
setPage(WizardCommon::Page_AdvancedSetup, _advancedSetupPage);
|
||||
setPage(WizardCommon::Page_Result, _resultPage );
|
||||
setPage(WizardCommon::Page_Result, _resultPage);
|
||||
|
||||
connect(this, SIGNAL(finished(int)), SIGNAL(basicSetupFinished(int)));
|
||||
|
||||
// note: start Id is set by the calling class depending on if the
|
||||
// welcome text is to be shown or not.
|
||||
|
@ -145,12 +147,13 @@ void OwncloudWizard::slotCurrentPageChanged( int id )
|
|||
qDebug() << "Current Wizard page changed to " << id;
|
||||
|
||||
if( id == WizardCommon::Page_ServerSetup ) {
|
||||
setButtonText( QWizard::NextButton, tr("Connect...") );
|
||||
emit clearPendingRequests();
|
||||
_setupPage->initializePage();
|
||||
}
|
||||
|
||||
if( id == WizardCommon::Page_Result ) {
|
||||
disconnect(this, SIGNAL(finished(int)), this, SIGNAL(basicSetupFinished(int)));
|
||||
emit basicSetupFinished(QDialog::Accepted);
|
||||
appendToConfigurationLog( QString::null );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,6 +69,8 @@ signals:
|
|||
void determineAuthType(const QString&);
|
||||
void connectToOCUrl( const QString& );
|
||||
void createLocalAndRemoteFolders(const QString&, const QString&);
|
||||
// make sure to connect to this, rather than finished(int)!!
|
||||
void basicSetupFinished( int );
|
||||
|
||||
private:
|
||||
OwncloudSetupPage* _setupPage;
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue