~ubuntu-branches/ubuntu/karmic/qtcreator/karmic-security

« back to all changes in this revision

Viewing changes to src/plugins/debugger/gdb/gdboptionspage.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Andres Rodriguez
  • Date: 2009-07-19 16:23:52 UTC
  • mfrom: (3.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090719162352-oni0h8hrrkdd3sil
Tags: 1.2.1-1ubuntu1
* Merge from debian unstable (LP: #399414), remaining changes:
  - Add qt-creator transitional package.
* debian/control: Conflicts on qt-creator (<< 1.2.1-1ubuntu1).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "gdboptionspage.h"
 
2
#include "debuggeractions.h"
 
3
#include "debuggerconstants.h"
 
4
 
 
5
#include <coreplugin/icore.h>
 
6
#include <QtCore/QCoreApplication>
 
7
 
 
8
const char * const GDB_SETTINGS_ID = QT_TRANSLATE_NOOP("Debugger::Internal::GdbOptionsPage", "Gdb");
 
9
 
 
10
namespace Debugger {
 
11
namespace Internal {
 
12
 
 
13
GdbOptionsPage::GdbOptionsPage()
 
14
{
 
15
}
 
16
 
 
17
QString GdbOptionsPage::settingsId()
 
18
{
 
19
    return QLatin1String(GDB_SETTINGS_ID);
 
20
}
 
21
 
 
22
QString GdbOptionsPage::trName() const
 
23
{
 
24
    return tr(GDB_SETTINGS_ID);
 
25
}
 
26
 
 
27
QString GdbOptionsPage::category() const
 
28
{
 
29
    return QLatin1String(Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY);
 
30
}
 
31
 
 
32
QString GdbOptionsPage::trCategory() const
 
33
{
 
34
    return QCoreApplication::translate("Debugger", Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY);
 
35
}
 
36
 
 
37
QWidget *GdbOptionsPage::createPage(QWidget *parent)
 
38
{
 
39
    QWidget *w = new QWidget(parent);
 
40
    m_ui.setupUi(w);
 
41
    m_ui.gdbLocationChooser->setExpectedKind(Core::Utils::PathChooser::Command);
 
42
    m_ui.gdbLocationChooser->setPromptDialogTitle(tr("Choose Gdb Location"));
 
43
    m_ui.scriptFileChooser->setExpectedKind(Core::Utils::PathChooser::File);
 
44
    m_ui.scriptFileChooser->setPromptDialogTitle(tr("Choose Location of Startup Script File"));
 
45
 
 
46
    m_group.clear();
 
47
    m_group.insert(theDebuggerAction(GdbLocation),
 
48
        m_ui.gdbLocationChooser);
 
49
    m_group.insert(theDebuggerAction(GdbScriptFile),
 
50
        m_ui.scriptFileChooser);
 
51
    m_group.insert(theDebuggerAction(GdbEnvironment),
 
52
        m_ui.environmentEdit);
 
53
 
 
54
    m_group.insert(theDebuggerAction(AllPluginBreakpoints),
 
55
        m_ui.radioButtonAllPluginBreakpoints);
 
56
    m_group.insert(theDebuggerAction(SelectedPluginBreakpoints),
 
57
        m_ui.radioButtonSelectedPluginBreakpoints);
 
58
    m_group.insert(theDebuggerAction(NoPluginBreakpoints),
 
59
        m_ui.radioButtonNoPluginBreakpoints);
 
60
    m_group.insert(theDebuggerAction(SelectedPluginBreakpointsPattern),
 
61
        m_ui.lineEditSelectedPluginBreakpointsPattern);
 
62
 
 
63
    m_ui.lineEditSelectedPluginBreakpointsPattern->
 
64
        setEnabled(theDebuggerAction(SelectedPluginBreakpoints)->value().toBool());
 
65
    connect(m_ui.radioButtonSelectedPluginBreakpoints, SIGNAL(toggled(bool)),
 
66
        m_ui.lineEditSelectedPluginBreakpointsPattern, SLOT(setEnabled(bool)));
 
67
 
 
68
    // FIXME
 
69
    m_ui.environmentEdit->hide();
 
70
    m_ui.labelEnvironment->hide();
 
71
 
 
72
    return w;
 
73
}
 
74
void GdbOptionsPage::apply()
 
75
{
 
76
    m_group.apply(Core::ICore::instance()->settings());
 
77
}
 
78
 
 
79
void GdbOptionsPage::finish()
 
80
{
 
81
    m_group.finish();
 
82
}
 
83
 
 
84
} // namespace Internal
 
85
} // namespace Debugger