void PackageWidget::setKeep(QApt::Package *package) { saveState(); package->setKeep(); handleBreakage(package); checkChanges(); }
bool OphaalHistoriekDialogSortFilterProxyModel::setData(const QModelIndex & index, const QVariant & value, int role) { bool result = QSortFilterProxyModel::setData(index, value, role); if (role == Qt::CheckStateRole) { emit checkChanges(); } return result; }
void DocumentView::initAlwaysUsedConnections() { connect(buttonBox,SIGNAL(rejected()),controller,SLOT(getDocumentData())); connect(buttonBox, SIGNAL(accepted()), controller,SLOT(checkRequiredFields())); connect(buttonBox, SIGNAL(rejected()), controller, SLOT(checkChanges())); connect(goodsTable,SIGNAL(cellChanged(int,int)),controller,SLOT(editGood(int,int))); connect(buttonGoodAdd, SIGNAL(clicked()), controller, SLOT(selectGoods())); connect(buttonGoodDel,SIGNAL(clicked()),controller,SLOT(removeGood())); }
void OfferView::initConnections() { connect(notConcerns,SIGNAL(toggled(bool)),controller,SLOT(setDateLikeNotConcerns(bool))); connect(chooseGood,SIGNAL(clicked()),controller,SLOT(selectGoods())); connect(buttonBox, SIGNAL(accepted()), controller,SLOT(checkRequiredFields())); connect(buttonBox, SIGNAL(rejected()), controller, SLOT(checkChanges())); connect(deleteGood, SIGNAL(clicked()), controller, SLOT(removeGoodsFromPositions())); connect(selectContractor, SIGNAL(clicked()), controller, SLOT(selectContractor())); connect(priceLevel, SIGNAL(activated(int)), controller, SLOT(initTableModel())); }
void GoodsDialogView::createMenu() { buttonBox = new ButtonBox(this); buttonBox->setGeometry(QRect(430,430,200,20)); context = new QMenu(); context->addAction("Ustaw zdjęcie"); context->addAction("Usuń zdjęcie"); connect (context,SIGNAL(triggered(QAction*)),controller,SLOT(fotoMenuAcces(QAction*))); connect (buttonBox, SIGNAL(accepted()), controller,SLOT(checkRequredFields())); connect (buttonBox, SIGNAL(rejected()), controller, SLOT(checkChanges())); }
void SettingsPageUnits::slotAccept() { if( checkChanges() ) { save(); GeneralConfig::instance()->save(); emit settingsChanged(); } QWidget::close(); }
bool AliasingManager::areAliases(VarDecl *VD1, VarDecl *VD2) { int x; int y; checkChanges(); x = m_indexesMap[VD1]; y = m_indexesMap[VD2]; return m_matricesMap[MK_ClosedMatrix][x][y]; }
void PackageWidget::setInstall(QApt::Package *package) { saveState(); if (!package->availableVersion().isEmpty()) { package->setInstall(); } // Check for/handle breakage handleBreakage(package); checkChanges(); }
void PackageWidget::actOnPackages(QApt::Package::State action) { const QApt::PackageList packages = selectedPackages(); if (packages.isEmpty()) return; QApplication::setOverrideCursor(Qt::WaitCursor); saveState(); m_backend->setCompressEvents(true); m_stop = false; for (QApt::Package *package : packages) { if (m_stop) { m_backend->setCompressEvents(false); QApplication::restoreOverrideCursor(); break; } switch (action) { case QApt::Package::ToInstall: setInstall(package); break; case QApt::Package::ToRemove: setRemove(package); break; case QApt::Package::ToUpgrade: setUpgrade(package); break; case QApt::Package::ToReInstall: if (package->isInstalled()) setReInstall(package); break; case QApt::Package::ToKeep: setKeep(package); break; case QApt::Package::ToPurge: setPurge(package); break; default: break; } } emit packageChanged(); m_backend->setCompressEvents(false); QApplication::restoreOverrideCursor(); checkChanges(); }
void PackageWidget::setPurge(QApt::Package *package) { bool remove = true; if (package->state() & QApt::Package::IsImportant) { remove = confirmEssentialRemoval(); } if (remove) { saveState(); package->setPurge(); handleBreakage(package); checkChanges(); } }
void AliasingManager::unset(VarDecl* VD) { int line; int col; checkChanges(); line = m_indexesMap[VD]; for (col = 0; col < m_dimension; ++col) { if (line != col && m_matricesMap[MK_PointsToMatrix][line][col]) { m_matricesMap[MK_PointsToMatrix][line][col] = false; break; } } m_matrixChanged = true; }
void AliasingManager::alias(VarDecl *lhs, VarDecl *rhs, bool init = false) { int x; int y; checkChanges(); // Error checking if (m_pinfosMap.find(lhs) == m_pinfosMap.end()) llvm_unreachable("error alias(): lhs not found into pmap"); if (m_pinfosMap[lhs]->isAnonymousPointer()) llvm_unreachable("error alias(): lhs is anonymous pointer"); if (m_pinfosMap.find(rhs) == m_pinfosMap.end()) llvm_unreachable("error alias(): rhs not found into pmap"); // Getting lhs index x = m_indexesMap[lhs]; // If this is not initialization of lhs... if (!init) { if (areAliases(lhs, rhs)) return; else m_pinfosMap[lhs]->setNonConst(); } // Unset current matrix configuration for lhs unset(lhs); // Getting target of rhs if it's a declared pointer if (!m_pinfosMap[rhs]->isAnonymousPointer() && !m_pinfosMap[rhs]->isParmVar()) rhs = m_pinfosMap[rhs]->getTarget(); // Getting rhs indexes y = m_indexesMap[rhs]; // Changing matrix configuration m_matricesMap[MK_PointsToMatrix][x][y] = true; m_matrixChanged = true; // Setting lhs new target m_pinfosMap[lhs]->setTarget(rhs); }
void RouteView::updateRouteView() { //SQL sql; mainWindow* myParent = qobject_cast<mainWindow*>(m_parent); TerminalInfo ti = SQL::instance()->getTerminalInfo(myParent->m_routeNbr, myParent->m_routeName, myParent->m_currRouteEndDate); startSegment = ti.startSegment; endSegment = ti.endSegment; // Check for uncomitted changes checkChanges(); route = myParent->m_routeNbr; name = myParent->m_routeName; startDate = myParent->m_currRouteStartDate; endDate = myParent->m_currRouteEndDate; alphaRoute = myParent->m_alphaRoute; segmentInfoList = SQL::instance()->getRouteSegmentsInOrder2(route, name, endDate); qDebug()<<"checkRoute: "+alphaRoute + " '"+name+"' "+endDate; chk = new checkRoute(segmentInfoList, config, this); chk->setStart(startSegment); chk->setEnd(endSegment); bIsSequenced = chk->setSeqNbrs(); if(segmentInfoList.count()== 0) return; #if 0 bIsSequenced = true; for(int i=0; i <segmentInfoList.count(); i++) { segmentInfo si = segmentInfoList.at(i); if(si.next < 1 && si.prev < 1 ) { bIsSequenced=false; break; } } if(bIsSequenced && ti.startSegment > 0) { // assign sequence numbers bool bWorking = true; qint32 nextSequence = ti.startSegment; qint32 currSeq = -1; int i=0; while(bWorking) { for( i=0; i < segmentInfoList.count(); i ++) { segmentInfo * si = (segmentInfo*)&segmentInfoList.at(i); if(segmentInfoList.at(i).SegmentId == nextSequence) { nextSequence = segmentInfoList.at(i).next; si->sequence = ++currSeq; //if(segmentInfoList.at(i).SegmentId == ti.endSegment) if(si->SegmentId == ti.endSegment) { bWorking = false; } break; } } if(i >= segmentInfoList.count()) break; if(currSeq > segmentInfoList.count()) break; } nextSequence = ti.endSegment; currSeq = -1; bWorking = true; while(bWorking) { for( i=0; i < segmentInfoList.count(); i ++) { segmentInfo * si = (segmentInfo*)&segmentInfoList.at(i); if(segmentInfoList.at(i).SegmentId == nextSequence) { nextSequence = segmentInfoList.at(i).prev; si->returnSeq = ++currSeq; //if(segmentInfoList.at(i).SegmentId == ti.startSegment) if(si->SegmentId == ti.startSegment) { bWorking = false; } break; } } if(i >= segmentInfoList.count()) break; if(currSeq > segmentInfoList.count()) break; } } #endif ui->setSortingEnabled(false); sourceModel = new RouteViewTableModel(route, name, QDate::fromString(startDate, "yyyy/MM/dd"), QDate::fromString(endDate, "yyyy/MM/dd"), segmentInfoList); //saveSegmentInfoList = segmentInfoList; // added 5/6/2012 ack //connect(saveChangesAct, SIGNAL(triggered()), sourceModel, SLOT(commitChanges())); connect(saveChangesAct, SIGNAL(triggered(bool)), this, SLOT(commitChanges())); saveSegmentInfoList.clear(); foreach(SegmentInfo si, segmentInfoList) saveSegmentInfoList.append(si); sourceModel->setSequenced(bIsSequenced); //routeViewFilterProxyModel* filterProxy = new routeViewFilterProxyModel(this); //routeViewSortProxyModel *proxyModel= new routeViewSortProxyModel(this); //filterProxy->setTerminals(startRow, endRow); //filterProxy->setSourceModel(sourceModel); myParent->proxyModel->setSourceModel(sourceModel); // get the row of the start segment and the end segment int numRows = sourceModel->rowCount(QModelIndex()); qint32 startRow =-1, endRow = -1; ti = SQL::instance()->getTerminalInfo(route,name, endDate); for(int i = 0; i < numRows; i++) { if(ui->isRowHidden(i)) continue; int segmentId = sourceModel->index(i, RouteViewTableModel::SEGMENTID).data(Qt::DisplayRole).toInt(); if(segmentId == ti.startSegment) startRow = i; if(segmentId == ti.endSegment) endRow = i; } if(startRow != -1 && endRow != -1) emit sendRows (startRow, endRow); //proxyModel->setTerminals(startRow, endRow); ui->setModel(myParent->proxyModel); ui->setSortingEnabled(true); ui->horizontalHeader()->setStretchLastSection(false); ui->horizontalHeader()->resizeSection(0,40); ui->horizontalHeader()->resizeSection(2,35); ui->horizontalHeader()->resizeSection(3,35); ui->horizontalHeader()->resizeSection(4,35); ui->horizontalHeader()->resizeSection(5,35); ui->horizontalHeader()->resizeSection(6,35); ui->horizontalHeader()->resizeSection(7,35); ui->horizontalHeader()->resizeSection(8,65); ui->horizontalHeader()->resizeSection(9,65); //populateList(); }