forked from qt-creator/qt-creator
		
	Add restore fallback functionality, make better tr()
Task-number: QTCREATORBUG-5025 Change-Id: Ia3f6fa2380dd1a93f120873f584662a267ca4d50 Reviewed-on: http://codereview.qt.nokia.com/360 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
This commit is contained in:
		@@ -234,6 +234,7 @@ CppCodeStylePreferencesWidget::CppCodeStylePreferencesWidget(QWidget *parent)
 | 
			
		||||
    m_ui->categoryTab->setCurrentIndex(0);
 | 
			
		||||
 | 
			
		||||
    m_ui->tabPreferencesWidget->setFlat(true);
 | 
			
		||||
    m_ui->fallbackWidget->setLabelText(tr("Code style settings:"));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
CppCodeStylePreferencesWidget::~CppCodeStylePreferencesWidget()
 | 
			
		||||
@@ -321,15 +322,11 @@ void CppCodeStylePreferencesWidget::setCppCodeStyleSettings(const CppCodeStyleSe
 | 
			
		||||
 | 
			
		||||
void CppCodeStylePreferencesWidget::slotCurrentFallbackChanged(TextEditor::IFallbackPreferences *fallback)
 | 
			
		||||
{
 | 
			
		||||
    m_ui->tabPreferencesWidget->setEnabled(!fallback);
 | 
			
		||||
    m_ui->contentGroupBox->setEnabled(!fallback);
 | 
			
		||||
    m_ui->bracesGroupBox->setEnabled(!fallback);
 | 
			
		||||
    m_ui->switchGroupBox->setEnabled(!fallback);
 | 
			
		||||
    m_ui->alignmentGroupBox->setEnabled(!fallback);
 | 
			
		||||
 | 
			
		||||
    // if C++ global is used for style, use it for tab settings as well
 | 
			
		||||
    if (fallback && m_tabPreferences && m_cppCodeStylePreferences->currentFallback())
 | 
			
		||||
        m_tabPreferences->setCurrentFallback(m_cppCodeStylePreferences->currentFallback()->id());
 | 
			
		||||
    updatePreview();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,7 @@
 | 
			
		||||
   <item>
 | 
			
		||||
    <widget class="QWidget" name="fallbackContainer" native="true">
 | 
			
		||||
     <layout class="QHBoxLayout" name="fallbackLayout">
 | 
			
		||||
      <property name="leftMargin">
 | 
			
		||||
      <property name="margin">
 | 
			
		||||
       <number>0</number>
 | 
			
		||||
      </property>
 | 
			
		||||
      <item>
 | 
			
		||||
 
 | 
			
		||||
@@ -42,14 +42,14 @@ CppToolsSettings::CppToolsSettings(QObject *parent)
 | 
			
		||||
                                                 << textEditorSettings->tabPreferences(), this);
 | 
			
		||||
        m_d->m_tabPreferences->setCurrentFallback(textEditorSettings->tabPreferences());
 | 
			
		||||
        m_d->m_tabPreferences->fromSettings(CppTools::Constants::CPP_SETTINGS_ID, s);
 | 
			
		||||
        m_d->m_tabPreferences->setDisplayName(tr("global C++"));
 | 
			
		||||
        m_d->m_tabPreferences->setDisplayName(tr("Global C++", "Settings"));
 | 
			
		||||
        m_d->m_tabPreferences->setId(idKey);
 | 
			
		||||
        textEditorSettings->registerLanguageTabPreferences(CppTools::Constants::CPP_SETTINGS_ID, m_d->m_tabPreferences);
 | 
			
		||||
 | 
			
		||||
        m_d->m_cppCodeStylePreferences
 | 
			
		||||
                = new CppCodeStylePreferences(QList<TextEditor::IFallbackPreferences *>(), this);
 | 
			
		||||
        m_d->m_cppCodeStylePreferences->fromSettings(CppTools::Constants::CPP_SETTINGS_ID, s);
 | 
			
		||||
        m_d->m_cppCodeStylePreferences->setDisplayName(tr("global C++"));
 | 
			
		||||
        m_d->m_cppCodeStylePreferences->setDisplayName(tr("Global C++", "Settings"));
 | 
			
		||||
        m_d->m_cppCodeStylePreferences->setId(idKey);
 | 
			
		||||
        textEditorSettings->registerLanguageCodeStylePreferences(CppTools::Constants::CPP_SETTINGS_ID, m_d->m_cppCodeStylePreferences);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user