Beispiel #1
0
DccRecipientDialog::DccRecipientDialog(QWidget* parent, const QStringList &list,const QSize &size) :
    KDialogBase(parent,"dcc_recipient_dialog",true,i18n("Select Recipient"),
                KDialogBase::Ok | KDialogBase::Cancel,KDialogBase::Ok,true)
{
    // Create the top level widget
    QWidget* page=new QWidget(this);
    setMainWidget(page);
    // Add the layout to the widget
    QVBoxLayout* dialogLayout=new QVBoxLayout(page);
    dialogLayout->setSpacing(spacingHint());
    // Add the nickname list widget
    KListBox* nicknameList=new KListBox(page,"recipient_list");

    nicknameList->insertStringList(list);
    nicknameList->sort(true);

    nicknameInput=new KLineEdit(page,"nickname_input");

    dialogLayout->addWidget(nicknameList);
    dialogLayout->addWidget(nicknameInput);

    connect(nicknameList,SIGNAL (highlighted(QListBoxItem*)),this,SLOT (newNicknameSelected(QListBoxItem*)) );
    connect(nicknameList,SIGNAL (doubleClicked(QListBoxItem*)),this,SLOT (newNicknameSelectedQuit(QListBoxItem*)) );

    setButtonOK(KGuiItem(i18n("&OK"),"button_ok",i18n("Select nickname and close the window")));
    setButtonCancel(KGuiItem(i18n("&Cancel"),"button_cancel",i18n("Close the window without changes")));

    setInitialSize(size);
    show();
}
Beispiel #2
0
KFindDialog::KFindDialog(TQWidget *parent, const char *name, bool /*forReplace*/) :
    KDialogBase(parent, name, true, i18n("Replace Text"), Ok | Cancel, Ok),
    m_findExtension (0),
    m_replaceExtension (0)
{
    d = new KFindDialogPrivate;
    setButtonCancel( KStdGuiItem::close() );
}
Beispiel #3
0
KFindDialog::KFindDialog(bool modal, TQWidget *parent, const char *name, long options, const TQStringList &findStrings, bool hasSelection) :
    KDialogBase(parent, name, modal, i18n("Find Text"), Ok | Cancel, Ok),
    m_findExtension (0),
    m_replaceExtension (0)
{
    d = new KFindDialogPrivate;
    init(false, findStrings, hasSelection);
    setOptions(options);
    setButtonCancel( KStdGuiItem::close() );
}
Beispiel #4
0
void KProgressDialog::slotAutoActions(int percentage)
{
    if (percentage < 100)
    {
        if (!d->cancelButtonShown)
        {
            setButtonCancel(mCancelText);
            d->cancelButtonShown = true;
        }
        return;
    }

    mShowTimer->stop();

    if (mAutoReset)
    {
        mProgressBar->setProgress(0);
    }
    else
    {
        setAllowCancel(true);
        setButtonCancel(KStdGuiItem::close());
        d->cancelButtonShown = false;
    }

    if (mAutoClose)
    {
        if (mShown)
        {
            hide();
        }
        else
        {
            emit finished();
        }
    }
}
Beispiel #5
0
void KProgressDialog::setButtonText(const QString& text)
{
    mCancelText = text;
    setButtonCancel(text);
}