Exemple #1
0
KACLEditWidget::KACLEditWidget( QWidget *parent )
    : QWidget(parent), d(new KACLEditWidgetPrivate)
{
    QHBoxLayout *hbox = new QHBoxLayout( this );
    hbox->setMargin( 0 );
    d->m_listView = new KACLListView(this);
    hbox->addWidget(d->m_listView);
    connect(d->m_listView->selectionModel(),
            SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection& )),
            this,
            SLOT(_k_slotUpdateButtons()));
    QVBoxLayout *vbox = new QVBoxLayout();
    hbox->addLayout( vbox );
    d->m_AddBtn = new QPushButton(i18n("Add Entry..."), this);
    vbox->addWidget(d->m_AddBtn);
    d->m_AddBtn->setObjectName(QLatin1String("add_entry_button"));
    connect(d->m_AddBtn, SIGNAL(clicked()), d->m_listView, SLOT(slotAddEntry()));
    d->m_EditBtn = new QPushButton(i18n("Edit Entry..."), this);
    vbox->addWidget(d->m_EditBtn);
    d->m_EditBtn->setObjectName(QLatin1String("edit_entry_button"));
    connect(d->m_EditBtn, SIGNAL(clicked()), d->m_listView, SLOT(slotEditEntry()));
    d->m_DelBtn = new QPushButton(i18n("Delete Entry"), this);
    vbox->addWidget(d->m_DelBtn);
    d->m_DelBtn->setObjectName(QLatin1String("delete_entry_button"));
    connect(d->m_DelBtn, SIGNAL(clicked()), d->m_listView, SLOT(slotRemoveEntry()));
    vbox->addItem( new QSpacerItem( 10, 10, QSizePolicy::Fixed, QSizePolicy::Expanding ) );
    d->_k_slotUpdateButtons();
}
Exemple #2
0
void HgIgnoreWidget::setupUI()
{
    QVBoxLayout *sideBar = new QVBoxLayout;
    m_addFiles = new QPushButton(xi18nc("@label:button", "Add Files"));
    m_addPattern = new QPushButton(xi18nc("@label:button", "Add Pattern"));
    m_editEntry = new QPushButton(xi18nc("@label:button", "Edit Entry"));
    m_removeEntries = new QPushButton(xi18nc("@label:button", "Remove Entries"));
    sideBar->addWidget(m_addFiles);
    sideBar->addWidget(m_addPattern);
    sideBar->addWidget(m_editEntry);
    sideBar->addWidget(m_removeEntries);
    sideBar->addStretch();

    m_ignoreTable = new QListWidget;
    m_untrackedList = new QListWidget;
    setupUntrackedList();

    m_ignoreTable->setSelectionMode(QListWidget::ExtendedSelection);
    m_untrackedList->setSelectionMode(QListWidget::ExtendedSelection);

    QHBoxLayout *mainLayout = new QHBoxLayout;
    mainLayout->addWidget(m_untrackedList);
    mainLayout->addWidget(m_ignoreTable);
    mainLayout->addLayout(sideBar);
    setLayout(mainLayout);

    connect(m_addFiles, SIGNAL(clicked()), this, SLOT(slotAddFiles()));
    connect(m_removeEntries, SIGNAL(clicked()), this, SLOT(slotRemoveEntries()));
    connect(m_addPattern, SIGNAL(clicked()), this, SLOT(slotAddPattern()));
    connect(m_editEntry, SIGNAL(clicked()), this, SLOT(slotEditEntry()));
}
Exemple #3
0
KACLEditWidget::KACLEditWidget(QWidget *parent, const char *name) : QWidget(parent, name)
{
    QHBox *hbox = new QHBox(parent);
    hbox->setSpacing(KDialog::spacingHint());
    m_listView = new KACLListView(hbox, "acl_listview");
    connect(m_listView, SIGNAL(selectionChanged()), this, SLOT(slotUpdateButtons()));
    QVBox *vbox = new QVBox(hbox);
    vbox->setSpacing(KDialog::spacingHint());
    m_AddBtn = new QPushButton(i18n("Add Entry..."), vbox, "add_entry_button");
    connect(m_AddBtn, SIGNAL(clicked()), m_listView, SLOT(slotAddEntry()));
    m_EditBtn = new QPushButton(i18n("Edit Entry..."), vbox, "edit_entry_button");
    connect(m_EditBtn, SIGNAL(clicked()), m_listView, SLOT(slotEditEntry()));
    m_DelBtn = new QPushButton(i18n("Delete Entry"), vbox, "delete_entry_button");
    connect(m_DelBtn, SIGNAL(clicked()), m_listView, SLOT(slotRemoveEntry()));
    QWidget *spacer = new QWidget(vbox);
    spacer->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
    slotUpdateButtons();
}