Eneboo - Documentación para desarrolladores
|
00001 /**************************************************************************** 00002 ** ui.h extension file, included from the uic-generated form implementation. 00003 ** 00004 ** Add custom slot implementations here. Use a slot init() for 00005 ** initialization code called during construction, and a slot destroy() 00006 ** for cleanup code called during destruction. 00007 ** 00008 ** This file gets modified by Qt Designer whenever you add, rename or 00009 ** remove custom slots. Implementation code does not get lost. 00010 *****************************************************************************/ 00011 00012 #include <designerinterface.h> 00013 00014 void CppProjectSettings::reInit( QUnknownInterface *iface ) 00015 { 00016 comboConfig->setCurrentItem( 0 ); 00017 comboLibs->setCurrentItem( 0 ); 00018 comboDefines->setCurrentItem( 0 ); 00019 comboInclude->setCurrentItem( 0 ); 00020 00021 DesignerInterface *dIface = 0; 00022 iface->queryInterface( IID_Designer, (QUnknownInterface**)&dIface ); 00023 if ( !dIface ) 00024 return; 00025 DesignerProject *project = dIface->currentProject(); 00026 if ( project->templte() == "app" ) 00027 comboTemplate->setCurrentItem( 0 ); 00028 else 00029 comboTemplate->setCurrentItem( 1 ); 00030 00031 config.clear(); 00032 defines.clear(); 00033 libs.clear(); 00034 defines.clear(); 00035 includes.clear(); 00036 00037 const QString platforms[] = { "(all)", "win32", "unix", "mac", QString::null }; 00038 for ( int i = 0; platforms[ i ] != QString::null; ++i ) { 00039 config.replace( platforms[ i ], project->config( platforms[ i ] ) ); 00040 libs.replace( platforms[ i ], project->libs( platforms[ i ] ) ); 00041 defines.replace( platforms[ i ], project->defines( platforms[ i ] ) ); 00042 includes.replace( platforms[ i ], project->includePath( platforms[ i ] ) ); 00043 } 00044 editConfig->setText( config[ "(all)" ] ); 00045 editLibs->setText( libs[ "(all)" ] ); 00046 editDefines->setText( defines[ "(all)" ] ); 00047 editInclude->setText( includes[ "(all)" ] ); 00048 } 00049 00050 void CppProjectSettings::save( QUnknownInterface *iface ) 00051 { 00052 DesignerInterface *dIface = 0; 00053 iface->queryInterface( IID_Designer, (QUnknownInterface**)&dIface ); 00054 if ( !dIface ) 00055 return; 00056 DesignerProject *project = dIface->currentProject(); 00057 00058 project->setTemplate( comboTemplate->currentText() ); 00059 const QString platforms[] = { "(all)", "win32", "unix", "mac", QString::null }; 00060 for ( int i = 0; platforms[ i ] != QString::null; ++i ) { 00061 project->setConfig( platforms[ i ], config[ platforms[ i ] ] ); 00062 project->setLibs( platforms[ i ], libs[ platforms[ i ] ] ); 00063 project->setDefines( platforms[ i ], defines[ platforms[ i ] ] ); 00064 project->setIncludePath( platforms[ i ], includes[ platforms[ i ] ] ); 00065 } 00066 } 00067 00068 void CppProjectSettings::configChanged( const QString &str ) 00069 { 00070 config.replace( comboConfig->currentText(), str ); 00071 } 00072 00073 void CppProjectSettings::libsChanged( const QString &str ) 00074 { 00075 libs.replace( comboLibs->currentText(), str ); 00076 } 00077 00078 void CppProjectSettings::definesChanged( const QString &str ) 00079 { 00080 defines.replace( comboDefines->currentText(), str ); 00081 } 00082 00083 void CppProjectSettings::includesChanged( const QString &str ) 00084 { 00085 includes.replace( comboInclude->currentText(), str ); 00086 } 00087 00088 void CppProjectSettings::configPlatformChanged( const QString &plat ) 00089 { 00090 editConfig->setText( config[ plat ] ); 00091 } 00092 00093 void CppProjectSettings::libsPlatformChanged( const QString &plat ) 00094 { 00095 editLibs->setText( libs[ plat ] ); 00096 } 00097 00098 void CppProjectSettings::definesPlatformChanged( const QString &plat ) 00099 { 00100 editDefines->setText( defines[ plat ] ); 00101 } 00102 00103 void CppProjectSettings::includesPlatformChanged( const QString &plat ) 00104 { 00105 editInclude->setText( includes[ plat ] ); 00106 }