//------------------------------------------------------------------------------------------------ void CalibrationWidget::stopCalibration() { calibTool.stopCalibration(); // cancel the calibration and wait for thread has finished if (calibrationFuture.isRunning()) { QMessageBox::information(this, trUtf8("Kalibrierung stoppen"), trUtf8("Die Kalibrierung wird abgebrochen, dies kann einen Moment dauern.")); calibrationFuture.cancel(); calibrationFuture.waitForFinished(); } else QMessageBox::information(this, trUtf8("Kalibrierung abgeschlossen"), trUtf8("Das Kalibrieren der Kamera ist abegschlossen.")); calibrationRunning = false; imgModel->setCheckboxesEnabled(true); calibrationWidget->pushButton_kalibrieren->setText(trUtf8("Kalibrieren")); // reset progressbar calibrationWidget->progressBar->setValue(0); enableButtons(); }
void MainWindow::on_actionOpen_Disk_triggered() { QString disco = QFileDialog::getOpenFileName(this, "Seleccione un disco", "", "*.disk"); if(disco == "") return; QFileInfo file(disco); QString name = file.baseName(); name.append(".disk"); Lista<string>* canciones = disk.openDisk(name.toStdString()); this->cant_bloques_previo = disk.super.used_blocks; if(canciones != NULL) { for(int i = 0; i < canciones->getCantidad(); i++) { string cancion = canciones->obtenerValor(i); ui->cmbSongs->addItem(cancion.c_str()); } } enableButtons(); ui->tableWidget->setRowCount(disk.super.cant_block / ui->tableWidget->columnCount()); loadTable(); }
StringListSelectAndReorderSet::StringListSelectAndReorderSet(QWidget* parent, const char* name) : StringListSelectAndReorderSetData(parent, name) { // ############################################################################ // ----- create the bitmaps: QBitmap previous(16, 16, (unsigned char*)arrow_left_bits, true); QBitmap next(16, 16, (unsigned char*)arrow_right_bits, true); QBitmap up(16, 16, (unsigned char*)uparrow_bits, true); QBitmap down(16, 16, (unsigned char*)arrow_down_bits, true); // ----- set the button faces: buttonSelect->setPixmap(next); buttonUnselect->setPixmap(previous); buttonUp->setPixmap(up); buttonDown->setPixmap(down); labelPossible->setText(i18n("Possible values:")); labelSelected->setText(i18n("Selected values:")); // ----- setup the dialog: connect(lbSelected, SIGNAL(highlighted(int)), SLOT(enableButtons(int))); enableButtons(0); // ----- setMinimumSize(sizeHint()); // ############################################################################ }
void PlayList::slotCurrentItemChanged(QTreeWidgetItem* currentItem, QTreeWidgetItem* /* prevItem */) { // RG_DEBUG << "PlayList::slotCurrentItemChanged() - selection Changed. "; enableButtons(currentItem); }
ServerWindow::ServerWindow(QWidget* parent) :QWidget(parent) { setWindowTitle("Qt TasServer Ui"); monitor = new ServerMonitor(); statusButton = new QPushButton("Check status"); stopButton = new QPushButton("Stop"); startButton = new QPushButton("Start"); resetButton = new QPushButton ("Reset server"); loadPluginsButton = new QPushButton("Load Plugins"); #ifdef Q_OS_SYMBIAN pluginButton = new QPushButton ("Enable tas"); autoStart = new QCheckBox("Autostart"); autoStart->setTristate(false); if(monitor->autostartState()){ autoStart->setCheckState(Qt::Checked); } connect(autoStart, SIGNAL(toggled(bool)), monitor, SLOT(setAutoStart(bool))); #endif QLabel* stateLabel = new QLabel("Server state:"); QLabel* versionLabel = new QLabel("Server version:"); QLabel* stateValue = new QLabel("Unknown"); QLabel* versionValue = new QLabel(TAS_VERSION); QLabel* hostBindingLabel = new QLabel("Server Address Binding:"); anyBindRadioButton = new QRadioButton("Any"); localBindRadioButton = new QRadioButton("Localhost"); anyBindRadioButton->setDisabled(true); localBindRadioButton->setDisabled(true); connect(monitor, SIGNAL(serverState(const QString&)), stateValue, SLOT(setText(const QString&))); connect(monitor, SIGNAL(beginMonitor()), this, SLOT(disableButtons())); connect(monitor, SIGNAL(stopMonitor()), this, SLOT(enableButtons())); connect(monitor, SIGNAL(disableReBinding()), this, SLOT(disableRadioButtons())); connect(monitor, SIGNAL(enableReBinding(const QString&)), this, SLOT(enableRadioButtons(const QString&))); QTextEdit* editField = new QTextEdit(); editField->setReadOnly(true); connect(monitor, SIGNAL(serverDebug(const QString&)), editField, SLOT(append(const QString&))); connect(startButton, SIGNAL(clicked()), editField, SLOT(clear())); connect(stopButton, SIGNAL(clicked()), editField, SLOT(clear())); connect(resetButton, SIGNAL(clicked()), editField, SLOT(clear())); connect(statusButton, SIGNAL(clicked()), editField, SLOT(clear())); connect(loadPluginsButton, SIGNAL(clicked()), editField, SLOT(clear())); connect(anyBindRadioButton, SIGNAL(clicked()), editField, SLOT(clear())); connect(localBindRadioButton, SIGNAL(clicked()), editField, SLOT(clear())); connect(anyBindRadioButton, SIGNAL(clicked()), monitor, SLOT(setAnyBinding())); connect(localBindRadioButton, SIGNAL(clicked()), monitor, SLOT(setLocalBinding())); #ifdef Q_OS_SYMBIAN connect(pluginButton, SIGNAL(clicked()), editField, SLOT(clear())); connect(pluginButton, SIGNAL(clicked()), monitor, SLOT(enablePluginLoad())); #endif connect(statusButton, SIGNAL(clicked()), monitor, SLOT(serverState())); connect(stopButton, SIGNAL(clicked()), monitor, SLOT(stopServer())); connect(startButton, SIGNAL(clicked()), monitor, SLOT(startServer())); connect(resetButton, SIGNAL(clicked()), monitor, SLOT(restartServer())); connect(loadPluginsButton, SIGNAL(clicked()),monitor, SLOT(loadPlugins())); QPushButton* quitButton = new QPushButton("Quit"); connect(quitButton, SIGNAL(clicked()), qApp, SLOT(quit())); QGridLayout* mainLayout = new QGridLayout(); mainLayout->addWidget(stateLabel, 0, 0, 1, 1); mainLayout->addWidget(stateValue, 0, 1, 1, 1); mainLayout->addWidget(versionLabel, 1, 0); mainLayout->addWidget(versionValue, 1, 1); // Server binding Radio mainLayout->addWidget(hostBindingLabel, 2, 0); mainLayout->addWidget(anyBindRadioButton, 2, 1); mainLayout->addWidget(localBindRadioButton, 3, 1); mainLayout->addWidget(editField, 4,0, 1, 2); #ifdef Q_OS_SYMBIAN mainLayout->addWidget(statusButton, 5, 0); mainLayout->addWidget(pluginButton, 5, 1); #else mainLayout->addWidget(statusButton, 5, 0); mainLayout->addWidget(loadPluginsButton, 5, 1); #endif mainLayout->addWidget(stopButton, 6, 0); mainLayout->addWidget(startButton, 6, 1); mainLayout->addWidget(resetButton, 7, 0); mainLayout->addWidget(quitButton, 7, 1); #ifdef Q_OS_SYMBIAN mainLayout->addWidget(autoStart, 8, 0); mainLayout->addWidget(loadPluginsButton, 8, 1); #endif setLayout(mainLayout); // QRect rect = qApp->desktop()->screenGeometry(); // if(rect.width() > 864) // setFixedSize(350,600); // else{ // showFullScreen(); // } }
void OrderDialog::on_pageList_currentRowChanged(int r) { enableButtons(r); }
void NewPromotedClassPanel::slotIncludeFileChanged(const QString &){ enableButtons(); }
void SpeechPad::on_isolatedButton_clicked(){ enableButtons(FALSE); decode(true); }
void QgsDelimitedTextSourceSelect::enableAccept() { emit enableButtons( validate() ); }
void VotePanel::onNoButtonEvent(wxCommandEvent&) { chatPanel->Say(TowxString(SAY_NO)); enableButtons(false); }
void VotePanel::onDontCareButtonEvent(wxCommandEvent&) { chatPanel->Say(TowxString(SAY_DONTCARE)); enableButtons(false); }
void ContourLinesEditor::showPenDialog(int row, int col) { if (!d_spectrogram || col != 1) return; enableButtons(row); QPen pen = d_pen_list[row]; if (!penDialog){ penDialog = new QDialog(this); penDialog->setWindowTitle(tr("MantidPlot - Edit pen")); QGroupBox *gb1 = new QGroupBox(); QGridLayout *hl1 = new QGridLayout(gb1); hl1->addWidget(new QLabel(tr("Color")), 0, 0); penColorBox = new ColorButton(); penColorBox->setColor(pen.color()); hl1->addWidget(penColorBox, 0, 1); applyAllColorBox = new QCheckBox(tr("Apply to all")); hl1->addWidget(applyAllColorBox, 0, 2); hl1->addWidget(new QLabel(tr("Style")), 1, 0); penStyleBox = new PenStyleBox; penStyleBox->setStyle(pen.style()); hl1->addWidget(penStyleBox, 1, 1); applyAllStyleBox = new QCheckBox(tr("Apply to all")); hl1->addWidget(applyAllStyleBox, 1, 2); hl1->addWidget(new QLabel(tr("Width")), 2, 0); penWidthBox = new DoubleSpinBox(); penWidthBox->setValue(pen.widthF()); hl1->addWidget(penWidthBox, 2, 1); hl1->setRowStretch(3, 1); applyAllWidthBox = new QCheckBox(tr("Apply to all")); hl1->addWidget(applyAllWidthBox, 2, 2); QPushButton *acceptPenBtn = new QPushButton(tr("&Ok")); connect(acceptPenBtn, SIGNAL(clicked()), this, SLOT(updatePen())); QPushButton *closeBtn = new QPushButton(tr("&Close")); connect(closeBtn, SIGNAL(clicked()), penDialog, SLOT(reject())); QHBoxLayout *hl2 = new QHBoxLayout(); hl2->addStretch(); hl2->addWidget(acceptPenBtn); hl2->addWidget(closeBtn); QVBoxLayout *vl = new QVBoxLayout(penDialog); vl->addWidget(gb1); vl->addLayout(hl2); } else { penColorBox->setColor(pen.color()); penStyleBox->setStyle(pen.style()); penWidthBox->setValue(pen.widthF()); } d_pen_index = row; penDialog->exec(); }
void GenericDataCollectionTableFilterDialog::buildDialog() { setWindowTitle(tr("Search Table")); // Radio buttons for search: // Column (enable column selector) // table // selected // Check boxes for: // case sensitive // entire cell // Search value (based on what I want to find) // Replace value (baesd on what I want to find) QGroupBox* filterType = new QGroupBox(); m_rbString = new QRadioButton(tr("String")); m_rbRegExp = new QRadioButton(tr("Regular Expression")); m_rbWild = new QRadioButton(tr("Wild Card")); QPushButton* button; QVBoxLayout *vLayout; QVBoxLayout *vLayout2; //QHBoxLayout *hLayout; QFormLayout *fLayout = new QFormLayout; vLayout = new QVBoxLayout(); m_findValueLineEdit = new QLineEdit(); m_replaceValueLineEdit = new QLineEdit(); //hLayout = new QHBoxLayout(); vLayout->addWidget(new QLabel(tr("Search &Text"))); button = new QPushButton(tr("&Find")); connect(button, SIGNAL(released()), this, SLOT(find())); QHBoxLayout *hLayout2 = new QHBoxLayout(); hLayout2->addWidget(m_findValueLineEdit); hLayout2->addWidget(button); vLayout->addLayout(hLayout2); vLayout->addWidget(new QLabel(tr("Replace with"))); vLayout2 = new QVBoxLayout(); button = new QPushButton(tr("Replace")); connect(button, SIGNAL(released()), this, SLOT(replace())); vLayout2->addWidget(button); button = new QPushButton(tr("Replace All")); connect(button, SIGNAL(released()), this, SLOT(replaceAll())); vLayout2->addWidget(button); hLayout2 = new QHBoxLayout(); hLayout2->addWidget(m_replaceValueLineEdit); hLayout2->addLayout(vLayout2); vLayout->addLayout(hLayout2); hLayout2 = new QHBoxLayout(); vLayout2 = new QVBoxLayout(); m_matchCaseCB = new QCheckBox(tr("Match case")); vLayout2->addWidget(m_matchCaseCB); m_regularExpressionCB = new QCheckBox(tr("Regular expression")); vLayout2->addWidget(m_regularExpressionCB); hLayout2->addLayout(vLayout2); vLayout2 = new QVBoxLayout(); m_matchEntireCellCB = new QCheckBox(tr("Match cell only")); vLayout2->addWidget(m_matchEntireCellCB); m_selectionOnlyCB = new QCheckBox(tr("Current Selection Only")); vLayout2->addWidget(m_selectionOnlyCB); hLayout2->addLayout(vLayout2); vLayout->addLayout(hLayout2); QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); vLayout->addWidget(buttonBox); /** hLayout2 = new QHBoxLayout(); m_matchCaseCB = new QCheckBox(tr("Match case")); hLayout2->addWidget(m_matchCaseCB); m_matchEntireCellCB = new QCheckBox(tr("Match cell only")); hLayout2->addWidget(m_matchEntireCellCB); vLayout->addLayout(hLayout2); hLayout2 = new QHBoxLayout(); m_regularExpressionCB = new QCheckBox(tr("Regular expression")); hLayout2->addWidget(m_regularExpressionCB); m_selectionOnlyCB = new QCheckBox(tr("Current Selection Only")); hLayout2->addWidget(m_selectionOnlyCB); vLayout->addLayout(hLayout2); **/ //vLayout = new QVBoxLayout(); //vLayout->addWidget(new QLabel(tr("Find: "))); //hLayout->addLayout(vLayout); //vLayout->addWidget(new QLabel(tr("Replace: "))); //hLayout->addLayout(vLayout); //hLayout->addLayout(vLayout); //vLayout = new QVBoxLayout(); //vLayout->addWidget(m_findValueLineEdit); //vLayout->addWidget(m_replaceValueLineEdit); //hLayout->addLayout(vLayout); fLayout->addRow(vLayout); setLayout(fLayout); /** m_configFilePath = new QLineEdit(); hLayout = new QHBoxLayout(); vLayout = new QVBoxLayout(); vLayout->addWidget(new QLabel(tr("Configuration File: "))); hLayout->addLayout(vLayout); vLayout = new QVBoxLayout(); vLayout->addWidget(m_configFilePath); hLayout->addLayout(vLayout); button = new QPushButton(tr("Load")); connect(button, SIGNAL(clicked()), this, SLOT(loadConfiguration())); hLayout->addWidget(button); button = new QPushButton(tr("Save")); connect(button, SIGNAL(clicked()), this, SLOT(saveConfiguration())); hLayout->addWidget(button); fLayout->addRow(hLayout); hLayout = new QHBoxLayout(); vLayout = new QVBoxLayout(); vLayout->addWidget(new QLabel(tr("Sort Fields:"))); button = new QPushButton(tr("Add")); connect(button, SIGNAL(clicked()), this, SLOT(addRow())); vLayout->addWidget(button); m_addButton = button; button = new QPushButton(tr("Delete")); connect(button, SIGNAL(clicked()), this, SLOT(delSelectedRow())); vLayout->addWidget(button); m_deleteButton = button; button = new QPushButton(tr("Up")); connect(button, SIGNAL(clicked()), this, SLOT(rowUp())); vLayout->addWidget(button); m_upButton = button; button = new QPushButton(tr("Down")); connect(button, SIGNAL(clicked()), this, SLOT(rowDown())); vLayout->addWidget(button); m_downButton = button; vLayout->addStretch(); hLayout->addLayout(vLayout); m_tableView = new QTableView(); m_tableModel = new TableSortFieldTableModel(m_dataCollection); m_tableView->setModel(m_tableModel); // Parameter sets the owning parent that will delete the delegate. LinkBackFilterDelegate* delegate = new LinkBackFilterDelegate(m_tableView); m_tableView->setItemDelegate(delegate); CheckBoxOnlyDelegate * cboDelegate = new CheckBoxOnlyDelegate(m_tableView); m_tableView->setItemDelegateForColumn(TableSortFieldTableModel::ascendingColumn, cboDelegate); m_tableView->setItemDelegateForColumn(TableSortFieldTableModel::caseColumn, cboDelegate); hLayout->addWidget(m_tableView); fLayout->addRow(hLayout); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal); connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); fLayout->addRow(buttonBox); setLayout(fLayout); QSettings settings; restoreGeometry(settings.value(Constants::Settings_SortFieldDlgGeometry).toByteArray()); setConfigFilePath(settings.value(Constants::SortFieldConfigDialogLastConfigPath).toString()); QString s = settings.value(Constants::SortFieldConfigDialogRoutingColumnWidths).toString(); if (s.length() > 0) { QStringList list = s.split(','); bool ok = true; for (int i=0; i<list.size() && i<TableSortFieldTableModel::numColumns; ++i) { int width = list[i].toInt(&ok); if (ok && width > 0) { m_tableView->setColumnWidth(i, width); } } } connect(m_tableView->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), this, SLOT(selectionChanged(const QItemSelection &, const QItemSelection &))); **/ enableButtons(); }
Gutenbrowser::Gutenbrowser(QWidget *,const char*, WFlags ) #endif : QMainWindow() { showMainList=TRUE; working=false; this->setUpdatesEnabled(TRUE); QString msg; msg="You have now entered unto gutenbrowser,\n"; msg+="make your self at home, sit back, relax and read something great.\n"; local_library = (QDir::homeDirPath ()) +"/Applications/gutenbrowser/"; setCaption("Gutenbrowser");// Embedded " VERSION); this->setUpdatesEnabled(TRUE); topLayout = new QVBoxLayout( this, 0, 0, "topLayout"); menu = new QHBoxLayout(-1,"menu"); buttons2 = new QHBoxLayout(-1,"buttons2"); edits = new QHBoxLayout(-1,"edits"); useSplitter=TRUE; initConfig(); initMenuBar(); initButtonBar(); initStatusBar(); initView(); initSlots(); qDebug("init finished"); QPEApplication::setStylusOperation( mainList->viewport(),QPEApplication::RightOnHold); connect( mainList, SIGNAL( mouseButtonPressed( int, QListBoxItem *, const QPoint &)), this, SLOT( mainListPressed(int, QListBoxItem *, const QPoint &)) ); if( useIcons) toggleButtonIcons( TRUE); else toggleButtonIcons( FALSE); enableButtons(false); Config config("Gutenbrowser"); // populate menubuttonlist config.setGroup("General"); config.setGroup( "Files" ); QString s_numofFiles = config.readEntry("NumberOfFiles", "0" ); int i_numofFiles = s_numofFiles.toInt(); QString tempFileName; for (int i = 0; i <= i_numofFiles; i++) { config.setGroup( "Files" ); QString ramble = config.readEntry( QString::number(i), "" ); config.setGroup( "Titles" ); QString tempTitle = config.readEntry( ramble, ""); config.setGroup( tempTitle); int index = config.readNumEntry( "LineNumber", -1 ); if( index != -1) { odebug << tempTitle << oendl; if(!tempTitle.isEmpty()) bookmarksMenu->insertItem( tempTitle); } } QString gutenIndex = local_library + "/GUTINDEX.ALL"; qDebug("gutenindex "+gutenIndex ); if( QFile( gutenIndex).exists() ) indexLib.setName( gutenIndex); else { QString localLibIndexFile = local_library + "/PGWHOLE.TXT"; newindexLib.setName( localLibIndexFile); } qDebug("attempting new library"); LibraryDlg = new LibraryDialog( this, "Library Index" /*, TRUE */); loadCheck = false; chdir(local_library); if(!showMainList) { Lview->setFocus(); for (int i=1;i< qApp->argc();i++) { qDebug("Suppose we open somethin"); if(!load(qApp->argv()[i])) return; } } else { fillWithTitles(); mainList->setFocus(); } writeConfig(); QTimer::singleShot( 250, this, SLOT(hideView()) ); }
bool Gutenbrowser::load( const char *fileName) { odebug << "Title is already set as "+title << oendl; odebug << "sizeHint " << sizeHint().height() << " pageSize " << Lview->PageSize() << "" << oendl; if( Lview->PageSize() < 4) { Lview->setMinimumHeight( sizeHint().height() ); pointSize = Lview->fontInfo().pointSize(); odebug << "sizeHint " << sizeHint().height() << " point size " << pointSize << "" << oendl; if(pointSize < 15) Lview->setFixedVisibleLines(19); else Lview->setFixedVisibleLines( ( (sizeHint().height() / pointSize ) * 2) -2); } Config cfg("Gutenbrowser"); cfg.setGroup("General"); cfg.writeEntry("Current",fileName); cfg.write(); currentLine=0; file_name=fileName; QString o_file = fileName; i_pageNum = 1; odebug << "ready to open "+o_file << oendl; if(f.isOpen()) f.close(); f.setName( o_file); if ( !f.open( IO_ReadOnly)) { QMessageBox::message( (tr("Note")), (tr("File not opened sucessfully.\n" +o_file)) ); return false; } currentFilePos = 0; pageStopArray.resize(3); pageStopArray[0] = currentFilePos; fileHandle = f.handle(); QString insertString; QTextStream t(&f); QString s; for(int fd=0; fd < Lview->PageSize() ;fd++) { s=t.readLine(); if(useWrap) s.replace(QRegExp("\n"),""); Lview->insertLine( s,-1); currentLine++; } currentFilePos = f.at(); pageStopArray[1] = currentFilePos; odebug << "<<<<<<<<<<<" << currentFilePos << " current page is number " << i_pageNum << ", length " << Lview->length() << ", current " << pageStopArray[i_pageNum] << ", pageSize " << Lview->PageSize() << oendl; Lview->setMaxLines(Lview->PageSize()*2); setCaption(title); Lview->setAutoUpdate( TRUE); loadCheck = true; enableButtons(true); if( donateMenu->count() == 3) donateMenu->insertItem("Current Title", this, SLOT( InfoBarClick() )); Lview->setFocus(); return true; }
void SpeechPad::on_update_decoder_status(bool status){ enableButtons(status); }
void SpeechPad::on_decoder_configured(bool status){ enableButtons(status); }
void QgsWFSSourceSelect::capabilitiesReplyFinished() { QApplication::restoreOverrideCursor(); btnConnect->setEnabled( true ); if ( !mCapabilities ) return; QgsWfsCapabilities::ErrorCode err = mCapabilities->errorCode(); if ( err != QgsWfsCapabilities::NoError ) { QString title; switch ( err ) { case QgsWfsCapabilities::NetworkError: title = tr( "Network Error" ); break; case QgsWfsCapabilities::XmlError: title = tr( "Capabilities document is not valid" ); break; case QgsWfsCapabilities::ServerExceptionError: title = tr( "Server Exception" ); break; default: title = tr( "Error" ); break; } // handle errors QMessageBox *box = new QMessageBox( QMessageBox::Critical, title, mCapabilities->errorMessage(), QMessageBox::Ok, this ); box->setAttribute( Qt::WA_DeleteOnClose ); box->setModal( true ); box->setObjectName( QStringLiteral( "WFSCapabilitiesErrorBox" ) ); if ( !property( "hideDialogs" ).toBool() ) box->open(); emit enableButtons( false ); return; } mCaps = mCapabilities->capabilities(); mAvailableCRS.clear(); Q_FOREACH ( const QgsWfsCapabilities::FeatureType &featureType, mCaps.featureTypes ) { // insert the typenames, titles and abstracts into the tree view QStandardItem *titleItem = new QStandardItem( featureType.title ); QStandardItem *nameItem = new QStandardItem( featureType.name ); QStandardItem *abstractItem = new QStandardItem( featureType.abstract ); abstractItem->setToolTip( "<font color=black>" + featureType.abstract + "</font>" ); abstractItem->setTextAlignment( Qt::AlignLeft | Qt::AlignTop ); QStandardItem *filterItem = new QStandardItem(); typedef QList< QStandardItem * > StandardItemList; mModel->appendRow( StandardItemList() << titleItem << nameItem << abstractItem << filterItem ); // insert the available CRS into mAvailableCRS mAvailableCRS.insert( featureType.name, featureType.crslist ); } if ( !mCaps.featureTypes.isEmpty() ) { treeView->resizeColumnToContents( MODEL_IDX_TITLE ); treeView->resizeColumnToContents( MODEL_IDX_NAME ); treeView->resizeColumnToContents( MODEL_IDX_ABSTRACT ); for ( int i = MODEL_IDX_TITLE; i < MODEL_IDX_ABSTRACT; i++ ) { if ( treeView->columnWidth( i ) > 300 ) { treeView->setColumnWidth( i, 300 ); } } if ( treeView->columnWidth( MODEL_IDX_ABSTRACT ) > 150 ) { treeView->setColumnWidth( MODEL_IDX_ABSTRACT, 150 ); } btnChangeSpatialRefSys->setEnabled( true ); treeView->selectionModel()->setCurrentIndex( mModelProxy->index( 0, 0 ), QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows ); treeView->setFocus(); } else { QMessageBox::information( nullptr, tr( "No Layers" ), tr( "capabilities document contained no layers." ) ); emit enableButtons( false ); mBuildQueryButton->setEnabled( false ); } }
void ClientSearch::setSelectedUser(int r){ selected_user=table->item(r,0)->text(); enableButtons(); }
void TeethX::Window_Open(Win::Event& e) { //____________________________________________________Login: Get userz_id LoginDlg dlg; if(dlg.BeginDialog(hWnd)!=TRUE) { this->Destroy(); return; } userz_id= dlg.userz_id; this->Width= 820; //________________________________________________________ toolbMain TBBUTTON tbButton[12];//<< EDIT HERE THE NUMBER OF BUTTONS toolbMain.imageList.Create(20, 20, 9);//<< EDIT HERE THE NUMBER OF IMAGES toolbMain.imageList.AddIcon(this->hInstance, IDI_SAVE); toolbMain.imageList.AddIcon(this->hInstance, IDI_COPY); toolbMain.imageList.AddIcon(this->hInstance, IDI_ADD); toolbMain.imageList.AddIcon(this->hInstance, IDI_EDIT); toolbMain.imageList.AddIcon(this->hInstance, IDI_DELETE); toolbMain.imageList.AddIcon(this->hInstance, IDI_PRINT); toolbMain.imageList.AddIcon(this->hInstance, IDI_MSEXCEL); toolbMain.imageList.AddIcon(this->hInstance, IDI_USERZ); toolbMain.imageList.AddIcon(this->hInstance, IDI_FIVE); toolbMain.SendMessage(TB_BUTTONSTRUCTSIZE, (WPARAM)(int)sizeof(TBBUTTON), 0); toolbMain.SetImageList(toolbMain.imageList); //_____________________________________ tbButton[0].iBitmap=MAKELONG(0, 0); //<< IMAGE INDEX tbButton[0].idCommand=IDM_SAVE; tbButton[0].fsState=TBSTATE_ENABLED; // | TBSTATE_WRAP tbButton[0].fsStyle=BTNS_BUTTON; tbButton[0].dwData=0L; tbButton[0].iString= (LONG_PTR)L"Save"; //_____________________________________ tbButton[1].iBitmap=MAKELONG(1, 0); //<< IMAGE INDEX tbButton[1].idCommand=IDM_COPY; tbButton[1].fsState=TBSTATE_ENABLED; // | TBSTATE_WRAP tbButton[1].fsStyle=BTNS_BUTTON; tbButton[1].dwData=0L; tbButton[1].iString= (LONG_PTR)L"Copy"; //________________________ A separator tbButton[2].iBitmap=-1; tbButton[2].idCommand=0; tbButton[2].fsState=TBSTATE_ENABLED; // | TBSTATE_WRAP tbButton[2].fsStyle=BTNS_SEP; tbButton[2].dwData=0L; tbButton[2].iString=0; //_____________________________________ tbButton[3].iBitmap=MAKELONG(2, 0); //<< IMAGE INDEX tbButton[3].idCommand=IDM_INSERT; tbButton[3].fsState=TBSTATE_ENABLED; // | TBSTATE_WRAP tbButton[3].fsStyle=BTNS_BUTTON; tbButton[3].dwData=0L; tbButton[3].iString= (LONG_PTR)L"Add"; //_____________________________________ tbButton[4].iBitmap=MAKELONG(3, 0); //<< IMAGE INDEX tbButton[4].idCommand=IDM_EDIT; tbButton[4].fsState=TBSTATE_ENABLED; // | TBSTATE_WRAP tbButton[4].fsStyle=BTNS_BUTTON; tbButton[4].dwData=0L; tbButton[4].iString= (LONG_PTR)L"Edit"; //_____________________________________ tbButton[5].iBitmap=MAKELONG(4, 0); //<< IMAGE INDEX tbButton[5].idCommand=IDM_DELETE; tbButton[5].fsState=TBSTATE_ENABLED; // | TBSTATE_WRAP tbButton[5].fsStyle=BTNS_BUTTON; tbButton[5].dwData=0L; tbButton[5].iString= (LONG_PTR)L"Delete"; //________________________ A separator tbButton[6].iBitmap=-1; tbButton[6].idCommand=0; tbButton[6].fsState=TBSTATE_ENABLED; // | TBSTATE_WRAP tbButton[6].fsStyle=BTNS_SEP; tbButton[6].dwData=0L; tbButton[6].iString=0; //_____________________________________ tbButton[7].iBitmap=MAKELONG(5, 0); //<< IMAGE INDEX tbButton[7].idCommand=IDM_PRINT; tbButton[7].fsState=TBSTATE_ENABLED; // | TBSTATE_WRAP tbButton[7].fsStyle=BTNS_BUTTON; tbButton[7].dwData=0L; tbButton[7].iString= (LONG_PTR)L"Print"; //_____________________________________ tbButton[8].iBitmap=MAKELONG(6, 0); //<< IMAGE INDEX tbButton[8].idCommand=IDM_MSEXCEL; tbButton[8].fsState=TBSTATE_ENABLED; // | TBSTATE_WRAP tbButton[8].fsStyle=BTNS_BUTTON; tbButton[8].dwData=0L; tbButton[8].iString= (LONG_PTR)L"Export to Microsoft Excel"; //________________________ A separator tbButton[9].iBitmap=-1; tbButton[9].idCommand=0; tbButton[9].fsState=TBSTATE_ENABLED; // | TBSTATE_WRAP tbButton[9].fsStyle=BTNS_SEP; tbButton[9].dwData=0L; tbButton[9].iString=0; //_____________________________________ tbButton[10].iBitmap=MAKELONG(7, 0); //<< IMAGE INDEX tbButton[10].idCommand=IDM_USERZ; tbButton[10].fsState=TBSTATE_ENABLED; // | TBSTATE_WRAP tbButton[10].fsStyle=BTNS_BUTTON; tbButton[10].dwData=0L; tbButton[10].iString= (LONG_PTR)L"Select a Patient"; //_____________________________________ tbButton[11].iBitmap=MAKELONG(8, 0); //<< IMAGE INDEX tbButton[11].idCommand=IDM_FIVE; tbButton[11].fsState=TBSTATE_ENABLED; // | TBSTATE_WRAP tbButton[11].fsStyle=BTNS_BUTTON; tbButton[11].dwData=0L; tbButton[11].iString= (LONG_PTR)L"TEMP"; toolbMain.SetBitmapSize(20, 20); toolbMain.SetButtonSize(24, 22); toolbMain.AddButtons(tbButton, 12);// << EDIT HERE THE NUMBER OF BUTTONS toolbMain.SendMessage(TB_AUTOSIZE, 0, 0); toolbMain.SetMaxTextRows(0);// EDIT HERE TO DISPLAY THE BUTTON TEXT toolbMain.Show(SW_SHOWNORMAL); enableButtons(); fillTabSelection(); //____________________________________________________Tooth Setup wchar_t text[64]; for(unsigned int i=0; i<TOOTH_COUNT; i++) { tooth[i]->IsUpper= (i<16); _snwprintf_s(text, 64, _TRUNCATE, L"%d", i+1); tooth[i]->ToothCode= text; tooth[i]->Visible= false; } }
void OrderDialog::slotEnableButtonsAfterDnD() { enableButtons(m_ui->pageList->currentRow()); }
VOID resizePDF(VOID *hwnd) { HAB habT; HMQ hmqT; CHAR errMsg1[80]; CHAR sizeStr[15]; ULONG totalSpace, allocated, available; ULONG drvNum, drvNumOrg, ulDriveMap; struct find_t ffblk; struct Smp { SHORT indx; CHAR noteName[NAMESIZE]; }tplate; habT = WinInitialize(0); hmqT = WinCreateMsgQueue(habT, 0); WinCancelShutdown(hmqT, TRUE); subClassWin(); disableButtons(); /* WinEnableMenuItem(hwndMenu, ID_MISC , FALSE); WinEnableMenuItem(hwndMenu, ID_OPTIONS , FALSE); WinEnableMenuItem(hwndMenu, ID_HELPME , FALSE); WinEnableMenuItem(hwndMenu, ID_SETMODULES , FALSE); WinEnableMenuItem(WinWindowFromID(hwndFrame, FID_SYSMENU), SC_CLOSE , FALSE); */ _dos_findfirst(datFile, _A_NORMAL, &ffblk); DosQueryCurrentDisk(&drvNumOrg, &ulDriveMap); drvNum = pdf[0].noteText[0] - '@'; DosSetDefaultDisk(drvNum); QueryDiskSpace (drvNum, &totalSpace, &allocated, &available); if( ((ffblk.size*2)+44000) >= available ) { strcpy(errMsg1, "You need at least "); ultoa((ffblk.size*2)+44000, sizeStr, 10); strcat(errMsg1, sizeStr); strcat(errMsg1, " bytes free and possibly more to resize this file."); WinMessageBox(HWND_DESKTOP, (HWND)hwnd, errMsg1, "Not enough disk space to accomplish task!", 0, MB_ICONEXCLAMATION | MB_OK); } else { INT LRECSIZE; INT xx, i; FILE *rHan, *hanTMP; div_t dvt; INT origFL; origFL = FIXEDLEN; rHan = fopen(datFile, MRW); fseek(rHan, 0L, SEEK_SET); fread(&recIndex, sizeof(recIndex), 1, rHan); xx = WinQueryLboxCount(WinWindowFromID((HWND)hwnd, ID_LISTBOX1)); LRECSIZE = 0; for(i=0;i<xx;i++) { fread(&tplate, sizeof(tplate), 1, rHan); fread(&dataRecs.noteText, FIXEDLEN, 1, rHan); if( strlen(dataRecs.noteText) > LRECSIZE ) LRECSIZE = strlen(dataRecs.noteText); } fclose(rHan); if( LRECSIZE < 1000 ) sModSize = 1; if( LRECSIZE > 28999 ) sModSize = 30; if( (LRECSIZE > 999) && (LRECSIZE < 29000) ) { dvt = div(LRECSIZE, 1000); if( dvt.rem == 0 ) sModSize = dvt.quot; else sModSize = dvt.quot + 1; } if( newSizePrompt((HWND)hwnd) ) { rHan = fopen(datFile, MRW); fseek(rHan, 0L, SEEK_SET); fread(&recIndex, sizeof(recIndex), 1, rHan); recIndex[0].alIndex = sModSize; hanTMP = fopen("TMP$$$$$.PDF", "w+b" ); fwrite(&recIndex, sizeof(recIndex), 1, hanTMP); for(i=0;i<xx;i++) { fread(&tplate, sizeof(tplate), 1, rHan); fread(&dataRecs.noteText, FIXEDLEN, 1, rHan); fwrite(&tplate, sizeof(tplate), 1, hanTMP); fwrite(&dataRecs.noteText, sModSize, 1, hanTMP); } fclose(rHan); fclose(hanTMP); if( rename(datFile, "X$X$$$$$.PDF") != 0 ) { FIXEDLEN = origFL; recIndex[0].alIndex = FIXEDLEN; sModSize = FIXEDLEN; } if( rename("TMP$$$$$.PDF", datFile) != 0 ) { FIXEDLEN = origFL; recIndex[0].alIndex = FIXEDLEN; rename("X$X$$$$$.PDF", datFile); sModSize = FIXEDLEN; } remove("X$X$$$$$.PDF"); FIXEDLEN = sModSize; initLoad(WinWindowFromID((HWND)hwnd, ID_LISTBOX1), datFile); setStatus((HWND)hwnd, datFile); WinPostMsg(WinWindowFromID((HWND)hwnd, ID_LISTBOX1), LM_SELECTITEM, MPFROMSHORT(0), MPFROMSHORT(TRUE)); } } DosSetDefaultDisk(drvNumOrg); enableButtons(); unSubClassWin(); /* WinEnableMenuItem(hwndMenu, ID_OPTIONS , TRUE); WinEnableMenuItem(hwndMenu, ID_HELPME , TRUE); WinEnableMenuItem(hwndMenu, ID_MISC , TRUE); WinEnableMenuItem(hwndMenu, ID_SETMODULES , TRUE); WinEnableMenuItem(WinWindowFromID(hwndFrame, FID_SYSMENU), SC_CLOSE , TRUE); */ WinDestroyMsgQueue(hmqT); WinTerminate(habT); _endthread(); }
void IntervalEditImpl::slotAddIntervalClicked() { new IntervalItem(intervalList, startTime->time(), (int)(length->value() * 1000. * 60. *60.) ); enableButtons(); emit changed(); }
void WBSDStartPage::gotMessage(Message aMsg){ if(IsBakMode) return; float vermcb; Message::qtype atype=aMsg.getType(); switch (atype){ case (Message::METADATA_ANSWER): { StringMessage sm(aMsg); QList <QString> al=sm.getList(); QList <QString> a2=al.at(1).split(":"); vermcb = a2.at(1).toDouble(); qDebug()<<"vermcb"<<vermcb; //panduan vermcb >=0.86 if(vermcb-0.85999999 >=0.001) { //ok //enableButtons(true); }else { /* int reply= QMessageBox::question(this,"The machine firmware is not the latest version !","Please press Cancel and first Update the latest version with the service key,\nsee http://www.cafitessesupport.com! \nWhen update not possible,press OK to start lower compact WBSD version.","OK","Cancle"); qDebug()<<"reply="<<reply; if(reply == 1) { qApp->quit(); } else if(reply == 0) { QProcess *ps = new QProcess(); ps->start(".\\WBSD085\\WBSD_Excellence_Compact.exe"); qApp->quit(); } */ //********************************************** int reply= QMessageBox::question(this,"The machine firmware is not the latest version !","When update is possible, please follow the next steps:\n 1. Press \"Backup\" to save the current customer settings \n 2. Update to the latest SW version with the service USB key (see http://www.cafitessesupport.com) \n 3. After the update is completed, restore the customer settings with the Compact PC_Tool.\n\n\nWhen update is not possible, press OK to start a compatible WBSD version. \nOtherwise press Cancel. ","OK","Backup","Cancel"); qDebug()<<"reply="<<reply; if(reply == 2) { qApp->quit(); } else if(reply == 0) { system(".\\myatu.bat"); }else if(reply == 1) { //backup the machine info IsBakMode = true; enableButtons(false); ui->btnlan->setEnabled(true); } //******************************/ } } break; } }
void PlayList::slotClear() { m_listView->clear(); enableButtons(0); }
void WBSDStartPage::connectionStatusChanged(int aStatus,StringMessage aMSG){ qDebug() << "WBSDStartPage::connectionStatusChanged Status:" << aStatus; static int currentState = CON_SHOW_INIT; if ((aStatus == wbsd_SERIAL_PORT::CS_CONNECTING)&& currentState != CON_SHOW_CONNECT){ enableButtons(false); itsBaseWindow->showConnectionStatus(CON_SHOW_CONNECT); currentState = CON_SHOW_CONNECT; ui->connStatusText->setText(Application::translate("startpage_conn_status",connecting_start[1])); ui->connStatusInd->setStyleSheet("background:rgb(200,200,0)"); } else if ((aStatus == wbsd_SERIAL_PORT::CS_LOCALESB)&& currentState != CON_SHOW_NONE) { //get version Message msg; msg.msg[0]=0x02; msg.msg[1]=0xb7; msg.msg[2]=0xa1; msg.msg[3]=0x60; msg.msg[4]=0x00; msg.msg[5]=0x00; msg.msg[6]=0x00; msg.msg[7]=0x00; itsBaseWindow->addMessageToQue(msg); if(DataBaseHelper::getInstance()->getMachineState() == 0) { if(wbsd_SERIAL_PORT::instance()->theConnectionStatus == 20 && DataBaseHelper::getInstance()->getlast()==1) { ParameterMsg msg1(Message::MCB,Message::DP,0,Message::SET_PARAMETER); msg1.setBit(15,1); wbsd_SERIAL_PORT::instance()->addMessageToQue(msg1); ParameterMsg query1(Message::MCB,Message::DP, 4, Message::SET_PARAMETER); query1.setNibble(3,2); wbsd_SERIAL_PORT::instance()->addMessageToQue(query1); ParameterMsg query2(Message::MCB,Message::DP, 4, Message::SET_PARAMETER); query2.setNibble(2,1); wbsd_SERIAL_PORT::instance()->addMessageToQue(query2); } } else { if(wbsd_SERIAL_PORT::instance()->theConnectionStatus == 20 && DataBaseHelper::getInstance()->getlast()==0) { ParameterMsg msg1(Message::MCB,Message::DP,0,Message::SET_PARAMETER); msg1.setBit(15,0); wbsd_SERIAL_PORT::instance()->addMessageToQue(msg1); ParameterMsg query1(Message::MCB,Message::DP, 4, Message::SET_PARAMETER); query1.setNibble(3,1); wbsd_SERIAL_PORT::instance()->addMessageToQue(query1); ParameterMsg query2(Message::MCB,Message::DP, 4, Message::SET_PARAMETER); query2.setNibble(2,3); wbsd_SERIAL_PORT::instance()->addMessageToQue(query2); } } enableButtons(true); itsBaseWindow->showConnectionStatus(CON_SHOW_NONE); currentState = CON_SHOW_NONE; ui->connStatusText->setText(Application::translate("startpage_conn_status",connecting_start[2])); ui->connStatusInd->setStyleSheet("background:rgb(0,200,0)"); } else if ((aStatus == wbsd_SERIAL_PORT::CS_DISCONNECTED) && currentState != CON_SHOW_OVERVIEW) { enableButtons(false); itsBaseWindow->showConnectionStatus(CON_SHOW_OVERVIEW); currentState = CON_SHOW_OVERVIEW; ui->connStatusText->setText(Application::translate("startpage_conn_status",connecting_start[0])); ui->connStatusInd->setStyleSheet("background:rgb(200,0,0)"); } // else if ((aStatus == wbsd_SERIAL_PORT::PING_TIMEOUT) && currentState != CON_SHOW_OVERVIEW) { // enableButtons(false); // itsBaseWindow->showConnectionStatus(CON_SHOW_OVERVIEW); // currentState = CON_SHOW_OVERVIEW; // ui->connStatusText->setText(Application::translate("startpage_conn_status",connecting[0])); // ui->connStatusInd->setStyleSheet("background:rgb(200,0,0)"); // } }
void BranchDialog::checkout() { if (!Core::DocumentManager::saveAllModifiedDocuments()) return; QModelIndex idx = selectedIndex(); const QString currentBranch = m_model->fullName(m_model->currentBranch()); const QString nextBranch = m_model->fullName(idx); const QString popMessageStart = QCoreApplication::applicationName() + QLatin1String(" ") + nextBranch + QLatin1String("-AutoStash "); BranchCheckoutDialog branchCheckoutDialog(this, currentBranch, nextBranch); GitClient *gitClient = GitPlugin::instance()->gitClient(); if (gitClient->gitStatus(m_repository, StatusMode(NoUntracked | NoSubmodules)) != GitClient::StatusChanged) branchCheckoutDialog.foundNoLocalChanges(); QList<Stash> stashes; gitClient->synchronousStashList(m_repository, &stashes); foreach (const Stash &stash, stashes) { if (stash.message.startsWith(popMessageStart)) { branchCheckoutDialog.foundStashForNextBranch(); break; } } if (!branchCheckoutDialog.hasLocalChanges() && !branchCheckoutDialog.hasStashForNextBranch()) { // No local changes and no Auto Stash - no need to open dialog m_model->checkoutBranch(idx); } else if (branchCheckoutDialog.exec() == QDialog::Accepted) { if (branchCheckoutDialog.makeStashOfCurrentBranch()) { if (gitClient->synchronousStash(m_repository, currentBranch + QLatin1String("-AutoStash")).isEmpty()) { return; } } else if (branchCheckoutDialog.moveLocalChangesToNextBranch()) { if (!gitClient->beginStashScope(m_repository, QLatin1String("Checkout"), NoPrompt)) return; } else if (branchCheckoutDialog.discardLocalChanges()) { if (!gitClient->synchronousReset(m_repository)) return; } m_model->checkoutBranch(idx); QString stashName; gitClient->synchronousStashList(m_repository, &stashes); foreach (const Stash &stash, stashes) { if (stash.message.startsWith(popMessageStart)) { stashName = stash.name; break; } } if (branchCheckoutDialog.moveLocalChangesToNextBranch()) gitClient->endStashScope(m_repository); else if (branchCheckoutDialog.popStashOfNextBranch()) gitClient->synchronousStashRestore(m_repository, stashName, true); } enableButtons(); }
void __fastcall TfrmRetrieveMain::CmbAliquotChange(TObject *Sender) { enableButtons(); }
void ColorMapEditor::deleteLevel() { table->removeRow (table->currentRow()); enableButtons(table->currentRow()); updateColorMap(); }
void __fastcall TfrmRetrieveMain::rgDestOrderClick(TObject *Sender) { enableButtons(); }