/*
This function creates the main Console Window.  It is not in the constructor because
QWorkspace needs a fully created workspace so that it can place correctly child windows.

When mysqlcc is in MDI mode, main.cpp will call this function.
*/
void CMDIWindow::createConsoleWindow()
{
#ifdef DEBUG
  qDebug("CMDIWindow::createConsoleWindow()");
#endif
  
  if (consoleWindow == 0)
  {
    consoleWindow = new CConsoleWindow(myApp()->workSpace(), true);
    myApp()->setMainConsoleWindow(consoleWindow);    
    if (!consoleWindow->loadWindowSettings())
      consoleWindow->setGeometry(35, 30, 600, 400);
    myShowWindow(consoleWindow);
    consoleWindow->databaseListView()->refreshServers();
  }
}
Exemple #2
0
int main( int argc, char** argv ) {
	try{
		PlatformSpecific::RegisterExceptionHandler();

		std::cout << "ModernGDV Build " __DATE__ << std::endl; //Banner auf Konsole ausgeben
		printManual();

		std::clog << std::fixed << std::setprecision( 4 );

		//Kommandozeilenparameter in vector lesen
		std::vector<std::string> commandline;
		for (int i = 0; i < argc; ++i)
			commandline.push_back( std::string( argv[i] ) );

		ModernGDV::Driver mgdv;
		{
			MyApp myApp( commandline, &mgdv );
			mgdv.Run();
			mgdv.SetApp( nullptr );
		}
		
		return 0;
	}
	catch (std::exception& ex) {
		std::cerr << "\nUnhandled exception: " << ex.what() << "\n\n";
		system( "pause" );
		return -1;
	}
	catch ( ... ) {
		std::cerr << "\nUnhandled exception: Unknown exception\n\n";
		system( "pause" );
		return -1;
	}
}
Exemple #3
0
int main(int argc, char **argv){

    ProcessingOptions opts;
    Processor processor(opts);
    DEV_INFOS("Starting OpenCFU");
    if(argc > 1){
        DEV_INFOS("At least one argument -> parsing arguments...");
        ArgumentParser par(argc, argv,opts);
        DEV_INFOS("Argument parsed OK. Now processing");
        processor.runAll();
        processor.writeResult();
    }
    else{
    #ifndef WITH_GUI
        std::cerr<<"If you use no argument, OpenCFU will run as a GUI, but the program was not compiled with GTK support. Run 'opencfu -h' for more information"<<std::endl;
        return EXIT_FAILURE;
    #else
        DEV_INFOS("No argument used, running the GUI...");
        Glib::thread_init();
        Glib::set_application_name (PROGRAM_NAME);
        Gui_MyApplication myApp(argc,argv,processor);
    #endif
    }

    return EXIT_SUCCESS;
}
int main(int argc, char** argv)
{
	int _argc = 10;
	char* _argv[] = { "Monte_Karlo.exe", "-p", "0", "0", "0", "10", "10", "10", "10", "0"};

	myApp App = myApp(argc, argv);
	bool ex;
	
	ex = App.init();
	
	if (!ex)
	{
		std::cout << "Init failed!" << std::endl;
		return 1;
	}
	
	App.calculate();
	App.returning();


#ifdef _MSC_VER // if compiling in the MS Visual Studio
	system("pause");
#endif

	return 0;
}
Exemple #5
0
int main(int argc, char** argv)
{
	//	help to optimize c++ stream I/O (may screw up threaded I/O though)

	std::ios_base::sync_with_stdio(false);

	int result = 0;
	try
	{
		CollectorApp myApp(argc, argv);
        bool startup_OK = myApp.Startup();
        if (startup_OK)
        {
            myApp.Run();
            myApp.Shutdown();
        }
        else
        {
            std::cout << "Problems starting program.  No processing done.\n";
        }
	}

	catch (const std::exception& theProblem)
	{
        spdlog::error(catenate("Something fundamental went wrong: ", theProblem.what()));
		result = 7;
	}
	catch (...)
	{
        spdlog::error("Something totally unexpected happened.");
		result = 9;
	}

	return result;
}
CAdministrationWindow::~CAdministrationWindow()
{
  myApp()->decCritical();
  if (delete_mysql)
    delete m_mysql;
  delete flush_menu;
}
void CUserAdminItem::doCreateUser()
{
#ifdef DEBUG
  qDebug("CUserAdminItem::doCreateUser()");
#endif

  CUserAdminWindow *p = new CUserAdminWindow(myApp()->workSpace(), mysql(), QString::null, QString::null, false);
  connect(p, SIGNAL(do_refresh()), this, SLOT(refresh()));
  myShowWindow(p);
}
Exemple #8
0
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pScmdline, int iCmdshow)
{
	// initialisation
	abfw::PlatformD3D11 platform(hInstance, 960, 544, false, true);

	S3D myApp(platform);
	myApp.Run();

	return 0;
}
Exemple #9
0
int main(int argc, char* argv[])
{
	Worker *myWorker = new Worker();
	QApplication myApp(argc, argv);
	QLabel* myLabel = new QLabel(myWorker->_text);
	myLabel->resize(400, 30);
	myLabel->show();
	  
	return myApp.exec();
}
/*
This slot closes the window which currently has the focus
*/
void CMDIWindow::closeActiveWindow()
{
#ifdef DEBUG
  qDebug("CMDIWindow::closeActiveWindow()");
#endif
  
  QWidget* wnd = (QWidget*)myApp()->workSpace()->activeWindow();  
  if (wnd)
    wnd->close();
}
void CAdministrationWindow::shutdown(CMySQLServer *m)
{
  if (myApp()->confirmCritical())
    if ((QMessageBox::information(0, tr("Confirm Shutdown"), tr("Are you sure you want to Shutdown mysqld ?"),
      tr("&Yes"), tr("&No")) != 0))
      return;

  if (m->mysql()->mysqlShutdown())
    m->messagePanel()->information("[" + m->connectionName() + "] " + tr("mysqld was shutdown successfully"));
}
Exemple #12
0
int main(int argc, char **argv)
{
  // Create a QApplication instance first
  mitk::BaseApplication myApp(argc, argv);
  myApp.setApplicationName("TestApp");
  myApp.setOrganizationName("DKFZ");

  myApp.setProperty(mitk::BaseApplication::PROP_APPLICATION, "org.mitk.qt.extapplication");
  return myApp.run();
}
Exemple #13
0
int main (int argc, char** argv)
{

    QApplication myApp(argc, argv);
    MainWindow mainWindow;

    mainWindow.show();
    myApp.exec();
    return 0;
}
/*
This slot is responsible for showing an activated window via the Window menu
*/
void CMDIWindow::windowActivated(int id)
{
#ifdef DEBUG
  qDebug("CMDIWindow::windowActivated()");
#endif
  
  QWidget* wnd = myApp()->workSpace()->windowList().at(id);
  if (wnd)
    wnd->showNormal();
  wnd->setFocus();
}
Exemple #15
0
// dummy main
int main(int argc, char** argv)
{
    QCoreApplication myApp(argc, argv);

    QString tmpPath = QDir::tempPath() + "/snippet-eventadmin-intro";
    ctkProperties fwProps;
    fwProps[ctkPluginConstants::FRAMEWORK_STORAGE] = tmpPath;
    fwProps[ctkPluginConstants::FRAMEWORK_STORAGE_CLEAN] = ctkPluginConstants::FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT;
    fwProps["org.commontk.pluginfw.debug.resolve"] = true;
    fwProps["org.commontk.pluginfw.debug.service_reference"] = true;
    fwProps["org.commontk.pluginfw.debug.errors"] = true;
    fwProps["org.commontk.pluginfw.debug.pluginfw"] = true;
    fwProps["org.commontk.pluginfw.debug.lazy_activation"] = true;
    ctkPluginFrameworkLauncher::setFrameworkProperties(fwProps);
    ctkPluginFrameworkLauncher::start("org.commontk.eventadmin");

    ctkPluginContext* pluginContext = ctkPluginFrameworkLauncher::getPluginContext();

    ReportManager reportManager(pluginContext);

    //! [Event Handler service registration]
    ReportEventHandler eventHandler;
    ctkDictionary props;
    props[ctkEventConstants::EVENT_TOPIC] = "com/acme/reportgenerator/GENERATED";
    pluginContext->registerService<ctkEventHandler>(&eventHandler, props);
    //! [Event Handler service registration]

    // You can also use a wildcard in the final character of the EVENT_TOPIC
    //! [Event Handler service registration wildcard]
    props[ctkEventConstants::EVENT_TOPIC] = "com/acme/reportgenerator/*";
    pluginContext->registerService<ctkEventHandler>(&eventHandler, props);
    //! [Event Handler service registration wildcard]

    // Or you could use a filter expression (using LDAP syntax)
    //! [Event Handler service registration filter]
    props[ctkEventConstants::EVENT_TOPIC] = "com/acme/reportgenerator/GENERATED";
    props[ctkEventConstants::EVENT_FILTER] = "(title=samplereport)";
    pluginContext->registerService<ctkEventHandler>(&eventHandler, props);
    //! [Event Handler service registration filter]

    //! [Event Handler service registration slot]
    ReportEventHandlerUsingSlots eventHandlerUsingSlots;
    ctkDictionary propsForSlot;
    propsForSlot[ctkEventConstants::EVENT_TOPIC] = "com/acme/reportgenerator/*";
    ctkServiceReference ref = pluginContext->getServiceReference<ctkEventAdmin>();
    if (ref)
    {
        ctkEventAdmin* eventAdmin = pluginContext->getService<ctkEventAdmin>(ref);
        eventAdmin->subscribeSlot(&eventHandlerUsingSlots, SLOT(handleEvent(ctkEvent)), propsForSlot);
    }
    //! [Event Handler service registration slot]

    reportManager.reportGenerated(Report());
}
QString CInnoDBStatus::contents() const
{
  QString ret = tr("Connection") + ": " + mysql->connectionName() + mysql->lineTerminator(true);
  ret += tr("Host") + ": " + mysql->hostName() + mysql->lineTerminator(true);
  ret += tr("Saved") + ": " + QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss") + mysql->lineTerminator(true);
  ret += mysql->lineTerminator(true);
  ret += mysql->lineTerminator(true);
  ret = myApp()->commentText(ret, mysql->lineTerminator(true));
  ret += text();
  return ret;
}
Exemple #17
0
/***************************************************************************//**
 * @name main
 * @par Description
 * Starts app up that allows a user to perform facial recognition
 ******************************************************************************/
int main(int argc, char *argv[])
{
    //Creates a facial recognition app
    FaceRecognitionApp myApp(NULL);
    ImageApp app(argc, argv);

    //Adds the face recognition app to the main app
    app.AddActions(&myApp);

    //Starts up the app
    return app.Start();
}
/*
This reimplemented method confirms if the user wants to exit from the application or not
*/
void CMDIWindow::closeEvent(QCloseEvent * e)
{
#ifdef DEBUG
  qDebug("CMDIWindow::closeEvent()");  
#endif
  
  if (myApp()->confirmCritical() && !myApp()->checkCritical())
    if ((QMessageBox::information(0, tr("Confirm Exit"), tr("Are you sure you want to Exit ?"),
      tr("&Yes"), tr("&No")) != 0))
    {
      e->ignore();
      return;
    }
  beforeClose();
  QWidgetList openWindows = myApp()->workSpace()->windowList();
  if (openWindows.count() > 0)
    for ( int i = 0; i < int(openWindows.count()); ++i)
      ((CMyWindow *)openWindows.at(i))->beforeClose();
  
  emit about_to_close();
  e->accept();
}
void gui_display (int shortcut)
{
	int foo;

	if (shortcut == -1) {
		int local_argc = 0;
		char **local_argv = NULL;
		QApplication myApp(local_argc, local_argv);
		puae_MainWindow w;

		w.show();
		foo = myApp.exec();
	}
}
int main(int argc, char** argv)
{
  mitk::BaseApplication myApp(argc, argv);
  myApp.setApplicationName("AwesomeApp");
  myApp.setOrganizationName("AwesomeOrg");

  // -------------------------------------------------------------------
  // Here you can switch to your customizable application:
  // -------------------------------------------------------------------

  myApp.setProperty(mitk::BaseApplication::PROP_APPLICATION, "org.mitk.qt.extapplication");
  //myApp.setProperty(mitk::BaseApplication::PROP_APPLICATION, "my.awesomeproject.exampleapp");
  return myApp.run();
}
void CProcessListTable::DoubleClicked(int row, int col, int button, const QPoint &)
{
  if (isBlocked() || button != 1 || col < 1)
    return;
  QString txt = text(row, 7);
  if (txt.isEmpty() || txt.isNull())
    return;

  CQueryWindow *w = new CQueryWindow(myApp()->workSpace(), mysql(), CQueryWindow::QUERY, SQL_PANEL | RESULTS_PANEL);
  w->setQuery(txt);
  w->setFocus();
  w->raise();
  myShowWindow(w);
}
/*
This slot closes ALL windows except for the Console Window
*/
void CMDIWindow::closeAllWindows()
{
#ifdef DEBUG
  qDebug("CMDIWindow::closeAllWindows()");
#endif
  
  QWidgetList lst = myApp()->workSpace()->windowList();
  QPtrListIterator<QWidget> it(lst);
  while (it.current())
  {
	  QWidget *w = it.current();
	  ++it;
    w->close(true);
  }
}
void CTableFieldChooser::setCaption(const QString &s)
{
  if (QDockWindow::caption() == s)
    return;

  if (myApp()->isMDI())
    QDockWindow::setCaption(s);
  else
  {
    QString app_name(SHORT_NAME);
    app_name += " - ";
    if (s.startsWith(app_name))
      QDockWindow::setCaption(s);
    else
      QDockWindow::setCaption(app_name + s);
  }
}
Exemple #24
0
/******************************************************************************
*******************************************************************************

                                MAIN PLAY THREAD

*******************************************************************************
*******************************************************************************/
int main( int argc, char *argv[] )
{
	char	name[256], dst[258];
	char	rcfilename[256];

	char* home = getenv("HOME");
	snprintf(name, 255, "%s", basename(argv[0]));
	snprintf(dst, 257, "/%s/", name);
	snprintf(rcfilename, 255, "%s/.%src", home, name);

    QApplication myApp(argc, argv);
    
	QTGUI* interface = new QTGUI();
	FUI* finterface = new FUI();
	DSP.buildUserInterface(interface);
	DSP.buildUserInterface(finterface);

	oscdsp osca (dst, argc, argv);
	OSCUI*	oscinterface = new OSCUI(name, argc, argv, &osca);
	DSP.buildUserInterface(oscinterface);
	
	snprintf(dst, 257, "/%s/", oscinterface->getRootName());
	osca.setDest (dst);
	
	osca.init (name, &DSP);	
	finterface->recallState(rcfilename);
	osca.start ();	
	
	oscinterface->run();
	interface->run();	
    
    myApp.setStyleSheet(interface->styleSheet());
    myApp.exec();
    interface->stop();
    
	osca.stop();
	finterface->saveState(rcfilename);
    
	// desallocation
    delete interface;
    delete finterface;
	delete oscinterface;
  	return 0;
}
Exemple #25
0
void CDatabaseItem::processMenu(int res)
{
#ifdef DEBUG
  qDebug("CDatabaseItem::processMenu(%d)", res);
#endif

  if (isBlocked())
    return;

  switch (res)
  {
		case MENU_CONNECT: setConnected(true);
      break;

    case MENU_DISCONNECT: setConnected(false);
      break;

    case MENU_DELETE:
      {
        if (myApp()->confirmCritical())
          if ((QMessageBox::information(0, tr("Confirm Delete Database"), 
            tr("Are you sure you want to Delete Database") + ":\'" + text(0) + "\' ?",
            tr("&Yes"), tr("&No")) != 0))
            return;

        setBlocked(true);
        CMySQLQuery qry(mysql()->mysql());
        qry.setEmitMessages(false);
        if (qry.execStaticQuery("DROP DATABASE IF EXISTS " + mysql()->mysql()->quote(text(0))))
        {
          setVisible(false);
          setBlocked(false);
          delete this;
        }
        else
          setBlocked(false);
      }
      break;

    case MENU_NEW_WINDOW_FROM_HERE: databaseListView()->openInNewWindow(this);
      break;
  }
}
int main( int argc, char* argv[] ) 
{
  QApplication myApp( argc, argv );
	string s;
	cerr << argc << endl;
	if ( argc > 1 )
		s = argv[1];
	else
		s = "/data/data/arbeitsgruppe/gudrun/xch2_reo_p101_r.dat";
	CMainWindow *mw = new CMainWindow( s );
	mw->setCaption( "Template mesh generation" );
	mw->resize( 600, 300 );	 
	myApp.setMainWidget( mw );
	mw->show();
	std::cerr << "Running" << endl;
  int nReturn = myApp.exec();  

  return nReturn;

}
Exemple #27
0
int main (int argc, char * argv[])
{
	QStringList lineList;
	QString curLine;
	Dictionary myDict(argv[2]);

  	QApplication myApp(argc, argv);
   	QTextEdit wid;
 	wid.setMinimumSize(500,300);
 	wid.setAcceptRichText(true);
  	QString word;
  	QTextStream stream(&word);
	
	QFile myFile(argv[1]);
	myFile.open(QIODevice::ReadOnly);
	QTextStream inFile(&myFile);

	while(!inFile.atEnd())
	{
		curLine = inFile.readLine();					//file is read
		lineList = curLine.split(QRegExp("\\b"), QString::SkipEmptyParts);	//the string is split into parts
		for (int c = 0; c < lineList.size(); c++)
		{
			if (myDict.dictLook(lineList[c]) == 0)			//if the word was misspelled, then
			{
				stream << "<font color=red>";			//red font tags are placed around the word
				stream << lineList[c];
				stream << "</font>";
			}
			else
			{
				stream << lineList[c];				//otherwise they are just outputted
			}
		}
		wid.append(word);						//printed to text editor
		word = "";							//string cleared
	
	}
 	wid.show();
	return myApp.exec();
}
Exemple #28
0
int main(int argc, char** argv)
{
  // Create a QApplication instance first
  QApplication myApp(argc, argv);
  myApp.setApplicationName("$(project-app-name)");
  myApp.setOrganizationName("$(vendor)");

  // These paths replace the .ini file and are tailored for installation
  // packages created with CPack. If a .ini file is presented, it will
  // overwrite the settings in MapConfiguration
  Poco::Path basePath(argv[0]);
  basePath.setFileName("");
  
  Poco::Path provFile(basePath);
  provFile.setFileName("$(project-app-name).provisioning");

  Poco::Util::MapConfiguration* sbConfig(new Poco::Util::MapConfiguration());
  sbConfig->setString(berry::Platform::ARG_PROVISIONING, provFile.toString());
  sbConfig->setString(berry::Platform::ARG_APPLICATION, "org.mitk.qt.extapplication");
  return berry::Starter::Run(argc, argv, sbConfig);
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevInstance,
	PSTR cmdLine, int showCmd)
{
	// Enable run-time memory check for debug builds.
#if defined(DEBUG) | defined(_DEBUG)
	_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
#endif

	try
	{
		SandBoxD3D12App myApp(hInstance);
		if (!myApp.Initialize())
			return 0;

		return myApp.Run();
	}
	catch (DxException& e)
	{
		MessageBox(nullptr, e.ToString().c_str(), L"HR Failed", MB_OK);
		return 0;
	}
}
Exemple #30
0
int main(int argc, char** argv)
{
  QApplication myApp(argc, argv);
  const QString VERSION_STRING = QString(APP_NAME) + " " + QString::number(APP_VERSION_MAJOR) + "." + QString::number(APP_VERSION_MINOR) +
                                 QString(APP_VERSION_REL);

  /* Setup global settings */
  {
    bool doSanityChecks;
    QStringList cmdArgs = QCoreApplication::arguments();
    if (cmdArgs.contains(NO_CHECKS_ARG))
      doSanityChecks = false;
    else
      doSanityChecks = true;

   GlobalSettings::init(doSanityChecks);
  }

  MainWindow* mWin = new MainWindow(VERSION_STRING);

  mWin->show();
  return myApp.exec();
}