Skip to content

Commit 439751b

Browse files
authored
Merge pull request #90 from ellie-commons/Better-code
Cleaner, more organized code
2 parents fdc84d2 + 9e15779 commit 439751b

File tree

10 files changed

+76
-16
lines changed

10 files changed

+76
-16
lines changed

README.md

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,50 @@
1313

1414
<br/>
1515

16-
## Installation
16+
## 🦺 Installation
1717

1818
You can download and install Jorts from various sources:
1919

2020
[![Get it on AppCenter](https://appcenter.elementary.io/badge.svg?new)](https://appcenter.elementary.io/io.github.ellie_commons.jorts)
2121
[<img src="https://flathub.org/assets/badges/flathub-badge-en.svg" width="160" alt="Download on Flathub">](https://flathub.org/apps/io.github.ellie_commons.jorts)
2222

23+
## ❓ FAQ
24+
25+
### Where settings
26+
27+
- Right-click on the app icon, and it is in the menu that appears
28+
- You can also Ctrl+P to show the dialog
29+
- Or run in a terminal:
30+
31+
```bash
32+
flatpak run io.github.ellie_commons.jorts --preferences
33+
```
34+
35+
36+
### Where tray icon
37+
38+
Theres none. The app closes on its own when no window is open. Doesn't make sense to use resources if unused.
39+
40+
41+
### Where close note
42+
43+
Theres none. If you dont need a note you delete it, theyre supposed to be ephemeral.
44+
You can still alt+F4 or right-click->Close, but there is no reopen mechanism, and i dont wanna make one. Everything shows upon reopening the app anyway
45+
46+
47+
### Where Bold/Italic/etc
48+
49+
I really want to avoid UI noise and resource usage. Notes are just, notes. The more complicated they become the less they are ephemeral notes and the more this looks like some notekeeping app. Which is what NoteJot, this was forked from, became.
50+
Now i know i added some stuff when maintaining the old version of NoteJot, but it doesn't mean it should have more, or everything.
51+
52+
53+
2354
## 🛣️ Roadmap
2455

25-
Jorts is a cute simple little notes app, and i wanna keep it this way
56+
Jorts is a cute simple and lightweight little notes app, and i wanna keep it this way
57+
Top priority is to have the clearest, simplest, most efficient code ever
2658

27-
right now im working on:
28-
- Maybe an option to show window title buttons, because now this is on flathub i may get flak from users about the lack of it
29-
- Probably some cleaner code if i come around to it
30-
- Maybe a toggle lists if i find how to do it without more UI noise
3159

32-
Feel free to check [the project board](https://github.com/orgs/ellie-commons/projects/4)
3360

3461
## 💝 Donations
3562

@@ -67,4 +94,6 @@ You can get it all by entering in a terminal:
6794
cp ~/.var/app/io.github.ellie_commons.jorts/data ~/
6895
```
6996

70-
"saved_state.json" contains all notes in JSON format
97+
"saved_state.json" contains all notes in JSON format. The structure is quite simple, if not pretty.
98+
99+
The app reads from it only during startup (rest of the time it writes in) so you could quite easily swap it up to swap between sets of notes.

data/jorts.gschema.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44
<key name="scribbly-mode-active" type="b">
55
<default>false</default>
66
<summary>Change font to an illegible one</summary>
7-
<description>Whether to change font to an illegible one for unfocused sticky notes, for privacy (NOT IMPLEMENTED YET)</description>
8-
</key>
9-
<key name="last-backup" type="s">
10-
<default>""</default>
11-
<summary>Last time saved_state.json was backed up</summary>
12-
<description>Stores the date in string format for the last time a backup happened. If empty, then the app was just installed, do it immediately (NOT IMPLEMENTED YET)</description>
7+
<description>Whether to change font to an illegible one for unfocused sticky notes, for privacy</description>
138
</key>
149
<key name="hide-bar" type="b">
1510
<default>false</default>

data/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ i18n.merge_file(
2929
#======== ICONS ========
3030

3131
# Install our icons in all the required sizes
32-
variant = 'halloween'
32+
# "variant" variable has been declared earlier in the base meson
3333
icon_sizes = ['16', '24', '32', '48', '64', '128']
3434

3535
foreach i : icon_sizes

io.github.ellie_commons.jorts.flathub.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ modules:
5050

5151
- name: jorts
5252
buildsystem: meson
53+
config-opts:
54+
- -Dvariant=['default']
5355
sources:
5456
- type: git
5557
url: https://github.com/ellie-commons/jorts.git

io.github.ellie_commons.jorts.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ modules:
4848

4949
- name: jorts
5050
buildsystem: meson
51+
config-opts:
52+
- -Dvariant=['default']
5153
sources:
5254
- type: dir
5355
path: .

meson.build

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ i18n = import('i18n')
99
add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (meson.project_name()), language:'c')
1010

1111

12+
vala_flags = []
13+
variant = get_option('variant')[0]
14+
15+
if variant == 'pride'
16+
vala_flags = ['--define', 'PRIDE']
17+
elif variant == 'halloween'
18+
vala_flags = ['--define', 'HALLOWEEN']
19+
else
20+
vala_flags = ['--define', 'DEFAULT']
21+
endif
22+
23+
add_project_arguments(vala_flags, language: 'vala')
24+
25+
1226
#================================
1327
# Import the stylesheet
1428

meson_options.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
option('variant',
2+
type : 'array',
3+
choices : ['default', 'pride', 'halloween'],
4+
value : ['default'],
5+
description : 'The name of the seasonal icon and style to use. Only the first value is chosen.'
6+
)

src/Objects/NoteData.vala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ public class Jorts.NoteData : Object {
9090
builder.add_string_value (title);
9191
builder.set_member_name ("theme");
9292
builder.add_string_value (theme.to_string ());
93+
94+
//TODO: save Color alongside theme for awhile. Later we can load it instead and drop string methods
95+
builder.set_member_name ("color");
96+
builder.add_int_value (theme);
97+
9398
builder.set_member_name ("content");
9499
builder.add_string_value (content);
95100
builder.set_member_name ("monospace");

src/Objects/Themes.vala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public enum Jorts.Themes {
7474
/**
7575
* recover Enum from a stored string, using when loading from storage
7676
*/
77+
//TODO: Retire this one day
7778
public static Themes from_string (string wtf_is_this) {
7879
switch (wtf_is_this.ascii_up ()) {
7980
case "BLUEBERRY": return BLUEBERRY;
@@ -86,7 +87,7 @@ public enum Jorts.Themes {
8687
case "GRAPE": return GRAPE;
8788
case "COCOA": return COCOA;
8889
case "SLATE": return SLATE;
89-
default: assert_not_reached ();
90+
default: return BLUEBERRY;
9091
}
9192
}
9293

src/Services/Constants.vala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ namespace Jorts.Constants {
1515
const string DONATE_LINK = "https://ko-fi.com/teamcons";
1616

1717
// signature theme
18+
#if PRIDE
19+
const Jorts.Themes DEFAULT_THEME = Jorts.Themes.BUBBLEGUM;
20+
#elif HALLOWEEN
1821
const Jorts.Themes DEFAULT_THEME = Jorts.Themes.ORANGE;
22+
#else
23+
const Jorts.Themes DEFAULT_THEME = Jorts.Themes.BLUEBERRY;
24+
#endif
1925

2026
// in ms
2127
const int DEBOUNCE = 1000;

0 commit comments

Comments
 (0)