int _tmain(int argc, _TCHAR* argv[])
{
	//pdf原版(是0 92 40,但用0 40也可以??
	PDFPath="Z:/My Folder/Files/PDF相关/PDFs/Yes/老友记-六人行-Friends-老友妙语录.pdf";
	ReadPath(PDFPath);
	showInfo();
	List attrs=InitList();
	Attr attr=(Attr)malloc(sizeof(_Attr));
	attr->Name=ProduceNameString(L"学校®");
	attr->Value=L"北航®";
	AddNode(attrs,attr);
	attr=(Attr)malloc(sizeof(_Attr));
	attr->Name=ProduceNameString(L"学院®");
	attr->Value=L"计算机®";
	AddNode(attrs,attr);
	SaveInfo(L"标题®",L"作者®",L"主题®",L"关键词®",attrs);
	List tails=InitList();
	Attr tail=(Attr)malloc(sizeof(_Attr));
	tail->Name=ProduceNameString(L"啊啊啊啊®");
	tail->Value=L"1112®";
	AddNode(tails,tail);
	tail=(Attr)malloc(sizeof(_Attr));
	tail->Name=ProduceNameString(L"ooo®");
	tail->Value=L"计算机®";
	AddNode(tails,tail);
	ReadPath(PDFPath);
	AppendTail(tails);
	ReadPath(PDFPath);
	showInfo();
	system("pause");
	return 0;
}
void ContestantApp::login()
{
    if( connected )
    {
        m_network->authenticate ( m_login_dlg->username_line->text(), m_login_dlg->password_line->text() );
        return;
    }

    QString xml;
    QFile file( QString("resources/client_config.xml") );
    if( !file.exists() )
    {
        showInfo( 1, "client_config.xml does not exist", "Make sure file is ready" );
        exit();
    }
    else if( !file.open( QIODevice::ReadOnly ) )
    {
        showInfo( 1, "Can't open client_config.xml", "Make sure file is ready" );
        exit();
    }

    QTextStream stream( &file );
    QString line;
    do {
        line = stream.readLine();
        xml.append( line );
    } while( !line.isNull() );

    ClientConfig config;
    XmlUtil::getInstance().readNetConfig( xml, config );

    m_network->connectToHost( config.ip , config.port );
}
/// Show info about the function browser.
void MultiDatasetFit::showFunctionBrowserInfo() {
  if (m_functionBrowser->hasFunction()) {
    showInfo("Use context menu to add more functions. Set parameters and "
             "attributes.");
  } else {
    showInfo("Use context menu to add a function.");
  }
}
/// Show info / tips on the dataset table.
void MultiDatasetFit::showTableInfo() {
  if (getNumberOfSpectra() > 0) {
    showInfo("Select spectra by selecting rows. For multiple selection use "
             "Shift or Ctrl keys.");
  } else {
    showInfo("Add some data sets. Click \"Add Workspace\" button.");
  }
}
Exemple #5
0
void plotsDialog::enableZoomMode(bool on)
{
    d_panner->setEnabled( on );

    d_zoomer[0]->setEnabled( on );
    d_zoomer[0]->zoom( 0 );

    d_zoomer[1]->setEnabled( on );
    d_zoomer[1]->zoom( 0 );

    if(on)
        showInfo("Zoom activated.");
    else
        showInfo("Zoom de-activated.");
}
	int main(void){
	
		configure();
		showInfo();

		if (!isVdaOfflineMode()){
			if( isInfoEnabled()) info( "Lanzando proceso servicio de comunicacion con KSS" );
			if(isKssConnectionOpen()) launchKssServiceThread();
		}
		
		info( "Lanzando proceso Shell" );
		help();
		
		Sleep(1000);
		do{
			processShell();

		}while(isVdaRunningStatus());
		
		finalizeResources();
		Sleep(1000);


		//testRandomKeys();

		return EXIT_SUCCESS;	
	}
void BattleHudLayer::showUI()
{
    auto ui = GUIReader::getInstance()->widgetFromJsonFile(UI_DIALOG_BATTLEHUD);
    this->addChild(ui, 0, "UI");
    
    // select
    auto btn0 = (Button*)Helper::seekWidgetByName(ui, "Button0");
    auto btn1 = (Button*)Helper::seekWidgetByName(ui, "Button1");
    auto btn2 = (Button*)Helper::seekWidgetByName(ui, "Button2");
    auto btn3 = (Button*)Helper::seekWidgetByName(ui, "Button3");
    auto btn4 = (Button*)Helper::seekWidgetByName(ui, "Button4");
    btn0->addTouchEventListener(CC_CALLBACK_2(BattleHudLayer::selectCallback, this));
    btn1->addTouchEventListener(CC_CALLBACK_2(BattleHudLayer::selectCallback, this));
    btn2->addTouchEventListener(CC_CALLBACK_2(BattleHudLayer::selectCallback, this));
    btn3->addTouchEventListener(CC_CALLBACK_2(BattleHudLayer::selectCallback, this));
    btn4->addTouchEventListener(CC_CALLBACK_2(BattleHudLayer::selectCallback, this));
    btn0->setBright(true);
    btn1->setBright(false);
    btn2->setBright(false);
    btn3->setBright(false);
    btn4->setBright(false);
    _select = 0;
    
    // skill
    auto skill1 = (Button*)Helper::seekWidgetByName(ui, "Skill1");
    auto skill2 = (Button*)Helper::seekWidgetByName(ui, "Skill2");
    skill1->addTouchEventListener(CC_CALLBACK_2(BattleHudLayer::skillCallback, this));
    skill2->addTouchEventListener(CC_CALLBACK_2(BattleHudLayer::skillCallback, this));
    
    // retreat
    auto retreat = (Button*)Helper::seekWidgetByName(ui, "RetreatButton");
    retreat->addTouchEventListener(CC_CALLBACK_2(BattleHudLayer::retreatCallback, this));

    showInfo();
}
Exemple #8
0
void plotsDialog::setupPlots(bool init)
{
    if(!init)
        disconnect(tabs,SIGNAL(currentChanged(int)),this,SLOT(resetZoomer(int)));
    if(!loadXml(init))
    {
        globalpara.reportError("Fail to load xml file for plots!",this);
        close();
    }
    showInfo();

    if(!init)
        connect(tabs,SIGNAL(currentChanged(int)),SLOT(resetZoomer(int)));

    int newCurrentIndex = 0;
    if(tabs->count()>0)
        newCurrentIndex = tabs->count()-1;

    if(startPName!="")
    {
        for(int i = 0; i<tabs->count(); i++)
        {
            if(tabs->tabText(i)==startPName)
                newCurrentIndex = i;
        }
    }

    tabs->setCurrentIndex(newCurrentIndex);

    refreshThePlot();
}
Exemple #9
0
/** builds all Actions for the menu is only used when the ui is not implemented in qml*/
void CoreEngine::buildActions()
{
    /*this creates the action in the menubar
      the tr() function is used for translation in internationalized apps
    */
    this->open_action = new QAction(tr("&Open"),this);
    this->open_action->setShortcut(QKeySequence::Open);
    this->connect(this->open_action , SIGNAL(triggered()), this, SLOT(open()));

    this->exit_action = new QAction(tr("&Exit"),this);
    this->exit_action->setShortcut(QKeySequence::Quit);
    this->connect(this->exit_action, SIGNAL(triggered()), this, SLOT(close()));

    this->show_file_info = new QAction(tr("Show &Info"),this);
    this->connect(this->show_file_info, SIGNAL(triggered()), this, SLOT(showInfo()));

    this->close_file_info = new QAction(tr("Close &Info"),this);
    this->connect(this->close_file_info, SIGNAL(triggered()), this, SLOT(closeInfo()));

    /*the aboutQT() function is a build in dialog*/
    this->about_qt_qction = new QAction(tr("About &Qt"), this);
    this->connect(this->about_qt_qction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));

    this->show_fullsreen = new QAction(tr("Show &Fullscreen"),this);
    this->connect(this->show_fullsreen, SIGNAL(triggered()), this, SLOT(showFullScreen()));

    this->close_fullsreen = new QAction(tr("Close &Fullscreen"),this);
    this->connect(this->close_fullsreen, SIGNAL(triggered()), this, SLOT(showNormal()));
}
Exemple #10
0
int main(int argc, char * const * argv)
{
    InitModuleObjects();
    try
    {
        KeyPatchParams params;
        getParams(argc, argv, params);
        Owned<IKeyDiffApplicator> applicator;
        if(params.mode == KEYPATCH_explicit)
            applicator.setown(createKeyDiffApplicator(params.patch.str(), params.oldIndex.str(), params.newIndex.str(), params.newTLK.str(), params.overwrite, params.ignoreTLK));
        else
            applicator.setown(createKeyDiffApplicator(params.patch.str(), params.overwrite, params.ignoreTLK));
        if(params.mode == KEYPATCH_info)
            showInfo(params.patch.str(), applicator);
        else
        {
            if(params.xmitTLK)
                applicator->setTransmitTLK(new CNodeSender(params.tlkPort, params.xmitEp));
            else if(params.recvTLK)
                applicator->setReceiveTLK(new CNodeReceiver(params.tlkPort), params.recvNum);
            if(params.progressFrequency)
                applicator->setProgressCallback(new KeyPatchProgressCallback, params.progressFrequency);
            applicator->run();
        }
    }
    catch(IException * e)
    {
        EXCLOG(e);
        e->Release();
        releaseAtoms();
        return 1;
    }
    releaseAtoms();
    return 0;
}
void FilePropertiesDialog::setMediaData( MediaData md )
{
    media_data = md;

    // get metadata info with ffmpeg if has no info with mplayer
   // if ( media_data.clip_name.isEmpty() ) {
    {
        MediaData ffmpeg_md;

        FfmpegProcess *ffmpeg_proc = new FfmpegProcess;
        if ( ffmpeg_proc ) {
            QString ffmpeg_bin = Global::pref->ffmpeg_bin;

            QFileInfo fi( ffmpeg_bin );
            if ( fi.exists() && fi.isExecutable() && !fi.isDir() ) {
                ffmpeg_bin = fi.absoluteFilePath();
            }

            ffmpeg_proc->addArgument( ffmpeg_bin );
            ffmpeg_proc->addArgument( "-i" );
            ffmpeg_proc->addArgument( media_data.filename );

            ffmpeg_proc->start();
            if ( !ffmpeg_proc->waitForFinished() ) {
                qWarning("FilePropertiesDialog::setMediaData: process didn't finish. Killing it...");
                ffmpeg_proc->kill();
            }

            ffmpeg_md = ffmpeg_proc->mediaData();
            delete ffmpeg_proc;

            if ( !ffmpeg_md.clip_name.isEmpty() ) {
                media_data.clip_name = ffmpeg_md.clip_name;
            }
            if ( !ffmpeg_md.clip_track.isEmpty() ) {
                media_data.clip_track = ffmpeg_md.clip_track;
            }
            if ( !ffmpeg_md.clip_album.isEmpty() ) {
                media_data.clip_album = ffmpeg_md.clip_album;
            }
            if ( !ffmpeg_md.clip_artist.isEmpty() ) {
                media_data.clip_artist = ffmpeg_md.clip_artist;
            }
            if ( !ffmpeg_md.clip_date.isEmpty() ) {
                media_data.clip_date = ffmpeg_md.clip_date;
            }
            if ( !ffmpeg_md.clip_copyright.isEmpty() ) {
                media_data.clip_copyright = ffmpeg_md.clip_copyright;
            }
            if ( !ffmpeg_md.clip_software.isEmpty() ) {
                media_data.clip_software = ffmpeg_md.clip_software;
            }
            if ( !ffmpeg_md.clip_comment.isEmpty() ) {
                media_data.clip_comment = ffmpeg_md.clip_comment;
            }
        }
    }

    showInfo();
}
Exemple #12
0
void MainWindow::on_resetButton_clicked()
{
    on_stopButton_clicked();
    usleep(10000);
    core->reset();
    showInfo();
}
BOOL CDlgCfgAlarmPowerFault::OnInitDialog() 
{
	CDialog::OnInitDialog();
	g_SetWndStaticText(this, DLG_ALARM_POWERFAULT);
	// TODO: Add extra initialization here
	if (m_lLoginId == 0)
	{
		MessageBox(ConvertString(CString("We haven't login yet!"), DLG_ALARM_POWERFAULT), ConvertString("Prompt"));
	}

	m_pstuPowerFault= new CFG_POWERFAULT_INFO;
	if (m_pstuPowerFault == NULL)
	{
		return FALSE;
	}

	memset(m_pstuPowerFault, 0, sizeof(CFG_POWERFAULT_INFO));
	if (GetConfigFromDevice())
	{
		for (int i = 0; i < m_pstuPowerFault->nPowerCount; ++i)
		{
			CString csTemp;
			csTemp.Format("%s %d", ConvertString("Power", DLG_ALARM_POWERFAULT), i + 1);
			m_cmbPower.InsertString(-1, csTemp);
		}
		m_cmbPower.SetCurSel(0);
		showInfo();
		return TRUE;
	}
	return FALSE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Exemple #14
0
void displayFirstCB()
{
    // normal drawing to the framebuffer, so, the first call of glReadPixels()
    // in displayCB() will get valid content

    // clear buffer
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);

    // tramsform camera
    glTranslatef(0, 0, -cameraDistance);
    glRotatef(cameraAngleX, 1, 0, 0);   // pitch
    glRotatef(cameraAngleY, 0, 1, 0);   // heading

    // draw a cube
    glPushMatrix();
    draw();
    glPopMatrix();

    // draw the read color buffer to the right side of the window
    toOrtho();      // set to orthographic on the right side of the window
    glRasterPos2i(0, 0);
    glDrawPixels(SCREEN_WIDTH, SCREEN_HEIGHT, PIXEL_FORMAT, GL_UNSIGNED_BYTE, colorBuffer);

    // draw info messages
    showInfo();
    printTransferRate();

    glutSwapBuffers();

    // switch to read-back drawing callback function
    glutDisplayFunc(displayCB);
}
Exemple #15
0
/// Intersept mouse-enter events to display context-specific info
/// in the "status bar".
bool MultiDatasetFit::eventFilter(QObject *widget, QEvent *evn)
{
  if ( evn->type() == QEvent::Enter )
  {
    if ( qobject_cast<QObject*>( m_functionBrowser ) == widget )
    {
      showFunctionBrowserInfo();
    }
    else if ( qobject_cast<QObject*>( m_fitOptionsBrowser ) == widget )
    {
      showFitOptionsBrowserInfo();
    }
    else if ( qobject_cast<QObject*>( m_uiForm.plot ) == widget )
    {
      showPlotInfo();
    }
    else if ( qobject_cast<QObject*>( m_uiForm.dataTable ) == widget )
    {
      showTableInfo();
    }
    else
    {
      showInfo("");
    }
  }
  return false;
}
	static void processForeignLandmark(LLLandmark* landmark,
			const LLUUID& object_id, const LLUUID& notecard_inventory_id,
			LLPointer<LLInventoryItem> item_ptr)
	{
		LLVector3d global_pos;
		landmark->getGlobalPos(global_pos);
		LLViewerInventoryItem* agent_landmark =
				LLLandmarkActions::findLandmarkForGlobalPos(global_pos);

		if (agent_landmark)
		{
			showInfo(agent_landmark->getUUID());
		}
		else
		{
			if (item_ptr.isNull())
			{
				// check to prevent a crash. See EXT-8459.
				LL_WARNS() << "Passed handle contains a dead inventory item. Most likely notecard has been closed and embedded item was destroyed." << LL_ENDL;
			}
			else
			{
				LLInventoryItem* item = item_ptr.get();
				LLPointer<LLEmbeddedLandmarkCopied> cb = new LLEmbeddedLandmarkCopied();
				copy_inventory_from_notecard(get_folder_by_itemtype(item),
											 object_id,
											 notecard_inventory_id,
											 item,
											 gInventoryCallbacks.registerCB(cb));
			}
		}
	}
Exemple #17
0
Tab::Tab(QWidget *parent) : QWidget(parent)
{
	tabMenu = new QMenu(this);
	openInNewWindow = new QAction(tr("Open in new Window"),this);
	openInNewWindow->setIcon(QIcon(":/icons/window-new.png"));
	bookmarkThisTab = new QAction(tr("Bookmark this tab"),this);
	bookmarkThisTab->setIcon(QIcon(":/icons/bookmark-menu.png"));
	closeTab = new QAction(tr("Close tab"),this);
	closeTab->setIcon(QIcon(":/icons/tab-close.png"));
	stopAction = new QAction(tr("Stop"),this);
	stopAction->setIcon(QIcon(":/icons/stop.png"));
	stopAction->setVisible(false);
	infoAction = new QAction(tr("Host Information"),this);
	tabMenu->addAction(openInNewWindow);
	tabMenu->addAction(bookmarkThisTab);
	tabMenu->addAction(closeTab);
	tabMenu->addAction(stopAction);
	tabMenu->addAction(infoAction);
	tabMenu->setWindowOpacity(0.9);
	setFixedSize(150,20);
	textSet = false;
	iconSet = false;
	mouseOverIcon = false;
	setMouseTracking(true);
	connect(closeTab,SIGNAL(triggered()),this,SLOT(_closeTab()));
	connect(openInNewWindow,SIGNAL(triggered()),this,SLOT(_newWindow()));
	connect(bookmarkThisTab,SIGNAL(triggered()),this,SLOT(_bookmark()));
	connect(infoAction,SIGNAL(triggered()),this,SLOT(showInfo()));
	loading = false;
}
Exemple #18
0
//Main Function
int main()
{
	char firstName[18];
	char lastName[18];
	int age;

	printf("Enter First Name  : ");
	scanf("%s", firstName);
	fseek(stdin,0,SEEK_END);

	printf("Enter Last Name   : ");
	scanf("%s", lastName);
	fseek(stdin,0,SEEK_END);

	printf("Enter age         : ");
	int ageScanCount = scanf("%d", &age);
	fseek(stdin, 0, SEEK_END);

	if(isalpha(*firstName) && isalpha(*lastName) && ageScanCount == 1)
	{
		showInfo(firstName, lastName, age);
	}
	else
	{
		puts("Invalid input.");
	}

	return(0);
}
void CDlgCfgAlarmChassisIntrusion::OnChassisintrusionButtonGet() 
{
	// TODO: Add your control notification handler code here
	if (GetConfigFromDevice())
	{
		showInfo();
	}
}
void CDlgCfgNetCollection::OnNetcollectionBtnGet() 
{
	// TODO: Add your control notification handler code here
    if (GetConfigFromDevice())
    {
        showInfo();
	}
}
Exemple #21
0
void showAll(sqlite3 * db)
{
    char * res;
    res = calloc(500, sizeof(char));
    strcat(res, "\n");
    showInfo(db, res);
   // printf("%s", res);
}
void CDlgCfgAlarmPowerFault::OnPowerfaultButtonGet() 
{
	// TODO: Add your control notification handler code here
	if (GetConfigFromDevice())
	{
		showInfo();
	}
}
Exemple #23
0
void MainWindow::timerEvent(QTimerEvent *) {
    miksys->buttonState = ui->softButton->isChecked();
    updateLEDs(miksys->LEDstate);
    if (miksys->frame % 2 == 0) ui->display->repaint();
    miksys->frame++;
    showInfo();
    ui->frequency->setText(QString("Freq: %1 MHz").arg(freq));
}
void CDlgCfgPSTNBreakLine::OnCfgPSTNBreakLineBtnGet() 
{
	// TODO: Add your control notification handler code here
    if (GetConfigFromDevice())
    {
        showInfo();
    }
}
Exemple #25
0
void plotsDialog::moved(const QPoint &pos)
{
    Plot* currentPlot = dynamic_cast<Plot*>(tabs->currentWidget());
    QString info;
    info.sprintf( "X=%g, Y=%g",currentPlot->invTransform(QwtPlot::xBottom,pos.x())
                  ,currentPlot->invTransform(QwtPlot::yLeft,pos.y()));

    showInfo( info );
}
Exemple #26
0
int main()
{
	struct namect person;

	getInfo(&person);
	makeInfo(&person);
	showInfo(&person);
	return 0;
}
void AnalysisWidget::moved(const QPoint &pos)
{
    QString info;
    info.sprintf("x=%g, y=%g",
        m_curvePlot->invTransform(QwtPlot::xBottom, pos.x()),
        m_curvePlot->invTransform(QwtPlot::yLeft, pos.y())
    );
    showInfo(info);
}
Exemple #28
0
void MainWindow::moved( const QPoint &pos )
{
    QString info;
    info.sprintf( "Freq=%g, Ampl=%g, Phase=%g",
        d_plot->invTransform( QwtPlot::xBottom, pos.x() ),
        d_plot->invTransform( QwtPlot::yLeft, pos.y() ),
        d_plot->invTransform( QwtPlot::yRight, pos.y() )
    );
    showInfo( info );
}
void ContestantApp::onAData ( bool result )
{
    if( result )
    {
        showInfo( 0, "Answers successfully sent to server", "" );
        if( round == 1 || round == 2 )
        {
            m_summary_w->hide();
            m_ending_w->show();
        }
        else if( round == 3 || round == 4 )
        {
            pauseQuestion();
            timer->start( 1000 );
        }
    }
    else
        showInfo( 1, "Answers not sent. Please try again.", "" );
}
void ContestantApp::onContestError ( ERROR_MESSAGES err )
{
    switch ( err )
    {
        case ERR_NOTAUTHORIZED:
            showInfo( 1, "Server returned that we're not authorized", "" );
            break;
        case ERR_BADCOMMAND:
            showInfo( 1, "Server returned bad command", "" );
            break;
        case ERR_CONTEST_STOPPED:
            showInfo( 1, "Contest is stopped", "" );
            break;
        case ERR_UNKNOWN:
            showInfo( 1, "Server returned unknown error", "" );
            break;
        default:
            assert ( false );
    }
}