<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
<class>PreferencesBase</class>
<include location="global" impldecl="in declaration">qmap.h</include>
<include location="local" impldecl="in declaration">conf.h</include>
<include location="local" impldecl="in declaration">dlldefs.h</include>
<include location="global" impldecl="in implementation">qpalette.h</include>
<include location="global" impldecl="in implementation">qlineedit.h</include>
<include location="global" impldecl="in implementation">qpixmap.h</include>
<include location="global" impldecl="in implementation">qcombobox.h</include>
<include location="global" impldecl="in implementation">qfontdatabase.h</include>
<include location="local" impldecl="in implementation">editor.h</include>
<include location="global" impldecl="in implementation">qpushbutton.h</include>
<include location="global" impldecl="in implementation">qcheckbox.h</include>
<include location="global" impldecl="in implementation">qcolordialog.h</include>
<include location="global" impldecl="in implementation">qsettings.h</include>
<variable>QString path;</variable>
<variable>QMap&lt;QString, ConfigStyle&gt; styles;</variable>
<variable>ConfigStyle currentStyle;</variable>
<variable>QString currentElement;</variable>
<exportmacro>EDITOR_EXPORT</exportmacro>
<widget class="QWidget">
    <property name="name">
        <cstring>PreferencesBase</cstring>
    </property>
    <property name="geometry">
        <rect>
            <x>0</x>
            <y>0</y>
            <width>358</width>
            <height>311</height>
        </rect>
    </property>
    <property name="caption">
        <string>Form1</string>
    </property>
    <vbox>
        <property name="name">
            <cstring>unnamed</cstring>
        </property>
        <property name="margin">
            <number>11</number>
        </property>
        <property name="spacing">
            <number>6</number>
        </property>
        <widget class="QGroupBox">
            <property name="name">
                <cstring>GroupBox2</cstring>
            </property>
            <property name="frameShape">
                <enum>Box</enum>
            </property>
            <property name="frameShadow">
                <enum>Sunken</enum>
            </property>
            <property name="title">
                <string>S&amp;yntax Highlighting</string>
            </property>
            <grid>
                <property name="name">
                    <cstring>unnamed</cstring>
                </property>
                <property name="margin">
                    <number>11</number>
                </property>
                <property name="spacing">
                    <number>6</number>
                </property>
                <widget class="QLabel" row="0" column="0">
                    <property name="name">
                        <cstring>TextLabel1</cstring>
                    </property>
                    <property name="frameShape">
                        <enum>MShape</enum>
                    </property>
                    <property name="frameShadow">
                        <enum>MShadow</enum>
                    </property>
                    <property name="text">
                        <string>&amp;Element:</string>
                    </property>
                    <property name="buddy" stdset="0">
                        <cstring>listElements</cstring>
                    </property>
                </widget>
                <widget class="QLayoutWidget" row="1" column="1" rowspan="3" colspan="1">
                    <property name="name">
                        <cstring>Layout1</cstring>
                    </property>
                    <grid>
                        <property name="name">
                            <cstring>unnamed</cstring>
                        </property>
                        <property name="margin">
                            <number>0</number>
                        </property>
                        <property name="spacing">
                            <number>6</number>
                        </property>
                        <widget class="QCheckBox" row="2" column="0" rowspan="1" colspan="2">
                            <property name="name">
                                <cstring>checkBold</cstring>
                            </property>
                            <property name="text">
                                <string>&amp;Bold</string>
                            </property>
                        </widget>
                        <widget class="QToolButton" row="5" column="1">
                            <property name="name">
                                <cstring>buttonColor</cstring>
                            </property>
                            <property name="sizePolicy">
                                <sizepolicy>
                                    <hsizetype>1</hsizetype>
                                    <vsizetype>0</vsizetype>
                                </sizepolicy>
                            </property>
                            <property name="text">
                                <string>...</string>
                            </property>
                        </widget>
                        <widget class="QComboBox" row="0" column="1">
                            <property name="name">
                                <cstring>comboFamily</cstring>
                            </property>
                            <property name="editable">
                                <bool>true</bool>
                            </property>
                        </widget>
                        <widget class="QLabel" row="0" column="0">
                            <property name="name">
                                <cstring>TextLabel2</cstring>
                            </property>
                            <property name="text">
                                <string>&amp;Family:</string>
                            </property>
                            <property name="buddy" stdset="0">
                                <cstring>comboFamily</cstring>
                            </property>
                        </widget>
                        <widget class="QCheckBox" row="4" column="0" rowspan="1" colspan="2">
                            <property name="name">
                                <cstring>checkUnderline</cstring>
                            </property>
                            <property name="text">
                                <string>&amp;Underline</string>
                            </property>
                        </widget>
                        <widget class="QSpinBox" row="1" column="1">
                            <property name="name">
                                <cstring>spinSize</cstring>
                            </property>
                            <property name="minValue">
                                <number>1</number>
                            </property>
                        </widget>
                        <widget class="QCheckBox" row="3" column="0" rowspan="1" colspan="2">
                            <property name="name">
                                <cstring>checkItalic</cstring>
                            </property>
                            <property name="text">
                                <string>&amp;Italic</string>
                            </property>
                        </widget>
                        <widget class="QLabel" row="5" column="0">
                            <property name="name">
                                <cstring>TextLabel4</cstring>
                            </property>
                            <property name="text">
                                <string>Co&amp;lor:</string>
                            </property>
                            <property name="buddy" stdset="0">
                                <cstring>buttonColor</cstring>
                            </property>
                        </widget>
                        <widget class="QLabel" row="1" column="0">
                            <property name="name">
                                <cstring>TextLabel3</cstring>
                            </property>
                            <property name="text">
                                <string>&amp;Size:</string>
                            </property>
                            <property name="buddy" stdset="0">
                                <cstring>spinSize</cstring>
                            </property>
                        </widget>
                    </grid>
                </widget>
                <widget class="QListBox" row="1" column="0">
                    <item>
                        <property name="text">
                            <string>Comment</string>
                        </property>
                    </item>
                    <item>
                        <property name="text">
                            <string>Number</string>
                        </property>
                    </item>
                    <item>
                        <property name="text">
                            <string>String</string>
                        </property>
                    </item>
                    <item>
                        <property name="text">
                            <string>Type</string>
                        </property>
                    </item>
                    <item>
                        <property name="text">
                            <string>Keyword</string>
                        </property>
                    </item>
                    <item>
                        <property name="text">
                            <string>Preprocessor</string>
                        </property>
                    </item>
                    <item>
                        <property name="text">
                            <string>Label</string>
                        </property>
                    </item>
                    <item>
                        <property name="text">
                            <string>Standard</string>
                        </property>
                    </item>
                    <property name="name">
                        <cstring>listElements</cstring>
                    </property>
                </widget>
                <widget class="QLabel" row="2" column="0">
                    <property name="name">
                        <cstring>TextLabel2_2</cstring>
                    </property>
                    <property name="text">
                        <string>&amp;Preview:</string>
                    </property>
                    <property name="buddy" stdset="0">
                        <cstring>editPreview</cstring>
                    </property>
                </widget>
                <widget class="QLineEdit" row="3" column="0">
                    <property name="name">
                        <cstring>editPreview</cstring>
                    </property>
                    <property name="text">
                        <string>Some Text</string>
                    </property>
                </widget>
                <spacer row="4" column="1">
                    <property name="name">
                        <cstring>Spacer2</cstring>
                    </property>
                    <property name="orientation">
                        <enum>Vertical</enum>
                    </property>
                    <property name="sizeType">
                        <enum>Expanding</enum>
                    </property>
                    <property name="sizeHint">
                        <size>
                            <width>20</width>
                            <height>20</height>
                        </size>
                    </property>
                </spacer>
            </grid>
        </widget>
        <widget class="QGroupBox">
            <property name="name">
                <cstring>GroupBox3</cstring>
            </property>
            <property name="title">
                <string>Optio&amp;ns</string>
            </property>
            <grid>
                <property name="name">
                    <cstring>unnamed</cstring>
                </property>
                <property name="margin">
                    <number>11</number>
                </property>
                <property name="spacing">
                    <number>6</number>
                </property>
                <widget class="QCheckBox" row="0" column="0">
                    <property name="name">
                        <cstring>checkWordWrap</cstring>
                    </property>
                    <property name="text">
                        <string>&amp;Word Wrap</string>
                    </property>
                </widget>
                <widget class="QCheckBox" row="0" column="1">
                    <property name="name">
                        <cstring>checkParenMatching</cstring>
                    </property>
                    <property name="text">
                        <string>Parentheses &amp;Matching</string>
                    </property>
                </widget>
                <widget class="QCheckBox" row="1" column="0">
                    <property name="name">
                        <cstring>checkCompletion</cstring>
                    </property>
                    <property name="text">
                        <string>Comple&amp;tion</string>
                    </property>
                </widget>
            </grid>
        </widget>
    </vbox>
</widget>
<connections>
    <connection>
        <sender>spinSize</sender>
        <signal>valueChanged(int)</signal>
        <receiver>PreferencesBase</receiver>
        <slot>sizeChanged(int)</slot>
    </connection>
    <connection>
        <sender>checkBold</sender>
        <signal>toggled(bool)</signal>
        <receiver>PreferencesBase</receiver>
        <slot>boldChanged(bool)</slot>
    </connection>
    <connection>
        <sender>checkItalic</sender>
        <signal>toggled(bool)</signal>
        <receiver>PreferencesBase</receiver>
        <slot>italicChanged(bool)</slot>
    </connection>
    <connection>
        <sender>checkUnderline</sender>
        <signal>toggled(bool)</signal>
        <receiver>PreferencesBase</receiver>
        <slot>underlineChanged(bool)</slot>
    </connection>
    <connection>
        <sender>buttonColor</sender>
        <signal>clicked()</signal>
        <receiver>PreferencesBase</receiver>
        <slot>colorClicked()</slot>
    </connection>
    <connection>
        <sender>comboFamily</sender>
        <signal>activated(const QString&amp;)</signal>
        <receiver>PreferencesBase</receiver>
        <slot>familyChanged(const QString&amp;)</slot>
    </connection>
    <connection>
        <sender>listElements</sender>
        <signal>highlighted(const QString&amp;)</signal>
        <receiver>PreferencesBase</receiver>
        <slot>elementChanged(const QString&amp;)</slot>
    </connection>
    <slot access="protected" language="C++" returnType="void">init()</slot>
    <slot access="protected" language="C++" returnType="void">destroy()</slot>
    <slot access="protected" language="C++" returnType="void">colorClicked()</slot>
    <slot access="protected" language="C++" returnType="void">reInit()</slot>
    <slot access="protected" language="C++" returnType="void">save()</slot>
    <slot access="public" language="C++" returnType="void">updatePreview()</slot>
    <slot access="protected" language="C++" returnType="void">boldChanged( bool b )</slot>
    <slot access="protected" language="C++" returnType="void">elementChanged( const QString &amp;element )</slot>
    <slot access="protected" language="C++" returnType="void">familyChanged( const QString &amp;f )</slot>
    <slot access="protected" language="C++" returnType="void">italicChanged( bool b )</slot>
    <slot access="protected" language="C++" returnType="void">setColorPixmap( const QColor &amp;c )</slot>
    <slot access="public" language="C++" returnType="void">setPath( const QString &amp;p )</slot>
    <slot access="protected" language="C++" returnType="void">sizeChanged( int s )</slot>
    <slot access="protected" language="C++" returnType="void">underlineChanged( bool b )</slot>
</connections>
<functions>
    <function name="init()" >{
    QFontDatabase fdb;
    comboFamily-&gt;insertStringList( fdb.families() );
    listElements-&gt;setCurrentItem( listElements-&gt;firstItem() );
    currentElement = "";
}</function>
    <function name="destroy()" >{
    
}</function>
    <function name="colorClicked()" >{
    QColor c = QColorDialog::getColor( currentStyle.color, this, "editor_getcolor_dlg" );
    if ( c.isValid() ) {
	currentStyle.color = c;
	setColorPixmap( c );
    }
}</function>
    <function name="reInit()" >{
    styles = Config::readStyles( path );
    currentElement = "";
    elementChanged( "Comment" );
    for ( int i = 0; i &lt; comboFamily-&gt;count(); ++i ) {
	if ( listElements-&gt;text( i ) == "Comment" ) {
	    listElements-&gt;setCurrentItem( i );
	    break;
	}
    }
    checkWordWrap-&gt;setChecked( Config::wordWrap( path ) );
    checkCompletion-&gt;setChecked( Config::completion( path ) ); 
    checkParenMatching-&gt;setChecked( Config::parenMatching( path ) ); 
}</function>
    <function name="save()" >{
    if ( !currentElement.isEmpty() ) {
	styles.remove( currentElement );
	styles.insert( currentElement, currentStyle );
	currentElement = "";
    }

    QSettings settings;
    Config::saveStyles( styles, path );
    Config::setWordWrap( checkWordWrap-&gt;isChecked(), path );
    Config::setCompletion( checkCompletion-&gt;isChecked(), path ); 
    Config::setParenMatching( checkParenMatching-&gt;isChecked(), path ); 
}</function>
    <function name="updatePreview()" >{
    editPreview-&gt;setFont( currentStyle.font );
    QPalette pal = editPreview-&gt;palette();
    pal.setColor( QPalette::Active, QColorGroup::Text, currentStyle.color );
    pal.setColor( QPalette::Active, QColorGroup::Foreground, currentStyle.color ); 
    editPreview-&gt;setPalette( pal );
}</function>
    <function name="boldChanged(bool)" >{
    currentStyle.font.setBold( b );
    updatePreview();
}</function>
    <function name="elementChanged(const QString&amp;)" >{
    if ( !currentElement.isEmpty() ) {
	styles.remove( currentElement );
	styles.insert( currentElement, currentStyle );
	currentElement = "";
    }
    QMap&lt;QString, ConfigStyle&gt;::Iterator it = styles.find( element );
    if ( it == styles.end() )
	return;
    ConfigStyle s = *it;
    currentStyle = s;
    comboFamily-&gt;lineEdit()-&gt;setText( s.font.family() );
    spinSize-&gt;setValue( s.font.pointSize() );
    checkBold-&gt;setChecked( s.font.bold() );
    checkItalic-&gt;setChecked( s.font.italic() );
    checkUnderline-&gt;setChecked( s.font.underline() );
    setColorPixmap( s.color );
    currentElement = element;
    updatePreview();
}</function>
    <function name="familyChanged(const QString&amp;)" >{
    QString oldFamily = currentStyle.font.family();
    currentStyle.font.setFamily( f );
    if ( currentElement == "Standard" ) {
	for ( QMap&lt;QString, ConfigStyle&gt;::Iterator it = styles.begin(); it != styles.end(); ++it ) {
	    if ( (*it).font.family() == oldFamily )
		(*it).font.setFamily( f );
	}
    }
    updatePreview();
}</function>
    <function name="italicChanged(bool)" >{
    currentStyle.font.setItalic( b );
    updatePreview();
}</function>
    <function name="setColorPixmap(const QColor&amp;)" >{
    QPixmap pm( 20, 20 );
    pm.fill( c );
    buttonColor-&gt;setPixmap( pm );
    updatePreview();
}</function>
    <function name="setPath(const QString&amp;)" >{
    path = p;
}</function>
    <function name="sizeChanged(int)" >{
    int oldSize = currentStyle.font.pointSize();
    currentStyle.font.setPointSize( s );
    if ( currentElement == "Standard" ) {
	for ( QMap&lt;QString, ConfigStyle&gt;::Iterator it = styles.begin(); it != styles.end(); ++it ) {
	    if ( (*it).font.pointSize() == oldSize )
		(*it).font.setPointSize( s );
	}
    }
    updatePreview();
}</function>
    <function name="underlineChanged(bool)" >{
    currentStyle.font.setUnderline( b );
    updatePreview();
}</function>
</functions>
<tabstops>
    <tabstop>listElements</tabstop>
    <tabstop>editPreview</tabstop>
    <tabstop>comboFamily</tabstop>
    <tabstop>spinSize</tabstop>
    <tabstop>checkBold</tabstop>
    <tabstop>checkItalic</tabstop>
    <tabstop>checkUnderline</tabstop>
    <tabstop>checkWordWrap</tabstop>
    <tabstop>checkCompletion</tabstop>
    <tabstop>checkParenMatching</tabstop>
</tabstops>
</UI>
