Пример #1
0
ReferenceDialog::ReferenceDialog(BrowserNode * bn)
    : QDialog(0/*, "Referenced By dialog", Qt::WA_DeleteOnClose*/)
{
    the = this;
    target = bn;

    setWindowTitle(tr("Referenced By dialog"));

    QVBoxLayout * vbox = new QVBoxLayout(this);

    vbox->setMargin(5);

    QString s = target->get_name();

    s += QObject::tr(" is referenced by :");

    vbox->addWidget(new QLabel(s, this));

    results = new QComboBox(this);
    vbox->addWidget(results);

    QHBoxLayout * hbox = new QHBoxLayout();
    vbox->addLayout(hbox);
    QPushButton * search_b = new QPushButton(tr("Recompute"), this);
    QPushButton * close_b = new QPushButton(tr("Close"), this);

    hbox->setMargin(5);
    hbox->addWidget(search_b);
    hbox->addWidget(select_b = new QPushButton(tr("Select"), this));
    hbox->addWidget(mark_unmark_b = new QPushButton(tr("Unmark"), this));
    hbox->addWidget(mark_them_b = new QPushButton(tr("Mark them"), this));
    hbox->addWidget(unmark_all_b = new QPushButton(tr("Unmark all"), this));
    hbox->addWidget(close_b);

    search_b->setDefault(TRUE);

    connect(search_b, SIGNAL(clicked()), this, SLOT(compute()));
    connect(select_b, SIGNAL(clicked()), this, SLOT(select()));
    connect(close_b, SIGNAL(clicked()), this, SLOT(reject()));
    connect(mark_unmark_b, SIGNAL(clicked()), this, SLOT(mark_unmark()));
    connect(mark_them_b, SIGNAL(clicked()), this, SLOT(mark_them()));
    connect(unmark_all_b, SIGNAL(clicked()), this, SLOT(unmark_all()));
    connect(results, SIGNAL(activated(int)), this, SLOT(selected(int)));

    compute();

    open_dialog(this);
}
Пример #2
0
ReferenceDialog::ReferenceDialog(BrowserNode * bn)
    : QDialog(0, "Referenced By dialog", FALSE, Qt::WDestructiveClose)
{
    the = this;
    target = bn;

    setCaption(TR("Referenced By dialog"));

    Q3VBoxLayout * vbox = new Q3VBoxLayout(this);

    vbox->setMargin(5);

    QString s = target->get_name();

    s += TR(" is referenced by :");

    vbox->addWidget(new QLabel(s, this));

    results = new Q3ComboBox(FALSE, this);
    vbox->addWidget(results);

    Q3HBoxLayout * hbox = new Q3HBoxLayout(vbox);
    QPushButton * search_b = new QPushButton(TR("Recompute"), this);
    QPushButton * close_b = new QPushButton(TR("Close"), this);

    hbox->setMargin(5);
    hbox->addWidget(search_b);
    hbox->addWidget(select_b = new QPushButton(TR("Select"), this));
    hbox->addWidget(mark_unmark_b = new QPushButton(TR("Unmark"), this));
    hbox->addWidget(mark_them_b = new QPushButton(TR("Mark them"), this));
    hbox->addWidget(unmark_all_b = new QPushButton(TR("Unmark all"), this));
    hbox->addWidget(close_b);

    search_b->setDefault(TRUE);

    connect(search_b, SIGNAL(clicked()), this, SLOT(compute()));
    connect(select_b, SIGNAL(clicked()), this, SLOT(select()));
    connect(close_b, SIGNAL(clicked()), this, SLOT(reject()));
    connect(mark_unmark_b, SIGNAL(clicked()), this, SLOT(mark_unmark()));
    connect(mark_them_b, SIGNAL(clicked()), this, SLOT(mark_them()));
    connect(unmark_all_b, SIGNAL(clicked()), this, SLOT(unmark_all()));
    connect(results, SIGNAL(activated(int)), this, SLOT(selected(int)));

    compute();

    open_dialog(this);
}
Пример #3
0
BrowserSearchDialog::BrowserSearchDialog()
    : QDialog(0, "Browser search", FALSE, Qt::WDestructiveClose)
{
    the = this;
    setCaption(TR("Browser search"));

    Q3VBoxLayout * vbox = new Q3VBoxLayout(this);

    vbox->setMargin(5);

    Q3GridLayout * gl = new Q3GridLayout(vbox, 4, 2, 5/*space*/);

    gl->addWidget(new QLabel(TR("Kind"), this), 0, 0, Qt::AlignLeft);
    kind = new Q3ComboBox(FALSE, this);

    for (int index = 0; index != sizeof(Kinds) / sizeof(*Kinds); index += 1)
        kind->insertItem(TR(Kinds[index].lbl));

    kind->setCurrentItem(saved_kind);
    gl->addWidget(kind, 0, 1);

    ed = new LineEdit(this);
    ed->setText(saved_ed);
    gl->addWidget(new QLabel(TR("Containing"), this), 1, 0, Qt::AlignLeft);
    gl->addWidget(ed, 1, 1);
    ed->setFocus();

    Q3HBox * hb = new Q3HBox(this);

    gl->addWidget(hb, 2, 1);

    Q3GroupBox * gb = new Q3GroupBox(2, Qt::Horizontal, hb);

    case_sensitive = new QCheckBox(TR("case sensitive"), gb);
    case_sensitive->setChecked(saved_case_sensitive);
    even_deleted = new QCheckBox(TR("even deleted"), gb);
    even_deleted->setChecked(saved_even_deleted);

    Q3ButtonGroup * bg = new Q3ButtonGroup(4, Qt::Horizontal, hb);

    bg->setExclusive(TRUE);
    for_name = new QRadioButton(TR("name"), bg);
    for_name->setChecked(saved_name);
    for_stereotype = new QRadioButton(TR("stereotype"), bg);
    for_stereotype->setChecked(saved_stereotype);
    for_comment = new QRadioButton(TR("description"), bg);
    for_comment->setChecked(saved_comment);
    for_decldefbody = new QRadioButton(TR("declaration/definition/body"), bg);
    for_decldefbody->setChecked(saved_decldefbody);

    gl->addWidget(new QLabel(TR("Result"), this), 3, 0, Qt::AlignLeft);
    results = new Q3ComboBox(FALSE, this);
    gl->addWidget(results, 3, 1);

    Q3HBoxLayout * hbox = new Q3HBoxLayout(vbox);
    QPushButton * search_b = new QPushButton(TR("Search"), this);
    QPushButton * close_b = new QPushButton(TR("Close"), this);

    hbox->setMargin(5);
    hbox->addWidget(search_b);
    hbox->addWidget(select_b = new QPushButton(TR("Select"), this));
    hbox->addWidget(mark_unmark_b = new QPushButton(TR("Unmark"), this));
    hbox->addWidget(mark_them_b = new QPushButton(TR("Mark them"), this));
    hbox->addWidget(unmark_all_b = new QPushButton(TR("Unmark all"), this));
    hbox->addWidget(close_b);

    search_b->setDefault(TRUE);

    connect(search_b, SIGNAL(clicked()), this, SLOT(search()));
    connect(select_b, SIGNAL(clicked()), this, SLOT(select()));
    connect(close_b, SIGNAL(clicked()), this, SLOT(reject()));
    connect(mark_unmark_b, SIGNAL(clicked()), this, SLOT(mark_unmark()));
    connect(mark_them_b, SIGNAL(clicked()), this, SLOT(mark_them()));
    connect(unmark_all_b, SIGNAL(clicked()), this, SLOT(unmark_all()));
    connect(results, SIGNAL(activated(int)), this, SLOT(selected(int)));

    if ((saved_kind != 0) || !saved_ed.isEmpty())
        search();
    else
        selected(-1);

    open_dialog(this);
}