gtk2checkboxes 3.0.210824 → 3.1.230114

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a3aa0e1c6fc4ebeceadfdb2c66cd1854f1080705e0c1f55ab5b9da208df1fb8
4
- data.tar.gz: 5bda88fc508e53bf1073b8b1189ace648897d934d8d9cc9e55495a6ed73bd99b
3
+ metadata.gz: 54af47cbb509ad01829de8bcef5815fce9d9eda1b845ef3028673ef6f6beaf26
4
+ data.tar.gz: 28072059b0dc6db2188ead8ce21c5237b929ad8255916ecdea0414ca58776550
5
5
  SHA512:
6
- metadata.gz: dff60370ab48dcb29c090c9f96684a17e3276c54b7b131d9fcb00ada0b5287c9e0101354fb896431312622970250b8bbb1560b26adb29a934576473cffacf669
7
- data.tar.gz: a46fd4cc94ce02045aad78650ed556f6bfba8545b70cf015fbdcfcfd0cd3cb0a081b12090ddd37d46fab0e5812d320904b33cc7d3e76b6e7813e928b40712fc2
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.0.210824](https://github.com/carlosjhr64/gtk2checkboxes/releases)
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
- ![Day Mode](img/snapshot.png)
7
+ ![snapshot](img/snapshot.png)
8
8
 
9
9
  ## DESCRIPTION
10
10
 
11
- Create a simple shopping list.
12
- Maintain a check list of reacuring chores.
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
- ```shell
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
- ## More
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
- * Mouse button 1 on logo: minime
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
- You can change your editor from `gedit` to something else in the configuration
42
- file. The process should not detach(go to background). For example, I edited
43
- my `Editor:` key from:
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
- to:
56
+ To:
57
+
58
+ Editor: "nvim-qt --geometry 725x936 --nofork $cachefile",
48
59
 
49
- Editor: "foot -W 80x13 nvim $cachefile 2>/dev/null",
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
- Note that the tasks cache file is markdown.
52
- Any line that matches `/^- \[x| \] /` is considered to be a check box and
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) 2021 CarlosJHR64
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: {show: a0},
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(*par)
4
- super(*par)
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(*par)
10
- Such::Label.new child, *par
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(*par)
23
- super(*par)
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(*par)
29
- @entry = Such::Entry.new child, *par
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 page, item, false
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 text, touch:true
219
+ add_page(text, touch:true).show_all
196
220
  end
197
221
  end
198
222
  Such::Button.new @tools, :delete_page! do
@@ -9,7 +9,7 @@ class Gtk2CheckBoxes
9
9
  --notoggle \t Minime wont toggle decorated and keep above
10
10
  --notdecorated\t Dont decorate window
11
11
  HELP
12
- VERSION = '3.0.210824'
12
+ VERSION = '3.1.230114'
13
13
 
14
14
  def self.run
15
15
  # StdLib
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.0.210824
4
+ version: 3.1.230114
5
5
  platform: ruby
6
6
  authors:
7
- - carlosjhr64
8
- autorequire:
7
+ - CarlosJHR64
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-24 00:00:00.000000000 Z
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.1'
19
+ version: '5.4'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 5.1.210203
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.1'
29
+ version: '5.4'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 5.1.210203
32
+ version: 5.4.230109
33
33
  description: |
34
- Create a simple shopping list.
35
- Maintain a check list of reacuring chores.
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.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux]'
72
- - 'gedit: gedit - Version 40.1'
73
- rubygems_version: 3.2.22
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: Create a simple shopping list. Maintain a check list of reacuring chores.
77
- Anything that one would make a check list for.
72
+ summary: More than just check-boxes. Create a simple check list, bookmarks, or start
73
+ menu.
78
74
  test_files: []