nowfocus 0.5.2__tar.gz → 0.5.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {nowfocus-0.5.2/src/nowfocus.egg-info → nowfocus-0.5.4}/PKG-INFO +1 -1
- {nowfocus-0.5.2 → nowfocus-0.5.4}/pyproject.toml +1 -1
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/__main__.py +2 -1
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/task_window.py +3 -3
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/utils.py +49 -40
- {nowfocus-0.5.2 → nowfocus-0.5.4/src/nowfocus.egg-info}/PKG-INFO +1 -1
- {nowfocus-0.5.2 → nowfocus-0.5.4}/LICENSE +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/README.md +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/setup.cfg +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/__init__.py +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/conf.py +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/connectors/activitywatch.py +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/connectors/caldav.py +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/connectors/csv.py +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/connectors/psc_timetracker.py +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/connectors/taskwarrior.py +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/connectors/timewarrior.py +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/connectors/todo_template.py +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/connectors/todotxt.py +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/connectors/trello.py +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/connectors/txt.py +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/connectors/vikunja.py +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/desktop-extras/nowfocus.desktop +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/desktop-extras/nowfocus.png +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/desktop-extras/nowfocus.svg +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/example-todo.txt +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/icon/cancel.png +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/icon/cancel.svg +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/icon/edit.png +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/icon/edit.svg +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/icon/icon-0.svg +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/icon/icon-1.svg +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/icon/icon-2.svg +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/icon/icon-3.svg +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/icon/icon-4.svg +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/icon/icon-5.svg +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/icon/icon-6.svg +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/icon/icon-7.svg +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/icon/icon-8.svg +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/icon/icon-9.svg +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/icon/icon-red.svg +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/icon/icon.svg +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/icon/mark-done.png +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/icon/mark-done.svg +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/icon/pause.png +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/icon/pause.svg +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/icon/settings.png +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/icon/settings.svg +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/install.py +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/new_task_dialog.py +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/session_edit_dialog.py +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/session_options.py +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/sessions.csv +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/settings.py +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/sound/bell-xylophone-g.mp3 +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/sound/dinner-bell.mp3 +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/sound/xylophone-chord.mp3 +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/styles.css +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/user_idle_time.py +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus/version_migrator.py +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus.egg-info/SOURCES.txt +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus.egg-info/dependency_links.txt +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus.egg-info/entry_points.txt +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus.egg-info/requires.txt +0 -0
- {nowfocus-0.5.2 → nowfocus-0.5.4}/src/nowfocus.egg-info/top_level.txt +0 -0
|
@@ -100,8 +100,9 @@ class Application(Gtk.Application):
|
|
|
100
100
|
# time.sleep(3)
|
|
101
101
|
# self.open_session_options_dialog('test_param')
|
|
102
102
|
# self.open_settings_window() #for testing
|
|
103
|
-
|
|
103
|
+
self.open_new_task_dialog() #for testing
|
|
104
104
|
# self.print_time_totals()
|
|
105
|
+
# self.new_task_dialog()
|
|
105
106
|
|
|
106
107
|
signal.signal(signal.SIGINT, self.quit)
|
|
107
108
|
signal.signal(signal.SIGUSR1, self.signal_handler)
|
|
@@ -407,7 +407,7 @@ class TaskWindow(Gtk.Window):
|
|
|
407
407
|
# self.r_sidebar.connect("enter-notify-event",self.test)
|
|
408
408
|
|
|
409
409
|
|
|
410
|
-
self.l_sidebar.add(choose_from_lists(self.select_list_callback, 'None', None, False))
|
|
410
|
+
self.l_sidebar.add(choose_from_lists(self.select_list_callback, 'None', None, False, show_todolist_headers=False))
|
|
411
411
|
|
|
412
412
|
self.SessionEditDialog = SessionEditDialog # passed to show_sessions via self
|
|
413
413
|
sidebar_sessions = get_sessions(use_sessions_timeframe_setting=False)
|
|
@@ -491,8 +491,8 @@ class TaskWindow(Gtk.Window):
|
|
|
491
491
|
|
|
492
492
|
extended_label = GLib.markup_escape_text(t['extended_label'])
|
|
493
493
|
|
|
494
|
-
if len(extended_label) >
|
|
495
|
-
extended_label = extended_label[:
|
|
494
|
+
if len(extended_label) > 100:
|
|
495
|
+
extended_label = extended_label[:100]+"..."
|
|
496
496
|
|
|
497
497
|
if len(self.search_term) > 1:
|
|
498
498
|
|
|
@@ -661,20 +661,20 @@ def db_cleanup(widget = None):
|
|
|
661
661
|
ids = []
|
|
662
662
|
# print('ids_sql',ids_sql)
|
|
663
663
|
for id, todo in conf.user['todolists'].items():
|
|
664
|
-
|
|
665
|
-
ids.append(id)
|
|
664
|
+
ids.append(id)
|
|
666
665
|
|
|
667
666
|
# Old save
|
|
668
667
|
# print("Active todolist ids",ids)
|
|
669
668
|
|
|
670
669
|
# Delete unlinked tasks
|
|
671
|
-
|
|
670
|
+
db_query('DELETE FROM tasks WHERE todolist NOT IN (%s)' % ','.join('?'*len(ids)),ids)
|
|
671
|
+
|
|
672
672
|
# print(len(orphaned_tasks),"orphaned_tasks",orphaned_tasks)
|
|
673
673
|
# orphaned_tasks = db_query('SELECT id, extended_label, todolist FROM tasks WHERE todolist NOT IN (%s)' % ','.join('?'*len(ids)),ids)
|
|
674
674
|
# print(len(orphaned_tasks),"orphaned_tasks",orphaned_tasks)
|
|
675
675
|
|
|
676
676
|
# Delete unlinked lists
|
|
677
|
-
|
|
677
|
+
db_query('DELETE FROM lists WHERE todolist NOT IN (%s)' % ','.join('?'*len(ids)),ids)
|
|
678
678
|
|
|
679
679
|
# orphaned_lists = db_query('SELECT id, extended_label, todolist FROM lists WHERE todolist NOT IN (%s)' % ','.join('?'*len(ids)),ids)
|
|
680
680
|
# print("orphaned_lists",orphaned_lists)
|
|
@@ -1043,10 +1043,11 @@ def get_times(task):
|
|
|
1043
1043
|
|
|
1044
1044
|
|
|
1045
1045
|
def db_deactivate_todo(id):
|
|
1046
|
-
dbg("deactivating todolist: "
|
|
1046
|
+
dbg("deactivating todolist: ",id, s='todoloading')
|
|
1047
1047
|
# Delete inactive todo items (except where there are sessions for them)
|
|
1048
|
-
db_query("DELETE FROM tasks WHERE todolist = ? AND id NOT IN (SELECT task_id FROM sessions)",(id,))
|
|
1049
|
-
db_query("DELETE FROM lists WHERE todolist = ? AND id NOT IN (SELECT parent_id FROM tasks)",(id,))
|
|
1048
|
+
# db_query("DELETE FROM tasks WHERE todolist = ? AND id NOT IN (SELECT task_id FROM sessions)",(id,))
|
|
1049
|
+
# db_query("DELETE FROM lists WHERE todolist = ? AND id NOT IN (SELECT parent_id FROM tasks)",(id,))
|
|
1050
|
+
|
|
1050
1051
|
db_query("UPDATE lists SET status = -1 WHERE todolist = ?",(id,))
|
|
1051
1052
|
db_query("UPDATE tasks SET status = -1 WHERE todolist = ?",(id,))
|
|
1052
1053
|
|
|
@@ -1156,7 +1157,7 @@ def get_most_recent_list(session = None):
|
|
|
1156
1157
|
return last_session[0]['parent_id']
|
|
1157
1158
|
|
|
1158
1159
|
|
|
1159
|
-
def choose_from_lists(callback, selected_list_id = None, session = None, accepts_tasks = True):
|
|
1160
|
+
def choose_from_lists(callback, selected_list_id = None, session = None, accepts_tasks = True, skip_top_level_lists = False, show_todolist_headers = True):
|
|
1160
1161
|
''' Returns a Gtk.ScrolledWindow widget with radio buttons'''
|
|
1161
1162
|
|
|
1162
1163
|
# TODO: consider using TreeView https://lazka.github.io/pgi-docs/Gtk-3.0/classes/TreeView.html#Gtk.TreeView
|
|
@@ -1166,6 +1167,7 @@ def choose_from_lists(callback, selected_list_id = None, session = None, accepts
|
|
|
1166
1167
|
selected_list_id = get_most_recent_list(session = None)
|
|
1167
1168
|
|
|
1168
1169
|
box = Gtk.VBox()
|
|
1170
|
+
box.set_spacing(8)
|
|
1169
1171
|
|
|
1170
1172
|
scrolled_window = Gtk.ScrolledWindow()
|
|
1171
1173
|
scrolled_window.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
|
|
@@ -1177,48 +1179,55 @@ def choose_from_lists(callback, selected_list_id = None, session = None, accepts
|
|
|
1177
1179
|
|
|
1178
1180
|
where = " WHERE status = '1' "
|
|
1179
1181
|
|
|
1180
|
-
if
|
|
1181
|
-
where += " AND
|
|
1182
|
-
else:
|
|
1183
|
-
# HACK: to not show op level lists
|
|
1184
|
-
# TODO: think of a better way
|
|
1185
|
-
where += " AND parent_label != '' "
|
|
1182
|
+
if skip_top_level_lists:
|
|
1183
|
+
where += " AND parent_label IS NOT NULL "
|
|
1186
1184
|
|
|
1187
|
-
|
|
1188
|
-
|
|
1185
|
+
lists = db_query("SELECT lists.*, (SELECT start_time FROM sessions WHERE todolist = lists.todolist ORDER BY start_time DESC LIMIT 1 ) as last_session_on_todo FROM lists "+where+" ORDER BY last_session_on_todo DESC, CASE WHEN parent_id IS NULL THEN 1 ELSE 2 END, extended_label ASC ", None, 'id')
|
|
1186
|
+
|
|
1187
|
+
r_button = None
|
|
1188
|
+
todolist_id = None
|
|
1189
1189
|
|
|
1190
1190
|
for id, l in lists.items():
|
|
1191
|
-
|
|
1192
|
-
|
|
1191
|
+
try:
|
|
1192
|
+
l['data'] = json.loads(l['data'])
|
|
1193
1193
|
|
|
1194
|
-
if todolist == None:
|
|
1195
|
-
# initial button group
|
|
1196
|
-
button_group = Gtk.RadioButton(label=l['label'])
|
|
1197
|
-
item = button_group
|
|
1198
|
-
else:
|
|
1199
1194
|
indent = len(get_lists_for_item(l)['ids'])
|
|
1200
|
-
label = f'{"
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1195
|
+
label = f'{" · " * indent}' + GLib.markup_escape_text(l['label'])
|
|
1196
|
+
|
|
1197
|
+
if todolist_id != l['todolist']:
|
|
1198
|
+
todolist_id = l['todolist']
|
|
1199
|
+
if show_todolist_headers:
|
|
1200
|
+
label = "<b>" + label + "</b>"
|
|
1201
|
+
if r_button:
|
|
1202
|
+
r_button.set_margin_bottom(20)
|
|
1203
|
+
else:
|
|
1204
|
+
continue
|
|
1207
1205
|
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
dbg('Exception creating button group header for list',l, e=e, l=0)
|
|
1212
|
-
|
|
1213
|
-
box.add(l['header'])
|
|
1206
|
+
label_widget = Gtk.Label()
|
|
1207
|
+
label_widget.set_halign(Gtk.Align.START)
|
|
1208
|
+
label_widget.set_markup(label)
|
|
1214
1209
|
|
|
1215
|
-
|
|
1216
|
-
|
|
1210
|
+
if accepts_tasks and l['data']['accepts_tasks'] == False:
|
|
1211
|
+
label_widget.set_markup(' '+label)
|
|
1212
|
+
|
|
1213
|
+
box.add(label_widget)
|
|
1214
|
+
|
|
1215
|
+
else:
|
|
1216
|
+
r_button = Gtk.RadioButton(group=r_button)
|
|
1217
|
+
r_button.add(label_widget)
|
|
1218
|
+
|
|
1219
|
+
|
|
1220
|
+
if l['id'] == selected_list_id:
|
|
1221
|
+
r_button.set_active(True)
|
|
1217
1222
|
|
|
1218
|
-
|
|
1219
|
-
|
|
1223
|
+
r_button.connect("toggled", callback, l)
|
|
1224
|
+
box.add(r_button)
|
|
1225
|
+
|
|
1226
|
+
except Exception as e:
|
|
1227
|
+
dbg('Exception adding to choose_from_lists list', l, e=e, l=0)
|
|
1220
1228
|
|
|
1221
1229
|
# TODO: allow a height argument to account for other things that require space, and possibly a global screen height value?
|
|
1230
|
+
|
|
1222
1231
|
# Optimize the height, 27px per item with max of 700 px and a min of 50
|
|
1223
1232
|
height = max(50,min(500, (len(lists) * 27)))
|
|
1224
1233
|
scrolled_window.set_size_request(-1, height)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|