void XMLProc::createNew(){ xmlItem i; xml.setContent(QString("<?xml version = '1.0' encoding = 'UTF-8'?>\n")); //setModified( true ); xml.appendChild( xml.implementation().createDocumentType("Конфигурация",QString::null,"")); rootnode = xml.createElement( md_root ); xml.appendChild( rootnode ); rootnode = xml.documentElement(); cfginfo = insert( rootnode, md_info, QString::null, -1 ); iface = insert( rootnode, md_interface, QString::null, -1 ); md = insert( rootnode, md_metadata, QString::null, -1 ); actions = insert( rootnode, md_actions, QString::null, -1 ); init(); setInfo( md_info_name, "Новая конфигурация" ); setInfo( md_info_lastid, "0" ); setInfo( md_info_author, "NetWorm" ); setInfo( md_info_date, QDateTime::currentDateTime().date().toString(Qt::ISODate) ); //setInfo( md_info_dir, "newConfig" ); insert( md, md_globals, QString::null, -1 ); insert( md, md_spravochniki, QString::null, -1 ); insert( md, md_documents, QString::null, -1 ); insert( md, md_journals, QString::null, -1 ); i = insert( md, md_registers, QString::null, -1 ); insert( i, md_iregisters, QString::null, -1 ); insert( i, md_aregisters, QString::null, -1 ); SetModify(true); }
///Connect Signals and Slots only relevant for the graphical interface void gui_connections(Graphical_UI* gui, GraphManager* graph_mgr, OpenNIListener* listener) { QObject::connect(listener, SIGNAL(newVisualImage(QImage)), gui, SLOT(setVisualImage(QImage))); QObject::connect(listener, SIGNAL(newFeatureFlowImage(QImage)), gui, SLOT(setFeatureFlowImage(QImage))); QObject::connect(listener, SIGNAL(newDepthImage(QImage)), gui, SLOT(setDepthImage(QImage))); QObject::connect(graph_mgr, SIGNAL(sendFinished()), gui, SLOT(sendFinished())); QObject::connect(graph_mgr, SIGNAL(iamBusy(int, const char*, int)), gui, SLOT(showBusy(int, const char*, int))); QObject::connect(graph_mgr, SIGNAL(progress(int, const char*, int)), gui, SLOT(setBusy(int, const char*, int))); QObject::connect(graph_mgr, SIGNAL(setGUIInfo(QString)), gui, SLOT(setInfo(QString))); QObject::connect(graph_mgr, SIGNAL(setGUIStatus(QString)), gui, SLOT(setStatus(QString))); QObject::connect(gui, SIGNAL(printEdgeErrors(QString)), graph_mgr, SLOT(printEdgeErrors(QString))); QObject::connect(gui, SIGNAL(pruneEdgesWithErrorAbove(float)), graph_mgr, SLOT(pruneEdgesWithErrorAbove(float))); QObject::connect(gui, SIGNAL(clearClouds()), graph_mgr, SLOT(clearPointClouds())); if (ParameterServer::instance()->get<bool>("use_glwidget") && gui->getGLViewer() != NULL) { GLViewer* glv = gui->getGLViewer(); QObject::connect(graph_mgr, SIGNAL(setPointCloud(pointcloud_type *, QMatrix4x4)), glv, SLOT(addPointCloud(pointcloud_type *, QMatrix4x4)), Qt::BlockingQueuedConnection ); //Needs to block, otherwise the opengl list compilation makes the app unresponsive. This effectively throttles the processing rate though typedef const std::vector<Eigen::Vector4f, Eigen::aligned_allocator<Eigen::Vector4f> >* cnst_ft_vectors; QObject::connect(graph_mgr, SIGNAL(setFeatures(const std::vector<Eigen::Vector4f, Eigen::aligned_allocator<Eigen::Vector4f> >*)), glv, SLOT(addFeatures(const std::vector<Eigen::Vector4f, Eigen::aligned_allocator<Eigen::Vector4f> >*))); //, Qt::DirectConnection); QObject::connect(graph_mgr, SIGNAL(setGraphEdges(const QList<QPair<int, int> >*)), glv, SLOT(setEdges(const QList<QPair<int, int> >*))); QObject::connect(graph_mgr, SIGNAL(updateTransforms(QList<QMatrix4x4>*)), glv, SLOT(updateTransforms(QList<QMatrix4x4>*))); QObject::connect(graph_mgr, SIGNAL(deleteLastNode()), glv, SLOT(deleteLastNode())); QObject::connect(graph_mgr, SIGNAL(resetGLViewer()), glv, SLOT(reset())); if(!ParameterServer::instance()->get<bool>("store_pointclouds")) { QObject::connect(glv, SIGNAL(cloudRendered(pointcloud_type const *)), graph_mgr, SLOT(clearPointCloud(pointcloud_type const *))); // } else if(ParameterServer::instance()->get<double>("voxelfilter_size") > 0.0) { QObject::connect(glv, SIGNAL(cloudRendered(pointcloud_type const *)), graph_mgr, SLOT(reducePointCloud(pointcloud_type const *))); // } } QObject::connect(listener, SIGNAL(setGUIInfo(QString)), gui, SLOT(setInfo(QString))); QObject::connect(listener, SIGNAL(setGUIStatus(QString)), gui, SLOT(setStatus(QString))); QObject::connect(graph_mgr, SIGNAL(setGUIInfo2(QString)), gui, SLOT(setInfo2(QString))); }
bool LatexLogWidget::loadLogFile(const QString &logname, const QString & compiledFileName){ resetLog(); QFileInfo fi(logname); if (logname.isEmpty() || !fi.exists()) { setInfo(tr("Log file not found.")); return false; } if (!fi.isReadable()) { setInfo(tr("Log file not readable.")); return false; } QFile f(logname); if (f.open(QIODevice::ReadOnly)) { double fileSizeLimitMB = ConfigManagerInterface::getInstance()->getOption("LogView/WarnIfFileSizeLargerMB").toDouble(); if (f.size() > fileSizeLimitMB*1024*1024 && !txsConfirmWarning(tr("The logfile is very large (%1 MB) are you sure you want to load it?").arg(double(f.size()) / 1024 / 1024, 0, 'f', 2))) return false; //QByteArray fullLog = simplifyLineConserving(f.readAll()); // TODO: if we want to have simplification here it has to be smarter. // The above version trims whitespace, which leads to undesired effects due to the 80 char // line width of the log. "line\n 1" would become "\line\n1" and, when rejoining lines for error/warning detection "line1". // Do we need this or can we just leave the output as it is? QByteArray fullLog = f.readAll(); f.close(); int sure; QTextCodec * codec = guessEncodingBasic(fullLog, &sure); if (!sure || !codec) codec = QTextCodec::codecForLocale(); log->setPlainText(codec->toUnicode(fullLog)); logModel->parseLogDocument(log->document(), compiledFileName); logpresent=true; // workaround to https://sourceforge.net/p/texstudio/feature-requests/622/ // There seems to be a bug in Qt (4.8.4) that resizeRowsToContents() does not work correctly if // horizontalHeader()->setStretchLastSection(true) and the tableView has not yet been shown // when iterating through the columns to determine the maximal height, everything is fine // until the last column. There the calculated height is too large. // As a workaround we will temporarily deactivate column stretching. // Note: To reproduce, you can call the viewer via The ViewLog button. When showing the viewer // by clicking the ViewTab, the widget is shown before loading (so there the bug did not appear.) bool visible = errorTable->isVisible(); if (!visible) errorTable->horizontalHeader()->setStretchLastSection(false); errorTable->resizeColumnsToContents(); errorTable->resizeRowsToContents(); if (!visible) errorTable->horizontalHeader()->setStretchLastSection(true); selectLogEntry(0); emit logLoaded(); return true; } setInfo(tr("Log file not readable.")); return false; }
virtual void update() { if (m_app->indexer()->isIndexing()) { char count[100]; sprintf(count, "Files: %d", m_app->indexer()->indexCount()); setInfo(count, "Stop Scan"); } else { if (strcmp(m_label, "Scan Media")) setInfo("", "Scan Media"); } }
void Server::setInfo(std::string key, std::string type, std::string value) { if (type.compare("int") == 0) { setInfo(key, atoi(value.c_str())); } else if (type.compare("long long") == 0) { setInfo(key, atoll(value.c_str())); } else if (type.compare("double") == 0) { setInfo(key, atof(value.c_str())); } else if (type.compare("string") == 0) { setInfo(key, value); } }
/** * Unreal Command Handler for "JOIN" - Constructor. * * @param mptr Module pointer */ UnrealCH_join::UnrealCH_join(UnrealModule* mptr) { setInfo(&mptr->inf); /* allocate additional contents */ command_ = new UnrealUserCommand(CMD_JOIN, &UnrealCH_join::exec); }
// ============================= // Test Funtion // ============================= void AStarTest::testAStar() { setInfo("testAStar"); m_gridLayer->testAstar(); }
void LocalSong::readList(const QString &fName) { QString fileName = QString("%1.xml").arg(fName); QFile file(fileName); if (false==file.open(QFile::ReadOnly | QFile::Text)) { return; } QXmlStreamReader reader; reader.setDevice(&file); songlist.clear();//清空歌曲路径列表 while (false==reader.atEnd()) { reader.readNext(); if (reader.isStartElement()) { if (reader.name() == "path") { QString songPath=reader.readElementText().toUtf8(); addSongList(songPath);//读取列表 setInfo(songPath); } } } qDebug()<<"本地列表读取完成"; unsigned long dirLength=songlist.length(); qDebug()<<"歌曲总数为"<<dirLength; emit dirCount(dirLength); file.close(); }
void LocalSong::addDir() { locDir= QFileDialog::getExistingDirectory(this,tr("扫描本地目录"),musicPaths.isEmpty() ? QDir::homePath() : musicPaths.first(),QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); QDir dir(locDir); if(false==dir.exists()) { return; } dir.setFilter(QDir::Files | QDir::NoSymLinks); QFileInfoList list = dir.entryInfoList(); int file_count = list.count(); if(file_count <= 0) { return; } for(int i=0; i<file_count;++i) { QFileInfo file_info = list.at(i); QString suffix = file_info.suffix(); if(QString::compare(suffix, QString("mp3"), Qt::CaseInsensitive) == 0) { QString absolute_file_path = file_info.absoluteFilePath(); addSongList(absolute_file_path); setInfo(absolute_file_path); } } qDebug()<<"已添加整个目录"<<locDir; unsigned long dirLength=songlist.length(); qDebug()<<"歌曲总数为"<<dirLength; emit dirCount(dirLength); }
/** * Unreal Command Handler for "KICK" - Constructor. * * @param mptr Module pointer */ UnrealCH_kick::UnrealCH_kick(UnrealModule* mptr) { setInfo(&mptr->inf); /* allocate additional contents */ command_ = new UnrealUserCommand(CMD_KICK, &UnrealCH_kick::exec); }
CmdProtocol::CmdProtocol() { setCmd("IP"); setArgsCount(1); setInfo("Force protocol."); setHelp("IP [4|6] Force protocol to use to connect to server. Server name may be solved with several protocols."); }
nftdialog::nftdialog(QWidget* parent, QString lang, QString templateDir) : QDialog(parent) { setupUi(this); setModal(true); settings = new nftsettings(lang, templateDir); setWindowIcon(loadIcon("AppIcon.png")); // context menu removeAction = new QAction(tr("&Remove"), tnailGrid); openAction = new QAction(tr("&Open"), tnailGrid); tnailGrid->addAction(removeAction); tnailGrid->addAction(openAction); setupAbout(); toolBox->setItemIcon(0, loadIcon("16/information.png")); toolBox->setItemIcon(1, loadIcon("16/image-x-generic.png")); toolBox->setItemIcon(2, loadIcon("16/help-browser.png")); tnailGrid->setIconSize(QSize(60, 60)); // Signals and Slots Connections connect(categoryList, SIGNAL(itemSelectionChanged()), this, SLOT(setTNails())); connect(tnailGrid, SIGNAL(itemSelectionChanged()), this, SLOT(setInfo())); connect(tnailGrid, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(accept())); connect(removeAction, SIGNAL(triggered()), this, SLOT(removeTemplate())); connect(openAction, SIGNAL(triggered()), this, SLOT(accept())); setupListItems(); setupCategories(); }
Word restoreValue(Fragment *F, Word *vals, IRRef ref) { IRIns *ir = IR(ref); HeapInfo *hp; Closure *cl; int j; // We only need to treat allocations specially. if (ir->o != IR_NEW) return vals[ref]; hp = &F->heap[ir->op2]; // Store has *not* been sunken, i.e., allocation occurred on-trace if (!ir_issunken(ir)) return vals[ref]; // Otherwise we need to do the allocation now, possibly recursively // // TODO: Can we have mutually recursive sunken refs? recordEvent(EV_ALLOC, 1 + hp->nfields); cl = allocClosure(wordsof(ClosureHeader) + hp->nfields); setInfo(cl, (InfoTable*)vals[ir->op1]); DBG_PR("(alloc[%lu])", wordsof(ClosureHeader) + hp->nfields); for (j = 0; j < hp->nfields; j++) cl->payload[j] = restoreValue(F, vals, getHeapInfoField(F, hp, j)); return (Word)cl; }
/** * Unreal Command Handler for "QUIT" - Constructor. * * @param mptr Module pointer */ UnrealCH_quit::UnrealCH_quit(UnrealModule* mptr) { setInfo(&mptr->inf); /* allocate additional contents */ command_ = new UnrealUserCommand(CMD_QUIT, &UnrealCH_quit::exec); }
CmdServerName::CmdServerName() { setCmd("server"); setArgsCount(1); setInfo("Force server name."); setHelp("server [name] Force server name to connect (to try to solve)."); }
void StageManager::loadPlayer( Point setPosition ) { addObject( OT_PLAYER , setPosition ); auto player = getWorldScene()->getGameLayer()->getPlayer(); _ASSERT( player != nullptr ); player->setInfo( m_PlayerInfo ); }
CmdRenderDelete::CmdRenderDelete() { setCmd("rdel"); setInfo("Delete render."); setHelp("rdel [name] Delete render with specified name, in no name porivieded, local host name used."); setMsgType( af::Msg::TJSON); }
CmdRenderExit::CmdRenderExit() { setCmd("rexit"); setInfo("Exit render."); setHelp("rexit [name] Exit render with specified name, in no name porivieded, local host name used."); setMsgType( af::Msg::TJSON); }
CmdServerPort::CmdServerPort() { setCmd("port"); setArgsCount(1); setInfo("Force server port."); setHelp("port [number] Force server port to connect."); }
CmdFork::CmdFork() { setCmd("fork"); setArgsCount(1); setInfo("Fork process."); setHelp("fork [count] Fork command process. For debug purposes only !"); }
CmdNetwork::CmdNetwork() { setCmd("net"); setArgsCount(1); setInfo("Network operations."); setHelp("net [operation] For testing purposes. Operations: [if,ip,pm,pa]."); }
CmdInvalid::CmdInvalid() { setCmd("inv"); setInfo("Try invalid message."); setHelp("Send invalid type of message. For debug purposes."); setMsgType( af::Msg::TInvalid); }
void TFormDevInfo::deviceSelected(UNUSEDPAR int p_index) { TDeviceBase *l_deviceBase=deviceList->getDeviceByName(ui.deviceName->currentText()); if(TDevice *l_device=dynamic_cast<TDevice *>(l_deviceBase)){ setInfo(l_device); } }
CmdJobsWeight::CmdJobsWeight() { setCmd("jweight"); setInfo("Jobs memory weight."); setMsgType( af::Msg::TJobsWeightRequest); setMsgOutType( af::Msg::TJobsWeight); }
/** * Unreal Command Handler for "MODE" - Constructor. * * @param mptr Module pointer */ UnrealCH_mode::UnrealCH_mode(UnrealModule* mptr) { setInfo(&mptr->inf); /* allocate additional contents */ command_ = new UnrealUserCommand(CMD_MODE, &UnrealCH_mode::exec); }
/** * Unreal Command Handler for "RMMOD" - Constructor. * * @param mptr Module pointer */ UnrealCH_rmmod::UnrealCH_rmmod(UnrealModule* mptr) { setInfo(&mptr->inf); /* allocate additional contents */ command_ = new UnrealUserCommand(CMD_RMMOD, &UnrealCH_rmmod::exec, true); }
CmdTestThreads::CmdTestThreads() { setCmd("tthr"); setArgsCount(1); setInfo("Test threads."); setHelp("tthr [count]\nRaise [count] number of threads. For debug purposes."); }
CmdSrvHosts::CmdSrvHosts() { setCmd("srvhosts"); setArgsCount(2); setInfo("apply hosts to command."); setHelp("srvcap [servicename] [command] [hosts1 host2 ...]"); }
newWordSuccess::newWordSuccess(INFO info, User *user):user(user) { this->info = info; this->setMaximumSize(270, 480); this->setMinimumSize(270, 480); this->setWindowFlags(Qt::FramelessWindowHint); background = new QLabel(this); background->setStyleSheet("background:url(:/image/newWordFinish.jpg)"); background->setGeometry(0, 0, this->width(), this->height()); sum = new QLabel(this); right = new QLabel(this); wrong = new QLabel(this); remove = new QLabel(this); sum->setGeometry(112, 140, 60, 60); sum->setStyleSheet("font-size:25px"); sum->setAlignment(Qt::AlignCenter); right->setGeometry(112, 196, 60, 60); right->setAlignment(Qt::AlignCenter); right->setStyleSheet("font-size:25px"); wrong->setGeometry(112, 255, 60, 60); wrong->setAlignment(Qt::AlignCenter); wrong->setStyleSheet("font-size:25px"); remove->setGeometry(112, 315, 60, 60); remove->setStyleSheet("font-size:25px"); remove->setAlignment(Qt::AlignCenter); backbutton = new QPushButton(this); backbutton->setGeometry(69, 417, 125, 45); backbutton->setStyleSheet("background-color:transparent"); setInfo(); connect(backbutton, SIGNAL(clicked()), this, SLOT(back())); }
CmdSrvCapacity::CmdSrvCapacity() { setCmd("srvcap"); setArgsCount(2); setInfo("apply capacity to command."); setHelp("srvcap [servicename] [command] [capacity]"); }