Skip to content

Commit

Permalink
renamed unit to client
Browse files Browse the repository at this point in the history
  • Loading branch information
psychs committed Mar 24, 2010
1 parent 982b4d4 commit cf333c9
Show file tree
Hide file tree
Showing 14 changed files with 265 additions and 265 deletions.
8 changes: 4 additions & 4 deletions LimeChat.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
78BF64AC0C2885E2004451B2 /* channelmode.rb in Resources */ = {isa = PBXBuildFile; fileRef = 78BF64A40C2885E2004451B2 /* channelmode.rb */; };
78BF64AD0C2885E2004451B2 /* config.rb in Resources */ = {isa = PBXBuildFile; fileRef = 78BF64A50C2885E2004451B2 /* config.rb */; };
78BF64AE0C2885E2004451B2 /* ircmessage.rb in Resources */ = {isa = PBXBuildFile; fileRef = 78BF64A60C2885E2004451B2 /* ircmessage.rb */; };
78BF64AF0C2885E2004451B2 /* unit.rb in Resources */ = {isa = PBXBuildFile; fileRef = 78BF64A70C2885E2004451B2 /* unit.rb */; };
78BF64AF0C2885E2004451B2 /* client.rb in Resources */ = {isa = PBXBuildFile; fileRef = 78BF64A70C2885E2004451B2 /* client.rb */; };
78BF64B00C2885E2004451B2 /* user.rb in Resources */ = {isa = PBXBuildFile; fileRef = 78BF64A80C2885E2004451B2 /* user.rb */; };
78BF64B10C2885E2004451B2 /* usermode.rb in Resources */ = {isa = PBXBuildFile; fileRef = 78BF64A90C2885E2004451B2 /* usermode.rb */; };
78BF64B20C2885E2004451B2 /* world.rb in Resources */ = {isa = PBXBuildFile; fileRef = 78BF64AA0C2885E2004451B2 /* world.rb */; };
Expand Down Expand Up @@ -252,7 +252,7 @@
78BF64A40C2885E2004451B2 /* channelmode.rb */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = text.script.ruby; path = channelmode.rb; sourceTree = "<group>"; };
78BF64A50C2885E2004451B2 /* config.rb */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = text.script.ruby; path = config.rb; sourceTree = "<group>"; };
78BF64A60C2885E2004451B2 /* ircmessage.rb */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = text.script.ruby; path = ircmessage.rb; sourceTree = "<group>"; };
78BF64A70C2885E2004451B2 /* unit.rb */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = text.script.ruby; path = unit.rb; sourceTree = "<group>"; };
78BF64A70C2885E2004451B2 /* client.rb */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = text.script.ruby; path = client.rb; sourceTree = "<group>"; };
78BF64A80C2885E2004451B2 /* user.rb */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = text.script.ruby; path = user.rb; sourceTree = "<group>"; };
78BF64A90C2885E2004451B2 /* usermode.rb */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = text.script.ruby; path = usermode.rb; sourceTree = "<group>"; };
78BF64AA0C2885E2004451B2 /* world.rb */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = text.script.ruby; path = world.rb; sourceTree = "<group>"; };
Expand Down Expand Up @@ -540,7 +540,7 @@
78BF64A40C2885E2004451B2 /* channelmode.rb */,
78BF64A50C2885E2004451B2 /* config.rb */,
78BF64A60C2885E2004451B2 /* ircmessage.rb */,
78BF64A70C2885E2004451B2 /* unit.rb */,
78BF64A70C2885E2004451B2 /* client.rb */,
78BF64A80C2885E2004451B2 /* user.rb */,
78BF64A90C2885E2004451B2 /* usermode.rb */,
78BF64AA0C2885E2004451B2 /* world.rb */,
Expand Down Expand Up @@ -637,7 +637,7 @@
78BF64AC0C2885E2004451B2 /* channelmode.rb in Resources */,
78BF64AD0C2885E2004451B2 /* config.rb in Resources */,
78BF64AE0C2885E2004451B2 /* ircmessage.rb in Resources */,
78BF64AF0C2885E2004451B2 /* unit.rb in Resources */,
78BF64AF0C2885E2004451B2 /* client.rb in Resources */,
78BF64B00C2885E2004451B2 /* user.rb in Resources */,
78BF64B10C2885E2004451B2 /* usermode.rb in Resources */,
78BF64B20C2885E2004451B2 /* world.rb in Resources */,
Expand Down
32 changes: 16 additions & 16 deletions ruby/controller/appcontroller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def applicationDidFinishLaunching(sender)

start_timer

if @world.units.empty?
if @world.clients.empty?
# start initial setting
@welcome = WelcomeDialog.alloc.init
@welcome.delegate = self
Expand Down Expand Up @@ -234,8 +234,8 @@ def fieldEditorTextView_paste(sender)
return false unless s
s = s.to_s
sel = @world.selected
if sel && !sel.unit? && /(\r\n|\r|\n)[^\r\n]/ =~ s
@menu.start_paste_dialog(sel.unit.mynick, sel.unit.uid, sel.uid, s)
if sel && !sel.client? && /(\r\n|\r|\n)[^\r\n]/ =~ s
@menu.start_paste_dialog(sel.client.mynick, sel.client.uid, sel.uid, s)
true
else
false
Expand All @@ -261,7 +261,7 @@ def welcomeDialog_onOk(sender, c)
c[:encoding] = NSUTF8StringEncoding
end
end
u = @world.create_unit(IRCUnitConfig.new(c))
u = @world.create_client(IRCClientConfig.new(c))
@world.save
u.connect if u.config.auto_connect
end
Expand Down Expand Up @@ -665,7 +665,7 @@ def register_key_handlers
handler(:space, :alt) { move(:down, :unread); true }
handler(:space, :alt, :shift) { move(:up, :unread); true }
handler('0'..'9', :cmd) {|n| @world.select_channel_at(n.to_s.to_i); true }
handler('0'..'9', :cmd, :ctrl) {|n| n = n.to_s.to_i; @world.select_unit_at(n == 0 ? 9 : n-1); true }
handler('0'..'9', :cmd, :ctrl) {|n| n = n.to_s.to_i; @world.select_client_at(n == 0 ? 9 : n-1); true }

input_handler(:up) { history_up; true }
input_handler(:up, :alt) { history_up; true }
Expand Down Expand Up @@ -757,7 +757,7 @@ def move(direction, target=:all)
if i
case target
when :active
if !i.unit? && i.active?
if !i.client? && i.active?
@world.select(i)
break
end
Expand All @@ -776,11 +776,11 @@ def move(direction, target=:all)
when :left,:right
sel = @world.selected
return false unless sel
unit = sel.unit
n = @world.units.index(unit)
client = sel.client
n = @world.clients.index(client)
return false unless n
start = n
size = @world.units.size
size = @world.clients.size
loop do
if direction == :left
n -= 1
Expand All @@ -789,19 +789,19 @@ def move(direction, target=:all)
n += 1
n = 0 if n >= size
end
unit = @world.units[n]
if unit
client = @world.clients[n]
if client
case target
when :active
if unit.login?
t = unit.last_selected_channel
t = unit unless t
if client.login?
t = client.last_selected_channel
t = client unless t
@world.select(t)
break
end
else
t = unit.last_selected_channel
t = unit unless t
t = client.last_selected_channel
t = client unless t
@world.select(t)
break
end
Expand Down
2 changes: 1 addition & 1 deletion ruby/controller/growlcontroller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def growlNotifier_notificationClicked(sender, context)
end
elsif /\A(\d+)\z/ =~ context
uid = $1.to_i
u = @owner.find_unit_by_id(uid)
u = @owner.find_client_by_id(uid)
@owner.select(u) if u
end
end
Expand Down
Loading

0 comments on commit cf333c9

Please sign in to comment.