void MainWindow::setWifiDirectEnabled(bool state) { if (state) { buttonsEnabled(true); wifiDirectCheckBox->setCheckState(Qt::Checked); } else { buttonsEnabled(false); wifiDirectCheckBox->setCheckState(Qt::Unchecked); wifiDirectStatusLabel->setText("Disabled"); startGroupButton->setText("Start Group"); } }
void MainWindow::enableStateChanged(int state) { if (state == Qt::Checked) { buttonsEnabled(true); wpa->setEnabled(true); } else { buttonsEnabled(false); wpa->setEnabled(false); DevicesListModel *model = qobject_cast<DevicesListModel *>(listView->model()); model->removeRows(0, model->rowCount()); } }
FormDlgRuleSnippet::FormDlgRuleSnippet(int opCode, FormCfgRuleSnippets *parent) : QDialog(parent), ui(new Ui::FormDlgRuleSnippet) { ui->setupUi(this); formCfgRuleSnippets = parent; this->opCode = opCode; id = formCfgRuleSnippets->getColumnData("id").toInt(); name = formCfgRuleSnippets->getColumnData("name").toString(); snippets = formCfgRuleSnippets->getColumnData("snippets").toString(); if (opCode == FormCfgRuleSnippets::REC_DELETE) { ui->edtRuleSnippetName->setReadOnly(true); ui->edtRuleSnippet->setReadOnly(true); ui->btnSave->setText("&Delete"); buttonsEnabled(true); } else { buttonsEnabled(false); } if (opCode == FormCfgRuleSnippets::REC_ADD) { ui->btnSave->setText("&Create"); ui->edtRuleSnippetName->setText(""); ui->edtRuleSnippet->clear(); ui->edtRuleSnippet->appendPlainText(""); } else { ui->edtRuleSnippetName->setText(name); ui->edtRuleSnippet->clear(); ui->edtRuleSnippet->appendPlainText(snippets); } connect(ui->edtRuleSnippetName, SIGNAL(textEdited(QString)), this, SLOT(dataChanged())); connect(ui->edtRuleSnippet, SIGNAL(textChanged()), this, SLOT(dataChanged())); }
void KopeteRichTextEditPart::slotSetRichTextEnabled( bool enable ) { m_richTextEnabled = enable && m_richTextAvailable; if( m_richTextEnabled ) { editor->setTextFormat( Qt::RichText ); } else { editor->setTextFormat( Qt::PlainText ); } emit toggleToolbar( buttonsEnabled() ); // Spellchecking disabled when using rich text because the // text we were getting from widget was coloured HTML! editor->setCheckSpellingEnabled( !m_richTextEnabled ); checkSpelling->setEnabled( !m_richTextEnabled ); //Enable / disable buttons updateActions(); enableRichText->setChecked( m_richTextEnabled ); }
MainWindow::MainWindow(QWidget *parent) :QWidget(parent) { setupUi(this); keyboard = new Keyboard; keyboard->setVisible(false); layout()->addWidget(keyboard); devicesModel = new DevicesListModel; listView->setModel(devicesModel); deviceDelegate = new DeviceListDelegate; listView->setItemDelegate(deviceDelegate); #if !defined(DEBUG) QWSServer *qws = QWSServer::instance(); if (qws) qws->setCursorVisible(false); #endif buttonGroup = new QButtonGroup(this); buttonGroup->addButton(pbcRadioButton); buttonGroup->addButton(pinRadioButton); buttonsEnabled(false); pinLineEdit->setEnabled(false); goCheckBox->setEnabled(false); wpa = new Wpa; dynamic_cast<QVBoxLayout *>(layout())->setStretchFactor(scrollArea, 1); connect(qApp, SIGNAL(focusChanged(QWidget*, QWidget*)), this, SLOT(focusChanged(QWidget*, QWidget*))); connect(wpa, SIGNAL(status(const QString&)), this, SLOT(statusChanged(const QString&))); connect(wpa, SIGNAL(deviceFound(Device&)), devicesModel, SLOT(addDevice(Device&))); connect(wpa, SIGNAL(connectFails(int)), this, SLOT(connectionFails(int))); connect(wpa, SIGNAL(groupStarted(bool)), this, SLOT(groupStarted(bool))); connect(wpa, SIGNAL(groupFinished()), this, SLOT(groupStopped())); connect(wpa, SIGNAL(enabled(bool)), this, SLOT(setWifiDirectEnabled(bool))); connect(listView, SIGNAL(doubleClicked(const QModelIndex&)), this, SLOT(deviceSelected(const QModelIndex&))); connect(startGroupButton, SIGNAL(clicked()), this, SLOT(startGroupClicked())); connect(disconnectButton, SIGNAL(clicked()), this, SLOT(disconnectClicked())); // connect(intentSlider, SIGNAL(valueChanged(int)), wpa, // SLOT(setIntent(int))); // connect(channelSlider, SIGNAL(sliderReleased()), this, // SLOT(channelReleased())); if (wpa->isEnabled()) { wifiDirectCheckBox->setCheckState(Qt::Checked); wpa->getPeers(); statusChanged(wpa->getStatus()); } }
void FormDlgRuleSnippet::dataChanged() { buttonsEnabled(true); }
void KopeteRichTextEditPart::checkToolbarEnabled() { emit toggleToolbar( buttonsEnabled() ); }