forked from kozy/time-to-ticket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLogTimeController.rb
53 lines (42 loc) · 868 Bytes
/
LogTimeController.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
require 'osx/cocoa'
class LogTimeController < OSX::NSWindowController
ib_outlets :redmine
ib_outlets :theWindow
ib_outlets :treeController
def init
super_init
#self if self.initWithWindowNibName_owner('logtime', self)
end
def WindowVisible
if @loaded and @theWindow.isVisible
return true
else
return false
end
end
ib_action :reloadWindow
def reloadWindow
@theWindow.orderOut_(false)
@loaded = nil
openW
end
def hideW
@theWindow.orderOut_(false)
end
def openW
if not @loaded
@loaded = OSX::NSBundle.loadNibNamed_owner("logtime", self)
end
@treeController.connectToRedMine
@treeController.retrievePositions
OSX::NSApp.activateIgnoringOtherApps(true)
@theWindow.makeKeyAndOrderFront(nil)
if $noConnection
@theWindow.orderOut_(false)
end
self
end
def awakeFromNib
puts 'logtime awake'
end
end