diff --git a/CMakeLists.txt b/CMakeLists.txt index 95edabcdc805c6375c2d82d627c36f5e8257c881..4033aa0bb08913b590a6451ac34a647706933908 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -254,6 +254,8 @@ SET(ringclient_OTHERS src/NSString+Extensions.mm src/RingMainWindow.h src/RingMainWindow.mm + src/MenuResponder.h + src/MenuResponder.mm src/Shader.metal ) diff --git a/src/MenuResponder.h b/src/MenuResponder.h new file mode 100644 index 0000000000000000000000000000000000000000..0a88684f0a977180b2b09b6aaa184c5f64653cfb --- /dev/null +++ b/src/MenuResponder.h @@ -0,0 +1,28 @@ +/* +* Copyright (C) 2020 Savoir-faire Linux Inc. +* Author: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#import <Cocoa/Cocoa.h> + +NS_ASSUME_NONNULL_BEGIN + +@interface MenuResponder : NSResponder + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/MenuResponder.mm b/src/MenuResponder.mm new file mode 100644 index 0000000000000000000000000000000000000000..d1fbc095ec154213643e82b512632af8a751bd61 --- /dev/null +++ b/src/MenuResponder.mm @@ -0,0 +1,30 @@ +/* +* Copyright (C) 2020 Savoir-faire Linux Inc. +* Author: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#import "MenuResponder.h" + +@implementation MenuResponder + +- (IBAction)showHelp:(id)sender +{ + NSURL * helpFile = [NSURL URLWithString: @"https://jami.net/help/"]; + [[NSWorkspace sharedWorkspace] openURL:helpFile]; +} + +@end diff --git a/src/RingWindowController.mm b/src/RingWindowController.mm index 4a4ff0b4a3214f7d6492e4dfd4b7978c8db6d902..4d26b6859ef10482dcb3b8e79228f0d2d0709b55 100644 --- a/src/RingWindowController.mm +++ b/src/RingWindowController.mm @@ -631,10 +631,4 @@ typedef NS_ENUM(NSInteger, ViewState) { [self changeViewTo:SHOW_CONVERSATION_SCREEN]; } -- (void)showHelp:(id)sender -{ - NSURL * helpFile = [NSURL URLWithString: @"https://jami.net/help/"]; - [[NSWorkspace sharedWorkspace] openURL:helpFile]; -} - @end diff --git a/ui/Base.lproj/MainMenu.xib b/ui/Base.lproj/MainMenu.xib index 66f2947a5ff3a92a63b15d901a0fd592bb88229b..e06e63036e590a4d48f4dce8393675e34ea73eb5 100644 --- a/ui/Base.lproj/MainMenu.xib +++ b/ui/Base.lproj/MainMenu.xib @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES"> +<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15705" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES"> <dependencies> - <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14460.31"/> + <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15705"/> </dependencies> <objects> <customObject id="-2" userLabel="File's Owner" customClass="RingWindowController"> @@ -326,16 +326,18 @@ <items> <menuItem title="Jami Help" keyEquivalent="?" id="492"> <connections> - <action selector="showHelp:" target="-1" id="493"/> + <action selector="showHelp:" target="TCU-co-tEb" id="gTr-qt-aGe"/> </connections> </menuItem> </items> </menu> </menuItem> </items> + <point key="canvasLocation" x="139" y="154"/> </menu> <customObject id="494" customClass="AppDelegate"/> <customObject id="420" customClass="NSFontManager"/> <customObject id="592" customClass="SUUpdater"/> + <customObject id="TCU-co-tEb" customClass="MenuResponder"/> </objects> </document>