forked from qt-creator/qt-creator
Merge branch '2.6'
Conflicts: src/libs/utils/consoleprocess_unix.cpp Change-Id: I196f61e882bfce94e165d9c724bffee9df1011b7
This commit is contained in:
@@ -113,10 +113,13 @@ QWidget *GeneralSettings::createPage(QWidget *parent)
|
||||
m_page->colorButton->setColor(StyleHelper::requestedBaseColor());
|
||||
m_page->reloadBehavior->setCurrentIndex(EditorManager::instance()->reloadSetting());
|
||||
#ifdef Q_OS_UNIX
|
||||
m_page->terminalEdit->setText(ConsoleProcess::terminalEmulator(settings));
|
||||
const QStringList availableTerminals = ConsoleProcess::availableTerminalEmulators();
|
||||
const QString currentTerminal = ConsoleProcess::terminalEmulator(settings);
|
||||
m_page->terminalComboBox->addItems(availableTerminals);
|
||||
m_page->terminalComboBox->lineEdit()->setText(currentTerminal);
|
||||
#else
|
||||
m_page->terminalLabel->hide();
|
||||
m_page->terminalEdit->hide();
|
||||
m_page->terminalComboBox->hide();
|
||||
m_page->resetTerminalButton->hide();
|
||||
#endif
|
||||
|
||||
@@ -175,7 +178,7 @@ void GeneralSettings::apply()
|
||||
EditorManager::instance()->setReloadSetting(IDocument::ReloadSetting(m_page->reloadBehavior->currentIndex()));
|
||||
#ifdef Q_OS_UNIX
|
||||
ConsoleProcess::setTerminalEmulator(Core::ICore::settings(),
|
||||
m_page->terminalEdit->text());
|
||||
m_page->terminalComboBox->lineEdit()->text());
|
||||
#ifndef Q_OS_MAC
|
||||
Utils::UnixUtils::setFileBrowser(Core::ICore::settings(), m_page->externalFileBrowserEdit->text());
|
||||
#endif
|
||||
@@ -200,7 +203,7 @@ void GeneralSettings::resetInterfaceColor()
|
||||
void GeneralSettings::resetTerminal()
|
||||
{
|
||||
#if defined(Q_OS_UNIX)
|
||||
m_page->terminalEdit->setText(ConsoleProcess::defaultTerminalEmulator() + QLatin1String(" -e"));
|
||||
m_page->terminalComboBox->lineEdit()->setText(ConsoleProcess::defaultTerminalEmulator());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,11 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="terminalEdit"/>
|
||||
<widget class="QComboBox" name="terminalComboBox">
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="externalFileBrowserLabel">
|
||||
@@ -305,7 +309,7 @@
|
||||
<tabstop>colorButton</tabstop>
|
||||
<tabstop>resetButton</tabstop>
|
||||
<tabstop>languageBox</tabstop>
|
||||
<tabstop>terminalEdit</tabstop>
|
||||
<tabstop>terminalComboBox</tabstop>
|
||||
<tabstop>resetTerminalButton</tabstop>
|
||||
<tabstop>externalFileBrowserEdit</tabstop>
|
||||
<tabstop>resetFileBrowserButton</tabstop>
|
||||
|
||||
@@ -78,6 +78,7 @@ struct ModeManagerPrivate
|
||||
QSignalMapper *m_signalMapper;
|
||||
Context m_addedContexts;
|
||||
int m_oldCurrent;
|
||||
bool m_saveSettingsOnModeChange;
|
||||
};
|
||||
|
||||
static ModeManagerPrivate *d;
|
||||
@@ -104,10 +105,13 @@ ModeManager::ModeManager(Internal::MainWindow *mainWindow,
|
||||
d->m_oldCurrent = -1;
|
||||
d->m_actionBar = new Internal::FancyActionBar(modeStack);
|
||||
d->m_modeStack->addCornerWidget(d->m_actionBar);
|
||||
d->m_saveSettingsOnModeChange = false;
|
||||
|
||||
connect(d->m_modeStack, SIGNAL(currentAboutToShow(int)), SLOT(currentTabAboutToChange(int)));
|
||||
connect(d->m_modeStack, SIGNAL(currentChanged(int)), SLOT(currentTabChanged(int)));
|
||||
connect(d->m_signalMapper, SIGNAL(mapped(int)), this, SLOT(slotActivateMode(int)));
|
||||
connect(ExtensionSystem::PluginManager::instance(), SIGNAL(initializationDone()), this, SLOT(handleStartup()));
|
||||
connect(ICore::instance(), SIGNAL(coreAboutToClose()), this, SLOT(handleShutdown()));
|
||||
}
|
||||
|
||||
void ModeManager::init()
|
||||
@@ -252,6 +256,12 @@ void ModeManager::enabledStateChanged()
|
||||
}
|
||||
}
|
||||
|
||||
void ModeManager::handleStartup()
|
||||
{ d->m_saveSettingsOnModeChange = true; }
|
||||
|
||||
void ModeManager::handleShutdown()
|
||||
{ d->m_saveSettingsOnModeChange = false; }
|
||||
|
||||
void ModeManager::aboutToRemoveObject(QObject *obj)
|
||||
{
|
||||
IMode *mode = Aggregation::query<IMode>(obj);
|
||||
@@ -290,8 +300,11 @@ void ModeManager::currentTabAboutToChange(int index)
|
||||
{
|
||||
if (index >= 0) {
|
||||
IMode *mode = d->m_modes.at(index);
|
||||
if (mode)
|
||||
if (mode) {
|
||||
if (d->m_saveSettingsOnModeChange)
|
||||
ICore::saveSettings();
|
||||
emit currentModeAboutToChange(mode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -85,6 +85,8 @@ private slots:
|
||||
void currentTabChanged(int index);
|
||||
void updateModeToolTip();
|
||||
void enabledStateChanged();
|
||||
void handleStartup();
|
||||
void handleShutdown();
|
||||
};
|
||||
|
||||
} // namespace Core
|
||||
|
||||
Reference in New Issue
Block a user