forked from qt-creator/qt-creator
Merge branch '0.9.1-beta' of git@scm.dev.nokia.troll.no:creator/mainline into 0.9.1-beta
This commit is contained in:
@@ -334,6 +334,10 @@ NavigationSubWidget::NavigationSubWidget(NavigationWidget *parentWidget)
|
||||
|
||||
m_navigationComboBox = new NavComboBox(this);
|
||||
m_navigationWidget = 0;
|
||||
#ifdef Q_OS_MAC
|
||||
// this is to avoid ugly tool bar behavior
|
||||
m_navigationComboBox->setMaximumWidth(130);
|
||||
#endif
|
||||
|
||||
m_toolbar = new QToolBar(this);
|
||||
m_toolbar->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
@@ -88,11 +88,15 @@ QWidget *GdbOptionPage::createPage(QWidget *parent)
|
||||
{
|
||||
QWidget *w = new QWidget(parent);
|
||||
m_ui.setupUi(w);
|
||||
m_ui.gdbLocationEdit->setText(m_settings->m_gdbCmd);
|
||||
m_ui.gdbLocationChooser->setExpectedKind(Core::Utils::PathChooser::Command);
|
||||
m_ui.gdbLocationChooser->setPromptDialogTitle(tr("Choose Gdb Location"));
|
||||
m_ui.gdbLocationChooser->setPath(m_settings->m_gdbCmd);
|
||||
m_ui.scriptFileChooser->setExpectedKind(Core::Utils::PathChooser::File);
|
||||
m_ui.scriptFileChooser->setPromptDialogTitle(tr("Choose Location of Startup Script File"));
|
||||
m_ui.scriptFileChooser->setPath(m_settings->m_scriptFile);
|
||||
m_ui.environmentEdit->setText(m_settings->m_gdbEnv);
|
||||
m_ui.autoStartBox->setChecked(m_settings->m_autoRun);
|
||||
m_ui.autoQuitBox->setChecked(m_settings->m_autoQuit);
|
||||
m_ui.gdbStartupScriptEdit->setText(m_settings->m_scriptFile);
|
||||
|
||||
// FIXME
|
||||
m_ui.autoStartBox->hide();
|
||||
@@ -100,32 +104,22 @@ QWidget *GdbOptionPage::createPage(QWidget *parent)
|
||||
m_ui.environmentEdit->hide();
|
||||
m_ui.labelEnvironment->hide();
|
||||
|
||||
connect(m_ui.browseForGdbButton, SIGNAL(clicked()),
|
||||
this, SLOT(browseForGdb()));
|
||||
connect(m_ui.browseForScriptButton, SIGNAL(clicked()),
|
||||
this, SLOT(browseForScript()));
|
||||
connect(m_ui.gdbLocationChooser, SIGNAL(changed()),
|
||||
this, SLOT(onGdbLocationChanged()));
|
||||
connect(m_ui.scriptFileChooser, SIGNAL(changed()),
|
||||
this, SLOT(onScriptFileChanged()));
|
||||
|
||||
return w;
|
||||
}
|
||||
|
||||
void GdbOptionPage::browseForGdb()
|
||||
void GdbOptionPage::onGdbLocationChanged()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(m_ui.browseForGdbButton,
|
||||
"Browse for gdb executable");
|
||||
if (fileName.isEmpty())
|
||||
return;
|
||||
m_settings->m_gdbCmd = fileName;
|
||||
m_ui.gdbLocationEdit->setText(fileName);
|
||||
m_settings->m_gdbCmd = m_ui.gdbLocationChooser->path();
|
||||
}
|
||||
|
||||
void GdbOptionPage::browseForScript()
|
||||
void GdbOptionPage::onScriptFileChanged()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(m_ui.browseForGdbButton,
|
||||
"Browse for gdb startup script");
|
||||
if (fileName.isEmpty())
|
||||
return;
|
||||
m_settings->m_scriptFile = fileName;
|
||||
m_ui.gdbStartupScriptEdit->setText(fileName);
|
||||
m_settings->m_scriptFile = m_ui.scriptFileChooser->path();
|
||||
}
|
||||
|
||||
void GdbOptionPage::finished(bool accepted)
|
||||
@@ -133,11 +127,11 @@ void GdbOptionPage::finished(bool accepted)
|
||||
if (!accepted)
|
||||
return;
|
||||
|
||||
m_settings->m_gdbCmd = m_ui.gdbLocationEdit->text();
|
||||
m_settings->m_gdbCmd = m_ui.gdbLocationChooser->path();
|
||||
m_settings->m_gdbEnv = m_ui.environmentEdit->text();
|
||||
m_settings->m_autoRun = m_ui.autoStartBox->isChecked();
|
||||
m_settings->m_autoQuit = m_ui.autoQuitBox->isChecked();
|
||||
m_settings->m_scriptFile = m_ui.gdbStartupScriptEdit->text();
|
||||
m_settings->m_scriptFile = m_ui.scriptFileChooser->path();
|
||||
|
||||
Core::ICore *coreIFace = m_pm->getObject<Core::ICore>();
|
||||
if (!coreIFace || !coreIFace->settings())
|
||||
|
||||
@@ -62,8 +62,8 @@ public:
|
||||
void finished(bool accepted);
|
||||
|
||||
public slots:
|
||||
void browseForGdb();
|
||||
void browseForScript();
|
||||
void onGdbLocationChanged();
|
||||
void onScriptFileChanged();
|
||||
|
||||
private:
|
||||
ExtensionSystem::PluginManager *m_pm;
|
||||
|
||||
@@ -32,10 +32,7 @@
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="gdbLocationEdit"/>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="environmentEdit"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
@@ -46,9 +43,6 @@
|
||||
<property name="text">
|
||||
<string>Gdb Location:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>gdbLocationEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
@@ -61,40 +55,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="browseForGdbButton">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../coreplugin/core.qrc">
|
||||
<normaloff>:/qworkbench/images/fileopen.png</normaloff>:/qworkbench/images/fileopen.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="gdbStartupScriptEdit"/>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QToolButton" name="browseForScriptButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>21</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../coreplugin/core.qrc">
|
||||
<normaloff>:/qworkbench/images/fileopen.png</normaloff>:/qworkbench/images/fileopen.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="labelGdbStartupScript">
|
||||
<property name="toolTip">
|
||||
@@ -105,6 +65,12 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="Core::Utils::PathChooser" name="scriptFileChooser" native="true"/>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="Core::Utils::PathChooser" name="gdbLocationChooser" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -137,6 +103,14 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Core::Utils::PathChooser</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">utils/pathchooser.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../coreplugin/core.qrc"/>
|
||||
</resources>
|
||||
|
||||
@@ -411,7 +411,7 @@ static QString niceType(QString type)
|
||||
"std::allocator<wchar_t> >", "std::wstring");
|
||||
|
||||
// std::vector
|
||||
static QRegExp re1("std::vector<(.*)\\s*,std::allocator<(.*)>\\s*>");
|
||||
static QRegExp re1("std::vector<(.*), std::allocator<(.*)>\\s*>");
|
||||
re1.setMinimal(true);
|
||||
for (int i = 0; i != 10; ++i) {
|
||||
if (re1.indexIn(type) == -1 || re1.cap(1) != re1.cap(2))
|
||||
@@ -420,7 +420,7 @@ static QString niceType(QString type)
|
||||
}
|
||||
|
||||
// std::list
|
||||
static QRegExp re2("std::list<(.*)\\s*,std::allocator<(.*)>\\s*>");
|
||||
static QRegExp re2("std::list<(.*), std::allocator<(.*)>\\s*>");
|
||||
re2.setMinimal(true);
|
||||
for (int i = 0; i != 10; ++i) {
|
||||
if (re2.indexIn(type) == -1 || re2.cap(1) != re2.cap(2))
|
||||
@@ -428,6 +428,17 @@ static QString niceType(QString type)
|
||||
type.replace(re2.cap(0), "std::list<" + re2.cap(1) + ">");
|
||||
}
|
||||
|
||||
// std::map
|
||||
static QRegExp re3("std::map<(.*), (.*), std::less<(.*)\\s*>, "
|
||||
"std::allocator<std::pair<const (.*), (.*)\\s*> > >");
|
||||
re3.setMinimal(true);
|
||||
for (int i = 0; i != 10; ++i) {
|
||||
if (re3.indexIn(type) == -1 || re3.cap(1) != re3.cap(3)
|
||||
|| re3.cap(1) != re3.cap(4) || re3.cap(2) != re3.cap(5))
|
||||
break;
|
||||
type.replace(re3.cap(0), "std::map<" + re3.cap(1) + ", " + re3.cap(2) + ">");
|
||||
}
|
||||
|
||||
type.replace(" >", ">");
|
||||
}
|
||||
return type;
|
||||
|
||||
Reference in New Issue
Block a user