Permalink
Browse files

Merged issue-226 branch back into trunk, fixed issue 226.

Application interface is now decomposed into smaller nib files. For example, each of the preferences views is now managed by its own view controller subclass. Same for an account window and its views, and for a call window and its views. Started using XSWindowController and XSViewController to manage such decomposed interface. Those view controller subviews are now doing some of the work that a higher level controller was doing before. For example, AccountPreferencesViewController is now responsible for adding and removing accounts (PreferenceController was doing this work before).

PreferenceController renamed to PreferencesController.
  • Loading branch information...
eofster
eofster committed Nov 29, 2009
1 parent 77a05b6 commit 8717bb7c14e11ec0037d06ed302e9454a0064cea
Showing with 34,839 additions and 20,048 deletions.
  1. +1 −1 AKSIPURIFormatter.m
  2. +3 −3 AKSIPUserAgent.h
  3. +16 −57 AccountController.h
  4. +145 −1,026 AccountController.m
  5. +103 −0 AccountPreferencesViewController.h
  6. +751 −0 AccountPreferencesViewController.m
  7. +72 −0 AccountSetupController.h
  8. +147 −0 AccountSetupController.m
  9. +64 −0 ActiveAccountViewController.h
  10. +951 −0 ActiveAccountViewController.m
  11. +101 −0 ActiveCallViewController.h
  12. +267 −0 ActiveCallViewController.m
  13. +9 −4 AppController.h
  14. +97 −73 AppController.m
  15. +82 −0 AuthenticationFailureController.h
  16. +164 −0 AuthenticationFailureController.m
  17. +25 −87 CallController.h
  18. +156 −296 CallController.m
  19. +71 −0 EndedCallViewController.h
  20. +91 −0 EndedCallViewController.m
  21. +508 −158 English.lproj/Account.xib
  22. +2,199 −0 English.lproj/AccountPreferencesView.xib
  23. +625 −196 English.lproj/{AddAccount.xib → AccountSetup.xib}
  24. +722 −0 English.lproj/ActiveAccountView.xib
  25. +857 −0 English.lproj/ActiveCallView.xib
  26. +29 −69 English.lproj/{AuthFailed.xib → AuthenticationFailure.xib}
  27. +81 −984 English.lproj/Call.xib
  28. +771 −0 English.lproj/EndedCallView.xib
  29. +809 −0 English.lproj/GeneralPreferencesView.xib
  30. +812 −0 English.lproj/IncomingCallView.xib
  31. BIN English.lproj/Localizable.strings
  32. +1,147 −0 English.lproj/NetworkPreferencesView.xib
  33. +300 −4,248 English.lproj/Preferences.xib
  34. +1,064 −0 English.lproj/SoundPreferencesView.xib
  35. +39 −0 GeneralPreferencesViewController.h
  36. +46 −0 GeneralPreferencesViewController.m
  37. +505 −159 German.lproj/Account.xib
  38. +2,199 −0 German.lproj/AccountPreferencesView.xib
  39. +625 −212 German.lproj/{AddAccount.xib → AccountSetup.xib}
  40. +714 −0 German.lproj/ActiveAccountView.xib
  41. +857 −0 German.lproj/ActiveCallView.xib
  42. +27 −67 German.lproj/{AuthFailed.xib → AuthenticationFailure.xib}
  43. +77 −982 German.lproj/Call.xib
  44. +771 −0 German.lproj/EndedCallView.xib
  45. +739 −0 German.lproj/GeneralPreferencesView.xib
  46. +812 −0 German.lproj/IncomingCallView.xib
  47. +0 −6 German.lproj/Localizable.strings
  48. +1,147 −0 German.lproj/NetworkPreferencesView.xib
  49. +249 −4,125 German.lproj/Preferences.xib
  50. +1,064 −0 German.lproj/SoundPreferencesView.xib
  51. +74 −0 IncomingCallViewController.h
  52. +94 −0 IncomingCallViewController.m
  53. +65 −0 NetworkPreferencesViewController.h
  54. +268 −0 NetworkPreferencesViewController.m
  55. +0 −275 PreferenceController.h
  56. +0 −1,405 PreferenceController.m
  57. +150 −0 PreferencesController.h
  58. +307 −0 PreferencesController.m
  59. +505 −159 Russian.lproj/Account.xib
  60. +2,199 −0 Russian.lproj/AccountPreferencesView.xib
  61. +627 −203 Russian.lproj/{AddAccount.xib → AccountSetup.xib}
  62. +714 −0 Russian.lproj/ActiveAccountView.xib
  63. +857 −0 Russian.lproj/ActiveCallView.xib
  64. +29 −69 Russian.lproj/{AuthFailed.xib → AuthenticationFailure.xib}
  65. +75 −984 Russian.lproj/Call.xib
  66. +771 −0 Russian.lproj/EndedCallView.xib
  67. +739 −0 Russian.lproj/GeneralPreferencesView.xib
  68. +812 −0 Russian.lproj/IncomingCallView.xib
  69. +0 −6 Russian.lproj/Localizable.strings
  70. +1,146 −0 Russian.lproj/NetworkPreferencesView.xib
  71. +249 −4,150 Russian.lproj/Preferences.xib
  72. +1,065 −0 Russian.lproj/SoundPreferencesView.xib
  73. +68 −0 SoundPreferencesViewController.h
  74. +213 −0 SoundPreferencesViewController.m
  75. +261 −44 Telephone.xcodeproj/project.pbxproj
  76. +66 −0 XSViewController.h
  77. +182 −0 XSViewController.m
  78. +53 −0 XSWindowController.h
  79. +139 −0 XSWindowController.m
View
@@ -31,7 +31,7 @@
#import "AKSIPURIFormatter.h"
#import "AKNSString+Scanning.h"
-#import "PreferenceController.h"
+#import "PreferencesController.h"
#import "AKSIPURI.h"
#import "AKTelephoneNumberFormatter.h"
View
@@ -152,7 +152,7 @@ extern NSString * const AKSIPUserAgentWillRemoveAccountNotification;
// Receiver's call data.
@property(nonatomic, readonly, assign) AKSIPUserAgentCallData *callData;
-// A pool used by the underlying PJSUA libraty of the receiver.
+// A pool used by the underlying PJSUA library of the receiver.
@property(readonly, assign) pj_pool_t *pjPool;
@property(readonly, assign) NSInteger ringbackSlot;
@@ -164,8 +164,8 @@ extern NSString * const AKSIPUserAgentWillRemoveAccountNotification;
@property(nonatomic, copy) NSArray *nameservers;
// SIP proxy host to visit for all outgoing requests. Will be used for all
-// accounts. The final route set for outgoing requests consists of the this
-// proxy and proxy configured for the account.
+// accounts. The final route set for outgoing requests consists of this proxy
+// and proxy configured for the account.
@property(nonatomic, copy) NSString *outboundProxyHost;
// Network port to use with the outbound proxy.
View
@@ -31,6 +31,7 @@
#import <Cocoa/Cocoa.h>
#import "AKSIPAccount.h"
+#import "XSWindowController.h"
// Account states.
@@ -43,16 +44,11 @@ enum {
// Address Book label for SIP address in the email field.
extern NSString * const kEmailSIPLabel;
-// Posted whenever an AccountController object changes account's username and
-// password.
-// The notification object is the AccountController object that changed
-// username and password.
-extern NSString * const AKAccountControllerDidChangeUsernameAndPasswordNotification;
-
-@class AKSIPAccount, AKNetworkReachability;
+@class AKSIPURI, AKNetworkReachability;
+@class ActiveAccountViewController, AuthenticationFailureController;
// A SIP account controller.
-@interface AccountController : NSWindowController <AKSIPAccountDelegate> {
+@interface AccountController : XSWindowController <AKSIPAccountDelegate> {
@private
BOOL enabled_;
AKSIPAccount *account_;
@@ -69,19 +65,10 @@ extern NSString * const AKAccountControllerDidChangeUsernameAndPasswordNotificat
BOOL substitutesPlusCharacter_;
NSString *plusCharacterSubstitution_;
- NSView *activeAccountView_;
- NSView *offlineAccountView_;
- NSPopUpButton *accountStatePopUp_;
- NSTokenField *callDestinationField_;
- NSUInteger callDestinationURIIndex_;
+ ActiveAccountViewController *activeAccountViewController_;
+ AuthenticationFailureController *authenticationFailureController_;
- // Authentication failure sheet elements.
- NSWindow *authenticationFailureSheet_;
- NSTextField *authenticationFailureInformativeText_;
- NSTextField *updatedUsernameField_;
- NSTextField *updatedPasswordField_;
- NSButton *mustSaveCheckBox_;
- NSButton *authenticationFailureCancelButton_;
+ NSPopUpButton *accountStatePopUp_;
}
// A Boolean value indicating whether receiver is enabled.
@@ -131,37 +118,15 @@ extern NSString * const AKAccountControllerDidChangeUsernameAndPasswordNotificat
// A replacement for the plus character in the phone number.
@property(nonatomic, copy) NSString *plusCharacterSubstitution;
-// Outlets.
-
-// Active account view outlet.
-@property(nonatomic, retain) IBOutlet NSView *activeAccountView;
+// An active account view controller.
+@property(nonatomic, readonly) ActiveAccountViewController *activeAccountViewController;
-// Offline account view outlet.
-@property(nonatomic, retain) IBOutlet NSView *offlineAccountView;
+// An authentication failure controller.
+@property(nonatomic, readonly) AuthenticationFailureController *authenticationFailureController;
// Account state pop-up button outlet.
@property(nonatomic, retain) IBOutlet NSPopUpButton *accountStatePopUp;
-// Call destination token field outlet.
-@property(nonatomic, retain) IBOutlet NSTokenField *callDestinationField;
-
-// Authentication failure sheet outlet.
-@property(nonatomic, retain) IBOutlet NSWindow *authenticationFailureSheet;
-
-// Informative text outlet of the authentication failure sheet.
-@property(nonatomic, retain) IBOutlet NSTextField *authenticationFailureInformativeText;
-
-// |User Name| field outlet of the authentication failure sheet.
-@property(nonatomic, retain) IBOutlet NSTextField *updatedUsernameField;
-
-// |Password| field outlet of the authentication failure sheet.
-@property(nonatomic, retain) IBOutlet NSTextField *updatedPasswordField;
-
-// |Save in the Keychain| checkbox outlet.
-@property(nonatomic, retain) IBOutlet NSButton *mustSaveCheckBox;
-
-// Cancel button outlet of the authentication failure sheet.
-@property(nonatomic, retain) IBOutlet NSButton *authenticationFailureCancelButton;
// Designated initializer.
// Initializes an AccountController object with a given account.
@@ -178,21 +143,15 @@ extern NSString * const AKAccountControllerDidChangeUsernameAndPasswordNotificat
// Removes account from the user agent.
- (void)removeAccountFromUserAgent;
-// Makes a call.
-- (IBAction)makeCall:(id)sender;
+// Makes a call to a given destination URI with a given phone label.
+// Host part of the |destinationURI| can be empty, in which case host part from
+// the account's |registrationURI| will be taken.
+- (void)makeCallToURI:(AKSIPURI *)destinationURI
+ phoneLabel:(NSString *)phoneLabel;
// Changes account state.
- (IBAction)changeAccountState:(id)sender;
-// Sets new user name and password when authentication fails.
-- (IBAction)changeUsernameAndPassword:(id)sender;
-
-// Closes a sheet.
-- (IBAction)closeSheet:(id)sender;
-
-// Changes the active SIP URI index in the call destination token.
-- (IBAction)changeCallDestinationURIIndex:(id)sender;
-
// Shows alert saying that connection to the registrar failed.
- (void)showRegistrarConnectionErrorSheetWithError:(NSString *)error;
Oops, something went wrong.

0 comments on commit 8717bb7

Please sign in to comment.