本文整理汇总了C++中enableButton函数的典型用法代码示例。如果您正苦于以下问题:C++ enableButton函数的具体用法?C++ enableButton怎么用?C++ enableButton使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了enableButton函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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");
}
开发者ID:simon-rock,项目名称:workspace_other,代码行数:29,代码来源:fsclientwDlg.cpp
示例2: enableButton
// new list
void KNGroupDialog::slotUser1()
{
leftLabel->setText(i18n("Downloading groups..."));
enableButton(User1,false);
enableButton(User2,false);
emit(fetchList(a_ccount));
}
开发者ID:chusopr,项目名称:kdepim-ktimetracker-akonadi,代码行数:8,代码来源:kngroupdialog.cpp
示例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 );
}
开发者ID:blue-shell,项目名称:folderview,代码行数:25,代码来源:konqprofiledlg.cpp
示例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());
}
开发者ID:KDE,项目名称:koffice,代码行数:28,代码来源:NamedAreaDialog.cpp
示例5: enableButton
void MatrixFunctionDialog::checkValues() {
if (!ui.teEquation->isValid()) {
enableButton(KDialog::Ok, false);
return;
}
enableButton(KDialog::Ok, true);
}
开发者ID:sutirthaghosh,项目名称:labplot,代码行数:8,代码来源:MatrixFunctionDialog.cpp
示例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();
}
开发者ID:NathanDM,项目名称:kipi-plugins,代码行数:57,代码来源:uploaddialog.cpp
示例7: enableFields
void KOCRBase::stopOCR()
{
enableFields(true);
enableButton( User1, true ); /* start ocr */
enableButton( User2, false ); /* Cancel */
enableButton( Close, true );
stopAnimation();
}
开发者ID:serghei,项目名称:kde3-kdegraphics,代码行数:11,代码来源:kocrbase.cpp
示例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();
}
开发者ID:KDE,项目名称:koffice,代码行数:54,代码来源:NamedAreaDialog.cpp
示例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);
}
开发者ID:fluxer,项目名称:kde-extraapps,代码行数:11,代码来源:mirrorsettings.cpp
示例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 );
}
开发者ID:blue-shell,项目名称:folderview,代码行数:12,代码来源:konqprofiledlg.cpp
示例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();
}
开发者ID:serghei,项目名称:kde3-kdegraphics,代码行数:12,代码来源:kocrbase.cpp
示例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();
}
}
开发者ID:akhuettel,项目名称:kdepim-noakonadi,代码行数:12,代码来源:kngroupbrowser.cpp
示例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
}
}
开发者ID:Vogtinator,项目名称:kipi-plugins,代码行数:13,代码来源:removeredeyeswindow.cpp
示例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;
}
开发者ID:chusopr,项目名称:kdepim-ktimetracker-akonadi,代码行数:51,代码来源:kngroupdialog.cpp
示例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);
}
开发者ID:ShermanHuang,项目名称:kdesdk,代码行数:15,代码来源:commitdialog.cpp
示例16: while
void KSaneDeviceDialog::updateDevicesList()
{
while (!m_btnGroup->buttons().isEmpty()) {
delete m_btnGroup->buttons().takeFirst();
}
const QList<KSaneWidget::DeviceInfo> list = m_findDevThread->devicesList();
if (list.isEmpty()) {
m_btnBox->setTitle(i18n("Sorry. No devices found."));
m_btnBox->layout()->itemAt(0)->widget()->show(); // explanation
m_btnBox->layout()->itemAt(1)->widget()->hide(); // scroll area
enableButton(KDialog::User1, true);
return;
}
delete m_btnLayout;
m_btnLayout = new QVBoxLayout;
m_btnContainer->setLayout(m_btnLayout);
m_btnBox->setTitle(i18n("Found devices:"));
m_btnBox->layout()->itemAt(0)->widget()->hide(); // explanation
m_btnBox->layout()->itemAt(1)->widget()->show(); // scroll area
for (int i=0; i< list.size(); i++) {
QRadioButton *b = new QRadioButton(this);
b->setObjectName(list[i].name);
b->setToolTip(list[i].name);
b->setText(QString("%1 : %2\n%3")
.arg(list[i].vendor)
.arg(list[i].model)
.arg(list[i].name));
m_btnLayout->addWidget(b);
m_btnGroup->addButton(b);
connect(b, SIGNAL(clicked(bool)), this, SLOT(setAvailable(bool)));
if((i==0) || (list[i].name == m_selectedDevice)) {
b->setChecked(true);
setAvailable(true);
}
}
m_btnLayout->addStretch();
if(list.size() == 1) {
button(KDialog::Ok)->animateClick();
}
enableButton(KDialog::User1, true);
}
开发者ID:rickysarraf,项目名称:digikam,代码行数:48,代码来源:ksane_device_dialog.cpp
示例17: setPixmap
//???
void Photos::openFiles()
{
QString path = QFileDialog::getOpenFileName(this,"","/","*.*");
if( "" != path)
{
position = 0;
imageList.clear();
imagePath = path;
//"/"??????stringList
QStringList stringList = imagePath.split("/");
//?????и
stringList.removeLast();
dirPath = stringList.join("/");
setPixmap(imagePath); //??
enableButton(); //?
scanFile(dirPath); //?
ui->label->setVisible(false);
}
}
开发者ID:AchillesL,项目名称:ARM,代码行数:26,代码来源:photos.cpp
示例18: emit
void OptionsDialog::slotApply()
{
global->server = w_server->text();
global->port = w_port->text().toInt();
global->timeout = w_timeout->value();
global->idleHold = w_idleHold->value();
global->pipeSize = w_pipesize->value();
global->encoding = KGlobal::charsets()->encodingForName(w_encoding->currentText());
global->authEnabled = w_auth->isChecked();
global->user = w_user->text();
global->secret = w_secret->text();
global->useCustomColors=c_olorCB->isChecked();
for(int i=0; i<global->colorCount(); i++)
global->c_olors[i] = (static_cast<ColorListItem*>(c_List->item(i)))->color();
global->useCustomFonts=f_ontCB->isChecked();
for(int i=0; i<global->fontCount(); i++)
global->f_onts[i] = (static_cast<FontListItem*>(f_List->item(i)))->font();
if (w_layout[0]->isChecked())
global->headLayout = 0;
else
if (w_layout[1]->isChecked())
global->headLayout = 1;
else
global->headLayout = 2;
global->maxDefinitions = w_MaxDefinitions->value();
global->maxBrowseListEntrys = w_Maxbrowse->value();
global->maxHistEntrys = w_Maxhist->value();
global->defineClipboard = w_Clipboard->isChecked();
global->saveHistory = w_Savehist->isChecked();
emit(optionsChanged());
enableButton( Apply, false );
configChanged = false;
}
开发者ID:serghei,项目名称:kde3-kdenetwork,代码行数:34,代码来源:options.cpp
示例19: KDialog
AddViewDialog::AddViewDialog( QHash<QString, ViewFactory*> *viewFactoryDict,
QWidget *parent )
: KDialog( parent),
mViewFactoryDict( viewFactoryDict )
{
setCaption( i18n( "Add View" ) );
setButtons( KDialog::Ok | KDialog::Cancel );
setDefaultButton( KDialog::Ok );
mTypeId = 0;
QWidget *page = new QWidget(this);
setMainWidget( page );
QGridLayout *layout = new QGridLayout( page );
layout->setMargin( 0 );
layout->setSpacing( spacingHint() );
layout->setRowStretch( 1, 1 );
layout->setColumnStretch( 1, 1 );
QLabel *label = new QLabel( i18n( "View name:" ), page );
layout->addWidget( label, 0, 0 );
mViewNameEdit = new KLineEdit( page );
connect( mViewNameEdit, SIGNAL( textChanged( const QString& ) ),
SLOT( textChanged( const QString& ) ) );
layout->addWidget( mViewNameEdit, 0, 1 );
QGroupBox *group = new QGroupBox( i18n( "View Type" ), page );
mTypeGroup = new QButtonGroup;
mTypeGroup->setExclusive( true );
connect( mTypeGroup, SIGNAL( buttonClicked( int ) ),
this, SLOT( clicked( int ) ) );
layout->addWidget( group, 1, 0, 1, 2 );
QGridLayout *groupLayout = new QGridLayout();
groupLayout->setMargin( KDialog::marginHint() );
groupLayout->setSpacing( KDialog::spacingHint() );
group->setLayout( groupLayout );
int row = 0;
QHashIterator<QString, ViewFactory*> iter( *mViewFactoryDict );
while ( iter.hasNext() ) {
iter.next();
QRadioButton *button = new QRadioButton( i18n( iter.value()->type().toUtf8() ),
group );
button->setObjectName( iter.value()->type().toLatin1() );
mTypeGroup->addButton( button, row );
label = new QLabel( iter.value()->description(), group );
label->setWordWrap( true );
groupLayout->addWidget( button, row, 0, Qt::AlignTop );
groupLayout->addWidget( label, row, 1, Qt::AlignTop );
row++;
}
mTypeGroup->button( 0 )->setChecked( true );
mViewNameEdit->setFocus();
enableButton( KDialog::Ok, false );
}
开发者ID:akhuettel,项目名称:kdepim-noakonadi,代码行数:60,代码来源:addviewdialog.cpp
示例20: KDialog
KonqNewSessionDlg::KonqNewSessionDlg( QWidget *parent, QString sessionName )
: KDialog( parent )
, d( new KonqNewSessionDlgPrivate( this ) )
{
d->layout()->setMargin( 0 );
setMainWidget( d );
setObjectName( QLatin1String( "konq_new_session_dialog" ) );
setModal( true );
setCaption( i18nc( "@title:window", "Save Session" ) );
setButtons( Ok | Cancel );
setDefaultButton( Ok );
enableButton( Ok, false );
if(!sessionName.isEmpty())
d->m_pSessionName->setText(sessionName);
d->m_pSessionName->setFocus();
connect(this, SIGNAL(okClicked()), SLOT(slotAddSession()));
connect(d->m_pSessionName, SIGNAL(textChanged(QString)), this,
SLOT(slotTextChanged(QString)));
resize( sizeHint() );
}
开发者ID:blue-shell,项目名称:folderview,代码行数:25,代码来源:konqsessiondlg.cpp
注:本文中的enableButton函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论