1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
10 ** GNU Lesser General Public License Usage
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
15 ** Please review the following information to ensure the GNU Lesser General
16 ** Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
25 ** Alternatively, this file may be used in accordance with the terms and
26 ** conditions contained in a signed written agreement between you and Nokia.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
31 **************************************************************************/
33 #include "gdboptionspage.h"
34 #include "debuggeractions.h"
35 #include "debuggercore.h"
37 #include <coreplugin/icore.h>
38 #include <projectexplorer/projectexplorer.h>
40 #include <QtCore/QCoreApplication>
41 #include <QtCore/QDebug>
42 #include <QtCore/QTextStream>
48 GdbOptionsPage::GdbOptionsPage()
52 QString GdbOptionsPage::settingsId()
54 return QLatin1String("M.Gdb");
57 QString GdbOptionsPage::displayName() const
62 QString GdbOptionsPage::category() const
64 return QLatin1String(Constants::DEBUGGER_SETTINGS_CATEGORY);
67 QString GdbOptionsPage::displayCategory() const
69 return QCoreApplication::translate("Debugger", Constants::DEBUGGER_SETTINGS_TR_CATEGORY);
72 QIcon GdbOptionsPage::categoryIcon() const
74 return QIcon(QLatin1String(Constants::DEBUGGER_COMMON_SETTINGS_CATEGORY_ICON));
77 QWidget *GdbOptionsPage::createPage(QWidget *parent)
79 QWidget *w = new QWidget(parent);
80 m_ui = new Ui::GdbOptionsPage;
83 m_ui->scriptFileChooser->setExpectedKind(Utils::PathChooser::File);
84 m_ui->scriptFileChooser->setPromptDialogTitle(
85 tr("Choose Location of Startup Script File"));
88 m_group.insert(debuggerCore()->action(GdbScriptFile),
89 m_ui->scriptFileChooser);
90 m_group.insert(debuggerCore()->action(LoadGdbInit),
91 m_ui->checkBoxLoadGdbInit);
92 m_group.insert(debuggerCore()->action(TargetAsync),
93 m_ui->checkBoxTargetAsync);
94 m_group.insert(debuggerCore()->action(AdjustBreakpointLocations),
95 m_ui->checkBoxAdjustBreakpointLocations);
96 m_group.insert(debuggerCore()->action(GdbWatchdogTimeout),
97 m_ui->spinBoxGdbWatchdogTimeout);
99 m_group.insert(debuggerCore()->action(UseMessageBoxForSignals),
100 m_ui->checkBoxUseMessageBoxForSignals);
101 m_group.insert(debuggerCore()->action(SkipKnownFrames),
102 m_ui->checkBoxSkipKnownFrames);
103 m_group.insert(debuggerCore()->action(EnableReverseDebugging),
104 m_ui->checkBoxEnableReverseDebugging);
105 m_group.insert(debuggerCore()->action(GdbWatchdogTimeout), 0);
107 m_ui->groupBoxPluginDebugging->hide();
109 m_ui->lineEditSelectedPluginBreakpointsPattern->
110 setEnabled(debuggerCore()->action(SelectedPluginBreakpoints)->value().toBool());
111 connect(m_ui->radioButtonSelectedPluginBreakpoints, SIGNAL(toggled(bool)),
112 m_ui->lineEditSelectedPluginBreakpointsPattern, SLOT(setEnabled(bool)));
114 if (m_searchKeywords.isEmpty()) {
115 QLatin1Char sep(' ');
116 QTextStream(&m_searchKeywords)
117 << sep << m_ui->groupBoxLocations->title()
118 << sep << m_ui->checkBoxLoadGdbInit->text()
119 << sep << m_ui->checkBoxTargetAsync->text()
120 << sep << m_ui->labelGdbStartupScript->text()
121 << sep << m_ui->labelGdbWatchdogTimeout->text()
122 << sep << m_ui->checkBoxEnableReverseDebugging->text()
123 << sep << m_ui->checkBoxSkipKnownFrames->text()
124 << sep << m_ui->checkBoxUseMessageBoxForSignals->text()
125 << sep << m_ui->checkBoxAdjustBreakpointLocations->text()
126 << sep << m_ui->groupBoxPluginDebugging->title()
127 << sep << m_ui->radioButtonAllPluginBreakpoints->text()
128 << sep << m_ui->radioButtonSelectedPluginBreakpoints->text()
129 << sep << m_ui->labelSelectedPluginBreakpoints->text()
130 << sep << m_ui->radioButtonNoPluginBreakpoints->text()
132 m_searchKeywords.remove(QLatin1Char('&'));
137 void GdbOptionsPage::apply()
139 m_group.apply(Core::ICore::instance()->settings());
142 void GdbOptionsPage::finish()
147 bool GdbOptionsPage::matches(const QString &s) const
149 return m_searchKeywords.contains(s, Qt::CaseInsensitive);
152 } // namespace Internal
153 } // namespace Debugger