Esempio n. 1
0
void MainWindow::on_actionAbout_triggered(void)
{
	// build up about box string
	QString aboutString(tr("<h3>Interactive BASIC Compiler Project</h3>"));

	const char *copyright = m_commandLine->copyrightStatement();
	// add version and copyright year to string
	aboutString.append(tr(copyright).arg(tr("Version %1")
		.arg(m_commandLine->version())).arg(m_commandLine->copyrightYear()));

	// add license statements
	aboutString.append(tr("<p>This program is free software: you can "
		"redistribute it and/or modify it under the terms of the GNU General "
		"Public License as published by the Free Software Foundation, either "
		"version 3 of the License, or (at your option) any later version."));
	aboutString.append(tr("<p>This program is distributed in the hope that it "
		"will be useful, but WITHOUT ANY WARRANTY; without even the implied "
		"warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  "
		"See the GNU General Public License for more details."));
	aboutString.append(tr("<p>For a copy of the GNU General Public License, "
		"<br>see <a href=\"http://www.gnu.org/licenses\" target=\"_blank\">"
		"http://www.gnu.org/licenses</a>."));

	// add oxygen icon license statement
	aboutString.append(tr("<p>The Oxygen icons (see "
		"<a href=\"http://www.oxygen-icons.org\" target=\"_blank\">"
		"http://www.oxygen-icons.org</a>) are used<br>under LGPLv3, "
		"see <a href=\"http://www.gnu.org/copyleft/lesser.html\" "
		"target=\"_blank\">http://www.gnu.org/copyleft/lesser.html</a>."));

	QMessageBox::about(this, tr("About IBCP"), aboutString);
}
Esempio n. 2
0
CMagnumWin::CMagnumWin() : m_shortcutFind( this ){

    m_documentTabs.setTabsClosable( true );
    connect( &m_documentTabs , SIGNAL(tabCloseRequested(int)) , this , SLOT(tabClose(int)) );
    connect( &m_documentTabs , SIGNAL(currentChanged(int)) , this , SLOT(currentDocumentChanged(int)) );
    setCentralWidget( &m_documentTabs );

    QMenu* file = m_mainMenu.addMenu( "File" );
    connect( file->addAction( "New" ) , SIGNAL(triggered()) , this , SLOT(newDocument()) );
    connect( file->addAction( "Open" ) , SIGNAL(triggered()) , this , SLOT(loadDocument()) );

    m_menuLastOpened.setTitle("Open recent");
    connect( &m_menuLastOpened , SIGNAL(triggered(QAction*)) , this , SLOT(lastOpened_Action(QAction*)) );
    file->addMenu( &m_menuLastOpened );
    file->addSeparator();

    connect( file->addAction( "Save" ) , SIGNAL(triggered()) , this , SLOT(saveCurrentDocument()) );
    connect( file->addAction( "Save As..." ) , SIGNAL(triggered()) , this , SLOT(saveCurrentDocumentAs()) );
    connect( file->addAction( "Save All" ) , SIGNAL(triggered()) , this , SLOT(saveAllDocument()) );

    file->addSeparator();
    connect( file->addAction( "Close" ) , SIGNAL(triggered()) , this , SLOT(closeCurrentDocument()) );
    connect( file->addAction( "Close All" ) , SIGNAL(triggered()) , this , SLOT(closeAllDocument()) );

    file->addSeparator();
    connect( file->addAction( tr( "About" ) ) , SIGNAL(triggered()) , this , SLOT(aboutDialog()) );

    setMenuBar( &m_mainMenu );

    m_mainToolbar.setObjectName( "mainWindowToolBar" );

    connect( m_mainToolbar.addAction( QIcon(":doc_new") , "New" ) , SIGNAL(triggered()) , this , SLOT(newDocument()) );
    connect( m_mainToolbar.addAction( QIcon(":doc_open") , "Open" ) , SIGNAL(triggered()) , this , SLOT(loadDocument()) );
    connect( m_mainToolbar.addAction( QIcon(":doc_filesave") , "Save" ) , SIGNAL(triggered()) , this , SLOT(saveCurrentDocument()) );
    connect( m_mainToolbar.addAction( QIcon(":doc_filesaveas") , "Save as..." ) , SIGNAL(triggered()) , this , SLOT(saveCurrentDocumentAs()) );
    connect( m_mainToolbar.addAction( QIcon(":doc_filesaveall") , "Save All" ) , SIGNAL(triggered()) , this , SLOT(saveAllDocument()) );

    //connect( m_mainToolbar.addAction("TEST") , SIGNAL(triggered()) , this , SLOT(testEvent()) );

    addToolBar( &m_mainToolbar );

    m_findWidget = new CFindWindow( this );
    connect( m_findWidget , SIGNAL(goTo(CDocument*,int)),this,SLOT(findWin_goTo(CDocument*,int)));
    addDockWidget( Qt::LeftDockWidgetArea , m_findWidget );

    newDocument();

    m_projectManager = new CProject( this );
    connect( m_projectManager, SIGNAL(gotoDocumentLine(CDocument*,int)), this, SLOT(findWin_goTo(CDocument*,int)) );
    addDockWidget( Qt::LeftDockWidgetArea, m_projectManager );

    m_shortcutFind.setKey( Qt::CTRL + Qt::Key_F );
    connect( &m_shortcutFind , SIGNAL(activated()) , this , SLOT( shortcutFind() ) );

    loadSettings();

    connect( &m_fileSystemNotification , SIGNAL(fileChanged(QString)) ,
             this , SLOT(fsNotify(QString)) );

    QString aboutString( "Magnum\n" );
    aboutString += "Kuka software editor\nRelease: 0.1\n\n";
    aboutString += "For information or suggestion contact [email protected]";

    m_aboutDialog = new CAboutWindow( ":PROGICO" , aboutString , this );

    setAcceptDrops( true );
}