~handlerug/TelegramSwift

b4314307b00b1f87adf0392d509de1c0a6be1555 — handlerug 3 years ago ca83952
Some minor changes to about window
M Telegram-Mac/AppDelegate.swift => Telegram-Mac/AppDelegate.swift +3 -0
@@ 981,6 981,7 @@ class AppDelegate: NSResponder, NSApplicationDelegate, NSUserNotificationCenterD
        //showModal(with: AboutModalController(), for: window)
        //window.makeKeyAndOrderFront(sender)
    }
    
    @IBAction func preferencesAction(_ sender: Any) {
        
        if let context = contextValue?.context {


@@ 989,11 990,13 @@ class AppDelegate: NSResponder, NSApplicationDelegate, NSUserNotificationCenterD
        window.makeKeyAndOrderFront(sender)

    }
    
    @IBAction func globalSearch(_ sender: Any) {
        if let context = contextValue?.context {
            context.sharedContext.bindings.mainController().focusSearch(animated: true)
        }
    }
    
    @IBAction func closeWindow(_ sender: Any) {
        NSApp.keyWindow?.close()
    }

M Telegram-Mac/Base.lproj/MainMenu.xib => Telegram-Mac/Base.lproj/MainMenu.xib +3 -3
@@ 24,14 24,14 @@
        <customObject id="YLy-65-1bz" customClass="NSFontManager"/>
        <menu title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
            <items>
                <menuItem title="TelegramMac" identifier="1Xt-HY-uBw" id="1Xt-HY-uBw" customClass="MMMenuItem" customModule="Telegram" customModuleProvider="target">
                <menuItem title="Telegram" identifier="1Xt-HY-uBw" id="1Xt-HY-uBw" customClass="MMMenuItem" customModule="Telegram" customModuleProvider="target">
                    <modifierMask key="keyEquivalentModifierMask"/>
                    <menu key="submenu" title="TelegramMac" systemMenu="apple" identifier="uQy-DD-JDr" id="uQy-DD-JDr" customClass="MMMenu" customModule="Telegram" customModuleProvider="target">
                    <menu key="submenu" title="Telegram" systemMenu="apple" identifier="uQy-DD-JDr" id="uQy-DD-JDr" customClass="MMMenu" customModule="Telegram" customModuleProvider="target">
                        <items>
                            <menuItem title="About Telegram" identifier="5kV-Vb-QxS" id="5kV-Vb-QxS" customClass="MMMenuItem" customModule="Telegram" customModuleProvider="target">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <connections>
                                    <action selector="orderFrontStandardAboutPanel:" target="-1" id="ad5-ky-xne"/>
                                    <action selector="aboutAction:" target="Voe-Tx-rLC" id="ZhI-1O-HA0"/>
                                </connections>
                            </menuItem>
                            <menuItem isSeparatorItem="YES" id="sE9-sf-sdU"/>

M Telegram-Mac/TGAboutViewController.swift => Telegram-Mac/TGAboutViewController.swift +13 -4
@@ 10,23 10,32 @@ import Cocoa

class TGAboutViewController: NSViewController {

    @IBOutlet weak var appIconImageView: NSImageView!
    @IBOutlet weak var versionLabel: NSTextField!
    @IBOutlet weak var copyVersionButton: NSButton!
    @IBOutlet weak var copyrightNoticeLabel: NSTextField!
    
    let versionString = Bundle.main.infoDictionary?["CFBundleShortVersionString"] ?? "1"
    let buildString = Bundle.main.infoDictionary?["CFBundleVersion"] ?? "0"
    #if STABLE
    let releaseChannel = "Stable"
    let releaseChannel = "Stable channel"
    #elseif APP_STORE
    let releaseChannel = "Mac App Store"
    #elseif BETA
    let releaseChannel = "Beta channel"
    #else
    let releaseChannel = "Beta"
    let releaseChannel = "Alpha channel"
    #endif
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        versionLabel.stringValue = "Version \(versionString) (\(buildString))\n\(releaseChannel)"
        appIconImageView.image = NSImage(named: "AppIcon")
        
        // no matching string for copy to clipboard except the image menu item label
        
        let formatter = DateFormatter()
        formatter.dateFormat = "yyyy"
        copyrightNoticeLabel.stringValue = "Copyright © 2016–\(formatter.string(from: Date(timeIntervalSinceReferenceDate: Date.timeIntervalSinceReferenceDate)))\nTELEGRAM MESSENGER LLP.\nAll rights reserved."
    }
    
    @IBAction func copyButtonClicked(_ sender: Any) {

M Telegram-Mac/TGAboutWindow.storyboard => Telegram-Mac/TGAboutWindow.storyboard +25 -22
@@ 1,8 1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
    <dependencies>
        <deployment identifier="macosx"/>
        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>
        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="16097"/>
        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
    </dependencies>
    <scenes>


@@ 13,11 13,10 @@
                    <window key="window" title="About Telegram" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" hidesOnDeactivate="YES" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="none" frameAutosaveName="" titleVisibility="hidden" id="aS8-cw-954" customClass="TGAboutWindow" customModule="Telegram" customModuleProvider="target">
                        <windowStyleMask key="styleMask" titled="YES" closable="YES"/>
                        <windowCollectionBehavior key="collectionBehavior" fullScreenAuxiliary="YES"/>
                        <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
                        <rect key="contentRect" x="245" y="301" width="328" height="270"/>
                        <rect key="contentRect" x="245" y="301" width="320" height="240"/>
                        <rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
                        <value key="minSize" type="size" width="328" height="270"/>
                        <value key="maxSize" type="size" width="328" height="270"/>
                        <value key="minSize" type="size" width="320" height="240"/>
                        <value key="maxSize" type="size" width="320" height="240"/>
                        <connections>
                            <outlet property="delegate" destination="4IT-0F-a13" id="bEo-h0-miV"/>
                        </connections>


@@ 35,17 34,17 @@
            <objects>
                <viewController showSeguePresentationStyle="single" id="iy1-iR-ByA" customClass="TGAboutViewController" customModule="Telegram" customModuleProvider="target" sceneMemberID="viewController">
                    <view key="view" id="o0x-fS-ZFt">
                        <rect key="frame" x="0.0" y="0.0" width="314" height="247"/>
                        <rect key="frame" x="0.0" y="0.0" width="320" height="240"/>
                        <autoresizingMask key="autoresizingMask"/>
                        <subviews>
                            <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="UNb-tG-O6e">
                                <rect key="frame" x="123" y="157" width="70" height="70"/>
                                <rect key="frame" x="125" y="150" width="70" height="70"/>
                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                                <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="Mif-HA-K2L"/>
                                <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="AppIcon" id="Mif-HA-K2L"/>
                            </imageView>
                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="uoh-fZ-hcn">
                                <rect key="frame" x="122" y="128" width="72" height="21"/>
                                <autoresizingMask key="autoresizingMask"/>
                                <rect key="frame" x="124" y="119" width="72" height="21"/>
                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                                <textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="Telegram" id="aqa-g8-PkV">
                                    <font key="font" metaFont="systemBold" size="14"/>
                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>


@@ 53,32 52,32 @@
                                </textFieldCell>
                            </textField>
                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="IPB-WT-oMo">
                                <rect key="frame" x="28" y="20" width="260" height="28"/>
                                <autoresizingMask key="autoresizingMask"/>
                                <rect key="frame" x="15" y="20" width="289" height="22"/>
                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                                <textFieldCell key="cell" lineBreakMode="clipping" alignment="center" id="oKE-Kn-Sj8">
                                    <font key="font" metaFont="smallSystem"/>
                                    <string key="title">Copyright © 2019 TELEGRAM MESSENGER LLP.
                                    <font key="font" metaFont="miniSystem"/>
                                    <string key="title">Copyright © 2016–2020 TELEGRAM MESSENGER LLP.
All rights reserved.</string>
                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                </textFieldCell>
                            </textField>
                            <button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="g12-WR-g1L">
                                <rect key="frame" x="103" y="67" width="109" height="19"/>
                                <rect key="frame" x="105" y="58" width="109" height="19"/>
                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                                <buttonCell key="cell" type="roundRect" title="Copy to Clipboard" bezelStyle="roundedRect" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="jkx-4l-Bvo">
                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                    <font key="font" metaFont="smallSystem"/>
                                    <font key="font" metaFont="menu" size="11"/>
                                </buttonCell>
                                <connections>
                                    <action selector="copyButtonClicked:" target="iy1-iR-ByA" id="qOf-IX-dv2"/>
                                </connections>
                            </button>
                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7wx-9O-ZxV">
                                <rect key="frame" x="87" y="94" width="141" height="28"/>
                                <autoresizingMask key="autoresizingMask"/>
                                <rect key="frame" x="89" y="87" width="141" height="28"/>
                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                                <textFieldCell key="cell" lineBreakMode="clipping" alignment="center" id="P7E-x4-hJQ">
                                    <font key="font" metaFont="smallSystem"/>
                                    <font key="font" metaFont="menu" size="11"/>
                                    <string key="title">Version 5.0.1 (123456)
Mac App Store</string>
                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>


@@ 88,13 87,17 @@ Mac App Store</string>
                        </subviews>
                    </view>
                    <connections>
                        <outlet property="appIconImageView" destination="UNb-tG-O6e" id="6f3-nn-6gG"/>
                        <outlet property="copyVersionButton" destination="g12-WR-g1L" id="2oR-75-h3F"/>
                        <outlet property="copyrightNoticeLabel" destination="IPB-WT-oMo" id="Zgs-ud-kZf"/>
                        <outlet property="versionLabel" destination="7wx-9O-ZxV" id="Tdz-bV-kc5"/>
                    </connections>
                </viewController>
                <customObject id="9H5-yz-bWK" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
            </objects>
            <point key="canvasLocation" x="-142" y="500.5"/>
            <point key="canvasLocation" x="-142" y="500"/>
        </scene>
    </scenes>
    <resources>
        <image name="AppIcon" width="512" height="512"/>
    </resources>
</document>

M Telegram-Mac/TGAboutWindow.swift => Telegram-Mac/TGAboutWindow.swift +1 -1
@@ 10,6 10,6 @@ import Cocoa

class TGAboutWindow: NSWindow {
    override func cancelOperation(_ sender: Any?) {
        self.orderOut(sender)
        self.close()
    }
}

M Telegram.xcodeproj/project.pbxproj => Telegram.xcodeproj/project.pbxproj +20 -0
@@ 7,6 7,9 @@
	objects = {

/* Begin PBXBuildFile section */
		7F8A11792497701800A4F127 /* TGAboutWindow.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7F8A11762497701700A4F127 /* TGAboutWindow.storyboard */; };
		7F8A117A2497701800A4F127 /* TGAboutWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F8A11772497701700A4F127 /* TGAboutWindow.swift */; };
		7F8A117B2497701800A4F127 /* TGAboutViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F8A11782497701700A4F127 /* TGAboutViewController.swift */; };
		9F0367F0227208E000456348 /* QRCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F0367EF227208E000456348 /* QRCode.swift */; };
		9F0367F22272108800456348 /* ProxyQRCodeRowItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F0367F12272108800456348 /* ProxyQRCodeRowItem.swift */; };
		9F0367F72273260A00456348 /* UndoTooltipController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F0367F62273260A00456348 /* UndoTooltipController.swift */; };


@@ 950,6 953,9 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
		7F8A11762497701700A4F127 /* TGAboutWindow.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = TGAboutWindow.storyboard; sourceTree = "<group>"; };
		7F8A11772497701700A4F127 /* TGAboutWindow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TGAboutWindow.swift; sourceTree = "<group>"; };
		7F8A11782497701700A4F127 /* TGAboutViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TGAboutViewController.swift; sourceTree = "<group>"; };
		9F0367EF227208E000456348 /* QRCode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QRCode.swift; sourceTree = "<group>"; };
		9F0367F12272108800456348 /* ProxyQRCodeRowItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProxyQRCodeRowItem.swift; sourceTree = "<group>"; };
		9F0367F62273260A00456348 /* UndoTooltipController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UndoTooltipController.swift; sourceTree = "<group>"; };


@@ 2081,6 2087,16 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
		7F8A117524976FE800A4F127 /* about-window */ = {
			isa = PBXGroup;
			children = (
				7F8A11782497701700A4F127 /* TGAboutViewController.swift */,
				7F8A11762497701700A4F127 /* TGAboutWindow.storyboard */,
				7F8A11772497701700A4F127 /* TGAboutWindow.swift */,
			);
			name = "about-window";
			sourceTree = "<group>";
		};
		9F0367E622707B6400456348 /* lottie */ = {
			isa = PBXGroup;
			children = (


@@ 3003,6 3019,7 @@
		C22E062F1D80439800A11C88 /* ui */ = {
			isa = PBXGroup;
			children = (
				7F8A117524976FE800A4F127 /* about-window */,
				9F354E9A227062F3006F1D42 /* haptic */,
				9F3D5F6122044D3500CB0CAA /* updater */,
				9F0AE6BA2199BBA400A8B53A /* media-player */,


@@ 4925,6 4942,7 @@
				C250B0371DB7BB09004E9FBE /* mime-types.txt in Resources */,
				D07450EA233D61B800769D7F /* write_words.tgs in Resources */,
				9F03681722771A9700456348 /* anim_unpin.json in Resources */,
				7F8A11792497701800A4F127 /* TGAboutWindow.storyboard in Resources */,
				C253A9701D92F9F100CDC850 /* Localizable.strings in Resources */,
				D07450E7233D61B800769D7F /* gift.tgs in Resources */,
				9F03681B22771A9700456348 /* anim_pin.json in Resources */,


@@ 5098,6 5116,7 @@
				D070DB8122D3638F008A0BBE /* StickersViewController.swift in Sources */,
				C2777B621DCFB4C9008B69DD /* ChatServiceItem.swift in Sources */,
				9FFAE4F9205A8C89000C028E /* FFMpegAudioFrameDecoder.swift in Sources */,
				7F8A117A2497701800A4F127 /* TGAboutWindow.swift in Sources */,
				C232EABE1E1D13A800C4D38C /* TextUtils.swift in Sources */,
				C253A9741D94182500CDC850 /* ChatRightView.swift in Sources */,
				9FDA713F20EE2D49001ED8ED /* PopularPeersRowItem.swift in Sources */,


@@ 5287,6 5306,7 @@
				C20232AA1D81D19C007C9ADE /* ChatRowItem.swift in Sources */,
				9FA0E53B2052EDFF001E5649 /* HackUtils.m in Sources */,
				9FC4DA9E21DD1C6C003E2A62 /* ImageCompression.swift in Sources */,
				7F8A117B2497701800A4F127 /* TGAboutViewController.swift in Sources */,
				C2271DAC1DAE1116001792B6 /* PeerInfoEntries.swift in Sources */,
				C25C132D1E8A404F00AE26A1 /* InstalledStickerPacksController.swift in Sources */,
				9F10CE9A206284F8002DD61A /* InputDataDateRowItem.swift in Sources */,