1 | /****************************************************************************
|
---|
2 | ** ui.h extension file, included from the uic-generated form implementation.
|
---|
3 | **
|
---|
4 | ** Add custom slot implementations here. Use a slot init() for
|
---|
5 | ** initialization code called during construction, and a slot destroy()
|
---|
6 | ** for cleanup code called during destruction.
|
---|
7 | **
|
---|
8 | ** This file gets modified by Qt Designer whenever you add, rename or
|
---|
9 | ** remove custom slots. Implementation code does not get lost.
|
---|
10 | *****************************************************************************/
|
---|
11 |
|
---|
12 | #include <designerinterface.h>
|
---|
13 |
|
---|
14 | void CppProjectSettings::reInit( QUnknownInterface *iface )
|
---|
15 | {
|
---|
16 | comboConfig->setCurrentItem( 0 );
|
---|
17 | comboLibs->setCurrentItem( 0 );
|
---|
18 | comboDefines->setCurrentItem( 0 );
|
---|
19 | comboInclude->setCurrentItem( 0 );
|
---|
20 |
|
---|
21 | DesignerInterface *dIface = 0;
|
---|
22 | iface->queryInterface( IID_Designer, (QUnknownInterface**)&dIface );
|
---|
23 | if ( !dIface )
|
---|
24 | return;
|
---|
25 | DesignerProject *project = dIface->currentProject();
|
---|
26 | if ( project->templte() == "app" )
|
---|
27 | comboTemplate->setCurrentItem( 0 );
|
---|
28 | else
|
---|
29 | comboTemplate->setCurrentItem( 1 );
|
---|
30 |
|
---|
31 | config.clear();
|
---|
32 | defines.clear();
|
---|
33 | libs.clear();
|
---|
34 | defines.clear();
|
---|
35 | includes.clear();
|
---|
36 |
|
---|
37 | const QString platforms[] = { "(all)", "win32", "unix", "mac", QString::null };
|
---|
38 | for ( int i = 0; platforms[ i ] != QString::null; ++i ) {
|
---|
39 | config.replace( platforms[ i ], project->config( platforms[ i ] ) );
|
---|
40 | libs.replace( platforms[ i ], project->libs( platforms[ i ] ) );
|
---|
41 | defines.replace( platforms[ i ], project->defines( platforms[ i ] ) );
|
---|
42 | includes.replace( platforms[ i ], project->includePath( platforms[ i ] ) );
|
---|
43 | }
|
---|
44 | editConfig->setText( config[ "(all)" ] );
|
---|
45 | editLibs->setText( libs[ "(all)" ] );
|
---|
46 | editDefines->setText( defines[ "(all)" ] );
|
---|
47 | editInclude->setText( includes[ "(all)" ] );
|
---|
48 | }
|
---|
49 |
|
---|
50 | void CppProjectSettings::save( QUnknownInterface *iface )
|
---|
51 | {
|
---|
52 | DesignerInterface *dIface = 0;
|
---|
53 | iface->queryInterface( IID_Designer, (QUnknownInterface**)&dIface );
|
---|
54 | if ( !dIface )
|
---|
55 | return;
|
---|
56 | DesignerProject *project = dIface->currentProject();
|
---|
57 |
|
---|
58 | project->setTemplate( comboTemplate->currentText() );
|
---|
59 | const QString platforms[] = { "(all)", "win32", "unix", "mac", QString::null };
|
---|
60 | for ( int i = 0; platforms[ i ] != QString::null; ++i ) {
|
---|
61 | project->setConfig( platforms[ i ], config[ platforms[ i ] ] );
|
---|
62 | project->setLibs( platforms[ i ], libs[ platforms[ i ] ] );
|
---|
63 | project->setDefines( platforms[ i ], defines[ platforms[ i ] ] );
|
---|
64 | project->setIncludePath( platforms[ i ], includes[ platforms[ i ] ] );
|
---|
65 | }
|
---|
66 | }
|
---|
67 |
|
---|
68 | void CppProjectSettings::configChanged( const QString &str )
|
---|
69 | {
|
---|
70 | config.replace( comboConfig->currentText(), str );
|
---|
71 | }
|
---|
72 |
|
---|
73 | void CppProjectSettings::libsChanged( const QString &str )
|
---|
74 | {
|
---|
75 | libs.replace( comboLibs->currentText(), str );
|
---|
76 | }
|
---|
77 |
|
---|
78 | void CppProjectSettings::definesChanged( const QString &str )
|
---|
79 | {
|
---|
80 | defines.replace( comboDefines->currentText(), str );
|
---|
81 | }
|
---|
82 |
|
---|
83 | void CppProjectSettings::includesChanged( const QString &str )
|
---|
84 | {
|
---|
85 | includes.replace( comboInclude->currentText(), str );
|
---|
86 | }
|
---|
87 |
|
---|
88 | void CppProjectSettings::configPlatformChanged( const QString &plat )
|
---|
89 | {
|
---|
90 | editConfig->setText( config[ plat ] );
|
---|
91 | }
|
---|
92 |
|
---|
93 | void CppProjectSettings::libsPlatformChanged( const QString &plat )
|
---|
94 | {
|
---|
95 | editLibs->setText( libs[ plat ] );
|
---|
96 | }
|
---|
97 |
|
---|
98 | void CppProjectSettings::definesPlatformChanged( const QString &plat )
|
---|
99 | {
|
---|
100 | editDefines->setText( defines[ plat ] );
|
---|
101 | }
|
---|
102 |
|
---|
103 | void CppProjectSettings::includesPlatformChanged( const QString &plat )
|
---|
104 | {
|
---|
105 | editInclude->setText( includes[ plat ] );
|
---|
106 | }
|
---|