Beispiel #1
0
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
bool RIApplication::saveProjectPromptForFileName()
{
    //if (m_project.isNull()) return true;

    QString startPath;
    if (!m_project->fileName().isEmpty())
    {
        QFileInfo fi(m_project->fileName());
        startPath = fi.absolutePath();
    }
    else
    {
        startPath = QDir::currentPath();
    }

    startPath += "/ResInsightProject.rip";

    QString fileName = QFileDialog::getSaveFileName(NULL, tr("Save File"), startPath, tr("Project Files (*.rip *.xml)"));
    if (fileName.isEmpty())
    {
        return false;
    }

    bool bSaveOk = saveProjectAs(fileName);

    setWindowCaptionFromAppState();

    return bSaveOk;
}
void KTMainWindow::saveProject()
{
	m_projectManager->save();
	
	if ( m_fileName.isEmpty() )
	{
		saveProjectAs();
		return;
	}
	
	if( !m_fileName.endsWith(".ktn"))
	{
		m_fileName += ".ktn";
	}
	
	dDebug() << "Saving " << m_fileName;
	
	KTPackageHandler packageHandler;
	
	bool ok = packageHandler.makePackage(REPOSITORY+"/"+m_projectManager->projectName(), m_fileName);
	
	if ( ok )
	{
		messageToOSD( tr("Project saved!"));
	}
	
}
Beispiel #3
0
bool
Gui::saveProject()
{
    ProjectPtr project = getApp()->getProject();

    if ( project->hasProjectBeenSavedByUser() ) {
        QString projectFilename = project->getProjectFilename();
        QString projectPath = project->getProjectPath();

        if ( !_imp->checkProjectLockAndWarn(projectPath, projectFilename) ) {
            return false;
        }

        bool ret = project->saveProject(projectPath, projectFilename, 0);

        ///update the open recents
        if ( !projectPath.endsWith( QLatin1Char('/') ) ) {
            projectPath.append( QLatin1Char('/') );
        }
        if (ret) {
            QString file = projectPath + projectFilename;
            updateRecentFiles(file);
        }

        return ret;
    } else {
        return saveProjectAs();
    }
}
Beispiel #4
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    connect(ui->actionNew_project, SIGNAL(triggered()), SLOT(addNewProject()));
    connect(ui->actionOpen_project, SIGNAL(triggered()), SLOT(openProject()));
    connect(ui->actionSave_project, SIGNAL(triggered()), SLOT(saveProject()));
    connect(ui->actionSave_project_as, SIGNAL(triggered()), SLOT(saveProjectAs()));
    connect(ui->actionClose_project, SIGNAL(triggered()), SLOT(closeProject()));

    connect(ui->actionUndo, SIGNAL(triggered()), SLOT(undo()));
    connect(ui->actionRedo, SIGNAL(triggered()), SLOT(redo()));

    connect(ui->actionImport, SIGNAL(triggered()), SLOT(importProject()));
    connect(ui->actionExport, SIGNAL(triggered()), SLOT(exportProject()));

    connect(ui->actionAbout, SIGNAL(triggered()), SLOT(showAbout()));
    connect(ui->actionAbout_Qt, SIGNAL(triggered()), SLOT(showAboutQt()));

    QString fileName =
          //"/home/gogi/Downloads/pcsc_pcsc_00001.vcf";
          "G:\\pcsc_pcsc_00001.vcf";
    QFile file(fileName);
    //showProject(new VCardProject(file));

    updateProjectState();
}
Beispiel #5
0
void MainWindow::on_actionSave_project_triggered()
{
    if (projectName=="") saveProjectAs();
    else {
        tmpProjectFolder = projectFolder;
        tmpProjectName = projectName;
        saveProject();
    }
}
void
OutOfMemoryDialog::saveProject()
{
	if (m_projectFile.isEmpty()) {
		saveProjectAs();
	} else if (saveProjectWithFeedback(m_projectFile)) {
		showSaveSuccessScreen();
	}
}
Beispiel #7
0
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
bool RIApplication::saveProject()
{
    CVF_ASSERT(m_project.notNull());

    if (!QFile::exists(m_project->fileName()))
    {
        return saveProjectPromptForFileName();
    }
    else
    {
        return saveProjectAs(m_project->fileName());
    }
}
Beispiel #8
0
bool
Gui::saveProjectAs()
{
    std::vector<std::string> filter;

    filter.push_back(NATRON_PROJECT_FILE_EXT);
    std::string outFile = popSaveFileDialog( false, filter, _imp->_lastSaveProjectOpenedDir.toStdString(), false );
    if (outFile.size() > 0) {
        return saveProjectAs(outFile);
    }

    return false;
}
Beispiel #9
0
/*!
 \brief

 \fn cdegs_main::connectSlots
*/
void cdegs_main::connectSlots(){
    QObject::connect(ui->actionNew_Project, SIGNAL(triggered()),
                      this,  SLOT(newProject()));

    QObject::connect(ui->actionNew_Config, SIGNAL(triggered()),
                      this,  SLOT(newConfig()));

    QObject::connect(ui->actionOpen_Project, SIGNAL(triggered()),
                      this,  SLOT(openProject()));

    QObject::connect(ui->actionSave_Project, SIGNAL(triggered()),
                      this,  SLOT(saveProject()));

    QObject::connect(ui->actionSave_Project_as, SIGNAL(triggered()),
                      this,  SLOT(saveProjectAs()));

    QObject::connect(ui->actionClose_Project, SIGNAL(triggered()),
                      this,  SLOT(closeProject()));

    QObject::connect(ui->tabProjects, SIGNAL(currentChanged(int)),
                     this, SLOT(changeTab()));

    QObject::connect(ui->tabProjects, SIGNAL(tabCloseRequested(int)),
                     this, SLOT(closeProject(int)));

    QObject::connect(ui->actionAbout, SIGNAL(triggered()),
                     this, SLOT(about()));

    QObject::connect(ui->actionStylesheet, SIGNAL(triggered()),
                     this, SLOT(openStyleDialog()));

    QObject::connect(ui->actionOpen_Config, SIGNAL(triggered()),
                     this, SLOT(openConfigDialog()));

    QObject::connect(ui->actionSave_Config, SIGNAL(triggered()),
                     this, SLOT(saveConfig()));

    QObject::connect(ui->actionClose_Config, SIGNAL(triggered()),
                     this, SLOT(closeConfig()));

    QObject::connect(ui->actionExport_Config, SIGNAL(triggered()),
                     this, SLOT(exportConfig()));

    QObject::connect(ui->actionExport_Config_as, SIGNAL(triggered()),
                     this, SLOT(exportConfigAs()));

    QObject::connect(ui->actionSave_All_Configs, SIGNAL(triggered()),
                     this, SLOT(saveAllConfigs()));
}
Beispiel #10
0
OutOfMemoryDialog::OutOfMemoryDialog(QWidget* parent)
:	QDialog(parent)
{
	ui.setupUi(this);
	if (sizeof(void*) > 32) {
		ui.only_32bit_1->hide();
		ui.only_32bit_2->hide();
	}

	ui.topLevelStack->setCurrentWidget(ui.mainPage);

	connect(ui.saveProjectBtn, SIGNAL(clicked()), SLOT(saveProject()));
	connect(ui.saveProjectAsBtn, SIGNAL(clicked()), SLOT(saveProjectAs()));
	connect(ui.dontSaveBtn, SIGNAL(clicked()), SLOT(reject()));
}
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);
}
Beispiel #12
0
void MainWindow::saveProject()
{
    if(m_project->fileName().isEmpty())
        saveProjectAs();

    else
    {
        QFile file(m_project->fileName());
        if (!file.open(QFile::WriteOnly | QFile::Text)) {
            QMessageBox::warning(this, tr("DES Project Writer"),
                                 tr("Cannot write file %1:\n%2.")
                                 .arg(m_project->fileName())
                                 .arg(file.errorString()));
            return;
        }

        ProjectSerializer serializer;
        if(serializer.saveProject(m_project, &file))
            statusBar()->showMessage(tr("Project saved"), 20000);

        m_unsavedChanges = false;
    }
}
Beispiel #13
0
void MainWindow::finalize()
{
	resetWindowTitle();
	setWindowIcon( embed::getIconPixmap( "icon" ) );


	// project-popup-menu
	QMenu * project_menu = new QMenu( this );
	menuBar()->addMenu( project_menu )->setText( tr( "&File" ) );
	project_menu->addAction( embed::getIconPixmap( "project_new" ),
					tr( "&New" ),
					this, SLOT( createNewProject() ),
					QKeySequence::New );

	m_templatesMenu = new QMenu( tr("New from template"), this );
	connect( m_templatesMenu, SIGNAL( aboutToShow() ), SLOT( fillTemplatesMenu() ) );
	connect( m_templatesMenu, SIGNAL( triggered( QAction * ) ),
		 SLOT( createNewProjectFromTemplate( QAction * ) ) );

	project_menu->addMenu(m_templatesMenu);

	project_menu->addAction( embed::getIconPixmap( "project_open" ),
					tr( "&Open..." ),
					this, SLOT( openProject() ),
					QKeySequence::Open );

	m_recentlyOpenedProjectsMenu = project_menu->addMenu(
				embed::getIconPixmap( "project_open_recent" ),
					tr( "&Recently Opened Projects" ) );
	connect( m_recentlyOpenedProjectsMenu, SIGNAL( aboutToShow() ),
			this, SLOT( updateRecentlyOpenedProjectsMenu() ) );
	connect( m_recentlyOpenedProjectsMenu, SIGNAL( triggered( QAction * ) ),
			this, SLOT( openRecentlyOpenedProject( QAction * ) ) );

	project_menu->addAction( embed::getIconPixmap( "project_save" ),
					tr( "&Save" ),
					this, SLOT( saveProject() ),
					QKeySequence::Save );
	project_menu->addAction( embed::getIconPixmap( "project_saveas" ),
					tr( "Save &As..." ),
					this, SLOT( saveProjectAs() ),
					Qt::CTRL + Qt::SHIFT + Qt::Key_S );
	project_menu->addAction( embed::getIconPixmap( "project_save" ),
					tr( "Save as New &Version" ),
					this, SLOT( saveProjectAsNewVersion() ),
					Qt::CTRL + Qt::ALT + Qt::Key_S );

	project_menu->addAction( tr( "Save as default template" ),
				     this, SLOT( saveProjectAsDefaultTemplate() ) );

	project_menu->addSeparator();
	project_menu->addAction( embed::getIconPixmap( "project_import" ),
					tr( "Import..." ),
					Engine::getSong(),
					SLOT( importProject() ) );
	project_menu->addAction( embed::getIconPixmap( "project_export" ),
					tr( "E&xport..." ),
					Engine::getSong(),
					SLOT( exportProject() ),
					Qt::CTRL + Qt::Key_E );
	project_menu->addAction( embed::getIconPixmap( "project_export" ),
					tr( "E&xport Tracks..." ),
					Engine::getSong(),
					SLOT( exportProjectTracks() ),
					Qt::CTRL + Qt::SHIFT + Qt::Key_E );

	// temporarily disabled broken MIDI export				
	/*project_menu->addAction( embed::getIconPixmap( "midi_file" ),
					tr( "Export &MIDI..." ),
					Engine::getSong(),
					SLOT( exportProjectMidi() ),
					Qt::CTRL + Qt::Key_M );*/

	project_menu->addSeparator();
	project_menu->addAction( embed::getIconPixmap( "exit" ), tr( "&Quit" ),
					qApp, SLOT( closeAllWindows() ),
					Qt::CTRL + Qt::Key_Q );


	QMenu * edit_menu = new QMenu( this );
	menuBar()->addMenu( edit_menu )->setText( tr( "&Edit" ) );
	m_undoAction = edit_menu->addAction( embed::getIconPixmap( "edit_undo" ),
					tr( "Undo" ),
					this, SLOT( undo() ),
					QKeySequence::Undo );
	m_redoAction = edit_menu->addAction( embed::getIconPixmap( "edit_redo" ),
					tr( "Redo" ),
					this, SLOT( redo() ),
					QKeySequence::Redo );
	// Ensure that both (Ctrl+Y) and (Ctrl+Shift+Z) activate redo shortcut regardless of OS defaults
	if (QKeySequence(QKeySequence::Redo) != QKeySequence(Qt::CTRL + Qt::Key_Y))
	{
		new QShortcut( QKeySequence( Qt::CTRL + Qt::Key_Y ), this, SLOT(redo()) );
	}
	if (QKeySequence(QKeySequence::Redo) != QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_Z ))
	{
		new QShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_Z ), this, SLOT(redo()) );
	}

	edit_menu->addSeparator();
	edit_menu->addAction( embed::getIconPixmap( "setup_general" ),
					tr( "Settings" ),
					this, SLOT( showSettingsDialog() ) );
	connect( edit_menu, SIGNAL(aboutToShow()), this, SLOT(updateUndoRedoButtons()) );

	m_viewMenu = new QMenu( this );
	menuBar()->addMenu( m_viewMenu )->setText( tr( "&View" ) );
	connect( m_viewMenu, SIGNAL( aboutToShow() ),
		 this, SLOT( updateViewMenu() ) );
	connect( m_viewMenu, SIGNAL(triggered(QAction*)), this,
		SLOT(updateConfig(QAction*)));


	m_toolsMenu = new QMenu( this );
	for( const Plugin::Descriptor* desc : pluginFactory->descriptors(Plugin::Tool) )
	{
		m_toolsMenu->addAction( desc->logo->pixmap(), desc->displayName );
		m_tools.push_back( ToolPlugin::instantiate( desc->name, /*this*/NULL )
						   ->createView(this) );
	}
	if( !m_toolsMenu->isEmpty() )
	{
		menuBar()->addMenu( m_toolsMenu )->setText( tr( "&Tools" ) );
		connect( m_toolsMenu, SIGNAL( triggered( QAction * ) ),
					this, SLOT( showTool( QAction * ) ) );
	}
Beispiel #14
0
void DGLMainWindow::createActions() {

    // create "QActions" - bindings between mainwindow clickable widgets,
    // and
    // local slots

    quitAct = new QAction(tr("&Quit"), this);
    quitAct->setShortcuts(QKeySequence::Quit);
    quitAct->setStatusTip(tr("Quit the application"));
    CONNASSERT(quitAct, SIGNAL(triggered()), this, SLOT(close()));
    quitAct->setShortcut(QKeySequence(Qt::ALT + Qt::Key_F4));

    aboutAct = new QAction(tr("&About"), this);
    aboutAct->setStatusTip(tr("Show the application's About box"));
    CONNASSERT(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
    aboutAct->setShortcut(QKeySequence(Qt::Key_F1));

    newProjectAct = new QAction(tr("&New Project..."), this);
    newProjectAct->setStatusTip(tr("Created new debugging project"));
    CONNASSERT(newProjectAct, SIGNAL(triggered()), this, SLOT(newProject()));
    newProjectAct->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_N));


    openProjectAct = new QAction(tr("&Open Project..."), this);
    openProjectAct->setStatusTip(tr("Opens a debugging project"));
    CONNASSERT(openProjectAct, SIGNAL(triggered()), this, SLOT(openProject())); //TODO: implement
    openProjectAct->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_O));

    saveProjectAct = new QAction(tr("&Save Project"), this);
    saveProjectAct->setStatusTip(tr("Save a debugging project"));
    CONNASSERT(saveProjectAct, SIGNAL(triggered()), this, SLOT(saveProject())); //TODO: implement
    saveProjectAct->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_S));

    saveAsProjectAct = new QAction(tr("&Save Project As ..."), this);
    saveAsProjectAct->setStatusTip(tr("Save a debugging project as as a file ..."));
    CONNASSERT(saveAsProjectAct, SIGNAL(triggered()), this, SLOT(saveProjectAs())); //TODO: implement
    saveAsProjectAct->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_S));
    

    projectProperiesAct = new QAction(tr("&Project properties..."), this);
    projectProperiesAct->setStatusTip(tr("Change properties of current project"));
    CONNASSERT(projectProperiesAct, SIGNAL(triggered()), this, SLOT(projectProperties()));
    

    closeProjectAct = new QAction(tr("&Close project"), this);
    closeProjectAct->setStatusTip(tr("Created new debugging project"));
    CONNASSERT(closeProjectAct, SIGNAL(triggered()), this, SLOT(closeProject()));

    debugStartAct = new QAction(tr("&Start debugging"), this);
    debugStartAct->setStatusTip(tr("Stop debugging."));
    CONNASSERT(debugStartAct, SIGNAL(triggered()), this, SLOT(debugStart()));
    CONNASSERT(&m_controller, SIGNAL(setDisconnected(bool)), debugStartAct,
        SLOT(setVisible(bool)));
    debugStartAct->setShortcut(QKeySequence(Qt::Key_F5));

    debugStopAct = new QAction(tr("Sto&p debugging"), this);
    debugStopAct->setStatusTip(tr("Stop debugging."));
    CONNASSERT(debugStopAct, SIGNAL(triggered()), this, SLOT(debugStop()));
    CONNASSERT(&m_controller, SIGNAL(setConnected(bool)), debugStopAct,
        SLOT(setEnabled(bool)));
    debugStopAct->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_F5));
    debugStopAct->setEnabled(false);

    debugTerminateAct = new QAction(tr("Terminate"), this);
    debugTerminateAct->setStatusTip(tr("Terminate debugged process."));
    CONNASSERT(debugTerminateAct, SIGNAL(triggered()), this, SLOT(debugTerminate()));
    CONNASSERT(&m_controller, SIGNAL(setConnected(bool)), debugTerminateAct,
        SLOT(setEnabled(bool)));
    debugTerminateAct->setEnabled(false);

    debugContinueAct = new QAction(tr("&Continue"), this);
    debugContinueAct->setStatusTip(tr("Continue program execution"));
    CONNASSERT(debugContinueAct, SIGNAL(triggered()), &m_controller,
               SLOT(debugContinue()));
    CONNASSERT(&m_controller, SIGNAL(setConnected(bool)), debugContinueAct,
               SLOT(setVisible(bool)));
    CONNASSERT(&m_controller, SIGNAL(setBreaked(bool)), debugContinueAct,
               SLOT(setEnabled(bool)));
    debugContinueAct->setShortcut(QKeySequence(Qt::Key_F5));
    debugContinueAct->setVisible(false);

    debugInterruptAct = new QAction(tr("&Break on next call"), this);
    debugInterruptAct->setStatusTip(
            tr("Break program execution on GL call"));
    CONNASSERT(debugInterruptAct, SIGNAL(triggered()), &m_controller,
               SLOT(debugInterrupt()));
    CONNASSERT(&m_controller, SIGNAL(setConnected(bool)), debugInterruptAct,
               SLOT(setEnabled(bool)));
    CONNASSERT(&m_controller, SIGNAL(setRunning(bool)), debugInterruptAct,
               SLOT(setEnabled(bool)));
    debugInterruptAct->setShortcut(QKeySequence(Qt::Key_F6));
    debugInterruptAct->setEnabled(false);

    debugStepAct = new QAction(tr("&Step"), this);
    debugStepAct->setStatusTip(tr("Step one GL call"));
    CONNASSERT(debugStepAct, SIGNAL(triggered()), &m_controller,
               SLOT(debugStep()));
    CONNASSERT(&m_controller, SIGNAL(setConnected(bool)), debugStepAct,
               SLOT(setEnabled(bool)));
    CONNASSERT(&m_controller, SIGNAL(setBreaked(bool)), debugStepAct,
               SLOT(setEnabled(bool)));
    debugStepAct->setShortcut(QKeySequence(Qt::Key_F11));
    debugStepAct->setEnabled(false);

    debugStepDrawCallAct = new QAction(tr("&Draw step"), this);
    debugStepDrawCallAct->setStatusTip(tr("Step one GL drawing call"));
    CONNASSERT(debugStepDrawCallAct, SIGNAL(triggered()), &m_controller,
               SLOT(debugStepDrawCall()));
    CONNASSERT(&m_controller, SIGNAL(setConnected(bool)), debugStepDrawCallAct,
               SLOT(setEnabled(bool)));
    CONNASSERT(&m_controller, SIGNAL(setBreaked(bool)), debugStepDrawCallAct,
               SLOT(setEnabled(bool)));
    debugStepDrawCallAct->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_F11));
    debugStepDrawCallAct->setEnabled(false);

    debugStepFrameAct = new QAction(tr("&Frame step"), this);
    debugStepFrameAct->setStatusTip(tr("Step one GL frame"));
    CONNASSERT(debugStepFrameAct, SIGNAL(triggered()), &m_controller,
               SLOT(debugStepFrame()));
    CONNASSERT(&m_controller, SIGNAL(setConnected(bool)), debugStepFrameAct,
               SLOT(setEnabled(bool)));
    CONNASSERT(&m_controller, SIGNAL(setBreaked(bool)), debugStepFrameAct,
               SLOT(setEnabled(bool)));
    debugStepFrameAct->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_F11));
    debugStepFrameAct->setEnabled(false);

    addDeleteBreakPointsAct = new QAction(tr("&Breakpoints..."), this);
    addDeleteBreakPointsAct->setStatusTip(tr("Add or remove breakpoints"));
    CONNASSERT(addDeleteBreakPointsAct, SIGNAL(triggered()), this,
               SLOT(addDeleteBreakPoints()));
    addDeleteBreakPointsAct->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_B));

    setBreakOnGLErrorAct = new QAction(tr("Break on GL error"), this);
    setBreakOnGLErrorAct->setStatusTip(
            tr("Break execution on GL error (glGetError() != GL_NO_ERROR)"));

    // this action has a state - it is checbox-like checkable

    DGLConfiguration& currentConfig = m_controller.getConfig();

    setBreakOnGLErrorAct->setCheckable(true);
    setBreakOnGLErrorAct->setChecked(currentConfig.m_BreakOnGLError);
    CONNASSERT(setBreakOnGLErrorAct, SIGNAL(toggled(bool)), this,
               SLOT(setBreakOnWhatever(bool)));

    setBreakOnDebugOutputAct = new QAction(tr("Break on debug output"), this);
    setBreakOnDebugOutputAct->setStatusTip(
            tr("Break execution on debug output message"));

    // this action has a state - it is checbox-like checkable

    setBreakOnDebugOutputAct->setCheckable(true);
    setBreakOnDebugOutputAct->setChecked(
            currentConfig.m_BreakOnGLError);
    CONNASSERT(setBreakOnDebugOutputAct, SIGNAL(toggled(bool)), this,
               SLOT(setBreakOnWhatever(bool)));

    setBreakOnCompilerErrAct =
            new QAction(tr("Break on compiler/linker error"), this);
    setBreakOnCompilerErrAct->setStatusTip(
            tr("Break execution on debug GLSL compiler or linker error"));

    // this action has a state - it is checbox-like checkable

    setBreakOnCompilerErrAct->setCheckable(true);
    setBreakOnCompilerErrAct->setChecked(
            currentConfig.m_BreakOnCompilerError);
    CONNASSERT(setBreakOnCompilerErrAct, SIGNAL(toggled(bool)), this,
               SLOT(setBreakOnWhatever(bool)));

    // Only one color scheme can be choosed - put all related actions to
    // action
    // group

    setColorSchemeActGroup = new QActionGroup(this);

    // iterate through all color schemes. for each one create one action

    for (uint i = 0; i < DGLNUM_COLOR_SCHEMES; i++) {
        setColorSchemeActs[i] = new QAction(tr(dglColorSchemes[i].name), this);
        setColorSchemeActs[i]->setCheckable(true);
        setColorSchemeActs[i]->setActionGroup(setColorSchemeActGroup);
        setColorSchemeActs[i]->setStatusTip(tr("Set this color scheme"));

        // connect all color scheme actions to one mapper, so we can connect
        // it
        // later to only one signal

        m_SetColorSchemeSignalMapper.setMapping(setColorSchemeActs[i], i);
        CONNASSERT(setColorSchemeActs[i], SIGNAL(triggered()),
                   &m_SetColorSchemeSignalMapper, SLOT(map()));
    }

    // mapper maps connected actions to one emitted signal by int parameter.
    // Connect this signal to "this"

    CONNASSERT(&m_SetColorSchemeSignalMapper, SIGNAL(mapped(int)), this,
               SLOT(setColorScheme(int)));

    configurationAct = new QAction(tr("Configuration..."), this);
    configurationAct->setStatusTip(tr("Configuration options"));
    CONNASSERT(configurationAct, SIGNAL(triggered()), this, SLOT(configure()));

    prepareAndroidAct = new QAction(tr("Prepare Android device..."), this);
    prepareAndroidAct->setStatusTip(tr("Installs " DGL_PRODUCT " on Android device"));
    CONNASSERT(prepareAndroidAct, SIGNAL(triggered()), this,
               SLOT(androidPrepare()));
}
Beispiel #15
0
void MainWindow::on_actionSave_project_as_triggered()
{
    saveProjectAs();
}
Beispiel #16
0
RMainWnd::RMainWnd(reditor::REditor* edit) : QMainWindow(), medit(edit)
{
    setWindowTitle(tr("Room Editor"));
    setWindowIcon(QIcon(":/resources/favicon.ico"));
    
    // central widget
    meditWnd = new REditWnd(medit->objects(), medit->camera(), this);
    setCentralWidget(meditWnd);
    
    // set corners for docks
    setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);
    setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
    setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
    setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
    
    // docks
    mloggerDock = new QDockWidget(this);
    mloggerDock->setWindowTitle(tr("Editor Log"));
    mlogger = new RLogger(mloggerDock);
    mloggerDock->setWidget(mlogger);
    addDockWidget(Qt::BottomDockWidgetArea, mloggerDock);
    // TODO attach dock window with objects on the scene
    
    // File menu
    QMenu* fileMenu = menuBar()->addMenu(tr("&File"));
    QAction* newAction = fileMenu->addAction(tr("&New Project"), this, SIGNAL(newProject()), QKeySequence::New);
    newAction->setIcon(QIcon(":/resources/new.png"));
    QAction* openAction = fileMenu->addAction(tr("&Open Project.."), this, SIGNAL(openProject()), QKeySequence::Open);
    openAction->setIcon(QIcon(":/resources/open.png"));
    fileMenu->addSeparator();
    msaveAction = fileMenu->addAction(tr("&Save Project"), this, SIGNAL(saveProject()), QKeySequence::Save);
    msaveAction->setIcon(QIcon(":/resources/save.png"));
    msaveAsAction = fileMenu->addAction(tr("S&ave Project As..."), this, SIGNAL(saveProjectAs()), Qt::SHIFT + Qt::CTRL + Qt::Key_S);
    msaveAsAction->setIcon(QIcon(":/resources/saveAs.png"));
    enableSave(false); // activate after user makes some changes, no sense to save empty project
    fileMenu->addSeparator();
    fileMenu->addAction(tr("&Exit.."), this, SLOT(close()), QKeySequence::Quit);
    
    // Help menu
    QMenu* helpMenu = menuBar()->addMenu(tr("&Help"));
    helpMenu->addAction(tr("&About RoomEdit"), this, SIGNAL(helpAbout()));
    
    // File toolbar
    QToolBar* fileToolBar = addToolBar(tr("File"));
    fileToolBar->addAction(newAction);
    fileToolBar->addAction(openAction);
    fileToolBar->addSeparator();
    fileToolBar->addAction(msaveAction);
    fileToolBar->addAction(msaveAsAction);
    
    // Camera view toolbar
    QToolBar* cameraToolBar = addToolBar(tr("Camera"));
    mcameraGroup = new QButtonGroup(cameraToolBar);
    QPushButton * cam1 = new QPushButton(QString("1"), this);
    QPushButton * cam2 = new QPushButton(QString("2"), this);
    QPushButton * cam3 = new QPushButton(QString("3"), this);
    cam1->setCheckable(true);
    cam2->setCheckable(true);
    cam3->setCheckable(true);
    cam1->setChecked(true);
    mcameraGroup->addButton(cam1, 1);
    mcameraGroup->addButton(cam2, 2);
    mcameraGroup->addButton(cam3, 3);
    mcameraGroup->setExclusive(true);
    connect(mcameraGroup, SIGNAL(buttonClicked(int)), this, SIGNAL(switchCamera(int)));
    cameraToolBar->addWidget(cam1);
    cameraToolBar->addWidget(cam2);
    cameraToolBar->addWidget(cam3);
}