Chris@67: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@67: Chris@67: /* Chris@67: EasyMercurial Chris@67: Chris@67: Based on HgExplorer by Jari Korhonen Chris@67: Copyright (c) 2010 Jari Korhonen Chris@67: Copyright (c) 2010 Chris Cannam Chris@67: Copyright (c) 2010 Queen Mary, University of London Chris@67: Chris@67: This program is free software; you can redistribute it and/or Chris@67: modify it under the terms of the GNU General Public License as Chris@67: published by the Free Software Foundation; either version 2 of the Chris@67: License, or (at your option) any later version. See the file Chris@67: COPYING included with this distribution for more information. Chris@67: */ Chris@67: Chris@67: #include "multichoicedialog.h" Chris@67: Chris@68: #include Chris@68: Chris@68: MultiChoiceDialog::MultiChoiceDialog(QString title, QString heading, QWidget *parent) : Chris@67: QDialog(parent) Chris@67: { Chris@68: setModal(true); Chris@68: setWindowTitle(title); Chris@68: Chris@68: QGridLayout *outer = new QGridLayout; Chris@68: setLayout(outer); Chris@68: Chris@68: outer->addWidget(new QLabel(heading), 0, 0, 1, 3); Chris@68: Chris@68: QWidget *innerWidget = new QWidget; Chris@68: outer->addWidget(innerWidget, 1, 0, 1, 2); Chris@68: m_choiceLayout = new QGridLayout; Chris@68: innerWidget->setLayout(m_choiceLayout); Chris@68: Chris@68: m_descriptionLabel = new QLabel; Chris@68: outer->addWidget(m_descriptionLabel, 2, 0, 1, 3); Chris@68: Chris@68: m_argLabel = new QLabel(); Chris@68: outer->addWidget(m_argLabel, 3, 0); Chris@68: Chris@68: m_argEdit = new QLineEdit(); Chris@68: outer->addWidget(m_argEdit, 3, 1); Chris@68: Chris@68: m_browseButton = new QPushButton(tr("Browse...")); Chris@68: outer->addWidget(m_browseButton, 3, 2); Chris@68: Chris@68: QDialogButtonBox *bbox = new QDialogButtonBox(QDialogButtonBox::Ok | Chris@68: QDialogButtonBox::Cancel); Chris@68: connect(bbox, SIGNAL(accepted()), this, SLOT(accept())); Chris@68: connect(bbox, SIGNAL(rejected()), this, SLOT(reject())); Chris@68: outer->addWidget(bbox, 4, 0, 1, 3); Chris@67: } Chris@68: