Compare commits
148 Commits
v1.4.0-bet
...
v1.4.2
| 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 | ||
|
|
3e31d86596 | ||
|
|
ab007e2bb2 | ||
|
|
c45d55b94b | ||
|
|
7048bd8cc9 | ||
|
|
cae6ca987f | ||
|
|
65171cfb3a | ||
|
|
7ec636aeb6 | ||
|
|
c96980a57d | ||
|
|
0959ceeff2 | ||
|
|
1988c9d8c4 | ||
|
|
1eaa1e47fe | ||
|
|
31923b314e | ||
|
|
ee840b62e5 | ||
|
|
363efaa408 | ||
|
|
b0beeea95f | ||
|
|
d0a4650d69 | ||
|
|
ec5a84cf01 | ||
|
|
a057eb8590 | ||
|
|
6a8753b119 | ||
|
|
23fab90a31 | ||
|
|
8fdf9cac6b | ||
|
|
525d12f5a2 | ||
|
|
15d247a708 | ||
|
|
a1d0b85277 | ||
|
|
5e5a77b040 | ||
|
|
e420ae6942 | ||
|
|
0be7c0273e | ||
|
|
864b7cd41e | ||
|
|
78c8f13645 | ||
|
|
c87c456ae0 | ||
|
|
94d9b8fb39 | ||
|
|
2dad027001 | ||
|
|
f97bb240d7 | ||
|
|
80332fb6ab | ||
|
|
287ec2f3df | ||
|
|
eb5824f713 | ||
|
|
eded901f69 | ||
|
|
fd30df82cb | ||
|
|
d8888432c3 | ||
|
|
51712fea53 | ||
|
|
f597f99198 | ||
|
|
74ec37f3c7 | ||
|
|
05178f0fbf | ||
|
|
9ce09713b6 | ||
|
|
4fa6faf608 | ||
|
|
a24ae13d9c | ||
|
|
64dd0d1b45 | ||
|
|
da63b1223c | ||
|
|
36f32c2aef | ||
|
|
063acadc3b | ||
|
|
81c720c05b | ||
|
|
edcdcb945a | ||
|
|
5df6430bb2 | ||
|
|
9a0096d07c | ||
|
|
25d33d6057 | ||
|
|
ab4c6247c7 | ||
|
|
1b69dbb38b | ||
|
|
bfdd488b00 | ||
|
|
54c8809bf4 | ||
|
|
0873665bec | ||
|
|
02b3033ca3 | ||
|
|
a27c8ad90c | ||
|
|
18a58f73de | ||
|
|
d1451a3c90 | ||
|
|
0bef47b2f3 | ||
|
|
ccc05d6658 | ||
|
|
c15de69156 | ||
|
|
8bfb44fd28 | ||
|
|
79d3b84fad | ||
|
|
b97701586e | ||
|
|
b120345fe7 | ||
|
|
ec5c65a530 | ||
|
|
77e7a1fa8d | ||
|
|
f6d45b68ef | ||
|
|
24d76a0d75 | ||
|
|
c3326efe94 | ||
|
|
c0e056bb84 | ||
|
|
8a7df36701 | ||
|
|
39ec6b1bb2 | ||
|
|
30b2406533 | ||
|
|
076d5dda0e | ||
|
|
e78eab46ff | ||
|
|
19a08f8d5e | ||
|
|
c6319117fd | ||
|
|
4c10ed4ada | ||
|
|
b0ab3ca80b | ||
|
|
9f89a2fe76 | ||
|
|
e386bfb550 | ||
|
|
0189a3f1bd | ||
|
|
d3a333e03c | ||
|
|
04d3e282fb | ||
|
|
4be5f970d5 | ||
|
|
31ceff181e | ||
|
|
42abf4101c | ||
|
|
f09cae74fb | ||
|
|
13a6393ec5 | ||
|
|
ace57f9dd4 | ||
|
|
e5117a98c9 | ||
|
|
c1f7af7e6f | ||
|
|
b4c116e2a2 | ||
|
|
a19a960b5e | ||
|
|
29d2094626 | ||
|
|
c3b82e6818 | ||
|
|
1a7c89326b | ||
|
|
3a1f04ac2d | ||
|
|
2c8e95a0f4 | ||
|
|
a9d94ef732 | ||
|
|
2756d17873 | ||
|
|
34d7f84fc2 | ||
|
|
cea9b389bf | ||
|
|
71b1e881d8 | ||
|
|
7ba47e9d44 | ||
|
|
be48cb646c | ||
|
|
47eb5ff1d9 | ||
|
|
b608f5a670 | ||
|
|
e81dc34c4e | ||
|
|
1603e627a3 | ||
|
|
bf978b3e0f | ||
|
|
0fdaf33288 | ||
|
|
367c4153c1 | ||
|
|
395c673a24 | ||
|
|
22de23c651 | ||
|
|
23926d2461 | ||
|
|
c03f31b6ba | ||
|
|
a1060a8538 |
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
.gitmodules
|
||||
*build*/
|
||||
*flymake*
|
||||
CMakeLists.txt.user*
|
||||
|
||||
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "doc/ocdoc"]
|
||||
path = doc/ocdoc
|
||||
url = https://github.com/owncloud/documentation
|
||||
@@ -13,12 +13,16 @@ else ()
|
||||
include ( ${CMAKE_SOURCE_DIR}/OWNCLOUD.cmake )
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED APPLICATION_SHORTNAME)
|
||||
set ( APPLICATION_SHORTNAME ${APPLICATION_NAME} )
|
||||
endif()
|
||||
|
||||
include(${CMAKE_SOURCE_DIR}/VERSION.cmake)
|
||||
configure_file( ${CMAKE_SOURCE_DIR}/src/mirall/version.h.in "${CMAKE_CURRENT_BINARY_DIR}/src/mirall/version.h" )
|
||||
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR} "${CMAKE_CURRENT_BINARY_DIR}/src/mirall/")
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
include(DefineInstallationPaths)
|
||||
include(GetGitRevisionDescription)
|
||||
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
|
||||
|
||||
@@ -34,10 +38,8 @@ if (${GIT_SHA1} STREQUAL "GITDIR-NOTFOUND")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
## stupid, we should upstream this
|
||||
if("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr" AND NOT CMAKE_INSTALL_SYSCONFDIR)
|
||||
set(CMAKE_INSTALL_SYSCONFDIR "/etc")
|
||||
endif()
|
||||
set(SYSCONFDIR ${SYSCONF_INSTALL_DIR})
|
||||
set(DATADIR ${DATA_INSTALL_DIR})
|
||||
|
||||
#####
|
||||
## handle BUILD_OWNCLOUD_OSX_BUNDLE
|
||||
@@ -83,25 +85,6 @@ set(USE_INOTIFY ${INOTIFY_FOUND})
|
||||
|
||||
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||
|
||||
set(CPACK_SOURCE_IGNORE_FILES
|
||||
# hidden files
|
||||
"/\\\\..+$"
|
||||
# temporary files
|
||||
"\\\\.swp$"
|
||||
# backup files
|
||||
"~$"
|
||||
# others
|
||||
"\\\\.#"
|
||||
"/#"
|
||||
"/build/"
|
||||
"/_build/"
|
||||
# used before
|
||||
"\\\\.o$"
|
||||
"\\\\.lo$"
|
||||
"\\\\.la$"
|
||||
"Makefile\\\\.in$"
|
||||
)
|
||||
|
||||
include(OwnCloudCPack.cmake)
|
||||
|
||||
add_definitions(-DUNICODE)
|
||||
@@ -123,5 +106,5 @@ endif(UNIT_TESTING)
|
||||
if(BUILD_OWNCLOUD_OSX_BUNDLE)
|
||||
configure_file(sync-exclude.lst ${OWNCLOUD_OSX_BUNDLE}/Contents/Resources/sync-exclude.lst COPYONLY)
|
||||
else()
|
||||
install( FILES sync-exclude.lst DESTINATION ${CMAKE_INSTALL_SYSCONFDIR} )
|
||||
install( FILES sync-exclude.lst DESTINATION ${SYSCONFDIR}/${APPLICATION_SHORTNAME} )
|
||||
endif()
|
||||
|
||||
43
ChangeLog
@@ -1,6 +1,44 @@
|
||||
ChangeLog
|
||||
=========
|
||||
version 1.4.0beta1 (release 2013-08-08 ), csync 0.81.0 required
|
||||
|
||||
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.
|
||||
* Fixed error display in settings/status dialog, displays multi
|
||||
line error messages now correctly.
|
||||
* Wait up to 30 secs before complaining about missing systray
|
||||
Fixes bug #949
|
||||
* Fixed utf8 issues with basic auth authentication, fixes bug #941
|
||||
* Fixed remote folder selector, avoid recursive syncing, fixes bug #962
|
||||
* Handle and display network problems at startup correctly.
|
||||
* Enable and disable the folder watcher during syncs correctly.
|
||||
* Fix setting of thread priority.
|
||||
* Fixed file size display.
|
||||
* Fixed various folder wizard issues, bug #992
|
||||
* Made "Sync started" message optional, fixes bug #934
|
||||
* Fixed shutdown, avoid crashed config on win32, fixes bug #945
|
||||
* Pop up config wizard if no server url is configured, fixes bug #1018
|
||||
* Settings: calculate sidebar width dynamically, fixes bug #1020
|
||||
* Fixed a crash if sync folders were removed, fixes bug #713
|
||||
* Do proper resync after network disconnect, fixes bug #1007
|
||||
* Various minor code fixes
|
||||
|
||||
version 1.4.0 (release 2013-09-04 ), csync 0.90.0 required
|
||||
|
||||
* New Scheduler: Only sync when there are actual changes in the server
|
||||
* Add a Settings Dialog, move Proxy Settings there
|
||||
@@ -19,6 +57,9 @@ version 1.4.0beta1 (release 2013-08-08 ), csync 0.81.0 required
|
||||
* Add an editor for ingore patterns
|
||||
* ALlow to flag certain ignore patterns as discardable
|
||||
* Ensure to ship with all valid translations
|
||||
* Progress Dialog now preserves the last syncned items across sync runs
|
||||
* Split Setup Wizard into multiple pages again
|
||||
* Implement "--logfile -" to log to stdout
|
||||
* Add preliminary support for Shibboleth authentication
|
||||
* Linux: Provide more icon sizes
|
||||
* Linux: Do not trigger notifier on ignored files
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
set( APPLICATION_SHORTNAME "owncloud" )
|
||||
set( APPLICATION_NAME "ownCloud" )
|
||||
set( APPLICATION_EXECUTABLE "owncloud" )
|
||||
set( APPLICATION_DOMAIN "owncloud.com" )
|
||||
set( APPLICATION_VENDOR "ownCloud, Inc" )
|
||||
set( THEME_CLASS "ownCloudTheme" )
|
||||
#set( APPLICATION_SHORTNAME ${APPLICATION_NAME} )
|
||||
set( APPLICATION_EXECUTABLE "owncloud" )
|
||||
set( APPLICATION_DOMAIN "owncloud.com" )
|
||||
set( APPLICATION_VENDOR "ownCloud, Inc" )
|
||||
set( THEME_CLASS "ownCloudTheme" )
|
||||
set( APPLICATION_REV_DOMAIN "com.owncloud.desktopclient" )
|
||||
set( WIN_SETUP_BITMAP_PATH "${CMAKE_SOURCE_DIR}/admin/win/nsi" )
|
||||
# set( THEME_INCLUDE "${OEM_THEME_DIR}/mytheme.h" )
|
||||
|
||||
@@ -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}beta2")
|
||||
set( VERSION_PATCH 2 )
|
||||
set( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX}")
|
||||
set( SOVERSION 0 )
|
||||
|
||||
|
||||
@@ -10,8 +10,7 @@ mount="/Volumes/$(basename $src_dmg|cut -d"-" -f1)"
|
||||
|
||||
test -e $tmp_dmg && rm -rf $tmp_dmg
|
||||
hdiutil convert $src_dmg -format UDRW -o $tmp_dmg
|
||||
open $tmp_dmg
|
||||
sleep 12s
|
||||
hdiutil attach $tmp_dmg
|
||||
pushd $mount
|
||||
codesign -s "$identity" $mount/*.app
|
||||
popd
|
||||
|
||||
108
cmake/modules/DefineInstallationPaths.cmake
Normal file
@@ -0,0 +1,108 @@
|
||||
if (UNIX)
|
||||
# Suffix for Linux
|
||||
SET(LIB_SUFFIX
|
||||
CACHE STRING "Define suffix of directory name (32/64)"
|
||||
)
|
||||
|
||||
SET(EXEC_INSTALL_PREFIX
|
||||
"${CMAKE_INSTALL_PREFIX}"
|
||||
CACHE PATH "Base directory for executables and libraries"
|
||||
)
|
||||
SET(SHARE_INSTALL_PREFIX
|
||||
"${CMAKE_INSTALL_PREFIX}/share"
|
||||
CACHE PATH "Base directory for files which go to share/"
|
||||
)
|
||||
SET(DATA_INSTALL_PREFIX
|
||||
"${SHARE_INSTALL_PREFIX}/${APPLICATION_SHORT_NAME}"
|
||||
CACHE PATH "The parent directory where applications can install their data")
|
||||
|
||||
# The following are directories where stuff will be installed to
|
||||
SET(BIN_INSTALL_DIR
|
||||
"${EXEC_INSTALL_PREFIX}/bin"
|
||||
CACHE PATH "The ${APPLICATION_SHORT_NAME} binary install dir (default prefix/bin)"
|
||||
)
|
||||
SET(SBIN_INSTALL_DIR
|
||||
"${EXEC_INSTALL_PREFIX}/sbin"
|
||||
CACHE PATH "The ${APPLICATION_SHORT_NAME} sbin install dir (default prefix/sbin)"
|
||||
)
|
||||
SET(LIB_INSTALL_DIR
|
||||
"${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}"
|
||||
CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is prefix/lib)"
|
||||
)
|
||||
SET(LIBEXEC_INSTALL_DIR
|
||||
"${EXEC_INSTALL_PREFIX}/libexec"
|
||||
CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is prefix/libexec)"
|
||||
)
|
||||
SET(PLUGIN_INSTALL_DIR
|
||||
"${LIB_INSTALL_DIR}/${APPLICATION_SHORT_NAME}"
|
||||
CACHE PATH "The subdirectory relative to the install prefix where plugins will be installed (default is prefix/lib/${APPLICATION_SHORT_NAME})"
|
||||
)
|
||||
SET(INCLUDE_INSTALL_DIR
|
||||
"${CMAKE_INSTALL_PREFIX}/include"
|
||||
CACHE PATH "The subdirectory to the header prefix (default prefix/include)"
|
||||
)
|
||||
|
||||
SET(DATA_INSTALL_DIR
|
||||
"${DATA_INSTALL_PREFIX}"
|
||||
CACHE PATH "The parent directory where applications can install their data (default prefix/share/${APPLICATION_SHORT_NAME})"
|
||||
)
|
||||
SET(HTML_INSTALL_DIR
|
||||
"${DATA_INSTALL_PREFIX}/doc/HTML"
|
||||
CACHE PATH "The HTML install dir for documentation (default data/doc/html)"
|
||||
)
|
||||
SET(ICON_INSTALL_DIR
|
||||
"${DATA_INSTALL_PREFIX}/icons"
|
||||
CACHE PATH "The icon install dir (default data/icons/)"
|
||||
)
|
||||
SET(SOUND_INSTALL_DIR
|
||||
"${DATA_INSTALL_PREFIX}/sounds"
|
||||
CACHE PATH "The install dir for sound files (default data/sounds)"
|
||||
)
|
||||
|
||||
SET(LOCALE_INSTALL_DIR
|
||||
"${SHARE_INSTALL_PREFIX}/locale"
|
||||
CACHE PATH "The install dir for translations (default prefix/share/locale)"
|
||||
)
|
||||
|
||||
SET(XDG_APPS_DIR
|
||||
"${SHARE_INSTALL_PREFIX}/applications/"
|
||||
CACHE PATH "The XDG apps dir"
|
||||
)
|
||||
SET(XDG_DIRECTORY_DIR
|
||||
"${SHARE_INSTALL_PREFIX}/desktop-directories"
|
||||
CACHE PATH "The XDG directory"
|
||||
)
|
||||
|
||||
IF(NOT "${EXEC_INSTALL_PREFIX}" STREQUAL "/usr")
|
||||
SET(SYSCONFDIR_INSTALL_PREFIX "${EXEC_INSTALL_PREFIX}")
|
||||
endif()
|
||||
|
||||
SET(SYSCONF_INSTALL_DIR
|
||||
"${SYSCONFDIR_INSTALL_PREFIX}/etc"
|
||||
CACHE PATH "The ${APPLICATION_SHORT_NAME} sysconfig install dir (default prefix/etc)"
|
||||
)
|
||||
SET(MAN_INSTALL_DIR
|
||||
"${SHARE_INSTALL_PREFIX}/man"
|
||||
CACHE PATH "The ${APPLICATION_SHORT_NAME} man install dir (default prefix/man)"
|
||||
)
|
||||
SET(INFO_INSTALL_DIR
|
||||
"${SHARE_INSTALL_PREFIX}/info"
|
||||
CACHE PATH "The ${APPLICATION_SHORT_NAME} info install dir (default prefix/info)"
|
||||
)
|
||||
endif (UNIX)
|
||||
|
||||
if (WIN32)
|
||||
# Same same
|
||||
set(SHARE_INSTALL_PREFIX "share" CACHE PATH "-")
|
||||
set(BIN_INSTALL_DIR "." CACHE PATH "-")
|
||||
set(SBIN_INSTALL_DIR "." CACHE PATH "-")
|
||||
set(LIB_INSTALL_DIR "lib" CACHE PATH "-")
|
||||
set(INCLUDE_INSTALL_DIR "include" CACHE PATH "-")
|
||||
set(PLUGIN_INSTALL_DIR "plugins" CACHE PATH "-")
|
||||
set(HTML_INSTALL_DIR "doc/HTML" CACHE PATH "-")
|
||||
set(ICON_INSTALL_DIR "." CACHE PATH "-")
|
||||
set(SOUND_INSTALL_DIR "." CACHE PATH "-")
|
||||
set(LOCALE_INSTALL_DIR "lang" CACHE PATH "-")
|
||||
set(SYSCONF_INSTALL_DIR "config" CACHE PATH "-")
|
||||
set(MAN_INSTALL_DIR "man" CACHE PATH "-")
|
||||
endif (WIN32)
|
||||
@@ -1,6 +1,6 @@
|
||||
;ownCloud installer script.
|
||||
|
||||
!define APPLICATION_SHORTNAME "@APPLICATION_SHORTNAME@"
|
||||
!define APPLICATION_SHORTNAME "@APPLICATION_EXECUTABLE@"
|
||||
!define APPLICATION_NAME "@APPLICATION_NAME@"
|
||||
!define APPLICATION_VENDOR "@APPLICATION_VENDOR@"
|
||||
!define APPLICATION_EXECUTABLE "@APPLICATION_EXECUTABLE@.exe"
|
||||
|
||||
@@ -8,4 +8,11 @@
|
||||
#cmakedefine APPLICATION_DOMAIN @APPLICATION_DOMAIN@
|
||||
#cmakedefine THEME_CLASS @THEME_CLASS@
|
||||
#cmakedefine THEME_INCLUDE @THEME_INCLUDE@
|
||||
|
||||
#cmakedefine APPLICATION_NAME "@APPLICATION_NAME@"
|
||||
#cmakedefine APPLICATION_SHORTNAME "@APPLICATION_SHORTNAME@"
|
||||
#cmakedefine APPLICATION_EXECUTABLE "@APPLICATION_EXECUTABLE@"
|
||||
|
||||
#cmakedefine SYSCONFDIR "@SYSCONFDIR@"
|
||||
#cmakedefine DATADIR "@DATADIR@"
|
||||
#endif
|
||||
|
||||
@@ -22,6 +22,11 @@ if(SPHINX_FOUND)
|
||||
add_custom_target(doc DEPENDS doc-html doc-man COMMENT "Building documentation...")
|
||||
endif(WITH_DOC)
|
||||
|
||||
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ocdoc/_shared_assets")
|
||||
add_dependencies(doc doc-html-org)
|
||||
add_dependencies(doc doc-html-com)
|
||||
endif()
|
||||
|
||||
if(PDFLATEX_FOUND)
|
||||
# if this still fails on Debian/Ubuntu, run
|
||||
# apt-get install texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
|
||||
@@ -56,7 +61,19 @@ if(SPHINX_FOUND)
|
||||
-q -c . -b html
|
||||
-d ${SPHINX_CACHE_DIR}/html
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${SPHINX_HTML_DIR} )
|
||||
${SPHINX_HTML_DIR}/unthemed )
|
||||
add_custom_target( doc-html-org ${SPHINX_EXECUTABLE}
|
||||
-q -c . -b html
|
||||
-d ${SPHINX_CACHE_DIR}/html
|
||||
-D html_theme=owncloud_org
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${SPHINX_HTML_DIR}/org )
|
||||
add_custom_target( doc-html-com ${SPHINX_EXECUTABLE}
|
||||
-q -c . -b html
|
||||
-d ${SPHINX_CACHE_DIR}/html
|
||||
-D html_theme=owncloud_com
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${SPHINX_HTML_DIR}/com )
|
||||
add_custom_target( doc-man ${SPHINX_EXECUTABLE}
|
||||
-q -c . -b man
|
||||
-d ${SPHINX_CACHE_DIR}/man
|
||||
|
||||
37
doc/accountsetup.rst
Normal file
@@ -0,0 +1,37 @@
|
||||
Setting up an Account
|
||||
=====================
|
||||
|
||||
If no account has been configured, ownCloud Client will automatically assist
|
||||
you in connecting to your ownCloud Server after the application has been
|
||||
started.
|
||||
|
||||
As a first step, specify the URL to your Server, just
|
||||
like you would when you open your ownCloud instance inside a browser.
|
||||
|
||||
.. image:: images/wizard_url.png
|
||||
:scale: 50 %
|
||||
|
||||
.. note:: Make sure to use ``https://`` if the server supports it. Otherwise,
|
||||
your password and all data will be transferred to the server unencrypted.
|
||||
This makes it easy for third parties to intercept your communication, and
|
||||
getting hold of your password!
|
||||
|
||||
Next, you are prompted for your username and password. Again, use the same
|
||||
credentials that you would use to log on via the web interface.
|
||||
|
||||
.. image:: images/wizard_user.png
|
||||
:scale: 50 %
|
||||
|
||||
Finally, choose the folder that ownCloud Client is supposed to sync the
|
||||
contents of your ownCloud account with. By default, this is a folder
|
||||
called `ownCloud`, which will reside in your home directory.
|
||||
|
||||
.. image:: images/wizard_targetfolder.png
|
||||
:scale: 50 %
|
||||
|
||||
After pressing `Connect`, ownCloud Client will commence with the syncing
|
||||
process. The next screen will give you the opportunity to review your
|
||||
settings:
|
||||
|
||||
.. image:: images/wizard_overview.png
|
||||
:scale: 50 %
|
||||
14
doc/advancedusage.rst
Normal file
@@ -0,0 +1,14 @@
|
||||
Advanced Usage
|
||||
==============
|
||||
|
||||
.. index:: Advanced Usage
|
||||
|
||||
Options
|
||||
-------
|
||||
.. index:: command line switches, command line, options, parameters
|
||||
.. include:: options.rst
|
||||
|
||||
Config File
|
||||
-----------
|
||||
.. index:: config file
|
||||
.. include:: conffile.rst
|
||||
@@ -1,5 +1,6 @@
|
||||
Architecture
|
||||
============
|
||||
Appendix B: Architecture
|
||||
========================
|
||||
|
||||
.. index:: architecture
|
||||
|
||||
The ownCloud project provides desktop sync clients to synchronize the
|
||||
@@ -11,11 +12,10 @@ csync was written to synchronize with ownCloud’s built-in WebDAV server.
|
||||
|
||||
The ownCloud sync client is based on a tool called mirall initially written by
|
||||
Duncan Mac Vicar. Later Klaas Freitag joined the project and enhanced it to work
|
||||
with ownCloud server. Both mirall and ownCloud Client (oCC) build from the same
|
||||
source, currently hosted in the ownCloud source repo on gitorious.
|
||||
with ownCloud server.
|
||||
|
||||
oCC is written in C++ using the `Qt Framework`_. As a result oCC runs on the
|
||||
three important platforms Linux, Windows and MacOS.
|
||||
ownCloud Client is written in C++ using the `Qt Framework`_. As a result, the
|
||||
ownCloud Client runs on the three important platforms Linux, Windows and MacOS.
|
||||
|
||||
.. _csync: http://www.csync.org
|
||||
.. _`Qt Framework`: http://www.qt-project.org
|
||||
@@ -23,8 +23,8 @@ three important platforms Linux, Windows and MacOS.
|
||||
The Sync Process
|
||||
----------------
|
||||
|
||||
First it is important to recall what syncing is. Syncing tries to keep the files
|
||||
on both repositories the same. That means if a file is added to one repository
|
||||
First it is important to recall what syncing is: It tries to keep the files
|
||||
on two repositories the same. That means if a file is added to one repository
|
||||
it is going to be copied to the other repository. If a file is changed on one
|
||||
repository, the change is propagated to the other repository. Also, if a file
|
||||
is deleted on one side, it is deleted on the other. As a matter of fact, in
|
||||
@@ -34,10 +34,10 @@ server is always master.
|
||||
This is the major difference to other systems like a file backup where just
|
||||
changes and new files are propagated but files never get deleted.
|
||||
|
||||
The oCC checks both repositories for changes frequently after a certain time
|
||||
span. That is refered to as a sync run. In between the local repository is
|
||||
monitored by a file system monitor system that starts a sync run immediately
|
||||
if something was edited, added or removed.
|
||||
The ownCloud Client checks both repositories for changes frequently after a
|
||||
certain time span. That is refered to as a sync run. In between the local
|
||||
repository is monitored by a file system monitor system that starts a sync run
|
||||
immediately if something was edited, added or removed.
|
||||
|
||||
Sync by Time versus ETag
|
||||
------------------------
|
||||
@@ -62,16 +62,18 @@ machines.
|
||||
Since this strategy is rather fragile without NTP, ownCloud 4.5 introduced a
|
||||
unique number, which changes whenever the file changes. Although it is a unique
|
||||
value, it is not a hash of the file, but a randomly chosen number, which it will
|
||||
transmit in the Etag_ field. Since the file number is guaranteed to change if the
|
||||
file changes, it can now be used to determine if one of the files has changed.
|
||||
transmit in the Etag_ field. Since the file number is guaranteed to change if
|
||||
the file changes, it can now be used to determine if one of the files has
|
||||
changed.
|
||||
|
||||
.. note:: oCC 1.1 and newer require file ID capabilities on the ownCloud server,
|
||||
hence using them with a server earlier than 4.5.0 is not supported.
|
||||
.. note:: ownCloud Client 1.1 and newer require file ID capabilities on the
|
||||
ownCloud server, hence using them with a server earlier than 4.5.0 is
|
||||
not supported.
|
||||
|
||||
Before the 1.3.0 release of the client the sync process might create faux conflict
|
||||
files if time deviates. The original and the conflict files only differed in the
|
||||
timestamp, but not in content. This behaviour was changed towards a binary check
|
||||
if the files are different.
|
||||
Before the 1.3.0 release of the client the sync process might create faux
|
||||
conflict files if time deviates. The original and the conflict files only
|
||||
differed in the timestamp, but not in content. This behaviour was changed
|
||||
towards a binary check if the files are different.
|
||||
|
||||
Just like files, directories also hold a unique id, which changes whenever
|
||||
one of the contained files or directories gets modified. Since this is a
|
||||
@@ -105,7 +107,8 @@ are involved and one of them is not in sync with NTP time.
|
||||
.. _Etag: http://en.wikipedia.org/wiki/HTTP_ETag
|
||||
|
||||
Comparison and Conflict Cases
|
||||
----------------------------
|
||||
-----------------------------
|
||||
|
||||
In a sync run the client first has to detect if one of the two repositories have
|
||||
changed files. On the local repository, the client traverses the file
|
||||
tree and compares the modification time of each file with the value it was
|
||||
@@ -118,25 +121,41 @@ For the remote (ie. ownCloud) repository, the client compares the ETag of each
|
||||
file with it's previous value. Again the previous value is queried from the
|
||||
database. If the ETag is still the same, the file has not changed.
|
||||
|
||||
So what happens if a file has changed on both, the local and the remote repository
|
||||
since the last sync run? That means it can not easily be decided which version
|
||||
of the file is the one that should be used. Moreover, changes to any side must
|
||||
not be lost. That is called the conflict case and the client solves it by creating
|
||||
a conflict file of the older of the two files and save the newer one under the
|
||||
original file name. Conflict files are always created on the client and never on
|
||||
the server. The conflict file has the same name as the original file appended
|
||||
with the timestamp of the conflict detection.
|
||||
In case a file has changed on both, the local and the remote repository since
|
||||
the last sync run, it can not easily be decided which version of the file is
|
||||
the one that should be used. However, changes to any side must not be lost.
|
||||
|
||||
That is called a **conflict case**. The client solves it by creating a conflict
|
||||
file of the older of the two files and save the newer one under the original
|
||||
file name. Conflict files are always created on the client and never on the
|
||||
server. The conflict file has the same name as the original file appended with
|
||||
the timestamp of the conflict detection.
|
||||
|
||||
|
||||
.. _ignored-files-label:
|
||||
|
||||
Ignored Files
|
||||
-------------
|
||||
|
||||
ownCloud Client will refuse to sync the following files:
|
||||
|
||||
* Files matched by one of the pattern in :ref:`ignoredFilesEditor-label`
|
||||
* Files containing characters that do not work on certain file systems.
|
||||
Currently, these characters are: `\, :, ?, *, ", >, <, |`
|
||||
* Files starting in ``.csync_journal.db`` (reserved for journalling)
|
||||
|
||||
The Sync Journal
|
||||
----------------
|
||||
The client stores the ETag number in a per-directory database, called the journal.
|
||||
It is located in the application directory (until version 1.1) or as a hidden file
|
||||
right in the directory to be synced (later versions).
|
||||
|
||||
If the journal database gets removed, oCC's CSync backend will rebuild the database
|
||||
by comparing the files and their modification times. Thus it should be made sure
|
||||
that both server and client synchronized to NTP time before restarting the client
|
||||
after a database removal.
|
||||
The client stores the ETag number in a per-directory database,
|
||||
called the journal. It is a hidden file right in the directory
|
||||
to be synced.
|
||||
|
||||
The oCC also provides a button in the Settings Dialog that allows to "reset" the
|
||||
journal. That can be used to recreate the journal database.
|
||||
If the journal database gets removed, ownCloud Client's CSync backend will
|
||||
rebuild the database by comparing the files and their modification times. Thus
|
||||
it should be made sure that both server and client synchronized with NTP time
|
||||
before restarting the client after a database removal.
|
||||
|
||||
Pressing ``F5`` in the Account Settings Dialog that allows to "reset" the
|
||||
journal. That can be used to recreate the journal database. Use this only
|
||||
if advised to do so by the developer or support staff.
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
Building the Client
|
||||
===================
|
||||
.. _building-label:
|
||||
|
||||
Appendix A: Building the Client
|
||||
===============================
|
||||
|
||||
This section explains how to build the ownCloud Client from source
|
||||
for all major platforms. You should read this section if you want
|
||||
@@ -34,9 +36,14 @@ its own repository which contains non-standard recipes. Add it with::
|
||||
|
||||
Next, install the missing dependencies::
|
||||
|
||||
brew install $(brew deps ocsync)
|
||||
brew install $(brew deps ocsync)
|
||||
brew install $(brew deps mirall)
|
||||
|
||||
bug:
|
||||
iniparser is not provideed by $(brew deps ocsync)
|
||||
fix with brew install iniparser
|
||||
|
||||
|
||||
To build mirall and csync, follow the `generic build instructions`_.
|
||||
|
||||
.. note::
|
||||
|
||||
@@ -28,7 +28,7 @@ import sys, os
|
||||
extensions = ['sphinx.ext.todo']
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
#templates_path = ['templates']
|
||||
templates_path = ['@CMAKE_CURRENT_SOURCE_DIR@/ocdoc/_shared_assets/templates']
|
||||
|
||||
# The suffix of source filenames.
|
||||
source_suffix = '.rst'
|
||||
@@ -64,7 +64,7 @@ release = '@VERSION@'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
exclude_patterns = ['_build']
|
||||
exclude_patterns = ['_build','scripts/*']
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all documents.
|
||||
#default_role = None
|
||||
@@ -95,7 +95,7 @@ pygments_style = 'sphinx'
|
||||
#html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
#html_theme_path = ['themes']
|
||||
html_theme_path = ['@CMAKE_CURRENT_SOURCE_DIR@/ocdoc/_shared_assets/themes']
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
@@ -120,7 +120,7 @@ html_short_title = "Client Manual"
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
#html_static_path = ['static']
|
||||
html_static_path = ['@CMAKE_CURRENT_SOURCE_DIR@/ocdoc/_shared_assets/static']
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
|
||||
@@ -4,8 +4,8 @@ Glossary
|
||||
.. glossary::
|
||||
:sorted:
|
||||
|
||||
ownCloud Sync Client
|
||||
ownCloud Client
|
||||
oCC
|
||||
Name of the official ownCloud syncing client for desktop, which runs on
|
||||
Windows, Mac OS X and Linux. It is based Mirall, and uses the CSync
|
||||
sync engine for synchronization with the ownCloud server.
|
||||
@@ -23,6 +23,7 @@ Glossary
|
||||
exist in the client directory.
|
||||
|
||||
unique id
|
||||
ETag
|
||||
ID assigned to every file starting with ownCloud server 4.5 and submitted
|
||||
via the HTTP ``Etag``. Used to check if files on client and server have
|
||||
changed.
|
||||
|
||||
|
Before Width: | Height: | Size: 45 KiB |
BIN
doc/images/icon.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
doc/images/ignored_files_editor.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
doc/images/menu.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
doc/images/settings_account.png
Normal file
|
After Width: | Height: | Size: 72 KiB |
BIN
doc/images/settings_general.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
doc/images/settings_network.png
Normal file
|
After Width: | Height: | Size: 59 KiB |
BIN
doc/images/sync_protocol.png
Normal file
|
After Width: | Height: | Size: 168 KiB |
BIN
doc/images/wizard_overview.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
doc/images/wizard_targetfolder.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
doc/images/wizard_url.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
doc/images/wizard_user.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
@@ -6,8 +6,11 @@ Contents
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
install
|
||||
usage
|
||||
introduction
|
||||
accountsetup
|
||||
visualtour
|
||||
advancedusage
|
||||
|
||||
building
|
||||
architecture
|
||||
troubleshooting
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
Installation
|
||||
============
|
||||
|
||||
General
|
||||
-------
|
||||
|
||||
The latest version of ownCloud client can be obtained at
|
||||
http://owncloud.org/sync-clients/.
|
||||
|
||||
Windows
|
||||
-------
|
||||
|
||||
ownCloud client for Windows is provided as a NSIS-based setup file for
|
||||
machine-wide install.
|
||||
|
||||
Mac OS X
|
||||
--------
|
||||
|
||||
Installing the ownCloud client on your Mac follows the normal app installation
|
||||
pattern:
|
||||
|
||||
1. Download the installation file Click ownCloud-x.y.z.dmg, a window with the
|
||||
2. ownCloud icon opens In that window, drag the ownCloud application into the
|
||||
3. ‘Applications’ folder on the right hand side From ‘Applications’, choose
|
||||
ownCloud
|
||||
|
||||
Linux
|
||||
------
|
||||
|
||||
The ownCloud client is provided as in a convenient repository for a wide range
|
||||
of popular Linux distributions. If you want to build the sources instead.
|
||||
|
||||
Supported distributions are CentOS/RHEL, Fedora, SLES, openSUSE, Ubuntu and
|
||||
Debian.
|
||||
|
||||
To support other distributions, a source build is required.
|
||||
37
doc/introduction.rst
Normal file
@@ -0,0 +1,37 @@
|
||||
Introduction
|
||||
============
|
||||
|
||||
This is the documentation for the ownCloud Sync Client, also referred to as
|
||||
the ownCloud Client.
|
||||
|
||||
The ownCloud Sync Client is a desktop program you install on your computer.
|
||||
Specify one ore more directories on the local machine to sync your ownCloud
|
||||
server, and always have your latest files wherever you are. Make a change to the
|
||||
files on one computer, it will flow across the others using these desktop sync
|
||||
clients.
|
||||
|
||||
ownCloud Client is available for Windows, Mac OS X and various Linux
|
||||
distributions. See below for details on how to obtain the Client.
|
||||
|
||||
Obtaining the Client
|
||||
--------------------
|
||||
|
||||
The latest version of the ownCloud Client can be obtained at
|
||||
http://owncloud.org/sync-clients/.
|
||||
|
||||
ownCloud client for **Windows** is provided as a NSIS-based setup file for
|
||||
machine-wide install. Installing the ownCloud client on **Mac OS** follows
|
||||
the normal app bundle installation pattern:
|
||||
|
||||
1. Download the installation file: Click ``ownCloud-x.y.z.dmg``, a window with
|
||||
the ownCloud icon opens.
|
||||
2. In that window, drag the ownCloud application into the ``Applications``
|
||||
folder.
|
||||
3. On the right hand side From ``Applications``, choose ``ownCloud``.
|
||||
|
||||
The ownCloud Client is also provided as in a convenient repository for a wide
|
||||
range of popular **Linux distributions**. If you want to build the sources
|
||||
instead.
|
||||
|
||||
Supported distributions are Fedora, openSUSE, Ubuntu and Debian.
|
||||
To support other distributions, a is required, see :ref:`building-label`
|
||||
1
doc/ocdoc
Submodule
@@ -15,9 +15,6 @@ ownCloud Client supports the following command line switches:
|
||||
``--logflush``
|
||||
flush the log file after every write.
|
||||
|
||||
``--monoicons``
|
||||
Use black/white pictograms for systray.
|
||||
|
||||
``--confdir`` `<dirname>`
|
||||
Use the given configuration directory.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Troubleshooting
|
||||
===============
|
||||
Appendix C: Troubleshooting
|
||||
===========================
|
||||
|
||||
If the client fails to start syncing it basically can have two
|
||||
basic reasons: Either the server setup has a problem or the client
|
||||
@@ -55,6 +55,12 @@ ownCloud is not shared with other syncing apps.
|
||||
not be attempted. In the worst case, doing so can result in data
|
||||
loss.
|
||||
|
||||
If some files do not get take a look at the sync protocol. Some files are
|
||||
automatically automatically being ignored because they are system files,
|
||||
others get ignored because their file name contains characters that cannot
|
||||
be represented on certain file systems. See :ref:`_ignored-files-label` for
|
||||
details.
|
||||
|
||||
If you are operating your own server and use the local storage backend (the
|
||||
default), make sure that ownCloud has exclusive access to the directory.
|
||||
|
||||
@@ -65,13 +71,15 @@ If you are using a different backend, you can try to exclude a bug in the
|
||||
backend by reverting to the local backend.
|
||||
|
||||
Logfiles
|
||||
========
|
||||
--------
|
||||
|
||||
Doing effective debugging requires to provide as much as relevant logs as
|
||||
possible. The log output can help you with tracking down problem, and if you
|
||||
report a bug, you're advised to include the output.
|
||||
|
||||
:Client Logfile:
|
||||
Client Logfile
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
Start the client with ``--logwindow``. That opens a window providing a view
|
||||
on the current log. It provides a Save button to let you save the log to a
|
||||
file.
|
||||
@@ -97,11 +105,14 @@ given expiry period.
|
||||
|
||||
For example, for a long running test where you intend to keep the log data of the
|
||||
last two days, this would be the command line:
|
||||
|
||||
```
|
||||
owncloud --logdir /tmp/owncloud_logs --logexpire 48
|
||||
```
|
||||
|
||||
:ownCloud server Logfile:
|
||||
ownCloud server Logfile
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ownCloud server maintains an ownCloud specific logfile as well. It can and
|
||||
must be enabled through the ownCloud Administration page. There you can adjust
|
||||
the loglevel. It is advisable to set it to a verbose level like ``Debug`` or
|
||||
@@ -110,7 +121,9 @@ the loglevel. It is advisable to set it to a verbose level like ``Debug`` or
|
||||
The logfile can be viewed either in the web interface or can be found in the
|
||||
filesystem in the ownCloud server data dir.
|
||||
|
||||
:Webserver Logfiles:
|
||||
Webserver Logfiles
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Also, please take a look at your webservers error log file to check if there
|
||||
are problems. For Apache on Linux, the error logs usually can be found at
|
||||
``/var/log/apache2``. A file called ``error_log`` shows errors like PHP code
|
||||
|
||||
@@ -1,95 +0,0 @@
|
||||
Usage
|
||||
=====
|
||||
.. index:: usage, client sync usage
|
||||
|
||||
To start ownCloud Client, click on the desktop icon or start it from the
|
||||
application menu. In the system tray, an ownCloud icon appears.
|
||||
|
||||
.. index:: start application
|
||||
|
||||
Overview
|
||||
--------
|
||||
|
||||
ownCloud is represented by an icon in the Desktop's system tray, also known
|
||||
as notification area.
|
||||
|
||||
The clients menu is accessed with a right click (Windows, Linux) or left click
|
||||
(Mac OS).
|
||||
|
||||
The status of the current sync can be observed in the Status dialog, available
|
||||
trough the ``Open status...`` option. On Windows, a left click on the tray icon
|
||||
also opens the status dialog.
|
||||
|
||||
.. note:: Until the intial setup has finished, the Connection Wizard will be
|
||||
shown instead when left-clicking on Windows.
|
||||
|
||||
The dialog provides an overview on the configured sync folders and allows to add
|
||||
and remove more sync folder connections as well as pausing a sync connection.
|
||||
|
||||
Changing Your Password and Account Settings
|
||||
-------------------------------------------
|
||||
|
||||
In the ``Settings`` Dialog, choose ``Account`` -> ``Modify Account``. It will open
|
||||
Setup Wizard, which next to reconfiguring your connection to use a different
|
||||
user or server also will allow to change the password for the local account,
|
||||
or to switch from HTTP to HTTPS.
|
||||
|
||||
Setting up a Proxy
|
||||
------------------
|
||||
|
||||
By default, the configured system proxy will be picked up. This may not be
|
||||
working reliably on some Linux distributions, as only the ``http_proxy``
|
||||
variable gets picked up. You can configure a proxy different from your
|
||||
system default in the ``Network`` section of the ``Settings`` dialog.
|
||||
|
||||
The default settings assume an HTTP proxy, which is the typical use case.
|
||||
If you require SOCKS 5 proxy, pick ``SOCKS5 proxy`` instead of ``HTTP(S) proxy``
|
||||
from the drop down menu. SOCKS 5 proxies are typically provided by some
|
||||
SSH implementations, for instance OpenSSH's ``-D`` parameter. This is
|
||||
useful for scenarios where SSH is employed to securely tunnel a client
|
||||
to the network running the ownCloud server.
|
||||
|
||||
Limiting Bandwidth
|
||||
------------------
|
||||
|
||||
Starting with Version 1.4, the Client provides bandwidth limiter.
|
||||
This option can be found in the ``Network`` section of the
|
||||
``Settings Dialog``.
|
||||
|
||||
You will find two settings for ``Download Bandwidth`` and
|
||||
``Upload Bandwidth``.
|
||||
|
||||
Upload Bandwidth
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
The default is to automatically limit the upload. The rationale
|
||||
for this default is that typically, Computers and laptops are
|
||||
not directly connected to the server, but via a Cable Modems
|
||||
or DSL lines, which provide significantly more downstream than
|
||||
upstream bandwith. Sataurating the upstream bandwidth would
|
||||
interfere with other applications, especially Voice-Over-IP or
|
||||
Games.
|
||||
|
||||
The automatic limiter will throttle the speed to about 75%
|
||||
of the available upstream bandwidth. If you are communicating
|
||||
with the server via a fast, symetric connection, you can set the
|
||||
Limiter to ``No Limit`` instead. If want a stronger limitation,
|
||||
choose ``Limit to`` and specify a limit manually.
|
||||
|
||||
|
||||
Download Bandwidth
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Because the download bandwidth is usually no concern, it is not
|
||||
automatically limited. Should you find that the Client is taking
|
||||
up too much bandwidth, you can manually specify a limit (in KB).
|
||||
|
||||
Options
|
||||
-------
|
||||
.. index:: command line switches, command line, options, parameters
|
||||
.. include:: options.rst
|
||||
|
||||
Config File
|
||||
-----------
|
||||
.. index:: config file
|
||||
.. include:: conffile.rst
|
||||
178
doc/visualtour.rst
Normal file
@@ -0,0 +1,178 @@
|
||||
Visual Tour
|
||||
===========
|
||||
|
||||
.. index:: visual tour, usage
|
||||
|
||||
ownCloud Client stays in the background, and is visible as an
|
||||
icon in your system tray (Windows, KDE), status bar (Mac OS X)
|
||||
or notification area (Ubuntu), like so:
|
||||
|
||||
.. image:: images/icon.png
|
||||
|
||||
If a setup is still required, it will open the setup. Otherwise, the
|
||||
main menu is opened, which provides several options and displays
|
||||
progress information:
|
||||
|
||||
.. image:: images/menu.png
|
||||
|
||||
Here is an explanation of the individual items in the menu:
|
||||
|
||||
* ``Open ownCloud in browser``: Opens the ownCloud web interface
|
||||
* ``Open folder 'ownCloud'``: Opens the local folder. If you have
|
||||
defined multiple sync targets, you should see multiple entries
|
||||
here.
|
||||
* **Disk space indicator**: Shows how much space is used up on the server.
|
||||
* Operation indicator: Shows the status of the current sync process, or
|
||||
``Up to date`` if server and client are in sync.
|
||||
* **Recent Changes**: shows the last six files modified by sync operations,
|
||||
and provides access to the Sync Protocol, which lists all changes
|
||||
since the last restart of ownCloud Client.
|
||||
* ``Settings...``: provides access to the settings menu.
|
||||
* ``Help``: Opens a browser to display this help.
|
||||
* ``Quit ownCloud``: Quits ownCloud, ending a currently running sync run.
|
||||
|
||||
The settings dialog is split up in three categories: ``Account Settings``,
|
||||
``General Settings`` and ``Network Settings``:
|
||||
|
||||
Account Settings
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
.. index:: account settings, user, password, Server URL
|
||||
|
||||
The ``Account Settings`` tab provides an executive summary about the synced
|
||||
folders in your account and allows to modify them. It also provides a more
|
||||
detailed report about the storage usage. Finally, it allows to change
|
||||
the files that ownCloud Client should ignore (for details, see the
|
||||
``Ignored Files Editor`` section below), and to modify various aspects
|
||||
of the current account settings, such as user name, password and server URL.
|
||||
|
||||
.. image:: images/settings_account.png
|
||||
:scale: 50 %
|
||||
|
||||
General Settings
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
.. index:: general settings, auto start, startup, desktop notifications
|
||||
|
||||
The tab provides several useful options:
|
||||
|
||||
.. image:: images/settings_general.png
|
||||
:scale: 50 %
|
||||
|
||||
* **Launch on System Startup**: This option is automatically activated
|
||||
once a user has conimaged his account. Unchecking the box will cause
|
||||
ownCloud client to not launch on startup for a particular user.
|
||||
* **Show Desktop Nofications**: Do not show bubble notifications whenever
|
||||
a set of sync operations has been performed.
|
||||
* **Use Monochrome Icons**: Use less obstrusive icons. Especially useful
|
||||
on Mac OS.
|
||||
|
||||
The acout menu provides information about authors as well as detailed
|
||||
information about the build conditions. Those are particularly valuable
|
||||
when filing a bug report.
|
||||
|
||||
Network Settings
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
.. index:: proxy settings, SOCKS, bandwith, throttling, limiting
|
||||
|
||||
This tab consollidates ``Proxy Settings`` and ``Bandwith Limiting``:
|
||||
|
||||
.. image:: images/settings_network.png
|
||||
:scale: 50 %
|
||||
|
||||
Proxy Settings
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
* ``No Proxy``: Check this if ownCloud Client should circumvent the default
|
||||
proxy conimaged on the system.
|
||||
* ``Use system proxy``: Default, will follow the systems proxy settings.
|
||||
On Linux, this will only pick up the value of the variable ``http_proxy``.
|
||||
* ``Specify proxy manually as``: Allows to specify custom proxy settings.
|
||||
If you require to go through a HTTP(S) proxy server such as Squid or Microsoft
|
||||
Forefront TMG, pick ``HTTP(S)``. ``SOCKSv5`` on the other hand is particulary
|
||||
useful in special company LAN setups, or in combination with the OpenSSH
|
||||
dynamic application level forwarding feature (see ``ssh -D``).
|
||||
* ``Host``: Enter the host name or IP address of your proxy server, followed
|
||||
by the port number. HTTP proxies usually listen on Ports 8080 (default) or
|
||||
3128. SOCKS server usually listen on port 1080.
|
||||
* ``Proxy Server requires authentication``: Should be checked if the proxy
|
||||
server does not allow anonymous usage. If you check this option, you must
|
||||
provide username and password in the fields below, or ownless Cloud will no
|
||||
longer be able to connect successfully.
|
||||
|
||||
Bandwidth Limiting
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The ``Download Bandwidth`` (i.e. the bandwidth available for data flowing
|
||||
from the ownCloud Server to the client) can be either ``Unlimited``
|
||||
(the default), or limited to a custom value, specified in bytes
|
||||
|
||||
The ``Upload Bandwith`` (i.e. the bandwith available for data flowing
|
||||
from the ownCloud Client to the server) additionally has the option
|
||||
to ``Limit automatically``: When this option is checked, the ownCloud
|
||||
Client will surrender available upstream bandwith to other applications.
|
||||
Use this option if you expirience problems with real time communication,
|
||||
such as Skype or other VoIP software, in conjunction with ownCloud Client.
|
||||
This is commonly the case with asymmetric internet connection, such as
|
||||
certain DSL lines with very limited upstream capacity.
|
||||
|
||||
ownCloud Client will pick up changes immediately, but ongoing operations
|
||||
will finish using the old settings.
|
||||
|
||||
The Sync Protocol
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. index:: sync protocol
|
||||
|
||||
The ``Sync Protocol`` window, which can be invoked from either from the main
|
||||
menu (``Recent Changes`` -> ``Details...``) or the ``Account Settings``
|
||||
(``Info`` button), will provide you with an in-depth summary of the recent
|
||||
sync activity. It will also show files that have not been synched (ignored
|
||||
files). Those are ignored either because they are listed in the ignored
|
||||
files list (see ``Ignored Files Editor`` section below), or because they
|
||||
cannot be synced in a cross-platform manner because they contain special
|
||||
characters that cannot be stored on certain file systems.
|
||||
|
||||
.. image:: images/sync_protocol.png
|
||||
:scale: 50 %
|
||||
|
||||
.. _ignoredFilesEditor-label:
|
||||
|
||||
The Ignored Files Editor
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. index:: ignored files, exclude files, pattern
|
||||
|
||||
The ignored files editor allows adding patterns for files or directories
|
||||
that should be excluded from the sync process. Next to normal characters,
|
||||
wildcards can be used to match an arbitrary number of characters, designated
|
||||
by an asterisk (``*``) or a single character, designated by a question mark
|
||||
(``?``).
|
||||
|
||||
Global defaults cannot be directly modified within the editor. Hovering
|
||||
with the mouse will reveal the location of the global exclude definition
|
||||
file.
|
||||
|
||||
In addition to this list, ownCloud Client always excludes files with
|
||||
characters that cannot be synched down to other file systems,
|
||||
see :ref:`ignored-files-label`.
|
||||
|
||||
.. note:: Modifying the global exclude definition file might render the
|
||||
client unusable or cause undesired behavior.
|
||||
|
||||
.. note:: Custom entries are currently not validated for syntactical
|
||||
correctness by the editor, but might fail to load correctly.
|
||||
|
||||
.. image:: images/ignored_files_editor.png
|
||||
:scale: 50%
|
||||
|
||||
Examples:
|
||||
^^^^^^^^^
|
||||
+-----------+------------------------------+
|
||||
| Pattern | Matches |
|
||||
+===========+==============================+
|
||||
| ``~$*`` | ``~$foo``, ``~$example.doc`` |
|
||||
+-----------+------------------------------+
|
||||
| ``fl?p`` | ``flip``, ``flap`` |
|
||||
+-----------+------------------------------+
|
||||
@@ -4,5 +4,5 @@ Type=Application
|
||||
Exec=@APPLICATION_EXECUTABLE@
|
||||
Name=@APPLICATION_NAME@ desktop sync client
|
||||
GenericName=Folder Sync
|
||||
Icon=@APPLICATION_SHORTNAME@
|
||||
Keywords=@APPLICATION_NAME@;syncing;file;sharing
|
||||
Icon=@APPLICATION_EXECUTABLE@
|
||||
Keywords=@APPLICATION_NAME@;syncing;file;sharing;
|
||||
|
||||
@@ -11,7 +11,7 @@ else()
|
||||
set(theme_dir ${CMAKE_CURRENT_SOURCE_DIR}/../theme)
|
||||
endif()
|
||||
|
||||
set(synclib_NAME ${APPLICATION_SHORTNAME}sync)
|
||||
set(synclib_NAME ${APPLICATION_EXECUTABLE}sync)
|
||||
|
||||
set(mirall_UI
|
||||
mirall/folderwizardsourcepage.ui
|
||||
@@ -168,8 +168,8 @@ if(NOT BUILD_OWNCLOUD_OSX_BUNDLE)
|
||||
)
|
||||
if(NOT WIN32)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/mirall.desktop.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${APPLICATION_SHORTNAME}.desktop)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${APPLICATION_SHORTNAME}.desktop DESTINATION share/applications )
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${APPLICATION_EXECUTABLE}.desktop)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${APPLICATION_EXECUTABLE}.desktop DESTINATION share/applications )
|
||||
endif()
|
||||
else()
|
||||
install(TARGETS ${synclib_NAME} DESTINATION ${OWNCLOUD_OSX_BUNDLE}/Contents/MacOS)
|
||||
@@ -254,7 +254,15 @@ set( final_src
|
||||
include( AddAppIconMacro )
|
||||
set(ownCloud_old ${ownCloud})
|
||||
|
||||
kde4_add_app_icon( ownCloud "${theme_dir}/colored/${APPLICATION_SHORTNAME}-icon*.png")
|
||||
# set an icon_app_name. For historical reasons we can not use the
|
||||
# application_shortname for ownCloud but must rather set it manually.
|
||||
if ( EXISTS ${OEM_THEME_DIR}/OEM.cmake )
|
||||
set(ICON_APP_NAME ${APPLICATION_SHORTNAME})
|
||||
else()
|
||||
set(ICON_APP_NAME "owncloud")
|
||||
endif()
|
||||
|
||||
kde4_add_app_icon( ownCloud "${theme_dir}/colored/${ICON_APP_NAME}-icon*.png")
|
||||
list(APPEND final_src ${ownCloud})
|
||||
set(ownCloud ${ownCloud_old})
|
||||
|
||||
@@ -262,16 +270,15 @@ if(NOT BUILD_OWNCLOUD_OSX_BUNDLE)
|
||||
set(BIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
|
||||
|
||||
if(NOT WIN32)
|
||||
file( GLOB _icons "${theme_dir}/colored/${APPLICATION_SHORTNAME}-icon-*.png" )
|
||||
file( GLOB _icons "${theme_dir}/colored/${ICON_APP_NAME}-icon-*.png" )
|
||||
foreach( _file ${_icons} )
|
||||
string( REPLACE "${theme_dir}/colored/${APPLICATION_SHORTNAME}-icon-" "" _res ${_file} )
|
||||
string( REPLACE "${theme_dir}/colored/${ICON_APP_NAME}-icon-" "" _res ${_file} )
|
||||
string( REPLACE ".png" "" _res ${_res} )
|
||||
install( FILES ${_file} RENAME ${APPLICATION_SHORTNAME}.png DESTINATION
|
||||
${CMAKE_INSTALL_DATADIR}/icons/hicolor/${_res}x${_res}/apps )
|
||||
install( FILES ${_file} RENAME ${ICON_APP_NAME}.png DESTINATION ${DATADIR}/icons/hicolor/${_res}x${_res}/apps )
|
||||
endforeach( _file )
|
||||
endif(NOT WIN32)
|
||||
|
||||
install(FILES ${mirall_I18N} DESTINATION share/${APPLICATION_SHORTNAME}/i18n)
|
||||
install(FILES ${mirall_I18N} DESTINATION share/${APPLICATION_EXECUTABLE}/i18n)
|
||||
|
||||
# we may not add MACOSX_BUNDLE here, if not building one
|
||||
|
||||
|
||||
@@ -67,11 +67,25 @@ int getauth(const char *prompt,
|
||||
|
||||
} // ns
|
||||
|
||||
class HttpCredentialsAccessManager : public MirallAccessManager {
|
||||
public:
|
||||
HttpCredentialsAccessManager(const HttpCredentials *cred, QObject* parent = 0)
|
||||
: MirallAccessManager(parent), _cred(cred) {}
|
||||
protected:
|
||||
QNetworkReply *createRequest(Operation op, const QNetworkRequest &request, QIODevice *outgoingData) {
|
||||
QByteArray credHash = QByteArray(_cred->user().toUtf8()+":"+_cred->password().toUtf8()).toBase64();
|
||||
QNetworkRequest req(request);
|
||||
req.setRawHeader(QByteArray("Authorization"), QByteArray("Basic ") + credHash);
|
||||
return MirallAccessManager::createRequest(op, req, outgoingData);\
|
||||
}
|
||||
private:
|
||||
const HttpCredentials *_cred;
|
||||
};
|
||||
|
||||
HttpCredentials::HttpCredentials()
|
||||
: _user(),
|
||||
_password(),
|
||||
_ready(false),
|
||||
_attempts()
|
||||
_ready(false)
|
||||
{}
|
||||
|
||||
HttpCredentials::HttpCredentials(const QString& user, const QString& password)
|
||||
@@ -134,7 +148,7 @@ QString HttpCredentials::password() const
|
||||
|
||||
QNetworkAccessManager* HttpCredentials::getQNAM() const
|
||||
{
|
||||
MirallAccessManager* qnam = new MirallAccessManager;
|
||||
MirallAccessManager* qnam = new HttpCredentialsAccessManager(this);
|
||||
|
||||
connect( qnam, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)),
|
||||
this, SLOT(slotAuthentication(QNetworkReply*,QAuthenticator*)));
|
||||
@@ -180,30 +194,12 @@ void HttpCredentials::slotCredentialsFetched(bool ok)
|
||||
|
||||
void HttpCredentials::slotAuthentication(QNetworkReply* reply, QAuthenticator* authenticator)
|
||||
{
|
||||
if( !(authenticator && reply) ) return;
|
||||
|
||||
qDebug() << "Authenticating request for " << reply->url();
|
||||
|
||||
if (_attempts.contains(reply)) {
|
||||
++_attempts[reply];
|
||||
} else {
|
||||
connect(reply, SIGNAL(finished()),
|
||||
this, SLOT(slotReplyFinished()));
|
||||
_attempts[reply] = 1;
|
||||
}
|
||||
// TODO: Replace it with something meaningful...
|
||||
//if( reply->url().toString().startsWith( webdavUrl( _connection ) ) ) {
|
||||
if (_attempts[reply] > 1) {
|
||||
qDebug() << "Too many attempts to authenticate. Stop request.";
|
||||
reply->close();
|
||||
} else {
|
||||
authenticator->setUser( _user );
|
||||
authenticator->setPassword( _password );
|
||||
}
|
||||
//} else {
|
||||
// qDebug() << "WRN: attempt to authenticate to different url - closing.";
|
||||
// reply->close();
|
||||
//}
|
||||
Q_UNUSED(authenticator)
|
||||
// we cannot use QAuthenticator, because it sends username and passwords with latin1
|
||||
// instead of utf8 encoding. Instead, we send it manually. Thus, if we reach this signal,
|
||||
// those credentials were invalid and we terminate.
|
||||
qDebug() << "Stop request: Authentication failed for " << reply->url().toString();
|
||||
reply->close();
|
||||
}
|
||||
|
||||
void HttpCredentials::slotReplyFinished()
|
||||
@@ -212,7 +208,6 @@ void HttpCredentials::slotReplyFinished()
|
||||
|
||||
disconnect(reply, SIGNAL(finished()),
|
||||
this, SLOT(slotReplyFinished()));
|
||||
_attempts.remove (reply);
|
||||
}
|
||||
|
||||
} // ns Mirall
|
||||
|
||||
@@ -56,7 +56,6 @@ private:
|
||||
QString _user;
|
||||
QString _password;
|
||||
bool _ready;
|
||||
QMap<QNetworkReply*, int> _attempts;
|
||||
};
|
||||
|
||||
} // ns Mirall
|
||||
|
||||
30
src/main.cpp
@@ -14,8 +14,20 @@
|
||||
|
||||
#include "mirall/application.h"
|
||||
#include "mirall/theme.h"
|
||||
#include "mirall/utility.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QTimer>
|
||||
|
||||
void warnSystray()
|
||||
{
|
||||
QMessageBox::critical(0, qApp->translate("main.cpp", "System Tray not available"),
|
||||
qApp->translate("main.cpp", "%1 requires on a working system tray. "
|
||||
"If you are running XFCE, please follow "
|
||||
"<a href=\"http://docs.xfce.org/xfce/xfce4-panel/systray\">these instructions</a>. "
|
||||
"Otherwise, please install a system tray application such as 'trayer' and try again.")
|
||||
.arg(Mirall::Theme::instance()->appNameGUI()));
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
@@ -39,13 +51,17 @@ int main(int argc, char **argv)
|
||||
}
|
||||
return 0;
|
||||
} else {
|
||||
if (!QSystemTrayIcon::isSystemTrayAvailable()) {
|
||||
QMessageBox::critical(0, qApp->translate("main.cpp", "System Tray not available"),
|
||||
qApp->translate("main.cpp", "%1 requires on a working system tray. "
|
||||
"If you are running XFCE, please follow "
|
||||
"<a href=\"http://docs.xfce.org/xfce/xfce4-panel/systray\">these instructions</a>. "
|
||||
"Otherwise, please install a system tray application such as 'trayer' and try again.")
|
||||
.arg(Mirall::Theme::instance()->appNameGUI()));
|
||||
int attempts = 0;
|
||||
forever {
|
||||
if (!QSystemTrayIcon::isSystemTrayAvailable() && qgetenv("DESKTOP_SESSION") != "ubuntu") {
|
||||
Mirall::Utility::sleep(1);
|
||||
attempts++;
|
||||
if (attempts < 30) continue;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
warnSystray();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return app.exec();
|
||||
|
||||
@@ -35,19 +35,32 @@
|
||||
#include <QMessageBox>
|
||||
#include <QAction>
|
||||
#include <QKeySequence>
|
||||
#include <QIcon>
|
||||
#include <QVariant>
|
||||
|
||||
namespace Mirall {
|
||||
|
||||
static const char progressBarStyleC[] =
|
||||
"QProgressBar {"
|
||||
"border: 1px 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),
|
||||
_item(0)
|
||||
_wasDisabledBefore(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
_model = new FolderStatusModel;
|
||||
_model->setParent(this);
|
||||
FolderStatusDelegate *delegate = new FolderStatusDelegate;
|
||||
delegate->setParent(this);
|
||||
|
||||
ui->_folderList->setItemDelegate( delegate );
|
||||
ui->_folderList->setModel( _model );
|
||||
@@ -74,6 +87,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)));
|
||||
@@ -192,9 +207,9 @@ void AccountSettings::buttonsSetEnabled()
|
||||
ui->_ButtonInfo->setEnabled(isSelected);
|
||||
}
|
||||
|
||||
void AccountSettings::setListWidgetItem( QListWidgetItem *item )
|
||||
void AccountSettings::setGeneralErrors( const QStringList& errors )
|
||||
{
|
||||
_item = item;
|
||||
_generalErrors = errors;
|
||||
}
|
||||
|
||||
void AccountSettings::folderToModelItem( QStandardItem *item, Folder *f )
|
||||
@@ -204,22 +219,40 @@ 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();
|
||||
|
||||
QString errors = res.errorStrings().join(QLatin1String("<br/>"));
|
||||
QStringList errorList = res.errorStrings();
|
||||
|
||||
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( errors, FolderStatusDelegate::FolderErrorMsg );
|
||||
item->setData( theme->statusHeaderText( status ), FolderStatusDelegate::FolderStatus );
|
||||
|
||||
if( errorList.isEmpty() ) {
|
||||
if( (status == SyncResult::Error ||
|
||||
status == SyncResult::SetupError ||
|
||||
status == SyncResult::Unavailable )) {
|
||||
errorList << theme->statusHeaderText(status);
|
||||
}
|
||||
}
|
||||
|
||||
item->setData( errorList, FolderStatusDelegate::FolderErrorMsg);
|
||||
|
||||
bool ongoing = false;
|
||||
item->setData( QVariant(res.warnCount()), FolderStatusDelegate::WarningCount );
|
||||
@@ -234,6 +267,8 @@ void AccountSettings::slotRemoveCurrentFolder()
|
||||
{
|
||||
QModelIndex selected = ui->_folderList->selectionModel()->currentIndex();
|
||||
if( selected.isValid() ) {
|
||||
int row = selected.row();
|
||||
|
||||
QString alias = _model->data( selected, FolderStatusDelegate::FolderAliasRole ).toString();
|
||||
qDebug() << "Remove Folder alias " << alias;
|
||||
if( !alias.isEmpty() ) {
|
||||
@@ -247,9 +282,22 @@ void AccountSettings::slotRemoveCurrentFolder()
|
||||
if( ret == QMessageBox::No ) {
|
||||
return;
|
||||
}
|
||||
/* Remove the selected item from the timer hash. */
|
||||
QStandardItem *item = NULL;
|
||||
if( selected.isValid() )
|
||||
item = _model->itemFromIndex(selected);
|
||||
|
||||
if( selected.isValid() && item && _hideProgressTimers.contains(item) ) {
|
||||
QTimer *t = _hideProgressTimers[item];
|
||||
t->stop();
|
||||
_hideProgressTimers.remove(item);
|
||||
delete(t);
|
||||
}
|
||||
|
||||
FolderMan *folderMan = FolderMan::instance();
|
||||
folderMan->slotRemoveFolder( alias );
|
||||
setFolderList(folderMan->map());
|
||||
_model->removeRow(row);
|
||||
|
||||
emit folderChanged();
|
||||
slotCheckConnection();
|
||||
}
|
||||
@@ -285,6 +333,22 @@ void AccountSettings::slotDoubleClicked( const QModelIndex& indx )
|
||||
emit openFolderAlias( alias );
|
||||
}
|
||||
|
||||
void AccountSettings::showConnectionLabel( const QString& message, const QString& tooltip )
|
||||
{
|
||||
const QString errStyle = QLatin1String("color:#ffffff; background-color:#bb4d4d;padding:5px;"
|
||||
"border-width: 1px; border-style: solid; border-color: #aaaaaa;"
|
||||
"border-radius:5px;");
|
||||
if( _generalErrors.isEmpty() ) {
|
||||
ui->connectLabel->setText( message );
|
||||
ui->connectLabel->setToolTip(tooltip);
|
||||
} else {
|
||||
const QString msg = _generalErrors.join(QLatin1String("\n"));
|
||||
ui->connectLabel->setText( msg );
|
||||
ui->connectLabel->setToolTip(QString());
|
||||
ui->connectLabel->setStyleSheet(errStyle);
|
||||
}
|
||||
}
|
||||
|
||||
void AccountSettings::slotCheckConnection()
|
||||
{
|
||||
if( ownCloudInfo::instance()->isConfigured() ) {
|
||||
@@ -293,12 +357,12 @@ void AccountSettings::slotCheckConnection()
|
||||
connect(ownCloudInfo::instance(), SIGNAL(noOwncloudFound(QNetworkReply*)),
|
||||
this, SLOT(slotOCInfoFail(QNetworkReply*)));
|
||||
|
||||
ui->connectLabel->setText( tr("Checking %1 connection...").arg(Theme::instance()->appNameGUI()));
|
||||
showConnectionLabel( tr("Checking %1 connection...").arg(Theme::instance()->appNameGUI()));
|
||||
qDebug() << "Check status.php from statusdialog.";
|
||||
ownCloudInfo::instance()->checkInstallation();
|
||||
} else {
|
||||
// ownCloud is not yet configured.
|
||||
ui->connectLabel->setText( tr("No %1 connection configured.").arg(Theme::instance()->appNameGUI()));
|
||||
showConnectionLabel( tr("No %1 connection configured.").arg(Theme::instance()->appNameGUI()) );
|
||||
ui->_ButtonAdd->setEnabled( false);
|
||||
}
|
||||
}
|
||||
@@ -306,8 +370,14 @@ void AccountSettings::slotCheckConnection()
|
||||
void AccountSettings::setFolderList( const Folder::Map &folders )
|
||||
{
|
||||
_model->clear();
|
||||
|
||||
foreach(QTimer *t, _hideProgressTimers) {
|
||||
t->stop();
|
||||
delete t;
|
||||
}
|
||||
_hideProgressTimers.clear();
|
||||
|
||||
foreach( Folder *f, folders ) {
|
||||
qDebug() << "Folder: " << f;
|
||||
slotAddFolder( f );
|
||||
}
|
||||
|
||||
@@ -375,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 );
|
||||
@@ -425,8 +499,10 @@ 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) );
|
||||
ui->connectLabel->setToolTip( tr("Version: %1 (%2)").arg(versionStr).arg(version));
|
||||
QUrl safeUrl(url);
|
||||
safeUrl.setPassword(QString()); // Remove the password from the URL to avoid showing it in the UI
|
||||
showConnectionLabel( tr("Connected to <a href=\"%1\">%2</a>.").arg(url, safeUrl.toString()),
|
||||
tr("Version: %1 (%2)").arg(versionStr).arg(version) );
|
||||
ui->_ButtonAdd->setEnabled(true);
|
||||
|
||||
disconnect(ownCloudInfo::instance(), SIGNAL(ownCloudInfoFound(const QString&, const QString&, const QString&, const QString&)),
|
||||
@@ -440,7 +516,7 @@ void AccountSettings::slotOCInfoFail( QNetworkReply *reply)
|
||||
QString errStr = tr("unknown problem.");
|
||||
if( reply ) errStr = reply->errorString();
|
||||
|
||||
ui->connectLabel->setText( tr("<p>Failed to connect to %1: <tt>%2</tt></p>").arg(Theme::instance()->appNameGUI()).arg(errStr) );
|
||||
showConnectionLabel( tr("<p>Failed to connect to %1: <tt>%2</tt></p>").arg(Theme::instance()->appNameGUI()).arg(errStr) );
|
||||
ui->_ButtonAdd->setEnabled( false);
|
||||
|
||||
disconnect(ownCloudInfo::instance(), SIGNAL(ownCloudInfoFound(const QString&, const QString&, const QString&, const QString&)),
|
||||
@@ -513,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;
|
||||
@@ -527,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;
|
||||
@@ -629,12 +710,21 @@ void AccountSettings::slotHideProgress()
|
||||
while (i != _hideProgressTimers.constEnd()) {
|
||||
if( i.value() == send_timer ) {
|
||||
QStandardItem *item = i.key();
|
||||
item->setData( QVariant(false), FolderStatusDelegate::AddProgressSpace );
|
||||
item->setData( QVariant(QString::null), FolderStatusDelegate::SyncProgressOverallString );
|
||||
item->setData( QVariant(QString::null), FolderStatusDelegate::SyncProgressItemString );
|
||||
item->setData( 0, FolderStatusDelegate::SyncProgressOverallPercent );
|
||||
|
||||
ui->_folderList->repaint();
|
||||
/* Check if this item is still existing */
|
||||
bool ok = false;
|
||||
for( int r = 0; !ok && r < _model->rowCount(); r++) {
|
||||
if( item == _model->item(r,0) ) {
|
||||
ok = true;
|
||||
}
|
||||
}
|
||||
|
||||
if( ok ) {
|
||||
item->setData( QVariant(false), FolderStatusDelegate::AddProgressSpace );
|
||||
item->setData( QVariant(QString::null), FolderStatusDelegate::SyncProgressOverallString );
|
||||
item->setData( QVariant(QString::null), FolderStatusDelegate::SyncProgressItemString );
|
||||
item->setData( 0, FolderStatusDelegate::SyncProgressOverallPercent );
|
||||
}
|
||||
_hideProgressTimers.remove(item);
|
||||
break;
|
||||
}
|
||||
@@ -646,13 +736,23 @@ void AccountSettings::slotHideProgress()
|
||||
|
||||
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));
|
||||
QString usedStr = Utility::octetsToString(used);
|
||||
QString totalStr = Utility::octetsToString(total);
|
||||
ui->quotaLabel->setText(tr("%1 of %2 in use.").arg(usedStr, totalStr));
|
||||
if( total > 0 ) {
|
||||
ui->quotaProgressBar->setVisible(true);
|
||||
ui->quotaInfoLabel->setVisible(true);
|
||||
ui->quotaProgressBar->setEnabled(true);
|
||||
// workaround the label only accepting ints (which may be only 32 bit wide)
|
||||
ui->quotaProgressBar->setMaximum(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("%1 of %2 in use.").arg(usedStr, totalStr));
|
||||
} else {
|
||||
ui->quotaProgressBar->setVisible(false);
|
||||
ui->quotaInfoLabel->setVisible(false);
|
||||
ui->quotaLabel->setText(tr("Currently there is no storage usage information available."));
|
||||
}
|
||||
}
|
||||
|
||||
void AccountSettings::slotIgnoreFilesEditor()
|
||||
|
||||
@@ -51,7 +51,6 @@ public:
|
||||
|
||||
void setFolderList( const Folder::Map& );
|
||||
void buttonsSetEnabled();
|
||||
void setListWidgetItem(QListWidgetItem* item);
|
||||
|
||||
signals:
|
||||
void folderChanged();
|
||||
@@ -74,6 +73,8 @@ public slots:
|
||||
void slotUpdateQuota( qint64,qint64 );
|
||||
void slotIgnoreFilesEditor();
|
||||
|
||||
void setGeneralErrors( const QStringList& errors );
|
||||
|
||||
protected slots:
|
||||
void slotAddFolder();
|
||||
void slotAddFolder( Folder* );
|
||||
@@ -90,16 +91,17 @@ private:
|
||||
QString shortenFilename( const QString& folder, const QString& file ) const;
|
||||
void folderToModelItem( QStandardItem *, Folder * );
|
||||
QStandardItem* itemForFolder(const QString& );
|
||||
void showConnectionLabel( const QString& message, const QString& tooltip = QString() );
|
||||
|
||||
Ui::AccountSettings *ui;
|
||||
QPointer<ItemProgressDialog> _fileItemDialog;
|
||||
QPointer<IgnoreListEditor> _ignoreEditor;
|
||||
QStandardItemModel *_model;
|
||||
QListWidgetItem *_item;
|
||||
QUrl _OCUrl;
|
||||
QHash<QStandardItem*, QTimer*> _hideProgressTimers;
|
||||
QString _kindContext;
|
||||
|
||||
QStringList _generalErrors;
|
||||
bool _wasDisabledBefore;
|
||||
};
|
||||
|
||||
} // namespace Mirall
|
||||
|
||||
@@ -37,19 +37,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -144,7 +131,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<widget class="QLabel" name="quotaInfoLabel">
|
||||
<property name="text">
|
||||
<string><b>Note:</b> Some folders, including network mounted or shared folders, might have different limits.</string>
|
||||
</property>
|
||||
|
||||
@@ -16,12 +16,13 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "mirall/application.h"
|
||||
#include "mirall/systray.h"
|
||||
#include "mirall/folder.h"
|
||||
#include "mirall/folderman.h"
|
||||
#include "mirall/folderwatcher.h"
|
||||
#include "mirall/folderwizard.h"
|
||||
#include "mirall/networklocation.h"
|
||||
#include "mirall/folder.h"
|
||||
#include "mirall/owncloudsetupwizard.h"
|
||||
@@ -81,8 +82,7 @@ static const char optionsC[] =
|
||||
QString applicationTrPath()
|
||||
{
|
||||
#ifdef Q_OS_LINUX
|
||||
// FIXME - proper path!
|
||||
return QString::fromLatin1("/usr/share/%1/i18n/").arg(Theme::instance()->appName());
|
||||
return QString::fromLatin1(DATADIR"/"APPLICATION_EXECUTABLE"/i18n/");
|
||||
#endif
|
||||
#ifdef Q_OS_MAC
|
||||
return QApplication::applicationDirPath()+QLatin1String("/../Resources/Translations"); // path defaults to app dir.
|
||||
@@ -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() ));
|
||||
@@ -178,13 +181,13 @@ Application::Application(int &argc, char **argv) :
|
||||
connect( ownCloudInfo::instance(), SIGNAL(quotaUpdated(qint64,qint64)),
|
||||
SLOT(slotRefreshQuotaDisplay(qint64, qint64)));
|
||||
|
||||
connect (this, SIGNAL(aboutToQuit()), SLOT(slotCleanup()));
|
||||
|
||||
qDebug() << "Network Location: " << NetworkLocation::currentLocation().encoded();
|
||||
}
|
||||
|
||||
Application::~Application()
|
||||
{
|
||||
delete _tray; // needed, see ctor
|
||||
|
||||
qDebug() << "* Mirall shutdown";
|
||||
}
|
||||
|
||||
@@ -223,8 +226,24 @@ void Application::slotCredentialsFetched()
|
||||
runValidator();
|
||||
}
|
||||
|
||||
void Application::slotCleanup()
|
||||
{
|
||||
// explicitly close windows. This is somewhat of a hack to ensure
|
||||
// that saving the geometries happens ASAP during a OS shutdown
|
||||
|
||||
// those do delete on close
|
||||
if (!_settingsDialog.isNull()) _settingsDialog->close();
|
||||
if (!_progressDialog.isNull()) _progressDialog->close();
|
||||
|
||||
// those need an extra invitation
|
||||
if (!_tray.isNull()) _tray->deleteLater();
|
||||
if (!_logBrowser.isNull()) _logBrowser->deleteLater();
|
||||
}
|
||||
|
||||
void Application::runValidator()
|
||||
{
|
||||
_startupFail.clear();
|
||||
|
||||
_conValidator = new ConnectionValidator();
|
||||
connect( _conValidator, SIGNAL(connectionResult(ConnectionValidator::Status)),
|
||||
this, SLOT(slotConnectionValidatorResult(ConnectionValidator::Status)) );
|
||||
@@ -239,24 +258,25 @@ 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();
|
||||
slotShowTrayMessage(tr("%1 Sync Started").arg(_theme->appNameGUI()),
|
||||
slotShowOptionalTrayMessage(tr("%1 Sync Started").arg(_theme->appNameGUI()),
|
||||
tr("Sync started for %n configured sync folder(s).","", cnt));
|
||||
|
||||
// queue up the sync for all folders.
|
||||
folderMan->slotScheduleAllFolders();
|
||||
|
||||
computeOverallSyncStatus();
|
||||
|
||||
setupContextMenu();
|
||||
} else if( status == ConnectionValidator::NotConfigured ) {
|
||||
// this can not happen, it should be caught in first step of startup.
|
||||
} else {
|
||||
// What else?
|
||||
// if we have problems here, it's unlikely that syncing will work.
|
||||
FolderMan::instance()->setSyncEnabled(false);
|
||||
|
||||
_startupFail = _conValidator->errors();
|
||||
_startupNetworkError = _conValidator->networkError();
|
||||
QTimer::singleShot(30*1000, this, SLOT(slotCheckConnection()));
|
||||
}
|
||||
computeOverallSyncStatus();
|
||||
setupContextMenu();
|
||||
|
||||
_conValidator->deleteLater();
|
||||
}
|
||||
|
||||
@@ -341,7 +361,7 @@ void Application::setupSystemTray()
|
||||
_tray = new Systray();
|
||||
_tray->setIcon( _theme->syncStateIcon( SyncResult::NotYetStarted, true ) );
|
||||
|
||||
connect(_tray,SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
|
||||
connect(_tray.data(), SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
|
||||
SLOT(slotTrayClicked(QSystemTrayIcon::ActivationReason)));
|
||||
|
||||
setupContextMenu();
|
||||
@@ -408,7 +428,9 @@ void Application::setupContextMenu()
|
||||
_contextMenu->addMenu(_recentActionsMenu);
|
||||
_contextMenu->addSeparator();
|
||||
_contextMenu->addAction(_actionSettings);
|
||||
_contextMenu->addAction(_actionHelp);
|
||||
if (!_theme->helpUrl().isEmpty()) {
|
||||
_contextMenu->addAction(_actionHelp);
|
||||
}
|
||||
_contextMenu->addSeparator();
|
||||
|
||||
_contextMenu->addAction(_actionQuit);
|
||||
@@ -417,7 +439,7 @@ void Application::setupContextMenu()
|
||||
void Application::setupLogBrowser()
|
||||
{
|
||||
// might be called from second instance
|
||||
if (!_logBrowser) {
|
||||
if (_logBrowser.isNull()) {
|
||||
// init the log browser.
|
||||
qInstallMsgHandler( mirallLogCatcher );
|
||||
_logBrowser = new LogBrowser;
|
||||
@@ -495,6 +517,7 @@ void Application::slotSetupProxy()
|
||||
|
||||
switch(proxyType) {
|
||||
case QNetworkProxy::NoProxy:
|
||||
QNetworkProxyFactory::setUseSystemConfiguration(false);
|
||||
QNetworkProxy::setApplicationProxy(QNetworkProxy::NoProxy);
|
||||
break;
|
||||
case QNetworkProxy::DefaultProxy:
|
||||
@@ -502,15 +525,20 @@ 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:
|
||||
break;
|
||||
}
|
||||
|
||||
FolderMan::instance()->setDirtyProxy(true);
|
||||
FolderMan::instance()->slotScheduleAllFolders();
|
||||
}
|
||||
|
||||
void Application::slotRefreshQuotaDisplay( qint64 total, qint64 used )
|
||||
@@ -552,9 +580,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");
|
||||
|
||||
@@ -651,7 +679,7 @@ bool Application::checkConfigExists(bool openSettings)
|
||||
// if no config file is there, start the configuration wizard.
|
||||
MirallConfigFile cfgFile;
|
||||
|
||||
if( cfgFile.exists() ) {
|
||||
if( cfgFile.exists() && !cfgFile.ownCloudUrl().isEmpty() ) {
|
||||
if( openSettings ) {
|
||||
slotSettings();
|
||||
}
|
||||
@@ -683,7 +711,9 @@ void Application::slotSettings()
|
||||
_settingsDialog->setAttribute( Qt::WA_DeleteOnClose, true );
|
||||
_settingsDialog->show();
|
||||
}
|
||||
Utility::raiseDialog(_settingsDialog);
|
||||
|
||||
_settingsDialog->setGeneralErrors( _startupFail );
|
||||
Utility::raiseDialog(_settingsDialog.data());
|
||||
}
|
||||
|
||||
void Application::slotItemProgressDialog()
|
||||
@@ -694,7 +724,7 @@ void Application::slotItemProgressDialog()
|
||||
_progressDialog->setupList();
|
||||
_progressDialog->show();
|
||||
}
|
||||
Utility::raiseDialog(_progressDialog);
|
||||
Utility::raiseDialog(_progressDialog.data());
|
||||
}
|
||||
|
||||
void Application::slotParseOptions(const QString &opts)
|
||||
@@ -805,23 +835,36 @@ void Application::computeOverallSyncStatus()
|
||||
Folder::Map map = folderMan->map();
|
||||
SyncResult overallResult = FolderMan::accountStatus(map.values());
|
||||
|
||||
// create the tray blob message, check if we have an defined state
|
||||
if( overallResult.status() != SyncResult::Undefined ) {
|
||||
QStringList allStatusStrings;
|
||||
foreach(Folder* folder, map.values()) {
|
||||
qDebug() << "Folder in overallStatus Message: " << folder << " with name " << folder->alias();
|
||||
QString folderMessage = folderMan->statusToString(folder->syncResult().status(), folder->syncEnabled());
|
||||
allStatusStrings += tr("Folder %1: %2").arg(folder->alias(), folderMessage);
|
||||
// if there have been startup problems, show an error message.
|
||||
if( !_startupFail.isEmpty() ) {
|
||||
trayMessage = _startupFail.join(QLatin1String("\n"));
|
||||
QIcon statusIcon;
|
||||
if (_startupNetworkError) {
|
||||
statusIcon = _theme->syncStateIcon( SyncResult::NotYetStarted, true );
|
||||
} else {
|
||||
statusIcon = _theme->syncStateIcon( SyncResult::Error, true );
|
||||
}
|
||||
|
||||
if( ! allStatusStrings.isEmpty() )
|
||||
trayMessage = allStatusStrings.join(QLatin1String("\n"));
|
||||
else
|
||||
trayMessage = tr("No sync folders configured.");
|
||||
|
||||
QIcon statusIcon = _theme->syncStateIcon( overallResult.status(), true);
|
||||
_tray->setIcon( statusIcon );
|
||||
_tray->setToolTip(trayMessage);
|
||||
} else {
|
||||
// create the tray blob message, check if we have an defined state
|
||||
if( overallResult.status() != SyncResult::Undefined ) {
|
||||
QStringList allStatusStrings;
|
||||
foreach(Folder* folder, map.values()) {
|
||||
qDebug() << "Folder in overallStatus Message: " << folder << " with name " << folder->alias();
|
||||
QString folderMessage = folderMan->statusToString(folder->syncResult().status(), folder->syncEnabled());
|
||||
allStatusStrings += tr("Folder %1: %2").arg(folder->alias(), folderMessage);
|
||||
}
|
||||
|
||||
if( ! allStatusStrings.isEmpty() )
|
||||
trayMessage = allStatusStrings.join(QLatin1String("\n"));
|
||||
else
|
||||
trayMessage = tr("No sync folders configured.");
|
||||
|
||||
QIcon statusIcon = _theme->syncStateIcon( overallResult.status(), true);
|
||||
_tray->setIcon( statusIcon );
|
||||
_tray->setToolTip(trayMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ namespace Mirall {
|
||||
class Theme;
|
||||
class Folder;
|
||||
class FolderWatcher;
|
||||
class FolderWizard;
|
||||
class ownCloudInfo;
|
||||
class SslErrorDialog;
|
||||
class SettingsDialog;
|
||||
@@ -107,13 +106,14 @@ protected slots:
|
||||
void slotDisplayIdle();
|
||||
void slotHelp();
|
||||
void slotCredentialsFetched();
|
||||
void slotCleanup();
|
||||
private:
|
||||
void setHelp();
|
||||
void raiseDialog( QWidget* );
|
||||
void rebuildRecentMenus();
|
||||
void runValidator();
|
||||
|
||||
Systray *_tray;
|
||||
QPointer<Systray> _tray;
|
||||
QAction *_actionOpenoC;
|
||||
QAction *_actionSettings;
|
||||
QAction *_actionQuota;
|
||||
@@ -124,7 +124,6 @@ private:
|
||||
|
||||
QNetworkConfigurationManager *_networkMgr;
|
||||
|
||||
QPointer<FolderWizard> _folderWizard;
|
||||
SslErrorDialog *_sslErrorDialog;
|
||||
ConnectionValidator *_conValidator;
|
||||
|
||||
@@ -134,12 +133,14 @@ private:
|
||||
|
||||
Theme *_theme;
|
||||
QSignalMapper *_folderOpenActionMapper;
|
||||
LogBrowser *_logBrowser;
|
||||
QPointer<LogBrowser>_logBrowser;
|
||||
QPointer<SettingsDialog> _settingsDialog;
|
||||
QPointer<ItemProgressDialog> _progressDialog;
|
||||
|
||||
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;
|
||||
@@ -89,6 +95,7 @@ void ConnectionValidator::checkConnection()
|
||||
// checks for status.php
|
||||
ownCloudInfo::instance()->checkInstallation();
|
||||
} else {
|
||||
_errors << tr("No ownCloud connection configured");
|
||||
emit connectionResult( NotConfigured );
|
||||
}
|
||||
}
|
||||
@@ -109,8 +116,8 @@ void ConnectionValidator::slotStatusFound( const QString& url, const QString& ve
|
||||
this, SLOT(slotNoStatusFound(QNetworkReply*)));
|
||||
|
||||
if( version.startsWith("4.0") ) {
|
||||
_errors.append( tr("<p>The configured server for this client is too old.</p>"
|
||||
"<p>Please update to the latest server and restart the client.</p>"));
|
||||
_errors.append( tr("The configured server for this client is too old") );
|
||||
_errors.append( tr("Please update to the latest server and restart the client.") );
|
||||
emit connectionResult( ServerVersionMismatch );
|
||||
return;
|
||||
}
|
||||
@@ -129,6 +136,7 @@ void ConnectionValidator::slotNoStatusFound(QNetworkReply *reply)
|
||||
this, SLOT(slotNoStatusFound(QNetworkReply*)));
|
||||
|
||||
_errors.append( reply->errorString() );
|
||||
_networkError = (reply->error() != QNetworkReply::NoError);
|
||||
emit connectionResult( StatusNotFound );
|
||||
|
||||
}
|
||||
@@ -144,15 +152,17 @@ void ConnectionValidator::slotCheckAuthentication()
|
||||
// continue in slotAuthCheck here :-)
|
||||
}
|
||||
|
||||
void ConnectionValidator::slotAuthCheck( const QString& ,QNetworkReply *reply )
|
||||
void ConnectionValidator::slotAuthCheck( const QString&, QNetworkReply *reply )
|
||||
{
|
||||
Status stat = Connected;
|
||||
|
||||
if( reply->error() == QNetworkReply::AuthenticationRequiredError ||
|
||||
reply->error() == QNetworkReply::OperationCanceledError ) { // returned if the user is wrong.
|
||||
qDebug() << "******** Password is wrong!";
|
||||
_errors << "The provided credentials are wrong.";
|
||||
_errors << tr("The provided credentials are not correct");
|
||||
stat = CredentialsWrong;
|
||||
} else if( reply->error() != QNetworkReply::NoError ) {
|
||||
_errors << reply->errorString();
|
||||
}
|
||||
|
||||
// disconnect from ownCloud Info signals
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -140,26 +140,26 @@ QString CSyncThread::csyncErrorToString( CSYNC_ERROR_CODE err, const char *errSt
|
||||
errStr = tr("A HTTP transmission error happened.");
|
||||
break;
|
||||
case CSYNC_ERR_PERM:
|
||||
errStr = tr("CSync failed due to not handled permission deniend.");
|
||||
errStr = tr("CSync: Permission deniend.");
|
||||
break;
|
||||
case CSYNC_ERR_NOT_FOUND:
|
||||
errStr = tr("CSync failed to find a specific file.");
|
||||
errStr = tr("CSync: File not found.");
|
||||
break;
|
||||
case CSYNC_ERR_EXISTS:
|
||||
errStr = tr("CSync tried to create a directory that already exists.");
|
||||
errStr = tr("CSync: Directory already exists.");
|
||||
break;
|
||||
case CSYNC_ERR_NOSPC:
|
||||
errStr = tr("CSync: No space on %1 server available.").arg(Theme::instance()->appNameGUI());
|
||||
errStr = tr("CSync: No space left on %1 server.").arg(Theme::instance()->appNameGUI());
|
||||
break;
|
||||
case CSYNC_ERR_UNSPEC:
|
||||
errStr = tr("CSync unspecified error.");
|
||||
errStr = tr("CSync: unspecified error.");
|
||||
|
||||
default:
|
||||
errStr = tr("An internal error number %1 happend.").arg( (int) err );
|
||||
}
|
||||
|
||||
if( errString ) {
|
||||
errStr += tr("<br/>Backend Message: ")+QString::fromUtf8(errString);
|
||||
errStr += tr(" Backend Message: ")+QString::fromUtf8(errString);
|
||||
}
|
||||
return errStr;
|
||||
|
||||
@@ -187,7 +187,9 @@ int CSyncThread::treewalkFile( TREE_WALK_FILE *file, bool remote )
|
||||
item._file = QString::fromUtf8( file->path );
|
||||
item._instruction = file->instruction;
|
||||
item._dir = SyncFileItem::None;
|
||||
|
||||
if(file->error_string) {
|
||||
item._errorString = QString::fromUtf8(file->error_string);
|
||||
}
|
||||
SyncFileItem::Direction dir;
|
||||
|
||||
int re = 0;
|
||||
|
||||
@@ -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());
|
||||
@@ -111,6 +114,7 @@ bool Folder::init()
|
||||
}
|
||||
return _csync_ctx;
|
||||
}
|
||||
|
||||
Folder::~Folder()
|
||||
{
|
||||
if( _thread ) {
|
||||
@@ -196,19 +200,33 @@ bool Folder::syncEnabled() const
|
||||
void Folder::setSyncEnabled( bool doit )
|
||||
{
|
||||
_enabled = doit;
|
||||
_watcher->setEventsEnabled( doit );
|
||||
|
||||
qDebug() << "setSyncEnabled - ############################ " << doit;
|
||||
if( doit ) {
|
||||
// undefined until next sync
|
||||
_syncResult.setStatus( SyncResult::NotYetStarted);
|
||||
_syncResult.clearErrors();
|
||||
evaluateSync( QStringList() );
|
||||
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 {
|
||||
// disable folder. Done through the _enabled-flag set above
|
||||
// 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);
|
||||
@@ -221,12 +239,17 @@ 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,10 @@ void Folder::slotPollTimerTimeout()
|
||||
{
|
||||
qDebug() << "* Polling" << alias() << "for changes. (time since next sync:" << (_timeSinceLastSync.elapsed() / 1000) << "s)";
|
||||
|
||||
if (quint64(_timeSinceLastSync.elapsed()) > MirallConfigFile().forceSyncInterval()) {
|
||||
qDebug() << "* Force Sync now";
|
||||
// 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::Problem)) {
|
||||
qDebug() << "** Force Sync now";
|
||||
evaluateSync(QStringList());
|
||||
} else {
|
||||
RequestEtagJob* job = new RequestEtagJob(secondPath(), this);
|
||||
@@ -283,9 +308,13 @@ void Folder::bubbleUpSyncResult()
|
||||
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->postOptionalGuiLog(tr("File %1").arg(item._file), item._errorString);
|
||||
|
||||
} else {
|
||||
if (item._dir == SyncFileItem::Down) {
|
||||
switch (item._instruction) {
|
||||
@@ -293,11 +322,21 @@ void Folder::bubbleUpSyncResult()
|
||||
newItems++;
|
||||
if (firstItemNew.isEmpty())
|
||||
firstItemNew = item;
|
||||
|
||||
if (item._type == SyncFileItem::Directory) {
|
||||
_watcher->addPath(path() + item._file);
|
||||
}
|
||||
|
||||
break;
|
||||
case CSYNC_INSTRUCTION_REMOVE:
|
||||
removedItems++;
|
||||
if (firstItemDeleted.isEmpty())
|
||||
firstItemDeleted = item;
|
||||
|
||||
if (item._type == SyncFileItem::Directory) {
|
||||
_watcher->removePath(path() + item._file);
|
||||
}
|
||||
|
||||
break;
|
||||
case CSYNC_INSTRUCTION_UPDATED:
|
||||
updatedItems++;
|
||||
@@ -321,31 +360,29 @@ void Folder::bubbleUpSyncResult()
|
||||
|
||||
_syncResult.setWarnCount(ignoredItems);
|
||||
|
||||
Logger *logger = Logger::instance();
|
||||
|
||||
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));
|
||||
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));
|
||||
}
|
||||
}
|
||||
@@ -387,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()
|
||||
@@ -420,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
|
||||
@@ -486,9 +524,22 @@ void Folder::setProxy()
|
||||
csync_set_module_property(_csync_ctx, "proxy_port", &proxyPort );
|
||||
csync_set_module_property(_csync_ctx, "proxy_user", proxy.user().toUtf8().data() );
|
||||
csync_set_module_property(_csync_ctx, "proxy_pwd" , proxy.password().toUtf8().data() );
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -524,6 +575,8 @@ void Folder::startSync(const QStringList &pathList)
|
||||
QMetaObject::invokeMethod(this, "slotCSyncFinished", Qt::QueuedConnection);
|
||||
return;
|
||||
}
|
||||
} else if (proxyDirty()) {
|
||||
setProxy();
|
||||
}
|
||||
|
||||
if (_thread && _thread->isRunning()) {
|
||||
@@ -545,7 +598,6 @@ void Folder::startSync(const QStringList &pathList)
|
||||
|
||||
qDebug() << "*** Start syncing";
|
||||
_thread = new QThread(this);
|
||||
_thread->setPriority(QThread::LowPriority);
|
||||
setIgnoredFiles();
|
||||
_csync = new CSyncThread( _csync_ctx );
|
||||
_csync->moveToThread(_thread);
|
||||
@@ -568,6 +620,7 @@ void Folder::startSync(const QStringList &pathList)
|
||||
connect(_csync, SIGNAL(transmissionProgress(Progress::Info)), this, SLOT(slotTransmissionProgress(Progress::Info)));
|
||||
|
||||
_thread->start();
|
||||
_thread->setPriority(QThread::LowPriority);
|
||||
QMetaObject::invokeMethod(_csync, "startSync", Qt::QueuedConnection);
|
||||
|
||||
// disable events until syncing is done
|
||||
@@ -596,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;
|
||||
|
||||
@@ -269,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.";
|
||||
@@ -278,7 +278,8 @@ void FolderMan::slotEnableFolder( const QString& alias, bool enable )
|
||||
|
||||
Folder *f = _folderMap[alias];
|
||||
if( f ) {
|
||||
f->setSyncEnabled(enable);
|
||||
f->slotSetSyncUserEnabled(enable);
|
||||
f->evaluateSync(QStringList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -360,6 +361,10 @@ void FolderMan::setSyncEnabled( bool enabled )
|
||||
QTimer::singleShot(200, this, SLOT(slotScheduleFolderSync()));
|
||||
}
|
||||
_syncEnabled = enabled;
|
||||
|
||||
foreach( Folder *f, _folderMap.values() ) {
|
||||
f->setSyncEnabled(enabled);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -385,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() );
|
||||
}
|
||||
}
|
||||
@@ -466,7 +471,10 @@ void FolderMan::removeFolder( const QString& alias )
|
||||
qDebug() << "Remove folder config file " << file.fileName();
|
||||
file.remove();
|
||||
}
|
||||
f->deleteLater();
|
||||
// FIXME: this is a temporar dirty fix against a crash happening because
|
||||
// the csync owncloud module still has static components. Activate the
|
||||
// delete once the module is fixed.
|
||||
// f->deleteLater();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -512,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);
|
||||
@@ -537,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 );
|
||||
@@ -548,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,6 +109,8 @@ public slots:
|
||||
|
||||
void slotScheduleAllFolders();
|
||||
|
||||
void setDirtyProxy(bool value = true);
|
||||
|
||||
private slots:
|
||||
// slot to add a folder to the syncing queue
|
||||
void slotScheduleSync( const QString & );
|
||||
@@ -136,6 +138,7 @@ private:
|
||||
QString _currentSyncFolder;
|
||||
bool _syncEnabled;
|
||||
QQueue<QString> _scheduleQueue;
|
||||
bool _dirtyProxy; // If the proxy need to be re-configured
|
||||
|
||||
explicit FolderMan(QObject *parent = 0);
|
||||
static FolderMan *_instance;
|
||||
|
||||
@@ -81,8 +81,9 @@ QSize FolderStatusDelegate::sizeHint(const QStyleOptionViewItem & option ,
|
||||
h += aliasMargin; // bottom margin
|
||||
|
||||
// add some space to show an error condition.
|
||||
if( ! qvariant_cast<QString>(index.data(FolderErrorMsg)).isEmpty() ) {
|
||||
h += aliasMargin*2+fm.height();
|
||||
if( ! qvariant_cast<QStringList>(index.data(FolderErrorMsg)).isEmpty() ) {
|
||||
QStringList errMsgs = qvariant_cast<QStringList>(index.data(FolderErrorMsg));
|
||||
h += aliasMargin*2 + errMsgs.count()*fm.height();
|
||||
}
|
||||
|
||||
if( qvariant_cast<bool>(index.data(AddProgressSpace)) ) {
|
||||
@@ -122,7 +123,7 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
|
||||
QString aliasText = qvariant_cast<QString>(index.data(FolderAliasRole));
|
||||
QString pathText = qvariant_cast<QString>(index.data(FolderPathRole));
|
||||
QString remotePath = qvariant_cast<QString>(index.data(FolderSecondPathRole));
|
||||
QString errorText = qvariant_cast<QString>(index.data(FolderErrorMsg));
|
||||
QStringList errorTexts= qvariant_cast<QStringList>(index.data(FolderErrorMsg));
|
||||
|
||||
int overallPercent = qvariant_cast<int>(index.data(SyncProgressOverallPercent));
|
||||
QString overallString = qvariant_cast<QString>(index.data(SyncProgressOverallString));
|
||||
@@ -211,12 +212,12 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
|
||||
// paint an error overlay if there is an error string
|
||||
|
||||
int h = iconRect.bottom();
|
||||
if( !errorText.isEmpty() ) {
|
||||
if( !errorTexts.isEmpty() ) {
|
||||
h += aliasMargin;
|
||||
QRect errorRect = localPathRect;
|
||||
errorRect.setLeft( iconRect.left());
|
||||
errorRect.setTop( h );
|
||||
errorRect.setHeight(subFm.height()+aliasMargin);
|
||||
errorRect.setHeight(errorTexts.count() * subFm.height()+aliasMargin);
|
||||
errorRect.setRight( option.rect.right()-aliasMargin );
|
||||
|
||||
painter->setBrush( QColor(0xbb, 0x4d, 0x4d) );
|
||||
@@ -226,15 +227,16 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
|
||||
painter->setPen( Qt::white );
|
||||
painter->setFont(errorFont);
|
||||
QRect errorTextRect = errorRect;
|
||||
errorTextRect.setLeft( errorTextRect.left()+aliasMargin +16);
|
||||
errorTextRect.setLeft( errorTextRect.left()+aliasMargin );
|
||||
errorTextRect.setTop( errorTextRect.top()+aliasMargin/2 );
|
||||
|
||||
int linebreak = errorText.indexOf(QLatin1String("<br"));
|
||||
QString eText = errorText;
|
||||
if(linebreak) {
|
||||
eText = errorText.left(linebreak);
|
||||
int x = errorTextRect.left();
|
||||
int y = errorTextRect.top()+aliasMargin/2 + subFm.height()/2;
|
||||
|
||||
foreach( QString eText, errorTexts ) {
|
||||
painter->drawText(x, y, subFm.elidedText( eText, Qt::ElideLeft, errorTextRect.width()-2*aliasMargin));
|
||||
y += subFm.height();
|
||||
}
|
||||
painter->drawText(errorTextRect, eText);
|
||||
|
||||
h = errorRect.bottom();
|
||||
}
|
||||
@@ -243,14 +245,14 @@ 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();
|
||||
|
||||
// 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;
|
||||
@@ -260,6 +262,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;
|
||||
@@ -278,8 +281,8 @@ 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
|
||||
QRect fileRect;
|
||||
@@ -287,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);
|
||||
}
|
||||
}
|
||||
@@ -172,5 +172,16 @@ void FolderWatcher::changeDetected(const QString& f)
|
||||
setProcessTimer();
|
||||
}
|
||||
|
||||
void FolderWatcher::addPath(const QString &path )
|
||||
{
|
||||
_d->addPath(path);
|
||||
}
|
||||
|
||||
void FolderWatcher::removePath(const QString &path )
|
||||
{
|
||||
_d->removePath(path);
|
||||
}
|
||||
|
||||
|
||||
} // namespace Mirall
|
||||
|
||||
|
||||
@@ -88,6 +88,15 @@ public:
|
||||
void setEventInterval(int seconds);
|
||||
|
||||
QStringList ignores() const;
|
||||
|
||||
/**
|
||||
* Not all backends are recursive by default.
|
||||
* Those need to be notified when a directory is added or removed while the watcher is disabled.
|
||||
* This is a no-op for backend that are recursive
|
||||
*/
|
||||
void addPath(const QString&);
|
||||
void removePath(const QString&);
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* Enabled or disables folderChanged() events.
|
||||
|
||||
@@ -50,8 +50,7 @@ void FolderWatcherPrivate::slotAddFolderRecursive(const QString &path)
|
||||
qDebug() << "(+) Watcher:" << path;
|
||||
|
||||
if (!_inotify->addPath(path)) {
|
||||
FolderWatcher *fw = qobject_cast<FolderWatcher*>(parent());
|
||||
emit fw->error(tr("Could not monitor directories due to system limitations.\n"
|
||||
emit _parent->error(tr("Could not monitor directories due to system limitations.\n"
|
||||
"The application will not work reliably. Please check the\n"
|
||||
"documentation for possible fixes."));
|
||||
}
|
||||
@@ -119,9 +118,8 @@ void FolderWatcherPrivate::slotINotifyEvent(int mask, int /*cookie*/, const QStr
|
||||
}
|
||||
else if (mask & IN_DELETE) {
|
||||
//qDebug() << cookie << " DELETE: " << path;
|
||||
if ( QFileInfo(path).isDir() && _inotify->directories().contains(path) ) {
|
||||
qDebug() << "(-) Watcher:" << path;
|
||||
_inotify->removePath(path);
|
||||
if ( QFileInfo(path).isDir() ) {
|
||||
removePath(path);
|
||||
}
|
||||
}
|
||||
else if (mask & IN_CLOSE_WRITE) {
|
||||
@@ -134,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);
|
||||
|
||||
@@ -160,4 +167,13 @@ void FolderWatcherPrivate::slotINotifyEvent(int mask, int /*cookie*/, const QStr
|
||||
_parent->setProcessTimer();
|
||||
}
|
||||
|
||||
void FolderWatcherPrivate::removePath(const QString &path )
|
||||
{
|
||||
if (_inotify->directories().contains(path) ) {
|
||||
qDebug() << "(-) Watcher:" << path;
|
||||
_inotify->removePath(path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // namespace Mirall
|
||||
|
||||
@@ -26,6 +26,8 @@ class FolderWatcherPrivate : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
FolderWatcherPrivate(FolderWatcher *p);
|
||||
void addPath(const QString &path) { slotAddFolderRecursive(path); }
|
||||
void removePath(const QString &);
|
||||
signals:
|
||||
void error(const QString& error);
|
||||
private slots:
|
||||
|
||||
@@ -31,6 +31,9 @@ public:
|
||||
FolderWatcherPrivate(FolderWatcher *p);
|
||||
~FolderWatcherPrivate();
|
||||
|
||||
void addPath(const QString &) {}
|
||||
void removePath(const QString &) {}
|
||||
|
||||
void startWatching();
|
||||
void doNotifyParent();
|
||||
|
||||
|
||||
@@ -48,6 +48,10 @@ class FolderWatcherPrivate : public QObject {
|
||||
public:
|
||||
FolderWatcherPrivate(FolderWatcher *p);
|
||||
~FolderWatcherPrivate();
|
||||
|
||||
void addPath(const QString &) {}
|
||||
void removePath(const QString &) {}
|
||||
|
||||
private:
|
||||
FolderWatcher *_parent;
|
||||
WatcherThread *_thread;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
*/
|
||||
|
||||
#include "mirall/folderwizard.h"
|
||||
#include "mirall/folderman.h"
|
||||
#include "mirall/owncloudinfo.h"
|
||||
#include "mirall/mirallconfigfile.h"
|
||||
#include "mirall/theme.h"
|
||||
@@ -242,6 +243,7 @@ static void recursiveInsert(QTreeWidgetItem *parent, QStringList pathTrail, QStr
|
||||
item = new QTreeWidgetItem(parent);
|
||||
item->setIcon(0, folderIcon);
|
||||
item->setText(0, pathTrail.first());
|
||||
item->setData(0, Qt::UserRole, pathTrail.first());
|
||||
item->setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);
|
||||
}
|
||||
|
||||
@@ -252,17 +254,13 @@ static void recursiveInsert(QTreeWidgetItem *parent, QStringList pathTrail, QStr
|
||||
|
||||
void FolderWizardTargetPage::slotUpdateDirectories(QStringList list)
|
||||
{
|
||||
QFileIconProvider prov;
|
||||
QIcon folderIcon = prov.icon(QFileIconProvider::Folder);
|
||||
|
||||
QString webdavFolder = QUrl(ownCloudInfo::instance()->webdavUrl()).path();
|
||||
connect(_ui.folderTreeWidget, SIGNAL(itemExpanded(QTreeWidgetItem*)), SLOT(slotItemExpanded(QTreeWidgetItem*)));
|
||||
|
||||
QTreeWidgetItem *root = _ui.folderTreeWidget->topLevelItem(0);
|
||||
if (!root) {
|
||||
root = new QTreeWidgetItem(_ui.folderTreeWidget);
|
||||
root->setText(0, tr("Root (\"/\")", "root folder"));
|
||||
root->setIcon(0, folderIcon);
|
||||
root->setText(0, Theme::instance()->appNameGUI());
|
||||
root->setIcon(0, Theme::instance()->applicationIcon());
|
||||
root->setToolTip(0, tr("Choose this to sync the entire account"));
|
||||
root->setData(0, Qt::UserRole, "/");
|
||||
}
|
||||
@@ -283,7 +281,7 @@ void FolderWizardTargetPage::slotRefreshFolders()
|
||||
|
||||
void FolderWizardTargetPage::slotItemExpanded(QTreeWidgetItem *item)
|
||||
{
|
||||
ownCloudInfo::instance()->getDirectoryListing(item->text(0));
|
||||
ownCloudInfo::instance()->getDirectoryListing(item->data(0, Qt::UserRole).toString());
|
||||
}
|
||||
|
||||
FolderWizardTargetPage::~FolderWizardTargetPage()
|
||||
@@ -298,6 +296,22 @@ bool FolderWizardTargetPage::isComplete() const
|
||||
QString dir = _ui.folderTreeWidget->currentItem()->data(0, Qt::UserRole).toString();
|
||||
wizard()->setProperty("targetPath", dir);
|
||||
|
||||
Folder::Map map = _folderMap;
|
||||
Folder::Map::const_iterator i = map.constBegin();
|
||||
for(i = map.constBegin();i != map.constEnd(); i++ ) {
|
||||
Folder *f = static_cast<Folder*>(i.value());
|
||||
QString curDir = f->secondPath();
|
||||
if (dir == curDir) {
|
||||
showWarn( tr("This directory is already being synced.") );
|
||||
return false;
|
||||
} else if (dir.startsWith(curDir)) {
|
||||
if (dir.isEmpty()) dir = QLatin1Char('/');
|
||||
if (curDir.isEmpty()) curDir = QLatin1Char('/');
|
||||
showWarn( tr("You are already syncing <i>%1</i>, which is a parent folder of <i>%2</i>.").arg(curDir).arg(dir) );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if( dir == QLatin1String("/") ) {
|
||||
showWarn( tr("If you sync the root folder, you can <b>not</b> configure another sync directory."));
|
||||
return true;
|
||||
@@ -325,6 +339,8 @@ void FolderWizardTargetPage::initializePage()
|
||||
SLOT(slotCreateRemoteFolderFinished( QNetworkReply::NetworkError )));
|
||||
connect( ocInfo, SIGNAL(directoryListingUpdated(QStringList)),
|
||||
SLOT(slotUpdateDirectories(QStringList)));
|
||||
connect(_ui.folderTreeWidget, SIGNAL(itemExpanded(QTreeWidgetItem*)),
|
||||
SLOT(slotItemExpanded(QTreeWidgetItem*)));
|
||||
|
||||
slotRefreshFolders();
|
||||
}
|
||||
@@ -370,6 +386,7 @@ FolderWizard::~FolderWizard()
|
||||
void FolderWizard::setFolderMap( const Folder::Map& fm)
|
||||
{
|
||||
_folderWizardSourcePage->setFolderMap( fm );
|
||||
_folderWizardTargetPage->setFolderMap( fm );
|
||||
}
|
||||
|
||||
} // end namespace
|
||||
|
||||
@@ -69,6 +69,8 @@ public:
|
||||
virtual void initializePage();
|
||||
virtual void cleanupPage();
|
||||
|
||||
void setFolderMap( const Folder::Map &fm ) { _folderMap = fm; }
|
||||
|
||||
protected slots:
|
||||
|
||||
void showWarn( const QString& = QString() ) const;
|
||||
@@ -83,6 +85,7 @@ private:
|
||||
ownCloudInfo *_ownCloudDirCheck;
|
||||
bool _dirChecked;
|
||||
bool _warnWasVisible;
|
||||
Folder::Map _folderMap;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -53,12 +53,9 @@ GeneralSettings::GeneralSettings(QWidget *parent) :
|
||||
|
||||
// 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/")
|
||||
QString themeDir = QString::fromLatin1(":/mirall/theme/%1/")
|
||||
.arg(Theme::instance()->systrayIconFlavor(true));
|
||||
if (QDir(themeDir).exists())
|
||||
{
|
||||
_ui->monoIconsCheckBox->setVisible(false);
|
||||
}
|
||||
_ui->monoIconsCheckBox->setVisible(QDir(themeDir).exists());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
@@ -103,8 +104,11 @@ void ItemProgressDialog::setSyncResult( const SyncResult& result )
|
||||
for (i = items.begin(); i != items.end(); ++i) {
|
||||
const SyncFileItem& item = *i;
|
||||
QString errMsg;
|
||||
QString tooltip;
|
||||
// handle ignored files here.
|
||||
if( item._instruction == CSYNC_INSTRUCTION_IGNORE ) {
|
||||
|
||||
if( item._instruction == CSYNC_INSTRUCTION_IGNORE
|
||||
|| item._instruction == CSYNC_INSTRUCTION_CONFLICT ) {
|
||||
QStringList columns;
|
||||
QString timeStr = timeString(dt);
|
||||
QString longTimeStr = timeString(dt, QLocale::LongFormat);
|
||||
@@ -112,22 +116,47 @@ void ItemProgressDialog::setSyncResult( const SyncResult& result )
|
||||
columns << timeStr;
|
||||
columns << item._file;
|
||||
columns << folder;
|
||||
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.");
|
||||
if( item._instruction == CSYNC_INSTRUCTION_IGNORE) {
|
||||
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 {
|
||||
QString obj = tr("file");
|
||||
if( item._type == SyncFileItem::Directory ) {
|
||||
obj = tr("directory");
|
||||
}
|
||||
tooltip = tr("The %1 was ignored because it is listed in the clients ignore list\n"
|
||||
"or the %1 name contains characters that are not syncable\nin a cross platform "
|
||||
"environment").arg(obj);
|
||||
errMsg = tr("Item ignored");
|
||||
if( item._errorString == QLatin1String("File listed on ignore list.") ) {
|
||||
errMsg = tr("%1 on ignore list").arg(obj);
|
||||
tooltip = tr("The %1 was skipped because it is listed on the clients\n"
|
||||
"list of names to ignore").arg(obj);
|
||||
} else if( item._errorString == QLatin1String("File contains invalid characters.") ) {
|
||||
errMsg = tr("Invalid characters");
|
||||
tooltip = tr("The %1 name contains one or more invalid characters which break\n"
|
||||
"syncing in a cross platform environment").arg(obj);
|
||||
}
|
||||
}
|
||||
} 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(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);
|
||||
_ui->_treeWidget->insertTopLevelItem(0, twitem);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -181,28 +210,25 @@ void ItemProgressDialog::copyToClipboard()
|
||||
|
||||
int topLevelItems = _ui->_treeWidget->topLevelItemCount();
|
||||
for (int i = 0; i < topLevelItems; i++) {
|
||||
QTreeWidgetItem *item = _ui->_treeWidget->topLevelItem(i);
|
||||
ts << left << qSetFieldWidth(0)
|
||||
<< item->data(0, Qt::DisplayRole).toString()
|
||||
<< endl;
|
||||
int childItems = item->childCount();
|
||||
for (int j = 0; j < childItems; j++) {
|
||||
QTreeWidgetItem *child =item->child(j);
|
||||
QTreeWidgetItem *child = _ui->_treeWidget->topLevelItem(i);
|
||||
ts << left
|
||||
// time stamp
|
||||
ts << left << qSetFieldWidth(10)
|
||||
<< child->data(0,Qt::DisplayRole).toString()
|
||||
// file name
|
||||
<< qSetFieldWidth(50)
|
||||
<< child->data(1,Qt::DisplayRole).toString()
|
||||
// action
|
||||
<< qSetFieldWidth(15)
|
||||
<< child->data(2, Qt::DisplayRole).toString()
|
||||
// size
|
||||
<< qSetFieldWidth(10)
|
||||
<< child->data(3, Qt::DisplayRole).toString()
|
||||
<< qSetFieldWidth(0)
|
||||
<< endl;
|
||||
}
|
||||
<< qSetFieldWidth(10)
|
||||
<< child->data(0,Qt::DisplayRole).toString()
|
||||
// file name
|
||||
<< qSetFieldWidth(64)
|
||||
<< child->data(1,Qt::DisplayRole).toString()
|
||||
// folder
|
||||
<< qSetFieldWidth(15)
|
||||
<< child->data(2, Qt::DisplayRole).toString()
|
||||
// action
|
||||
<< qSetFieldWidth(15)
|
||||
<< child->data(3, Qt::DisplayRole).toString()
|
||||
// size
|
||||
<< qSetFieldWidth(10)
|
||||
<< child->data(4, Qt::DisplayRole).toString()
|
||||
<< qSetFieldWidth(0)
|
||||
<< endl;
|
||||
}
|
||||
|
||||
QApplication::clipboard()->setText(text);
|
||||
@@ -272,7 +298,7 @@ void ItemProgressDialog::slotProgressErrors( const QString& folder, const Progre
|
||||
// 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);
|
||||
_ui->_treeWidget->insertTopLevelItem(0, item);
|
||||
Q_UNUSED(item);
|
||||
}
|
||||
|
||||
@@ -303,7 +329,7 @@ void ItemProgressDialog::slotProgressInfo( const QString& folder, const Progress
|
||||
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem(columns);
|
||||
item->setToolTip(0, longTimeStr);
|
||||
_ui->_treeWidget->addTopLevelItem(item);
|
||||
_ui->_treeWidget->insertTopLevelItem(0, item);
|
||||
Q_UNUSED(item);
|
||||
}
|
||||
|
||||
|
||||
@@ -39,9 +39,6 @@
|
||||
<property name="uniformRowHeights">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="columnCount">
|
||||
<number>4</number>
|
||||
</property>
|
||||
|
||||
@@ -130,9 +130,18 @@ LogBrowser::~LogBrowser()
|
||||
{
|
||||
}
|
||||
|
||||
void LogBrowser::closeEvent(QCloseEvent *)
|
||||
{
|
||||
MirallConfigFile cfg;
|
||||
cfg.saveGeometry(this);
|
||||
}
|
||||
|
||||
|
||||
void LogBrowser::slotNewLog( const QString& msg )
|
||||
{
|
||||
_logWidget->appendPlainText( msg );
|
||||
if( _logWidget->isVisible() ) {
|
||||
_logWidget->appendPlainText( msg );
|
||||
}
|
||||
|
||||
if( _logstream ) {
|
||||
(*_logstream) << msg << endl;
|
||||
@@ -225,11 +234,4 @@ void LogBrowser::slotClearLog()
|
||||
_logWidget->clear();
|
||||
}
|
||||
|
||||
void LogBrowser::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
MirallConfigFile cfg;
|
||||
cfg.saveGeometry(this);
|
||||
QWidget::closeEvent(event);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
void setLogFile(const QString& , bool );
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
void closeEvent(QCloseEvent *);
|
||||
|
||||
protected slots:
|
||||
void slotNewLog( const QString &msg );
|
||||
|
||||
@@ -193,7 +193,7 @@ QString MirallConfigFile::excludeFile(Scope scope) const
|
||||
fi.setFile( QApplication::applicationDirPath(), exclFile );
|
||||
#endif
|
||||
#ifdef Q_OS_UNIX
|
||||
fi.setFile( QString("/etc/%1").arg(Theme::instance()->appName()), exclFile );
|
||||
fi.setFile( QString( SYSCONFDIR "/%1").arg(Theme::instance()->appName()), exclFile );
|
||||
#endif
|
||||
#ifdef Q_OS_MAC
|
||||
// exec path is inside the bundle
|
||||
@@ -595,7 +595,7 @@ QString MirallConfigFile::proxyPassword() const
|
||||
|
||||
int MirallConfigFile::useUploadLimit() const
|
||||
{
|
||||
return getValue(useUploadLimitC, QString::null, -1).toInt();
|
||||
return getValue(useUploadLimitC, QString::null, 0).toInt();
|
||||
}
|
||||
|
||||
bool MirallConfigFile::useDownloadLimit() const
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QRadioButton" name="noDownloadLimitRadioButton">
|
||||
<property name="text">
|
||||
<string>No Limit</string>
|
||||
<string>No limit</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
@@ -254,6 +254,12 @@
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Upload Bandwidth</string>
|
||||
</property>
|
||||
@@ -261,7 +267,7 @@
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QRadioButton" name="noUploadLimitRadioButton">
|
||||
<property name="text">
|
||||
<string>No Limit</string>
|
||||
<string>No limit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -138,7 +138,11 @@ QNetworkReply* ownCloudInfo::mkdirRequest( const QString& dir )
|
||||
qDebug() << "OCInfo Making dir " << dir;
|
||||
_authAttempts = 0;
|
||||
QNetworkRequest req;
|
||||
req.setUrl( QUrl( webdavUrl(_connection) + dir ) );
|
||||
QUrl url( webdavUrl(_connection) );
|
||||
// ensure #, ? and co are interpreted as part of the path and nothing else
|
||||
url.setEncodedPath(url.encodedPath()+QUrl::toPercentEncoding(dir, "/"));
|
||||
|
||||
req.setUrl( url );
|
||||
QNetworkReply *reply = davRequest("MKCOL", req, 0);
|
||||
|
||||
// remember the confighandle used for this request
|
||||
@@ -159,7 +163,7 @@ QNetworkReply* ownCloudInfo::mkdirRequest( const QString& dir )
|
||||
QNetworkReply* ownCloudInfo::getQuotaRequest( const QString& dir )
|
||||
{
|
||||
QNetworkRequest req;
|
||||
req.setUrl( QUrl( webdavUrl(_connection) + dir ) );
|
||||
req.setUrl( QUrl( webdavUrl(_connection) + QUrl::toPercentEncoding(dir, "/") ) );
|
||||
req.setRawHeader("Depth", "0");
|
||||
QByteArray xml("<?xml version=\"1.0\" ?>\n"
|
||||
"<d:propfind xmlns:d=\"DAV:\">\n"
|
||||
@@ -187,7 +191,10 @@ QNetworkReply* ownCloudInfo::getQuotaRequest( const QString& dir )
|
||||
QNetworkReply* ownCloudInfo::getDirectoryListing( const QString& dir )
|
||||
{
|
||||
QNetworkRequest req;
|
||||
req.setUrl( QUrl( webdavUrl(_connection) + dir ) );
|
||||
QUrl url( webdavUrl(_connection) );
|
||||
// ensure #, ? and co are interpreted as part of the path and nothing else
|
||||
url.setPath(url.path() + dir );
|
||||
req.setUrl( url );
|
||||
req.setRawHeader("Depth", "1");
|
||||
QByteArray xml("<?xml version=\"1.0\" ?>\n"
|
||||
"<d:propfind xmlns:d=\"DAV:\">\n"
|
||||
@@ -234,8 +241,9 @@ void ownCloudInfo::slotGetQuotaFinished()
|
||||
{
|
||||
bool ok = false;
|
||||
QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender());
|
||||
int http_result_code = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
||||
|
||||
if (reply->attribute(QNetworkRequest::HttpStatusCodeAttribute) == 207) {
|
||||
if (http_result_code == 207) {
|
||||
// Parse DAV response
|
||||
QXmlStreamReader reader(reply);
|
||||
reader.addExtraNamespaceDeclaration(QXmlStreamNamespaceDeclaration("d", "DAV:"));
|
||||
@@ -268,6 +276,7 @@ void ownCloudInfo::slotGetQuotaFinished()
|
||||
emit quotaUpdated(total, quotaUsedBytes);
|
||||
_lastEtag = etag;
|
||||
} else {
|
||||
qDebug() << "Quota request *not* successful, http result code is " << http_result_code;
|
||||
_lastQuotaTotalBytes = 0;
|
||||
_lastQuotaUsedBytes = 0;
|
||||
}
|
||||
|
||||
@@ -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()));
|
||||
}
|
||||
@@ -60,8 +63,15 @@ OwncloudSetupWizard::~OwncloudSetupWizard()
|
||||
|
||||
void OwncloudSetupWizard::runWizard(QObject* obj, const char* amember, QWidget *parent)
|
||||
{
|
||||
OwncloudSetupWizard *wiz = new OwncloudSetupWizard(parent);
|
||||
static QPointer<OwncloudSetupWizard> wiz;
|
||||
|
||||
if (!wiz.isNull()) {
|
||||
return;
|
||||
}
|
||||
|
||||
wiz = new OwncloudSetupWizard(parent);
|
||||
connect( wiz, SIGNAL(ownCloudWizardDone(int)), obj, amember);
|
||||
connect( wiz, SIGNAL(ownCloudWizardDone(int)), wiz, SLOT(deleteLater()));
|
||||
FolderMan::instance()->setSyncEnabled(false);
|
||||
wiz->startWizard();
|
||||
}
|
||||
|
||||
@@ -33,15 +33,6 @@ ownCloudTheme::ownCloudTheme()
|
||||
// qDebug() << " ** running ownCloud theme!";
|
||||
}
|
||||
|
||||
QString ownCloudTheme::appName() const
|
||||
{
|
||||
/* If this is changed, existing configs are not found any more
|
||||
* because the value is used by QDesktopServices to find the config
|
||||
* file. Be aware.
|
||||
*/
|
||||
return QLatin1String("ownCloud");
|
||||
}
|
||||
|
||||
QString ownCloudTheme::configFileName() const
|
||||
{
|
||||
return QLatin1String("owncloud.cfg");
|
||||
|
||||
@@ -25,7 +25,6 @@ class ownCloudTheme : public Theme
|
||||
public:
|
||||
ownCloudTheme();
|
||||
|
||||
virtual QString appName() const;
|
||||
QString configFileName() const;
|
||||
QString about() const;
|
||||
QPixmap splashScreen() const;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -163,24 +163,33 @@ void ProgressDispatcher::setProgressInfo(const QString& folder, const Progress::
|
||||
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 {
|
||||
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 ||
|
||||
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.
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <QHash>
|
||||
#include <QTime>
|
||||
#include <QQueue>
|
||||
#include <QElapsedTimer>
|
||||
|
||||
namespace Mirall {
|
||||
|
||||
@@ -25,9 +26,8 @@ namespace Mirall {
|
||||
/**
|
||||
* @brief The FolderScheduler class schedules folders for sync
|
||||
*/
|
||||
class Progress
|
||||
namespace Progress
|
||||
{
|
||||
public:
|
||||
typedef enum {
|
||||
Invalid,
|
||||
StartSync,
|
||||
@@ -69,9 +69,9 @@ public:
|
||||
QDateTime timestamp;
|
||||
} SyncProblem;
|
||||
|
||||
static QString asActionString( Kind );
|
||||
static QString asResultString( Kind );
|
||||
};
|
||||
QString asActionString( Kind );
|
||||
QString asResultString( Kind );
|
||||
}
|
||||
|
||||
/**
|
||||
* @file progressdispatcher.h
|
||||
@@ -112,11 +112,13 @@ 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;
|
||||
|
||||
QElapsedTimer _timer;
|
||||
static ProgressDispatcher* _instance;
|
||||
};
|
||||
|
||||
|
||||
@@ -48,6 +48,10 @@ SettingsDialog::SettingsDialog(Application *app, QWidget *parent) :
|
||||
|
||||
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);
|
||||
general->setSizeHint(QSize(0, 32));
|
||||
@@ -62,14 +66,9 @@ SettingsDialog::SettingsDialog(Application *app, QWidget *parent) :
|
||||
NetworkSettings *networkSettings = new NetworkSettings;
|
||||
_ui->stack->addWidget(networkSettings);
|
||||
connect(networkSettings, SIGNAL(proxySettingsChanged()), app, SLOT(slotSetupProxy()));
|
||||
connect(networkSettings, SIGNAL(proxySettingsChanged()), FolderMan::instance(), SLOT(slotScheduleAllFolders()));
|
||||
|
||||
//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()));
|
||||
|
||||
@@ -83,7 +82,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)));
|
||||
@@ -96,6 +95,23 @@ SettingsDialog::SettingsDialog(Application *app, QWidget *parent) :
|
||||
connect(showLogWindow, SIGNAL(triggered()), app, SLOT(slotOpenLogBrowser()));
|
||||
addAction(showLogWindow);
|
||||
|
||||
int iconSize = 32;
|
||||
QListWidget *listWidget = _ui->labelWidget;
|
||||
int spacing = 20;
|
||||
// reverse at least ~8 characters
|
||||
int effectiveWidth = fontMetrics().averageCharWidth() * 8 + iconSize + spacing;
|
||||
// less than ~16 characters, elide otherwise
|
||||
int maxWidth = fontMetrics().averageCharWidth() * 16 + iconSize + spacing;
|
||||
for (int i = 0; i < listWidget->count(); i++) {
|
||||
QListWidgetItem *item = listWidget->item(i);
|
||||
QFontMetrics fm(item->font());
|
||||
int curWidth = fm.width(item->text()) + iconSize + spacing;
|
||||
effectiveWidth = qMax(curWidth, effectiveWidth);
|
||||
if (curWidth > maxWidth) item->setToolTip(item->text());
|
||||
}
|
||||
effectiveWidth = qMin(effectiveWidth, maxWidth);
|
||||
listWidget->setFixedWidth(effectiveWidth);
|
||||
|
||||
MirallConfigFile cfg;
|
||||
cfg.restoreGeometry(this);
|
||||
}
|
||||
@@ -114,13 +130,6 @@ void SettingsDialog::addAccount(const QString &title, QWidget *widget)
|
||||
|
||||
}
|
||||
|
||||
void SettingsDialog::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
MirallConfigFile cfg;
|
||||
cfg.saveGeometry(this);
|
||||
QWidget::closeEvent(event);
|
||||
}
|
||||
|
||||
void SettingsDialog::slotUpdateAccountState()
|
||||
{
|
||||
FolderMan *folderMan = FolderMan::instance();
|
||||
@@ -128,4 +137,23 @@ void SettingsDialog::slotUpdateAccountState()
|
||||
_accountItem->setIcon(Theme::instance()->syncStateIcon(state.status()));
|
||||
}
|
||||
|
||||
void SettingsDialog::setGeneralErrors(const QStringList &errors)
|
||||
{
|
||||
_accountSettings->setGeneralErrors(errors);
|
||||
}
|
||||
|
||||
|
||||
// close event is not being called here
|
||||
void SettingsDialog::reject() {
|
||||
MirallConfigFile cfg;
|
||||
cfg.saveGeometry(this);
|
||||
QDialog::reject();
|
||||
}
|
||||
|
||||
void SettingsDialog::accept() {
|
||||
MirallConfigFile cfg;
|
||||
cfg.saveGeometry(this);
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
} // namespace Mirall
|
||||
|
||||
@@ -40,9 +40,11 @@ public:
|
||||
~SettingsDialog();
|
||||
|
||||
void addAccount(const QString &title, QWidget *widget);
|
||||
void setGeneralErrors( const QStringList& errors );
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
void reject();
|
||||
void accept();
|
||||
|
||||
protected slots:
|
||||
void slotUpdateAccountState();
|
||||
@@ -51,7 +53,6 @@ private:
|
||||
Ui::SettingsDialog *_ui;
|
||||
AccountSettings *_accountSettings;
|
||||
QListWidgetItem *_accountItem;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>704</width>
|
||||
<height>299</height>
|
||||
<width>693</width>
|
||||
<height>457</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -28,12 +28,6 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
class QSslError;
|
||||
class QSslCertificate;
|
||||
|
||||
namespace Mirall
|
||||
{
|
||||
|
||||
namespace Ui {
|
||||
class SslErrorDialog;
|
||||
}
|
||||
|
||||
namespace Mirall
|
||||
{
|
||||
|
||||
class SslErrorDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -57,7 +57,7 @@ private:
|
||||
|
||||
QList<QSslCertificate> _unknownCerts;
|
||||
QString _customConfigHandle;
|
||||
::Ui::SslErrorDialog *_ui;
|
||||
Ui::SslErrorDialog *_ui;
|
||||
};
|
||||
} // end namespace
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SslErrorDialog</class>
|
||||
<widget class="QWidget" name="SslErrorDialog">
|
||||
<class>Mirall::SslErrorDialog</class>
|
||||
<widget class="QWidget" name="Mirall::SslErrorDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* Copyright (C) by Klaas Freitag <freitag@owncloud.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*/
|
||||
|
||||
#ifndef SYNCFILEITEM_H
|
||||
#define SYNCFILEITEM_H
|
||||
|
||||
|
||||
@@ -45,35 +45,45 @@ 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;
|
||||
}
|
||||
|
||||
QString Theme::appNameGUI() const
|
||||
{
|
||||
return appName();
|
||||
return QLatin1String(APPLICATION_NAME);
|
||||
}
|
||||
|
||||
QString Theme::appName() const
|
||||
{
|
||||
return QLatin1String(APPLICATION_SHORTNAME);
|
||||
}
|
||||
|
||||
QString Theme::version() const
|
||||
|
||||
@@ -48,7 +48,8 @@ public:
|
||||
* Use and redefine this if the human readable name contains spaces,
|
||||
* special chars and such.
|
||||
*
|
||||
* By default, appName() is returned.
|
||||
* By default, the name is derived from the APPLICATION_NAME
|
||||
* cmake variable.
|
||||
*
|
||||
* @return QString with human readable app name.
|
||||
*/
|
||||
@@ -61,9 +62,16 @@ public:
|
||||
* it is used for config files etc. If you need a more sophisticated
|
||||
* name in the GUI, redefine appNameGUI.
|
||||
*
|
||||
* By default, the name is derived from the APPLICATION_SHORTNAME
|
||||
* cmake variable, and should be the same. This method is only
|
||||
* reimplementable for legacy reasons.
|
||||
*
|
||||
* Warning: Do not modify this value, as many things, e.g. settings
|
||||
* depend on it! You most likely want to modify \ref appNameGUI().
|
||||
*
|
||||
* @return QString with app name.
|
||||
*/
|
||||
virtual QString appName() const = 0;
|
||||
virtual QString appName() const;
|
||||
|
||||
/**
|
||||
* @brief configFileName
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QSettings>
|
||||
#include <QTextStream>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QUrl>
|
||||
@@ -26,6 +27,7 @@
|
||||
#ifdef Q_OS_UNIX
|
||||
#include <sys/statvfs.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <stdarg.h>
|
||||
@@ -36,6 +38,7 @@
|
||||
#elif defined(Q_OS_WIN)
|
||||
#include <shlobj.h>
|
||||
#include <winbase.h>
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
namespace Mirall {
|
||||
@@ -107,28 +110,25 @@ QString Utility::octetsToString( qint64 octets )
|
||||
static const qint64 gb = 1024 * mb;
|
||||
static const qint64 tb = 1024 * gb;
|
||||
|
||||
QString s;
|
||||
qreal value = octets;
|
||||
if (octets >= tb) {
|
||||
if (octets < 10*tb) {
|
||||
return compactFormatDouble(qreal(octets)/qreal(tb), 1, QLatin1String("TB"));
|
||||
}
|
||||
return QString::number(qRound64(qreal(octets)/qreal(tb))) + QLatin1String(" TB");
|
||||
s = QCoreApplication::translate("Utility", "%L1 TB");
|
||||
value /= tb;
|
||||
} else if (octets >= gb) {
|
||||
if (octets < 10*gb) {
|
||||
return compactFormatDouble(qreal(octets)/qreal(gb), 1, QLatin1String("GB"));
|
||||
}
|
||||
return QString::number(qRound64(qreal(octets)/qreal(gb))) + QLatin1String(" GB");
|
||||
s = QCoreApplication::translate("Utility", "%L1 GB");
|
||||
value /= gb;
|
||||
} else if (octets >= mb) {
|
||||
if (octets < 10*mb) {
|
||||
return compactFormatDouble(qreal(octets)/qreal(mb), 1, QLatin1String("MB"));
|
||||
}
|
||||
return QString::number(qRound64(qreal(octets)/qreal(mb))) + QLatin1String(" MB");
|
||||
s = QCoreApplication::translate("Utility", "%L1 MB");
|
||||
value /= mb;
|
||||
} else if (octets >= kb) {
|
||||
return QString::number(qRound64(qreal(octets)/qreal(kb))) + QLatin1String(" KB");
|
||||
} else if (octets == 1){
|
||||
return QLatin1String("1 byte");
|
||||
} else {
|
||||
return QString::number(octets) + QLatin1String(" bytes");
|
||||
s = QCoreApplication::translate("Utility", "%L1 kB");
|
||||
value /= kb;
|
||||
} else {
|
||||
s = QCoreApplication::translate("Utility", "%L1 B");
|
||||
}
|
||||
|
||||
return (value > 9.95) ? s.arg(qRound(value)) : s.arg(value, 0, 'g', 2);
|
||||
}
|
||||
|
||||
// Qtified version of get_platforms() in csync_owncloud.c
|
||||
@@ -286,16 +286,24 @@ void Utility::setLaunchOnStartup(const QString &appName, const QString& guiName,
|
||||
qDebug() << "Could not create autostart directory";
|
||||
return;
|
||||
}
|
||||
QSettings desktopFile(desktopFileLocation, QSettings::IniFormat);
|
||||
desktopFile.beginGroup("Desktop Entry");
|
||||
desktopFile.setValue(QLatin1String("Name"), guiName);
|
||||
desktopFile.setValue(QLatin1String("GenericName"), QLatin1String("File Synchronizer"));
|
||||
desktopFile.setValue(QLatin1String("Exec"), QCoreApplication::applicationFilePath());
|
||||
desktopFile.setValue(QLatin1String("Terminal"), false);
|
||||
desktopFile.setValue(QLatin1String("Icon"), appName);
|
||||
desktopFile.setValue(QLatin1String("Categories"), QLatin1String("Network"));
|
||||
desktopFile.setValue(QLatin1String("StartupNotify"), false);
|
||||
desktopFile.endGroup();
|
||||
QFile iniFile(desktopFileLocation);
|
||||
if (!iniFile.open(QIODevice::WriteOnly)) {
|
||||
qDebug() << "Could not write auto start entry" << desktopFileLocation;
|
||||
return;
|
||||
}
|
||||
QTextStream ts(&iniFile);
|
||||
ts.setCodec("UTF-8");
|
||||
ts << QLatin1String("[Desktop Entry]") << endl
|
||||
<< QLatin1String("Name=") << guiName << endl
|
||||
<< QLatin1String("GenericName=") << QLatin1String("File Synchronizer") << endl
|
||||
<< QLatin1String("Exec=") << QCoreApplication::applicationFilePath() << endl
|
||||
<< QLatin1String("Terminal=") << "false" << endl
|
||||
<< QLatin1String("Icon=") << appName << endl
|
||||
<< QLatin1String("Categories=") << QLatin1String("Network") << endl
|
||||
<< QLatin1String("Type=") << QLatin1String("Application") << endl
|
||||
<< QLatin1String("StartupNotify=") << "false" << endl
|
||||
<< QLatin1String("X-GNOME-Autostart-enabled=") << "true" << endl
|
||||
;
|
||||
} else {
|
||||
if (!QFile::remove(desktopFileLocation)) {
|
||||
qDebug() << "Could not remove autostart desktop file";
|
||||
@@ -360,4 +368,12 @@ QString Utility::toCSyncScheme(const QString &urlStr)
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
void Utility::sleep(int sec)
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
::Sleep(sec*1000);
|
||||
#else
|
||||
::sleep(sec);
|
||||
#endif
|
||||
}
|
||||
} // namespace Mirall
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace Mirall {
|
||||
|
||||
namespace Utility
|
||||
{
|
||||
void sleep(int sec);
|
||||
QString formatFingerprint( const QByteArray& );
|
||||
void setupFavLink( const QString &folder );
|
||||
QString octetsToString( qint64 octets );
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <QDir>
|
||||
#include <QFileDialog>
|
||||
#include <QUrl>
|
||||
#include <QTimer>
|
||||
|
||||
#include "QProgressIndicator.h"
|
||||
|
||||
@@ -26,7 +27,6 @@
|
||||
#include "mirall/theme.h"
|
||||
#include "mirall/mirallconfigfile.h"
|
||||
#include "creds/abstractcredentials.h"
|
||||
|
||||
namespace Mirall
|
||||
{
|
||||
|
||||
@@ -54,6 +54,7 @@ OwncloudAdvancedSetupPage::OwncloudAdvancedSetupPage()
|
||||
setupCustomization();
|
||||
|
||||
connect( _ui.pbSelectLocalFolder, SIGNAL(clicked()), SLOT(slotSelectFolder()));
|
||||
setButtonText(QWizard::NextButton, tr("Connect..."));
|
||||
}
|
||||
|
||||
void OwncloudAdvancedSetupPage::setupCustomization()
|
||||
@@ -88,8 +89,8 @@ void OwncloudAdvancedSetupPage::initializePage()
|
||||
// call to init label
|
||||
updateStatus();
|
||||
|
||||
// TODO: focus
|
||||
_ui.pbSelectLocalFolder->setFocus();
|
||||
// ensure "next" gets the focus, not obSelectLocalFolder
|
||||
QTimer::singleShot(0, wizard()->button(QWizard::NextButton), SLOT(setFocus()));
|
||||
}
|
||||
|
||||
// Called if the user changes the user- or url field. Adjust the texts and
|
||||
|
||||
@@ -34,6 +34,9 @@
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
@@ -108,6 +108,12 @@
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="3">
|
||||
@@ -121,7 +127,6 @@
|
||||
<zorder>horizontalSpacer</zorder>
|
||||
<zorder>verticalSpacer</zorder>
|
||||
<zorder>horizontalSpacer_2</zorder>
|
||||
<zorder>horizontalLayoutWidget</zorder>
|
||||
<zorder>topLabel</zorder>
|
||||
<zorder>bottomLabel</zorder>
|
||||
</widget>
|
||||
|
||||
@@ -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())));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
*.filepart
|
||||
*~
|
||||
*.bak
|
||||
*.part
|
||||
*.crdownload
|
||||
|
||||
@@ -17,10 +16,6 @@ csync_journal.db.ctmp
|
||||
desktop.ini
|
||||
|
||||
*.kate-swp
|
||||
*.aux
|
||||
*.nav
|
||||
*.out
|
||||
*.toc
|
||||
|
||||
*_conflict-*
|
||||
]*.~*
|
||||
|
||||
@@ -10,7 +10,7 @@ macro(owncloud_add_test test_class)
|
||||
add_executable(${OWNCLOUD_TEST_CLASS}Test test${OWNCLOUD_TEST_CLASS_LOWERCASE}.cpp ${${OWNCLOUD_TEST_CLASS}_MOCS})
|
||||
|
||||
target_link_libraries(${OWNCLOUD_TEST_CLASS}Test
|
||||
${APPLICATION_SHORTNAME}sync
|
||||
${APPLICATION_EXECUTABLE}sync
|
||||
${QT_QTTEST_LIBRARY}
|
||||
${QT_QTCORE_LIBRARY}
|
||||
)
|
||||
|
||||
@@ -26,33 +26,55 @@ private slots:
|
||||
}
|
||||
void testOctetsToString()
|
||||
{
|
||||
QVERIFY(octetsToString(1) == "1 byte");
|
||||
QVERIFY(octetsToString(2) == "2 bytes");
|
||||
QVERIFY(octetsToString(1024) == "1 KB");
|
||||
QVERIFY(octetsToString(1024*1024) == "1 MB");
|
||||
QVERIFY(octetsToString(1024LL*1024*1024) == "1 GB");
|
||||
QVERIFY(octetsToString(1024LL*1024*1024*1024) == "1 TB");
|
||||
QLocale::setDefault(QLocale("en"));
|
||||
QCOMPARE(octetsToString(999) , QString("999 B"));
|
||||
QCOMPARE(octetsToString(1000) , QString("1,000 B"));
|
||||
QCOMPARE(octetsToString(1010) , QString("1,010 B"));
|
||||
QCOMPARE(octetsToString(1024) , QString("1 kB"));
|
||||
QCOMPARE(octetsToString(1110) , QString("1.1 kB"));
|
||||
|
||||
QCOMPARE(octetsToString(9110) , QString("8.9 kB"));
|
||||
QCOMPARE(octetsToString(9910) , QString("9.7 kB"));
|
||||
QCOMPARE(octetsToString(9999) , QString("9.8 kB"));
|
||||
QCOMPARE(octetsToString(10240) , QString("10 kB"));
|
||||
|
||||
QCOMPARE(octetsToString(123456) , QString("121 kB"));
|
||||
QCOMPARE(octetsToString(1234567) , QString("1.2 MB"));
|
||||
QCOMPARE(octetsToString(12345678) , QString("12 MB"));
|
||||
QCOMPARE(octetsToString(123456789) , QString("118 MB"));
|
||||
QCOMPARE(octetsToString(1000LL*1000*1000 * 5) , QString("4.7 GB"));
|
||||
QCOMPARE(octetsToString(1024LL*1024*1024 * 5) , QString("5 GB"));
|
||||
|
||||
QCOMPARE(octetsToString(1), QString("1 B"));
|
||||
QCOMPARE(octetsToString(2), QString("2 B"));
|
||||
QCOMPARE(octetsToString(1024), QString("1 kB"));
|
||||
QCOMPARE(octetsToString(1024*1024), QString("1 MB"));
|
||||
QCOMPARE(octetsToString(1024LL*1024*1024), QString("1 GB"));
|
||||
QCOMPARE(octetsToString(1024LL*1024*1024*1024), QString("1 TB"));
|
||||
}
|
||||
|
||||
void testLaunchOnStartup()
|
||||
{
|
||||
const QString appName = "testLaunchOnStartup";
|
||||
const QString guiName = "LaunchOnStartup GUI Name";
|
||||
qsrand(QDateTime::currentDateTime().toTime_t());
|
||||
QString postfix = QString::number(qrand());
|
||||
|
||||
QVERIFY(hasLaunchOnStartup(appName) == false);
|
||||
setLaunchOnStartup(appName, guiName, true);
|
||||
QVERIFY(hasLaunchOnStartup(appName) == true);
|
||||
setLaunchOnStartup(appName, guiName, false);
|
||||
QVERIFY(hasLaunchOnStartup(appName) == false);
|
||||
const QString appName = QString::fromLatin1("testLaunchOnStartup.%1").arg(postfix);
|
||||
const QString guiName = "LaunchOnStartup GUI Name";
|
||||
|
||||
QVERIFY(hasLaunchOnStartup(appName) == false);
|
||||
setLaunchOnStartup(appName, guiName, true);
|
||||
QVERIFY(hasLaunchOnStartup(appName) == true);
|
||||
setLaunchOnStartup(appName, guiName, false);
|
||||
QVERIFY(hasLaunchOnStartup(appName) == false);
|
||||
}
|
||||
|
||||
void testToCSyncScheme()
|
||||
{
|
||||
QVERIFY(toCSyncScheme("http://example.com/owncloud/") ==
|
||||
QVERIFY(toCSyncScheme("http://example.com/owncloud/") ==
|
||||
"owncloud://example.com/owncloud/");
|
||||
QVERIFY(toCSyncScheme("https://example.com/owncloud/") ==
|
||||
QVERIFY(toCSyncScheme("https://example.com/owncloud/") ==
|
||||
"ownclouds://example.com/owncloud/");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||