Ejemplo n.º 1
0
void ofxSDLAppWindow::keyDownHandler(SDL_Event* evt) {
  static ofKeyEventArgs keyEventArgs;

  // TODO: better handling of non chars and true unicode
  SDLKey sym = evt->key.keysym.sym;
  char key = evt->key.keysym.unicode & 0x7F;

	if (ofAppPtr) {
		ofAppPtr->keyPressed(sym);
  }
  
#ifdef OF_USING_POCO
  keyEventArgs.key = sym;
  ofNotifyEvent(ofEvents.keyPressed, keyEventArgs);
#endif

  // --- quit sequences -----------------

	if (sym == SDLK_ESCAPE) {
		exitApp();
	}

#ifdef TARGET_OSX
  if (sym == SDLK_q && evt->key.keysym.mod & KMOD_META) { // OSX quit command
		exitApp();
	}
#endif
  
#ifdef TARGET_WIN32
  if (sym == SDLK_F4 && evt->key.keysym.mod & KMOD_ALT) { // Win quit command
		exitApp();
	}
#endif

}
Ejemplo n.º 2
0
/*
 * Cleans up and exits the application.
 */
void cleanUpAndExit(int code)
{
	RsslErrorInfo rsslErrorInfo;

	if (pReactor && rsslDestroyReactor(pReactor, &rsslErrorInfo) != RSSL_RET_SUCCESS)
	{
		printf("Error cleaning up reactor: %s\n", rsslErrorInfo.rsslError.text);
		exitApp(-1);
	}

	rsslUninitialize();

	exitApp(code);
}
Ejemplo n.º 3
0
	void sighandler(int sig) {
		ofLogVerbose("ofAppRunner") << "sighandler caught: " << sig;
		if(!bExitCalled) {
			bExitCalled = true;
			exitApp();
		}
	}
Ejemplo n.º 4
0
void LayoutApp::setup(){
    ofSetWindowTitle("Map");
    ofSeedRandom();
    ofEnableSmoothing();
    ofSetFrameRate(30);

    fontVerd10.loadFont("verdana.ttf", 10);
    fontVerd14.loadFont("verdana.ttf", 14);

    if (!visConfig.loadFile(getMainAppDataDirectory() + "VisConfig.txt")) {
        printf("ERR: (fatal) config load failed\n");
        exitApp();
    }

    if (visConfig.fake_data) gelink.ensureFakeData();

    setupLayouts();
    setupUI();

    mainRenderMode.structure    = true;
    mainRenderMode.locations    = true;
    mainRenderMode.texture      = false;
    mainRenderMode.presence     = true;
    mainRenderMode.userLocation = true;
    mainRenderMode.skeletons    = true;
}
Ejemplo n.º 5
0
//--------------------------------------------------------------
void testApp::draw(){
	if(cmd == "run")
	{		
		//do
		//	m_par.Simulate(&canvas);
		//while(!m_par.canstop());
		time_t now, then;
		double seconds;
		//time(&now);

		for(int i =0; i<500; i++)
		{
			m_par.Simulate(&canvas);	
		}
		
		//time(&then);
		//seconds = difftime(now, then);
		//cout<<"elapse time during 5000 iterations: "<<seconds<<endl;

		if(m_par.canstop())
			pdfmaker = true;

		if(!m_par.GetSaved1stGroup() && m_par.Get1stGroupStopSign())
		{
			pdfmaker = true;
			m_par.SetSaved1stGroup();
		}
		// show catmull curves and save as pdf
		if(pdfmaker)
		{
			ofBeginSaveScreenAsPDF("testpdf-"+ofGetTimestampString()+".pdf");
			cout<<"Saving..."<<endl;
		}
		m_par.drawcatmull();
		if(pdfmaker)
		{
			ofEndSaveScreenAsPDF();
			cout<<"Saved PDF."<<endl;
			pdfmaker =false;
			if(m_par.canstop())
				exitApp();
		}

		//canvas.reloadTexture();
		//ofSetColor(255);
		//canvas.draw(0,0);
		//if(nowSaveImage)
		//{
		//	nowSaveImage = false;
		//	SaveImage();
		//}
	}
	else if(cmd == "edge")
	{
		edgeImage.reloadTexture();
		ofSetColor(150);
		edgeImage.draw(0,0);
		showEGmap = true;
	}
}
Ejemplo n.º 6
0
void mySpaces::openNewTab(QUrl url)
{
    for(int i = 0; i < tabs->count(); i++)
    {
        tabPage * tab = static_cast<tabPage*>(tabs->widget(i));
        if(tab->url().toString() == url.toString())
        {
            tabs->setCurrentIndex(i);
            return;
        }
    }
    tabPage * tab = new tabPage(tabs);
    tab->load(url);
    tabs->addTab(tab,QIcon(":/myspaces/t_icon_home.png"),"mySpaces");
    connect(tab, SIGNAL(OpenLinkInNewTab(QUrl)),SLOT(openNewTab(QUrl)));
    connect(tab, SIGNAL(changeTitle(QString)),
            this, SLOT(refreshTitles(QString)));
    connect(tab, SIGNAL(exitApplication()), SLOT(exitApp()));
    if(url.toString().startsWith("myspaces://"))
        tabs->setCurrentWidget(tab);
    if(tabs->count()>1)
        tabs->setMovable(true);
    else
        tabs->setMovable(false);
    resizeTabs();
}
//--------------------------------------------------------------
void testApp::setup(){
	ofSetFrameRate(60);

	//string train[] = {"zoom_in_out_base.txt"};
	if(useTwoHandRegognizer)
		//recognizer.initPipeline("TrainingData_v3_zoomIn_ZoomOut.txt", 6);		
		
				recognizer.initPipeline("zoom_in_out_base.txt", 6);
	if(useOneHandRecognizer)
		oneHandrecognizer.initPipeline("TrainingData_A_X_S.txt", 3);


	int returnCode = openniP.initOpenNi();
	if(returnCode == -1){
		exitApp();
		return;
	}
	tracker.initHandTracker();
	if(useFullbodyTracker){
		bodyTracker.initTracker();
	}
	if(useGrabDetector){
		grabLeft.initGrabDetector(openniP.m_device);
		grabRight.initGrabDetector(openniP.m_device);
	}

	if(useStaticRecognizer){
		//static_recognizer.initPipeline("TrainingData_static_zoomin_out.txt" ,6);
		static_recognizer.initPipeline("TrainingData_v4_5_static_postures.txt", 6);

	}
}
Ejemplo n.º 8
0
Archivo: main.cpp Proyecto: allush/capt
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    Capt *c = new Capt();

    QObject::connect(c, SIGNAL(exitApp()), &a, SLOT(quit()));

    QString url;
    QString out;

    for(int i = 0; i < argc; i++){
        QStringList param = QString(argv[i]).split('=');
        if(param.length() == 1){
            continue;
        }

        if(param.at(0) == "--url"){
            url = param.at(1);
        } else if(param.at(0) == "--out"){
            out = param.at(1);
        }
    }

    if(!url.length() or !out.length()){
        qDebug("missed --out or --url params");
        return 0;
    }

    c->save(QUrl(url), out);

    return a.exec();
}
void RFIDMonitorDaemon::start()
{
    if(m_localServer->listen(m_serverName)){
        qDebug() <<  QString("Server name: %1").arg(m_localServer->serverName());

        initMonitor();

        QThread *consoleThread = new QThread(this);
        Console *console = new Console;
        console->moveToThread(consoleThread);

        connect(consoleThread, SIGNAL(destroyed()), console, SLOT(deleteLater()));
        connect(consoleThread, &QThread::started, console, &Console::run);
        connect(console, &Console::exitApp, consoleThread, &QThread::quit);
        connect(console, SIGNAL(exitApp()), qApp, SLOT(quit()));

        // consoleThread->start();

        QTimer::singleShot(100, this, SLOT(tcpConnect()));
    }else{
        qDebug() <<  "Could not start IPC server";
    }
    if(!m_udpSocket->bind(QHostAddress::Any, 9999))
        qDebug() <<  QString("Couldn't listening to broadcast");
}
Ejemplo n.º 10
0
int main() {
	signal(SIGABRT,exitApp);
	signal(SIGTERM, exitApp);
	ms = init_socket();
	listen_and_handle(ms);
	exitApp();
	return(0);
}
Ejemplo n.º 11
0
//------------------------------------------------------------
void ofAppGlutWindow::keyboard_cb(unsigned char key, int x, int y) {

	ofNotifyKeyPressed(key);

	if (key == OF_KEY_ESC){				// "escape"
		exitApp();
	}
}
Ejemplo n.º 12
0
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent), ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    m_phoneGap = new PhoneGap(ui->webView);
    QObject::connect(m_phoneGap, SIGNAL(s_exitapp()), this, SLOT(exitApp()));
}
Ejemplo n.º 13
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    scaleFactor=1.0;
    ui->setupUi(this);

    //////////////////
    db = QSqlDatabase::addDatabase("QSQLITE");
    db.setDatabaseName("project_DB.s3db");
    db.open();


    ui->label->setBackgroundRole(QPalette::Base);
    ui->label->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
    ui->label->setScaledContents(true);

    ui->scrollArea->setWidget(ui->label);
    ui->scrollArea->setBackgroundRole(QPalette::Dark);
    //setCentralWidget(ui->scrollArea);

    setWindowTitle(tr("Image Viewer"));
        resize(500, 400);

    connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(openfile()));
    connect(ui->actionAbout_Program, SIGNAL(triggered()), this, SLOT(aboutProg()));
    connect(ui->actionHelp, SIGNAL(triggered()), this, SLOT(help()));
    connect(ui->actionExit, SIGNAL(triggered()), this, SLOT(exitApp()));
    connect(ui->actionZoomIn, SIGNAL(triggered()), this, SLOT(zoomIn()));
    connect(ui->actionZoomOut, SIGNAL(triggered()), this, SLOT(zoomOut()));
    connect(ui->actionNormal_Size, SIGNAL(triggered()), this, SLOT(normalSize()));
    connect(ui->actionFitToWindow, SIGNAL(triggered()), this, SLOT(fitToWindow()));
    connect(ui->pushButton_2, SIGNAL(clicked()), this, SLOT(zoomIn()));
    connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(zoomOut()));
    connect(ui->pushButton_4, SIGNAL(clicked()), this, SLOT(next()));
    connect(ui->pushButton_3, SIGNAL(clicked()), this, SLOT(prev()));


    ui->actionFitToWindow->setEnabled(false);
    ui->actionFitToWindow->setCheckable(true);
    ui->actionFitToWindow->setShortcut(tr("Ctrl+F"));

    ui->actionNormal_Size->setShortcut(tr("Ctrl+S"));
    ui->actionNormal_Size->setEnabled(false);

    ui->actionZoomOut->setShortcut(tr("Ctrl+-"));
    ui->actionZoomOut->setEnabled(false);

    ui->actionZoomIn->setShortcut(tr("Ctrl++"));
    ui->actionZoomIn->setEnabled(false);

    ui->actionExit->setShortcut(tr("Ctrl+Q"));

    ui->actionOpen->setShortcut(tr("Ctrl+O"));

    namefilter.append("*.png");
    namefilter.append("*.jpg");
}
Ejemplo n.º 14
0
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
    _ui.setupUi(this);

    connect(_ui.actionNew, SIGNAL(triggered()), this, SLOT(addNew()));
    connect(_ui.actionExit, SIGNAL(triggered()), this, SLOT(exitApp()));
    connect(_ui.actionView_wireframe, SIGNAL(triggered(bool)), _ui.tabPane, SLOT(enableWireFrameView(bool)));
    connect(_ui.actionLighting, SIGNAL(triggered(bool)), _ui.tabPane, SLOT(enableLighting(bool)));
    connect(_ui.actionToggleTexturing, SIGNAL(triggered(bool)), _ui.tabPane, SLOT(enableTexturing(bool)));
}
int main()
{
	int nSelection = -1;

	printf("\n");
	printf("欢迎进入计费管理系统\n");

	do{
	outputMenu();//输出系统菜单
	scanf("%d",&nSelection);//输入菜单项编号
	switch(nSelection){
		case 1:{
			add();// printf("添加卡\n");
			break;
		}
		case 2:{
			query();//printf("查询卡\n");
			break;
		}
		case 3:{
			logon();// printf("上机\n");
			break;
		}
		case 4:{
			settle();//printf("下机\n");
			break;
		}
		case 5:{
			addMoney();//printf("充值\n");
			break;
		}
		case 6:{
			refundMoney();//printf("退费\n");
			break;
		}
		case 7:{
			printf("查询统计\n");
			break;
		}
		case 8:{
			annul();//printf("注销卡\n");
			break;
		}
		case 0:{
			exitApp();
			break;
		}
	default:printf("输入菜单序号错误!请选择(0~8)\n");break;
	}
	}while(nSelection != 0);
	
	system("pause");
	return 0;
}
Ejemplo n.º 16
0
void check_for_upgrade()
{
    int rc = FAILURE;
    char *new_file_arrived_config = NULL;
    unsigned char reboot = 0;

    RESET_GLOBAL_BUFFER;

    rc = get_config_value_from_persistent_storage(NEW_FILE_KEY, (char*) GLOBAL_BUFFER, MAX_BUFFER_SIZE);
    if(rc == FAILURE)
    {
        sg_sprintf(LOG_GLOBAL_BUFFER, PROSTR("%sConfig not found on persistent storage ... so proceeding with old file"), FILE_UPGRADE);
        error_log(LOG_GLOBAL_BUFFER);

        goto exit;
    }

    new_file_arrived_config = (char*) sg_malloc(MAX_BUFFER_SIZE);
    if(new_file_arrived_config == NULL)
    {
        sg_sprintf(LOG_GLOBAL_BUFFER,
                   PROSTR("%sCould not allocate memory for checking whether new-file arrived ... so proceeding with old file"), FILE_UPGRADE);
        error_log(LOG_GLOBAL_BUFFER);

        goto exit;
    }

    memset(new_file_arrived_config, 0, MAX_BUFFER_SIZE);
    getJsonKeyValueIfPresent((char*)GLOBAL_BUFFER, CONFIG_VALUE_KEY, new_file_arrived_config);

    if(strcmp(new_file_arrived_config, NEW_FILE_ARRIVED) == 0)
    {
        remove_old_executable_binary();
        copy_new_executable_binary_from_temp_location();

        sg_sprintf(LOG_GLOBAL_BUFFER, PROSTR("%sBinary upgraded, restarting to take effect"), FILE_UPGRADE);
        info_log(LOG_GLOBAL_BUFFER);

        reboot = 1;
    }

    delete_config_value_from_persistent_storage(NEW_FILE_KEY);

exit:
    if(new_file_arrived_config)
    {
        sg_free(new_file_arrived_config);
    }

    if(reboot == 1)
    {
        exitApp();
    }
}
Ejemplo n.º 17
0
void acceptAction(AppInfo *app)
{
   int status = append_to_buf(&(app->buf), &(app->bufSize),
			      &(app->bufIndex), '\0');
   if (APPEND_FAILURE == status) {
      cleanUp(app);
      outOfMemory(app, __LINE__);
   }
   fputs(app->buf, stdout);
   fputc('\n', stdout);
   exitApp(app, EXIT_STATUS_ACCEPT);
}
void TrayIcon::exitAndSeeYouAgain() {

    QDeclarativeComponent comp(view->engine(), QUrl::fromLocalFile("qml/ScoreModel.qml"));
    QObject *myObject = comp.create();
    //QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(myObject);
    QVariant returned;
    QMetaObject::invokeMethod(myObject, "getFullScore", Q_RETURN_ARG(QVariant, returned));

    if (returned.toInt()==0) return;

        QMessageBox::information(view, tr("Good bye"), tr("Day ended, huh? See you again tomorrow :D"));
        exitApp();
}
void StudentDashBoard::quitApp()
{
    if(database->updateStudentStatus(studentID,"off")){
        sendStudentStatus();
        socket->disconnectFromHost();
        socket->close();
        system("stopserver.vbs");
        emit exitApp();
    }
    else{
        QMessageBox::information(this,SETTINGSERVERPROMPT,LOGOUTUPDATESTATUSFAILUREPROMPT,QMessageBox::Ok);
    }
}
Ejemplo n.º 20
0
void handleInputTimeout(XtPointer data, XtIntervalId *timerId)
{
   /* 'gcc -Wall' complains about 'timerId' being an unused parameter.
    * Tough.  Xt forces us to have it here.  Like it.
    */
   AppInfo *app = (AppInfo *) data;
   if (app->inputTimeoutActive) {
      app->inputTimeoutActive = False;
      fprintf(stderr, "%s[%ld]: *Yawn*...timed out after %lu seconds.\n",
	      app->appName, (long) app->pid, (app->inputTimeout / 1000));
      exitApp(app, EXIT_STATUS_TIMEOUT);
   }
}
Ejemplo n.º 21
0
bool lmcCore::receiveAppMessage(const QString& szMessage) {
	bool doNotExit = true;

	if(szMessage.isEmpty()) {
		pMainWindow->restore();
		return doNotExit;
	}

	QStringList messageList = szMessage.split("\n", QString::SkipEmptyParts);
	//	remove duplicates
	messageList = messageList.toSet().toList();

	if(messageList.contains("/new", Qt::CaseInsensitive)) {
		if(messageList.contains("/loopback", Qt::CaseInsensitive))
			pMessaging->setLoopback(true);
	}
	if(messageList.contains("/nohistory", Qt::CaseInsensitive)) {
		QFile::remove(History::historyFile());
		if(pHistoryWindow)
			pHistoryWindow->updateList();
	}
	if(messageList.contains("/nofilehistory", Qt::CaseInsensitive)) {
		QFile::remove(StdLocation::transferHistory());
		if(pTransferWindow)
			pTransferWindow->updateList();
	}
	if(messageList.contains("/noconfig", Qt::CaseInsensitive)) {
		QFile::remove(StdLocation::avatarFile());
		QFile::remove(pSettings->fileName());
		pSettings->sync();
		settingsChanged();
	}
	if(messageList.contains("/sync", Qt::CaseInsensitive)) {
		bool autoStart = pSettings->value(IDS_AUTOSTART, IDS_AUTOSTART_VAL).toBool();
		lmcSettings::setAutoStart(autoStart);
	}
	if(messageList.contains("/unsync", Qt::CaseInsensitive)) {
		lmcSettings::setAutoStart(false);
	}
	if(messageList.contains("/term", Qt::CaseInsensitive)) {
		doNotExit = false;
		exitApp();
	}
	if(messageList.contains("/quit", Qt::CaseInsensitive)) {
		doNotExit  = false;
	}

	return doNotExit;
}
Ejemplo n.º 22
0
//------------------------------------------------------------
void ofAppGlutWindow::keyboard_cb(unsigned char key, int x, int y) {
	static ofKeyEventArgs keyEventArgs;

	if(ofAppPtr)
		ofAppPtr->keyPressed(key);

	#ifdef OF_USING_POCO
		keyEventArgs.key = key;
		ofNotifyEvent( ofEvents.keyPressed, keyEventArgs );
	#endif

	if (key == OF_KEY_ESC){				// "escape"
		exitApp();
	}
}
Ejemplo n.º 23
0
void usage()
{
    qWarning("Usage: qmlobserver [options] <filename>");
    qWarning(" ");
    qWarning(" options:");
    qWarning("  -v, -version ............................. display version");
    qWarning("  -frameless ............................... run with no window frame");
    qWarning("  -maximized................................ run maximized");
    qWarning("  -fullscreen............................... run fullscreen");
    qWarning("  -stayontop................................ keep viewer window on top");
    qWarning("  -sizeviewtorootobject .................... the view resizes to the changes in the content");
    qWarning("  -sizerootobjecttoview .................... the content resizes to the changes in the view (default)");
    qWarning("  -qmlbrowser .............................. use a QML-based file browser");
    qWarning("  -warnings [show|hide]..................... show warnings in a separate log window");
#ifndef NO_PRIVATE_HEADERS
    qWarning("  -recordfile <output> ..................... set video recording file");
    qWarning("                                              - ImageMagick 'convert' for GIF)");
    qWarning("                                              - png file for raw frames");
    qWarning("                                              - 'ffmpeg' for other formats");
    qWarning("  -recorddither ordered|threshold|floyd .... set GIF dither recording mode");
    qWarning("  -recordrate <fps> ........................ set recording frame rate");
    qWarning("  -record arg .............................. add a recording process argument");
    qWarning("  -autorecord [from-]<tomilliseconds> ...... set recording to start and stop");
#endif
    qWarning("  -devicekeys .............................. use numeric keys (see F1)");
    qWarning("  -dragthreshold <size> .................... set mouse drag threshold size");
    qWarning("  -netcache <size> ......................... set disk cache to size bytes");
    qWarning("  -translation <translationfile> ........... set the language to run in");
    qWarning("  -I <directory> ........................... prepend to the module import search path,");
    qWarning("                                             display path if <directory> is empty");
    qWarning("  -P <directory> ........................... prepend to the plugin search path");
#if defined(Q_WS_MAC)
    qWarning("  -no-opengl ............................... don't use a QGLWidget for the viewport");
#else
    qWarning("  -opengl .................................. use a QGLWidget for the viewport");
#endif
#ifndef NO_PRIVATE_HEADERS
    qWarning("  -script <path> ........................... set the script to use");
    qWarning("  -scriptopts <options>|help ............... set the script options to use");
#endif

    qWarning(" ");
    qWarning(" Press F1 for interactive help");

    exitApp(1);
}
TrayIcon::TrayIcon(QmlView * view, QObject *parent) :
    QSystemTrayIcon(parent)
{
    this->view = view;
    QMenu * menu = new QMenu();
    menu->addAction((tr("&End of day")), this, SLOT(showScore()));
    menu->addSeparator();
    menu->addAction(tr("&Tick"), this, SLOT(showTick()));
    menu->addAction(tr("&Manage..."), this, SLOT(showManage()));
    menu->addSeparator();
    menu->addAction(tr("&About"), this, SLOT(showAbout()));
    menu->addAction(tr("About &Qt"), this, SLOT(showAboutQt()));
    menu->addAction(tr("Exit"), this, SLOT(exitApp()));
    setContextMenu(menu);

    this->setIcon(QIcon(":/Gupaa.png"));
}
Ejemplo n.º 25
0
void TrayIcon::initTrayMenu()
{
	if(m_trayMenu) return;

	m_trayMenu = new QMenu();
	m_pConfigWndAction = m_trayMenu->addAction("显示本机ip");
	//m_pConfigWndAction->setCheckable(true);
	//m_p = m_trayMenu->addAction("无功能");
	m_trayMenu->addSeparator();
	m_pExitAppAction = m_trayMenu->addAction("退出");

	connect(m_pConfigWndAction, SIGNAL(triggered()), this, SLOT(onTriggerConfigWnd()));
	//connect(m_p, SIGNAL(triggered()), this, SIGNAL(clearCache()));
	connect(m_pExitAppAction, SIGNAL(triggered()), this, SIGNAL(exitApp()));

	setContextMenu(m_trayMenu);
}
MainWindow::MainWindow()
  :QMainWindow()
{
  // actions
  fileNewAction = new QAction( this );
  helpAboutAction = new QAction( this);
  ExitApplicationAction = new QAction( this);
  openAction = new QAction(this);
  saveAction = new QAction(this);
  
  //MenuBars
  MenuBar = new QMenuBar(this);
  setMenuBar(MenuBar);

  fileMenu = new QMenu( this );
  fileMenu->addAction(fileNewAction);;
  fileMenu->addAction(openAction);
  fileMenu->addAction(saveAction);
  fileMenu->addAction(ExitApplicationAction);
  fileMenu->insertSeparator(ExitApplicationAction);
  menuBar()->addMenu( fileMenu);
  helpMenu = new QMenu( this );
  helpMenu->addAction(helpAboutAction);
  menuBar()->addMenu(helpMenu);

  //Add Text
  fileNewAction->setText(tr("&New MarSystem") );
  helpAboutAction->setText(tr( "&About") );
  ExitApplicationAction->setText( tr("&Quit") );
  openAction->setText( tr("&Open") );
  saveAction->setText( tr("&Save") );
  fileMenu->setTitle( tr("&File") );
  helpMenu->setTitle( tr("&Help") );

  // signals and slots connections
  connect( fileNewAction, SIGNAL( activated() ), this, SLOT( fileNew() ) );
  connect( helpAboutAction, SIGNAL( activated() ), this, SLOT( helpAbout() ) );
  connect( ExitApplicationAction, SIGNAL( activated() ), this, SLOT( exitApp() ) );
  connect( openAction, SIGNAL( activated() ), this, SLOT( openFile() ) );
  connect( saveAction, SIGNAL( activated() ), this, SLOT( saveFile())) ;

  init();
  
  
}
Ejemplo n.º 27
0
void lmcCore::connectionStateChanged(void) {
	bool connected = pMessaging->isConnected();

	pMainWindow->connectionStateChanged(connected);
	if(pPublicChatWindow)
		pPublicChatWindow->connectionStateChanged(connected);
	for(int index = 0; index < chatWindows.count(); index++)
		chatWindows[index]->connectionStateChanged(connected);
	for(int index = 0; index < chatRoomWindows.count(); index++)
		chatRoomWindows[index]->connectionStateChanged(connected);
	if(pBroadcastWindow)
		pBroadcastWindow->connectionStateChanged(connected);

	if(pMessaging->isConnected() && !pMessaging->canReceive()) {
		showPortConflictMessage();
		exitApp();
	}
}
Ejemplo n.º 28
0
void scriptOptsUsage()
{
    qWarning("Usage: qmlobserver -scriptopts <option>[,<option>...] ...");
    qWarning(" options:");
    qWarning("  record ................................... record a new script");
    qWarning("  play ..................................... playback an existing script");
    qWarning("  testimages ............................... record images or compare images on playback");
    qWarning("  testerror ................................ test 'error' property of root item on playback");
    qWarning("  testskip  ................................ test 'skip' property of root item on playback");
    qWarning("  snapshot ................................. file being recorded is static,");
    qWarning("                                             only one frame will be recorded or tested");
    qWarning("  exitoncomplete ........................... cleanly exit the viewer on script completion");
    qWarning("  exitonfailure ............................ immediately exit the viewer on script failure");
    qWarning("  saveonexit ............................... save recording on viewer exit");
    qWarning(" ");
    qWarning(" One of record, play or both must be specified.");

    exitApp(1);
}
Ejemplo n.º 29
0
//------------------------------------------
void ofNotifyKeyPressed(int key){
	static ofKeyEventArgs keyEventArgs;
	// FIXME: modifiers are being reported twice, for generic and for left/right
	// add operators to the arguments class so it can be checked for both
    if(key == OF_KEY_RIGHT_CONTROL || key == OF_KEY_LEFT_CONTROL){
        pressedKeys.insert(OF_KEY_CONTROL);
    	keyEventArgs.key = OF_KEY_CONTROL;
        ofNotifyEvent( ofEvents().keyPressed, keyEventArgs );
    }
    else if(key == OF_KEY_RIGHT_SHIFT || key == OF_KEY_LEFT_SHIFT){
        pressedKeys.insert(OF_KEY_SHIFT);
    	keyEventArgs.key = OF_KEY_SHIFT;
        ofNotifyEvent( ofEvents().keyPressed, keyEventArgs );
    }
    else if(key == OF_KEY_LEFT_ALT || key == OF_KEY_RIGHT_ALT){
        pressedKeys.insert(OF_KEY_ALT);
    	keyEventArgs.key = OF_KEY_ALT;
        ofNotifyEvent( ofEvents().keyPressed, keyEventArgs );
    }
    else if(key == OF_KEY_LEFT_SUPER || key == OF_KEY_RIGHT_SUPER){
        pressedKeys.insert(OF_KEY_SUPER);
    	keyEventArgs.key = OF_KEY_SUPER;
        ofNotifyEvent( ofEvents().keyPressed, keyEventArgs );
    }
            
	pressedKeys.insert(key);

	keyEventArgs.key = key;
	ofNotifyEvent( ofEvents().keyPressed, keyEventArgs );
	
	
	if (key == OF_KEY_ESC && bEscQuits == true){				// "escape"
        ofAppGLFWWindow *appGLFWWindow = dynamic_cast<ofAppGLFWWindow*>(ofGetWindowPtr());
        if (appGLFWWindow) {
            glfwSetWindowShouldClose(appGLFWWindow->getGLFWWindow(), true);
        }else{
            exitApp();
        }
    }
	
	
}
Ejemplo n.º 30
0
MainWindowApplication::MainWindowApplication(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindowApplication)
{
    ui->setupUi(this);

    materialsWindow = new MaterialDockWindow(this);
    ui->dockMateriales->setWidget(materialsWindow);

    connect(ui->action_New, SIGNAL(triggered()), this, SLOT(newProject()));
    connect(ui->action_Open, SIGNAL(triggered()), this, SLOT(openProject()));
    connect(ui->action_Save, SIGNAL(triggered()), this, SLOT(saveProject()));
    connect(ui->actionSave_As, SIGNAL(triggered()), this, SLOT(saveProjectAs()));
    connect(ui->action_Close, SIGNAL(triggered()), this, SLOT(closeProject()));

    connect(ui->actionEdit_Material_defiinition, SIGNAL(triggered()), this, SLOT(editMaterialLibrary()));

    connect(ui->actionE_xit, SIGNAL(triggered()), this, SLOT(exitApp()));
    on_mdiArea_subWindowActivated(NULL);
}