Ejemplo n.º 1
0
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow){
    ui->setupUi(this);

    QGLFormat format;
    format.setVersion(4,1);
    format.setProfile(QGLFormat::CoreProfile);

    //do this so everything isnt so bunched up
    this->setMinimumHeight(600);

    //add our openGL context to our scene
    m_openGLWidget = new OpenGLWidget(format,this);
    m_openGLWidget->hide();
    ui->gridLayout->addWidget(m_openGLWidget,0,0,7,1);

    //Group box for our general UI buttons
    QGroupBox *docGrb = new QGroupBox("General:",this);
    ui->gridLayout->addWidget(docGrb,8,0,1,1);
    QGridLayout *docLayout = new QGridLayout(docGrb);
    docGrb->setLayout(docLayout);

    //button to add fluid simulations
    QPushButton *addFluidSimBtn = new QPushButton("Add Fluid Simulation",docGrb);
    connect(addFluidSimBtn,SIGNAL(clicked()),this,SLOT(addFluidSim()));
    docLayout->addWidget(addFluidSimBtn,0,0,1,1);

    //open Documation button
    QPushButton *openDocBtn = new QPushButton("Open Documentation",docGrb);
    connect(openDocBtn,SIGNAL(pressed()),this,SLOT(openDoc()));
    docLayout->addWidget(openDocBtn,1,0,1,1);

}
Ejemplo n.º 2
0
void MainWindow::open()
{
    QString file =
            QFileDialog::getOpenFileName(this, "Open", QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation),
                                         "All (*);;XmlOcaf (*.xml);;MDTV-Standard (*.std);;BinOcaf (*.cbf)");

    if(!file.isEmpty()) openDoc(file);
}
Ejemplo n.º 3
0
JuffEd::JuffEd() : Juff::PluginNotifier(), Juff::DocHandlerInt() {
	mw_ = new JuffMW();
	initActions();
	
	viewer_ = new Juff::DocViewer(this);
	mw_->setMainWidget(viewer_);
	settingsDlg_ = new SettingsDlg(mw_);
	connect(settingsDlg_, SIGNAL(applied()), SLOT(onSettingsApplied()));
	
	connect(viewer_, SIGNAL(docActivated(Juff::Document*)), SLOT(onDocActivated(Juff::Document*)));
	connect(mw_, SIGNAL(closeRequested(bool&)), SLOT(onCloseRequested(bool&)));
	
	// UI must be initialized before engines and plugins because 
	// we need menus to be already created when loading engines and plugins.
	initUI();
	
	loadEngines();
	
	pluginMgr_ = new PluginManager(this, this);
	// buildUI() *must* go before loadPlugins() because
	// it creates structures and widgets expected by loadPlugins()
	buildUI();
	
	loadPlugins();
	
	search_ = new SearchEngine(this, mw_);
	
	setSessionName( MainSettings::get( MainSettings::LastSession ) );
	if ( !loadSession() ) {
		slotFileNew();
	}
	
	if ( viewer_->docCount(Juff::PanelAll) == 0 ) {
		openDoc("", Juff::PanelLeft);
		viewer_->hidePanel(Juff::PanelRight);
	}
	else if ( viewer_->docCount(Juff::PanelLeft) == 0 ) {
		viewer_->hidePanel(Juff::PanelLeft);
	}
	else if ( viewer_->docCount(Juff::PanelRight) == 0 ) {
		viewer_->hidePanel(Juff::PanelRight);
	}
	
	onSettingsApplied();

    mw_->restoreState();
}
Ejemplo n.º 4
0
int filmat_parse_map(void)
{
	char *map_name=(char *)calloc(1024,1);
	int ret=0;
	sprintf(map_name,"Pre-parsing: %s%i%s%s",DATA_PREFIX,level,FILE_SEPARATOR,"level.map");
	display_gauge_only(map_name);
	sprintf(map_name,"%s%i%s%s",DATA_PREFIX,level,FILE_SEPARATOR,"level.map");
	if (!openDoc(map_name))
	{
		if (parseDoc())
			ret=-1;
	}
	else
		ret=-2;

	closeDoc();
	free(map_name);
	return ret;
}