mirror of
https://github.com/transmission/transmission
synced 2024-12-26 17:47:37 +00:00
left-allign the text in the inspector pull-down menus; update the Keychain method
This commit is contained in:
parent
fa92408627
commit
de6a87bfc9
2 changed files with 19 additions and 25 deletions
|
@ -3,12 +3,12 @@
|
||||||
<data>
|
<data>
|
||||||
<int key="IBDocument.SystemTarget">1050</int>
|
<int key="IBDocument.SystemTarget">1050</int>
|
||||||
<string key="IBDocument.SystemVersion">9D34</string>
|
<string key="IBDocument.SystemVersion">9D34</string>
|
||||||
<string key="IBDocument.InterfaceBuilderVersion">667</string>
|
<string key="IBDocument.InterfaceBuilderVersion">670</string>
|
||||||
<string key="IBDocument.AppKitVersion">949.33</string>
|
<string key="IBDocument.AppKitVersion">949.33</string>
|
||||||
<string key="IBDocument.HIToolboxVersion">352.00</string>
|
<string key="IBDocument.HIToolboxVersion">352.00</string>
|
||||||
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
<integer value="1770"/>
|
<integer value="1066"/>
|
||||||
</object>
|
</object>
|
||||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
@ -2222,7 +2222,7 @@ AAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSBDb21wdXRlciwgSW5jLiwgMjAwNQAAAAA</bytes>
|
||||||
<string key="NSExtension">NSResponder</string>
|
<string key="NSExtension">NSResponder</string>
|
||||||
</object>
|
</object>
|
||||||
<object class="NSCustomView" id="180459949">
|
<object class="NSCustomView" id="180459949">
|
||||||
<reference key="NSNextResponder"/>
|
<nil key="NSNextResponder"/>
|
||||||
<int key="NSvFlags">274</int>
|
<int key="NSvFlags">274</int>
|
||||||
<object class="NSMutableArray" key="NSSubviews">
|
<object class="NSMutableArray" key="NSSubviews">
|
||||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
@ -3863,7 +3863,6 @@ zijOSc5pzorOqs66ztvO+88czzzPXc99z57Pvs/fz+/QANAg0EHQYdCC0KLQw9Dj0PPRFNE00VXRddGW
|
||||||
</object>
|
</object>
|
||||||
<string key="NSFrame">{{1, 17}, {338, 172}}</string>
|
<string key="NSFrame">{{1, 17}, {338, 172}}</string>
|
||||||
<reference key="NSSuperview" ref="1009918777"/>
|
<reference key="NSSuperview" ref="1009918777"/>
|
||||||
<reference key="NSNextKeyView" ref="221969066"/>
|
|
||||||
<reference key="NSDocView" ref="221969066"/>
|
<reference key="NSDocView" ref="221969066"/>
|
||||||
<reference key="NSBGColor" ref="987864771"/>
|
<reference key="NSBGColor" ref="987864771"/>
|
||||||
<int key="NScvFlags">4</int>
|
<int key="NScvFlags">4</int>
|
||||||
|
@ -3897,7 +3896,6 @@ zijOSc5pzorOqs66ztvO+88czzzPXc99z57Pvs/fz+/QANAg0EHQYdCC0KLQw9Dj0PPRFNE00VXRddGW
|
||||||
</object>
|
</object>
|
||||||
<string key="NSFrame">{{1, 0}, {338, 17}}</string>
|
<string key="NSFrame">{{1, 0}, {338, 17}}</string>
|
||||||
<reference key="NSSuperview" ref="1009918777"/>
|
<reference key="NSSuperview" ref="1009918777"/>
|
||||||
<reference key="NSNextKeyView" ref="1053875789"/>
|
|
||||||
<reference key="NSDocView" ref="1053875789"/>
|
<reference key="NSDocView" ref="1053875789"/>
|
||||||
<reference key="NSBGColor" ref="987864771"/>
|
<reference key="NSBGColor" ref="987864771"/>
|
||||||
<int key="NScvFlags">4</int>
|
<int key="NScvFlags">4</int>
|
||||||
|
@ -3906,7 +3904,6 @@ zijOSc5pzorOqs66ztvO+88czzzPXc99z57Pvs/fz+/QANAg0EHQYdCC0KLQw9Dj0PPRFNE00VXRddGW
|
||||||
</object>
|
</object>
|
||||||
<string key="NSFrame">{{10, 77}, {340, 190}}</string>
|
<string key="NSFrame">{{10, 77}, {340, 190}}</string>
|
||||||
<reference key="NSSuperview" ref="180459949"/>
|
<reference key="NSSuperview" ref="180459949"/>
|
||||||
<reference key="NSNextKeyView" ref="386870512"/>
|
|
||||||
<int key="NSsFlags">562</int>
|
<int key="NSsFlags">562</int>
|
||||||
<reference key="NSVScroller" ref="70145897"/>
|
<reference key="NSVScroller" ref="70145897"/>
|
||||||
<reference key="NSHScroller" ref="38561669"/>
|
<reference key="NSHScroller" ref="38561669"/>
|
||||||
|
@ -4024,7 +4021,6 @@ zijOSc5pzorOqs66ztvO+88czzzPXc99z57Pvs/fz+/QANAg0EHQYdCC0KLQw9Dj0PPRFNE00VXRddGW
|
||||||
</object>
|
</object>
|
||||||
<string key="NSFrame">{{1, 17}, {338, 48}}</string>
|
<string key="NSFrame">{{1, 17}, {338, 48}}</string>
|
||||||
<reference key="NSSuperview" ref="252354812"/>
|
<reference key="NSSuperview" ref="252354812"/>
|
||||||
<reference key="NSNextKeyView" ref="705721384"/>
|
|
||||||
<reference key="NSDocView" ref="705721384"/>
|
<reference key="NSDocView" ref="705721384"/>
|
||||||
<reference key="NSBGColor" ref="987864771"/>
|
<reference key="NSBGColor" ref="987864771"/>
|
||||||
<int key="NScvFlags">4</int>
|
<int key="NScvFlags">4</int>
|
||||||
|
@ -4058,7 +4054,6 @@ zijOSc5pzorOqs66ztvO+88czzzPXc99z57Pvs/fz+/QANAg0EHQYdCC0KLQw9Dj0PPRFNE00VXRddGW
|
||||||
</object>
|
</object>
|
||||||
<string key="NSFrame">{{1, 0}, {338, 17}}</string>
|
<string key="NSFrame">{{1, 0}, {338, 17}}</string>
|
||||||
<reference key="NSSuperview" ref="252354812"/>
|
<reference key="NSSuperview" ref="252354812"/>
|
||||||
<reference key="NSNextKeyView" ref="842629001"/>
|
|
||||||
<reference key="NSDocView" ref="842629001"/>
|
<reference key="NSDocView" ref="842629001"/>
|
||||||
<reference key="NSBGColor" ref="987864771"/>
|
<reference key="NSBGColor" ref="987864771"/>
|
||||||
<int key="NScvFlags">4</int>
|
<int key="NScvFlags">4</int>
|
||||||
|
@ -4067,7 +4062,6 @@ zijOSc5pzorOqs66ztvO+88czzzPXc99z57Pvs/fz+/QANAg0EHQYdCC0KLQw9Dj0PPRFNE00VXRddGW
|
||||||
</object>
|
</object>
|
||||||
<string key="NSFrame">{{10, 271}, {340, 66}}</string>
|
<string key="NSFrame">{{10, 271}, {340, 66}}</string>
|
||||||
<reference key="NSSuperview" ref="180459949"/>
|
<reference key="NSSuperview" ref="180459949"/>
|
||||||
<reference key="NSNextKeyView" ref="230403242"/>
|
|
||||||
<int key="NSsFlags">562</int>
|
<int key="NSsFlags">562</int>
|
||||||
<reference key="NSVScroller" ref="58257122"/>
|
<reference key="NSVScroller" ref="58257122"/>
|
||||||
<reference key="NSHScroller" ref="904154524"/>
|
<reference key="NSHScroller" ref="904154524"/>
|
||||||
|
@ -4293,7 +4287,6 @@ zijOSc5pzorOqs66ztvO+88czzzPXc99z57Pvs/fz+/QANAg0EHQYdCC0KLQw9Dj0PPRFNE00VXRddGW
|
||||||
</object>
|
</object>
|
||||||
</object>
|
</object>
|
||||||
<string key="NSFrameSize">{360, 342}</string>
|
<string key="NSFrameSize">{360, 342}</string>
|
||||||
<reference key="NSSuperview"/>
|
|
||||||
<string key="NSClassName">NSView</string>
|
<string key="NSClassName">NSView</string>
|
||||||
<string key="NSExtension">NSResponder</string>
|
<string key="NSExtension">NSResponder</string>
|
||||||
</object>
|
</object>
|
||||||
|
@ -4496,7 +4489,7 @@ zijOSc5pzorOqs66ztvO+88czzzPXc99z57Pvs/fz+/QANAg0EHQYdCC0KLQw9Dj0PPRFNE00VXRddGW
|
||||||
<string key="NSExtension">NSResponder</string>
|
<string key="NSExtension">NSResponder</string>
|
||||||
</object>
|
</object>
|
||||||
<object class="NSCustomView" id="1005910882">
|
<object class="NSCustomView" id="1005910882">
|
||||||
<nil key="NSNextResponder"/>
|
<reference key="NSNextResponder"/>
|
||||||
<int key="NSvFlags">258</int>
|
<int key="NSvFlags">258</int>
|
||||||
<object class="NSMutableArray" key="NSSubviews">
|
<object class="NSMutableArray" key="NSSubviews">
|
||||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
@ -4703,7 +4696,7 @@ zijOSc5pzorOqs66ztvO+88czzzPXc99z57Pvs/fz+/QANAg0EHQYdCC0KLQw9Dj0PPRFNE00VXRddGW
|
||||||
<bool key="NSEnabled">YES</bool>
|
<bool key="NSEnabled">YES</bool>
|
||||||
<object class="NSPopUpButtonCell" key="NSCell" id="271393508">
|
<object class="NSPopUpButtonCell" key="NSCell" id="271393508">
|
||||||
<int key="NSCellFlags">-2076049856</int>
|
<int key="NSCellFlags">-2076049856</int>
|
||||||
<int key="NSCellFlags2">134350848</int>
|
<int key="NSCellFlags2">133120</int>
|
||||||
<reference key="NSSupport" ref="26"/>
|
<reference key="NSSupport" ref="26"/>
|
||||||
<reference key="NSControlView" ref="307561255"/>
|
<reference key="NSControlView" ref="307561255"/>
|
||||||
<int key="NSButtonFlags">-2038284033</int>
|
<int key="NSButtonFlags">-2038284033</int>
|
||||||
|
@ -4875,7 +4868,7 @@ zijOSc5pzorOqs66ztvO+88czzzPXc99z57Pvs/fz+/QANAg0EHQYdCC0KLQw9Dj0PPRFNE00VXRddGW
|
||||||
<bool key="NSEnabled">YES</bool>
|
<bool key="NSEnabled">YES</bool>
|
||||||
<object class="NSPopUpButtonCell" key="NSCell" id="646947417">
|
<object class="NSPopUpButtonCell" key="NSCell" id="646947417">
|
||||||
<int key="NSCellFlags">-2076049856</int>
|
<int key="NSCellFlags">-2076049856</int>
|
||||||
<int key="NSCellFlags2">134350848</int>
|
<int key="NSCellFlags2">133120</int>
|
||||||
<reference key="NSSupport" ref="26"/>
|
<reference key="NSSupport" ref="26"/>
|
||||||
<reference key="NSControlView" ref="188523528"/>
|
<reference key="NSControlView" ref="188523528"/>
|
||||||
<int key="NSButtonFlags">-2038284033</int>
|
<int key="NSButtonFlags">-2038284033</int>
|
||||||
|
@ -4961,7 +4954,7 @@ zijOSc5pzorOqs66ztvO+88czzzPXc99z57Pvs/fz+/QANAg0EHQYdCC0KLQw9Dj0PPRFNE00VXRddGW
|
||||||
<bool key="NSEnabled">YES</bool>
|
<bool key="NSEnabled">YES</bool>
|
||||||
<object class="NSPopUpButtonCell" key="NSCell" id="380288231">
|
<object class="NSPopUpButtonCell" key="NSCell" id="380288231">
|
||||||
<int key="NSCellFlags">-2076049856</int>
|
<int key="NSCellFlags">-2076049856</int>
|
||||||
<int key="NSCellFlags2">134350848</int>
|
<int key="NSCellFlags2">133120</int>
|
||||||
<reference key="NSSupport" ref="26"/>
|
<reference key="NSSupport" ref="26"/>
|
||||||
<reference key="NSControlView" ref="535987563"/>
|
<reference key="NSControlView" ref="535987563"/>
|
||||||
<int key="NSButtonFlags">-2038284033</int>
|
<int key="NSButtonFlags">-2038284033</int>
|
||||||
|
@ -5151,6 +5144,7 @@ zijOSc5pzorOqs66ztvO+88czzzPXc99z57Pvs/fz+/QANAg0EHQYdCC0KLQw9Dj0PPRFNE00VXRddGW
|
||||||
</object>
|
</object>
|
||||||
</object>
|
</object>
|
||||||
<string key="NSFrameSize">{351, 161}</string>
|
<string key="NSFrameSize">{351, 161}</string>
|
||||||
|
<reference key="NSSuperview"/>
|
||||||
<object class="NSMutableString" key="NSClassName">
|
<object class="NSMutableString" key="NSClassName">
|
||||||
<characters key="NS.bytes">NSView</characters>
|
<characters key="NS.bytes">NSView</characters>
|
||||||
</object>
|
</object>
|
||||||
|
|
|
@ -64,7 +64,7 @@
|
||||||
- (void) incompleteFolderSheetClosed: (NSOpenPanel *) openPanel returnCode: (int) code contextInfo: (void *) info;
|
- (void) incompleteFolderSheetClosed: (NSOpenPanel *) openPanel returnCode: (int) code contextInfo: (void *) info;
|
||||||
- (void) importFolderSheetClosed: (NSOpenPanel *) openPanel returnCode: (int) code contextInfo: (void *) info;
|
- (void) importFolderSheetClosed: (NSOpenPanel *) openPanel returnCode: (int) code contextInfo: (void *) info;
|
||||||
|
|
||||||
- (void) setKeychainPassword: (NSString *) password forService: (const char *) service username: (const char *) username;
|
- (void) setKeychainPassword: (const char *) password forService: (const char *) service username: (const char *) username;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -767,10 +767,10 @@
|
||||||
|
|
||||||
- (void) setProxyPassword: (id) sender
|
- (void) setProxyPassword: (id) sender
|
||||||
{
|
{
|
||||||
NSString * password = [sender stringValue];
|
const char * password = [[sender stringValue] UTF8String];
|
||||||
[self setKeychainPassword: password forService: PROXY_KEYCHAIN_SERVICE username: PROXY_KEYCHAIN_NAME];
|
[self setKeychainPassword: password forService: PROXY_KEYCHAIN_SERVICE username: PROXY_KEYCHAIN_NAME];
|
||||||
|
|
||||||
tr_sessionSetProxyPassword(fHandle, [password UTF8String]);
|
tr_sessionSetProxyPassword(fHandle, password);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) updateProxyPassword
|
- (void) updateProxyPassword
|
||||||
|
@ -809,10 +809,10 @@
|
||||||
|
|
||||||
- (void) setRPCPassword: (id) sender
|
- (void) setRPCPassword: (id) sender
|
||||||
{
|
{
|
||||||
NSString * password = [sender stringValue];
|
const char * password = [[sender stringValue] UTF8String];
|
||||||
[self setKeychainPassword: password forService: RPC_KEYCHAIN_SERVICE username: RPC_KEYCHAIN_NAME];
|
[self setKeychainPassword: password forService: RPC_KEYCHAIN_SERVICE username: RPC_KEYCHAIN_NAME];
|
||||||
|
|
||||||
tr_sessionSetRPCPassword(fHandle, [password UTF8String]);
|
tr_sessionSetRPCPassword(fHandle, password);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) updateRPCPassword
|
- (void) updateRPCPassword
|
||||||
|
@ -1158,17 +1158,17 @@
|
||||||
[fImportFolderPopUp selectItemAtIndex: 0];
|
[fImportFolderPopUp selectItemAtIndex: 0];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setKeychainPassword: (NSString *) password forService: (const char *) service username: (const char *) username
|
- (void) setKeychainPassword: (const char *) password forService: (const char *) service username: (const char *) username
|
||||||
{
|
{
|
||||||
SecKeychainItemRef item = NULL;
|
SecKeychainItemRef item = NULL;
|
||||||
BOOL shouldAdd = password && ![password isEqualToString: @""];
|
NSUInteger passwordLength = strlen(password) > 0;
|
||||||
|
|
||||||
OSStatus result = SecKeychainFindGenericPassword(NULL, strlen(service), service, strlen(username), username, NULL, NULL, &item);
|
OSStatus result = SecKeychainFindGenericPassword(NULL, strlen(service), service, strlen(username), username, NULL, NULL, &item);
|
||||||
if (result == noErr && item)
|
if (result == noErr && item)
|
||||||
{
|
{
|
||||||
if (shouldAdd) //found, so update
|
if (passwordLength > 0) //found, so update
|
||||||
{
|
{
|
||||||
result = SecKeychainItemModifyAttributesAndData(item, NULL, [password length], (const void *)[password UTF8String]);
|
result = SecKeychainItemModifyAttributesAndData(item, NULL, passwordLength, (const void *)password);
|
||||||
if (result != noErr)
|
if (result != noErr)
|
||||||
NSLog(@"Problem updating Keychain item: %s", GetMacOSStatusErrorString(result));
|
NSLog(@"Problem updating Keychain item: %s", GetMacOSStatusErrorString(result));
|
||||||
}
|
}
|
||||||
|
@ -1181,10 +1181,10 @@
|
||||||
}
|
}
|
||||||
else if (result == errSecItemNotFound) //not found, so add
|
else if (result == errSecItemNotFound) //not found, so add
|
||||||
{
|
{
|
||||||
if (shouldAdd)
|
if (passwordLength > 0)
|
||||||
{
|
{
|
||||||
result = SecKeychainAddGenericPassword(NULL, strlen(service), service, strlen(username), username,
|
result = SecKeychainAddGenericPassword(NULL, strlen(service), service, strlen(username), username,
|
||||||
[password length], (const void *)[password UTF8String], NULL);
|
passwordLength, (const void *)password, NULL);
|
||||||
if (result != noErr)
|
if (result != noErr)
|
||||||
NSLog(@"Problem adding Keychain item: %s", GetMacOSStatusErrorString(result));
|
NSLog(@"Problem adding Keychain item: %s", GetMacOSStatusErrorString(result));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue