universal binaries on Mac, some cleanup, fix for click on Mac bundle for starting llcon

This commit is contained in:
Volker Fischer 2010-03-12 20:25:30 +00:00
parent 425424b4ad
commit a36d36d015
3 changed files with 11 additions and 7 deletions

View file

@ -15,6 +15,7 @@ macx {
HEADERS += mac/sound.h
SOURCES += mac/sound.cpp
RC_FILE = mac/llcon.icns
CONFIG += x86 ppc
LIBS += -framework CoreFoundation \
-framework CoreServices \

View file

@ -220,7 +220,7 @@ public:
/* Prototypes for global functions ********************************************/
// command line parsing, TODO do not declare functions globally but in a class
std::string UsageArguments ( char** argv );
bool GetFlagArgument ( int argc, char** argv, int& i, std::string strShortOpt, std::string strLongOpt );
bool GetFlagArgument ( char** argv, int& i, std::string strShortOpt, std::string strLongOpt );
bool GetStringArgument ( int argc, char** argv, int& i, std::string strShortOpt, std::string strLongOpt, std::string& strArg );
bool GetNumericArgument ( int argc, char** argv, int& i, std::string strShortOpt, std::string strLongOpt, double rRangeStart, double rRangeStop, double& rValue);

View file

@ -62,7 +62,7 @@ int main ( int argc, char** argv )
for ( int i = 1; i < argc; i++ )
{
// server mode flag ----------------------------------------------------
if ( GetFlagArgument ( argc, argv, i, "-s", "--server" ) )
if ( GetFlagArgument ( argv, i, "-s", "--server" ) )
{
bIsClient = false;
cout << "- server mode chosen" << std::endl;
@ -71,7 +71,7 @@ int main ( int argc, char** argv )
// use GUI flag --------------------------------------------------------
if ( GetFlagArgument ( argc, argv, i, "-n", "--nogui" ) )
if ( GetFlagArgument ( argv, i, "-n", "--nogui" ) )
{
bUseGUI = false;
cout << "- no GUI mode chosen" << std::endl;
@ -80,7 +80,7 @@ int main ( int argc, char** argv )
// disable LEDs flag ---------------------------------------------------
if ( GetFlagArgument ( argc, argv, i, "-d", "--disableleds" ) )
if ( GetFlagArgument ( argv, i, "-d", "--disableleds" ) )
{
bDisalbeLEDs = true;
cout << "- disable LEDs in main window" << std::endl;
@ -142,7 +142,7 @@ int main ( int argc, char** argv )
// connect on startup --------------------------------------------------
if ( GetFlagArgument ( argc, argv, i, "-c", "--connect" ) )
if ( GetFlagArgument ( argv, i, "-c", "--connect" ) )
{
bConnectOnStartup = true;
cout << "- connect on startup enabled" << std::endl;
@ -164,7 +164,11 @@ int main ( int argc, char** argv )
cerr << "Unknown option '" << argv[i] << "' -- use '--help' for help"
<< endl;
// clicking on the Mac application bundle, the actual application
// is called with weird command line args -> do not exit on these
#if !( defined ( __APPLE__ ) || defined ( __MACOSX ) )
exit ( 1 );
#endif
}
// Application object
@ -317,8 +321,7 @@ std::string UsageArguments ( char **argv )
"Example: " + std::string ( argv[0] ) + " -l -inifile myinifile.ini\n";
}
bool GetFlagArgument ( int argc,
char** argv,
bool GetFlagArgument ( char** argv,
int& i,
std::string strShortOpt,
std::string strLongOpt )