From 31fea087438ac67ac3765e71023b43937c25bdef Mon Sep 17 00:00:00 2001 From: Nikolay Polyanovskii Date: Wed, 14 May 2014 05:11:52 -0500 Subject: [PATCH] Little improvement of open file dialog on MacOS [git-p4: depot-paths = "//Abdaw/dev_main/tracks/": change = 460387] --- gtk2_ardour/OpenFileDialog.mm | 8 +------- gtk2_ardour/OpenFileDialogProxy.h | 11 ++++++----- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/gtk2_ardour/OpenFileDialog.mm b/gtk2_ardour/OpenFileDialog.mm index f1f6733c94..40574fbb66 100644 --- a/gtk2_ardour/OpenFileDialog.mm +++ b/gtk2_ardour/OpenFileDialog.mm @@ -21,10 +21,7 @@ namespace ARDOUR { // ====== C "trampoline" functions to invoke Objective-C method ====== // string OpenFileDialog(string title) -{ - if(title.size()==0) - title = "Open"; - +{ NSString *nsTitle = [NSString stringWithUTF8String:title.c_str()]; // Call the Objective-C method using Objective-C syntax @@ -36,9 +33,6 @@ string OpenFileDialog(string title) string SaveFileDialog(string title) { - if(title.size()==0) - title = "Save"; - NSString *nsTitle = [NSString stringWithUTF8String:title.c_str()]; // Call the Objective-C method using Objective-C syntax diff --git a/gtk2_ardour/OpenFileDialogProxy.h b/gtk2_ardour/OpenFileDialogProxy.h index e1b894ced8..f430d713bb 100644 --- a/gtk2_ardour/OpenFileDialogProxy.h +++ b/gtk2_ardour/OpenFileDialogProxy.h @@ -11,15 +11,16 @@ #include -// This is the C "trampoline" function that will be used -// to invoke a specific Objective-C method FROM C++ namespace ARDOUR { + // This is the C "trampoline" function that will be used + // to invoke a specific Objective-C method FROM C++ #ifdef __APPLE__ - std::string SaveFileDialog(std::string title = ""); - std::string OpenFileDialog(std::string title = ""); + std::string SaveFileDialog(std::string title = "Save"); + std::string OpenFileDialog(std::string title = "Open"); #endif - + + // OS Windows specific functions #ifdef _WIN32 bool SaveFileDialog(std::string& fileName, std::string title = "Save"); bool OpenFileDialog(std::string& fileName, std::string title = "Open");