topinambour 1.0.7 → 1.0.8
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 +4 -10
- data/bin/topinambour +3 -14
- data/data/topinambour.css +9 -17
- data/data/topinambour.gresource +0 -0
- data/lib/headerbar.rb +0 -1
- data/lib/notebook.rb +11 -11
- data/lib/shortcuts.rb +1 -1
- data/lib/terminal.rb +35 -14
- data/lib/terminal_chooser.rb +3 -27
- data/lib/terminal_regex.rb +37 -2
- data/lib/window.rb +7 -29
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9731f01ec7dc60445c7c44ff02d54fc422ca2aa
|
4
|
+
data.tar.gz: d187f4634172dbab1d86b8a174106a1013c2eff0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54a2232474f93220cfdbc90ed920d7ecfb420a1054baee9c2bf6c11af0a7a72973e176f471a97b5523aa0a13467668ad42f791a9470ef25c06a921326e2b721b
|
7
|
+
data.tar.gz: 2d9c1d7e4da1e81198406c14710c578b91b50b8ec219e845d03be0f8d846f6210e14cc7e9d018db84557cd23cfdec4461ac8c73293df690e651f9ee0f67db28d
|
data/README.md
CHANGED
@@ -12,23 +12,17 @@ Topinambour is Terminal written with the Gtk3 and Vte3 ruby bindings from the pr
|
|
12
12
|
|
13
13
|
## Features
|
14
14
|
|
15
|
-
*
|
16
|
-
*
|
17
|
-
<a href="https://raw.github.com/cedlemo/topinambour/master/screenshot2.png"><img src="https://raw.github.com/cedlemo/topinambour/master/screenshot2_prev.png" width="576" height="324" alt="Screenshot"></a>
|
18
|
-
|
15
|
+
* Tabs supports
|
16
|
+
* Tabs can be reordered or selected through the preview mode ( `Shift + Ctrl + o` )
|
19
17
|
* Each tab can be named.
|
20
18
|
* The configuration can be done via a Css file
|
21
19
|
* Terminal colors can be changed on the fly and saved in the CSS configuration file
|
22
|
-
<a href="https://raw.github.com/cedlemo/topinambour/master/screenshot3.png"><img src="https://raw.github.com/cedlemo/topinambour/master/screenshot3_prev.png" width="576" height="324" alt="Screenshot"></a>
|
23
20
|
* Terminal font can be changed on the fly and saved in the CSS configuration file
|
24
|
-
<a href="https://raw.github.com/cedlemo/topinambour/master/screenshot4.png"><img src="https://raw.github.com/cedlemo/topinambour/master/screenshot4_prev.png" width="576" height="324" alt="Screenshot"></a>
|
25
|
-
|
26
21
|
* The Css file can be edited in a tab of Topinambour and saved. Each modifications are applied while you are writting them. (Use `Shift + Ctrl + w` to close the editor)
|
27
|
-
|
28
|
-
* Topinambour allows users to modify existing modules. For example if a user copy the css_editor.rb in the directory *~/.config/topinambour/lib/css_editor.rb*, he should be able to modify it in order to fit its needs.
|
22
|
+
* Topinambour allows users to modify existing modules. For example if a user copy the css_editor.rb in the directory *~/.config/topinambour/lib/css_editor.rb*, he should be able to modify it in order to fit its needs.
|
29
23
|
|
30
24
|
## TODO:
|
31
|
-
*
|
25
|
+
* Extand the regex support for colors pattern (hexadecimal or rgb/css form).
|
32
26
|
* Create more Css properties in oder to configure the terminals (cursor shape or blink mode, audible bell or not ...)
|
33
27
|
* Make Topinambour allows users to easily create their own modules. For example create a tab that will act as a MPD client. There will be widgets that control a MPD server and a GtkTree widget that displays the playlist of the MPD server for example.
|
34
28
|
|
data/bin/topinambour
CHANGED
@@ -25,30 +25,19 @@ require "fileutils"
|
|
25
25
|
require "sass"
|
26
26
|
|
27
27
|
CURRENT_PATH = File.expand_path(File.dirname(__FILE__))
|
28
|
-
ROOT_PATH = File.expand_path("#{CURRENT_PATH}/..")
|
29
28
|
LIB_PATH = "#{CURRENT_PATH}/../lib"
|
30
29
|
DATA_PATH = "#{CURRENT_PATH}/../data"
|
31
30
|
CONFIG_DIR = File.expand_path("#{ENV['HOME']}/.config/topinambour")
|
32
31
|
USR_CSS = "#{CONFIG_DIR}/topinambour.css"
|
33
32
|
USR_LIB_PATH = "#{CONFIG_DIR}/lib"
|
34
|
-
gresource_bin = "/
|
35
|
-
gresource_xml = "#{DATA_PATH}/topinambour.gresource.xml"
|
36
|
-
|
37
|
-
system("glib-compile-resources",
|
38
|
-
"--target", gresource_bin,
|
39
|
-
"--sourcedir", File.dirname(gresource_xml),
|
40
|
-
gresource_xml)
|
41
|
-
|
42
|
-
at_exit do
|
43
|
-
FileUtils.rm_f(gresource_bin)
|
44
|
-
end
|
33
|
+
gresource_bin = "#{DATA_PATH}/topinambour.gresource"
|
45
34
|
|
46
35
|
resource = Gio::Resource.load(gresource_bin)
|
47
36
|
Gio::Resources.register(resource)
|
48
37
|
# Load default libraries !!WARNING!! loading order matters
|
49
|
-
|
38
|
+
|
50
39
|
%w(actions style_properties css_handler application terminal_regex terminal notebook color_selector font_selector
|
51
|
-
terminal_chooser headerbar shortcuts window
|
40
|
+
terminal_chooser headerbar shortcuts window css_editor).each do |l|
|
52
41
|
if File.exist?("#{USR_LIB_PATH}/#{l}.rb")
|
53
42
|
require "#{USR_LIB_PATH}/#{l}.rb"
|
54
43
|
else
|
data/data/topinambour.css
CHANGED
@@ -25,32 +25,24 @@
|
|
25
25
|
-TopinambourWindow-width: 1000;*/
|
26
26
|
}
|
27
27
|
|
28
|
-
TopinambourWindow
|
28
|
+
TopinambourWindow headerbar entry{
|
29
29
|
border-radius: 4px;
|
30
30
|
}
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
border-radius: 6px 0px 0px 0px;
|
35
|
-
}
|
36
|
-
TopinambourWindow GtkOverlay GtkScrolledWindow#terminal_chooser GtkBox{
|
37
|
-
background-color: rgba(49, 150, 188, 0.5);
|
31
|
+
|
32
|
+
#OverviewBox {
|
33
|
+
background-color: rgba(0,0,0,0.2);
|
38
34
|
border: solid 1px rgba(49, 150, 188, 1);
|
39
35
|
border-radius: 6px 0px 0px 6px;
|
40
36
|
}
|
41
37
|
|
42
|
-
|
38
|
+
grid button {
|
43
39
|
margin: 0px;
|
44
40
|
padding: 0px;
|
45
|
-
}
|
46
41
|
|
47
|
-
TopinambourWindow GtkOverlay GtkScrolledWindow GtkGrid GtkButton GtkImage {
|
48
|
-
border: solid 3px rgba(0, 0, 0, 0.0);
|
49
42
|
}
|
50
43
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
border-radius: 0px 6px 0px 6px;
|
44
|
+
grid button image {
|
45
|
+
border: solid 3px rgba(0, 0, 0, 0.0);
|
46
|
+
margin: 0px;
|
47
|
+
padding: 0px;
|
56
48
|
}
|
Binary file
|
data/lib/headerbar.rb
CHANGED
data/lib/notebook.rb
CHANGED
@@ -15,10 +15,8 @@
|
|
15
15
|
# along with Topinambour. If not, see <http://www.gnu.org/licenses/>.
|
16
16
|
class TopinambourNotebook < Gtk::Notebook
|
17
17
|
attr_reader :visible
|
18
|
-
attr_accessor :gen_preview
|
19
18
|
def initialize
|
20
19
|
super()
|
21
|
-
@gen_preview = true
|
22
20
|
signal_connect "hide" do
|
23
21
|
@visible = false
|
24
22
|
end
|
@@ -30,15 +28,7 @@ class TopinambourNotebook < Gtk::Notebook
|
|
30
28
|
signal_connect "switch-page" do |_widget, next_page, next_page_num|
|
31
29
|
toplevel.current_label.text = next_page.terminal_title if next_page.class == TopinambourTerminal
|
32
30
|
toplevel.current_tab.text = "#{next_page_num + 1}/#{n_pages}"
|
33
|
-
|
34
|
-
if page >= 0 && @gen_preview
|
35
|
-
current.queue_draw
|
36
|
-
_x, _y, w, h = current.allocation.to_a
|
37
|
-
pix = current.window.to_pixbuf(0, 0, w, h)
|
38
|
-
current.preview = pix if pix
|
39
|
-
elsif !@gen_preview
|
40
|
-
@gen_preview = true
|
41
|
-
end
|
31
|
+
generate_tab_preview if page >= 0
|
42
32
|
end
|
43
33
|
|
44
34
|
signal_connect "page-reordered" do
|
@@ -83,4 +73,14 @@ class TopinambourNotebook < Gtk::Notebook
|
|
83
73
|
def toggle_visibility
|
84
74
|
@visible ? hide : show
|
85
75
|
end
|
76
|
+
|
77
|
+
def generate_tab_preview
|
78
|
+
_x, _y, w, h = current.allocation.to_a
|
79
|
+
surface = Cairo::ImageSurface.new(Cairo::FORMAT_ARGB32,
|
80
|
+
w, h)
|
81
|
+
cr = Cairo::Context.new(surface)
|
82
|
+
current.draw(cr)
|
83
|
+
pix = surface.to_pixbuf(0, 0, w, h)
|
84
|
+
current.preview = pix if pix
|
85
|
+
end
|
86
86
|
end
|
data/lib/shortcuts.rb
CHANGED
data/lib/terminal.rb
CHANGED
@@ -93,7 +93,9 @@ class TopinambourTerminal
|
|
93
93
|
private
|
94
94
|
|
95
95
|
def parse_css_color(color_name)
|
96
|
-
|
96
|
+
color_index = TERMINAL_COLOR_NAMES.index(color_name.to_sym)
|
97
|
+
color_value = DEFAULT_TERMINAL_COLORS[color_index]
|
98
|
+
default_color = Gdk::RGBA.parse(color_value)
|
97
99
|
color_from_css = style_get_property(color_name)
|
98
100
|
color = color_from_css ? color_from_css : default_color
|
99
101
|
color
|
@@ -110,7 +112,8 @@ class TopinambourTerminal
|
|
110
112
|
|
111
113
|
def add_matches
|
112
114
|
@regexes = [:REGEX_URL_AS_IS, :REGEX_URL_FILE, :REGEX_URL_HTTP,
|
113
|
-
:REGEX_URL_VOIP, :REGEX_EMAIL, :REGEX_NEWS_MAN
|
115
|
+
:REGEX_URL_VOIP, :REGEX_EMAIL, :REGEX_NEWS_MAN,
|
116
|
+
:CSS_COLORS]
|
114
117
|
@regexes.each do |name|
|
115
118
|
regex_name = TopinambourRegex.const_get(name)
|
116
119
|
flags = [GLib::RegexCompileFlags::OPTIMIZE,
|
@@ -138,22 +141,40 @@ class TopinambourTerminal
|
|
138
141
|
def manage_regex_on_click(_widget, event)
|
139
142
|
match, regex_type = match_check_event(event)
|
140
143
|
return nil if regex_type == -1
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
Gio::AppInfo.launch_default_for_uri(modified_match)
|
151
|
-
rescue => e
|
152
|
-
puts "error : #{e.message}\n\tfor match: #{match} of type :#{@regexes[regex_type]}"
|
144
|
+
case @regexes[regex_type]
|
145
|
+
when :REGEX_EMAIL
|
146
|
+
launch_default_for_regex_match("mailto:" + match, @regexes[regex_type])
|
147
|
+
when :REGEX_URL_HTTP
|
148
|
+
launch_default_for_regex_match("http://" + match, @regexes[regex_type])
|
149
|
+
when :CSS_COLORS
|
150
|
+
launch_color_visualizer(match)
|
151
|
+
else
|
152
|
+
launch_default_for_regex_match(match, @regexes[regex_type])
|
153
153
|
end
|
154
154
|
end
|
155
155
|
|
156
156
|
def when_terminal_title_change
|
157
157
|
parent.toplevel.current_label.text = terminal_title
|
158
158
|
end
|
159
|
+
|
160
|
+
def launch_default_for_regex_match(match, regex_type)
|
161
|
+
begin
|
162
|
+
Gio::AppInfo.launch_default_for_uri(match)
|
163
|
+
rescue => e
|
164
|
+
puts "error : #{e.message}\n\tfor match: #{match} of type :#{regex_type}"
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
def launch_color_visualizer(color_name)
|
169
|
+
dialog = Gtk::ColorChooserDialog.new(:title => color_name,
|
170
|
+
:parent => parent.toplevel)
|
171
|
+
dialog.show_editor = true
|
172
|
+
dialog.use_alpha = true
|
173
|
+
dialog.rgba = Gdk::RGBA.parse(color_name)
|
174
|
+
if dialog.run == Gtk::ResponseType::OK
|
175
|
+
clipboard = Gtk::Clipboard.get_default(Gdk::Display.default)
|
176
|
+
clipboard.text = dialog.rgba.to_s
|
177
|
+
end
|
178
|
+
dialog.destroy
|
179
|
+
end
|
159
180
|
end
|
data/lib/terminal_chooser.rb
CHANGED
@@ -22,11 +22,12 @@ class TopinambourTermChooser < Gtk::ScrolledWindow
|
|
22
22
|
set_valign(:center)
|
23
23
|
set_name("terminal_chooser")
|
24
24
|
|
25
|
-
|
25
|
+
window.notebook.generate_tab_preview
|
26
26
|
generate_grid
|
27
27
|
fill_grid
|
28
28
|
|
29
29
|
@box = Gtk::Box.new(:vertical, 4)
|
30
|
+
@box.name = "OverviewBox"
|
30
31
|
@box.pack_start(@grid, :expand => true, :fill => true, :padding => 4)
|
31
32
|
add(@box)
|
32
33
|
end
|
@@ -92,10 +93,7 @@ class TopinambourTermChooser < Gtk::ScrolledWindow
|
|
92
93
|
button = Gtk::Button.new
|
93
94
|
button.add(generate_preview_image(child.preview))
|
94
95
|
button.set_tooltip_text(i.to_s)
|
95
|
-
button.signal_connect
|
96
|
-
@window.notebook.gen_preview = false
|
97
|
-
@window.notebook.set_current_page(i)
|
98
|
-
end
|
96
|
+
button.signal_connect("clicked") { @window.notebook.current_page = i }
|
99
97
|
button
|
100
98
|
end
|
101
99
|
|
@@ -121,28 +119,6 @@ class TopinambourTermChooser < Gtk::ScrolledWindow
|
|
121
119
|
button
|
122
120
|
end
|
123
121
|
|
124
|
-
def generate_previews_pixbufs
|
125
|
-
current_page = @window.notebook.page
|
126
|
-
|
127
|
-
if @window.notebook.children.size == 1
|
128
|
-
# If we have only one vte, just generate the preview
|
129
|
-
_x, _y, w, h = @window.notebook.current.allocation.to_a
|
130
|
-
@window.notebook.current.preview = @window.notebook.current.window.to_pixbuf(0, 0, w, h)
|
131
|
-
else
|
132
|
-
# If we have more terminals, just cycle through them
|
133
|
-
# the previews will be generated in the "switch-page" event of the notebook
|
134
|
-
begin
|
135
|
-
@window.notebook.cycle_next_page
|
136
|
-
end while @window.notebook.page == current_page
|
137
|
-
# Here I disable the preview generation in the notebook "switch-page" event
|
138
|
-
# before returning to the current page.
|
139
|
-
# This is a Hack, If I don't disable the preview, all the previews will be
|
140
|
-
# the same.
|
141
|
-
@window.notebook.gen_preview = false
|
142
|
-
@window.notebook.set_current_page(current_page)
|
143
|
-
end
|
144
|
-
end
|
145
|
-
|
146
122
|
def add_drag_and_drop_functionalities(button)
|
147
123
|
add_dnd_source(button)
|
148
124
|
add_dnd_destination(button)
|
data/lib/terminal_regex.rb
CHANGED
@@ -15,8 +15,7 @@
|
|
15
15
|
# along with Topinambour. If not, see <http://www.gnu.org/licenses/>.
|
16
16
|
|
17
17
|
# Stolen from https://github.com/GNOME/gnome-terminal/blob/master/src/terminal-regex.h
|
18
|
-
module
|
19
|
-
SCHEME = "(?ix: news | telnet | nntp | https? | ftps? | sftp | webcal )"
|
18
|
+
module UserPassRegexes
|
20
19
|
USERCHARS = "-+.[:alnum:]"
|
21
20
|
# Nonempty username, e.g. "john.smith"
|
22
21
|
USER = "[#{USERCHARS}]+"
|
@@ -25,6 +24,9 @@ module TopinambourRegex
|
|
25
24
|
PASS = "(?x: :#{PASSCHARS_CLASS}* )?"
|
26
25
|
# Optional at-terminated username (with perhaps a password too), e.g. "joe@", "pete:secret@", "" */
|
27
26
|
USERPASS = "(?:#{USER}#{PASS}@)?"
|
27
|
+
end
|
28
|
+
|
29
|
+
module IpRegexes
|
28
30
|
# S4: IPv4 segment (number between 0 and 255) with lookahead at the end so that we don't match "25" in the string "256".
|
29
31
|
# The lookahead could go to the last segment of IPv4 only but this construct allows nicer unittesting. */
|
30
32
|
S4_DEF = "(?(DEFINE)(?<S4>(?x: (?: [0-9] | [1-9][0-9] | 1[0-9]{2} | 2[0-4][0-9] | 25[0-5] ) (?! [0-9] ) )))"
|
@@ -57,6 +59,9 @@ module TopinambourRegex
|
|
57
59
|
IP_DEF = "#{IPV4_DEF}#{S6_DEF}(?(DEFINE)(?<IPV6>(?x: (?: #{IPV6_NULL} | #{IPV6_LEFT} | #{IPV6_MID} | #{IPV6_RIGHT} \
|
58
60
|
| #{IPV6_FULL} | (?: #{IPV6V4_FULL} | #{IPV6V4_LEFT} | #{IPV6V4_MID} | #{IPV6V4_RIGHT} \
|
59
61
|
) (?&IPV4) ) (?! [.:[:xdigit:]] ) )))"
|
62
|
+
end
|
63
|
+
|
64
|
+
module HostnameRegexes
|
60
65
|
# Either an alphanumeric character or dash; or if [negative lookahead] not ASCII
|
61
66
|
# then any graphical Unicode character.
|
62
67
|
# A segment can consist entirely of numbers.
|
@@ -74,17 +79,46 @@ module TopinambourRegex
|
|
74
79
|
# Technically an e-mail with a single-component hostname might be valid on a local network,
|
75
80
|
# but let's avoid tons of false positives (e.g. in a typical shell prompt). */
|
76
81
|
EMAIL_HOST = "(?x: #{HOSTNAME2} | \\[ (?: (?&IPV4) | (?&IPV6) ) \\] )"
|
82
|
+
end
|
83
|
+
|
84
|
+
module PortRegexes
|
77
85
|
# Number between 1 and 65535, with lookahead at the end so that we don't match "6789" in the string "67890",
|
78
86
|
# and in turn we don't eventually match "http://host:6789" in "http://host:67890". */
|
79
87
|
N_1_65535 = "(?x: (?: [1-9][0-9]{0,3} | [1-5][0-9]{4} | 6[0-4][0-9]{3} | 65[0-4][0-9]{2} | 655[0-2][0-9] | 6553[0-5] ) (?! [0-9] ) )"
|
80
88
|
# Optional colon-prefixed port, e.g. ":1080", "" */
|
81
89
|
PORT = "(?x: \\:#{N_1_65535} )?"
|
90
|
+
end
|
91
|
+
|
92
|
+
module PathRegexes
|
82
93
|
PATHCHARS_CLASS = "[-[:alnum:]\\Q_$.+!*,:;@&=?/~#|%\\E]"
|
83
94
|
# Chars not to end a URL */
|
84
95
|
PATHNONTERM_CLASS = "[\\Q.!,?\\E]"
|
85
96
|
# Lookbehind at the end, so that the last character (if we matched a character at all) is not from PATHTERM_CLASS */
|
86
97
|
URLPATH = "(?x: /#{PATHCHARS_CLASS}* (?<! #{PATHNONTERM_CLASS} ) )?"
|
87
98
|
VOIP_PATH = "(?x: [;?]#{PATHCHARS_CLASS}* (?<! #{PATHNONTERM_CLASS} ) )?"
|
99
|
+
end
|
100
|
+
|
101
|
+
module ColorRegexes
|
102
|
+
HEX_CLASS = "[a-fA-F0-9]"
|
103
|
+
# /*http://www.regular-expressions.info/numericranges.html*/
|
104
|
+
UINT8_CLASS = "\\b([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\\b"
|
105
|
+
PERCENT_CLASS = "(0{0,2}[0-9]\\s*\\%|0?[1-9][0-9]\\s*\\%|100\\s*\\%)"
|
106
|
+
HEX_COLOR = "#(#{HEX_CLASS}{16}|#{HEX_CLASS}{12}|#{HEX_CLASS}{9}|#{HEX_CLASS}{8}|#{HEX_CLASS}{6}|#{HEX_CLASS}{4}|#{HEX_CLASS}{3})"
|
107
|
+
RGB_COLOR = "rgb\\s*\\(\\s*#{UINT8_CLASS}\\s*\\,\\s*#{UINT8_CLASS}\\s*\\,\\s*#{UINT8_CLASS}\\s*\\)"
|
108
|
+
RGBPERC_COLOR = "rgb\\s*\\(\\s*#{PERCENT_CLASS}\\s*\\,\\s*#{PERCENT_CLASS}\\s*\\,\\s*#{PERCENT_CLASS}\\s*\\)"
|
109
|
+
RGBA_COLOR = "rgba\\s*\\(\\s*#{UINT8_CLASS}\\s*\\,\\s*#{UINT8_CLASS}\\s*\\,\\s*#{UINT8_CLASS}\\s*\\,\\s*[0-1](\\.[0-9]*)?\\s*\\)"
|
110
|
+
RGBAPERC_COLOR = "rgba\\s*\\(\\s*#{PERCENT_CLASS}\\s*\\,\\s*#{PERCENT_CLASS}\\s*\\,\\s*#{PERCENT_CLASS}\\s*\\,\\s*[0-1](\\.[0-9]*)?\\s*\\)"
|
111
|
+
CSS_COLORS = "#{HEX_COLOR}|#{RGB_COLOR}|#{RGBPERC_COLOR}|#{RGBA_COLOR}|#{RGBAPERC_COLOR}"
|
112
|
+
end
|
113
|
+
|
114
|
+
module TopinambourRegex
|
115
|
+
SCHEME = "(?ix: news | telnet | nntp | https? | ftps? | sftp | webcal )"
|
116
|
+
include UserPassRegexes
|
117
|
+
include IpRegexes
|
118
|
+
include HostnameRegexes
|
119
|
+
include PortRegexes
|
120
|
+
include PathRegexes
|
121
|
+
|
88
122
|
# Now let's put these fragments together */
|
89
123
|
DEFS = IP_DEF
|
90
124
|
REGEX_URL_AS_IS = "#{DEFS}#{SCHEME}://#{USERPASS}#{URL_HOST}#{PORT}#{URLPATH}"
|
@@ -96,4 +130,5 @@ module TopinambourRegex
|
|
96
130
|
REGEX_URL_VOIP = "#{DEFS}(?i:h323:|sips?:)#{USERPASS}#{URL_HOST}#{PORT}#{VOIP_PATH}"
|
97
131
|
REGEX_EMAIL = "#{DEFS}(?i:mailto:)?#{USER}@#{EMAIL_HOST}"
|
98
132
|
REGEX_NEWS_MAN = "(?i:news:|man:|info:)[-[:alnum:]\\Q^_{|}~!\"#$%&'()*+,./;:=?`\\E]+"
|
133
|
+
include ColorRegexes
|
99
134
|
end
|
data/lib/window.rb
CHANGED
@@ -40,19 +40,6 @@ class TopinambourWindow
|
|
40
40
|
|
41
41
|
terminal = TopinambourTerminal.new(cmd, working_dir)
|
42
42
|
terminal.show
|
43
|
-
terminal.signal_connect "size-allocate" do |widget|
|
44
|
-
w = widget.column_count
|
45
|
-
h = widget.row_count
|
46
|
-
size_infos = "#{w}x#{h}"
|
47
|
-
if @overlay.children.size == 1
|
48
|
-
add_overlay(TopinambourResizeMessage.new(size_infos))
|
49
|
-
add_resize_timeout
|
50
|
-
elsif @overlay.children[1].class == TopinambourResizeMessage
|
51
|
-
GLib::Source.remove(@resize_timeout) if @resize_timeout
|
52
|
-
@overlay.children[1].text = size_infos
|
53
|
-
add_resize_timeout
|
54
|
-
end
|
55
|
-
end
|
56
43
|
@notebook.append_page(terminal)
|
57
44
|
@notebook.set_tab_reorderable(terminal, true)
|
58
45
|
@notebook.set_page(@notebook.n_pages - 1)
|
@@ -64,7 +51,7 @@ class TopinambourWindow
|
|
64
51
|
@notebook.remove_all_pages
|
65
52
|
application.quit
|
66
53
|
end
|
67
|
-
|
54
|
+
|
68
55
|
def show_color_selector
|
69
56
|
toggle_overlay(TopinambourColorSelector) if @notebook.current.class == TopinambourTerminal
|
70
57
|
end
|
@@ -80,10 +67,6 @@ class TopinambourWindow
|
|
80
67
|
@notebook.cycle_next_page
|
81
68
|
@notebook.current.grab_focus
|
82
69
|
end
|
83
|
-
|
84
|
-
def show_terminal_chooser
|
85
|
-
toggle_overlay(TopinambourTermChooser)
|
86
|
-
end
|
87
70
|
|
88
71
|
def show_font_selector
|
89
72
|
toggle_overlay(TopinambourFontSelector) if @notebook.current.class == TopinambourTerminal
|
@@ -95,6 +78,10 @@ class TopinambourWindow
|
|
95
78
|
@notebook.set_page(@notebook.n_pages - 1)
|
96
79
|
end
|
97
80
|
|
81
|
+
def show_terminal_chooser
|
82
|
+
toggle_overlay(TopinambourTermChooser)
|
83
|
+
end
|
84
|
+
|
98
85
|
def exit_overlay_mode
|
99
86
|
@overlay.children[1].destroy if in_overlay_mode?
|
100
87
|
end
|
@@ -121,7 +108,7 @@ class TopinambourWindow
|
|
121
108
|
"website_label" => "Topinambour github repository"
|
122
109
|
)
|
123
110
|
end
|
124
|
-
|
111
|
+
|
125
112
|
def close_current_tab
|
126
113
|
exit_overlay_mode
|
127
114
|
@notebook.remove_current_page
|
@@ -144,7 +131,7 @@ class TopinambourWindow
|
|
144
131
|
@overlay.add(@notebook)
|
145
132
|
add(@overlay)
|
146
133
|
end
|
147
|
-
|
134
|
+
|
148
135
|
def create_header_bar
|
149
136
|
@bar = TopinambourHeaderBar.generate_header_bar(self)
|
150
137
|
@current_label = TopinambourHeaderBar.generate_current_label(self)
|
@@ -175,15 +162,6 @@ class TopinambourWindow
|
|
175
162
|
@bar.pack_end(button)
|
176
163
|
end
|
177
164
|
|
178
|
-
def add_resize_timeout
|
179
|
-
@resize_timeout = GLib::Timeout.add_seconds(2) do
|
180
|
-
second_child = @overlay.children[1] || nil
|
181
|
-
if second_child && second_child.class == TopinambourResizeMessage
|
182
|
-
@overlay.children[1].hide
|
183
|
-
end
|
184
|
-
end
|
185
|
-
end
|
186
|
-
|
187
165
|
def toggle_overlay(klass)
|
188
166
|
if in_overlay_mode? && @overlay.children[1].class == klass
|
189
167
|
exit_overlay_mode
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: topinambour
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
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-04-
|
11
|
+
date: 2016-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: vte3
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- data/tab-new-symbolic.svg
|
92
92
|
- data/terminal-menu.ui
|
93
93
|
- data/topinambour.css
|
94
|
+
- data/topinambour.gresource
|
94
95
|
- data/topinambour.gresource.xml
|
95
96
|
- data/window-close-symbolic.svg
|
96
97
|
- data/window-menu.ui
|