mlomnicki-quick_start 0.2 → 0.2.2

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.
data/README.rdoc ADDED
@@ -0,0 +1,38 @@
1
+ = QuickStart: Simple tool which runs chosen program on startup
2
+
3
+ It's best to use QuickStart with GNOME as it's build with GTK. After GNOME startup QuickStart window is shown,
4
+ where one can choose set of applications started by one-click. Currently set of application is hardcoded as consists of
5
+ * firefox
6
+ * evolution
7
+ * skype
8
+ * gnome-terminal
9
+
10
+ All aplications are selected by default.
11
+
12
+ The set should be configured and this is job which will be done soon.
13
+
14
+ == Dependencies
15
+
16
+ * ruby
17
+ * libglade2-ruby
18
+
19
+ == Installation
20
+
21
+ sudo gem install mlomnicki-quick_start
22
+
23
+ At GNOME panel:
24
+ System -> Preferences -> Startup Applications, add new item and put /usr/bin/quick_start as command.
25
+
26
+ == About
27
+
28
+ Author:: Michał Łomnicki <michal@lomnicki.com.pl>
29
+ License:: Copyright 2009 by Michał Łomnicki
30
+ Released under a MIT license.
31
+
32
+ == Warranty
33
+
34
+ This software is provided "as is" and without any express or
35
+ implied warranties, including, without limitation, the implied
36
+ warranties of merchantibility and fitness for a particular
37
+ purpose.
38
+
@@ -0,0 +1,27 @@
1
+ module QuickStart
2
+
3
+ class Program
4
+ @@map = {
5
+ :firefox => '/usr/bin/firefox',
6
+ :evolution => '/usr/bin/evolution',
7
+ :skype => '/usr/bin/skype',
8
+ :terminal => '/usr/bin/gnome-terminal'
9
+ }
10
+
11
+ class << self
12
+
13
+ attr_reader :map
14
+
15
+ def run( name )
16
+ puts "running #{name} #{@@map[name.to_sym]}"
17
+ pid = Kernel.fork do
18
+ exec( @@map[name.to_sym] )
19
+ end
20
+ Process.detach(pid)
21
+ end
22
+
23
+ end
24
+
25
+ end
26
+
27
+ end
@@ -0,0 +1,115 @@
1
+ <?xml version="1.0"?>
2
+ <glade-interface>
3
+ <!-- interface-requires gtk+ 2.16 -->
4
+ <!-- interface-naming-policy project-wide -->
5
+ <widget class="GtkWindow" id="window1">
6
+ <property name="width_request">400</property>
7
+ <property name="height_request">200</property>
8
+ <property name="title" translatable="yes">QuickStart</property>
9
+ <property name="resizable">False</property>
10
+ <property name="window_position">center-always</property>
11
+ <property name="default_width">400</property>
12
+ <property name="default_height">250</property>
13
+ <child>
14
+ <widget class="GtkVBox" id="vbox1">
15
+ <property name="visible">True</property>
16
+ <property name="orientation">vertical</property>
17
+ <child>
18
+ <widget class="GtkVButtonBox" id="vbuttonbox1">
19
+ <property name="visible">True</property>
20
+ <child>
21
+ <widget class="GtkCheckButton" id="chb_firefox">
22
+ <property name="label" translatable="yes">Firefox</property>
23
+ <property name="visible">True</property>
24
+ <property name="can_focus">True</property>
25
+ <property name="receives_default">False</property>
26
+ <property name="active">True</property>
27
+ <property name="draw_indicator">True</property>
28
+ <signal name="toggled" handler="on_chb_application_toggled"/>
29
+ </widget>
30
+ <packing>
31
+ <property name="expand">False</property>
32
+ <property name="fill">False</property>
33
+ <property name="position">0</property>
34
+ </packing>
35
+ </child>
36
+ <child>
37
+ <widget class="GtkCheckButton" id="chb_evolution">
38
+ <property name="label" translatable="yes">Evolution</property>
39
+ <property name="visible">True</property>
40
+ <property name="can_focus">True</property>
41
+ <property name="receives_default">False</property>
42
+ <property name="active">True</property>
43
+ <property name="draw_indicator">True</property>
44
+ <signal name="toggled" handler="on_chb_application_toggled"/>
45
+ </widget>
46
+ <packing>
47
+ <property name="expand">False</property>
48
+ <property name="fill">False</property>
49
+ <property name="position">1</property>
50
+ </packing>
51
+ </child>
52
+ <child>
53
+ <widget class="GtkCheckButton" id="chb_skype">
54
+ <property name="label" translatable="yes">Skype</property>
55
+ <property name="visible">True</property>
56
+ <property name="can_focus">True</property>
57
+ <property name="receives_default">False</property>
58
+ <property name="active">True</property>
59
+ <property name="draw_indicator">True</property>
60
+ <signal name="toggled" handler="on_chb_application_toggled"/>
61
+ </widget>
62
+ <packing>
63
+ <property name="expand">False</property>
64
+ <property name="fill">False</property>
65
+ <property name="position">2</property>
66
+ </packing>
67
+ </child>
68
+ <child>
69
+ <widget class="GtkCheckButton" id="chb_teminal">
70
+ <property name="label" translatable="yes">Terminal</property>
71
+ <property name="visible">True</property>
72
+ <property name="can_focus">True</property>
73
+ <property name="receives_default">False</property>
74
+ <property name="active">True</property>
75
+ <property name="draw_indicator">True</property>
76
+ <signal name="toggled" handler="on_chb_application_toggled"/>
77
+ </widget>
78
+ <packing>
79
+ <property name="expand">False</property>
80
+ <property name="fill">False</property>
81
+ <property name="position">3</property>
82
+ </packing>
83
+ </child>
84
+ </widget>
85
+ <packing>
86
+ <property name="position">0</property>
87
+ </packing>
88
+ </child>
89
+ <child>
90
+ <widget class="GtkFixed" id="fixed1">
91
+ <property name="visible">True</property>
92
+ <child>
93
+ <widget class="GtkButton" id="btn_run">
94
+ <property name="label" translatable="yes">Start</property>
95
+ <property name="width_request">160</property>
96
+ <property name="height_request">40</property>
97
+ <property name="visible">True</property>
98
+ <property name="can_focus">True</property>
99
+ <property name="receives_default">True</property>
100
+ <signal name="clicked" handler="on_btn_run_clicked"/>
101
+ </widget>
102
+ <packing>
103
+ <property name="x">125</property>
104
+ <property name="y">35</property>
105
+ </packing>
106
+ </child>
107
+ </widget>
108
+ <packing>
109
+ <property name="position">1</property>
110
+ </packing>
111
+ </child>
112
+ </widget>
113
+ </child>
114
+ </widget>
115
+ </glade-interface>
@@ -0,0 +1,41 @@
1
+ require 'quick_start/program'
2
+
3
+ module QuickStart
4
+
5
+ class QuickStart2Glade
6
+ include GetText
7
+
8
+ attr :glade
9
+
10
+ def initialize(path_or_data, root = nil, domain = nil, localedir = nil, flag = GladeXML::FILE)
11
+ bindtextdomain(domain, localedir, nil, "UTF-8")
12
+ @glade = GladeXML.new(path_or_data, root, domain, localedir, flag) {|handler| method(handler)}
13
+ end
14
+
15
+ def show
16
+ @window = glade['window1']
17
+ @window.show_all
18
+ @window.signal_connect('destroy') { Gtk.main_quit }
19
+ end
20
+
21
+ def on_chb_application_toggled(widget)
22
+ if widget.active?
23
+ selected << widget.name
24
+ else
25
+ selected.delete( widget.name )
26
+ end
27
+ end
28
+
29
+ def on_btn_run_clicked(widget)
30
+ selected.each do |name|
31
+ Program.run( name.sub(/^chb_/, '') )
32
+ end
33
+ end
34
+
35
+ def selected
36
+ @@selected ||= Program.map.keys.collect { |p| "chb_#{p}" }
37
+ end
38
+
39
+ end
40
+
41
+ end
@@ -0,0 +1,5 @@
1
+ $:.unshift File.dirname(__FILE__)
2
+
3
+ require 'libglade2'
4
+ require 'quick_start/quick_start_2_glade'
5
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mlomnicki-quick_start
3
3
  version: !ruby/object:Gem::Version
4
- version: "0.2"
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Micha\xC5\x82 \xC5\x81omnicki"
@@ -21,8 +21,13 @@ extensions: []
21
21
 
22
22
  extra_rdoc_files: []
23
23
 
24
- files: []
25
-
24
+ files:
25
+ - README.rdoc
26
+ - bin/quick_start
27
+ - lib/quick_start/quick_start_2_glade.rb
28
+ - lib/quick_start/quick_start.glade
29
+ - lib/quick_start/program.rb
30
+ - lib/quick_start.rb
26
31
  has_rdoc: false
27
32
  homepage:
28
33
  licenses: