Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d05aac8
Phase 1: GTK4 version bump and mechanical API changes
rabin-io May 17, 2026
3de51e5
Phase 2: Convert UI files to GTK4 format
rabin-io May 17, 2026
5e5d0ff
Phase 3: Replace removed GTK3 widget patterns
rabin-io May 17, 2026
2649888
Phase 4: Migrate graphics framework to GTK4
rabin-io May 17, 2026
6a412a6
Phase 5: Migrate popup widgets and EntryCompletion
rabin-io May 17, 2026
b52a5ad
Phase 6: Migrate preferences DnD and event controllers
rabin-io May 17, 2026
e66a93d
Phase 7: Packaging, smoke tests, and cleanup
rabin-io May 17, 2026
bd9e416
Fix runtime GTK4 errors found during manual testing
rabin-io May 17, 2026
abb1873
Fix DayLine division by zero and restore UI padding
rabin-io May 17, 2026
fcb4e2e
Remove leftover EntryCompletion property references from UI
rabin-io May 17, 2026
d5b30ed
Replace gtk-delete/cancel/save stock labels with plain text
rabin-io May 17, 2026
d7f40a5
Replace gtk-save/gtk-dialog-warning stock labels in Python code
rabin-io May 17, 2026
e172889
Fix time/date input widgets for GTK4
rabin-io May 17, 2026
16c5d8e
Fix TimeInput icon click: use icon-press, fix focus fight
rabin-io May 17, 2026
81c74c2
Fix regex escape warnings and Ctrl+Space key capture
rabin-io May 17, 2026
7e20a7e
Replace deprecated utcfromtimestamp with timezone-aware equivalent
rabin-io May 17, 2026
420a412
Fix Calendar.get_date() for GTK4 GLib.DateTime return type
rabin-io May 17, 2026
67f5f72
Replace gtk-close and gtk-edit stock labels in preferences UI
rabin-io May 17, 2026
21564c4
Fix category/activity inline editing in GTK4
rabin-io May 17, 2026
95e7f66
Fix all TreeView inline editing for GTK4
rabin-io May 17, 2026
a04b619
Fix TreeView cell editing: stop key controllers from eating input
rabin-io May 17, 2026
1304bf7
Replace broken TreeView inline editing with dialog-based editing
rabin-io May 17, 2026
66be64d
Fix preferences tree view sizing: add hexpand to scrolled windows
rabin-io May 17, 2026
faaeb45
Fix tag popup width: ensure minimum 300px for tag layout
rabin-io May 17, 2026
f2aeb75
Fix tag text wrapping: don't initialize width to 0
rabin-io May 17, 2026
d341983
Fix tags text area width: add hexpand to frame, box, scrolledwindow
rabin-io May 17, 2026
6877350
Set editable and cursor_visible on autocomplete tags text view
rabin-io May 17, 2026
5ceeef1
Replace window key controller with ShortcutController
rabin-io May 17, 2026
9c6e858
Move Delete/F2 shortcuts to tree controllers only
rabin-io May 17, 2026
536a679
Remove all key/shortcut controllers from preferences window
rabin-io May 17, 2026
30dc9d3
Fix overview key handling: remove CAPTURE phase, use ShortcutController
rabin-io May 17, 2026
b7e466c
Remove GTK3 can_focus=False and empty accessible blocks from UI files
rabin-io May 17, 2026
fed25e8
Fix totals text color on dark themes
rabin-io May 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ commands). Older versions are not supported.
###### Ubuntu (tested in 19.04 and 18.04)

```bash
sudo apt install gettext intltool python3-gi python3-cairo python3-gi-cairo python3-distutils python3-dbus libglib2.0-dev libglib2.0-bin gir1.2-gtk-3.0 gtk-update-icon-cache
sudo apt install gettext intltool python3-gi python3-cairo python3-gi-cairo python3-distutils python3-dbus libglib2.0-dev libglib2.0-bin gir1.2-gtk-4.0 gtk-update-icon-cache
# and for documentation
sudo apt install itstool yelp
```
Expand Down Expand Up @@ -307,7 +307,7 @@ for some time now. Hopefully the effort will be renewed in the future.
In the meantime, this sub-project aims to pursue development of the "legacy" Hamster
code base, maintaining database compatibility with the widely installed
[v1.04](https://github.com/projecthamster/hamster/releases/tag/hamster-time-tracker-1.04),
but migrating to `Gtk3` and `python3`.
but migrating to `Gtk4` and `python3`.
This will allow package maintainers to provide
new packages for recent releases of mainstream Linux distributions for which the old
1.04-based versions are no longer provided.
Expand Down
220 changes: 31 additions & 189 deletions data/date_range.ui

Large diffs are not rendered by default.

412 changes: 81 additions & 331 deletions data/edit_activity.ui

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/org.gnome.Hamster.flatpak.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
app-id: org.gnome.Hamster
runtime: org.gnome.Platform
runtime-version: '45'
runtime-version: '47'
sdk: org.gnome.Sdk
command: hamster
modules:
Expand Down
640 changes: 190 additions & 450 deletions data/preferences.ui

Large diffs are not rendered by default.

266 changes: 0 additions & 266 deletions data/stats.ui

This file was deleted.

2 changes: 1 addition & 1 deletion po/wscript
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
# encoding: utf-8
# Thomas Nagy, 2006-2009 (ita)

Expand Down
8 changes: 3 additions & 5 deletions src/hamster-cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import re

import gi
gi.require_version('Gdk', '3.0') # noqa: E402
gi.require_version('Gtk', '3.0') # noqa: E402
gi.require_version('Gdk', '4.0') # noqa: E402
gi.require_version('Gtk', '4.0') # noqa: E402
from gi.repository import GLib as glib
from gi.repository import Gdk as gdk
from gi.repository import Gtk as gtk
Expand Down Expand Up @@ -200,8 +200,6 @@ def _open_window(self, name, data=None):
# https://specifications.freedesktop.org/wm-spec/wm-spec-1.3.html
if name != "overview" and self.overview_controller:
window.set_transient_for(self.overview_controller.window)
# so the dialog appears on top of the transient-for:
window.set_type_hint(gdk.WindowTypeHint.DIALOG)
else:
# toplevel
window.set_transient_for(None)
Expand Down Expand Up @@ -455,7 +453,7 @@ def version(self):
logger.debug("app instanciated")

import signal
signal.signal(signal.SIGINT, signal.SIG_DFL) # gtk3 screws up ctrl+c
signal.signal(signal.SIGINT, signal.SIG_DFL)

parser = argparse.ArgumentParser(
description="Time tracking utility",
Expand Down
16 changes: 8 additions & 8 deletions src/hamster-service.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def AddFact(self, fact_str, start_time, end_time, temporary):
Returns:
fact id (int), 0 means failure.

Note: see datetime.utcfromtimestamp documentation
Note: see datetime.fromtimestamp documentation
for the precise meaning of timestamps.
"""
fact = Fact.parse(fact_str)
Expand All @@ -166,12 +166,12 @@ def AddFact(self, fact_str, start_time, end_time, temporary):
if start_time == -1:
fact.start_time = None
elif start_time != 0:
fact.start_time = dt.datetime.utcfromtimestamp(start_time)
fact.start_time = dt.datetime.fromtimestamp(start_time, tz=dt.timezone.utc).replace(tzinfo=None)

if end_time == -1:
fact.end_time = None
elif end_time != 0:
fact.end_time = dt.datetime.utcfromtimestamp(end_time)
fact.end_time = dt.datetime.fromtimestamp(end_time, tz=dt.timezone.utc).replace(tzinfo=None)

return self.add_fact(fact)

Expand Down Expand Up @@ -249,11 +249,11 @@ def GetFactJSON(self, fact_id):
def UpdateFact(self, fact_id, fact, start_time, end_time, temporary):
start_time = start_time or None
if start_time:
start_time = dt.datetime.utcfromtimestamp(start_time)
start_time = dt.datetime.fromtimestamp(start_time, tz=dt.timezone.utc).replace(tzinfo=None)

end_time = end_time or None
if end_time:
end_time = dt.datetime.utcfromtimestamp(end_time)
end_time = dt.datetime.fromtimestamp(end_time, tz=dt.timezone.utc).replace(tzinfo=None)
return self.update_fact(fact_id, fact, start_time, end_time, temporary)


Expand All @@ -278,7 +278,7 @@ def StopTracking(self, end_time):
"""Stops tracking the current activity"""
end_time = end_time or None
if end_time:
end_time = dt.datetime.utcfromtimestamp(end_time)
end_time = dt.datetime.fromtimestamp(end_time, tz=dt.timezone.utc).replace(tzinfo=None)
return self.stop_tracking(end_time)


Expand Down Expand Up @@ -310,11 +310,11 @@ def GetFacts(self, start_date, end_date, search_terms):
#TODO: Assert start > end ?
start = dt.date.today()
if start_date:
start = dt.datetime.utcfromtimestamp(start_date).date()
start = dt.datetime.fromtimestamp(start_date, tz=dt.timezone.utc).date()

end = None
if end_date:
end = dt.datetime.utcfromtimestamp(end_date).date()
end = dt.datetime.fromtimestamp(end_date, tz=dt.timezone.utc).date()

return [to_dbus_fact(fact) for fact in self.get_facts(start, end, search_terms)]

Expand Down
2 changes: 1 addition & 1 deletion src/hamster/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import gi
gi.require_version('Gtk', '3.0') # noqa: E402
gi.require_version('Gtk', '4.0') # noqa: E402
gi.require_version('PangoCairo', '1.0') # noqa: E402
# for some reason performance is improved by importing Gtk early
from gi.repository import Gtk as gtk
Expand Down
Loading