gtk2checkboxes 3.0.210824 → 3.1.230114
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.
- checksums.yaml +4 -4
- data/README.md +64 -24
- data/lib/gtk2checkboxes/config.rb +13 -7
- data/lib/gtk2checkboxes/gtk2checkboxes.rb +36 -12
- data/lib/gtk2checkboxes.rb +1 -1
- metadata +17 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54af47cbb509ad01829de8bcef5815fce9d9eda1b845ef3028673ef6f6beaf26
|
4
|
+
data.tar.gz: 28072059b0dc6db2188ead8ce21c5237b929ad8255916ecdea0414ca58776550
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2d5bcf78fe9730c57821a860af0e8d91e8865ece775bd16a3e8d31b7293a839dd19029326cd521fc361e7fb69405b539f113fe68e5432637cce8ab7bcc13f49
|
7
|
+
data.tar.gz: 84510c9dcd9ab447528de54647062c9646e6406e418748ebd7c96e815e452384bca31408e02b226df70919c4aa2ca441108afc72de95924e14cc0993ea65aebf
|
data/README.md
CHANGED
@@ -1,26 +1,22 @@
|
|
1
1
|
# Ruby-Gnome CheckBoxes
|
2
2
|
|
3
|
-
* [VERSION 3.
|
3
|
+
* [VERSION 3.1.230114](https://github.com/carlosjhr64/gtk2checkboxes/releases)
|
4
4
|
* [github](https://www.github.com/carlosjhr64/gtk2checkboxes)
|
5
5
|
* [rubygems](https://rubygems.org/gems/gtk2checkboxes)
|
6
6
|
|
7
|
-

|
8
8
|
|
9
9
|
## DESCRIPTION
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
Anything that one would make a check list for.
|
14
|
-
|
15
|
-
Just a really simple app.
|
16
|
-
Allows for multiple lists.
|
11
|
+
More than just check-boxes.
|
12
|
+
Create a simple check list, bookmarks, or start menu.
|
17
13
|
|
18
14
|
## INSTALL
|
19
15
|
```shell
|
20
16
|
gem install gtk2checkboxes
|
21
17
|
```
|
22
18
|
## HELP
|
23
|
-
```
|
19
|
+
```console
|
24
20
|
$ gtk2checkboxes --help
|
25
21
|
Usage:
|
26
22
|
gtk2checkboxes [:options+]
|
@@ -31,33 +27,77 @@ Options:
|
|
31
27
|
--notoggle Minime wont toggle decorated and keep above
|
32
28
|
--notdecorated Dont decorate window
|
33
29
|
```
|
34
|
-
##
|
30
|
+
## Logo mouse clicks
|
31
|
+
|
32
|
+
Mouse clicks on logo:
|
33
|
+
|
34
|
+
+ Button 1: minime
|
35
|
+
+ Button 2: nothing
|
36
|
+
+ Button 3: application menu
|
35
37
|
|
36
|
-
|
37
|
-
* Mouse button 2 on logo: app menu
|
38
|
-
* Toolbar "Edit" button opens the tasks markdown file with `gedit` by default
|
39
|
-
* Configuration file: `~/.config/gtk3app/gtk2checkboxes/config-*.rbon`
|
38
|
+
## Tool-bar buttons
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
|
40
|
+
* `Append item` to quickly add a check list item to the current list
|
41
|
+
* `Edit` to open the list's markdown file
|
42
|
+
* `Rename` to rename the current list
|
43
|
+
* `Add` to add a new list
|
44
|
+
* `Delete` to delete the current list
|
45
|
+
|
46
|
+
## Configuration
|
47
|
+
|
48
|
+
+ Configuration file: `~/.config/gtk3app/gtk2checkboxes/config-*.rbon`
|
49
|
+
|
50
|
+
You can change your editor to something else,
|
51
|
+
but the process should not detach(go to background).
|
52
|
+
For example, I edited my `Editor:` key from:
|
44
53
|
|
45
54
|
Editor: "gedit $cachefile",
|
46
55
|
|
47
|
-
|
56
|
+
To:
|
57
|
+
|
58
|
+
Editor: "nvim-qt --geometry 725x936 --nofork $cachefile",
|
48
59
|
|
49
|
-
|
60
|
+
## Check-boxes
|
61
|
+
|
62
|
+
In the list's markdown file:
|
63
|
+
Any line that looks like `- [ ] item` is considered to be a check box:
|
64
|
+
```markdown
|
65
|
+
- [ ] This is a unchecked item
|
66
|
+
- [x] This is a checked item
|
67
|
+
```
|
68
|
+
## Links
|
69
|
+
|
70
|
+
In the list's markdown file:
|
71
|
+
Any line that looks like `* [link](target)` is considered to be a link.
|
72
|
+
The target will be open by it's preferred application:
|
73
|
+
```markdown
|
74
|
+
* [Link to github](https://github.com)
|
75
|
+
```
|
76
|
+
## Commands
|
77
|
+
|
78
|
+
In the list's markdown file:
|
79
|
+
Any line that looks like `+ command: executable` is considered to be a command.
|
80
|
+
The executable is spawn when the command button is clicked:
|
81
|
+
```markdown
|
82
|
+
+ Spawn X-terminal: xterm
|
83
|
+
```
|
84
|
+
## Plain labels
|
85
|
+
|
86
|
+
In the list's markdown file:
|
87
|
+
Any line that looks like `* label` is considered to be a label:
|
88
|
+
```markdown
|
89
|
+
* Hello!
|
90
|
+
```
|
91
|
+
## Additional notes
|
50
92
|
|
51
|
-
|
52
|
-
|
53
|
-
should be followed by an item to be checked off.
|
54
|
-
All other lines are ignored by the application.
|
93
|
+
Lines in the list's markdown file that does not match
|
94
|
+
any of the above match cases is ignored.
|
55
95
|
|
56
96
|
## LICENSE
|
57
97
|
|
58
98
|
(The MIT License)
|
59
99
|
|
60
|
-
Copyright (c)
|
100
|
+
Copyright (c) 2023 CarlosJHR64
|
61
101
|
|
62
102
|
Permission is hereby granted, free of charge, to any person obtaining
|
63
103
|
a copy of this software and associated documentation files (the
|
@@ -4,10 +4,11 @@ class Gtk2CheckBoxes
|
|
4
4
|
|
5
5
|
CACHE = File.join UserSpace::XDG['cache'], 'gtk3app', 'gtk2checkboxes'
|
6
6
|
DATA_DIR = File.join UserSpace::XDG['data'], 'gtk3app', 'gtk2checkboxes'
|
7
|
+
EDITOR = `which gedit mousepad pluma kwrite`.split.first || 'xterm -e vi'
|
7
8
|
|
8
9
|
CONFIG = {
|
10
|
+
Editor: "#{EDITOR} $cachefile",
|
9
11
|
DefaultTab: 'TODO',
|
10
|
-
Editor: 'gedit $cachefile',
|
11
12
|
HelpFile: 'https://github.com/carlosjhr64/gtk2checkboxes',
|
12
13
|
Logo: "#{DATA_DIR}/logo.png",
|
13
14
|
|
@@ -22,7 +23,7 @@ class Gtk2CheckBoxes
|
|
22
23
|
|
23
24
|
DIALOG_ENTRY: a0,
|
24
25
|
dialog_entry: h0,
|
25
|
-
dialog_entry!: [:DIALOG_ENTRY, :dialog_entry],
|
26
|
+
dialog_entry!: [:DIALOG_ENTRY, :dialog_entry, 'activate'],
|
26
27
|
|
27
28
|
ITEM_DIALOG: [title: 'Append Item'],
|
28
29
|
item_dialog: h0,
|
@@ -64,16 +65,21 @@ class Gtk2CheckBoxes
|
|
64
65
|
tab_label: h0,
|
65
66
|
|
66
67
|
VBOX: [:vertical],
|
67
|
-
vbox: {
|
68
|
-
into: [:append_page],
|
69
|
-
show: a0,
|
70
|
-
},
|
68
|
+
vbox: {into: [:append_page]},
|
71
69
|
vbox!: [:VBOX, :vbox],
|
72
70
|
|
73
71
|
CHECKBUTTON: a0,
|
74
|
-
checkbutton:
|
72
|
+
checkbutton: h0,
|
75
73
|
checkbutton!: [:CHECKBUTTON, :checkbutton],
|
76
74
|
|
75
|
+
LABEL: a0,
|
76
|
+
label: {set_xalign: 0.01},
|
77
|
+
label!: [:LABEL, :label],
|
78
|
+
|
79
|
+
BUTTON: a0,
|
80
|
+
button: {set_xalign: 0.01},
|
81
|
+
button!: [:BUTTON, :button],
|
82
|
+
|
77
83
|
HBOX: [:horizontal],
|
78
84
|
hbox: h0,
|
79
85
|
hbox!: [:HBOX, :hbox],
|
@@ -1,13 +1,13 @@
|
|
1
1
|
class Gtk2CheckBoxes
|
2
2
|
class YesNo < Such::Dialog
|
3
|
-
def initialize(
|
4
|
-
super(
|
3
|
+
def initialize(key)
|
4
|
+
super(key)
|
5
5
|
add_button Gtk::Stock::NO, Gtk::ResponseType::CANCEL
|
6
6
|
add_button Gtk::Stock::YES, Gtk::ResponseType::OK
|
7
7
|
end
|
8
8
|
|
9
|
-
def label(
|
10
|
-
Such::Label.new child,
|
9
|
+
def label(key)
|
10
|
+
Such::Label.new child, key
|
11
11
|
end
|
12
12
|
|
13
13
|
def yes?
|
@@ -19,14 +19,14 @@ class Gtk2CheckBoxes
|
|
19
19
|
end
|
20
20
|
|
21
21
|
class EntryDialog < Such::Dialog
|
22
|
-
def initialize(
|
23
|
-
super(
|
22
|
+
def initialize(key)
|
23
|
+
super(key)
|
24
24
|
add_button Gtk::Stock::CANCEL, Gtk::ResponseType::CANCEL
|
25
|
-
add_button Gtk::Stock::OK, Gtk::ResponseType::OK
|
25
|
+
@ok = add_button Gtk::Stock::OK, Gtk::ResponseType::OK
|
26
26
|
end
|
27
27
|
|
28
|
-
def entry(
|
29
|
-
@entry = Such::Entry.new
|
28
|
+
def entry(key)
|
29
|
+
@entry = Such::Entry.new(child, key){@ok.clicked}
|
30
30
|
end
|
31
31
|
|
32
32
|
def text
|
@@ -49,6 +49,22 @@ class Gtk2CheckBoxes
|
|
49
49
|
File.join CACHE, tab+'.md'
|
50
50
|
end
|
51
51
|
|
52
|
+
# Spawn command defined
|
53
|
+
def add_command(vbox, command, exe)
|
54
|
+
Such::Button.new(vbox, {set_label: command}, :button!){spawn exe}
|
55
|
+
end
|
56
|
+
|
57
|
+
# Open link target with default application:
|
58
|
+
def add_link(vbox, link, url)
|
59
|
+
Such::Button.new(vbox, {set_label: link}, :button!) do
|
60
|
+
system(CONFIG[:Open], url)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def add_label(vbox, text)
|
65
|
+
Such::Label.new(vbox, {set_label: text}, :label!)
|
66
|
+
end
|
67
|
+
|
52
68
|
def add_check_button(vbox, text, status)
|
53
69
|
checkbutton = Such::CheckButton.new(
|
54
70
|
vbox,
|
@@ -81,9 +97,16 @@ class Gtk2CheckBoxes
|
|
81
97
|
add_check_button vbox, $1, false
|
82
98
|
when %r{^\- \[x\] (.*)$}
|
83
99
|
add_check_button vbox, $1, true
|
100
|
+
when %r{^\* \[([^\[\]]+)\]\(([^\(\)]+)\)}
|
101
|
+
add_link vbox, $1, $2
|
102
|
+
when %r{^\* (.*)$}
|
103
|
+
add_label vbox, $1
|
104
|
+
when %r{^\+ ([^:]+): (.*)$}
|
105
|
+
add_command vbox, $1, $2
|
84
106
|
end
|
85
107
|
end
|
86
108
|
end
|
109
|
+
vbox
|
87
110
|
end
|
88
111
|
|
89
112
|
def clear
|
@@ -158,6 +181,7 @@ class Gtk2CheckBoxes
|
|
158
181
|
@notebook.set_tab_label vbox, Such::Label.new([label], :tab_label)
|
159
182
|
populate_page(fn, vbox) if populate and File.exist? fn
|
160
183
|
FileUtils.touch File.join(CACHE, label+'.md') if touch
|
184
|
+
vbox
|
161
185
|
end
|
162
186
|
|
163
187
|
def initialize(stage, toolbar, options)
|
@@ -176,13 +200,13 @@ class Gtk2CheckBoxes
|
|
176
200
|
Such::Button.new @tools, :append_item! do
|
177
201
|
if item = get_new_item(:item_dialog!)
|
178
202
|
append item
|
179
|
-
add_check_button
|
203
|
+
add_check_button(page, item, false).show_all
|
180
204
|
end
|
181
205
|
end
|
182
206
|
Such::Button.new @tools, :edit_page! do
|
183
207
|
start = Time.now
|
184
208
|
system CONFIG[:Editor].sub('$cachefile', cachefile)
|
185
|
-
reload if File.mtime(cachefile) > start
|
209
|
+
reload.show_all if File.mtime(cachefile) > start
|
186
210
|
end
|
187
211
|
Such::Button.new @tools, :rename_page! do
|
188
212
|
if text = get_new_page_name(:rename_dialog!)
|
@@ -192,7 +216,7 @@ class Gtk2CheckBoxes
|
|
192
216
|
end
|
193
217
|
Such::Button.new @tools, :add_page! do
|
194
218
|
if text = get_new_page_name(:add_dialog!)
|
195
|
-
add_page
|
219
|
+
add_page(text, touch:true).show_all
|
196
220
|
end
|
197
221
|
end
|
198
222
|
Such::Button.new @tools, :delete_page! do
|
data/lib/gtk2checkboxes.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gtk2checkboxes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.1.230114
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
autorequire:
|
7
|
+
- CarlosJHR64
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gtk3app
|
@@ -16,27 +16,23 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '5.
|
19
|
+
version: '5.4'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 5.
|
22
|
+
version: 5.4.230109
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - "~>"
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '5.
|
29
|
+
version: '5.4'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 5.
|
32
|
+
version: 5.4.230109
|
33
33
|
description: |
|
34
|
-
|
35
|
-
|
36
|
-
Anything that one would make a check list for.
|
37
|
-
|
38
|
-
Just a really simple app.
|
39
|
-
Allows for multiple lists.
|
34
|
+
More than just check-boxes.
|
35
|
+
Create a simple check list, bookmarks, or start menu.
|
40
36
|
email: carlosjhr64@gmail.com
|
41
37
|
executables:
|
42
38
|
- gtk2checkboxes
|
@@ -53,7 +49,7 @@ homepage: https://github.com/carlosjhr64/gtk2checkboxes
|
|
53
49
|
licenses:
|
54
50
|
- MIT
|
55
51
|
metadata: {}
|
56
|
-
post_install_message:
|
52
|
+
post_install_message:
|
57
53
|
rdoc_options: []
|
58
54
|
require_paths:
|
59
55
|
- lib
|
@@ -68,11 +64,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
68
64
|
- !ruby/object:Gem::Version
|
69
65
|
version: '0'
|
70
66
|
requirements:
|
71
|
-
- 'ruby: ruby 3.0
|
72
|
-
- 'gedit: gedit - Version
|
73
|
-
rubygems_version: 3.
|
74
|
-
signing_key:
|
67
|
+
- 'ruby: ruby 3.2.0 (2022-12-25 revision a528908271) [aarch64-linux]'
|
68
|
+
- 'gedit: gedit - Version 3.38.1'
|
69
|
+
rubygems_version: 3.4.3
|
70
|
+
signing_key:
|
75
71
|
specification_version: 4
|
76
|
-
summary:
|
77
|
-
|
72
|
+
summary: More than just check-boxes. Create a simple check list, bookmarks, or start
|
73
|
+
menu.
|
78
74
|
test_files: []
|