Skip to content

Commit ecbaa40

Browse files
authored
Merge pull request #44 from Adam-Color/Develop
merge for 1.9.0
2 parents fbfc631 + c3eeb7b commit ecbaa40

17 files changed

Lines changed: 519 additions & 208 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![version](https://img.shields.io/badge/Version-1.8.8-white.svg)
1+
![version](https://img.shields.io/badge/Version-1.9.0-white.svg)
22
![license](https://img.shields.io/badge/License-GPL%20v3-blue.svg)
33
![python](https://img.shields.io/badge/Python-3.14t-green.svg)
44

dev/windows_installer.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#define MyAppName "AppUsageGUI"
55
#define MyAppPublisher "Adam Blair-Smith"
6-
#define MyAppVersion "1.8.8"
6+
#define MyAppVersion "1.9.0"
77
#define MyAppURL "https://github.com/Adam-Color/AppUsageGUI"
88
#define MyAppExeName "AppUsageGUI.exe"
99
#define MyInstallerName "AppUsageGUI_v" + MyAppVersion + "_WINDOWS_setup"

docs/install_macos.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Note: only arm-based systems are currently supported.
1212

1313
If you encounter the error message saying the app was not opened or was damaged, click "done" or "cancel", then enter this in your terminal:
1414
```shell
15-
xattr -dr com.apple.quarantine /Applications/AppUsageGUI/AppUsageGUI.app
15+
xattr -dr com.apple.quarantine /Applications/AppUsageGUI.app
1616
```
1717
If you mistakingly hit "move to trash" or "delete", repeat installation steps.
1818

docs/release_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# AppUsageGUI v0.0.0
22

33
>[!warning]
4-
>Due to Apple's restrictions when it comes to open source applications such as ours, workarounds are needed to get AppUsageGUI to run on macOS. Please read the installation instructions below.
4+
>Due to codesigning restrictions, workarounds are needed to get AppUsageGUI to run. Please read the installation instructions below.
55
66
To install, follow the instructions for your platform found here:
77

@@ -16,4 +16,4 @@ To install, follow the instructions for your platform found here:
1616
*
1717

1818
### Patches:
19-
*
19+
*

src/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.8.8"
1+
__version__ = "1.9.0"

src/core/gui_root.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from .screens.save_window import SaveWindow
2222
from .screens.create_session_window import CreateSessionWindow
2323
from .screens.session_total_window import SessionTotalWindow
24-
from .screens.tracker_settings_window import TrackerSettingsWindow
24+
from .screens.settings_window import SettingsWindow
2525

2626
import logging
2727
logger = logging.getLogger(__name__)
@@ -300,7 +300,7 @@ def refresh_logs():
300300
def init_screens(self):
301301
"""Pass the logic_controller when initializing screens"""
302302
for F in (MainWindow, SessionsWindow, ProjectSessionsWindow, ProjectsWindow, CreateProjectWindow,
303-
SelectAppWindow, TrackerWindow, SaveWindow, CreateSessionWindow, SessionTotalWindow, TrackerSettingsWindow):
303+
SelectAppWindow, TrackerWindow, SaveWindow, CreateSessionWindow, SessionTotalWindow, SettingsWindow):
304304
page_name = F.__name__
305305
frame = F(parent=self.container, controller=self, logic_controller=self.logic)
306306
self.frames[page_name] = frame

src/core/logic/file_handler.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ def get_current_project(self):
193193

194194
def move_session_to_project(self, session_name, current_project, target_project):
195195
"""Move a session from one project to another (or to/from No Project)"""
196+
# If already in the target project, nothing to do
197+
if current_project == target_project:
198+
return True
199+
196200
try:
197201
# Load the session data first
198202
self.load_session_data(session_name, current_project)

src/core/logic/user_trackers.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,30 @@ def __init__(self, parent, logic_controller):
3434

3535
self.update_thread = threading.Thread(target=self._update_mouse_position, name="mouse_tracker")
3636

37+
def _check_mouse_position(self):
38+
"""Perform a single mouse position check and trigger pause/resume as needed."""
39+
self.last_mouse_position = self.mouse_position
40+
41+
x, y = pynput.mouse.Controller().position
42+
self.mouse_position = x, y
43+
44+
# Pause the timer if mouse hasn't moved
45+
if self.last_mouse_position == self.mouse_position and not self.logic.time_tracker.get_is_paused():
46+
self.logic.time_tracker.pause()
47+
self.pausing = True
48+
elif self.pausing and self.last_mouse_position != self.mouse_position:
49+
self.logic.time_tracker.resume()
50+
self.pausing = False
51+
3752
def _update_mouse_position(self):
3853
while not self.stop_event.is_set():
39-
self.last_mouse_position = self.mouse_position
40-
4154
wait_time = self.idle_time_limit if not self.logic.time_tracker.get_is_paused() else 1
4255

4356
# Wait for the idle time or exit early if stop_event is set
4457
if self.stop_event.wait(timeout=wait_time):
4558
break
4659

47-
x, y = pynput.mouse.Controller().position
48-
self.mouse_position = x, y
49-
50-
# Pause the timer if mouse hasn’t moved
51-
if self.last_mouse_position == self.mouse_position and not self.logic.time_tracker.get_is_paused():
52-
self.logic.time_tracker.pause()
53-
self.pausing = True
54-
elif self.pausing and self.last_mouse_position != self.mouse_position:
55-
self.logic.time_tracker.resume()
56-
self.pausing = False
60+
self._check_mouse_position()
5761

5862

5963
def start(self):

src/core/screens/create_session_window.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def __init__(self, parent, controller, logic_controller):
3737

3838
# Project dropdown
3939
self.project_var = tk.StringVar()
40+
self.no_project_var = tk.BooleanVar(value=True)
4041
self.project_dropdown = tk.OptionMenu(project_frame, self.project_var, "")
4142
self.project_dropdown.pack(side="left", fill="x", expand=True, padx=(10, 5))
4243

@@ -106,8 +107,10 @@ def check_pre_selected_project(self):
106107
selected_project = self.logic.project_handler.get_selected_project()
107108
if selected_project:
108109
self.project_var.set(selected_project)
110+
self.no_project_var.set(False)
109111
else:
110112
self.project_var.set("No Project")
113+
self.no_project_var.set(True)
111114

112115
def create_new_project(self):
113116
"""Open a dialog to create a new project and associate it with the session"""
@@ -134,7 +137,8 @@ def create_new_project(self):
134137
vcmd = (dialog.register(validate_name), '%P')
135138
project_name_var = tk.StringVar()
136139
project_name_entry = tk.Entry(dialog, textvariable=project_name_var,
137-
validate="key", validatecommand=vcmd, width=30)
140+
validate="key", validatecommand=vcmd, width=30,
141+
borderwidth=3, relief="groove")
138142
project_name_entry.pack(pady=5)
139143

140144
# Help text

src/core/screens/main_window.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ def __init__(self, parent, controller, logic_controller):
4747
btn_sessions.grid(row=1, column=0, padx=10, pady=10)
4848

4949
btn_rules = tk.Button(
50-
button_frame, text="Custom Rules",
51-
command=lambda: self.controller.show_frame("TrackerSettingsWindow"),
50+
button_frame, text="Settings",
51+
command=lambda: self.controller.show_frame("SettingsWindow"),
5252
width=20, height=2
5353
)
5454
btn_rules.grid(row=1, column=1, padx=10, pady=10)

0 commit comments

Comments
 (0)