Skip to content

Commit

Permalink
Add setting xib to bridge "alt-login" setting from skype4pidgin
Browse files Browse the repository at this point in the history
  • Loading branch information
tripplet committed May 25, 2019
1 parent 6e916a2 commit d05b996
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 10 deletions.
41 changes: 37 additions & 4 deletions skypeweb4adium.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
CD99FB4C1B5BF4E100E6E652 /* skypeweb_messages.c in Sources */ = {isa = PBXBuildFile; fileRef = CD99FB441B5BF4E100E6E652 /* skypeweb_messages.c */; };
CD99FB4D1B5BF4E100E6E652 /* skypeweb_util.c in Sources */ = {isa = PBXBuildFile; fileRef = CD99FB461B5BF4E100E6E652 /* skypeweb_util.c */; };
CD99FB4F1B5BFBF700E6E652 /* PurpleSkypeWebService.m in Sources */ = {isa = PBXBuildFile; fileRef = CD99FB4E1B5BFBF700E6E652 /* PurpleSkypeWebService.m */; };
CDE7B9EA22993C01008D5015 /* SkypeSettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CDE7B9E822993C01008D5015 /* SkypeSettingsViewController.m */; };
CDE7B9EB22993C01008D5015 /* SkypeSettings.xib in Resources */ = {isa = PBXBuildFile; fileRef = CDE7B9E922993C01008D5015 /* SkypeSettings.xib */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -76,6 +78,9 @@
CD99FB471B5BF4E100E6E652 /* skypeweb_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = skypeweb_util.h; path = skype4pidgin/skypeweb/skypeweb_util.h; sourceTree = "<group>"; };
CD99FB4E1B5BFBF700E6E652 /* PurpleSkypeWebService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PurpleSkypeWebService.m; sourceTree = "<group>"; };
CD99FB501B5BFC1300E6E652 /* PurpleSkypeWebService.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PurpleSkypeWebService.h; sourceTree = "<group>"; };
CDE7B9E722993C01008D5015 /* SkypeSettingsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SkypeSettingsViewController.h; sourceTree = "<group>"; };
CDE7B9E822993C01008D5015 /* SkypeSettingsViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SkypeSettingsViewController.m; sourceTree = "<group>"; };
CDE7B9E922993C01008D5015 /* SkypeSettings.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SkypeSettings.xib; sourceTree = "<group>"; };
CDEC6DCA1AED672300E6E652 /* skypeweb4adium.AdiumPlugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = skypeweb4adium.AdiumPlugin; sourceTree = BUILT_PRODUCTS_DIR; };
CDEC6DCE1AED672300E6E652 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -183,6 +188,16 @@
name = skypeweb;
sourceTree = "<group>";
};
CDE7B9E122993AB0008D5015 /* Settings */ = {
isa = PBXGroup;
children = (
CDE7B9E722993C01008D5015 /* SkypeSettingsViewController.h */,
CDE7B9E822993C01008D5015 /* SkypeSettingsViewController.m */,
CDE7B9E922993C01008D5015 /* SkypeSettings.xib */,
);
name = Settings;
sourceTree = "<group>";
};
CDEC6DC11AED672300E6E652 = {
isa = PBXGroup;
children = (
Expand All @@ -204,13 +219,14 @@
CDEC6DCC1AED672300E6E652 /* skypeweb4adium */ = {
isa = PBXGroup;
children = (
CDEC6DCD1AED672300E6E652 /* Supporting Files */,
CDE7B9E122993AB0008D5015 /* Settings */,
CD74DB851AED6F6800E6E652 /* AISkypewebPlugin.h */,
CD74DB831AED6F3100E6E652 /* AISkypewebPlugin.m */,
CD99FB501B5BFC1300E6E652 /* PurpleSkypeWebService.h */,
CD99FB4E1B5BFBF700E6E652 /* PurpleSkypeWebService.m */,
CD7B08E31B5DA96600E6E652 /* PurpleSkypeWebAccount.h */,
CD7B08E41B5DA96600E6E652 /* PurpleSkypeWebAccount.m */,
CDEC6DCD1AED672300E6E652 /* Supporting Files */,
);
path = skypeweb4adium;
sourceTree = "<group>";
Expand Down Expand Up @@ -253,11 +269,12 @@
CDEC6DC21AED672300E6E652 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "Tobias Tangemann";
TargetAttributes = {
CDEC6DC91AED672300E6E652 = {
CreatedOnToolsVersion = 6.3;
LastSwiftMigration = 1020;
};
};
};
Expand All @@ -266,6 +283,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
);
mainGroup = CDEC6DC11AED672300E6E652;
Expand All @@ -283,6 +301,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CDE7B9EB22993C01008D5015 /* SkypeSettings.xib in Resources */,
CD7B08E11B5DA80000E6E652 /* skype_small.png in Resources */,
CD7B08DB1B5DA55900E6E652 /* skype.png in Resources */,
);
Expand All @@ -302,7 +321,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "PLUGIN_BIN=\"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\"\nLIBS=\"$(/usr/bin/otool -L \"$PLUGIN_BIN\" | \\\n/usr/bin/tail -n +2 | \\\n/usr/bin/tr -d '\\t' | \\\n/usr/bin/grep -e '^@[a-z_]*path.*' | \\\n/usr/bin/grep -v -e '\\.framework/Versions/Current' | \\\n/usr/bin/sed \\\ns/'(compatibility version [0-9.]*, current version [0-9.]*)'/''/g)\"\n\nfor LIB in $LIBS; do\nNEW_LIB=\"$(/bin/echo \"$LIB\" | /usr/bin/sed s,'Versions/[A-Za-z0-9.]*/','Versions/Current/',)\"\nprintf \"Changing '%s' to '%s'\\n\" \"$LIB\" \"$NEW_LIB\"\n/usr/bin/install_name_tool -change \"$LIB\" \"$NEW_LIB\" \"$PLUGIN_BIN\"\ndone";
shellScript = "PLUGIN_BIN=\"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\"\nLIBS=\"$(/usr/bin/otool -L \"$PLUGIN_BIN\" | \\\n/usr/bin/tail -n +2 | \\\n/usr/bin/tr -d '\\t' | \\\n/usr/bin/grep -e '^@[a-z_]*path.*' | \\\n/usr/bin/grep -v -e '\\.framework/Versions/Current' | \\\n/usr/bin/sed \\\ns/'(compatibility version [0-9.]*, current version [0-9.]*)'/''/g)\"\n\nfor LIB in $LIBS; do\nNEW_LIB=\"$(/bin/echo \"$LIB\" | /usr/bin/sed s,'Versions/[A-Za-z0-9.]*/','Versions/Current/',)\"\nprintf \"Changing '%s' to '%s'\\n\" \"$LIB\" \"$NEW_LIB\"\n/usr/bin/install_name_tool -change \"$LIB\" \"$NEW_LIB\" \"$PLUGIN_BIN\"\ndone\n";
};
CD74DB701AED691D00E6E652 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
Expand All @@ -315,7 +334,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "ln -sf \"$BUILD_DIR\" xcode_build";
shellScript = "ln -sf \"$BUILD_DIR\" xcode_build\n";
};
CD7B08E61B5DAB9000E6E652 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
Expand All @@ -337,6 +356,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CDE7B9EA22993C01008D5015 /* SkypeSettingsViewController.m in Sources */,
CD25998F1F9543AE0046A0FF /* purple-socket.c in Sources */,
CD25998E1F9543AA0046A0FF /* http.c in Sources */,
CD99FB4A1B5BF4E100E6E652 /* skypeweb_contacts.c in Sources */,
Expand Down Expand Up @@ -366,12 +386,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -429,12 +451,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -475,6 +499,7 @@
CDEC6DD21AED672300E6E652 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
COMBINE_HIDPI_IMAGES = YES;
HEADER_SEARCH_PATHS = (
"$(SOURCE_ROOT)/adium/Frameworks/libglib.framework/Versions/Current/Headers",
Expand All @@ -485,16 +510,21 @@
);
INFOPLIST_FILE = skypeweb4adium/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.tangemann.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OBJC_BRIDGING_HEADER = "skypeweb4adium/skypeweb4adium-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
WRAPPER_EXTENSION = AdiumPlugin;
};
name = Debug;
};
CDEC6DD31AED672300E6E652 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
COMBINE_HIDPI_IMAGES = YES;
HEADER_SEARCH_PATHS = (
"$(SOURCE_ROOT)/adium/Frameworks/libglib.framework/Versions/Current/Headers",
Expand All @@ -505,9 +535,12 @@
);
INFOPLIST_FILE = skypeweb4adium/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.tangemann.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OBJC_BRIDGING_HEADER = "skypeweb4adium/skypeweb4adium-Bridging-Header.h";
SWIFT_VERSION = 5.0;
WRAPPER_EXTENSION = AdiumPlugin;
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
Expand All @@ -37,7 +36,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
4 changes: 2 additions & 2 deletions skypeweb4adium/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleVersion</key>
<string>1.4.1</string>
<string>1.5</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2017 Tobias Tangemann. All rights reserved.</string>
<string>Copyright © 2019 Tobias Tangemann. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string>AISkypewebPlugin</string>
</dict>
Expand Down
6 changes: 5 additions & 1 deletion skypeweb4adium/PurpleSkypeWebAccount.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
#import <Cocoa/Cocoa.h>
#import <AdiumLibpurple/CBPurpleAccount.h>

@interface PurpleSkypeWebAccount : CBPurpleAccount
@interface PurpleSkypeWebAccount : CBPurpleAccount {

}

- (PurpleAccount*) getPurpleAccount;

@end
13 changes: 13 additions & 0 deletions skypeweb4adium/PurpleSkypeWebAccount.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,24 @@

@implementation PurpleSkypeWebAccount

- (PurpleAccount *)getPurpleAccount
{
return account;
}

- (const char*)protocolPlugin
{
return "prpl-skypeweb";
}

// Bridge Adium settings over to the libpurple side
- (void) configurePurpleAccount
{
[super configurePurpleAccount];

purple_account_set_bool(account, "alt-login", [[self preferenceForKey:@"alt-login" group:GROUP_ACCOUNT_STATUS] boolValue]);
}

- (NSString *)host
{
return @"api.skype.com";
Expand Down
6 changes: 6 additions & 0 deletions skypeweb4adium/PurpleSkypeWebService.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#import "PurpleSkypeWebAccount.h"
#import "PurpleSkypeWebService.h"

#import "SkypeSettingsViewController.h"

#import <Adium/AISharedAdium.h>
#import <Adium/AIStatusControllerProtocol.h>
#import <AIUtilities/AIStringUtilities.h>
Expand Down Expand Up @@ -45,6 +47,10 @@ - (NSImage *)defaultServiceIconOfType:(AIServiceIconType)iconType
}
}

- (AIAccountViewController *) accountViewController {
return [[SkypeSettingsViewController alloc] init];
}

- (NSString *)pathForDefaultServiceIconOfType:(AIServiceIconType)iconType
{
if ((iconType == AIServiceIconSmall) || (iconType == AIServiceIconList)) {
Expand Down
33 changes: 33 additions & 0 deletions skypeweb4adium/SkypeSettings.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment version="101400" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="SkypeSettingsViewController">
<connections>
<outlet property="optionsView" destination="Hz6-mo-xeY" id="QMG-wV-Nrq"/>
<outlet property="useAltLogin" destination="qag-WQ-G0t" id="gIi-M3-Smv"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="Hz6-mo-xeY" userLabel="Options">
<rect key="frame" x="0.0" y="0.0" width="326" height="171"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<button verticalHuggingPriority="750" id="qag-WQ-G0t">
<rect key="frame" x="112" y="135" width="103" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Use Alt Login" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="fsb-Xl-vC5">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
</button>
</subviews>
<point key="canvasLocation" x="-164" y="30.5"/>
</customView>
</objects>
</document>
19 changes: 19 additions & 0 deletions skypeweb4adium/SkypeSettingsViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// SkypeSettingsViewController.h
// skypeweb4adium
//
// Created by Tobias Tangemann on 25.05.19.
// Copyright © 2019 Tobias Tangemann. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import <AdiumLibpurple/PurpleAccountViewController.h>

@interface SkypeSettingsViewController : PurpleAccountViewController {
IBOutlet NSButton *useAltLogin;
__unsafe_unretained IBOutlet NSView *optionsView;
}

@property (nonatomic, assign) IBOutlet NSView *optionsView;

@end
36 changes: 36 additions & 0 deletions skypeweb4adium/SkypeSettingsViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// SkypeSettingsViewController.m
// skypeweb4adium
//
// Created by Tobias Tangemann on 25.05.19.
// Copyright © 2019 Tobias Tangemann. All rights reserved.
//

#import "SkypeSettingsViewController.h"
#import <AdiumLibpurple/CBPurpleAccount.h>
#import "PurpleSkypeWebAccount.h"

@interface SkypeSettingsViewController ()
@end

@implementation SkypeSettingsViewController
@synthesize optionsView;

- (NSView*) optionsView { return optionsView; }
- (NSString*) nibName { return @"SkypeSettings"; }

- (void)configureForAccount:(AIAccount *) inAccount
{
[super configureForAccount:inAccount];
[useAltLogin setState:[[account preferenceForKey:@"alt-login" group:GROUP_ACCOUNT_STATUS] boolValue]];
}

//Save controls
- (void)saveConfiguration
{
[super saveConfiguration];
[account setPreference:[NSNumber numberWithBool:[useAltLogin state]]
forKey:@"alt-login" group:GROUP_ACCOUNT_STATUS];
}

@end

0 comments on commit d05b996

Please sign in to comment.