2 * Copyright Johannes Sixt
3 * This file is licensed under the GNU General Public License Version 2.
4 * See the file COPYING in the toplevel directory of the source directory.
7 #include "pgmsettings.h"
8 #include <klocalizedstring.h> /* i18n */
12 #include <QRadioButton>
13 #include <QButtonGroup>
14 #include <QVBoxLayout>
18 ChooseDriver::ChooseDriver(QWidget
* parent
) :
21 QVBoxLayout
* layout
= new QVBoxLayout(this);
23 QLabel
* label
= new QLabel(this);
24 label
->setText(i18n("How to invoke &GDB - leave empty to use\n"
25 "the default from the global options:"));
26 label
->setMinimumSize(label
->sizeHint());
27 layout
->addWidget(label
);
29 m_debuggerCmd
= new QLineEdit(this);
30 m_debuggerCmd
->setMinimumSize(m_debuggerCmd
->sizeHint());
31 layout
->addWidget(m_debuggerCmd
);
32 label
->setBuddy(m_debuggerCmd
);
35 this->setLayout(layout
);
38 void ChooseDriver::setDebuggerCmd(const QString
& cmd
)
40 m_debuggerCmd
->setText(cmd
);
43 QString
ChooseDriver::debuggerCmd() const
45 return m_debuggerCmd
->text();
49 OutputSettings::OutputSettings(QWidget
* parent
) :
52 m_group
= new QButtonGroup(this);
54 QVBoxLayout
* layout
= new QVBoxLayout(this);
58 btn
= new QRadioButton(i18n("&No input and output"), this);
59 m_group
->addButton(btn
, 0);
60 layout
->addWidget(btn
);
62 btn
= new QRadioButton(i18n("&Only output, simple terminal emulation"), this);
63 m_group
->addButton(btn
, 1);
64 layout
->addWidget(btn
);
66 btn
= new QRadioButton(i18n("&Full terminal emulation"), this);
67 m_group
->addButton(btn
, 7);
68 layout
->addWidget(btn
);
72 this->setLayout(layout
);
74 // there is no simpler way to get to the active button than
75 // to connect to a signal
76 connect(m_group
, SIGNAL(buttonClicked(int)), SLOT(slotLevelChanged(int)));
79 void OutputSettings::setTTYLevel(int l
)
81 QAbstractButton
* button
= m_group
->button(l
);
83 button
->setChecked(true);
87 void OutputSettings::slotLevelChanged(int id
)
90 TRACE("new ttyLevel: " + QString().setNum(id
));
95 ProgramSettings::ProgramSettings(QWidget
* parent
, QString exeName
) :
101 QFileInfo
fi(exeName
);
102 QString title
= i18n("Settings for %1");
103 setWindowTitle(title
.arg(fi
.fileName()));
105 addPage(&m_chooseDriver
, i18n("Debugger"));
106 addPage(&m_output
, i18n("Output"));
109 #include "pgmsettings.moc"