gtk3app 1.3.1 → 1.4.0

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
  SHA1:
3
- metadata.gz: d725799c67ae4a60e8b5a741e1cf4dc6bad1dd5b
4
- data.tar.gz: 8c9ff122ee8e7c79765ad569f4c2bdf1880d04e6
3
+ metadata.gz: 169460b6e138bf15bd30d2ea36d31e4e813394c8
4
+ data.tar.gz: 3ebd9eb5acb24a96c9b86bf41a8146d6b0bb323a
5
5
  SHA512:
6
- metadata.gz: 74f2656f20c518ad9617dee73c114c3296e7d5061347878f0c197178b19e21153bf7d990fb60a7c213ad0ae91911c34aae7560447dd366a163e912b612bd2cce
7
- data.tar.gz: 3fd333df78f8a3e93fec5f68634083680b2bc2b9d591972f7b1bc0c33ec1f7b513e8e5a38453352472a1bca58c93deac00814e3483f6127a1fd017c8d42b1358
6
+ metadata.gz: ad83ecb96ff961283b30095a2d7be9b5f68ef1add4e3a961696849b21837c08b1bc5c1196c5f5f5a0c2a2f8508603325b0cba3f010b693bac083198bfd4892bb
7
+ data.tar.gz: 389c1039cc9da16c61323ab0c761417b7b11d3aec0d025dd5678e1f31721093a4278e7b8c8a609b9d41246991e0de42a259ca756ff8c00b84ce12ff7f8bb0d3d
@@ -6,7 +6,7 @@
6
6
 
7
7
  _Gtk3App_ provides a _Gtk3_ application stub.
8
8
 
9
- It autmatically provides for command line options parsing, user configuration, and minime windows.
9
+ It automatically provides for command line options parsing, user configuration, and minime windows.
10
10
 
11
11
  == SYNOPSIS:
12
12
 
@@ -27,6 +27,7 @@ directory fully explains the rest of what _Gtk3App_ can do for you.
27
27
 
28
28
  == HELP:
29
29
 
30
+ Warning: Gdk constants are missing.
30
31
  This is the gtk3app stub.
31
32
  Usage:
32
33
  gtk3app [options] appname ...
@@ -1 +1 @@
1
- 1.3.1
1
+ 1.4.0
@@ -1,25 +1,49 @@
1
1
  # Standard Libraries
2
+
2
3
  require 'yaml'
3
4
  require 'sdbm'
4
5
 
5
6
  # Supporting Gems
7
+
6
8
  require 'help_parser'
7
9
  require 'user_space'
8
10
  require 'rafini'
9
11
  require 'sys/proctable'
10
12
 
11
13
  # Workhorse Gems
14
+
12
15
  require 'gtk3'
16
+ begin
17
+ # TODO: remove when fixed.
18
+ Gdk::Selection::PRIMARY
19
+ Gdk::Selection::CLIPBOARD
20
+ Gdk::Event::BUTTON_PRESS_MASK
21
+ rescue NameError
22
+ # This is surely a bug in the 2.2.* releases.
23
+ # Just patching what I need for now.
24
+ puts "Warning: Gdk constants are missing."
25
+ Gdk::Selection::PRIMARY ||= 1
26
+ Gdk::Selection::CLIPBOARD ||= 69
27
+ Gdk::Event::BUTTON_PRESS_MASK ||= 256
28
+ end
29
+
13
30
  require 'such'
14
31
  Such::Things.gtk_widget
15
32
 
16
33
  ### Gtk3App ###
34
+
17
35
  # Configuration
36
+
18
37
  require 'gtk3app/version.rb'
19
38
  require 'gtk3app/config.rb'
20
- # Custom Widgets
39
+
40
+ # Custom Widgets & Dialogs
41
+
21
42
  require 'gtk3app/widget/widgets.rb'
43
+ require 'gtk3app/dialog/dialogs.rb'
44
+
22
45
  # Program Flow
46
+
23
47
  require 'gtk3app/slot.rb'
24
48
  require 'gtk3app/program.rb'
25
49
  require 'gtk3app/gtk3app.rb'
@@ -0,0 +1,59 @@
1
+ module Gtk3App
2
+ module Dialog
3
+
4
+ module Runs
5
+ def initialize(*par,&block)
6
+ @block = block
7
+ super(*par)
8
+ end
9
+
10
+ def runs
11
+ set_window_position(:center) if parent and not parent.visible?
12
+ show_all
13
+ response = run
14
+ if block_given?
15
+ response = yield(response)
16
+ elsif @block
17
+ response = @block.call(child, response)
18
+ else
19
+ response = (response==Gtk::ResponseType::OK)
20
+ end
21
+ destroy
22
+ return response
23
+ end
24
+
25
+ # The following is just to save a bit of typing.
26
+
27
+ def label(*par)
28
+ Such::Label.new child, *par
29
+ end
30
+
31
+ def combo(*par)
32
+ Such::ComboBoxText.new child, *par
33
+ end
34
+
35
+ def entry(*par)
36
+ Such::Entry.new child, *par
37
+ end
38
+ end
39
+
40
+ class CancelOk < Such::Dialog
41
+ include Runs
42
+ def initialize(*par)
43
+ super
44
+ add_button(Gtk::Stock::CANCEL, Gtk::ResponseType::CANCEL)
45
+ add_button(Gtk::Stock::OK, Gtk::ResponseType::OK)
46
+ end
47
+ end
48
+
49
+ class NoYes < Such::Dialog
50
+ include Runs
51
+ def initialize(*par)
52
+ super
53
+ add_button('_No', Gtk::ResponseType::CANCEL)
54
+ add_button('_Yes', Gtk::ResponseType::OK)
55
+ end
56
+ end
57
+
58
+ end
59
+ end
@@ -15,7 +15,7 @@ module Gtk3App
15
15
  appname = mod.name.downcase
16
16
  appname.prepend('gtk3app/') unless mod==Gtk3App
17
17
  # UserSpace does its thing...
18
- UserSpace::OPTIONS[:config] = "config-#{version}"
18
+ UserSpace::OPTIONS[:config] = "config-#{version.semantic(0..1)}"
19
19
  user_space = UserSpace.new(appname: appname, appdir: appdir)
20
20
  user_space.install unless user_space.version == version
21
21
  user_space.configures(config)
@@ -1,3 +1,3 @@
1
1
  module Gtk3App
2
- VERSION = '1.3.1'
2
+ VERSION = '1.4.0'
3
3
  end
@@ -51,5 +51,6 @@ module Widget
51
51
  self.add Gtk::Image.new(pixbuf: MainWindow.icon.scale(x,x)).show
52
52
  end
53
53
  end
54
+
54
55
  end
55
56
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gtk3app
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - carlosjhr64
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-29 00:00:00.000000000 Z
11
+ date: 2014-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: help_parser
@@ -56,20 +56,20 @@ dependencies:
56
56
  requirements:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
- version: '1.1'
59
+ version: '1.2'
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: 1.1.0
62
+ version: 1.2.0
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '1.1'
69
+ version: '1.2'
70
70
  - - ">="
71
71
  - !ruby/object:Gem::Version
72
- version: 1.1.0
72
+ version: 1.2.0
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: sys-proctable
75
75
  requirement: !ruby/object:Gem::Requirement
@@ -127,7 +127,7 @@ dependencies:
127
127
  description: |
128
128
  _Gtk3App_ provides a _Gtk3_ application stub.
129
129
 
130
- It autmatically provides for command line options parsing, user configuration, and minime windows.
130
+ It automatically provides for command line options parsing, user configuration, and minime windows.
131
131
  email: carlosjhr64@gmail.com
132
132
  executables:
133
133
  - gtk3app
@@ -142,6 +142,7 @@ files:
142
142
  - data/ruby.png
143
143
  - lib/gtk3app.rb
144
144
  - lib/gtk3app/config.rb
145
+ - lib/gtk3app/dialog/dialogs.rb
145
146
  - lib/gtk3app/gtk3app.rb
146
147
  - lib/gtk3app/program.rb
147
148
  - lib/gtk3app/slot.rb