Germinal 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/germinal.gresource.xml +2 -0
- data/data/terminal-menu.ui +18 -0
- data/data/window-menu.ui +26 -0
- data/lib/application.rb +12 -0
- data/lib/terminal.rb +11 -19
- data/lib/window.rb +36 -18
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25f734b1b9677293d5d77a0b1327269bdb3cbdf5
|
4
|
+
data.tar.gz: 1e77a4b1243af8d88fed13892e96a8ba9f273f7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3d7b4102322df36b315624a6e7ef3eb83a29ecbb83edefda65aa6e21b28ccf97fa1737c6faa3e1196202b13ba298b8bafb5e833a7e596e7097595075cda4dd2
|
7
|
+
data.tar.gz: 79237ff4efd4be2ee4c97cb20d5eb6f2c4230cde19fe3ec285a45af07ebb9066974f02b49f7856b238ca2b77f269d3392e20e73d82b1e813047f76081ff9bcd8
|
data/data/germinal.gresource.xml
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
<gresource prefix="/com/github/cedlemo/germinal">
|
4
4
|
<file preprocess="xml-stripblanks">window.ui</file>
|
5
5
|
<file preprocess="xml-stripblanks">app-menu.ui</file>
|
6
|
+
<file preprocess="xml-stripblanks">window-menu.ui</file>
|
7
|
+
<file preprocess="xml-stripblanks">terminal-menu.ui</file>
|
6
8
|
<file>germinal.css</file>
|
7
9
|
<file>application-exit-symbolic.svg</file>
|
8
10
|
<file>color-select-symbolic.svg</file>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<interface>
|
3
|
+
<!-- interface-requires gtk+ 3.0 -->
|
4
|
+
<menu id="termmenu">
|
5
|
+
<section>
|
6
|
+
<item>
|
7
|
+
<attribute name="label">Copy</attribute>
|
8
|
+
<attribute name="action">app.term_copy</attribute>
|
9
|
+
<attribute name="verb-icon">edit-copy-symbolic</attribute>
|
10
|
+
</item>
|
11
|
+
<item>
|
12
|
+
<attribute name="label">Paste</attribute>
|
13
|
+
<attribute name="action">app.term_paste</attribute>
|
14
|
+
<attribute name="verb-icon">edit-paste-symbolic</attribute>
|
15
|
+
</item>
|
16
|
+
</section>
|
17
|
+
</menu>
|
18
|
+
</interface>
|
data/data/window-menu.ui
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<interface>
|
3
|
+
<!-- interface-requires gtk+ 3.0 -->
|
4
|
+
<menu id="winmenu">
|
5
|
+
<section>
|
6
|
+
<item >
|
7
|
+
<attribute name="label" translatable="yes" >_Css Configuration Editor</attribute>
|
8
|
+
</item>
|
9
|
+
<item>
|
10
|
+
<attribute name="label" translatable="yes">_Preferences</attribute>
|
11
|
+
<attribute name="action">app.preferences</attribute>
|
12
|
+
</item>
|
13
|
+
<item>
|
14
|
+
<attribute name="label" translatable="yes">_About</attribute>
|
15
|
+
<attribute name="action">app.about</attribute>
|
16
|
+
</item>
|
17
|
+
</section>
|
18
|
+
|
19
|
+
<section>
|
20
|
+
<item>
|
21
|
+
<attribute name="label" translatable="yes">_Quit</attribute>
|
22
|
+
<attribute name="action">app.quit</attribute>
|
23
|
+
</item>
|
24
|
+
</section>
|
25
|
+
</menu>
|
26
|
+
</interface>
|
data/lib/application.rb
CHANGED
@@ -43,6 +43,18 @@ class GerminalApplication < Gtk::Application
|
|
43
43
|
end
|
44
44
|
application.add_action(action)
|
45
45
|
|
46
|
+
action = Gio::SimpleAction.new("term_copy")
|
47
|
+
action.signal_connect("activate") do |_action, _parameter|
|
48
|
+
application.windows[0].notebook.current.copy_clipboard
|
49
|
+
end
|
50
|
+
application.add_action(action)
|
51
|
+
|
52
|
+
action = Gio::SimpleAction.new("term_paste")
|
53
|
+
action.signal_connect("activate") do |_action, _parameter|
|
54
|
+
application.windows[0].notebook.current.paste_clipboard
|
55
|
+
end
|
56
|
+
application.add_action(action)
|
57
|
+
|
46
58
|
builder = Gtk::Builder.new(:resource => "/com/github/cedlemo/germinal/app-menu.ui")
|
47
59
|
app_menu = builder.get_object("appmenu")
|
48
60
|
application.set_app_menu(app_menu)
|
data/lib/terminal.rb
CHANGED
@@ -13,23 +13,6 @@
|
|
13
13
|
#
|
14
14
|
# You should have received a copy of the GNU General Public License
|
15
15
|
# along with Germinal. If not, see <http://www.gnu.org/licenses/>.
|
16
|
-
class GerminalMenu < Gtk::Menu
|
17
|
-
def initialize(vte)
|
18
|
-
super()
|
19
|
-
copyitem = Gtk::MenuItem.new(:label => "Copy")
|
20
|
-
copyitem.signal_connect "activate" do
|
21
|
-
vte.copy_clipboard
|
22
|
-
end
|
23
|
-
append(copyitem)
|
24
|
-
|
25
|
-
pasteitem = Gtk::MenuItem.new(:label => "Paste")
|
26
|
-
pasteitem.signal_connect "activate" do
|
27
|
-
vte.paste_clipboard
|
28
|
-
end
|
29
|
-
append(pasteitem)
|
30
|
-
show_all
|
31
|
-
end
|
32
|
-
end
|
33
16
|
|
34
17
|
TERMINAL_COLOR_NAMES = [:foreground, :background, :black, :red, :green, :yellow, :blue, :magenta, :cyan, :white,
|
35
18
|
:brightblack, :brightred, :brightgreen, :brightyellow, :brightblue, :brightmagenta, :brightcyan, :brightwhite]
|
@@ -95,12 +78,21 @@ class GerminalTerminal < Vte::Terminal
|
|
95
78
|
end
|
96
79
|
end
|
97
80
|
|
98
|
-
|
81
|
+
builder = Gtk::Builder.new(:resource => "/com/github/cedlemo/germinal/terminal-menu.ui")
|
82
|
+
@menu = Gtk::Popover.new(self, builder["termmenu"])
|
83
|
+
|
99
84
|
signal_connect "button-press-event" do |widget, event|
|
100
85
|
if event.type == Gdk::EventType::BUTTON_PRESS &&
|
101
86
|
event.button == Gdk::BUTTON_SECONDARY
|
102
87
|
|
103
|
-
|
88
|
+
x, y = event.window.coords_to_parent(event.x,
|
89
|
+
event.y)
|
90
|
+
rect = Gdk::Rectangle.new(x - allocation.x,
|
91
|
+
y - allocation.y,
|
92
|
+
1,
|
93
|
+
1)
|
94
|
+
widget.menu.set_pointing_to(rect)
|
95
|
+
widget.menu.show
|
104
96
|
true
|
105
97
|
else
|
106
98
|
false
|
data/lib/window.rb
CHANGED
@@ -13,8 +13,6 @@
|
|
13
13
|
#
|
14
14
|
# You should have received a copy of the GNU General Public License
|
15
15
|
# along with Germinal. If not, see <http://www.gnu.org/licenses/>.
|
16
|
-
#require "#{CURRENT_PATH}/resize_message.rb"
|
17
|
-
#require "#{CURRENT_PATH}/css_editor.rb"
|
18
16
|
|
19
17
|
class GerminalWindow < Gtk::ApplicationWindow
|
20
18
|
attr_reader :notebook, :bar, :overlay, :current_label, :current_tab, :css_editor_style
|
@@ -213,19 +211,17 @@ class GerminalWindow < Gtk::ApplicationWindow
|
|
213
211
|
end
|
214
212
|
|
215
213
|
def add_buttons_at_begining
|
216
|
-
button = gen_icon_button("pan-start-symbolic")
|
217
|
-
button.tooltip_text = "Prev"
|
218
|
-
button.signal_connect("clicked") { @notebook.cycle_prev_page }
|
214
|
+
button = gen_icon_button("pan-start-symbolic", "prev") { @notebook.cycle_prev_page }
|
219
215
|
@bar.pack_start(button)
|
216
|
+
|
220
217
|
@bar.pack_start(@current_tab)
|
221
|
-
|
222
|
-
button
|
223
|
-
button.signal_connect("clicked") { @notebook.cycle_next_page }
|
218
|
+
|
219
|
+
button = gen_icon_button("pan-end-symbolic", "next") { @notebook.cycle_next_page }
|
224
220
|
@bar.pack_start(button)
|
221
|
+
|
225
222
|
@bar.pack_start(@current_label)
|
226
|
-
|
227
|
-
button
|
228
|
-
button.signal_connect("clicked") do
|
223
|
+
|
224
|
+
button = gen_icon_button("tab-new-symbolic", "New terminal") do
|
229
225
|
add_terminal
|
230
226
|
@notebook.set_page(@notebook.n_pages - 1)
|
231
227
|
end
|
@@ -233,27 +229,49 @@ class GerminalWindow < Gtk::ApplicationWindow
|
|
233
229
|
end
|
234
230
|
|
235
231
|
def add_buttons_at_end
|
236
|
-
button = gen_icon_button("
|
237
|
-
|
232
|
+
button = gen_icon_button("open-menu-symbolic", "Main Menu") do
|
233
|
+
builder = Gtk::Builder.new(:resource => "/com/github/cedlemo/germinal/window-menu.ui")
|
234
|
+
menu = Gtk::Menu.new(builder["winmenu"])
|
235
|
+
menu.attach_to_widget(button)
|
236
|
+
|
237
|
+
menu.children[0].signal_connect "activate" do
|
238
|
+
css_editor = GerminalCssEditor.new(self)
|
239
|
+
@notebook.append_page(css_editor, Gtk::Label.new)
|
240
|
+
@notebook.set_page(@notebook.n_pages - 1)
|
241
|
+
end
|
242
|
+
|
243
|
+
menu.show_all
|
244
|
+
event = Gtk.current_event
|
245
|
+
menu.popup(nil, nil, event.button, event.time)
|
246
|
+
end
|
247
|
+
@bar.pack_end(button)
|
248
|
+
|
249
|
+
button = gen_icon_button("font-select-symbolic", "Set font") do
|
238
250
|
toggle_overlay(GerminalFontSelector) if @notebook.current.class == GerminalTerminal
|
239
251
|
end
|
240
252
|
@bar.pack_end(button)
|
241
|
-
|
242
|
-
button
|
253
|
+
|
254
|
+
button = gen_icon_button("color-select-symbolic", "Set colors") do
|
243
255
|
toggle_overlay(GerminalColorSelector) if @notebook.current.class == GerminalTerminal
|
244
256
|
end
|
245
257
|
@bar.pack_end(button)
|
246
|
-
|
247
|
-
button
|
258
|
+
|
259
|
+
button = gen_icon_button("emblem-photos-symbolic", "Terminals overview") do
|
248
260
|
toggle_overlay(GerminalTermChooser)
|
249
261
|
end
|
250
262
|
@bar.pack_end(button)
|
251
263
|
end
|
252
264
|
|
253
|
-
def gen_icon_button(icon_name)
|
265
|
+
def gen_icon_button(icon_name, tooltip)
|
254
266
|
button = Gtk::Button.new
|
255
267
|
image = Gtk::Image.new(:icon_name => icon_name, :size => :button)
|
256
268
|
button.add(image)
|
269
|
+
button.tooltip_text = tooltip
|
270
|
+
if block_given?
|
271
|
+
button.signal_connect "clicked" do
|
272
|
+
yield
|
273
|
+
end
|
274
|
+
end
|
257
275
|
button
|
258
276
|
end
|
259
277
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Germinal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cédric LE MOIGNE
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: vte3
|
@@ -91,7 +91,9 @@ files:
|
|
91
91
|
- data/pan-end-symbolic.svg
|
92
92
|
- data/pan-start-symbolic.svg
|
93
93
|
- data/tab-new-symbolic.svg
|
94
|
+
- data/terminal-menu.ui
|
94
95
|
- data/window-close-symbolic.svg
|
96
|
+
- data/window-menu.ui
|
95
97
|
- data/window.ui
|
96
98
|
- lib/application.rb
|
97
99
|
- lib/color_selector.rb
|