Add version 2.1
This commit is contained in:
parent
c87ea33ae3
commit
bf2423dcfe
3
NEWS.md
3
NEWS.md
|
@ -1,10 +1,11 @@
|
|||
# OutNoted project news
|
||||
|
||||
## [Unreleased]
|
||||
## [2.1 beta] - 2024-01-31
|
||||
|
||||
### Added
|
||||
|
||||
* Ability to use native file dialogs on X11 (via Zenity)
|
||||
* Ability to handle feed lists as used in newsreaders
|
||||
|
||||
### Changed
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ Minimum screen resolution: 800x600. Recommended: 1024x768.
|
|||
|
||||
## Status
|
||||
|
||||
This document applies to OutNoted 2.0, in beta as of January 2024. This version comes with a redesigned user interface, including:
|
||||
This document applies to OutNoted 2.1, in beta as of January 2024. This version comes with a redesigned user interface, including:
|
||||
|
||||
- menu system;
|
||||
- extended toolbar with icons;
|
||||
|
@ -28,7 +28,7 @@ Application logic is unchanged, so it should still work, barring new bugs.
|
|||
|
||||
- Create and edit outlines made of one-line notes.
|
||||
- Open and save outline formats like Org Mode and OPML.
|
||||
- Treat any note as a task and / or link.
|
||||
- Treat any note as a task, link and/or newsfeed.
|
||||
|
||||
## Uses
|
||||
|
||||
|
|
60
outnoted2.py
60
outnoted2.py
|
@ -157,6 +157,9 @@ def parseOPML(node):
|
|||
node["link"] = i.getAttribute("url")
|
||||
elif i.hasAttribute("htmlUrl"):
|
||||
node["link"] = i.getAttribute("htmlUrl")
|
||||
|
||||
if i.hasAttribute("xmlUrl"):
|
||||
node["feed"] = i.getAttribute("xmlUrl")
|
||||
subnodes.append(node)
|
||||
return subnodes
|
||||
|
||||
|
@ -177,7 +180,12 @@ def buildOutline(document, parent, outline):
|
|||
for i in outline:
|
||||
node = document.createElement("outline");
|
||||
node.setAttribute("text", i["text"])
|
||||
if "link" in i and i["link"] != "":
|
||||
if "feed" in i and i["feed"] != "":
|
||||
node.setAttribute("type", "rss")
|
||||
node.setAttribute("xmlUrl", i["feed"])
|
||||
if "link" in i and i["link"] != "":
|
||||
node.setAttribute("htmlUrl", i["link"])
|
||||
elif "link" in i and i["link"] != "":
|
||||
node.setAttribute("type", "link")
|
||||
node.setAttribute("url", i["link"])
|
||||
buildOutline(document, node, i["children"])
|
||||
|
@ -199,7 +207,7 @@ def buildOPML(metadata, outline):
|
|||
|
||||
about_text = """
|
||||
An outline note-taking editor
|
||||
Version 2.0 beta (28 Jan 2024)
|
||||
Version 2.1 beta (31 Jan 2024)
|
||||
MIT License
|
||||
"""
|
||||
|
||||
|
@ -258,7 +266,7 @@ def load_help():
|
|||
viewport.insert("about", "end",
|
||||
text="An outline note-taking editor")
|
||||
viewport.insert("about", "end",
|
||||
text="Version 2.0 beta (28 Jan 2024), by No Time To Play")
|
||||
text="Version 2.1 beta (31 Jan 2024), by No Time To Play")
|
||||
viewport.insert("about", "end",
|
||||
text="Open source under the MIT License")
|
||||
viewport.insert("", "end", "features", text="Features", open=1)
|
||||
|
@ -267,7 +275,7 @@ def load_help():
|
|||
viewport.insert("features", "end",
|
||||
text="Open and save outline formats like Org Mode and OPML.")
|
||||
viewport.insert("features", "end",
|
||||
text="Treat any note as a task and / or link.")
|
||||
text="Treat any note as a task, link and/or newsfeed.")
|
||||
viewport.insert("", "end", "usage", text="How to use", open=1)
|
||||
tmp = viewport.insert("usage", "end", open=1,
|
||||
text="Press Ctrl-Insert to add a note, Enter to save.")
|
||||
|
@ -295,9 +303,14 @@ def load_outline(data, item = ""):
|
|||
added = viewport.insert(item, "end", text=i["text"], open=1)
|
||||
if "status" in i:
|
||||
viewport.set(added, "status", i["status"])
|
||||
|
||||
if "link" in i:
|
||||
viewport.set(added, "link", i["link"])
|
||||
viewport.item(added, image=bookmark_icon)
|
||||
|
||||
if "feed" in i:
|
||||
viewport.set(added, "feed", i["feed"])
|
||||
viewport.item(added, image=bookmark_icon)
|
||||
load_outline(i["children"], added)
|
||||
|
||||
def unload_outline(item = ""):
|
||||
|
@ -310,9 +323,15 @@ def unload_outline(item = ""):
|
|||
status = viewport.set(i, "status")
|
||||
if status != "":
|
||||
child["status"] = status
|
||||
|
||||
link = viewport.set(i, "link")
|
||||
if link != "":
|
||||
child["link"] = link
|
||||
|
||||
feed = viewport.set(i, "feed")
|
||||
if feed != "":
|
||||
child["feed"] = feed
|
||||
|
||||
outline.append(child)
|
||||
return outline
|
||||
|
||||
|
@ -724,6 +743,13 @@ def set_note_status(text):
|
|||
modified = True
|
||||
status["text"] = "(modified)"
|
||||
|
||||
def set_link_icon(note):
|
||||
v = viewport
|
||||
if (v.set(note, "link") == "" and v.set(note, "feed") == ""):
|
||||
v.item(note, image="")
|
||||
else:
|
||||
v.item(note, image=bookmark_icon)
|
||||
|
||||
def set_note_link():
|
||||
global modified
|
||||
focus = viewport.focus()
|
||||
|
@ -736,10 +762,23 @@ def set_note_link():
|
|||
if answer != None:
|
||||
status["text"] = "Link set to: " + answer
|
||||
viewport.set(focus, "link", answer)
|
||||
if answer == "":
|
||||
viewport.item(focus, image="")
|
||||
else:
|
||||
viewport.item(focus, image=bookmark_icon)
|
||||
set_link_icon(focus)
|
||||
modified = True
|
||||
status["text"] = "(modified)"
|
||||
|
||||
def set_note_feed():
|
||||
global modified
|
||||
focus = viewport.focus()
|
||||
if focus == "":
|
||||
status["text"] = "Nothing selected."
|
||||
return
|
||||
answer = askstring(
|
||||
"OutNoted", "Feed URL:", parent=top,
|
||||
initialvalue=viewport.set(focus, "feed"))
|
||||
if answer != None:
|
||||
status["text"] = "Feed set to: " + answer
|
||||
viewport.set(focus, "feed", answer)
|
||||
set_link_icon(focus)
|
||||
modified = True
|
||||
status["text"] = "(modified)"
|
||||
|
||||
|
@ -876,7 +915,7 @@ edit_text = StringVar()
|
|||
edit_line = ttk.Entry(top, textvariable=edit_text)
|
||||
|
||||
viewport = ttk.Treeview(top, height=19, selectmode="browse",
|
||||
columns=('status', 'link'), displaycolumns=('status',))
|
||||
columns=('status', 'link', 'feed'), displaycolumns=('status',))
|
||||
scrollbar = ttk.Scrollbar(top, orient=VERTICAL, command=viewport.yview)
|
||||
viewport["yscrollcommand"] = scrollbar.set
|
||||
|
||||
|
@ -1069,6 +1108,7 @@ m.add_separator()
|
|||
menu_item(m, "Reset", 0, "Ctrl-0", lambda: set_note_status(""))
|
||||
m.add_separator()
|
||||
menu_item(m, "Link...", 0, "Ctrl-L", set_note_link)
|
||||
menu_item(m, "Feed URL...", 0, "Ctrl-K", set_note_feed)
|
||||
menu_item(m, "Go to site", 0, "Ctrl-H", go_to_site)
|
||||
menubar.add_cascade(menu=m, label="Stat", underline=0)
|
||||
|
||||
|
@ -1141,8 +1181,10 @@ top.bind("<Command-Key-3>", lambda e: set_note_status("DONE"))
|
|||
top.bind("<Command-Key-0>", lambda e: set_note_status(""))
|
||||
|
||||
top.bind("<Control-l>", lambda e: set_note_link())
|
||||
top.bind("<Control-k>", lambda e: set_note_feed())
|
||||
top.bind("<Control-h>", lambda e: go_to_site())
|
||||
top.bind("<Command-l>", lambda e: set_note_link())
|
||||
top.bind("<Command-k>", lambda e: set_note_feed())
|
||||
top.bind("<Command-h>", lambda e: go_to_site())
|
||||
|
||||
viewport.bind("<Control-x>", lambda e: handle_cut())
|
||||
|
|
Loading…
Reference in New Issue