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 +4 -4
- data/README.rdoc +2 -1
- data/data/VERSION +1 -1
- data/lib/gtk3app.rb +25 -1
- data/lib/gtk3app/dialog/dialogs.rb +59 -0
- data/lib/gtk3app/gtk3app.rb +1 -1
- data/lib/gtk3app/version.rb +1 -1
- data/lib/gtk3app/widget/widgets.rb +1 -0
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 169460b6e138bf15bd30d2ea36d31e4e813394c8
|
4
|
+
data.tar.gz: 3ebd9eb5acb24a96c9b86bf41a8146d6b0bb323a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad83ecb96ff961283b30095a2d7be9b5f68ef1add4e3a961696849b21837c08b1bc5c1196c5f5f5a0c2a2f8508603325b0cba3f010b693bac083198bfd4892bb
|
7
|
+
data.tar.gz: 389c1039cc9da16c61323ab0c761417b7b11d3aec0d025dd5678e1f31721093a4278e7b8c8a609b9d41246991e0de42a259ca756ff8c00b84ce12ff7f8bb0d3d
|
data/README.rdoc
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
_Gtk3App_ provides a _Gtk3_ application stub.
|
8
8
|
|
9
|
-
It
|
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 ...
|
data/data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.4.0
|
data/lib/gtk3app.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/gtk3app/gtk3app.rb
CHANGED
@@ -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)
|
data/lib/gtk3app/version.rb
CHANGED
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.
|
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-
|
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.
|
59
|
+
version: '1.2'
|
60
60
|
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 1.
|
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.
|
69
|
+
version: '1.2'
|
70
70
|
- - ">="
|
71
71
|
- !ruby/object:Gem::Version
|
72
|
-
version: 1.
|
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
|
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
|