Comparar commits

..

499 Commits

Autor SHA1 Mensagem Data
Daniel Molkentin 58035a2f4a Final version 2013-12-12 18:20:45 +01:00
Daniel Molkentin 99a4de6741 Add ChangeLog 2013-12-12 18:01:03 +01:00
Daniel Molkentin 9010e1015e Better fix for override urls 2013-12-12 17:17:07 +01:00
Klaas Freitag 9bf15178f9 Fix button states in account widget 2013-12-12 16:38:45 +01:00
Daniel Molkentin 5b2c734fe5 Respect the override URL properly 2013-12-12 16:20:01 +01:00
Klaas Freitag bc5f7d899a Save and restore activity view state.
Fixes bug #1256
2013-12-12 15:16:43 +01:00
Klaas Freitag ec77ecfd0f Show error reason for blacklisted files in sync activity. 2013-12-12 12:21:24 +01:00
Klaas Freitag 09745c7f75 Fix: Allow to retry sync also for fatal err conditions.
Otherwise there would not  have been a chance to resync for example data
that was Forbidden because of a read only share.

Also removed some commented code.
2013-12-12 11:39:05 +01:00
Daniel Molkentin 9ffb33293c QuotaInfo: Keep polling quota if a previous request fails 2013-12-12 10:53:51 +01:00
Daniel Molkentin 93d75932ac NSIS: fix c&p error. 2013-12-12 10:46:37 +01:00
Daniel Molkentin 8491d95ca4 NSIS: English must be enumerated, too
Fixes empty strings in installer.
2013-12-12 10:46:13 +01:00
Daniel Molkentin e774bbacde NSIS: Can only use global variables in translation strings
fixes #1273
2013-12-12 10:44:05 +01:00
Klaas Freitag 131945b14b Doc fixes about ignore files. 2013-12-11 22:08:24 +01:00
Klaas Freitag 93d250c49b Add NE_LFS define to config.h.in 2013-12-11 20:52:17 +01:00
Olivier Goffart f5c46d481c Tru to get NE_LFS properly
The csync and mirall build system are slightly different so this might help
2013-12-11 20:44:46 +01:00
Jenkins for ownCloud 81773e53b1 [tx-robot] updated from transifex 2013-12-11 13:40:28 -05:00
Klaas Freitag 4f7fe64309 Bump version to rc1 2013-12-11 19:01:53 +01:00
Mr. Jenkins 342937ccd1 [tx-robot] updated from transifex 2013-12-11 12:30:51 -05:00
Klaas Freitag aa213eeafb Do not check for the ETag in case the HTTP request connected. 2013-12-11 13:51:38 +01:00
Daniel Molkentin 76a60e889c Start timer only after the last quota request was answered 2013-12-11 13:48:31 +01:00
Olivier Goffart fa195eb1e8 Logger: Initialize all variables
To avoid valgrind warnings in owncloudcmd
2013-12-11 13:23:42 +01:00
Klaas Freitag b68e721f05 Do not error out on ETag if the status klass is != 2. 2013-12-11 12:59:11 +01:00
Klaas Freitag bbfb2f2a60 Do not force resync if status is SyncResult::Problem. 2013-12-11 12:59:11 +01:00
Olivier Goffart bf309f83f4 Don't keep the temporary file if the transfer fails because of a wrong etag
The downloaded file is corrupted, remove it.
2013-12-11 12:48:11 +01:00
Thomas Müller f05e998430 Translation SectionGroup Shortcuts 2013-12-10 18:08:07 +01:00
Daniel Molkentin 80d202c630 Fix build on Win32 2013-12-10 17:19:36 +01:00
Olivier Goffart 47308cdc01 define NE_LFS from cmake 2013-12-10 16:20:49 +01:00
Daniel Molkentin 03e9a06c7d Fix build 2013-12-10 16:07:49 +01:00
Thomas Müller 370cf45357 fixing add button behavior in single folder mode 2013-12-10 15:59:59 +01:00
Thomas Müller 638b62a3ae prevent crash on 'add folder' 2013-12-10 15:59:59 +01:00
Klaas Freitag 6707e93f31 Add NE_LFS define for correct size of ne_off_t 2013-12-10 15:28:02 +01:00
Olivier Goffart 0360babe02 usleep is not working on windows, use QThread::usleep
Shoud fix #1082
2013-12-10 14:03:01 +01:00
Klaas Freitag a743f804f5 Ignore another sqlite journal tmp name that shows up on win32. 2013-12-10 13:19:57 +01:00
Klaas Freitag 4b42743a2a Better documentation of file ignore patterns. 2013-12-10 13:19:49 +01:00
Olivier Goffart b6e4575dea Do not initialize all the application if another instance is running
This fixes a crash becasue we were constructing the systemtray and then
destroying it too early before the systemtray could initilize itself.
(This work around a bug in QSystemTray which crashes if it is destroyed
before it is registered to the X11 server)
2013-12-10 12:48:59 +01:00
Daniel Molkentin ebfe2c793e Remove leftover file 2013-12-10 12:20:43 +01:00
Daniel Molkentin f9ba3bc22d Merge pull request #1264 from owncloud/l10n-installer-2
Multi-lingual installer
2013-12-10 03:10:56 -08:00
Thomas Müller 13f5d29c3c No language selection dialog - use Windows GUI langaage, which is default as of today with NSIS 2013-12-10 11:10:48 +01:00
Jenkins for ownCloud 082a60e067 [tx-robot] updated from transifex 2013-12-10 04:00:10 -05:00
Thomas Müller d82a9423d6 adding Turkish translation to installer 2013-12-10 09:59:23 +01:00
Thomas Müller b41feebcdd Multi-lingual installer 2013-12-10 00:43:58 +01:00
Daniel Molkentin 2cf7ba91c1 Don't install headers on OS X 2013-12-09 20:39:55 +01:00
hefee f8478ac27b Fixing typos 2013-12-09 20:17:56 +01:00
hefee b092a8cee3 Add deleted Changelog entry for 1.4.2 2013-12-09 20:15:29 +01:00
Olivier Goffart bb2f221edf Fix broken slot connection
The slot was renamed.
2013-12-09 19:19:49 +01:00
Daniel Molkentin dd323bc296 Don't invariably set variables that could be also set externally
We can't use cached variables here, since at least the suffix
may change at any  time, and it needs to take precedence over
any cached content, which cmake doesn't seem to allow for.
2013-12-09 19:03:22 +01:00
Daniel Molkentin 31989d23a6 Adjust Windows and Mac binaries package names 2013-12-09 17:41:41 +01:00
Daniel Molkentin 1291ffaf02 Small adjustments to the last commit 2013-12-09 17:16:42 +01:00
Olivier Goffart 89d1e2d924 When reconfiguring, we need to clear the _currentSyncFolder
Else, if we reconfigure when the folder is syncing, it may be impossible to
sync again.
This happens for example when changing the password when the folder is
syncing
2013-12-09 17:16:04 +01:00
Klaas Freitag 857ef33056 Use proper email in license header. 2013-12-09 17:02:17 +01:00
Daniel Molkentin f5e8efd435 Add build number into versioning scheme
This is an enabler to improve update experience
2013-12-09 16:39:13 +01:00
Olivier Goffart e5edb8e2c7 Fix opening the explorer with a selected file on windows.
Should Fix #1249
2013-12-09 16:13:48 +01:00
Mr. Jenkins 93ac78fd75 [tx-robot] updated from transifex 2013-12-09 06:41:11 -05:00
Klaas Freitag 5f31d13236 Install headers for owncloudsync 2013-12-08 08:55:18 +01:00
Mr. Jenkins ae69a24f5c [tx-robot] updated from transifex 2013-12-07 21:27:41 -05:00
Klaas Freitag fc986b0ab8 If item is a directory, remove its contents from the database as well.
Fixes bug #1257
2013-12-06 16:38:43 +01:00
Klaas Freitag c5e435f9bd Let recursive removal also remove the top dir. 2013-12-06 16:37:30 +01:00
Klaas Freitag 599451d250 Unchanged files still count as files. 2013-12-06 16:37:01 +01:00
Klaas Freitag af78f1996c Set action string as tooltip 2013-12-06 15:50:14 +01:00
Klaas Freitag 41d5445980 Display rename-target in sync protocol action column. 2013-12-06 15:07:25 +01:00
Klaas Freitag e5afd8b901 Maintain the file type correctly. 2013-12-06 14:11:51 +01:00
Klaas Freitag 6fad20d5fc Show local MOVE operations only for top level directory instead for all
files.

This fixes bug mirall#1240
2013-12-06 12:32:26 +01:00
Mr. Jenkins 7662a60111 [tx-robot] updated from transifex 2013-12-05 21:24:22 -05:00
Daniel Molkentin dff17ec08e A different user constitutes a different account
Fixes #1231
2013-12-05 19:03:40 +01:00
Daniel Molkentin df5a72eb38 Resize wizard if advanced options are required
Fixes #1130
2013-12-05 17:43:57 +01:00
Olivier Goffart fa9d9c9909 Maybe we need to destroy the decompress context before the request.
Possibly fix the issue #1229
2013-12-05 16:51:39 +01:00
Daniel Molkentin a0d1dc8807 Avoid horizontal scrollbar
...by intproducing more tooltips and set eliding to center elide
You can still force a scrollbar, but it's not there by default
and the center eliding makes pathes more meaningful

Fixes #1213
2013-12-05 16:42:07 +01:00
Klaas Freitag 9e2f6c0258 Close the sync journal if a folder gets removed.
This fixes bug #1252
2013-12-05 16:06:46 +01:00
Daniel Molkentin ee2efbb071 Fix for c3dc84c58f.
This resulted in the wizard not coming up the second time around
because it wasn't destructed properly.

Also fix a comment.
2013-12-05 16:00:32 +01:00
Mr. Jenkins 8bc532705f [tx-robot] updated from transifex 2013-12-04 17:05:31 -05:00
Daniel Molkentin c3dc84c58f Don't close setup wizard when the initial sync run is started
Fixes regression over 1.4.2
2013-12-04 20:26:18 +01:00
Daniel Molkentin 72b0f4e573 Add man page for owncloudcmd
Fixes #1234
2013-12-04 20:07:05 +01:00
Klaas Freitag 861de89e9c Add translatable error messages for individual file errors.
The error messages coming out of the csync updater and were
string based before which could not be translated.
2013-12-04 12:19:38 +01:00
Klaas Freitag a6dfc0a83e Refactoring, pick proper method name. 2013-12-04 11:36:24 +01:00
Klaas Freitag 859f776440 Set proper enable state of blacklist button after the dialog was opened.
Also set proper tooltips.
2013-12-04 11:32:46 +01:00
Klaas Freitag 4b7f75059a Fixed check for SQL command successs. 2013-12-04 10:31:05 +01:00
Klaas Freitag b3620e320b Avoid a comparison warning on win32 2013-12-03 17:09:57 +01:00
Klaas Freitag 883576cb95 Fix Win32 move file operation. 2013-12-03 17:07:42 +01:00
Daniel Molkentin 62ec7aa9c5 Add file forgotten in last commit 2013-12-03 16:24:17 +01:00
Daniel Molkentin 99fc570267 Replace Q_OS_WIN32 by Q_OS_WIN
Fixes #1238
2013-12-03 16:23:49 +01:00
Olivier Goffart 1f5c4bde14 Fix windows rename of temporary files 2013-12-03 16:10:44 +01:00
Klaas Freitag 046d180d2f Rather count the blacklist items in the database.
Use database functions to count the entries rather than trying to
compute it from the progress items the widget got.
2013-12-03 14:48:49 +01:00
Klaas Freitag 278e76b774 Add blackListEntryCount method. 2013-12-03 14:48:49 +01:00
Olivier Goffart 09d850bfaa When the temporary file is the same size as the file we would download, just keep it
Don't download the file if the temporary file is complete.

else, we get error from server: Requested Range not satisfiable
2013-12-03 14:44:04 +01:00
Klaas Freitag f0a6047ecf Add a button to acitivity view to clean the blacklist. 2013-12-03 14:04:01 +01:00
Klaas Freitag e8ffb17b3b Add a slot to wipe the folder's blacklist. 2013-12-03 14:04:01 +01:00
Klaas Freitag 09d4fa2127 Fixed wording, do not expose the term blacklist to users. 2013-12-03 14:04:01 +01:00
Daniel Molkentin f521301c51 Add plugins in install_qt4_executable to ensure the lib paths get fixed up
Fixes #1228
2013-12-03 13:33:50 +01:00
Olivier Goffart de5161137f remove unneeded file 2013-12-03 13:11:41 +01:00
Klaas Freitag 1abfd4ba44 Fixed wording, removed the term "problem". 2013-12-03 12:31:28 +01:00
Klaas Freitag ecf45856e1 Add missing call to CloseHandle on the win32 platform.
This fixes bug mirall#1236 and also mirall#1237
Also some minor cleanups.
2013-12-03 10:08:17 +01:00
Mr. Jenkins 148b22f53d [tx-robot] updated from transifex 2013-12-02 17:13:40 -05:00
Thomas Müller ec075a6d2a removing libiniparder.dll and libdl.dll from NSNIS installer 2013-12-02 13:20:10 +01:00
Thomas Müller 6923f26597 Adding missing \ on zypper install command 2013-12-02 11:37:06 +01:00
Mr. Jenkins 206c62a171 [tx-robot] updated from transifex 2013-11-29 13:11:24 -05:00
Klaas Freitag c03b2bbc87 Make unblacklisting depending on Up or Download
Compare modtime in case of uploading and ETag in case of downloading
as they are the correct indicators.
2013-11-29 16:16:04 +01:00
Klaas Freitag 2f708c0877 Move checkAccountExists out of gui class. 2013-11-29 16:16:04 +01:00
Olivier Goffart 58eb000163 Make the "details" manu entry work
Fix #1214
2013-11-29 11:18:59 +01:00
Olivier Goffart f5f56e45c0 Fix pausing one of the folder pauses all foder after it while restarting. 2013-11-29 10:57:34 +01:00
Klaas Freitag 951ac79a68 Destinguish between rename and move in wording. 2013-11-28 10:58:04 +01:00
Klaas Freitag ce47adb482 push version to 1.5.0beta1 2013-11-28 10:58:04 +01:00
Olivier Goffart ef8fe11f5a Do not write the directory etag in the database in case of soft error
Else we won't retry next time as we think nothing has changed.
2013-11-28 10:01:30 +01:00
Olivier Goffart 30db533cea Stop iterating files when aborting. 2013-11-28 10:01:30 +01:00
Olivier Goffart 99eeaa0db5 no need to set twice the error string
done() is already taking care of that
2013-11-28 10:01:30 +01:00
Klaas Freitag 80a01ecff3 Use the activity icon in settings dialog. 2013-11-28 09:47:49 +01:00
Klaas Freitag 5f3ce25ccf Push version to 1.4.90 2013-11-28 09:44:09 +01:00
Klaas Freitag 0d85810c23 Change tab name in settingsdialog to Activity rather than Status. 2013-11-28 09:44:09 +01:00
Mr. Jenkins 4626ef1ffb [tx-robot] updated from transifex 2013-11-27 11:20:43 -05:00
Klaas Freitag 23007613a9 Fix progress bar in new propagator. 2013-11-27 16:48:16 +01:00
Daniel Molkentin 0fc51704f5 Enable accessibility on OS X
Fixes #736
2013-11-27 15:43:47 +01:00
Daniel Molkentin 46a403eb02 Report connection errors explicitly on explicit sign in attempts
Implicit connection attempts fail silently. This is roughly what
users expect from e.g. mail clients.

Fixes #1205.
2013-11-27 14:15:56 +01:00
Daniel Molkentin e719e80409 ConnectionValidator: Account::setState no longer takes a bool
This makes the client come up with the correct state when the
initial connect fails.
2013-11-27 14:12:30 +01:00
Daniel Molkentin 310278f580 Account: Swap connected and disconnected state
Also, avoid full integer enumeration
2013-11-27 14:11:10 +01:00
Klaas Freitag 59072a81f1 Put detailed sync status widget into ButtonGroup for common style. 2013-11-26 14:27:32 +01:00
Klaas Freitag d55bffb319 Removed not longer needed Info button.
The detailed sync status is now in the same dialog in another tab.
2013-11-26 14:15:37 +01:00
Klaas Freitag 232cbc45b5 Simplify progress and error signals again.
Now handle everything through the progress signal and let the errors
be progressed in the done slot.

Remove unused code, fix sorting of the list, more efficiency.

This fixes #916
2013-11-26 14:02:11 +01:00
Klaas Freitag a88d45bff4 Comment some unused code. 2013-11-26 14:02:11 +01:00
Klaas Freitag 090e474d70 Add a couple of missing progress signals. 2013-11-26 14:02:11 +01:00
Klaas Freitag 4f7546768b Do not blacklist Softerrors. 2013-11-26 14:02:11 +01:00
Klaas Freitag 7a3c086be2 Display a proper error message for missing sync directory on server.
this fixes bug mirall#1149
2013-11-26 14:02:11 +01:00
Olivier Goffart 5c8b6ed902 Fix Remove -gzip from etag
Remove it from both "foo"-gzip  and "foo-gzip"

See issue #1195
2013-11-26 12:10:52 +01:00
dragotin cb6918f3d5 Merge pull request #1203 from pascalBokBok/patch-1
Remove spammy "sync starting" notification on every program start.

Thanks!
2013-11-26 02:39:08 -08:00
pascalBokBok 489cc8aa29 Remove spammy "sync starting" notification on every program start. 2013-11-26 10:01:36 +01:00
Mr. Jenkins d8a8d5da63 [tx-robot] updated from transifex 2013-11-26 03:05:08 -05:00
Daniel Molkentin 0d85dcdd9e Toggle Settings window when clicking on the icon
This restores the old behavior for every DE but OS X and Ubuntu Unity
(which respond to all clicks by opening the menu).

Discussed in #896
2013-11-26 03:15:03 +01:00
Daniel Molkentin 7eddff39e7 Wizard: Allow /index.php or /remote.php/webdav in URLs.
We will strip those. Also works on paste.

Fixes #349
2013-11-26 02:32:04 +01:00
Daniel Molkentin 81e47b0896 Folder wizard: sanitize error detection
* Wrap text properly
* Format multiple warnings as bullet points
* Use 'Folder' instead of 'Directory' everywhere
* Fix false positives when checking if one directory contains another
* Fix logic errors in target folder warning detection

Fixes #1201
2013-11-26 02:03:00 +01:00
Daniel Molkentin ef0c7348ad Account Settings: Fix label 2013-11-26 00:04:50 +01:00
Daniel Molkentin 050bb55f1e Wizard: Do not start from scratch if the initial folder is non-default
Before, the folder was initialized to "ownCloud" in any case,
which lead the wizard to conclude it had to sync everything anew,
because the location moved -- even if the folder location was manually
corrected.

Fixes parts of #1172
2013-11-26 00:04:33 +01:00
Markus Goetz fa715ce135 Propagator: Open download file as Unbuffered 2013-11-25 19:25:19 +01:00
Markus Goetz 911e0bdd6e Propagator: Check write errors when downloading 2013-11-25 19:25:19 +01:00
Olivier Goffart fa0f773fcb Separate the case of file changing durng upload in the chunk or non chunk case.
If the file is changed between chunk, it is easy and we can just retry as the
file has not been changed on the server.
But if the file is changed after it has been updated on the server, we must still
update the database with the etag. (and possibly delete the partial file)

Relates to issue #1002
2013-11-25 19:16:54 +01:00
Markus Goetz ac8296fb94 Propagator: Check E-Tag when resuming
Should fix #756
2013-11-25 19:01:04 +01:00
Daniel Molkentin f47ce2fea6 Account Settings: Set initial button state correctly
Fixes #1185
2013-11-25 17:56:09 +01:00
Klaas Freitag 33ff6b3934 Even if problems occured show the Ok-Icon in the setup dialog.
Fixes bug #942.
2013-11-25 17:49:59 +01:00
Olivier Goffart ca3d8ab193 Add one case of missing -gzip removal 2013-11-25 17:48:57 +01:00
Daniel Molkentin d85009a2e9 Account Settings: fix connect error
Fixes #1198
2013-11-25 17:34:40 +01:00
Markus Goetz 72d2ac09e3 Propagator: Don't ignore error if no HTTP error code 2013-11-25 16:37:48 +01:00
Olivier Goffart 6b7da798b8 Remove -gzip from Etag
Fix #1195
2013-11-25 16:30:13 +01:00
Klaas Freitag 2e4043b498 Show proper error message and icon according to error class. 2013-11-25 16:18:07 +01:00
Klaas Freitag dc29046d61 Add new progressProblem signal and slots.
Now the sync problems are handled differently than the sync progress
to ease error message handling and stuff.
2013-11-25 16:18:07 +01:00
Klaas Freitag 0c6dca25c4 Register meta type for SyncProblem 2013-11-25 16:18:07 +01:00
Klaas Freitag 1a3f246c46 Add new Error Types to progress: Soft, Normal, Fatal. 2013-11-25 16:18:07 +01:00
Daniel Molkentin ad6c42b031 Wizard: let us handle/ignore credential failures 2013-11-25 15:50:19 +01:00
Daniel Molkentin 9ddedf81ac Cleanup: "Use QMutexLocker" 2013-11-25 15:34:17 +01:00
Daniel Molkentin 685c13dead Distiguish "Signed out" from "Disconnected" 2013-11-25 15:34:17 +01:00
Daniel Molkentin c25c7daca7 docs: Add infos about installing the sql plugin and module
Fixes #1184
2013-11-25 15:34:17 +01:00
Daniel Molkentin 2a17a2a102 Remove credential-exposing debug output 2013-11-25 15:34:16 +01:00
Daniel Molkentin 4e22fff427 Introduce online/offline state, accessible via GUI 2013-11-25 15:34:16 +01:00
Daniel Molkentin 6165c38289 Fix indentation 2013-11-25 15:34:16 +01:00
Daniel Molkentin f554cca3d6 Fix initial state of quota info class. 2013-11-25 15:34:16 +01:00
Daniel Molkentin 67132326d2 Prefix tooltips with app name 2013-11-25 15:34:16 +01:00
Daniel Molkentin ea2b5fb29c Query credentials when needed. Put the account offline if user aborts.
This is only implemented for HTTP auth. Shibboleth still does its own thing.
2013-11-25 15:34:16 +01:00
Daniel Molkentin 0a2861a731 Disable quota polling when default account does not exist or is offline 2013-11-25 15:34:16 +01:00
Olivier Goffart 6f17131e3c Fix mutex usage in the journal
All public function must lock the mutex. And therefore none of the journal
function may call public function because the mutex is already locked.

So have a public commit that lock the mutex,  and a private  commitInternal
that assume the mutex is locked
2013-11-25 15:11:37 +01:00
Olivier Goffart ca3885de2a Fix some SQL error and warning
Such as:
 Error opening the db:  "Driver not loaded Driver not loaded"
or
 QSqlDatabasePrivate::removeDatabase: connection '...' is still in use, all queries will cease to wor

We need to clear the QSqlDatabase _db handle before calling removeDatabase.
And we also need to give a different name to different folder database, just to be sure
2013-11-25 15:07:58 +01:00
Daniel Molkentin 5d6700c68d Merge pull request #1165 from csware/startmenu-according-to-ms-guidelines
Startmenu according to ms guidelines
2013-11-25 04:27:43 -08:00
Daniel Molkentin 37d6f6eeab Build on OS X 2013-11-25 10:54:18 +01:00
Klaas Freitag fd1552f7a0 Handle SoftError and show blacklisted files. 2013-11-24 22:27:11 +01:00
Klaas Freitag 055a8d7e74 Do not display error messages if user aborts the sync run. 2013-11-24 22:26:50 +01:00
Klaas Freitag 1964e60eb0 Do not show an error message if user aborted. Also CSYNC_STATUS fixes. 2013-11-24 22:21:29 +01:00
Klaas Freitag 11acfde55a Refresh the Protocol widget when the dialog is raised. 2013-11-24 22:20:43 +01:00
Mr. Jenkins 3a1c6429ab [tx-robot] updated from transifex 2013-11-23 23:14:03 -05:00
Klaas Freitag ecb2444923 Handle changing source file in upload correctly.
Delete the file on the server if the source file is new, but
the source did not arrive completely within a timespan.
2013-11-22 19:45:26 +01:00
Klaas Freitag 65bd4be16e Make sure all queries are initialized on our database object.
Since we use a database with the non default name, we need to do that,
otherwise the query is initialized on the default db which is not open
in our case.
2013-11-22 15:37:35 +01:00
Mr. Jenkins 39e48d3d01 [tx-robot] updated from transifex 2013-11-21 20:06:22 -05:00
Mr. Jenkins c0b3672f32 [tx-robot] updated from transifex 2013-11-21 08:09:18 -05:00
Klaas Freitag 8d2950f66c Enable the overall file count in progress again. 2013-11-21 11:37:47 +01:00
Klaas Freitag 55e82ee4c1 Made transaction management a bit more transparent. Some fixes. 2013-11-21 11:13:58 +01:00
Klaas Freitag aa17be40cc Some database code cleanups. 2013-11-20 18:19:14 +01:00
Klaas Freitag 97c661c909 Cleanups 2013-11-20 14:59:58 +01:00
Klaas Freitag 2767e7084a Minor cleanups. 2013-11-20 14:27:44 +01:00
Klaas Freitag 5900b1ad25 Add blacklisting for files with error conditions. 2013-11-20 14:27:44 +01:00
Klaas Freitag 20b9ae757d Add a http status code varialbe to the sync item object. 2013-11-20 14:27:44 +01:00
Klaas Freitag aff2dd9f44 The IGNORE statement is handled further down the code. 2013-11-20 14:27:44 +01:00
Klaas Freitag e30c484a7a Ignore the SIGPIPE signal as that disturbs debugging with Qt Creator.
It is questionable why this happens and if this patch really helps,
or if it might have side effects. Input appreciated :)
2013-11-20 14:27:44 +01:00
Klaas Freitag 0f6dd8748f Fixed some header wording. 2013-11-20 14:27:44 +01:00
Klaas Freitag a342f63fdf Changed wording: Replaced Protocol against Status. 2013-11-20 14:27:44 +01:00
Daniel Molkentin 5c4d240c66 Build on mac with Qt 5
I still had this patch on disk.
2013-11-19 14:41:40 +01:00
Markus Goetz e551e92e13 Downloads: Ignore file if no ETag was sent
Fixes part of #970
2013-11-19 12:44:25 +01:00
Markus Goetz b98d97a96d SyncJournalDb: Fix warnings
I got those warnings for the latter sync runs:
11-19 10:58:15:997 QSqlDatabasePrivate::removeDatabase: connection 'qt_sql_default_connection' is still in use, all queries will cease to work.
11-19 10:58:15:997 QSqlDatabasePrivate::addDatabase: duplicate connection name 'qt_sql_default_connection', old connection removed.
2013-11-19 11:28:08 +01:00
Klaas Freitag f30ac49264 Cached more queries, used safe QSqlQuery pattern 2013-11-18 13:02:09 +01:00
Klaas Freitag 49ba252fff Database initialize code cleanup.
If the QSqlQuery class is called with a query in the constructor, the query
is executed immediately. In fact, we executed each query twice before.
Later on we might want to implement a wrapper clas around the query.
2013-11-18 10:02:33 +01:00
Klaas Freitag 69269f8f75 Use transactions to speed up database access. 2013-11-18 10:02:32 +01:00
Klaas Freitag e73730cb94 Close database after retrieval of file record count.
As the csync updater opens the database itself, it is cleaner to close
the db before and open it again after csync has finished.
Added a close method to the journal class.
2013-11-18 10:02:32 +01:00
Klaas Freitag 098e04c13f Set PRAGMA synchronous to NORMAL 2013-11-18 10:02:32 +01:00
Klaas Freitag b0f6628584 Moved implementation of start() to cpp file. 2013-11-18 10:02:32 +01:00
Klaas Freitag 42f6867329 Add some useful logging. 2013-11-18 10:02:32 +01:00
Daniel Molkentin 0a9a3d8f04 Cleanup in folderman 2013-11-18 09:37:09 +01:00
Daniel Molkentin ec850e83b9 Folders need to be setup before initializing the GUI
This fixes the incomplete context menu
2013-11-18 09:37:09 +01:00
Markus Goetz 08665d6ac2 Settings: Don't specify encoding
QSettings automatically does escaping. When UTF-8 was set, I
got all kind of problems with the QByteArray for the geometry
and the umlaut in my name for the proxy user.
2013-11-18 09:30:42 +01:00
Markus Goetz 4194a078d5 Revert "set utf8 for the central settings file"
This reverts commit 6758c89130.
2013-11-15 15:45:21 +01:00
Daniel Molkentin 6758c89130 set utf8 for the central settings file 2013-11-15 14:43:48 +01:00
Olivier Goffart c15a1eedd1 Only update the db for ETAG if the etag has changed for directories 2013-11-15 13:53:18 +01:00
Klaas Freitag bf6e1f10ce Prepare the queries after the database was migrated. 2013-11-15 11:21:27 +01:00
Klaas Freitag c22f8a47f1 Initialise values properly, avoid warning. 2013-11-15 10:32:13 +01:00
Klaas Freitag 858facb5e0 Use precompiled database statements. 2013-11-15 10:32:13 +01:00
Olivier Goffart b610dd2754 Revert "Partial revert of "CMake: Remove cmake module""
That patch reverted the oposite of what it should have reverted :-)

This reverts commit b22ef9f8fa.
2013-11-15 10:20:12 +01:00
Olivier Goffart b3972a5ba8 Do not fetch the file id in the propagator with a HEAD
Normally, the fileid comes with the PUT or the GET.
If it did not comes with the PUT, it means the server do not support
fileid,  we should not query it with a useless HEAD.

Also, in case the fileid changes (which it should not)  update anyway
to the new fileid in the db
2013-11-15 10:18:19 +01:00
Daniel Molkentin 36e8273da0 fix mac builds 2013-11-14 20:53:56 +01:00
Daniel Molkentin 2f4de3cc48 Build fix 2013-11-14 20:41:23 +01:00
Daniel Molkentin b22ef9f8fa Partial revert of "CMake: Remove cmake module"
This reverts commit 63188667bb.
2013-11-14 19:34:12 +01:00
Daniel Molkentin e20f39f040 Another cleanup 2013-11-14 19:31:38 +01:00
Daniel Molkentin 63188667bb CMake: Remove cmake module 2013-11-14 19:26:09 +01:00
Daniel Molkentin c2eaf5e627 owncloud is no longer a dl'opened module, but linked into csync 2013-11-14 19:22:22 +01:00
Daniel Molkentin 7ba8983f0a Change all Network Jobs to use start() 2013-11-14 19:20:19 +01:00
Markus Goetz 088aa6ebdd Wizard: Default button to Next 2013-11-14 19:13:59 +01:00
Markus Goetz 767ec4ed59 Wizard: Support redirects again 2013-11-14 17:54:38 +01:00
Markus Goetz b12b8c981d Wizard: Also reset timeout on forwards 2013-11-14 17:23:56 +01:00
Markus Goetz b499a62593 Wizard: Timeout handling for CheckServerJob 2013-11-14 17:23:56 +01:00
Markus Goetz fa0a2764a4 Fix changing URL in wizard 2013-11-14 17:23:56 +01:00
Markus Goetz a537a98f03 Tray menu: Populate at start 2013-11-14 17:23:56 +01:00
Sven Strickroth ed5b0973dd Do not create folder for single link
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2013-11-14 15:45:14 +01:00
Olivier Goffart e8e27b61f6 Revert the changes that fetch the file id in the propagator.
We don't want to fetch the file id in the propagator.

Revert "Put item member variable to base class."
This reverts commit f7aa2aa348.

Revert "Add isValidFileId and getFileIdPropget methods."
This reverts commit ccd254abba.
2013-11-14 14:59:03 +01:00
Sven Strickroth 336e22233d Do not create uninstall shortcut in start menu
According to Microsoft Design guidelines (http://msdn.microsoft.com/en-us/library/windows/desktop/aa511447.aspx) no icons for uninstallers should be created.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2013-11-14 14:40:21 +01:00
Daniel Molkentin 578431c791 Fix building owncloudcmd in case of theming 2013-11-14 14:20:09 +01:00
Daniel Molkentin ead0f8d029 Update build docs 2013-11-14 12:36:09 +01:00
Klaas Freitag f7aa2aa348 Put item member variable to base class. 2013-11-14 11:37:32 +01:00
Klaas Freitag ccd254abba Add isValidFileId and getFileIdPropget methods. 2013-11-14 11:37:08 +01:00
Daniel Molkentin 56de183155 Merge pull request #1160 from csware/exclude-office-tempfiles
Add another Office lock/temporary file pattern
2013-11-13 15:52:37 -08:00
Daniel Molkentin c8256eea0e Merge pull request #1162 from csware/startmenu-according-to-ms-guidelines
Startmenu according to ms guidelines
2013-11-13 15:52:05 -08:00
Sven Strickroth b026bb308d Do not create folder for single link
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2013-11-14 00:45:18 +01:00
Sven Strickroth 6bd4d367d4 Do not create uninstall shortcut in start menu
According to Microsoft Design guidelines (http://msdn.microsoft.com/en-us/library/windows/desktop/aa511447.aspx) no icons for uninstallers should be created.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2013-11-14 00:43:11 +01:00
Sven Strickroth d401a62fd9 Add another Office lock/temporary file pattern
Experienced with Microsoft Office 2010.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2013-11-14 00:33:11 +01:00
Daniel Molkentin 8f61cc4041 Hint the OS to not show [?] in Wizards and Dialogs
Fixes #1156
2013-11-13 20:12:56 +01:00
Daniel Molkentin 21c9fc2d35 Cleanup 2013-11-13 19:11:46 +01:00
Daniel Molkentin 171572e400 Remember paused state throughout application restarts
Fixes #823
2013-11-13 18:58:35 +01:00
Daniel Molkentin 475a4f2676 Windows: ship QtSql lib 2013-11-13 14:32:09 +01:00
Olivier Goffart 52e01b39d6 Adapt to csync 'md5'->'etag' change 2013-11-13 14:28:41 +01:00
Daniel Molkentin af1dcfd179 Compile fix 2013-11-13 14:24:02 +01:00
Daniel Molkentin 233a6908dd Partial revert "Compile with Qt5"
This reverts commit 878ae56a71.
2013-11-13 14:19:01 +01:00
Daniel Molkentin ae83c12f05 Fix compiler warning 2013-11-13 14:19:01 +01:00
Daniel Molkentin 878ae56a71 Compile with Qt5 2013-11-13 14:00:12 +01:00
Daniel Molkentin 2ff4ebc72f Make user() available throught AbsctractCredentials 2013-11-13 13:59:35 +01:00
Daniel Molkentin ca79d3b437 Merge remote-tracking branch 'origin/master' into account_refactoring 2013-11-13 13:55:58 +01:00
Klaas Freitag 14081a197b Call ne_sock_init and ne_sock_exit to initialize neons SSL stack.
See https://github.com/owncloud/mirall/issues/1115 for more details on
why that is done here now.
2013-11-11 17:47:24 +01:00
Daniel Molkentin 9fe2549938 Add user info if the auth backends provides it 2013-11-11 16:57:15 +01:00
Klaas Freitag e0a50d4bb9 PostSyncCleanup added: Remove superfluous entries from database after
sync.
2013-11-11 16:45:40 +01:00
Daniel Molkentin ad1c1f4130 Remove legacy code 2013-11-11 15:36:49 +01:00
Daniel Molkentin 121b18bf70 QtKeychain is not a hard dependency 2013-11-11 15:36:29 +01:00
Daniel Molkentin 22ed29a30b Remove obsolete credentialstore class 2013-11-11 15:24:07 +01:00
Daniel Molkentin 64b59f8679 Don't use integration directory 2013-11-11 15:22:51 +01:00
Daniel Molkentin 406ed5a0c0 Make new folder wizard work again 2013-11-11 15:20:07 +01:00
Daniel Molkentin d5081f4328 Fix logic 2013-11-11 14:02:54 +01:00
Daniel Molkentin 95d7afb0d0 cleanups 2013-11-11 10:57:33 +01:00
Klaas Freitag 2b2987d962 Make sure to rebuild the recent changes menu. 2013-11-11 10:06:14 +01:00
Klaas Freitag 2eb77445be Add rename actions to progress dispatching.
With that fix rename operations are shown as such in the progress
window and in bubble help etc.
2013-11-08 16:21:59 +01:00
Daniel Molkentin 12b1b38351 Fix connect 2013-11-08 14:02:13 +01:00
Daniel Molkentin b0abb6362a Don't set the content header length
This breaks POSTS and is not needed in QNAM, since QNAM
does this itself internally.
2013-11-08 14:01:56 +01:00
Klaas Freitag a458ffd472 Add missing return in error case. 2013-11-08 12:56:54 +01:00
Daniel Molkentin 60b6f520e7 Make Shibboleth browser aware of Accounts
Needed for SSL error handling. It's also more consistent.
2013-11-07 18:47:38 +01:00
Daniel Molkentin 8d0d5b4077 Make redirects work 2013-11-07 18:46:57 +01:00
Daniel Molkentin 5c9a6afb82 Fix crash when opening settings without a valid account 2013-11-07 18:46:28 +01:00
Klaas Freitag 162acc1cc2 Fix conflict file handling, create a proper conflict file name.
Before this fix, the conflict file name was set in the file name
variable which lead to the problem that the subsequent rename of
the temp file to the final final filename was moving the temp file on
the conflict file. No final file was there.
2013-11-07 16:53:22 +01:00
Daniel Molkentin 64ef43d918 Fix the key used for storing the password 2013-11-07 15:59:58 +01:00
Daniel Molkentin 33c3d2a7d0 Wizard: Initialize account credentials.
Required to be able to readily retrieve the user name later on
2013-11-07 15:24:49 +01:00
Daniel Molkentin 1238ab4f69 fix broken connect() statement 2013-11-07 12:50:55 +01:00
Daniel Molkentin a42ff5a07c Show floating point prec. in account settings, too 2013-11-07 12:50:39 +01:00
Daniel Molkentin aa4b6bd4ea Readd "online" notion as a state in account.
This gets updated by the ConnectionValidator. Not sure if that's
the best choice, but it mimmicks the old behavior the closest.
2013-11-07 12:22:17 +01:00
Daniel Molkentin 478ba9c5ef Fix approved SSL certificates being forgotten 2013-11-07 12:04:45 +01:00
Klaas Freitag c58e9d17a8 Again minor doc changes. 2013-11-07 10:29:27 +01:00
Klaas Freitag 41ccbc0334 Minor docu change. 2013-11-07 10:28:14 +01:00
Daniel Molkentin bd46ad56fc Add new quotainfo class 2013-11-07 10:14:38 +01:00
Daniel Molkentin bde5e86c50 Reformatting fixes 2013-11-07 10:14:25 +01:00
Daniel Molkentin ec0f01fd7c Ensure an SSL Error Handler is always available 2013-11-07 10:14:12 +01:00
Klaas Freitag fe4c1cc35a Remove straycat code from mirall. 2013-11-06 14:20:44 +01:00
Klaas Freitag b6152c19d6 Adjust generic build documentation to the current state. 2013-11-06 11:13:55 +01:00
Daniel Molkentin 800abbf8b7 Make http credentials work 2013-11-05 18:16:00 +01:00
Daniel Molkentin 3af622d535 Make quota display work 2013-11-05 18:15:47 +01:00
Klaas Freitag ee4cbf52dc Remove straycats collected in the reconcile phase from journal. 2013-11-05 17:53:01 +01:00
Klaas Freitag 5cd2be058d Fix local rename. 2013-11-05 17:50:09 +01:00
Klaas Freitag 3a21edca2b Keep originalFile member as QString rather than C string.
This avoids encoding problems with interesting file names.
2013-11-05 17:48:51 +01:00
Klaas Freitag c6a926842a Fix recursivley flag misinterpretation. 2013-11-05 17:47:51 +01:00
Daniel Molkentin 440b5164ad Build fix 2013-11-04 16:41:59 +01:00
Daniel Molkentin cc5f17a7d2 Merge remote-tracking branch 'origin/master' into account_refactoring
Conflicts:
	src/mirall/accountsettings.cpp
	src/mirall/folder.cpp
2013-11-04 16:38:55 +01:00
Daniel Molkentin 85d5b82811 - Make saving/restoring accounts work.
- Prepare for fetching quota
2013-11-04 16:36:23 +01:00
Olivier Goffart f0a1ac4346 Fix syncing folder with nothing in it
Do the start after connecting, as the finish may be imediate if there
is nothing to do.
2013-10-31 12:11:56 +01:00
Olivier Goffart bdc39f9cc2 Allow folder that are prefix of another 2013-10-31 11:41:56 +01:00
Olivier Goffart d3ae2f42a7 Reset the proxy module property at every sync
This is required for the fix for #713
Since the module properties are shared in global variables shared by
every folders, removing another folder may clean the proxy settings.
So we need to restore them at every sync
2013-10-31 11:39:43 +01:00
Olivier Goffart df39ab0b2f Don't leak the system tray 2013-10-31 10:52:19 +01:00
Olivier Goffart 28833ee5ac Fix crash when removing folder while syncing.
We need to set _thread to 0 after destoying it
2013-10-31 10:51:45 +01:00
Klaas Freitag c66a1d1895 Removed unused code from LocalRename 2013-10-30 18:14:33 +01:00
Klaas Freitag cdee0dc1cf Added a PropagateLocalRename job to do local renames. 2013-10-30 17:37:34 +01:00
Klaas Freitag a43c5fcfe8 Fix header name according to changes on server master. 2013-10-30 17:37:34 +01:00
Olivier Goffart 5c67f39476 Ignore error 404 on DELETE
This may happen if we have stale entries in the database
2013-10-30 17:33:06 +01:00
Olivier Goffart fb47657b1f Make F6 in the account config sync the selected folder, for debugging purposes
Issue #409
2013-10-30 16:58:08 +01:00
Olivier Goffart 76d46af4b7 Revert "Implement a sync now button"
Actually, after discussion with the team, we decided this button is a bad idea

This reverts commit b56fcd8ebd.
2013-10-30 16:48:28 +01:00
Daniel Molkentin 86af2848dd Merge remote-tracking branch 'origin/master' into account_refactoring
Conflicts:
	src/mirall/accountsettings.cpp
2013-10-30 16:37:49 +01:00
Daniel Molkentin 4ca310b63b Remove ownCloudInfo for good 2013-10-30 16:33:15 +01:00
Daniel Molkentin 59bc1d8966 Credential Store is no longer static
It now belongs to HttpCredentials
2013-10-30 16:32:34 +01:00
Daniel Molkentin 14c2ff44f3 More porting to Account class
- Finish port of owncloud setup wizard to Account
- Deprive MirallConfigFile of the customHandle
2013-10-30 16:31:47 +01:00
Olivier Goffart b56fcd8ebd Implement a sync now button
The button is in the account config, next to the "pause/resume" button

Fixes #409
2013-10-30 16:27:00 +01:00
Olivier Goffart e38d6d974b Replace _Button* with _button
Identifiers starting with underscore and uppercase are reserved in C++.
2013-10-30 15:52:30 +01:00
Olivier Goffart 9500c5ffab Do not change the instruction anymore when we finish an item
The status is in the status.  Keep the original instruction so the
UI knows what to display for eath item
2013-10-30 10:46:05 +01:00
Olivier Goffart b079cedbf5 Use the status instead of the instruction for finished items 2013-10-30 10:44:41 +01:00
Olivier Goffart 6e088e28f5 Adjust the mtime in case of fake conflicts
"Fake conflicts" happen when the etag changes on the server, and the
mtime changes on the client,  but the actual file is still exactly
the same.  We correctly detect them as false conflict and we do not
generate the conflict file for them.
But we should also update the local mtime to the server mtime so future
sync don't get confused.
2013-10-29 12:23:51 +01:00
Olivier Goffart 01e2743bae Always download the conflicted files.
Conflicts have a direction==NONE. And they need to be downloaded, not uploaded
2013-10-29 12:13:30 +01:00
Olivier Goffart 75ffa787a6 emit the EndDownload progress at the right place.
It was put in rename instead of download
2013-10-29 12:13:30 +01:00
Olivier Goffart 4ad9f34807 Save the UPDATED files in the database
Those are files that were detected as "resolved conflict".
They should have been a conflict because they both were new, or both
had their local mtime or remote etag modified, but the size and mtime
is the same on the server.  This typically happen when the database is removed.
Nothing will be done for those file, but we still need to update the database.
2013-10-29 12:13:30 +01:00
Daniel Molkentin a91799a11c Make the setup wizard compile again
- introduces more jobs
- needs more cleaning up
2013-10-28 20:01:59 +01:00
Daniel Molkentin 44fd03c058 Merge pull request #1125 from iAndre89/patch-1
Update mingw32-cross-nsis-plugin-processes and mingw32-cross-nsis-plugin...
2013-10-28 09:20:09 -07:00
Andrea Sosso 083e75998f Update mingw32-cross-nsis-plugin-processes and mingw32-cross-nsis-plugin-uac 2013-10-28 17:17:10 +01:00
Olivier Goffart adc47948a5 Add a comment explaining OwncloudPropagator::start 2013-10-28 17:00:27 +01:00
Olivier Goffart 6e886e28e9 Merge branch 'propagator-job'
Conflicts:
	src/mirall/owncloudpropagator.cpp
2013-10-28 16:26:25 +01:00
Klaas Freitag e63fc184a5 Options parsing added. 2013-10-28 16:07:13 +01:00
Olivier Goffart 84a40dcb59 Refactor the new propagator in jobs
This makes the code (IMHO) more easy to understand, and will allow
even more easy parallelism
2013-10-28 15:58:35 +01:00
Olivier Goffart 8e90782107 Make owncloudcmd display the debug output 2013-10-28 15:45:37 +01:00
Klaas Freitag 68ba99b7f0 Fixed fileID parsing and improved logging. 2013-10-28 15:28:34 +01:00
Klaas Freitag 2fefc428a8 Write file Id to journal table.
Since this requires a change of existing sync journals, database migration
code was added.
2013-10-25 13:31:00 +02:00
Klaas Freitag 17220f2604 Query file Id from server if unknown. 2013-10-25 13:31:00 +02:00
Klaas Freitag 7a68961b25 Add handling for the file_id data to the sync items. 2013-10-25 13:31:00 +02:00
Daniel Molkentin aa2baa45fb Cleanups, ownership for ssl error handler 2013-10-24 12:55:26 +02:00
Daniel Molkentin eda5feb82c Bring back proper ssl handling 2013-10-24 00:29:08 +02:00
Daniel Molkentin d2b445c80c Basic port, misses wizard 2013-10-23 14:48:53 +02:00
hefee b4621e22e6 Merge pull request #1114 from owncloud/freebsd-inotify
Need inotify on FreeBSD for libsync
2013-10-23 02:36:12 -07:00
hefee 38679f79b5 Need inotify on FreeBSD for libsync 2013-10-23 01:24:27 +02:00
hefee a927caf2b0 Fixing Utility::platform for all platforms 2013-10-23 00:59:29 +02:00
Daniel Molkentin 29c846a764 WIP: Dissolve owncloudinfo class 2013-10-21 21:42:52 +02:00
Jenkins for ownCloud 804c9fbd6f [tx-robot] updated from transifex 2013-10-21 12:01:30 -04:00
Jenkins for ownCloud 2edebdef08 [tx-robot] updated from transifex 2013-10-20 06:49:52 -04:00
Daniel Molkentin a91ba0fd48 WIP: Move network tasks from ownCloudInfo into Job classes. 2013-10-18 12:24:29 +02:00
Daniel Molkentin a25d55a265 Add QtJson to 3rdparty, use it in ownCloudInfo 2013-10-18 02:00:19 +02:00
Jenkins for ownCloud c99f75b247 [tx-robot] updated from transifex 2013-10-17 12:48:20 -04:00
Olivier Goffart 0efbfb10aa Fix MOVE of directory.
Remove the right entry from the database (i.e: the original file name)
Fetch the etags of the sub entries
2013-10-17 13:06:39 +02:00
Olivier Goffart cb8006b89f Fix comments of the propagation step.
Also, don't mark item as removed if the instruction is not REMOVE
2013-10-17 12:09:44 +02:00
Klaas Freitag 660469cbf5 Do not propagate a move of the Shared folder. 2013-10-17 10:48:31 +02:00
Daniel Molkentin a06e551469 Merge pull request #1103 from Absolight/freebsd-port
Patches for FreeBSD
2013-10-16 08:52:46 -07:00
Olivier Goffart 746b86a1dd Save the progress db once a chunk has been upload
Allow to resume when we cancel the sync
2013-10-16 16:47:24 +02:00
Mathieu Arnold 1c594b6a8d FreeBSD doesn't have statvfs64, like MacOS X. 2013-10-16 15:57:59 +02:00
Mathieu Arnold 2b652422b9 Don't call make directly, it can have another name. 2013-10-16 15:57:05 +02:00
Olivier Goffart 313832de8d Put the progress database within the journal 2013-10-16 12:01:14 +02:00
Jenkins for ownCloud 250f281189 [tx-robot] updated from transifex 2013-10-15 23:26:29 -04:00
Olivier Goffart 2c63f7a24d Merge branch '1.4'
Conflicts:
	VERSION.cmake
	src/mirall/application.cpp
	src/mirall/application.h
	src/mirall/csyncthread.cpp
	src/mirall/folder.cpp
	src/mirall/folder.h
	src/mirall/folderman.cpp
2013-10-15 17:00:53 +02:00
Klaas Freitag a3927c5c2c Avoid quick flickering up of the ok-icon for the sync prepare state.
For the SyncPrepare phase now the icon that was displayed before is
kept. If the folder was disabled before, the sync icon is displayed.
2013-10-14 12:59:08 +02:00
Klaas Freitag 89cfa387cd Remove bogus html formatting tag. 2013-10-14 11:46:02 +02:00
Jenkins for ownCloud d2301c811e [tx-robot] updated from transifex 2013-10-13 19:29:34 -04:00
Jenkins for ownCloud 006be43c73 [tx-robot] updated from transifex 2013-10-10 22:18:01 -04:00
Daniel Molkentin 2240039442 Fix literal occurances of "ownCloud" in GUI 2013-10-10 11:34:45 +02:00
Klaas Freitag 3c95d342ee Handle sync enable flag correctly in folder scheduling.
This fixes bug #1083.
2013-10-09 14:27:28 +02:00
Klaas Freitag 53ac5427a8 Integrate progress dialog into settings dialog. 2013-10-09 14:27:28 +02:00
Klaas Freitag 1ed8afba09 Minor changes. 2013-10-09 14:27:28 +02:00
Klaas Freitag ef81a8a2ad Use qint64 rather than int64_t. 2013-10-08 15:41:15 +02:00
Klaas Freitag fa9d1614e7 Add some progress meassuring logging. 2013-10-08 14:07:46 +02:00
Jenkins for ownCloud fe46b588af [tx-robot] updated from transifex 2013-10-07 11:14:31 -04:00
Jenkins for ownCloud 290de7c430 [tx-robot] updated from transifex 2013-10-05 10:12:16 -04:00
Olivier Goffart 05fbfb520f Protect the sync database by a mutex since it is used by the thread 2013-10-04 21:05:46 +02:00
Daniel Molkentin 805e1330ad Compile with MinGW 2013-10-04 20:29:42 +02:00
Olivier Goffart 7c6fcf688c Fix the fact that some success was reported as error 2013-10-04 15:55:59 +02:00
Olivier Goffart 127055dd70 Refactor a bit the error reporting from the propagator
Add different classes of error failures.
Fatal error means the sync should be stopped.
SoftErrors are not to be displayed to the user.

We still need to make a classification of the errors.
2013-10-04 15:55:59 +02:00
Markus Goetz f4929e849e CsyncThread: Activate recursive PROPFIND 2013-10-04 15:42:40 +02:00
Mackie Messer ba9ac03b0b Put plugins in PlugIns, not Plugins on Mac
Requires 770539f0a5 on csync
2013-10-04 13:01:46 +02:00
Mackie Messer 0257f7e169 Add sqlite plugin for OS X 2013-10-04 13:01:46 +02:00
Daniel Molkentin 763cb43e46 Add qsqlite plugin on Windows 2013-10-04 12:45:17 +02:00
Olivier Goffart 8ed2588cdf Fix build with Qt5 2013-10-03 23:14:10 +02:00
Olivier Goffart d8d2d36638 Fix SQL Query 2013-10-03 23:00:47 +02:00
Olivier Goffart afc13e70b9 fix Qt5 test compilation 2013-10-03 22:51:40 +02:00
Olivier Goffart baa9ba089c Save the database after each operation. 2013-10-03 22:41:12 +02:00
Olivier Goffart 3495b822a5 TMP 2013-10-03 20:01:07 +02:00
Daniel Molkentin be88d425fc Fix connecting to the mysql db 2013-10-03 19:52:09 +02:00
Klaas Freitag 94a06cec5b WIP on the journal database. 2013-10-03 18:52:02 +02:00
Klaas Freitag 4008f6b309 Fix file status enum names. 2013-10-03 17:55:32 +02:00
Klaas Freitag daac6886a0 Added method setFileRecord to update sync journal 2013-10-03 17:48:14 +02:00
Daniel Molkentin e304dfd5b9 Add socketapi
Slightly amended by: Daniel Molkentin <danimo@owncloud.com>
2013-10-03 17:05:01 +02:00
Dominik Schmidt d0af48c417 Add KDE tmp files to .gitignore 2013-10-03 17:05:00 +02:00
Klaas Freitag 2e3aabf99b Read header without prefix path now that it's in 3rdparty. 2013-10-03 16:47:48 +02:00
Klaas Freitag 59bf8740a0 Add c_jhash.h header from csync to 3rdparty. 2013-10-03 16:41:23 +02:00
Olivier Goffart 21cd57228e Fix build with Qt5
Missing SQL module
2013-10-03 16:29:47 +02:00
Klaas Freitag 4501c64e61 Do not include whole header of csync_exclude. 2013-10-03 16:22:31 +02:00
Klaas Freitag 273105e78b Handle new case SyncAbortRequested. 2013-10-03 16:21:54 +02:00
Klaas Freitag 2707116350 Minor fixes for file_status 2013-10-03 16:12:50 +02:00
Klaas Freitag c7d30bae98 Handle new sync result enum. 2013-10-03 15:32:44 +02:00
Klaas Freitag be328581a7 Implemented sync status function for overlay icons. 2013-10-03 15:29:10 +02:00
Klaas Freitag c32bc27b3e Add sync journal database class that opens the csync db to read from it. 2013-10-03 15:29:10 +02:00
Klaas Freitag 0fef88a9b9 Some comments added. 2013-10-03 15:29:10 +02:00
Klaas Freitag 3e0fc56495 Dont show the [i] icon in the tray, see bug #942 2013-10-03 15:29:10 +02:00
Olivier Goffart 7ea3fc1533 Fix compilation of the test 2013-10-03 14:45:00 +02:00
Olivier Goffart 396ec4f888 Fix race condition in the logger.
Logs can come from multiple thread, we need to keep the _logstream
protected by a mutex
2013-10-03 14:37:13 +02:00
Olivier Goffart 79ea7c3eed Abort the sync asynchroniously
Don't block the GUI when clicking on pause

Mirall issue #968
2013-10-03 14:36:32 +02:00
Olivier Goffart b18810f381 Implement abort with the new propagator
abort was implemented in csync after the new propagator was written,
so it was not working with the new propagator
2013-10-03 14:35:56 +02:00
Jenkins for ownCloud 51d9cf099c [tx-robot] updated from transifex 2013-10-03 08:09:15 -04:00
Daniel Molkentin 339ed20abc Utility::showInFileManager(): Substitute valid desktop file parameters 2013-10-03 12:05:00 +02:00
Klaas Freitag 44ed577992 List results for all folders, not only one. 2013-10-03 11:36:18 +02:00
Klaas Freitag f6685accc3 Use subdirs for more xdg dirs to go through 2013-10-02 19:23:06 +02:00
Klaas Freitag 2c2e79c13d Consider the folder of items to delete from info window. 2013-10-02 19:23:06 +02:00
Daniel Molkentin 81961068a2 Utility: Move OS specific implementations into separate files 2013-10-02 19:15:56 +02:00
Daniel Molkentin 4e91a6450c Change the recent changes menu and file item dialog behavior
Recent Changes:
- "No items synced recently"
- Add separator to the details section
- Make items clickable (will open file location in file manager)
- If a file was deleted, disable it

File Item Dialog:
- Make items clickable (will open file location in file manager)

This is implemented via a new method Utility::showInFileManager(QString),
which goes through great lengths to use use the right file manager on all
OSes/WMs/DEs, and make sure it selects the file in question if possible.
This needs good testing, though.

Fixes #1044
2013-10-02 18:17:48 +02:00
Daniel Molkentin 3dc2547bb5 WIP 2013-10-02 18:16:32 +02:00
Olivier Goffart 47f299f0ee Send the last known etag to the server in a If-Match header
That way we avoid race conditions in case the file changed between the
update and the reconcile
2013-10-02 15:57:49 +02:00
Olivier Goffart d135aab86c clear the etag in every cases, not only when we upload files 2013-10-02 15:57:49 +02:00
Olivier Goffart e2a2b882bb Remove the unused errorDetails
It was not displayed to the user. Only use errorString instead.

Also report neon error to the user
2013-10-02 15:57:49 +02:00
Klaas Freitag d8309a64cb Even more cleanup. 2013-10-02 15:55:15 +02:00
Klaas Freitag 55722099fa More refactoring: Logger and Logbrowser out of application class. 2013-10-02 15:29:24 +02:00
Jenkins for ownCloud 48abe62151 [tx-robot] updated from transifex 2013-10-02 09:08:33 -04:00
Klaas Freitag 2149814428 Fix/enhance user information about problems on startup.
Pass the error conditions to the gui class.
2013-10-01 18:25:43 +02:00
Klaas Freitag ea1c951006 Refactoring: Moved all GUI related computing out of application class.
Created ownCloudGui class to contain all gui related stuff.
2013-10-01 13:58:01 +02:00
Klaas Freitag 4a96f9a5c9 Add Mirall namespace. 2013-10-01 13:58:01 +02:00
Klaas Freitag fcc4151810 Fix sequence of directories in help text. 2013-10-01 13:58:01 +02:00
Klaas Freitag 82cd79c004 Add unify defines to header. 2013-10-01 13:58:00 +02:00
Klaas Freitag 74983af3b4 Make evaluateSync public, review pls. 2013-10-01 13:58:00 +02:00
Klaas Freitag f5bcb11fe9 Add connected server to error message. 2013-10-01 13:58:00 +02:00
Klaas Freitag f6f1c638a5 Allow Constructor to be public, for synclibrary 2013-10-01 13:58:00 +02:00
Daniel Molkentin e250672e4a CMake: libhttplib -> httplib 2013-09-30 23:16:04 +02:00
Jenkins for ownCloud 13093f5de3 [tx-robot] updated from transifex 2013-09-30 09:04:25 -04:00
Daniel Molkentin df36ebf308 Merge branch '1.4'
Conflicts:
	VERSION.cmake
2013-09-30 13:34:10 +02:00
Jenkins for ownCloud 0d0c6a15fb [tx-robot] updated from transifex 2013-09-28 23:02:52 -04:00
Jenkins for ownCloud b4911cc5ce [tx-robot] updated from transifex 2013-09-26 23:55:07 -04:00
Klaas Freitag de9dcbd231 Transmit the new mtime of the file with the PUT request.
If the server supports it already, we can save another request by
sending the mtime as a header value in the PUT request and check the
servers reply for a acknoledge header.
2013-09-25 14:26:13 +02:00
Jenkins for ownCloud 00fff7f793 [tx-robot] updated from transifex 2013-09-24 11:58:13 -04:00
Klaas Freitag 5cf13dfa32 Make logging work again. 2013-09-24 15:56:03 +02:00
Klaas Freitag 27b9a5aed9 Merge branch '1.4', brings in the changes we did for 1.4.1 2013-09-24 14:18:25 +02:00
Jenkins for ownCloud 4de99d2540 [tx-robot] updated from transifex 2013-09-22 11:52:39 -04:00
Jenkins for ownCloud 5b60522e5e [tx-robot] updated from transifex 2013-09-20 09:44:46 -04:00
Jenkins for ownCloud b334c82fdd [tx-robot] updated from transifex 2013-09-18 10:45:45 -04:00
Jenkins for ownCloud 9ed4aa4111 [tx-robot] updated from transifex 2013-09-16 10:34:17 -04:00
Jenkins for ownCloud 41b1b53c76 [tx-robot] updated from transifex 2013-09-13 20:47:28 -04:00
Thomas Müller 60ef5535c6 fixing testOctetsToString
(cherry picked from commit 78c8f13645)
2013-09-13 20:14:53 +02:00
Thomas Müller e38d0807c9 moving back to 1024 as divider for kB, MB, GB & TB
(cherry picked from commit c87c456ae0)
2013-09-13 20:14:47 +02:00
Daniel Molkentin 7045a6c239 Merge pull request #996 from owncloud/dont-ship-doc_scripts
Don't ship doc/scripts/README.rst via sphinx
2013-09-12 17:25:39 -07:00
hefee 2b1602872c Don't ship doc/scripts/README.rst via sphinx 2013-09-13 01:26:02 +02:00
Daniel Molkentin b488ad12c2 Do not build org and com theming when building from tar ball
Fixes #989
2013-09-12 12:56:24 +02:00
Daniel Molkentin 574e029254 Setting thread priority is only possible after calling start() 2013-09-11 15:51:06 +02:00
Jenkins for ownCloud 91759c4a27 [tx-robot] updated from transifex 2013-09-11 06:40:51 -04:00
Klaas Freitag ce5934461e Do not en- or disable the watcher in setSyncEnabled.
The watcher is handled through the start and stop sync hooks in the
folder class. Even if the the folder is disabled and the watcher
fires, the folder does not schedule because it checks first if the
folder is enabled.
2013-09-11 12:33:07 +02:00
Klaas Freitag 6f637e40d8 Enable and disable syncing also in the folder objects. 2013-09-11 10:32:09 +02:00
Klaas Freitag ec06663dee Handle startup network errors correctly. 2013-09-11 10:32:09 +02:00
Klaas Freitag 3c5c432e1d Minor code cleanups- 2013-09-11 10:32:09 +02:00
Olivier Goffart 927f7549d4 Revert "Compile (find httpbf)"
This reverts commit 2d2e843804.

Turns out i had an old build of csync
2013-09-11 09:00:27 +02:00
Olivier Goffart 177114f8d9 Initialize the size of the SyncItem 2013-09-11 08:49:09 +02:00
Olivier Goffart 6bfdfd1af0 Fix progress with new propagator 2013-09-11 08:42:29 +02:00
Olivier Goffart 2d2e843804 Compile (find httpbf) 2013-09-11 08:11:03 +02:00
Daniel Molkentin 55f2fcb4c6 Folder Wizard: More sanity checks
Check if a server folder or its parent
is already part of a sync and refuse
to create a sync in this case.

Avoids "recursive syncing"

Fixes #962
2013-09-10 23:37:52 +02:00
Daniel Molkentin 59425741b6 Send basic auth in utf8.
Implies circumventing QAuthenticator and handling
authentication manually again.

Fixes #941
2013-09-10 23:03:52 +02:00
Daniel Molkentin 3577ba2981 Fix httpbf/neon linkage 2013-09-10 19:50:44 +02:00
Jenkins for ownCloud d4477b0d65 [tx-robot] updated from transifex 2013-09-10 09:42:18 -04:00
Daniel Molkentin 48b4c57d92 Use shared version of libhttpbf, package it on win 2013-09-10 14:45:08 +02:00
Daniel Molkentin 00d09763af Fix compile error 2013-09-10 11:37:52 +02:00
Daniel Molkentin 5639572ef3 Wait up to 30 secs before complaining about missing systray 2013-09-10 11:37:52 +02:00
Daniel Molkentin 1e7716abb4 Merge pull request #964 from morriswinkler/patch-1
Update building.rst
2013-09-10 02:28:03 -07:00
morriswinkler 751181d14f Update building.rst
eider fix it or add the note here
2013-09-09 19:09:08 +02:00
Olivier Goffart 013b87f9c5 ignore the progress database 2013-09-09 15:18:28 +02:00
Olivier Goffart 6da2f6bbaa Qt5: QSettings is no longer case insensitive 2013-09-09 14:00:13 +02:00
Olivier Goffart 198cb43ad6 Qt5: Q_WS_* macro were deprecated, replace by QT_OS_*
in particular, QT_WS_X11 is no longer defined
2013-09-09 13:31:39 +02:00
Jenkins for ownCloud db648a0268 [tx-robot] updated from transifex 2013-09-08 20:37:37 -04:00
Jenkins for ownCloud 7cea2225de [tx-robot] updated from transifex 2013-09-07 04:38:12 -04:00
Daniel Molkentin 51a7cbeb55 kill warning 2013-09-05 20:15:55 +02:00
Daniel Molkentin 171a9e1575 fix Qt 5 build on Mac/Win 2013-09-05 19:53:39 +02:00
Klaas Freitag 76deabe4df Use List to handle errors and display multiline. 2013-09-05 19:28:23 +02:00
Daniel Molkentin 6b9950a9a0 Qt5: DBUS is only needed for FDO 2013-09-05 18:41:49 +02:00
Daniel Molkentin c6ed7dc586 Tests: Find test lib in Qt5 2013-09-05 18:06:00 +02:00
Daniel Molkentin 35ac6610c7 Compile with Qt5 on Linux 2013-09-05 17:13:31 +02:00
Jenkins for ownCloud 121efd8ff1 [tx-robot] updated from transifex 2013-09-05 07:30:27 -04:00
Daniel Molkentin 23d8f01012 Fix locating translations on linux 2013-09-05 11:08:00 +02:00
Daniel Molkentin 573aaec9fd Fix propagator test 2013-09-04 17:29:19 +02:00
Klaas Freitag 8fe102662d Merge branch 'propagator-ng': Fixes to work with new LGPL ocsync.
Conflicts:
	src/mirall/csyncthread.cpp
2013-09-04 16:33:06 +02:00
Klaas Freitag b676ffe208 Some more info about the exclude matching. 2013-09-04 15:17:43 +02:00
Daniel Molkentin 625b21152e Merge branch 'qt5' 2013-09-04 15:01:21 +02:00
Daniel Molkentin 385759f3c9 bump version 2013-09-04 15:00:53 +02:00
Olivier Goffart bf6d0a521c Compile with Qt5 2013-08-28 20:58:22 +02:00
Olivier Goffart 336bbb2403 Compile with Qt4 2013-08-28 20:14:40 +02:00
Daniel Molkentin 73da086964 Initial changes to also build on Qt5, doesn't compile yet 2013-08-28 17:03:31 +02:00
Daniel Molkentin 58f4f3623f Startup: Unity has no proper Systray implementation
...so it can't respond to isSysTrayAvailable()
2013-08-28 15:51:00 +02:00
Olivier Goffart 3c2bb1e2bc Compile after the merge 2013-08-21 15:29:04 +02:00
Olivier Goffart 24af9f38f4 Merge branch 'csync_lgpl' into propagator-ng
Conflicts:
	src/mirall/csyncthread.cpp
	src/mirall/csyncthread.h
	src/mirall/folder.cpp
	src/mirall/progressdispatcher.h
	src/mirall/syncfileitem.h
2013-08-21 13:19:02 +02:00
Klaas Freitag 98efab83a1 Compile against ocsync based on csync 0.50 2013-08-20 13:26:03 +02:00
Olivier Goffart e4128cd5d8 progress with new propagator 2013-08-14 19:59:16 +02:00
Olivier Goffart f8e6326880 Default to not cancel
So that the owncloudcmd client is not blocked
2013-08-14 15:44:30 +02:00
Olivier Goffart 67c5f513aa Fix compilation after merge 2013-08-14 15:36:34 +02:00
Olivier Goffart 0589bfc51b Merge branch 'master' into propagator-ng
This just fix the conflict.
Do not compile or work yet

Conflicts:
	src/CMakeLists.txt
	src/mirall/csyncthread.cpp
	src/mirall/csyncthread.h
	src/mirall/owncloudfolder.cpp
	src/mirall/syncfileitem.h
	test/CMakeLists.txt
2013-08-14 15:19:21 +02:00
Olivier Goffart 04f32bd397 Revert "TMP threaded"
This reverts commit 5bb4c3be43.
2013-08-14 14:59:32 +02:00
Olivier Goffart 5bb4c3be43 TMP threaded 2013-06-03 10:43:21 +02:00
Olivier Goffart 07ce6cfa79 don't use member variable of the propagator 2013-05-16 14:50:36 +02:00
Olivier Goffart 9ce47c9675 make the propagator asynchronous 2013-05-16 13:54:22 +02:00
Olivier Goffart 40255d643c propagator-ng: adapt to the merge of rename_folders branch 2013-05-15 15:22:20 +02:00
Olivier Goffart b31200a6f2 propagator-ng: fix setting the mtime 2013-05-10 13:20:21 +02:00
Olivier Goffart 98cbb599b8 Fix handling of conflicting directories
We can safely ignore them in the propagator
2013-05-10 12:35:10 +02:00
Olivier Goffart ecd314cef5 Give the tmp file a proper hidden and excluded name 2013-05-08 14:31:52 +02:00
Olivier Goffart 0b1ecd0ac6 propagator-ng: Abort on fatal error 2013-05-08 13:30:30 +02:00
Olivier Goffart 852e30ef07 owncloudcmd: don't abort on unknown argument 2013-05-08 12:11:23 +02:00
Olivier Goffart 2193da0ab5 Fix a few FIXME 2013-05-07 17:47:29 +02:00
Olivier Goffart 7cd12e7dc5 remove some FIXME 2013-05-07 17:16:11 +02:00
Olivier Goffart 685bf395be propagator-ng: resume uploads
Currently i think it corrupt the files
2013-05-06 18:41:56 +02:00
Olivier Goffart 0636ae6f28 propagator-ng: be able to resume download 2013-05-06 16:59:11 +02:00
Olivier Goffart 7f8eba3700 propagator-ng: set the modtime on downloaded files 2013-05-06 12:09:21 +02:00
Olivier Goffart 02957aba45 propagator-ng: Emit the fileReceived signal 2013-05-05 12:46:40 +02:00
Klaas Freitag 946258ca59 Created a test file for ownCloudPropagator. Not much in yet. 2013-05-05 12:36:42 +02:00
Klaas Freitag 2e53e2e4e0 Really return true in case of error. 2013-05-05 12:34:38 +02:00
Klaas Freitag 721a8f79ab Improve error handling, add error string to each individual file item. 2013-05-05 11:47:19 +02:00
Olivier Goffart ecaf66db5d style: use _ in front of member variable 2013-05-05 11:32:12 +02:00
Olivier Goffart 0c775aba6d propagator-ng: get the etag also in the GET request 2013-05-05 11:32:12 +02:00
Olivier Goffart 71b238031f Fix compilation after previous rebase 2013-05-05 11:32:12 +02:00
Olivier Goffart 662bd4e5fe propagator-ng: handle conflict
Always download the file from the server.
And if they are equals, ignore the conflict
2013-05-05 11:17:42 +02:00
Olivier Goffart 5118054fa3 Enable the backup of conflicts files in owncloudcmd 2013-05-05 11:17:07 +02:00
Klaas Freitag c956d11183 More error handling of propagator, some cleanups. 2013-05-04 17:14:47 +02:00
Klaas Freitag 7df23a1b19 Proper error reporting of propagator - WIP 2013-05-04 17:14:47 +02:00
Klaas Freitag 72580d7213 move command line client into bin dir 2013-05-04 17:14:47 +02:00
Olivier Goffart 264cc73806 Implement renaming on windows
(Not actually tested)
2013-05-04 16:18:13 +02:00
Olivier Goffart c041076c95 Handle renames 2013-05-04 15:32:11 +02:00
Olivier Goffart f6ff189f35 Add owncloudcmd
A simple commandline client like ocsync.
The goal is to be used bu the t1.pl test
2013-05-04 13:52:35 +02:00
Olivier Goffart e1e8842548 New owncloud propagator that skip the vio abstraction layer
The vio abstraction layer within csync is inneficient for the owncloud
use case because not all calls maps well to the POSIX interface. We can
be much more efficient by doing exactly what we need.

Also, this will allow us to scedule better the calls and possibly to use
threads.
2013-05-04 11:02:30 +02:00
197 arquivos alterados com 32343 adições e 26313 exclusões
+6
Ver Arquivo
@@ -6,3 +6,9 @@ CMakeLists.txt.user*
*~
*.autosave
doc/_build/*
*~
*.kate-swp
*.kdev4
win/
admin/win/nsi/l10n/pofiles/*.po
+18 -12
Ver Arquivo
@@ -21,8 +21,20 @@ 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/")
#####
## handle DBUS for Fdo notifications
if( UNIX AND NOT APPLE )
add_definitions( -DUSE_FDO_NOTIFICATIONS)
set(WITH_DBUS ON)
endif()
####
include(GNUInstallDirs)
include(DefineInstallationPaths)
include(QtVersionAbstraction)
setup_qt()
include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
@@ -58,19 +70,14 @@ else()
endif()
#####
#####
## handle DBUS for Fdo notifications
if( UNIX AND NOT APPLE )
add_definitions( -DUSE_FDO_NOTIFICATIONS)
endif()
####
#### find libs
find_package(Qt4 4.7.0 COMPONENTS QtCore QtGui QtXml QtNetwork QtTest QtWebkit REQUIRED )
if( UNIX AND NOT APPLE ) # Fdo notifications
find_package(Qt4 4.7.0 COMPONENTS QtDBus REQUIRED )
endif()
#find_package(Qt4 4.7.0 COMPONENTS QtCore QtGui QtXml QtNetwork QtTest QtWebkit REQUIRED )
#if( UNIX AND NOT APPLE ) # Fdo notifications
# find_package(Qt4 4.7.0 COMPONENTS QtDBus REQUIRED )
#endif()
find_package(Neon REQUIRED)
find_package(Csync REQUIRED)
find_package(QtKeychain REQUIRED)
if(UNIX)
find_package(INotify REQUIRED)
else()
@@ -78,7 +85,6 @@ find_package(INotify)
endif()
find_package(Sphinx)
find_package(PdfLatex)
find_package(QtKeychain)
set(WITH_QTKEYCHAIN ${QTKEYCHAIN_FOUND})
set(USE_INOTIFY ${INOTIFY_FOUND})
-2
Ver Arquivo
@@ -21,11 +21,9 @@ set( CSYNC_BINARY_DIR @CSYNC_BINARY_DIR@ )
set( MINGW_ROOT @CMAKE_FIND_ROOT_PATH@ )
if(CSYNC_BINARY_DIR)
set( CSYNC_LIBRARY_DIR "${CSYNC_BINARY_DIR}/src" )
set( CSYNC_PLUGIN_DIR "${CSYNC_BINARY_DIR}/modules" )
set( CSYNC_CONFIG_DIR "${CSYNC_BINARY_DIR}/config" )
else()
set( CSYNC_LIBRARY_DIR "${MINGW_ROOT}/bin" )
set( CSYNC_PLUGIN_DIR "${MINGW_ROOT}/plugins-0" ) #FIXME: whatever it is
set( CSYNC_CONFIG_DIR "${MINGW_ROOT}/etc/ocsync" )
endif()
set( BUILD_OWNCLOUD_OSX_BUNDLE @BUILD_OWNCLOUD_OSX_BUNDLE@)
+31
Ver Arquivo
@@ -1,6 +1,37 @@
ChangeLog
=========
version 1.5.0 (release 2013-12-12 ), csync 0.91.4 required
* New owncloud propagator that skips the vio abstraction layer
* Add owncloudcmd to replace the ocsync command line tool
* Localize Windows installer
* Allow to sign in and out
* Ask for password if missing
* Introduce activity view
* Introduce black list for files which could not be synced
* Enabling accessbility by shipping accessibility enables on OS X (#736)
* Toggle Settings window when clicking on systray icon on Win and KDE (#896)
* FolderWizard: Sanitize error detection (#1201)
* Set proper enable state of blacklist button after the dialog was opened
* Set proper tooltips in blacklist
* Translatable error messages for file errors
* Add man page for owncloudcmd (#1234)
* Don't close setup wizard when the initial sync run is started
* Close the sync journal if a folder gets removed (#1252)
* Activity: Avoid horizontal scrollbar (#1213)
* Fix crash (#1229)
* Resize wizard appropriately (#1130)
* Fix account identity test (#1231)
* Maintain the file type correctly
* Display rename-target in sync protocol action column
* Let recursive removal also remove the top dir
* If item is a directory, remove its contents from the database as well (#1257)
* Install headers for owncloudsync library
* Fix opening the explorer with a selected file in Windows (#1249)
* Add build number into versioning scheme
* Windows: Fix rename of temporary files
* Windows: Fix move file operation
version 1.4.2 (release 2013-10-18 ), csync 0.90.4 required
* Do not show the warning icon in the tray (#944)
+5 -4
Ver Arquivo
@@ -9,10 +9,11 @@ else ()
endif()
include( VERSION.cmake )
set( CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR} )
set( CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR} )
set( CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH} )
set( CPACK_PACKAGE_VERSION ${VERSION} )
set( CPACK_PACKAGE_VERSION_MAJOR ${MIRALL_VERSION_MAJOR} )
set( CPACK_PACKAGE_VERSION_MINOR ${MIRALL_VERSION_MINOR} )
set( CPACK_PACKAGE_VERSION_PATCH ${MIRALL_VERSION_PATCH} )
set( CPACK_PACKAGE_VERSION_BUILD ${MIRALL_VERSION_BUILD} )
set( CPACK_PACKAGE_VERSION ${MIRALL_VERSION_FULL}${MIRALL_VERSION_SUFFIX} )
if(APPLE)
set( CPACK_GENERATOR "DragNDrop" )
+25 -5
Ver Arquivo
@@ -1,6 +1,26 @@
set( VERSION_MAJOR 1 )
set( VERSION_MINOR 4 )
set( VERSION_PATCH 2 )
set( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX}")
set( SOVERSION 0 )
set( MIRALL_VERSION_MAJOR 1 )
set( MIRALL_VERSION_MINOR 5 )
set( MIRALL_VERSION_PATCH 0 )
set( MIRALL_SOVERSION 0 )
if ( NOT DEFINED MIRALL_VERSION_SUFFIX )
set( MIRALL_VERSION_SUFFIX "" ) #e.g. beta1, beta2, rc1
endif( NOT DEFINED MIRALL_VERSION_SUFFIX )
if( NOT DEFINED MIRALL_VERSION_BUILD )
set( MIRALL_VERSION_BUILD "0" ) # Integer ID. Generated by the build system
endif( NOT DEFINED MIRALL_VERSION_BUILD )
# Composite defines
# Used e.g. for libraries Keep at x.y.z.
set( MIRALL_VERSION "${MIRALL_VERSION_MAJOR}.${MIRALL_VERSION_MINOR}.${MIRALL_VERSION_PATCH}" )
# Version with Build ID. Used in the installer
set( MIRALL_VERSION_FULL ${MIRALL_VERSION} )
set( MIRALL_VERSION_STRING ${MIRALL_VERSION} )
set( MIRALL_VERSION_FULL "${MIRALL_VERSION_FULL}.${MIRALL_VERSION_BUILD}" )
set( MIRALL_VERSION_STRING "${MIRALL_VERSION}${MIRALL_VERSION_SUFFIX}" )
if( MIRALL_VERSION_BUILD )
set( MIRALL_VERSION_STRING "${MIRALL_VERSION_STRING} (build ${MIRALL_VERSION_BUILD})" )
endif( MIRALL_VERSION_BUILD )
+48
Ver Arquivo
@@ -0,0 +1,48 @@
[main]
host = https://www.transifex.net
[owncloud.mirall-wininstaller]
host = https://www.transifex.net
source_file = pofiles/messages.pot
source_lang = en
type = PO
minimum_perc = 5
# simple one-to-one language mappings
trans.ca = pofiles/ca.po
trans.el = pofiles/el.po
trans.es = pofiles/es.po
trans.es_AR = pofiles/es_AR.po
trans.eu = pofiles/eu.po
trans.fa = pofiles/fa.po
trans.fr = pofiles/fr.po
trans.gl = pofiles/gl.po
trans.it = pofiles/it.po
trans.nl = pofiles/nl.po
trans.pl = pofiles/pl.po
trans.pt_BR = pofiles/pt_BR.po
trans.ru = pofiles/ru.po
trans.sl = pofiles/sl.po
trans.sv = pofiles/sv.po
trans.tr = pofiles/tr.po
trans.uk = pofiles/uk.po
trans.zh_TW = pofiles/zh_TW.po
trans.zh_CN = pofiles/zh_CN.po
# special handling below
# de_DE holds the formal translation which we want as default
trans.de_DE = pofiles/de.po
# choose one of the given translations on transifex as default
trans.pt_PT = pofiles/pt.po
# choose a special language as more generic default
trans.cs_CZ = pofiles/cs.po
trans.et_EE = pofiles/et.po
trans.fi_FI = pofiles/fi.po
trans.ja_JP = pofiles/ja.po
trans.hu_HU = pofiles/hu.po
trans.sk_SK = pofiles/sk.po
trans.th_TH = pofiles/th.po
+43
Ver Arquivo
@@ -0,0 +1,43 @@
# Auto-generated - do not modify
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "${APPLICATION_EXECUTABLE} prozesuak hiltzen."
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "kill prozesua ez da aurkitu!"
StrCpy $PageReinstall_NEW_Field_2 "Desinstalatu instalatu baino lehen"
StrCpy $PageReinstall_NEW_Field_3 "Ez desinstalatu"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Dagoeneko Instalatuta"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Hautatu nola nahi duzun ${APPLICATION_NAME} instalatzea."
StrCpy $PageReinstall_SAME_Field_2 "Gehitu/Berrinstalatu osagaiak"
StrCpy $PageReinstall_SAME_Field_3 "Desinstalatu ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Desinstalatu ${APPLICATION_NAME}"
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Hasierako Menuko Lasterbidea"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Hasierako Menuan ${APPLICATION_NAME}rako Abiarazle bizkorra sortzen."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Mahaigaineko Lasterbidea"
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "Mahaigaineko Lasterbideak Sortzen"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "Abiarazle Bizkorreko Lasterbidea"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "Abiarazle Bizkorreko Lasterbidea Sortzen"
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "${APPLICATION_NAME} lasterbidea."
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "${APPLICATION_NAME}rako mahaigaineko lasterbidea."
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "${APPLICATION_NAME}erako Abiarazle Bizkorreko Lasterbidea."
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Ezabatu ${APPLICATION_NAME}en datuen karpeta zure ordenagailutik."
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "${APPLICATION_NAME}en datuen karpeta ezabatu nahi duzu?"
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "Bai, ezabtu datu karpeta hau."
StrCpy $UNINSTALLER_FILE_Detail "Desinstalatzailea idazten"
StrCpy $UNINSTALLER_REGISTRY_Detail "Instalatzaileko Erregistroko Giltzak idazten"
StrCpy $UNINSTALLER_FINISHED_Detail "Bukatuta"
StrCpy $UNINSTALL_ABORT "Desinstalazioak erabiltzaileak bertan behera utzi du"
StrCpy $INIT_NO_QUICK_LAUNCH "Abiarazle Bizkorreko Lasterbidea (E/E)"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "Instalatzaileak administratzaile baimenak behar ditu, saiatu berriro"
StrCpy $INIT_INSTALLER_RUNNING "Instalatzailea dagoeneko martxan da."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Desinstalatzaile honek administratzaile baimenak behar ditu, saiatu berriro"
StrCpy $INIT_UNINSTALLER_RUNNING "Desinstalatzailea dagoeneko martxan da."
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "Show release notes"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Found ${APPLICATION_EXECUTABLE} process(s) which need to be stopped.$\nDo you want the installer to stop these for you?"
StrCpy $PageReinstall_NEW_Field_1 "An older version of ${APPLICATION_NAME} is installed on your system. It is recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_OLD_Field_1 "A newer version of ${APPLICATION_NAME} is already installed! It is not recommended that you install an older version. If you really want to install this older version, it is better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} is already installed.\r\nSelect the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Choose the maintenance option to perform."
StrCpy $SEC_APPLICATION_DETAILS "Installing ${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME} essentials."
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Leave unchecked to keep the data folder for later use or check to delete the data folder."
StrCpy $UNINSTALL_MESSAGEBOX "It does not appear that ${APPLICATION_NAME} is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?"
StrCpy $UAC_ERROR_ELEVATE "Unable to elevate, error:"
StrCpy $SectionGroup_Shortcuts "Shortcuts"
+43
Ver Arquivo
@@ -0,0 +1,43 @@
# Auto-generated - do not modify
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "Zobraz poznámky k vydání"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Nalezen proces(y) ${APPLICATION_EXECUTABLE}, které je nutné ukončit .$\nPřejete si, aby je instalátor ukončil?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "Ukončuji proces ${APPLICATION_EXECUTABLE}."
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "Proces k ukončení nebyl nalezen! "
StrCpy $PageReinstall_NEW_Field_1 "Starší verze ${APPLICATION_NAME} je nainstalována na tomto systému. Doporučuje se předem tuto verzi odinstalovat. Zvolte operaci, kterou chcete uskutečnit a klikněte na tlačítko Další pro pokračování."
StrCpy $PageReinstall_NEW_Field_2 "Odinstalovat před instalací"
StrCpy $PageReinstall_NEW_Field_3 "Neodinstalovávat"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Již nainstalováno"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Zvolte, jak chcete ${APPLICATION_NAME} nainstalovat."
StrCpy $PageReinstall_OLD_Field_1 "Novější verze aplikace ${APPLICATION_NAME} jejiž nainstalována. Instalace starší verze se nedoporučuje. Pokud opravdu chcete tuto starší verzi nainstalovat, tak je lepší nejprve odinstalovat současnou verzi. Zvolte požadovanou operaci a klikněte na Další pro pokračování."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} je již nainstalována.\nZvolte požadovanou operaci a klikněte na Další pro pokračování."
StrCpy $PageReinstall_SAME_Field_2 "Přidat/odinstalovat komponenty"
StrCpy $PageReinstall_SAME_Field_3 "Odinstalovat ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Odinstalovat ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Vyberte údržbovou volbu k provedení."
StrCpy $SEC_APPLICATION_DETAILS "Instalují se náležitosti ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Zástupce v Nabídce Start"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Přidávám zástupce pro ${APPLICATION_NAME} do Nabídky Start."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Zástupce na ploše"
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "Vytvářím zástupce na ploše"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "Zástupce v panelu rychlého spuštění"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "Vytvářím zástupce v panelu rychlého spuštění"
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "Náležitosti ${APPLICATION_NAME}"
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "Zástupce ${APPLICATION_NAME}"
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Zástupce na ploše pro ${APPLICATION_NAME}"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "Zástupce rychlého spuštění pro ${APPLICATION_NAME}."
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Odstraňte složku s daty aplikace ${APPLICATION_NAME} z tohoto počítače."
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "Chcete smazat složku s daty ${APPLICATION_NAME}?"
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Ponechejte nezaškrtnuté, pokud chcete složku s daty ponechat pro pozdější využití nebo zaškrtněte, pokud chcete složku smazat."
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "Ano, smaž tuto složku s daty."
StrCpy $UNINSTALLER_FILE_Detail "Zapisuji odinstalátor"
StrCpy $UNINSTALLER_REGISTRY_Detail "Zapisuji do registrů instalační klíče "
StrCpy $UNINSTALLER_FINISHED_Detail "Dokončeno"
StrCpy $UNINSTALL_MESSAGEBOX "Nezdá se, že ${APPLICATION_NAME} je nainstalována ve složce '$INSTDIR'.\nChcete pokračovat (nedoporučuje se)?"
StrCpy $UNINSTALL_ABORT "Odinstalace zrušena uživatelem"
StrCpy $INIT_NO_QUICK_LAUNCH "Zástupce rychlého spuštění (není k dispozici)"
StrCpy $UAC_ERROR_ELEVATE "Nelze zvýšit, chyba:"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "Tento instalátor vyžaduje správcovská oprávnění, opakujte znovu"
StrCpy $INIT_INSTALLER_RUNNING "Instalátor je již spuštěn."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Tento odinstalátor vyžaduje správcovská oprávnění, opakujte znovu"
StrCpy $INIT_UNINSTALLER_RUNNING "Odinstalátor je již spuštěn."
StrCpy $SectionGroup_Shortcuts "Shortcuts"
+43
Ver Arquivo
@@ -0,0 +1,43 @@
# Auto-generated - do not modify
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "toon releaseopmerkingen"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Proces(sen) ${APPLICATION_EXECUTABLE} moet worden gestopt.$\nWilt u dat het installatieprogramma dat voor u doet?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "Stoppen ${APPLICATION_EXECUTABLE} processen."
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "Het te stoppen proces is niet gevonden!"
StrCpy $PageReinstall_NEW_Field_1 "Er is een oudere versie van ${APPLICATION_NAME} geïnstalleerd op uw systeem. geadviseerd wordt om de huidige versie te de-installeren voordat de nieuwe versie wordt geïnstalleerd. Selecteer de uit te voeren actie en klik op Verder om door te gaan."
StrCpy $PageReinstall_NEW_Field_2 "De-installeren voor installeren"
StrCpy $PageReinstall_NEW_Field_3 "Niet de-installeren"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Reeds geinstalleerd"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Kies hoe u ${APPLICATION_NAME} wilt installeren."
StrCpy $PageReinstall_SAME_Field_3 "De-installeer ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "De-installeer ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Kies de uit te voeren onderhoudsoptie."
StrCpy $SEC_APPLICATION_DETAILS "Installeren ${APPLICATION_NAME} basis."
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Startmenu snelkoppeling"
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Werkblad snelkoppeling"
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "Aanmaken werkblad snelkoppelingen"
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME} basis."
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "${APPLICATION_NAME} snelkoppeling."
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Werkblad snelkoppeling voor ${APPLICATION_NAME}."
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Verwijder ${APPLICATION_NAME}'s data map van uw computer."
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "Wilt u de ${APPLICATION_NAME}'s data map verwijderen?"
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "Ja, verwijder deze data map."
StrCpy $UNINSTALLER_FILE_Detail "Wegschrijven Uninstaller"
StrCpy $UNINSTALLER_REGISTRY_Detail "Wegschrijven installer Registersleutels"
StrCpy $UNINSTALLER_FINISHED_Detail "Klaar"
StrCpy $UNINSTALL_ABORT "De-installatie afgebroken door de gebruiker"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "Dit installatieprogramma vereist administrator rechten. Probeer het opnieuw"
StrCpy $INIT_INSTALLER_RUNNING "De Installer is al gestart."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Deze uninstaller vereist administrator toegang, probeer opnieuw"
StrCpy $INIT_UNINSTALLER_RUNNING "De uninstaller is al gestart."
StrCpy $PageReinstall_OLD_Field_1 "A newer version of ${APPLICATION_NAME} is already installed! It is not recommended that you install an older version. If you really want to install this older version, it is better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} is already installed.\r\nSelect the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_Field_2 "Add/Reinstall components"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Adding shortcut for ${APPLICATION_NAME} to the Start Menu."
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "Quick Launch Shortcut"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "Creating Quick Launch Shortcut"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "Quick Launch shortcut for ${APPLICATION_NAME}."
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Leave unchecked to keep the data folder for later use or check to delete the data folder."
StrCpy $UNINSTALL_MESSAGEBOX "It does not appear that ${APPLICATION_NAME} is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?"
StrCpy $INIT_NO_QUICK_LAUNCH "Quick Launch Shortcut (N/A)"
StrCpy $UAC_ERROR_ELEVATE "Unable to elevate, error:"
StrCpy $SectionGroup_Shortcuts "Shortcuts"
+43
Ver Arquivo
@@ -0,0 +1,43 @@
# Auto-generated - do not modify
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "Show release notes"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Found ${APPLICATION_EXECUTABLE} process(s) which need to be stopped.$\nDo you want the installer to stop these for you?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "Killing ${APPLICATION_EXECUTABLE} processes."
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "Process to kill not found!"
StrCpy $PageReinstall_NEW_Field_1 "An older version of ${APPLICATION_NAME} is installed on your system. It is recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_NEW_Field_2 "Uninstall before installing"
StrCpy $PageReinstall_NEW_Field_3 "Do not uninstall"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Already Installed"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Choose how you want to install ${APPLICATION_NAME}."
StrCpy $PageReinstall_OLD_Field_1 "A newer version of ${APPLICATION_NAME} is already installed! It is not recommended that you install an older version. If you really want to install this older version, it is better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} is already installed.\r\nSelect the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_Field_2 "Add/Reinstall components"
StrCpy $PageReinstall_SAME_Field_3 "Uninstall ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Uninstall ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Choose the maintenance option to perform."
StrCpy $SEC_APPLICATION_DETAILS "Installing ${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Start Menu Program Shortcut"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Adding shortcut for ${APPLICATION_NAME} to the Start Menu."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Desktop Shortcut"
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "Creating Desktop Shortcuts"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "Quick Launch Shortcut"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "Creating Quick Launch Shortcut"
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "${APPLICATION_NAME} shortcut."
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Desktop shortcut for ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "Quick Launch shortcut for ${APPLICATION_NAME}."
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Remove ${APPLICATION_NAME}'s data folder from your computer."
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "Do you want to delete ${APPLICATION_NAME}'s data folder?"
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Leave unchecked to keep the data folder for later use or check to delete the data folder."
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "Yes, delete this data folder."
StrCpy $UNINSTALLER_FILE_Detail "Writing Uninstaller"
StrCpy $UNINSTALLER_REGISTRY_Detail "Writing Installer Registry Keys"
StrCpy $UNINSTALLER_FINISHED_Detail "Finished"
StrCpy $UNINSTALL_MESSAGEBOX "It does not appear that ${APPLICATION_NAME} is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?"
StrCpy $UNINSTALL_ABORT "Uninstall aborted by user"
StrCpy $INIT_NO_QUICK_LAUNCH "Quick Launch Shortcut (N/A)"
StrCpy $UAC_ERROR_ELEVATE "Unable to elevate, error:"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "This installer requires admin access, try again"
StrCpy $INIT_INSTALLER_RUNNING "The installer is already running."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "This uninstaller requires admin access, try again"
StrCpy $INIT_UNINSTALLER_RUNNING "The uninstaller is already running."
StrCpy $SectionGroup_Shortcuts "Shortcuts"
+43
Ver Arquivo
@@ -0,0 +1,43 @@
# Auto-generated - do not modify
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "Näita väljalaske märkmeid"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "Protsessi ${APPLICATION_EXECUTABLE} lõpetamine."
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "Ei leitud protsessi, mida tappa!"
StrCpy $PageReinstall_NEW_Field_2 "Eemalda enne paigaldamist"
StrCpy $PageReinstall_NEW_Field_3 "Ära paigalda"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Juba paigaldatud"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Vali, kuidas sa soovid paigaldada ${APPLICATION_NAME}."
StrCpy $PageReinstall_SAME_Field_2 "Lisa/Taaspaigalda komponente"
StrCpy $PageReinstall_SAME_Field_3 "Desinstalli ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Desinstalli ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Vali hooldustegevus, mida sa soovid sooritada."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Töölaua otsetee"
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "Töölaua otseteede loomine"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "Kiirvaliku nupp"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "Kiirvaliku nupu loomine"
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "${APPLICATION_NAME} otsetee."
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "Jah, kustuta andmete kaust."
StrCpy $UNINSTALLER_FILE_Detail "Desinstallija kirjutamine"
StrCpy $UNINSTALLER_FINISHED_Detail "Lõpetatud"
StrCpy $UNINSTALL_ABORT "Desinstallimine on kasutaja poolt katkestatud"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "See paigaldaja vajab admini ligipääsu, proovi uuesti"
StrCpy $INIT_INSTALLER_RUNNING "Paigaldaja on juba käimas."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "See desinstallija vajab admini ligipääsu, proovi uuesti"
StrCpy $INIT_UNINSTALLER_RUNNING "See desinstallija on juba käimas"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Found ${APPLICATION_EXECUTABLE} process(s) which need to be stopped.$\nDo you want the installer to stop these for you?"
StrCpy $PageReinstall_NEW_Field_1 "An older version of ${APPLICATION_NAME} is installed on your system. It is recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_OLD_Field_1 "A newer version of ${APPLICATION_NAME} is already installed! It is not recommended that you install an older version. If you really want to install this older version, it is better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} is already installed.\r\nSelect the operation you want to perform and click Next to continue."
StrCpy $SEC_APPLICATION_DETAILS "Installing ${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Start Menu Program Shortcut"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Adding shortcut for ${APPLICATION_NAME} to the Start Menu."
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Desktop shortcut for ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "Quick Launch shortcut for ${APPLICATION_NAME}."
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Remove ${APPLICATION_NAME}'s data folder from your computer."
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "Do you want to delete ${APPLICATION_NAME}'s data folder?"
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Leave unchecked to keep the data folder for later use or check to delete the data folder."
StrCpy $UNINSTALLER_REGISTRY_Detail "Writing Installer Registry Keys"
StrCpy $UNINSTALL_MESSAGEBOX "It does not appear that ${APPLICATION_NAME} is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?"
StrCpy $INIT_NO_QUICK_LAUNCH "Quick Launch Shortcut (N/A)"
StrCpy $UAC_ERROR_ELEVATE "Unable to elevate, error:"
StrCpy $SectionGroup_Shortcuts "Shortcuts"
+43
Ver Arquivo
@@ -0,0 +1,43 @@
# Auto-generated - do not modify
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "Näytä julkaisutiedot"
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "Tapettavaa prosessia ei löytynyt!"
StrCpy $PageReinstall_NEW_Field_2 "Poista ennen asentamista"
StrCpy $PageReinstall_NEW_Field_3 "Älä poista"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Asennettu jo"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Valitse miten ${APPLICATION_NAME} asennetaan."
StrCpy $PageReinstall_SAME_Field_3 "Poista ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Poista ${APPLICATION_NAME}"
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Työpöydän pikakuvake"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "Pikakäynnistyksen pikakuvake"
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "${APPLICATION_NAME}-pikakuvake."
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Sovelluksen ${APPLICATION_NAME} työpyötäpikakuvake."
StrCpy $UNINSTALLER_REGISTRY_Detail "Kirjoitetaan asennusohjelman rekisteriavaimia"
StrCpy $UNINSTALLER_FINISHED_Detail "Valmis"
StrCpy $UNINSTALL_ABORT "Poistaminen keskeytettiin käyttäjän toimesta"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "Tämä asennusohjelma vaatii ylläpitäjän oikeudet, yritä uudelleen."
StrCpy $INIT_INSTALLER_RUNNING "Asennusohjelma on jo käynnissä."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Tämä poisto-ohjelma vaatii ylläpitäjän oikeudet, yritä uudelleen."
StrCpy $INIT_UNINSTALLER_RUNNING "Poisto-ohjelma on jo käynnissä."
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Found ${APPLICATION_EXECUTABLE} process(s) which need to be stopped.$\nDo you want the installer to stop these for you?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "Killing ${APPLICATION_EXECUTABLE} processes."
StrCpy $PageReinstall_NEW_Field_1 "An older version of ${APPLICATION_NAME} is installed on your system. It is recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_OLD_Field_1 "A newer version of ${APPLICATION_NAME} is already installed! It is not recommended that you install an older version. If you really want to install this older version, it is better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} is already installed.\r\nSelect the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_Field_2 "Add/Reinstall components"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Choose the maintenance option to perform."
StrCpy $SEC_APPLICATION_DETAILS "Installing ${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Start Menu Program Shortcut"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Adding shortcut for ${APPLICATION_NAME} to the Start Menu."
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "Creating Desktop Shortcuts"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "Creating Quick Launch Shortcut"
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "Quick Launch shortcut for ${APPLICATION_NAME}."
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Remove ${APPLICATION_NAME}'s data folder from your computer."
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "Do you want to delete ${APPLICATION_NAME}'s data folder?"
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Leave unchecked to keep the data folder for later use or check to delete the data folder."
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "Yes, delete this data folder."
StrCpy $UNINSTALLER_FILE_Detail "Writing Uninstaller"
StrCpy $UNINSTALL_MESSAGEBOX "It does not appear that ${APPLICATION_NAME} is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?"
StrCpy $INIT_NO_QUICK_LAUNCH "Quick Launch Shortcut (N/A)"
StrCpy $UAC_ERROR_ELEVATE "Unable to elevate, error:"
StrCpy $SectionGroup_Shortcuts "Shortcuts"
+43
Ver Arquivo
@@ -0,0 +1,43 @@
# Auto-generated - do not modify
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "Amosar as notas de publicación"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Atopouse o proceso ${APPLICATION_EXECUTABLE} que ten que ser detido.$\nQuere que sexa o instalador quen o deteña?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "Matando os procesos ${APPLICATION_EXECUTABLE}."
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "Non se atopou o proceso para matalo!"
StrCpy $PageReinstall_NEW_Field_1 "No seu sistema hai instalada unha versión anterior do ${APPLICATION_NAME}. Recomendámoslle que desinstale a versión actual antes de instalar. Seleccione a operación que quere realizar e prema en Seguinte para continuar."
StrCpy $PageReinstall_NEW_Field_2 "Desinstalar antes de instalar"
StrCpy $PageReinstall_NEW_Field_3 "Non desinstalar"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Xa instalado"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Escolla como quere instalar ${APPLICATION_NAME}."
StrCpy $PageReinstall_OLD_Field_1 "Ten instalada unha versión actualizada do ${APPLICATION_NAME}! recomendámoslle que non instale unha versión anterior. Se realmente quere instalar esta versión máis antiga, é preferíbel que desinstale a versión actual antes de instalar. Seleccione a operación que quere realizar e prema en Seguinte para continuar."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} xa está instalado.\nSeleccione a operación que que quere realizar e prema en Seguinte para continuar."
StrCpy $PageReinstall_SAME_Field_2 "Engadir/reinstalar compoñentes"
StrCpy $PageReinstall_SAME_Field_3 "Desinstalar ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Desinstalar ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Escolla a opción de mantemento a realizar."
StrCpy $SEC_APPLICATION_DETAILS "Instalando ${APPLICATION_NAME} esenciais."
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Acceso directo ao programa no menú de inicio"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Engadindo o acceso directo ao ${APPLICATION_NAME} no menú de inicio"
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Acceso directo no escritorio"
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "Creando os accesos directos no escritorio"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "Acceso de inicio rápido"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "Creando o acceso de inicio rápido"
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME} esenciais."
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "Acceso directo ao ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Acceso directo no escritorio para "
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "Acceso de inicio rápido para ${APPLICATION_NAME}."
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Retirar o cartafol de datos do ${APPLICATION_NAME} do seu computador."
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "Confirma que quere eliminar o cartafol de datos do ${APPLICATION_NAME}?"
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Deixeo sen marcar para manter o cartafol de datos para o seu uso posterior ou marqueo para eliminar o cartafol de datos."
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "Si, eliminar este cartafol de datos."
StrCpy $UNINSTALLER_FILE_Detail "Escribindo o desinstalador"
StrCpy $UNINSTALLER_REGISTRY_Detail "Escribindo o instalador nas chaves do rexistro"
StrCpy $UNINSTALLER_FINISHED_Detail "Rematado"
StrCpy $UNINSTALL_MESSAGEBOX "Semella que ${APPLICATION_NAME} non está instalado no directorio «$INSTDIR».$\n$\nContinuar aínda así (non recomendado)?"
StrCpy $UNINSTALL_ABORT "A desinstalación foi interrompida polo usuario."
StrCpy $INIT_NO_QUICK_LAUNCH "Acceso de inicio rápido (n/d)"
StrCpy $UAC_ERROR_ELEVATE "Non foi posíbel elevalo, erro:"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "Este instalador require acceso de administrador, tenteo de novo"
StrCpy $INIT_INSTALLER_RUNNING "O instalador xa está en execución."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Este desinstalador require acceso de administrador, tenteo de novo"
StrCpy $INIT_UNINSTALLER_RUNNING "O desinstalador xa está en execución."
StrCpy $SectionGroup_Shortcuts "Shortcuts"
+43
Ver Arquivo
@@ -0,0 +1,43 @@
# Auto-generated - do not modify
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "Release-Informationen anzeigen"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "${APPLICATION_EXECUTABLE} Prozess(e) müssen gestoppt werden.$\nWollen Sie diese nun stoppen?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "Beende ${APPLICATION_EXECUTABLE} Prozesse."
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "Prozess zum Beenden nicht gefunden!"
StrCpy $PageReinstall_NEW_Field_1 "Eine ältere Version von ${APPLICATION_NAME} ist auf Ihrem System installiert. Es wird empfohlen, diese Version zunächst zu entfernen. Wählen Sie unter folgenden Vorgehenweisen und wählen Sie $\"Weiter$\"."
StrCpy $PageReinstall_NEW_Field_2 "Vor der Installation entfernen"
StrCpy $PageReinstall_NEW_Field_3 "Nicht entfernen"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Bereits installiert"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Wählen Sie die Methode, mit der sie ${APPLICATION_NAME} installieren wollen."
StrCpy $PageReinstall_OLD_Field_1 "Eine neuere Version von ${APPLICATION_NAME} ist bereits installiert! Es wird nicht empfohlen, eine ältere Version zu installieren. Wollen Sie dies trotzdem tun, so sollten Sie die aktuelle Version zunächst entfernen. Wählen Sie eine Vorgehensweise und wählen dann $\"Weiter$\"."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} ist bereits installiert.\nWählen Sie eine Vorgehensweise und klicken Sie auf $\"Weiter$\"."
StrCpy $PageReinstall_SAME_Field_2 "Komponenten hinzufügen"
StrCpy $PageReinstall_SAME_Field_3 "${APPLICATION_NAME} entfernen"
StrCpy $UNINSTALLER_APPDATA_TITLE "${APPLICATION_NAME} entfernen"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Wählen Sie zur Ausführung die Wartungsoption."
StrCpy $SEC_APPLICATION_DETAILS "Installiere ${APPLICATION_NAME} Basis."
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Installiere Verknüpfung im Programmmenü"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Füge Verknüpfung für ${APPLICATION_NAME} dem Startmenü hinzu."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Desktop-Verknüpfung"
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "Erstellt Desktop-Verknüpfung"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "Schnellstart-Verknüpfung"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "Erstelle Schnellstart-Verknüpfung"
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME} Basis."
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "${APPLICATION_NAME} Verknüfung."
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Desktop-Verknüpfung für ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "Schnellstart-Verknüpfung für ${APPLICATION_NAME}."
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Entferne Datenordner ${APPLICATION_NAME} von der Maschine."
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "Wollen sie den ${APPLICATION_NAME} Datenordner entfernen?"
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Abwählen, um den Datenordner für spätere Verwendung zu behalten."
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "Ja, Datenordner löschen."
StrCpy $UNINSTALLER_FILE_Detail "Schreibe Uninstaller"
StrCpy $UNINSTALLER_REGISTRY_Detail "Schreibe Registrierungseinträge"
StrCpy $UNINSTALLER_FINISHED_Detail "Abgeschlossen"
StrCpy $UNINSTALL_MESSAGEBOX "Es scheint, als ob ${APPLICATION_NAME} nicht im Verzeichnis '$INSTDIR' installiert ist.$\n$\nTrotzdem fortfahren (nicht empfohlen)?"
StrCpy $UNINSTALL_ABORT "Deinstallation vom Benutzer abgebrochen"
StrCpy $INIT_NO_QUICK_LAUNCH "Schnellstart-Verknüpfung (Nicht verfügbar)"
StrCpy $UAC_ERROR_ELEVATE "Kann Rechte nicht erhöhen, Fehler:"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "Dieses Installationsprogramm erfordert Administrator-Rechte, bitte erneut versuchen"
StrCpy $INIT_INSTALLER_RUNNING "Das Installationsprogramm wird bereits ausgeführt."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Das Deinstallationsprogramm erfordert Administrator-Rechte. Bitte erneut versuchen."
StrCpy $INIT_UNINSTALLER_RUNNING "Das Deinstallationsprogramm wird bereits ausgeführt."
StrCpy $SectionGroup_Shortcuts "Verknüpfungen"
+43
Ver Arquivo
@@ -0,0 +1,43 @@
# Auto-generated - do not modify
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "ÅìöÜíéóç óçìåéþóåùí Ýêäïóçò"
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "Äåí âñÝèçêå äéåñãáóßá ãéá âßáéï ôåñìáôéóìü!"
StrCpy $PageReinstall_NEW_Field_2 "ÁðåãêáôÜóôáóç ðñéí ôçí åãêáôÜóôáóç"
StrCpy $PageReinstall_NEW_Field_3 "Íá ìçí áðåãêáôáóôáèåß"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "¹äç åãêáôåóôçìÝíï"
StrCpy $PageReinstall_SAME_Field_3 "ÁðåãêáôÜóôáóç ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "ÁðåãêáôÜóôáóç ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "Íá äéáãñáöåß ï öÜêåëïò äåäïìÝíùí."
StrCpy $UNINSTALLER_FINISHED_Detail "ÏëïêëÞñùóç"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Found ${APPLICATION_EXECUTABLE} process(s) which need to be stopped.$\nDo you want the installer to stop these for you?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "Killing ${APPLICATION_EXECUTABLE} processes."
StrCpy $PageReinstall_NEW_Field_1 "An older version of ${APPLICATION_NAME} is installed on your system. It is recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Choose how you want to install ${APPLICATION_NAME}."
StrCpy $PageReinstall_OLD_Field_1 "A newer version of ${APPLICATION_NAME} is already installed! It is not recommended that you install an older version. If you really want to install this older version, it is better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} is already installed.\r\nSelect the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_Field_2 "Add/Reinstall components"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Choose the maintenance option to perform."
StrCpy $SEC_APPLICATION_DETAILS "Installing ${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Start Menu Program Shortcut"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Adding shortcut for ${APPLICATION_NAME} to the Start Menu."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Desktop Shortcut"
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "Creating Desktop Shortcuts"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "Quick Launch Shortcut"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "Creating Quick Launch Shortcut"
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "${APPLICATION_NAME} shortcut."
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Desktop shortcut for ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "Quick Launch shortcut for ${APPLICATION_NAME}."
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Remove ${APPLICATION_NAME}'s data folder from your computer."
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "Do you want to delete ${APPLICATION_NAME}'s data folder?"
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Leave unchecked to keep the data folder for later use or check to delete the data folder."
StrCpy $UNINSTALLER_FILE_Detail "Writing Uninstaller"
StrCpy $UNINSTALLER_REGISTRY_Detail "Writing Installer Registry Keys"
StrCpy $UNINSTALL_MESSAGEBOX "It does not appear that ${APPLICATION_NAME} is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?"
StrCpy $UNINSTALL_ABORT "Uninstall aborted by user"
StrCpy $INIT_NO_QUICK_LAUNCH "Quick Launch Shortcut (N/A)"
StrCpy $UAC_ERROR_ELEVATE "Unable to elevate, error:"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "This installer requires admin access, try again"
StrCpy $INIT_INSTALLER_RUNNING "The installer is already running."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "This uninstaller requires admin access, try again"
StrCpy $INIT_UNINSTALLER_RUNNING "The uninstaller is already running."
StrCpy $SectionGroup_Shortcuts "Shortcuts"
+43
Ver Arquivo
@@ -0,0 +1,43 @@
# Auto-generated - do not modify
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "Mostra le note di rilascio"
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "Il processo da terminare non è stato trovato!"
StrCpy $PageReinstall_NEW_Field_2 "Disinstalla prima di installare"
StrCpy $PageReinstall_NEW_Field_3 "Non disinstallare"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Già installato"
StrCpy $PageReinstall_SAME_Field_2 "Aggiungi/Reinstalla i componenti"
StrCpy $PageReinstall_SAME_Field_3 "Disinstalla ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Disinstalla ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Scegli l'opzione di manutenzione da eseguire."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Scorciatoia del desktop"
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "Creazione delle scorciatoie del desktop"
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Rimuovi la cartella dei dati di ${APPLICATION_NAME} dal tuo computer."
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "Vuoi eliminare la cartella dei dati di ${APPLICATION_NAME}?"
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "Sì, elimina questa cartella di dati."
StrCpy $UNINSTALLER_FINISHED_Detail "Completato"
StrCpy $UNINSTALL_ABORT "Disinstallazione interrotta dall'utente"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Found ${APPLICATION_EXECUTABLE} process(s) which need to be stopped.$\nDo you want the installer to stop these for you?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "Killing ${APPLICATION_EXECUTABLE} processes."
StrCpy $PageReinstall_NEW_Field_1 "An older version of ${APPLICATION_NAME} is installed on your system. It is recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Choose how you want to install ${APPLICATION_NAME}."
StrCpy $PageReinstall_OLD_Field_1 "A newer version of ${APPLICATION_NAME} is already installed! It is not recommended that you install an older version. If you really want to install this older version, it is better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} is already installed.\r\nSelect the operation you want to perform and click Next to continue."
StrCpy $SEC_APPLICATION_DETAILS "Installing ${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Start Menu Program Shortcut"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Adding shortcut for ${APPLICATION_NAME} to the Start Menu."
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "Quick Launch Shortcut"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "Creating Quick Launch Shortcut"
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "${APPLICATION_NAME} shortcut."
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Desktop shortcut for ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "Quick Launch shortcut for ${APPLICATION_NAME}."
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Leave unchecked to keep the data folder for later use or check to delete the data folder."
StrCpy $UNINSTALLER_FILE_Detail "Writing Uninstaller"
StrCpy $UNINSTALLER_REGISTRY_Detail "Writing Installer Registry Keys"
StrCpy $UNINSTALL_MESSAGEBOX "It does not appear that ${APPLICATION_NAME} is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?"
StrCpy $INIT_NO_QUICK_LAUNCH "Quick Launch Shortcut (N/A)"
StrCpy $UAC_ERROR_ELEVATE "Unable to elevate, error:"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "This installer requires admin access, try again"
StrCpy $INIT_INSTALLER_RUNNING "The installer is already running."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "This uninstaller requires admin access, try again"
StrCpy $INIT_UNINSTALLER_RUNNING "The uninstaller is already running."
StrCpy $SectionGroup_Shortcuts "Shortcuts"
+43
Ver Arquivo
@@ -0,0 +1,43 @@
# Auto-generated - do not modify
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "リリースノートを表示"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "次の ${APPLICATION_EXECUTABLE} のプロセスを終了する必要があります。\nインストーラーがそのプロセスを停止してもよろしいですか?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "${APPLICATION_EXECUTABLE} プロセスを終了しています。"
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "終了するプロセスがありません"
StrCpy $PageReinstall_NEW_Field_2 "インストール前にアンインストールする"
StrCpy $PageReinstall_NEW_Field_3 "アンインストールしない"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "インストール済"
StrCpy $PageReinstall_SAME_Field_3 "${APPLICATION_NAME} をアンインストール"
StrCpy $UNINSTALLER_APPDATA_TITLE "${APPLICATION_NAME} をアンインストール"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "実行する為に、メンテナンスオプションを選択してください。"
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "スタートメニューショートカット"
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "デスクトップショートカット"
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "デスクトップショートカット作成"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "クイック起動ショートカット"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "クイック起動ショートカットを作成"
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "${APPLICATION_NAME} のデスクトップショートカット"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "${APPLICATION_NAME} のクイック起動ショートカット"
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "${APPLICATION_NAME} のデータフォルダを削除しますか?"
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "はい。データフォルダーを削除します。"
StrCpy $UNINSTALLER_FILE_Detail "アンインストーラーを書き込み"
StrCpy $UNINSTALLER_REGISTRY_Detail "インストーラーのレジストリキーの書き込み"
StrCpy $UNINSTALLER_FINISHED_Detail "終了"
StrCpy $UNINSTALL_ABORT "アンインストールは、ユーザーによって中止されました。"
StrCpy $INIT_NO_QUICK_LAUNCH "クイック起動ショートカット(N/A)"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "このインストーラーは、管理者権限が必要です。インストールを再試行してください。"
StrCpy $INIT_INSTALLER_RUNNING "インストーラーは、既に起動しています。"
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "このアンインストーラーは、管理者権限が必要です。アンインストールを再試行してください。"
StrCpy $INIT_UNINSTALLER_RUNNING "アンインストーラーは、既に起動しています。"
StrCpy $PageReinstall_NEW_Field_1 "An older version of ${APPLICATION_NAME} is installed on your system. It is recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Choose how you want to install ${APPLICATION_NAME}."
StrCpy $PageReinstall_OLD_Field_1 "A newer version of ${APPLICATION_NAME} is already installed! It is not recommended that you install an older version. If you really want to install this older version, it is better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} is already installed.\r\nSelect the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_Field_2 "Add/Reinstall components"
StrCpy $SEC_APPLICATION_DETAILS "Installing ${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Adding shortcut for ${APPLICATION_NAME} to the Start Menu."
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "${APPLICATION_NAME} shortcut."
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Remove ${APPLICATION_NAME}'s data folder from your computer."
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Leave unchecked to keep the data folder for later use or check to delete the data folder."
StrCpy $UNINSTALL_MESSAGEBOX "It does not appear that ${APPLICATION_NAME} is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?"
StrCpy $UAC_ERROR_ELEVATE "Unable to elevate, error:"
StrCpy $SectionGroup_Shortcuts "Shortcuts"
+43
Ver Arquivo
@@ -0,0 +1,43 @@
# Auto-generated - do not modify
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "Mostrar notas de lançamento"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Encontrados ${APPLICATION_EXECUTABLE} processo(s) que precisam ser interrompidos. $ \n Você quer que o instalador pare estes para você?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "Eliminar ${APPLICATION_EXECUTABLE} processos."
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "Processo para eliminar não encontrado!"
StrCpy $PageReinstall_NEW_Field_1 "Uma versão mais antiga de ${APPLICATION_NAME} está instalado em seu sistema. É recomendado que você desinstale a versão atual antes de instalar. Selecione a operação que deseja executar e clique em Avançar para continuar."
StrCpy $PageReinstall_NEW_Field_2 "Desinstalar antes de instalar"
StrCpy $PageReinstall_NEW_Field_3 "Não desinstale"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Já instalado"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Escolha como você deseja instalar ${APPLICATION_NAME}."
StrCpy $PageReinstall_OLD_Field_1 "A versão mais recente do ${APPLICATION_NAME} já está instalado! Não é recomendado que você instale uma versão mais antiga. Se você realmente deseja instalar esta versão mais antiga, é melhor desinstalar a versão atual primeiro. Selecione a operação que deseja executar e clique em Avançar para continuar."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${version} já está instalado. \nSelecione a operação que deseja executar e clique em Avançar para continuar."
StrCpy $PageReinstall_SAME_Field_2 "Adicionar/reinstalar componentes"
StrCpy $PageReinstall_SAME_Field_3 "Desinstalar ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Desinstalar ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Escolha a opção de realizar manutenção."
StrCpy $SEC_APPLICATION_DETAILS "Instalando ${APPLICATION_NAME} fundamentos."
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Menu Iniciar Programa Atalho"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Adicionando atalho para ${APPLICATION_NAME} para o Menu Iniciar."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Atalho Desktop"
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "Criando Atalhos de Desktop"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "Atalho Rápido"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "Criando Atalho Rápido"
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME} esseciais."
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "${APPLICATION_NAME} atalho."
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Atalho Desktop para ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "Atalho Rápido para ${APPLICATION_NAME}."
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Remover ${APPLICATION_NAME} pasta de dados de seu computador."
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "Você quer apagar $ {APPLICATION_NAME} 's pasta de dados?"
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Deixe desmarcada para manter a pasta de dados para uso posterior ou cheque para excluir a pasta de dados."
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "Sim, excluir essa pasta de dados."
StrCpy $UNINSTALLER_FILE_Detail "Escrevendo Desinstalador"
StrCpy $UNINSTALLER_REGISTRY_Detail "Escrevendo Chaves de Registro do Inslalador"
StrCpy $UNINSTALLER_FINISHED_Detail "Finalizado"
StrCpy $UNINSTALL_MESSAGEBOX "Não parece que ${APPLICATION_NAME} está instalado no diretório '$INSTDIR'.$\n$\nContinuar assim mesmo (não recomendado)?"
StrCpy $UNINSTALL_ABORT "Desinstalação abortada pelo usuário"
StrCpy $INIT_NO_QUICK_LAUNCH "Atalho de Inicialização Rápida (N/A)"
StrCpy $UAC_ERROR_ELEVATE "Incapaz de elevar, erro:"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "Este programa de instalação requer acesso de administrador, tente novamente"
StrCpy $INIT_INSTALLER_RUNNING "O instalador já está em execução."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Este desinstalador requer acesso de administrador, tente novamente"
StrCpy $INIT_UNINSTALLER_RUNNING "O desinstalador já está em execução."
StrCpy $SectionGroup_Shortcuts "Atalhos"
+43
Ver Arquivo
@@ -0,0 +1,43 @@
# Auto-generated - do not modify
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "Zobrazi zoznam zmien"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Našli sa ${APPLICATION_EXECUTABLE} proces (y), ktoré je potrebné zastavi.$\nChcete, aby ich inštalátor zastavil?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "Ukonèi ${APPLICATION_EXECUTABLE} procesy."
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "Proces ukonèenia nebol nájdený!"
StrCpy $PageReinstall_NEW_Field_1 "Staršia verzia ${APPLICATION_NAME} je nainštalovaná vo vašom systéme. Odporúèam vám odinštalova aktuálnu verziu pred inštaláciou. Vyberte operáciu, ktorú chcete vykona, a kliknite na tlaèidlo Ïalej pre pokraèovanie."
StrCpy $PageReinstall_NEW_Field_2 "Odinštalova pred inštaláciou"
StrCpy $PageReinstall_NEW_Field_3 "Neodinštalova"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Už je nainštalovaný"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Vyberte si, ako chcete nainštalova ${APPLICATION_NAME}."
StrCpy $PageReinstall_OLD_Field_1 "Novšia verzia ${APPLICATION_NAME} je už nainštalovaná! Neodporúèam vám nainštalova staršiu verziu. Ak naozaj chcete nainštalova túto staršiu verziu, je lepšie najprv odinštalova aktuálnu verziu. Vyberte operáciu, ktorú chcete vykona, a kliknite na tlaèidlo Ïalej pre pokraèovanie."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} je už nainštalovaná.\nVyberte operáciu, ktorú chcete vykona, a kliknite na tlaèidlo Ïalej pre pokraèovanie."
StrCpy $PageReinstall_SAME_Field_2 "Prida/Preinštalova komponenty"
StrCpy $PageReinstall_SAME_Field_3 "Odinštalova ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Odinštalova ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Vyberte možnos vykona údržbu."
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Zástupca programu v menu Štart"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Prida zástupcu pre ${APPLICATION_NAME} do menu Štart."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Zástupca na ploche"
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "Vytvorenie zástupcu na ploche"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "Zástupca na paneli úloh"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "Vytvorenie zástupcu na paneli úloh"
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "${APPLICATION_NAME} zástupca."
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Zástupca na ploche pre ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "Zástupca na paneli úloh pre ${APPLICATION_NAME}."
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Zmaza dátový prieèinok ${APPLICATION_NAME}'s z vášho poèítaèa."
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "Naozaj chcete zmaza prieèinok s dátami ${APPLICATION_NAME}'s ?"
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "Áno, zmaza tento prieèinok."
StrCpy $UNINSTALLER_FINISHED_Detail "Dokonèené"
StrCpy $UNINSTALL_MESSAGEBOX "Nezdá sa, že ${APPLICATION_NAME} je nainštalovaný v prieèinku '$INSTDIR'.$\n$\nNapriek tomu pokraèova (neodporúèa sa)?"
StrCpy $UNINSTALL_ABORT "Odinštalácia prerušená používate¾om"
StrCpy $INIT_NO_QUICK_LAUNCH "Zástupca na paneli úloh (N/A)"
StrCpy $UAC_ERROR_ELEVATE "Nemožno povýši, chyba:"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "Tento inštalátor vyžaduje admin prístup, skúste to znova"
StrCpy $INIT_INSTALLER_RUNNING "Inštalátor je už spustený."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Tento odinštalátor vyžaduje admin prístup, skúste to znova"
StrCpy $INIT_UNINSTALLER_RUNNING "Odinštalátor je už spustený."
StrCpy $SEC_APPLICATION_DETAILS "Installing ${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME} essentials."
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Leave unchecked to keep the data folder for later use or check to delete the data folder."
StrCpy $UNINSTALLER_FILE_Detail "Writing Uninstaller"
StrCpy $UNINSTALLER_REGISTRY_Detail "Writing Installer Registry Keys"
StrCpy $SectionGroup_Shortcuts "Shortcuts"
+43
Ver Arquivo
@@ -0,0 +1,43 @@
# Auto-generated - do not modify
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "Pokaži opombe k objavi"
StrCpy $PageReinstall_NEW_Field_3 "Ne odstrani namestitve"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Program je že namešèen"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Izberite naèin namestitve programa ${APPLICATION_NAME}."
StrCpy $UNINSTALLER_FINISHED_Detail "Konèano"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Found ${APPLICATION_EXECUTABLE} process(s) which need to be stopped.$\nDo you want the installer to stop these for you?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "Killing ${APPLICATION_EXECUTABLE} processes."
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "Process to kill not found!"
StrCpy $PageReinstall_NEW_Field_1 "An older version of ${APPLICATION_NAME} is installed on your system. It is recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_NEW_Field_2 "Uninstall before installing"
StrCpy $PageReinstall_OLD_Field_1 "A newer version of ${APPLICATION_NAME} is already installed! It is not recommended that you install an older version. If you really want to install this older version, it is better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} is already installed.\r\nSelect the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_Field_2 "Add/Reinstall components"
StrCpy $PageReinstall_SAME_Field_3 "Uninstall ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Uninstall ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Choose the maintenance option to perform."
StrCpy $SEC_APPLICATION_DETAILS "Installing ${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Start Menu Program Shortcut"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Adding shortcut for ${APPLICATION_NAME} to the Start Menu."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Desktop Shortcut"
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "Creating Desktop Shortcuts"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "Quick Launch Shortcut"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "Creating Quick Launch Shortcut"
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "${APPLICATION_NAME} shortcut."
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Desktop shortcut for ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "Quick Launch shortcut for ${APPLICATION_NAME}."
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Remove ${APPLICATION_NAME}'s data folder from your computer."
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "Do you want to delete ${APPLICATION_NAME}'s data folder?"
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Leave unchecked to keep the data folder for later use or check to delete the data folder."
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "Yes, delete this data folder."
StrCpy $UNINSTALLER_FILE_Detail "Writing Uninstaller"
StrCpy $UNINSTALLER_REGISTRY_Detail "Writing Installer Registry Keys"
StrCpy $UNINSTALL_MESSAGEBOX "It does not appear that ${APPLICATION_NAME} is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?"
StrCpy $UNINSTALL_ABORT "Uninstall aborted by user"
StrCpy $INIT_NO_QUICK_LAUNCH "Quick Launch Shortcut (N/A)"
StrCpy $UAC_ERROR_ELEVATE "Unable to elevate, error:"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "This installer requires admin access, try again"
StrCpy $INIT_INSTALLER_RUNNING "The installer is already running."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "This uninstaller requires admin access, try again"
StrCpy $INIT_UNINSTALLER_RUNNING "The uninstaller is already running."
StrCpy $SectionGroup_Shortcuts "Shortcuts"
+43
Ver Arquivo
@@ -0,0 +1,43 @@
# Auto-generated - do not modify
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "Mostrar las notas de la versión"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Se encontró el proceso(s) ${APPLICATION_EXECUTABLE} el cual necesita detenerse. $\n¿Desea que el instalador lo detenga por usted?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "Terminando los procesos de ${APPLICATION_EXECUTABLE}"
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "¡Proceso a detener no encontrado!"
StrCpy $PageReinstall_NEW_Field_1 "Una versión anterior de ${APPLICATION_NAME} se encuentra instalada en el sistema. Se recomienda de instalar la versión actual antes de instalar la nueva. Seleccione la operacion deseada y haga click en Siguiente para continuar."
StrCpy $PageReinstall_NEW_Field_2 "Desinstalar antes de instalar"
StrCpy $PageReinstall_NEW_Field_3 "No desinstalar"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Ya está instalado"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Elija como quiere instalar ${APPLICATION_NAME}."
StrCpy $PageReinstall_OLD_Field_1 "Una nueva versión de ${APPLICATION_NAME} ya está instalada. No es recomendable instalar una versión anterior. Si realmente quiere instalar esta versión anterior, es mejor que desinstale la versión actual primero. Seleccione la operación que desea realizar y pulse Next para continuar."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} ya está instalada.\nSeleccione la operación que desea realizar y pulse Next para continuar."
StrCpy $PageReinstall_SAME_Field_2 "Añadir/Reinstalar componentes"
StrCpy $PageReinstall_SAME_Field_3 "Desinstalar ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Desinstalar ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Elija la opcion de mantenimiento a realizar."
StrCpy $SEC_APPLICATION_DETAILS "Instalando ${APPLICATION_NAME} esenciales."
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Acceso Directo al Programa Menú de Inicio"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Añadiendo accesos directos para ${APPLICATION_NAME} en el Menú de Inicio."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Acceso directo de Escritorio"
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "Creando Accesos Directos de Escritorio"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "Acceso Directo al Lanzador Rápido"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "Creando un Acceso Directo al Lanzador Rápido"
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME} esencial."
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "Acceso Directo de ${APPLICATION_NAME}"
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Acceso Directo de Escritorio para ${APPLICATION_NAME}"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "Lanzador Rápido de Accesos Director para ${APPLICATION_NAME}."
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Remueva la carpeta de datos de ${APPLICATION_NAME} del computador."
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "¿Desea eliminar la carpeta de datos de ${APPLICATION_NAME}?"
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Deja sin marcar para mantener la carpeta de datos para uso posterior, o del marque para eliminar la carpeta de datos."
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "Si, Elimine esta carpeta de datos."
StrCpy $UNINSTALLER_FILE_Detail "Escribiendo Desinstalador"
StrCpy $UNINSTALLER_REGISTRY_Detail "Escribiendo Llaves en el Registro del Instalador"
StrCpy $UNINSTALLER_FINISHED_Detail "Terminado"
StrCpy $UNINSTALL_MESSAGEBOX "Parece que ${APPLICATION_NAME} no está instalado en el directorio '$INSTDIR'.$$ ¿Continuar de todos modos? (No Recomendado)"
StrCpy $UNINSTALL_ABORT "Desinstalación cancelada por el usuario"
StrCpy $INIT_NO_QUICK_LAUNCH "Acceso Directo al Lanzador Rápido (N/A)"
StrCpy $UAC_ERROR_ELEVATE "No se ha podido elevar, Error:"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "El instalador requiere acceso administrativo, intente de nuevo"
StrCpy $INIT_INSTALLER_RUNNING "El instalador ya se encuentra en ejecución"
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "El desinstalador requiere acceso administrativo, intente de nuevo"
StrCpy $INIT_UNINSTALLER_RUNNING "El desinstalador ya se encuentra en ejecución."
StrCpy $SectionGroup_Shortcuts "Accesos Directos"
+43
Ver Arquivo
@@ -0,0 +1,43 @@
# Auto-generated - do not modify
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "Sürüm notlarını göster"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Durdurulması gereken ${APPLICATION_EXECUTABLE} süreci bulunuyor.$\nYükleyicinin bunu sizin için yapmasını ister misiniz?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "${APPLICATION_EXECUTABLE} süreç sonlandırılıyor."
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "Sonlandırılacak süreç bulunamadı!"
StrCpy $PageReinstall_NEW_Field_1 "${APPLICATION_NAME} önceki sürümü sisteminizde yüklü. Kurulumdan önce bunu kaldırmanız önerilir. Yapmak istediğiniz işlemi seçip devam etmek için İleri tıklayın."
StrCpy $PageReinstall_NEW_Field_2 "Yüklemeden önce kaldır"
StrCpy $PageReinstall_NEW_Field_3 "Kaldırma"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Zaten Yüklü"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "${APPLICATION_NAME} uygulamasını nasıl yüklemek istediğinizi seçin."
StrCpy $PageReinstall_OLD_Field_1 "${APPLICATION_NAME} uygulamasının daha yeni sürümü zaten yüklü! Daha eski bir sürümünü yüklemeniz önerilmez. Gerçekten bu eski sürümü yüklemek isterseniz, ilk olarak geçerli sürümü kaldırmanız tavsiye edilir. Yapmak istediğiniz işlemi seçin ve devam etmek üzere İleri tıklayın."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} zaten yüklü.\nYapmak istediğiniz işlemi seçin ve devam etmek için İleri tıklayın."
StrCpy $PageReinstall_SAME_Field_2 "Bileşenleri ekle/yeniden yükle"
StrCpy $PageReinstall_SAME_Field_3 "${APPLICATION_NAME} uygulamasını kaldır"
StrCpy $UNINSTALLER_APPDATA_TITLE "${APPLICATION_NAME} uygulamasını kaldır"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Yapmak istediğiniz bakım işlemini seçin."
StrCpy $SEC_APPLICATION_DETAILS "${APPLICATION_NAME} gereklilikleri yükleniyor."
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Başlat Menüsü Program Kısayolu"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "${APPLICATION_NAME} için Başlat Menüsü'ne kısayol ekleniyor."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Masaüstü Kısayolu"
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "Masaüstü Kısayolları Oluşturuluyor"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "Hızlı Başlat Kısayolu"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "Hızlı Başlat Kısayolu Oluşturuluyor"
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME} gereklilikleri."
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "${APPLICATION_NAME} kısayolu."
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "${APPLICATION_NAME} için masaüstü kısayolu."
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "${APPLICATION_NAME} için Hızlı Başlat kısayolu."
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Bilgisayarınızdan ${APPLICATION_NAME} veri klasörünü kaldırır."
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "${APPLICATION_NAME} veri klasörünü silmek istiyor musunuz?"
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Veri klasörünün daha sonraki kullanımı için saklamak üzere işaretini kaldırın veya silmek için işaretleyin."
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "Evet bu veri klasörünü sil."
StrCpy $UNINSTALLER_FILE_Detail "Kaldırıcı Yazılıyor"
StrCpy $UNINSTALLER_REGISTRY_Detail "Yükleyici Kayıt Anahtarları Yazılıyor"
StrCpy $UNINSTALLER_FINISHED_Detail "Tamamlandı"
StrCpy $UNINSTALL_MESSAGEBOX "${APPLICATION_NAME} uygulaması '$INSTDIR' dizinine yüklenmiş gibi görünmüyor.$\n$\nYine de devam edilsin mi (önerilmez)?"
StrCpy $UNINSTALL_ABORT "Kaldırma kullanıcı tarafından iptal edildi"
StrCpy $INIT_NO_QUICK_LAUNCH "Hızlı Başlat Kısayolu (Kullanılamıyor)"
StrCpy $UAC_ERROR_ELEVATE "Yükseltme başarısız, hata:"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "Bu yükleyici yönetici erişimi gerektiriyor, yeniden deneyin"
StrCpy $INIT_INSTALLER_RUNNING "Yükleyici zaten çalışıyor."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Bu kaldırıcı yönetici erişimi gerektiriyor, yeniden deneyin"
StrCpy $INIT_UNINSTALLER_RUNNING "Kaldırıcı zaten çalışıyor."
StrCpy $SectionGroup_Shortcuts "Kısayollar"
+182
Ver Arquivo
@@ -0,0 +1,182 @@
##############################################################################
#
# PROJECT: ownCloud v1.0
# LICENSE: See LICENSE in the top level directory
#
##############################################################################
import collections
import os
import polib
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-o", "--output", dest="output",
help="Directory for localized output", default="../Shared/installer/nightly_localized.nsi")
parser.add_option("-p", "--podir", dest="podir",
help="Directory containing PO files", default="../Shared/installer/locale/")
parser.add_option("-l", "--lang", dest="lang",
help="Default language of the NSI", default="English" )
(options, args) = parser.parse_args()
# Define a dict to convert locale names to language names
localeToName = {
"af" : "Afrikaans",
"sq" : "Albanian",
"ar" : "Arabic",
"hy" : "Armenian",
"eu" : "Basque",
"be" : "Belarusian",
"bs" : "Bosnian",
"br" : "Breton",
"bg" : "Bulgarian",
"ca" : "Catalan",
"bem" : "Cibemba",
"hr" : "Croatian",
"cs" : "Czech",
"da" : "Danish",
"nl" : "Dutch",
"efi" : "Efik",
"en" : "English",
"eo" : "Esperanto",
"et" : "Estonian",
"fa" : "Farsi",
"fi" : "Finnish",
"fr" : "French",
"gl" : "Galician",
"ka" : "Georgian",
"de" : "German",
"el" : "Greek",
"he" : "Hebrew",
"hi" : "Hindi",
"hu" : "Hungarian",
"is" : "Icelandic",
"ig" : "Igbo",
"id" : "Indonesian",
"ga" : "Irish",
"it" : "Italian",
"ja" : "Japanese",
"km" : "Khmer",
"ko" : "Korean",
"ku" : "Kurdish",
"lv" : "Latvian",
"lt" : "Lithuanian",
"lb" : "Luxembourgish",
"mk" : "Macedonian",
"mg" : "Malagasy",
"ms" : "Malay",
"mn" : "Mongolian",
"nb" : "Norwegian",
"nn" : "NorwegianNynorsk",
"ps" : "Pashto",
"pl" : "Polish",
"pt" : "Portuguese",
"pt_BR" : "PortugueseBR",
"ro" : "Romanian",
"ru" : "Russian",
"sr" : "Serbian",
"sr_sp" : "SerbianLatin",
"st" : "Sesotho",
"sn" : "Shona",
"zh_CN" : "SimpChinese",
"sk" : "Slovak",
"sl" : "Slovenian",
"es" : "Spanish",
"es_AR" : "SpanishInternational",
"sw" : "Swahili",
"sv" : "Swedish",
"ta" : "Tamil",
"th" : "Thai",
"zh_HK" : "TradChinese",
"tr" : "Turkish",
"tw" : "Twi",
"uk" : "Ukrainian",
"ug" : "Uyghur",
"uz" : "Uzbek",
"ca@valencia" : "Valencian",
"vi" : "Vietnamese",
"cy" : "Welsh",
"yo" : "Yoruba",
"zu" : "Zulu",
}
def escapeNSIS(st):
return st.replace('\\', r'$\\')\
.replace('\t', r'$\t')\
.replace('\r', r'\r')\
.replace('\n', r'\n')\
.replace('\"', r'$\"')\
.replace('$$\\', '$\\')
translationCache = {}
# The purpose of this loop is to go to the podir scanning for PO files for each locale name
# Once we've found a PO file, we use PO lib to read every translated entry
# Using this, for each each language, we store a dict of entries - { nsilabel (comment) : translation (msgstr) }
# For untranslated entries, we use msgid instead of msgstr (i.e. default English string)
for root,dirs,files in os.walk(options.podir):
for file in files:
filename,ext = os.path.splitext(file)
if ext == ".po":
# Valid locale filename (fr.po, de.po etc)?
if filename in localeToName:
language = localeToName[filename]
translationCache[language] = collections.OrderedDict()
po = polib.pofile(os.path.join(root,file))
for entry in po.translated_entries():
# Loop through all our labels and add translation (each translation may have multiple labels)
for label in entry.comment.split():
translationCache[language][label] = escapeNSIS(entry.msgstr)
# For untranslated strings, let's add the English entry
for entry in po.untranslated_entries():
for label in entry.comment.split():
print("Warning: Label '%s' for language '%s' remains untranslated"%(label,language))
translationCache[language][label] = escapeNSIS(entry.msgid)
def tostr(obj):
if type(obj) == unicode:
return obj.encode("utf-8")
else:
return obj
NSILanguages = []
NSIDeclarations = []
# file header
NSILanguages.append( tostr('; Auto-generated - do not modify\n') )
NSIDeclarations.append( tostr('; Auto-generated - do not modify\n') )
# loopthrough the languages an generate one nsh files for each language
lineNo = 1
for language,translations in translationCache.iteritems():
NSINewLines = []
NSINewLines.append( tostr('# Auto-generated - do not modify\n') )
count = 0
# if the language isn't the default, we add our MUI_LANGUAGE macro
if language.upper() != options.lang.upper():
NSILanguages.append( tostr('!insertmacro MUI_LANGUAGE "%s"\n'%language) )
# For every translation we grabbed from the .po, let's add our StrCpy command
for label,value in translations.iteritems():
NSINewLines.append( tostr('StrCpy $%s "%s"\n' % (label,value)) )
if language.upper() == options.lang.upper():
NSIDeclarations.append( tostr('Var %s\n' % label) )
count += 1
NSIWorkingFile = open('%s/%s.nsh' % (options.output, language),"w")
NSIWorkingFile.writelines(NSINewLines)
NSIWorkingFile.close()
print ( "%i translations merged for language '%s'"%(count,language) )
# Finally, let's write languages.nsh and declarations.nsh
NSIWorkingFile = open('%s/languages.nsh' % options.output,"w")
NSIWorkingFile.writelines(NSILanguages)
NSIWorkingFile.close()
NSIWorkingFile = open('%s/declarations.nsh' % options.output,"w")
NSIWorkingFile.writelines(NSIDeclarations)
NSIWorkingFile.close()
print ( "NSI Localization Operation Complete" )
+48
Ver Arquivo
@@ -0,0 +1,48 @@
#!/bin/bash
L10NDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
SCRIPTDIR="$L10NDIR/bin"
PODIR="$L10NDIR/pofiles"
# messages.pot will be used as English translation
cp -f $PODIR/messages.pot $PODIR/en.po
# generate all the languages nsh files
python $SCRIPTDIR/build_locale_nsi.py -o $L10NDIR -p $PODIR -l "English"
# for future references: the windows code pages
# 874 — Thai
# 932 — Japanese
# 936 — Chinese (simplified) (PRC, Singapore)
# 949 — Korean
# 950 — Chinese (traditional) (Taiwan, Hong Kong)
# 1200 — Unicode (BMP of ISO 10646, UTF-16LE)
# 1201 — Unicode (BMP of ISO 10646, UTF-16BE)
# 1250 — Latin (Central European languages)
# 1251 — Cyrillic
# 1252 — Latin (Western European languages, replacing Code page 850)
# 1253 — Greek
# 1254 — Turkish
# 1255 — Hebrew
# 1256 — Arabic
# 1257 — Latin (Baltic languages)
# 1258 — Vietnamese
# convert file to proper content
cd $L10NDIR
iconv -t CP1252 -o German.nsh German.nsh
iconv -t CP1252 -o Basque.nsh Basque.nsh
iconv -t CP1252 -o English.nsh English.nsh
iconv -t CP1252 -o Galician.nsh Galician.nsh
iconv -t CP1253 -o Greek.nsh Greek.nsh
iconv -t CP1250 -o Slovenian.nsh Slovenian.nsh
iconv -t CP1257 -o Estonian.nsh Estonian.nsh
iconv -t CP1252 -o Italian.nsh Italian.nsh
iconv -t CP1252 -o PortugueseBR.nsh PortugueseBR.nsh
iconv -t CP1252 -o Spanish.nsh Spanish.nsh
iconv -t CP1252 -o Dutch.nsh Dutch.nsh
iconv -t CP1252 -o Finnish.nsh Finnish.nsh
iconv -t CP932 -o Japanese.nsh Japanese.nsh
iconv -t CP1250 -o Slovak.nsh Slovak.nsh
iconv -t CP1254 -o Turkish.nsh Turkish.nsh
+43
Ver Arquivo
@@ -0,0 +1,43 @@
; Auto-generated - do not modify
Var MUI_FINISHPAGE_SHOWREADME_TEXT_STRING
Var ConfirmEndProcess_MESSAGEBOX_TEXT
Var ConfirmEndProcess_KILLING_PROCESSES_TEXT
Var ConfirmEndProcess_KILL_NOT_FOUND_TEXT
Var PageReinstall_NEW_Field_1
Var PageReinstall_NEW_Field_2
Var PageReinstall_NEW_Field_3
Var PageReinstall_NEW_MUI_HEADER_TEXT_TITLE
Var PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE
Var PageReinstall_OLD_Field_1
Var PageReinstall_SAME_Field_1
Var PageReinstall_SAME_Field_2
Var PageReinstall_SAME_Field_3
Var UNINSTALLER_APPDATA_TITLE
Var PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE
Var SEC_APPLICATION_DETAILS
Var OPTION_SECTION_SC_START_MENU_SECTION
Var OPTION_SECTION_SC_START_MENU_DetailPrint
Var OPTION_SECTION_SC_DESKTOP_SECTION
Var OPTION_SECTION_SC_DESKTOP_DetailPrint
Var OPTION_SECTION_SC_QUICK_LAUNCH_SECTION
Var OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint
Var OPTION_SECTION_SC_APPLICATION_Desc
Var OPTION_SECTION_SC_START_MENU_Desc
Var OPTION_SECTION_SC_DESKTOP_Desc
Var OPTION_SECTION_SC_QUICK_LAUNCH_Desc
Var UNINSTALLER_APPDATA_SUBTITLE
Var UNINSTALLER_APPDATA_LABEL_1
Var UNINSTALLER_APPDATA_LABEL_2
Var UNINSTALLER_APPDATA_CHECKBOX
Var UNINSTALLER_FILE_Detail
Var UNINSTALLER_REGISTRY_Detail
Var UNINSTALLER_FINISHED_Detail
Var UNINSTALL_MESSAGEBOX
Var UNINSTALL_ABORT
Var INIT_NO_QUICK_LAUNCH
Var UAC_ERROR_ELEVATE
Var UAC_INSTALLER_REQUIRE_ADMIN
Var INIT_INSTALLER_RUNNING
Var UAC_UNINSTALLER_REQUIRE_ADMIN
Var INIT_UNINSTALLER_RUNNING
Var SectionGroup_Shortcuts
+16
Ver Arquivo
@@ -0,0 +1,16 @@
; Auto-generated - do not modify
!insertmacro MUI_LANGUAGE "PortugueseBR"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_LANGUAGE "Czech"
!insertmacro MUI_LANGUAGE "Estonian"
!insertmacro MUI_LANGUAGE "Finnish"
!insertmacro MUI_LANGUAGE "Turkish"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Slovenian"
!insertmacro MUI_LANGUAGE "Basque"
!insertmacro MUI_LANGUAGE "Japanese"
!insertmacro MUI_LANGUAGE "Galician"
!insertmacro MUI_LANGUAGE "Greek"
!insertmacro MUI_LANGUAGE "Slovak"
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "Italian"
+196
Ver Arquivo
@@ -0,0 +1,196 @@
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: ownCloud\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-12-09 06:40\n"
"PO-Revision-Date: 2013-12-03 23:13+0000\n"
"Last-Translator: I Robot <owncloud-bot@tmit.eu>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. MUI_FINISHPAGE_SHOWREADME_TEXT_STRING
msgid "Show release notes"
msgstr "Show release notes"
#. ConfirmEndProcess_MESSAGEBOX_TEXT
msgid ""
"Found ${processName} process(s) which need to be stopped.$\n"
"Do you want the installer to stop these for you?"
msgstr "Found ${processName} process(s) which need to be stopped.$\nDo you want the installer to stop these for you?"
#. ConfirmEndProcess_KILLING_PROCESSES_TEXT
msgid "Killing ${processName} processes."
msgstr "Killing ${processName} processes."
#. ConfirmEndProcess_KILL_NOT_FOUND_TEXT
msgid "Process to kill not found!"
msgstr "Process to kill not found!"
#. PageReinstall_NEW_Field_1
msgid ""
"An older version of ${APPLICATION_NAME} is installed on your system. It is "
"recommended that you uninstall the current version before installing. Select"
" the operation you want to perform and click Next to continue."
msgstr "An older version of ${APPLICATION_NAME} is installed on your system. It is recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
#. PageReinstall_NEW_Field_2
msgid "Uninstall before installing"
msgstr "Uninstall before installing"
#. PageReinstall_NEW_Field_3
msgid "Do not uninstall"
msgstr "Do not uninstall"
#. PageReinstall_NEW_MUI_HEADER_TEXT_TITLE
msgid "Already Installed"
msgstr "Already Installed"
#. PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE
msgid "Choose how you want to install ${APPLICATION_NAME}."
msgstr "Choose how you want to install ${APPLICATION_NAME}."
#. PageReinstall_OLD_Field_1
msgid ""
"A newer version of ${APPLICATION_NAME} is already installed! It is not "
"recommended that you install an older version. If you really want to install"
" this older version, it is better to uninstall the current version first. "
"Select the operation you want to perform and click Next to continue."
msgstr "A newer version of ${APPLICATION_NAME} is already installed! It is not recommended that you install an older version. If you really want to install this older version, it is better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
#. PageReinstall_SAME_Field_1
msgid ""
"${APPLICATION_NAME} ${VERSION} is already installed.\r\n"
"Select the operation you want to perform and click Next to continue."
msgstr "${APPLICATION_NAME} ${VERSION} is already installed.\r\nSelect the operation you want to perform and click Next to continue."
#. PageReinstall_SAME_Field_2
msgid "Add/Reinstall components"
msgstr "Add/Reinstall components"
#. PageReinstall_SAME_Field_3 UNINSTALLER_APPDATA_TITLE
msgid "Uninstall ${APPLICATION_NAME}"
msgstr "Uninstall ${APPLICATION_NAME}"
#. PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE
msgid "Choose the maintenance option to perform."
msgstr "Choose the maintenance option to perform."
#. SEC_APPLICATION_DETAILS
msgid "Installing ${APPLICATION_NAME} essentials."
msgstr "Installing ${APPLICATION_NAME} essentials."
#. OPTION_SECTION_SC_START_MENU_SECTION
msgid "Start Menu Program Shortcut"
msgstr "Start Menu Program Shortcut"
#. OPTION_SECTION_SC_START_MENU_DetailPrint
msgid "Adding shortcut for ${APPLICATION_NAME} to the Start Menu."
msgstr "Adding shortcut for ${APPLICATION_NAME} to the Start Menu."
#. OPTION_SECTION_SC_DESKTOP_SECTION
msgid "Desktop Shortcut"
msgstr "Desktop Shortcut"
#. OPTION_SECTION_SC_DESKTOP_DetailPrint
msgid "Creating Desktop Shortcuts"
msgstr "Creating Desktop Shortcuts"
#. OPTION_SECTION_SC_QUICK_LAUNCH_SECTION
msgid "Quick Launch Shortcut"
msgstr "Quick Launch Shortcut"
#. OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint
msgid "Creating Quick Launch Shortcut"
msgstr "Creating Quick Launch Shortcut"
#. OPTION_SECTION_SC_APPLICATION_Desc
msgid "${APPLICATION_NAME} essentials."
msgstr "${APPLICATION_NAME} essentials."
#. OPTION_SECTION_SC_START_MENU_Desc
msgid "${APPLICATION_NAME} shortcut."
msgstr "${APPLICATION_NAME} shortcut."
#. OPTION_SECTION_SC_DESKTOP_Desc
msgid "Desktop shortcut for ${APPLICATION_NAME}."
msgstr "Desktop shortcut for ${APPLICATION_NAME}."
#. OPTION_SECTION_SC_QUICK_LAUNCH_Desc
msgid "Quick Launch shortcut for ${APPLICATION_NAME}."
msgstr "Quick Launch shortcut for ${APPLICATION_NAME}."
#. UNINSTALLER_APPDATA_SUBTITLE
msgid "Remove ${APPLICATION_NAME}'s data folder from your computer."
msgstr "Remove ${APPLICATION_NAME}'s data folder from your computer."
#. UNINSTALLER_APPDATA_LABEL_1
msgid "Do you want to delete ${APPLICATION_NAME}'s data folder?"
msgstr "Do you want to delete ${APPLICATION_NAME}'s data folder?"
#. UNINSTALLER_APPDATA_LABEL_2
msgid ""
"Leave unchecked to keep the data folder for later use or check to delete the"
" data folder."
msgstr "Leave unchecked to keep the data folder for later use or check to delete the data folder."
#. UNINSTALLER_APPDATA_CHECKBOX
msgid "Yes, delete this data folder."
msgstr "Yes, delete this data folder."
#. UNINSTALLER_FILE_Detail
msgid "Writing Uninstaller"
msgstr "Writing Uninstaller"
#. UNINSTALLER_REGISTRY_Detail
msgid "Writing Installer Registry Keys"
msgstr "Writing Installer Registry Keys"
#. UNINSTALLER_FINISHED_Detail
msgid "Finished"
msgstr "Finished"
#. UNINSTALL_MESSAGEBOX
msgid ""
"It does not appear that ${APPLICATION_NAME} is installed in the directory '$INSTDIR'.$\r"
"$\n"
"Continue anyway (not recommended)?"
msgstr "It does not appear that ${APPLICATION_NAME} is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?"
#. UNINSTALL_ABORT
msgid "Uninstall aborted by user"
msgstr "Uninstall aborted by user"
#. INIT_NO_QUICK_LAUNCH
msgid "Quick Launch Shortcut (N/A)"
msgstr "Quick Launch Shortcut (N/A)"
#. UAC_ERROR_ELEVATE
msgid "Unable to elevate, error:"
msgstr "Unable to elevate, error:"
#. UAC_INSTALLER_REQUIRE_ADMIN
msgid "This installer requires admin access, try again"
msgstr "This installer requires admin access, try again"
#. INIT_INSTALLER_RUNNING
msgid "The installer is already running."
msgstr "The installer is already running."
#. UAC_UNINSTALLER_REQUIRE_ADMIN
msgid "This uninstaller requires admin access, try again"
msgstr "This uninstaller requires admin access, try again"
#. INIT_UNINSTALLER_RUNNING
msgid "The uninstaller is already running."
msgstr "The uninstaller is already running."
#. SectionGroup_Shortcuts
msgid "Shortcuts"
msgstr "Shortcuts"
@@ -5,7 +5,6 @@ This sample uses the registry plugin, so you need to download that if you don't
!define APPNAME "UAC_RealWorldFullyLoadedDualMode"
!define ELEVATIONTITLE "${APPNAME}: Elevate" ;displayed during elevation on our custom page
!define SMSUBDIR $StartMenuFolder ;"${APPNAME}"
!define UNINSTALLER_NAME "Uninstall ${APPNAME}.exe"
!define UNINSTALLER_REGSECTION "${APPNAME}"
!define RegPath.MSUninstall "Software\Microsoft\Windows\CurrentVersion\Uninstall"
@@ -200,10 +199,7 @@ UAC::Exec "" "Notepad.exe" "$Windir\Win.INI" "$InstDir"
FunctionEnd
Function CreateSMShortcuts
StrCpy ${SMSUBDIR} $9 ;stupid sync
CreateDirectory "$SMPrograms\${SMSUBDIR}"
CreateShortcut "$SMPrograms\${SMSUBDIR}\${APPNAME}.lnk" "$Windir\Notepad.exe"
CreateShortcut "$SMPrograms\${SMSUBDIR}\Uninstall ${APPNAME}.lnk" "$InstDir\${UNINSTALLER_NAME}"
CreateShortcut "$SMPrograms\${APPNAME}.lnk" "$Windir\Notepad.exe"
FunctionEnd
Function CreateDeskShortcuts
CreateShortcut "$Desktop\${APPNAME}.lnk" "$Windir\Notepad.exe"
@@ -222,7 +218,6 @@ ${registry::Unload}
SectionEnd
Section "Startmenu Shortcuts"
StrCpy $9 ${SMSUBDIR} ;this is stupid as hell, we need correct ${SMSUBDIR} in the outer process, this is the only way (plugins cannot enum "custom" var's AFAIK)
${UAC.CallFunctionAsUser} CreateSMShortcuts
SectionEnd
Section "Desktop Shortcut"
@@ -231,9 +226,7 @@ SectionEnd
Section Uninstall
Delete "$InstDir\${UNINSTALLER_NAME}"
Delete "$SMPrograms\${SMSUBDIR}\${APPNAME}.lnk"
Delete "$SMPrograms\${SMSUBDIR}\Uninstall ${APPNAME}.lnk"
RMDir "$SMPrograms\${SMSUBDIR}"
Delete "$SMPrograms\${APPNAME}.lnk"
Delete "$Desktop\${APPNAME}.lnk"
RMDir "$InstDir"
+73
Ver Arquivo
@@ -0,0 +1,73 @@
# - Try to find Neon
# Once done this will define
#
# NEON_FOUND - system has Neon
# NEON_INCLUDE_DIRS - the Neon include directory
# NEON_LIBRARIES - Link these to use Neon
# NEON_DEFINITIONS - Compiler switches required for using Neon
#
# Copyright (c) 2011 Andreas Schneider <asn@cryptomilk.org>
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_NEON neon)
endif (PKG_CONFIG_FOUND)
include(GNUInstallDirs)
find_path(NEON_INCLUDE_DIRS
NAMES
neon/ne_basic.h
HINTS
${_NEON_INCLUDEDIR}
${CMAKE_INSTALL_INCLUDEDIR}
)
find_library(NEON_LIBRARIES
NAMES
neon
HINTS
${_NEON_LIBDIR}
${CMAKE_INSTALL_LIBDIR}
${CMAKE_INSTALL_PREFIX}/lib
${CMAKE_INSTALL_PREFIX}/lib64
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Neon DEFAULT_MSG NEON_LIBRARIES NEON_INCLUDE_DIRS)
# show the NEON_INCLUDE_DIRS and NEON_LIBRARIES variables only in the advanced view
mark_as_advanced(NEON_INCLUDE_DIRS NEON_LIBRARIES)
# Check if neon was compiled with LFS support, if so, the NE_LFS variable has to
# be defined in the owncloud module.
# If neon was not compiled with LFS its also ok since the underlying system
# than probably supports large files anyway.
IF( CMAKE_FIND_ROOT_PATH )
FIND_PROGRAM( NEON_CONFIG_EXECUTABLE NAMES neon-config HINTS ${CMAKE_FIND_ROOT_PATH}/bin )
ELSE( CMAKE_FIND_ROOT_PATH )
FIND_PROGRAM( NEON_CONFIG_EXECUTABLE NAMES neon-config )
ENDIF( CMAKE_FIND_ROOT_PATH )
IF ( NEON_CONFIG_EXECUTABLE )
MESSAGE(STATUS "neon-config executable: ${NEON_CONFIG_EXECUTABLE}")
# neon-config --support lfs
EXECUTE_PROCESS( COMMAND ${NEON_CONFIG_EXECUTABLE} "--support" "lfs"
RESULT_VARIABLE LFS
OUTPUT_STRIP_TRAILING_WHITESPACE )
IF (LFS EQUAL 0)
MESSAGE(STATUS "libneon has been compiled with LFS support")
SET(NEON_WITH_LFS 1)
ELSE (LFS EQUAL 0)
MESSAGE(STATUS "libneon has not been compiled with LFS support, rely on OS")
ENDIF (LFS EQUAL 0)
ELSE ( NEON_CONFIG_EXECUTABLE )
MESSAGE(STATUS, "neon-config could not be found.")
ENDIF ( NEON_CONFIG_EXECUTABLE )
+3 -3
Ver Arquivo
@@ -17,15 +17,15 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>@APPLICATION_NAME@ @VERSION@</string>
<string>@APPLICATION_NAME@ @MIRALL_VERSION_STRING@</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>@VERSION@</string>
<string>@VERSION_FULL@</string>
<key>CFBundleShortVersionString</key>
<string>@VERSION@</string>
<string>@VERSION_FULL@</string>
<key>NSHumanReadableCopyright</key>
<string>(C) 2012 @APPLICATION_VENDOR@</string>
</dict>
+157
Ver Arquivo
@@ -0,0 +1,157 @@
# This file defines the Feature Logging macros.
#
# MACRO_LOG_FEATURE(VAR FEATURE DESCRIPTION URL [REQUIRED [MIN_VERSION [COMMENTS]]])
# Logs the information so that it can be displayed at the end
# of the configure run
# VAR : TRUE or FALSE, indicating whether the feature is supported
# FEATURE: name of the feature, e.g. "libjpeg"
# DESCRIPTION: description what this feature provides
# URL: home page
# REQUIRED: TRUE or FALSE, indicating whether the featue is required
# MIN_VERSION: minimum version number. empty string if unneeded
# COMMENTS: More info you may want to provide. empty string if unnecessary
#
# MACRO_DISPLAY_FEATURE_LOG()
# Call this to display the collected results.
# Exits CMake with a FATAL error message if a required feature is missing
#
# Example:
#
# INCLUDE(MacroLogFeature)
#
# FIND_PACKAGE(JPEG)
# MACRO_LOG_FEATURE(JPEG_FOUND "libjpeg" "Support JPEG images" "http://www.ijg.org" TRUE "3.2a" "")
# ...
# MACRO_DISPLAY_FEATURE_LOG()
# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
# Copyright (c) 2006, Allen Winter, <winter@kde.org>
# Copyright (c) 2009, Sebastian Trueg, <trueg@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
IF (NOT _macroLogFeatureAlreadyIncluded)
SET(_file ${CMAKE_BINARY_DIR}/MissingRequirements.txt)
IF (EXISTS ${_file})
FILE(REMOVE ${_file})
ENDIF (EXISTS ${_file})
SET(_file ${CMAKE_BINARY_DIR}/EnabledFeatures.txt)
IF (EXISTS ${_file})
FILE(REMOVE ${_file})
ENDIF (EXISTS ${_file})
SET(_file ${CMAKE_BINARY_DIR}/DisabledFeatures.txt)
IF (EXISTS ${_file})
FILE(REMOVE ${_file})
ENDIF (EXISTS ${_file})
SET(_macroLogFeatureAlreadyIncluded TRUE)
INCLUDE(FeatureSummary)
ENDIF (NOT _macroLogFeatureAlreadyIncluded)
MACRO(MACRO_LOG_FEATURE _var _package _description _url ) # _required _minvers _comments)
STRING(TOUPPER "${ARGV4}" _required)
SET(_minvers "${ARGV5}")
SET(_comments "${ARGV6}")
IF (${_var})
SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/EnabledFeatures.txt)
ELSE (${_var})
IF ("${_required}" STREQUAL "TRUE")
SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/MissingRequirements.txt)
ELSE ("${_required}" STREQUAL "TRUE")
SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/DisabledFeatures.txt)
ENDIF ("${_required}" STREQUAL "TRUE")
ENDIF (${_var})
SET(_logtext " * ${_package}")
IF (NOT ${_var})
IF (${_minvers} MATCHES ".*")
SET(_logtext "${_logtext} (${_minvers} or higher)")
ENDIF (${_minvers} MATCHES ".*")
SET(_logtext "${_logtext} <${_url}>\n ")
ELSE (NOT ${_var})
SET(_logtext "${_logtext} - ")
ENDIF (NOT ${_var})
SET(_logtext "${_logtext}${_description}")
IF (NOT ${_var})
IF (${_comments} MATCHES ".*")
SET(_logtext "${_logtext}\n ${_comments}")
ENDIF (${_comments} MATCHES ".*")
# SET(_logtext "${_logtext}\n") #double-space missing features?
ENDIF (NOT ${_var})
FILE(APPEND "${_LOGFILENAME}" "${_logtext}\n")
IF(COMMAND SET_PACKAGE_INFO) # in FeatureSummary.cmake since CMake 2.8.3
SET_PACKAGE_INFO("${_package}" "\"${_description}\"" "${_url}" "\"${_comments}\"")
ENDIF(COMMAND SET_PACKAGE_INFO)
ENDMACRO(MACRO_LOG_FEATURE)
MACRO(MACRO_DISPLAY_FEATURE_LOG)
IF(COMMAND FEATURE_SUMMARY) # in FeatureSummary.cmake since CMake 2.8.3
FEATURE_SUMMARY(FILENAME ${CMAKE_CURRENT_BINARY_DIR}/FindPackageLog.txt
WHAT ALL)
ENDIF(COMMAND FEATURE_SUMMARY)
SET(_missingFile ${CMAKE_BINARY_DIR}/MissingRequirements.txt)
SET(_enabledFile ${CMAKE_BINARY_DIR}/EnabledFeatures.txt)
SET(_disabledFile ${CMAKE_BINARY_DIR}/DisabledFeatures.txt)
IF (EXISTS ${_missingFile} OR EXISTS ${_enabledFile} OR EXISTS ${_disabledFile})
SET(_printSummary TRUE)
ENDIF (EXISTS ${_missingFile} OR EXISTS ${_enabledFile} OR EXISTS ${_disabledFile})
IF(_printSummary)
SET(_missingDeps 0)
IF (EXISTS ${_enabledFile})
FILE(READ ${_enabledFile} _enabled)
FILE(REMOVE ${_enabledFile})
SET(_summary "${_summary}\n-----------------------------------------------------------------------------\n-- The following external packages were located on your system.\n-- This installation will have the extra features provided by these packages.\n-----------------------------------------------------------------------------\n${_enabled}")
ENDIF (EXISTS ${_enabledFile})
IF (EXISTS ${_disabledFile})
SET(_missingDeps 1)
FILE(READ ${_disabledFile} _disabled)
FILE(REMOVE ${_disabledFile})
SET(_summary "${_summary}\n-----------------------------------------------------------------------------\n-- The following OPTIONAL packages could NOT be located on your system.\n-- Consider installing them to enable more features from this software.\n-----------------------------------------------------------------------------\n${_disabled}")
ENDIF (EXISTS ${_disabledFile})
IF (EXISTS ${_missingFile})
SET(_missingDeps 1)
FILE(READ ${_missingFile} _requirements)
SET(_summary "${_summary}\n-----------------------------------------------------------------------------\n-- The following REQUIRED packages could NOT be located on your system.\n-- You must install these packages before continuing.\n-----------------------------------------------------------------------------\n${_requirements}")
FILE(REMOVE ${_missingFile})
SET(_haveMissingReq 1)
ENDIF (EXISTS ${_missingFile})
IF (NOT ${_missingDeps})
SET(_summary "${_summary}\n-----------------------------------------------------------------------------\n-- Congratulations! All external packages have been found.")
ENDIF (NOT ${_missingDeps})
MESSAGE(${_summary})
MESSAGE("-----------------------------------------------------------------------------\n")
IF(_haveMissingReq)
MESSAGE(FATAL_ERROR "Exiting: Missing Requirements")
ENDIF(_haveMissingReq)
ENDIF(_printSummary)
ENDMACRO(MACRO_DISPLAY_FEATURE_LOG)
+47
Ver Arquivo
@@ -0,0 +1,47 @@
# - MACRO_OPTIONAL_FIND_PACKAGE() combines FIND_PACKAGE() with an OPTION()
# MACRO_OPTIONAL_FIND_PACKAGE( <name> [QUIT] )
# This macro is a combination of OPTION() and FIND_PACKAGE(), it
# works like FIND_PACKAGE(), but additionally it automatically creates
# an option name WITH_<name>, which can be disabled via the cmake GUI.
# or via -DWITH_<name>=OFF
# The standard <name>_FOUND variables can be used in the same way
# as when using the normal FIND_PACKAGE()
# Copyright (c) 2006-2010 Alexander Neundorf, <neundorf@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# This is just a helper macro to set a bunch of variables empty.
# We don't know whether the package uses UPPERCASENAME or CamelCaseName, so we try both:
macro(_MOFP_SET_EMPTY_IF_DEFINED _name _var)
if(DEFINED ${_name}_${_var})
set(${_name}_${_var} "")
endif(DEFINED ${_name}_${_var})
string(TOUPPER ${_name} _nameUpper)
if(DEFINED ${_nameUpper}_${_var})
set(${_nameUpper}_${_var} "")
endif(DEFINED ${_nameUpper}_${_var})
endmacro(_MOFP_SET_EMPTY_IF_DEFINED _package _var)
macro (MACRO_OPTIONAL_FIND_PACKAGE _name )
option(WITH_${_name} "Search for ${_name} package" ON)
if (WITH_${_name})
find_package(${_name} ${ARGN})
else (WITH_${_name})
string(TOUPPER ${_name} _nameUpper)
set(${_name}_FOUND FALSE)
set(${_nameUpper}_FOUND FALSE)
_mofp_set_empty_if_defined(${_name} INCLUDE_DIRS)
_mofp_set_empty_if_defined(${_name} INCLUDE_DIR)
_mofp_set_empty_if_defined(${_name} INCLUDES)
_mofp_set_empty_if_defined(${_name} LIBRARY)
_mofp_set_empty_if_defined(${_name} LIBRARIES)
_mofp_set_empty_if_defined(${_name} LIBS)
_mofp_set_empty_if_defined(${_name} FLAGS)
_mofp_set_empty_if_defined(${_name} DEFINITIONS)
endif (WITH_${_name})
endmacro (MACRO_OPTIONAL_FIND_PACKAGE)
+127 -63
Ver Arquivo
@@ -39,7 +39,6 @@
!define IMAGEFORMATS_DLL_PATH "${MING_LIB}/qt4/plugins/imageformats"
!define CSYNC_LIBRARY_DIR "@CSYNC_LIBRARY_DIR@"
!define CSYNC_PLUGIN_DIR "@CSYNC_PLUGIN_DIR@"
!define CSYNC_CONFIG_DIR "@CSYNC_CONFIG_DIR@"
!define NSI_PATH "${source_path}/admin/win/nsi"
@@ -50,7 +49,8 @@
!define VER_MAJOR "@CPACK_PACKAGE_VERSION_MAJOR@"
!define VER_MINOR "@CPACK_PACKAGE_VERSION_MINOR@"
!define VER_BUILD "@CPACK_PACKAGE_VERSION_PATCH@"
!define VER_PATCH "@CPACK_PACKAGE_VERSION_PATCH@"
!define VER_BUILD "@CPACK_PACKAGE_VERSION_BUILD@"
!define VERSION "@CPACK_PACKAGE_VERSION@"
;-----------------------------------------------------------------------------
@@ -111,7 +111,7 @@ ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
!ifdef OPTION_FINISHPAGE_RELEASE_NOTES
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\NOTES.txt"
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Show release notes"
!define MUI_FINISHPAGE_SHOWREADME_TEXT $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING
!endif
!ifdef OPTION_FINISHPAGE_LAUNCHER
!define MUI_FINISHPAGE_NOAUTOCLOSE
@@ -142,6 +142,9 @@ UninstPage custom un.UnPageUserAppData un.UnPageUserAppDataLeave
;-----------------------------------------------------------------------------
!insertmacro MUI_LANGUAGE "English"
!include ${source_path}/admin/win/nsi/l10n/languages.nsh
!include ${source_path}/admin/win/nsi/l10n/declarations.nsh
##############################################################################
# #
# FINISH PAGE LAUNCHER FUNCTIONS #
@@ -169,14 +172,14 @@ FunctionEnd
!macro ConfirmEndProcess processName
MessageBox MB_YESNO|MB_ICONEXCLAMATION \
"Found ${processName} process(s) which need to be stopped.$\nDo you want the installer to stop these for you?" \
$ConfirmEndProcess_MESSAGEBOX_TEXT \
IDYES process_${processName}_kill IDNO process_${processName}_ended
process_${processName}_kill:
DetailPrint "Killing ${processName} processes."
DetailPrint $ConfirmEndProcess_KILLING_PROCESSES_TEXT
Processes::KillProcess ${processName}
Sleep 1500
StrCmp $R0 "1" process_${processName}_ended
DetailPrint "Process to kill not found!"
DetailPrint $ConfirmEndProcess_KILL_NOT_FOUND_TEXT
process_${processName}_ended:
!macroend
@@ -206,32 +209,35 @@ Function PageReinstall
IntCmp $R0 ${VER_MAJOR} minor_check new_version older_version
minor_check:
ReadRegDWORD $R0 HKLM "Software\${APPLICATION_NAME}" "VersionMinor"
IntCmp $R0 ${VER_MINOR} build_check new_version older_version
IntCmp $R0 ${VER_MINOR} rev_check new_version older_version
rev_check:
ReadRegDWORD $R0 HKLM "Software\${APPLICATION_NAME}" "VersionRevision"
IntCmp $R0 ${VER_PATCH} build_check new_version older_version
build_check:
ReadRegDWORD $R0 HKLM "Software\${APPLICATION_NAME}" "VersionBuild"
IntCmp $R0 ${VER_BUILD} same_version new_version older_version
new_version:
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 1" "Text" "An older version of ${APPLICATION_NAME} is installed on your system. It is recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 2" "Text" "Uninstall before installing"
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 3" "Text" "Do not uninstall"
!insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${APPLICATION_NAME}."
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 1" "Text" $PageReinstall_NEW_Field_1
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 2" "Text" $PageReinstall_NEW_Field_2
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 3" "Text" $PageReinstall_NEW_Field_3
!insertmacro MUI_HEADER_TEXT $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE
StrCpy $R0 "1"
Goto reinst_start
older_version:
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 1" "Text" "A newer version of ${APPLICATION_NAME} is already installed! It is not recommended that you install an older version. If you really want to install this older version, it is better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 2" "Text" "Uninstall before installing"
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 3" "Text" "Do not uninstall"
!insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${APPLICATION_NAME}."
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 1" "Text" $PageReinstall_OLD_Field_1
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 2" "Text" $PageReinstall_OLD_Field_2
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 3" "Text" $PageReinstall_OLD_Field_3
!insertmacro MUI_HEADER_TEXT $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE $PageReinstall_OLD_MUI_HEADER_TEXT_SUBTITLE
StrCpy $R0 "1"
Goto reinst_start
same_version:
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 1" "Text" "${APPLICATION_NAME} ${VERSION} is already installed.\r\nSelect the operation you want to perform and click Next to continue."
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 2" "Text" "Add/Reinstall components"
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 3" "Text" "Uninstall ${APPLICATION_NAME}"
!insertmacro MUI_HEADER_TEXT "Already Installed" "Choose the maintenance option to perform."
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 1" "Text" $PageReinstall_SAME_Field_1
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 2" "Text" $PageReinstall_SAME_Field_2
!insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 3" "Text" $PageReinstall_SAME_Field_3
!insertmacro MUI_HEADER_TEXT $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE
StrCpy $R0 "2"
reinst_start:
@@ -271,7 +277,7 @@ Section "${APPLICATION_NAME}" SEC_APPLICATION
SetDetailsPrint listonly
SetDetailsPrint textonly
DetailPrint "Installing ${APPLICATION_NAME} essentials."
DetailPrint $SEC_APPLICATION_DETAILS
SetDetailsPrint listonly
SetOutPath "$INSTDIR"
@@ -297,11 +303,9 @@ Section "${APPLICATION_NAME}" SEC_APPLICATION
File "${IMAGEFORMATS_DLL_PATH}\qjpeg4.dll"
File "${IMAGEFORMATS_DLL_PATH}\qico4.dll"
SetOutPath "$INSTDIR\modules"
; FIXME: fix installation dir of module, currently needs manual copying to
; /usr/i686-w64-mingw32/sys-root/mingw/bin/csync_modules/
SetOutPath "$INSTDIR\sqldrivers"
File "${SQLITE_DLL_PATH}\qsqlite4.dll"
File "${CSYNC_PLUGIN_DIR}/ocsync_owncloud.dll"
SetOutPath "$INSTDIR"
!endif
@@ -315,16 +319,15 @@ Section "${APPLICATION_NAME}" SEC_APPLICATION
File "${QT_DLL_PATH}\QtCore4.dll"
File "${QT_DLL_PATH}\QtGui4.dll"
File "${QT_DLL_PATH}\QtNetwork4.dll"
File "${QT_DLL_PATH}\QtSql4.dll"
File "${QT_DLL_PATH}\QtXml4.dll"
File "${QT_DLL_PATH}\QtWebKit4.dll"
;QtKeyChain stuff
File "${MING_BIN}\libqtkeychain.dll"
File "${CSYNC_LIBRARY_DIR}/libocsync.dll"
File "${CSYNC_LIBRARY_DIR}\libocsync.dll"
File "${MING_BIN}\libsqlite3-0.dll"
File "${MING_BIN}\libiniparser.dll"
File "${MING_BIN}\libdl.dll"
File "${MING_BIN}\libpng15-15.dll"
; ownCloud plugin
@@ -350,40 +353,35 @@ Section "${APPLICATION_NAME}" SEC_APPLICATION
SectionEnd
SectionGroup "Shortcuts"
SectionGroup $SectionGroup_Shortcuts
!ifdef OPTION_SECTION_SC_START_MENU
${MementoSection} "Start Menu Program Group" SEC_START_MENU
${MementoSection} $OPTION_SECTION_SC_START_MENU_SECTION SEC_START_MENU
SectionIn 1 2 3
SetDetailsPrint textonly
DetailPrint "Adding shortcuts for the ${APPLICATION_NAME} program group to the Start Menu."
DetailPrint $OPTION_SECTION_SC_START_MENU_DetailPrint
SetDetailsPrint listonly
SetShellVarContext all
RMDir /r "$SMPROGRAMS\${APPLICATION_NAME}"
CreateDirectory "$SMPROGRAMS\${APPLICATION_NAME}"
;CreateShortCut "$SMPROGRAMS\${APPLICATION_NAME}\LICENSE.lnk" "$INSTDIR\LICENSE.txt"
CreateShortCut "$SMPROGRAMS\${APPLICATION_NAME}\${APPLICATION_NAME}.lnk" "$INSTDIR\${APPLICATION_EXECUTABLE}"
;CreateShortCut "$SMPROGRAMS\${APPLICATION_NAME}\Release notes.lnk" "$INSTDIR\NOTES.txt"
CreateShortCut "$SMPROGRAMS\${APPLICATION_NAME}\Uninstall.lnk" "$INSTDIR\uninstall.exe"
CreateShortCut "$SMPROGRAMS\${APPLICATION_NAME}.lnk" "$INSTDIR\${APPLICATION_EXECUTABLE}"
SetShellVarContext current
${MementoSectionEnd}
!endif
!ifdef OPTION_SECTION_SC_DESKTOP
${MementoSection} "Desktop Shortcut" SEC_DESKTOP
${MementoSection} $OPTION_SECTION_SC_DESKTOP_SECTION SEC_DESKTOP
SectionIn 1 2
SetDetailsPrint textonly
DetailPrint "Creating Desktop Shortcuts"
DetailPrint $OPTION_SECTION_SC_DESKTOP_DetailPrint
SetDetailsPrint listonly
CreateShortCut "$DESKTOP\${APPLICATION_NAME}.lnk" "$INSTDIR\${APPLICATION_EXECUTABLE}"
${MementoSectionEnd}
!endif
!ifdef OPTION_SECTION_SC_QUICK_LAUNCH
${MementoSection} "Quick Launch Shortcut" SEC_QUICK_LAUNCH
${MementoSection} $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION SEC_QUICK_LAUNCH
SectionIn 1 2
SetDetailsPrint textonly
DetailPrint "Creating Quick Launch Shortcut"
DetailPrint $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint
SetDetailsPrint listonly
CreateShortCut "$QUICKLAUNCH\${APPLICATION_NAME}.lnk" "$INSTDIR\${APPLICATION_EXECUTABLE}"
${MementoSectionEnd}
@@ -396,30 +394,31 @@ ${MementoSectionDone}
; Installer section descriptions
;--------------------------------
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_APPLICATION} "${APPLICATION_NAME} essentials."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_START_MENU} "${APPLICATION_NAME} program group."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_DESKTOP} "Desktop shortcut for ${APPLICATION_NAME}."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_QUICK_LAUNCH} "Quick Launch shortcut for ${APPLICATION_NAME}."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_APPLICATION} $OPTION_SECTION_SC_APPLICATION_Desc
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_START_MENU} $OPTION_SECTION_SC_START_MENU_Desc
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_DESKTOP} $OPTION_SECTION_SC_DESKTOP_Desc
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_QUICK_LAUNCH} $OPTION_SECTION_SC_QUICK_LAUNCH_Desc
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Section -post
;Uninstaller file.
SetDetailsPrint textonly
DetailPrint "Writing Uninstaller"
DetailPrint $UNINSTALLER_FILE_Detail
SetDetailsPrint listonly
WriteUninstaller $INSTDIR\uninstall.exe
;Registry keys required for installer version handling and uninstaller.
SetDetailsPrint textonly
DetailPrint "Writing Installer Registry Keys"
DetailPrint $UNINSTALLER_REGISTRY_Detail
SetDetailsPrint listonly
;Version numbers used to detect existing installation version for comparisson.
WriteRegStr HKLM "Software\${APPLICATION_NAME}" "" $INSTDIR
WriteRegDWORD HKLM "Software\${APPLICATION_NAME}" "VersionMajor" "${VER_MAJOR}"
WriteRegDWORD HKLM "Software\${APPLICATION_NAME}" "VersionMinor" "${VER_MINOR}"
WriteRegDWORD HKLM "Software\${APPLICATION_NAME}" "VersionRevision" "${REVISION}"
WriteRegDWORD HKLM "Software\${APPLICATION_NAME}" "VersionRevision" "${VER_PATCH}"
WriteRegDWORD HKLM "Software\${APPLICATION_NAME}" "VersionBuild" "${VER_BUILD}"
;Add or Remove Programs entry.
@@ -438,7 +437,7 @@ Section -post
SetDetailsPrint textonly
DetailPrint "Finished."
DetailPrint $UNINSTALLER_FINISHED_Detail
SectionEnd
##############################################################################
@@ -453,7 +452,7 @@ Var UnPageUserAppDataCheckbox_State
Var UnPageUserAppDataEditBox
Function un.UnPageUserAppData
!insertmacro MUI_HEADER_TEXT "Uninstall ${APPLICATION_NAME}" "Remove ${APPLICATION_NAME}'s data folder from your computer."
!insertmacro MUI_HEADER_TEXT $UNINSTALLER_APPDATA_TITLE $UNINSTALLER_APPDATA_SUBTITLE
nsDialogs::Create /NOUNLOAD 1018
Pop $UnPageUserAppDataDialog
@@ -461,17 +460,17 @@ Function un.UnPageUserAppData
Abort
${EndIf}
${NSD_CreateLabel} 0 0 100% 12u "Do you want to delete ${APPLICATION_NAME}'s data folder?"
${NSD_CreateLabel} 0 0 100% 12u $UNINSTALLER_APPDATA_LABEL_1
Pop $0
${NSD_CreateText} 0 13u 100% 12u "$LOCALAPPDATA\${APPLICATION_NAME}"
Pop $UnPageUserAppDataEditBox
SendMessage $UnPageUserAppDataEditBox ${EM_SETREADONLY} 1 0
${NSD_CreateLabel} 0 46u 100% 24u "Leave unchecked to keep the data folder for later use or check to delete the data folder."
${NSD_CreateLabel} 0 46u 100% 24u $UNINSTALLER_APPDATA_LABEL_2
Pop $0
${NSD_CreateCheckbox} 0 71u 100% 8u "Yes, delete this data folder."
${NSD_CreateCheckbox} 0 71u 100% 8u $UNINSTALLER_APPDATA_CHECKBOX
Pop $UnPageUserAppDataCheckbox
nsDialogs::Show
@@ -487,8 +486,8 @@ FunctionEnd
Section Uninstall
IfFileExists "$INSTDIR\${APPLICATION_EXECUTABLE}" owncloud_installed
MessageBox MB_YESNO "It does not appear that ${APPLICATION_NAME} is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?" IDYES owncloud_installed
Abort "Uninstall aborted by user"
MessageBox MB_YESNO $UNINSTALL_MESSAGEBOX IDYES owncloud_installed
Abort $UNINSTALL_ABORT
owncloud_installed:
;Delete registry keys.
@@ -505,7 +504,7 @@ Section Uninstall
;Start menu shortcuts.
!ifdef OPTION_SECTION_SC_START_MENU
SetShellVarContext all
RMDir /r "$SMPROGRAMS\${APPLICATION_NAME}"
Delete "$SMPROGRAMS\${APPLICATION_NAME}.lnk"
SetShellVarContext current
!endif
@@ -530,7 +529,7 @@ Section Uninstall
${EndIf}
SetDetailsPrint textonly
DetailPrint "Finshed."
DetailPrint $UNINSTALLER_FINISHED_Detail
SectionEnd
##############################################################################
@@ -542,9 +541,74 @@ SectionEnd
Function .onInit
!insertmacro INSTALLOPTIONS_EXTRACT "NSIS.InstallOptions.ini"
; uncomment this line if you want to see the language selection
;!insertmacro MUI_LANGDLL_DISPLAY
# load the selected language file
StrCmp $LANGUAGE ${LANG_ENGLISH} English 0
StrCmp $LANGUAGE ${LANG_GERMAN} German 0
StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
StrCmp $LANGUAGE ${LANG_JAPANESE} Japanese 0
StrCmp $LANGUAGE ${LANG_SLOVENIAN} Slovenian 0
StrCmp $LANGUAGE ${LANG_SPANISH} Spanish 0
StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
StrCmp $LANGUAGE ${LANG_ESTONIAN} Estonian 0
StrCmp $LANGUAGE ${LANG_GREEK} Greek 0
StrCmp $LANGUAGE ${LANG_GREEK} Basque 0
StrCmp $LANGUAGE ${LANG_GREEK} Galician 0
StrCmp $LANGUAGE ${LANG_GREEK} Slovak 0
StrCmp $LANGUAGE ${LANG_GREEK} Turkish 0
StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
English:
!include "${source_path}/admin/win/nsi/l10n\English.nsh"
Goto EndLanguageCmp
German:
!include "${source_path}/admin/win/nsi/l10n\German.nsh"
Goto EndLanguageCmp
Dutch:
!include "${source_path}/admin/win/nsi/l10n\Dutch.nsh"
Goto EndLanguageCmp
Finnish:
!include "${source_path}/admin/win/nsi/l10n\Finnish.nsh"
Goto EndLanguageCmp
Japanese:
!include "${source_path}/admin/win/nsi/l10n\Japanese.nsh"
Goto EndLanguageCmp
Slovenian:
!include "${source_path}/admin/win/nsi/l10n\Slovenian.nsh"
Goto EndLanguageCmp
Spanish:
!include "${source_path}/admin/win/nsi/l10n\Spanish.nsh"
Goto EndLanguageCmp
Italian:
!include "${source_path}/admin/win/nsi/l10n\Italian.nsh"
Goto EndLanguageCmp
Estonian:
!include "${source_path}/admin/win/nsi/l10n\Estonian.nsh"
Goto EndLanguageCmp
Greek:
!include "${source_path}/admin/win/nsi/l10n\Greek.nsh"
Goto EndLanguageCmp
Basque:
!include "${source_path}/admin/win/nsi/l10n\Basque.nsh"
Goto EndLanguageCmp
Galician:
!include "${source_path}/admin/win/nsi/l10n\Galician.nsh"
Goto EndLanguageCmp
Slovak:
!include "${source_path}/admin/win/nsi/l10n\Slovak.nsh"
Goto EndLanguageCmp
Turkish:
!include "${source_path}/admin/win/nsi/l10n\Turkish.nsh"
Goto EndLanguageCmp
Brazilian:
!include "${source_path}/admin/win/nsi/l10n\PortugueseBR.nsh"
EndLanguageCmp:
;Remove Quick Launch option from Windows 7, as no longer applicable - usually.
${IfNot} ${AtMostWinVista}
SectionSetText ${SEC_QUICK_LAUNCH} "Quick Launch Shortcut (N/A)"
SectionSetText ${SEC_QUICK_LAUNCH} $INIT_NO_QUICK_LAUNCH
SectionSetFlags ${SEC_QUICK_LAUNCH} ${SF_RO}
SectionSetInstTypes ${SEC_QUICK_LAUNCH} 0
${EndIf}
@@ -559,7 +623,7 @@ Function .onInit
Quit
UAC_Err:
MessageBox MB_ICONSTOP "Unable to elevate, error $0"
MessageBox MB_ICONSTOP "$UAC_ERROR_ELEVATE $0"
Abort
UAC_ElevationAborted:
@@ -568,14 +632,14 @@ Function .onInit
UAC_Success:
StrCmp 1 $3 +4 ;Admin?
StrCmp 3 $1 0 UAC_ElevationAborted ;Try again?
MessageBox MB_ICONSTOP "This installer requires admin access, try again"
MessageBox MB_ICONSTOP $UAC_INSTALLER_REQUIRE_ADMIN
goto UAC_Elevate
;Prevent multiple instances.
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "owncloudInstaller") i .r1 ?e'
Pop $R0
StrCmp $R0 0 +3
MessageBox MB_OK|MB_ICONEXCLAMATION "The installer is already running."
MessageBox MB_OK|MB_ICONEXCLAMATION $INIT_INSTALLER_RUNNING
Abort
;Use available InstallLocation when possible. This is useful in the uninstaller
@@ -613,7 +677,7 @@ Function un.onInit
Quit
UAC_Err:
MessageBox MB_ICONSTOP "Unable to elevate, error $0"
MessageBox MB_ICONSTOP "$UAC_ERROR_ELEVATE $0"
Abort
UAC_ElevationAborted:
@@ -622,14 +686,14 @@ Function un.onInit
UAC_Success:
StrCmp 1 $3 +4 ;Admin?
StrCmp 3 $1 0 UAC_ElevationAborted ;Try again?
MessageBox MB_ICONSTOP "This uninstaller requires admin access, try again"
MessageBox MB_ICONSTOP $UAC_UNINSTALLER_REQUIRE_ADMIN
goto UAC_Elevate
;Prevent multiple instances.
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "owncloudUninstaller") i .r1 ?e'
Pop $R0
StrCmp $R0 0 +3
MessageBox MB_OK|MB_ICONEXCLAMATION "This uninstaller is already running."
MessageBox MB_OK|MB_ICONEXCLAMATION $INIT_UNINSTALLER_RUNNING
Abort
;Shutdown ${APPLICATION_NAME} in order to remove locked files.
+131
Ver Arquivo
@@ -0,0 +1,131 @@
include (MacroOptionalFindPackage)
include (MacroLogFeature)
option(BUILD_WITH_QT4 "Build with Qt4 no matter if Qt5 was found" ON)
if( NOT BUILD_WITH_QT4 )
find_package(Qt5Core QUIET)
if( Qt5Core_DIR )
find_package(Qt5Widgets QUIET)
find_package(Qt5Quick QUIET)
find_package(Qt5PrintSupport QUIET)
find_package(Qt5WebKit QUIET)
find_package(Qt5Location QUIET)
find_package(Qt5Network QUIET)
find_package(Qt5Sensors QUIET)
find_package(Qt5Xml QUIET)
# find_package(Qt5WebKitWidgets QUIET)
message(STATUS "Using Qt 5!")
# We need this to find the paths to qdbusxml2cpp and co
if (WITH_DBUS)
find_package(Qt5DBus REQUIRED)
include_directories(${Qt5DBus_INCLUDES})
add_definitions(${Qt5DBus_DEFINITIONS})
endif (WITH_DBUS)
include_directories(${Qt5Widgets_INCLUDES})
add_definitions(${Qt5Widgets_DEFINITIONS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
# set(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
macro(qt_wrap_ui)
qt5_wrap_ui(${ARGN})
endmacro()
macro(qt_add_resources)
qt5_add_resources(${ARGN})
endmacro()
# find_package(Qt5LinguistTools REQUIRED)
macro(qt_add_translation)
# qt5_add_translation(${ARGN})
endmacro()
macro(qt_add_dbus_interface)
qt5_add_dbus_interface(${ARGN})
endmacro()
macro(qt_add_dbus_adaptor)
qt5_add_dbus_adaptor(${ARGN})
endmacro()
macro(qt_wrap_cpp)
qt5_wrap_cpp(${ARGN})
endmacro()
macro(install_qt_executable)
install_qt5_executable(${ARGN})
endmacro()
macro(setup_qt)
endmacro()
set(QT_RCC_EXECUTABLE "${Qt5Core_RCC_EXECUTABLE}")
#Enable deprecated symbols
add_definitions("-DQT_DISABLE_DEPRECATED_BEFORE=0")
endif()
endif()
if( NOT Qt5Core_DIR )
message(STATUS "Could not find Qt5, searching for Qt4 instead...")
set(NEEDED_QT4_COMPONENTS "QtCore" "QtXml" "QtNetwork" "QtGui" "QtWebkit")
if( BUILD_TESTS )
list(APPEND NEEDED_QT4_COMPONENTS "QtTest")
endif()
macro_optional_find_package(Qt4 4.7.0 COMPONENTS ${NEEDED_QT4_COMPONENTS} )
macro_log_feature(QT4_FOUND "Qt" "A cross-platform application and UI framework" "http://qt.nokia.com" TRUE "" "If you see this, although libqt4-devel is installed, check whether the \n qtwebkit-devel package and whatever contains QtUiTools is installed too")
macro(qt5_use_modules)
endmacro()
macro(qt_wrap_ui)
qt4_wrap_ui(${ARGN})
endmacro()
macro(qt_add_resources)
qt4_add_resources(${ARGN})
endmacro()
macro(qt_add_translation)
qt4_add_translation(${ARGN})
endmacro()
macro(qt_add_dbus_interface)
qt4_add_dbus_interface(${ARGN})
endmacro()
macro(qt_add_dbus_adaptor)
qt4_add_dbus_adaptor(${ARGN})
endmacro()
macro(qt_wrap_cpp)
qt4_wrap_cpp(${ARGN})
endmacro()
macro(install_qt_executable)
install_qt4_executable(${ARGN})
endmacro()
macro(setup_qt)
set(QT_USE_QTGUI TRUE)
set(QT_USE_QTSQL TRUE)
set(QT_USE_QTNETWORK TRUE)
set(QT_USE_QTXML TRUE)
set(QT_USE_QTWEBKIT TRUE)
set(QT_USE_QTDBUS TRUE)
include( ${QT_USE_FILE} )
endmacro()
endif()
if( Qt5Core_DIR )
set( HAVE_QT5 TRUE )
else( Qt5Core_DIR )
set( HAVE_QT5 FALSE )
endif( Qt5Core_DIR )
+2
Ver Arquivo
@@ -15,4 +15,6 @@
#cmakedefine SYSCONFDIR "@SYSCONFDIR@"
#cmakedefine DATADIR "@DATADIR@"
#cmakedefine NEON_WITH_LFS "@NEON_WITH_LFS@"
#endif
+1 -1
Ver Arquivo
@@ -36,7 +36,7 @@ if(SPHINX_FOUND)
-D latex_logo=${LATEX_LOGO}
${CMAKE_CURRENT_SOURCE_DIR}
${SPHINX_PDF_DIR} )
add_custom_target(doc-pdf make -C ${SPHINX_PDF_DIR} all-pdf
add_custom_target(doc-pdf $(MAKE) -C ${SPHINX_PDF_DIR} all-pdf
DEPENDS doc-latex )
add_dependencies(doc doc-pdf)
if (WITH_DOC)
-153
Ver Arquivo
@@ -1,153 +0,0 @@
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
-rm -rf $(BUILDDIR)/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/OwncloudDocumentation.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/OwncloudDocumentation.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/OwncloudDocumentation"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/OwncloudDocumentation"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
+38 -2
Ver Arquivo
@@ -137,12 +137,48 @@ the timestamp of the conflict detection.
Ignored Files
-------------
ownCloud Client will refuse to sync the following files:
ownCloud Client supports that certain files are excluded or ignored from
the synchronization. There are a couple of system wide file patterns which
come with the client. Custom patterns can be added by the user.
ownCloud Client will ignore 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)
* Files starting in ``.csync_journal.db*`` (reserved for journalling)
If a pattern is checkmarked in the `ignoredFilesEditor-label` (or if a line in
the exclude file starts with the character `]` directly followed
by the file pattern), files matching this pattern are considered fleeting
meta data. These files are ingored and *removed* by the client if found
in the sync folder. This is suitable for meta files created by some
applications that have no sustainable meaning.
If a pattern is ending with character `/` it means that only directories are
matched. The pattern is only applied for directory components of the checked
filename.
To match file names against the exclude patterns, the unix standard C
library function fnmatch is used. It checks the filename against the pattern
using standard shell wildcard pattern matching. Check `The opengroup website
<http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_13_01>`
for the gory details.
The path that is checked is the relative path unter the sync root directory.
Examples:
^^^^^^^^^
+-----------+------------------------------+
| Pattern | Matches |
+===========+==============================+
| ``~$*`` | ``~$foo``, ``~$example.doc`` |
+-----------+------------------------------+
| ``fl?p`` | ``flip``, ``flap`` |
+-----------+------------------------------+
| ``moo/`` | ``map/moo/``, ``moo/`` |
+-----------+------------------------------+
The Sync Journal
----------------
+27 -24
Ver Arquivo
@@ -7,6 +7,11 @@ This section explains how to build the ownCloud Client from source
for all major platforms. You should read this section if you want
to development on the desktop client.
Note that the building instruction are subject to change as development
proceeds. It is important to check the version which is to built.
This instructions were updated to work with ownCloud Client 1.5.
Linux
-----
@@ -39,10 +44,6 @@ Next, install the missing dependencies::
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`_.
@@ -56,13 +57,12 @@ Windows (cross-compile)
Due to the amount of dependencies that csync entails, building the client
for Windows is **currently only supported on openSUSE**, by using the MinGW
cross compiler. You can set up openSUSE 12.1 or 12.2 in a virtual machine
cross compiler. You can set up openSUSE 12.1, 12.2 or 13.1 in a virtual machine
if you do not have it installed already.
In order to cross-compile, the following repositories need to be added
via YaST or ``zypper ar`` (adjust when using openSUSE 12.2)::
via YaST or ``zypper ar`` (adjust when using openSUSE 12.2 or 13.1)::
zypper ar http://download.opensuse.org/repositories/isv:/ownCloud:/devel:/mingw:/win32/openSUSE_12.1/isv:ownCloud:devel:mingw:win32.repo
zypper ar http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_12.1/windows:mingw:win32.repo
zypper ar http://download.opensuse.org/repositories/windows:/mingw/openSUSE_12.1/windows:mingw.repo
@@ -70,14 +70,16 @@ Next, install the cross-compiler packages and the cross-compiled dependencies::
zypper install cmake make mingw32-cross-binutils mingw32-cross-cpp mingw32-cross-gcc \
mingw32-cross-gcc-c++ mingw32-cross-pkg-config mingw32-filesystem \
mingw32-headers mingw32-runtime site-config mingw32-iniparser-devel \
mingw32-libsqlite-devel mingw32-dlfcn-devel mingw32-libssh2-devel \
kdewin-png2ico mingw32-libqt4 mingw32-libqt4-devel mingw32-libgcrypt \
mingw32-libgnutls mingw32-libneon mingw32-libneon-devel mingw32-libbeecrypt \
mingw32-libopenssl mingw32-openssl mingw32-libpng-devel mingw32-libsqlite \
mingw32-qtkeychain mingw32-qtkeychain-devel mingw32-iniparser mingw32-dlfcn \
mingw32-libintl-devel mingw32-libneon-devel mingw32-libopenssl-devel \
mingw32-libproxy-devel mingw32-libxml2-devel mingw32-zlib-devel
mingw32-headers mingw32-runtime site-config mingw32-libqt4-sql \
mingw32-libqt4-sql-sqlite mingw32-libsqlite-devel \
mingw32-dlfcn-devel mingw32-libssh2-devel kdewin-png2ico \
mingw32-libqt4 mingw32-libqt4-devel mingw32-libgcrypt \
mingw32-libgnutls mingw32-libneon-openssl mingw32-libneon-devel \
mingw32-libbeecrypt mingw32-libopenssl mingw32-openssl \
mingw32-libpng-devel mingw32-libsqlite mingw32-qtkeychain \
mingw32-qtkeychain-devel mingw32-dlfcn mingw32-libintl-devel \
mingw32-libneon-devel mingw32-libopenssl-devel mingw32-libproxy-devel \
mingw32-libxml2-devel mingw32-zlib-devel
For the installer, the NSIS installer package is also required::
@@ -89,10 +91,10 @@ For the installer, the NSIS installer package is also required::
mingw32-cross-nsis-plugin-processes mingw32-cross-nsis-plugin-uac
You will also need to manually download and install the following files with
``rpm -ivh <package>`` (They will also work with OpenSUSE 12.2)::
``rpm -ivh <package>`` (They will also work with openSUSE 12.2 and newer)::
rpm -ihv http://pmbs.links2linux.org/download/mingw:/32/openSUSE_12.1/x86_64/mingw32-cross-nsis-plugin-processes-0-1.1.x86_64.rpm
rpm -ihv http://pmbs.links2linux.org/download/mingw:/32/openSUSE_12.1/x86_64/mingw32-cross-nsis-plugin-uac-0-3.1.x86_64.rpm
rpm -ihv http://download.tomahawk-player.org/packman/mingw:32/openSUSE_12.1/x86_64/mingw32-cross-nsis-plugin-processes-0-1.1.x86_64.rpm
rpm -ihv http://download.tomahawk-player.org/packman/mingw:32/openSUSE_12.1/x86_64/mingw32-cross-nsis-plugin-uac-0-3.1.x86_64.rpm
Now, follow the `generic build instructions`_, but pay attention to
the following differences:
@@ -122,7 +124,7 @@ CMake and Mirall can be downloaded at ownCloud's `Client Download Page`_.
If you want to build the leading edge version of the client, you should
use the latest versions of Mirall and CSync via Git_, like so::
git clone git://git.csync.org/users/freitag/csync.git ocsync
git clone git://git.csync.org/users/owncloud/csync.git ocsync
git clone git://github.com/owncloud/mirall.git
Next, create build directories::
@@ -131,11 +133,11 @@ Next, create build directories::
mkdir mirall-build
This guide assumes that all directories are residing next to each other.
Next, make sure to check out the 'dav' branch in the newly checked out
Next, make sure to check out the branch called 'ocsync' in the newly checked out
`ocsync` directory::
cd ocsync
git checkout dav
git checkout ocsync
The first package to build is CSync::
@@ -144,9 +146,10 @@ The first package to build is CSync::
make
You probably have to satisfy some dependencies. Make sure to install all the
needed development packages. You will need ``iniparser``, ``sqlite3`` as well as
``neon`` for the ownCloud module. Take special care about ``neon``. If that is
missing, the cmake run will succeed but silently not build the ownCloud module.
needed development packages. You will need ``sqlite3`` as well as ``neon`` for
the ownCloud module. Take special care about ``neon``. If that is missing, the
cmake run will succeed but silently not build the ownCloud module.
``libssh`` and ``libsmbclient`` are optional and not required for the client
to work. If you want to install the client, run ``make install`` as a final step.
+2
Ver Arquivo
@@ -215,6 +215,8 @@ latex_documents = [
man_pages = [
('owncloud.1', 'owncloud', u'File synchronisation desktop utility.',
[u'The ownCloud developers'], 1),
('owncloudcmd.1', 'owncloudcmd', u'Command line ownCloud client tool.',
[u'The ownCloud developers'], 1),
]
# If true, show URL addresses after external links.
+4 -3
Ver Arquivo
@@ -1,7 +1,8 @@
:orphan:
owncloud(1)
-----------
SYNOPSIS
========
*owncloud* [`OPTIONS`...]
@@ -28,10 +29,10 @@ Config File
BUGS
====
Please report bugs at https://github.com/owncloud/core/issues.
Please report bugs at https://github.com/owncloud/mirall/issues.
SEE ALSO
========
`csync(1)`
:manpage:`owncloudcmd(1)`
+34
Ver Arquivo
@@ -0,0 +1,34 @@
:orphan:
owncloudcmd(1)
--------------
SYNOPSIS
========
*owncloudcmd* [`OPTIONS`...] sourcedir owncloudurl
DESCRIPTION
===========
owncloudcmd is the command line tool for the ownCloud file synchronisation
desktop utility, based on mirall.
Contrary to the :manpage:`owncloud(1)` GUI client, `owncloudcmd` will only
perform a single sync run and then exit. It thus replaces the `ocsync` binary
used for the same purpose in earlier releases.
A sync run will sync a single local directory with a WebDAV share on a
remote ownCloud server.
OPTIONS
=======
``--confdir`` `PATH`
The configuration dir where `csync.conf` is located
BUGS
====
Please report bugs at https://github.com/owncloud/mirall/issues.
SEE ALSO
========
:manpage:`owncloud(1)`
+29 -26
Ver Arquivo
@@ -25,7 +25,7 @@ Here is an explanation of the individual items in the menu:
* 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
and provides access to the Sync status, 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.
@@ -120,12 +120,12 @@ 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
~~~~~~~~~~~~~~~~~
The Sync Status Display
~~~~~~~~~~~~~~~~~~~~~~~
.. index:: sync protocol
.. index:: sync status
The ``Sync Protocol`` window, which can be invoked from either from the main
The ``Sync Status`` 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
@@ -144,19 +144,26 @@ 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,
ownCloud Client has the ability to exclude files from the sync process.
The ignored files editor allows editing of custom patterns for files or
directories that should be excluded from the sync process.
There is a system wide list of default ignore patterns. These global defaults
cannot be directly modified within the editor. Hovering with the mouse will
reveal the location of the global exclude definition file.
.. image:: images/ignored_files_editor.png
:scale: 50%
Each line contains an ignore pattern string. 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
(``?``).
(``?``). If a pattern ends with a slash character (``/``) the pattern is only
applied to directory components of the path to check.
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`.
If the checkbox is checked for a pattern in the editor it means that files
which are matched by this pattern are fleeting metadata which the client will
*remove*.
.. note:: Modifying the global exclude definition file might render the
client unusable or cause undesired behavior.
@@ -164,15 +171,11 @@ see :ref:`ignored-files-label`.
.. 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%
In addition to this list, ownCloud Client always excludes files with
characters that cannot be synced to other file systems.
Examples:
^^^^^^^^^
+-----------+------------------------------+
| Pattern | Matches |
+===========+==============================+
| ``~$*`` | ``~$foo``, ``~$example.doc`` |
+-----------+------------------------------+
| ``fl?p`` | ``flip``, ``flap`` |
+-----------+------------------------------+
With version 1.5.0 it also ignores files that caused individual errors
while syncing for a three times. These are listed in the activity view.
There also is a button to retry the sync for another three times.
For more detailed information see :ref:`ignored-files-label`.
+1
Ver Arquivo
@@ -11,6 +11,7 @@
<file>resources/view-refresh.png</file>
<file>resources/warning-16.png</file>
<file>resources/settings.png</file>
<file>resources/activity.png</file>
<file>resources/network.png</file>
<file>resources/owncloud_logo_blue.png</file>
</qresource>
Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 1.4 KiB

+245
Ver Arquivo
@@ -0,0 +1,245 @@
/*
* c_jhash.c Jenkins Hash
*
* Copyright (c) 1997 Bob Jenkins <bob_jenkins@burtleburtle.net>
*
* lookup8.c, by Bob Jenkins, January 4 1997, Public Domain.
* hash(), hash2(), hash3, and _c_mix() are externally useful functions.
* Routines to test the hash are included if SELF_TEST is defined.
* You can use this free for any purpose. It has no warranty.
*
* See http://burtleburtle.net/bob/hash/evahash.html
*/
/**
* @file c_jhash.h
*
* @brief Interface of the cynapses jhash implementation
*
* @defgroup cynJHashInternals cynapses libc jhash function
* @ingroup cynLibraryAPI
*
* @{
*/
#ifndef _C_JHASH_H
#define _C_JHASH_H
#include <stdint.h>
#define c_hashsize(n) ((uint8_t) 1 << (n))
#define c_hashmask(n) (xhashsize(n) - 1)
/**
* _c_mix -- Mix 3 32-bit values reversibly.
*
* For every delta with one or two bit set, and the deltas of all three
* high bits or all three low bits, whether the original value of a,b,c
* is almost all zero or is uniformly distributed,
* If _c_mix() is run forward or backward, at least 32 bits in a,b,c
* have at least 1/4 probability of changing.
* If _c_mix() is run forward, every bit of c will change between 1/3 and
* 2/3 of the time. (Well, 22/100 and 78/100 for some 2-bit deltas.)
* _c_mix() was built out of 36 single-cycle latency instructions in a
* structure that could supported 2x parallelism, like so:
* a -= b;
* a -= c; x = (c>>13);
* b -= c; a ^= x;
* b -= a; x = (a<<8);
* c -= a; b ^= x;
* c -= b; x = (b>>13);
* ...
*
* Unfortunately, superscalar Pentiums and Sparcs can't take advantage
* of that parallelism. They've also turned some of those single-cycle
* latency instructions into multi-cycle latency instructions. Still,
* this is the fastest good hash I could find. There were about 2^^68
* to choose from. I only looked at a billion or so.
*/
#define _c_mix(a,b,c) \
{ \
a -= b; a -= c; a ^= (c>>13); \
b -= c; b -= a; b ^= (a<<8); \
c -= a; c -= b; c ^= (b>>13); \
a -= b; a -= c; a ^= (c>>12); \
b -= c; b -= a; b ^= (a<<16); \
c -= a; c -= b; c ^= (b>>5); \
a -= b; a -= c; a ^= (c>>3); \
b -= c; b -= a; b ^= (a<<10); \
c -= a; c -= b; c ^= (b>>15); \
}
/**
* _c_mix64 -- Mix 3 64-bit values reversibly.
*
* _c_mix64() takes 48 machine instructions, but only 24 cycles on a superscalar
* machine (like Intel's new MMX architecture). It requires 4 64-bit
* registers for 4::2 parallelism.
* All 1-bit deltas, all 2-bit deltas, all deltas composed of top bits of
* (a,b,c), and all deltas of bottom bits were tested. All deltas were
* tested both on random keys and on keys that were nearly all zero.
* These deltas all cause every bit of c to change between 1/3 and 2/3
* of the time (well, only 113/400 to 287/400 of the time for some
* 2-bit delta). These deltas all cause at least 80 bits to change
* among (a,b,c) when the _c_mix is run either forward or backward (yes it
* is reversible).
* This implies that a hash using _c_mix64 has no funnels. There may be
* characteristics with 3-bit deltas or bigger, I didn't test for
* those.
*/
#define _c_mix64(a,b,c) \
{ \
a -= b; a -= c; a ^= (c>>43); \
b -= c; b -= a; b ^= (a<<9); \
c -= a; c -= b; c ^= (b>>8); \
a -= b; a -= c; a ^= (c>>38); \
b -= c; b -= a; b ^= (a<<23); \
c -= a; c -= b; c ^= (b>>5); \
a -= b; a -= c; a ^= (c>>35); \
b -= c; b -= a; b ^= (a<<49); \
c -= a; c -= b; c ^= (b>>11); \
a -= b; a -= c; a ^= (c>>12); \
b -= c; b -= a; b ^= (a<<18); \
c -= a; c -= b; c ^= (b>>22); \
}
/**
* @brief hash a variable-length key into a 32-bit value
*
* The best hash table sizes are powers of 2. There is no need to do
* mod a prime (mod is sooo slow!). If you need less than 32 bits,
* use a bitmask. For example, if you need only 10 bits, do
* h = (h & hashmask(10));
* In which case, the hash table should have hashsize(10) elements.
*
* Use for hash table lookup, or anything where one collision in 2^32 is
* acceptable. Do NOT use for cryptographic purposes.
*
* @param k The key (the unaligned variable-length array of bytes).
*
* @param length The length of the key, counting by bytes.
*
* @param initval Initial value, can be any 4-byte value.
*
* @return Returns a 32-bit value. Every bit of the key affects every bit
* of the return value. Every 1-bit and 2-bit delta achieves
* avalanche. About 36+6len instructions.
*/
static inline uint32_t c_jhash(const uint8_t *k, uint32_t length, uint32_t initval) {
uint32_t a,b,c,len;
/* Set up the internal state */
len = length;
a = b = 0x9e3779b9; /* the golden ratio; an arbitrary value */
c = initval; /* the previous hash value */
while (len >= 12) {
a += (k[0] +((uint32_t)k[1]<<8) +((uint32_t)k[2]<<16) +((uint32_t)k[3]<<24));
b += (k[4] +((uint32_t)k[5]<<8) +((uint32_t)k[6]<<16) +((uint32_t)k[7]<<24));
c += (k[8] +((uint32_t)k[9]<<8) +((uint32_t)k[10]<<16)+((uint32_t)k[11]<<24));
_c_mix(a,b,c);
k += 12; len -= 12;
}
/* handle the last 11 bytes */
c += length;
/* all the case statements fall through */
switch(len) {
case 11: c+=((uint32_t)k[10]<<24);
case 10: c+=((uint32_t)k[9]<<16);
case 9 : c+=((uint32_t)k[8]<<8);
/* the first byte of c is reserved for the length */
case 8 : b+=((uint32_t)k[7]<<24);
case 7 : b+=((uint32_t)k[6]<<16);
case 6 : b+=((uint32_t)k[5]<<8);
case 5 : b+=k[4];
case 4 : a+=((uint32_t)k[3]<<24);
case 3 : a+=((uint32_t)k[2]<<16);
case 2 : a+=((uint32_t)k[1]<<8);
case 1 : a+=k[0];
/* case 0: nothing left to add */
}
_c_mix(a,b,c);
return c;
}
/**
* @brief hash a variable-length key into a 64-bit value
*
* The best hash table sizes are powers of 2. There is no need to do
* mod a prime (mod is sooo slow!). If you need less than 64 bits,
* use a bitmask. For example, if you need only 10 bits, do
* h = (h & hashmask(10));
* In which case, the hash table should have hashsize(10) elements.
*
* Use for hash table lookup, or anything where one collision in 2^^64
* is acceptable. Do NOT use for cryptographic purposes.
*
* @param k The key (the unaligned variable-length array of bytes).
* @param length The length of the key, counting by bytes.
* @param intval Initial value, can be any 8-byte value.
*
* @return A 64-bit value. Every bit of the key affects every bit of
* the return value. No funnels. Every 1-bit and 2-bit delta
* achieves avalanche. About 41+5len instructions.
*/
static inline uint64_t c_jhash64(const uint8_t *k, uint64_t length, uint64_t intval) {
uint64_t a,b,c,len;
/* Set up the internal state */
len = length;
a = b = intval; /* the previous hash value */
c = 0x9e3779b97f4a7c13LL; /* the golden ratio; an arbitrary value */
/* handle most of the key */
while (len >= 24)
{
a += (k[0] +((uint64_t)k[ 1]<< 8)+((uint64_t)k[ 2]<<16)+((uint64_t)k[ 3]<<24)
+((uint64_t)k[4 ]<<32)+((uint64_t)k[ 5]<<40)+((uint64_t)k[ 6]<<48)+((uint64_t)k[ 7]<<56));
b += (k[8] +((uint64_t)k[ 9]<< 8)+((uint64_t)k[10]<<16)+((uint64_t)k[11]<<24)
+((uint64_t)k[12]<<32)+((uint64_t)k[13]<<40)+((uint64_t)k[14]<<48)+((uint64_t)k[15]<<56));
c += (k[16] +((uint64_t)k[17]<< 8)+((uint64_t)k[18]<<16)+((uint64_t)k[19]<<24)
+((uint64_t)k[20]<<32)+((uint64_t)k[21]<<40)+((uint64_t)k[22]<<48)+((uint64_t)k[23]<<56));
_c_mix64(a,b,c);
k += 24; len -= 24;
}
/* handle the last 23 bytes */
c += length;
switch(len) {
case 23: c+=((uint64_t)k[22]<<56);
case 22: c+=((uint64_t)k[21]<<48);
case 21: c+=((uint64_t)k[20]<<40);
case 20: c+=((uint64_t)k[19]<<32);
case 19: c+=((uint64_t)k[18]<<24);
case 18: c+=((uint64_t)k[17]<<16);
case 17: c+=((uint64_t)k[16]<<8);
/* the first byte of c is reserved for the length */
case 16: b+=((uint64_t)k[15]<<56);
case 15: b+=((uint64_t)k[14]<<48);
case 14: b+=((uint64_t)k[13]<<40);
case 13: b+=((uint64_t)k[12]<<32);
case 12: b+=((uint64_t)k[11]<<24);
case 11: b+=((uint64_t)k[10]<<16);
case 10: b+=((uint64_t)k[ 9]<<8);
case 9: b+=((uint64_t)k[ 8]);
case 8: a+=((uint64_t)k[ 7]<<56);
case 7: a+=((uint64_t)k[ 6]<<48);
case 6: a+=((uint64_t)k[ 5]<<40);
case 5: a+=((uint64_t)k[ 4]<<32);
case 4: a+=((uint64_t)k[ 3]<<24);
case 3: a+=((uint64_t)k[ 2]<<16);
case 2: a+=((uint64_t)k[ 1]<<8);
case 1: a+=((uint64_t)k[ 0]);
/* case 0: nothing left to add */
}
_c_mix64(a,b,c);
return c;
}
/**
* }@
*/
#endif /* _C_JHASH_H */
+3
Ver Arquivo
@@ -0,0 +1,3 @@
Eeli Reilin <eeli@emicode.fi>
Luis Gustavo S. Barreto <gustavosbarreto@gmail.com>
Stephen Kockentiedt <Stephen@Kockentiedt.name>
+26
Ver Arquivo
@@ -0,0 +1,26 @@
Copyright 2011 Eeli Reilin. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL EELI REILIN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation
are those of the authors and should not be interpreted as representing
official policies, either expressed or implied, of Eeli Reilin.
+96
Ver Arquivo
@@ -0,0 +1,96 @@
########################################################################
1. INTRODUCTION
The Json class is a simple class for parsing JSON data into a QVariant
hierarchies. Now, we can also reverse the process and serialize
QVariant hierarchies into valid JSON data.
########################################################################
2. HOW TO USE
The parser is really easy to use. Let's say we have the following
QString of JSON data:
------------------------------------------------------------------------
{
"encoding" : "UTF-8",
"plug-ins" : [
"python",
"c++",
"ruby"
],
"indent" : {
"length" : 3,
"use_space" : true
}
}
------------------------------------------------------------------------
We would first call the parse-method:
------------------------------------------------------------------------
//Say that we're using the QtJson namespace
using namespace QtJson;
bool ok;
//json is a QString containing the JSON data
QVariantMap result = Json::parse(json, ok).toMap();
if(!ok) {
qFatal("An error occurred during parsing");
exit(1);
}
------------------------------------------------------------------------
Assuming the parsing process completed without errors, we would then
go through the hierarchy:
------------------------------------------------------------------------
qDebug() << "encoding:" << result["encoding"].toString();
qDebug() << "plugins:";
foreach(QVariant plugin, result["plug-ins"].toList()) {
qDebug() << "\t-" << plugin.toString();
}
QVariantMap nestedMap = result["indent"].toMap();
qDebug() << "length:" << nestedMap["length"].toInt();
qDebug() << "use_space:" << nestedMap["use_space"].toBool();
------------------------------------------------------------------------
The previous code would print out the following:
------------------------------------------------------------------------
encoding: "UTF-8"
plugins:
- "python"
- "c++"
- "ruby"
length: 3
use_space: true
------------------------------------------------------------------------
To write JSON data from Qt object is as simple as parsing:
------------------------------------------------------------------------
QVariantMap map;
map["name"] = "Name";
map["age"] = 22;
QByteArray data = Json::serialize(map);
------------------------------------------------------------------------
The byte array 'data' contains valid JSON data:
------------------------------------------------------------------------
{
name: "Luis Gustavo",
age: 22,
}
------------------------------------------------------------------------
########################################################################
4. CONTRIBUTING
The code is available to download at GitHub. Contribute if you dare!
+653
Ver Arquivo
@@ -0,0 +1,653 @@
/* Copyright 2011 Eeli Reilin. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL EELI REILIN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
* official policies, either expressed or implied, of Eeli Reilin.
*/
/**
* \file json.cpp
*/
#include "json.h"
namespace QtJson
{
static QString sanitizeString(QString str);
static QByteArray join(const QList<QByteArray> &list, const QByteArray &sep);
static QVariant parseValue(const QString &json, int &index, bool &success);
static QVariant parseObject(const QString &json, int &index, bool &success);
static QVariant parseArray(const QString &json, int &index, bool &success);
static QVariant parseString(const QString &json, int &index, bool &success);
static QVariant parseNumber(const QString &json, int &index);
static int lastIndexOfNumber(const QString &json, int index);
static void eatWhitespace(const QString &json, int &index);
static int lookAhead(const QString &json, int index);
static int nextToken(const QString &json, int &index);
/***** public *****/
/**
* parse
*/
QVariant parse(const QString &json)
{
bool success = true;
return parse(json, success);
}
/**
* parse
*/
QVariant parse(const QString &json, bool &success)
{
success = true;
//Return an empty QVariant if the JSON data is either null or empty
if(!json.isNull() || !json.isEmpty())
{
QString data = json;
//We'll start from index 0
int index = 0;
//Parse the first value
QVariant value = parseValue(data, index, success);
//Return the parsed value
return value;
}
else
{
//Return the empty QVariant
return QVariant();
}
}
QByteArray serialize(const QVariant &data)
{
bool success = true;
return serialize(data, success);
}
QByteArray serialize(const QVariant &data, bool &success)
{
QByteArray str;
success = true;
if(!data.isValid()) // invalid or null?
{
str = "null";
}
else if((data.type() == QVariant::List) || (data.type() == QVariant::StringList)) // variant is a list?
{
QList<QByteArray> values;
const QVariantList list = data.toList();
Q_FOREACH(const QVariant& v, list)
{
QByteArray serializedValue = serialize(v);
if(serializedValue.isNull())
{
success = false;
break;
}
values << serializedValue;
}
str = "[ " + join( values, ", " ) + " ]";
}
else if(data.type() == QVariant::Hash) // variant is a hash?
{
const QVariantHash vhash = data.toHash();
QHashIterator<QString, QVariant> it( vhash );
str = "{ ";
QList<QByteArray> pairs;
while(it.hasNext())
{
it.next();
QByteArray serializedValue = serialize(it.value());
if(serializedValue.isNull())
{
success = false;
break;
}
pairs << sanitizeString(it.key()).toUtf8() + " : " + serializedValue;
}
str += join(pairs, ", ");
str += " }";
}
else if(data.type() == QVariant::Map) // variant is a map?
{
const QVariantMap vmap = data.toMap();
QMapIterator<QString, QVariant> it( vmap );
str = "{ ";
QList<QByteArray> pairs;
while(it.hasNext())
{
it.next();
QByteArray serializedValue = serialize(it.value());
if(serializedValue.isNull())
{
success = false;
break;
}
pairs << sanitizeString(it.key()).toUtf8() + " : " + serializedValue;
}
str += join(pairs, ", ");
str += " }";
}
else if((data.type() == QVariant::String) || (data.type() == QVariant::ByteArray)) // a string or a byte array?
{
str = sanitizeString(data.toString()).toUtf8();
}
else if(data.type() == QVariant::Double) // double?
{
str = QByteArray::number(data.toDouble(), 'g', 20);
if(!str.contains(".") && ! str.contains("e"))
{
str += ".0";
}
}
else if (data.type() == QVariant::Bool) // boolean value?
{
str = data.toBool() ? "true" : "false";
}
else if (data.type() == QVariant::ULongLong) // large unsigned number?
{
str = QByteArray::number(data.value<qulonglong>());
}
else if ( data.canConvert<qlonglong>() ) // any signed number?
{
str = QByteArray::number(data.value<qlonglong>());
}
else if (data.canConvert<long>())
{
str = QString::number(data.value<long>()).toUtf8();
}
else if (data.canConvert<QString>()) // can value be converted to string?
{
// this will catch QDate, QDateTime, QUrl, ...
str = sanitizeString(data.toString()).toUtf8();
}
else
{
success = false;
}
if (success)
{
return str;
}
else
{
return QByteArray();
}
}
/***** private *****/
/**
* \enum JsonToken
*/
enum JsonToken
{
JsonTokenNone = 0,
JsonTokenCurlyOpen = 1,
JsonTokenCurlyClose = 2,
JsonTokenSquaredOpen = 3,
JsonTokenSquaredClose = 4,
JsonTokenColon = 5,
JsonTokenComma = 6,
JsonTokenString = 7,
JsonTokenNumber = 8,
JsonTokenTrue = 9,
JsonTokenFalse = 10,
JsonTokenNull = 11
};
static QString sanitizeString(QString str)
{
str.replace(QLatin1String("\\"), QLatin1String("\\\\"));
str.replace(QLatin1String("\""), QLatin1String("\\\""));
str.replace(QLatin1String("\b"), QLatin1String("\\b"));
str.replace(QLatin1String("\f"), QLatin1String("\\f"));
str.replace(QLatin1String("\n"), QLatin1String("\\n"));
str.replace(QLatin1String("\r"), QLatin1String("\\r"));
str.replace(QLatin1String("\t"), QLatin1String("\\t"));
return QString(QLatin1String("\"%1\"")).arg(str);
}
static QByteArray join(const QList<QByteArray> &list, const QByteArray &sep)
{
QByteArray res;
Q_FOREACH(const QByteArray &i, list)
{
if(!res.isEmpty())
{
res += sep;
}
res += i;
}
return res;
}
/**
* parseValue
*/
static QVariant parseValue(const QString &json, int &index, bool &success)
{
//Determine what kind of data we should parse by
//checking out the upcoming token
switch(lookAhead(json, index))
{
case JsonTokenString:
return parseString(json, index, success);
case JsonTokenNumber:
return parseNumber(json, index);
case JsonTokenCurlyOpen:
return parseObject(json, index, success);
case JsonTokenSquaredOpen:
return parseArray(json, index, success);
case JsonTokenTrue:
nextToken(json, index);
return QVariant(true);
case JsonTokenFalse:
nextToken(json, index);
return QVariant(false);
case JsonTokenNull:
nextToken(json, index);
return QVariant();
case JsonTokenNone:
break;
}
//If there were no tokens, flag the failure and return an empty QVariant
success = false;
return QVariant();
}
/**
* parseObject
*/
static QVariant parseObject(const QString &json, int &index, bool &success)
{
QVariantMap map;
int token;
//Get rid of the whitespace and increment index
nextToken(json, index);
//Loop through all of the key/value pairs of the object
bool done = false;
while(!done)
{
//Get the upcoming token
token = lookAhead(json, index);
if(token == JsonTokenNone)
{
success = false;
return QVariantMap();
}
else if(token == JsonTokenComma)
{
nextToken(json, index);
}
else if(token == JsonTokenCurlyClose)
{
nextToken(json, index);
return map;
}
else
{
//Parse the key/value pair's name
QString name = parseString(json, index, success).toString();
if(!success)
{
return QVariantMap();
}
//Get the next token
token = nextToken(json, index);
//If the next token is not a colon, flag the failure
//return an empty QVariant
if(token != JsonTokenColon)
{
success = false;
return QVariant(QVariantMap());
}
//Parse the key/value pair's value
QVariant value = parseValue(json, index, success);
if(!success)
{
return QVariantMap();
}
//Assign the value to the key in the map
map[name] = value;
}
}
//Return the map successfully
return QVariant(map);
}
/**
* parseArray
*/
static QVariant parseArray(const QString &json, int &index, bool &success)
{
QVariantList list;
nextToken(json, index);
bool done = false;
while(!done)
{
int token = lookAhead(json, index);
if(token == JsonTokenNone)
{
success = false;
return QVariantList();
}
else if(token == JsonTokenComma)
{
nextToken(json, index);
}
else if(token == JsonTokenSquaredClose)
{
nextToken(json, index);
break;
}
else
{
QVariant value = parseValue(json, index, success);
if(!success)
{
return QVariantList();
}
list.push_back(value);
}
}
return QVariant(list);
}
/**
* parseString
*/
static QVariant parseString(const QString &json, int &index, bool &success)
{
QString s;
QChar c;
eatWhitespace(json, index);
c = json[index++];
bool complete = false;
while(!complete)
{
if(index == json.size())
{
break;
}
c = json[index++];
if(c == '\"')
{
complete = true;
break;
}
else if(c == '\\')
{
if(index == json.size())
{
break;
}
c = json[index++];
if(c == '\"')
{
s.append('\"');
}
else if(c == '\\')
{
s.append('\\');
}
else if(c == '/')
{
s.append('/');
}
else if(c == 'b')
{
s.append('\b');
}
else if(c == 'f')
{
s.append('\f');
}
else if(c == 'n')
{
s.append('\n');
}
else if(c == 'r')
{
s.append('\r');
}
else if(c == 't')
{
s.append('\t');
}
else if(c == 'u')
{
int remainingLength = json.size() - index;
if(remainingLength >= 4)
{
QString unicodeStr = json.mid(index, 4);
int symbol = unicodeStr.toInt(0, 16);
s.append(QChar(symbol));
index += 4;
}
else
{
break;
}
}
}
else
{
s.append(c);
}
}
if(!complete)
{
success = false;
return QVariant();
}
return QVariant(s);
}
/**
* parseNumber
*/
static QVariant parseNumber(const QString &json, int &index)
{
eatWhitespace(json, index);
int lastIndex = lastIndexOfNumber(json, index);
int charLength = (lastIndex - index) + 1;
QString numberStr;
numberStr = json.mid(index, charLength);
index = lastIndex + 1;
if (numberStr.contains('.')) {
return QVariant(numberStr.toDouble(NULL));
} else if (numberStr.startsWith('-')) {
return QVariant(numberStr.toLongLong(NULL));
} else {
return QVariant(numberStr.toULongLong(NULL));
}
}
/**
* lastIndexOfNumber
*/
static int lastIndexOfNumber(const QString &json, int index)
{
int lastIndex;
for(lastIndex = index; lastIndex < json.size(); lastIndex++)
{
if(QString("0123456789+-.eE").indexOf(json[lastIndex]) == -1)
{
break;
}
}
return lastIndex -1;
}
/**
* eatWhitespace
*/
static void eatWhitespace(const QString &json, int &index)
{
for(; index < json.size(); index++)
{
if(QString(" \t\n\r").indexOf(json[index]) == -1)
{
break;
}
}
}
/**
* lookAhead
*/
static int lookAhead(const QString &json, int index)
{
int saveIndex = index;
return nextToken(json, saveIndex);
}
/**
* nextToken
*/
static int nextToken(const QString &json, int &index)
{
eatWhitespace(json, index);
if(index == json.size())
{
return JsonTokenNone;
}
QChar c = json[index];
index++;
switch(c.toLatin1())
{
case '{': return JsonTokenCurlyOpen;
case '}': return JsonTokenCurlyClose;
case '[': return JsonTokenSquaredOpen;
case ']': return JsonTokenSquaredClose;
case ',': return JsonTokenComma;
case '"': return JsonTokenString;
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
case '-': return JsonTokenNumber;
case ':': return JsonTokenColon;
}
index--;
int remainingLength = json.size() - index;
//True
if(remainingLength >= 4)
{
if (json[index] == 't' && json[index + 1] == 'r' &&
json[index + 2] == 'u' && json[index + 3] == 'e')
{
index += 4;
return JsonTokenTrue;
}
}
//False
if (remainingLength >= 5)
{
if (json[index] == 'f' && json[index + 1] == 'a' &&
json[index + 2] == 'l' && json[index + 3] == 's' &&
json[index + 4] == 'e')
{
index += 5;
return JsonTokenFalse;
}
}
//Null
if (remainingLength >= 4)
{
if (json[index] == 'n' && json[index + 1] == 'u' &&
json[index + 2] == 'l' && json[index + 3] == 'l')
{
index += 4;
return JsonTokenNull;
}
}
return JsonTokenNone;
}
} //end namespace
+85
Ver Arquivo
@@ -0,0 +1,85 @@
/* Copyright 2011 Eeli Reilin. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL EELI REILIN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
* official policies, either expressed or implied, of Eeli Reilin.
*/
/**
* \file json.h
*/
#ifndef JSON_H
#define JSON_H
#include <QVariant>
#include <QString>
/**
* \namespace QtJson
* \brief A JSON data parser
*
* Json parses a JSON data into a QVariant hierarchy.
*/
namespace QtJson
{
/**
* Parse a JSON string
*
* \param json The JSON data
*/
QVariant parse(const QString &json);
/**
* Parse a JSON string
*
* \param json The JSON data
* \param success The success of the parsing
*/
QVariant parse(const QString &json, bool &success);
/**
* This method generates a textual JSON representation
*
* \param data The JSON data generated by the parser.
*
* \return QByteArray Textual JSON representation
*/
QByteArray serialize(const QVariant &data);
/**
* This method generates a textual JSON representation
*
* \param data The JSON data generated by the parser.
* \param success The success of the serialization
*
* \return QByteArray Textual JSON representation
*/
QByteArray serialize(const QVariant &data, bool &success);
} //end namespace
#endif //JSON_H
@@ -61,11 +61,13 @@ QtSingleApplication::QtSingleApplication(const QString &appId, int &argc, char *
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
QtSingleApplication::QtSingleApplication(int &argc, char **argv, Type type)
: QApplication(argc, argv, type)
{
sysInit();
}
#endif
#if defined(Q_WS_X11)
+6
Ver Arquivo
@@ -28,6 +28,9 @@
**
**************************************************************************/
#ifndef _SHAREDTOOLS_SINGLEAPPLICATION
#define _SHAREDTOOLS_SINGLEAPPLICATION
#include <QApplication>
namespace SharedTools {
@@ -41,7 +44,9 @@ class QtSingleApplication : public QApplication
public:
QtSingleApplication(int &argc, char **argv, bool GUIenabled = true);
QtSingleApplication(const QString &id, int &argc, char **argv);
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
QtSingleApplication(int &argc, char **argv, Type type);
#endif
#if defined(Q_WS_X11)
explicit QtSingleApplication(Display *dpy, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);
QtSingleApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0);
@@ -83,3 +88,4 @@ private:
};
} // namespace SharedTools
#endif // _SHAREDTOOLS_SINGLEAPPLICATION
+132 -49
Ver Arquivo
@@ -1,34 +1,18 @@
include(${QT_USE_FILE})
#add_subdirectory(integration)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
QT4_ADD_RESOURCES ( MIRALL_RC_SRC ../mirall.qrc)
qt_add_resources(MIRALL_RC_SRC ../mirall.qrc)
if ( IS_DIRECTORY ${OEM_THEME_DIR} )
QT4_ADD_RESOURCES ( MIRALL_RC_SRC ${OEM_THEME_DIR}/theme.qrc)
qt_add_resources(MIRALL_RC_SRC ${OEM_THEME_DIR}/theme.qrc)
set(theme_dir ${OEM_THEME_DIR}/theme)
else()
QT4_ADD_RESOURCES ( MIRALL_RC_SRC ../theme.qrc)
qt_add_resources(MIRALL_RC_SRC ../theme.qrc)
set(theme_dir ${CMAKE_CURRENT_SOURCE_DIR}/../theme)
endif()
set(synclib_NAME ${APPLICATION_EXECUTABLE}sync)
set(mirall_UI
mirall/folderwizardsourcepage.ui
mirall/folderwizardtargetpage.ui
mirall/sslerrordialog.ui
mirall/settingsdialog.ui
mirall/generalsettings.ui
mirall/networksettings.ui
mirall/accountsettings.ui
mirall/ignorelisteditor.ui
mirall/itemprogressdialog.ui
wizard/owncloudsetupnocredspage.ui
wizard/owncloudhttpcredspage.ui
wizard/owncloudwizardresultpage.ui
wizard/owncloudadvancedsetuppage.ui
)
set(3rdparty_SRC
3rdparty/qtsingleapplication/qtsingleapplication.cpp
3rdparty/qtsingleapplication/qtlocalpeer.cpp
@@ -45,9 +29,10 @@ set(3rdparty_HEADER
3rdparty/fancylineedit/fancylineedit.h
3rdparty/QProgressIndicator/QProgressIndicator.h
)
qt4_wrap_cpp(3rdparty_MOC ${3rdparty_HEADER})
if(NOT WIN32)
qt_wrap_cpp(3rdparty_MOC ${3rdparty_HEADER})
if(NOT WIN32)
list(APPEND 3rdparty_SRC 3rdparty/qtlockedfile/qtlockedfile_unix.cpp)
else()
list(APPEND 3rdparty_SRC 3rdparty/qtlockedfile/qtlockedfile_win.cpp )
@@ -58,31 +43,34 @@ set(3rdparty_INC
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/qtsingleapplication
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/QProgressIndicator
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/fancylineedit
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/csync
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/qjson
)
qt4_wrap_ui(mirall_UI_SRCS ${mirall_UI})
set(libsync_SRCS
mirall/folderman.cpp
mirall/folder.cpp
mirall/folderwatcher.cpp
mirall/syncresult.cpp
mirall/networklocation.cpp
mirall/mirallconfigfile.cpp
mirall/csyncthread.cpp
mirall/owncloudpropagator.cpp
mirall/syncjournalfilerecord.cpp
mirall/syncjournaldb.cpp
mirall/fileutils.cpp
mirall/theme.cpp
mirall/owncloudtheme.cpp
mirall/owncloudinfo.cpp
mirall/logger.cpp
mirall/utility.cpp
mirall/connectionvalidator.cpp
mirall/progressdispatcher.cpp
mirall/mirallaccessmanager.cpp
mirall/networkjobs.cpp
mirall/account.cpp
mirall/quotainfo.cpp
creds/dummycredentials.cpp
creds/httpcredentials.cpp
creds/credentialsfactory.cpp
creds/http/credentialstore.cpp
creds/http/httpconfigfile.cpp
creds/shibbolethcredentials.cpp
creds/shibboleth/shibbolethaccessmanager.cpp
@@ -91,6 +79,7 @@ set(libsync_SRCS
creds/shibboleth/shibbolethrefresher.cpp
creds/shibboleth/shibbolethconfigfile.cpp
creds/credentialscommon.cpp
3rdparty/qjson/json.cpp
)
set(libsync_HEADERS
@@ -98,18 +87,21 @@ set(libsync_HEADERS
mirall/folder.h
mirall/folderwatcher.h
mirall/csyncthread.h
mirall/owncloudpropagator.h
mirall/syncjournaldb.h
mirall/theme.h
mirall/owncloudtheme.h
mirall/owncloudinfo.h
mirall/logger.h
mirall/connectionvalidator.h
mirall/progressdispatcher.h
mirall/mirallaccessmanager.h
mirall/networkjobs.h
mirall/account.h
mirall/quotainfo.h
creds/abstractcredentials.h
creds/dummycredentials.h
creds/httpcredentials.h
creds/credentialsfactory.h
creds/http/credentialstore.h
creds/http/httpconfigfile.h
creds/shibbolethcredentials.h
creds/shibboleth/shibbolethaccessmanager.h
@@ -118,6 +110,7 @@ set(libsync_HEADERS
creds/shibboleth/shibbolethrefresher.h
creds/shibboleth/shibbolethconfigfile.h
creds/credentialscommon.h
3rdparty/qjson/json.h
)
IF( INOTIFY_FOUND )
@@ -126,7 +119,7 @@ IF( INOTIFY_FOUND )
set(libsync_HEADERS ${libsync_HEADERS} mirall/inotify.h)
set(libsync_HEADERS ${libsync_HEADERS} mirall/folderwatcher_inotify.h)
ENDIF()
IF( WIN32 )
IF( WIN32 )
set(libsync_SRCS ${libsync_SRCS} mirall/folderwatcher_win.cpp)
set(libsync_HEADERS ${libsync_HEADERS} mirall/folderwatcher_win.h)
ENDIF()
@@ -135,23 +128,80 @@ IF( APPLE )
ENDIF()
qt4_wrap_cpp(syncMoc ${libsync_HEADERS})
qt_wrap_cpp(syncMoc ${libsync_HEADERS})
# These headers are installed for libowncloudsync to be used by 3rd party apps
set(owncloudsync_HEADERS
mirall/account.h
mirall/csyncthread.h
mirall/folder.h
mirall/folderman.h
mirall/folderwatcher.h
mirall/mirallconfigfile.h
mirall/networkjobs.h
mirall/progressdispatcher.h
mirall/syncfileitem.h
mirall/syncjournaldb.h
mirall/syncresult.h
)
set(creds_HEADERS
creds/abstractcredentials.h
creds/httpcredentials.h
)
IF (NOT APPLE)
INSTALL(
FILES ${owncloudsync_HEADERS}
DESTINATION ${INCLUDE_INSTALL_DIR}/owncloudsync/mirall
)
INSTALL(
FILES ${creds_HEADERS}
DESTINATION ${INCLUDE_INSTALL_DIR}/owncloudsync/creds
)
ENDIF(NOT APPLE)
IF( DEFINED CSYNC_BUILD_PATH )
SET(HTTPBF_LIBRARY ${CSYNC_BUILD_PATH}/src/httpbf/libhttpbf.a)
ELSE()
FIND_LIBRARY(HTTPBF_LIBRARY NAMES httpbf HINTS $ENV{CSYNC_DIR})
ENDIF()
list(APPEND libsync_LINK_TARGETS
${QT_LIBRARIES}
${CSYNC_LIBRARY}
dl
${HTTPBF_LIBRARY}
)
IF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
list(APPEND libsync_LINK_TARGETS
inotify
)
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
if(QTKEYCHAIN_FOUND)
list(APPEND libsync_LINK_TARGETS ${QTKEYCHAIN_LIBRARY})
include_directories(${QTKEYCHAIN_INCLUDE_DIR})
endif()
if(NEON_FOUND)
list(APPEND libsync_LINK_TARGETS ${NEON_LIBRARIES})
include_directories(${NEON_INCLUDE_DIRS})
if(NEON_WITH_LFS)
add_definitions(-DNE_LFS)
endif()
endif()
add_library(${synclib_NAME} SHARED ${libsync_SRCS} ${syncMoc})
qt5_use_modules(${synclib_NAME} Widgets Network Xml WebKitWidgets Sql)
set_target_properties( ${synclib_NAME} PROPERTIES
VERSION ${VERSION}
SOVERSION ${SOVERSION}
VERSION ${MIRALL_VERSION}
SOVERSION ${MIRALL_SOVERSION}
)
target_link_libraries(${synclib_NAME} ${libsync_LINK_TARGETS} )
@@ -175,11 +225,30 @@ else()
install(TARGETS ${synclib_NAME} DESTINATION ${OWNCLOUD_OSX_BUNDLE}/Contents/MacOS)
endif()
set(mirall_UI
mirall/folderwizardsourcepage.ui
mirall/folderwizardtargetpage.ui
mirall/sslerrordialog.ui
mirall/settingsdialog.ui
mirall/generalsettings.ui
mirall/networksettings.ui
mirall/accountsettings.ui
mirall/ignorelisteditor.ui
mirall/protocolwidget.ui
wizard/owncloudsetupnocredspage.ui
wizard/owncloudhttpcredspage.ui
wizard/owncloudwizardresultpage.ui
wizard/owncloudadvancedsetuppage.ui
)
qt_wrap_ui(mirall_UI_SRCS ${mirall_UI})
set(mirall_SRCS
mirall/application.cpp
mirall/systray.cpp
mirall/folderwizard.cpp
mirall/folderstatusmodel.cpp
mirall/protocolwidget.cpp
wizard/owncloudwizard.cpp
wizard/owncloudsetuppage.cpp
wizard/owncloudhttpcredspage.cpp
@@ -197,7 +266,8 @@ set(mirall_SRCS
mirall/networksettings.cpp
mirall/accountsettings.cpp
mirall/ignorelisteditor.cpp
mirall/itemprogressdialog.cpp
mirall/owncloudgui.cpp
mirall/socketapi.cpp
)
set(mirall_HEADERS
@@ -221,7 +291,9 @@ set(mirall_HEADERS
mirall/networksettings.h
mirall/accountsettings.h
mirall/ignorelisteditor.h
mirall/itemprogressdialog.h
mirall/protocolwidget.h
mirall/owncloudgui.h
mirall/socketapi.h
)
if( UNIX AND NOT APPLE)
@@ -231,12 +303,12 @@ if( UNIX AND NOT APPLE)
endif()
# csync is required.
include_directories(${CSYNC_INCLUDE_DIR}/csync ${CSYNC_INCLUDE_DIR} ${CSYNC_BUILD_PATH}/src)
include_directories(${CSYNC_INCLUDE_DIR}/csync ${CSYNC_INCLUDE_DIR} ${CSYNC_INCLUDE_DIR}/httpbf/src ${CSYNC_BUILD_PATH}/src)
include_directories(${3rdparty_INC})
qt4_wrap_cpp(mirallMoc ${mirall_HEADERS})
qt_wrap_cpp(mirallMoc ${mirall_HEADERS})
qt4_add_translation(mirall_I18N ${TRANSLATIONS})
qt_add_translation(mirall_I18N ${TRANSLATIONS})
set( final_src
${mirall_HEADERS}
@@ -266,6 +338,10 @@ kde4_add_app_icon( ownCloud "${theme_dir}/colored/${ICON_APP_NAME}-icon*.png")
list(APPEND final_src ${ownCloud})
set(ownCloud ${ownCloud_old})
if (WITH_DBUS)
set(ADDITIONAL_APP_MODULES DBus)
endif(WITH_DBUS)
if(NOT BUILD_OWNCLOUD_OSX_BUNDLE)
set(BIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
@@ -284,7 +360,7 @@ endif(NOT WIN32)
# add_executable( ${APPLICATION_EXECUTABLE} main.cpp ${final_src})
add_executable( ${APPLICATION_EXECUTABLE} WIN32 main.cpp ${final_src})
qt5_use_modules(${APPLICATION_EXECUTABLE} Widgets Network Xml WebKitWidgets Sql ${ADDITIONAL_APP_MODULES})
else()
set(BIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
include(DeployQt4)
@@ -294,13 +370,7 @@ else()
# we must add MACOSX_BUNDLE only if building a bundle
add_executable( ${APPLICATION_EXECUTABLE} WIN32 MACOSX_BUNDLE main.cpp ${final_src})
#FIXME: hardcoded path
if ( EXISTS ${CSYNC_BINARY_DIR}/modules/ocsync_owncloud.so )
install(FILES ${CSYNC_BINARY_DIR}/modules/ocsync_owncloud.so DESTINATION ${OWNCLOUD_OSX_BUNDLE}/Contents/Plugins)
else()
install(FILES /usr/local/lib/ocsync-0/ocsync_owncloud.so DESTINATION ${OWNCLOUD_OSX_BUNDLE}/Contents/Plugins)
endif()
qt5_use_modules(${APPLICATION_EXECUTABLE} Widgets Network Xml WebKitWidgets Sql ${ADDITIONAL_APP_MODULES})
set (QM_DIR ${OWNCLOUD_OSX_BUNDLE}/Contents/Resources/Translations)
install(FILES ${mirall_I18N} DESTINATION ${QM_DIR})
@@ -308,7 +378,6 @@ else()
install(FILES ${qt_I18N} DESTINATION ${QM_DIR})
file(GLOB qtkeychain_I18N ${QT_TRANSLATIONS_DIR}/qtkeychain*.qm)
install(FILES ${qtkeychain_I18N} DESTINATION ${QM_DIR})
list(APPEND dirs "/usr/local/lib")
endif()
@@ -330,7 +399,7 @@ install(TARGETS ${APPLICATION_EXECUTABLE}
# currently it needs to be done because the code right above needs to be executed no matter
# if building a bundle or not and the install_qt4_executable needs to be called afterwards
if(BUILD_OWNCLOUD_OSX_BUNDLE)
install_qt4_executable(${OWNCLOUD_OSX_BUNDLE} "" "${OWNCLOUD_OSX_BUNDLE}/Contents/Plugins/ocsync_owncloud.so" ${dirs})
install_qt4_executable(${OWNCLOUD_OSX_BUNDLE} "qtaccessiblewidgets;qsqlite")
endif()
find_program(KRAZY2_EXECUTABLE krazy2)
@@ -343,3 +412,17 @@ if(KRAZY2_EXECUTABLE)
)
endif()
set(owncloudcmd_NAME ${APPLICATION_EXECUTABLE}cmd)
set(OWNCLOUDCMD_SRC owncloudcmd/owncloudcmd.cpp)
add_executable(${owncloudcmd_NAME} ${OWNCLOUDCMD_SRC})
qt5_use_modules(${owncloudcmd_NAME} Network Sql)
set_target_properties(${owncloudcmd_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} )
target_link_libraries(${owncloudcmd_NAME} ${synclib_NAME})
target_link_libraries(${owncloudcmd_NAME} ${CSYNC_LIBRARY})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/mirall)
install(TARGETS ${owncloudcmd_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
+19 -12
Ver Arquivo
@@ -19,27 +19,34 @@
#include <csync.h>
class QNetworkAccessManager;
class QNetworkReply;
namespace Mirall
{
class Account;
class AbstractCredentials : public QObject
{
Q_OBJECT
Q_OBJECT
public:
// No need for virtual destructor - QObject already has one.
virtual void syncContextPreInit(CSYNC* ctx) = 0;
virtual void syncContextPreStart(CSYNC* ctx) = 0;
virtual bool changed(AbstractCredentials* credentials) const = 0;
virtual QString authType() const = 0;
virtual QNetworkAccessManager* getQNAM() const = 0;
virtual bool ready() const = 0;
virtual void fetch() = 0;
virtual void persistForUrl(const QString& url) = 0;
// No need for virtual destructor - QObject already has one.
virtual void syncContextPreInit(CSYNC* ctx) = 0;
virtual void syncContextPreStart(CSYNC* ctx) = 0;
virtual bool changed(AbstractCredentials* credentials) const = 0;
virtual QString authType() const = 0;
virtual QString user() const = 0;
virtual QNetworkAccessManager* getQNAM() const = 0;
virtual bool ready() const = 0;
virtual void fetch(Account *account) = 0;
virtual bool stillValid(QNetworkReply *reply) = 0;
virtual bool fetchFromUser(Account *account) = 0;
virtual void persist(Account *account) = 0;
/** Invalidates auth token, or password for basic auth */
virtual void invalidateToken(Account *account) = 0;
Q_SIGNALS:
void fetched();
void fetched();
};
} // ns Mirall
+4 -3
Ver Arquivo
@@ -1,5 +1,4 @@
/*
* Copyright (C) by Duncan Mac-Vicar P. <duncan@kde.org>
* Copyright (C) by Klaas Freitag <freitag@kde.org>
* Copyright (C) by Krzesimir Nowak <krzesimir@endocode.com>
*
@@ -19,10 +18,12 @@
#include <QString>
#include <QSslCertificate>
#include <QDebug>
#include "creds/credentialscommon.h"
#include "mirall/utility.h"
#include "mirall/owncloudinfo.h"
#include "mirall/account.h"
namespace Mirall
{
@@ -46,7 +47,7 @@ int handleNeonSSLProblems(const char* prompt,
int pos = 0;
// This is the set of certificates which QNAM accepted, so we should accept
// them as well
QList<QSslCertificate> certs = ownCloudInfo::instance()->certificateChain();
QList<QSslCertificate> certs = AccountManager::instance()->account()->certificateChain();
while (!certOk && (pos = regexp.indexIn(qPrompt, 1+pos)) != -1) {
QString neon_fingerprint = regexp.cap(1);
-1
Ver Arquivo
@@ -1,5 +1,4 @@
/*
* Copyright (C) by Duncan Mac-Vicar P. <duncan@kde.org>
* Copyright (C) by Klaas Freitag <freitag@kde.org>
* Copyright (C) by Krzesimir Nowak <krzesimir@endocode.com>
*
+19 -2
Ver Arquivo
@@ -35,6 +35,11 @@ QString DummyCredentials::authType() const
return QString::fromLatin1("dummy");
}
QString DummyCredentials::user() const
{
return QString();
}
QNetworkAccessManager* DummyCredentials::getQNAM() const
{
return new MirallAccessManager;
@@ -45,12 +50,24 @@ bool DummyCredentials::ready() const
return true;
}
void DummyCredentials::fetch()
bool DummyCredentials::stillValid(QNetworkReply *reply)
{
Q_UNUSED(reply)
return true;
}
bool DummyCredentials::fetchFromUser(Account *account)
{
Q_UNUSED(account)
return false;
}
void DummyCredentials::fetch(Account*)
{
Q_EMIT(fetched());
}
void DummyCredentials::persistForUrl(const QString&)
void DummyCredentials::persist(Account*)
{}
} // ns Mirall
+13 -9
Ver Arquivo
@@ -21,17 +21,21 @@ namespace Mirall
class DummyCredentials : public AbstractCredentials
{
Q_OBJECT
Q_OBJECT
public:
void syncContextPreInit(CSYNC* ctx);
void syncContextPreStart(CSYNC* ctx);
bool changed(AbstractCredentials* credentials) const;
QString authType() const;
QNetworkAccessManager* getQNAM() const;
bool ready() const;
void fetch();
void persistForUrl(const QString& url);
void syncContextPreInit(CSYNC* ctx);
void syncContextPreStart(CSYNC* ctx);
bool changed(AbstractCredentials* credentials) const;
QString authType() const;
QString user() const;
QNetworkAccessManager* getQNAM() const;
bool ready() const;
bool stillValid(QNetworkReply *reply);
bool fetchFromUser(Account *account);
void fetch(Account*);
void persist(Account*);
void invalidateToken(Account *) {}
};
} // ns Mirall
-338
Ver Arquivo
@@ -1,338 +0,0 @@
/*
* 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.
*/
#include <QtGui>
#include <QInputDialog>
#include "config.h"
#include "creds/http/credentialstore.h"
#include "creds/http/httpconfigfile.h"
#include "mirall/theme.h"
#ifdef WITH_QTKEYCHAIN
#include <qtkeychain/keychain.h>
using namespace QKeychain;
#endif
#define MAX_LOGIN_ATTEMPTS 3
namespace Mirall {
CredentialStore *CredentialStore::_instance=0;
CredentialStore::CredState CredentialStore::_state = NotFetched;
QString CredentialStore::_passwd = QString::null;
QString CredentialStore::_user = QString::null;
QString CredentialStore::_url = QString::null;
QString CredentialStore::_errorMsg = QString::null;
#ifdef WITH_QTKEYCHAIN
CredentialStore::CredentialType CredentialStore::_type = KeyChain;
#else
CredentialStore::CredentialType CredentialStore::_type = Settings;
#endif
CredentialStore::CredentialStore(QObject *parent) :
QObject(parent)
{
}
CredentialStore *CredentialStore::instance()
{
if( !CredentialStore::_instance ) CredentialStore::_instance = new CredentialStore;
return CredentialStore::_instance;
}
QString CredentialStore::password() const
{
return _passwd;
}
QString CredentialStore::user() const
{
return _user;
}
CredentialStore::CredState CredentialStore::state()
{
return _state;
}
void CredentialStore::fetchCredentials()
{
HttpConfigFile cfgFile;
bool ok = false;
QString pwd;
_user = cfgFile.user();
_url = cfgFile.ownCloudUrl();
QString key = keyChainKey(_url);
if( key.isNull() ) {
qDebug() << "Can not fetch credentials, url is zero!";
_state = Error;
emit( fetchCredentialsFinished(false) );
return;
}
switch( _type ) {
case CredentialStore::Settings: {
/* Read from config file. */
_state = Fetching;
cfgFile.fixupOldPassword();
if( cfgFile.passwordExists() ) {
pwd = cfgFile.password();
ok = true;
} else {
ok = false;
_state = EntryNotFound;
}
break;
}
case CredentialStore::KeyChain: {
// If the credentials are here already, return.
if( _state == Ok || _state == AsyncWriting ) {
emit(fetchCredentialsFinished(true));
return;
}
// otherwise fetch asynchronious.
#ifdef WITH_QTKEYCHAIN
_state = AsyncFetching;
if( !_user.isEmpty() ) {
ReadPasswordJob *job = new ReadPasswordJob(Theme::instance()->appName());
job->setKey( key );
connect( job, SIGNAL(finished(QKeychain::Job*)), this,
SLOT(slotKeyChainReadFinished(QKeychain::Job*)));
job->start();
}
#else
qDebug() << "QtKeyChain: Not yet implemented!";
_state = Error;
#endif
break;
}
default: {
break;
}
}
if( _state == Fetching ) { // ...but not AsyncFetching
if( ok ) {
_passwd = pwd;
_state = Ok;
}
if( !ok && _state == Fetching ) {
_state = Error;
}
emit( fetchCredentialsFinished(ok) );
} else {
// in case of AsyncFetching nothing happens here. The finished-Slot
// will emit the finish signal.
}
}
void CredentialStore::reset()
{
_state = NotFetched;
_user = QString::null;
_passwd = QString::null;
}
QString CredentialStore::keyChainKey( const QString& url ) const
{
QString u(url);
if( u.isEmpty() ) {
qDebug() << "Empty url in keyChain, error!";
return QString::null;
}
if( _user.isEmpty() ) {
qDebug() << "Error: User is emty!";
return QString::null;
}
if( !u.endsWith(QChar('/')) ) {
u.append(QChar('/'));
}
QString key = _user+QLatin1Char(':')+u;
return key;
}
void CredentialStore::slotKeyChainReadFinished(QKeychain::Job* job)
{
#ifdef WITH_QTKEYCHAIN
ReadPasswordJob *pwdJob = static_cast<ReadPasswordJob*>(job);
if( pwdJob ) {
switch( pwdJob->error() ) {
case QKeychain::NoError:
_passwd = pwdJob->textData();
#ifdef Q_OS_LINUX
// Currently there is a bug in the keychain on linux that if no
// entry is there, an empty password comes back, but no error.
if( _passwd.isEmpty() ) {
_state = EntryNotFound;
_errorMsg = tr("No password entry found in keychain. Please reconfigure.");
} else
#endif
_state = Ok;
break;
case QKeychain::EntryNotFound:
_state = EntryNotFound;
break;
case QKeychain::CouldNotDeleteEntry:
_state = Error;
break;
case QKeychain::AccessDenied:
_state = AccessDenied;
break;
case QKeychain::NoBackendAvailable:
_state = NoKeychainBackend;
break;
case QKeychain::NotImplemented:
_state = NoKeychainBackend;
break;
case QKeychain::OtherError:
default:
_state = Error;
}
/* In case there is no backend, tranparentely switch to Settings file. */
if( _state == NoKeychainBackend ) {
qDebug() << "No Storage Backend, falling back to Settings mode.";
_type = CredentialStore::Settings;
fetchCredentials();
return;
}
if( _state == EntryNotFound ) {
// try to migrate.
}
if( _state != Ok ) {
qDebug() << "Error with keychain: " << pwdJob->errorString();
if(_errorMsg.isEmpty()) _errorMsg = pwdJob->errorString();
} else {
_errorMsg = QString::null;
}
} else {
_state = Error;
qDebug() << "Error: KeyChain Read Password Job failed!";
}
emit(fetchCredentialsFinished(_state == Ok));
#else
(void) job;
#endif
}
QString CredentialStore::errorMessage()
{
return _errorMsg;
}
void CredentialStore::setCredentials( const QString& url, const QString& user,
const QString& pwd )
{
_passwd = pwd;
_user = user;
#ifdef WITH_QTKEYCHAIN
_type = KeyChain;
#else
_type = Settings;
#endif
_url = url;
_state = Ok;
}
void CredentialStore::saveCredentials( )
{
HttpConfigFile cfgFile;
QString key = keyChainKey(_url);
if( key.isNull() ) {
qDebug() << "Error: Can not save credentials, URL is zero!";
return;
}
#ifdef WITH_QTKEYCHAIN
#endif
cfgFile.setUser(_user);
switch( _type ) {
case CredentialStore::KeyChain: {
#ifdef WITH_QTKEYCHAIN
WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());
// Set password in KeyChain
job->setKey( key );
job->setTextData(_passwd);
connect( job, SIGNAL(finished(QKeychain::Job*)), this,
SLOT(slotKeyChainWriteFinished(QKeychain::Job*)));
_state = AsyncWriting;
job->start();
#endif
}
break;
case CredentialStore::Settings:
cfgFile.setPassword( _passwd );
reset();
break;
default:
// unsupported.
break;
}
}
void CredentialStore::slotKeyChainWriteFinished( QKeychain::Job *job )
{
#ifdef WITH_QTKEYCHAIN
WritePasswordJob *pwdJob = static_cast<WritePasswordJob*>(job);
if( pwdJob ) {
QKeychain::Error err = pwdJob->error();
if( err != QKeychain::NoError ) {
qDebug() << "Error with keychain: " << pwdJob->errorString();
if( err == NoBackendAvailable || err == NotImplemented ||
pwdJob->errorString().contains(QLatin1String("Could not open wallet"))) {
_state = NoKeychainBackend;
_type = Settings;
saveCredentials();
} else {
_state = Error;
}
} else {
qDebug() << "Successfully stored password for user " << _user;
// Try to remove password formerly stored in the config file.
HttpConfigFile cfgFile;
cfgFile.removePassword();
_state = NotFetched;
}
} else {
qDebug() << "Error: KeyChain Write Password Job failed!";
_state = Error;
}
#else
(void) job;
#endif
}
// Called if a user chooses to not store the password locally.
void CredentialStore::deleteKeyChainCredential( const QString& key )
{
#ifdef WITH_QTKEYCHAIN
// Start the remove job, do not care so much about the result.
DeletePasswordJob *job = new DeletePasswordJob(Theme::instance()->appName());
job->setKey( key );
job->start();
#endif
}
}
-132
Ver Arquivo
@@ -1,132 +0,0 @@
/*
* 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 CREDENTIALSTORE_H
#define CREDENTIALSTORE_H
#include <QObject>
#include <QInputDialog>
namespace QKeychain {
class Job;
}
namespace Mirall {
/*
* This object holds the credential information of the ownCloud connection. It
* is implemented as a singleton.
* At startup of the client, at first the fetchCredentials() method must be called
* which tries to get credentials from one of the supported backends. To determine
* which backend should be used, MirallConfigFile::credentialType() is called as
* the backend is configured in the config file.
*
* The fetchCredentials() call changes the internal state of the credential store
* to one of
* Ok: There are credentials. Note that it's unknown if they are correct!!
* Fetching: The fetching is not yet finished.
* EntryNotFound: No password entry found in the storage.
* Error: A general error happened.
* After fetching has finished, signal fetchCredentialsFinished(bool) is emitted.
* The result can be retrieved with state() and password() and user() methods.
*/
class CredentialStore : public QObject
{
Q_OBJECT
public:
enum CredState { NotFetched = 0,
Ok,
Fetching,
AsyncFetching,
EntryNotFound,
AccessDenied,
NoKeychainBackend,
Error,
AsyncWriting };
enum CredentialType {
Settings = 0,
KeyChain
};
QString password( ) const;
QString user( ) const;
/**
* @brief state
* @return the state of the Credentialstore.
*/
CredState state();
/**
* @brief fetchCredentials - start to retrieve user credentials.
*
* This method must be called first to retrieve the credentials.
* At the end, this method emits the fetchKeyChainFinished() signal.
*/
void fetchCredentials();
/**
* @brief instance - singleton pointer.
* @return the singleton pointer to access the object.
*/
static CredentialStore *instance();
/**
* @brief setCredentials - sets the user credentials.
*
* This function is called from the setup wizard to set the credentials
* int this store. Note that it does not store the password.
* The function also sets the state to ok.
* @param url - the connection url
* @param user - the user name
*/
void setCredentials( const QString& url, const QString& user, const QString& pwd);
void saveCredentials( );
QString errorMessage();
void reset();
signals:
/**
* @brief fetchCredentialsFinished
*
* emitted as soon as the fetching of the credentials has finished.
* If the parameter is true, there is a password and user. This does
* however, not say if the credentials are valid log in data.
* If false, the user pressed cancel.
*/
void fetchCredentialsFinished(bool);
protected slots:
void slotKeyChainReadFinished( QKeychain::Job* );
void slotKeyChainWriteFinished( QKeychain::Job* );
private:
explicit CredentialStore(QObject *parent = 0);
void deleteKeyChainCredential( const QString& );
QString keyChainKey( const QString& ) const;
static CredentialStore *_instance;
static CredState _state;
static QString _passwd;
static QString _user;
static QString _url;
static QString _errorMsg;
static CredentialType _type;
};
}
#endif // CREDENTIALSTORE_H
+133 -32
Ver Arquivo
@@ -1,5 +1,4 @@
/*
* Copyright (C) by Duncan Mac-Vicar P. <duncan@kde.org>
* Copyright (C) by Klaas Freitag <freitag@kde.org>
* Copyright (C) by Krzesimir Nowak <krzesimir@endocode.com>
*
@@ -15,14 +14,23 @@
*/
#include <QMutex>
#include <QDebug>
#include <QNetworkReply>
#include <QSettings>
#include <QInputDialog>
#include "creds/httpcredentials.h"
#include "mirall/owncloudinfo.h"
#include "mirall/mirallconfigfile.h"
#include <qtkeychain/keychain.h>
#include "mirall/account.h"
#include "mirall/mirallaccessmanager.h"
#include "mirall/utility.h"
#include "creds/http/credentialstore.h"
#include "mirall/theme.h"
#include "creds/credentialscommon.h"
#include "creds/httpcredentials.h"
using namespace QKeychain;
Q_DECLARE_METATYPE(Mirall::Account*)
namespace Mirall
{
@@ -39,8 +47,8 @@ int getauth(const char *prompt,
{
int re = 0;
QMutex mutex;
MirallConfigFile cfg;
HttpCredentials* http_credentials = dynamic_cast< HttpCredentials* > (cfg.getCredentials());
// ### safe?
HttpCredentials* http_credentials = qobject_cast<HttpCredentials*>(AccountManager::instance()->account()->credentials());
if (!http_credentials) {
qDebug() << "Not a HTTP creds instance!";
@@ -65,6 +73,8 @@ int getauth(const char *prompt,
return re;
}
const char userC[] = "user";
} // ns
class HttpCredentialsAccessManager : public MirallAccessManager {
@@ -76,7 +86,8 @@ protected:
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);\
//qDebug() << "Request for " << req.url() << "with authorization" << QByteArray::fromBase64(credHash);
return MirallAccessManager::createRequest(op, req, outgoingData);
}
private:
const HttpCredentials *_cred;
@@ -92,7 +103,8 @@ HttpCredentials::HttpCredentials(const QString& user, const QString& password)
: _user(user),
_password(password),
_ready(true)
{}
{
}
void HttpCredentials::syncContextPreInit (CSYNC* ctx)
{
@@ -105,7 +117,7 @@ void HttpCredentials::syncContextPreStart (CSYNC* ctx)
// any way to get "session_key" module property from csync. Had we
// have it, then we could remove this code and keep it in
// csyncthread code (or folder code, git remembers).
QList<QNetworkCookie> cookies(ownCloudInfo::instance()->getLastAuthCookies());
QList<QNetworkCookie> cookies(AccountManager::instance()->account()->lastAuthCookies());
QString cookiesAsString;
// Stuff cookies inside csync, then we can avoid the intermediate HTTP 401 reply
@@ -124,7 +136,7 @@ bool HttpCredentials::changed(AbstractCredentials* credentials) const
{
HttpCredentials* other(dynamic_cast< HttpCredentials* >(credentials));
if (!other || other->user() != this->user()) {
if (!other || (other->user() != this->user())) {
return true;
}
@@ -161,35 +173,112 @@ bool HttpCredentials::ready() const
return _ready;
}
void HttpCredentials::fetch()
void HttpCredentials::fetch(Account *account)
{
_user = account->credentialSetting(QLatin1String(userC)).toString();
if (_ready) {
Q_EMIT fetched();
} else {
// TODO: merge CredentialStore into HttpCredentials?
CredentialStore* store(CredentialStore::instance());
connect(store, SIGNAL(fetchCredentialsFinished(bool)),
this, SLOT(slotCredentialsFetched(bool)));
store->fetchCredentials();
ReadPasswordJob *job = new ReadPasswordJob(Theme::instance()->appName());
job->setSettings(account->settingsWithGroup(Theme::instance()->appName()));
job->setInsecureFallback(true);
job->setKey(keychainKey(account->url().toString(), _user));
connect(job, SIGNAL(finished(QKeychain::Job*)), SLOT(slotReadJobDone(QKeychain::Job*)));
job->setProperty("account", QVariant::fromValue(account));
job->start();
}
}
bool HttpCredentials::stillValid(QNetworkReply *reply)
{
return ((reply->error() != QNetworkReply::AuthenticationRequiredError)
// returned if user or password is incorrect
&& (reply->error() != QNetworkReply::OperationCanceledError));
}
bool HttpCredentials::fetchFromUser(Account *account)
{
bool ok = false;
QString password = queryPassword(&ok);
if (ok) {
_password = password;
_ready = true;
persist(account);
}
return ok;
}
void HttpCredentials::slotReadJobDone(QKeychain::Job *job)
{
ReadPasswordJob *readJob = static_cast<ReadPasswordJob*>(job);
delete readJob->settings();
_password = readJob->textData();
QKeychain::Error error = job->error();
switch (error) {
case NoError:
_ready = true;
Q_EMIT fetched();
break;
default:
if (!_user.isEmpty()) {
bool ok;
QString pwd = queryPassword(&ok);
if (ok) {
_password = pwd;
_ready = true;
persist(qvariant_cast<Account*>(readJob->property("account")));
Q_EMIT fetched();
break;
}
}
qDebug() << "Error while reading password" << job->errorString();
}
}
void HttpCredentials::persistForUrl(const QString& url)
QString HttpCredentials::queryPassword(bool *ok)
{
CredentialStore* store(CredentialStore::instance());
store->setCredentials(url, _user, _password);
store->saveCredentials();
qDebug() << AccountManager::instance()->account()->state();
if (ok) {
QString str = QInputDialog::getText(0, tr("Enter Password"),
tr("Please enter %1 password for user '%2':")
.arg(Theme::instance()->appNameGUI(), _user),
QLineEdit::Password, QString(), ok);
qDebug() << AccountManager::instance()->account()->state();
return str;
} else {
return QString();
}
}
void HttpCredentials::slotCredentialsFetched(bool ok)
void HttpCredentials::invalidateToken(Account *account)
{
_ready = ok;
if (_ready) {
CredentialStore* store(CredentialStore::instance());
_user = store->user();
_password = store->password();
_password = QString();
DeletePasswordJob *job = new DeletePasswordJob(Theme::instance()->appName());
job->setKey(keychainKey(account->url().toString(), _user));
job->start();
_ready = false;
}
void HttpCredentials::persist(Account *account)
{
account->setCredentialSetting(QLatin1String(userC), _user);
WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());
job->setSettings(account->settingsWithGroup(Theme::instance()->appName()));
job->setInsecureFallback(true);
connect(job, SIGNAL(finished(QKeychain::Job*)), SLOT(slotWriteJobDone(QKeychain::Job*)));
job->setKey(keychainKey(account->url().toString(), _user));
job->setTextData(_password);
job->start();
}
void HttpCredentials::slotWriteJobDone(QKeychain::Job *job)
{
delete job->settings();
switch (job->error()) {
case NoError:
break;
default:
qDebug() << "Error while writing password" << job->errorString();
}
Q_EMIT fetched();
}
void HttpCredentials::slotAuthentication(QNetworkReply* reply, QAuthenticator* authenticator)
@@ -202,12 +291,24 @@ void HttpCredentials::slotAuthentication(QNetworkReply* reply, QAuthenticator* a
reply->close();
}
void HttpCredentials::slotReplyFinished()
QString HttpCredentials::keychainKey(const QString &url, const QString &user)
{
QNetworkReply* reply = qobject_cast< QNetworkReply* >(sender());
QString u(url);
if( u.isEmpty() ) {
qDebug() << "Empty url in keyChain, error!";
return QString::null;
}
if( user.isEmpty() ) {
qDebug() << "Error: User is emty!";
return QString::null;
}
disconnect(reply, SIGNAL(finished()),
this, SLOT(slotReplyFinished()));
if( !u.endsWith(QChar('/')) ) {
u.append(QChar('/'));
}
QString key = user+QLatin1Char(':')+u;
return key;
}
} // ns Mirall
+28 -21
Ver Arquivo
@@ -1,5 +1,4 @@
/*
* Copyright (C) by Duncan Mac-Vicar P. <duncan@kde.org>
* Copyright (C) by Klaas Freitag <freitag@kde.org>
* Copyright (C) by Krzesimir Nowak <krzesimir@endocode.com>
*
@@ -24,38 +23,46 @@
class QNetworkReply;
class QAuthenticator;
namespace QKeychain {
class Job;
}
namespace Mirall
{
class HttpCredentials : public AbstractCredentials
{
Q_OBJECT
Q_OBJECT
public:
HttpCredentials();
HttpCredentials(const QString& user, const QString& password);
HttpCredentials();
HttpCredentials(const QString& user, const QString& password);
void syncContextPreInit(CSYNC* ctx);
void syncContextPreStart(CSYNC* ctx);
bool changed(AbstractCredentials* credentials) const;
QString authType() const;
QNetworkAccessManager* getQNAM() const;
bool ready() const;
void fetch();
void persistForUrl(const QString& url);
QString user() const;
QString password() const;
void syncContextPreInit(CSYNC* ctx);
void syncContextPreStart(CSYNC* ctx);
bool changed(AbstractCredentials* credentials) const;
QString authType() const;
QNetworkAccessManager* getQNAM() const;
bool ready() const;
void fetch(Account *account);
bool stillValid(QNetworkReply *reply);
bool fetchFromUser(Account *account);
void persist(Account *account);
QString user() const;
QString password() const;
QString queryPassword(bool *ok);
void invalidateToken(Account *account);
private Q_SLOTS:
void slotCredentialsFetched(bool);
void slotAuthentication(QNetworkReply*, QAuthenticator*);
void slotReplyFinished();
void slotAuthentication(QNetworkReply*, QAuthenticator*);
void slotReadJobDone(QKeychain::Job*);
void slotWriteJobDone(QKeychain::Job*);
private:
QString _user;
QString _password;
bool _ready;
static QString keychainKey(const QString &url, const QString &user);
QString _user;
QString _password;
bool _ready;
};
} // ns Mirall
@@ -13,6 +13,7 @@
#include <QDebug>
#include <QNetworkRequest>
#include <QNetworkCookieJar>
#include "creds/shibboleth/shibbolethaccessmanager.h"
+5 -2
Ver Arquivo
@@ -13,14 +13,16 @@
#include <QEventLoop>
#include "mirall/account.h"
#include "creds/shibboleth/shibbolethrefresher.h"
#include "creds/shibbolethcredentials.h"
namespace Mirall
{
ShibbolethRefresher::ShibbolethRefresher(ShibbolethCredentials* creds, CSYNC* csync_ctx, QObject* parent)
ShibbolethRefresher::ShibbolethRefresher(Account *account, ShibbolethCredentials* creds, CSYNC* csync_ctx, QObject* parent)
: QObject(parent),
_account(account),
_creds(creds),
_csync_ctx(csync_ctx)
{}
@@ -33,7 +35,8 @@ void ShibbolethRefresher::refresh()
this, SLOT(onInvalidatedAndFetched(QByteArray)));
connect(_creds, SIGNAL(invalidatedAndFetched(QByteArray)),
&loop, SLOT(quit()));
QMetaObject::invokeMethod(_creds, "invalidateAndFetch", Qt::QueuedConnection);
QMetaObject::invokeMethod(_creds, "invalidateAndFetch",Qt::QueuedConnection,
Q_ARG(Account*, _account));
loop.exec();
disconnect(_creds, SIGNAL(invalidatedAndFetched(QByteArray)),
&loop, SLOT(quit()));
+3 -1
Ver Arquivo
@@ -23,6 +23,7 @@ class QByteArray;
namespace Mirall
{
class Account;
class ShibbolethCredentials;
class ShibbolethRefresher : public QObject
@@ -30,7 +31,7 @@ class ShibbolethRefresher : public QObject
Q_OBJECT
public:
ShibbolethRefresher(ShibbolethCredentials* creds, CSYNC* csync_ctx, QObject* parent = 0);
ShibbolethRefresher(Account *account, ShibbolethCredentials* creds, CSYNC* csync_ctx, QObject* parent = 0);
void refresh();
@@ -38,6 +39,7 @@ private Q_SLOTS:
void onInvalidatedAndFetched(const QByteArray& cookieData);
private:
Account* _account;
ShibbolethCredentials* _creds;
CSYNC* _csync_ctx;
};
+29 -9
Ver Arquivo
@@ -16,17 +16,25 @@
#include <QNetworkCookie>
#include <QWebFrame>
#include <QWebPage>
#include <QMessageBox>
#include "creds/shibboleth/shibbolethcookiejar.h"
#include "creds/shibboleth/shibbolethwebview.h"
#include "mirall/account.h"
#include "mirall/mirallaccessmanager.h"
#include "mirall/theme.h"
namespace Mirall
{
void ShibbolethWebView::setup(const QUrl& url, ShibbolethCookieJar* jar)
void ShibbolethWebView::setup(Account *account, ShibbolethCookieJar* jar)
{
MirallAccessManager* nm = new MirallAccessManager(this);
// we need our own QNAM, but the we offload the SSL error handling to
// the account object, which already can do this
connect(nm, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
account, SLOT(slotHandleErrors(QNetworkReply*,QList<QSslError>)));
QWebPage* page = new QWebPage(this);
jar->setParent(this);
@@ -35,18 +43,19 @@ void ShibbolethWebView::setup(const QUrl& url, ShibbolethCookieJar* jar)
connect(page, SIGNAL(loadStarted()),
this, SLOT(slotLoadStarted()));
connect(page, SIGNAL(loadFinished(bool)),
this, SLOT(slotLoadFinished()));
this, SLOT(slotLoadFinished(bool)));
nm->setCookieJar(jar);
page->setNetworkAccessManager(nm);
page->mainFrame ()->load (url);
this->setPage (page);
page->mainFrame()->load(account->url());
this->setPage(page);
setWindowTitle(tr("%1 - Authenticate").arg(Theme::instance()->appNameGUI()));
}
ShibbolethWebView::ShibbolethWebView(const QUrl& url, QWidget* parent)
ShibbolethWebView::ShibbolethWebView(Account* account, QWidget* parent)
: QWebView(parent)
{
setup(url, new ShibbolethCookieJar(this));
setup(account, new ShibbolethCookieJar(this));
}
ShibbolethWebView::~ShibbolethWebView()
@@ -54,10 +63,10 @@ ShibbolethWebView::~ShibbolethWebView()
slotLoadFinished();
}
ShibbolethWebView::ShibbolethWebView(const QUrl& url, ShibbolethCookieJar* jar, QWidget* parent)
ShibbolethWebView::ShibbolethWebView(Account* account, ShibbolethCookieJar* jar, QWidget* parent)
: QWebView(parent)
{
setup(url, jar);
setup(account, jar);
}
void ShibbolethWebView::onNewCookiesForUrl (const QList<QNetworkCookie>& cookieList, const QUrl& url)
@@ -96,9 +105,20 @@ void ShibbolethWebView::slotLoadStarted()
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
}
void ShibbolethWebView::slotLoadFinished()
void ShibbolethWebView::slotLoadFinished(bool success)
{
QApplication::restoreOverrideCursor();
if (!title().isNull()) {
setWindowTitle(tr("%1 - %2").arg(Theme::instance()->appNameGUI(), title()));
}
if (!success) {
QMessageBox::critical(this, tr("Error loading IdP login page"),
tr("Could not load Shibboleth login page to log you in.\n"
"Please ensure that your network connection is working."));
}
}
} // ns Mirall
+5 -4
Ver Arquivo
@@ -24,14 +24,15 @@ namespace Mirall
{
class ShibbolethCookieJar;
class Account;
class ShibbolethWebView : public QWebView
{
Q_OBJECT
public:
ShibbolethWebView(const QUrl& url, QWidget* parent = 0);
ShibbolethWebView(const QUrl& url, ShibbolethCookieJar* jar, QWidget* parent = 0);
ShibbolethWebView(Account *account, QWidget* parent = 0);
ShibbolethWebView(Account *account, ShibbolethCookieJar* jar, QWidget* parent = 0);
~ShibbolethWebView();
protected:
@@ -45,10 +46,10 @@ Q_SIGNALS:
private Q_SLOTS:
void onNewCookiesForUrl(const QList<QNetworkCookie>& cookieList, const QUrl& url);
void slotLoadStarted();
void slotLoadFinished();
void slotLoadFinished(bool success = true);
private:
void setup(const QUrl& url, ShibbolethCookieJar* jar);
void setup(Account *account, ShibbolethCookieJar* jar);
};
} // ns Mirall
+51 -13
Ver Arquivo
@@ -12,14 +12,16 @@
* for more details.
*/
#include <QDebug>
#include <QMutex>
#include "creds/shibbolethcredentials.h"
#include "creds/shibboleth/shibbolethaccessmanager.h"
#include "creds/shibboleth/shibbolethwebview.h"
#include "creds/shibboleth/shibbolethrefresher.h"
#include "creds/shibboleth/shibbolethconfigfile.h"
#include "creds/credentialscommon.h"
#include "mirall/owncloudinfo.h"
#include "mirall/mirallconfigfile.h"
#include "mirall/account.h"
namespace Mirall
{
@@ -44,15 +46,16 @@ int shibboleth_redirect_callback(CSYNC* csync_ctx,
QMutex mutex;
QMutexLocker locker(&mutex);
MirallConfigFile cfg;
ShibbolethCredentials* creds = dynamic_cast< ShibbolethCredentials* > (cfg.getCredentials());
Account *account = AccountManager::instance()->account();
ShibbolethCredentials* creds = qobject_cast<ShibbolethCredentials*>(account->credentials());
if (!creds) {
qDebug() << "Not a Shibboleth creds instance!";
return 1;
}
ShibbolethRefresher refresher(creds, csync_ctx);
ShibbolethRefresher refresher(account, creds, csync_ctx);
// blocks
refresher.refresh();
@@ -63,7 +66,9 @@ int shibboleth_redirect_callback(CSYNC* csync_ctx,
} // ns
ShibbolethCredentials::ShibbolethCredentials()
: _shibCookie(),
: AbstractCredentials(),
_url(),
_shibCookie(),
_ready(false),
_browser(0),
_otherCookies()
@@ -88,7 +93,7 @@ QByteArray ShibbolethCredentials::prepareCookieData() const
// have any way to get "session_key" module property from
// csync. Had we have it, then we could just append shibboleth
// cookies to the "session_key" value and set it in csync module.
QList<QNetworkCookie> cookies(ownCloudInfo::instance()->getLastAuthCookies());
QList<QNetworkCookie> cookies(AccountManager::instance()->account()->lastAuthCookies());
QMap<QString, QString> uniqueCookies;
cookies << _shibCookie;
@@ -142,6 +147,14 @@ QString ShibbolethCredentials::authType() const
return QString::fromLatin1("shibboleth");
}
QString ShibbolethCredentials::user() const
{
// ### TODO: If we had a way to extract the currently authenticated user
// somehow, we could return its id token (email) here (stored in REMOTE_USER)
// The server doesn't return it by default
return QString();
}
QNetworkCookie ShibbolethCredentials::cookie() const
{
return _shibCookie;
@@ -161,14 +174,16 @@ bool ShibbolethCredentials::ready() const
return _ready;
}
void ShibbolethCredentials::fetch()
void ShibbolethCredentials::fetch(Account *account)
{
if (_ready) {
Q_EMIT fetched();
} else {
ShibbolethConfigFile cfg;
_browser = new ShibbolethWebView(QUrl(cfg.ownCloudUrl()), cfg.createCookieJar());
if (account) {
_url = account->url();
}
_browser = new ShibbolethWebView(account, cfg.createCookieJar());
connect(_browser, SIGNAL(shibbolethCookieReceived(QNetworkCookie)),
this, SLOT(onShibbolethCookieReceived(QNetworkCookie)));
connect(_browser, SIGNAL(viewHidden()),
@@ -177,13 +192,33 @@ void ShibbolethCredentials::fetch()
}
}
void ShibbolethCredentials::persistForUrl(const QString& /*url*/)
bool ShibbolethCredentials::stillValid(QNetworkReply *reply)
{
Q_UNUSED(reply)
return true;
}
bool ShibbolethCredentials::fetchFromUser(Account *account)
{
Q_UNUSED(account)
return false;
}
void ShibbolethCredentials::persist(Account* /*account*/)
{
ShibbolethConfigFile cfg;
cfg.storeCookies(_otherCookies);
}
void ShibbolethCredentials::invalidateToken(Account *account)
{
Q_UNUSED(account)
_shibCookie.setValue("");
// ### access to ctx missing, but might not be required at all
//csync_set_module_property(ctx, "session_key", "");
}
void ShibbolethCredentials::disposeBrowser()
{
disconnect(_browser, SIGNAL(viewHidden()),
@@ -212,12 +247,15 @@ void ShibbolethCredentials::slotBrowserHidden()
Q_EMIT fetched();
}
void ShibbolethCredentials::invalidateAndFetch()
void ShibbolethCredentials::invalidateAndFetch(Account* account)
{
_ready = false;
connect (this, SIGNAL(fetched()),
this, SLOT(onFetched()));
fetch();
// small hack to support the ShibbolethRefresher hack
// we already rand fetch() with a valid account object,
// and hence know the url on refresh
fetch(account);
}
void ShibbolethCredentials::onFetched()
+8 -3
Ver Arquivo
@@ -38,15 +38,19 @@ public:
void syncContextPreStart(CSYNC* ctx);
bool changed(AbstractCredentials* credentials) const;
QString authType() const;
QString user() const;
QNetworkAccessManager* getQNAM() const;
bool ready() const;
void fetch();
void persistForUrl(const QString& url);
void fetch(Account *account);
bool stillValid(QNetworkReply *reply);
virtual bool fetchFromUser(Account *account);
void persist(Account *account);
void invalidateToken(Account *account);
QNetworkCookie cookie() const;
public Q_SLOTS:
void invalidateAndFetch();
void invalidateAndFetch(Account *account);
private Q_SLOTS:
void onShibbolethCookieReceived(const QNetworkCookie& cookie);
@@ -58,6 +62,7 @@ Q_SIGNALS:
void invalidatedAndFetched(const QByteArray& cookieData);
private:
QUrl _url;
QByteArray prepareCookieData() const;
void disposeBrowser();
+4 -2
Ver Arquivo
@@ -11,6 +11,7 @@
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
#include <signal.h>
#include "mirall/application.h"
#include "mirall/theme.h"
@@ -34,8 +35,9 @@ int main(int argc, char **argv)
Q_INIT_RESOURCE(mirall);
Mirall::Application app(argc, argv);
app.initialize();
#ifndef Q_OS_WIN
signal(SIGPIPE, SIG_IGN);
#endif
if( app.giveHelp() ) {
app.showHelp();
return 0;
+327
Ver Arquivo
@@ -0,0 +1,327 @@
/*
* Copyright (C) by Daniel Molkentin <danimo@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.
*/
#include "mirall/account.h"
#include "mirall/theme.h"
#include "mirall/mirallconfigfile.h"
#include "creds/abstractcredentials.h"
#include "creds/credentialsfactory.h"
#include <QSettings>
#include <QMutex>
#include <QNetworkReply>
#include <QNetworkAccessManager>
#include <QSslSocket>
#include <QNetworkCookieJar>
#include <QDebug>
namespace Mirall {
static const char urlC[] = "url";
static const char authTypeC[] = "authType";
static const char userC[] = "user";
static const char httpUserC[] = "http_user";
AccountManager *AccountManager::_instance = 0;
AccountManager *AccountManager::instance()
{
static QMutex mutex;
if (!_instance)
{
QMutexLocker lock(&mutex);
if (!_instance) {
_instance = new AccountManager;
}
}
return _instance;
}
void AccountManager::setAccount(Account *account)
{
emit accountAboutToChange(account, _account);
std::swap(_account, account);
emit accountChanged(_account, account);
}
Account::Account(AbstractSslErrorHandler *sslErrorHandler, QObject *parent)
: QObject(parent)
, _url(Theme::instance()->overrideServerUrl())
, _sslErrorHandler(sslErrorHandler)
, _am(0)
, _credentials(0)
, _treatSslErrorsAsFailure(false)
, _state(Account::Disconnected)
{
}
Account::~Account()
{
}
void Account::save()
{
QScopedPointer<QSettings> settings(settingsWithGroup(Theme::instance()->appName()));
settings->setValue(QLatin1String(urlC), _url.toString());
if (_credentials) {
_credentials->persist(this);
Q_FOREACH(QString key, _settingsMap.keys()) {
settings->setValue(key, _settingsMap.value(key));
}
settings->setValue(QLatin1String(authTypeC), _credentials->authType());
// HACK: Save http_user also as user
if (_settingsMap.contains(httpUserC))
settings->setValue(userC, _settingsMap.value(httpUserC));
}
settings->sync();
// ### TODO port away from MirallConfigFile
MirallConfigFile cfg;
qDebug() << "Saving " << approvedCerts().count() << " unknown certs.";
QByteArray certs;
Q_FOREACH( const QSslCertificate& cert, approvedCerts() ) {
certs += cert.toPem() + '\n';
}
if (!certs.isEmpty()) {
cfg.setCaCerts( certs );
}
}
Account* Account::restore()
{
QScopedPointer<QSettings> settings(settingsWithGroup(Theme::instance()->appName()));
if (!settings->childKeys().isEmpty()) {
Account *acc = new Account;
MirallConfigFile cfg;
acc->setApprovedCerts(QSslCertificate::fromData(cfg.caCerts()));
acc->setUrl(settings->value(QLatin1String(urlC)).toUrl());
acc->setCredentials(CredentialsFactory::create(settings->value(QLatin1String(authTypeC)).toString()));
// We want to only restore settings for that auth type and the user value
acc->_settingsMap.insert(QLatin1String(userC), settings->value(userC));
QString authTypePrefix = settings->value(authTypeC).toString() + "_";
Q_FOREACH(QString key, settings->childKeys()) {
if (!key.startsWith(authTypePrefix))
continue;
acc->_settingsMap.insert(key, settings->value(key));
}
return acc;
}
return 0;
}
static bool isEqualExceptProtocol(const QUrl &url1, const QUrl &url2)
{
return (url1.host() != url2.host() ||
url1.port() != url2.port() ||
url1.path() != url2.path());
}
bool Account::changed(Account *other, bool ignoreUrlProtocol) const
{
if (!other) {
return false;
}
bool changes = false;
if (ignoreUrlProtocol) {
changes = isEqualExceptProtocol(_url, other->_url);
} else {
changes = (_url == other->_url);
}
changes |= _credentials->changed(other->_credentials);
return changes;
}
AbstractCredentials *Account::credentials() const
{
return _credentials;
}
void Account::setCredentials(AbstractCredentials *cred)
{
_credentials = cred;
// set active credential manager
if (_am) {
_am->deleteLater();
}
_am = _credentials->getQNAM();
connect(_am, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
SLOT(slotHandleErrors(QNetworkReply*,QList<QSslError>)));
}
QUrl Account::davUrl() const
{
return concatUrlPath(url(), davPath());
}
QList<QNetworkCookie> Account::lastAuthCookies() const
{
return _am->cookieJar()->cookiesForUrl(_url);
}
QNetworkReply *Account::headRequest(const QString &relPath)
{
return headRequest(concatUrlPath(url(), relPath));
}
QNetworkReply *Account::headRequest(const QUrl &url)
{
QNetworkRequest request(url);
return _am->head(request);
}
QNetworkReply *Account::getRequest(const QString &relPath)
{
return getRequest(concatUrlPath(url(), relPath));
}
QNetworkReply *Account::getRequest(const QUrl &url)
{
QNetworkRequest request(url);
return _am->get(request);
}
QNetworkReply *Account::davRequest(const QByteArray &verb, const QString &relPath, QNetworkRequest req, QIODevice *data)
{
return davRequest(verb, concatUrlPath(davUrl(), relPath), req, data);
}
QNetworkReply *Account::davRequest(const QByteArray &verb, const QUrl &url, QNetworkRequest req, QIODevice *data)
{
req.setUrl(url);
return _am->sendCustomRequest(req, verb, data);
}
void Account::setCertificateChain(const QList<QSslCertificate> &certs)
{
_certificateChain = certs;
}
void Account::setApprovedCerts(const QList<QSslCertificate> certs)
{
_approvedCerts = certs;
}
void Account::addApprovedCerts(const QList<QSslCertificate> certs)
{
_approvedCerts += certs;
}
void Account::setSslErrorHandler(AbstractSslErrorHandler *handler)
{
_sslErrorHandler.reset(handler);
}
void Account::setUrl(const QUrl &url)
{
_url = url;
}
QUrl Account::concatUrlPath(const QUrl &url, const QString &concatPath)
{
QUrl tmpUrl = url;
QString path = tmpUrl.path();
// avoid '//'
if (path.endsWith('/') && concatPath.startsWith('/')) {
path.chop(1);
} // avoid missing '/'
else if (!path.endsWith('/') && !concatPath.startsWith('/')) {
path += QLatin1Char('/');
}
path += concatPath;
tmpUrl.setPath(path);
return tmpUrl;
}
QString Account::_configFileName;
QSettings *Account::settingsWithGroup(const QString& group)
{
if (_configFileName.isEmpty()) {
// cache file name
MirallConfigFile cfg;
_configFileName = cfg.configFile();
}
QSettings *settings = new QSettings(_configFileName, QSettings::IniFormat);
settings->beginGroup(group);
return settings;
}
QVariant Account::credentialSetting(const QString &key) const
{
if (_credentials) {
QString prefix = _credentials->authType();
QString value = _settingsMap.value(prefix+"_"+key).toString();
if (value.isEmpty()) {
value = _settingsMap.value(key).toString();
}
return value;
}
return QVariant();
}
void Account::setCredentialSetting(const QString &key, const QVariant &value)
{
if (_credentials) {
QString prefix = _credentials->authType();
_settingsMap.insert(prefix+"_"+key, value);
}
}
int Account::state() const
{
return _state;
}
void Account::setState(int state)
{
if (_state != state) {
_state = state;
emit stateChanged(state);
}
}
void Account::slotHandleErrors(QNetworkReply *reply , QList<QSslError> errors)
{
qDebug() << "SSL-Warnings happened for url " << reply->url().toString();
if( _treatSslErrorsAsFailure ) {
// User decided once not to trust. Honor this decision.
qDebug() << "Certs not trusted by user decision, returning.";
return;
}
QList<QSslCertificate> approvedCerts;
if (_sslErrorHandler.isNull() ) {
qDebug() << Q_FUNC_INFO << "called without valid SSL error handler for account" << url();
} else {
if (_sslErrorHandler->handleErrors(errors, &approvedCerts, this)) {
QSslSocket::addDefaultCaCertificates(approvedCerts);
addApprovedCerts(approvedCerts);
// all ssl certs are known and accepted. We can ignore the problems right away.
qDebug() << "Certs are already known and trusted, Warnings are not valid.";
reply->ignoreSslErrors();
} else {
_treatSslErrorsAsFailure = true;
return;
}
}
}
} // namespace Mirall
+164
Ver Arquivo
@@ -0,0 +1,164 @@
/*
* Copyright (C) by Daniel Molkentin <danimo@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 SERVERCONNECTION_H
#define SERVERCONNECTION_H
#include <QByteArray>
#include <QUrl>
#include <QNetworkCookie>
#include <QNetworkRequest>
#include <QSslCertificate>
#include <QSslError>
class QSettings;
class QNetworkReply;
class QUrl;
class QNetworkAccessManager;
namespace Mirall {
class AbstractCredentials;
class Account;
class AccountManager : public QObject {
Q_OBJECT
public:
static AccountManager *instance();
~AccountManager() {}
void setAccount(Account *account);
Account *account() { return _account; }
Q_SIGNALS:
void accountChanged(Account *newAccount, Account *oldAccount);
void accountAboutToChange(Account *newAccount, Account *oldAccount);
private:
AccountManager() : _account(0) {}
Account *_account;
static AccountManager *_instance;
};
/* Reimplement this to handle SSL errors */
class AbstractSslErrorHandler {
public:
virtual ~AbstractSslErrorHandler() {}
virtual bool handleErrors(QList<QSslError>, QList<QSslCertificate>*, Account*) = 0;
};
/**
* @brief This class represents an account on an ownCloud Server
*/
class Account : public QObject {
Q_OBJECT
public:
enum State { Disconnected = 0, /// no network connection
Connected, /// account is online
SignedOut /// Disconnected + credential token has been discarded
};
static QString davPath() { return "remote.php/webdav/"; }
Account(AbstractSslErrorHandler *sslErrorHandler = 0, QObject *parent = 0);
~Account();
/**
* Saves the account to a given settings file
*/
void save();
/**
* Creates an account object from from a given settings file.
*/
static Account* restore();
/**
* @brief Creates a minimal account object
*
* This will set up a ssl error handler
*
* @return A new Account object
*/
static Account* create(const QUrl &url);
/**
* @brief Checks the Account instance is different from \param other
*
* @returns true, if credentials or url have changed, false otherwise
*/
bool changed(Account *other, bool ignoreUrlProtocol) const;
/** Holds the accounts credentials */
AbstractCredentials* credentials() const;
void setCredentials(AbstractCredentials *cred);
/** Server url of the account */
void setUrl(const QUrl &url);
QUrl url() const { return _url; }
/** Returns webdav entry URL, based on url() */
QUrl davUrl() const;
QList<QNetworkCookie> lastAuthCookies() const;
QNetworkReply* headRequest(const QString &relPath);
QNetworkReply* headRequest(const QUrl &url);
QNetworkReply* getRequest(const QString &relPath);
QNetworkReply* getRequest(const QUrl &url);
QNetworkReply* davRequest(const QByteArray &verb, const QString &relPath, QNetworkRequest req, QIODevice *data = 0);
QNetworkReply* davRequest(const QByteArray &verb, const QUrl &url, QNetworkRequest req, QIODevice *data = 0);
/** The certificates of the account */
QList<QSslCertificate> certificateChain() const { return _certificateChain; }
void setCertificateChain(const QList<QSslCertificate> &certs);
/** The certificates of the account */
QList<QSslCertificate> approvedCerts() const { return _approvedCerts; }
void setApprovedCerts(const QList<QSslCertificate> certs);
void addApprovedCerts(const QList<QSslCertificate> certs);
// pluggable handler
void setSslErrorHandler(AbstractSslErrorHandler *handler);
// static helper function
static QUrl concatUrlPath(const QUrl &url, const QString &concatPath);
static QSettings* settingsWithGroup(const QString &group);
// to be called by credentials only
QVariant credentialSetting(const QString& key) const;
void setCredentialSetting(const QString& key, const QVariant &value);
int state() const;
void setState(int state);
signals:
void stateChanged(int state);
protected Q_SLOTS:
void slotHandleErrors(QNetworkReply*,QList<QSslError>);
private:
QMap<QString, QVariant> _settingsMap;
QUrl _url;
QList<QSslCertificate> _approvedCerts;
QList<QSslCertificate> _certificateChain;
QScopedPointer<AbstractSslErrorHandler> _sslErrorHandler;
QNetworkAccessManager *_am;
AbstractCredentials* _credentials;
bool _treatSslErrorsAsFailure;
int _state;
static QString _configFileName;
};
}
#endif //SERVERCONNECTION_H
+117 -122
Ver Arquivo
@@ -17,7 +17,6 @@
#include "mirall/theme.h"
#include "mirall/folderman.h"
#include "mirall/owncloudinfo.h"
#include "mirall/folderwizard.h"
#include "mirall/folderstatusmodel.h"
#include "mirall/utility.h"
@@ -25,7 +24,8 @@
#include "mirall/owncloudsetupwizard.h"
#include "mirall/mirallconfigfile.h"
#include "mirall/ignorelisteditor.h"
#include "mirall/itemprogressdialog.h"
#include "mirall/account.h"
#include "creds/abstractcredentials.h"
#include <math.h>
@@ -38,6 +38,8 @@
#include <QIcon>
#include <QVariant>
#include "mirall/account.h"
namespace Mirall {
static const char progressBarStyleC[] =
@@ -53,7 +55,8 @@ static const char progressBarStyleC[] =
AccountSettings::AccountSettings(QWidget *parent) :
QWidget(parent),
ui(new Ui::AccountSettings),
_wasDisabledBefore(false)
_wasDisabledBefore(false),
_account(AccountManager::instance()->account())
{
ui->setupUi(this);
@@ -67,20 +70,23 @@ AccountSettings::AccountSettings(QWidget *parent) :
ui->_folderList->setMinimumWidth( 300 );
ui->_folderList->setEditTriggers( QAbstractItemView::NoEditTriggers );
ui->_ButtonRemove->setEnabled(false);
ui->_ButtonEnable->setEnabled(false);
ui->_ButtonInfo->setEnabled(false);
ui->_ButtonAdd->setEnabled(true);
ui->_buttonRemove->setEnabled(false);
ui->_buttonEnable->setEnabled(false);
ui->_buttonAdd->setEnabled(true);
QAction *resetFolderAction = new QAction(this);
resetFolderAction->setShortcut(QKeySequence(Qt::Key_F5));
connect(resetFolderAction, SIGNAL(triggered()), SLOT(slotResetCurrentFolder()));
addAction(resetFolderAction);
connect(ui->_ButtonRemove, SIGNAL(clicked()), this, SLOT(slotRemoveCurrentFolder()));
connect(ui->_ButtonEnable, SIGNAL(clicked()), this, SLOT(slotEnableCurrentFolder()));
connect(ui->_ButtonInfo, SIGNAL(clicked()), this, SLOT(slotInfoAboutCurrentFolder()));
connect(ui->_ButtonAdd, SIGNAL(clicked()), this, SLOT(slotAddFolder()));
QAction *syncNowAction = new QAction(this);
syncNowAction->setShortcut(QKeySequence(Qt::Key_F6));
connect(syncNowAction, SIGNAL(triggered()), SLOT(slotSyncCurrentFolderNow()));
addAction(syncNowAction);
connect(ui->_buttonRemove, SIGNAL(clicked()), this, SLOT(slotRemoveCurrentFolder()));
connect(ui->_buttonEnable, SIGNAL(clicked()), this, SLOT(slotEnableCurrentFolder()));
connect(ui->_buttonAdd, SIGNAL(clicked()), this, SLOT(slotAddFolder()));
connect(ui->modifyAccountButton, SIGNAL(clicked()), SLOT(slotOpenAccountWizard()));
connect(ui->ignoredFilesButton, SIGNAL(clicked()), SLOT(slotIgnoreFilesEditor()));;
@@ -89,32 +95,43 @@ AccountSettings::AccountSettings(QWidget *parent) :
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)));
ui->connectLabel->setWordWrap(true);
ui->connectLabel->setOpenExternalLinks(true);
ui->quotaLabel->setWordWrap(true);
ui->connectLabel->setWordWrap( true );
ui->connectLabel->setText(tr("No account configured."));
ui->_buttonAdd->setEnabled(false);
if (_account) {
connect(_account, SIGNAL(stateChanged(int)), SLOT(slotAccountStateChanged(int)));
slotAccountStateChanged(_account->state());
}
setFolderList(FolderMan::instance()->map());
slotCheckConnection();
}
void AccountSettings::slotFolderActivated( const QModelIndex& indx )
{
bool state = indx.isValid();
ui->_ButtonRemove->setEnabled( state );
ui->_ButtonEnable->setEnabled( state );
ui->_ButtonInfo->setEnabled( state );
bool haveFolders = ui->_folderList->model()->rowCount() > 0;
ui->_buttonRemove->setEnabled(state);
if( Theme::instance()->singleSyncFolder() ) {
// only one folder synced folder allowed.
ui->_buttonAdd->setVisible(!haveFolders);
} else {
ui->_buttonAdd->setVisible(true);
ui->_buttonAdd->setEnabled( true );
}
ui->_buttonEnable->setEnabled( state );
if ( state ) {
bool folderEnabled = _model->data( indx, FolderStatusDelegate::FolderSyncEnabled).toBool();
qDebug() << "folder is sync enabled: " << folderEnabled;
if ( folderEnabled ) {
ui->_ButtonEnable->setText( tr( "Pause" ) );
ui->_buttonEnable->setText( tr( "Pause" ) );
} else {
ui->_ButtonEnable->setText( tr( "Resume" ) );
ui->_buttonEnable->setText( tr( "Resume" ) );
}
}
}
@@ -157,7 +174,7 @@ void AccountSettings::slotFolderWizardAccepted()
folderMan->slotScheduleAllFolders();
emit folderChanged();
}
buttonsSetEnabled();
slotButtonsSetEnabled();
}
void AccountSettings::slotFolderWizardRejected()
@@ -181,30 +198,17 @@ void AccountSettings::slotAddFolder( Folder *folder )
QStandardItem *item = new QStandardItem();
folderToModelItem( item, folder );
_model->appendRow( item );
slotCheckConnection();
// in order to update the enabled state of the "Sync now" button
connect(folder, SIGNAL(syncStateChange()), this, SLOT(slotButtonsSetEnabled()), Qt::UniqueConnection);
}
void AccountSettings::buttonsSetEnabled()
void AccountSettings::slotButtonsSetEnabled()
{
bool haveFolders = ui->_folderList->model()->rowCount() > 0;
ui->_ButtonRemove->setEnabled(false);
if( Theme::instance()->singleSyncFolder() ) {
// only one folder synced folder allowed.
ui->_ButtonAdd->setVisible(!haveFolders);
} else {
ui->_ButtonAdd->setVisible(true);
ui->_ButtonAdd->setEnabled(true);
}
QModelIndex selected = ui->_folderList->currentIndex();
bool isSelected = selected.isValid();
ui->_ButtonEnable->setEnabled(isSelected);
ui->_ButtonRemove->setEnabled(isSelected);
ui->_ButtonInfo->setEnabled(isSelected);
slotFolderActivated(selected);
}
void AccountSettings::setGeneralErrors( const QStringList& errors )
@@ -217,9 +221,9 @@ void AccountSettings::folderToModelItem( QStandardItem *item, Folder *f )
if( ! item || !f ) return;
item->setData( f->nativePath(), FolderStatusDelegate::FolderPathRole );
item->setData( f->secondPath(), FolderStatusDelegate::FolderSecondPathRole );
item->setData( f->remotePath(), FolderStatusDelegate::FolderSecondPathRole );
item->setData( f->alias(), FolderStatusDelegate::FolderAliasRole );
item->setData( f->userSyncEnabled() && f->syncEnabled(), FolderStatusDelegate::FolderSyncEnabled );
item->setData( f->syncEnabled(), FolderStatusDelegate::FolderSyncEnabled );
SyncResult res = f->syncResult();
SyncResult::Status status = res.status();
@@ -228,7 +232,7 @@ void AccountSettings::folderToModelItem( QStandardItem *item, Folder *f )
Theme *theme = Theme::instance();
item->setData( theme->statusHeaderText( status ), Qt::ToolTipRole );
if( f->syncEnabled() && f->userSyncEnabled() ) {
if( f->syncEnabled() ) {
if( status == SyncResult::SyncPrepare ) {
if( _wasDisabledBefore ) {
// if the folder was disabled before, set the sync icon
@@ -236,7 +240,11 @@ void AccountSettings::folderToModelItem( QStandardItem *item, Folder *f )
} // 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 );
if( status == SyncResult::Problem) {
item->setData( theme->syncStateIcon( SyncResult::Success), FolderStatusDelegate::FolderStatusIconRole );
} else {
item->setData( theme->syncStateIcon( status ), FolderStatusDelegate::FolderStatusIconRole );
}
}
} else {
item->setData( theme->folderDisabledIcon( ), FolderStatusDelegate::FolderStatusIconRole ); // size 48 before
@@ -247,7 +255,8 @@ void AccountSettings::folderToModelItem( QStandardItem *item, Folder *f )
if( errorList.isEmpty() ) {
if( (status == SyncResult::Error ||
status == SyncResult::SetupError ||
status == SyncResult::Unavailable )) {
status == SyncResult::SyncAbortRequested ||
status == SyncResult::Unavailable)) {
errorList << theme->statusHeaderText(status);
}
}
@@ -298,11 +307,14 @@ void AccountSettings::slotRemoveCurrentFolder()
folderMan->slotRemoveFolder( alias );
_model->removeRow(row);
// single folder fix to show add-button and hide remove-button
slotButtonsSetEnabled();
emit folderChanged();
slotCheckConnection();
}
}
}
void AccountSettings::slotResetCurrentFolder()
{
QModelIndex selected = ui->_folderList->selectionModel()->currentIndex();
@@ -318,7 +330,7 @@ void AccountSettings::slotResetCurrentFolder()
if( ret == QMessageBox::Yes ) {
FolderMan *folderMan = FolderMan::instance();
Folder *f = folderMan->folder(alias);
f->slotTerminateSync();
f->slotTerminateSync(true);
f->wipe();
folderMan->slotScheduleAllFolders();
}
@@ -349,24 +361,6 @@ void AccountSettings::showConnectionLabel( const QString& message, const QString
}
}
void AccountSettings::slotCheckConnection()
{
if( ownCloudInfo::instance()->isConfigured() ) {
connect(ownCloudInfo::instance(), SIGNAL(ownCloudInfoFound(const QString&, const QString&, const QString&, const QString&)),
this, SLOT(slotOCInfo( const QString&, const QString&, const QString&, const QString& )));
connect(ownCloudInfo::instance(), SIGNAL(noOwncloudFound(QNetworkReply*)),
this, SLOT(slotOCInfoFail(QNetworkReply*)));
showConnectionLabel( tr("Checking %1 connection...").arg(Theme::instance()->appNameGUI()));
qDebug() << "Check status.php from statusdialog.";
ownCloudInfo::instance()->checkInstallation();
} else {
// ownCloud is not yet configured.
showConnectionLabel( tr("No %1 connection configured.").arg(Theme::instance()->appNameGUI()) );
ui->_ButtonAdd->setEnabled( false);
}
}
void AccountSettings::setFolderList( const Folder::Map &folders )
{
_model->clear();
@@ -385,7 +379,7 @@ void AccountSettings::setFolderList( const Folder::Map &folders )
if (idx.isValid()) {
ui->_folderList->setCurrentIndex(idx);
}
buttonsSetEnabled();
slotButtonsSetEnabled();
}
@@ -398,7 +392,7 @@ void AccountSettings::slotFolderOpenAction( const QString& alias )
QUrl url(f->path(), QUrl::TolerantMode);
url.setScheme( QLatin1String("file") );
#ifdef Q_OS_WIN32
#ifdef Q_OS_WIN
// work around a bug in QDesktopServices on Win32, see i-net
QString filePath = f->path();
@@ -442,10 +436,11 @@ void AccountSettings::slotEnableCurrentFolder()
// message box can return at any time while the thread keeps running,
// so better check again after the user has responded.
if ( f->isBusy() && terminate )
folderMan->terminateSyncProcess( alias );
if ( f->isBusy() && terminate ) {
f->slotTerminateSync(false);
}
folderMan->slotGuiPauseFolder( alias, !folderEnabled );
folderMan->slotEnableFolder( alias, !folderEnabled );
// keep state for the icon setting.
if( !folderEnabled ) _wasDisabledBefore = true;
@@ -457,6 +452,20 @@ void AccountSettings::slotEnableCurrentFolder()
}
}
void AccountSettings::slotSyncCurrentFolderNow()
{
QModelIndex selected = ui->_folderList->selectionModel()->currentIndex();
if( !selected.isValid() )
return;
QString alias = _model->data( selected, FolderStatusDelegate::FolderAliasRole ).toString();
FolderMan *folderMan = FolderMan::instance();
Folder *f = folderMan->folder( alias );
if (!f)
return;
f->evaluateSync(QStringList());
}
void AccountSettings::slotUpdateFolderState( Folder *folder )
{
QStandardItem *item = 0;
@@ -479,51 +488,6 @@ void AccountSettings::slotUpdateFolderState( Folder *folder )
} else {
// the dialog is not visible.
}
slotCheckConnection();
}
void AccountSettings::slotOCInfo( const QString& url, const QString& versionStr, const QString& version, const QString& )
{
#ifdef Q_OS_WIN32
// work around a bug in QDesktopServices on Win32, see i-net
QString filePath = url;
if (filePath.startsWith("\\\\") || filePath.startsWith("//"))
_OCUrl.setUrl(QDir::toNativeSeparators(filePath));
else
_OCUrl = QUrl::fromLocalFile(filePath);
#else
_OCUrl = QUrl::fromLocalFile(url);
#endif
qDebug() << "#-------# oC found on " << url;
/* enable the open button */
ui->connectLabel->setOpenExternalLinks(true);
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&)),
this, SLOT(slotOCInfo( const QString&, const QString&, const QString&, const QString& )));
disconnect(ownCloudInfo::instance(), SIGNAL(noOwncloudFound(QNetworkReply*)),
this, SLOT(slotOCInfoFail(QNetworkReply*)));
}
void AccountSettings::slotOCInfoFail( QNetworkReply *reply)
{
QString errStr = tr("unknown problem.");
if( reply ) errStr = reply->errorString();
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&)),
this, SLOT(slotOCInfo( const QString&, const QString&, const QString&, const QString& )));
disconnect(ownCloudInfo::instance(), SIGNAL(noOwncloudFound(QNetworkReply*)),
this, SLOT(slotOCInfoFail(QNetworkReply*)));
}
void AccountSettings::slotOpenOC()
@@ -567,9 +531,8 @@ QString AccountSettings::shortenFilename( const QString& folder, const QString&
// rip off the whole ownCloud URL.
Folder *f = FolderMan::instance()->folder(folder);
if( f ) {
QString remotePathUrl = ownCloudInfo::instance()->webdavUrl() + QLatin1Char('/') + f->secondPath();
QString remotePathUrl = f->remoteUrl().toString();
shortFile.remove(Utility::toCSyncScheme(remotePathUrl));
}
}
return shortFile;
@@ -603,7 +566,7 @@ 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)
if( (progress.kind == Progress::StartSync)
&& progress.overall_file_count == 0 ) {
// do not show progress if nothing is transmitted.
return;
@@ -634,6 +597,7 @@ void AccountSettings::slotSetProgress(const QString& folder, const Progress::Inf
case Progress::StartDownload:
case Progress::StartUpload:
case Progress::StartDelete:
case Progress::StartRename:
syncFileProgressString = tr("Start");
if( _hideProgressTimers.contains(item) ) {
// The timer is still running.
@@ -648,6 +612,7 @@ void AccountSettings::slotSetProgress(const QString& folder, const Progress::Inf
case Progress::EndDownload:
case Progress::EndUpload:
case Progress::EndDelete:
case Progress::EndRename:
break;
case Progress::EndSync:
syncFileProgressString = tr("Completely");
@@ -669,7 +634,9 @@ void AccountSettings::slotSetProgress(const QString& folder, const Progress::Inf
case Progress::Download:
case Progress::Upload:
case Progress::Inactive:
case Progress::Error:
case Progress::SoftError:
case Progress::NormalError:
case Progress::FatalError:
break;
}
@@ -747,7 +714,9 @@ void AccountSettings::slotUpdateQuota(qint64 total, qint64 used)
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));
double percent = used/(double)total*100;
QString percentStr = Utility::compactFormatDouble(percent, 1);
ui->quotaLabel->setText(tr("%1 of %2 (%3%) in use.").arg(usedStr, totalStr, percentStr));
} else {
ui->quotaProgressBar->setVisible(false);
ui->quotaInfoLabel->setVisible(false);
@@ -766,9 +735,35 @@ void AccountSettings::slotIgnoreFilesEditor()
}
}
void AccountSettings::slotInfoAboutCurrentFolder()
void AccountSettings::slotAccountStateChanged(int state)
{
emit(openProgressDialog());
if (_account) {
QUrl safeUrl(_account->url());
safeUrl.setPassword(QString()); // Remove the password from the URL to avoid showing it in the UI
ui->_buttonAdd->setEnabled(state == Account::Connected);
if (state == Account::Connected) {
QString user;
if (AbstractCredentials *cred = _account->credentials()) {
user = cred->user();
}
if (user.isEmpty()) {
showConnectionLabel( tr("Connected to <a href=\"%1\">%2</a>.").arg(_account->url().toString(), safeUrl.toString())
/*, tr("Version: %1 (%2)").arg(versionStr).arg(version) */ );
} else {
showConnectionLabel( tr("Connected to <a href=\"%1\">%2</a> as <i>%3</i>.").arg(_account->url().toString(), safeUrl.toString(), user)
/*, tr("Version: %1 (%2)").arg(versionStr).arg(version) */ );
}
} else {
showConnectionLabel( tr("No connection to %1 at <a href=\"%1\">%2</a>.")
.arg(Theme::instance()->appNameGUI(),
_account->url().toString(),
safeUrl.toString()) );
}
} else {
// ownCloud is not yet configured.
showConnectionLabel( tr("No %1 connection configured.").arg(Theme::instance()->appNameGUI()) );
ui->_buttonAdd->setEnabled( false);
}
}
AccountSettings::~AccountSettings()
+6 -9
Ver Arquivo
@@ -23,7 +23,6 @@
#include "mirall/folder.h"
#include "mirall/progressdispatcher.h"
#include "mirall/itemprogressdialog.h"
class QStandardItemModel;
class QModelIndex;
@@ -38,8 +37,8 @@ class AccountSettings;
}
class FolderMan;
class ItemProgressDialog;
class IgnoreListEditor;
class Account;
class AccountSettings : public QWidget
{
@@ -50,11 +49,10 @@ public:
~AccountSettings();
void setFolderList( const Folder::Map& );
void buttonsSetEnabled();
signals:
void folderChanged();
void openProgressDialog();
void openProtocol();
void openFolderAlias( const QString& );
void infoFolderAlias( const QString& );
@@ -62,16 +60,15 @@ public slots:
void slotFolderActivated( const QModelIndex& );
void slotOpenOC();
void slotUpdateFolderState( Folder* );
void slotCheckConnection();
void slotOCInfo( const QString&, const QString&, const QString&, const QString& );
void slotOCInfoFail( QNetworkReply* );
void slotDoubleClicked( const QModelIndex& );
void slotFolderOpenAction( const QString& );
void slotSetProgress(const QString&, const Progress::Info& progress);
void slotProgressProblem(const QString& folder, const Progress::SyncProblem& problem);
void slotButtonsSetEnabled();
void slotUpdateQuota( qint64,qint64 );
void slotIgnoreFilesEditor();
void slotAccountStateChanged(int state);
void setGeneralErrors( const QStringList& errors );
@@ -79,8 +76,8 @@ protected slots:
void slotAddFolder();
void slotAddFolder( Folder* );
void slotEnableCurrentFolder();
void slotSyncCurrentFolderNow();
void slotRemoveCurrentFolder();
void slotInfoAboutCurrentFolder();
void slotResetCurrentFolder();
void slotFolderWizardAccepted();
void slotFolderWizardRejected();
@@ -94,7 +91,6 @@ private:
void showConnectionLabel( const QString& message, const QString& tooltip = QString() );
Ui::AccountSettings *ui;
QPointer<ItemProgressDialog> _fileItemDialog;
QPointer<IgnoreListEditor> _ignoreEditor;
QStandardItemModel *_model;
QUrl _OCUrl;
@@ -102,6 +98,7 @@ private:
QString _kindContext;
QStringList _generalErrors;
bool _wasDisabledBefore;
Account *_account;
};
} // namespace Mirall
+7 -11
Ver Arquivo
@@ -43,7 +43,7 @@
<item row="0" column="0" colspan="2">
<widget class="QGroupBox" name="syncStatusGroupBox">
<property name="title">
<string>Sync Status</string>
<string>Account to Synchronize</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
@@ -59,21 +59,21 @@
<item row="1" column="1">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QPushButton" name="_ButtonAdd">
<widget class="QPushButton" name="_buttonAdd">
<property name="text">
<string>Add Folder...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="_ButtonEnable">
<widget class="QPushButton" name="_buttonEnable">
<property name="text">
<string>Pause</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="_ButtonRemove">
<widget class="QPushButton" name="_buttonRemove">
<property name="text">
<string>Remove</string>
</property>
@@ -92,13 +92,6 @@
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="_ButtonInfo">
<property name="text">
<string>Info...</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
@@ -121,6 +114,9 @@
<property name="value">
<number>-1</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
</widget>
</item>
<item>
+119 -564
Ver Arquivo
@@ -19,24 +19,18 @@
#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/networklocation.h"
#include "mirall/folder.h"
#include "mirall/owncloudsetupwizard.h"
#include "mirall/owncloudinfo.h"
#include "mirall/sslerrordialog.h"
#include "mirall/theme.h"
#include "mirall/mirallconfigfile.h"
#include "mirall/updatedetector.h"
#include "mirall/logger.h"
#include "mirall/settingsdialog.h"
#include "mirall/itemprogressdialog.h"
#include "mirall/utility.h"
#include "mirall/inotify.h"
#include "mirall/connectionvalidator.h"
#include "mirall/socketapi.h"
#include "mirall/account.h"
#include "creds/abstractcredentials.h"
@@ -44,26 +38,14 @@
#include <windows.h>
#endif
#include <QtCore>
#include <QtGui>
#include <QHash>
#include <QHashIterator>
#include <QUrl>
#include <QDesktopServices>
#include <QTranslator>
#include <QNetworkProxy>
#include <QNetworkProxyFactory>
#include <QMenu>
#include <QMessageBox>
namespace Mirall {
// application logging handler.
void mirallLogCatcher(QtMsgType type, const char *msg)
{
Q_UNUSED(type)
// qDebug() exports to local8Bit, which is not always UTF-8
Logger::instance()->mirallLog( QString::fromLocal8Bit(msg) );
}
namespace {
static const char optionsC[] =
@@ -87,7 +69,7 @@ QString applicationTrPath()
#ifdef Q_OS_MAC
return QApplication::applicationDirPath()+QLatin1String("/../Resources/Translations"); // path defaults to app dir.
#endif
#ifdef Q_OS_WIN32
#ifdef Q_OS_WIN
return QApplication::applicationDirPath();
#endif
}
@@ -97,18 +79,14 @@ QString applicationTrPath()
Application::Application(int &argc, char **argv) :
SharedTools::QtSingleApplication(argc, argv),
_tray(0),
_networkMgr(new QNetworkConfigurationManager(this)),
_sslErrorDialog(0),
_contextMenu(0),
_recentActionsMenu(0),
_gui(0),
_theme(Theme::instance()),
_logBrowser(0),
_helpOnly(false),
_startupNetworkError(false),
_logExpire(0),
_showLogWindow(false),
_logExpire(0),
_logFlush(false),
_helpOnly(false)
_userTriggeredConnect(false)
{
setApplicationName( _theme->appNameGUI() );
setWindowIcon( _theme->applicationIcon() );
@@ -117,57 +95,47 @@ Application::Application(int &argc, char **argv) :
//no need to waste time;
if ( _helpOnly ) return;
setupLogBrowser();
initialize();
if (isRunning())
return;
setupLogging();
setupTranslations();
connect( this, SIGNAL(messageReceived(QString)), SLOT(slotParseOptions(QString)));
connect( Logger::instance(), SIGNAL(guiLog(QString,QString)),
this, SLOT(slotShowTrayMessage(QString,QString)));
connect( Logger::instance(), SIGNAL(optionalGuiLog(QString,QString)),
this, SLOT(slotShowOptionalTrayMessage(QString,QString)));
connect( Logger::instance(), SIGNAL(guiMessage(QString,QString)),
this, SLOT(slotShowGuiMessage(QString,QString)));
ProgressDispatcher *pd = ProgressDispatcher::instance();
connect( pd, SIGNAL(progressInfo(QString,Progress::Info)), this,
SLOT(slotUpdateProgress(QString,Progress::Info)) );
connect( pd, SIGNAL(progressSyncProblem(QString,Progress::SyncProblem)),
SLOT(slotProgressSyncProblem(QString,Progress::SyncProblem)));
Account *account = Account::restore();
if (account) {
account->setSslErrorHandler(new SslDialogErrorHandler);
AccountManager::instance()->setAccount(account);
}
// create folder manager for sync folder management
FolderMan *folderMan = FolderMan::instance();
connect( folderMan, SIGNAL(folderSyncStateChange(QString)),
this,SLOT(slotSyncStateChange(QString)));
folderMan->setSyncEnabled(false);
/* use a signal mapper to map the open requests to the alias names */
_folderOpenActionMapper = new QSignalMapper(this);
connect(_folderOpenActionMapper, SIGNAL(mapped(const QString &)),
this, SLOT(slotFolderOpenAction(const QString &)));
FolderMan::instance()->setSyncEnabled(false);
setQuitOnLastWindowClosed(false);
qRegisterMetaType<Progress::Kind>("Progress::Kind");
qRegisterMetaType<Progress::Info>("Progress::Info");
#if 0
qDebug() << "* Network is" << (_networkMgr->isOnline() ? "online" : "offline");
foreach (const QNetworkConfiguration& netCfg, _networkMgr->allConfigurations(QNetworkConfiguration::Active)) {
//qDebug() << "Network:" << netCfg.identifier();
}
#endif
// connect(_networkMgr, SIGNAL(onlineStateChanged(bool)), SLOT(slotCheckConnection()));
qRegisterMetaType<Progress::SyncProblem>("Progress::SyncProblem");
MirallConfigFile cfg;
_theme->setSystrayUseMonoIcons(cfg.monoIcons());
connect (_theme, SIGNAL(systrayUseMonoIconsChanged(bool)), SLOT(slotUseMonoIconsChanged(bool)));
setupActions();
setupSystemTray();
folderMan->setupFolders();
FolderMan::instance()->setupFolders();
slotSetupProxy(); // folders have to be defined first.
_gui = new ownCloudGui(this);
if( _showLogWindow ) {
_gui->slotToggleLogBrowser(); // _showLogWindow is set in parseOptions.
}
connect( _gui, SIGNAL(setupProxy()), SLOT(slotSetupProxy()));
if (account) {
connect(account, SIGNAL(stateChanged(int)), _gui, SLOT(slotAccountStateChanged()));
}
connect(AccountManager::instance(), SIGNAL(accountChanged(Account*,Account*)),
this, SLOT(slotAccountChanged(Account*,Account*)));
// startup procedure.
QTimer::singleShot( 0, this, SLOT( slotCheckConnection() ));
@@ -175,20 +143,61 @@ Application::Application(int &argc, char **argv) :
QTimer::singleShot( 3000, this, SLOT( slotStartUpdateDetector() ));
}
connect( ownCloudInfo::instance(), SIGNAL(sslFailed(QNetworkReply*, QList<QSslError>)),
this,SLOT(slotSSLFailed(QNetworkReply*, QList<QSslError>)));
connect( ownCloudInfo::instance(), SIGNAL(quotaUpdated(qint64,qint64)),
SLOT(slotRefreshQuotaDisplay(qint64, qint64)));
connect (this, SIGNAL(aboutToQuit()), SLOT(slotCleanup()));
qDebug() << "Network Location: " << NetworkLocation::currentLocation().encoded();
_socketApi = new SocketApi(this, cfg.configPathWithAppName().append(QLatin1String("socket")));
}
Application::~Application()
{
qDebug() << "* Mirall shutdown";
// qDebug() << "* Mirall shutdown";
}
void Application::slotLogin()
{
Account *a = AccountManager::instance()->account();
if (a) {
FolderMan::instance()->setupFolders();
_userTriggeredConnect = true;
slotCheckConnection();
}
}
void Application::slotLogout()
{
Account *a = AccountManager::instance()->account();
if (a) {
// invalidate & forget token/password
a->credentials()->invalidateToken(a);
// terminate all syncs and unload folders
FolderMan *folderMan = FolderMan::instance();
folderMan->setSyncEnabled(false);
folderMan->terminateSyncProcess();
folderMan->unloadAllFolders();
a->setState(Account::SignedOut);
// show result
_gui->slotComputeOverallSyncStatus();
}
}
void Application::slotAccountChanged(Account *newAccount, Account *oldAccount)
{
disconnect(oldAccount, SIGNAL(stateChanged(int)), _gui, SLOT(slotAccountStateChanged()));
connect(newAccount, SIGNAL(stateChanged(int)), _gui, SLOT(slotAccountStateChanged()));
}
void Application::slotCleanup()
{
// explicitly close windows. This is somewhat of a hack to ensure
// that saving the geometries happens ASAP during a OS shutdown
Account *account = AccountManager::instance()->account();
if (account) {
account->save();
}
_gui->slotShutdown();
_gui->deleteLater();
}
void Application::slotStartUpdateDetector()
@@ -199,52 +208,35 @@ void Application::slotStartUpdateDetector()
void Application::slotCheckConnection()
{
if( checkConfigExists(false) ) {
MirallConfigFile cfg;
AbstractCredentials* credentials(cfg.getCredentials());
Account *account = AccountManager::instance()->account();
if( account ) {
AbstractCredentials* credentials(account->credentials());
if (! credentials->ready()) {
connect( credentials, SIGNAL(fetched()),
this, SLOT(slotCredentialsFetched()));
credentials->fetch();
credentials->fetch(account);
} else {
runValidator();
}
} else {
// the call to checkConfigExists opens the setup wizard
// if the config does not exist. Nothing to do here.
// let gui open the setup wizard
_gui->slotOpenSettingsDialog( true );
}
}
void Application::slotCredentialsFetched()
{
MirallConfigFile cfg;
AbstractCredentials* credentials(cfg.getCredentials());
disconnect(credentials, SIGNAL(fetched()),
Account *account = AccountManager::instance()->account();
disconnect(account->credentials(), SIGNAL(fetched()),
this, SLOT(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();
_conValidator = new ConnectionValidator(AccountManager::instance()->account());
connect( _conValidator, SIGNAL(connectionResult(ConnectionValidator::Status)),
this, SLOT(slotConnectionValidatorResult(ConnectionValidator::Status)) );
_conValidator->checkConnection();
@@ -253,69 +245,40 @@ void Application::runValidator()
void Application::slotConnectionValidatorResult(ConnectionValidator::Status status)
{
qDebug() << "Connection Validator Result: " << _conValidator->statusString(status);
QStringList startupFails;
if( status == ConnectionValidator::Connected ) {
FolderMan *folderMan = FolderMan::instance();
qDebug() << "######## Connection and Credentials are ok!";
folderMan->setSyncEnabled(true);
int cnt = folderMan->map().size();
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();
if(!_connectionMsgBox.isNull()) {
_connectionMsgBox->close();
}
} else {
// if we have problems here, it's unlikely that syncing will work.
FolderMan::instance()->setSyncEnabled(false);
_startupFail = _conValidator->errors();
startupFails = _conValidator->errors();
_startupNetworkError = _conValidator->networkError();
if (_userTriggeredConnect) {
if(_connectionMsgBox.isNull()) {
_connectionMsgBox = new QMessageBox(QMessageBox::Warning, tr("Connection failed"),
_conValidator->errors().join(". ").append('.'), QMessageBox::Ok, 0);
_connectionMsgBox->setAttribute(Qt::WA_DeleteOnClose);
_connectionMsgBox->open();
_userTriggeredConnect = false;
}
}
QTimer::singleShot(30*1000, this, SLOT(slotCheckConnection()));
}
computeOverallSyncStatus();
setupContextMenu();
_gui->startupConnected( (status == ConnectionValidator::Connected), startupFails);
_conValidator->deleteLater();
}
void Application::slotSSLFailed( QNetworkReply *reply, QList<QSslError> errors )
{
qDebug() << "SSL-Warnings happened for url " << reply->url().toString();
if( ownCloudInfo::instance()->certsUntrusted() ) {
// User decided once to untrust. Honor this decision.
qDebug() << "Untrusted by user decision, returning.";
return;
}
QString configHandle = ownCloudInfo::instance()->configHandle(reply);
// make the ssl dialog aware of the custom config. It loads known certs.
if( ! _sslErrorDialog ) {
_sslErrorDialog = new SslErrorDialog;
}
_sslErrorDialog->setCustomConfigHandle( configHandle );
if( _sslErrorDialog->setErrorList( errors ) ) {
// all ssl certs are known and accepted. We can ignore the problems right away.
qDebug() << "Certs are already known and trusted, Warnings are not valid.";
reply->ignoreSslErrors();
} else {
if( _sslErrorDialog->exec() == QDialog::Accepted ) {
if( _sslErrorDialog->trustConnection() ) {
reply->ignoreSslErrors();
} else {
// User does not want to trust.
ownCloudInfo::instance()->setCertsUntrusted(true);
}
} else {
ownCloudInfo::instance()->setCertsUntrusted(true);
}
}
}
void Application::slotownCloudWizardDone( int res )
{
FolderMan *folderMan = FolderMan::instance();
@@ -334,126 +297,15 @@ void Application::slotownCloudWizardDone( int res )
}
void Application::setupActions()
{
_actionOpenoC = new QAction(tr("Open %1 in browser").arg(_theme->appNameGUI()), this);
QObject::connect(_actionOpenoC, SIGNAL(triggered(bool)), SLOT(slotOpenOwnCloud()));
_actionQuota = new QAction(tr("Calculating quota..."), this);
_actionQuota->setEnabled( false );
_actionStatus = new QAction(tr("Unknown status"), this);
_actionStatus->setEnabled( false );
_actionSettings = new QAction(tr("Settings..."), this);
_actionRecent = new QAction(tr("Details..."), this);
_actionRecent->setEnabled( true );
QObject::connect(_actionRecent, SIGNAL(triggered(bool)), SLOT(slotItemProgressDialog()));
QObject::connect(_actionSettings, SIGNAL(triggered(bool)), SLOT(slotSettings()));
_actionHelp = new QAction(tr("Help"), this);
QObject::connect(_actionHelp, SIGNAL(triggered(bool)), SLOT(slotHelp()));
_actionQuit = new QAction(tr("Quit %1").arg(_theme->appNameGUI()), this);
QObject::connect(_actionQuit, SIGNAL(triggered(bool)), SLOT(quit()));
}
void Application::setupSystemTray()
{
// Setting a parent heres will crash on X11 since by the time qapp runs
// its childrens dtors, the X11->screen variable queried for is gone -> crash
_tray = new Systray();
_tray->setIcon( _theme->syncStateIcon( SyncResult::NotYetStarted, true ) );
connect(_tray.data(), SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
SLOT(slotTrayClicked(QSystemTrayIcon::ActivationReason)));
setupContextMenu();
_tray->show();
}
void Application::setupContextMenu()
{
bool isConfigured = ownCloudInfo::instance()->isConfigured();
FolderMan *folderMan = FolderMan::instance();
_actionOpenoC->setEnabled(isConfigured);
if( _contextMenu ) {
_contextMenu->clear();
_recentActionsMenu->clear();
_recentActionsMenu->addAction(tr("None."));
_recentActionsMenu->addAction(_actionRecent);
} else {
_contextMenu = new QMenu();
_recentActionsMenu = _contextMenu->addMenu(tr("Recent Changes"));
// this must be called only once after creating the context menu, or
// it will trigger a bug in Ubuntu's SNI bridge patch (11.10, 12.04).
_tray->setContextMenu(_contextMenu);
}
_contextMenu->setTitle(_theme->appNameGUI() );
_contextMenu->addAction(_actionOpenoC);
int folderCnt = folderMan->map().size();
// add open actions for all sync folders to the tray menu
if( _theme->singleSyncFolder() ) {
// there should be exactly one folder. No sync-folder add action will be shown.
QStringList li = folderMan->map().keys();
if( li.size() == 1 ) {
Folder *folder = folderMan->map().value(li.first());
if( folder ) {
// if there is singleFolder mode, a generic open action is displayed.
QAction *action = new QAction( tr("Open %1 folder").arg(_theme->appNameGUI()), this);
connect( action, SIGNAL(triggered()),_folderOpenActionMapper,SLOT(map()));
_folderOpenActionMapper->setMapping( action, folder->alias() );
_contextMenu->addAction(action);
}
}
} else {
// show a grouping with more than one folder.
if ( folderCnt > 1) {
_contextMenu->addAction(tr("Managed Folders:"))->setDisabled(true);
}
foreach (Folder *folder, folderMan->map() ) {
QAction *action = new QAction( tr("Open folder '%1'").arg(folder->alias()), this );
connect( action, SIGNAL(triggered()),_folderOpenActionMapper,SLOT(map()));
_folderOpenActionMapper->setMapping( action, folder->alias() );
_contextMenu->addAction(action);
}
}
_contextMenu->addSeparator();
_contextMenu->addAction(_actionQuota);
_contextMenu->addSeparator();
_contextMenu->addAction(_actionStatus);
_contextMenu->addMenu(_recentActionsMenu);
_contextMenu->addSeparator();
_contextMenu->addAction(_actionSettings);
if (!_theme->helpUrl().isEmpty()) {
_contextMenu->addAction(_actionHelp);
}
_contextMenu->addSeparator();
_contextMenu->addAction(_actionQuit);
}
void Application::setupLogBrowser()
void Application::setupLogging()
{
// might be called from second instance
if (_logBrowser.isNull()) {
// init the log browser.
qInstallMsgHandler( mirallLogCatcher );
_logBrowser = new LogBrowser;
// ## TODO: allow new log name maybe?
if (!_logDirectory.isEmpty()) {
enterNextLogFile();
} else if (!_logFile.isEmpty()) {
qDebug() << "Logging into logfile: " << _logFile << " with flush " << _logFlush;
_logBrowser->setLogFile( _logFile, _logFlush );
}
}
Logger::instance()->setLogFile(_logFile);
Logger::instance()->setLogDir(_logDir);
Logger::instance()->setLogExpire(_logExpire);
Logger::instance()->setLogFlush(_logFlush);
if (_showLogWindow)
slotOpenLogBrowser();
Logger::instance()->enterNextLogFile();
qDebug() << QString::fromLatin1( "################## %1 %2 (%3) %4").arg(_theme->appName())
.arg( QLocale::system().name() )
@@ -462,37 +314,6 @@ void Application::setupLogBrowser()
}
void Application::enterNextLogFile()
{
if (_logBrowser && !_logDirectory.isEmpty()) {
QDir dir(_logDirectory);
if (!dir.exists()) {
dir.mkpath(".");
}
// Find out what is the file with the highest nymber if any
QStringList files = dir.entryList(QStringList("owncloud.log.*"),
QDir::Files);
QRegExp rx("owncloud.log.(\\d+)");
uint maxNumber = 0;
QDateTime now = QDateTime::currentDateTime();
foreach(const QString &s, files) {
if (rx.exactMatch(s)) {
maxNumber = qMax(maxNumber, rx.cap(1).toUInt());
if (_logExpire > 0) {
QFileInfo fileInfo = dir.absoluteFilePath(s);
if (fileInfo.lastModified().addSecs(60*60 * _logExpire) < now) {
dir.remove(s);
}
}
}
}
QString filename = _logDirectory + "/owncloud.log." + QString::number(maxNumber+1);
_logBrowser->setLogFile(filename , _logFlush);
}
}
QNetworkProxy proxyFromConfig(const MirallConfigFile& cfg)
{
QNetworkProxy proxy;
@@ -541,240 +362,16 @@ void Application::slotSetupProxy()
FolderMan::instance()->slotScheduleAllFolders();
}
void Application::slotRefreshQuotaDisplay( qint64 total, qint64 used )
{
if (total == 0) {
_actionQuota->setText(tr("Quota n/a"));
return;
}
double percent = used/(double)total*100;
QString percentFormatted = Utility::compactFormatDouble(percent, 1);
QString totalFormatted = Utility::octetsToString(total);
_actionQuota->setText(tr("%1% of %2 in use").arg(percentFormatted).arg(totalFormatted));
}
void Application::slotUseMonoIconsChanged(bool)
{
computeOverallSyncStatus();
}
void Application::slotProgressSyncProblem(const QString& folder, const Progress::SyncProblem& problem)
{
Q_UNUSED(folder);
Q_UNUSED(problem);
// display a warn icon if warnings happend.
QIcon warnIcon(":/mirall/resources/warning-16");
_actionRecent->setIcon(warnIcon);
rebuildRecentMenus();
}
void Application::rebuildRecentMenus()
{
_recentActionsMenu->clear();
const QList<Progress::Info>& progressInfoList = ProgressDispatcher::instance()->recentChangedItems(5);
if( progressInfoList.size() == 0 ) {
_recentActionsMenu->addAction(tr("No items synced recently"));
} else {
QListIterator<Progress::Info> i(progressInfoList);
while(i.hasNext()) {
Progress::Info info = i.next();
QString kindStr = Progress::asResultString(info.kind);
QString timeStr = info.timestamp.toString("hh:mm");
QString actionText = tr("%1 (%2, %3)").arg(info.current_file).arg(kindStr).arg(timeStr);
_recentActionsMenu->addAction( actionText );
}
}
// add a more... entry.
_recentActionsMenu->addAction(_actionRecent);
}
void Application::slotUpdateProgress(const QString &folder, const Progress::Info& progress)
{
Q_UNUSED(folder);
// shows an entry in the context menu.
QString curAmount = Utility::octetsToString(progress.overall_current_bytes);
QString totalAmount = Utility::octetsToString(progress.overall_transmission_size);
_actionStatus->setText(tr("Syncing %1 of %2 (%3 of %4) ").arg(progress.current_file_no)
.arg(progress.overall_file_count).arg(curAmount, totalAmount));
// wipe the problem list at start of sync.
if( progress.kind == Progress::StartSync ) {
_actionRecent->setIcon( QIcon() ); // Fixme: Set a "in-progress"-item eventually.
}
// If there was a change in the file list, redo the progress menu.
if( progress.kind == Progress::EndDownload || progress.kind == Progress::EndUpload ||
progress.kind == Progress::EndDelete ) {
rebuildRecentMenus();
}
if (progress.kind == Progress::EndSync) {
rebuildRecentMenus(); // show errors.
QTimer::singleShot(2000, this, SLOT(slotDisplayIdle()));
}
}
void Application::slotDisplayIdle()
{
_actionStatus->setText(tr("Up to date"));
}
void Application::slotHelp()
{
QDesktopServices::openUrl(QUrl(_theme->helpUrl()));
}
/*
* open the folder with the given Alais
*/
void Application::slotFolderOpenAction( const QString& alias )
{
Folder *f = FolderMan::instance()->folder(alias);
qDebug() << "opening local url " << f->path();
if( f ) {
QUrl url(f->path(), QUrl::TolerantMode);
url.setScheme( QLatin1String("file") );
#ifdef Q_OS_WIN32
// work around a bug in QDesktopServices on Win32, see i-net
QString filePath = f->path();
if (filePath.startsWith(QLatin1String("\\\\")) || filePath.startsWith(QLatin1String("//")))
url.setUrl(QDir::toNativeSeparators(filePath));
else
url = QUrl::fromLocalFile(filePath);
#endif
QDesktopServices::openUrl(url);
}
}
void Application::slotOpenOwnCloud()
{
MirallConfigFile cfgFile;
QString url = cfgFile.ownCloudUrl();
QDesktopServices::openUrl( url );
}
void Application::slotTrayClicked( QSystemTrayIcon::ActivationReason reason )
{
// A click on the tray icon should only open the status window on Win and
// Linux, not on Mac. They want a menu entry.
#if defined Q_WS_WIN || defined Q_WS_X11
if( reason == QSystemTrayIcon::Trigger ) {
checkConfigExists(true); // start settings if config is existing.
}
#endif
}
bool Application::checkConfigExists(bool openSettings)
{
// if no config file is there, start the configuration wizard.
MirallConfigFile cfgFile;
if( cfgFile.exists() && !cfgFile.ownCloudUrl().isEmpty() ) {
if( openSettings ) {
slotSettings();
}
return true;
} else {
qDebug() << "No configured folders yet, starting setup wizard";
OwncloudSetupWizard::runWizard(this, SLOT(slotownCloudWizardDone(int)));
return false;
}
}
void Application::slotOpenLogBrowser()
{
_logBrowser->show();
_logBrowser->raise();
}
// slot hit when a folder gets changed in the settings dialog.
void Application::slotFoldersChanged()
{
computeOverallSyncStatus();
setupContextMenu();
}
void Application::slotSettings()
{
if (_settingsDialog.isNull()) {
_settingsDialog = new SettingsDialog(this);
_settingsDialog->setAttribute( Qt::WA_DeleteOnClose, true );
_settingsDialog->show();
}
_settingsDialog->setGeneralErrors( _startupFail );
Utility::raiseDialog(_settingsDialog.data());
}
void Application::slotItemProgressDialog()
{
if (_progressDialog.isNull()) {
_progressDialog = new ItemProgressDialog(this);
_progressDialog->setAttribute( Qt::WA_DeleteOnClose, true );
_progressDialog->setupList();
_progressDialog->show();
}
Utility::raiseDialog(_progressDialog.data());
_gui->slotComputeOverallSyncStatus();
}
void Application::slotParseOptions(const QString &opts)
{
QStringList options = opts.split(QLatin1Char('|'));
parseOptions(options);
setupLogBrowser();
}
void Application::slotShowTrayMessage(const QString &title, const QString &msg)
{
if( _tray )
_tray->showMessage(title, msg);
else
qDebug() << "Tray not ready: " << msg;
}
void Application::slotShowOptionalTrayMessage(const QString &title, const QString &msg)
{
MirallConfigFile cfg;
if (cfg.optionalDesktopNotifications())
slotShowTrayMessage(title, msg);
}
void Application::slotShowGuiMessage(const QString &title, const QString &message)
{
QMessageBox *msgBox = new QMessageBox;
msgBox->setAttribute(Qt::WA_DeleteOnClose);
msgBox->setText(message);
msgBox->setWindowTitle(title);
msgBox->setIcon(QMessageBox::Information);
msgBox->open();
}
void Application::slotSyncStateChange( const QString& alias )
{
FolderMan *folderMan = FolderMan::instance();
const SyncResult& result = folderMan->syncResult( alias );
emit folderStateChanged( folderMan->folder(alias) );
computeOverallSyncStatus();
qDebug() << "Sync state changed for folder " << alias << ": " << result.statusString();
if (result.status() == SyncResult::Success || result.status() == SyncResult::Error) {
enterNextLogFile();
}
if( _progressDialog ) {
_progressDialog->setSyncResult(result);
}
setupLogging();
}
void Application::parseOptions(const QStringList &options)
@@ -790,17 +387,17 @@ void Application::parseOptions(const QStringList &options)
setHelp();
break;
} else if (option == QLatin1String("--logwindow") ||
option == QLatin1String("-l")) {
option == QLatin1String("-l")) {
_showLogWindow = true;
} else if (option == QLatin1String("--logfile")) {
if (it.hasNext() && !it.peekNext().startsWith(QLatin1String("--"))) {
_logFile = it.next();
_logFile = it.next();
} else {
setHelp();
}
} else if (option == QLatin1String("--logdir")) {
if (it.hasNext() && !it.peekNext().startsWith(QLatin1String("--"))) {
_logDirectory = it.next();
_logDir = it.next();
} else {
setHelp();
}
@@ -823,48 +420,6 @@ void Application::parseOptions(const QStringList &options)
setHelp();
break;
}
}
}
void Application::computeOverallSyncStatus()
{
// display the info of the least successful sync (eg. not just display the result of the latest sync
QString trayMessage;
FolderMan *folderMan = FolderMan::instance();
Folder::Map map = folderMan->map();
SyncResult overallResult = FolderMan::accountStatus(map.values());
// 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 );
}
_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);
}
}
}
@@ -907,7 +462,7 @@ void Application::showHelp()
<< QLatin1String(optionsC);
if (_theme->appName() == QLatin1String("ownCloud"))
stream << endl << "For more information, see http://www.owncloud.org" << endl;
stream << endl << "For more information, see http://www.owncloud.org" << endl << endl;
displayHelpText(helpText);
}
+20 -63
Ver Arquivo
@@ -16,8 +16,6 @@
#define APPLICATION_H
#include <QApplication>
#include <QNetworkReply>
#include <QSslError>
#include <QPointer>
#include <QQueue>
@@ -25,25 +23,18 @@
#include "mirall/syncresult.h"
#include "mirall/logbrowser.h"
#include "mirall/systray.h"
#include "mirall/owncloudgui.h"
#include "mirall/connectionvalidator.h"
#include "mirall/progressdispatcher.h"
class QAction;
class QMenu;
class QMessageBox;
class QSystemTrayIcon;
class QNetworkConfigurationManager;
class QSignalMapper;
class QNetworkReply;
namespace Mirall {
class Theme;
class Folder;
class FolderWatcher;
class ownCloudInfo;
class SslErrorDialog;
class SettingsDialog;
class ItemProgressDialog;
class SocketApi;
class Application : public SharedTools::QtSingleApplication
{
@@ -62,16 +53,10 @@ public slots:
protected:
void parseOptions(const QStringList& );
void setupTranslations();
void setupActions();
void setupSystemTray();
void setupContextMenu();
void setupLogBrowser();
void setupLogging();
void enterNextLogFile();
bool checkConfigExists(bool openSettings);
//folders have to be disabled while making config changes
void computeOverallSyncStatus();
// reimplemented
#if defined(Q_WS_WIN)
bool winEventFilter( MSG * message, long * result );
@@ -82,70 +67,42 @@ signals:
void folderStateChanged(Folder*);
protected slots:
void slotFoldersChanged();
void slotSettings();
void slotItemProgressDialog();
void slotParseOptions( const QString& );
void slotShowTrayMessage(const QString&, const QString&);
void slotShowOptionalTrayMessage(const QString&, const QString&);
void slotShowGuiMessage(const QString& title, const QString& message);
void slotCheckConnection();
void slotConnectionValidatorResult(ConnectionValidator::Status);
void slotSyncStateChange( const QString& );
void slotTrayClicked( QSystemTrayIcon::ActivationReason );
void slotFolderOpenAction(const QString & );
void slotOpenOwnCloud();
void slotOpenLogBrowser();
void slotSSLFailed( QNetworkReply *reply, QList<QSslError> errors );
void slotStartUpdateDetector();
void slotSetupProxy();
void slotRefreshQuotaDisplay( qint64 total, qint64 used );
void slotUseMonoIconsChanged( bool );
void slotUpdateProgress(const QString&, const Progress::Info&);
void slotProgressSyncProblem(const QString& folder, const Progress::SyncProblem &problem);
void slotDisplayIdle();
void slotHelp();
void slotCredentialsFetched();
void slotLogin();
void slotLogout();
void slotCleanup();
void slotAccountChanged(Account *newAccount, Account *oldAccount);
private:
void setHelp();
void raiseDialog( QWidget* );
void rebuildRecentMenus();
void runValidator();
QPointer<Systray> _tray;
QAction *_actionOpenoC;
QAction *_actionSettings;
QAction *_actionQuota;
QAction *_actionStatus;
QAction *_actionRecent;
QAction *_actionHelp;
QAction *_actionQuit;
QPointer<ownCloudGui> _gui;
QPointer<SocketApi> _socketApi;
QNetworkConfigurationManager *_networkMgr;
SslErrorDialog *_sslErrorDialog;
ConnectionValidator *_conValidator;
// tray's menu
QMenu *_contextMenu;
QMenu *_recentActionsMenu;
Theme *_theme;
QSignalMapper *_folderOpenActionMapper;
QPointer<LogBrowser>_logBrowser;
QPointer<SettingsDialog> _settingsDialog;
QPointer<ItemProgressDialog> _progressDialog;
QString _logFile;
QString _logDirectory;
QStringList _startupFail;
bool _helpOnly;
bool _startupNetworkError;
int _logExpire;
// options from command line:
bool _showLogWindow;
bool _logFlush;
bool _helpOnly;
QString _logFile;
QString _logDir;
int _logExpire;
bool _logFlush;
bool _userTriggeredConnect;
QPointer<QMessageBox> _connectionMsgBox;
friend class ownCloudGui; // for _startupNetworkError
};
} // namespace Mirall
+46 -51
Ver Arquivo
@@ -12,26 +12,21 @@
*/
#include <QtCore>
#include <QNetworkReply>
#include "mirall/connectionvalidator.h"
#include "mirall/owncloudinfo.h"
#include "mirall/mirallconfigfile.h"
#include "mirall/theme.h"
#include "mirall/account.h"
#include "mirall/networkjobs.h"
namespace Mirall {
ConnectionValidator::ConnectionValidator(QObject *parent) :
QObject(parent)
{
}
ConnectionValidator::ConnectionValidator(const QString& connection, QObject *parent)
ConnectionValidator::ConnectionValidator(Account *account, QObject *parent)
: QObject(parent),
_connection(connection),
_account(account),
_networkError(QNetworkReply::NoError)
{
ownCloudInfo::instance()->setCustomConfigHandle(_connection);
}
QStringList ConnectionValidator::errors() const
@@ -85,37 +80,28 @@ QString ConnectionValidator::statusString( Status stat ) const
void ConnectionValidator::checkConnection()
{
if( ownCloudInfo::instance()->isConfigured() ) {
connect( ownCloudInfo::instance(),SIGNAL(ownCloudInfoFound(QString,QString,QString,QString)),
SLOT(slotStatusFound(QString,QString,QString,QString)));
connect( ownCloudInfo::instance(),SIGNAL(noOwncloudFound(QNetworkReply*)),
SLOT(slotNoStatusFound(QNetworkReply*)));
// checks for status.php
ownCloudInfo::instance()->checkInstallation();
if( _account ) {
CheckServerJob *checkJob = new CheckServerJob(_account, false, this);
checkJob->setIgnoreCredentialFailure(true);
connect(checkJob, SIGNAL(instanceFound(QUrl,QVariantMap)), SLOT(slotStatusFound(QUrl,QVariantMap)));
connect(checkJob, SIGNAL(networkError(QNetworkReply*)), SLOT(slotNoStatusFound(QNetworkReply*)));
checkJob->start();
} else {
_errors << tr("No ownCloud connection configured");
_errors << tr("No ownCloud account configured");
emit connectionResult( NotConfigured );
}
}
void ConnectionValidator::slotStatusFound( const QString& url, const QString& versionStr, const QString& version, const QString& /*edition*/)
void ConnectionValidator::slotStatusFound(const QUrl&url, const QVariantMap &info)
{
// status.php was found.
qDebug() << "** Application: ownCloud found: " << url << " with version " << versionStr << "(" << version << ")";
qDebug() << "** Application: ownCloud found: "
<< url << " with version "
<< CheckServerJob::versionString(info)
<< "(" << CheckServerJob::version(info) << ")";
// now check the authentication
MirallConfigFile cfgFile(_connection);
cfgFile.setOwnCloudVersion( version );
// disconnect from ownCloudInfo
disconnect( ownCloudInfo::instance(),SIGNAL(ownCloudInfoFound(QString,QString,QString,QString)),
this, SLOT(slotStatusFound(QString,QString,QString,QString)));
disconnect( ownCloudInfo::instance(),SIGNAL(noOwncloudFound(QNetworkReply*)),
this, SLOT(slotNoStatusFound(QNetworkReply*)));
if( version.startsWith("4.0") ) {
if( CheckServerJob::version(info).startsWith("4.0") ) {
_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 );
@@ -128,13 +114,10 @@ void ConnectionValidator::slotStatusFound( const QString& url, const QString& ve
// status.php could not be loaded.
void ConnectionValidator::slotNoStatusFound(QNetworkReply *reply)
{
// disconnect from ownCloudInfo
disconnect( ownCloudInfo::instance(),SIGNAL(ownCloudInfoFound(QString,QString,QString,QString)),
this, SLOT(slotStatusFound(QString,QString,QString,QString)));
disconnect( ownCloudInfo::instance(),SIGNAL(noOwncloudFound(QNetworkReply*)),
this, SLOT(slotNoStatusFound(QNetworkReply*)));
_account->setState(Account::Disconnected);
// ### TODO
_errors.append(tr("Unable to connect to %1").arg(_account->url().toString()));
_errors.append( reply->errorString() );
_networkError = (reply->error() != QNetworkReply::NoError);
emit connectionResult( StatusNotFound );
@@ -143,34 +126,46 @@ void ConnectionValidator::slotNoStatusFound(QNetworkReply *reply)
void ConnectionValidator::slotCheckAuthentication()
{
connect( ownCloudInfo::instance(), SIGNAL(ownCloudDirExists(QString,QNetworkReply*)),
this, SLOT(slotAuthCheck(QString,QNetworkReply*)));
qDebug() << "# checking for authentication settings.";
ownCloudInfo::instance()->getWebDAVPath(QLatin1String("/") ); // this call needs to be authenticated.
// simply GET the webdav root, will fail if credentials are wrong.
// continue in slotAuthCheck here :-)
PropfindJob *job = new PropfindJob(_account, "/", this);
job->setIgnoreCredentialFailure(true);
job->setProperties(QList<QByteArray>() << "getlastmodified");
connect(job, SIGNAL(result(QVariantMap)), SLOT(slotAuthSuccess()));
connect(job, SIGNAL(networkError(QNetworkReply*)), SLOT(slotAuthFailed(QNetworkReply*)));
job->start();
qDebug() << "# checking for authentication settings.";
}
void ConnectionValidator::slotAuthCheck( const QString&, QNetworkReply *reply )
void ConnectionValidator::slotAuthFailed(QNetworkReply *reply)
{
Status stat = Connected;
Status stat = StatusNotFound;
if( reply->error() == QNetworkReply::AuthenticationRequiredError ||
reply->error() == QNetworkReply::OperationCanceledError ) { // returned if the user is wrong.
reply->error() == QNetworkReply::OperationCanceledError ) { // returned if the user/pwd is wrong.
qDebug() << reply->error() << reply->errorString();
qDebug() << "******** Password is wrong!";
_errors << tr("The provided credentials are not correct");
stat = CredentialsWrong;
switch (_account->state()) {
case Account::SignedOut:
_account->setState(Account::SignedOut);
break;
default:
_account->setState(Account::Disconnected);
}
} else if( reply->error() != QNetworkReply::NoError ) {
_errors << reply->errorString();
}
// disconnect from ownCloud Info signals
disconnect( ownCloudInfo::instance(),SIGNAL(ownCloudDirExists(QString,QNetworkReply*)),
this,SLOT(slotAuthCheck(QString,QNetworkReply*)));
emit connectionResult( stat );
}
void ConnectionValidator::slotAuthSuccess()
{
_account->setState(Account::Connected);
emit connectionResult(Connected);
}
} // namespace Mirall
+10 -8
Ver Arquivo
@@ -16,17 +16,18 @@
#include <QObject>
#include <QStringList>
class QNetworkReply;
#include <QVariantMap>
#include <QNetworkReply>
namespace Mirall {
class Account;
class ConnectionValidator : public QObject
{
Q_OBJECT
public:
explicit ConnectionValidator(QObject *parent = 0);
explicit ConnectionValidator(const QString& connection, QObject *parent = 0);
explicit ConnectionValidator(Account *account, QObject *parent = 0);
enum Status {
Undefined,
@@ -56,15 +57,16 @@ signals:
public slots:
protected slots:
void slotStatusFound( const QString&, const QString&, const QString&, const QString& );
void slotNoStatusFound(QNetworkReply *);
void slotStatusFound(const QUrl&url, const QVariantMap &info);
void slotNoStatusFound(QNetworkReply *reply);
void slotCheckAuthentication();
void slotAuthCheck( const QString& ,QNetworkReply * );
void slotAuthFailed(QNetworkReply *reply);
void slotAuthSuccess();
private:
QStringList _errors;
QString _connection;
Account *_account;
bool _networkError;
};
+437 -244
Ver Arquivo
@@ -14,10 +14,13 @@
*/
#include "mirall/csyncthread.h"
#include "mirall/account.h"
#include "mirall/mirallconfigfile.h"
#include "mirall/theme.h"
#include "mirall/logger.h"
#include "mirall/owncloudinfo.h"
#include "owncloudpropagator.h"
#include "syncjournaldb.h"
#include "syncjournalfilerecord.h"
#include "creds/abstractcredentials.h"
#ifdef Q_OS_WIN
@@ -42,16 +45,28 @@
namespace Mirall {
/* static variables to hold the credentials */
void csyncLogCatcher(int /*verbosity*/,
const char */*function*/,
const char *buffer,
void */*userdata*/)
{
Logger::instance()->csyncLog( QString::fromUtf8(buffer) );
}
/* static variables to hold the credentials */
QMutex CSyncThread::_mutex;
QMutex CSyncThread::_syncMutex;
CSyncThread::CSyncThread(CSYNC *csync)
CSyncThread::CSyncThread(CSYNC *csync, const QString &localPath, const QString &remotePath, SyncJournalDb *journal)
{
_mutex.lock();
_localPath = localPath;
_remotePath = remotePath;
_csync_ctx = csync;
_journal = journal;
_mutex.unlock();
qRegisterMetaType<SyncFileItem>("SyncFileItem");
qRegisterMetaType<SyncFileItem::Status>("SyncFileItem::Status");
}
CSyncThread::~CSyncThread()
@@ -61,110 +76,175 @@ CSyncThread::~CSyncThread()
//Convert an error code from csync to a user readable string.
// Keep that function thread safe as it can be called from the sync thread or the main thread
QString CSyncThread::csyncErrorToString( CSYNC_ERROR_CODE err, const char *errString )
QString CSyncThread::csyncErrorToString(CSYNC_STATUS err)
{
QString errStr;
switch( err ) {
case CSYNC_ERR_NONE:
case CSYNC_STATUS_OK:
errStr = tr("Success.");
break;
case CSYNC_ERR_LOG:
errStr = tr("CSync Logging setup failed.");
break;
case CSYNC_ERR_LOCK:
case CSYNC_STATUS_NO_LOCK:
errStr = tr("CSync failed to create a lock file.");
break;
case CSYNC_ERR_STATEDB_LOAD:
case CSYNC_STATUS_STATEDB_LOAD_ERROR:
errStr = tr("CSync failed to load the state db.");
break;
case CSYNC_ERR_MODULE:
case CSYNC_STATUS_STATEDB_WRITE_ERROR:
errStr = tr("CSync failed to write the state db.");
break;
case CSYNC_STATUS_NO_MODULE:
errStr = tr("<p>The %1 plugin for csync could not be loaded.<br/>Please verify the installation!</p>").arg(Theme::instance()->appNameGUI());
break;
case CSYNC_ERR_TIMESKEW:
case CSYNC_STATUS_TIMESKEW:
errStr = tr("The system time on this client is different than the system time on the server. "
"Please use a time synchronization service (NTP) on the server and client machines "
"so that the times remain the same.");
break;
case CSYNC_ERR_FILESYSTEM:
case CSYNC_STATUS_FILESYSTEM_UNKNOWN:
errStr = tr("CSync could not detect the filesystem type.");
break;
case CSYNC_ERR_TREE:
case CSYNC_STATUS_TREE_ERROR:
errStr = tr("CSync got an error while processing internal trees.");
break;
case CSYNC_ERR_MEM:
case CSYNC_STATUS_MEMORY_ERROR:
errStr = tr("CSync failed to reserve memory.");
break;
case CSYNC_ERR_PARAM:
case CSYNC_STATUS_PARAM_ERROR:
errStr = tr("CSync fatal parameter error.");
break;
case CSYNC_ERR_UPDATE:
case CSYNC_STATUS_UPDATE_ERROR:
errStr = tr("CSync processing step update failed.");
break;
case CSYNC_ERR_RECONCILE:
case CSYNC_STATUS_RECONCILE_ERROR:
errStr = tr("CSync processing step reconcile failed.");
break;
case CSYNC_ERR_PROPAGATE:
case CSYNC_STATUS_PROPAGATE_ERROR:
errStr = tr("CSync processing step propagate failed.");
break;
case CSYNC_ERR_ACCESS_FAILED:
case CSYNC_STATUS_REMOTE_ACCESS_ERROR:
errStr = tr("<p>The target directory does not exist.</p><p>Please check the sync setup.</p>");
break;
case CSYNC_ERR_REMOTE_CREATE:
case CSYNC_ERR_REMOTE_STAT:
case CSYNC_STATUS_REMOTE_CREATE_ERROR:
case CSYNC_STATUS_REMOTE_STAT_ERROR:
errStr = tr("A remote file can not be written. Please check the remote access.");
break;
case CSYNC_ERR_LOCAL_CREATE:
case CSYNC_ERR_LOCAL_STAT:
case CSYNC_STATUS_LOCAL_CREATE_ERROR:
case CSYNC_STATUS_LOCAL_STAT_ERROR:
errStr = tr("The local filesystem can not be written. Please check permissions.");
break;
case CSYNC_ERR_PROXY:
case CSYNC_STATUS_PROXY_ERROR:
errStr = tr("CSync failed to connect through a proxy.");
break;
case CSYNC_ERR_LOOKUP:
case CSYNC_STATUS_PROXY_AUTH_ERROR:
errStr = tr("CSync could not authenticate at the proxy.");
break;
case CSYNC_STATUS_LOOKUP_ERROR:
errStr = tr("CSync failed to lookup proxy or server.");
break;
case CSYNC_ERR_AUTH_SERVER:
case CSYNC_STATUS_SERVER_AUTH_ERROR:
errStr = tr("CSync failed to authenticate at the %1 server.").arg(Theme::instance()->appNameGUI());
break;
case CSYNC_ERR_AUTH_PROXY:
errStr = tr("CSync failed to authenticate at the proxy.");
break;
case CSYNC_ERR_CONNECT:
case CSYNC_STATUS_CONNECT_ERROR:
errStr = tr("CSync failed to connect to the network.");
break;
case CSYNC_ERR_TIMEOUT:
case CSYNC_STATUS_TIMEOUT:
errStr = tr("A network connection timeout happend.");
break;
case CSYNC_ERR_HTTP:
case CSYNC_STATUS_HTTP_ERROR:
errStr = tr("A HTTP transmission error happened.");
break;
case CSYNC_ERR_PERM:
errStr = tr("CSync: Permission deniend.");
case CSYNC_STATUS_PERMISSION_DENIED:
errStr = tr("CSync failed due to not handled permission deniend.");
break;
case CSYNC_ERR_NOT_FOUND:
errStr = tr("CSync: File not found.");
case CSYNC_STATUS_NOT_FOUND:
errStr = tr("CSync failed to access "); // filename gets added.
break;
case CSYNC_ERR_EXISTS:
errStr = tr("CSync: Directory already exists.");
case CSYNC_STATUS_FILE_EXISTS:
errStr = tr("CSync tried to create a directory that already exists.");
break;
case CSYNC_ERR_NOSPC:
errStr = tr("CSync: No space left on %1 server.").arg(Theme::instance()->appNameGUI());
case CSYNC_STATUS_OUT_OF_SPACE:
errStr = tr("CSync: No space on %1 server available.").arg(Theme::instance()->appNameGUI());
break;
case CSYNC_STATUS_QUOTA_EXCEEDED:
errStr = tr("CSync: No space on %1 server available.").arg(Theme::instance()->appNameGUI());
break;
case CSYNC_STATUS_UNSUCCESSFUL:
errStr = tr("CSync unspecified error.");
break;
case CSYNC_STATUS_ABORTED:
errStr = tr("Aborted by the user");
break;
case CSYNC_ERR_UNSPEC:
errStr = tr("CSync: unspecified error.");
default:
errStr = tr("An internal error number %1 happend.").arg( (int) err );
}
if( errString ) {
errStr += tr(" Backend Message: ")+QString::fromUtf8(errString);
}
return errStr;
}
bool CSyncThread::checkBlacklisting( SyncFileItem *item )
{
bool re = false;
if( !_journal ) {
qWarning() << "Journal is undefined!";
return false;
}
SyncJournalBlacklistRecord entry = _journal->blacklistEntry(item->_file);
item->_blacklistedInDb = false;
// if there is a valid entry in the blacklist table and the retry count is
// already null or smaller than 0, the file is blacklisted.
if( entry.isValid() ) {
item->_blacklistedInDb = true;
if( entry._retryCount <= 0 ) {
re = true;
}
// if the retryCount is 0, but the etag for downloads or the mtime for uploads
// has changed, it is tried again
// note that if the retryCount is -1 we never try again.
if( entry._retryCount == 0 ) {
if( item->_dir == SyncFileItem::Up ) { // check the modtime
if(item->_modtime == 0 || entry._lastTryModtime == 0) {
re = false;
} else {
if( item->_modtime != entry._lastTryModtime ) {
re = false;
qDebug() << item->_file << " is blacklisted, but has changed mtime!";
}
}
} else {
// download, check the etag.
if( item->_etag.isEmpty() || entry._lastTryEtag.isEmpty() ) {
qDebug() << item->_file << "one ETag is empty, no blacklisting";
return false;
} else {
if( item->_etag != entry._lastTryEtag ) {
re = false;
qDebug() << item->_file << " is blacklisted, but has changed etag!";
}
}
}
}
if( re ) {
qDebug() << "Item is on blacklist: " << entry._file << "retries:" << entry._retryCount;
item->_instruction = CSYNC_INSTRUCTION_IGNORE;
// FIXME: put the error string into an .arg(..) later
item->_errorString = tr("The item is not synced because of previous errors:")
+ QLatin1String(" ")+ entry._errorString;
slotProgress( Progress::SoftError, *item );
}
}
return re;
}
int CSyncThread::treewalkLocal( TREE_WALK_FILE* file, void *data )
{
return static_cast<CSyncThread*>(data)->treewalkFile( file, false );
@@ -175,66 +255,41 @@ int CSyncThread::treewalkRemote( TREE_WALK_FILE* file, void *data )
return static_cast<CSyncThread*>(data)->treewalkFile( file, true );
}
int CSyncThread::walkFinalize(TREE_WALK_FILE* file, void *data )
{
return static_cast<CSyncThread*>(data)->treewalkError( file);
}
int CSyncThread::treewalkFile( TREE_WALK_FILE *file, bool remote )
{
if( ! file ) return -1;
SyncFileItem item;
item._file = QString::fromUtf8( file->path );
item._originalFile = item._file;
item._instruction = file->instruction;
item._dir = SyncFileItem::None;
if(file->error_string) {
item._errorString = QString::fromUtf8(file->error_string);
}
SyncFileItem::Direction dir;
item._fileId = QString::fromUtf8(file->file_id);
int re = 0;
// record the seen files to be able to clean the journal later
_seenFiles[item._file] = QString();
if (file->instruction != CSYNC_INSTRUCTION_IGNORE
&& file->instruction != CSYNC_INSTRUCTION_REMOVE) {
_hasFiles = true;
}
switch(file->instruction) {
case CSYNC_INSTRUCTION_NONE:
case CSYNC_INSTRUCTION_IGNORE:
switch(file->error_status) {
case CSYNC_STATUS_OK:
break;
case CSYNC_STATUS_INDIVIDUAL_IS_SYMLINK:
item._errorString = tr("Symbolic links are not supported in syncing.");
break;
case CSYNC_STATUS_INDIVIDUAL_IGNORE_LIST:
item._errorString = tr("File is listed on the ignore list.");
break;
case CSYNC_STATUS_INDIVIDUAL_IS_INVALID_CHARS:
item._errorString = tr("File contains invalid characters that can not be synced cross platform.");
break;
default:
if (!_needsUpdate)
_needsUpdate = true;
}
switch(file->instruction) {
case CSYNC_INSTRUCTION_NONE:
// No need to do anything.
return re;
break;
case CSYNC_INSTRUCTION_RENAME:
dir = !remote ? SyncFileItem::Down : SyncFileItem::Up;
item._renameTarget = QString::fromUtf8( file->rename_path );
break;
case CSYNC_INSTRUCTION_REMOVE:
dir = !remote ? SyncFileItem::Down : SyncFileItem::Up;
break;
case CSYNC_INSTRUCTION_CONFLICT:
case CSYNC_INSTRUCTION_IGNORE:
case CSYNC_INSTRUCTION_ERROR:
dir = SyncFileItem::None;
break;
case CSYNC_INSTRUCTION_EVAL:
case CSYNC_INSTRUCTION_NEW:
case CSYNC_INSTRUCTION_SYNC:
case CSYNC_INSTRUCTION_STAT_ERROR:
case CSYNC_INSTRUCTION_DELETED:
case CSYNC_INSTRUCTION_UPDATED:
default:
dir = remote ? SyncFileItem::Down : SyncFileItem::Up;
break;
Q_ASSERT("Non handled error-status");
/* No error string */
}
item._isDirectory = file->type == CSYNC_FTW_TYPE_DIR;
item._modtime = file->modtime;
item._etag = file->etag;
item._size = file->size;
item._should_update_etag = file->should_update_etag;
switch( file->type ) {
case CSYNC_FTW_TYPE_DIR:
item._type = SyncFileItem::Directory;
@@ -249,66 +304,110 @@ int CSyncThread::treewalkFile( TREE_WALK_FILE *file, bool remote )
item._type = SyncFileItem::UnknownType;
}
SyncFileItem::Direction dir;
int re = 0;
switch(file->instruction) {
case CSYNC_INSTRUCTION_NONE:
break;
case CSYNC_INSTRUCTION_NEW:
case CSYNC_INSTRUCTION_SYNC:
case CSYNC_INSTRUCTION_CONFLICT:
case CSYNC_INSTRUCTION_RENAME:
case CSYNC_INSTRUCTION_REMOVE:
_progressInfo.overall_file_count++;
_progressInfo.overall_transmission_size += file->size;
//fall trough
default:
_needsUpdate = true;
}
switch(file->instruction) {
case CSYNC_INSTRUCTION_UPDATED:
// We need to update the database.
_journal->setFileRecord(SyncJournalFileRecord(item, _localPath + item._file));
item._instruction = CSYNC_INSTRUCTION_NONE;
// fall trough
case CSYNC_INSTRUCTION_NONE:
if (item._isDirectory && remote) {
// Because we want still to update etags of directories
dir = SyncFileItem::None;
} else {
// No need to do anything.
_hasFiles = true;
return re;
}
break;
case CSYNC_INSTRUCTION_RENAME:
dir = !remote ? SyncFileItem::Down : SyncFileItem::Up;
item._renameTarget = QString::fromUtf8( file->rename_path );
if (item._isDirectory)
_renamedFolders.insert(item._file, item._renameTarget);
break;
case CSYNC_INSTRUCTION_REMOVE:
dir = !remote ? SyncFileItem::Down : SyncFileItem::Up;
break;
case CSYNC_INSTRUCTION_CONFLICT:
case CSYNC_INSTRUCTION_IGNORE:
case CSYNC_INSTRUCTION_ERROR:
//
slotProgress(Progress::SoftError, item, 0, 0);
dir = SyncFileItem::None;
break;
case CSYNC_INSTRUCTION_EVAL:
case CSYNC_INSTRUCTION_NEW:
case CSYNC_INSTRUCTION_SYNC:
case CSYNC_INSTRUCTION_STAT_ERROR:
case CSYNC_INSTRUCTION_DELETED:
default:
dir = remote ? SyncFileItem::Down : SyncFileItem::Up;
break;
}
item._dir = dir;
_mutex.lock();
// check for blacklisting of this item.
// if the item is on blacklist, the instruction was set to IGNORE
checkBlacklisting( &item );
if (file->instruction != CSYNC_INSTRUCTION_IGNORE
&& file->instruction != CSYNC_INSTRUCTION_REMOVE) {
_hasFiles = true;
}
_syncedItems.append(item);
_mutex.unlock();
return re;
}
int CSyncThread::treewalkError(TREE_WALK_FILE* file)
{
SyncFileItem item; // only used for search.
item._file= QString::fromUtf8(file->path);
int indx = _syncedItems.indexOf(item);
if ( indx == -1 )
return 0;
if( file &&
(file->instruction == CSYNC_INSTRUCTION_STAT_ERROR ||
file->instruction == CSYNC_INSTRUCTION_ERROR) ) {
_mutex.lock();
_syncedItems[indx]._instruction = file->instruction;
_syncedItems[indx]._errorString = QString::fromUtf8(file->error_string);
_mutex.unlock();
}
return 0;
}
struct CSyncRunScopeHelper {
CSyncRunScopeHelper(CSYNC *ctx, CSyncThread *parent)
: _ctx(ctx), _parent(parent)
{
_t.start();
}
~CSyncRunScopeHelper() {
csync_commit(_ctx);
qDebug() << "CSync run took " << _t.elapsed() << " Milliseconds";
emit(_parent->finished());
_parent->_syncMutex.unlock();
}
CSYNC *_ctx;
QTime _t;
CSyncThread *_parent;
};
void CSyncThread::handleSyncError(CSYNC *ctx, const char *state) {
CSYNC_ERROR_CODE err = csync_get_error( ctx );
const char *errMsg = csync_get_error_string( ctx );
QString errStr = csyncErrorToString(err, errMsg);
CSYNC_STATUS err = csync_get_status( ctx );
const char *errMsg = csync_get_status_string( ctx );
QString errStr = csyncErrorToString(err);
if( errMsg ) {
if( !errStr.endsWith(" ")) {
errStr.append(" ");
}
errStr += QString::fromUtf8(errMsg);
}
// if there is csyncs url modifier in the error message, replace it.
if( errStr.contains("ownclouds://") ) errStr.replace("ownclouds://", "https://");
if( errStr.contains("owncloud://") ) errStr.replace("owncloud://", "http://");
qDebug() << " #### ERROR during "<< state << ": " << errStr;
switch (err) {
case CSYNC_ERR_SERVICE_UNAVAILABLE:
case CSYNC_ERR_CONNECT:
if( CSYNC_STATUS_IS_EQUAL( err, CSYNC_STATUS_ABORTED) ) {
qDebug() << "Update phase was aborted by user!";
} else if( CSYNC_STATUS_IS_EQUAL( err, CSYNC_STATUS_SERVICE_UNAVAILABLE ) ||
CSYNC_STATUS_IS_EQUAL( err, CSYNC_STATUS_CONNECT_ERROR )) {
emit csyncUnavailable();
break;
default:
} else {
emit csyncError(errStr);
}
csync_commit(_csync_ctx);
emit finished();
_syncMutex.unlock();
thread()->quit();
}
void CSyncThread::startSync()
@@ -323,44 +422,63 @@ void CSyncThread::startSync()
}
qDebug() << Q_FUNC_INFO << "Sync started";
qDebug() << "starting to sync " << qApp->thread() << QThread::currentThread();
_syncedItems.clear();
_mutex.lock();
_syncedItems.clear();
_needsUpdate = false;
if (!_abortRequested.fetchAndAddRelease(0)) {
csync_resume(_csync_ctx);
}
_mutex.unlock();
// cleans up behind us and emits finished() to ease error handling
CSyncRunScopeHelper helper(_csync_ctx, this);
// maybe move this somewhere else where it can influence a running sync?
MirallConfigFile cfg;
int downloadLimit = 0;
if (cfg.useDownloadLimit()) {
downloadLimit = cfg.downloadLimit() * 1000;
}
csync_set_module_property(_csync_ctx, "bandwidth_limit_download", &downloadLimit);
if (!_journal->exists()) {
qDebug() << "=====sync looks new (no DB exists), activating recursive PROPFIND if csync supports it";
bool no_recursive_propfind = false;
csync_set_module_property(_csync_ctx, "no_recursive_propfind", &no_recursive_propfind);
} else {
// retrieve the file count from the db and close it afterwards because
// csync_update also opens the database.
int fileRecordCount = 0;
fileRecordCount = _journal->getFileRecordCount();
_journal->close();
int uploadLimit = -75; // 75%
int useUpLimit = cfg.useUploadLimit();
if ( useUpLimit >= 1) {
uploadLimit = cfg.uploadLimit() * 1000;
} else if (useUpLimit == 0) {
uploadLimit = 0;
}
csync_set_module_property(_csync_ctx, "bandwidth_limit_upload", &uploadLimit);
if( fileRecordCount == -1 ) {
qDebug() << "No way to create a sync journal!";
emit csyncError(tr("Unable to initialize a sync journal."));
csync_set_progress_callback( _csync_ctx, cb_progress );
csync_commit(_csync_ctx);
emit finished();
_syncMutex.unlock();
thread()->quit();
return;
// database creation error!
} else if ( fileRecordCount < 50 ) {
qDebug() << "=====sync DB has only" << fileRecordCount << "items, enable recursive PROPFIND if csync supports it";
bool no_recursive_propfind = false;
csync_set_module_property(_csync_ctx, "no_recursive_propfind", &no_recursive_propfind);
} else {
qDebug() << "=====sync with existing DB";
}
}
csync_set_module_property(_csync_ctx, "csync_context", _csync_ctx);
csync_set_userdata(_csync_ctx, this);
// TODO: This should be a part of this method, but we don't have
// any way to get "session_key" module property from csync. Had we
// have it, then we could keep this code and remove it from
// AbstractCredentials implementations.
cfg.getCredentials()->syncContextPreStart(_csync_ctx);
if (Account *account = AccountManager::instance()->account()) {
account->credentials()->syncContextPreStart(_csync_ctx);
} else {
qDebug() << Q_FUNC_INFO << "No default Account object, huh?";
}
// if (_lastAuthCookies.length() > 0) {
// // Stuff cookies inside csync, then we can avoid the intermediate HTTP 401 reply
// // when https://github.com/owncloud/core/pull/4042 is merged.
@@ -375,23 +493,34 @@ void CSyncThread::startSync()
// }
// csync_set_auth_callback( _csync_ctx, getauth );
csync_set_log_callback( csyncLogCatcher );
csync_set_log_level( 11 );
_syncTime.start();
QElapsedTimer updateTime;
updateTime.start();
qDebug() << "#### Update start #################################################### >>";
if( csync_update(_csync_ctx) < 0 ) {
handleSyncError(_csync_ctx, "csync_update");
return;
}
qDebug() << "<<#### Update end ###########################################################";
qDebug() << "<<#### Update end #################################################### " << updateTime.elapsed();
if( csync_reconcile(_csync_ctx) < 0 ) {
handleSyncError(_csync_ctx, "csync_reconcile");
return;
}
slotProgress(Progress::StartSync, SyncFileItem(), 0, 0);
_progressInfo = Progress::Info();
_hasFiles = false;
bool walkOk = true;
_seenFiles.clear();
if( csync_walk_local_tree(_csync_ctx, &treewalkLocal, 0) < 0 ) {
qDebug() << "Error in local treewalk.";
walkOk = false;
@@ -400,9 +529,15 @@ void CSyncThread::startSync()
qDebug() << "Error in remote treewalk.";
}
// Adjust the paths for the renames.
for (SyncFileItemVector::iterator it = _syncedItems.begin();
it != _syncedItems.end(); ++it) {
it->_file = adjustRenamedPath(it->_file);
}
if (!_hasFiles && !_syncedItems.isEmpty()) {
qDebug() << Q_FUNC_INFO << "All the files are going to be removed, asking the user";
bool cancel = true;
bool cancel = false;
emit aboutToRemoveAllFiles(_syncedItems.first()._dir, &cancel);
if (cancel) {
qDebug() << Q_FUNC_INFO << "Abort sync";
@@ -413,95 +548,153 @@ void CSyncThread::startSync()
if (_needsUpdate)
emit(started());
if( csync_propagate(_csync_ctx) < 0 ) {
handleSyncError(_csync_ctx, "cysnc_reconcile");
ne_session_s *session = 0;
// that call to set property actually is a get which will return the session
// FIXME add a csync_get_module_property to csync
csync_set_module_property(_csync_ctx, "get_dav_session", &session);
Q_ASSERT(session);
_propagator.reset(new OwncloudPropagator (session, _localPath, _remotePath,
_journal, &_abortRequested));
connect(_propagator.data(), SIGNAL(completed(SyncFileItem)),
this, SLOT(transferCompleted(SyncFileItem)), Qt::QueuedConnection);
connect(_propagator.data(), SIGNAL(progress(Progress::Kind,SyncFileItem,quint64,quint64)),
this, SLOT(slotProgress(Progress::Kind,SyncFileItem,quint64,quint64)));
connect(_propagator.data(), SIGNAL(finished()), this, SLOT(slotFinished()));
int downloadLimit = 0;
if (cfg.useDownloadLimit()) {
downloadLimit = cfg.downloadLimit() * 1000;
}
_propagator->_downloadLimit = downloadLimit;
int uploadLimit = -75; // 75%
int useUpLimit = cfg.useUploadLimit();
if ( useUpLimit >= 1) {
uploadLimit = cfg.uploadLimit() * 1000;
} else if (useUpLimit == 0) {
uploadLimit = 0;
}
_propagator->_uploadLimit = uploadLimit;
_propagator->start(_syncedItems);
}
void CSyncThread::transferCompleted(const SyncFileItem &item)
{
qDebug() << Q_FUNC_INFO << item._file << item._status << item._errorString;
/* Update the _syncedItems vector */
int idx = _syncedItems.indexOf(item);
if (idx >= 0) {
_syncedItems[idx]._instruction = item._instruction;
_syncedItems[idx]._errorString = item._errorString;
_syncedItems[idx]._status = item._status;
} else {
qWarning() << Q_FUNC_INFO << "Could not find index in synced items!";
}
if (item._status == SyncFileItem::FatalError) {
emit csyncError(item._errorString);
}
}
void CSyncThread::slotFinished()
{
// emit the treewalk results.
if( ! _journal->postSyncCleanup( _seenFiles ) ) {
qDebug() << "Cleaning of synced ";
}
_journal->commit("All Finished.", false);
emit treeWalkResult(_syncedItems);
csync_commit(_csync_ctx);
qDebug() << "CSync run took " << _syncTime.elapsed() << " Milliseconds";
slotProgress(Progress::EndSync,SyncFileItem(), 0 , 0);
emit finished();
_propagator.reset(0);
_syncMutex.unlock();
thread()->quit();
}
void CSyncThread::progressProblem(Progress::Kind kind, const SyncFileItem& item)
{
Progress::SyncProblem problem;
problem.kind = kind;
problem.current_file = item._file;
problem.error_message = item._errorString;
problem.error_code = item._httpErrorCode;
problem.timestamp = QDateTime::currentDateTime();
// connected to something in folder.
emit transmissionProblem( problem );
}
void CSyncThread::slotProgress(Progress::Kind kind, const SyncFileItem& item, quint64 curr, quint64 total)
{
if( Progress::isErrorKind(kind) ) {
progressProblem(kind, item);
return;
}
if( walkOk ) {
if( csync_walk_local_tree(_csync_ctx, &walkFinalize, 0) < 0 ||
csync_walk_remote_tree(_csync_ctx, &walkFinalize, 0 ) < 0 ) {
qDebug() << "Error in finalize treewalk.";
} else {
// emit the treewalk results.
emit treeWalkResult(_syncedItems);
if( kind == Progress::StartSync ) {
QMutexLocker lock(&_mutex);
_currentFileNo = 0;
_lastOverallBytes = 0;
}
if( kind == Progress::StartDelete ||
kind == Progress::StartDownload ||
kind == Progress::StartRename ||
kind == Progress::StartUpload ) {
QMutexLocker lock(&_mutex);
_currentFileNo += 1;
}
if( kind == Progress::EndUpload ||
kind == Progress::EndDownload ||
kind == Progress::EndRename ||
kind == Progress::EndDelete ) {
QMutexLocker lock(&_mutex);
_lastOverallBytes += total;
curr = 0;
}
Progress::Info pInfo(_progressInfo);
pInfo.kind = kind;
pInfo.current_file = item._file;
pInfo.rename_target = item._renameTarget;
pInfo.file_size = total;
pInfo.current_file_bytes = curr;
pInfo.current_file_no = _currentFileNo;
pInfo.timestamp = QDateTime::currentDateTime();
pInfo.overall_current_bytes = _lastOverallBytes + curr;
// Connect to something in folder!
emit transmissionProgress( pInfo );
}
/* Given a path on the remote, give the path as it is when the rename is done */
QString CSyncThread::adjustRenamedPath(const QString& original)
{
int slashPos = original.size();
while ((slashPos = original.lastIndexOf('/' , slashPos - 1)) > 0) {
QHash< QString, QString >::const_iterator it = _renamedFolders.constFind(original.left(slashPos));
if (it != _renamedFolders.constEnd()) {
return *it + original.mid(slashPos);
}
}
qDebug() << Q_FUNC_INFO << "Sync finished";
return original;
}
Progress::Kind CSyncThread::csyncToProgressKind( enum csync_notify_type_e kind )
void CSyncThread::abort()
{
Progress::Kind pKind = Progress::Invalid;
switch(kind) {
case CSYNC_NOTIFY_INVALID:
pKind = Progress::Invalid;
break;
case CSYNC_NOTIFY_START_SYNC_SEQUENCE:
pKind = Progress::StartSync;
break;
case CSYNC_NOTIFY_START_DOWNLOAD:
pKind = Progress::StartDownload;
break;
case CSYNC_NOTIFY_START_UPLOAD:
pKind = Progress::StartUpload;
break;
case CSYNC_NOTIFY_PROGRESS:
pKind = Progress::Context;
break;
case CSYNC_NOTIFY_FINISHED_DOWNLOAD:
pKind = Progress::EndDownload;
break;
case CSYNC_NOTIFY_FINISHED_UPLOAD:
pKind = Progress::EndUpload;
break;
case CSYNC_NOTIFY_FINISHED_SYNC_SEQUENCE:
pKind = Progress::EndSync;
break;
case CSYNC_NOTIFY_START_DELETE:
pKind = Progress::StartDelete;
break;
case CSYNC_NOTIFY_END_DELETE:
pKind = Progress::EndDelete;
break;
case CSYNC_NOTIFY_ERROR:
pKind = Progress::Error;
break;
default:
pKind = Progress::Invalid;
break;
}
return pKind;
QMutexLocker locker(&_mutex);
csync_request_abort(_csync_ctx);
_abortRequested = true;
}
void CSyncThread::cb_progress( CSYNC_PROGRESS *progress, void *userdata )
{
if( !progress ) {
qDebug() << "No progress block in progress callback found!";
return;
}
if( !userdata ) {
qDebug() << "No thread given in progress callback!";
return;
}
Progress::Info pInfo;
CSyncThread *thread = static_cast<CSyncThread*>(userdata);
pInfo.kind = thread->csyncToProgressKind( progress->kind );
pInfo.current_file = QUrl::fromEncoded( progress->path ).toString();
pInfo.file_size = progress->file_size;
pInfo.current_file_bytes = progress->curr_bytes;
pInfo.overall_file_count = progress->overall_file_count;
pInfo.current_file_no = progress->current_file_no;
pInfo.overall_transmission_size = progress->overall_transmission_size;
pInfo.overall_current_bytes = progress->current_overall_bytes;
pInfo.timestamp = QDateTime::currentDateTime();
// Connect to something in folder!
thread->transmissionProgress( pInfo );
}
} // ns Mirall
+48 -12
Ver Arquivo
@@ -21,6 +21,8 @@
#include <QMutex>
#include <QThread>
#include <QString>
#include <qelapsedtimer.h>
#include <qstack.h>
#include <QNetworkProxy>
#include <QNetworkCookie>
@@ -33,26 +35,41 @@ class QProcess;
namespace Mirall {
class SyncJournalFileRecord;
class SyncJournalDb;
class OwncloudPropagator;
void csyncLogCatcher(int /*verbosity*/,
const char */*function*/,
const char *buffer,
void */*userdata*/);
class CSyncThread : public QObject
{
Q_OBJECT
public:
CSyncThread(CSYNC *);
CSyncThread(CSYNC *, const QString &localPath, const QString &remotePath, SyncJournalDb *journal);
~CSyncThread();
static QString csyncErrorToString( CSYNC_ERROR_CODE, const char * );
static QString csyncErrorToString( CSYNC_STATUS);
Q_INVOKABLE void startSync();
/* Abort the sync. Called from the main thread */
void abort();
signals:
void fileReceived( const QString& );
void fileRemoved( const QString& );
void csyncError( const QString& );
void csyncWarning( const QString& );
void csyncUnavailable();
void treeWalkResult(const SyncFileItemVector&);
void transmissionProgress( const Progress::Info& progress );
void transmissionProblem( const Progress::SyncProblem& problem );
void csyncStateDbFile( const QString& );
void wipeDb();
@@ -61,20 +78,19 @@ signals:
void aboutToRemoveAllFiles(SyncFileItem::Direction direction, bool *cancel);
private slots:
void transferCompleted(const SyncFileItem& item);
void slotFinished();
void slotProgress(Progress::Kind kind, const SyncFileItem &item, quint64 curr = 0, quint64 total = 0);
private:
void handleSyncError(CSYNC *ctx, const char *state);
static void cb_progress( CSYNC_PROGRESS *progress, void *userdata );
void progressProblem(Progress::Kind kind, const SyncFileItem& item);
static int treewalkLocal( TREE_WALK_FILE*, void *);
static int treewalkRemote( TREE_WALK_FILE*, void *);
int treewalkFile( TREE_WALK_FILE*, bool );
int treewalkError( TREE_WALK_FILE* );
Progress::Kind csyncToProgressKind( enum csync_notify_type_e kind );
static int walkFinalize(TREE_WALK_FILE*, void* );
bool checkBlacklisting( SyncFileItem *item );
static QMutex _mutex;
static QMutex _syncMutex;
@@ -82,8 +98,28 @@ private:
CSYNC *_csync_ctx;
bool _needsUpdate;
QString _localPath;
QString _remotePath;
SyncJournalDb *_journal;
QScopedPointer <OwncloudPropagator> _propagator;
QElapsedTimer _syncTime;
QString _lastDeleted; // if the last item was a path and it has been deleted
QHash <QString, QString> _seenFiles;
// maps the origin and the target of the folders that have been renamed
QHash<QString, QString> _renamedFolders;
QString adjustRenamedPath(const QString &original);
bool _hasFiles; // true if there is at least one file that is not ignored or removed
Progress::Info _progressInfo;
int _downloadLimit;
int _uploadLimit;
qint64 _currentFileNo;
qint64 _overallFileCount;
quint64 _lastOverallBytes;
QAtomicInt _abortRequested;
friend struct CSyncRunScopeHelper;
};
+248 -138
Ver Arquivo
@@ -15,16 +15,35 @@
*/
#include "config.h"
#include "mirall/account.h"
#include "mirall/folder.h"
#include "mirall/folderman.h"
#include "mirall/folderwatcher.h"
#include "mirall/mirallconfigfile.h"
#include "mirall/syncresult.h"
#include "mirall/logger.h"
#include "mirall/owncloudinfo.h"
#include "mirall/mirallconfigfile.h"
#include "mirall/networkjobs.h"
#include "mirall/syncjournalfilerecord.h"
#include "mirall/syncresult.h"
#include "mirall/utility.h"
#include "folderman.h"
#include "creds/abstractcredentials.h"
extern "C" {
enum csync_exclude_type_e {
CSYNC_NOT_EXCLUDED = 0,
CSYNC_FILE_SILENTLY_EXCLUDED,
CSYNC_FILE_EXCLUDE_AND_REMOVE,
CSYNC_FILE_EXCLUDE_LIST,
CSYNC_FILE_EXCLUDE_INVALID_CHAR
};
typedef enum csync_exclude_type_e CSYNC_EXCLUDE_TYPE;
CSYNC_EXCLUDE_TYPE csync_excluded(CSYNC *ctx, const char *path, int filetype);
}
#include <QDebug>
#include <QTimer>
#include <QUrl>
@@ -35,28 +54,19 @@
namespace Mirall {
void csyncLogCatcher(CSYNC */*ctx*/,
int /*verbosity*/,
const char */*function*/,
const char *buffer,
void */*userdata*/)
{
Logger::instance()->csyncLog( QString::fromUtf8(buffer) );
}
Folder::Folder(const QString &alias, const QString &path, const QString& secondPath, QObject *parent)
: QObject(parent)
, _path(path)
, _secondPath(secondPath)
, _remotePath(secondPath)
, _alias(alias)
, _enabled(true)
, _userSyncEnabled(true)
, _thread(0)
, _csync(0)
, _csyncError(false)
, _csyncUnavail(false)
, _wipeDb(false)
, _proxyDirty(true)
, _journal(path)
, _csync_ctx(0)
{
qsrand(QTime::currentTime().msec());
@@ -87,7 +97,7 @@ Folder::Folder(const QString &alias, const QString &path, const QString& secondP
bool Folder::init()
{
QString url = Utility::toCSyncScheme(ownCloudInfo::instance()->webdavUrl() + secondPath());
QString url = Utility::toCSyncScheme(remoteUrl().toString());
QString localpath = path();
if( csync_create( &_csync_ctx, localpath.toUtf8().data(), url.toUtf8().data() ) < 0 ) {
@@ -95,19 +105,29 @@ bool Folder::init()
slotCSyncError(tr("Unable to create csync-context"));
_csync_ctx = 0;
} else {
csync_set_log_callback( _csync_ctx, csyncLogCatcher );
csync_set_log_verbosity(_csync_ctx, 11);
csync_set_log_callback( csyncLogCatcher );
csync_set_log_level( 11 );
MirallConfigFile cfgFile;
csync_set_config_dir( _csync_ctx, cfgFile.configPath().toUtf8() );
csync_enable_conflictcopys(_csync_ctx);
setIgnoredFiles();
cfgFile.getCredentials()->syncContextPreInit(_csync_ctx);
if (Account *account = AccountManager::instance()->account()) {
account->credentials()->syncContextPreInit(_csync_ctx);
} else {
qDebug() << Q_FUNC_INFO << "No default Account object, huh?";
}
if( csync_init( _csync_ctx ) < 0 ) {
qDebug() << "Could not initialize csync!" << csync_get_error(_csync_ctx) << csync_get_error_string(_csync_ctx);
slotCSyncError(CSyncThread::csyncErrorToString(csync_get_error(_csync_ctx), csync_get_error_string(_csync_ctx)));
qDebug() << "Could not initialize csync!" << csync_get_status(_csync_ctx) << csync_get_status_string(_csync_ctx);
QString errStr = CSyncThread::csyncErrorToString(CSYNC_STATUS(csync_get_status(_csync_ctx)));
const char *errMsg = csync_get_status_string(_csync_ctx);
if( errMsg ) {
errStr += QLatin1String("<br/>");
errStr += QString::fromUtf8(errMsg);
}
slotCSyncError(errStr);
csync_destroy(_csync_ctx);
_csync_ctx = 0;
}
@@ -118,8 +138,7 @@ bool Folder::init()
Folder::~Folder()
{
if( _thread ) {
_thread->quit();
csync_request_abort(_csync_ctx);
_csync->abort();
_thread->wait();
}
delete _csync;
@@ -182,9 +201,23 @@ bool Folder::isBusy() const
return ( _thread && _thread->isRunning() );
}
QString Folder::secondPath() const
QString Folder::remotePath() const
{
return _secondPath;
return _remotePath;
}
QUrl Folder::remoteUrl() const
{
Account *account = AccountManager::instance()->account();
QUrl url = account->davUrl();
QString path = url.path();
if (!path.endsWith('/')) {
path.append('/');
}
path.append(_remotePath);
url.setPath(path);
qDebug() << url;
return url;
}
QString Folder::nativePath() const
@@ -201,32 +234,16 @@ void Folder::setSyncEnabled( bool doit )
{
_enabled = doit;
if( doit && userSyncEnabled() ) {
if( doit ) {
// qDebug() << "Syncing enabled on folder " << name();
_pollTimer.start();
_watcher->clearPendingEvents(); // FIXME 1.5: Why isn't that happening in setEventsEnabled?
_watcher->setEventsEnabled(true);
_timeSinceLastSync.restart();
} else {
// do not stop or start the watcher here, that is done internally by
// folder class. Even if the watcher fires, the folder does not
// schedule itself because it checks the var. _enabled before.
_pollTimer.stop();
_watcher->setEventsEnabled(false);
}
}
bool Folder::userSyncEnabled()
{
return _userSyncEnabled;
}
void Folder::slotSetSyncUserEnabled( bool enable )
{
_userSyncEnabled = enable;
setSyncEnabled( syncEnabled() ); // no change on the system enable flag.
}
void Folder::setSyncState(SyncResult::Status state)
{
_syncResult.setStatus(state);
@@ -239,15 +256,11 @@ SyncResult Folder::syncResult() const
void Folder::evaluateSync(const QStringList &/*pathList*/)
{
if( !syncEnabled() ) {
if( !_enabled ) {
qDebug() << "*" << alias() << "sync skipped, disabled!";
return;
}
if( !userSyncEnabled() ) {
qDebug() << "*" << alias() << "sync skipped, user disabled!";
return;
}
_syncResult.setStatus( SyncResult::NotYetStarted );
_syncResult.clearErrors();
emit scheduleToSync( alias() );
@@ -256,18 +269,18 @@ void Folder::evaluateSync(const QStringList &/*pathList*/)
void Folder::slotPollTimerTimeout()
{
qDebug() << "* Polling" << alias() << "for changes. (time since next sync:" << (_timeSinceLastSync.elapsed() / 1000) << "s)";
qDebug() << "* Polling" << alias() << "for changes. (time since last sync:" << (_timeSinceLastSync.elapsed() / 1000) << "s)";
// Force sync if the last sync is a long time ago or if there was a serious problem.
if (quint64(_timeSinceLastSync.elapsed()) > MirallConfigFile().forceSyncInterval() ||
!(_syncResult.status() == SyncResult::Success || _syncResult.status() == SyncResult::Problem)) {
qDebug() << "** Force Sync now";
!(_syncResult.status() == SyncResult::Success ||_syncResult.status() == SyncResult::Problem)) {
qDebug() << "** Force Sync now, state is " << _syncResult.statusString();
evaluateSync(QStringList());
} else {
RequestEtagJob* job = new RequestEtagJob(secondPath(), this);
RequestEtagJob* job = new RequestEtagJob(AccountManager::instance()->account(), remotePath(), this);
// check if the etag is different
QObject::connect(job, SIGNAL(etagRetreived(QString)), this, SLOT(etagRetreived(QString)));
QObject::connect(job, SIGNAL(networkError()), this, SLOT(slotNetworkUnavailable()));
QObject::connect(job, SIGNAL(networkError(QNetworkReply*)), this, SLOT(slotNetworkUnavailable()));
job->start();
}
}
@@ -286,6 +299,7 @@ void Folder::etagRetreived(const QString& etag)
void Folder::slotNetworkUnavailable()
{
AccountManager::instance()->account()->setState(Account::Disconnected);
_syncResult.setStatus(SyncResult::Unavailable);
emit syncStateChange();
}
@@ -303,15 +317,16 @@ void Folder::bubbleUpSyncResult()
int removedItems = 0;
int updatedItems = 0;
int ignoredItems = 0;
int renamedItems = 0;
SyncFileItem firstItemNew;
SyncFileItem firstItemDeleted;
SyncFileItem firstItemUpdated;
SyncFileItem firstItemRenamed;
Logger *logger = Logger::instance();
foreach (const SyncFileItem &item, _syncResult.syncFileItemVector() ) {
if( item._instruction == CSYNC_INSTRUCTION_ERROR ) {
if( item._status == SyncFileItem::FatalError || item._status == SyncFileItem::NormalError ) {
slotCSyncError( tr("File %1: %2").arg(item._file).arg(item._errorString) );
logger->postOptionalGuiLog(tr("File %1").arg(item._file), item._errorString);
@@ -338,7 +353,8 @@ void Folder::bubbleUpSyncResult()
}
break;
case CSYNC_INSTRUCTION_UPDATED:
case CSYNC_INSTRUCTION_CONFLICT:
case CSYNC_INSTRUCTION_SYNC:
updatedItems++;
if (firstItemUpdated.isEmpty())
firstItemUpdated = item;
@@ -346,6 +362,12 @@ void Folder::bubbleUpSyncResult()
case CSYNC_INSTRUCTION_ERROR:
qDebug() << "Got Instruction ERROR. " << _syncResult.errorString();
break;
case CSYNC_INSTRUCTION_RENAME:
if (firstItemRenamed.isEmpty()) {
firstItemRenamed = item;
}
renamedItems++;
break;
default:
// nothing.
break;
@@ -360,33 +382,50 @@ void Folder::bubbleUpSyncResult()
_syncResult.setWarnCount(ignoredItems);
createGuiLog( firstItemNew._file, tr("downloaded"), newItems );
createGuiLog( firstItemDeleted._file, tr("removed"), removedItems );
createGuiLog( firstItemUpdated._file, tr("updated"), updatedItems );
if( !firstItemRenamed.isEmpty() ) {
QString renameVerb = tr("renamed");
// if the path changes it's rather a move
QDir renTarget = QFileInfo(firstItemRenamed._renameTarget).dir();
QDir renSource = QFileInfo(firstItemRenamed._file).dir();
if(renTarget != renSource) {
renameVerb = tr("moved");
}
createGuiLog( firstItemRenamed._file, tr("%1 to %2").arg(renameVerb).arg(firstItemRenamed._renameTarget), renamedItems );
}
qDebug() << "OO folder slotSyncFinished: result: " << int(_syncResult.status());
if (newItems > 0) {
QString file = QDir::toNativeSeparators(firstItemNew._file);
if (newItems == 1)
logger->postOptionalGuiLog(tr("New file available"), tr("'%1' has been synced to this machine.").arg(file));
else
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->postOptionalGuiLog(tr("File removed"), tr("'%1' has been removed.").arg(file));
else
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->postOptionalGuiLog(tr("File updated"), tr("'%1' has been updated.").arg(file));
else
logger->postOptionalGuiLog(tr("Files updated"), tr("'%1' and %n other file(s) have been updated.",
"", updatedItems-1).arg(file));
}
void Folder::createGuiLog( const QString& filename, const QString& verb, int count )
{
if(count > 0) {
Logger *logger = Logger::instance();
QString file = QDir::toNativeSeparators(filename);
if (count == 1) {
logger->postOptionalGuiLog(tr("File %1").arg(verb), tr("'%1' has been %2.").arg(file).arg(verb));
} else {
logger->postOptionalGuiLog(tr("Files %1").arg(verb),
tr("'%1' and %2 other files have been %3.").arg(file).arg(count-1).arg(verb));
}
}
}
int Folder::blackListEntryCount()
{
return _journal.blackListEntryCount();
}
int Folder::slotWipeBlacklist()
{
return _journal.wipeBlacklist();
}
void Folder::slotLocalPathChanged( const QString& dir )
{
QDir notifiedDir(dir);
@@ -427,36 +466,27 @@ void Folder::slotCatchWatcherError(const QString& error)
Logger::instance()->postOptionalGuiLog(tr("Error"), error);
}
void Folder::slotTerminateSync()
void Folder::slotTerminateSync(bool block)
{
qDebug() << "folder " << alias() << " Terminating!";
MirallConfigFile cfg;
QString configDir = cfg.configPath();
qDebug() << "csync's Config Dir: " << configDir;
if( _thread && _csync ) {
csync_request_abort(_csync_ctx);
_thread->quit();
_csync->abort();
// Do not display an error message, user knows his own actions.
// _errors.append( tr("The CSync thread terminated.") );
// _csyncError = true;
if (!block) {
setSyncState(SyncResult::SyncAbortRequested);
return;
}
_thread->wait();
_csync->deleteLater();
delete _thread;
_csync = 0;
_thread = 0;
csync_resume(_csync_ctx);
slotCSyncFinished();
}
if( ! configDir.isEmpty() ) {
QFile file( configDir + QLatin1String("/lock"));
if( file.exists() ) {
qDebug() << "After termination, lock file exists and gets removed.";
file.remove();
}
}
_errors.append( tr("The CSync thread terminated.") );
_csyncError = true;
qDebug() << "-> CSync Terminated!";
slotCSyncFinished();
setSyncEnabled(false);
}
@@ -468,6 +498,8 @@ void Folder::wipe()
{
QString stateDbFile = path()+QLatin1String(".csync_journal.db");
_journal.close(); // close the sync journal
QFile file(stateDbFile);
if( file.exists() ) {
if( !file.remove()) {
@@ -504,31 +536,26 @@ void Folder::setIgnoredFiles()
void Folder::setProxy()
{
if( _csync_ctx ) {
/* Store proxy */
QUrl proxyUrl(ownCloudInfo::instance()->webdavUrl());
QList<QNetworkProxy> proxies = QNetworkProxyFactory::proxyForQuery(proxyUrl);
// We set at least one in Application
Q_ASSERT(proxies.count() > 0);
QNetworkProxy proxy = proxies.first();
if (proxy.type() == QNetworkProxy::NoProxy) {
qDebug() << "Passing NO proxy to csync for" << proxyUrl;
} else {
qDebug() << "Passing" << proxy.hostName() << "of proxy type " << proxy.type()
<< " to csync for" << proxyUrl;
}
int proxyPort = proxy.port();
csync_set_module_property(_csync_ctx, "proxy_type", (char*) proxyTypeToCStr(proxy.type()) );
csync_set_module_property(_csync_ctx, "proxy_host", proxy.hostName().toUtf8().data() );
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);
/* Store proxy */
QUrl proxyUrl(AccountManager::instance()->account()->url());
QList<QNetworkProxy> proxies = QNetworkProxyFactory::proxyForQuery(QNetworkProxyQuery(proxyUrl));
// We set at least one in Application
Q_ASSERT(proxies.count() > 0);
QNetworkProxy proxy = proxies.first();
if (proxy.type() == QNetworkProxy::NoProxy) {
qDebug() << "Passing NO proxy to csync for" << proxyUrl;
} else {
qDebug() << "WRN: Unable to set Proxy without csync-ctx!";
qDebug() << "Passing" << proxy.hostName() << "of proxy type " << proxy.type()
<< " to csync for" << proxyUrl;
}
_proxy_type = proxyTypeToCStr(proxy.type());
_proxy_host = proxy.hostName().toUtf8();
_proxy_port = proxy.port();
_proxy_user = proxy.user().toUtf8();
_proxy_pwd = proxy.password().toUtf8();
setProxyDirty(false);
}
void Folder::setProxyDirty(bool value)
@@ -567,7 +594,6 @@ void Folder::startSync(const QStringList &pathList)
if (!_csync_ctx) {
// no _csync_ctx yet, initialize it.
init();
setProxy();
if (!_csync_ctx) {
qDebug() << Q_FUNC_INFO << "init failed.";
@@ -575,9 +601,15 @@ void Folder::startSync(const QStringList &pathList)
QMetaObject::invokeMethod(this, "slotCSyncFinished", Qt::QueuedConnection);
return;
}
setProxy();
} else if (proxyDirty()) {
setProxy();
}
csync_set_module_property(_csync_ctx, "proxy_type", const_cast<char*>(_proxy_type) );
csync_set_module_property(_csync_ctx, "proxy_host", _proxy_host.data() );
csync_set_module_property(_csync_ctx, "proxy_port", &_proxy_port );
csync_set_module_property(_csync_ctx, "proxy_user", _proxy_user.data() );
csync_set_module_property(_csync_ctx, "proxy_pwd", _proxy_pwd.data() );
if (_thread && _thread->isRunning()) {
qCritical() << "* ERROR csync is still running and new sync requested.";
@@ -599,10 +631,9 @@ void Folder::startSync(const QStringList &pathList)
qDebug() << "*** Start syncing";
_thread = new QThread(this);
setIgnoredFiles();
_csync = new CSyncThread( _csync_ctx );
_csync = new CSyncThread( _csync_ctx, path(), remoteUrl().path(), &_journal);
_csync->moveToThread(_thread);
qRegisterMetaType<SyncFileItemVector>("SyncFileItemVector");
qRegisterMetaType<SyncFileItem::Direction>("SyncFileItem::Direction");
@@ -618,9 +649,11 @@ void Folder::startSync(const QStringList &pathList)
connect(_csync, SIGNAL(aboutToRemoveAllFiles(SyncFileItem::Direction,bool*)),
SLOT(slotAboutToRemoveAllFiles(SyncFileItem::Direction,bool*)), Qt::BlockingQueuedConnection);
connect(_csync, SIGNAL(transmissionProgress(Progress::Info)), this, SLOT(slotTransmissionProgress(Progress::Info)));
connect(_csync, SIGNAL(transmissionProblem(Progress::SyncProblem)), this, SLOT(slotTransmissionProblem(Progress::SyncProblem)));
_thread->start();
_thread->setPriority(QThread::LowPriority);
QMetaObject::invokeMethod(_csync, "startSync", Qt::QueuedConnection);
// disable events until syncing is done
@@ -649,13 +682,10 @@ void Folder::slotCsyncUnavailable()
void Folder::slotCSyncFinished()
{
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();
}
qDebug() << "-> CSync Finished slot with error " << _csyncError << "warn count" << _syncResult.warnCount();
_watcher->setEventsEnabledDelayed(2000);
_pollTimer.start();
_timeSinceLastSync.restart();
bubbleUpSyncResult();
@@ -677,10 +707,35 @@ void Folder::slotCSyncFinished()
_thread->quit();
}
emit syncStateChange();
ownCloudInfo::instance()->getQuotaRequest("/");
emit syncFinished( _syncResult );
}
// the problem comes without a folder and the valid path set. Add that here
// and hand the result over to the progress dispatcher.
void Folder::slotTransmissionProblem( const Progress::SyncProblem& problem )
{
Progress::SyncProblem newProb = problem;
newProb.folder = alias();
if(newProb.current_file.startsWith(QLatin1String("ownclouds://")) ||
newProb.current_file.startsWith(QLatin1String("owncloud://")) ) {
// rip off the whole ownCloud URL.
newProb.current_file.remove(Utility::toCSyncScheme(remoteUrl().toString()));
}
QString localPath = path();
if( newProb.current_file.startsWith(localPath) ) {
// remove the local dir.
newProb.current_file = newProb.current_file.right( newProb.current_file.length() - localPath.length());
}
// Count all error conditions.
_syncResult.setWarnCount( _syncResult.warnCount()+1 );
ProgressDispatcher::instance()->setProgressProblem(alias(), newProb);
}
// the progress comes without a folder and the valid path set. Add that here
// and hand the result over to the progress dispatcher.
void Folder::slotTransmissionProgress(const Progress::Info& progress)
{
Progress::Info newInfo = progress;
@@ -689,8 +744,7 @@ void Folder::slotTransmissionProgress(const Progress::Info& progress)
if(newInfo.current_file.startsWith(QLatin1String("ownclouds://")) ||
newInfo.current_file.startsWith(QLatin1String("owncloud://")) ) {
// rip off the whole ownCloud URL.
QString remotePathUrl = ownCloudInfo::instance()->webdavUrl() + secondPath();
newInfo.current_file.remove(Utility::toCSyncScheme(remotePathUrl));
newInfo.current_file.remove(Utility::toCSyncScheme(remoteUrl().toString()));
}
QString localPath = path();
if( newInfo.current_file.startsWith(localPath) ) {
@@ -702,9 +756,6 @@ void Folder::slotTransmissionProgress(const Progress::Info& progress)
if( newInfo.kind == Progress::StartSync ) {
_syncResult.setWarnCount(0);
}
if( newInfo.kind == Progress::Error ) {
_syncResult.setWarnCount( _syncResult.warnCount()+1 );
}
ProgressDispatcher::instance()->setProgressInfo(alias(), newInfo);
}
@@ -733,6 +784,65 @@ void Folder::slotAboutToRemoveAllFiles(SyncFileItem::Direction direction, bool *
}
}
SyncFileStatus Folder::fileStatus( const QString& fileName )
{
/*
STATUS_NONE,
+ STATUS_EVAL,
STATUS_REMOVE, (invalid for this case because it asks for local files)
STATUS_RENAME,
+ STATUS_NEW,
STATUS_CONFLICT,(probably also invalid as we know the conflict only with server involvement)
+ STATUS_IGNORE,
+ STATUS_SYNC,
+ STATUS_STAT_ERROR,
STATUS_ERROR,
STATUS_UPDATED
*/
// FIXME: Find a way for STATUS_ERROR
SyncFileStatus stat = FILE_STATUS_NONE;
QString file = path() + fileName;
QFileInfo fi(file);
if( !fi.exists() ) {
stat = FILE_STATUS_STAT_ERROR; // not really possible.
}
// file is ignored?
if( fi.isSymLink() ) {
stat = FILE_STATUS_IGNORE;
}
int type = CSYNC_FTW_TYPE_FILE;
if( fi.isDir() ) {
type = CSYNC_FTW_TYPE_DIR;
}
if( stat == FILE_STATUS_NONE ) {
CSYNC_EXCLUDE_TYPE excl = csync_excluded(_csync_ctx, file.toUtf8(), type);
if( excl != CSYNC_NOT_EXCLUDED ) {
stat = FILE_STATUS_IGNORE;
}
}
SyncJournalFileRecord rec = _journal.getFileRecord(fileName);
if( stat == FILE_STATUS_NONE && !rec.isValid() ) {
stat = FILE_STATUS_NEW;
}
// file was locally modified.
if( stat == FILE_STATUS_NONE && fi.lastModified() != rec._modtime ) {
stat = FILE_STATUS_EVAL;
}
if( stat == FILE_STATUS_NONE ) {
stat = FILE_STATUS_SYNC;
}
return stat;
}
} // namespace Mirall
+45 -31
Ver Arquivo
@@ -20,6 +20,7 @@
#include "mirall/syncresult.h"
#include "mirall/progressdispatcher.h"
#include "mirall/csyncthread.h"
#include "mirall/syncjournaldb.h"
#include <QDir>
#include <QHash>
@@ -40,28 +41,27 @@ namespace Mirall {
class FolderWatcher;
typedef enum SyncFileStatus_s {
STATUS_NONE,
STATUS_EVAL,
STATUS_REMOVE,
STATUS_RENAME,
STATUS_NEW,
STATUS_CONFLICT,
STATUS_IGNORE,
STATUS_SYNC,
STATUS_STAT_ERROR,
STATUS_ERROR,
STATUS_UPDATED
FILE_STATUS_NONE,
FILE_STATUS_EVAL,
FILE_STATUS_REMOVE,
FILE_STATUS_RENAME,
FILE_STATUS_NEW,
FILE_STATUS_CONFLICT,
FILE_STATUS_IGNORE,
FILE_STATUS_SYNC,
FILE_STATUS_STAT_ERROR,
FILE_STATUS_ERROR,
FILE_STATUS_UPDATED
} SyncFileStatus;
class Folder : public QObject
{
Q_OBJECT
protected:
friend class FolderMan;
public:
Folder(const QString&, const QString&, const QString& , QObject*parent = 0L);
public:
~Folder();
typedef QHash<QString, Folder*> Map;
@@ -81,10 +81,16 @@ public:
* local folder path
*/
QString path() const;
/**
* remote folder path
*/
QString secondPath() const;
QString remotePath() const;
/**
* remote folder path with server url
*/
QUrl remoteUrl() const;
/**
* local folder path with native separators
@@ -137,8 +143,10 @@ public slots:
/**
* terminate the current sync run
*
* If block is true, this will block synchroniously for the sync thread to finish.
*/
void slotTerminateSync();
void slotTerminateSync(bool block);
void slotAboutToRemoveAllFiles(SyncFileItem::Direction, bool*);
@@ -150,15 +158,17 @@ public slots:
*/
void startSync(const QStringList &pathList = QStringList());
/**
* Starts a sync (calling startSync)
* if the policies allow for it
*/
void evaluateSync(const QStringList &pathList);
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();
int slotWipeBlacklist();
int blackListEntryCount();
private slots:
void slotCSyncStarted();
@@ -167,6 +177,7 @@ private slots:
void slotCSyncFinished();
void slotTransmissionProgress(const Progress::Info& progress);
void slotTransmissionProblem( const Progress::SyncProblem& problem );
void slotPollTimerTimeout();
void etagRetreived(const QString &);
@@ -179,7 +190,7 @@ private slots:
void slotThreadTreeWalkResult(const SyncFileItemVector& );
void slotCatchWatcherError( const QString& );
protected:
private:
bool init();
void setSyncState(SyncResult::Status state);
@@ -190,21 +201,16 @@ protected:
void bubbleUpSyncResult();
/**
* Starts a sync (calling startSync)
* if the policies allow for it
*/
void evaluateSync(const QStringList &pathList);
void checkLocalPath();
void createGuiLog( const QString& filename, const QString& verb, int count );
QString _path;
QString _secondPath;
QString _remotePath;
QString _alias;
QString _configFile;
QFileSystemWatcher *_pathWatcher;
bool _enabled;
bool _userSyncEnabled; // enabled by user interaction?
FolderWatcher *_watcher;
SyncResult _syncResult;
QThread *_thread;
@@ -219,8 +225,16 @@ protected:
QString _lastEtag;
QElapsedTimer _timeSinceLastSync;
SyncJournalDb _journal;
CSYNC *_csync_ctx;
const char *_proxy_type;
QByteArray _proxy_host;
int _proxy_port;
QByteArray _proxy_user;
QByteArray _proxy_pwd;
};
}
+54 -28
Ver Arquivo
@@ -18,7 +18,8 @@
#include "mirall/syncresult.h"
#include "mirall/inotify.h"
#include "mirall/theme.h"
#include "owncloudinfo.h"
#include <neon/ne_socket.h>
#ifdef Q_OS_MAC
#include <CoreServices/CoreServices.h>
@@ -53,8 +54,10 @@ FolderMan::FolderMan(QObject *parent) :
FolderMan *FolderMan::instance()
{
if(!_instance)
if(!_instance) {
_instance = new FolderMan;
ne_sock_init();
}
return _instance;
}
@@ -62,6 +65,7 @@ FolderMan *FolderMan::instance()
FolderMan::~FolderMan()
{
qDeleteAll(_folderMap);
ne_sock_exit();
}
Mirall::Folder::Map FolderMan::map()
@@ -69,18 +73,6 @@ Mirall::Folder::Map FolderMan::map()
return _folderMap;
}
int FolderMan::setupFolders()
{
// setup a handler to look for configuration changes
return setupKnownFolders();
}
void FolderMan::slotReparseConfiguration()
{
setupKnownFolders();
}
int FolderMan::unloadAllFolders()
{
int cnt = 0;
@@ -92,10 +84,11 @@ int FolderMan::unloadAllFolders()
delete _folderMap.take( i.key() );
cnt++;
}
_currentSyncFolder.clear();
return cnt;
}
int FolderMan::setupKnownFolders()
int FolderMan::setupFolders()
{
qDebug() << "* Setup folders from " << _folderConfigPath;
@@ -225,7 +218,7 @@ Folder* FolderMan::setupFolderFromConfigFile(const QString &file) {
return folder;
}
QSettings settings( cfgFile.filePath(), QSettings::IniFormat);
QSettings settings( _folderConfigPath + QLatin1Char('/') + escapedAlias, QSettings::IniFormat);
qDebug() << " -> file path: " << settings.fileName();
// Check if the filename is equal to the group setting. If not, use the group
@@ -238,9 +231,10 @@ Folder* FolderMan::setupFolderFromConfigFile(const QString &file) {
settings.beginGroup( escapedAlias ); // read the group with the same name as the file which is the folder alias
QString path = settings.value(QLatin1String("localpath")).toString();
QString path = settings.value(QLatin1String("localPath")).toString();
QString backend = settings.value(QLatin1String("backend")).toString();
QString targetPath = settings.value( QLatin1String("targetPath") ).toString();
QString targetPath = settings.value( QLatin1String("targetPath")).toString();
bool paused = settings.value( QLatin1String("paused"), false).toBool();
// QString connection = settings.value( QLatin1String("connection") ).toString();
QString alias = unescapeAlias( escapedAlias );
@@ -258,6 +252,9 @@ Folder* FolderMan::setupFolderFromConfigFile(const QString &file) {
folder->setConfigFile(file);
qDebug() << "Adding folder to Folder Map " << folder;
_folderMap[alias] = folder;
if (paused) {
_disabledFolders.insert(folder);
}
/* Use a signal mapper to connect the signals to the alias */
connect(folder, SIGNAL(scheduleToSync(const QString&)), SLOT(slotScheduleSync(const QString&)));
@@ -269,7 +266,7 @@ Folder* FolderMan::setupFolderFromConfigFile(const QString &file) {
return folder;
}
void FolderMan::slotGuiPauseFolder( const QString& alias, bool enable )
void FolderMan::slotEnableFolder( const QString& alias, bool enable )
{
if( ! _folderMap.contains( alias ) ) {
qDebug() << "!! Can not enable alias " << alias << ", can not be found in folderMap.";
@@ -278,8 +275,18 @@ void FolderMan::slotGuiPauseFolder( const QString& alias, bool enable )
Folder *f = _folderMap[alias];
if( f ) {
f->slotSetSyncUserEnabled(enable);
f->setSyncEnabled(enable);
f->evaluateSync(QStringList());
QSettings settings(_folderConfigPath + QLatin1Char('/') + f->configFile(), QSettings::IniFormat);
settings.beginGroup(escapeAlias(f->alias()));
if (enable) {
settings.remove("paused");
_disabledFolders.remove(f);
} else {
settings.setValue("paused", true);
_disabledFolders.insert(f);
}
}
}
@@ -294,8 +301,7 @@ void FolderMan::terminateSyncProcess( const QString& alias )
if( ! folderAlias.isEmpty() ) {
Folder *f = _folderMap[folderAlias];
if( f ) {
f->slotTerminateSync();
f->slotTerminateSync(true);
if(_currentSyncFolder == folderAlias )
_currentSyncFolder.clear();
}
@@ -342,7 +348,7 @@ void FolderMan::slotScheduleSync( const QString& alias )
qDebug() << "Schedule folder " << alias << " to sync!";
if( _currentSyncFolder == alias ) {
// the current folder is currently syncing.
qDebug() << " the current folder is currently syncing.";
return;
}
@@ -363,7 +369,7 @@ void FolderMan::setSyncEnabled( bool enabled )
_syncEnabled = enabled;
foreach( Folder *f, _folderMap.values() ) {
f->setSyncEnabled(enabled);
f->setSyncEnabled(enabled && !_disabledFolders.contains(f));
}
}
@@ -388,7 +394,6 @@ void FolderMan::slotScheduleFolderSync()
if( ! _scheduleQueue.isEmpty() ) {
const QString alias = _scheduleQueue.dequeue();
if( _folderMap.contains( alias ) ) {
ownCloudInfo::instance()->getQuotaRequest("/");
Folder *f = _folderMap[alias];
if( f->syncEnabled() ) {
_currentSyncFolder = alias;
@@ -429,6 +434,23 @@ void FolderMan::addFolderDefinition(const QString& alias, const QString& sourceF
settings.sync();
}
Folder *FolderMan::folderForPath(const QUrl &path)
{
QString absolutePath = path.toLocalFile();
absolutePath.append("/");
foreach(Folder* folder, map().values())
{
if(absolutePath.startsWith(folder->path()))
{
qDebug() << "found folder: " << folder->path() << " for " << absolutePath;
return folder;
}
}
return 0;
}
void FolderMan::removeAllFolderDefinitions()
{
foreach( Folder *f, _folderMap.values() ) {
@@ -553,7 +575,7 @@ SyncResult FolderMan::accountStatus(const QList<Folder*> &folders)
case SyncResult::Unavailable:
overallResult.setStatus( SyncResult::Unavailable );
break;
case SyncResult::Problem:
case SyncResult::Problem: // don't show the problem icon in tray.
case SyncResult::Success:
if( overallResult.status() == SyncResult::Undefined )
overallResult.setStatus( SyncResult::Success );
@@ -565,8 +587,9 @@ SyncResult FolderMan::accountStatus(const QList<Folder*> &folders)
if ( overallResult.status() != SyncResult::Error )
overallResult.setStatus( SyncResult::SetupError );
break;
// no default case on purpose, check compiler warnings
case SyncResult::SyncAbortRequested:
break;
// no default case on purpose, check compiler warnings
}
}
return overallResult;
@@ -602,6 +625,9 @@ QString FolderMan::statusToString( SyncResult syncStatus, bool enabled ) const
case SyncResult::SetupError:
folderMessage = tr( "Setup Error." );
break;
case SyncResult::SyncAbortRequested:
folderMessage = tr( "User Abort." );
break;
// no default case on purpose, check compiler warnings
}
if( !enabled ) {
+5 -4
Ver Arquivo
@@ -50,6 +50,9 @@ public:
*/
void addFolderDefinition(const QString&, const QString&, const QString& );
/** Returns the folder which the file or directory stored in path is in */
Folder* folderForPath(const QUrl& path);
/** Returns the folder by alias or NULL if no folder with the alias exists. */
Folder *folder( const QString& );
@@ -91,13 +94,11 @@ signals:
public slots:
void slotRemoveFolder( const QString& );
void slotGuiPauseFolder( const QString&, bool );
void slotEnableFolder( const QString&, bool );
void slotFolderSyncStarted();
void slotFolderSyncFinished( const SyncResult& );
void slotReparseConfiguration();
void terminateSyncProcess( const QString& alias = QString::null );
/* delete all folder objects */
@@ -121,7 +122,6 @@ private slots:
private:
// finds all folder configuration files
// and create the folders
int setupKnownFolders();
void terminateCurrentSync();
QString getBackupName( const QString& ) const;
@@ -132,6 +132,7 @@ private:
void removeFolder( const QString& );
QSet<Folder*> _disabledFolders;
Folder::Map _folderMap;
QString _folderConfigPath;
QSignalMapper *_folderChangeSignalMapper;
+3
Ver Arquivo
@@ -17,6 +17,9 @@
#include <QtCore>
#include <QtGui>
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#include <QtWidgets>
#endif
namespace Mirall {
+1
Ver Arquivo
@@ -136,6 +136,7 @@ void FolderWatcherPrivate::slotINotifyEvent(int mask, int /*cookie*/, const QStr
if( path.endsWith(".csync_journal.db.ctmp") ||
path.endsWith(".csync_journal.db.ctmp-journal") ||
path.endsWith(".csync_journal.db-journal") ||
path.endsWith(".csync_journal.db")) {
qDebug() << " ** Inotify ignored for " <<path;
return;
+115 -66
Ver Arquivo
@@ -14,9 +14,10 @@
#include "mirall/folderwizard.h"
#include "mirall/folderman.h"
#include "mirall/owncloudinfo.h"
#include "mirall/mirallconfigfile.h"
#include "mirall/theme.h"
#include "mirall/networkjobs.h"
#include "mirall/account.h"
#include <QDebug>
#include <QDesktopServices>
@@ -35,8 +36,24 @@
namespace Mirall
{
QString FormatWarningsWizardPage::formatWarnings(const QStringList &warnings) const
{
QString ret;
if (warnings.count() == 1) {
ret = tr("<b>Warning:</b> ") + warnings.first();
} else if (warnings.count() > 1) {
ret = tr("<b>Warning:</b> ") + "<ul>";
Q_FOREACH(QString warning, warnings) {
ret += QString::fromLatin1("<li>%1</li>").arg(warning);
}
ret += "</ul>";
}
return ret;
}
FolderWizardSourcePage::FolderWizardSourcePage()
: QWizardPage()
: FormatWarningsWizardPage()
{
_ui.setupUi(this);
registerField(QLatin1String("sourceFolder*"), _ui.localFolderLineEdit);
@@ -44,7 +61,7 @@ FolderWizardSourcePage::FolderWizardSourcePage()
_ui.localFolderLineEdit->setText( QDir::toNativeSeparators( defaultPath ) );
registerField(QLatin1String("alias*"), _ui.aliasLineEdit);
_ui.aliasLineEdit->setText( Theme::instance()->appNameGUI() );
_ui.warnLabel->setTextFormat(Qt::RichText);
_ui.warnLabel->hide();
}
@@ -68,16 +85,16 @@ bool FolderWizardSourcePage::isComplete() const
QFileInfo selFile( QDir::fromNativeSeparators(_ui.localFolderLineEdit->text()) );
QString userInput = selFile.canonicalFilePath();
QString warnString;
QStringList warnStrings;
bool isOk = selFile.isDir();
if( !isOk ) {
warnString = tr("No local folder selected!");
warnStrings.append(tr("No valid local folder selected!"));
}
if (isOk && !selFile.isWritable()) {
isOk = false;
warnString += tr("You have no permission to write to the selected folder!");
warnStrings.append(tr("You have no permission to write to the selected folder!"));
}
// check if the local directory isn't used yet in another ownCloud sync
@@ -98,21 +115,40 @@ bool FolderWizardSourcePage::isComplete() const
if( ! folderDir.endsWith(QLatin1Char('/')) ) folderDir.append(QLatin1Char('/'));
qDebug() << "Checking local path: " << folderDir << " <-> " << userInput;
if( QFileInfo( f->path() ) == userInput ) {
if( QDir::cleanPath(f->path()) == QDir::cleanPath(userInput) &&
QDir::cleanPath(QDir(f->path()).canonicalPath()) == QDir(userInput).canonicalPath() ) {
isOk = false;
warnString.append( tr("The local path %1 is already an upload folder.<br/>Please pick another one!")
warnStrings.append( tr("The local path %1 is already an upload folder. Please pick another one!")
.arg(QDir::toNativeSeparators(userInput)) );
}
if( isOk && folderDir.startsWith( userInput )) {
if( isOk && QDir::cleanPath(folderDir).startsWith(QDir::cleanPath(userInput)+'/') ) {
qDebug() << "A already configured folder is child of the current selected";
warnString.append( tr("An already configured folder is contained in the current entry."));
warnStrings.append( tr("An already configured folder is contained in the current entry."));
isOk = false;
}
if( isOk && userInput.startsWith( folderDir ) ) {
QString absCleanUserFolder = QDir::cleanPath(QDir(userInput).canonicalPath())+'/';
if( isOk && QDir::cleanPath(folderDir).startsWith(absCleanUserFolder) ) {
qDebug() << "A already configured folder is child of the current selected";
warnStrings.append( tr("The selected folder is a symbolic link. An already configured"
"folder is contained in the folder this link is pointing to."));
isOk = false;
}
if( isOk && QDir::cleanPath(QString(userInput+'/')).startsWith( QDir::cleanPath(folderDir)) ) {
qDebug() << "An already configured folder is parent of the current selected";
warnString.append( tr("An already configured folder contains the currently entered directory."));
warnStrings.append( tr("An already configured folder contains the currently entered folder."));
isOk = false;
}
if( isOk && absCleanUserFolder.startsWith( QDir::cleanPath(folderDir)) ) {
qDebug() << "The selected folder is a symbolic link. An already configured folder is\n"
"the parent of the current selected contains the folder this link is pointing to.";
warnStrings.append( tr("The selected folder is a symbolic link. An already configured folder "
"is the parent of the current selected contains the folder this link is "
"pointing to."));
isOk = false;
}
i++;
}
}
@@ -120,7 +156,7 @@ bool FolderWizardSourcePage::isComplete() const
// check if the alias is unique.
QString alias = _ui.aliasLineEdit->text();
if( alias.isEmpty() ) {
warnString.append( tr("The alias can not be empty. Please provide a descriptive alias word.") );
warnStrings.append( tr("The alias can not be empty. Please provide a descriptive alias word.") );
isOk = false;
}
@@ -131,7 +167,7 @@ bool FolderWizardSourcePage::isComplete() const
qDebug() << "Checking local alias: " << f->alias();
if( f ) {
if( f->alias() == alias ) {
warnString.append( tr("<br/>The alias <i>%1</i> is already in use. Please pick another alias.").arg(alias) );
warnStrings.append( tr("The alias <i>%1</i> is already in use. Please pick another alias.").arg(alias) );
isOk = false;
goon = false;
}
@@ -139,12 +175,14 @@ bool FolderWizardSourcePage::isComplete() const
i++;
}
_ui.warnLabel->setWordWrap(true);
if( isOk ) {
_ui.warnLabel->hide();
_ui.warnLabel->setText( QString::null );
} else {
_ui.warnLabel->show();
_ui.warnLabel->setText( warnString );
QString warnings = formatWarnings(warnStrings);
_ui.warnLabel->setText( warnings );
}
return isOk;
}
@@ -167,7 +205,8 @@ void FolderWizardSourcePage::on_localFolderLineEdit_textChanged()
// =================================================================================
FolderWizardTargetPage::FolderWizardTargetPage()
: _warnWasVisible(false)
: FormatWarningsWizardPage()
,_warnWasVisible(false)
{
_ui.setupUi(this);
_ui.warnFrame->hide();
@@ -176,6 +215,8 @@ FolderWizardTargetPage::FolderWizardTargetPage()
connect(_ui.refreshButton, SIGNAL(clicked()), SLOT(slotRefreshFolders()));
connect(_ui.folderTreeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), SIGNAL(completeChanged()));
connect(_ui.folderTreeWidget, SIGNAL(itemActivated(QTreeWidgetItem*,int)), SIGNAL(completeChanged()));
connect(_ui.folderTreeWidget, SIGNAL(itemExpanded(QTreeWidgetItem*)), SLOT(slotItemExpanded(QTreeWidgetItem*)));
}
void FolderWizardTargetPage::slotAddRemoteFolder()
@@ -196,24 +237,32 @@ void FolderWizardTargetPage::slotAddRemoteFolder()
dlg->setAttribute(Qt::WA_DeleteOnClose);
}
void FolderWizardTargetPage::slotCreateRemoteFolder(QString folder)
void FolderWizardTargetPage::slotCreateRemoteFolder(const QString &folder)
{
if( folder.isEmpty() ) return;
ownCloudInfo::instance()->mkdirRequest( folder );
MkColJob *job = new MkColJob(AccountManager::instance()->account(), folder, this);
/* check the owncloud configuration file and query the ownCloud */
connect(job, SIGNAL(finished(QNetworkReply::NetworkError)),
SLOT(slotCreateRemoteFolderFinished(QNetworkReply::NetworkError)));
connect(job, SIGNAL(networkError(QNetworkReply*)), SLOT(slotHandleNetworkError(QNetworkReply*)));
job->start();
}
void FolderWizardTargetPage::slotCreateRemoteFolderFinished( QNetworkReply::NetworkError error )
void FolderWizardTargetPage::slotCreateRemoteFolderFinished(QNetworkReply::NetworkError error)
{
qDebug() << "** webdav mkdir request finished " << error;
if (error == QNetworkReply::NoError) {
qDebug() << "** webdav mkdir request finished";
showWarn(tr("Folder was successfully created on %1.").arg(Theme::instance()->appNameGUI()));
slotRefreshFolders();
}
}
// the webDAV server seems to return a 202 even if mkdir was successful.
if( error == QNetworkReply::NoError ||
error == QNetworkReply::ContentOperationNotPermittedError) {
showWarn( tr("Folder was successfully created on %1.").arg( Theme::instance()->appNameGUI() ) );
slotRefreshFolders();
} else {
showWarn( tr("Failed to create the folder on %1.<br/>Please check manually.").arg( Theme::instance()->appNameGUI() ) );
}
void FolderWizardTargetPage::slotHandleNetworkError(QNetworkReply *reply)
{
qDebug() << "** webdav mkdir request failed:" << reply->error();
showWarn(tr("Failed to create the folder on %1. Please check manually.")
.arg(Theme::instance()->appNameGUI()));
}
static QTreeWidgetItem* findFirstChild(QTreeWidgetItem *parent, const QString& text)
@@ -227,11 +276,11 @@ static QTreeWidgetItem* findFirstChild(QTreeWidgetItem *parent, const QString& t
return 0;
}
static void recursiveInsert(QTreeWidgetItem *parent, QStringList pathTrail, QString path)
void FolderWizardTargetPage::recursiveInsert(QTreeWidgetItem *parent, QStringList pathTrail, QString path)
{
QFileIconProvider prov;
QIcon folderIcon = prov.icon(QFileIconProvider::Folder);
if (pathTrail.size() == 0) {
if (pathTrail.size() == 0) {
if (path.endsWith('/')) {
path.chop(1);
}
@@ -252,9 +301,9 @@ static void recursiveInsert(QTreeWidgetItem *parent, QStringList pathTrail, QStr
}
}
void FolderWizardTargetPage::slotUpdateDirectories(QStringList list)
void FolderWizardTargetPage::slotUpdateDirectories(const QStringList &list)
{
QString webdavFolder = QUrl(ownCloudInfo::instance()->webdavUrl()).path();
QString webdavFolder = QUrl(AccountManager::instance()->account()->davUrl()).path();
QTreeWidgetItem *root = _ui.folderTreeWidget->topLevelItem(0);
if (!root) {
@@ -275,13 +324,20 @@ void FolderWizardTargetPage::slotUpdateDirectories(QStringList list)
void FolderWizardTargetPage::slotRefreshFolders()
{
ownCloudInfo::instance()->getDirectoryListing("/");
LsColJob *job = new LsColJob(AccountManager::instance()->account(), "/", this);
connect(job, SIGNAL(directoryListing(QStringList)),
SLOT(slotUpdateDirectories(QStringList)));
job->start();
_ui.folderTreeWidget->clear();
}
void FolderWizardTargetPage::slotItemExpanded(QTreeWidgetItem *item)
{
ownCloudInfo::instance()->getDirectoryListing(item->data(0, Qt::UserRole).toString());
QString dir = item->data(0, Qt::UserRole).toString();
LsColJob *job = new LsColJob(AccountManager::instance()->account(), dir, this);
connect(job, SIGNAL(directoryListing(QStringList)),
SLOT(slotUpdateDirectories(QStringList)));
job->start();
}
FolderWizardTargetPage::~FolderWizardTargetPage()
@@ -293,32 +349,36 @@ bool FolderWizardTargetPage::isComplete() const
if (!_ui.folderTreeWidget->currentItem())
return false;
QStringList warnStrings;
QString dir = _ui.folderTreeWidget->currentItem()->data(0, Qt::UserRole).toString();
if (!dir.startsWith(QLatin1Char('/'))) {
dir.prepend(QLatin1Char('/'));
}
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;
QString curDir = f->remotePath();
if (!curDir.startsWith(QLatin1Char('/'))) {
curDir.prepend(QLatin1Char('/'));
}
if (QDir::cleanPath(dir) == QDir::cleanPath(curDir)) {
warnStrings.append(tr("This folder is already being synced."));
} else if (dir.startsWith(curDir + QLatin1Char('/'))) {
warnStrings.append(tr("You are already syncing <i>%1</i>, which is a parent folder of <i>%2</i>.").arg(curDir).arg(dir));
}
if (curDir == QLatin1String("/")) {
warnStrings.append(tr("You are already syncing all your files. Syncing another folder is <b>not</b> supported. "
"If you want to sync multiple folders, please remove the currently configured "
"root folder sync."));
}
}
if( dir == QLatin1String("/") ) {
showWarn( tr("If you sync the root folder, you can <b>not</b> configure another sync directory."));
return true;
} else {
showWarn();
return true;
}
showWarn(formatWarnings(warnStrings));
return warnStrings.isEmpty();
}
void FolderWizardTargetPage::cleanupPage()
@@ -329,21 +389,7 @@ void FolderWizardTargetPage::cleanupPage()
void FolderWizardTargetPage::initializePage()
{
showWarn();
/* check the owncloud configuration file and query the ownCloud */
ownCloudInfo *ocInfo = ownCloudInfo::instance();
if( ocInfo->isConfigured() ) {
connect( ocInfo, SIGNAL(ownCloudDirExists(QString,QNetworkReply*)),
SLOT(slotDirCheckReply(QString,QNetworkReply*)));
connect( ocInfo, SIGNAL(webdavColCreated(QNetworkReply::NetworkError)),
SLOT(slotCreateRemoteFolderFinished( QNetworkReply::NetworkError )));
connect( ocInfo, SIGNAL(directoryListingUpdated(QStringList)),
SLOT(slotUpdateDirectories(QStringList)));
connect(_ui.folderTreeWidget, SIGNAL(itemExpanded(QTreeWidgetItem*)),
SLOT(slotItemExpanded(QTreeWidgetItem*)));
slotRefreshFolders();
}
slotRefreshFolders();
}
void FolderWizardTargetPage::showWarn( const QString& msg ) const
@@ -368,6 +414,7 @@ FolderWizard::FolderWizard( QWidget *parent )
_folderWizardSourcePage(new FolderWizardSourcePage),
_folderWizardTargetPage(0)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setPage(Page_Source, _folderWizardSourcePage );
if (!Theme::instance()->singleSyncFolder()) {
_folderWizardTargetPage = new FolderWizardTargetPage();
@@ -386,7 +433,9 @@ FolderWizard::~FolderWizard()
void FolderWizard::setFolderMap( const Folder::Map& fm)
{
_folderWizardSourcePage->setFolderMap( fm );
_folderWizardTargetPage->setFolderMap( fm );
if (!Theme::instance()->singleSyncFolder()) {
_folderWizardTargetPage->setFolderMap( fm );
}
}
} // end namespace
+12 -5
Ver Arquivo
@@ -28,10 +28,15 @@ namespace Mirall {
class ownCloudInfo;
class FormatWarningsWizardPage : public QWizardPage {
protected:
QString formatWarnings(const QStringList &warnings) const;
};
/**
* page to ask for the local source folder
*/
class FolderWizardSourcePage : public QWizardPage
class FolderWizardSourcePage : public FormatWarningsWizardPage
{
Q_OBJECT
public:
@@ -57,7 +62,7 @@ private:
* page to ask for the target folder
*/
class FolderWizardTargetPage : public QWizardPage
class FolderWizardTargetPage : public FormatWarningsWizardPage
{
Q_OBJECT
public:
@@ -75,12 +80,14 @@ protected slots:
void showWarn( const QString& = QString() ) const;
void slotAddRemoteFolder();
void slotCreateRemoteFolder(QString);
void slotCreateRemoteFolderFinished( QNetworkReply::NetworkError error );
void slotUpdateDirectories(QStringList);
void slotCreateRemoteFolder(const QString&);
void slotCreateRemoteFolderFinished(QNetworkReply::NetworkError error);
void slotHandleNetworkError(QNetworkReply*);
void slotUpdateDirectories(const QStringList&);
void slotRefreshFolders();
void slotItemExpanded(QTreeWidgetItem*);
private:
void recursiveInsert(QTreeWidgetItem *parent, QStringList pathTrail, QString path);
Ui_FolderWizardTargetPage _ui;
ownCloudInfo *_ownCloudDirCheck;
bool _dirChecked;
-3
Ver Arquivo
@@ -145,9 +145,6 @@
<property name="textFormat">
<enum>Qt::AutoText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="margin">
<number>3</number>
</property>
-3
Ver Arquivo
@@ -109,9 +109,6 @@
<property name="textFormat">
<enum>Qt::AutoText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
+1 -4
Ver Arquivo
@@ -17,7 +17,7 @@
<item>
<widget class="QGroupBox" name="generalGroupBox">
<property name="title">
<string>General</string>
<string>General Setttings</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
@@ -77,7 +77,4 @@
</widget>
<resources/>
<connections/>
<buttongroups>
<buttongroup name="proxyButtonGroup"/>
</buttongroups>
</ui>
+1 -1
Ver Arquivo
@@ -20,7 +20,6 @@
#include <QDir>
#include <QListWidget>
#include <QListWidgetItem>
#include <QColorGroup>
#include <QMessageBox>
#include <QInputDialog>
@@ -30,6 +29,7 @@ IgnoreListEditor::IgnoreListEditor(QWidget *parent) :
QDialog(parent),
ui(new Ui::IgnoreListEditor)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
ui->setupUi(this);
ui->descriptionLabel->setText(tr("Files or directories matching a pattern will not be synchronized.\n\n"
-337
Ver Arquivo
@@ -1,337 +0,0 @@
/*
* 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.
*/
#include <QtGui>
#include "mirall/itemprogressdialog.h"
#include "mirall/syncresult.h"
#include "mirall/logger.h"
#include "mirall/utility.h"
#include "mirall/theme.h"
#include "mirall/folderman.h"
#include "mirall/syncfileitem.h"
#include "ui_itemprogressdialog.h"
namespace Mirall {
ItemProgressDialog::ItemProgressDialog(Application*, QWidget *parent) :
QDialog(parent),
ErrorIndicatorRole( Qt::UserRole +1 ),
_ui(new Ui::ItemProgressDialog)
{
_ui->setupUi(this);
connect(_ui->_dialogButtonBox->button(QDialogButtonBox::Close), SIGNAL(clicked()),
this, SLOT(accept()));
connect(ProgressDispatcher::instance(), SIGNAL(progressInfo(QString,Progress::Info)),
this, SLOT(slotProgressInfo(QString,Progress::Info)));
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");
header << tr("Folder");
header << tr("Action");
header << tr("Size");
_ui->_treeWidget->setHeaderLabels( header );
_ui->_treeWidget->setColumnWidth(1, 180);
_ui->_treeWidget->setColumnCount(5);
_ui->_treeWidget->setRootIsDecorated(false);
connect(this, SIGNAL(guiLog(QString,QString)), Logger::instance(), SIGNAL(guiLog(QString,QString)));
QPushButton *copyBtn = _ui->_dialogButtonBox->addButton(tr("Copy"), QDialogButtonBox::ActionRole);
connect(copyBtn, SIGNAL(clicked()), SLOT(copyToClipboard()));
setWindowTitle(tr("Sync Protocol"));
}
void ItemProgressDialog::setSyncResultStatus(const SyncResult& result )
{
if( result.errorStrings().count() ) {
_ui->_errorLabel->setVisible(true);
_ui->_errorLabel->setTextFormat(Qt::RichText);
QString errStr;
QStringList errors = result.errorStrings();
int cnt = errors.size();
bool appendDots = false;
if( cnt > 3 ) {
cnt = 3;
appendDots = true;
}
for( int i = 0; i < cnt; i++) {
errStr.append(QString("%1<br/>").arg(errors.at(i)));
}
if( appendDots ) {
errStr.append(QString("..."));
}
_ui->_errorLabel->setText(errStr);
} else {
_ui->_errorLabel->setText(QString::null);
_ui->_errorLabel->setVisible(false);
}
}
void ItemProgressDialog::setSyncResult( const SyncResult& result )
{
setSyncResultStatus(result);
const QString& folder = result.folder();
qDebug() << "Setting sync result for folder " << folder;
SyncFileItemVector::const_iterator i;
const SyncFileItemVector& items = result.syncFileItemVector();
QDateTime dt = QDateTime::currentDateTime();
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
|| item._instruction == CSYNC_INSTRUCTION_CONFLICT ) {
QStringList columns;
QString timeStr = timeString(dt);
QString longTimeStr = timeString(dt, QLocale::LongFormat);
columns << timeStr;
columns << item._file;
columns << folder;
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 {
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->insertTopLevelItem(0, twitem);
}
}
}
void ItemProgressDialog::setupList()
{
// get the folders to set up the top level list.
Folder::Map map = FolderMan::instance()->map();
SyncResult lastResult;
QDateTime dt;
bool haveSyncResult = false;
foreach( Folder *f, map.values() ) {
if( f->syncResult().syncTime() > dt ) {
dt = f->syncResult().syncTime();
lastResult = f->syncResult();
haveSyncResult = true;
}
}
if( haveSyncResult ) {
setSyncResult(lastResult);
}
QList<Progress::Info> progressList = ProgressDispatcher::instance()->recentChangedItems(0); // All.
QHash <QString, int> folderHash;
foreach( Progress::Info info, progressList ) {
slotProgressInfo( info.folder, info );
folderHash[info.folder] = 1;
}
QList<Progress::SyncProblem> problemList = ProgressDispatcher::instance()->recentProblems(0);
foreach( Progress::SyncProblem prob, problemList ) {
slotProgressErrors(prob.folder, prob);
folderHash[prob.folder] = 1;
}
}
ItemProgressDialog::~ItemProgressDialog()
{
delete _ui;
}
void ItemProgressDialog::copyToClipboard()
{
QString text;
QTextStream ts(&text);
int topLevelItems = _ui->_treeWidget->topLevelItemCount();
for (int i = 0; i < topLevelItems; i++) {
QTreeWidgetItem *child = _ui->_treeWidget->topLevelItem(i);
ts << left
// time stamp
<< 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);
emit guiLog(tr("Copied to clipboard"), tr("The sync protocol has been copied to the clipboard."));
}
void ItemProgressDialog::accept()
{
QDialog::accept();
}
void ItemProgressDialog::cleanErrors( const QString& /* folder */ ) // FIXME: Use the folder to detect which errors can be deleted.
{
_problemCounter = 0;
QList<QTreeWidgetItem*> wipeList;
int itemCnt = _ui->_treeWidget->topLevelItemCount();
for( int cnt = 0; cnt < itemCnt; cnt++ ) {
QTreeWidgetItem *item = _ui->_treeWidget->topLevelItem(cnt);
bool isErrorItem = item->data(0, ErrorIndicatorRole).toBool();
if( isErrorItem ) {
wipeList.append(item);
}
}
qDeleteAll(wipeList.begin(), wipeList.end());
}
QString ItemProgressDialog::timeString(QDateTime dt, QLocale::FormatType format) const
{
QLocale loc = QLocale::system();
QString timeStr;
QDate today = QDate::currentDate();
if( format == QLocale::NarrowFormat ) {
if( dt.date().day() == today.day() ) {
timeStr = loc.toString(dt.time(), QLocale::NarrowFormat);
} else {
timeStr = loc.toString(dt, QLocale::NarrowFormat);
}
} else {
timeStr = loc.toString(dt, format);
}
return timeStr;
}
void ItemProgressDialog::slotProgressErrors( const QString& folder, const Progress::SyncProblem& problem )
{
QStringList columns;
QString timeStr = timeString(problem.timestamp);
QString longTimeStr = timeString(problem.timestamp, QLocale::LongFormat);
columns << timeStr;
columns << problem.current_file;
columns << folder;
QString errMsg = tr("Problem: %1").arg(problem.error_message);
#if 0
if( problem.error_code == 507 ) {
errMsg = tr("No more storage space available on server.");
}
#endif
columns << errMsg;
QTreeWidgetItem *item = new QTreeWidgetItem(columns);
item->setData(0, ErrorIndicatorRole, QVariant(true) );
// Maybe we should not set the error icon for all problems but distinguish
// by error_code. A quota problem is considered an error, others might not??
item->setIcon(0, Theme::instance()->syncStateIcon(SyncResult::Error, true));
item->setToolTip(0, longTimeStr);
_ui->_treeWidget->insertTopLevelItem(0, item);
Q_UNUSED(item);
}
void ItemProgressDialog::slotProgressInfo( const QString& folder, const Progress::Info& progress )
{
if( progress.kind == Progress::StartSync ) {
cleanErrors( folder );
}
if( progress.kind == Progress::EndSync ) {
// decorateFolderItem( folder );
}
// Ingore other events than finishing an individual up- or download.
if( !(progress.kind == Progress::EndDownload || progress.kind == Progress::EndUpload || progress.kind == Progress::EndDelete)) {
return;
}
QStringList columns;
QString timeStr = timeString(progress.timestamp);
QString longTimeStr = timeString(progress.timestamp, QLocale::LongFormat);
columns << timeStr;
columns << progress.current_file;
columns << progress.folder;
columns << Progress::asResultString(progress.kind);
columns << Utility::octetsToString( progress.file_size );
QTreeWidgetItem *item = new QTreeWidgetItem(columns);
item->setToolTip(0, longTimeStr);
_ui->_treeWidget->insertTopLevelItem(0, item);
Q_UNUSED(item);
}
}
-87
Ver Arquivo
@@ -1,87 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Mirall::ItemProgressDialog</class>
<widget class="QWidget" name="Mirall::ItemProgressDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>612</width>
<height>543</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string>Detailed Sync Protocol</string>
</property>
</widget>
</item>
<item>
<widget class="QTreeWidget" name="_treeWidget">
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="rootIsDecorated">
<bool>true</bool>
</property>
<property name="uniformRowHeights">
<bool>true</bool>
</property>
<property name="columnCount">
<number>4</number>
</property>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
<column>
<property name="text">
<string notr="true">2</string>
</property>
</column>
<column>
<property name="text">
<string>3</string>
</property>
</column>
<column>
<property name="text">
<string>4</string>
</property>
</column>
</widget>
</item>
<item>
<widget class="QLabel" name="_errorLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="_dialogButtonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
+2 -33
Ver Arquivo
@@ -52,9 +52,9 @@ LogWidget::LogWidget(QWidget *parent)
LogBrowser::LogBrowser(QWidget *parent) :
QDialog(parent),
_logWidget( new LogWidget(parent) ),
_doFileFlush(false)
_logWidget( new LogWidget(parent) )
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setObjectName("LogBrowser"); // for save/restoreGeometry()
setWindowTitle(tr("Log Output"));
setMinimumWidth(600);
@@ -142,39 +142,8 @@ void LogBrowser::slotNewLog( const QString& msg )
if( _logWidget->isVisible() ) {
_logWidget->appendPlainText( msg );
}
if( _logstream ) {
(*_logstream) << msg << endl;
if( _doFileFlush ) _logstream->flush();
}
}
void LogBrowser::setLogFile( const QString & name, bool flush )
{
if( _logstream ) {
_logFile.close();
}
bool openSucceeded = false;
if (name == QLatin1String("-")) {
openSucceeded = _logFile.open(1, QIODevice::WriteOnly);
} else {
_logFile.setFileName( name );
openSucceeded = _logFile.open(QIODevice::WriteOnly);
}
if(!openSucceeded) {
QMessageBox::warning(
this,
tr("Error"),
QString(tr("<nobr>File '%1'<br/>cannot be opened for writing.<br/><br/>"
"The log output can <b>not</b> be saved!</nobr>"))
.arg(name));
return;
}
_doFileFlush = flush;
_logstream.reset(new QTextStream( &_logFile ));
}
void LogBrowser::slotFind()
{
-3
Ver Arquivo
@@ -64,9 +64,6 @@ private:
QPushButton *_clearBtn;
QLabel *_statusLabel;
QFile _logFile;
bool _doFileFlush;
QScopedPointer<QTextStream> _logstream;
};
} // namespace
+105 -3
Ver Arquivo
@@ -14,19 +14,33 @@
#include "mirall/logger.h"
#include <QDir>
#include <QStringList>
namespace Mirall {
// logging handler.
void mirallLogCatcher(QtMsgType type, const char *msg)
{
Q_UNUSED(type)
// qDebug() exports to local8Bit, which is not always UTF-8
Logger::instance()->mirallLog( QString::fromLocal8Bit(msg) );
}
Logger* Logger::_instance=0;
Logger::Logger( QObject* parent)
: QObject(parent),
_showTime(true)
_showTime(true), _doLogging(false), _doFileFlush(false), _logExpire(0)
{
}
Logger *Logger::instance()
{
if( !Logger::_instance ) Logger::_instance = new Logger;
if( !Logger::_instance ) {
Logger::_instance = new Logger;
qInstallMsgHandler( mirallLogCatcher );
}
return Logger::_instance;
}
@@ -50,7 +64,7 @@ void Logger::postOptionalGuiLog(const QString &title, const QString &message)
void Logger::postGuiMessage(const QString &title, const QString &message)
{
emit postGuiMessage(title, message);
emit guiMessage(title, message);
}
void Logger::log(Log log)
@@ -68,6 +82,15 @@ void Logger::log(Log log)
msg += log.message;
// _logs.append(log);
// std::cout << qPrintable(log.message) << std::endl;
{
QMutexLocker lock(&_mutex);
if( _logstream ) {
(*_logstream) << msg << endl;
if( _doFileFlush ) _logstream->flush();
}
}
emit newLog(msg);
}
@@ -91,4 +114,83 @@ void Logger::mirallLog( const QString& message )
Logger::instance()->log( log_ );
}
void Logger::setLogFile(const QString & name)
{
QMutexLocker locker(&_mutex);
if( _logstream ) {
_logstream.reset(0);
_logFile.close();
}
if( name.isEmpty() ) {
return;
}
bool openSucceeded = false;
if (name == QLatin1String("-")) {
openSucceeded = _logFile.open(1, QIODevice::WriteOnly);
} else {
_logFile.setFileName( name );
openSucceeded = _logFile.open(QIODevice::WriteOnly);
}
if(!openSucceeded) {
locker.unlock(); // Just in case postGuiMessage has a qDebug()
postGuiMessage( tr("Error"),
QString(tr("<nobr>File '%1'<br/>cannot be opened for writing.<br/><br/>"
"The log output can <b>not</b> be saved!</nobr>"))
.arg(name));
return;
}
_logstream.reset(new QTextStream( &_logFile ));
}
void Logger::setLogExpire( int expire )
{
_logExpire = expire;
}
void Logger::setLogDir( const QString& dir )
{
_logDirectory = dir;
}
void Logger::setLogFlush( bool flush )
{
_doFileFlush = flush;
}
void Logger::enterNextLogFile()
{
if (!_logDirectory.isEmpty()) {
QDir dir(_logDirectory);
if (!dir.exists()) {
dir.mkpath(".");
}
// Find out what is the file with the highest nymber if any
QStringList files = dir.entryList(QStringList("owncloud.log.*"),
QDir::Files);
QRegExp rx("owncloud.log.(\\d+)");
uint maxNumber = 0;
QDateTime now = QDateTime::currentDateTime();
foreach(const QString &s, files) {
if (rx.exactMatch(s)) {
maxNumber = qMax(maxNumber, rx.cap(1).toUInt());
if (_logExpire > 0) {
QFileInfo fileInfo = dir.absoluteFilePath(s);
if (fileInfo.lastModified().addSecs(60*60 * _logExpire) < now) {
dir.remove(s);
}
}
}
}
QString filename = _logDirectory + "/owncloud.log." + QString::number(maxNumber+1);
setLogFile(filename);
}
}
} // namespace Mirall

Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais