本文整理汇总了C++中enableButton函数的典型用法代码示例。如果您正苦于以下问题:C++ enableButton函数的具体用法?C++ enableButton怎么用?C++ enableButton使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了enableButton函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MessageBox
void CfsclientwDlg::OnBnClickedButconn()
{
//m_logoWin.setImage(icon_doing);
//m_logoWin.refresh();
m_gifWin.setText("...");
m_gifWin.refresh();
//Sleep(100000);
CComboBox * pcb = (CComboBox*)GetDlgItem(IDC_COMBOSRV);
CString cstr;
pcb->GetWindowText(cstr);
if (cstr == "")
{
MessageBox("please select or input a server", "error");
return;
}
if (m_dwM->connectServer(cstr.GetBuffer()) < 0)
{
MessageBox("failed to connect this server", "error");
return;
}
dir("/home");
enableButton("server", false);
enableButton("download", true);
enableButton("connect", false);
//Sleep(3000);
//m_logoWin.setImage(icon_ok);
m_gifWin.setText("ok");
}
示例2: enableButton
// new list
void KNGroupDialog::slotUser1()
{
leftLabel->setText(i18n("Downloading groups..."));
enableButton(User1,false);
enableButton(User2,false);
emit(fetchList(a_ccount));
}
示例3: enableButton
void KonqProfileDlg::slotTextChanged( const QString & text )
{
enableButton( BTN_SAVE, !text.isEmpty() );
// If we type the name of a profile, select it in the list
QList<QListWidgetItem*> items = d->m_pListView->findItems(text, Qt::MatchCaseSensitive);
QListWidgetItem * item = !items.isEmpty() ? items.first() : 0;
d->m_pListView->setCurrentItem(item);
bool itemSelected = item;
if ( itemSelected )
{
KConfig config( d->m_mapEntries[text], KConfig::SimpleConfig );
KConfigGroup profile( &config, "Profile" );
QFileInfo fi( d->m_mapEntries[ item->text() ] );
itemSelected = itemSelected && fi.isWritable();
if ( itemSelected )
item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable );
}
enableButton( BTN_RENAME, itemSelected );
enableButton( BTN_DELETE, itemSelected );
}
示例4: i18n
void NamedAreaDialog::slotRemove()
{
const QString question = i18n("Do you really want to remove this named area?");
int result = KMessageBox::warningContinueCancel(this, question, i18n("Remove Named Area"),
KStandardGuiItem::del());
if (result == KMessageBox::Cancel)
return;
QListWidgetItem* item = m_list->currentItem();
KCNamedAreaCommand* command = new KCNamedAreaCommand();
command->setAreaName(item->text());
command->setReverse(true);
command->setSheet(m_selection->activeSheet());
if (!command->execute(m_selection->canvas())) {
delete command;
return;
}
m_list->takeItem(m_list->row(item));
if (m_list->count() == 0) {
enableButtonOk(false);
enableButton(KDialog::User1, false);
enableButton(KDialog::User2, false);
displayAreaValues(QString());
} else
displayAreaValues(m_list->currentItem()->text());
}
示例5: enableButton
void MatrixFunctionDialog::checkValues() {
if (!ui.teEquation->isValid()) {
enableButton(KDialog::Ok, false);
return;
}
enableButton(KDialog::Ok, true);
}
示例6: enableButton
void UploadDialog::startTransfer()
{
if( !m_itdb || !m_uploadList->model()->hasChildren() )
return;
QTreeWidgetItem* selected = m_ipodAlbumList->currentItem();
IpodAlbumItem* ipodAlbum = dynamic_cast<IpodAlbumItem*>( selected );
if( !selected || !ipodAlbum )
return;
m_transferring = true;
Itdb_PhotoAlbum* album = ipodAlbum->photoAlbum();
enableButton(User1, false);
enableButton(Close, false);
GError* err = 0;
while( QTreeWidgetItem* item = m_uploadList->takeTopLevelItem(0) )
{
#define item static_cast<ImageListItem*>(item)
kDebug() << "Uploading " << item->pathSrc()
<< " to ipod album " << album->name ;
Itdb_Artwork* art = itdb_photodb_add_photo( m_itdb, QFile::encodeName( item->pathSrc() ), 0, 0, &err );
if( !art )
{
if( err )
{
kDebug() << "Error adding photo " << item->pathSrc() << " to database:"
<< err->message ;
err = 0;
}
}
else
{
itdb_photodb_photoalbum_add_photo( m_itdb, album, art, 0 );
}
delete item;
#undef item
}
itdb_photodb_write( m_itdb, &err );
if( err ) kDebug() << "Failed with error: " << err->message ;
reloadIpodAlbum( ipodAlbum, album );
IpodAlbumItem* library = static_cast<IpodAlbumItem*>( m_ipodAlbumList->topLevelItem(0) );
reloadIpodAlbum( library, library->photoAlbum() );
m_transferring = false;
enableButtons();
}
示例7: enableFields
void KOCRBase::stopOCR()
{
enableFields(true);
enableButton( User1, true ); /* start ocr */
enableButton( User2, false ); /* Cancel */
enableButton( Close, true );
stopAnimation();
}
示例8: KDialog
NamedAreaDialog::NamedAreaDialog(QWidget* parent, Selection* selection)
: KDialog(parent)
, m_selection(selection)
{
setButtons(KDialog::Ok | KDialog::Close | KDialog::User1 | KDialog::User2 | KDialog::User3);
setButtonsOrientation(Qt::Vertical);
setButtonText(KDialog::Ok, i18n("&Select"));
setButtonText(KDialog::User1, i18n("&Remove"));
setButtonText(KDialog::User2, i18n("&Edit..."));
setButtonText(KDialog::User3, i18n("&New..."));
setCaption(i18n("Named Areas"));
setModal(true);
setObjectName("NamedAreaDialog");
QWidget* widget = new QWidget(this);
setMainWidget(widget);
QVBoxLayout *vboxLayout = new QVBoxLayout(widget);
vboxLayout->setMargin(0);
vboxLayout->setSpacing(KDialog::spacingHint());
m_list = new KListWidget(this);
m_list->setSortingEnabled(true);
vboxLayout->addWidget(m_list);
m_rangeName = new QLabel(this);
m_rangeName->setText(i18n("Area: %1", QString()));
vboxLayout->addWidget(m_rangeName);
const QList<QString> namedAreas = m_selection->activeSheet()->map()->namedAreaManager()->areaNames();
for (int i = 0; i < namedAreas.count(); ++i)
m_list->addItem(namedAreas[i]);
if (m_list->count() == 0) {
enableButtonOk(false);
enableButton(KDialog::User1, false);
enableButton(KDialog::User2, false);
m_list->setCurrentRow(0);
}
connect(this, SIGNAL(okClicked()), this, SLOT(slotOk()));
connect(this, SIGNAL(cancelClicked()), this, SLOT(slotClose()));
connect(this, SIGNAL(user1Clicked()), this, SLOT(slotRemove()));
connect(this, SIGNAL(user2Clicked()), this, SLOT(slotEdit()));
connect(this, SIGNAL(user3Clicked()), this, SLOT(slotNew()));
connect(m_list, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(slotOk()));
connect(m_list, SIGNAL(currentTextChanged(const QString&)),
this, SLOT(displayAreaValues(const QString&)));
if (m_list->count() > 0)
m_list->setCurrentItem(m_list->item(0));
m_list->setFocus();
}
示例9: url
void MirrorAddDlg::updateButton(const QString &text)
{
bool enabled = false;
KUrl url(text);
if (url.isValid() && !url.protocol().isEmpty() && url.hasPath())
{
enabled = true;
}
enableButton(KDialog::Yes, enabled);
enableButton(KDialog::User1, enabled);
}
示例10: loadAllProfiles
void KonqProfileDlg::slotDeleteProfile()
{
if(!d->m_pListView->currentItem())
return;
KonqProfileMap::Iterator it = d->m_mapEntries.find( d->m_pListView->currentItem()->text() );
if ( it != d->m_mapEntries.end() && QFile::remove( it.value() ) )
loadAllProfiles();
enableButton( BTN_RENAME, d->m_pListView->currentItem() != 0 );
enableButton( BTN_DELETE, d->m_pListView->currentItem() != 0 );
}
示例11: kdDebug
void KOCRBase::startOCR()
{
/* en- and disable the buttons */
kdDebug(28000) << "Base: Starting OCR" << endl;
enableFields(false);
enableButton( User1, false ); /* Start OCR */
enableButton( User2, true ); /* Stop OCR */
enableButton( Close, true );
startAnimation();
}
示例12: enableButton
void KNGroupBrowser::slotReceiveList(KNGroupListData* d)
{
enableButton(User1,true);
enableButton(User2,true);
if (d) { // d==0 if something has gone wrong...
delete allList;
allList = d->extractList();
incrementalFilter=false;
slotRefilter();
}
}
示例13: enableButton
void RemoveRedEyesWindow::locatorChanged()
{
if (d->hasLocator)
{
enableButton(User1, true); // correction button
enableButton(User2, true); // testrun button
}
else
{
enableButton(User1, false); // correction button
enableButton(User2, false); // testrun button
}
}
示例14: KDialog
// new groups
void KNGroupDialog::slotUser2()
{
QDate lastDate = a_ccount->lastNewFetch();
KDialog *dlg = new KDialog( this );
dlg->setCaption( i18n("New Groups") );
dlg->setButtons( Ok | Cancel );
QGroupBox *btnGrp = new QGroupBox( i18n("Check for New Groups"), dlg );
dlg->setMainWidget(btnGrp);
QGridLayout *topL = new QGridLayout( btnGrp );
QRadioButton *takeLast = new QRadioButton( i18n("Created since last check:"), btnGrp );
topL->addWidget(takeLast, 0, 0, 1, 2 );
QLabel *l = new QLabel(KGlobal::locale()->formatDate(lastDate, KLocale::LongDate),btnGrp);
topL->addWidget(l, 1, 1, Qt::AlignLeft);
connect(takeLast, SIGNAL(toggled(bool)), l, SLOT(setEnabled(bool)));
QRadioButton *takeCustom = new QRadioButton( i18n("Created since this date:"), btnGrp );
topL->addWidget(takeCustom, 2, 0, 1, 2 );
dateSel = new KDatePicker( lastDate, btnGrp );
dateSel->setMinimumSize(dateSel->sizeHint());
topL->addWidget(dateSel, 3, 1, Qt::AlignLeft);
connect(takeCustom, SIGNAL(toggled(bool)), this, SLOT(slotDatePickerEnabled(bool)));
takeLast->setChecked(true);
dateSel->setEnabled(false);
topL->addItem( new QSpacerItem(30, 0 ), 0, 0 );
if (dlg->exec()) {
if (takeCustom->isChecked())
lastDate = dateSel->date();
a_ccount->setLastNewFetch(QDate::currentDate());
leftLabel->setText(i18n("Checking for new groups..."));
enableButton(User1,false);
enableButton(User2,false);
filterEdit->clear();
subCB->setChecked(false);
newCB->setChecked(true);
emit(checkNew(a_ccount,lastDate));
incrementalFilter=false;
slotRefilter();
}
delete dlg;
}
示例15: DiffDialog
void CommitDialog::showDiffDialog(const QString& fileName)
{
DiffDialog *l = new DiffDialog(partConfig, this, "diffdialog");
// disable diff button so user doesn't open the same diff several times (#83018)
enableButton(User1, false);
if (l->parseCvsDiff(cvsService, fileName, "", ""))
l->show();
else
delete l;
// re-enable diff button
enableButton(User1, true);
}