void ItemBank::update() { vector<string>items; for (vector<Item*>::iterator iter = bank.begin(); iter != bank.end(); iter++) { items = updateItem(items, *iter); } DataStorage* dataStorage = dataStorage->getInstance(); dataStorage->writeToFile(items); return; }
void InputManager::updateTree() { m_tree->clear(); for (quint32 i = 0; i < m_inputMap->universes(); i++) { InputPatch* inputPatch = m_inputMap->patch(i); Q_ASSERT(inputPatch != NULL); QTreeWidgetItem* item = new QTreeWidgetItem(m_tree); updateItem(item, inputPatch, i); } }
void LLNotifications::cancel(LLNotificationPtr pNotif) { if (pNotif == NULL || pNotif->isCancelled()) return; LLNotificationSet::iterator it=mItems.find(pNotif); if (it == mItems.end()) { llerrs << "Attempted to delete nonexistent notification " << pNotif->getName() << llendl; } updateItem(LLSD().with("sigtype", "delete").with("id", pNotif->id()), pNotif); pNotif->cancel(); }
void TableItem::setItem(const Widget::Ptr& widgetPtr, HorizontalAlign align) { if (m_widget != nullptr) remove(m_widget); m_widget = widgetPtr; m_align = align; updateItem(); if (m_widget != nullptr) add(m_widget); }
WSortFilterProxyModel::Item * WSortFilterProxyModel::itemFromSourceIndex(const WModelIndex& sourceParent) const { if (!sourceParent.isValid()) { if (!mappedRootItem_) { Item *result = new Item(sourceParent); mappedRootItem_ = result; updateItem(result); } return mappedRootItem_; } ItemMap::const_iterator i = mappedIndexes_.find(sourceParent); if (i == mappedIndexes_.end()) { Item *result = new Item(sourceParent); mappedIndexes_[sourceParent] = result; updateItem(result); return result; } else return dynamic_cast<Item *>(i->second); }
void KDPluginsListBox::setEnabled( bool state ) { if( state == isEnabled() ) { return; } QListBox::setEnabled( state ); for( uint i=0; i<count(); i++ ) { updateItem( i ); } }
void ColorDialog::loadColors(){ QStringList contents = LUtils::readFile(filepath); for(int i=0; i<ui->tree_color->topLevelItemCount(); i++){ QTreeWidgetItem *it = ui->tree_color->topLevelItem(i); //Get the current value and update the item QStringList fil = contents.filter(it->whatsThis(0)+"="); QString val; for(int i=0; i<fil.length(); i++){ if( fil[i].startsWith(it->whatsThis(0)+"=") ){ val = fil[i]; } } updateItem(it, val.section("=",1,1)); } }
void LLNotifications::add(const LLNotificationPtr pNotif) { if (pNotif == NULL) return; // first see if we already have it -- if so, that's a problem LLNotificationSet::iterator it=mItems.find(pNotif); if (it != mItems.end()) { llerrs << "Notification added a second time to the master notification channel." << llendl; } updateItem(LLSD().with("sigtype", "add").with("id", pNotif->id()), pNotif); }
void SmartListCtrl::thumbManagerUpdate( const std::string& longText ) { if ( !GetSafeHwnd() || longText.empty() ) return; std::string longTextTmp = longText; std::replace( longTextTmp.begin(), longTextTmp.end(), '/', '\\' ); std::string textTmp = longTextTmp.c_str() + longTextTmp.find_last_of( '\\' ) + 1; updateItem( AssetInfo( "", textTmp, longTextTmp ), false /* dont try to remove from cache, it's not there */ ); }
void InternalLink::handleInternalLink(DesuraId id, uint8 action, const std::vector<std::string> &argsList) { if (g_pMainApp->isOffline() && action != ACTION_LAUNCH) return; Args args(argsList); bool handled = true; switch (action) { case ACTION_UPLOAD : uploadMCF( id ); break; case ACTION_CREATE : createMCF( id ); break; case ACTION_RESUPLOAD : resumeUploadMCF( id, args ); break; #ifdef WIN32 case ACTION_INSTALLEDW : installedWizard(); break; #endif case ACTION_SHOWSETTINGS: showSettings(args); break; case ACTION_APPUPDATELOG: showUpdateLogApp( id.getItem() ); break; case ACTION_PAUSE : setPauseItem( id , true ); break; case ACTION_UNPAUSE : setPauseItem( id , false ); break; case ACTION_UNINSTALL : uninstallMCF( id ); break; case ACTION_PROMPT : showPrompt(id, args); break; case ACTION_UPDATELOG : showUpdateLog(id); break; case ACTION_DISPCDKEY : showCDKey(id, args); break; default: handled = false; break; } if (handled || checkForm(id)) return; switch (action) { case ACTION_INSTALL : installItem(id, args); break; case ACTION_LAUNCH : launchItem(id, args); break; case ACTION_VERIFY : verifyItem(id, args); break; case ACTION_UPDATE : updateItem(id, args); break; case ACTION_TEST : installTestMCF(id, args); break; case ACTION_INSCHECK : installCheck(id); break; case ACTION_SHOWUPDATE : showUpdateForm(id, args); break; case ACTION_SWITCHBRANCH: switchBranch(id, args); break; case ACTION_CLEANCOMPLEXMOD: cleanComplexMod(id); break; default: Warning(gcString("Unknown internal link {0} for item {1}\n.", (uint32)action, id.toInt64())); break; } }
void BearerMonitor::configurationAdded(const QNetworkConfiguration &config, QTreeWidgetItem *parent) { QTreeWidgetItem *item = new QTreeWidgetItem; updateItem(item, config); if (parent) parent->addChild(item); else treeWidget->addTopLevelItem(item); if (config.type() == QNetworkConfiguration::ServiceNetwork) { foreach (const QNetworkConfiguration &child, config.children()) configurationAdded(child, item); }
void ModuleTreeView::updateItem(ModuleTreeItem *item, ConfigModule *module) { while (item) { if (item->childCount() != 0) updateItem(static_cast<ModuleTreeItem*>(item->firstChild()), module); if (item->module() == module) { setSelected(item, true); break; } item = static_cast<ModuleTreeItem*>(item->nextSibling()); } }
/** Constructor */ PeerItem::PeerItem(FeedHolder *parent, uint32_t feedId, const std::string &peerId, uint32_t type, bool isHome) :QWidget(NULL), mParent(parent), mFeedId(feedId), mPeerId(peerId), mType(type), mIsHome(isHome) { /* Invoke the Qt Designer generated object setup routine */ setupUi(this); messageframe->setVisible(false); sendmsgButton->setEnabled(false); /* general ones */ connect( expandButton, SIGNAL( clicked( void ) ), this, SLOT( toggle ( void ) ) ); connect( clearButton, SIGNAL( clicked( void ) ), this, SLOT( removeItem ( void ) ) ); /* specific ones */ connect( chatButton, SIGNAL( clicked( void ) ), this, SLOT( openChat ( void ) ) ); connect( actionNew_Message, SIGNAL( triggered( ) ), this, SLOT( sendMsg ( void ) ) ); connect( quickmsgButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) ); connect( cancelButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) ); connect( sendmsgButton, SIGNAL( clicked( ) ), this, SLOT( sendMessage() ) ); connect(NotifyQt::getInstance(), SIGNAL(friendsChanged()), this, SLOT(updateItem())); QMenu *msgmenu = new QMenu(); msgmenu->addAction(actionNew_Message); quickmsgButton->setMenu(msgmenu); avatar->setId(mPeerId, false); expandFrame->hide(); updateItemStatic(); updateItem(); }
/** Constructor */ SecurityItem::SecurityItem(FeedHolder *parent, uint32_t feedId, const RsPgpId &gpgId, const RsPeerId &sslId, const std::string &sslCn, const std::string& ip_address,uint32_t type, bool isHome) : FeedItem(NULL), mParent(parent), mFeedId(feedId), mGpgId(gpgId), mSslId(sslId), mSslCn(sslCn), mIP(ip_address), mType(type), mIsHome(isHome) { /* Invoke the Qt Designer generated object setup routine */ setupUi(this); //quickmsgButton->hide(); chatButton->hide(); removeFriendButton->setEnabled(false); removeFriendButton->hide(); peerDetailsButton->setEnabled(false); friendRequesttoolButton->hide(); requestLabel->hide(); /* general ones */ connect( expandButton, SIGNAL( clicked( void ) ), this, SLOT( toggle ( void ) ) ); connect( clearButton, SIGNAL( clicked( void ) ), this, SLOT( removeItem ( void ) ) ); /* specific ones */ connect( chatButton, SIGNAL( clicked( void ) ), this, SLOT( openChat ( void ) ) ); //connect( quickmsgButton, SIGNAL( clicked( ) ), this, SLOT( sendMsg() ) ); connect( removeFriendButton, SIGNAL(clicked()), this, SLOT(removeFriend())); connect( peerDetailsButton, SIGNAL(clicked()), this, SLOT(peerDetails())); connect( friendRequesttoolButton, SIGNAL(clicked()), this, SLOT(friendRequest())); connect(NotifyQt::getInstance(), SIGNAL(friendsChanged()), this, SLOT(updateItem())); avatar->setId(ChatId(mSslId)); expandFrame->hide(); updateItemStatic(); updateItem(); }
/*! \brief TreeModel::propertyChanged This function is responsible to propagade the changes in the data to the GUI. */ void TreeModel::propertyChanged() { int propCount = QObject::sender()->metaObject()->propertyCount(); int signalIndex = QObject::senderSignalIndex(); for ( int i = 0; i < propCount; ++i ) { QMetaProperty metaProperty = mp_object->metaObject()->property( i ); if ( metaProperty.notifySignalIndex() == signalIndex ) { QStandardItem* item = m_propertyIndexToItemMap.value( i ); updateItem( item, mp_object, metaProperty ); return; } } }
BOOL LLPanelDummyClothingListItem::postBuild() { addWidgetToRightSide("btn_add_panel"); setIconImage(LLInventoryIcon::getIcon(LLAssetType::AT_CLOTHING, LLInventoryType::IT_NONE, mWearableType, FALSE)); updateItem(wearableTypeToString(mWearableType)); // Make it look loke clothing item - reserve space for 'delete' button setLeftWidgetsWidth(getChildView("item_icon")->getRect().mLeft); setWidgetsVisible(false); reshapeWidgets(); return TRUE; }
/* PRIVATE FUNCTIONS */ void MenuItem::slotMountClicked(){ //Hide the parent menu emit itemWorking(); //Now if( isConnected() ){ if( !isMounted() ){ mountItem(); }else{ unmountItem(); } }else{ emit itemRemoved(device); } updateItem(); }
BOOL LLPanelInventoryListItemBase::postBuild() { LLViewerInventoryItem* inv_item = getItem(); if (inv_item) { mIconImage = LLInventoryIcon::getIcon(inv_item->getType(), inv_item->getInventoryType(), inv_item->getFlags(), FALSE); updateItem(inv_item->getName()); } setNeedsRefresh(true); setWidgetsVisible(false); reshapeWidgets(); return TRUE; }
QListWidgetItem *PawnConverter::pawnToItem(const Pawn &pawn) { if (pawn.isNull()) { postError("Can't convert pawn to item: pawn is null"); return nullptr; } QListWidgetItem *item = new QListWidgetItem(); if (!updateItem(item, pawn)) return nullptr; postSuccess(QString("Convertion Pawn %1 to item have been successfull").arg(pawn.name())); return item; }
void PropertyTableModel::changeProperty(const core::property_t& pr) { for (size_t i = 0; i < data_.size(); ++i) { PropertyTableItem* it = dynamic_cast<PropertyTableItem*>(data_[i]); // + if (!it) { continue; } core::property_t prop = it->property(); if (prop.first == pr.first) { it->setProperty(pr); updateItem(index(i, PropertyTableItem::eKey, QModelIndex()), index(i, PropertyTableItem::eValue, QModelIndex())); return; } } }
void ControlManagerImpl::setControlSize(int size, bool force) { if ((size < 1) || (size > 7)) { g_warning("Illegal logical size set: %d", size); } else if (force || (size != _size)) { _size = size; for (std::vector<SPCanvasItem *>::iterator it = _itemList.begin(); it != _itemList.end(); ++it) { if (*it) { updateItem(*it); } } _sizeChangedSignal.emit(); } }
void CheatEditorWindow::textEdited() { QList<QTreeWidgetItem*> items = list->selectedItems(); if(items.count() > 0) { QTreeWidgetItem *item = items[0]; unsigned n = item->data(0, Qt::UserRole).toUInt(); string scode = codeEdit->text().toUtf8().data(); string sdesc = descEdit->text().toUtf8().data(); SNES::Cheat::cheat_t code; SNES::cheat.get(n, code); SNES::cheat.edit(n, code.enabled, scode, sdesc); updateItem(item); syncUi(); } }
void KonqCombo::setTemporary( const QString& url, const QPixmap& pix ) { //kDebug() << url << "temporary=" << temporary; // Insert a temporary item when we don't have one yet if ( count() == 0 ) insertItem( pix, url, temporary, titleOfURL( url ) ); else { if (url != temporaryItem()) applyPermanent(); updateItem( pix, url, temporary, titleOfURL( url ) ); } setCurrentIndex( temporary ); }
void QtGroupBoxPropertyBrowserPrivate::slotUpdate() { QListIterator<WidgetItem *> itItem(m_recreateQueue); while (itItem.hasNext()) { WidgetItem *item = itItem.next(); WidgetItem *par = item->parent; QWidget *w = 0; QGridLayout *l = 0; int oldRow = -1; if (!par) { w = q_ptr; l = m_mainLayout; oldRow = m_children.indexOf(item); } else { w = par->groupBox; l = par->layout; oldRow = par->children.indexOf(item); if (hasHeader(par)) oldRow += 2; } if (item->widget) { item->widget->setParent(w); } else if (item->widgetLabel) { item->widgetLabel->setParent(w); } else { item->widgetLabel = new QLabel(w); item->widgetLabel->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed)); item->widgetLabel->setTextFormat(Qt::PlainText); } int span = 1; if (item->widget) l->addWidget(item->widget, oldRow, 1, 1, 1); else if (item->widgetLabel) l->addWidget(item->widgetLabel, oldRow, 1, 1, 1); else span = 2; item->label = new QLabel(w); item->label->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); l->addWidget(item->label, oldRow, 0, 1, span); updateItem(item); } m_recreateQueue.clear(); }
void UatDialog::updateItems() { if (!uat_) return; // Forcibly sync ui->uaTreeWidget with uat_. // It would probably be more correct to create a UatModel and // use it in conjunction with a QTreeView. while (ui->uatTreeWidget->topLevelItemCount() > (int) uat_->raw_data->len) { delete (ui->uatTreeWidget->topLevelItem(0)); } for (guint row = 0; row < uat_->raw_data->len; row++) { QTreeWidgetItem *item = ui->uatTreeWidget->topLevelItem(row); if (!item) item = new QTreeWidgetItem(ui->uatTreeWidget); item->setData(0, Qt::UserRole, qVariantFromValue(row)); updateItem(*item); } }
void ProgressTree2::monitoredJobChanged(Job* state) { time_t now; time(&now); monitoredJobLastChanged = now; QTreeWidgetItem* item = findItem(state, true); if (item) updateItem(item, state); if (state->isCompleted()) { if (item) { setItemWidget(item, 4, 0); } } }
void TodoView::newTodo() { QString tmpStr; KDPEvent *newEvent; newEvent = new KDPEvent; newEvent->setStatus(QString("NEEDS ACTION")); newEvent->setPriority(1); calendar->addTodo(newEvent); tmpStr.sprintf("%i\n",newEvent->getEventId()); tmpStr += "EMPTY\n0\n \n "; appendItem(tmpStr.data()); repaint(); setCurrentItem(numRows()-1); updateItem(currentItem(), 3); }
void OutputManager::slotEditClicked() { QTreeWidgetItem* item; OutputPatch* patch; int universe; item = m_tree->currentItem(); if (item == NULL) return; universe = item->text(KColumnUniverse).toInt() - 1; patch = _app->outputMap()->patch(universe); Q_ASSERT(patch != NULL); OutputPatchEditor ope(this, universe, patch); if (ope.exec() == QDialog::Accepted) updateItem(item, patch, universe); }
bool GxsChannelPostItem::setPost(const RsGxsChannelPost &post, bool doFill) { if (groupId() != post.mMeta.mGroupId || messageId() != post.mMeta.mMsgId) { std::cerr << "GxsChannelPostItem::setPost() - Wrong id, cannot set post"; std::cerr << std::endl; return false; } mPost = post; if (doFill) { fill(); } updateItem(); return true; }
void QGeoTiledMapPixmapObjectInfo::update() { int zoomFactor = tiledMapData->zoomFactor(); QPointF pos = tiledMapData->coordinateToWorldReferencePosition(pixmap->coordinate()); QPointF offset = pixmap->offset(); offset *= zoomFactor; pos += offset; int width = tiledMapData->worldReferenceSize().width(); int x = pos.x(); if (x > width) x -= width; if (x < 0) x += width; pos.setX(x); int rightBound = pos.x() + pixmap->pixmap().width() * zoomFactor; QPointF pos2 = QPointF(-1.0 * static_cast<qreal>(width / zoomFactor), 0); if (rightBound > width ) { if (!pixmapItem2) { pixmapItem2 = new QGraphicsPixmapItem(pixmapItem1); pixmapItem2->setPixmap(pixmap->pixmap()); } } else { if (pixmapItem2) { delete pixmapItem2; pixmapItem2 = 0; } } pixmapItem1->setScale(zoomFactor); pixmapItem1->setPos(pos); if (pixmapItem2) pixmapItem2->setPos(pos2); updateItem(); }