Skip to content

Commit

Permalink
v2.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
j4321 committed Apr 8, 2017
1 parent 1dde6fa commit 54450cd
Show file tree
Hide file tree
Showing 20 changed files with 118 additions and 44 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ Copyright 2016 Juliette Monsel <j_4321@protonmail.com>
Changelog
---------

- Version 2.0.3
* Corrected bug: wrong default category in default config file
* Corrected bug: selection of a font not on the system
* Corrected bug: bold and italic text was always in Liberation Sans
* Corrected bug: Alignement only set for fisrt selected line
* Corrected bug: ImportError: No module named 'tktray'
* Set colored text selected foreground to white

- Version 2.0.2
* Corrected bug: import and restore did not update the categories, which lead
to incomplete menus and errors
Expand Down
2 changes: 1 addition & 1 deletion PKG-INFO
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: mynotes
Version: 2.0.2
Version: 2.0.3
Summary: Post-it system tray app
Home-page: UNKNOWN
Author: Juliette Monsel
Expand Down
2 changes: 1 addition & 1 deletion mynotes.egg-info/PKG-INFO
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: mynotes
Version: 2.0.2
Version: 2.0.3
Summary: Post-it system tray app
Home-page: UNKNOWN
Author: Juliette Monsel
Expand Down
Empty file modified mynotes.egg-info/SOURCES.txt
100644 → 100755
Empty file.
Empty file modified mynotes.egg-info/dependency_links.txt
100644 → 100755
Empty file.
Empty file modified mynotes.egg-info/top_level.txt
100644 → 100755
Empty file.
Empty file modified mynoteslib/__init__.py
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion mynoteslib/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
from tkinter import Tk, PhotoImage, Menu, Toplevel
from tkinter.ttk import Style, Label, Checkbutton, Button
from tkinter.messagebox import askokcancel, showerror
import tktray
import os
from shutil import copy
import pickle
from mynoteslib import tktray
from mynoteslib.constantes import CONFIG, PATH_DATA, PATH_DATA_BACKUP, LOCAL_PATH
from mynoteslib.constantes import backup, asksaveasfilename, askopenfilename
import mynoteslib.constantes as cst
Expand Down
34 changes: 23 additions & 11 deletions mynoteslib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ def __init__(self, master):
self.notebook.pack(expand=True, fill="both")
okcancel_frame.pack(fill="x", expand=True)

### * general settings
### * General settings
general_settings = Frame(self.notebook)
general_settings.columnconfigure(0, weight=1)
self.notebook.add(general_settings, text=_("General"),
sticky="ewsn", padding=4)

### *- language
### *-- language
lang = {"fr": "Français", "en": "English"}
self.lang = StringVar(self, lang[CONFIG.get("General","language")])
lang_frame = Frame(general_settings)
Expand All @@ -81,14 +81,14 @@ def __init__(self, master):
variable=self.lang, command=self.translate)
menu_lang.add_radiobutton(label="Français", value="Français",
variable=self.lang, command=self.translate)
### *- opacity
### *-- opacity
self.opacity_scale = Scale(general_settings, orient="horizontal", length=200,
from_=0, to=100,
value=CONFIG.get("General", "opacity"),
command=self.display_label)
self.opacity_label = Label(general_settings,
text="{val}%".format(val=self.opacity_scale.get()))
### *- position
### *-- position
frame_position = Frame(general_settings)
self.position = StringVar(self, CONFIG.get("General", "position"))
Label(frame_position,
Expand All @@ -102,7 +102,7 @@ def __init__(self, master):
variable=self.position).grid(row=1,column=1)
Radiobutton(frame_position, text=_("Normal"), value="normal",
variable=self.position).grid(row=1,column=2)
### *- titlebar
### *-- titlebar
self.titlebar_disposition = StringVar(self, CONFIG.get("General",
"buttons_position"))
font_title = "%s %s" %(CONFIG.get("Font", "title_family").replace(" ", "\ "),
Expand Down Expand Up @@ -142,7 +142,7 @@ def select_left(event):
font=font_title).pack(side="right", fill="x", expand=True)
for ch in left.children.values():
ch.bind("<Button-1>", select_left)
### *- placement
### *-- placement
lang_frame.grid(row=0, sticky="w")
Separator(general_settings,
orient="horizontal").grid(row=1, sticky="ew", pady=10)
Expand All @@ -158,13 +158,13 @@ def select_left(event):
orient="horizontal").grid(row=6, sticky="ew", pady=10)
frame_titlebar.grid(row=7, sticky="ew", pady=4)

### * font settings
### * Font settings
font_settings = Frame(self.notebook)
font_settings.columnconfigure(0, weight=1)
self.notebook.add(font_settings, text=_("Font"),
sticky="ewsn", padding=4)

### *- title
### *-- title
fonttitle_frame = Frame(font_settings)

title_size = CONFIG.get("Font", "title_size")
Expand Down Expand Up @@ -217,7 +217,7 @@ def select_left(event):
self.is_underlined.pack(side="left")

self.update_preview_title()
### *- text
### *-- text
size = CONFIG.get("Font", "text_size")
family = CONFIG.get("Font", "text_family")

Expand All @@ -244,7 +244,7 @@ def select_left(event):

self.update_preview()

### *- placement
### *-- placement
Label(font_settings,
text=_("Title")).grid(row=0, padx=4, pady=4, sticky="w")
fonttitle_frame.grid(row=1)
Expand All @@ -253,7 +253,7 @@ def select_left(event):
text=_("Text")).grid(row=3, padx=4, pady=4, sticky="w")
font_frame.grid(row=4)

### * categories
### * Categories
self.category_settings = CategoryManager(self.notebook, master)
self.notebook.add(self.category_settings, text=_("Categories"),
sticky="ewsn", padding=4)
Expand Down Expand Up @@ -315,8 +315,20 @@ def validate_font_family(self, combo, action, modif, pos, prev_txt, V):

def ok(self):
family = self.font_family.get()
if not family in self.fonts:
l = [i for i in self.fonts if i[:len(family)] == family]
if l:
family = l[0]
else:
family = 'TkDefaultFont'
size = self.font_size.get()
familytitle = self.fonttitle_family.get()
if not familytitle in self.fonts:
l = [i for i in self.fonts if i[:len(familytitle)] == familytitle]
if l:
familytitle = l[0]
else:
familytitle = 'TkDefaultFont'
sizetitle = self.fonttitle_size.get()
opacity = "%i" % float(self.opacity_scale.get())
language = self.lang.get().lower()[:2]
Expand Down
4 changes: 2 additions & 2 deletions mynoteslib/constantes.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from locale import getdefaultlocale, setlocale, LC_ALL
from subprocess import check_output, CalledProcessError

VERSION = "2.0.0"
VERSION = "2.0.3"
SYMBOLS = 'ΓΔΘΛΞΠΣΦΨΩαβγδεζηθικλμνξοπρςστυφχψωϐϑϒϕϖ末»¡¿£¥$€§ø∞∀∃∄∈∉∫∧∨∩∪÷±√∝∼≃≅≡≤≥≪≫≲≳▪•✭✦➔➢✔▴▸✗✚✳☎✉✎♫⚠⇒⇔'

#----paths----
Expand Down Expand Up @@ -116,7 +116,7 @@

#----default categories----
if not CONFIG.has_option("General", "default_category"):
CONFIG.set("General", "default_category", _("Home"))
CONFIG.set("General", "default_category", _("home"))
CONFIG.set("Categories", _("home"), '#F9F3A9')
CONFIG.set("Categories", _("office"), '#A7B6D6')

Expand Down
Empty file modified mynoteslib/export.py
100644 → 100755
Empty file.
Empty file modified mynoteslib/locale/en_US/LC_MESSAGES/MyNotes.mo
100644 → 100755
Empty file.
Empty file modified mynoteslib/locale/fr_FR/LC_MESSAGES/MyNotes.mo
100644 → 100755
Empty file.
85 changes: 59 additions & 26 deletions mynoteslib/sticky.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,23 @@ def __init__(self, master, key, **kwargs):
selectforeground='white',
inactiveselectbackground=selectbg,
selectbackground=selectbg,
tabs=("10", 'center', '20', 'left'),
tabs=("10", 'right', '20', 'left'),
relief="flat", borderwidth=0,
highlightthickness=0, font=font_text)
# tags
self.txt.tag_configure("bold", font="Liberation\ Sans 10 bold")
self.txt.tag_configure("italic", font="Liberation\ Sans 10 italic")
self.txt.tag_configure("bold-italic", font="Liberation\ Sans 10 bold italic")
self.txt.tag_configure("bold", font="%s bold" % font_text)
self.txt.tag_configure("italic", font="%s italic" % font_text)
self.txt.tag_configure("bold-italic", font="%s bold italic" % font_text)
self.txt.tag_configure("underline", underline=True)
self.txt.tag_configure("overstrike", overstrike=True)
self.txt.tag_configure("center", justify="center")
self.txt.tag_configure("left", justify="left")
self.txt.tag_configure("right", justify="right")
self.txt.tag_configure("list", lmargin1=0, lmargin2='20')
self.txt.tag_configure("todolist", lmargin1=0, lmargin2='20')

for coul in TEXT_COLORS.values():
self.txt.tag_configure(coul, foreground=coul)
self.txt.tag_configure(coul, foreground=coul, selectforeground="white")
### menus
### * menu on title
self.menu = Menu(self, tearoff=False)
Expand Down Expand Up @@ -155,17 +158,16 @@ def __init__(self, master, key, **kwargs):
command=self.set_position_normal)
# mode: note, list, todo list
menu_mode = Menu(self.menu, tearoff=False)
self.mode = StringVar(self,
kwargs.get("mode", "note"))
self.mode = StringVar(self, kwargs.get("mode", "note"))
menu_mode.add_radiobutton(label=_("Note"), value="note",
variable=self.mode)
# command=self.set_mode_note)
variable=self.mode,
command=self.set_mode_note)
menu_mode.add_radiobutton(label=_("List"), value="list",
variable=self.mode)
# command=self.set_mode_list)
variable=self.mode,
command=self.set_mode_list)
menu_mode.add_radiobutton(label=_("ToDo List"), value="todolist",
variable=self.mode)
# command=self.set_mode_todolist)
variable=self.mode,
command=self.set_mode_todolist)

self.menu.add_command(label=_("Delete"), command=self.delete)
self.menu.add_cascade(label=_("Category"), menu=self.menu_categories)
Expand Down Expand Up @@ -260,7 +262,7 @@ def __init__(self, master, key, **kwargs):
self.corner.place(relx=1.0, rely=1.0, anchor="se")

### bindings
self.bind("<FocusOut>", self.focus_out)
self.bind("<FocusOut>", self.save_note)
self.bind('<Configure>', self.bouge)
self.bind('<Button-1>', self.change_focus, True)
self.close.bind("<Button-1>", self.hide)
Expand Down Expand Up @@ -354,7 +356,7 @@ def lock(self):
self.menu.entryconfigure(3, label=_("Unlock"))
self.title_label.unbind("<Double-Button-1>")
self.txt.unbind('<Button-3>')
self.focus_out()
self.save_note()

def save_info(self):
""" Return the dictionnary containing all the note data """
Expand Down Expand Up @@ -384,13 +386,13 @@ def save_info(self):

def change_color(self, key):
self.color = COLORS[key]
self.focus_out()
self.save_note()

def change_category(self, category=None):
if category:
self.category.set(category)
self.color = CONFIG.get("Categories", self.category.get())
self.focus_out()
self.save_note()

def set_position_above(self):
e = ewmh.EWMH()
Expand All @@ -399,7 +401,7 @@ def set_position_above(self):
e.setWmState(w, 1, '_NET_WM_STATE_ABOVE')
e.setWmState(w, 0, '_NET_WM_STATE_BELOW')
e.display.flush()
self.focus_out()
self.save_note()

def set_position_below(self):
e = ewmh.EWMH()
Expand All @@ -408,7 +410,7 @@ def set_position_below(self):
e.setWmState(w, 0, '_NET_WM_STATE_ABOVE')
e.setWmState(w, 1, '_NET_WM_STATE_BELOW')
e.display.flush()
self.focus_out()
self.save_note()

def set_position_normal(self):
e = ewmh.EWMH()
Expand All @@ -417,7 +419,34 @@ def set_position_normal(self):
e.setWmState(w, 0, '_NET_WM_STATE_BELOW')
e.setWmState(w, 0, '_NET_WM_STATE_ABOVE')
e.display.flush()
self.focus_out()
self.save_note()

def set_mode_note(self):
self.txt.tag_remove("list", "1.0", "end")
self.save_note()

def set_mode_list(self):
index = self.txt.index("insert")
if index.split(".")[-1] == "0":
self.txt.insert("insert", "\t\t")
else:
self.txt.insert("insert", "\n\t\t")
self.txt.tag_add("list", "1.0", "end")
self.txt.tag_remove("todolist", "1.0", "end")
self.save_note()

def set_mode_todolist(self):
index = self.txt.index("insert")
if index.split(".")[-1] == "0":
ch = Checkbutton(self.txt, style=self.id + ".TCheckbutton")
self.txt.window_create("insert", window=ch)
else:
self.txt.insert("insert", "\n")
ch = Checkbutton(self.txt, style=self.id + ".TCheckbutton")
self.txt.window_create("insert", window=ch)
self.txt.tag_remove("list", "1.0", "end")
self.txt.tag_add("todolist", "1.0", "end")
self.save_note()

### bindings
def enter_roll(self, event):
Expand Down Expand Up @@ -476,7 +505,7 @@ def move(self, event):
y = self.winfo_y() + deltay
self.geometry("+%s+%s" % (x, y))

def focus_out(self, event=None):
def save_note(self, event=None):
data = self.save_info()
data["visible"] = True
self.master.note_data[self.id] = data
Expand All @@ -492,6 +521,7 @@ def rollnote(self, event=None):
column=0, sticky="ewsn", pady=(1,4), padx=4)
self.corner.place(relx=1.0, rely=1.0, anchor="se")
self.geometry(self.save_geometry)
self.save_note()

def hide(self, event=None):
""" Hide note (can be displayed again via app menu) """
Expand Down Expand Up @@ -521,6 +551,9 @@ def update_text_font(self):
font = "%s %s" %(CONFIG.get("Font", "text_family").replace(" ", "\ "),
CONFIG.get("Font", "text_size"))
self.txt.configure(font=font)
self.txt.tag_configure("bold", font="%s bold" % font)
self.txt.tag_configure("italic", font="%s italic" % font)
self.txt.tag_configure("bold-italic", font="%s bold italic" % font)

def update_menu_cat(self, categories):
""" Update the category submenu """
Expand Down Expand Up @@ -608,10 +641,10 @@ def set_align(self, alignment):
""" Align the text according to alignment (left, right, center) """
if self.txt.tag_ranges("sel"):
line = self.txt.index("sel.first").split(".")[0]
line2 = self.txt.index("sel.last").split(".")[0]
# remove old alignment tag
self.txt.tag_remove("left", line + ".0", line + ".end")
self.txt.tag_remove("right", line + ".0", line + ".end")
self.txt.tag_remove("center", line + ".0", line + ".end")
self.txt.tag_remove("left", line + ".0", line2 + ".end")
self.txt.tag_remove("right", line + ".0", line2 + ".end")
self.txt.tag_remove("center", line + ".0", line2 + ".end")
# set new alignment tag
self.txt.tag_add(alignment, line + ".0", line + ".end")

self.txt.tag_add(alignment, line + ".0", line2 + ".end")
23 changes: 22 additions & 1 deletion mynoteslib/symbols.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
# -*- coding: utf-8 -*-
#! /usr/bin/python3
# -*- coding:Utf-8 -*-
"""
My Notes - Sticky notes/post-it
Copyright 2016-2017 Juliette Monsel <j_4321@protonmail.com>
My Notes is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
My Notes is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Symbol palette
"""

from tkinter import Tk, Toplevel, Canvas, Menu, TclError
from tkinter.ttk import Frame, Button, Label, Entry, Scrollbar, Menubutton, Style
Expand Down
Empty file modified po/MyNotes.pot
100644 → 100755
Empty file.
Empty file modified po/en_US.po
100644 → 100755
Empty file.
Empty file modified po/fr.po
100644 → 100755
Empty file.
Empty file modified setup.cfg
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
("share/applications", ["mynotes.desktop"])]

setup(name = "mynotes",
version = "2.0.2",
version = "2.0.3",
description = "Post-it system tray app",
author = "Juliette Monsel",
author_email = "j_4321@protonmail.fr",
Expand Down

0 comments on commit 54450cd

Please sign in to comment.