openall_time_applet 0.0.17 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bin/OpenAll Timelogging +12 -0
- data/gui/trayicon.rb +1 -14
- data/gui/win_main.rb +37 -2
- data/openall_time_applet.gemspec +4 -4
- metadata +6 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.18
|
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/usr/bin/env ruby1.9.1
|
2
|
+
|
3
|
+
#This custom script is to manipulate the tray-text for Gnome Shell.
|
4
|
+
|
5
|
+
Dir.chdir(File.dirname(__FILE__))
|
6
|
+
require "../lib/openall_time_applet.rb"
|
7
|
+
|
8
|
+
GetText.bindtextdomain("default", "../locales", ENV["LANGUAGE"])
|
9
|
+
|
10
|
+
oata = Openall_time_applet.new(:debug => true)
|
11
|
+
|
12
|
+
Gtk.main
|
data/gui/trayicon.rb
CHANGED
@@ -121,20 +121,7 @@ class Openall_time_applet::Gui::Trayicon
|
|
121
121
|
|
122
122
|
#Get main-window-object.
|
123
123
|
win_main = Knj::Gtk2::Window.get("main")
|
124
|
-
|
125
|
-
if !win_main.gui["expOverview"].expanded?
|
126
|
-
#If the expander isnt expanded, call the activate and wait a bit before calling the plus-button.
|
127
|
-
win_main.gui["expOverview"].activate
|
128
|
-
|
129
|
-
Gtk.timeout_add(250) do
|
130
|
-
#Make a "plus"-click which adds a new task.
|
131
|
-
win_main.gui["btnPlus"].clicked
|
132
|
-
false
|
133
|
-
end
|
134
|
-
else
|
135
|
-
#If the expander is already expanded, then call the plus-button instantly to prevent the "laggy" feeling that would otherwise have occurred because of the timeout.
|
136
|
-
win_main.gui["btnPlus"].clicked
|
137
|
-
end
|
124
|
+
win_main.gui["txtDescr"].grab_focus
|
138
125
|
end
|
139
126
|
|
140
127
|
menu.append(Gtk::SeparatorMenuItem.new)
|
data/gui/win_main.rb
CHANGED
@@ -23,6 +23,34 @@ class Openall_time_applet::Gui::Win_main
|
|
23
23
|
tasks << task
|
24
24
|
end
|
25
25
|
|
26
|
+
|
27
|
+
#Set up completion for description entry.
|
28
|
+
ec = Gtk::EntryCompletion.new
|
29
|
+
ec.model = Gtk::ListStore.new(String)
|
30
|
+
ec.text_column = 0
|
31
|
+
@gui["txtDescr"].completion = ec
|
32
|
+
|
33
|
+
added = {}
|
34
|
+
@args[:oata].ob.list(:Worktime, {"orderby" => "timestamp"}) do |worktime|
|
35
|
+
next if added.key?(worktime[:comment])
|
36
|
+
added[worktime[:comment]] = true
|
37
|
+
ec.model.append[0] = worktime[:comment]
|
38
|
+
end
|
39
|
+
|
40
|
+
@args[:oata].ob.list(:Timelog, {"orderby" => "descr"}) do |timelog|
|
41
|
+
next if added.key?(timelog[:descr])
|
42
|
+
added[timelog[:descr]] = true
|
43
|
+
ec.model.append[0] = timelog[:descr]
|
44
|
+
end
|
45
|
+
|
46
|
+
ec.signal_connect("match-selected") do |me, model, iter|
|
47
|
+
text = model.get_value(iter, 0)
|
48
|
+
me.entry.text = text
|
49
|
+
true
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
|
26
54
|
#Add the tasks to the combo-box.
|
27
55
|
@gui["cbTask"].init(tasks)
|
28
56
|
|
@@ -194,14 +222,21 @@ class Openall_time_applet::Gui::Win_main
|
|
194
222
|
end
|
195
223
|
end
|
196
224
|
|
225
|
+
#Removes all timelogs from the treeview and adds them again. Does nothing if the 'dont_reload'-variable is set.
|
197
226
|
def reload_timelogs
|
198
227
|
return nil if @dont_reload or @gui["tvTimelogs"].destroyed?
|
199
228
|
@gui["tvTimelogs"].model.clear
|
200
|
-
@args[:oata].ob.list(:Timelog, {"orderby" => "
|
229
|
+
@args[:oata].ob.list(:Timelog, {"orderby" => [["timestamp", "desc"]]}) do |timelog|
|
230
|
+
begin
|
231
|
+
tstamp_str = timelog.timestamp_str
|
232
|
+
rescue => e
|
233
|
+
tstamp_str = "[#{_("error")}: #{e.message}"
|
234
|
+
end
|
235
|
+
|
201
236
|
@gui["tvTimelogs"].append([
|
202
237
|
timelog.id,
|
203
238
|
Knj::Web.html(timelog[:descr]),
|
204
|
-
|
239
|
+
tstamp_str,
|
205
240
|
timelog.time_as_human,
|
206
241
|
timelog.time_transport_as_human,
|
207
242
|
Knj::Locales.number_out(timelog[:transportlength], 0),
|
data/openall_time_applet.gemspec
CHANGED
@@ -5,15 +5,14 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{openall_time_applet}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.18"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kasper Johansen"]
|
12
|
-
s.date = %q{2012-
|
13
|
-
s.default_executable = %q{openall_time_applet.rb}
|
12
|
+
s.date = %q{2012-07-05}
|
14
13
|
s.description = %q{Off-line time-tracking for OpenAll with syncing when online.}
|
15
14
|
s.email = %q{k@spernj.org}
|
16
|
-
s.executables = ["openall_time_applet.rb"]
|
15
|
+
s.executables = ["OpenAll Timelogging", "openall_time_applet.rb"]
|
17
16
|
s.extra_rdoc_files = [
|
18
17
|
"LICENSE.txt",
|
19
18
|
"README.rdoc"
|
@@ -27,6 +26,7 @@ Gem::Specification.new do |s|
|
|
27
26
|
"README.rdoc",
|
28
27
|
"Rakefile",
|
29
28
|
"VERSION",
|
29
|
+
"bin/OpenAll Timelogging",
|
30
30
|
"bin/openall_time_applet.rb",
|
31
31
|
"classes/connection.rb",
|
32
32
|
"classes/translations.rb",
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: openall_time_applet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.18
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Kasper Johansen
|
@@ -10,8 +10,8 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-
|
14
|
-
default_executable:
|
13
|
+
date: 2012-07-05 00:00:00 +02:00
|
14
|
+
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: knjrbfw
|
@@ -137,6 +137,7 @@ dependencies:
|
|
137
137
|
description: Off-line time-tracking for OpenAll with syncing when online.
|
138
138
|
email: k@spernj.org
|
139
139
|
executables:
|
140
|
+
- OpenAll Timelogging
|
140
141
|
- openall_time_applet.rb
|
141
142
|
extensions: []
|
142
143
|
|
@@ -152,6 +153,7 @@ files:
|
|
152
153
|
- README.rdoc
|
153
154
|
- Rakefile
|
154
155
|
- VERSION
|
156
|
+
- bin/OpenAll Timelogging
|
155
157
|
- bin/openall_time_applet.rb
|
156
158
|
- classes/connection.rb
|
157
159
|
- classes/translations.rb
|
@@ -196,7 +198,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
196
198
|
requirements:
|
197
199
|
- - ">="
|
198
200
|
- !ruby/object:Gem::Version
|
199
|
-
hash: -
|
201
|
+
hash: -1991198915258529709
|
200
202
|
segments:
|
201
203
|
- 0
|
202
204
|
version: "0"
|