# HG changeset patch # User Teemu Piippo # Date 1374010203 -10800 # Node ID c9b22c06307cb25350a9eacab64c6b2f0737ad7b # Parent bb264814dd81ec21628d884dca9087a945973d3a Done config box base diff -r bb264814dd81 -r c9b22c06307c src/main.cpp --- a/src/main.cpp Tue Jul 16 23:53:31 2013 +0300 +++ b/src/main.cpp Wed Jul 17 00:30:03 2013 +0300 @@ -1,13 +1,31 @@ +#include #include "types.h" +#include "config.h" -int main() { +// ============================================================================= +// ----------------------------------------------------------------------------- +int main( int argc, char* argv[] ) { + QApplication app( argc, argv ); + + for( int i = 1; i < argc; ++i ) { + str arg = argv[i]; + + if( arg == "--config" ) { + ConfigBox* dlg = new ConfigBox; + dlg->show(); + } + } + print ("Hello world! This is " APPNAME " %1\n", versionString() ); + return app.exec(); } +// ============================================================================= +// ----------------------------------------------------------------------------- QString versionString() { str text = fmt( "v%1.%2", VERSION_MAJOR, VERSION_MINOR ); #if VERSION_PATCH != 0 - text += fmt( ".%3", VERSION_PATCH ); + text += fmt( ".%1", VERSION_PATCH ); #endif #if BUILD_ID == BUILD_INTERNAL diff -r bb264814dd81 -r c9b22c06307c src/src.pro --- a/src/src.pro Tue Jul 16 23:53:31 2013 +0300 +++ b/src/src.pro Wed Jul 17 00:30:03 2013 +0300 @@ -9,5 +9,5 @@ RCC_DIR = ./build/ SOURCES = *.cpp HEADERS = *.h -# FORMS = ui/*.ui +FORMS = ui/*.ui QMAKE_CXXFLAGS += -std=c++0x \ No newline at end of file diff -r bb264814dd81 -r c9b22c06307c src/types.cpp --- a/src/types.cpp Tue Jul 16 23:53:31 2013 +0300 +++ b/src/types.cpp Wed Jul 17 00:30:03 2013 +0300 @@ -4,12 +4,12 @@ #include #include "types.h" -str doFormat( std::vector args ) { +str doFormat( initlist args ) { assert( args.size() >= 1 ); - str text = args[0].value(); + str text = args.begin()->value(); - for( uchar i = 1; i < args.size(); ++i ) - text = text.arg( args[i].value() ); + for( initlist::iterator it = args.begin() + 1; it != args.end(); ++it ) + text = text.arg( it->value() ); return text; } diff -r bb264814dd81 -r c9b22c06307c src/types.h --- a/src/types.h Tue Jul 16 23:53:31 2013 +0300 +++ b/src/types.h Wed Jul 17 00:30:03 2013 +0300 @@ -74,10 +74,10 @@ }; // Formatter function -str doFormat( std::vector< StringFormatArg > args ); +str doFormat( initlist args ); // printf replacement -void doPrint( initlist args ); // heh +void doPrint( initlist args ); // Macros to access these functions #ifndef IN_IDE_PARSER