1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2026-04-03 18:11:32 +02:00

Compare commits

..

654 Commits

Author SHA1 Message Date
Klaas Freitag
3e31d86596 Add missing trailing semicolon as nagged by rpmlint. 2013-09-26 11:13:19 +02:00
Klaas Freitag
ab007e2bb2 Set version to 1.4.1 2013-09-26 10:29:14 +02:00
Klaas Freitag
c45d55b94b Create a rc2. 2013-09-24 12:45:45 +02:00
Klaas Freitag
7048bd8cc9 Handle app icon names properly. 2013-09-24 12:19:29 +02:00
Klaas Freitag
cae6ca987f Revert "Fix application shortname for proper icon"
We must not change the app short name for ownCloud. Too dangerous as it
is used all over.
This reverts commit 65171cfb3a.
2013-09-24 11:48:19 +02:00
Klaas Freitag
65171cfb3a Fix application shortname for proper icon 2013-09-23 18:23:21 +02:00
Klaas Freitag
7ec636aeb6 Added changelog entries. 2013-09-23 16:36:49 +02:00
Klaas Freitag
c96980a57d Set version to 1.4.1rc1 2013-09-23 16:36:36 +02:00
Klaas Freitag
0959ceeff2 Disable delete of folder object temparily. 2013-09-23 15:10:42 +02:00
Klaas Freitag
1988c9d8c4 Do complete sync if network was disconnected.
This fixes owncloud/mirall#1007
2013-09-23 15:10:42 +02:00
Klaas Freitag
1eaa1e47fe Be more careful with items in model when deleting rows. 2013-09-23 15:10:42 +02:00
Klaas Freitag
31923b314e Removed left over stuff from refactoring. 2013-09-23 15:10:42 +02:00
Klaas Freitag
ee840b62e5 Fix syncEnable in folder and folderman. 2013-09-23 15:10:42 +02:00
Daniel Molkentin
363efaa408 Theming build fix: Icons need shortname 2013-09-20 23:09:41 +02:00
Daniel Molkentin
b0beeea95f More fixes related to object destruction on exit
- _logBrowser is not delete on close, call deleteLater
- move writing geometry out of dtor.
- _folderWizard was unused, remove it and all related noops

Hopefully solves #945
2013-09-20 14:18:28 +02:00
Daniel Molkentin
d0a4650d69 Settings: calculate sidebar width dynamically
Fixes #1020
2013-09-20 10:40:22 +02:00
Daniel Molkentin
ec5a84cf01 Pop up config wizard if no server url is configured.
Fixes #1018.
2013-09-19 17:24:22 +02:00
Daniel Molkentin
a057eb8590 Fix focus issue during setup wizard 2013-09-19 14:52:41 +02:00
Daniel Molkentin
6a8753b119 Start only one wizard, delete it when done 2013-09-19 12:11:46 +02:00
Daniel Molkentin
23fab90a31 _tray is a QPointer, not a QScopedPointer 2013-09-18 16:41:37 +02:00
Daniel Molkentin
8fdf9cac6b Try to be more graceful during shutdown
- Do not delete _tray, use deleteLater() via QScropedPointer
- force closing any dialoges that might want to write their
  geometry in aboutToQuit(), before the actual destruction
  of the sync thread, etc starts.

This tries to fix #945
2013-09-18 15:42:35 +02:00
Daniel Molkentin
525d12f5a2 Make "Sync started" message optional
Fixes #934
2013-09-18 14:14:42 +02:00
Daniel Molkentin
15d247a708 Ui::SslErrorDialog belongs within the Mirall namespace 2013-09-18 14:06:23 +02:00
Daniel Molkentin
a1d0b85277 Add copyright header to syncfileitem.h
Fixes #993
2013-09-15 22:49:24 +02:00
Daniel Molkentin
5e5a77b040 Fix parameter order 2013-09-15 22:48:12 +02:00
Daniel Molkentin
e420ae6942 Folder Wizard: Fix various issues
- Use data role for pathes
- call root dir "ownCloud"
- don't connect() multiple times
- ensure chars like # or ? in path are interpreted as part of the url path segment

Should fix #992
2013-09-15 22:47:35 +02:00
Daniel Molkentin
0be7c0273e Replace forgotton 22px app icon version which was still s/w 2013-09-15 00:48:06 +02:00
Daniel Molkentin
864b7cd41e Merge pull request #998 from owncloud/fixing-mb-1.4
Fixing mb 1.4
2013-09-13 11:11:43 -07:00
Thomas Müller
78c8f13645 fixing testOctetsToString 2013-09-13 17:30:53 +02:00
Thomas Müller
c87c456ae0 moving back to 1024 as divider for kB, MB, GB & TB 2013-09-13 15:00:49 +02:00
hefee
94d9b8fb39 Don't ship doc/scripts/README.rst via sphinx 2013-09-13 02:26:21 +02:00
Daniel Molkentin
2dad027001 Do not build org and com theming when building from tar ball
Fixes #989
2013-09-12 12:55:12 +02:00
Daniel Molkentin
f97bb240d7 Setting thread priority is only possible after calling start() 2013-09-11 15:52:07 +02:00
Klaas Freitag
80332fb6ab 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:30:29 +02:00
Klaas Freitag
287ec2f3df Enable and disable syncing also in the folder objects. 2013-09-11 10:50:03 +02:00
Klaas Freitag
eb5824f713 Handle startup network errors correctly. 2013-09-11 10:49:45 +02:00
Klaas Freitag
eded901f69 Minor code cleanups- 2013-09-11 10:49:10 +02:00
Daniel Molkentin
fd30df82cb 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:38:00 +02:00
Daniel Molkentin
d8888432c3 Send basic auth in utf8.
Implies circumventing QAuthenticator and handling
authentication manually again.

Fixes #941
2013-09-10 23:04:10 +02:00
morriswinkler
51712fea53 Update building.rst
eider fix it or add the note here
2013-09-10 12:15:16 +02:00
Daniel Molkentin
f597f99198 Wait up to 30 secs before complaining about missing systray
Conflicts:
	src/mirall/utility.cpp

Fixes #949
2013-09-10 11:40:02 +02:00
Klaas Freitag
74ec37f3c7 Use List to handle errors and display multiline. 2013-09-05 19:25:59 +02:00
Daniel Molkentin
05178f0fbf Fix locating translations on linux 2013-09-05 11:06:40 +02:00
Daniel Molkentin
9ce09713b6 1.4.0 final 2013-09-04 11:09:12 +02:00
Klaas Freitag
4fa6faf608 Hide quota and display explanation if no quota info is available. 2013-09-03 14:25:28 +02:00
Klaas Freitag
a24ae13d9c Added logging to quota info result slot. 2013-09-03 14:25:28 +02:00
Daniel Molkentin
64dd0d1b45 Consistent look for top-labels 2013-09-03 14:24:34 +02:00
Daniel Molkentin
da63b1223c Doc: more polishing
- add description of syncing limitations
- update out-of-date comments

Fixes #788
2013-09-03 12:35:40 +02:00
Jenkins for ownCloud
36f32c2aef [tx-robot] updated from transifex 2013-09-03 06:30:41 -04:00
Daniel Molkentin
063acadc3b Doc: new interface chapter 2013-09-02 19:28:06 +02:00
Klaas Freitag
81c720c05b Remove dots from the end of error messages. 2013-09-02 17:37:16 +02:00
Klaas Freitag
edcdcb945a Show the reason why a file was ignored. 2013-09-02 17:25:23 +02:00
Daniel Molkentin
5df6430bb2 Doc: Do not enforce theme when building without submodules 2013-09-02 15:55:03 +02:00
Daniel Molkentin
9a0096d07c Docs: Allow to build with org and com branding 2013-09-02 14:01:15 +02:00
Jenkins for ownCloud
25d33d6057 [tx-robot] updated from transifex 2013-09-01 12:30:19 -04:00
Daniel Molkentin
ab4c6247c7 Fix display of "Monochrome icon" setting
The logic was inverse, and there was a typo in the string. Oh my...
2013-08-31 14:14:24 +02:00
Jenkins for ownCloud
1b69dbb38b [tx-robot] updated from transifex 2013-08-30 09:22:37 -04:00
Daniel Molkentin
bfdd488b00 Tests: make tests run in parallel 2013-08-29 14:50:55 +02:00
Daniel Molkentin
54c8809bf4 Tests: Fix indentation 2013-08-29 14:50:18 +02:00
Daniel Molkentin
0873665bec Tests: Move all comparisons from QVERIFY to QCOMPARE 2013-08-29 14:48:40 +02:00
Olivier Goffart
02b3033ca3 Use the same convention as on the server to format strings
* use power of 10 SI units
 * use "B" instead of "bytes"
 * use at least 2 significant digit, but no more than one digit after
   the period
2013-08-29 12:06:41 +02:00
Olivier Goffart
a27c8ad90c Fix crash in case of error
the QObject::parent() is 0
2013-08-28 21:26:42 +02:00
Daniel Molkentin
18a58f73de Startup: Unity has no proper Systray implementation
...so it can't respond to isSysTrayAvailable()
2013-08-28 15:45:52 +02:00
Daniel Molkentin
d1451a3c90 Mac: Use hdiutil attach instead of open during signing 2013-08-28 12:53:34 +02:00
Jenkins for ownCloud
0bef47b2f3 [tx-robot] updated from transifex 2013-08-28 05:24:20 -04:00
Jenkins for ownCloud
ccc05d6658 [tx-robot] updated from transifex 2013-08-27 10:23:30 -04:00
Olivier Goffart
c15de69156 Reconfigure the proxy when needed 2013-08-27 10:02:59 +02:00
Thomas Müller
8bfb44fd28 Inverting the logic to set the prefix for SYSCONF_INSTALL_DIR 2013-08-26 22:42:17 +02:00
Daniel Molkentin
79d3b84fad Reintroduce workaround for /etc in root if files go to /usr 2013-08-26 21:59:52 +02:00
Daniel Molkentin
b97701586e Properly install icons 2013-08-26 21:18:56 +02:00
Daniel Molkentin
b120345fe7 Icon file needs to use app_executable as well 2013-08-26 20:54:10 +02:00
Daniel Molkentin
ec5c65a530 install correct file 2013-08-26 20:35:56 +02:00
Daniel Molkentin
77e7a1fa8d Fix casing in settings dialog 2013-08-26 20:22:24 +02:00
Daniel Molkentin
f6d45b68ef More clear error messages 2013-08-26 20:20:10 +02:00
Daniel Molkentin
24d76a0d75 desktop file == executable 2013-08-26 20:20:10 +02:00
Olivier Goffart
c3326efe94 Do not sort the entries in the syc protocol dialog alphabetically
The entries should be sorted chronogically.  But now the QTreeWidget can
only sort them alphabetically by the time,  which is not what we want.
Disalbe the sorting, and always insert the elements in the reverse
order.

Fix #890
2013-08-26 17:27:44 +02:00
Daniel Molkentin
c0e056bb84 Only show help if a URL is provided 2013-08-26 14:27:39 +02:00
Jenkins for ownCloud
8a7df36701 [tx-robot] updated from transifex 2013-08-25 18:19:18 -04:00
Jenkins for ownCloud
39ec6b1bb2 [tx-robot] updated from transifex 2013-08-23 19:15:56 -04:00
Daniel Molkentin
30b2406533 Fix windows packaging 2013-08-23 15:37:24 +02:00
Daniel Molkentin
076d5dda0e RC1 2013-08-23 14:35:15 +02:00
Olivier Goffart
e78eab46ff Fix saving the geometry of the log browser 2013-08-23 12:41:29 +02:00
Olivier Goffart
19a08f8d5e Make remember the size of the settings dialog
Before, we saved the geometry in the closeEvent which is only called if
the user press the [x] in the title bar.  But it is not called when the
user accept the dialog (by pressing the close button or the enter key)
So save the geometry in the destructor of the dialog instead.

One also must call delete from the Application destructor because it was
leaking
2013-08-23 12:25:16 +02:00
Olivier Goffart
c6319117fd Better default size for the setting dialog 2013-08-23 11:59:49 +02:00
Olivier Goffart
4c10ed4ada Remove some entries from the default exclude list.
If the user really want to have those entries excluded it can add them
manually.
But one cannot change the default so if user want the .bak files synced,
he would not be able to do it
2013-08-23 11:17:02 +02:00
Daniel Molkentin
b0ab3ca80b Theme: Add documentation after recent changes 2013-08-23 10:36:09 +02:00
Daniel Molkentin
9f89a2fe76 More adjustments around the application name
- libname is now derived from binary name (which is lowercase)
- remove superflouos reimplementation of appName() in owncloud theme
- APPLICATION_SHORTNAME is now optional (and if not set, equals
  APPLICATION_NAME
2013-08-23 10:30:03 +02:00
Daniel Molkentin
e386bfb550 fix x-compilation 2013-08-23 00:36:05 +02:00
Jenkins for ownCloud
0189a3f1bd [tx-robot] updated from transifex 2013-08-22 10:35:38 -04:00
Olivier Goffart
d3a333e03c Fix the 'copy button' in the protocol log
Fix #863

Also added more padding for the filename because it might be big, and in
case it's not enough, always add at least a space.
2013-08-22 16:20:04 +02:00
Olivier Goffart
04d3e282fb Stop the poll timer when the folder is disabled
No need to request etag every 30 second for disabled folder.

When the folder is re-enabled, the Timer is actived again after the sync
2013-08-22 12:35:28 +02:00
Olivier Goffart
4be5f970d5 Default to no limit upload
We don't want to make the transfer slow by default
2013-08-22 12:26:34 +02:00
Daniel Molkentin
31ceff181e Amendment to last commit 2013-08-22 09:51:35 +02:00
Daniel Molkentin
42abf4101c Honor cmake's install prefix
since the entire ting is so incredibly broken in cmake,
use the approach taken by csync (which emulates the
approach of autotools), to get the directories right.

This mandates changes in the theme, which need discussion
(APPLICATION_SHORTNAME must now equal appName(), and
APPLICATION_NAME should equal appGuiName()).
2013-08-22 09:40:25 +02:00
Daniel Molkentin
f09cae74fb Merge pull request #897 from onnozweers/patch-1
Adding "Type=Application" to desktop file (to fix autostart in Ubuntu)
2013-08-21 16:50:25 -07:00
onnozweers
13a6393ec5 Adding "Type=Application" to desktop file (to fix autostart in Ubuntu) 2013-08-21 22:11:02 +02:00
Jenkins for ownCloud
ace57f9dd4 [tx-robot] updated from transifex 2013-08-21 07:10:45 -04:00
Daniel Molkentin
e5117a98c9 Quota bar: Reduce border width to 1px per request
As requested by Jan
2013-08-21 11:34:49 +02:00
Daniel Molkentin
c1f7af7e6f Write desktop file manually, add gnome startup property
Fixes #893
2013-08-21 11:09:56 +02:00
Olivier Goffart
b4c116e2a2 Add the new directories comming from the sync in the watcher 2013-08-21 00:45:36 +02:00
Jenkins for ownCloud
a19a960b5e [tx-robot] updated from transifex 2013-08-19 14:08:05 -04:00
Olivier Goffart
29d2094626 Hide password in the account settings
Fix #811
2013-08-19 13:42:01 +02:00
Klaas Freitag
c3b82e6818 Fix sequence for recently changed items. 2013-08-19 13:06:48 +02:00
Olivier Goffart
1a7c89326b Fix crash when finishing the wizard
As shown on this backtrace:

=13334== Invalid read of size 8
QCoreApplication::postEvent(QObject*,QEvent*, int)
Mirall::ownCloudInfo::slotReplyFinished()
[...]

==13334==  Address 0x1afb91d8 is 8 bytes inside a block of size 16 free'd
operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
QNetworkAccessManager::~QNetworkAccessManager()
Mirall::MirallAccessManager::~MirallAccessManager()
[...]
Mirall::ownCloudInfo::setNetworkAccessManager(QNetworkAccessManager*)
Mirall::ownCloudInfo::setCustomConfigHandle(QString const&)
Mirall::OwncloudSetupWizard::slotAssistantFinished(int)
[...]
Mirall::OwncloudWizard::basicSetupFinished(int)
Mirall::OwncloudWizard::slotCurrentPageChanged(int)
[...]
QWizard::currentIdChanged(int) (in
Mirall::OwncloudWizard::successfulStep()
Mirall::OwncloudSetupWizard::finalizeSetup(bool)
Mirall::OwncloudSetupWizard::slotAuthCheckReply(QString const&,
[...]
Mirall::ownCloudInfo::ownCloudDirExists(QString const&, QNetworkReply*)
Mirall::ownCloudInfo::slotReplyFinished()

The QNetworkManager was destroyed in a slot connected to a signal emited
by slotReplyFinished,  but we did not finish with the QNetworkReply yet.

Fix the crash by using QueuedConnection so the QNetworkAccessManager is
not destroyed before slotReplyFinished has completed.
2013-08-19 12:43:52 +02:00
Daniel Molkentin
3a1f04ac2d Allow folders with characters that need percent-encoding
Fixes #191
2013-08-18 20:24:24 +02:00
Daniel Molkentin
2c8e95a0f4 Be more specific when disconnecting the signal
Fixes a crash, amends be48cb646c
2013-08-18 19:41:01 +02:00
Klaas Freitag
a9d94ef732 Show error message in status dialog in error case. 2013-08-18 19:27:20 +02:00
Klaas Freitag
2756d17873 Fix/add missing status strings to theme. 2013-08-18 19:20:25 +02:00
Klaas Freitag
34d7f84fc2 Minor cleanup. 2013-08-18 17:59:03 +02:00
Daniel Molkentin
cea9b389bf Account Settings: Use native highlight color 2013-08-18 17:00:37 +02:00
Daniel Molkentin
71b1e881d8 Setup Wizard: Only label button "Connect" where suitable 2013-08-18 15:23:52 +02:00
Daniel Molkentin
7ba47e9d44 Code formatting fixes 2013-08-18 15:23:52 +02:00
Daniel Molkentin
be48cb646c Setup wizard: Start sync when displaying result page 2013-08-18 15:23:52 +02:00
Klaas Freitag
47eb5ff1d9 Do not keep the log if the log window is not visible. 2013-08-18 13:28:40 +02:00
Klaas Freitag
b608f5a670 Progressbar and quota bar tweaking. 2013-08-17 22:56:02 +02:00
Klaas Freitag
e81dc34c4e Add a tooltip in the sync protocol list. 2013-08-17 17:57:33 +02:00
Klaas Freitag
1603e627a3 Remove superflous conflict case. 2013-08-17 17:57:33 +02:00
Klaas Freitag
bf978b3e0f Handle Progress as a namespace rather than a class. 2013-08-17 17:57:33 +02:00
Klaas Freitag
0fdaf33288 Use correct translation call from QCoreApplication. 2013-08-17 17:57:33 +02:00
Klaas Freitag
367c4153c1 Show a bubble if the quota was exceeded. 2013-08-17 17:57:33 +02:00
Klaas Freitag
395c673a24 Fix the quota bar for quotas larger 100%. 2013-08-17 17:57:32 +02:00
Olivier Goffart
22de23c651 Fix the 'no limit' upload setting
Fix issue #879
2013-08-17 16:11:45 +02:00
Olivier Goffart
23926d2461 small leak 2013-08-16 20:18:35 +02:00
Olivier Goffart
c03f31b6ba put the 'Account' item first 2013-08-16 15:09:54 +02:00
Olivier Goffart
a1060a8538 fixup the layout of the account settings 2013-08-16 15:03:38 +02:00
Daniel Molkentin
24251bc223 Add "Keyword" to the desktop template
Fixes #876
2013-08-16 12:29:11 +02:00
Jenkins for ownCloud
f78749d2cd [tx-robot] updated from transifex 2013-08-15 16:57:02 -04:00
Daniel Molkentin
0995377d39 1.4.0 beta2 2013-08-15 17:32:46 +02:00
Daniel Molkentin
b9228e64ff Make Folder Reset an expert option (F5)
This feature should not be required, but might be helpful
in the debugging process.
2013-08-15 17:00:07 +02:00
Olivier Goffart
c4084de716 Remove the 'Remove Account' button
It is not doing anything right now, and we have no plans to implement it
in a short future

Fix Issue #866
2013-08-15 16:42:08 +02:00
Olivier Goffart
3c667918e7 Fix Reconfiguration keeps sync folder definition
Issue #875
2013-08-15 16:35:03 +02:00
Olivier Goffart
e55745cbcf Remove connection from unexisting signal to unexisting slot 2013-08-15 16:16:22 +02:00
Daniel Molkentin
e01ce20431 Wizard: Do not use FormLayout for URL line edit
Looks ugly on Mac

Fixes #870
2013-08-15 15:58:20 +02:00
Olivier Goffart
dce8cb83d9 Do not forget the config on the second page of the wizzard
Fixes mirral issue #874 where certificate was not stored on the first
page
2013-08-15 15:45:16 +02:00
Olivier Goffart
8dc956c55b Put all the debug in the log window
Don't emit debug before we installed the hook and created he log window
Also no debug if we use --help
2013-08-15 15:45:16 +02:00
Daniel Molkentin
6c77921a32 Admendment of last commit 2013-08-15 13:09:20 +02:00
Daniel Molkentin
55e4748f06 allow relative directories for --confdir 2013-08-15 13:01:05 +02:00
Daniel Molkentin
5ff9e02517 Implement --logfile - (log to stdout) 2013-08-15 12:24:52 +02:00
Daniel Molkentin
7f7ebc36f5 Fix showing help when app is running 2013-08-15 12:24:52 +02:00
Klaas Freitag
0e5bfc03ce Removed label on request of Jan. 2013-08-15 12:17:01 +02:00
Klaas Freitag
b309d333a6 Minor wording and margin fixes. 2013-08-15 11:30:48 +02:00
Daniel Molkentin
ee439382ed Logger: always log to log widget 2013-08-15 10:56:16 +02:00
Klaas Freitag
192212c682 Handle quota exceeding as error. 2013-08-15 08:15:43 +02:00
Klaas Freitag
148bdfdcd6 Some minor cleanups. 2013-08-15 08:15:43 +02:00
hefee
066c0ba189 Make building documantation parallelable.
sphinx will fail in a race condition, if every sphinx target
uses the same CACHE dir:

Exception occurred:
	File "/usr/lib/pymodules/python2.7/sphinx/cmdline.py", line 189, in main
app.build(force_all, filenames)
	File "/usr/lib/pymodules/python2.7/sphinx/application.py", line 204, in build
self.builder.build_update()
	File "/usr/lib/pymodules/python2.7/sphinx/builders/__init__.py", line 196, in build_update
	'out of date' % len(to_build))
	File "/usr/lib/pymodules/python2.7/sphinx/builders/__init__.py", line 238, in build
self.env.topickle(path.join(self.doctreedir, ENV_PICKLE_FILENAME))
	File "/usr/lib/pymodules/python2.7/sphinx/environment.py", line 351, in topickle
	movefile(filename + '.tmp', filename)
	File "/usr/lib/pymodules/python2.7/sphinx/util/osutil.py", line 104, in movefile
os.rename(source, dest)
	OSError: [Errno 2] No such file or directory
2013-08-15 02:36:44 +02:00
Daniel Molkentin
9651f1cddf Folder Wizard: Decode percent encoding 2013-08-14 19:24:02 +02:00
Daniel Molkentin
5feb9b0806 folderwizard: layout fixes 2013-08-14 19:24:02 +02:00
Klaas Freitag
44b9ee19e7 Flatten the itemprogressdialog and show a flat list. 2013-08-14 18:24:06 +02:00
Klaas Freitag
cc16d19bc4 Removed unused defines. 2013-08-14 18:24:06 +02:00
Klaas Freitag
b96c2de2b7 Cleaned folder class, removed a couple of signals and helper classes. 2013-08-14 18:24:06 +02:00
Klaas Freitag
f882b80708 Fix wording to more consolidated style, Jan request. 2013-08-14 18:24:06 +02:00
Daniel Molkentin
4d7c014b23 Resize dialog 2013-08-14 17:47:10 +02:00
Daniel Molkentin
1f274699e5 Pressing F12 in Settings now open the log browser 2013-08-14 17:46:58 +02:00
Daniel Molkentin
697e355f07 Hide mono icon options if the resource has no mono icons 2013-08-14 16:35:42 +02:00
Olivier Goffart
e89bdfc422 Make the Pause button stop the sync 2013-08-14 14:57:56 +02:00
Olivier Goffart
c2cc9e62a7 Fix the brandwith limit
The unit in mirall are in kbytes/s,  but csync expect  byte/s
2013-08-14 14:57:56 +02:00
Daniel Molkentin
1f2ae0d061 Folder Wizard UI clean up
Input from Jan
2013-08-14 14:01:33 +02:00
Olivier Goffart
91a39588c6 re-enable the sync if the syncing was disabled because the connection is down at startup 2013-08-14 12:59:56 +02:00
Olivier Goffart
a642f86d5b Detect connection failure from the polling 2013-08-14 12:34:03 +02:00
Olivier Goffart
00cf290574 reduce a bit the log output 2013-08-14 12:34:03 +02:00
Daniel Molkentin
b59952b539 Wrap custom message label 2013-08-14 11:58:03 +02:00
Daniel Molkentin
88b4ff9809 Wording changes proposed by Jan 2013-08-14 11:57:19 +02:00
Daniel Molkentin
ddd0965a82 Fix include after class rename 2013-08-14 11:11:47 +02:00
Klaas Freitag
0a9491ff46 Improved timestamp formatting in item sync progress dialog. 2013-08-14 08:04:46 +02:00
Klaas Freitag
32b44e3d87 Removed unused dialog class. 2013-08-14 08:04:46 +02:00
Klaas Freitag
268004b4ff Get correct action kind from progress Dispatcher in case of Context
kind.
2013-08-14 08:04:46 +02:00
Daniel Molkentin
6c0f6ae62e Make copy action copy all fields again
Fixes #863
2013-08-13 15:39:28 +02:00
Jenkins for ownCloud
094f2bb540 [tx-robot] updated from transifex 2013-08-13 08:12:11 -04:00
Daniel Molkentin
f4da7f1fb0 Merge pull request #857 from Arakmar/hiddenFix
Don't add empty entries in hidden files editor with an empty string or when cancel is clicked
2013-08-13 03:43:02 -07:00
Yoann Laissus
b058185d3b Don't add empty entries in hidden files editor with an empty string
or when cancel is clicked
2013-08-12 13:10:16 +02:00
Jenkins for ownCloud
eecb981736 [tx-robot] updated from transifex 2013-08-11 07:07:58 -04:00
Daniel Molkentin
46b870e260 Revert "run tests verbosely"
This reverts commit ff2d59d32f.
2013-08-09 14:45:49 +02:00
Olivier Goffart
1ffab7337d add the temporary downloaded files to the exclude list 2013-08-09 14:10:21 +02:00
Olivier Goffart
82fb8c49cf Do not clear the pending event in the polling anymore
This is useless,  and can even cause problems now since polling only do
a sync when the server has actually changed
2013-08-09 14:10:21 +02:00
Daniel Molkentin
ff2d59d32f run tests verbosely 2013-08-09 13:27:05 +02:00
Daniel Molkentin
0ced165b3e Add tests for Utility namespace 2013-08-09 13:09:41 +02:00
Daniel Molkentin
d3378c131a Fix formatting for 1 byte size in octetsToString() 2013-08-09 13:02:24 +02:00
Jenkins for ownCloud
0300a85295 [tx-robot] updated from transifex 2013-08-09 07:01:08 -04:00
Daniel Molkentin
60a116f3e0 Add tests for Utility namespace 2013-08-09 12:56:43 +02:00
Daniel Molkentin
ff4d2d488f Add cancel button to wizard on Mac
Fixes #848
2013-08-09 01:08:46 +02:00
Daniel Molkentin
b0852b4cf5 No ... for entires that do not spawn a dialog 2013-08-08 20:27:16 +02:00
Daniel Molkentin
c047b4d4de Seems autowrapping doesn't work everywhere. Enforce it 2013-08-08 17:52:09 +02:00
Olivier Goffart
6655da9d24 Fix warning 2013-08-08 16:03:57 +02:00
Daniel Molkentin
cc6abfc366 ChangeLog: 1.4.0beta1 2013-08-08 15:51:48 +02:00
Daniel Molkentin
4e3d4c3153 Credits: Add Jan 2013-08-08 15:51:36 +02:00
Daniel Molkentin
c323041040 NSIS: install libjpeg for qjpeg4.dll 2013-08-08 15:39:34 +02:00
Daniel Molkentin
95d600c5f1 Fix proxy documentation, explain bandwidth limiter 2013-08-08 14:54:52 +02:00
Olivier Goffart
52a47fbc67 Force a sync run after 5 minutes 2013-08-08 14:32:14 +02:00
Klaas Freitag
4e7c069c1f Some adds to the architecture documentation. 2013-08-08 14:19:13 +02:00
Klaas Freitag
f89ffa513a Bump version to 1.4.0beta1 2013-08-08 13:08:23 +02:00
Daniel Molkentin
0086916b4d Retain all old settings when running the setup wizard
Fixes #825
Fixes #759
2013-08-08 13:04:05 +02:00
Klaas Freitag
df5ef6fe67 Added new information icon. 2013-08-08 11:16:28 +02:00
Klaas Freitag
c9e51dcfc1 Display properly elided text in progress. 2013-08-08 11:16:28 +02:00
Daniel Molkentin
c05adfd817 Open Top-Level-Dialogs modal, not semi-modal 2013-08-08 10:36:09 +02:00
Daniel Molkentin
055410e38f Setup proxy connection before every sync 2013-08-08 00:46:23 +02:00
Daniel Molkentin
6163de378e Merge pull request #840 from owncloud/network-icon
Proper network icon for the nice new settings dialog.
2013-08-07 13:27:00 -07:00
Jan-Christoph Borchardt
22938cd697 Proper network icon for the nice new settings dialog. 2013-08-07 21:04:27 +02:00
Daniel Molkentin
a493f81ec2 Windows Installer: Add jpeg,gif,ico image formats 2013-08-07 16:24:10 +02:00
Krzesimir Nowak
87cb2a7114 Set busy cursor when doing page loading in browser. 2013-08-07 15:05:42 +02:00
Krzesimir Nowak
a875b46a80 Add cookie handling for Shibboleth credentials.
Which cookies are going to be stored are determined only when setting
up or modifying an account. Cookie handling allow us to avoid choosing
Identity Provider everytime when browser page appears.
2013-08-07 15:03:13 +02:00
Krzesimir Nowak
704ba791fd Fail the sync if we close the browser without passing proper credentials. 2013-08-07 15:03:13 +02:00
Daniel Molkentin
c24d6bd71c Notify user if there is a problem with the inotify watcher 2013-08-07 15:00:10 +02:00
Daniel Molkentin
9b319cf189 Significantly simply logging 2013-08-07 15:00:10 +02:00
Klaas Freitag
1a9eb19f0d Fix even more compile warnings. 2013-08-07 14:51:31 +02:00
Klaas Freitag
1943cc60b6 Added missing switch cases to calm compiler warnings. 2013-08-07 14:46:57 +02:00
Jenkins for ownCloud
761c05c358 [tx-robot] updated from transifex 2013-08-07 08:01:30 -04:00
Daniel Molkentin
b08c1ada02 -Wno-long-long required due to Qt headers 2013-08-07 13:19:21 +02:00
Daniel Molkentin
dab17e381c Merge pull request #836 from krnowak/warnings
Add -Wall -Wextra -Wpedantic (or -pedantic) warnings by default.
2013-08-07 04:08:26 -07:00
Krzesimir Nowak
114f66f297 Add -Wall -Wextra -Wpedantic (or -pedantic) warnings by default.
This also introduces a MIRALL_FATAL_WARNINGS to enable a -Werror for
GNU compilers and clang.

MSVC compilers are yet to be handled.
2013-08-07 12:54:34 +02:00
Daniel Molkentin
f8878833de Fix compiler warning 2013-08-07 12:18:44 +02:00
Klaas Freitag
364d4340fd Show a more informative problem message in progress. 2013-08-07 12:15:28 +02:00
Klaas Freitag
6226a6ee8f Enable delete messages for progress display. 2013-08-07 10:28:34 +02:00
Daniel Molkentin
c49edeb09d Fix regression in FolderWizard over 1.3
Now it's possible to also pick subdirectory
of in arbitrary depths again
2013-08-06 21:50:22 +02:00
Klaas Freitag
7e794cd94f Tell the progress dialog about a new sync result object. 2013-08-06 18:07:59 +02:00
Klaas Freitag
933a62de01 Add recent action entries in correct sequence to menu. 2013-08-06 18:07:31 +02:00
Klaas Freitag
23f8e3b4f8 Allow Delete notification. 2013-08-06 18:06:54 +02:00
Klaas Freitag
3502edf71b More detailed strings for the progress kind. 2013-08-06 18:06:39 +02:00
Klaas Freitag
4d8a371e43 Display information from SyncResult. 2013-08-06 18:06:05 +02:00
Klaas Freitag
01fd3242c4 Add folder alias to sync result structure. 2013-08-06 18:04:42 +02:00
Klaas Freitag
9c289334e9 Handle notifications for deletes. 2013-08-06 18:04:08 +02:00
Krzesimir Nowak
002142539b Remove most of the dead code in Shibboleth setup page.
The effect of most of the code wasn't even visible after making a
browser an independent window.
2013-08-06 14:56:26 +02:00
Krzesimir Nowak
e1d1c10fad Fix workflow in wizard.
Pressing back in third window should show us browser again. Closing
browser window should show us server setup window again.
2013-08-06 14:35:11 +02:00
Krzesimir Nowak
577bc546d8 Handle SSL problems also for Shibboleth servers. 2013-08-06 11:56:27 +02:00
Daniel Molkentin
85a832fb7c NSIS: Add WebKit dll 2013-08-05 23:25:14 +02:00
Olivier Goffart
a9f23a8331 Get the etag of all subfolder for the root directory
The root directory etag is not updated when the files change.
That's why we need to check the etag of all its sub items
2013-08-05 20:13:39 +02:00
Olivier Goffart
5d24599546 Fetch the etag of the folder to see if it has changed before syncing
Notice that this does not work for the toplevel directory yet, as
owncloud does not change the etag of the root folder
2013-08-05 20:13:39 +02:00
Olivier Goffart
07d9d3770b Refactor: move the pollTimer to the folder 2013-08-05 20:13:39 +02:00
Daniel Molkentin
c9ddb12b5a Build after merge 2013-08-05 20:14:22 +02:00
Daniel Molkentin
0932ee6051 Merge branch 'shibboleth'
Conflicts:
	src/CMakeLists.txt
	src/mirall/application.h
2013-08-05 19:54:06 +02:00
Daniel Molkentin
ee1b8465a3 Revert "Temporarily log HTTP traffic done by MirallAccessManager."
This reverts commit 5930ca8ac7.
2013-08-05 19:47:48 +02:00
Daniel Molkentin
26bd164168 Safer implementation for substitution of WebDav URL
- Use of RegEx is dangerous with folder names
  containing e.g. '(' or ')'.
- Didn't work in my case at all.
2013-08-05 19:45:24 +02:00
Krzesimir Nowak
00e819bd92 Make sure we don't append several copies of cookies for syncing.
Also, make sure we don't append old Shibboleth ones as well.
2013-08-05 18:39:26 +02:00
Krzesimir Nowak
740d33b378 Revert "Go back if browser in wizard is destroyed before getting a cookie."
This reverts commit da370c8b36.
2013-08-05 17:57:32 +02:00
Krzesimir Nowak
f0b284eda7 Refresh Shibboleth cookie if it gets outdated during sync. 2013-08-05 17:42:03 +02:00
Krzesimir Nowak
da370c8b36 Go back if browser in wizard is destroyed before getting a cookie. 2013-08-05 17:29:11 +02:00
Olivier Goffart
203b9c7f6b leak fix 2013-08-05 16:49:18 +02:00
Daniel Molkentin
7932ec3cc1 IgnoreListEditor: slightly better text 2013-08-05 16:26:17 +02:00
Daniel Molkentin
3f15e02881 Add support for deletable ignores in IgnoreListEditor. 2013-08-05 16:13:26 +02:00
Olivier Goffart
6fb5c04bde Finish danimo's patch that refactor the scheduler
Wait a full poll interval after the end of the sync
2013-08-05 15:15:15 +02:00
Olivier Goffart
578bcc3522 Remove scheduler logic from folderman and moved it in folderman
Also fetch and parse the etag when doing a PROPFIND to get the quota

(Patch from danimo)
2013-08-05 15:15:15 +02:00
Daniel Molkentin
99dea76fd1 Fix path display in folder wizard
The new implementation did not work correctly when owncloud is installed
in a subdirectory.
2013-08-05 14:28:05 +02:00
Jenkins for ownCloud
b680540adf [tx-robot] updated from transifex 2013-08-05 06:54:39 -04:00
Klaas Freitag
67f57a443c Disable unknown csync flags for now. 2013-08-05 12:30:24 +02:00
Klaas Freitag
2b3b4f9daf Start setup wizard if no config exists on startup. 2013-08-05 12:19:53 +02:00
Klaas Freitag
ba01a697e6 Renamed test case to get rid of stinking name. 2013-08-05 09:39:06 +02:00
Klaas Freitag
16d81db117 Show deletes in progress. 2013-08-05 09:39:06 +02:00
Jenkins for ownCloud
4ce92f1a98 [tx-robot] updated from transifex 2013-08-04 01:26:52 -04:00
Jenkins for ownCloud
21c63637bd [tx-robot] updated from transifex 2013-08-03 01:27:06 -04:00
Klaas Freitag
18f764e4d5 Fix a typo. 2013-08-02 21:55:09 +02:00
Krzesimir Nowak
5930ca8ac7 Temporarily log HTTP traffic done by MirallAccessManager.
To be reverted later.
2013-08-02 14:30:15 +02:00
Klaas Freitag
49be4a3be2 Propagate soft errors into SyncResult, icon fixes. 2013-08-02 14:22:01 +02:00
dragotin
1e50620f53 Merge pull request #822 from RealRancor/master
Updated options with missing cl switches - thanks a lot :)
2013-08-02 03:19:24 -07:00
Klaas Freitag
5e82dc1841 Some more refinements on item progress 2013-08-02 12:16:21 +02:00
RealRancor
33d76962a7 Updated options with missing cl switches 2013-08-02 11:59:57 +02:00
Klaas Freitag
6ce1c17ee1 Give application class control over itemprogressdialog 2013-08-02 11:33:45 +02:00
Jenkins for ownCloud
8d9b4d3669 [tx-robot] updated from transifex 2013-08-02 01:27:17 -04:00
Krzesimir Nowak
fb79b8a7f8 Omit the server setup page in wizard if URL is overriden by theme. 2013-08-01 19:17:41 +02:00
Krzesimir Nowak
b0236eaa24 Fix folder item being inactive. 2013-08-01 19:11:05 +02:00
Daniel Molkentin
19bbff708e Improve FolderWizard 2013-08-01 18:22:13 +02:00
Klaas Freitag
1399ea13cc Fixed rounding of size display. 2013-08-01 16:58:36 +02:00
Klaas Freitag
a25d9fd3b4 Added itemprogressdialog class to show the sync progress and problems. 2013-08-01 16:58:36 +02:00
Krzesimir Nowak
72d51e4667 Show browser as independent window instead of putting it into dialog.
When browser is shown, dialog is hidden. It reappears after we are
done with logging in.
2013-08-01 16:53:43 +02:00
Krzesimir Nowak
f6e3838eb2 Create a QNetworkAccessManager subclass which sets proper user agent and use it. 2013-08-01 16:53:43 +02:00
Krzesimir Nowak
c1fdecae2d Fix misc warnings. 2013-08-01 16:53:43 +02:00
Krzesimir Nowak
4104db65bb Remove unused method. 2013-08-01 16:53:43 +02:00
Krzesimir Nowak
36cb827406 Print correct subtitles when modifying account details. 2013-08-01 16:53:43 +02:00
Krzesimir Nowak
69a4558fe4 Actually use the remoteFolder sent by signal. 2013-08-01 16:53:43 +02:00
Krzesimir Nowak
928eae419f Hide resolution widget in advanced setup page if nothing has changed. 2013-08-01 16:53:43 +02:00
Krzesimir Nowak
50edac8ee8 Split setup page into server and advanced parts. 2013-08-01 16:53:43 +02:00
Krzesimir Nowak
945951cda5 Fix indentation. 2013-08-01 16:53:43 +02:00
Krzesimir Nowak
fa95a638af Fill username in HTTP credentials setup page. 2013-08-01 16:53:43 +02:00
Krzesimir Nowak
3b6aeb1fc8 Make browser inside Shibboleth wizard page a bit larger. 2013-08-01 16:53:43 +02:00
Krzesimir Nowak
6543a01418 Fix warnings emitted by clang. 2013-08-01 16:53:43 +02:00
Krzesimir Nowak
9724e52f1b Fix warnings.
Should be now compilable when run with -Wall -Wextra -Wpedantic
-Werror.
2013-08-01 16:53:43 +02:00
Krzesimir Nowak
9413a30a08 Fix build when using QtKeyChain. 2013-08-01 16:53:43 +02:00
Krzesimir Nowak
6a9a2559d2 Fix shibboleth syncing after client restart.
We needed to notify shibboleth-specific QNAM about new cookie and then
stop cramming that cookie into request via setHeader, but rather put
it to cookie jar and let Qt handle the cookie insertion into requests.
2013-08-01 16:53:43 +02:00
Krzesimir Nowak
78b6f4df01 Move the creds/ and wizard/ directories one level higher. 2013-08-01 16:53:43 +02:00
Krzesimir Nowak
b7e88aa2ef Fix copyright headers. 2013-08-01 16:53:43 +02:00
Krzesimir Nowak
224fd21612 Fix displaying URL in account settings.
I deleted too much code there last time.
2013-08-01 16:53:43 +02:00
Krzesimir Nowak
a6bf33c501 Make "Connect" button inactive until we get a Shibboleth cookie. 2013-08-01 16:53:43 +02:00
Krzesimir Nowak
306a9421fb Avoid a crash when disposing Shibboleth browser. 2013-08-01 16:53:43 +02:00
Krzesimir Nowak
d5885daf0f Move credential related files to creds directory.
CredentialStore is now only used for HTTP credentials, so it was moved
into http directory under creds.
2013-08-01 16:53:43 +02:00
Krzesimir Nowak
52b3f7105d Remove unused stuff. 2013-08-01 16:53:43 +02:00
Krzesimir Nowak
7f6dc291c0 Create HTTP credentials object for config without type value. 2013-08-01 16:53:43 +02:00
Krzesimir Nowak
eacb849353 Fix credentials handling in csync.
CSync module's properties can be set only after it was initialized, so
we split the sync context vfunc into two: the one ran before
initialization and the one ran before sync beginning.
2013-08-01 16:53:43 +02:00
Krzesimir Nowak
367bc401ee Add Shibboleth credentials implementation. 2013-08-01 16:53:43 +02:00
Krzesimir Nowak
92af3ea725 Add and use credentials abstraction. Implement HTTP and dummy credentials.
To achieve that MirallConfigFile now exports several general
settings-related methods for subclasses (here: for HttpConfigFile), so
it does not have to contain any code targeted for specific
credentials.
2013-08-01 16:53:43 +02:00
Krzesimir Nowak
582ce4cfa0 Cleanup setup wizard. Split setup page into two.
First page is for giving server URL and advanced setup and second page
is for giving credentials. Second page will differ based on
authentication type supported by ownCloud server. For now only HTTP
credentials are supported.
2013-08-01 16:53:43 +02:00
Thomas Müller
43ae3dfce5 no zh, but zh_CN 2013-08-01 15:32:45 +02:00
Daniel Molkentin
ce851a7a8b Use wildcards for translations, so they are always up-to-date 2013-08-01 15:28:06 +02:00
Jenkins for ownCloud
b5b7589b41 [tx-robot] updated from transifex 2013-08-01 08:51:42 -04:00
Daniel Molkentin
b638341c14 Merge pull request #821 from owncloud/ts-cleanup
Translation cleanup
2013-08-01 05:38:50 -07:00
Thomas Müller
7274417f84 explicit selection and mapping of maguages 2013-08-01 14:06:17 +02:00
Daniel Molkentin
1967226c71 fix networksettings.ui _again_ 2013-08-01 13:48:42 +02:00
Thomas Müller
227ea8ed24 kill existing 2013-08-01 13:23:21 +02:00
Jenkins for ownCloud
e705db8339 [tx-robot] updated from transifex 2013-08-01 01:26:44 -04:00
Daniel Molkentin
be65f78174 Fix win32 installer 2013-07-31 08:35:13 +02:00
Daniel Molkentin
fd6a17f3e6 Add journal and temp journal to ignore file
csync ignores them anyway, but inotify and other
watchers don't.
2013-07-31 08:35:13 +02:00
Jenkins for ownCloud
0353d7b6a6 [tx-robot] updated from transifex 2013-07-31 01:26:54 -04:00
Klaas Freitag
a64724be0e More sophisticated progress, add Recent Changes Menu to tray.
ProgressDispatcher now stores a queue of events as well as sync
problems, better known as soft errors. The tray menu displays a
sub menu with 5 recent changes and adds a more... button that
shows a warning icon if soft errors had happend.
More to implement.
2013-07-30 22:24:48 +02:00
Klaas Freitag
a0d9d41455 Use const reference parameters for custom struct parameters. 2013-07-30 22:24:48 +02:00
Klaas Freitag
84e8ab5b71 Make progress aware of errors, first step. 2013-07-30 22:24:48 +02:00
Markus Goetz
f5bbb12434 Crash hotfix, need to dig down actual cause 2013-07-30 15:49:57 +02:00
Jenkins for ownCloud
a07d2cddd2 [tx-robot] updated from transifex 2013-07-30 07:57:21 -04:00
Daniel Molkentin
f1878640c8 Linux: install all available icon sizes 2013-07-27 13:06:38 +02:00
Klaas Freitag
edf8147561 Small cleanups. 2013-07-26 15:10:03 +02:00
Klaas Freitag
3a9ab3a86f Consolidated progress displaying to a single slot from csync. 2013-07-26 13:44:38 +02:00
Klaas Freitag
8f912ca0c5 Adopt to new progress API in csync, WIP 2013-07-25 16:28:45 +02:00
Olivier Goffart
a827056d28 Fix upload limit 2013-07-25 11:21:02 +02:00
Klaas Freitag
6c90989584 Make progress display more robust. 2013-07-25 11:00:19 +02:00
Daniel Molkentin
08acf5e9aa Network Settings: Reword entries, fix uic warnings 2013-07-25 10:41:44 +02:00
Daniel Molkentin
bca295183b Make use of bandwidth limiting, split general/network settings.
Fixes #14
2013-07-24 19:53:20 +02:00
Markus Goetz
a400a2e0bb OS X: Fix window messup 2013-07-24 17:06:35 +02:00
Daniel Molkentin
8c15839753 Remove all >= Qt 4.7 ifdefs 2013-07-24 15:34:37 +02:00
Klaas Freitag
810024f4c9 Reworked progress display for more performance.
Moved most of the logic to the dialog class to be able to only update
the GUI if there are really changes rather than doing it whenever a
change happens.
2013-07-24 14:40:47 +02:00
Klaas Freitag
de7bcca5fe Fixed signal and slot parameter list for progress. 2013-07-24 14:40:47 +02:00
Klaas Freitag
6552a48639 Make compactFormatDouble a bit smarter. 2013-07-24 14:40:47 +02:00
Daniel Molkentin
aee0f0c882 make addFolderDefintion easier to read 2013-07-24 14:27:57 +02:00
Daniel Molkentin
e353193fbb FolderMan: Remove dead code 2013-07-24 14:23:32 +02:00
Daniel Molkentin
fb547e9100 Fix/compactify comments in folderman.h 2013-07-24 14:16:52 +02:00
Markus Goetz
44289c8781 OS X: Fix compile 2013-07-24 14:08:16 +02:00
Daniel Molkentin
d4a5ab252d Drop Compat with Qt 4.6
We now require Qt 4.7 due to QNAM
2013-07-24 13:59:03 +02:00
Daniel Molkentin
a3b3c28694 CSyncThread: Fix unreachable code 2013-07-23 14:34:06 +02:00
Klaas Freitag
976c41a3b8 Beautified ProgressDispatcher 2013-07-23 13:32:33 +02:00
Daniel Molkentin
da087292fd First version of progress in the context menu 2013-07-23 13:19:17 +02:00
Klaas Freitag
274f59f93b Reworked progress again following mirall bug #137 2013-07-23 12:23:29 +02:00
Klaas Freitag
85d810d2cf Rename signal from folderProgress to itemProgress. 2013-07-23 12:23:20 +02:00
Daniel Molkentin
47f151c594 FolderWizard: Return targetPath properly 2013-07-22 23:14:41 +02:00
Daniel Molkentin
7b5ef2186e Remove accidential change 2013-07-22 23:14:12 +02:00
Daniel Molkentin
8236dafb96 INotify backend: honor ignored files
Actually this needs a careful redesign,
but this is good enough to fix the issue.

Fixes: #763
2013-07-22 21:39:13 +02:00
Daniel Molkentin
56e5627b6b ownCloudFolder -> Folder
Fixes #769
2013-07-22 20:30:38 +02:00
Daniel Molkentin
38db0eddab Make selection of target ListView-based
Fixes #222
2013-07-22 18:07:44 +02:00
Daniel Molkentin
710625e2a3 Spelling bee 2013-07-22 18:06:27 +02:00
Daniel Molkentin
a5e7af6c1f Make FolderMan a singleton
It doesn't "belong" to application (think about lib use cases).
This is better.
2013-07-22 13:59:52 +02:00
Daniel Molkentin
5fe4d2db2b Introduce MirallConfigFile::save/restoreGeometry() 2013-07-22 12:28:43 +02:00
Daniel Molkentin
b2c587e2f8 Settings: Show overall state as account icon
Requires the previous refactoring commit
2013-07-22 12:11:12 +02:00
Daniel Molkentin
40c2d891c1 Refactor sync result
Sync result computation is now owned by FolderMan
2013-07-22 12:10:13 +02:00
Klaas Freitag
d5ad3a8a70 Removed mistakenly checked in file. 2013-07-22 09:47:15 +02:00
Daniel Molkentin
c74382af4f octetsToString: Add TB case to pretty printer 2013-07-20 01:27:41 +02:00
Daniel Molkentin
0be0111724 Use WA_DeleteOnClose for settings
instead of trying brain dead things
2013-07-20 01:27:00 +02:00
Daniel Molkentin
f0d454b511 Ignore list editor fixes 2013-07-20 01:26:11 +02:00
Daniel Molkentin
b79a45403e Implement UI changes discussed with Jan.
Fixes #785
Fixes #782
Fixes #781
2013-07-19 22:14:21 +02:00
Klaas Freitag
1cc60e755b Rather show overall progress in settings dialog. 2013-07-19 17:05:46 +02:00
Daniel Molkentin
7fb7cc8c46 Don't hardcode strings, use constants instead
This hopefully reduces the chances for
regressions during refactoring.
2013-07-19 16:28:12 +02:00
Daniel Molkentin
1400889b23 Small cleanups 2013-07-19 16:28:12 +02:00
Daniel Molkentin
44fa9bd141 remove skip save pwd parameter -- not used any longer 2013-07-19 16:28:12 +02:00
Klaas Freitag
992dffa032 Add an overall progress counter to progressDispatcher 2013-07-19 13:05:30 +02:00
Klaas Freitag
5fa7e48c24 Do not show the frame around the progress. 2013-07-19 11:07:47 +02:00
Klaas Freitag
3b00dfebed Add a textual display of the file size in progress. 2013-07-19 10:04:09 +02:00
Klaas Freitag
b42c7e07e6 More work on progress display of file up and download.
This is at least working for file upload, untested for downloads
and other operations. Needs more testing and more polish.
2013-07-17 22:34:11 +02:00
Markus Goetz
ab7bfabf12 Put cookies into csync
We already have the auth cookies from the quota request,
so put them into csync to avoid a 401 roundtrip
2013-07-17 16:27:18 +02:00
Markus Goetz
ab72644ace Check if quota request had HTTP 207 2013-07-17 15:08:48 +02:00
Daniel Molkentin
218fa040c8 Reduce thread priority 2013-07-16 16:05:37 +02:00
Daniel Molkentin
b8f783f104 Set proxies and ignored files before every sync run 2013-07-16 16:05:04 +02:00
Daniel Molkentin
ae2e3e7fb1 Remove autostart option from Windows installer
now handled by the application
2013-07-15 11:05:14 +02:00
Daniel Molkentin
edd9d9aee3 Fix disabled state _again_
Seems like a bug in Designer
2013-07-12 18:05:59 +02:00
Daniel Molkentin
8c66085621 Folder wizard: Warn if a chosen dir is read-only
Fixes #755
2013-07-12 13:54:20 +02:00
Klaas Freitag
40ab325a37 Cleaned up credentialstore class a bit.
Removed all "user mode" stuff from the class that was used to ask the
user interactively for the password. We do not do that any more.
2013-07-12 12:22:11 +02:00
Klaas Freitag
7ae95b14f4 Added method to check if the password is in the config file. 2013-07-12 12:21:34 +02:00
Klaas Freitag
5da6103fb5 Documented the docexpire option. 2013-07-11 12:32:58 +02:00
Klaas Freitag
6b5b9db20a Handle progress through ProgressDispatcher class, WIP. 2013-07-11 12:32:58 +02:00
Daniel Molkentin
eb39d144e4 Use default cookie jar again 2013-07-10 18:59:01 +02:00
Daniel Molkentin
cfaaf4a2c4 Don't always send Auth headers
Use slotAuthentication again instead.
2013-07-10 18:57:52 +02:00
Daniel Molkentin
279a738aa6 General Settings: Fix spacing in layout 2013-07-10 12:46:43 +02:00
Daniel Molkentin
10b55f11a2 Fix build for Qt <= 4.6 2013-07-10 09:48:10 +02:00
Daniel Molkentin
25065c4151 Remember geometry of LogBrowser 2013-07-10 09:34:41 +02:00
Daniel Molkentin
d2657bc154 Do display floating points with precision of 1
For several GB of quota, we might end up showing
<1% far too long. So show one decimal number,
unless it's zero.
2013-07-10 09:34:41 +02:00
Daniel Molkentin
4fde3f4a65 Quota in Account Settings: properly round value 2013-07-10 09:34:41 +02:00
Daniel Molkentin
e398cfb27c Introduce Utility::compactFormatDouble()
Like QLocale::toString(double, 'f', prec), but drops trailing
zeros after the decimal point.
2013-07-10 09:34:27 +02:00
Daniel Molkentin
3cc670ec29 Send non-standard port along with host
In QNAM, that's actually the default,
and we were overriding it incorrectly
for no obvious reason. When using the
QHTTP fallback, we need to submit a
non-standard port manually.

Fixes #748
2013-07-10 08:43:10 +02:00
Markus Goetz
c8d9e8458a OS X: Find out if we are a startup item 2013-07-09 17:30:50 +02:00
Markus Goetz
892419e880 OS X: Ability to disable startup item 2013-07-09 17:13:41 +02:00
Markus Goetz
13fb49cf39 Make Jenkins happy 2013-07-09 14:23:58 +02:00
Markus Goetz
eabe3f968e Raise settings dialog when creating
Else at least on OS X it is burried somewhere.
2013-07-09 14:18:23 +02:00
Markus Goetz
2ca5eaaab9 utility.cpp: Make compile on OS X 2013-07-09 14:07:48 +02:00
Daniel Molkentin
eed3deac67 Acount Settings: Enable in place password change 2013-07-08 14:49:01 +02:00
Daniel Molkentin
a63863b65c Detect missing system tray
Fixes #497
2013-07-08 14:48:58 +02:00
Daniel Molkentin
748ff13bce Utility::freeDiskSpace()
Does not yet work for UNC locations
2013-07-08 14:48:17 +02:00
Daniel Molkentin
6c7700c2e7 Save size of settings dialog
Fixes #541
2013-07-08 04:01:36 +02:00
Daniel Molkentin
c8ccb014c8 Use plural form for sync notification
Fixes #419
2013-07-08 03:19:49 +02:00
Daniel Molkentin
f1bd14e8de Remove superflous cast 2013-07-08 01:44:49 +02:00
Daniel Molkentin
024d01a192 Cleanly install themed clients next to owncloud on Unix
- Renames libowncloudsync for themes
- Properly names i18n dir
2013-07-08 01:44:49 +02:00
Daniel Molkentin
b2d02ef0bd Improve labeling in case of root sync 2013-07-07 01:24:56 +02:00
Daniel Molkentin
751d7deda6 Utility: Compile on Windows again
Theme moc files belong with libowncloud
2013-07-06 22:42:02 +02:00
Daniel Molkentin
fff795146e Make Utility::*Startup* testable 2013-07-06 22:41:59 +02:00
Daniel Molkentin
c6219581f6 More work on ignore/exclude files:
- Introduce split between sytem and user files
- Add Editor

Current limitation: Picking up the changes requires
a restart
2013-07-05 16:54:11 +02:00
Klaas Freitag
d0c5fb2395 Check connection at startup through ConnectionValidator 2013-07-05 13:14:48 +02:00
Klaas Freitag
6c2c81dc83 Format integer to string. 2013-07-05 11:40:44 +02:00
Daniel Molkentin
bfdb0c0012 Enable autostart when the client has been configured 2013-07-05 01:05:23 +02:00
Daniel Molkentin
d870d6c326 Implement "Show Desktop Notifications" option (default: on)
Should make #314 subscriber happy :-)
2013-07-05 01:01:23 +02:00
Daniel Molkentin
c06410e726 Implement Launch on Startup (Win, Linux).
Mac OS started. Untested.
2013-07-05 00:25:19 +02:00
Daniel Molkentin
ef03ebe086 Remove obsolete include 2013-07-04 20:43:20 +02:00
Daniel Molkentin
a217e8f24c Compile fix 2013-07-04 20:21:40 +02:00
Daniel Molkentin
c164beb040 Commit squashed refactoring branch
- introduce settings dialog
- general settings for general / proxy settings
- standalone proxy settings dialog removed
- standalone status dialog removed
- moved status dialog into settings dialog
- radically cut down links in context menu
- add help link to context menu

This needs more cleanup and testing. Known issues:

- When the wizard is called while the settings dialog
  is open, it will not show old information (see FIXME)
- Some settings are not implemented yet (greyed out)
- The counter in the FileItemDialog is not correct the
  first time around.

Based on the discussion done with Jan and Klaas during the
Nuenberg workshop.
2013-07-04 20:02:44 +02:00
Klaas Freitag
5171e5880d Initialize member var with zero to avoid crash. 2013-07-02 17:01:16 +02:00
Klaas Freitag
2ef62524d6 Use showTrayMessage instead of _tray directly 2013-07-02 17:01:16 +02:00
Klaas Freitag
4bbb29c2b4 Terminate sync process in the wizard rather than in folderman unload. 2013-07-02 17:01:16 +02:00
Klaas Freitag
261776cc78 Remove useless log message. 2013-07-02 17:01:16 +02:00
Daniel Molkentin
3008142b1b lowercase webdav request 2013-07-01 14:21:04 +02:00
Daniel Molkentin
152e729768 thinko 2013-06-28 23:23:42 +02:00
Daniel Molkentin
e7c77df59e Quota: Distinguish 0 and <1 2013-06-28 23:14:09 +02:00
Daniel Molkentin
4ff1a13f32 Implement folder display.
- Displayed as disabled action
- Refactor davRequest along the way
  - take Verb as QByteArray
  - pass along a QIODevice

Not implemented for Qt < 4.8
2013-06-28 23:01:31 +02:00
Daniel Molkentin
b9b18d6120 Remove unused configfile instance 2013-06-28 22:28:18 +02:00
Daniel Molkentin
4945ce3c8c Use awesome Qt template magic 2013-06-28 22:27:53 +02:00
Daniel Molkentin
19aa8c63c0 build again 2013-06-28 22:27:16 +02:00
Daniel Molkentin
efd11b61c6 Merge branch '1.3' 2013-06-28 11:47:09 +02:00
Daniel Molkentin
1facb1f95d 1.3.80 (pre 1.4.0) 2013-06-27 16:58:55 +02:00
Jenkins for ownCloud
3db0788a91 [tx-robot] updated from transifex 2013-06-27 16:57:44 +02:00
Jenkins for ownCloud
e068098046 [tx-robot] updated from transifex 2013-06-27 16:57:44 +02:00
Daniel Molkentin
f2d289326b More whitespace changes 2013-06-27 16:57:44 +02:00
Jenkins for ownCloud
ae57f27eb9 [tx-robot] updated from transifex 2013-06-27 16:57:44 +02:00
Daniel Molkentin
a1767b2f7f String whitespace fixes 2013-06-27 16:57:15 +02:00
Markus Goetz
5e9fcf7537 Raise setup wizard 2013-06-27 16:57:15 +02:00
Markus Goetz
8192cc7eea Setup Dialog: Fix widget size issue (2) 2013-06-27 16:57:15 +02:00
Markus Goetz
2b8e1f2504 Setup Dialog: Fix widget size issue
in advanced settings
2013-06-27 16:57:15 +02:00
Daniel Molkentin
9d01f80744 Fix Dialog behavior
- Fix proxy dialog being callable multiple times
- Use smart pointers in more places
- _owncloudSetupWizard was guarded by a smart pointer,
  this needs to be accounted for in other code pathes.
  Fixes Setup dialog not showing up when left-clicking
  on unconfigured instances on Windows.
2013-06-27 16:54:33 +02:00
Jenkins for ownCloud
1a04c9da67 [tx-robot] updated from transifex 2013-06-27 01:42:28 +02:00
Daniel Molkentin
d35e1baee1 Remove obsolete code 2013-06-26 17:27:44 +02:00
Jenkins for ownCloud
2f16e50c87 [tx-robot] updated from transifex 2013-06-26 15:55:25 +02:00
Jenkins for ownCloud
3a662f7afb [tx-robot] updated from transifex 2013-06-26 01:27:29 +02:00
Daniel Molkentin
903a78623c Minor theme changes 2013-06-25 14:51:39 +02:00
Daniel Molkentin
7cd2f39f82 ChangeLog 2013-06-25 10:37:40 +02:00
Jenkins for ownCloud
949dd5db35 [tx-robot] updated from transifex 2013-06-25 01:45:02 +02:00
Jenkins for ownCloud
49a5c5bb8b [tx-robot] updated from transifex 2013-06-24 23:05:09 +02:00
Jenkins for ownCloud
48aa355eea [tx-robot] updated from transifex 2013-06-24 23:01:20 +02:00
Daniel Molkentin
644b2673e0 More whitespace changes 2013-06-24 23:00:33 +02:00
Jenkins for ownCloud
8eed62e639 [tx-robot] updated from transifex 2013-06-24 22:58:54 +02:00
Daniel Molkentin
04c8449e5f String whitespace fixes 2013-06-24 22:58:00 +02:00
Jenkins for ownCloud
9dd776ff6c [tx-robot] updated from transifex 2013-06-24 22:55:32 +02:00
Jenkins for ownCloud
016868e95a [tx-robot] updated from transifex 2013-06-24 21:43:58 +02:00
Jenkins for ownCloud
5d9c664fba [tx-robot] updated from transifex 2013-06-24 21:25:21 +02:00
Daniel Molkentin
a662c85728 Add "Reset Folder" option to status dialog
to recover from invalid databases. Features
a big fat warning.
2013-06-24 21:17:00 +02:00
Daniel Molkentin
5c4b7d427d Add "Reset Folder" option to status dialog
to recover from invalid databases. Features
a big fat warning.
2013-06-24 21:15:22 +02:00
Markus Goetz
12cc8bfd95 Raise setup wizard 2013-06-24 15:15:46 +02:00
Markus Goetz
11c6f20c90 Setup Dialog: Fix widget size issue (2) 2013-06-24 14:57:48 +02:00
Markus Goetz
c602ec310d Setup Dialog: Fix widget size issue
in advanced settings
2013-06-24 13:24:46 +02:00
Olivier Goffart
60a4180dd6 Delay the csync_init after we called status.php
That way, if there was a redirection, it is handled propertly
2013-06-21 00:34:46 +02:00
Olivier Goffart
8e42721959 Do not store the redirected URL in the config file.
Because it may be a temporary URL.
Especially anoying in captive portal

Fix issue #368

This is a revert of the revert 0bc9b6f44e
With small changes
2013-06-21 00:34:28 +02:00
Olivier Goffart
4553fa1d09 Merge remote-tracking branch '1.3' into master 2013-06-21 00:04:01 +02:00
Daniel Molkentin
b206a3b8e2 Beta4 2013-06-20 21:01:38 +02:00
Daniel Molkentin
3bff5a061b Network: Display actual error message next to code. 2013-06-20 20:02:25 +02:00
Daniel Molkentin
0bc9b6f44e Revert "Do not store the redirected URL in the config file."
This reverts commit 905f70a186.

Patch still has issues, defer until after Beta 4
2013-06-20 19:50:34 +02:00
Olivier Goffart
905f70a186 Do not store the redirected URL in the config file.
Because it may be a temporary URL.
Especially anoying in captive portal

Fix issue #368
2013-06-20 17:50:02 +02:00
Olivier Goffart
a8707b681d Report proper error when csync_init fails
Fix mirall issue #705
2013-06-19 18:17:32 +02:00
Olivier Goffart
5d8f9f5346 Silent clang warning 2013-06-19 18:16:43 +02:00
Daniel Molkentin
e43ff398cd Merge branch '1.3'
Conflicts:
	doc/troubleshooting.rst
2013-06-19 16:09:54 +02:00
Daniel Molkentin
a441b1d562 Bump year 2013-06-19 16:07:07 +02:00
Daniel Molkentin
6e2042cd55 Doc: Expand usage page 2013-06-19 16:04:48 +02:00
Daniel Molkentin
bb8b58dc66 Doc: more fixes on troubleshooting section 2013-06-19 15:48:04 +02:00
Daniel Molkentin
9cd099056b Doc: More structure in troubleshooting.rst 2013-06-19 15:40:20 +02:00
Daniel Molkentin
0adbc032ae Doc: Expand trouble shooting section 2013-06-19 15:40:15 +02:00
Daniel Molkentin
22a679fb8c Doc: Add back --logfile, as it still exists 2013-06-19 15:40:09 +02:00
Daniel Molkentin
35a67fab0a Doc: remove now meaningless scentences 2013-06-19 15:40:06 +02:00
Daniel Molkentin
fdc8117211 doc: Fix wording 2013-06-19 15:40:02 +02:00
Daniel Molkentin
24208e6137 Remove mirall man page 2013-06-19 15:39:56 +02:00
Daniel Molkentin
c0cd255ea3 Doc: More structure in troubleshooting.rst 2013-06-19 15:39:03 +02:00
Daniel Molkentin
a0375fd000 Doc: Expand trouble shooting section 2013-06-19 15:06:47 +02:00
Daniel Molkentin
6d847cd5f9 Doc: Add back --logfile, as it still exists 2013-06-19 15:06:16 +02:00
Daniel Molkentin
6470a3f539 Doc: remove now meaningless scentences 2013-06-19 15:05:33 +02:00
Daniel Molkentin
c6111d09ce doc: Fix wording 2013-06-19 14:29:56 +02:00
Daniel Molkentin
d6012854a9 Remove mirall man page 2013-06-19 14:29:28 +02:00
Daniel Molkentin
46c7026726 Answer correctly if proxy auth is needed
Fixes #704
2013-06-19 12:48:36 +02:00
Daniel Molkentin
01ad3c4d81 Remove more dead code for readability 2013-06-19 11:31:09 +02:00
Daniel Molkentin
4ac98bde73 Remove dead code from StatusDialog 2013-06-18 17:38:20 +02:00
Daniel Molkentin
f42a6d6ef6 Advertise the use of Gists for long logs 2013-06-18 15:21:56 +02:00
Daniel Molkentin
9055c6ade7 Add storage backend field to issue template 2013-06-18 14:57:12 +02:00
Olivier Goffart
1356a5bbaa Fix reading the password from the config
The code was expecting pwdba to be in base64, which it was not if it
came from the "password" field
2013-06-18 14:19:37 +02:00
Olivier Goffart
3c320c2736 Credidentail dialog: it was suposed to be asynchronous 2013-06-18 14:19:37 +02:00
Olivier Goffart
969757199e Fix changing the password when the password manager is not available
Leaving the state in NoKeychainBackend would break any further attempt
to get the password because CredentialStore::canTryAgain would return
false.
2013-06-18 14:19:37 +02:00
Daniel Molkentin
60f1c65a48 Don't lose proxy settings when changing passwords 2013-06-17 14:25:11 +02:00
Daniel Molkentin
b87b0e16e6 Avoid infinite loop if authcheck fails 2013-06-17 13:35:54 +02:00
Daniel Molkentin
8ed0b1be55 Teach ownCloud theme about QVariant 2013-06-13 16:31:38 +02:00
Daniel Molkentin
91b5f1076f Theming cleanups
- remove splash screen pixmap
- remove backend icon (folderIcon())
- Move owncloud ad into owncloud theme
2013-06-13 12:56:20 +02:00
Daniel Molkentin
8ec2457965 Only change subtitle if the config file actually exists 2013-06-13 12:55:07 +02:00
Daniel Molkentin
82d79b1188 Remove folder from the scheduling queue
Not really needed, but cleaner
2013-06-12 12:42:02 +02:00
Olivier Goffart
e33601becd Fix leak 2013-06-12 12:23:12 +02:00
Olivier Goffart
334443adbb Fix crash when removing a folder
The problem is that the module_property of csync are not really tight to
a context, but are global to all the contextes.
Which means csync_owncloud may still have a pointer to the destroyed
context of the destroyed folder.
By always resetting the context pointer, we make sure there is no stale
pointers there
2013-06-12 12:23:12 +02:00
Daniel Molkentin
99579e8a2a 1.3.0beta3 2013-06-12 11:10:08 +02:00
Daniel Molkentin
89438f7ace Make SyncDisabler local to slotAddFolder
This also allows us to update the folder state as
soon as the wizard is being closed.
2013-06-12 09:27:20 +02:00
Daniel Molkentin
d323ec5dd9 FileItemDialog: more clarity in the label
- finished %n sec ago -> last finished %n sec ago
- switch to minutes after 60 seconds
2013-06-11 22:34:37 +02:00
Daniel Molkentin
bb5cf37330 Fix issues found after review
- use safer formatting
- remove unnecessary condition
2013-06-11 22:33:11 +02:00
Daniel Molkentin
4b0bdd648c Do not repeat old strings
Fixes #678, fixes #494
2013-06-11 22:14:32 +02:00
Olivier Goffart
5588fbe695 Fix clicking on the systray when the setup is not finished
We should raise the wizard
2013-06-11 21:32:44 +02:00
Olivier Goffart
12ea381205 Do not re-use the configuration wizard.
Create it on demand.
This allow yo alays keep a cleen state.
Mirall issue #668
2013-06-11 21:15:37 +02:00
Daniel Molkentin
99fbf25fb2 Keep the member variable, avoids double instanciation 2013-06-11 18:41:35 +02:00
Daniel Molkentin
b37645e14d Revert "Put FolderWizard on the stack"
This reverts commit 1ec5a1aaa2.
2013-06-11 18:33:39 +02:00
Daniel Molkentin
1ec5a1aaa2 Put FolderWizard on the stack 2013-06-11 18:19:09 +02:00
Daniel Molkentin
3eb7acde25 Folder wizard: use native separators in path lineedit 2013-06-11 18:18:38 +02:00
Daniel Molkentin
e53e39cfad Remove obsolete members from enum 2013-06-11 18:17:34 +02:00
Daniel Molkentin
1a17f40233 Remove debug 2013-06-11 18:17:22 +02:00
Daniel Molkentin
10094a997a Proxy Dialog: default to port 8080 2013-06-11 17:46:00 +02:00
Daniel Molkentin
2af38b093f Fix status delegate
- remove magic values
- remove backend icon, put status icon in the front
- elide text when > list view width
- use list view font
2013-06-11 14:46:12 +02:00
Daniel Molkentin
b03c168175 Status dialog> Do not adjust pen when using Vista Style
Light blue and white are not contrasting enough
2013-06-10 21:29:45 +02:00
Daniel Molkentin
1c6bc84d2d Wizard: Always initialize all labels 2013-06-10 21:29:45 +02:00
Olivier Goffart
541239c17b Make the message box more explicit when all files have been removed
Also clean the db if the user wish to keep the files
2013-06-10 15:58:02 +02:00
Daniel Molkentin
74b4ade15a Add missing return statement 2013-06-10 15:37:52 +02:00
Daniel Molkentin
205502fd3b Fix incorrect license attribution
Fixes #672
2013-06-10 07:42:35 +02:00
Daniel Molkentin
54e4217216 Add Missing LGPL_EXCEPTION.txt
Fixes #671
2013-06-10 07:38:35 +02:00
Olivier Goffart
d2579a7754 Warn if we detect that all fles are about to be removed. 2013-06-08 15:41:53 +02:00
Daniel Molkentin
76580840dd Fix misleading confirmation message
Fixes #459
2013-06-07 22:01:26 +02:00
Olivier Goffart
779e59156c Added --logexpire to remove the log after some hours 2013-06-07 18:58:16 +02:00
Daniel Molkentin
b0f0d0b1cd qDebug() ises local8bit, not utf-8.
Fixes #651
2013-06-07 17:28:04 +02:00
Daniel Molkentin
858dcb53bd Status dialog delegate: Use font from option 2013-06-06 22:12:18 +02:00
Daniel Molkentin
9d7db88fcb status dialog: Use contrast color for highlights
Fixes #440.
2013-06-06 22:11:36 +02:00
Daniel Molkentin
2099b7c6a0 ensureJournalGone: fix logic 2013-06-06 21:43:05 +02:00
Daniel Molkentin
4442564ad2 Clean up slotAddFolder
Ensure folder sync scheduling is off in the meanwhile.
2013-06-06 21:27:15 +02:00
Daniel Molkentin
12148b5c9b remove journal when adding a new sync on an existing folder 2013-06-06 17:59:50 +02:00
Daniel Molkentin
d7d77a49fc Show help on Windows
We have no console, so show a message box.
2013-06-06 16:00:51 +02:00
Daniel Molkentin
b70c2f5c20 torture scripts: fix description 2013-06-06 11:05:21 +02:00
Daniel Molkentin
033249423f Add torture scripts + standard layout files 2013-06-05 21:36:55 +02:00
Daniel Molkentin
0c959e8661 Windows: Log change of power state 2013-06-05 16:14:20 +02:00
Daniel Molkentin
79785241ea Docs: --logdir replaces --logfile 2013-06-05 14:57:32 +02:00
Daniel Molkentin
0090862313 wizard: show native separators on folder chooser button 2013-06-04 00:46:34 +02:00
Daniel Molkentin
a4a68c6622 Wizard: Better wording when renaming failes 2013-06-03 23:34:28 +02:00
Klaas Freitag
49b4c341ae Really unload folders before reconfiguring. 2013-06-03 17:27:06 +02:00
Olivier Goffart
7c1f91abdd Add the --logdir commandline option
To log to a different file for every sync.

This also changed a QueuedConnection to AutoConnection, that way we
directly save the log from the main thread in the file without waiting
for the event loop (so if it crashes before, the log has been writen)
2013-06-03 16:25:41 +02:00
Klaas Freitag
1f2ba7e254 Handle rename fails for backup reasons correctly. 2013-06-03 15:47:39 +02:00
Klaas Freitag
8014bcb7c4 Check for emptiness before backuping the entire dir. 2013-06-03 15:47:07 +02:00
Klaas Freitag
b1c8bf5954 Fix backup name generation. 2013-06-03 15:46:41 +02:00
Klaas Freitag
0eb6740bac Added default argument to terminateSyncProcess 2013-06-03 15:46:11 +02:00
Klaas Freitag
96531b548a Minor Cleanups. 2013-06-03 15:45:28 +02:00
Klaas Freitag
f3371360ed Check the CredentialStore state before fetching creds again. 2013-06-03 15:44:58 +02:00
Daniel Molkentin
c1b92f9fed beta2 2013-05-31 16:25:57 +02:00
Daniel Molkentin
b028ca0738 Merge pull request #650 from manolopm/master
Fixes for windows client when setup server url customization
2013-05-31 07:25:09 -07:00
Daniel Molkentin
a9aab30d55 Display proxy errors 2013-05-31 16:16:56 +02:00
Daniel Molkentin
efbad3a3c8 Propagate proxy changes to csync at run time 2013-05-31 16:16:41 +02:00
Manuel Padron Martinez
b6ed959f98 Removes server url label if a custom url is defined
Signed-off-by: Manuel Padron Martinez <manolopm@gmail.com>
2013-05-31 04:46:26 +01:00
Manuel Padron Martinez
477953f965 Put wizard url customization before connect signals
Signed-off-by: Manuel Padron Martinez <manolopm@gmail.com>
2013-05-31 04:45:48 +01:00
Daniel Molkentin
aaf59cece5 Wizard: Normalize directory separators 2013-05-29 17:24:59 +02:00
Daniel Molkentin
e88b7e8ec2 Centralize User Agent string and use in UpdateDetector 2013-05-29 16:13:38 +02:00
Daniel Molkentin
078b09b5f4 Remove obsolete include 2013-05-29 16:12:42 +02:00
Daniel Molkentin
0d06fe764a Status dialog: Use correct font metrics
This avoids cutting charcters such as 'y'.
2013-05-29 14:46:02 +02:00
Daniel Molkentin
94f8c39a9e Proxy settings: Also keep proxy user/pwd
make sure not to use it when the user
has asked us not to.

Simplify setupProxy()
2013-05-29 12:56:23 +02:00
Daniel Molkentin
7d1bd9da86 Properly deal with SOCKS proxies
Fixes #10
2013-05-29 02:14:40 +02:00
Daniel Molkentin
ed8cdf6910 Remember proxy settings even after switching type
Fixes #649
2013-05-29 01:41:04 +02:00
Daniel Molkentin
7ee83847c8 Do not try to reset the wizard when visible 2013-05-29 01:30:00 +02:00
Daniel Molkentin
52eca1362f Delete QWizard on destruction 2013-05-29 01:29:56 +02:00
Daniel Molkentin
eec1af09c4 Wizard: Fix rich text label layouting 2013-05-29 01:17:12 +02:00
Daniel Molkentin
c651c8cbf9 Wizard: Improve wording. 2013-05-29 01:16:52 +02:00
Daniel Molkentin
da6a398624 Wizard: Warn on re-setup with multiple folders 2013-05-28 20:25:31 +02:00
Daniel Molkentin
1418512a9f More cheating on proxies: Add OS to User-Agent 2013-05-28 19:35:30 +02:00
Daniel Molkentin
dd2859880b Set User-Agent to contain Mozilla/5.0 string
A blatant lie for a blatant abuse of Firewall filters.
2013-05-28 15:44:41 +02:00
Daniel Molkentin
f38d8ba2e4 Improve wizard in edit mode 2013-05-28 14:51:49 +02:00
Daniel Molkentin
fdd52a2520 Kill non-boxed mode for now 2013-05-28 14:51:48 +02:00
Daniel Molkentin
e2c0792043 take local folder path from property
This gets set by slotSelectFolder() and from the wizards caller.
2013-05-28 14:51:41 +02:00
Daniel Molkentin
e8889530b0 Fix owncloud theme icon 2013-05-28 14:42:41 +02:00
Klaas Freitag
23f67d950a Handle password change correct, add "sync from scratch".
The setup wizard now destinguishes if there was already a configuration
or not. If yes, it's going to password-change mode. Also added a checkbox
that allows to start a sync from a cleared local directory.
2013-05-26 14:04:11 +02:00
Klaas Freitag
0bd1f507ab Added a checkbox "start sync from scratch". 2013-05-26 13:57:28 +02:00
Klaas Freitag
2bcfc143f6 Let the folderman create a new sync directory.
If a sync directory exists its moved to a backup path and created new.
That allows to start a sync "from scratch".
2013-05-26 13:56:51 +02:00
Klaas Freitag
9dc21bf8a3 Let the keychain return new creds during async save.
The credentials are asynchronously saved. The credentialstore now returns
the creds even if the saving has not yet finished but is running, for that
the new state AsyncWriting was added. That makes the start of the sync
after the password was changed more reliable.
2013-05-26 13:55:23 +02:00
Klaas Freitag
70f627ba06 Fix the folder setup wizard. 2013-05-24 09:54:48 +02:00
Daniel Molkentin
0683c26d41 Make setting custom folders work again
Also, ensure that opening the local directory from the wizard
will work on Windows.
2013-05-23 01:51:05 +02:00
Daniel Molkentin
dbc085d4d4 Fix systray class when built without FDO support 2013-05-22 17:39:49 +02:00
Daniel Molkentin
804eaa700e Remove bogus debug output 2013-05-22 15:58:54 +02:00
Daniel Molkentin
646922665d 1.3.0beta1 2013-05-22 15:34:19 +02:00
Daniel Molkentin
62ad2f19e3 Setup Wizard: Make server/folder buttons work 2013-05-21 14:25:31 +02:00
Daniel Molkentin
14f55420f9 Remove obsolete connect statement 2013-05-21 14:20:56 +02:00
Daniel Molkentin
d4ea0ba6ba Merge branch 'master' of git://github.com/gnumdk/mirall
Conflicts:
	CMakeLists.txt

As per PR 457
2013-05-20 16:54:49 +02:00
Daniel Molkentin
c06f7b7ecb Update README.md
Fixes #182.
2013-05-20 11:00:29 +02:00
Daniel Molkentin
3a50eece9e More theming refactoring 2013-05-17 20:56:17 +02:00
Daniel Molkentin
44f0fb0242 Fix broken include 2013-05-17 20:12:31 +02:00
Daniel Molkentin
c210e2b72f Remove obsolete miralltheme 2013-05-17 20:11:16 +02:00
Daniel Molkentin
7b5079f043 Amendment to previous commit 2013-05-17 18:27:07 +02:00
Daniel Molkentin
be4027fb36 Remove deleted file from resources 2013-05-17 18:13:14 +02:00
Daniel Molkentin
0f03b47a46 Make new connection wizard themable 2013-05-17 18:05:22 +02:00
Daniel Molkentin
c923e0803e Add SyncResult::SyncPrepare case to FileItemDialog 2013-05-17 12:33:02 +02:00
Daniel Molkentin
bd74dbbfc5 doc: markup fixes 2013-05-17 12:02:40 +02:00
Daniel Molkentin
a0599e75b7 Update build instructions for Mac OS 2013-05-17 11:42:19 +02:00
Klaas Freitag
f334b6349b Add a call to quit to make the thread ending the loop 2013-05-16 17:35:40 +02:00
Klaas Freitag
2ff9fcfa1d Fix crash if _thread is not initialized before. 2013-05-16 13:26:05 +02:00
Daniel Molkentin
aa23e4698b Correct spelling of some mac os meta files
Fixes #619
2013-05-14 23:15:22 +02:00
Daniel Molkentin
302fdeb1f9 Use UTF-8 for basic auth
Slightly off-specs, and fails for non UTF-8 setups,
but the ownCloud server itself expects UTF-8 encoding.
2013-05-09 22:01:39 +02:00
Daniel Molkentin
eea8542fc0 Quit app/abort sync gracefully. 2013-05-09 21:55:28 +02:00
Daniel Molkentin
a36d79e993 Fix make install 2013-05-04 17:01:14 +02:00
Daniel Molkentin
be5c1b2072 Fix build 2013-05-04 16:38:39 +02:00
Daniel Molkentin
f0bd1ea48e Add connectionvalidator class 2013-05-04 16:01:45 +02:00
Daniel Molkentin
90d0460a42 Remove dummy artwork, dead switches 2013-05-04 15:55:04 +02:00
Daniel Molkentin
c15ce2b20b Remove last traces of localRun 2013-05-04 15:16:53 +02:00
Daniel Molkentin
b51f210bfa Drop (broken) mirall binary
This remove all non-ownCloud backends, as well
as all obsolete wizard pages. CSync is now
a mandatory dependency.
2013-05-04 14:03:51 +02:00
Daniel Molkentin
105c76c055 Fix sizing problems in the new wizard dialog. 2013-04-30 21:51:48 +02:00
Daniel Molkentin
6b15b7a58f Update detector: make it possible to skip updates.
Fixes issue #588.
2013-04-30 17:46:07 +02:00
Daniel Molkentin
fee0aae975 new wizard: Better separate folder names in strings. 2013-04-30 17:46:07 +02:00
Klaas Freitag
b33b638d2d A bit more verbose troubleshooting documentation. 2013-04-30 13:53:33 +02:00
Klaas Freitag
1e677a5f0f Fixed default target dir to / and fixed logging text. 2013-04-30 13:53:13 +02:00
Klaas Freitag
3f3f6c0f39 Move setPlaceholderText to correct class. 2013-04-29 14:09:05 +02:00
Klaas Freitag
5dd53b48ef Add missing lineedit method for ancient Qt versions 2013-04-29 11:08:37 +02:00
Klaas Freitag
a215e11b20 Merge development branch with new setup dialog. 2013-04-29 10:20:01 +02:00
Daniel Molkentin
7d71f9dd2d Merge pull request #582 from ghmer/master
Fix messed formatting in build documentation
2013-04-29 00:34:53 -07:00
Jenkins for ownCloud
183f1574ca [tx-robot] updated from transifex 2013-04-29 01:26:56 +02:00
Jenkins for ownCloud
504b651bb9 [tx-robot] updated from transifex 2013-04-28 01:27:25 +02:00
Klaas Freitag
c848ff4bdb New setup dialog, simplified version. 2013-04-27 22:24:32 +02:00
Klaas Freitag
5aa8f5bc01 Added own CookieJar to not return a Session Cookie, rem Auth Callback
The auth callback is not needed as we send an Basic Auth header.
2013-04-27 22:22:20 +02:00
Klaas Freitag
6c5d5a543c Simplified config file write method, removed don't store pwd. 2013-04-27 22:21:28 +02:00
Klaas Freitag
a8bc849b5d Add blue ownCloud logo. 2013-04-27 22:20:33 +02:00
Klaas Freitag
5f535b9661 owncloud logo pixmap. 2013-04-27 21:07:39 +02:00
Klaas Freitag
eaf865539c Added owncloud logo for new setup dialog. 2013-04-27 21:07:00 +02:00
Mario Enrico Ragucci
75448c41d4 Verified format cleanup (really...)
Signed-off-by: Mario Enrico Ragucci <github@ragucci.de>
2013-04-26 17:02:55 +02:00
Mario Enrico Ragucci
afc96e2021 Format cleanup
Signed-off-by: Mario Enrico Ragucci <github@ragucci.de>
2013-04-26 15:47:49 +02:00
Daniel Molkentin
d7bce80c7b Merge pull request #580 from ghmer/master
Documentation Update cross-compiling section to include all libs needed to build the Windows Package
2013-04-26 04:41:20 -07:00
Mario Enrico Ragucci
7e07d20d31 Remove LOG4C information as this is not needed anymore
Signed-off-by: Mario Enrico Ragucci <github@ragucci.de>
2013-04-26 13:32:35 +02:00
Daniel Molkentin
238111be09 Find csync_version.h, local config.h 2013-04-26 10:48:02 +02:00
Klaas Freitag
6f0820a3ed Add QProgressIndicator to source list 2013-04-26 10:47:17 +02:00
Jenkins for ownCloud
1d0d1c249b [tx-robot] updated from transifex 2013-04-26 01:26:32 +02:00
Mario Enrico Ragucci
1b5ed68375 Formatting cleanup 2013-04-26 01:00:50 +02:00
Mario Enrico Ragucci
ce996b3fc8 - Update Cross-Compiling section: Listing of all needed libraries to successfully build the Windows installer package
- Adding a note about the missing cross-compiled LOG4C package
- Minor changes to the documentation to be more specific about building the Windows package
2013-04-26 00:45:19 +02:00
Daniel Molkentin
2789522948 Folder/ownCloudFolder: Clean up secondPath stuff 2013-04-25 16:06:31 +02:00
Daniel Molkentin
55a56cc275 Find csync_version.h, local config.h 2013-04-25 13:19:38 +02:00
Jenkins for ownCloud
20101527b2 [tx-robot] updated from transifex 2013-04-25 01:27:34 +02:00
Daniel Molkentin
311bd39100 Add simplified FancyLineEdit from Qt Creator to 3rdparty 2013-04-24 13:36:25 +02:00
Klaas Freitag
fab77a15f0 Fix build after merge 2013-04-24 13:33:26 +02:00
Klaas Freitag
09e7f5c618 Add qprogressindicator widget 2013-04-24 11:45:53 +02:00
Klaas Freitag
c5a674b1df More work on new Connection dialog. First working version. 2013-04-24 11:40:29 +02:00
Jenkins for ownCloud
f83453cfc7 [tx-robot] updated from transifex 2013-04-24 01:27:36 +02:00
Daniel Molkentin
1ca8ebebd9 Do not add shortcuts to non-existent files 2013-04-23 17:19:27 +02:00
Klaas Freitag
7cc73ed46c Merge feature branch that introduces non terminating csync. 2013-04-23 16:52:02 +02:00
Daniel Molkentin
01b4694b47 Bump version to distinguish nightlies 2013-04-23 16:49:15 +02:00
dragotin
bcc6d59c6b Update CONTRIBUTING.md 2013-04-23 12:35:44 +03:00
Daniel Molkentin
b4e2e5f586 1.2.5 ChangeLog 2013-04-22 15:48:21 +02:00
Jenkins for ownCloud
43ed874789 [tx-robot] updated from transifex 2013-04-22 15:28:38 +02:00
Klaas Freitag
8928c87fc3 Removed silly configDir hack from thread. 2013-04-22 15:06:28 +02:00
Daniel Molkentin
e3f8a918d6 Merge pull request #559 from ghmer/master
Fix for Issue #424
2013-04-22 04:01:22 -07:00
Daniel Molkentin
668bb94270 1.2.5 2013-04-22 12:46:16 +02:00
Daniel Molkentin
89e0543e0a Merge pull request #562 from fastfwd/master
Fix Issue #382 (Minor Windows Installer Issue: Missing descriptions on the "Choose Components" screen).
2013-04-22 03:41:17 -07:00
fastfwd
6695b50965 Fix Issue #382
Just a couple of typo/cut-and-paste errors.
2013-04-22 01:22:16 -07:00
Jenkins for ownCloud
5c02c85126 [tx-robot] updated from transifex 2013-04-21 01:26:18 +02:00
Mario Enrico Ragucci
de99c0c7e7 Silently ignore "installed = true" string in JSON string returned by status.php 2013-04-21 00:46:37 +02:00
Klaas Freitag
9f0348979b Simplify csyncthread with keeping csync ctx intact 2013-04-20 13:15:27 +03:00
Jenkins for ownCloud
5b5cd310b9 [tx-robot] updated from transifex 2013-04-20 01:27:05 +02:00
Daniel Molkentin
ea85d68a26 Revert non-working hack 2013-04-19 16:20:30 +02:00
Daniel Molkentin
fb0a883f7b Init member to 0, remove nonsensical if (foo) delete foo 2013-04-19 16:20:30 +02:00
Jenkins for ownCloud
64a0efe29a [tx-robot] updated from transifex 2013-04-19 01:26:30 +02:00
Daniel Molkentin
1f361b7260 Make certificateChain() thread safe
Fixes #487, #491, #454
2013-04-18 14:02:20 +02:00
Jenkins for ownCloud
763b06477d [tx-robot] updated from transifex 2013-04-18 01:28:59 +02:00
Klaas Freitag
cd7d2a0778 Set path for configure_file of desktop file. 2013-04-17 16:21:05 +02:00
Klaas Freitag
a4be3f304d Set log verbosity before calling csync_init. 2013-04-17 15:29:44 +02:00
Jenkins for ownCloud
88184d14d6 [tx-robot] updated from transifex 2013-04-17 01:53:47 +02:00
Daniel Molkentin
844d8eba47 Fix tr plural usage 2013-04-17 01:21:15 +02:00
Daniel Molkentin
5e65945a53 filitemdialog: more wording changes 2013-04-16 17:28:03 +02:00
Daniel Molkentin
428040762f fileitemdialog: GUI feedback for the copy action 2013-04-16 16:49:53 +02:00
Daniel Molkentin
30e0a13bc5 invalid password: Improve wording 2013-04-16 14:28:00 +02:00
Daniel Molkentin
275c2b1a6b Fix misleading balloon titles
Fixes #546
2013-04-16 11:24:07 +02:00
Jenkins for ownCloud
e409814cb6 [tx-robot] updated from transifex 2013-04-16 01:03:40 +02:00
Daniel Molkentin
acdb624713 safer approach for detecting duplicate sync runs 2013-04-15 15:55:54 +02:00
Daniel Molkentin
3cae8e7124 Remove debugging code 2013-04-15 14:32:23 +02:00
Jenkins for ownCloud
2595b9eae7 [tx-robot] updated from transifex 2013-04-15 01:02:18 +02:00
Jenkins for ownCloud
46a8561925 [tx-robot] updated from transifex 2013-04-14 01:02:45 +02:00
Jenkins for ownCloud
bb74cab887 [tx-robot] updated from transifex 2013-04-13 01:02:28 +02:00
Jenkins for ownCloud
dd7f58b9b9 [tx-robot] updated from transifex 2013-04-12 01:02:18 +02:00
Cedric Bellegarde
8165b83a27 Check for service availability 2013-03-22 11:58:55 +01:00
Cedric Bellegarde
fa62c270e6 Merge git://github.com/owncloud/mirall 2013-03-22 11:40:58 +01:00
Cedric Bellegarde
c03199e78a Re add space 2013-03-22 11:35:25 +01:00
Cedric Bellegarde
f346503534 Better fdo detection 2013-03-22 11:34:21 +01:00
Cedric Bellegarde
1315ca2a57 Move files to correct location 2013-03-20 10:19:55 +01:00
Cedric Bellegarde
2f0474a467 Add support for freedesktop notifications 2013-03-20 10:03:49 +01:00
285 changed files with 71998 additions and 92244 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
.gitmodules
*build*/
*flymake*
CMakeLists.txt.user*

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "doc/ocdoc"]
path = doc/ocdoc
url = https://github.com/owncloud/documentation

View File

@@ -4,18 +4,25 @@ project(mirall)
set(PACKAGE "mirall")
set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
if ( DEFINED OEM_THEME_DIR AND EXISTS ${OEM_THEME_DIR}/OEM.cmake )
include(Warnings)
set(OEM_THEME_DIR "" CACHE STRING "Define directory containing a custom theme")
if ( EXISTS ${OEM_THEME_DIR}/OEM.cmake )
include ( ${OEM_THEME_DIR}/OEM.cmake )
else ()
include ( ${CMAKE_SOURCE_DIR}/OWNCLOUD.cmake )
endif()
if (NOT DEFINED APPLICATION_SHORTNAME)
set ( APPLICATION_SHORTNAME ${APPLICATION_NAME} )
endif()
include(${CMAKE_SOURCE_DIR}/VERSION.cmake)
configure_file( ${CMAKE_SOURCE_DIR}/src/mirall/version.h.in "${CMAKE_CURRENT_BINARY_DIR}/src/mirall/version.h" )
include_directories(BEFORE "${CMAKE_CURRENT_BINARY_DIR}/src/mirall/")
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR} "${CMAKE_CURRENT_BINARY_DIR}/src/mirall/")
include(GNUInstallDirs)
include(DefineInstallationPaths)
include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
@@ -31,10 +38,8 @@ if (${GIT_SHA1} STREQUAL "GITDIR-NOTFOUND")
endif()
endif()
## stupid, we should upstream this
if("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr" AND NOT CMAKE_INSTALL_SYSCONFDIR)
set(CMAKE_INSTALL_SYSCONFDIR "/etc")
endif()
set(SYSCONFDIR ${SYSCONF_INSTALL_DIR})
set(DATADIR ${DATA_INSTALL_DIR})
#####
## handle BUILD_OWNCLOUD_OSX_BUNDLE
@@ -53,9 +58,19 @@ else()
endif()
#####
#####
## handle DBUS for Fdo notifications
if( UNIX AND NOT APPLE )
add_definitions( -DUSE_FDO_NOTIFICATIONS)
endif()
####
#### find libs
find_package(Qt4 4.6.0 COMPONENTS QtCore QtGui QtXml QtNetwork QtTest REQUIRED )
find_package(Csync)
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(Csync REQUIRED)
if(UNIX)
find_package(INotify REQUIRED)
else()
@@ -65,39 +80,13 @@ find_package(Sphinx)
find_package(PdfLatex)
find_package(QtKeychain)
set(WITH_CSYNC CSYNC_FOUND)
set(WITH_QTKEYCHAIN ${QTKEYCHAIN_FOUND})
set(USE_INOTIFY ${INOTIFY_FOUND})
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
set(CPACK_SOURCE_IGNORE_FILES
# hidden files
"/\\\\..+$"
# temporary files
"\\\\.swp$"
# backup files
"~$"
# others
"\\\\.#"
"/#"
"/build/"
"/_build/"
# used before
"\\\\.o$"
"\\\\.lo$"
"\\\\.la$"
"Makefile\\\\.in$"
)
include(OwnCloudCPack.cmake)
#
# This cmake builds two targets (aka apps), mirall and owncloud. For the owncloud
# target, OWNCLOUD_CLIENT needs to be a compile flag. It is set in src/CMakeLists.txt
# but if that fails because cmake is too old, uncomment this here if you want to build
# owncloud.
# add_definitions(-DOWNCLOUD_CLIENT)
add_definitions(-DUNICODE)
add_definitions(-D_UNICODE)
@@ -117,5 +106,5 @@ endif(UNIT_TESTING)
if(BUILD_OWNCLOUD_OSX_BUNDLE)
configure_file(sync-exclude.lst ${OWNCLOUD_OSX_BUNDLE}/Contents/Resources/sync-exclude.lst COPYONLY)
else()
install( FILES sync-exclude.lst DESTINATION ${CMAKE_INSTALL_SYSCONFDIR} )
install( FILES sync-exclude.lst DESTINATION ${SYSCONFDIR}/${APPLICATION_SHORTNAME} )
endif()

View File

@@ -4,8 +4,8 @@ If you have questions about how to use the ownCloud Desktop Client, please
direct these to the [mailing list][mailinglist] or our [forum][forum].
We are also available on [IRC][irc].
### Guidelines
* Report the issue using our [template][template], it includes all the
### Bug Reporting Guidelines
* Important: Report the issue using our [template][template], it includes all the
informations we need to track down the issue.
* This repository is *only* for issues within the ownCloud desktop client.
Issues in other compontents should be reported in their own repositores:

View File

@@ -1,5 +1,95 @@
ChangeLog
=========
version 1.4.1 (release 2013-09-24 ), csync 0.90.1 required
* Translation and documentation fixes.
* Fixed error display in settings/status dialog, displays multi
line error messages now correctly.
* Wait up to 30 secs before complaining about missing systray
Fixes bug #949
* Fixed utf8 issues with basic auth authentication, fixes bug #941
* Fixed remote folder selector, avoid recursive syncing, fixes bug #962
* Handle and display network problems at startup correctly.
* Enable and disable the folder watcher during syncs correctly.
* Fix setting of thread priority.
* Fixed file size display.
* Fixed various folder wizard issues, bug #992
* Made "Sync started" message optional, fixes bug #934
* Fixed shutdown, avoid crashed config on win32, fixes bug #945
* Pop up config wizard if no server url is configured, fixes bug #1018
* Settings: calculate sidebar width dynamically, fixes bug #1020
* Fixed a crash if sync folders were removed, fixes bug #713
* Do proper resync after network disconnect, fixes bug #1007
* Various minor code fixes
version 1.4.0 (release 2013-09-04 ), csync 0.90.0 required
* New Scheduler: Only sync when there are actual changes in the server
* Add a Settings Dialog, move Proxy Settings there
* Transform folder Status Dialog into Account Settings, provide feedback via context menu
* Add Bandwidth Control
* Add a visual storage/quota indicator (context menu and account settings)
* Add progress indication (context menu and account settings)
* Introduce a sync history, persisting results across syncs
* Move ability to switch to mono icons from a switch to a Settings option
* Add "Launch on System Startup" GUI option
* Add "Show Desktop Nofications"GUI option (enabled by default)
top optionally disable sync notifications
* Add Help item, pointing to online reference
* Implement graphical selection of remote folders in FolderWizard
* Allow custom ignore patterns
* Add an editor for ingore patterns
* ALlow to flag certain ignore patterns as discardable
* Ensure to ship with all valid translations
* Progress Dialog now preserves the last syncned items across sync runs
* Split Setup Wizard into multiple pages again
* Implement "--logfile -" to log to stdout
* Add preliminary support for Shibboleth authentication
* Linux: Provide more icon sizes
* Linux: Do not trigger notifier on ignored files
* Windows: Reduce priority of CSync thread
* Documentation: Prem. updates to reflect UI changes
* Significant code refactorings
* Require Qt 4.7
* Known issue: Under certain conditions, a file will only get uploaded after up to five minutes
version 1.3.0 (release 2013-06-25 ), csync 0.80.0 required
* Default proxy port to 8080
* Don't lose proxy settings when changing passwords
* Support SOCKS5 proxy (useful in combination with ssh *D)
* Propagate proxy changes to csync at runtime
* Improve proxy wizard
* Display proxy errors
* Solved problems with lock files
* Warn if for some reason all files are scheduled for removal on either side
* Avoid infinite loop if authentication fails in certain cases
* Fix reading the password from the config in certain cases
* Do not crash when configured sync target disappears
* Make --help work on windows
* Make sync feedback less ambiguous.
* Fix icon tray tooltip sometimes showing repeated content
* More use of native directory separators on Windows
* Remove journal when reusing a directory that used to have a journal before
* Visual clean up of status dialog items
* Wizard: When changing the URL or user name, allow the user to push his data
to the new location or wipe the folder and start from scratch
* Wizard: Make setting a custom folder as a sync target work again
* Fix application icon
* User-Agent now contains "Mozilla/5.0" and the Platform name (for firewall/proxy compat)
* Server side directory moves will be detected
* New setup wizard, defaulting to root syncing (only for new setups)
* Improved thread stop/termination
version 1.2.5 (release 2013-04-23 ), csync 0.70.7 required
* [Fixes] NSIS installer fixes
* [Fixes] Fix crash race by making certificateChain() thread safe
* [Fixes] Build with older CMake versions (CentOS/RHEL 6)
* [Fixes] Wording in GUI
* [Fixes] Silently ignore "installed = true" status.php
* Set log verbosity before calling csync_init.
* GUI feedback for the statistics copy action
* Safer approach for detecting duplicate sync runs
version 1.2.4 (release 2013-04-11 ), csync 0.70.6 required
* [Fixes] Clarify string in folder wizard
@@ -10,11 +100,9 @@ version 1.2.4 (release 2013-04-11 ), csync 0.70.6 required
* [Fixes] Allow setting the configuration directory on command line
version 1.2.3 (release 2013-04-02 ), csync 0.70.5 required
* [Fixes] Unbreak self-signed certificate handling
version 1.2.2 (release 2013-04-02 ), csync 0.70.5 required
* [Fixes] Do not crash when local file tree contains symlinks
* [Fixes] Correctly handle locked files on Windows
* [Fixes] Display errors in all members of the SSL chain

View File

@@ -1,9 +1,9 @@
set( APPLICATION_SHORTNAME "owncloud" )
set( APPLICATION_NAME "ownCloud" )
set( APPLICATION_EXECUTABLE "owncloud" )
set( APPLICATION_DOMAIN "owncloud.com" )
set( APPLICATION_VENDOR "ownCloud, Inc" )
set( THEME_CLASS "ownCloudTheme" )
#set( APPLICATION_SHORTNAME ${APPLICATION_NAME} )
set( APPLICATION_EXECUTABLE "owncloud" )
set( APPLICATION_DOMAIN "owncloud.com" )
set( APPLICATION_VENDOR "ownCloud, Inc" )
set( THEME_CLASS "ownCloudTheme" )
set( APPLICATION_REV_DOMAIN "com.owncloud.desktopclient" )
set( WIN_SETUP_BITMAP_PATH "${CMAKE_SOURCE_DIR}/admin/win/nsi" )
# set( THEME_INCLUDE "${OEM_THEME_DIR}/mytheme.h" )

View File

@@ -2,50 +2,12 @@
## Introduction
Mirall synchronizes your folders with another computer.
The ultimate goals of Mirall are:
* Network location aware: should not try to sync against your NAS if you are
not in the home network
* It is a zero-interaction tool. So forget about resolving conflicts.
* It should work silently and realiably.
Mirall is in early stages of development, and may still eat your
files or hang your computer.
* Network location awareness not implemented yet
* Current version supports local and remote (sftp and smb) folders.
* It is powered by csync (http://www.csync.org), however
the user does not know and other tools will be incorporated to provide other
functionality.
## Current issues
* No sane way to backup conflicting versions yet, this should be solved
in a near csync release (--conflictcopy, available in Jann's branch).
Right now the newest copy wins.
* You can't remove folder configurations
Workaround: delete ~/.local/share/data/Mirall/folders/$alias and restart
* Some tasks block the GUI (initial setup of watchers)
* May be some concurrency issues
## Roadmap
* Improve robustness to minimize user interaction
* Improve feedback and sync results
* Add support for other folder types: tarsnap, duplicity, git (SparkleShare)
## Requirements
* Linux (currently it uses inotify to detect file changes)
* unison installed in the local and remote machine
(you should not care if you got Mirall with your favorite
distribution)
Mirall is a tool to synchronize files from ownCloud Server with your computer.
It uses OCSync as its syncing backend.
## Download
### openSUSE
### Binary packages
* Refer to the download page http://owncloud.org/sync-clients/
@@ -55,23 +17,12 @@ files or hang your computer.
## Building the source code
You need Qt 4.7 and cmake:
mkdir build
cd build
cmake ..
make
To generate a tarball:
mkdir build
cd build
cmake ..
make package_source
Please refer to [Building the Client](http://doc.owncloud.org/desktop/1.2/building.html)
in the ownCloud client manual.
## Authors
* Duncan Mac-Vicar P. <duncan@kde.org>
* Duncan Mac-Vicar P. <duncan@kde.org> (original Mirall author)
* Klaas Freitag <freitag@owncloud.com>
* Daniel Molkentin <danimo@owncloud.com>

View File

@@ -1,6 +1,6 @@
set( VERSION_MAJOR 1 )
set( VERSION_MINOR 2 )
set( VERSION_PATCH 4 )
set( VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX})
set( VERSION_MINOR 4 )
set( VERSION_PATCH 1 )
set( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX}")
set( SOVERSION 0 )

View File

@@ -10,8 +10,7 @@ mount="/Volumes/$(basename $src_dmg|cut -d"-" -f1)"
test -e $tmp_dmg && rm -rf $tmp_dmg
hdiutil convert $src_dmg -format UDRW -o $tmp_dmg
open $tmp_dmg
sleep 12s
hdiutil attach $tmp_dmg
pushd $mount
codesign -s "$identity" $mount/*.app
popd

View File

@@ -0,0 +1,108 @@
if (UNIX)
# Suffix for Linux
SET(LIB_SUFFIX
CACHE STRING "Define suffix of directory name (32/64)"
)
SET(EXEC_INSTALL_PREFIX
"${CMAKE_INSTALL_PREFIX}"
CACHE PATH "Base directory for executables and libraries"
)
SET(SHARE_INSTALL_PREFIX
"${CMAKE_INSTALL_PREFIX}/share"
CACHE PATH "Base directory for files which go to share/"
)
SET(DATA_INSTALL_PREFIX
"${SHARE_INSTALL_PREFIX}/${APPLICATION_SHORT_NAME}"
CACHE PATH "The parent directory where applications can install their data")
# The following are directories where stuff will be installed to
SET(BIN_INSTALL_DIR
"${EXEC_INSTALL_PREFIX}/bin"
CACHE PATH "The ${APPLICATION_SHORT_NAME} binary install dir (default prefix/bin)"
)
SET(SBIN_INSTALL_DIR
"${EXEC_INSTALL_PREFIX}/sbin"
CACHE PATH "The ${APPLICATION_SHORT_NAME} sbin install dir (default prefix/sbin)"
)
SET(LIB_INSTALL_DIR
"${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}"
CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is prefix/lib)"
)
SET(LIBEXEC_INSTALL_DIR
"${EXEC_INSTALL_PREFIX}/libexec"
CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is prefix/libexec)"
)
SET(PLUGIN_INSTALL_DIR
"${LIB_INSTALL_DIR}/${APPLICATION_SHORT_NAME}"
CACHE PATH "The subdirectory relative to the install prefix where plugins will be installed (default is prefix/lib/${APPLICATION_SHORT_NAME})"
)
SET(INCLUDE_INSTALL_DIR
"${CMAKE_INSTALL_PREFIX}/include"
CACHE PATH "The subdirectory to the header prefix (default prefix/include)"
)
SET(DATA_INSTALL_DIR
"${DATA_INSTALL_PREFIX}"
CACHE PATH "The parent directory where applications can install their data (default prefix/share/${APPLICATION_SHORT_NAME})"
)
SET(HTML_INSTALL_DIR
"${DATA_INSTALL_PREFIX}/doc/HTML"
CACHE PATH "The HTML install dir for documentation (default data/doc/html)"
)
SET(ICON_INSTALL_DIR
"${DATA_INSTALL_PREFIX}/icons"
CACHE PATH "The icon install dir (default data/icons/)"
)
SET(SOUND_INSTALL_DIR
"${DATA_INSTALL_PREFIX}/sounds"
CACHE PATH "The install dir for sound files (default data/sounds)"
)
SET(LOCALE_INSTALL_DIR
"${SHARE_INSTALL_PREFIX}/locale"
CACHE PATH "The install dir for translations (default prefix/share/locale)"
)
SET(XDG_APPS_DIR
"${SHARE_INSTALL_PREFIX}/applications/"
CACHE PATH "The XDG apps dir"
)
SET(XDG_DIRECTORY_DIR
"${SHARE_INSTALL_PREFIX}/desktop-directories"
CACHE PATH "The XDG directory"
)
IF(NOT "${EXEC_INSTALL_PREFIX}" STREQUAL "/usr")
SET(SYSCONFDIR_INSTALL_PREFIX "${EXEC_INSTALL_PREFIX}")
endif()
SET(SYSCONF_INSTALL_DIR
"${SYSCONFDIR_INSTALL_PREFIX}/etc"
CACHE PATH "The ${APPLICATION_SHORT_NAME} sysconfig install dir (default prefix/etc)"
)
SET(MAN_INSTALL_DIR
"${SHARE_INSTALL_PREFIX}/man"
CACHE PATH "The ${APPLICATION_SHORT_NAME} man install dir (default prefix/man)"
)
SET(INFO_INSTALL_DIR
"${SHARE_INSTALL_PREFIX}/info"
CACHE PATH "The ${APPLICATION_SHORT_NAME} info install dir (default prefix/info)"
)
endif (UNIX)
if (WIN32)
# Same same
set(SHARE_INSTALL_PREFIX "share" CACHE PATH "-")
set(BIN_INSTALL_DIR "." CACHE PATH "-")
set(SBIN_INSTALL_DIR "." CACHE PATH "-")
set(LIB_INSTALL_DIR "lib" CACHE PATH "-")
set(INCLUDE_INSTALL_DIR "include" CACHE PATH "-")
set(PLUGIN_INSTALL_DIR "plugins" CACHE PATH "-")
set(HTML_INSTALL_DIR "doc/HTML" CACHE PATH "-")
set(ICON_INSTALL_DIR "." CACHE PATH "-")
set(SOUND_INSTALL_DIR "." CACHE PATH "-")
set(LOCALE_INSTALL_DIR "lang" CACHE PATH "-")
set(SYSCONF_INSTALL_DIR "config" CACHE PATH "-")
set(MAN_INSTALL_DIR "man" CACHE PATH "-")
endif (WIN32)

View File

@@ -1,6 +1,6 @@
;ownCloud installer script.
!define APPLICATION_SHORTNAME "@APPLICATION_SHORTNAME@"
!define APPLICATION_SHORTNAME "@APPLICATION_EXECUTABLE@"
!define APPLICATION_NAME "@APPLICATION_NAME@"
!define APPLICATION_VENDOR "@APPLICATION_VENDOR@"
!define APPLICATION_EXECUTABLE "@APPLICATION_EXECUTABLE@.exe"
@@ -18,7 +18,6 @@
!define OPTION_SECTION_SC_START_MENU
!define OPTION_SECTION_SC_DESKTOP
!define OPTION_SECTION_SC_QUICK_LAUNCH
!define OPTION_SECTION_SC_AUTOSTART
!define OPTION_FINISHPAGE
!define OPTION_FINISHPAGE_LAUNCHER
; !define OPTION_FINISHPAGE_RELEASE_NOTES
@@ -267,7 +266,7 @@ FunctionEnd
# INSTALLER SECTIONS #
# #
##############################################################################
Section "${APPLICATION_NAME}" SEC_OWNCLOUD
Section "${APPLICATION_NAME}" SEC_APPLICATION
SectionIn 1 2 3 RO
SetDetailsPrint listonly
@@ -283,84 +282,20 @@ Section "${APPLICATION_NAME}" SEC_OWNCLOUD
!ifndef INSTALL_PATH
;Main executable.
File "${BUILD_PATH}\bin\${APPLICATION_EXECUTABLE}"
File "${BUILD_PATH}\src\libowncloudsync.dll"
File "${BUILD_PATH}\src\lib${APPLICATION_SHORTNAME}sync.dll"
File "${BUILD_PATH}\src\mirall_ca.qm"
File "${BUILD_PATH}\src\mirall_cs_CZ.qm"
File "${BUILD_PATH}\src\mirall_da.qm"
File "${BUILD_PATH}\src\mirall_de.qm"
File "${BUILD_PATH}\src\mirall_el.qm"
File "${BUILD_PATH}\src\mirall_en.qm"
File "${BUILD_PATH}\src\mirall_eo.qm"
File "${BUILD_PATH}\src\mirall_es.qm"
File "${BUILD_PATH}\src\mirall_es_AR.qm"
File "${BUILD_PATH}\src\mirall_et_EE.qm"
File "${BUILD_PATH}\src\mirall_eu.qm"
File "${BUILD_PATH}\src\mirall_fa.qm"
File "${BUILD_PATH}\src\mirall_fi_FI.qm"
File "${BUILD_PATH}\src\mirall_fr.qm"
File "${BUILD_PATH}\src\mirall_gl.qm"
File "${BUILD_PATH}\src\mirall_he.qm"
File "${BUILD_PATH}\src\mirall_hr.qm"
File "${BUILD_PATH}\src\mirall_hu_HU.qm"
File "${BUILD_PATH}\src\mirall_it.qm"
File "${BUILD_PATH}\src\mirall_ja_JP.qm"
File "${BUILD_PATH}\src\mirall_ko.qm"
File "${BUILD_PATH}\src\mirall_lb.qm"
File "${BUILD_PATH}\src\mirall_lt_LT.qm"
File "${BUILD_PATH}\src\mirall_lv.qm"
File "${BUILD_PATH}\src\mirall_mk.qm"
File "${BUILD_PATH}\src\mirall_ms_MY.qm"
File "${BUILD_PATH}\src\mirall_nb_NO.qm"
File "${BUILD_PATH}\src\mirall_nl.qm"
File "${BUILD_PATH}\src\mirall_oc.qm"
File "${BUILD_PATH}\src\mirall_pl.qm"
File "${BUILD_PATH}\src\mirall_pt_BR.qm"
File "${BUILD_PATH}\src\mirall_pt_PT.qm"
File "${BUILD_PATH}\src\mirall_ro.qm"
File "${BUILD_PATH}\src\mirall_ru.qm"
File "${BUILD_PATH}\src\mirall_ru_RU.qm"
File "${BUILD_PATH}\src\mirall_si_LK.qm"
File "${BUILD_PATH}\src\mirall_sk_SK.qm"
File "${BUILD_PATH}\src\mirall_sl.qm"
File "${BUILD_PATH}\src\mirall_sr@latin.qm"
File "${BUILD_PATH}\src\mirall_sv.qm"
File "${BUILD_PATH}\src\mirall_ta_LK.qm"
File "${BUILD_PATH}\src\mirall_th_TH.qm"
File "${BUILD_PATH}\src\mirall_tr.qm"
File "${BUILD_PATH}\src\mirall_uk.qm"
File "${BUILD_PATH}\src\mirall_vi.qm"
File "${BUILD_PATH}\src\mirall_zh_CN.qm"
File "${BUILD_PATH}\src\mirall_zh_TW.qm"
#File "${MING_SHARE}\qt4\translations\qt_ar.qm"
File "${MING_SHARE}\qt4\translations\qt_cs.qm"
File "${MING_SHARE}\qt4\translations\qt_da.qm"
File "${MING_SHARE}\qt4\translations\qt_de.qm"
File "${MING_SHARE}\qt4\translations\qt_es.qm"
File "${MING_SHARE}\qt4\translations\qt_fa.qm"
File "${MING_SHARE}\qt4\translations\qt_fr.qm"
File "${MING_SHARE}\qt4\translations\qt_gl.qm"
File "${MING_SHARE}\qt4\translations\qt_he.qm"
File "${MING_SHARE}\qt4\translations\qt_hu.qm"
File "${MING_SHARE}\qt4\translations\qt_ja.qm"
File "${MING_SHARE}\qt4\translations\qt_ko.qm"
File "${MING_SHARE}\qt4\translations\qt_lt.qm"
File "${MING_SHARE}\qt4\translations\qt_pl.qm"
File "${MING_SHARE}\qt4\translations\qt_pt.qm"
File "${MING_SHARE}\qt4\translations\qt_ru.qm"
File "${MING_SHARE}\qt4\translations\qt_sk.qm"
File "${MING_SHARE}\qt4\translations\qt_sl.qm"
File "${MING_SHARE}\qt4\translations\qt_sv.qm"
File "${MING_SHARE}\qt4\translations\qt_uk.qm"
File "${MING_SHARE}\qt4\translations\qt_zh_CN.qm"
File "${MING_SHARE}\qt4\translations\qt_zh_TW.qm"
File "${MING_SHARE}\qt4\translations\qt_zh_TW.qm"
File "${MING_SHARE}\qt4\translations\qtkeychain_de.qm"
File "${BUILD_PATH}\src\mirall_*.qm"
; Make sure only to copy qt, not qt_help, etc
File "${MING_SHARE}\qt4\translations\qt_??.qm"
File "${MING_SHARE}\qt4\translations\qt_??_??.qm"
File "${MING_SHARE}\qt4\translations\qtkeychain_*.qm"
SetOutPath "$INSTDIR\accessible"
File "${ACCESSIBLE_DLL_PATH}\qtaccessiblewidgets4.dll"
SetOutPath "$INSTDIR\imageformats"
File "${IMAGEFORMATS_DLL_PATH}\qgif4.dll"
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
@@ -374,13 +309,14 @@ Section "${APPLICATION_NAME}" SEC_OWNCLOUD
;License & release notes.
File "@CPACK_RESOURCE_FILE_LICENSE@"
File /oname=NOTES.txt ${NSI_PATH}\RELEASE_NOTES.txt
;File /oname=NOTES.txt ${NSI_PATH}\RELEASE_NOTES.txt
;QT stuff:
File "${QT_DLL_PATH}\QtCore4.dll"
File "${QT_DLL_PATH}\QtGui4.dll"
File "${QT_DLL_PATH}\QtNetwork4.dll"
File "${QT_DLL_PATH}\QtXml4.dll"
File "${QT_DLL_PATH}\QtWebKit4.dll"
;QtKeyChain stuff
File "${MING_BIN}\libqtkeychain.dll"
@@ -404,7 +340,7 @@ Section "${APPLICATION_NAME}" SEC_OWNCLOUD
; Other
;File "${MING_BIN}\libpng15-15.dll"
;File "${MING_BIN}\libjpeg-8.dll"
File "${MING_BIN}\libjpeg-8.dll"
File "${MING_BIN}\zlib1.dll"
File "${MING_BIN}\libcrypto-10.dll"
File "${MING_BIN}\libssl-10.dll"
@@ -425,9 +361,9 @@ SectionGroup "Shortcuts"
SetShellVarContext all
RMDir /r "$SMPROGRAMS\${APPLICATION_NAME}"
CreateDirectory "$SMPROGRAMS\${APPLICATION_NAME}"
CreateShortCut "$SMPROGRAMS\${APPLICATION_NAME}\LICENSE.lnk" "$INSTDIR\LICENSE.txt"
;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}\Release notes.lnk" "$INSTDIR\NOTES.txt"
CreateShortCut "$SMPROGRAMS\${APPLICATION_NAME}\Uninstall.lnk" "$INSTDIR\uninstall.exe"
SetShellVarContext current
${MementoSectionEnd}
@@ -455,17 +391,6 @@ SectionGroup "Shortcuts"
SectionGroupEnd
!ifdef OPTION_SECTION_SC_AUTOSTART
${MementoSection} "Autostart" SEC_AUTOSTART
SectionIn 1 2
SetDetailsPrint textonly
DetailPrint "Creating Windows Start Entry"
SetDetailsPrint listonly
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Run" \
"${APPLICATION_NAME}" "$INSTDIR\${APPLICATION_EXECUTABLE}"
${MementoSectionEnd}
!endif
${MementoSectionDone}
; Installer section descriptions
@@ -475,7 +400,6 @@ ${MementoSectionDone}
!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_QUICK_AUTOSTART} "Register ${APPLICATION_NAME} to run on Windows startup."
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Section -post
@@ -578,11 +502,6 @@ Section Uninstall
DeleteRegKey HKCR "${APPLICATION_NAME}"
;Windows Start entry
!ifdef OPTION_SECTION_SC_AUTOSTART
DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "${APPLICATION_NAME}"
!endif
;Start menu shortcuts.
!ifdef OPTION_SECTION_SC_START_MENU
SetShellVarContext all

View File

@@ -0,0 +1,20 @@
if(CMAKE_COMPILER_IS_GNUCXX)
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
if(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic -Wno-long-long")
else(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -Wno-long-long")
endif(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
endif(CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_CXX_COMPILER MATCHES "clang")
set(CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -Wno-long-long")
endif(CMAKE_CXX_COMPILER MATCHES "clang")
# TODO: handle msvc compilers warnings?
if(DEFINED MIRALL_FATAL_WARNINGS)
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER MATCHES "clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
endif (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER MATCHES "clang")
# TODO: handle msvc compilers warnings?
endif(DEFINED MIRALL_FATAL_WARNINGS)

View File

@@ -2,11 +2,17 @@
#define CONFIG_H
#cmakedefine USE_INOTIFY 1
#cmakedefine WITH_CSYNC 1
#cmakedefine WITH_QTKEYCHAIN 1
#cmakedefine GIT_SHA1 "@GIT_SHA1@"
#cmakedefine APPLICATION_DOMAIN @APPLICATION_DOMAIN@
#cmakedefine THEME_CLASS @THEME_CLASS@
#cmakedefine THEME_INCLUDE @THEME_INCLUDE@
#cmakedefine APPLICATION_NAME "@APPLICATION_NAME@"
#cmakedefine APPLICATION_SHORTNAME "@APPLICATION_SHORTNAME@"
#cmakedefine APPLICATION_EXECUTABLE "@APPLICATION_EXECUTABLE@"
#cmakedefine SYSCONFDIR "@SYSCONFDIR@"
#cmakedefine DATADIR "@DATADIR@"
#endif

View File

@@ -22,12 +22,17 @@ if(SPHINX_FOUND)
add_custom_target(doc DEPENDS doc-html doc-man COMMENT "Building documentation...")
endif(WITH_DOC)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ocdoc/_shared_assets")
add_dependencies(doc doc-html-org)
add_dependencies(doc doc-html-com)
endif()
if(PDFLATEX_FOUND)
# if this still fails on Debian/Ubuntu, run
# apt-get install texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
add_custom_target(doc-latex ${SPHINX_EXECUTABLE}
-q -c . -b latex
-d ${SPHINX_CACHE_DIR}
-d ${SPHINX_CACHE_DIR}/latex
-D latex_logo=${LATEX_LOGO}
${CMAKE_CURRENT_SOURCE_DIR}
${SPHINX_PDF_DIR} )
@@ -41,7 +46,7 @@ if(SPHINX_FOUND)
if (EXISTS ${QT_QCOLLECTIONGENERATOR_EXECUTABLE})
add_custom_target( doc-qch-sphinx ${SPHINX_EXECUTABLE}
-q -c . -b qthelp
-d ${SPHINX_CACHE_DIR}
-d ${SPHINX_CACHE_DIR}/qthelp
${CMAKE_CURRENT_SOURCE_DIR}
${SPHINX_QCH_DIR} )
add_custom_target( doc-qch ${QT_QCOLLECTIONGENERATOR_EXECUTABLE}
@@ -54,12 +59,24 @@ if(SPHINX_FOUND)
endif()
add_custom_target( doc-html ${SPHINX_EXECUTABLE}
-q -c . -b html
-d ${SPHINX_CACHE_DIR}
-d ${SPHINX_CACHE_DIR}/html
${CMAKE_CURRENT_SOURCE_DIR}
${SPHINX_HTML_DIR} )
${SPHINX_HTML_DIR}/unthemed )
add_custom_target( doc-html-org ${SPHINX_EXECUTABLE}
-q -c . -b html
-d ${SPHINX_CACHE_DIR}/html
-D html_theme=owncloud_org
${CMAKE_CURRENT_SOURCE_DIR}
${SPHINX_HTML_DIR}/org )
add_custom_target( doc-html-com ${SPHINX_EXECUTABLE}
-q -c . -b html
-d ${SPHINX_CACHE_DIR}/html
-D html_theme=owncloud_com
${CMAKE_CURRENT_SOURCE_DIR}
${SPHINX_HTML_DIR}/com )
add_custom_target( doc-man ${SPHINX_EXECUTABLE}
-q -c . -b man
-d ${SPHINX_CACHE_DIR}
-d ${SPHINX_CACHE_DIR}/man
${CMAKE_CURRENT_SOURCE_DIR}
${SPHINX_MAN_DIR} )
@@ -71,7 +88,7 @@ if(SPHINX_FOUND)
add_custom_target( doc-chm-sphinx ${SPHINX_EXECUTABLE}
-q -c . -b htmlhelp
-D html_theme=basic
-d ${SPHINX_CACHE_DIR}
-d ${SPHINX_CACHE_DIR}/htmlhelp
${CMAKE_CURRENT_SOURCE_DIR}
${SPHINX_HTMLHELP_DIR} )
add_custom_target( doc-chm pushd ${SPHINX_HTMLHELP_DIR}; ${MSHTML_COMPILER} *.hhp; popd

37
doc/accountsetup.rst Normal file
View File

@@ -0,0 +1,37 @@
Setting up an Account
=====================
If no account has been configured, ownCloud Client will automatically assist
you in connecting to your ownCloud Server after the application has been
started.
As a first step, specify the URL to your Server, just
like you would when you open your ownCloud instance inside a browser.
.. image:: images/wizard_url.png
:scale: 50 %
.. note:: Make sure to use ``https://`` if the server supports it. Otherwise,
your password and all data will be transferred to the server unencrypted.
This makes it easy for third parties to intercept your communication, and
getting hold of your password!
Next, you are prompted for your username and password. Again, use the same
credentials that you would use to log on via the web interface.
.. image:: images/wizard_user.png
:scale: 50 %
Finally, choose the folder that ownCloud Client is supposed to sync the
contents of your ownCloud account with. By default, this is a folder
called `ownCloud`, which will reside in your home directory.
.. image:: images/wizard_targetfolder.png
:scale: 50 %
After pressing `Connect`, ownCloud Client will commence with the syncing
process. The next screen will give you the opportunity to review your
settings:
.. image:: images/wizard_overview.png
:scale: 50 %

14
doc/advancedusage.rst Normal file
View File

@@ -0,0 +1,14 @@
Advanced Usage
==============
.. index:: Advanced Usage
Options
-------
.. index:: command line switches, command line, options, parameters
.. include:: options.rst
Config File
-----------
.. index:: config file
.. include:: conffile.rst

View File

@@ -1,5 +1,6 @@
Architecture
============
Appendix B: Architecture
========================
.. index:: architecture
The ownCloud project provides desktop sync clients to synchronize the
@@ -11,11 +12,10 @@ csync was written to synchronize with ownClouds built-in WebDAV server.
The ownCloud sync client is based on a tool called mirall initially written by
Duncan Mac Vicar. Later Klaas Freitag joined the project and enhanced it to work
with ownCloud server. Both mirall and ownCloud Client (oCC) build from the same
source, currently hosted in the ownCloud source repo on gitorious.
with ownCloud server.
oCC is written in C++ using the `Qt Framework`_. As a result oCC runs on the
three important platforms Linux, Windows and MacOS.
ownCloud Client is written in C++ using the `Qt Framework`_. As a result, the
ownCloud Client runs on the three important platforms Linux, Windows and MacOS.
.. _csync: http://www.csync.org
.. _`Qt Framework`: http://www.qt-project.org
@@ -23,8 +23,8 @@ three important platforms Linux, Windows and MacOS.
The Sync Process
----------------
First it is important to recall what syncing is. Syncing tries to keep the files
on both repositories the same. That means if a file is added to one repository
First it is important to recall what syncing is: It tries to keep the files
on two repositories the same. That means if a file is added to one repository
it is going to be copied to the other repository. If a file is changed on one
repository, the change is propagated to the other repository. Also, if a file
is deleted on one side, it is deleted on the other. As a matter of fact, in
@@ -34,8 +34,13 @@ server is always master.
This is the major difference to other systems like a file backup where just
changes and new files are propagated but files never get deleted.
Sync Direction and Strategies
-----------------------------
The ownCloud Client checks both repositories for changes frequently after a
certain time span. That is refered to as a sync run. In between the local
repository is monitored by a file system monitor system that starts a sync run
immediately if something was edited, added or removed.
Sync by Time versus ETag
------------------------
.. index:: time stamps, file times, etag, unique id
Until the release of ownCloud 4.5 and ownCloud Client 1.1, ownCloud employed
@@ -44,7 +49,7 @@ synced to the other repository: the files modification time.
The *modification timestamp* is part of the files metadata. It is available on
every relevant filesystem and is the natural indicator for a file change.
modification timestamps do not require special action to create and have
Modification timestamps do not require special action to create and have
a general meaning. One design goal of csync is to not require a special server
component, thats why it was chosen as the backend component.
@@ -57,29 +62,24 @@ machines.
Since this strategy is rather fragile without NTP, ownCloud 4.5 introduced a
unique number, which changes whenever the file changes. Although it is a unique
value, it is not a hash of the file, but a randomly chosen number, which it will
transmit in the Etag_ field. The client will store this number in a
per-directory database, located in the application directory (version 1.1) or
as a hidden file right in the directory to be synced (later versions).
Since the file number is guaranteed to change if the file changes, it can now be
used to determine if one of the files has changed.
transmit in the Etag_ field. Since the file number is guaranteed to change if
the file changes, it can now be used to determine if one of the files has
changed.
.. todo:: describe what happens if both sides change
.. note:: ownCloud Client 1.1 and newer require file ID capabilities on the
ownCloud server, hence using them with a server earlier than 4.5.0 is
not supported.
Before the 1.3.0 release of the client the sync process might create faux
conflict files if time deviates. The original and the conflict files only
differed in the timestamp, but not in content. This behaviour was changed
towards a binary check if the files are different.
If the per-directory database gets removed, oCC's CSync backend will fall back
to a time-stamp based sync process to rebuild the database. Thus it should be
made sure that both server and client synchronized to NTP time before
restarting the client after a database removal. If time deviates, the sync
process might create faux conflict files, which only differ in their time.
Those need to be cleaned up manually later on and will not be synced back
to the server. However, no files will get deleted in this process.
Just like files, directories also hold a unique id, which changes whenever
one of the contained files or directories gets modified. Since this is a
recursive process, it significantly reduces the effort required for a sync
cycle, because the client will only walk directories with a modified unique id.
.. note:: oCC 1.1 and newer require file ID capabilities on the ownCloud server,
hence using them with a server earlier than 4.5.0 is not supported.
This table outlines the different sync methods attempted depending
on server/client combination:
@@ -106,3 +106,56 @@ are involved and one of them is not in sync with NTP time.
.. _`NTP time synchronisation`: http://en.wikipedia.org/wiki/Network_Time_Protocol
.. _Etag: http://en.wikipedia.org/wiki/HTTP_ETag
Comparison and Conflict Cases
-----------------------------
In a sync run the client first has to detect if one of the two repositories have
changed files. On the local repository, the client traverses the file
tree and compares the modification time of each file with the value it was
before. The previous value is stored in the client's database. If it is not, it
means that the file has been added to the local repository. Note that on
the local side, the modificaton time a good attribute to detect changes because
it does not depend on time shifts and such.
For the remote (ie. ownCloud) repository, the client compares the ETag of each
file with it's previous value. Again the previous value is queried from the
database. If the ETag is still the same, the file has not changed.
In case a file has changed on both, the local and the remote repository since
the last sync run, it can not easily be decided which version of the file is
the one that should be used. However, changes to any side must not be lost.
That is called a **conflict case**. The client solves it by creating a conflict
file of the older of the two files and save the newer one under the original
file name. Conflict files are always created on the client and never on the
server. The conflict file has the same name as the original file appended with
the timestamp of the conflict detection.
.. _ignored-files-label:
Ignored Files
-------------
ownCloud Client will refuse to sync the following files:
* Files matched by one of the pattern in :ref:`ignoredFilesEditor-label`
* Files containing characters that do not work on certain file systems.
Currently, these characters are: `\, :, ?, *, ", >, <, |`
* Files starting in ``.csync_journal.db`` (reserved for journalling)
The Sync Journal
----------------
The client stores the ETag number in a per-directory database,
called the journal. It is a hidden file right in the directory
to be synced.
If the journal database gets removed, ownCloud Client's CSync backend will
rebuild the database by comparing the files and their modification times. Thus
it should be made sure that both server and client synchronized with NTP time
before restarting the client after a database removal.
Pressing ``F5`` in the Account Settings Dialog that allows to "reset" the
journal. That can be used to recreate the journal database. Use this only
if advised to do so by the developer or support staff.

View File

@@ -1,5 +1,7 @@
Building the Client
===================
.. _building-label:
Appendix A: Building the Client
===============================
This section explains how to build the ownCloud Client from source
for all major platforms. You should read this section if you want
@@ -20,20 +22,29 @@ Linux
Mac OS X
--------
Follow the `generic build instructions`_.
Next to XCode (and the command line tools!), you will need some
extra dependencies.
You can install the missing dependencies via MacPorts_ or Homebrew_.
You can install these dependencies via MacPorts_ or Homebrew_.
This is only needed on the build machine, since non-standard libs
will be deployed in the app bundle.
The only exception to this rule is libiniparser_, which lacks a decent
build system. If you are using Homebrew_, you can just add it::
The tested and preferred way is to use HomeBrew_. The ownCloud team has
its own repository which contains non-standard recipes. Add it with::
brew tap dschmidt/owncloud
brew install iniparser
brew tap owncloud/owncloud
Otherwise, you need to copy the header and lib files to
``/usr/local/include`` and ``/usr/local/lib`` respectively.
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`_.
.. note::
You should not call ``make install`` at any time, since the product of the
@@ -51,18 +62,22 @@ 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)::
http://download.opensuse.org/repositories/isv:/ownCloud:/devel:/mingw:/win32/openSUSE_12.1/
http://download.opensuse.org/repositories/windows:/mingw/openSUSE_12.1/
http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_12.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
Next, install the cross-compiler packages and the cross-compiled dependencies::
zypper si -d mingw32-csync
zypper install kdewin-png2ico mingw32-libqt4 mingw32-libqt4-devel \
mingw32-libgcrypt mingw32-libgnutls mingw32-libneon \
mingw32-libbeecrypt mingw32-libopenssl mingw32-openssl \
mingw32-libpng-devel mingw32-libsqlite mingw32-qtkeychain \
mingw32-qtkeychain-devel mingw32-iniparser mingw32-dlfcn
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
For the installer, the NSIS installer package is also required::
@@ -76,18 +91,18 @@ For the installer, the NSIS installer package is also required::
You will also need to manually download and install the following files with
``rpm -ivh <package>`` (They will also work with OpenSUSE 12.2)::
http://pmbs.links2linux.org/download/mingw:/32/openSUSE_12.1/x86_64/mingw32-cross-nsis-plugin-processes-0-1.1.x86_64.rpm
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://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
Now, follow the `generic build instructions`_, but pay attention to
the following differences:
1. For building ``libocsync``, you need to use ``mingw32-cmake`` instead
of cmake.
2. Also, you need to specify *absolute pathes* for ``CSYNC_LIBRARY_PATH``
and ``CSYNC_LIBRARY_PATH`` when running ``cmake`` on mirall.
3. for building ``mirall``, you need to use ``cmake`` again, but make sure
2. for building ``mirall``, you need to use ``cmake`` again, but make sure
to append the following parameter::
3. Also, you need to specify *absolute pathes* for ``CSYNC_LIBRARY_PATH``
and ``CSYNC_LIBRARY_PATH`` when running ``cmake`` on mirall.
``-DCMAKE_TOOLCHAIN_FILE=../mirall/admin/win/Toolchain-mingw32-openSUSE.cmake``
@@ -147,7 +162,7 @@ directories. If this succeeds, call ``make``. The owncloud binary should appear
in the ``bin`` directory. You can also run ``make install`` to install the client to
``/usr/local/bin``.
To build in installer (requires the mingw32-cross-nsis packages)::
To build an installer/app bundle (requires the mingw32-cross-nsis packages on Windows)::
make package
@@ -161,4 +176,3 @@ Known cmake parameters:
.. _Git: http://git-scm.com
.. _MacPorts: http://www.macports.org
.. _Homebrew: http://mxcl.github.com/homebrew/
.. _libiniparser: http://ndevilla.free.fr/iniparser/

View File

@@ -28,7 +28,7 @@ import sys, os
extensions = ['sphinx.ext.todo']
# Add any paths that contain templates here, relative to this directory.
#templates_path = ['templates']
templates_path = ['@CMAKE_CURRENT_SOURCE_DIR@/ocdoc/_shared_assets/templates']
# The suffix of source filenames.
source_suffix = '.rst'
@@ -41,7 +41,7 @@ master_doc = 'index'
# General information about the project.
project = u'ownCloud Client Manual'
copyright = u'2012, The ownCloud developers'
copyright = u'2013, The ownCloud developers'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@@ -64,7 +64,7 @@ release = '@VERSION@'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
exclude_patterns = ['_build','scripts/*']
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
@@ -95,7 +95,7 @@ pygments_style = 'sphinx'
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = ['themes']
html_theme_path = ['@CMAKE_CURRENT_SOURCE_DIR@/ocdoc/_shared_assets/themes']
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
@@ -120,7 +120,7 @@ html_short_title = "Client Manual"
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['static']
html_static_path = ['@CMAKE_CURRENT_SOURCE_DIR@/ocdoc/_shared_assets/static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
@@ -215,8 +215,6 @@ latex_documents = [
man_pages = [
('owncloud.1', 'owncloud', u'File synchronisation desktop utility.',
[u'The ownCloud developers'], 1),
('mirall.1', 'mirall', u'File synchronisation desktop utility.',
[u'The ownCloud developers'], 1)
]
# If true, show URL addresses after external links.
@@ -250,7 +248,7 @@ texinfo_documents = [
epub_title = u'ownCloud Client Manual'
epub_author = u'The ownCloud developers'
epub_publisher = u'The ownCloud developers'
epub_copyright = u'2012, The ownCloud developers'
epub_copyright = u'2013, The ownCloud developers'
# The language of the text. It defaults to the language option
# or en if the language is not set.

View File

@@ -16,8 +16,6 @@ It contains settings in the ini file format known from Windows.
.. note:: Changes may be overwritten by using ownCloud's configuration dialog.
.. note:: The new version is less precise in this regard.
These are config settings that may be changed:
``remotePollinterval`` (default: ``30000``)
@@ -26,6 +24,3 @@ These are config settings that may be changed:
``maxLogLines`` (default: ``20000``)
Maximum count of log lines shown in the log window
``remotePollinterval``
The frequency used for polling for remote changes on the ownCloud Server.

View File

@@ -4,8 +4,8 @@ Glossary
.. glossary::
:sorted:
ownCloud Sync Client
ownCloud Client
oCC
Name of the official ownCloud syncing client for desktop, which runs on
Windows, Mac OS X and Linux. It is based Mirall, and uses the CSync
sync engine for synchronization with the ownCloud server.
@@ -23,6 +23,7 @@ Glossary
exist in the client directory.
unique id
ETag
ID assigned to every file starting with ownCloud server 4.5 and submitted
via the HTTP ``Etag``. Used to check if files on client and server have
changed.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

BIN
doc/images/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
doc/images/menu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
doc/images/wizard_url.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
doc/images/wizard_user.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View File

@@ -6,8 +6,11 @@ Contents
.. toctree::
:maxdepth: 2
install
usage
introduction
accountsetup
visualtour
advancedusage
building
architecture
troubleshooting

View File

@@ -1,36 +0,0 @@
Installation
============
General
-------
The latest version of ownCloud client can be obtained at
http://owncloud.org/sync-clients/.
Windows
-------
ownCloud client for Windows is provided as a NSIS-based setup file for
machine-wide install.
Mac OS X
--------
Installing the ownCloud client on your Mac follows the normal app installation
pattern:
1. Download the installation file Click ownCloud-1.1.1.dmg, a window with the
2. ownCloud icon opens In that window, drag the ownCloud application into the
3. Applications folder on the right hand side From Applications, choose
ownCloud
Linux
------
The ownCloud client is provided as in a convenient repository for a wide range
of popular Linux distributions. If you want to build the sources instead.
Supported distributions are CentOS/RHEL, Fedora, SLES, openSUSE, Ubuntu and
Debian.
To support other distributions, a source build is required.

37
doc/introduction.rst Normal file
View File

@@ -0,0 +1,37 @@
Introduction
============
This is the documentation for the ownCloud Sync Client, also referred to as
the ownCloud Client.
The ownCloud Sync Client is a desktop program you install on your computer.
Specify one ore more directories on the local machine to sync your ownCloud
server, and always have your latest files wherever you are. Make a change to the
files on one computer, it will flow across the others using these desktop sync
clients.
ownCloud Client is available for Windows, Mac OS X and various Linux
distributions. See below for details on how to obtain the Client.
Obtaining the Client
--------------------
The latest version of the ownCloud Client can be obtained at
http://owncloud.org/sync-clients/.
ownCloud client for **Windows** is provided as a NSIS-based setup file for
machine-wide install. Installing the ownCloud client on **Mac OS** follows
the normal app bundle installation pattern:
1. Download the installation file: Click ``ownCloud-x.y.z.dmg``, a window with
the ownCloud icon opens.
2. In that window, drag the ownCloud application into the ``Applications``
folder.
3. On the right hand side From ``Applications``, choose ``ownCloud``.
The ownCloud Client is also provided as in a convenient repository for a wide
range of popular **Linux distributions**. If you want to build the sources
instead.
Supported distributions are Fedora, openSUSE, Ubuntu and Debian.
To support other distributions, a is required, see :ref:`building-label`

View File

@@ -1,38 +0,0 @@
mirall(1)
---------
SYNOPSIS
========
*mirall* [`OPTIONS`...]
DESCRIPTION
===========
mirall is a file synchronisation desktop utility.
It synchronizes files on your local machine with an ownCloud Server. If you
make a change to the files on one computer, it will flow across the others
using this desktop sync clients.
Normally you start the client by click on the desktop icon or start from the
application menu. After starting an ownCloud icon appears in the system tray.
Options
=======
.. include:: options.rst
Config File
===========
.. include:: conffile.rst
BUGS
====
Please report bugs at https://github.com/owncloud/core/issues.
SEE ALSO
========
`csync(1)`, `mirall(1)`

1
doc/ocdoc Submodule

Submodule doc/ocdoc added at 2c3e584b23

View File

@@ -1,15 +1,20 @@
ownCloud Client supports the following command line switches:
``--logwindow``
open a window to show log output at startup.
open a window to show log output.
``--logfile`` `<filename>`
write log output to file.
write log output to file <filename>.
``--flushlog``
``--logdir`` `<name>`
write each sync log output in a new file in directory <name>
``--logexpire`` `<hours>`
removes logs older than <hours> hours. (to be used with --logdir)
``--logflush``
flush the log file after every write.
``--monoicons``
Use black/white pictograms for systray.
``--confdir`` `<dirname>`
Use the given configuration directory.

View File

@@ -9,7 +9,7 @@ SYNOPSIS
DESCRIPTION
===========
owncloud is a file synchronisation desktop utility it is based on mirall.
ownCloud is a file synchronisation desktop utility based on mirall.
It synchronizes files on your local machine with an ownCloud Server. If you
make a change to the files on one computer, it will flow across the others
using this desktop sync clients.
@@ -33,5 +33,5 @@ Please report bugs at https://github.com/owncloud/core/issues.
SEE ALSO
========
`csync(1)`, `mirall(1)`
`csync(1)`

View File

@@ -4,9 +4,12 @@ Doc Build Convenience Scripts
* ``htmlhelp.sh``: A script to install Microsoft HTML Workshop on Linux or Mac OS using Wine, along with some dependencies.
* ``htmlhelp.reg``: Registry file to override some DLLs with their native version and set the right Windows version.
Those files have been taken from the HTML Help Project (http://code.google.com/p/htmlhelp/wiki/HHW4Wine).
Those files have been taken from the `HTML Help Project`_.
License
-------
The HTML Help Project has licensed its software under LGPLv3 terms.
The HTML Help Project has licensed_ its software under LGPLv2.1 terms
.. _HTML Help Project: http://code.google.com/p/htmlhelp/wiki/HHW4Wine
.. _licensed: https://code.google.com/p/htmlhelp/source/browse/trunk/pyhtmlhelp/COPYING

View File

@@ -1,42 +1,136 @@
Troubleshooting
===============
Appendix C: Troubleshooting
===========================
:All of my desktop clients fail to connect to ownCloud:
If the client fails to start syncing it basically can have two
basic reasons: Either the server setup has a problem or the client
has a bug. When reporting bugs, it is crucial to find out what part
of the system causes the problem.
Identifying basic functionality problems
----------------------------------------
:Perform a general ownCloud Server test:
A very first check is to verify that you can log on to ownClouds web
application. Assuming your ownCloud instance is installed at
``http://yourserver.com/owncloud``, type
``http://yourserver.com/owncloud/`` into your browsers address bar.
If you are not prompted to enter your user name and password, or if you
see a red warning box on the page, your server setup is not correct or needs
fixes. Please verify that your server installation is working correctly.
:Ensure the WebDAV API is working:
If all desktop clients fail to connect to ownCloud, but the access via the
web interface works, the problem often is a mis-configuration of the WebDAV
API.
The ownCloud client uses the built-in WebDAV access of the server content.
Verify that you can log on to ownClouds WebDAV server. Assuming your ownCloud
instance is installed at ``http://yourserver.com/owncloud``, type
``http://yourserver.com/owncloud/remote.php/webdav`` into your browsers
address bar.
If you are not prompted to enter your user name and password, please verify
that your server installation is working correctly.
If you are prompted, but the authentication fails even though the credentials
your provided are correct, please ensure that your authentication backend
is configured properly.
:Use a WebDAV command line tool to test:
A more sophisticated test is to use a WebDAV command line client and log
into the ownCloud WebDAV server, such as a little app called cadaver, available
on Linux. I can be used to further verify that the WebDAV server is running
properly, for example by performing PROPFIND calls:
into the ownCloud WebDAV server, such as a little app called cadaver,
available on Linux. It can be used to further verify that the WebDAV server is
running properly, for example by performing PROPFIND calls:
``propget .`` called within cadaver will return some properties of the current
directory and thus be a successful WebDAV connect.
:The desktop client fails for an unknown reason:
Start the client with ``--logwindow``. You can also open a log window for an
already running session, by simply starting the client again with this
parameter. Syntax:
Isolating other issues
----------------------
If the sync result is unreliable, please ensure that the folder synced with
ownCloud is not shared with other syncing apps.
.. note:: Syncing the same directory with ownCloud and other sync software such
as Unison, rsync, Microsoft Windows Offline Folders or cloud services
such as DropBox or Microsoft SkyDrive is not supported and should
not be attempted. In the worst case, doing so can result in data
loss.
If some files do not get take a look at the sync protocol. Some files are
automatically automatically being ignored because they are system files,
others get ignored because their file name contains characters that cannot
be represented on certain file systems. See :ref:`_ignored-files-label` for
details.
If you are operating your own server and use the local storage backend (the
default), make sure that ownCloud has exclusive access to the directory.
.. note:: The data directory on the server is exclusive to ownCloud and must
not be modified manually.
If you are using a different backend, you can try to exclude a bug in the
backend by reverting to the local backend.
Logfiles
--------
Doing effective debugging requires to provide as much as relevant logs as
possible. The log output can help you with tracking down problem, and if you
report a bug, you're advised to include the output.
Client Logfile
~~~~~~~~~~~~~~
Start the client with ``--logwindow``. That opens a window providing a view
on the current log. It provides a Save button to let you save the log to a
file.
You can also open a log window for an already running session, by simply
starting the client again with this parameter. Syntax:
* Windows: ``C:\Program Files (x86)\ownCloud\owncloud.exe --logwindow``
* Mac OS X: ``/Applications/owncloud.app/Contents/MacOS/owncloud --logwindow``
* Linux: ``owncloud --logwindow``
The log output can help you with tracking down problem, and if you report
a bug, it's useful to include the output.
It is also possible to directly log to a directory, which is an useful option
in case the problem only happens ocassionally. In that case it is better to
create a huge amount of data, as the log window has a limited buffer.
To write logs to disk, start the client with ``--logfile <file>``, where
``<file`` is the file you want to log to, or ``--logdir <dir>``, where ``<dir>``
is an existing directory. In case of ``--logdir``, each sync run will create a
new file. To limit the amount of data that accumulates over time, there is another
useful parameter: ``--logexpire <hours>```. If that is combined with ```--logdir```
the client automatically erases log data in that directory that is older than the
given expiry period.
For example, for a long running test where you intend to keep the log data of the
last two days, this would be the command line:
```
owncloud --logdir /tmp/owncloud_logs --logexpire 48
```
ownCloud server Logfile
~~~~~~~~~~~~~~~~~~~~~~~
The ownCloud server maintains an ownCloud specific logfile as well. It can and
must be enabled through the ownCloud Administration page. There you can adjust
the loglevel. It is advisable to set it to a verbose level like ``Debug`` or
``Info``.
The logfile can be viewed either in the web interface or can be found in the
filesystem in the ownCloud server data dir.
Webserver Logfiles
~~~~~~~~~~~~~~~~~~
Also, please take a look at your webservers error log file to check if there
are problems. For Apache on Linux, the error logs usually can be found at
``/var/log/apache2``. A file called ``error_log`` shows errors like PHP code
problems. A file called ``access_log`` usually records all requests handled
by the server. Especially the access_log is a very good debugging tool as the
log line contains a lot of information of every request and it's result.
More information about the apache logging can be found at
``http://httpd.apache.org/docs/current/logs.html``.
Also, please take a look at your webservers error log file to check if there
are problems. For apache on linux, the error logs usually can be found at
``/var/log/apache2``. A file called ``error_log`` shows errors like PHP code
problems. A file called ``access_log`` usually records all requests handled
by the server. More information about the apache logging can be found at
``http://httpd.apache.org/docs/current/logs.html``.

View File

@@ -1,24 +0,0 @@
Usage
=====
.. index:: usage, client sync usage
To start ownCloud Client, click on the desktop icon or start it from the
application menu. In the system tray, an ownCloud icon appears.
.. index:: start application
A left click on the tray icon open a status dialog which gives an overview on
the configured sync folders and allows to add and remove more sync folder
connections as well as pausing a sync connection.
A right click on the tray icon gives other configuration options.
Options
-------
.. index:: command line switches, command line, options, parameters
.. include:: options.rst
Config File
-----------
.. index:: config file
.. include:: conffile.rst

178
doc/visualtour.rst Normal file
View File

@@ -0,0 +1,178 @@
Visual Tour
===========
.. index:: visual tour, usage
ownCloud Client stays in the background, and is visible as an
icon in your system tray (Windows, KDE), status bar (Mac OS X)
or notification area (Ubuntu), like so:
.. image:: images/icon.png
If a setup is still required, it will open the setup. Otherwise, the
main menu is opened, which provides several options and displays
progress information:
.. image:: images/menu.png
Here is an explanation of the individual items in the menu:
* ``Open ownCloud in browser``: Opens the ownCloud web interface
* ``Open folder 'ownCloud'``: Opens the local folder. If you have
defined multiple sync targets, you should see multiple entries
here.
* **Disk space indicator**: Shows how much space is used up on the server.
* Operation indicator: Shows the status of the current sync process, or
``Up to date`` if server and client are in sync.
* **Recent Changes**: shows the last six files modified by sync operations,
and provides access to the Sync Protocol, which lists all changes
since the last restart of ownCloud Client.
* ``Settings...``: provides access to the settings menu.
* ``Help``: Opens a browser to display this help.
* ``Quit ownCloud``: Quits ownCloud, ending a currently running sync run.
The settings dialog is split up in three categories: ``Account Settings``,
``General Settings`` and ``Network Settings``:
Account Settings
~~~~~~~~~~~~~~~~
.. index:: account settings, user, password, Server URL
The ``Account Settings`` tab provides an executive summary about the synced
folders in your account and allows to modify them. It also provides a more
detailed report about the storage usage. Finally, it allows to change
the files that ownCloud Client should ignore (for details, see the
``Ignored Files Editor`` section below), and to modify various aspects
of the current account settings, such as user name, password and server URL.
.. image:: images/settings_account.png
:scale: 50 %
General Settings
~~~~~~~~~~~~~~~~
.. index:: general settings, auto start, startup, desktop notifications
The tab provides several useful options:
.. image:: images/settings_general.png
:scale: 50 %
* **Launch on System Startup**: This option is automatically activated
once a user has conimaged his account. Unchecking the box will cause
ownCloud client to not launch on startup for a particular user.
* **Show Desktop Nofications**: Do not show bubble notifications whenever
a set of sync operations has been performed.
* **Use Monochrome Icons**: Use less obstrusive icons. Especially useful
on Mac OS.
The acout menu provides information about authors as well as detailed
information about the build conditions. Those are particularly valuable
when filing a bug report.
Network Settings
~~~~~~~~~~~~~~~~
.. index:: proxy settings, SOCKS, bandwith, throttling, limiting
This tab consollidates ``Proxy Settings`` and ``Bandwith Limiting``:
.. image:: images/settings_network.png
:scale: 50 %
Proxy Settings
^^^^^^^^^^^^^^
* ``No Proxy``: Check this if ownCloud Client should circumvent the default
proxy conimaged on the system.
* ``Use system proxy``: Default, will follow the systems proxy settings.
On Linux, this will only pick up the value of the variable ``http_proxy``.
* ``Specify proxy manually as``: Allows to specify custom proxy settings.
If you require to go through a HTTP(S) proxy server such as Squid or Microsoft
Forefront TMG, pick ``HTTP(S)``. ``SOCKSv5`` on the other hand is particulary
useful in special company LAN setups, or in combination with the OpenSSH
dynamic application level forwarding feature (see ``ssh -D``).
* ``Host``: Enter the host name or IP address of your proxy server, followed
by the port number. HTTP proxies usually listen on Ports 8080 (default) or
3128. SOCKS server usually listen on port 1080.
* ``Proxy Server requires authentication``: Should be checked if the proxy
server does not allow anonymous usage. If you check this option, you must
provide username and password in the fields below, or ownless Cloud will no
longer be able to connect successfully.
Bandwidth Limiting
^^^^^^^^^^^^^^^^^^
The ``Download Bandwidth`` (i.e. the bandwidth available for data flowing
from the ownCloud Server to the client) can be either ``Unlimited``
(the default), or limited to a custom value, specified in bytes
The ``Upload Bandwith`` (i.e. the bandwith available for data flowing
from the ownCloud Client to the server) additionally has the option
to ``Limit automatically``: When this option is checked, the ownCloud
Client will surrender available upstream bandwith to other applications.
Use this option if you expirience problems with real time communication,
such as Skype or other VoIP software, in conjunction with ownCloud Client.
This is commonly the case with asymmetric internet connection, such as
certain DSL lines with very limited upstream capacity.
ownCloud Client will pick up changes immediately, but ongoing operations
will finish using the old settings.
The Sync Protocol
~~~~~~~~~~~~~~~~~
.. index:: sync protocol
The ``Sync Protocol`` window, which can be invoked from either from the main
menu (``Recent Changes`` -> ``Details...``) or the ``Account Settings``
(``Info`` button), will provide you with an in-depth summary of the recent
sync activity. It will also show files that have not been synched (ignored
files). Those are ignored either because they are listed in the ignored
files list (see ``Ignored Files Editor`` section below), or because they
cannot be synced in a cross-platform manner because they contain special
characters that cannot be stored on certain file systems.
.. image:: images/sync_protocol.png
:scale: 50 %
.. _ignoredFilesEditor-label:
The Ignored Files Editor
~~~~~~~~~~~~~~~~~~~~~~~~
.. index:: ignored files, exclude files, pattern
The ignored files editor allows adding patterns for files or directories
that should be excluded from the sync process. Next to normal characters,
wildcards can be used to match an arbitrary number of characters, designated
by an asterisk (``*``) or a single character, designated by a question mark
(``?``).
Global defaults cannot be directly modified within the editor. Hovering
with the mouse will reveal the location of the global exclude definition
file.
In addition to this list, ownCloud Client always excludes files with
characters that cannot be synched down to other file systems,
see :ref:`ignored-files-label`.
.. note:: Modifying the global exclude definition file might render the
client unusable or cause undesired behavior.
.. note:: Custom entries are currently not validated for syntactical
correctness by the editor, but might fail to load correctly.
.. image:: images/ignored_files_editor.png
:scale: 50%
Examples:
^^^^^^^^^
+-----------+------------------------------+
| Pattern | Matches |
+===========+==============================+
| ``~$*`` | ``~$foo``, ``~$example.doc`` |
+-----------+------------------------------+
| ``fl?p`` | ``flip``, ``flap`` |
+-----------+------------------------------+

View File

@@ -20,6 +20,8 @@ PHP version:
ownCloud version:
Storage backend:
### Client configuration
Client version:
@@ -31,18 +33,14 @@ Installation path of client:
### Logs
#### output of `owncloud --logwindow` or `owncloud --logfile log.txt`
```
Insert your log output here
```
Please use Gist (https://gist.github.com/) or a similar code paster for longer
logs.
#### Web server error log
```
Insert your webserver log here
```
```Template for output < 10 lines```
#### ownCloud log (data/owncloud.log)
```
Insert your ownCloud log here
```
1. Output of `owncloud --logwindow` or `owncloud --logfile log.txt`
2. Web server error log:
3. ownCloud log (data/owncloud.log):

View File

@@ -4,4 +4,5 @@ Type=Application
Exec=@APPLICATION_EXECUTABLE@
Name=@APPLICATION_NAME@ desktop sync client
GenericName=Folder Sync
Icon=@APPLICATION_SHORTNAME@
Icon=@APPLICATION_EXECUTABLE@
Keywords=@APPLICATION_NAME@;syncing;file;sharing;

View File

@@ -7,10 +7,11 @@
<file>resources/folder-remote.png</file>
<file>resources/folder-sync.png</file>
<file>resources/folder-grey.png</file>
<file>resources/mirall-32.png</file>
<file>resources/mirall-128.png</file>
<file>resources/mirall-48.png</file>
<file>resources/task-ongoing.png</file>
<file>resources/view-refresh.png</file>
<file>resources/warning-16.png</file>
<file>resources/settings.png</file>
<file>resources/network.png</file>
<file>resources/owncloud_logo_blue.png</file>
</qresource>
</RCC>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 698 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 991 B

BIN
resources/network.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
resources/settings.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
resources/warning-16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 B

22
src/3rdparty/LGPL_EXCEPTION.txt vendored Normal file
View File

@@ -0,0 +1,22 @@
Digia Qt LGPL Exception version 1.1
As an additional permission to the GNU Lesser General Public License version
2.1, the object code form of a "work that uses the Library" may incorporate
material from a header file that is part of the Library. You may distribute
such object code under terms of your choice, provided that:
(i) the header files of the Library have not been modified; and
(ii) the incorporated material is limited to numerical parameters, data
structure layouts, accessors, macros, inline functions and
templates; and
(iii) you comply with the terms of Section 6 of the GNU Lesser General
Public License version 2.1.
Moreover, you may apply this exception to a modified version of the Library,
provided that such modification does not involve copying material from the
Library into the modified Library's header files unless such material is
limited to (i) numerical parameters; (ii) data structure layouts;
(iii) accessors; and (iv) small macros, templates and inline functions of
five lines or less in length.
Furthermore, you are not required to apply this additional permission to a
modified version of the Library.

165
src/3rdparty/QProgressIndicator/LICENSE vendored Normal file
View File

@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@@ -0,0 +1,137 @@
/*
*
* This file is part of QProgressIndicator,
* an open-source recent files menu widget
*
* Copyright (C) 2009 - 2010 Morgan Leborgne
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QRecentFilesMenu. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "QProgressIndicator.h"
#include <QPainter>
QProgressIndicator::QProgressIndicator(QWidget* parent)
: QWidget(parent),
m_angle(0),
m_timerId(-1),
m_delay(40),
m_displayedWhenStopped(false),
m_color(Qt::black)
{
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
setFocusPolicy(Qt::NoFocus);
}
bool QProgressIndicator::isAnimated () const
{
return (m_timerId != -1);
}
void QProgressIndicator::setDisplayedWhenStopped(bool state)
{
m_displayedWhenStopped = state;
update();
}
bool QProgressIndicator::isDisplayedWhenStopped() const
{
return m_displayedWhenStopped;
}
void QProgressIndicator::startAnimation()
{
m_angle = 0;
if (m_timerId == -1)
m_timerId = startTimer(m_delay);
}
void QProgressIndicator::stopAnimation()
{
if (m_timerId != -1)
killTimer(m_timerId);
m_timerId = -1;
update();
}
void QProgressIndicator::setAnimationDelay(int delay)
{
if (m_timerId != -1)
killTimer(m_timerId);
m_delay = delay;
if (m_timerId != -1)
m_timerId = startTimer(m_delay);
}
void QProgressIndicator::setColor(const QColor & color)
{
m_color = color;
update();
}
QSize QProgressIndicator::sizeHint() const
{
return QSize(20,20);
}
int QProgressIndicator::heightForWidth(int w) const
{
return w;
}
void QProgressIndicator::timerEvent(QTimerEvent * /*event*/)
{
m_angle = (m_angle+30)%360;
update();
}
void QProgressIndicator::paintEvent(QPaintEvent * /*event*/)
{
if (!m_displayedWhenStopped && !isAnimated())
return;
int width = qMin(this->width(), this->height());
QPainter p(this);
p.setRenderHint(QPainter::Antialiasing);
int outerRadius = (width-1)*0.5;
int innerRadius = (width-1)*0.5*0.38;
int capsuleHeight = outerRadius - innerRadius;
int capsuleWidth = (width > 32 ) ? capsuleHeight *.23 : capsuleHeight *.35;
int capsuleRadius = capsuleWidth/2;
for (int i=0; i<12; i++)
{
QColor color = m_color;
color.setAlphaF(1.0f - (i/12.0f));
p.setPen(Qt::NoPen);
p.setBrush(color);
p.save();
p.translate(rect().center());
p.rotate(m_angle - i*30.0f);
p.drawRoundedRect(-capsuleWidth*0.5, -(innerRadius+capsuleHeight), capsuleWidth, capsuleHeight, capsuleRadius, capsuleRadius);
p.restore();
}
}

View File

@@ -0,0 +1,108 @@
/*
*
* This file is part of QProgressIndicator,
* an open-source recent files menu widget
*
* Copyright (C) 2009 - 2010 Morgan Leborgne
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with QRecentFilesMenu. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef QPROGRESSINDICATOR_H
#define QPROGRESSINDICATOR_H
#include <QWidget>
#include <QColor>
/*!
\class QProgressIndicator
\brief The QProgressIndicator class lets an application display a progress indicator to show that a lengthy task is under way.
Progress indicators are indeterminate and do nothing more than spin to show that the application is busy.
\sa QProgressBar
*/
class QProgressIndicator : public QWidget
{
Q_OBJECT
Q_PROPERTY(int delay READ animationDelay WRITE setAnimationDelay)
Q_PROPERTY(bool displayedWhenStopped READ isDisplayedWhenStopped WRITE setDisplayedWhenStopped)
Q_PROPERTY(QColor color READ color WRITE setColor)
public:
QProgressIndicator(QWidget* parent = 0);
/*! Returns the delay between animation steps.
\return The number of milliseconds between animation steps. By default, the animation delay is set to 40 milliseconds.
\sa setAnimationDelay
*/
int animationDelay() const { return m_delay; }
/*! Returns a Boolean value indicating whether the component is currently animated.
\return Animation state.
\sa startAnimation stopAnimation
*/
bool isAnimated () const;
/*! Returns a Boolean value indicating whether the receiver shows itself even when it is not animating.
\return Return true if the progress indicator shows itself even when it is not animating. By default, it returns false.
\sa setDisplayedWhenStopped
*/
bool isDisplayedWhenStopped() const;
/*! Returns the color of the component.
\sa setColor
*/
const QColor & color() const { return m_color; }
virtual QSize sizeHint() const;
int heightForWidth(int w) const;
public slots:
/*! Starts the spin animation.
\sa stopAnimation isAnimated
*/
void startAnimation();
/*! Stops the spin animation.
\sa startAnimation isAnimated
*/
void stopAnimation();
/*! Sets the delay between animation steps.
Setting the \a delay to a value larger than 40 slows the animation, while setting the \a delay to a smaller value speeds it up.
\param delay The delay, in milliseconds.
\sa animationDelay
*/
void setAnimationDelay(int delay);
/*! Sets whether the component hides itself when it is not animating.
\param state The animation state. Set false to hide the progress indicator when it is not animating; otherwise true.
\sa isDisplayedWhenStopped
*/
void setDisplayedWhenStopped(bool state);
/*! Sets the color of the components to the given color.
\sa color
*/
void setColor(const QColor & color);
protected:
virtual void timerEvent(QTimerEvent * event);
virtual void paintEvent(QPaintEvent * event);
private:
int m_angle;
int m_timerId;
int m_delay;
bool m_displayedWhenStopped;
QColor m_color;
};
#endif // QPROGRESSINDICATOR_H

View File

@@ -0,0 +1,14 @@
## Description
The QProgressIndicator class lets an application display a progress indicator to show that a lengthy task is under way.
Will work at any size.
<img src="https://raw.github.com/mojocorp/QProgressIndicator/master/screen-capture-1.png" >
<img src="https://raw.github.com/mojocorp/QProgressIndicator/master/screen-capture-2.png" >
## Dependency
Qt 4.4.x.
## License
LGPL

View File

@@ -0,0 +1,353 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "fancylineedit.h"
#include <QEvent>
#include <QDebug>
#include <QString>
#include <QPropertyAnimation>
#include <QApplication>
#include <QMenu>
#include <QMouseEvent>
#include <QLabel>
#include <QAbstractButton>
#include <QPainter>
#include <QStyle>
#include <QPaintEvent>
#include <QDesktopWidget>
/*! Opens a menu at the specified widget position.
* This functions computes the position where to show the menu, and opens it with
* QMenu::exec().
* \param menu The menu to open
* \param widget The widget next to which to open the menu
*/
static void execMenuAtWidget(QMenu *menu, QWidget *widget)
{
QPoint p;
QRect screen = qApp->desktop()->availableGeometry(widget);
QSize sh = menu->sizeHint();
QRect rect = widget->rect();
if (widget->isRightToLeft()) {
if (widget->mapToGlobal(QPoint(0, rect.bottom())).y() + sh.height() <= screen.height())
p = widget->mapToGlobal(rect.bottomRight());
else
p = widget->mapToGlobal(rect.topRight() - QPoint(0, sh.height()));
p.rx() -= sh.width();
} else {
if (widget->mapToGlobal(QPoint(0, rect.bottom())).y() + sh.height() <= screen.height())
p = widget->mapToGlobal(rect.bottomLeft());
else
p = widget->mapToGlobal(rect.topLeft() - QPoint(0, sh.height()));
}
p.rx() = qMax(screen.left(), qMin(p.x(), screen.right() - sh.width()));
p.ry() += 1;
menu->exec(p);
}
/*!
\class Utils::FancyLineEdit
\brief A line edit with an embedded pixmap on one side that is connected to
a menu.
Additionally, it can display a grayed hintText (like "Type Here to")
when not focused and empty. When connecting to the changed signals and
querying text, one has to be aware that the text is set to that hint
text if isShowingHintText() returns true (that is, does not contain
valid user input).
*/
enum { margin = 6 };
#define ICONBUTTON_HEIGHT 18
#define FADE_TIME 160
namespace Utils {
// --------- FancyLineEditPrivate
class FancyLineEditPrivate : public QObject
{
public:
explicit FancyLineEditPrivate(FancyLineEdit *parent);
virtual bool eventFilter(QObject *obj, QEvent *event);
FancyLineEdit *m_lineEdit;
QPixmap m_pixmap[2];
QMenu *m_menu[2];
bool m_menuTabFocusTrigger[2];
IconButton *m_iconbutton[2];
bool m_iconEnabled[2];
};
FancyLineEditPrivate::FancyLineEditPrivate(FancyLineEdit *parent) :
QObject(parent), m_lineEdit(parent)
{
for (int i = 0; i < 2; ++i) {
m_menu[i] = 0;
m_menuTabFocusTrigger[i] = false;
m_iconbutton[i] = new IconButton(parent);
m_iconbutton[i]->installEventFilter(this);
m_iconbutton[i]->hide();
m_iconbutton[i]->setAutoHide(false);
m_iconEnabled[i] = false;
}
}
bool FancyLineEditPrivate::eventFilter(QObject *obj, QEvent *event)
{
int buttonIndex = -1;
for (int i = 0; i < 2; ++i) {
if (obj == m_iconbutton[i]) {
buttonIndex = i;
break;
}
}
if (buttonIndex == -1)
return QObject::eventFilter(obj, event);
switch (event->type()) {
case QEvent::FocusIn:
if (m_menuTabFocusTrigger[buttonIndex] && m_menu[buttonIndex]) {
m_lineEdit->setFocus();
execMenuAtWidget(m_menu[buttonIndex], m_iconbutton[buttonIndex]);
return true;
}
default:
break;
}
return QObject::eventFilter(obj, event);
}
// --------- FancyLineEdit
FancyLineEdit::FancyLineEdit(QWidget *parent) :
QLineEdit(parent),
d(new FancyLineEditPrivate(this))
{
ensurePolished();
updateMargins();
connect(this, SIGNAL(textChanged(QString)), this, SLOT(checkButtons(QString)));
connect(d->m_iconbutton[Left], SIGNAL(clicked()), this, SLOT(iconClicked()));
connect(d->m_iconbutton[Right], SIGNAL(clicked()), this, SLOT(iconClicked()));
}
void FancyLineEdit::checkButtons(const QString &text)
{
if (m_oldText.isEmpty() || text.isEmpty()) {
for (int i = 0; i < 2; ++i) {
if (d->m_iconbutton[i]->hasAutoHide())
d->m_iconbutton[i]->animateShow(!text.isEmpty());
}
m_oldText = text;
}
}
FancyLineEdit::~FancyLineEdit()
{
}
void FancyLineEdit::setButtonVisible(Side side, bool visible)
{
d->m_iconbutton[side]->setVisible(visible);
d->m_iconEnabled[side] = visible;
updateMargins();
}
bool FancyLineEdit::isButtonVisible(Side side) const
{
return d->m_iconEnabled[side];
}
void FancyLineEdit::iconClicked()
{
IconButton *button = qobject_cast<IconButton *>(sender());
int index = -1;
for (int i = 0; i < 2; ++i)
if (d->m_iconbutton[i] == button)
index = i;
if (index == -1)
return;
if (d->m_menu[index]) {
execMenuAtWidget(d->m_menu[index], button);
} else {
emit buttonClicked((Side)index);
if (index == Left)
emit leftButtonClicked();
else if (index == Right)
emit rightButtonClicked();
}
}
void FancyLineEdit::updateMargins()
{
bool leftToRight = (layoutDirection() == Qt::LeftToRight);
Side realLeft = (leftToRight ? Left : Right);
Side realRight = (leftToRight ? Right : Left);
int leftMargin = d->m_iconbutton[realLeft]->pixmap().width() + 8;
int rightMargin = d->m_iconbutton[realRight]->pixmap().width() + 8;
// Note KDE does not reserve space for the highlight color
if (style()->inherits("OxygenStyle")) {
leftMargin = qMax(24, leftMargin);
rightMargin = qMax(24, rightMargin);
}
QMargins margins((d->m_iconEnabled[realLeft] ? leftMargin : 0), 0,
(d->m_iconEnabled[realRight] ? rightMargin : 0), 0);
setTextMargins(margins);
}
void FancyLineEdit::updateButtonPositions()
{
QRect contentRect = rect();
for (int i = 0; i < 2; ++i) {
Side iconpos = (Side)i;
if (layoutDirection() == Qt::RightToLeft)
iconpos = (iconpos == Left ? Right : Left);
if (iconpos == FancyLineEdit::Right) {
const int iconoffset = textMargins().right() + 4;
d->m_iconbutton[i]->setGeometry(contentRect.adjusted(width() - iconoffset, 0, 0, 0));
} else {
const int iconoffset = textMargins().left() + 4;
d->m_iconbutton[i]->setGeometry(contentRect.adjusted(0, 0, -width() + iconoffset, 0));
}
}
}
void FancyLineEdit::resizeEvent(QResizeEvent *)
{
updateButtonPositions();
}
void FancyLineEdit::setButtonPixmap(Side side, const QPixmap &buttonPixmap)
{
d->m_iconbutton[side]->setPixmap(buttonPixmap);
updateMargins();
updateButtonPositions();
update();
}
QPixmap FancyLineEdit::buttonPixmap(Side side) const
{
return d->m_pixmap[side];
}
void FancyLineEdit::setButtonMenu(Side side, QMenu *buttonMenu)
{
d->m_menu[side] = buttonMenu;
d->m_iconbutton[side]->setIconOpacity(1.0);
}
QMenu *FancyLineEdit::buttonMenu(Side side) const
{
return d->m_menu[side];
}
bool FancyLineEdit::hasMenuTabFocusTrigger(Side side) const
{
return d->m_menuTabFocusTrigger[side];
}
void FancyLineEdit::setMenuTabFocusTrigger(Side side, bool v)
{
if (d->m_menuTabFocusTrigger[side] == v)
return;
d->m_menuTabFocusTrigger[side] = v;
d->m_iconbutton[side]->setFocusPolicy(v ? Qt::TabFocus : Qt::NoFocus);
}
bool FancyLineEdit::hasAutoHideButton(Side side) const
{
return d->m_iconbutton[side]->hasAutoHide();
}
void FancyLineEdit::setAutoHideButton(Side side, bool h)
{
d->m_iconbutton[side]->setAutoHide(h);
if (h)
d->m_iconbutton[side]->setIconOpacity(text().isEmpty() ? 0.0 : 1.0);
else
d->m_iconbutton[side]->setIconOpacity(1.0);
}
void FancyLineEdit::setButtonToolTip(Side side, const QString &tip)
{
d->m_iconbutton[side]->setToolTip(tip);
}
void FancyLineEdit::setButtonFocusPolicy(Side side, Qt::FocusPolicy policy)
{
d->m_iconbutton[side]->setFocusPolicy(policy);
}
// IconButton - helper class to represent a clickable icon
IconButton::IconButton(QWidget *parent)
: QAbstractButton(parent), m_autoHide(false)
{
setCursor(Qt::ArrowCursor);
setFocusPolicy(Qt::NoFocus);
}
void IconButton::paintEvent(QPaintEvent *)
{
QPainter painter(this);
QRect pixmapRect = QRect(0, 0, m_pixmap.width(), m_pixmap.height());
pixmapRect.moveCenter(rect().center());
if (m_autoHide)
painter.setOpacity(m_iconOpacity);
painter.drawPixmap(pixmapRect, m_pixmap);
}
void IconButton::animateShow(bool visible)
{
if (visible) {
QPropertyAnimation *animation = new QPropertyAnimation(this, "iconOpacity");
animation->setDuration(FADE_TIME);
animation->setEndValue(1.0);
animation->start(QAbstractAnimation::DeleteWhenStopped);
} else {
QPropertyAnimation *animation = new QPropertyAnimation(this, "iconOpacity");
animation->setDuration(FADE_TIME);
animation->setEndValue(0.0);
animation->start(QAbstractAnimation::DeleteWhenStopped);
}
}
} // namespace Utils

View File

@@ -0,0 +1,121 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef FANCYLINEEDIT_H
#define FANCYLINEEDIT_H
#include <QLineEdit>
#include <QAbstractButton>
namespace Utils {
class FancyLineEditPrivate;
class IconButton: public QAbstractButton
{
Q_OBJECT
Q_PROPERTY(float iconOpacity READ iconOpacity WRITE setIconOpacity)
Q_PROPERTY(bool autoHide READ hasAutoHide WRITE setAutoHide)
Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap)
public:
explicit IconButton(QWidget *parent = 0);
void paintEvent(QPaintEvent *event);
void setPixmap(const QPixmap &pixmap) { m_pixmap = pixmap; update(); }
QPixmap pixmap() const { return m_pixmap; }
float iconOpacity() { return m_iconOpacity; }
void setIconOpacity(float value) { m_iconOpacity = value; update(); }
void animateShow(bool visible);
void setAutoHide(bool hide) { m_autoHide = hide; }
bool hasAutoHide() const { return m_autoHide; }
private:
float m_iconOpacity;
bool m_autoHide;
QPixmap m_pixmap;
};
class FancyLineEdit : public QLineEdit
{
Q_OBJECT
Q_ENUMS(Side)
public:
enum Side {Left = 0, Right = 1};
explicit FancyLineEdit(QWidget *parent = 0);
~FancyLineEdit();
QPixmap buttonPixmap(Side side) const;
void setButtonPixmap(Side side, const QPixmap &pixmap);
QMenu *buttonMenu(Side side) const;
void setButtonMenu(Side side, QMenu *menu);
void setButtonVisible(Side side, bool visible);
bool isButtonVisible(Side side) const;
void setButtonToolTip(Side side, const QString &);
void setButtonFocusPolicy(Side side, Qt::FocusPolicy policy);
// Set whether tabbing in will trigger the menu.
void setMenuTabFocusTrigger(Side side, bool v);
bool hasMenuTabFocusTrigger(Side side) const;
// Set if icon should be hidden when text is empty
void setAutoHideButton(Side side, bool h);
bool hasAutoHideButton(Side side) const;
#if QT_VERSION <= 0x040700
void setPlaceholderText( const QString& ) { }
#endif
signals:
void buttonClicked(Utils::FancyLineEdit::Side side);
void leftButtonClicked();
void rightButtonClicked();
private slots:
void checkButtons(const QString &);
void iconClicked();
protected:
virtual void resizeEvent(QResizeEvent *e);
private:
void updateMargins();
void updateButtonPositions();
friend class Utils::FancyLineEditPrivate;
FancyLineEditPrivate *d;
QString m_oldText;
};
} // namespace Utils
#endif // FANCYLINEEDIT_H

View File

@@ -3,7 +3,7 @@ include(${QT_USE_FILE})
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
QT4_ADD_RESOURCES ( MIRALL_RC_SRC ../mirall.qrc)
if ( DEFINED OEM_THEME_DIR)
if ( IS_DIRECTORY ${OEM_THEME_DIR} )
QT4_ADD_RESOURCES ( MIRALL_RC_SRC ${OEM_THEME_DIR}/theme.qrc)
set(theme_dir ${OEM_THEME_DIR}/theme)
else()
@@ -11,39 +11,39 @@ else()
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/folderwizardnetworkpage.ui
mirall/folderwizardowncloudpage.ui
mirall/statusdialog.ui
mirall/owncloudwizardselecttypepage.ui
mirall/owncloudsetuppage.ui
mirall/createanowncloudpage.ui
mirall/owncloudftpaccesspage.ui
mirall/owncloudwizardresultpage.ui
mirall/owncloudcredentialspage.ui
mirall/sslerrordialog.ui
mirall/proxydialog.ui
mirall/fileitemdialog.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.h
3rdparty/qtsingleapplication/qtlocalpeer.cpp
3rdparty/qtsingleapplication/qtsingleapplication.h
3rdparty/qtsingleapplication/qtsinglecoreapplication.h
3rdparty/qtsingleapplication/qtsinglecoreapplication.cpp
3rdparty/qtlockedfile/qtlockedfile.h
3rdparty/qtlockedfile/qtlockedfile.cpp
3rdparty/fancylineedit/fancylineedit.cpp
3rdparty/QProgressIndicator/QProgressIndicator.cpp
)
set(3rdparty_HEADER
3rdparty/qtsingleapplication/qtlocalpeer.h
3rdparty/qtsingleapplication/qtsingleapplication.h
3rdparty/qtsingleapplication/qtsinglecoreapplication.h
3rdparty/fancylineedit/fancylineedit.h
3rdparty/QProgressIndicator/QProgressIndicator.h
)
qt4_wrap_cpp(3rdparty_MOC ${3rdparty_HEADER})
@@ -56,6 +56,8 @@ endif()
set(3rdparty_INC
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/qtlockedfile
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/qtsingleapplication
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/QProgressIndicator
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/fancylineedit
)
qt4_wrap_ui(mirall_UI_SRCS ${mirall_UI})
@@ -65,32 +67,57 @@ set(libsync_SRCS
mirall/folder.cpp
mirall/folderwatcher.cpp
mirall/syncresult.cpp
mirall/unisonfolder.cpp
mirall/networklocation.cpp
mirall/mirallconfigfile.cpp
mirall/credentialstore.cpp
mirall/csyncfolder.cpp
mirall/owncloudfolder.cpp
mirall/csyncthread.cpp
mirall/fileutils.cpp
mirall/theme.cpp
mirall/owncloudtheme.cpp
mirall/miralltheme.cpp
mirall/owncloudinfo.cpp
mirall/logger.cpp
mirall/utility.cpp
mirall/connectionvalidator.cpp
mirall/progressdispatcher.cpp
mirall/mirallaccessmanager.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
creds/shibboleth/shibbolethcookiejar.cpp
creds/shibboleth/shibbolethwebview.cpp
creds/shibboleth/shibbolethrefresher.cpp
creds/shibboleth/shibbolethconfigfile.cpp
creds/credentialscommon.cpp
)
set(libsync_HEADERS
set(libsync_HEADERS
mirall/folderman.h
mirall/folder.h
mirall/folderwatcher.h
mirall/unisonfolder.h
mirall/csyncfolder.h
mirall/owncloudfolder.h
mirall/csyncthread.h
mirall/theme.h
mirall/owncloudtheme.h
mirall/owncloudinfo.h
mirall/credentialstore.h
mirall/logger.h
mirall/connectionvalidator.h
mirall/progressdispatcher.h
mirall/mirallaccessmanager.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
creds/shibboleth/shibbolethcookiejar.h
creds/shibboleth/shibbolethwebview.h
creds/shibboleth/shibbolethrefresher.h
creds/shibboleth/shibbolethconfigfile.h
creds/credentialscommon.h
)
IF( INOTIFY_FOUND )
@@ -121,59 +148,80 @@ if(QTKEYCHAIN_FOUND)
include_directories(${QTKEYCHAIN_INCLUDE_DIR})
endif()
add_library(owncloudsync SHARED ${libsync_SRCS} ${syncMoc})
set_target_properties( owncloudsync PROPERTIES COMPILE_DEFINITIONS OWNCLOUD_CLIENT)
set_target_properties( owncloudsync PROPERTIES
add_library(${synclib_NAME} SHARED ${libsync_SRCS} ${syncMoc})
set_target_properties( ${synclib_NAME} PROPERTIES
VERSION ${VERSION}
SOVERSION ${SOVERSION}
)
target_link_libraries(owncloudsync ${libsync_LINK_TARGETS} )
target_link_libraries(${synclib_NAME} ${libsync_LINK_TARGETS} )
if ( APPLE )
target_link_libraries(owncloudsync /System/Library/Frameworks/CoreServices.framework)
target_link_libraries(${synclib_NAME} /System/Library/Frameworks/CoreServices.framework)
endif()
if(NOT BUILD_OWNCLOUD_OSX_BUNDLE)
install(TARGETS owncloudsync
install(TARGETS ${synclib_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
if(NOT WIN32)
configure_file(${CMAKE_SOURCE_DIR}/mirall.desktop.in
${APPLICATION_SHORTNAME}.desktop)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${APPLICATION_SHORTNAME}.desktop DESTINATION share/applications )
${CMAKE_CURRENT_BINARY_DIR}/${APPLICATION_EXECUTABLE}.desktop)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${APPLICATION_EXECUTABLE}.desktop DESTINATION share/applications )
endif()
else()
install(TARGETS owncloudsync DESTINATION ${OWNCLOUD_OSX_BUNDLE}/Contents/MacOS)
install(TARGETS ${synclib_NAME} DESTINATION ${OWNCLOUD_OSX_BUNDLE}/Contents/MacOS)
endif()
set(mirall_SRCS
mirall/application.cpp
mirall/systray.cpp
mirall/folderwizard.cpp
mirall/statusdialog.cpp
mirall/owncloudwizard.cpp
mirall/folderstatusmodel.cpp
wizard/owncloudwizard.cpp
wizard/owncloudsetuppage.cpp
wizard/owncloudhttpcredspage.cpp
wizard/owncloudwizardresultpage.cpp
wizard/owncloudwizardcommon.cpp
wizard/owncloudshibbolethcredspage.cpp
wizard/owncloudadvancedsetuppage.cpp
mirall/owncloudsetupwizard.cpp
mirall/updatedetector.cpp
mirall/occinfo.cpp
mirall/sslerrordialog.cpp
mirall/logbrowser.cpp
mirall/proxydialog.cpp
mirall/fileitemdialog.cpp
mirall/settingsdialog.cpp
mirall/generalsettings.cpp
mirall/networksettings.cpp
mirall/accountsettings.cpp
mirall/ignorelisteditor.cpp
mirall/itemprogressdialog.cpp
)
set(mirall_HEADERS
mirall/application.h
mirall/systray.h
mirall/folderwizard.h
mirall/owncloudsetupwizard.h
mirall/owncloudwizard.h
mirall/statusdialog.h
wizard/owncloudwizard.h
wizard/owncloudsetuppage.h
wizard/owncloudhttpcredspage.h
wizard/owncloudwizardresultpage.h
wizard/owncloudwizardcommon.h
wizard/owncloudshibbolethcredspage.h
wizard/owncloudadvancedsetuppage.h
mirall/folderstatusmodel.h
mirall/updatedetector.h
mirall/sslerrordialog.h
mirall/logbrowser.h
mirall/proxydialog.h
mirall/fileitemdialog.h
mirall/settingsdialog.h
mirall/generalsettings.h
mirall/networksettings.h
mirall/accountsettings.h
mirall/ignorelisteditor.h
mirall/itemprogressdialog.h
)
if( UNIX AND NOT APPLE)
@@ -183,7 +231,7 @@ if( UNIX AND NOT APPLE)
endif()
# csync is required.
include_directories(${CSYNC_INCLUDE_DIR}/csync ${CSYNC_INCLUDE_DIR} ${CMAKE_BINARY_DIR})
include_directories(${CSYNC_INCLUDE_DIR}/csync ${CSYNC_INCLUDE_DIR} ${CSYNC_BUILD_PATH}/src)
include_directories(${3rdparty_INC})
qt4_wrap_cpp(mirallMoc ${mirall_HEADERS})
@@ -206,7 +254,15 @@ set( final_src
include( AddAppIconMacro )
set(ownCloud_old ${ownCloud})
kde4_add_app_icon( ownCloud "${theme_dir}/colored/${APPLICATION_SHORTNAME}-icon*.png")
# set an icon_app_name. For historical reasons we can not use the
# application_shortname for ownCloud but must rather set it manually.
if ( EXISTS ${OEM_THEME_DIR}/OEM.cmake )
set(ICON_APP_NAME ${APPLICATION_SHORTNAME})
else()
set(ICON_APP_NAME "owncloud")
endif()
kde4_add_app_icon( ownCloud "${theme_dir}/colored/${ICON_APP_NAME}-icon*.png")
list(APPEND final_src ${ownCloud})
set(ownCloud ${ownCloud_old})
@@ -214,35 +270,21 @@ if(NOT BUILD_OWNCLOUD_OSX_BUNDLE)
set(BIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
if(NOT WIN32)
install(FILES ${CMAKE_SOURCE_DIR}/resources/mirall-48.png
DESTINATION share/icons/hicolor/48x48/apps/ RENAME mirall.png)
install(FILES
${theme_dir}/colored/${APPLICATION_SHORTNAME}-icon-48.png
DESTINATION share/icons/hicolor/48x48/apps/ RENAME ${APPLICATION_SHORTNAME}.png)
file( GLOB _icons "${theme_dir}/colored/${ICON_APP_NAME}-icon-*.png" )
foreach( _file ${_icons} )
string( REPLACE "${theme_dir}/colored/${ICON_APP_NAME}-icon-" "" _res ${_file} )
string( REPLACE ".png" "" _res ${_res} )
install( FILES ${_file} RENAME ${ICON_APP_NAME}.png DESTINATION ${DATADIR}/icons/hicolor/${_res}x${_res}/apps )
endforeach( _file )
endif(NOT WIN32)
install(FILES ${mirall_I18N} DESTINATION share/mirall/i18n)
install(FILES ${mirall_I18N} DESTINATION share/${APPLICATION_EXECUTABLE}/i18n)
# we may not add MACOSX_BUNDLE here, if not building one
# add_executable( ${APPLICATION_EXECUTABLE} main.cpp ${final_src})
add_executable( ${APPLICATION_EXECUTABLE} WIN32 main.cpp ${final_src})
set_target_properties( ${APPLICATION_EXECUTABLE} PROPERTIES COMPILE_DEFINITIONS OWNCLOUD_CLIENT)
# mirall is not built for the bundle
add_executable( mirall WIN32 main.cpp ${final_src})
target_link_libraries(mirall ${QT_LIBRARIES} )
target_link_libraries(mirall owncloudsync)
target_link_libraries(mirall ${CSYNC_LIBRARY})
set_target_properties( mirall PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} )
install(TARGETS mirall
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
else()
set(BIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
include(DeployQt4)
@@ -252,7 +294,6 @@ else()
# we must add MACOSX_BUNDLE only if building a bundle
add_executable( ${APPLICATION_EXECUTABLE} WIN32 MACOSX_BUNDLE main.cpp ${final_src})
set_target_properties( ${APPLICATION_EXECUTABLE} PROPERTIES COMPILE_DEFINITIONS OWNCLOUD_CLIENT)
#FIXME: hardcoded path
if ( EXISTS ${CSYNC_BINARY_DIR}/modules/ocsync_owncloud.so )
@@ -275,7 +316,7 @@ set_target_properties( ${APPLICATION_EXECUTABLE} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY}
)
target_link_libraries( ${APPLICATION_EXECUTABLE} ${QT_LIBRARIES} )
target_link_libraries( ${APPLICATION_EXECUTABLE} owncloudsync )
target_link_libraries( ${APPLICATION_EXECUTABLE} ${synclib_NAME} )
target_link_libraries( ${APPLICATION_EXECUTABLE} ${CSYNC_LIBRARY} )
install(TARGETS ${APPLICATION_EXECUTABLE}

View File

@@ -0,0 +1,47 @@
/*
* Copyright (C) by Krzesimir Nowak <krzesimir@endocode.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 MIRALL_CREDS_ABSTRACT_CREDENTIALS_H
#define MIRALL_CREDS_ABSTRACT_CREDENTIALS_H
#include <QObject>
#include <csync.h>
class QNetworkAccessManager;
namespace Mirall
{
class AbstractCredentials : public QObject
{
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;
Q_SIGNALS:
void fetched();
};
} // ns Mirall
#endif

View File

@@ -0,0 +1,77 @@
/*
* 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>
*
* 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; either version 2 of the License, or
* (at your option) any later version.
*
* 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 <QList>
#include <QRegExp>
#include <QString>
#include <QSslCertificate>
#include "creds/credentialscommon.h"
#include "mirall/utility.h"
#include "mirall/owncloudinfo.h"
namespace Mirall
{
int handleNeonSSLProblems(const char* prompt,
char* buf,
size_t /*len*/,
int /*echo*/,
int /*verify*/,
void* /*userdata*/)
{
int re = 0;
const QString qPrompt = QString::fromLatin1( prompt ).trimmed();
if( qPrompt.startsWith( QLatin1String("There are problems with the SSL certificate:"))) {
// SSL is requested. If the program came here, the SSL check was done by mirall
// It needs to be checked if the chain is still equal to the one which
// was verified by the user.
const QRegExp regexp("fingerprint: ([\\w\\d:]+)");
bool certOk = false;
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();
while (!certOk && (pos = regexp.indexIn(qPrompt, 1+pos)) != -1) {
QString neon_fingerprint = regexp.cap(1);
foreach( const QSslCertificate& c, certs ) {
QString verified_shasum = Utility::formatFingerprint(c.digest(QCryptographicHash::Sha1).toHex());
qDebug() << "SSL Fingerprint from neon: " << neon_fingerprint << " compared to verified: " << verified_shasum;
if( verified_shasum == neon_fingerprint ) {
certOk = true;
break;
}
}
}
// certOk = false; DEBUG setting, keep disabled!
if( !certOk ) { // Problem!
qstrcpy( buf, "no" );
re = -1;
} else {
qstrcpy( buf, "yes" ); // Certificate is fine!
}
} else {
qDebug() << "Unknown prompt: <" << prompt << ">";
re = -1;
}
return re;
}
} // ns Mirall

View File

@@ -0,0 +1,32 @@
/*
* 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>
*
* 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; either version 2 of the License, or
* (at your option) any later version.
*
* 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 MIRALL_CREDS_COMMON_H
#define MIRALL_CREDS_COMMON_H
namespace Mirall
{
int handleNeonSSLProblems(const char* prompt,
char* buf,
size_t len,
int echo,
int verify,
void* userdata);
} // ns Mirall
#endif

View File

@@ -0,0 +1,43 @@
/*
* Copyright (C) by Krzesimir Nowak <krzesimir@endocode.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 <QString>
#include "creds/httpcredentials.h"
#include "creds/dummycredentials.h"
#include "creds/shibbolethcredentials.h"
namespace Mirall
{
namespace CredentialsFactory
{
AbstractCredentials* create(const QString& type)
{
// empty string might happen for old version of configuration
if (type == "http" || type == "") {
return new HttpCredentials;
} else if (type == "dummy") {
return new DummyCredentials;
} else if (type == "shibboleth") {
return new ShibbolethCredentials;
} else {
qWarning("Unknown credentials type: %s", qPrintable(type));
return new DummyCredentials;
}
}
} // ns CredentialsFactory
} // ns Mirall

View File

@@ -0,0 +1,32 @@
/*
* Copyright (C) by Krzesimir Nowak <krzesimir@endocode.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 MIRALL_CREDS_CREDENTIALS_FACTORY_H
#define MIRALL_CREDS_CREDENTIALS_FACTORY_H
class AbstractCredentials;
class QString;
namespace Mirall
{
namespace CredentialsFactory
{
AbstractCredentials* create(const QString& type);
} // ns CredentialsFactory
} // ns Mirall
#endif

View File

@@ -0,0 +1,56 @@
/*
* Copyright (C) by Krzesimir Nowak <krzesimir@endocode.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 "creds/dummycredentials.h"
#include "mirall/mirallaccessmanager.h"
namespace Mirall
{
void DummyCredentials::syncContextPreInit(CSYNC*)
{}
void DummyCredentials::syncContextPreStart(CSYNC*)
{}
bool DummyCredentials::changed(AbstractCredentials* credentials) const
{
DummyCredentials* dummy(dynamic_cast< DummyCredentials* >(credentials));
return dummy == 0;
}
QString DummyCredentials::authType() const
{
return QString::fromLatin1("dummy");
}
QNetworkAccessManager* DummyCredentials::getQNAM() const
{
return new MirallAccessManager;
}
bool DummyCredentials::ready() const
{
return true;
}
void DummyCredentials::fetch()
{
Q_EMIT(fetched());
}
void DummyCredentials::persistForUrl(const QString&)
{}
} // ns Mirall

View File

@@ -0,0 +1,39 @@
/*
* Copyright (C) by Krzesimir Nowak <krzesimir@endocode.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 MIRALL_CREDS_DUMMY_CREDENTIALS_H
#define MIRALL_CREDS_DUMMY_CREDENTIALS_H
#include "creds/abstractcredentials.h"
namespace Mirall
{
class DummyCredentials : public AbstractCredentials
{
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);
};
} // ns Mirall
#endif

View File

@@ -16,8 +16,8 @@
#include "config.h"
#include "mirall/credentialstore.h"
#include "mirall/mirallconfigfile.h"
#include "creds/http/credentialstore.h"
#include "creds/http/httpconfigfile.h"
#include "mirall/theme.h"
#ifdef WITH_QTKEYCHAIN
@@ -35,7 +35,6 @@ QString CredentialStore::_passwd = QString::null;
QString CredentialStore::_user = QString::null;
QString CredentialStore::_url = QString::null;
QString CredentialStore::_errorMsg = QString::null;
int CredentialStore::_tries = 0;
#ifdef WITH_QTKEYCHAIN
CredentialStore::CredentialType CredentialStore::_type = KeyChain;
#else
@@ -67,51 +66,14 @@ CredentialStore::CredState CredentialStore::state()
return _state;
}
bool CredentialStore::canTryAgain()
{
bool canDoIt = false;
if( _tries > MAX_LOGIN_ATTEMPTS ) {
qDebug() << "canTryAgain: Max attempts reached.";
return false;
}
if( _state == NotFetched ) {
return true;
}
switch( _type ) {
case CredentialStore::User:
canDoIt = true;
break;
case CredentialStore::Settings:
break;
case CredentialStore::KeyChain:
canDoIt = true;
break;
default:
break;
}
return canDoIt;
}
void CredentialStore::fetchCredentials()
{
MirallConfigFile cfgFile;
if( ++_tries > MAX_LOGIN_ATTEMPTS ) {
qDebug() << "Too many attempts to enter password!";
_state = TooManyAttempts;
emit( fetchCredentialsFinished(false) );
return;
}
HttpConfigFile cfgFile;
bool ok = false;
QString pwd;
_user = cfgFile.ownCloudUser();
_user = cfgFile.user();
_url = cfgFile.ownCloudUrl();
if( !cfgFile.passwordStorageAllowed() ) {
_type = CredentialStore::User;
}
QString key = keyChainKey(_url);
@@ -123,31 +85,22 @@ void CredentialStore::fetchCredentials()
}
switch( _type ) {
case CredentialStore::User: {
/* Ask the user for the password */
/* Fixme: Move user interaction out here. */
_state = AsyncFetching;
_inputDialog = new QInputDialog;
_inputDialog->setWindowTitle(QApplication::translate("MirallConfigFile","Password Required") );
_inputDialog->setLabelText( QApplication::translate("MirallConfigFile","Please enter your %1 password:")
.arg(Theme::instance()->appNameGUI()));
_inputDialog->setInputMode( QInputDialog::TextInput );
_inputDialog->setTextEchoMode( QLineEdit::Password );
connect(_inputDialog, SIGNAL(finished(int)), SLOT(slotUserDialogDone(int)));
_inputDialog->exec();
break;
}
case CredentialStore::Settings: {
/* Read from config file. */
_state = Fetching;
pwd = cfgFile.ownCloudPasswd();
ok = true;
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 ) {
if( _state == Ok || _state == AsyncWriting ) {
emit(fetchCredentialsFinished(true));
return;
}
@@ -189,25 +142,11 @@ void CredentialStore::fetchCredentials()
}
}
void CredentialStore::slotUserDialogDone( int result )
{
if( result == QDialog::Accepted ) {
_passwd = _inputDialog->textValue();
_state = Ok;
} else {
_state = UserCanceled;
_passwd = QString::null;
}
_inputDialog->deleteLater();
emit(fetchCredentialsFinished(_state == Ok));
}
void CredentialStore::reset()
{
_state = NotFetched;
_user = QString::null;
_passwd = QString::null;
_tries = 0;
}
QString CredentialStore::keyChainKey( const QString& url ) const
@@ -254,9 +193,6 @@ void CredentialStore::slotKeyChainReadFinished(QKeychain::Job* job)
case QKeychain::CouldNotDeleteEntry:
_state = Error;
break;
case QKeychain::AccessDeniedByUser:
_state = AccessDeniedByUser;
break;
case QKeychain::AccessDenied:
_state = AccessDenied;
break;
@@ -305,53 +241,48 @@ QString CredentialStore::errorMessage()
}
void CredentialStore::setCredentials( const QString& url, const QString& user,
const QString& pwd, bool allowToStore )
const QString& pwd )
{
_passwd = pwd;
_user = user;
if( allowToStore ) {
#ifdef WITH_QTKEYCHAIN
_type = KeyChain;
_type = KeyChain;
#else
_type = Settings;
_type = Settings;
#endif
} else {
_type = User;
}
_url = url;
_state = Ok;
}
void CredentialStore::saveCredentials( )
{
MirallConfigFile cfgFile;
HttpConfigFile cfgFile;
QString key = keyChainKey(_url);
if( key.isNull() ) {
qDebug() << "Error: Can not save credentials, URL is zero!";
return;
}
#ifdef WITH_QTKEYCHAIN
WritePasswordJob *job = NULL;
#endif
cfgFile.setUser(_user);
switch( _type ) {
case CredentialStore::User:
deleteKeyChainCredential( key );
break;
case CredentialStore::KeyChain:
case CredentialStore::KeyChain: {
#ifdef WITH_QTKEYCHAIN
WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());
// Set password in KeyChain
job = new WritePasswordJob(Theme::instance()->appName());
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.writePassword( _passwd );
cfgFile.setPassword( _passwd );
reset();
break;
default:
@@ -371,17 +302,22 @@ void CredentialStore::slotKeyChainWriteFinished( QKeychain::Job *job )
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.
MirallConfigFile cfgFile;
cfgFile.clearPasswordFromConfig();
HttpConfigFile cfgFile;
cfgFile.removePassword();
_state = NotFetched;
}
} else {
qDebug() << "Error: KeyChain Write Password Job failed!";
_state = Error;
}
#else
(void) job;

View File

@@ -34,10 +34,8 @@ namespace Mirall {
* 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!!
* UserCanceled: The fetching involved user interaction and the user canceled
* the operation. No valid credentials are there.
* TooManyAttempts: The user tried to often to enter a password.
* 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.
@@ -49,19 +47,16 @@ class CredentialStore : public QObject
public:
enum CredState { NotFetched = 0,
Ok,
UserCanceled,
Fetching,
AsyncFetching,
EntryNotFound,
AccessDeniedByUser,
AccessDenied,
NoKeychainBackend,
Error,
TooManyAttempts };
AsyncWriting };
enum CredentialType {
User = 0,
Settings,
Settings = 0,
KeyChain
};
@@ -96,19 +91,13 @@ public:
* The function also sets the state to ok.
* @param url - the connection url
* @param user - the user name
* @param password - the password.
*/
void setCredentials( const QString&, const QString&, const QString&, bool );
void setCredentials( const QString& url, const QString& user, const QString& pwd);
void saveCredentials( );
QString errorMessage();
/**
* @brief canTryAgain - check if another try to get credentials makes sense.
*/
bool canTryAgain();
void reset();
signals:
/**
@@ -124,7 +113,6 @@ signals:
protected slots:
void slotKeyChainReadFinished( QKeychain::Job* );
void slotKeyChainWriteFinished( QKeychain::Job* );
void slotUserDialogDone(int);
private:
explicit CredentialStore(QObject *parent = 0);
@@ -137,9 +125,7 @@ private:
static QString _user;
static QString _url;
static QString _errorMsg;
static int _tries;
static CredentialType _type;
QInputDialog *_inputDialog;
};
}

View File

@@ -0,0 +1,81 @@
/*
* Copyright (C) by Krzesimir Nowak <krzesimir@endocode.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 "creds/http/httpconfigfile.h"
namespace Mirall
{
namespace
{
const char userC[] = "user";
const char passwdC[] = "passwd";
const char oldPasswdC[] = "password";
} // ns
QString HttpConfigFile::user() const
{
return retrieveData(QString(), QLatin1String(userC)).toString();
}
void HttpConfigFile::setUser(const QString& user)
{
storeData(QString(), QLatin1String(userC), QVariant(user));
}
QString HttpConfigFile::password() const
{
const QVariant passwd(retrieveData(QString(), QLatin1String(passwdC)));
if (passwd.isValid()) {
return QString::fromUtf8(QByteArray::fromBase64(passwd.toByteArray()));
}
return QString();
}
void HttpConfigFile::setPassword(const QString& password)
{
QByteArray pwdba = password.toUtf8();
storeData( QString(), QLatin1String(passwdC), QVariant(pwdba.toBase64()) );
removeOldPassword();
}
bool HttpConfigFile::passwordExists() const
{
return dataExists(QString(), QLatin1String(passwdC));
}
void HttpConfigFile::removePassword()
{
removeOldPassword();
removeData(QString(), QLatin1String(passwdC));
}
void HttpConfigFile::fixupOldPassword()
{
const QString old(QString::fromLatin1(oldPasswdC));
if (dataExists(QString(), old)) {
setPassword(retrieveData(QString(), old).toString());
}
}
void HttpConfigFile::removeOldPassword()
{
removeData(QString(), QLatin1String(oldPasswdC));
}
} // ns Mirall

View File

@@ -0,0 +1,40 @@
/*
* Copyright (C) by Krzesimir Nowak <krzesimir@endocode.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 MIRALL_CREDS_HTTP_CONFIG_FILE_H
#define MIRALL_CREDS_HTTP_CONFIG_FILE_H
#include "mirall/mirallconfigfile.h"
namespace Mirall
{
class HttpConfigFile : public MirallConfigFile
{
public:
QString user() const;
void setUser(const QString& user);
QString password() const;
void setPassword(const QString& password);
bool passwordExists() const;
void removePassword();
void fixupOldPassword();
private:
void removeOldPassword();
};
} // ns Mirall
#endif

View File

@@ -0,0 +1,213 @@
/*
* 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>
*
* 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; either version 2 of the License, or
* (at your option) any later version.
*
* 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 <QMutex>
#include "creds/httpcredentials.h"
#include "mirall/owncloudinfo.h"
#include "mirall/mirallconfigfile.h"
#include "mirall/mirallaccessmanager.h"
#include "mirall/utility.h"
#include "creds/http/credentialstore.h"
#include "creds/credentialscommon.h"
namespace Mirall
{
namespace
{
int getauth(const char *prompt,
char *buf,
size_t len,
int echo,
int verify,
void *userdata)
{
int re = 0;
QMutex mutex;
MirallConfigFile cfg;
HttpCredentials* http_credentials = dynamic_cast< HttpCredentials* > (cfg.getCredentials());
if (!http_credentials) {
qDebug() << "Not a HTTP creds instance!";
return -1;
}
QString qPrompt = QString::fromLatin1( prompt ).trimmed();
QString user = http_credentials->user();
QString pwd = http_credentials->password();
if( qPrompt == QLatin1String("Enter your username:") ) {
// qDebug() << "OOO Username requested!";
QMutexLocker locker( &mutex );
qstrncpy( buf, user.toUtf8().constData(), len );
} else if( qPrompt == QLatin1String("Enter your password:") ) {
QMutexLocker locker( &mutex );
// qDebug() << "OOO Password requested!";
qstrncpy( buf, pwd.toUtf8().constData(), len );
} else {
re = handleNeonSSLProblems(prompt, buf, len, echo, verify, userdata);
}
return re;
}
} // ns
class HttpCredentialsAccessManager : public MirallAccessManager {
public:
HttpCredentialsAccessManager(const HttpCredentials *cred, QObject* parent = 0)
: MirallAccessManager(parent), _cred(cred) {}
protected:
QNetworkReply *createRequest(Operation op, const QNetworkRequest &request, QIODevice *outgoingData) {
QByteArray credHash = QByteArray(_cred->user().toUtf8()+":"+_cred->password().toUtf8()).toBase64();
QNetworkRequest req(request);
req.setRawHeader(QByteArray("Authorization"), QByteArray("Basic ") + credHash);
return MirallAccessManager::createRequest(op, req, outgoingData);\
}
private:
const HttpCredentials *_cred;
};
HttpCredentials::HttpCredentials()
: _user(),
_password(),
_ready(false)
{}
HttpCredentials::HttpCredentials(const QString& user, const QString& password)
: _user(user),
_password(password),
_ready(true)
{}
void HttpCredentials::syncContextPreInit (CSYNC* ctx)
{
csync_set_auth_callback (ctx, getauth);
}
void HttpCredentials::syncContextPreStart (CSYNC* ctx)
{
// TODO: This should not 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 remove this code and keep it in
// csyncthread code (or folder code, git remembers).
QList<QNetworkCookie> cookies(ownCloudInfo::instance()->getLastAuthCookies());
QString cookiesAsString;
// Stuff cookies inside csync, then we can avoid the intermediate HTTP 401 reply
// when https://github.com/owncloud/core/pull/4042 is merged.
foreach(QNetworkCookie c, cookies) {
cookiesAsString += c.name();
cookiesAsString += '=';
cookiesAsString += c.value();
cookiesAsString += "; ";
}
csync_set_module_property(ctx, "session_key", cookiesAsString.toLatin1().data());
}
bool HttpCredentials::changed(AbstractCredentials* credentials) const
{
HttpCredentials* other(dynamic_cast< HttpCredentials* >(credentials));
if (!other || other->user() != this->user()) {
return true;
}
return false;
}
QString HttpCredentials::authType() const
{
return QString::fromLatin1("http");
}
QString HttpCredentials::user() const
{
return _user;
}
QString HttpCredentials::password() const
{
return _password;
}
QNetworkAccessManager* HttpCredentials::getQNAM() const
{
MirallAccessManager* qnam = new HttpCredentialsAccessManager(this);
connect( qnam, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)),
this, SLOT(slotAuthentication(QNetworkReply*,QAuthenticator*)));
return qnam;
}
bool HttpCredentials::ready() const
{
return _ready;
}
void HttpCredentials::fetch()
{
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();
}
}
void HttpCredentials::persistForUrl(const QString& url)
{
CredentialStore* store(CredentialStore::instance());
store->setCredentials(url, _user, _password);
store->saveCredentials();
}
void HttpCredentials::slotCredentialsFetched(bool ok)
{
_ready = ok;
if (_ready) {
CredentialStore* store(CredentialStore::instance());
_user = store->user();
_password = store->password();
}
Q_EMIT fetched();
}
void HttpCredentials::slotAuthentication(QNetworkReply* reply, QAuthenticator* authenticator)
{
Q_UNUSED(authenticator)
// we cannot use QAuthenticator, because it sends username and passwords with latin1
// instead of utf8 encoding. Instead, we send it manually. Thus, if we reach this signal,
// those credentials were invalid and we terminate.
qDebug() << "Stop request: Authentication failed for " << reply->url().toString();
reply->close();
}
void HttpCredentials::slotReplyFinished()
{
QNetworkReply* reply = qobject_cast< QNetworkReply* >(sender());
disconnect(reply, SIGNAL(finished()),
this, SLOT(slotReplyFinished()));
}
} // ns Mirall

View File

@@ -0,0 +1,63 @@
/*
* 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>
*
* 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; either version 2 of the License, or
* (at your option) any later version.
*
* 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 MIRALL_CREDS_HTTP_CREDENTIALS_H
#define MIRALL_CREDS_HTTP_CREDENTIALS_H
#include <QMap>
#include "creds/abstractcredentials.h"
class QNetworkReply;
class QAuthenticator;
namespace Mirall
{
class HttpCredentials : public AbstractCredentials
{
Q_OBJECT
public:
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;
private Q_SLOTS:
void slotCredentialsFetched(bool);
void slotAuthentication(QNetworkReply*, QAuthenticator*);
void slotReplyFinished();
private:
QString _user;
QString _password;
bool _ready;
};
} // ns Mirall
#endif

View File

@@ -0,0 +1,55 @@
/*
* Copyright (C) by Krzesimir Nowak <krzesimir@endocode.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 <QDebug>
#include <QNetworkRequest>
#include "creds/shibboleth/shibbolethaccessmanager.h"
namespace Mirall
{
ShibbolethAccessManager::ShibbolethAccessManager(const QNetworkCookie& cookie, QObject* parent)
: MirallAccessManager (parent),
_cookie(cookie)
{}
QNetworkReply* ShibbolethAccessManager::createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest& request, QIODevice* outgoingData)
{
if (!_cookie.name().isEmpty()) {
QNetworkCookieJar* jar(cookieJar());
QUrl url(request.url());
QList<QNetworkCookie> cookies;
Q_FOREACH(const QNetworkCookie& cookie, jar->cookiesForUrl(url)) {
if (!cookie.name().startsWith("_shibsession_")) {
cookies << cookie;
}
}
cookies << _cookie;
jar->setCookiesFromUrl(cookies, url);
}
qDebug() << "Creating a request to " << request.url().toString() << " with shibboleth cookie:" << _cookie.name();
return MirallAccessManager::createRequest (op, request, outgoingData);
}
void ShibbolethAccessManager::setCookie(const QNetworkCookie& cookie)
{
qDebug() << "Got new shibboleth cookie:" << cookie.name();
_cookie = cookie;
}
} // ns Mirall

View File

@@ -0,0 +1,43 @@
/*
* Copyright (C) by Krzesimir Nowak <krzesimir@endocode.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 MIRALL_WIZARD_SHIBBOLETH_ACCESS_MANAGER_H
#define MIRALL_WIZARD_SHIBBOLETH_ACCESS_MANAGER_H
#include <QNetworkCookie>
#include "mirall/mirallaccessmanager.h"
namespace Mirall
{
class ShibbolethAccessManager : public MirallAccessManager
{
Q_OBJECT
public:
ShibbolethAccessManager(const QNetworkCookie& cookie, QObject* parent = 0);
public Q_SLOTS:
void setCookie(const QNetworkCookie& cookie);
protected:
QNetworkReply* createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest& request, QIODevice* outgoingData = 0);
private:
QNetworkCookie _cookie;
};
} // ns Mirall
#endif

View File

@@ -0,0 +1,104 @@
/*
* Copyright (C) by Krzesimir Nowak <krzesimir@endocode.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 <QDebug>
#include <QTextStream>
#include "creds/shibboleth/shibbolethconfigfile.h"
#include "creds/shibboleth/shibbolethcookiejar.h"
namespace Mirall
{
namespace
{
const char otherCookiesC[] = "otherCookies";
} // ns
void ShibbolethConfigFile::storeCookies(const QMap<QUrl, QList<QNetworkCookie> >& cookiesForUrl)
{
if (cookiesForUrl.isEmpty()) {
removeData(QString(), QString::fromLatin1(otherCookiesC));
} else {
QByteArray data;
QTextStream stream(&data);
Q_FOREACH (const QUrl& url, cookiesForUrl.keys()) {
const QList<QNetworkCookie>& cookies(cookiesForUrl[url]);
if (cookies.isEmpty()) {
continue;
}
stream << "URL: " << url.toString().toUtf8() << "\n";
qDebug() << "URL: " << url.toString().toUtf8();
Q_FOREACH (const QNetworkCookie& cookie, cookies) {
stream << cookie.toRawForm(QNetworkCookie::NameAndValueOnly) << "\n";
qDebug() << cookie.toRawForm(QNetworkCookie::NameAndValueOnly);
}
}
stream.flush();
const QByteArray encodedCookies(data.toBase64());
qDebug() << "Raw cookies:\n" << data;
qDebug() << "Encoded cookies: " << encodedCookies;
storeData(QString(), QString::fromLatin1(otherCookiesC), QVariant(encodedCookies));
}
}
ShibbolethCookieJar* ShibbolethConfigFile::createCookieJar() const
{
ShibbolethCookieJar* jar = new ShibbolethCookieJar();
const QVariant variant(retrieveData(QString(), QString::fromLatin1(otherCookiesC)));
if (variant.isValid()) {
QByteArray data(QByteArray::fromBase64(variant.toByteArray()));
QTextStream stream (&data);
const QString urlHeader(QString::fromLatin1("URL: "));
QUrl currentUrl;
QList<QNetworkCookie> currentCookies;
qDebug() << "Got valid cookies variant: " << data;
while (!stream.atEnd()) {
const QString line(stream.readLine());
qDebug() << line;
if (line.startsWith(urlHeader)) {
if (!currentUrl.isEmpty() && !currentCookies.isEmpty()) {
jar->setCookiesFromUrl(currentCookies, currentUrl);
currentCookies.clear();
currentUrl.clear();
}
currentUrl = QUrl(line.mid(5));
} else if (!currentUrl.isEmpty()) {
const int equalPos(line.indexOf('='));
currentCookies << QNetworkCookie(line.left(equalPos).toUtf8(), line.mid(equalPos + 1).toUtf8());
}
}
if (!currentUrl.isEmpty() && !currentCookies.isEmpty()) {
jar->setCookiesFromUrl(currentCookies, currentUrl);
}
}
return jar;
}
} // ns Mirall

View File

@@ -0,0 +1,38 @@
/*
* Copyright (C) by Krzesimir Nowak <krzesimir@endocode.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 MIRALL_CREDS_SHIBBOLETH_CONFIG_FILE_H
#define MIRALL_CREDS_SHIBBOLETH_CONFIG_FILE_H
#include <QList>
#include <QMap>
#include <QNetworkCookie>
#include <QUrl>
#include "mirall/mirallconfigfile.h"
namespace Mirall
{
class ShibbolethCookieJar;
class ShibbolethConfigFile : public MirallConfigFile
{
public:
void storeCookies(const QMap<QUrl, QList<QNetworkCookie> >& cookies);
ShibbolethCookieJar* createCookieJar() const;
};
} // ns Mirall
#endif

View File

@@ -0,0 +1,34 @@
/*
* Copyright (C) by Krzesimir Nowak <krzesimir@endocode.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 "creds/shibboleth/shibbolethcookiejar.h"
namespace Mirall
{
ShibbolethCookieJar::ShibbolethCookieJar (QObject* parent)
: QNetworkCookieJar (parent)
{}
bool ShibbolethCookieJar::setCookiesFromUrl (const QList<QNetworkCookie>& cookieList, const QUrl& url)
{
if (QNetworkCookieJar::setCookiesFromUrl (cookieList, url)) {
Q_EMIT newCookiesForUrl (cookieList, url);
return true;
}
return false;
}
} // ns Mirall

View File

@@ -0,0 +1,41 @@
/*
* Copyright (C) by Krzesimir Nowak <krzesimir@endocode.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 MIRALL_WIZARD_SHIBBOLETH_COOKIE_JAR_H
#define MIRALL_WIZARD_SHIBBOLETH_COOKIE_JAR_H
#include <QNetworkCookieJar>
#include <QList>
class QUrl;
class QNetworkCookie;
namespace Mirall
{
class ShibbolethCookieJar : public QNetworkCookieJar
{
Q_OBJECT
public:
ShibbolethCookieJar (QObject* parent = 0);
virtual bool setCookiesFromUrl (const QList<QNetworkCookie>& cookieList, const QUrl& url);
Q_SIGNALS:
void newCookiesForUrl (const QList<QNetworkCookie>& cookieList, const QUrl& url);
};
} // ns Mirall
#endif

View File

@@ -0,0 +1,52 @@
/*
* Copyright (C) by Krzesimir Nowak <krzesimir@endocode.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 <QEventLoop>
#include "creds/shibboleth/shibbolethrefresher.h"
#include "creds/shibbolethcredentials.h"
namespace Mirall
{
ShibbolethRefresher::ShibbolethRefresher(ShibbolethCredentials* creds, CSYNC* csync_ctx, QObject* parent)
: QObject(parent),
_creds(creds),
_csync_ctx(csync_ctx)
{}
void ShibbolethRefresher::refresh()
{
QEventLoop loop;
connect(_creds, SIGNAL(invalidatedAndFetched(QByteArray)),
this, SLOT(onInvalidatedAndFetched(QByteArray)));
connect(_creds, SIGNAL(invalidatedAndFetched(QByteArray)),
&loop, SLOT(quit()));
QMetaObject::invokeMethod(_creds, "invalidateAndFetch", Qt::QueuedConnection);
loop.exec();
disconnect(_creds, SIGNAL(invalidatedAndFetched(QByteArray)),
&loop, SLOT(quit()));
}
void ShibbolethRefresher::onInvalidatedAndFetched(const QByteArray& cookies)
{
// "cookies" is const and its data() return const void*. We want just void*.
QByteArray myCookies(cookies);
disconnect(_creds, SIGNAL(invalidatedAndFetched(QByteArray)),
this, SLOT(onInvalidatedAndFetched(QByteArray)));
csync_set_module_property(_csync_ctx, "session_key", myCookies.data());
}
} // ns Mirall

View File

@@ -0,0 +1,47 @@
/*
* Copyright (C) by Krzesimir Nowak <krzesimir@endocode.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 MIRALL_CREDS_SHIBBOLETH_REFRESHER_H
#define MIRALL_CREDS_SHIBBOLETH_REFRESHER_H
#include <QObject>
#include <csync.h>
class QByteArray;
namespace Mirall
{
class ShibbolethCredentials;
class ShibbolethRefresher : public QObject
{
Q_OBJECT
public:
ShibbolethRefresher(ShibbolethCredentials* creds, CSYNC* csync_ctx, QObject* parent = 0);
void refresh();
private Q_SLOTS:
void onInvalidatedAndFetched(const QByteArray& cookieData);
private:
ShibbolethCredentials* _creds;
CSYNC* _csync_ctx;
};
} // ns Mirall
#endif

View File

@@ -0,0 +1,104 @@
/*
* Copyright (C) by Krzesimir Nowak <krzesimir@endocode.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 <QApplication>
#include <QDebug>
#include <QNetworkCookie>
#include <QWebFrame>
#include <QWebPage>
#include "creds/shibboleth/shibbolethcookiejar.h"
#include "creds/shibboleth/shibbolethwebview.h"
#include "mirall/mirallaccessmanager.h"
namespace Mirall
{
void ShibbolethWebView::setup(const QUrl& url, ShibbolethCookieJar* jar)
{
MirallAccessManager* nm = new MirallAccessManager(this);
QWebPage* page = new QWebPage(this);
jar->setParent(this);
connect(jar, SIGNAL (newCookiesForUrl (QList<QNetworkCookie>, QUrl)),
this, SLOT (onNewCookiesForUrl (QList<QNetworkCookie>, QUrl)));
connect(page, SIGNAL(loadStarted()),
this, SLOT(slotLoadStarted()));
connect(page, SIGNAL(loadFinished(bool)),
this, SLOT(slotLoadFinished()));
nm->setCookieJar(jar);
page->setNetworkAccessManager(nm);
page->mainFrame ()->load (url);
this->setPage (page);
}
ShibbolethWebView::ShibbolethWebView(const QUrl& url, QWidget* parent)
: QWebView(parent)
{
setup(url, new ShibbolethCookieJar(this));
}
ShibbolethWebView::~ShibbolethWebView()
{
slotLoadFinished();
}
ShibbolethWebView::ShibbolethWebView(const QUrl& url, ShibbolethCookieJar* jar, QWidget* parent)
: QWebView(parent)
{
setup(url, jar);
}
void ShibbolethWebView::onNewCookiesForUrl (const QList<QNetworkCookie>& cookieList, const QUrl& url)
{
QList<QNetworkCookie> otherCookies;
QNetworkCookie shibCookie;
Q_FOREACH (const QNetworkCookie& cookie, cookieList) {
if (cookie.name().startsWith ("_shibsession_")) {
if (shibCookie.name().isEmpty()) {
shibCookie = cookie;
} else {
qWarning() << "Too many Shibboleth session cookies at once!";
}
} else {
otherCookies << cookie;
}
}
if (!otherCookies.isEmpty()) {
Q_EMIT otherCookiesReceived(otherCookies, url);
}
if (!shibCookie.name().isEmpty()) {
Q_EMIT shibbolethCookieReceived(shibCookie);
}
}
void ShibbolethWebView::hideEvent(QHideEvent* event)
{
Q_EMIT viewHidden();
QWebView::hideEvent(event);
}
void ShibbolethWebView::slotLoadStarted()
{
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
}
void ShibbolethWebView::slotLoadFinished()
{
QApplication::restoreOverrideCursor();
}
} // ns Mirall

View File

@@ -0,0 +1,56 @@
/*
* Copyright (C) by Krzesimir Nowak <krzesimir@endocode.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 MIRALL_WIZARD_SHIBBOLETH_WEB_VIEW_H
#define MIRALL_WIZARD_SHIBBOLETH_WEB_VIEW_H
#include <QList>
#include <QWebView>
class QNetworkCookie;
class QUrl;
namespace Mirall
{
class ShibbolethCookieJar;
class ShibbolethWebView : public QWebView
{
Q_OBJECT
public:
ShibbolethWebView(const QUrl& url, QWidget* parent = 0);
ShibbolethWebView(const QUrl& url, ShibbolethCookieJar* jar, QWidget* parent = 0);
~ShibbolethWebView();
protected:
void hideEvent(QHideEvent* event);
Q_SIGNALS:
void shibbolethCookieReceived(const QNetworkCookie& cookie);
void viewHidden();
void otherCookiesReceived(const QList<QNetworkCookie>& cookieList, const QUrl& url);
private Q_SLOTS:
void onNewCookiesForUrl(const QList<QNetworkCookie>& cookieList, const QUrl& url);
void slotLoadStarted();
void slotLoadFinished();
private:
void setup(const QUrl& url, ShibbolethCookieJar* jar);
};
} // ns Mirall
#endif

View File

@@ -0,0 +1,231 @@
/*
* Copyright (C) by Krzesimir Nowak <krzesimir@endocode.com>
* 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 "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"
namespace Mirall
{
namespace
{
int shibboleth_redirect_callback(CSYNC* csync_ctx,
const char* uri)
{
if (!csync_ctx || !uri) {
return 1;
}
const QString qurl(QString::fromLatin1(uri));
QRegExp shibbolethyWords ("SAML|wayf");
shibbolethyWords.setCaseSensitivity (Qt::CaseInsensitive);
if (!qurl.contains(shibbolethyWords)) {
return 1;
}
QMutex mutex;
QMutexLocker locker(&mutex);
MirallConfigFile cfg;
ShibbolethCredentials* creds = dynamic_cast< ShibbolethCredentials* > (cfg.getCredentials());
if (!creds) {
qDebug() << "Not a Shibboleth creds instance!";
return 1;
}
ShibbolethRefresher refresher(creds, csync_ctx);
// blocks
refresher.refresh();
return creds->ready() ? 0 : 1;
}
} // ns
ShibbolethCredentials::ShibbolethCredentials()
: _shibCookie(),
_ready(false),
_browser(0),
_otherCookies()
{}
ShibbolethCredentials::ShibbolethCredentials(const QNetworkCookie& cookie, const QMap<QUrl, QList<QNetworkCookie> >& otherCookies)
: _shibCookie(cookie),
_ready(true),
_browser(0),
_otherCookies(otherCookies)
{}
void ShibbolethCredentials::syncContextPreInit(CSYNC* ctx)
{
csync_set_auth_callback (ctx, handleNeonSSLProblems);
}
QByteArray ShibbolethCredentials::prepareCookieData() const
{
QString cookiesAsString;
// TODO: This should not 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 just append shibboleth
// cookies to the "session_key" value and set it in csync module.
QList<QNetworkCookie> cookies(ownCloudInfo::instance()->getLastAuthCookies());
QMap<QString, QString> uniqueCookies;
cookies << _shibCookie;
// Stuff cookies inside csync, then we can avoid the intermediate HTTP 401 reply
// when https://github.com/owncloud/core/pull/4042 is merged.
foreach(QNetworkCookie c, cookies) {
const QString cookieName(c.name());
if (cookieName.startsWith("_shibsession_")) {
continue;
}
uniqueCookies.insert(cookieName, c.value());
}
if (!_shibCookie.name().isEmpty()) {
uniqueCookies.insert(_shibCookie.name(), _shibCookie.value());
}
foreach(const QString& cookieName, uniqueCookies.keys()) {
cookiesAsString += cookieName;
cookiesAsString += '=';
cookiesAsString += uniqueCookies[cookieName];
cookiesAsString += "; ";
}
return cookiesAsString.toLatin1();
}
void ShibbolethCredentials::syncContextPreStart (CSYNC* ctx)
{
typedef int (*csync_owncloud_redirect_callback_t)(CSYNC* ctx, const char* uri);
csync_owncloud_redirect_callback_t cb = shibboleth_redirect_callback;
csync_set_module_property(ctx, "session_key", prepareCookieData().data());
csync_set_module_property(ctx, "redirect_callback", &cb);
}
bool ShibbolethCredentials::changed(AbstractCredentials* credentials) const
{
ShibbolethCredentials* other(dynamic_cast< ShibbolethCredentials* >(credentials));
if (!other || other->cookie() != this->cookie()) {
return true;
}
return false;
}
QString ShibbolethCredentials::authType() const
{
return QString::fromLatin1("shibboleth");
}
QNetworkCookie ShibbolethCredentials::cookie() const
{
return _shibCookie;
}
QNetworkAccessManager* ShibbolethCredentials::getQNAM() const
{
ShibbolethAccessManager* qnam(new ShibbolethAccessManager(_shibCookie));
connect(this, SIGNAL(newCookie(QNetworkCookie)),
qnam, SLOT(setCookie(QNetworkCookie)));
return qnam;
}
bool ShibbolethCredentials::ready() const
{
return _ready;
}
void ShibbolethCredentials::fetch()
{
if (_ready) {
Q_EMIT fetched();
} else {
ShibbolethConfigFile cfg;
_browser = new ShibbolethWebView(QUrl(cfg.ownCloudUrl()), cfg.createCookieJar());
connect(_browser, SIGNAL(shibbolethCookieReceived(QNetworkCookie)),
this, SLOT(onShibbolethCookieReceived(QNetworkCookie)));
connect(_browser, SIGNAL(viewHidden()),
this, SLOT(slotBrowserHidden()));
_browser->show ();
}
}
void ShibbolethCredentials::persistForUrl(const QString& /*url*/)
{
ShibbolethConfigFile cfg;
cfg.storeCookies(_otherCookies);
}
void ShibbolethCredentials::disposeBrowser()
{
disconnect(_browser, SIGNAL(viewHidden()),
this, SLOT(slotBrowserHidden()));
disconnect(_browser, SIGNAL(shibbolethCookieReceived(QNetworkCookie)),
this, SLOT(onShibbolethCookieReceived(QNetworkCookie)));
_browser->hide();
_browser->deleteLater();
_browser = 0;
}
void ShibbolethCredentials::onShibbolethCookieReceived(const QNetworkCookie& cookie)
{
disposeBrowser();
_ready = true;
_shibCookie = cookie;
Q_EMIT newCookie(_shibCookie);
Q_EMIT fetched();
}
void ShibbolethCredentials::slotBrowserHidden()
{
disposeBrowser();
_ready = false;
_shibCookie = QNetworkCookie();
Q_EMIT fetched();
}
void ShibbolethCredentials::invalidateAndFetch()
{
_ready = false;
connect (this, SIGNAL(fetched()),
this, SLOT(onFetched()));
fetch();
}
void ShibbolethCredentials::onFetched()
{
disconnect (this, SIGNAL(fetched()),
this, SLOT(onFetched()));
Q_EMIT invalidatedAndFetched(prepareCookieData());
}
} // ns Mirall

View File

@@ -0,0 +1,72 @@
/*
* Copyright (C) by Krzesimir Nowak <krzesimir@endocode.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 MIRALL_CREDS_SHIBBOLETH_CREDENTIALS_H
#define MIRALL_CREDS_SHIBBOLETH_CREDENTIALS_H
#include <QList>
#include <QMap>
#include <QNetworkCookie>
#include <QUrl>
#include "creds/abstractcredentials.h"
namespace Mirall
{
class ShibbolethWebView;
class ShibbolethCredentials : public AbstractCredentials
{
Q_OBJECT
public:
ShibbolethCredentials();
ShibbolethCredentials(const QNetworkCookie& cookie, const QMap<QUrl, QList<QNetworkCookie> >& otherCookies);
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);
QNetworkCookie cookie() const;
public Q_SLOTS:
void invalidateAndFetch();
private Q_SLOTS:
void onShibbolethCookieReceived(const QNetworkCookie& cookie);
void slotBrowserHidden();
void onFetched();
Q_SIGNALS:
void newCookie(const QNetworkCookie& cookie);
void invalidatedAndFetched(const QByteArray& cookieData);
private:
QByteArray prepareCookieData() const;
void disposeBrowser();
QNetworkCookie _shibCookie;
bool _ready;
ShibbolethWebView* _browser;
QMap<QUrl, QList<QNetworkCookie> > _otherCookies;
};
} // ns Mirall
#endif

View File

@@ -13,6 +13,21 @@
*/
#include "mirall/application.h"
#include "mirall/theme.h"
#include "mirall/utility.h"
#include <QMessageBox>
#include <QTimer>
void warnSystray()
{
QMessageBox::critical(0, qApp->translate("main.cpp", "System Tray not available"),
qApp->translate("main.cpp", "%1 requires on a working system tray. "
"If you are running XFCE, please follow "
"<a href=\"http://docs.xfce.org/xfce/xfce4-panel/systray\">these instructions</a>. "
"Otherwise, please install a system tray application such as 'trayer' and try again.")
.arg(Mirall::Theme::instance()->appNameGUI()));
}
int main(int argc, char **argv)
{
@@ -20,7 +35,12 @@ int main(int argc, char **argv)
Mirall::Application app(argc, argv);
app.initialize();
if( app.giveHelp() ) {
app.showHelp();
return 0;
}
// if the application is already running, notify it.
if( app.isRunning() ) {
QStringList args = app.arguments();
@@ -30,12 +50,20 @@ int main(int argc, char **argv)
return -1;
}
return 0;
}
// if help requested, show on command line and exit.
if( ! app.giveHelp() ) {
return app.exec();
} else {
app.showHelp();
int attempts = 0;
forever {
if (!QSystemTrayIcon::isSystemTrayAvailable() && qgetenv("DESKTOP_SESSION") != "ubuntu") {
Mirall::Utility::sleep(1);
attempts++;
if (attempts < 30) continue;
} else {
break;
}
warnSystray();
break;
}
}
return app.exec();
}

View File

@@ -0,0 +1,758 @@
/*
* 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 "accountsettings.h"
#include "ui_accountsettings.h"
#include "mirall/theme.h"
#include "mirall/folderman.h"
#include "mirall/owncloudinfo.h"
#include "mirall/folderwizard.h"
#include "mirall/folderstatusmodel.h"
#include "mirall/utility.h"
#include "mirall/application.h"
#include "mirall/owncloudsetupwizard.h"
#include "mirall/mirallconfigfile.h"
#include "mirall/ignorelisteditor.h"
#include "mirall/itemprogressdialog.h"
#include <math.h>
#include <QDebug>
#include <QDesktopServices>
#include <QListWidgetItem>
#include <QMessageBox>
#include <QAction>
#include <QKeySequence>
namespace Mirall {
static const char progressBarStyleC[] =
"QProgressBar {"
"border: 1px solid grey;"
"border-radius: 5px;"
"text-align: center;"
"}"
"QProgressBar::chunk {"
"background-color: %1; width: 1px;"
"}";
AccountSettings::AccountSettings(QWidget *parent) :
QWidget(parent),
ui(new Ui::AccountSettings)
{
ui->setupUi(this);
_model = new FolderStatusModel;
_model->setParent(this);
FolderStatusDelegate *delegate = new FolderStatusDelegate;
delegate->setParent(this);
ui->_folderList->setItemDelegate( delegate );
ui->_folderList->setModel( _model );
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);
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()));
connect(ui->modifyAccountButton, SIGNAL(clicked()), SLOT(slotOpenAccountWizard()));
connect(ui->ignoredFilesButton, SIGNAL(clicked()), SLOT(slotIgnoreFilesEditor()));;
connect(ui->_folderList, SIGNAL(clicked(QModelIndex)), SLOT(slotFolderActivated(QModelIndex)));
connect(ui->_folderList, SIGNAL(doubleClicked(QModelIndex)),SLOT(slotDoubleClicked(QModelIndex)));
QColor color = palette().highlight().color();
ui->quotaProgressBar->setStyleSheet(QString::fromLatin1(progressBarStyleC).arg(color.name()));
ownCloudInfo *ocInfo = ownCloudInfo::instance();
slotUpdateQuota(ocInfo->lastQuotaTotalBytes(), ocInfo->lastQuotaUsedBytes());
connect(ocInfo, SIGNAL(quotaUpdated(qint64,qint64)), SLOT(slotUpdateQuota(qint64,qint64)));
ui->connectLabel->setWordWrap( true );
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 );
if ( state ) {
bool folderEnabled = _model->data( indx, FolderStatusDelegate::FolderSyncEnabled).toBool();
qDebug() << "folder is sync enabled: " << folderEnabled;
if ( folderEnabled ) {
ui->_ButtonEnable->setText( tr( "Pause" ) );
} else {
ui->_ButtonEnable->setText( tr( "Resume" ) );
}
}
}
void AccountSettings::slotAddFolder()
{
FolderMan *folderMan = FolderMan::instance();
folderMan->setSyncEnabled(false); // do not start more syncs.
FolderWizard *folderWizard = new FolderWizard(this);
Folder::Map folderMap = folderMan->map();
folderWizard->setFolderMap( folderMap );
connect(folderWizard, SIGNAL(accepted()), SLOT(slotFolderWizardAccepted()));
connect(folderWizard, SIGNAL(rejected()), SLOT(slotFolderWizardRejected()));
folderWizard->open();
}
void AccountSettings::slotFolderWizardAccepted()
{
FolderWizard *folderWizard = qobject_cast<FolderWizard*>(sender());
FolderMan *folderMan = FolderMan::instance();
qDebug() << "* Folder wizard completed";
QString alias = folderWizard->field(QLatin1String("alias")).toString();
QString sourceFolder = folderWizard->field(QLatin1String("sourceFolder")).toString();
QString targetPath = folderWizard->property("targetPath").toString();
if (!FolderMan::ensureJournalGone( sourceFolder ))
return;
folderMan->addFolderDefinition(alias, sourceFolder, targetPath );
Folder *f = folderMan->setupFolderFromConfigFile( alias );
slotAddFolder( f );
folderMan->setSyncEnabled(true);
if( f ) {
folderMan->slotScheduleAllFolders();
emit folderChanged();
}
buttonsSetEnabled();
}
void AccountSettings::slotFolderWizardRejected()
{
qDebug() << "* Folder wizard cancelled";
FolderMan *folderMan = FolderMan::instance();
folderMan->setSyncEnabled(true);
folderMan->slotScheduleAllFolders();
}
void AccountSettings::slotOpenAccountWizard()
{
this->topLevelWidget()->close();
OwncloudSetupWizard::runWizard(qApp, SLOT(slotownCloudWizardDone(int)), 0);
}
void AccountSettings::slotAddFolder( Folder *folder )
{
if( ! folder || folder->alias().isEmpty() ) return;
QStandardItem *item = new QStandardItem();
folderToModelItem( item, folder );
_model->appendRow( item );
slotCheckConnection();
}
void AccountSettings::buttonsSetEnabled()
{
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);
}
void AccountSettings::setGeneralErrors( const QStringList& errors )
{
_generalErrors = errors;
}
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->alias(), FolderStatusDelegate::FolderAliasRole );
item->setData( f->syncEnabled(), FolderStatusDelegate::FolderSyncEnabled );
SyncResult res = f->syncResult();
SyncResult::Status status = res.status();
QStringList errorList = res.errorStrings();
Theme *theme = Theme::instance();
item->setData( theme->statusHeaderText( status ), Qt::ToolTipRole );
if( f->syncEnabled() ) {
item->setData( theme->syncStateIcon( status ), FolderStatusDelegate::FolderStatusIconRole );
} else {
item->setData( theme->folderDisabledIcon( ), FolderStatusDelegate::FolderStatusIconRole ); // size 48 before
}
item->setData( theme->statusHeaderText( status ), FolderStatusDelegate::FolderStatus );
if( errorList.isEmpty() ) {
if( (status == SyncResult::Error ||
status == SyncResult::SetupError ||
status == SyncResult::Unavailable )) {
errorList << theme->statusHeaderText(status);
}
}
item->setData( errorList, FolderStatusDelegate::FolderErrorMsg);
bool ongoing = false;
item->setData( QVariant(res.warnCount()), FolderStatusDelegate::WarningCount );
if( status == SyncResult::SyncRunning ) {
ongoing = true;
}
item->setData( ongoing, FolderStatusDelegate::SyncRunning);
}
void AccountSettings::slotRemoveCurrentFolder()
{
QModelIndex selected = ui->_folderList->selectionModel()->currentIndex();
if( selected.isValid() ) {
int row = selected.row();
QString alias = _model->data( selected, FolderStatusDelegate::FolderAliasRole ).toString();
qDebug() << "Remove Folder alias " << alias;
if( !alias.isEmpty() ) {
// remove from file system through folder man
// _model->removeRow( selected.row() );
int ret = QMessageBox::question( this, tr("Confirm Folder Remove"),
tr("<p>Do you really want to stop syncing the folder <i>%1</i>?</p>"
"<p><b>Note:</b> This will not remove the files from your client.</p>").arg(alias),
QMessageBox::Yes|QMessageBox::No );
if( ret == QMessageBox::No ) {
return;
}
/* Remove the selected item from the timer hash. */
QStandardItem *item = NULL;
if( selected.isValid() )
item = _model->itemFromIndex(selected);
if( selected.isValid() && item && _hideProgressTimers.contains(item) ) {
QTimer *t = _hideProgressTimers[item];
t->stop();
_hideProgressTimers.remove(item);
delete(t);
}
FolderMan *folderMan = FolderMan::instance();
folderMan->slotRemoveFolder( alias );
_model->removeRow(row);
emit folderChanged();
slotCheckConnection();
}
}
}
void AccountSettings::slotResetCurrentFolder()
{
QModelIndex selected = ui->_folderList->selectionModel()->currentIndex();
if( selected.isValid() ) {
QString alias = _model->data( selected, FolderStatusDelegate::FolderAliasRole ).toString();
int ret = QMessageBox::question( 0, tr("Confirm Folder Reset"),
tr("<p>Do you really want to reset folder <i>%1</i> and rebuild your client database?</p>"
"<p><b>Note:</b> This function is designed for maintenance purposes only. "
"No files will be removed, but this can cause significant data traffic and "
"take several minutes or hours to complete, depending on the size of the folder. "
"Only use this option if advised by your administrator.</p>").arg(alias),
QMessageBox::Yes|QMessageBox::No );
if( ret == QMessageBox::Yes ) {
FolderMan *folderMan = FolderMan::instance();
Folder *f = folderMan->folder(alias);
f->slotTerminateSync();
f->wipe();
folderMan->slotScheduleAllFolders();
}
}
}
void AccountSettings::slotDoubleClicked( const QModelIndex& indx )
{
if( ! indx.isValid() ) return;
QString alias = _model->data( indx, FolderStatusDelegate::FolderAliasRole ).toString();
emit openFolderAlias( alias );
}
void AccountSettings::showConnectionLabel( const QString& message, const QString& tooltip )
{
const QString errStyle = QLatin1String("color:#ffffff; background-color:#bb4d4d;padding:5px;"
"border-width: 1px; border-style: solid; border-color: #aaaaaa;"
"border-radius:5px;");
if( _generalErrors.isEmpty() ) {
ui->connectLabel->setText( message );
ui->connectLabel->setToolTip(tooltip);
} else {
const QString msg = _generalErrors.join(QLatin1String("\n"));
ui->connectLabel->setText( msg );
ui->connectLabel->setToolTip(QString());
ui->connectLabel->setStyleSheet(errStyle);
}
}
void AccountSettings::slotCheckConnection()
{
if( ownCloudInfo::instance()->isConfigured() ) {
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();
foreach(QTimer *t, _hideProgressTimers) {
t->stop();
delete t;
}
_hideProgressTimers.clear();
foreach( Folder *f, folders ) {
slotAddFolder( f );
}
QModelIndex idx = _model->index(0, 0);
if (idx.isValid()) {
ui->_folderList->setCurrentIndex(idx);
}
buttonsSetEnabled();
}
// move from Application
void AccountSettings::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 AccountSettings::slotEnableCurrentFolder()
{
QModelIndex selected = ui->_folderList->selectionModel()->currentIndex();
if( selected.isValid() ) {
QString alias = _model->data( selected, FolderStatusDelegate::FolderAliasRole ).toString();
bool folderEnabled = _model->data( selected, FolderStatusDelegate::FolderSyncEnabled).toBool();
qDebug() << "Toggle enabled/disabled Folder alias " << alias << " - current state: " << folderEnabled;
if( !alias.isEmpty() ) {
FolderMan *folderMan = FolderMan::instance();
qDebug() << "Application: enable folder with alias " << alias;
bool terminate = false;
// this sets the folder status to disabled but does not interrupt it.
Folder *f = folderMan->folder( alias );
if( f && folderEnabled ) {
// check if a sync is still running and if so, ask if we should terminate.
if( f->isBusy() ) { // its still running
int reply = QMessageBox::question( 0, tr("Sync Running"),
tr("The syncing operation is running.<br/>Do you want to terminate it?"),
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes );
if ( reply == QMessageBox::Yes )
terminate = true;
else
return; // do nothing
}
}
// 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 );
folderMan->slotEnableFolder( alias, !folderEnabled );
slotUpdateFolderState (f);
// set the button text accordingly.
slotFolderActivated( selected );
}
}
}
void AccountSettings::slotUpdateFolderState( Folder *folder )
{
QStandardItem *item = 0;
int row = 0;
if( ! folder ) return;
item = _model->item( row );
while( item ) {
if( item->data( FolderStatusDelegate::FolderAliasRole ) == folder->alias() ) {
// its the item to update!
break;
}
item = _model->item( ++row );
}
if( item ) {
folderToModelItem( item, 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()
{
if( _OCUrl.isValid() )
QDesktopServices::openUrl( _OCUrl );
}
QStandardItem* AccountSettings::itemForFolder(const QString& folder)
{
QStandardItem *item = NULL;
if( folder.isEmpty() ) {
return item;
}
int row = 0;
item = _model->item( row );
while( item ) {
if( item->data( FolderStatusDelegate::FolderAliasRole ) == folder ) {
// its the item to update!
break;
}
item = _model->item( ++row );
}
return item;
}
QString AccountSettings::shortenFilename( const QString& folder, const QString& file ) const
{
// strip off the server prefix from the file name
QString shortFile(file);
if( shortFile.isEmpty() ) {
return QString::null;
}
if(shortFile.startsWith(QLatin1String("ownclouds://")) ||
shortFile.startsWith(QLatin1String("owncloud://")) ) {
// rip off the whole ownCloud URL.
Folder *f = FolderMan::instance()->folder(folder);
if( f ) {
QString remotePathUrl = ownCloudInfo::instance()->webdavUrl() + QLatin1Char('/') + f->secondPath();
shortFile.remove(Utility::toCSyncScheme(remotePathUrl));
}
}
return shortFile;
}
void AccountSettings::slotProgressProblem(const QString& folder, const Progress::SyncProblem& problem)
{
Q_UNUSED(problem);
QStandardItem *item = itemForFolder( folder );
if( !item ) return;
int warnCount = qvariant_cast<int>( item->data(FolderStatusDelegate::WarningCount) );
warnCount++;
item->setData( QVariant(warnCount), FolderStatusDelegate::WarningCount );
}
void AccountSettings::slotSetProgress(const QString& folder, const Progress::Info &progress )
{
// qDebug() << "================================> Progress for folder " << folder << " file " << file << ": "<< p1;
QStandardItem *item = itemForFolder( folder );
qint64 prog1 = progress.current_file_bytes;
qint64 prog2 = progress.file_size;
if( item == NULL ) {
return;
}
// Hotfix for a crash that I experienced in a very rare case/setup
if (progress.kind == Mirall::Progress::Invalid) {
qDebug() << "================================> INVALID Progress for folder " << folder;
return;
}
QString itemFileName = shortenFilename(folder, progress.current_file);
QString syncFileProgressString;
// stay with the previous kind-string for Context.
if( progress.kind != Progress::Context ) {
_kindContext = Progress::asActionString(progress.kind);
} else {
if( _kindContext.isEmpty() ) {
// empty kind context means that the dialog was opened after the action
// was started.
Progress::Kind kind = ProgressDispatcher::instance()->currentFolderContext(progress.folder);
if( kind != Progress::Invalid ) {
_kindContext = Progress::asActionString(kind);
}
}
}
QString kindString = _kindContext;
switch( progress.kind ) {
case Progress::StartSync:
item->setData( QVariant(0), FolderStatusDelegate::WarningCount );
break;
case Progress::StartDownload:
case Progress::StartUpload:
case Progress::StartDelete:
syncFileProgressString = tr("Start");
if( _hideProgressTimers.contains(item) ) {
// The timer is still running.
QTimer *t = _hideProgressTimers.take(item);
t->stop();
t->deleteLater();
}
break;
case Progress::Context:
syncFileProgressString = tr("Currently");
break;
case Progress::EndDownload:
case Progress::EndUpload:
case Progress::EndDelete:
break;
case Progress::EndSync:
syncFileProgressString = tr("Completely");
// start a timer to stop the progress display
QTimer *timer;
if( _hideProgressTimers.contains(item) ) {
timer = _hideProgressTimers[item];
// there is already one timer running.
} else {
timer = new QTimer;
connect(timer, SIGNAL(timeout()), this, SLOT(slotHideProgress()));
timer->setSingleShot(true);
_hideProgressTimers.insert(item, timer);
}
timer->start(5000);
break;
case Progress::Invalid:
case Progress::Download:
case Progress::Upload:
case Progress::Inactive:
case Progress::Error:
break;
}
QString fileProgressString;
QString s1 = Utility::octetsToString( prog1 );
QString s2 = Utility::octetsToString( prog2 );
// switch on extra space.
item->setData( QVariant(true), FolderStatusDelegate::AddProgressSpace );
if( progress.kind != Progress::EndSync ) {
// Example text: "Currently uploading foobar.png (1MB of 2MB)"
fileProgressString = tr("%1 %2 %3 (%4 of %5)").arg(syncFileProgressString).arg(kindString).
arg(itemFileName).arg(s1).arg(s2);
} else {
fileProgressString = tr("Completely finished.");
}
item->setData( fileProgressString,FolderStatusDelegate::SyncProgressItemString);
// overall progress
s1 = Utility::octetsToString( progress.overall_current_bytes );
s2 = Utility::octetsToString( progress.overall_transmission_size );
QString overallSyncString = tr("%1 of %2, file %3 of %4").arg(s1).arg(s2)
.arg(progress.current_file_no).arg(progress.overall_file_count);
item->setData( overallSyncString, FolderStatusDelegate::SyncProgressOverallString );
int overallPercent = 0;
if( progress.overall_transmission_size > 0 ) {
overallPercent = qRound(double(progress.overall_current_bytes)/double(progress.overall_transmission_size) * 100.0);
}
item->setData( overallPercent, FolderStatusDelegate::SyncProgressOverallPercent);
}
void AccountSettings::slotHideProgress()
{
QTimer *send_timer = qobject_cast<QTimer*>(this->sender());
QHash<QStandardItem*, QTimer*>::const_iterator i = _hideProgressTimers.constBegin();
while (i != _hideProgressTimers.constEnd()) {
if( i.value() == send_timer ) {
QStandardItem *item = i.key();
/* Check if this item is still existing */
bool ok = false;
for( int r = 0; !ok && r < _model->rowCount(); r++) {
if( item == _model->item(r,0) ) {
ok = true;
}
}
if( ok ) {
item->setData( QVariant(false), FolderStatusDelegate::AddProgressSpace );
item->setData( QVariant(QString::null), FolderStatusDelegate::SyncProgressOverallString );
item->setData( QVariant(QString::null), FolderStatusDelegate::SyncProgressItemString );
item->setData( 0, FolderStatusDelegate::SyncProgressOverallPercent );
}
_hideProgressTimers.remove(item);
break;
}
++i;
}
send_timer->deleteLater();
}
void AccountSettings::slotUpdateQuota(qint64 total, qint64 used)
{
if( total > 0 ) {
ui->quotaProgressBar->setVisible(true);
ui->quotaInfoLabel->setVisible(true);
ui->quotaProgressBar->setEnabled(true);
// workaround the label only accepting ints (which may be only 32 bit wide)
ui->quotaProgressBar->setMaximum(100);
int qVal = qRound(used/(double)total * 100);
if( qVal > 100 ) qVal = 100;
ui->quotaProgressBar->setValue(qVal);
QString usedStr = Utility::octetsToString(used);
QString totalStr = Utility::octetsToString(total);
ui->quotaLabel->setText(tr("%1 of %2 in use.").arg(usedStr, totalStr));
} else {
ui->quotaProgressBar->setVisible(false);
ui->quotaInfoLabel->setVisible(false);
ui->quotaLabel->setText(tr("Currently there is no storage usage information available."));
}
}
void AccountSettings::slotIgnoreFilesEditor()
{
if (_ignoreEditor.isNull()) {
_ignoreEditor = new IgnoreListEditor(this);
_ignoreEditor->setAttribute( Qt::WA_DeleteOnClose, true );
_ignoreEditor->open();
} else {
Utility::raiseDialog(_ignoreEditor);
}
}
void AccountSettings::slotInfoAboutCurrentFolder()
{
emit(openProgressDialog());
}
AccountSettings::~AccountSettings()
{
delete ui;
}
} // namespace Mirall

View File

@@ -0,0 +1,109 @@
/*
* 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 ACCOUNTSETTINGS_H
#define ACCOUNTSETTINGS_H
#include <QWidget>
#include <QUrl>
#include <QPointer>
#include <QHash>
#include <QTimer>
#include <QStandardItem>
#include "mirall/folder.h"
#include "mirall/progressdispatcher.h"
#include "mirall/itemprogressdialog.h"
class QStandardItemModel;
class QModelIndex;
class QStandardItem;
class QNetworkReply;
class QListWidgetItem;
namespace Mirall {
namespace Ui {
class AccountSettings;
}
class FolderMan;
class ItemProgressDialog;
class IgnoreListEditor;
class AccountSettings : public QWidget
{
Q_OBJECT
public:
explicit AccountSettings(QWidget *parent = 0);
~AccountSettings();
void setFolderList( const Folder::Map& );
void buttonsSetEnabled();
signals:
void folderChanged();
void openProgressDialog();
void openFolderAlias( const QString& );
void infoFolderAlias( const QString& );
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 slotUpdateQuota( qint64,qint64 );
void slotIgnoreFilesEditor();
void setGeneralErrors( const QStringList& errors );
protected slots:
void slotAddFolder();
void slotAddFolder( Folder* );
void slotEnableCurrentFolder();
void slotRemoveCurrentFolder();
void slotInfoAboutCurrentFolder();
void slotResetCurrentFolder();
void slotFolderWizardAccepted();
void slotFolderWizardRejected();
void slotOpenAccountWizard();
void slotHideProgress();
private:
QString shortenFilename( const QString& folder, const QString& file ) const;
void folderToModelItem( QStandardItem *, Folder * );
QStandardItem* itemForFolder(const QString& );
void showConnectionLabel( const QString& message, const QString& tooltip = QString() );
Ui::AccountSettings *ui;
QPointer<ItemProgressDialog> _fileItemDialog;
QPointer<IgnoreListEditor> _ignoreEditor;
QStandardItemModel *_model;
QUrl _OCUrl;
QHash<QStandardItem*, QTimer*> _hideProgressTimers;
QString _kindContext;
QStringList _generalErrors;
};
} // namespace Mirall
#endif // ACCOUNTSETTINGS_H

View File

@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Mirall::AccountSettings</class>
<widget class="QWidget" name="Mirall::AccountSettings">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>607</width>
<height>382</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="1">
<widget class="QGroupBox" name="maintenanceGroupBox">
<property name="title">
<string>Account Maintenance</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QPushButton" name="ignoredFilesButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Edit Ignored Files</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="modifyAccountButton">
<property name="text">
<string>Modify Account</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QGroupBox" name="syncStatusGroupBox">
<property name="title">
<string>Sync Status</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="connectLabel">
<property name="text">
<string>Connected with &lt;server&gt; as &lt;user&gt;</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QListView" name="_folderList"/>
</item>
<item row="1" column="1">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QPushButton" name="_ButtonAdd">
<property name="text">
<string>Add Folder...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="_ButtonEnable">
<property name="text">
<string>Pause</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="_ButtonRemove">
<property name="text">
<string>Remove</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="_ButtonInfo">
<property name="text">
<string>Info...</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="storageGroupBox">
<property name="title">
<string>Storage Usage</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QProgressBar" name="quotaProgressBar">
<property name="enabled">
<bool>false</bool>
</property>
<property name="maximum">
<number>0</number>
</property>
<property name="value">
<number>-1</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="quotaLabel">
<property name="text">
<string>Retrieving usage information...</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="quotaInfoLabel">
<property name="text">
<string>&lt;b&gt;Note:&lt;/b&gt; Some folders, including network mounted or shared folders, might have different limits.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

File diff suppressed because it is too large Load Diff

View File

@@ -16,17 +16,18 @@
#define APPLICATION_H
#include <QApplication>
#include <QSystemTrayIcon>
#include <QNetworkReply>
#include <QSslError>
#include <QPointer>
#include <QQueue>
#include "qtsingleapplication.h"
#include "mirall/syncresult.h"
#include "mirall/folder.h"
#include "mirall/logbrowser.h"
#include "mirall/folderman.h"
#include "mirall/fileitemdialog.h"
#include "mirall/systray.h"
#include "mirall/connectionvalidator.h"
#include "mirall/progressdispatcher.h"
class QAction;
class QMenu;
@@ -37,13 +38,12 @@ class QNetworkReply;
namespace Mirall {
class Theme;
class Folder;
class FolderWatcher;
class FolderWizard;
class StatusDialog;
class OwncloudSetupWizard;
class ownCloudInfo;
class SslErrorDialog;
class UpdateDetector;
class SettingsDialog;
class ItemProgressDialog;
class Application : public SharedTools::QtSingleApplication
{
@@ -55,84 +55,93 @@ public:
bool giveHelp();
void showHelp();
signals:
protected slots:
void slotAddFolder();
void slotOpenStatus();
void slotRemoveFolder( const QString& );
void slotEnableFolder( const QString&, const bool );
void slotInfoFolder( const QString& );
void slotConfigure();
void slotConfigureProxy();
void slotParseOptions( const QString& );
void slotShowTrayMessage(const QString&, const QString&);
void slotSyncStateChange( const QString& );
public slots:
// TODO: this should not be public
void slotownCloudWizardDone(int);
protected:
protected:
void parseOptions(const QStringList& );
void setupTranslations();
void setupActions();
void setupSystemTray();
void setupContextMenu();
void setupLogBrowser();
void setupProxy();
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 );
#endif
signals:
void folderRemoved();
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 slotStartFolderSetup(int result = QDialog::Accepted); // defaulting to Accepted
void slotOwnCloudFound( const QString&, const QString&, const QString&, const QString& );
void slotNoOwnCloudFound( QNetworkReply* );
void slotCheckAuthentication();
void slotAuthCheck( const QString& ,QNetworkReply* );
void slotOpenLogBrowser();
void slotAbout();
void slotSSLFailed( QNetworkReply *reply, QList<QSslError> errors );
void slotFetchCredentials();
void slotCredentialsFetched( bool );
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 slotCleanup();
private:
void setHelp();
void raiseDialog( QWidget* );
void rebuildRecentMenus();
void runValidator();
// configuration file -> folder
QSystemTrayIcon *_tray;
QAction *_actionQuit;
QAction *_actionAddFolder;
QAction *_actionOpenStatus;
QAction *_actionConfigure;
QPointer<Systray> _tray;
QAction *_actionOpenoC;
QAction *_actionConfigureProxy;
QAction *_actionAbout;
QAction *_actionSettings;
QAction *_actionQuota;
QAction *_actionStatus;
QAction *_actionRecent;
QAction *_actionHelp;
QAction *_actionQuit;
#if QT_VERSION >= 0x040700
QNetworkConfigurationManager *_networkMgr;
#endif
FolderWizard *_folderWizard;
OwncloudSetupWizard *_owncloudSetupWizard;
SslErrorDialog *_sslErrorDialog;
ConnectionValidator *_conValidator;
// tray's menu
QMenu *_contextMenu;
StatusDialog *_statusDialog;
FileItemDialog *_fileItemDialog;
QMenu *_recentActionsMenu;
FolderMan *_folderMan;
Theme *_theme;
QSignalMapper *_folderOpenActionMapper;
UpdateDetector *_updateDetector;
QMap<QString, QString> _overallStatusStrings;
LogBrowser *_logBrowser;
QPointer<LogBrowser>_logBrowser;
QPointer<SettingsDialog> _settingsDialog;
QPointer<ItemProgressDialog> _progressDialog;
QString _logFile;
QString _logDirectory;
QStringList _startupFail;
int _logExpire;
bool _showLogWindow;
bool _logFlush;
bool _helpOnly;

View File

@@ -0,0 +1,169 @@
/*
* 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 <QtCore>
#include "mirall/connectionvalidator.h"
#include "mirall/owncloudinfo.h"
#include "mirall/mirallconfigfile.h"
#include "mirall/theme.h"
namespace Mirall {
ConnectionValidator::ConnectionValidator(QObject *parent) :
QObject(parent)
{
}
ConnectionValidator::ConnectionValidator(const QString& connection, QObject *parent)
: QObject(parent),
_connection(connection)
{
ownCloudInfo::instance()->setCustomConfigHandle(_connection);
}
QStringList ConnectionValidator::errors() const
{
return _errors;
}
QString ConnectionValidator::statusString( Status stat ) const
{
QString re;
switch( stat ) {
case Undefined:
re = QLatin1String("Undefined");
break;
case Connected:
re = QLatin1String("Connected");
break;
case NotConfigured:
re = QLatin1String("NotConfigured");
break;
case ServerVersionMismatch:
re = QLatin1String("Server Version Mismatch");
break;
case CredentialsTooManyAttempts:
re = QLatin1String("Credentials Too Many Attempts");
break;
case CredentialError:
re = QLatin1String("CredentialError");
break;
case CredentialsUserCanceled:
re = QLatin1String("Credential User Canceled");
break;
case CredentialsWrong:
re = QLatin1String("Credentials Wrong");
break;
case StatusNotFound:
re = QLatin1String("Status not found");
break;
default:
re = QLatin1String("status undeclared.");
}
return re;
}
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();
} else {
_errors << tr("No ownCloud connection configured");
emit connectionResult( NotConfigured );
}
}
void ConnectionValidator::slotStatusFound( const QString& url, const QString& versionStr, const QString& version, const QString& /*edition*/)
{
// status.php was found.
qDebug() << "** Application: ownCloud found: " << url << " with version " << versionStr << "(" << version << ")";
// 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") ) {
_errors.append( tr("The configured server for this client is too old") );
_errors.append( tr("Please update to the latest server and restart the client.") );
emit connectionResult( ServerVersionMismatch );
return;
}
QTimer::singleShot( 0, this, SLOT( slotCheckAuthentication() ));
}
// 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*)));
_errors.append( reply->errorString() );
emit connectionResult( StatusNotFound );
}
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 :-)
}
void ConnectionValidator::slotAuthCheck( const QString&, QNetworkReply *reply )
{
Status stat = Connected;
if( reply->error() == QNetworkReply::AuthenticationRequiredError ||
reply->error() == QNetworkReply::OperationCanceledError ) { // returned if the user is wrong.
qDebug() << "******** Password is wrong!";
_errors << tr("The provided credentials are not correct");
stat = CredentialsWrong;
} 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 );
}
}

View File

@@ -0,0 +1,71 @@
/*
* 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 CONNECTIONVALIDATOR_H
#define CONNECTIONVALIDATOR_H
#include <QObject>
#include <QStringList>
class QNetworkReply;
namespace Mirall {
class ConnectionValidator : public QObject
{
Q_OBJECT
public:
explicit ConnectionValidator(QObject *parent = 0);
explicit ConnectionValidator(const QString& connection, QObject *parent = 0);
enum Status {
Undefined,
Connected,
NotConfigured,
ServerVersionMismatch,
CredentialsTooManyAttempts,
CredentialError,
CredentialsUserCanceled,
CredentialsWrong,
StatusNotFound
};
QStringList errors() const;
void checkConnection();
QString statusString( Status ) const;
signals:
void connectionResult( ConnectionValidator::Status );
// void connectionAvailable();
// void connectionFailed();
public slots:
protected slots:
void slotStatusFound( const QString&, const QString&, const QString&, const QString& );
void slotNoStatusFound(QNetworkReply *);
void slotCheckAuthentication();
void slotAuthCheck( const QString& ,QNetworkReply * );
private:
QStringList _errors;
QString _connection;
};
}
#endif // CONNECTIONVALIDATOR_H

View File

@@ -1,213 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CreateAnOwncloudPage</class>
<widget class="QWidget" name="CreateAnOwncloudPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>539</width>
<height>346</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_12">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../mirall.qrc">:/mirall/resources/mirall-32.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Create a new ownCloud</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_17">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Where do you want to create your ownCloud?</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="3">
<widget class="QRadioButton" name="createLocalRadioBtn">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>create ownCloud on this computer</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>22</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1" colspan="2">
<widget class="QLabel" name="label_2">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#585858;&quot;&gt;installs the ownCloud on this computer. Other people will not be able to access your data by default.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::AutoText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<widget class="QRadioButton" name="createPerFTPRadioBtn">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<underline>false</underline>
</font>
</property>
<property name="text">
<string>create ownCloud on my internet domain</string>
</property>
</widget>
</item>
<item row="3" column="0">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>22</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1" colspan="2">
<widget class="QLabel" name="label_4">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#585858;&quot;&gt;installs ownCloud on a domain you control. You need the FTP credentials for the installation.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; color:#585858;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#585858;&quot;&gt;This ownCloud will be accessible from the internet.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::AutoText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label">
<property name="text">
<string>&amp;Domain:</string>
</property>
<property name="buddy">
<cstring>myDomainEdit</cstring>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QLineEdit" name="myDomainEdit">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>388</width>
<height>72</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources>
<include location="../../mirall.qrc"/>
</resources>
<connections/>
</ui>

View File

@@ -1,104 +0,0 @@
/*
* Copyright (C) by Duncan Mac-Vicar P. <duncan@kde.org>
*
* 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; either version 2 of the License, or
* (at your option) any later version.
*
* 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/csyncfolder.h"
#include "mirall/csyncthread.h"
#include "mirall/mirallconfigfile.h"
#include <csync.h>
#include <QDebug>
#include <QDir>
#include <QMutexLocker>
#include <QThread>
#include <QStringList>
#include <QTextStream>
namespace Mirall {
CSyncFolder::CSyncFolder(const QString &alias,
const QString &path,
const QString &secondPath,
QObject *parent)
: Folder(alias, path, secondPath, parent)
, _csync(0)
, _thread(0)
, _csyncError(false)
{
}
CSyncFolder::~CSyncFolder()
{
}
bool CSyncFolder::isBusy() const
{
return (_csync && _thread && _thread->isRunning() );
}
void CSyncFolder::startSync(const QStringList &pathList)
{
if (_thread && _thread->isRunning()) {
qCritical() << "* ERROR csync is still running and new sync requested.";
return;
}
delete _csync;
delete _thread;
_errors.clear();
_csyncError = false;
_syncResult.setStatus( SyncResult::SyncRunning );
emit syncStateChange();
_thread = new QThread(this);
_csync = new CSyncThread( path(), secondPath() );
connect(_csync, SIGNAL(started()), SLOT(slotCSyncStarted()), Qt::QueuedConnection);
connect(_csync, SIGNAL(finished()), SLOT(slotCSyncFinished()), Qt::QueuedConnection);
connect(_csync, SIGNAL(csyncError(QString)), SLOT(slotCSyncError(QString)), Qt::QueuedConnection);
_csync->moveToThread(_thread);
_thread->start();
QMetaObject::invokeMethod(_csync, "startSync", Qt::QueuedConnection);
}
void CSyncFolder::slotTerminateSync()
{
if( _thread ) {
_thread->terminate();
}
}
void CSyncFolder::slotCSyncStarted()
{
qDebug() << " * csync thread started";
emit syncStarted();
}
void CSyncFolder::slotCSyncFinished()
{
SyncResult res(SyncResult::Success);
if( _csyncError ) {
res.setStatus( SyncResult::Error );
res.setErrorString( _errors.join(QLatin1String("\n")));
}
emit syncFinished( res );
}
void CSyncFolder::slotCSyncError( const QString& errorStr )
{
_errors.append( errorStr );
_csyncError = true;
}
} // ns

View File

@@ -17,8 +17,8 @@
#include "mirall/mirallconfigfile.h"
#include "mirall/theme.h"
#include "mirall/logger.h"
#include "mirall/utility.h"
#include "mirall/owncloudinfo.h"
#include "creds/abstractcredentials.h"
#ifdef Q_OS_WIN
#include <windows.h>
@@ -43,30 +43,14 @@
namespace Mirall {
/* static variables to hold the credentials */
QString CSyncThread::_user;
QString CSyncThread::_passwd;
QNetworkProxy CSyncThread::_proxy;
QString CSyncThread::_csyncConfigDir; // to be able to remove the lock file.
QMutex CSyncThread::_mutex;
QMutex CSyncThread::_syncMutex;
void csyncLogCatcher(CSYNC *ctx,
int verbosity,
const char *function,
const char *buffer,
void *userdata)
{
Logger::instance()->csyncLog( QString::fromUtf8(buffer) );
}
CSyncThread::CSyncThread(const QString &source, const QString &target)
: _source(source)
, _target(target)
CSyncThread::CSyncThread(CSYNC *csync)
{
_mutex.lock();
if( ! _source.endsWith(QLatin1Char('/'))) _source.append(QLatin1Char('/'));
_csync_ctx = csync;
_mutex.unlock();
}
@@ -75,6 +59,8 @@ 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 errStr;
@@ -122,9 +108,7 @@ QString CSyncThread::csyncErrorToString( CSYNC_ERROR_CODE err, const char *errSt
errStr = tr("CSync processing step propagate failed.");
break;
case CSYNC_ERR_ACCESS_FAILED:
errStr = tr("<p>The target directory %1 does not exist.</p><p>Please check the sync setup.</p>").arg(_target);
// this is critical. The database has to be removed.
emit wipeDb();
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:
@@ -156,19 +140,19 @@ QString CSyncThread::csyncErrorToString( CSYNC_ERROR_CODE err, const char *errSt
errStr = tr("A HTTP transmission error happened.");
break;
case CSYNC_ERR_PERM:
errStr = tr("CSync failed due to not handled permission deniend.");
errStr = tr("CSync: Permission deniend.");
break;
case CSYNC_ERR_NOT_FOUND:
errStr = tr("CSync failed to find a specific file.");
errStr = tr("CSync: File not found.");
break;
case CSYNC_ERR_EXISTS:
errStr = tr("CSync tried to create a directory that already exists.");
errStr = tr("CSync: Directory already exists.");
break;
case CSYNC_ERR_NOSPC:
errStr = tr("CSync: No space on %1 server available.").arg(Theme::instance()->appNameGUI());
errStr = tr("CSync: No space left on %1 server.").arg(Theme::instance()->appNameGUI());
break;
case CSYNC_ERR_UNSPEC:
errStr = tr("CSync unspecified error.");
errStr = tr("CSync: unspecified error.");
default:
errStr = tr("An internal error number %1 happend.").arg( (int) err );
@@ -181,26 +165,6 @@ QString CSyncThread::csyncErrorToString( CSYNC_ERROR_CODE err, const char *errSt
}
const char* CSyncThread::proxyTypeToCStr(QNetworkProxy::ProxyType type)
{
switch (type) {
case QNetworkProxy::NoProxy:
return "NoProxy";
case QNetworkProxy::DefaultProxy:
return "DefaultProxy";
case QNetworkProxy::Socks5Proxy:
return "Socks5Proxy";
case QNetworkProxy::HttpProxy:
return "HttpProxy";
case QNetworkProxy::HttpCachingProxy:
return "HttpCachingProxy";
case QNetworkProxy::FtpCachingProxy:
return "FtpCachingProxy";
default:
return "NoProxy";
}
}
int CSyncThread::treewalkLocal( TREE_WALK_FILE* file, void *data )
{
return static_cast<CSyncThread*>(data)->treewalkFile( file, false );
@@ -223,11 +187,18 @@ int CSyncThread::treewalkFile( TREE_WALK_FILE *file, bool remote )
item._file = QString::fromUtf8( file->path );
item._instruction = file->instruction;
item._dir = SyncFileItem::None;
if(file->error_string) {
item._errorString = QString::fromUtf8(file->error_string);
}
SyncFileItem::Direction dir;
int re = 0;
if (file->instruction != CSYNC_INSTRUCTION_IGNORE
&& file->instruction != CSYNC_INSTRUCTION_REMOVE) {
_hasFiles = true;
}
switch(file->instruction) {
case CSYNC_INSTRUCTION_NONE:
case CSYNC_INSTRUCTION_IGNORE:
@@ -264,6 +235,20 @@ int CSyncThread::treewalkFile( TREE_WALK_FILE *file, bool remote )
break;
}
switch( file->type ) {
case CSYNC_FTW_TYPE_DIR:
item._type = SyncFileItem::Directory;
break;
case CSYNC_FTW_TYPE_FILE:
item._type = SyncFileItem::File;
break;
case CSYNC_FTW_TYPE_SLINK:
item._type = SyncFileItem::SoftLink;
break;
default:
item._type = SyncFileItem::UnknownType;
}
item._dir = dir;
_mutex.lock();
_syncedItems.append(item);
@@ -274,7 +259,7 @@ int CSyncThread::treewalkFile( TREE_WALK_FILE *file, bool remote )
int CSyncThread::treewalkError(TREE_WALK_FILE* file)
{
SyncFileItem item;
SyncFileItem item; // only used for search.
item._file= QString::fromUtf8(file->path);
int indx = _syncedItems.indexOf(item);
@@ -282,10 +267,11 @@ int CSyncThread::treewalkError(TREE_WALK_FILE* file)
return 0;
if( file &&
file->instruction == CSYNC_INSTRUCTION_STAT_ERROR ||
file->instruction == CSYNC_INSTRUCTION_ERROR ) {
(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();
}
@@ -293,20 +279,21 @@ int CSyncThread::treewalkError(TREE_WALK_FILE* file)
}
struct CSyncRunScopeHelper {
CSyncRunScopeHelper(CSYNC *_ctx, CSyncThread *_parent)
: ctx(_ctx), parent(_parent)
CSyncRunScopeHelper(CSYNC *ctx, CSyncThread *parent)
: _ctx(ctx), _parent(parent)
{
t.start();
_t.start();
}
~CSyncRunScopeHelper() {
csync_destroy(ctx);
csync_commit(_ctx);
qDebug() << "CSync run took " << t.elapsed() << " Milliseconds";
emit(parent->finished());
qDebug() << "CSync run took " << _t.elapsed() << " Milliseconds";
emit(_parent->finished());
_parent->_syncMutex.unlock();
}
CSYNC *ctx;
QTime t;
CSyncThread *parent;
CSYNC *_ctx;
QTime _t;
CSyncThread *_parent;
};
void CSyncThread::handleSyncError(CSYNC *ctx, const char *state) {
@@ -326,194 +313,195 @@ void CSyncThread::handleSyncError(CSYNC *ctx, const char *state) {
void CSyncThread::startSync()
{
if (!_syncMutex.tryLock()) {
qDebug() << Q_FUNC_INFO << "WARNING: Another sync seems to be running. Not starting a new one.";
return;
}
if( ! _csync_ctx ) {
qDebug() << "XXXXXXXXXXXXXXXX FAIL: do not have csync_ctx!";
}
qDebug() << Q_FUNC_INFO << "Sync started";
static int syncsRunning = 0;
syncsRunning++;
assert(syncsRunning == 1);
qDebug() << "starting to sync " << qApp->thread() << QThread::currentThread();
CSYNC *csync;
int proxyPort = _proxy.port();
_mutex.lock();
_syncedItems.clear();
_needsUpdate = false;
_mutex.unlock();
if( csync_create(&csync,
_source.toUtf8().data(),
_target.toUtf8().data()) < 0 ) {
emit csyncError( tr("CSync create failed.") );
}
MirallConfigFile cfg;
csync_set_config_dir( csync, cfg.configPath().toUtf8() );
_mutex.lock();
_csyncConfigDir = cfg.configPath();
_mutex.unlock();
csync_enable_conflictcopys(csync);
QString excludeList = cfg.excludeFile();
if( !excludeList.isEmpty() ) {
qDebug() << "==== added CSync exclude List: " << excludeList.toUtf8();
csync_add_exclude_list( csync, excludeList.toUtf8() );
}
// cleans up behind us and emits finished() to ease error handling
CSyncRunScopeHelper helper(csync, this);
CSyncRunScopeHelper helper(_csync_ctx, this);
csync_set_userdata(csync, this);
// maybe move this somewhere else where it can influence a running sync?
MirallConfigFile cfg;
csync_set_log_callback( csync, csyncLogCatcher );
csync_set_auth_callback( csync, getauth );
csync_set_progress_callback( csync, progress );
if( csync_init(csync) < 0 ) {
handleSyncError(csync, "csync_init");
return;
int downloadLimit = 0;
if (cfg.useDownloadLimit()) {
downloadLimit = cfg.downloadLimit() * 1000;
}
csync_set_module_property(_csync_ctx, "bandwidth_limit_download", &downloadLimit);
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);
csync_set_progress_callback( _csync_ctx, cb_progress );
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 (_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.
// QString cookiesAsString;
// foreach(QNetworkCookie c, _lastAuthCookies) {
// cookiesAsString += c.name();
// cookiesAsString += '=';
// cookiesAsString += c.value();
// cookiesAsString += "; ";
// }
// csync_set_module_property(_csync_ctx, "session_key", cookiesAsString.to
// }
// csync_set_auth_callback( _csync_ctx, getauth );
// set module properties, mainly the proxy information.
// do not use QLatin1String here because that has to be real const char* for C.
csync_set_log_verbosity(csync, 11);
csync_set_module_property(csync, "csync_context", csync);
csync_set_module_property(csync, "proxy_type", (char*) proxyTypeToCStr(_proxy.type()) );
csync_set_module_property(csync, "proxy_host", _proxy.hostName().toUtf8().data() );
csync_set_module_property(csync, "proxy_port", &proxyPort );
csync_set_module_property(csync, "proxy_user", _proxy.user().toUtf8().data() );
csync_set_module_property(csync, "proxy_pwd" , _proxy.password().toUtf8().data() );
qDebug() << "#### Update start #################################################### >>";
if( csync_update(csync) < 0 ) {
handleSyncError(csync, "csync_update");
if( csync_update(_csync_ctx) < 0 ) {
handleSyncError(_csync_ctx, "csync_update");
return;
}
qDebug() << "<<#### Update end ###########################################################";
if( csync_reconcile(csync) < 0 ) {
handleSyncError(csync, "cysnc_reconcile");
if( csync_reconcile(_csync_ctx) < 0 ) {
handleSyncError(_csync_ctx, "csync_reconcile");
return;
}
_hasFiles = false;
bool walkOk = true;
if( csync_walk_local_tree(csync, &treewalkLocal, 0) < 0 ) {
if( csync_walk_local_tree(_csync_ctx, &treewalkLocal, 0) < 0 ) {
qDebug() << "Error in local treewalk.";
walkOk = false;
}
if( walkOk && csync_walk_remote_tree(csync, &treewalkRemote, 0) < 0 ) {
if( walkOk && csync_walk_remote_tree(_csync_ctx, &treewalkRemote, 0) < 0 ) {
qDebug() << "Error in remote treewalk.";
}
if (!_hasFiles && !_syncedItems.isEmpty()) {
qDebug() << Q_FUNC_INFO << "All the files are going to be removed, asking the user";
bool cancel = true;
emit aboutToRemoveAllFiles(_syncedItems.first()._dir, &cancel);
if (cancel) {
qDebug() << Q_FUNC_INFO << "Abort sync";
return;
}
}
if (_needsUpdate)
emit(started());
if( csync_propagate(csync) < 0 ) {
handleSyncError(csync, "cysnc_reconcile");
if( csync_propagate(_csync_ctx) < 0 ) {
handleSyncError(_csync_ctx, "cysnc_reconcile");
return;
}
if( walkOk ) {
if( csync_walk_local_tree(csync, &walkFinalize, 0) < 0 ||
csync_walk_remote_tree( csync, &walkFinalize, 0 ) < 0 ) {
qDebug() << "Error in finalize treewalk.";
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);
}
}
syncsRunning--;
qDebug() << Q_FUNC_INFO << "Sync finished";
}
void CSyncThread::setConnectionDetails( const QString &user, const QString &passwd, const QNetworkProxy &proxy )
Progress::Kind CSyncThread::csyncToProgressKind( enum csync_notify_type_e kind )
{
_mutex.lock();
_user = user;
_passwd = passwd;
_proxy = proxy;
_mutex.unlock();
}
Progress::Kind pKind = Progress::Invalid;
QString CSyncThread::csyncConfigDir()
{
return _csyncConfigDir;
}
int CSyncThread::getauth(const char *prompt,
char *buf,
size_t len,
int echo,
int verify,
void *userdata
)
{
int re = 0;
QString qPrompt = QString::fromLatin1( prompt ).trimmed();
if( qPrompt == QLatin1String("Enter your username:") ) {
// qDebug() << "OOO Username requested!";
QMutexLocker locker( &_mutex );
qstrncpy( buf, _user.toUtf8().constData(), len );
} else if( qPrompt == QLatin1String("Enter your password:") ) {
QMutexLocker locker( &_mutex );
// qDebug() << "OOO Password requested!";
qstrncpy( buf, _passwd.toUtf8().constData(), len );
} else {
if( qPrompt.startsWith( QLatin1String("There are problems with the SSL certificate:"))) {
// SSL is requested. If the program came here, the SSL check was done by mirall
// It needs to be checked if the chain is still equal to the one which
// was verified by the user.
QRegExp regexp("fingerprint: ([\\w\\d:]+)");
bool certOk = false;
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();
while (!certOk && (pos = regexp.indexIn(qPrompt, 1+pos)) != -1) {
QString neon_fingerprint = regexp.cap(1);
foreach( const QSslCertificate& c, certs ) {
QString verified_shasum = Utility::formatFingerprint(c.digest(QCryptographicHash::Sha1).toHex());
qDebug() << "SSL Fingerprint from neon: " << neon_fingerprint << " compared to verified: " << verified_shasum;
if( verified_shasum == neon_fingerprint ) {
certOk = true;
break;
}
}
}
// certOk = false; DEBUG setting, keep disabled!
if( !certOk ) { // Problem!
qstrcpy( buf, "no" );
re = -1;
} else {
qstrcpy( buf, "yes" ); // Certificate is fine!
}
} else {
qDebug() << "Unknown prompt: <" << prompt << ">";
re = -1;
}
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 re;
return pKind;
}
void CSyncThread::progress(const char *remote_url, enum csync_notify_type_e kind,
long long o1, long long o2, void *userdata)
void CSyncThread::cb_progress( CSYNC_PROGRESS *progress, void *userdata )
{
(void) o1; (void) o2;
if (kind == CSYNC_NOTIFY_FINISHED_DOWNLOAD) {
QString path = QUrl::fromEncoded(remote_url).toString();
CSyncThread *thread = static_cast<CSyncThread*>(userdata);
thread->fileReceived(path);
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

View File

@@ -22,10 +22,12 @@
#include <QThread>
#include <QString>
#include <QNetworkProxy>
#include <QNetworkCookie>
#include <csync.h>
#include "mirall/syncfileitem.h"
#include "mirall/progressdispatcher.h"
class QProcess;
@@ -35,14 +37,10 @@ class CSyncThread : public QObject
{
Q_OBJECT
public:
CSyncThread(const QString &source, const QString &target);
CSyncThread(CSYNC *);
~CSyncThread();
static void setConnectionDetails( const QString&, const QString&, const QNetworkProxy& );
static QString csyncConfigDir();
const char* proxyTypeToCStr(QNetworkProxy::ProxyType);
QString csyncErrorToString( CSYNC_ERROR_CODE, const char * );
static QString csyncErrorToString( CSYNC_ERROR_CODE, const char * );
Q_INVOKABLE void startSync();
@@ -54,48 +52,40 @@ signals:
void csyncUnavailable();
void treeWalkResult(const SyncFileItemVector&);
void transmissionProgress( const Progress::Info& progress );
void csyncStateDbFile( const QString& );
void wipeDb();
void finished();
void started();
void aboutToRemoveAllFiles(SyncFileItem::Direction direction, bool *cancel);
private:
void handleSyncError(CSYNC *ctx, const char *state);
static void progress(const char *remote_url,
enum csync_notify_type_e kind,
long long o1, long long o2,
void *userdata);
static void cb_progress( CSYNC_PROGRESS *progress, void *userdata );
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* );
static int getauth(const char *prompt,
char *buf,
size_t len,
int echo,
int verify,
void *userdata
);
static QMutex _mutex;
static QString _user;
static QString _passwd;
static QNetworkProxy _proxy;
static QString _csyncConfigDir;
static QMutex _syncMutex;
SyncFileItemVector _syncedItems;
QString _source;
QString _target;
CSYNC *_csync_ctx;
bool _needsUpdate;
friend class CSyncRunScopeHelper;
bool _hasFiles; // true if there is at least one file that is not ignored or removed
friend struct CSyncRunScopeHelper;
};
}

View File

@@ -1,295 +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/fileitemdialog.h"
#include "mirall/theme.h"
#include "mirall/syncresult.h"
#define TYPE_SUCCESS 1
#define TYPE_CONFLICT 2
#define TYPE_NEW 3
#define TYPE_DELETED 4
#define TYPE_ERROR 5
#define TYPE_RENAME 6
#define TYPE_IGNORE 7
#define FILE_TYPE 100
namespace Mirall {
FileItemDialog::FileItemDialog(Theme *theme, QWidget *parent) :
QDialog(parent),
_theme(theme)
{
setupUi(this);
connect(_dialogButtonBox->button(QDialogButtonBox::Close), SIGNAL(clicked()),
this, SLOT(accept()));
QStringList header;
header << tr("Files");
QString firstColString = tr("File Count");
header << firstColString;
_treeWidget->setHeaderLabels( header );
_treeWidget->setColumnWidth(0, 480);
_timer.setInterval(1000);
connect(&_timer, SIGNAL(timeout()), this, SLOT(slotSetFolderMessage()));
QPushButton *copyBtn = _dialogButtonBox->addButton(tr("Copy"), QDialogButtonBox::ActionRole);
connect(copyBtn, SIGNAL(clicked()), SLOT(copyToClipboard()));
setWindowTitle(tr("Sync Protocol"));
}
void FileItemDialog::setSyncResult( const SyncResult& result )
{
QString folderMessage;
SyncResult::Status syncStatus = result.status();
switch( syncStatus ) {
case SyncResult::Undefined:
folderMessage = tr( "Undefined Folder State" );
break;
case SyncResult::NotYetStarted:
folderMessage = tr( "The folder waits to start syncing." );
break;
case SyncResult::Unavailable:
folderMessage = tr( "Server is currently not available." );
break;
case SyncResult::SyncRunning:
folderMessage = tr("Sync is running.");
break;
case SyncResult::Success:
folderMessage = tr("Last Sync was successful.");
break;
case SyncResult::Error:
folderMessage = tr( "Syncing Error." );
break;
case SyncResult::SetupError:
folderMessage = tr( "Setup Error." );
break;
default:
folderMessage = tr( "Undefined Error State." );
}
_folderMessage = folderMessage;
_lastSyncTime = result.syncTime();
if( result.errorStrings().count() ) {
_errorLabel->setVisible(true);
_errorLabel->setTextFormat(Qt::RichText);
QString errStr;
foreach( QString err, result.errorStrings() ) {
errStr.append(QString("<p>%1</p>").arg(err));
}
_errorLabel->setText(errStr);
} else {
_errorLabel->setText(QString::null);
_errorLabel->setVisible(false);
}
slotSetFolderMessage();
if( syncStatus == SyncResult::SyncRunning ) {
_timer.stop();
} else {
_timer.start();
}
setSyncFileItems( result.syncFileItemVector() );
}
void FileItemDialog::slotSetFolderMessage()
{
QDateTime now = QDateTime::currentDateTime();
int secs = _lastSyncTime.secsTo(now);
_timelabel->setText(tr("%1 (finished %2 sec. ago)").arg(_folderMessage).arg(secs));
}
void FileItemDialog::copyToClipboard()
{
QString text;
QTextStream ts(&text);
int topLevelItems = _treeWidget->topLevelItemCount();
for (int i = 0; i < topLevelItems; i++) {
QTreeWidgetItem *item = _treeWidget->topLevelItem(i);
ts << left << qSetFieldWidth(50)
<< item->data(0, Qt::DisplayRole).toString()
<< right << qSetFieldWidth(6)
<< item->data(1, Qt::DisplayRole).toString()
<< endl;
int childItems = item->childCount();
for (int j = 0; j < childItems; j++) {
QTreeWidgetItem *child =item->child(j);
ts << left << qSetFieldWidth(0) << QLatin1String(" ")
<< child->data(0,Qt::DisplayRole).toString()
<< QString::fromLatin1(" (%1)").arg(
child->data(1, Qt::DisplayRole).toString()
)
<< endl;
}
}
QApplication::clipboard()->setText(text);
}
void FileItemDialog::accept()
{
_timer.stop();
QDialog::accept();
}
void FileItemDialog::setSyncFileItems( const SyncFileItemVector& list )
{
_treeWidget->clear();
QStringList strings;
QFont headerFont;
headerFont.setWeight(QFont::Bold);
strings.clear();
strings.append(tr("Synced Files"));
_syncedFileItem = new QTreeWidgetItem( _treeWidget, strings, TYPE_SUCCESS );
_syncedFileItem->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless);
_treeWidget->addTopLevelItem(_syncedFileItem);
strings.clear();
strings.append(tr("New Files"));
_newFileItem = new QTreeWidgetItem( _treeWidget, strings, TYPE_NEW );
_newFileItem->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless);
_treeWidget->addTopLevelItem(_newFileItem);
strings.clear();
strings.append(tr("Deleted Files"));
_deletedFileItem = new QTreeWidgetItem( _treeWidget, strings, TYPE_DELETED );
_deletedFileItem->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless);
_treeWidget->addTopLevelItem(_deletedFileItem);
strings.clear();
strings.append(tr("Renamed Files"));
_renamedFileItem = new QTreeWidgetItem( _treeWidget, strings, TYPE_RENAME);
_renamedFileItem->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless);
_treeWidget->addTopLevelItem(_renamedFileItem);
strings.clear();
strings.append(tr("Ignored Files"));
_ignoredFileItem = new QTreeWidgetItem( _treeWidget, strings, TYPE_IGNORE);
_ignoredFileItem->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless);
_treeWidget->addTopLevelItem(_renamedFileItem);
strings.clear();
strings.append(tr("Errors"));
_errorFileItem = new QTreeWidgetItem( _treeWidget, strings, TYPE_ERROR );
_errorFileItem->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless);
_treeWidget->addTopLevelItem(_errorFileItem);
strings.clear();
strings.append(tr("Conflicts"));
_conflictFileItem = new QTreeWidgetItem( _treeWidget, strings, TYPE_CONFLICT);
_conflictFileItem->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless);
_treeWidget->addTopLevelItem(_conflictFileItem);
QList<QTreeWidgetItem*> syncedItems;
QList<QTreeWidgetItem*> renamedItems;
QList<QTreeWidgetItem*> newItems;
QList<QTreeWidgetItem*> deletedItems;
QList<QTreeWidgetItem*> ignoredItems;
QList<QTreeWidgetItem*> conflictItems;
QList<QTreeWidgetItem*> errorItems;
quint64 overall_files = 0;
foreach( SyncFileItem item, list ) {
overall_files++;
QString dir;
QStringList str( item._file );
if( item._dir == SyncFileItem::Up ) dir = tr("Up");
if( item._dir == SyncFileItem::Down ) dir = tr("Down");
str << dir;
switch( item._instruction ) {
case CSYNC_INSTRUCTION_NONE:
// do nothing.
break;
case CSYNC_INSTRUCTION_EVAL:
// should not happen
break;
case CSYNC_INSTRUCTION_REMOVE:
case CSYNC_INSTRUCTION_DELETED:
deletedItems.append( new QTreeWidgetItem(_deletedFileItem, str, FILE_TYPE) );
break;
case CSYNC_INSTRUCTION_RENAME:
renamedItems.append( new QTreeWidgetItem(_renamedFileItem, str, FILE_TYPE) );
break;
case CSYNC_INSTRUCTION_NEW:
newItems.append( new QTreeWidgetItem(_newFileItem, str, FILE_TYPE) );
break;
case CSYNC_INSTRUCTION_CONFLICT:
conflictItems.append( new QTreeWidgetItem(_conflictFileItem, str, FILE_TYPE) );
break;
case CSYNC_INSTRUCTION_IGNORE:
ignoredItems.append( new QTreeWidgetItem(_ignoredFileItem, str, FILE_TYPE) );
break;
case CSYNC_INSTRUCTION_SYNC:
case CSYNC_INSTRUCTION_UPDATED:
syncedItems.append( new QTreeWidgetItem(_syncedFileItem, str, FILE_TYPE) );
break;
case CSYNC_INSTRUCTION_STAT_ERROR:
case CSYNC_INSTRUCTION_ERROR:
errorItems.append( new QTreeWidgetItem(_errorFileItem, str, FILE_TYPE) );
break;
default:
break;
}
}
formatHeaderItem( _syncedFileItem, syncedItems );
formatHeaderItem( _newFileItem, newItems );
formatHeaderItem( _deletedFileItem, deletedItems );
formatHeaderItem( _renamedFileItem, renamedItems );
formatHeaderItem( _errorFileItem, errorItems );
formatHeaderItem( _conflictFileItem, conflictItems );
formatHeaderItem( _ignoredFileItem, ignoredItems );
}
void FileItemDialog::formatHeaderItem( QTreeWidgetItem *header, const QList<QTreeWidgetItem*>& list )
{
if( !header ) return;
header->addChildren( list );
int count = list.count();
#if LEAVE_THAT_TO_DESIGNERS
QColor col("#adc5d3");
header->setBackgroundColor(0, col);
header->setBackgroundColor(1, col);
#endif
header->setText(1, QString::number( count ));
if( count ) {
QFont font;
font.setWeight( QFont::Bold );
header->setFont(0, font);
header->setFont(1, font);
header->setExpanded(true);
} else {
header->setExpanded(false);
}
}
}

Some files were not shown because too many files have changed in this diff Show More