1
0
mirror of https://github.com/bpozdena/OneDriveGUI.git synced 2026-10-24 04:59:17 +03:00
Commit Graph

394 Commits

Author SHA1 Message Date
Boris Pozdena
b648d06b4e Point the desktop entry at the onedrive-gui entry point v2.4.0RC1 2026-10-22 11:27:48 +02:00
Boris Pozdena
d8ecf2705f Refactor MaintenanceWorker to improve handling of SharePoint site retrieval and login response; add filtering capability to combo boxes in SetupWizard. 2026-10-22 09:59:38 +02:00
Boris Pozdena
404beb16e4 Clean stale packaging output before building the AppImage wheel
The wheel-install step installs every *.whl in dist/. A wheel left over
from a previous build (with an older version baked into options.py) was
installed on top of the freshly built one, so the AppImage could carry a
mix of the new version in its filename and old code inside.
2026-10-18 18:42:24 +02:00
Boris Pozdena
ec8fef6518 Bump version to 2.4.0 2026-10-18 18:34:11 +02:00
Boris Pozdena
d56c7c7047 Skip dependency resolution when installing the wheel into the AppDir
pip resolves dependencies against the build container, not the AppDir
root, so the wheel install reinstalled PySide6_Essentials after the
pruning steps and grew the AppImage from ~58 MB to ~87 MB. Dependencies
are already installed from requirements.txt earlier in the recipe.
2026-10-18 11:22:58 +02:00
Boris Pozdena
f38f993bb5 Update README for v2.4.0
Feature list, known limitations and notes brought in line with the
current state: browser-based login, failed-transfers toggle, window
geometry, monitor-status.json based state on client v2.5.12+, graceful
client shutdown and takeover, invalid-name and Recycle Bin failure
reporting, and the new client options. Limitations updated for the
AppImage login situation and the Wayland window position caveat.

Additional notes now cover the one-time --resync after the removed
client options are dropped from the config, and the log note no longer
has an empty path - it names the configured file and both rotation
mechanisms.
2026-10-18 11:14:16 +02:00
Boris Pozdena
f35318d470 Document client compatibility for v2.4.0
The minimum supported OneDrive client stays v2.5.11 (needed for the
client-based browser login flow); the README now also states what the
GUI gains with client v2.5.12+ - monitor-status.json based state, the
new client options, Recycle Bin failure reporting and system clock
drift warnings - and that v2.5.11 keeps working without them.
2026-10-18 11:08:46 +02:00
Boris Pozdena
cdd4224c7e Cap the size of the GUI log file
With the default DEBUG level every line of client output is logged,
and a busy initial sync can grow the log by gigabytes per day. The
logs rotated by time only (default: every 24 hours, 3 backups), so a
single day of DEBUG logging could fill /tmp (or wherever the log file
points) before any rotation happened.

The log file now also rotates when it reaches the new "Max log file
size (MB)" setting (default 20 MB), so the total space used by the
current file and its backups is bounded to roughly
(backup count + 1) x max size.

Size-triggered rollovers rotate numbered backups (.1, .2, ...): the
time-based rollover refuses to run twice within one rotation interval
(the backup name already exists), which would leave the file growing
unbounded for the rest of the interval.
2026-10-18 11:08:29 +02:00
Boris Pozdena
0b298e8eea Allow timeout values above 99 seconds in profile settings
The Connect timeout and Data timeout spin boxes had no maximum set, so
they were capped at the QSpinBox default of 99 seconds. The default
Data timeout is 240 seconds, so opening the settings silently clamped
any existing value to 99, and a higher custom value could not be set at
all. Both spin boxes now accept up to 3600 seconds, like the Operation
timeout.
2026-10-18 11:04:21 +02:00
Boris Pozdena
40b0ffa41b Add skip_size, device authentication and permanent delete options
Three client options that were configurable only by editing the config
file are now available in profile settings, with tooltips from the
client documentation:

- "Skip files larger than (MB)" (Excluded files): skip_size. Changing
  it requires a resync, which the tooltip points out.
- "Use device authentication" (Sync Options > Advanced options):
  use_device_auth. Signs in with a device code instead of the browser
  flow - ideal for headless systems, but only supported for Work/School
  (Entra ID) accounts.
- "Permanent delete" (Sync Options > Advanced options):
  permanent_delete. Permanently removes items online instead of moving
  them to the OneDrive Recycle Bin, with the data-loss warning in the
  tooltip.

Defaults are added to the bundled default config, so nothing is written
to the client config until the user changes a value.
2026-10-18 11:04:02 +02:00
Boris Pozdena
ab64365aab Bundle libglib2.0-0 in the AppImage
Qt requires libgthread-2.0.so.0, which is provided by libglib2.0-0.
Some distributions (reported on openSUSE Leap 16) do not have it
installed system-wide, so the AppImage failed to start with
"libgthread-2.0.so.0: cannot open shared object file". An AppImage is
expected to carry all of its dependencies, so the package is now
included in the image.

Not verified with a full AppImage build; the package list change is
the same mechanism as the other bundled libraries.

Fixes #283
2026-10-18 11:02:23 +02:00
Boris Pozdena
d98a10ed90 Add browser sign-in to the login dialog
The login dialog now offers "Sign in with web browser" as the preferred
method: it restarts the profile's client with --reauth, which opens the
default browser and receives the OAuth response on a local loopback
listener (client v2.5.11+). Nothing has to be copied manually, and the
flow no longer depends on the nativeclient redirect that Microsoft
answers with the "This page is no longer available" (wrongplace) page.

The manual paste workflow stays as a fallback, with instructions
updated to explain how to recover the response URI from the browser
history or the network log when the wrongplace page appears.

The button is hidden on clients older than v2.5.11, which do not have
the loopback login flow.

Fixes #274
2026-10-18 11:02:04 +02:00
Boris Pozdena
a9636fcb13 Remember the window size and position between sessions
New setting "Remember window size and position" (enabled by default).
The main window geometry is saved when the window is hidden to the
tray, closed or when the application quits, and restored on the next
start instead of always opening at the default position.

The tooltip notes that on Wayland the compositor controls the position
and it may not be restored exactly.

Fixes #280
2026-10-18 11:00:24 +02:00
Boris Pozdena
f5a1efd4cc Fix and complete the tooltips of advanced sync options
The advanced sync options had either no tooltip at all (Force Session
Upload, Bypass data preservation, Delay inotify processing) or a wrong
one: Disable upload validation was described as disabling *download*
validation, and No remote delete had a confusing wording about "local
file 'deletes'".

All five tooltips now describe what the option does, based on the
current client documentation, including the cautions that belong to
them: Bypass data preservation can lead to data loss without a
recoverable safeBackup copy, and Delay inotify processing requires
Force Session Upload to be enabled as well.

Fixes #284
2026-10-18 10:59:23 +02:00
Boris Pozdena
7fc66cf93a Offer to take over an OneDrive client left running outside the GUI
The client refuses to start a second instance for the same
configuration directory, so when OneDriveGUI starts and a client for a
profile is already running (typically orphaned by a previous GUI
session that exited without stopping it, or started manually), the GUI
could not monitor the profile - the client failed with "The 'onedrive'
application is already running" or the GUI showed no status at all.

Before starting a monitor, OneDriveGUI now scans the process list for a
client using the profile's configuration directory. If one is found,
the user can stop it gracefully (SIGINT, killed after 10 s at the
latest) and start monitoring in the GUI, or keep the external client
and not start the monitor.

Together with the stop-on-exit option this closes the reconnect gap
after logouts and crashes.

Fixes #267
2026-10-18 10:58:18 +02:00
Boris Pozdena
56221241dd Add option to stop the OneDrive clients when OneDriveGUI exits
New setting "Stop OneDrive clients when OneDriveGUI exits" (enabled by
default). When it is on, every running client is asked to shut down
gracefully not only via the Quit dialog, but also when the application
exits for any other reason - in particular when the session ends: the
desktop environment's SIGTERM/SIGHUP to the GUI now triggers the same
graceful client shutdown instead of leaving orphaned clients behind.

When the setting is disabled, the clients keep running in the
background after OneDriveGUI exits; the next OneDriveGUI start offers
to reconnect to them.

Refs #267
2026-10-18 10:54:16 +02:00
Boris Pozdena
f9abbcf5c0 Stop the OneDrive client gracefully instead of killing it
stop_worker() killed the client process in a busy loop until it died.
A SIGKILL can interrupt an in-flight transfer, skips the database
checkpoint/vacuum and leaves monitor-status.json behind (the client
only removes it on an orderly shutdown).

The client is now asked to shut down with SIGINT, which lets it finish
in-flight operations, checkpoint its delta state, vacuum the database
and remove its status file. Only a client that does not exit within the
grace period (10 s) is killed.

Refs #267
2026-10-18 10:48:47 +02:00
Boris Pozdena
458c62529b List items skipped because of an invalid name as failed
The client never uploads items whose names are not valid on OneDrive
("Skipping item - invalid name (Microsoft Naming Convention): ./a:b",
also for invalid whitespace, HTML ASCII codes, invalid UTF-16 and
control codes), and it does not count them as failed, so the sync
result is "success" while the item is silently missing online.

Such items are now listed as failed entries in the file operation list
(behind the "N failed" toggle) with a tooltip naming the reason and
asking to rename the item.
2026-10-18 10:35:26 +02:00
Boris Pozdena
fc8c22204f Merge pull request #308 from nikolainyegaard/fix-version-check-retry
Retry version checks when the GUI starts before the network is up
2026-10-18 10:29:02 +02:00
Boris Pozdena
b41f5395f9 Compare OneDrive client versions numerically everywhere
Client versions were turned into numbers in three different ways:
concatenated digits in options/utils ("2.5.12" -> 2512, so a future
"2.6.0" -> 260 would be considered older), digit concatenation with a
x10 fixup in the setup wizard, and zero-padded components in the main
window version check.

A single version_number() helper now zero-pads each component
(2.5.12 -> 20512) and is used by all of them, together with a shared
MIN_CLIENT_VERSION (2.5.11):

- The v2.5.12 options in profile settings are enabled based on a
  correct comparison.
- The setup wizard enforces the same minimum version as the main
  window (it accepted anything from v2.5.0).
- The "OneDrive client is out of date!" warning is only shown when the
  installed client is older than the latest release, not when it is
  newer (e.g. a v2.5.12 pre-release built from 'master').
2026-10-18 10:28:23 +02:00
Boris Pozdena
2f84265997 Keep running when the last dialog closes and stop workers before exit
With start_minimized enabled the main window is hidden, so a dialog
such as the resync prompt can be the only top-level window. Closing it
triggered Qt's default quit-on-last-window-closed, the application was
torn down while the worker QThread was still running, and Qt aborted
the process ("QThread: Destroyed while thread is still running"). The
onedrive client was left behind orphaned.

OneDriveGUI is a tray application, so it no longer quits when its last
window closes; quitting is explicit via the tray menu or the Quit
button. All workers are stopped from QApplication.aboutToQuit, so no
worker thread outlives the application, and the Quit action now ends
the event loop with QApplication.quit() instead of raising SystemExit
from a slot.

Fixes #297
2026-10-18 10:27:34 +02:00
Boris Pozdena
21a80b29f4 Make local file system errors readable and point to broken symlinks
For a local file system error the client prints a summary line without
any information of its own ("The local file system returned an error
with the following details:"), followed by the path and the actual
error. The status showed mostly the summary, e.g. "Error: The local
file system returned an error with the following details: Path:
./.steampath ...".

The status now shows the actual error ("Error: Local file system error:
./.steampath: No such file or directory"). When the item does not
exist, which is how a broken symbolic link is reported, the warning
tooltip suggests removing the link or enabling 'Skip symlinks'.

The tray icon ignores these errors as intended, matching the client's
current wording again ("...following details" instead of the old
"...following message").

Fixes #278
2026-10-18 10:26:32 +02:00
Boris Pozdena
2941efd4e5 Remove output matcher for a message the client never prints
"Initializing the OneDrive API" does not exist in client v2.5.11 or
v2.5.12, so the branch matching it never ran, including the per-cycle
reset of the per-file error messages it contained. That reset now
happens when a sync cycle starts, so error messages of files that
failed in earlier cycles no longer accumulate for the lifetime of the
client process.

The tray notification de-duplication is intentionally not reset per
cycle, so persistent failures are not re-notified on every cycle.

Refs #305
2026-10-18 10:25:51 +02:00
Boris Pozdena
e4d8b279f7 Log WebSocket availability changes without flagging an error
Client v2.5.12 reports when WebSocket notifications for online changes
cannot be configured ("WARNING: Unable to configure WebSocket support
... The client will retry while monitor mode remains active"), when it
retries, and when WebSocket support is enabled again.

These are now written to the GUI log at warning/info level so they can
be found when diagnosing delayed online changes, but deliberately do
not change the status or warning icon: the client keeps picking up
online changes on the regular monitor interval and recovers by itself.

Refs #305
2026-10-18 10:25:38 +02:00
Boris Pozdena
4e1ef9fdf9 Show system clock drift warnings and sync suspension
Client v2.5.12 validates the local system clock against Microsoft
service time. On unsafe drift it suspends timestamp-sensitive
synchronisation ("ERROR: OneDrive synchronisation suspended because
unsafe local system clock drift has been confirmed"), and on smaller
drift it warns ("WARNING: Local system clock drift detected").

- Suspension: the status reads "Sync suspended: the system clock is out
  of sync" and the warning icon explains that sync resumes automatically
  once the time is corrected, including the observed clock difference.
- Drift warning: the warning icon tooltip explains the problem without
  replacing the current status.
- Recovery ("NOTICE: System clock validation has recovered", "...drift
  has returned to the acceptable range", "...below the blocking
  threshold") clears the warning and says that sync will resume.

Previously the suspension line was treated as a generic error that
waited for a continuation line, and the warnings were ignored.

Refs #305
2026-10-18 10:25:26 +02:00
Boris Pozdena
4ccea940e8 Report local Recycle Bin move failures
Client v2.5.12 reports online deletions that could not be moved to the
configured local Recycle Bin, both as an error line ("ERROR: Move of
local file to the configured Recycle Bin failed for <path>: <reason>")
and in the end-of-cycle summary ("Failed local items to move to the
configured Recycle Bin: N" followed by one line per path).

These failures are now included in the failed-files count, status
tooltip and tray notification, and each affected path gets a
"Move to Recycle Bin failed" row in the file operation list with the
reason in its tooltip. Failed rows for deletions and Recycle Bin moves
are no longer rendered as completed "Deleted"/"Trashed" entries.

Refs #305
2026-10-18 10:24:26 +02:00
Boris Pozdena
8697e28794 Count download failures and notify once per sync cycle
The client summarises failed uploads and failed downloads on separate
lines ("Failed items to upload to/from Microsoft OneDrive: N" and
"Failed items to download to/from ..."). Only the upload summary was
matched, and a second summary would have replaced the count instead of
adding to it, so the reported number of failed files was wrong when
downloads failed.

The tray notification is now raised once at the end of the sync cycle,
after all summaries are collected. Previously each summary could raise
its own notification, giving two notifications for one cycle.

Refs #305
2026-10-18 10:23:49 +02:00
Boris Pozdena
7614c084bd Show deletions reported with the current client wording
The client reports a local deletion that is propagated online as
"Deleting online file from Microsoft OneDrive: ./path" (or "... online
folder ..."). This wording, used since v2.5.11, was not matched, so these
deletions never appeared in the file operation list; only the older
"Deleting item from Microsoft OneDrive" form was handled.

Also show folders deleted locally because they were removed online
("Deleting local directory") and folders moved to the local Recycle Bin
("Moving this local directory to the configured 'Recycle Bin'").

The follow-up "Successfully deleted item" line and the pathless
"Deleting online folder due to --local-first & --mirror-local-state"
line are not matched, so each deletion is listed once.

Refs #305
2026-10-18 10:23:01 +02:00
Boris Pozdena
1dacf5587f Use the client's monitor-status.json for the high-level sync state
Client v2.5.12 publishes a machine-readable runtime status document,
monitor-status.json, in the configuration directory while running in
--monitor mode. OneDriveGUI now polls it every 2 seconds for each
running profile and uses it as the authoritative high-level state,
while the client output stays the source for per-file activity and
progress.

- The document is only used when its schema_version is 1 and its pid is
  the client process started by the worker, so a stale file left behind
  by a crashed or killed client is ignored.
- The status label is rewritten only when the high-level state changes
  (idle with the local time of the last successful sync, partial
  failure with the failure count, service unreachable, system clock
  drift blocking sync, interrupted), so detailed messages from the
  client output are not overwritten on every poll.
- The status label tooltip summarises the document: client state and
  loop, last successful sync, cycle count and result, failure counts,
  OneDrive reachability and system time state.
- The tray icon uses the document's state (syncing, idle, degraded)
  instead of guessing from the status text.

UTC timestamps are converted to local time by hand, as the client emits
7 fractional digits which datetime.fromisoformat() rejects before
Python 3.11 (the AppImage ships Python 3.10).

Clients older than v2.5.12, or profiles with monitor_status disabled,
keep using the status derived from the client output.

Refs #305
2026-10-18 10:22:31 +02:00
Boris Pozdena
cd6b9ef52a Detect required resync from the client exit code
Client v2.5.12 exits with code 78 (previously 126) when a --resync is
required. The worker now checks the exit code after the client stops and
asks for resync authorization if the output matcher did not already
fire, so a future change in the message wording does not leave the
profile silently stopped.

The resync dialog is also requested only once per run: v2.5.12 can
print two matching lines for one event (e.g. the cache-state message
followed by "A --resync is required to rebuild the local item
database."), which would otherwise open the dialog twice.

Refs #305
2026-10-18 10:21:39 +02:00
Boris Pozdena
07f0319097 Add client v2.5.12 options to profile settings
New options introduced in OneDrive client v2.5.12:

- disable_time_check (Sync Options > Advanced options): skip validating
  the system clock against Microsoft service time. The tooltip carries
  the upstream caution that this bypasses a correctness safeguard.
- monitor_status (Sync Options > Advanced options): publish the
  machine-readable monitor-status.json runtime status file.
- notify_monitor_start (Logging > Notifications): desktop notification
  when monitor mode becomes active; disabled while notifications are
  disabled.

Defaults are added to the bundled default config, so the options are
only written to the client config when changed. Older clients refuse to
start with unknown keys, so the checkboxes are disabled when the
installed client is older than v2.5.12.

Refs #305
2026-10-18 10:21:39 +02:00
Boris Pozdena
801eb9792d Remove deprecated client options from profile configs
The client no longer supports 'sync_business_shared_folders',
'min_notify_changes' and 'force_http_2'. The latter two are ignored
with a warning on every start, but 'sync_business_shared_folders' is a
configuration error that stops the client from starting at all.

These options are now dropped when profiles are loaded, so the config
saved on startup no longer contains them. 'min_notify_changes' is
removed from the bundled default config, which made it look like a
supported option.

The status message shown when the client reports the option no longer
claims that Business Shared Folders were deprecated (the wiki it linked
says otherwise). It now says that the config option is unsupported and
how to remove it. None of these options affect the client's
resync-required checks.

Fixes #287
Refs #305
2026-10-18 10:21:39 +02:00
Boris Pozdena
0459c09f7e Normalise file paths before matching list rows and file errors
The client prints the same file both with and without a leading './'
depending on the message (e.g. the transfer line vs. the failed-items
summary). The two spellings were treated as different files, which
created duplicate rows and left a stale hidden "failed" row (and a
wrong failed count) behind after the file synced successfully.

Paths are now normalised before they are used as row keys in the file
operation list and as keys for the per-file error messages in the
worker.
2026-10-18 10:21:39 +02:00
Boris Pozdena
8a0beae7b0 Collapse failed transfers behind a toggle and track open rows by path
Failed file transfers are pinned at the top of the file operation list
but hidden by default; a "N failed" button in the account header shows
or hides them, so a large number of persistent failures no longer
floods the list and pushes synced files out of view.

Rows that are still open (in progress or failed, no completion
timestamp) are tracked in a per-profile map keyed by full path, so a
file that keeps failing across sync cycles updates its row in place
instead of adding a duplicate on every cycle, regardless of how far
down the list the row has moved. Stalled transfers are moved to the top
as one batch.
2026-10-18 10:21:39 +02:00
Boris Pozdena
dced6b9cdf Show free space in system tray tooltip (#309)
The tray tooltip now lists free space per profile, including the last
known value restored from config while sync is stopped, so the GUI
window does not need to be opened to check it.

Tray tooltips are rendered by the desktop environment at a fixed narrow
width that the application cannot widen, and profile names (often email
addresses) use most of it. The tooltip was restructured so each value
gets its own short line indented under the profile name, with profiles
separated by blank lines - lines no longer wrap mid-value and
multi-profile listings stay readable.

Also removed leftover src/ui/ from the pre-packaging layout (empty file
from a mistargeted uic run and stale __pycache__).

Closes #309
2026-10-09 10:21:07 +02:00
Boris Pozdena
d111f0dcd3 Add error handling and notifications for failed file syncs 2026-10-08 18:00:08 +02:00
Nikolai Nyegaard
7f2fcee639 retry version checks when started offline
- client and GUI version lookups retry every 60 seconds, up to 10 attempts, before reporting failure
- raise the GitHub request timeout from 1 to 3 seconds
2026-10-05 11:39:01 +02:00
Boris Pozdena
8a781a7e18 Fix packaging follow-ups from PR #301
- Fix autostart Exec fallback: the package now uses relative imports, so
  a desktop entry pointing at the script path fails at login. Use
  "-m onedrive_gui" with PYTHONPATH instead, and recognise the pip
  console script "onedrive-gui" when it is on PATH.
- AppImageBuilder.yml: revert accidental python3.10 -> python3.12 change,
  drop the now-redundant "cp src AppDir/usr" (the wheel install covers
  it), quote the *.whl glob.
- pyproject.toml: read version dynamically from options.py so it is not
  duplicated in a third place; declare runtime dependencies; remove the
  pyproject sed step from build_appimage.sh.
- MANIFEST.in: ship the resources/ directory only; stop packaging .ui
  sources and remove the stray mainwindow.ui.autosave.
- Ignore build/, dist/ and *.egg-info; update README wheel filename.
2026-09-15 14:26:13 +02:00
Boris Pozdena
7872e43fb9 Merge pull request #301 from maikwoehl/feature/packagable
Create resources to make it packable as python package
2026-09-15 14:24:26 +02:00
Boris Pozdena
5b1358a2cb Merge pull request #304 from nikolainyegaard/fix-sharepoint-business-detection
Fix SharePoint wizard never detecting Business profiles
2026-09-15 05:05:48 -07:00
Boris Pozdena
f292d61539 Merge pull request #303 from nikolainyegaard/fix-autostart-exec-path
Fix autostart entry pointing at a non-existent command
2026-09-15 05:02:28 -07:00
Boris Pozdena
481697ef17 Merge pull request #302 from nikolainyegaard/tray-click-focus
Focus main window on tray click instead of hiding it when unfocused
2026-09-15 04:56:29 -07:00
Boris Pozdena
eaba3f1981 Merge pull request #300 from maikwoehl/feature/appstream-metainfo
Provide AppStream MetaInfo file
2026-09-15 04:53:41 -07:00
Boris Pozdena
4e5dc40989 Merge pull request #292 from razinkele/fix/pyflakes-cleanup
Small cleanups: duplicate QTimer import + set_check_box_state hygiene
2026-09-15 04:52:49 -07:00
Nikolai Nyegaard
95f7d74090 fix sharepoint wizard not detecting business profiles
- rebuild the wizard's profile dropdown from live config on every page entry instead of a one-time snapshot at app startup
- persist account type to the profiles file when the client reports it; previously it only lived in memory and was lost on restart
2026-09-01 12:41:02 +02:00
Nikolai Nyegaard
8a4a0e511a fix autostart exec path when executable not on PATH
- resolve installed executable to its absolute path instead of writing a bare command name
- fall back to the current interpreter plus the main script path when running from source, where no executable exists on PATH
- return the binary path for frozen builds
- quote Exec paths so install locations with spaces work
2026-09-01 11:59:58 +02:00
Nikolai Nyegaard
c494ab046c raise unfocused window on tray icon click
- left click on tray icon now focuses and raises the main window when it is visible but unfocused, instead of hiding it
- hiding still happens when the window is focused, showing when hidden
2026-09-01 10:55:56 +02:00
Maik Wöhl
93c2d3cfd9 Update build environment
Signed-off-by: Maik Wöhl <maik.woehl@outlook.de>
2026-07-18 13:01:58 +02:00
Maik Wöhl
6c8e820ed0 Make package runnable
Signed-off-by: Maik Wöhl <maik.woehl@outlook.de>
2026-07-18 12:51:37 +02:00
Maik Wöhl
efbbcd8fa7 Rewrite imports to be relative
Signed-off-by: Maik Wöhl <maik.woehl@outlook.de>
2026-07-18 12:51:33 +02:00