diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e2fd13a7f85a32099fafd03adf7001ee3a44234..a07a90d0b1921d3af58d289c3cec7d2efece376e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,35 +30,63 @@ MESSAGE("LibRingClient is here:" ${LIB_RING_CLIENT_INCLUDE_DIR}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") #Files to compile -SET(ringclient_SRCS - src/main.mm - src/AppDelegate.mm - src/RingWindowController.mm - src/ConversationsViewController.mm - src/PreferencesViewController.mm +SET(ringclient_CONTROLLERS src/QNSTreeController.mm + src/QNSTreeController.h + src/CurrentCallVC.mm + src/CurrentCallVC.h + src/GeneralPrefsVC.mm + src/RingWizardWC.mm + src/RingWizardWC.h + src/RingWindowController.mm + src/RingWindowController.h + src/ConversationsVC.mm + src/ConversationsVC.h + src/PreferencesVC.mm + src/PreferencesVC.h src/AccGeneralVC.mm - src/AccAudioVC.mm + src/AccGeneralVC.h src/AccVideoVC.mm + src/AccVideoVC.h + src/AccAudioVC.mm + src/AccAudioVC.h src/AccRingVC.mm + src/AccRingVC.h src/AccAdvancedVC.mm + src/AccAdvancedVC.h src/AccSecurityVC.mm - src/AccountsVC.mm - src/CurrentCallVC.mm + src/AccSecurityVC.h src/AudioPrefsVC.mm + src/AudioPrefsVC.h + src/AccountsVC.mm + src/AccountsVC.h src/VideoPrefsVC.mm - src/GeneralPrefsVC.mm - src/RingWizardWC.mm - src/HistoryViewController.mm + src/VideoPrefsVC.h + src/GeneralPrefsVC.h + src/HistoryVC.mm + src/HistoryVC.h src/PersonsVC.mm + src/PersonsVC.h) - src/delegates/ImageManipulationDelegate.mm +SET(ringclient_BACKENDS + src/backends/AddressBookBackend.mm + src/backends/MinimalHistoryBackend.mm + src/backends/AddressBookBackend.h + src/backends/MinimalHistoryBackend.h) - src/views/PersonCell.mm +SET(ringclient_VIEWS src/views/CallView.mm + src/views/CallView.h + src/views/PersonCell.mm + src/views/PersonCell.h) + +SET(ringclient_OTHERS + src/main.mm + src/AppDelegate.mm + src/AppDelegate.h + src/delegates/ImageManipulationDelegate.mm + src/delegates/ImageManipulationDelegate.h) - src/backends/AddressBookBackend.mm - src/backends/MinimalHistoryBackend.mm) SET(ringclient_XIBS MainMenu @@ -77,37 +105,7 @@ SET(ringclient_XIBS PreferencesScreen RingWizard) -SET(ringclient_HDRS - src/AppDelegate.h - src/RingWindowController.h - src/CurrentCallVC.h - src/ConversationsViewController.h - src/PreferencesViewController.h - src/AccGeneralVC.h - src/AccVideoVC.h - src/AccAudioVC.h - src/AccRingVC.h - src/AccAdvancedVC.h - src/AccSecurityVC.h - src/AudioPrefsVC.h - src/AccountsVC.h - src/VideoPrefsVC.h - src/GeneralPrefsVC.h - src/HistoryViewController.h - src/RingWizardWC.h - src/QNSTreeController.h - src/PersonsVC.h - - src/delegates/ImageManipulationDelegate.h - - src/views/PersonCell.h - src/views/CallView.h - - src/backends/AddressBookBackend.h - src/backends/MinimalHistoryBackend.h) - # Icons - # This part tells CMake where to find and install the file itself SET(myApp_ICON ${CMAKE_CURRENT_SOURCE_DIR}/data/appicon.icns) SET_SOURCE_FILES_PROPERTIES(${myApp_ICON} PROPERTIES @@ -136,13 +134,23 @@ FOREACH(xib ${ringclient_XIBS}) ENDFOREACH() ADD_EXECUTABLE(${PROJ_NAME} MACOSX_BUNDLE - ${ringclient_SRCS} - ${ringclient_HDRS} + ${ringclient_CONTROLLERS} + ${ringclient_BACKENDS} + ${ringclient_VIEWS} + ${ringclient_OTHERS} ${ringclient_XIBS_FOR_EXECUTABLE} ${myApp_ICON} Credits.rtf ${ring_ICONS}) +# Follow Xcode hierarchy principles +SOURCE_GROUP("Controllers" FILES ${ringclient_CONTROLLERS}) +SOURCE_GROUP("Backends" FILES ${ringclient_BACKENDS}) +SOURCE_GROUP("CustomViews" FILES ${ringclient_VIEWS}) +SOURCE_GROUP("Classes" FILES ${ringclient_OTHERS}) +SOURCE_GROUP("Resources\\Interface Builder" FILES ${ringclient_XIBS_FOR_EXECUTABLE}) + + TARGET_LINK_LIBRARIES( ${PROJ_NAME} ${LIB_RING_CLIENT_LIBRARY} ${Qt5Core_LIBRARIES} diff --git a/src/ConversationsViewController.h b/src/ConversationsVC.h similarity index 94% rename from src/ConversationsViewController.h rename to src/ConversationsVC.h index 09d4e3bc160062d4bc28ff283f2de9958dcef2f4..af8843d80b642c3858ccd1a6fcaa086c94586c4d 100644 --- a/src/ConversationsViewController.h +++ b/src/ConversationsVC.h @@ -33,7 +33,7 @@ #import <Cocoa/Cocoa.h> #import "QNSTreeController.h" -@interface ConversationsViewController : NSViewController <NSOutlineViewDelegate> { +@interface ConversationsVC : NSViewController <NSOutlineViewDelegate> { } diff --git a/src/ConversationsViewController.mm b/src/ConversationsVC.mm similarity index 98% rename from src/ConversationsViewController.mm rename to src/ConversationsVC.mm index 4b7ce22d28e2305a91157b226c7a281b52db9238..c7dabad97726b68b14472e7a89971fdccfd5d5fe 100644 --- a/src/ConversationsViewController.mm +++ b/src/ConversationsVC.mm @@ -27,7 +27,7 @@ * shall include the source code for the parts of OpenSSL used as well * as that of the covered work. */ -#import "ConversationsViewController.h" +#import "ConversationsVC.h" #import <callmodel.h> #import <QtCore/qitemselectionmodel.h> @@ -36,7 +36,7 @@ #define COLUMNID_CONVERSATIONS @"ConversationsColumn" // the single column name in our outline view -@interface ConversationsViewController () +@interface ConversationsVC () @property CurrentCallVC* currentVC; @property (assign) IBOutlet NSView *currentCallView; @@ -45,7 +45,7 @@ @end -@implementation ConversationsViewController +@implementation ConversationsVC @synthesize conversationsView; @synthesize treeController; @synthesize currentVC; diff --git a/src/HistoryViewController.h b/src/HistoryVC.h similarity index 95% rename from src/HistoryViewController.h rename to src/HistoryVC.h index 4c4dbeacce2d08e5a6e1c545d3e0f69084165e12..fe6b7b48431ec644695e52c1df2358623ee9c280 100644 --- a/src/HistoryViewController.h +++ b/src/HistoryVC.h @@ -32,7 +32,7 @@ #import <Cocoa/Cocoa.h> -@interface HistoryViewController : NSViewController <NSOutlineViewDelegate> { +@interface HistoryVC : NSViewController <NSOutlineViewDelegate> { } diff --git a/src/HistoryViewController.mm b/src/HistoryVC.mm similarity index 98% rename from src/HistoryViewController.mm rename to src/HistoryVC.mm index 60d05b0e7f05b7fa1351c9a78931c7ac7fbea64d..4073320b4cda1e2a0d11b2672566766bacce4f94 100644 --- a/src/HistoryViewController.mm +++ b/src/HistoryVC.mm @@ -27,7 +27,7 @@ * shall include the source code for the parts of OpenSSL used as well * as that of the covered work. */ -#import "HistoryViewController.h" +#import "HistoryVC.h" #import <categorizedhistorymodel.h> #import <QSortFilterProxyModel> @@ -42,14 +42,14 @@ #define COLUMNID_CONTACTMETHOD @"ContactMethodColumn" // the single column name in our outline view #define COLUMNID_DATE @"DateColumn" // the single column name in our outline view -@interface HistoryViewController() +@interface HistoryVC() @property NSTreeController *treeController; @property (assign) IBOutlet NSOutlineView *historyView; @property QSortFilterProxyModel *historyProxyModel; @end -@implementation HistoryViewController +@implementation HistoryVC @synthesize treeController; @synthesize historyView; @synthesize historyProxyModel; diff --git a/src/PreferencesViewController.h b/src/PreferencesVC.h similarity index 96% rename from src/PreferencesViewController.h rename to src/PreferencesVC.h index ac0400ce9db70887ba1746f09db5f4da66c355b5..583e2e596513bd6da2713c14ca9c994470f4f922 100644 --- a/src/PreferencesViewController.h +++ b/src/PreferencesVC.h @@ -32,7 +32,7 @@ #import <Cocoa/Cocoa.h> -@interface PreferencesViewController : NSViewController <NSToolbarDelegate> +@interface PreferencesVC : NSViewController <NSToolbarDelegate> - (void) close; @property (nonatomic, assign) NSViewController *currentVC; diff --git a/src/PreferencesViewController.mm b/src/PreferencesVC.mm similarity index 98% rename from src/PreferencesViewController.mm rename to src/PreferencesVC.mm index 5ccde7a043827bf39ef2252a7f683e42ea333852..ebc4991aa65f4e4c6211369f560f93013f1dc34c 100644 --- a/src/PreferencesViewController.mm +++ b/src/PreferencesVC.mm @@ -27,7 +27,7 @@ * shall include the source code for the parts of OpenSSL used as well * as that of the covered work. */ -#import "PreferencesViewController.h" +#import "PreferencesVC.h" #import <QuartzCore/QuartzCore.h> @@ -39,13 +39,13 @@ #import "AudioPrefsVC.h" #import "VideoPrefsVC.h" -@interface PreferencesViewController () +@interface PreferencesVC () @property NSButton* toggleAdvancedSettings; @end -@implementation PreferencesViewController +@implementation PreferencesVC @synthesize toggleAdvancedSettings; static NSString* const kProfilePrefsIdentifier = @"ProfilesPrefsIdentifier"; diff --git a/src/RingWindowController.h b/src/RingWindowController.h index 77c93c4e5a910ef3f7cd293b9e2a17a19f5d19db..86b104b1f0da3ea1a7526e53e4cd189c71b7d437 100644 --- a/src/RingWindowController.h +++ b/src/RingWindowController.h @@ -31,14 +31,14 @@ #define RINGWINDOWCONTROLLER_H #import <Cocoa/Cocoa.h> -#import "HistoryViewController.h" -#import "PreferencesViewController.h" +#import "HistoryVC.h" +#import "PreferencesVC.h" @interface RingWindowController : NSWindowController <NSToolbarDelegate, NSTextFieldDelegate>{ IBOutlet NSView *currentView; } @property (nonatomic, assign) NSViewController *myCurrentViewController; -@property PreferencesViewController* preferencesViewController; +@property PreferencesVC* preferencesViewController; - (IBAction)openPreferences:(id)sender; - (IBAction)closePreferences:(NSToolbarItem *)sender; diff --git a/src/RingWindowController.mm b/src/RingWindowController.mm index f46bf664220b7260874cdedbd964a3c402d0eaf7..48a5c0c0eda48bd3de67bb3340931ce5eff1a613 100644 --- a/src/RingWindowController.mm +++ b/src/RingWindowController.mm @@ -62,7 +62,7 @@ static NSString* const kCallButtonIdentifer = @"CallButtonIdentifier"; } NSToolbar* tb = [[NSToolbar alloc] initWithIdentifier: @"PreferencesToolbar"]; - self.preferencesViewController = [[PreferencesViewController alloc] initWithNibName:@"PreferencesScreen" bundle:nil]; + self.preferencesViewController = [[PreferencesVC alloc] initWithNibName:@"PreferencesScreen" bundle:nil]; self.myCurrentViewController = self.preferencesViewController; NSLayoutConstraint* test = [NSLayoutConstraint constraintWithItem:self.preferencesViewController.view diff --git a/ui/RingWindow.xib b/ui/RingWindow.xib index 17975d94e08896a322fbc4eecca517a6cec241d2..fdd2c01c0a0b585c86aae74b00cc949438a9bd04 100644 --- a/ui/RingWindow.xib +++ b/ui/RingWindow.xib @@ -254,13 +254,13 @@ </connections> <point key="canvasLocation" x="529.5" y="361"/> </window> - <viewController id="jzj-dD-ryc" customClass="HistoryViewController"> + <viewController id="jzj-dD-ryc" customClass="HistoryVC"> <connections> <outlet property="historyView" destination="rr8-UC-gGF" id="8NW-8O-X5L"/> <outlet property="view" destination="9uI-D5-KRt" id="hCt-k1-UV2"/> </connections> </viewController> - <viewController id="txt-J3-pzW" customClass="ConversationsViewController"> + <viewController id="txt-J3-pzW" customClass="ConversationsVC"> <connections> <outlet property="conversationsView" destination="zcl-pp-rGb" id="YXp-WN-UmC"/> <outlet property="currentCallView" destination="tSW-YT-asL" id="r2r-Q3-clc"/>