forked from ashchan/gmail-notifr
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPrefsSettingsViewController.rb
45 lines (36 loc) · 1.13 KB
/
PrefsSettingsViewController.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
#
# PrefsSettingsViewController.rb
# Gmail Notifr
#
# Created by James Chen on 8/16/09.
# Copyright (c) 2009 ashchan.com. All rights reserved.
#
require 'osx/cocoa'
class PrefsSettingsViewController < OSX::NSViewController
ib_outlet :autoLaunch
ib_outlet :showUnreadCount
ib_action :saveAutoLaunch
ib_action :saveShowUnreadCount
def title
NSLocalizedString("Settings")
end
def image
NSImage.imageNamed("NSPreferencesGeneral")
end
def identifier
PrefsToolbarItemSettings
end
def loadView
super_loadView
@autoLaunch.setTitle(NSLocalizedString("Launch at login"))
@autoLaunch.setState(GNPreferences.sharedInstance.autoLaunch? ? NSOnState : NSOffState)
@showUnreadCount.setTitle(NSLocalizedString("Show unread count in menu bar"))
@showUnreadCount.setState(GNPreferences.sharedInstance.showUnreadCount? ? NSOnState : NSOffState)
end
def saveAutoLaunch(sender)
GNPreferences.sharedInstance.autoLaunch = (@autoLaunch.state == NSOnState)
end
def saveShowUnreadCount(sender)
GNPreferences.sharedInstance.showUnreadCount = (@showUnreadCount.state == NSOnState)
end
end