bool GolangCodePlugin::load(LiteApi::IApplication *app) { m_liteApp = app; m_code = new GolangCode(app,this); m_commentAct = new QAction(tr("Comment/Uncomment Selection"),this); m_commentAct->setShortcut(QKeySequence("CTRL+/")); connect(m_commentAct,SIGNAL(triggered()),this,SLOT(editorComment())); connect(app->editorManager(),SIGNAL(editorCreated(LiteApi::IEditor*)),this,SLOT(editorCreated(LiteApi::IEditor*))); connect(app->editorManager(),SIGNAL(currentEditorChanged(LiteApi::IEditor*)),this,SLOT(currentEditorChanged(LiteApi::IEditor*))); connect(app,SIGNAL(loaded()),this,SLOT(appLoaded())); return true; }
TextOutput::TextOutput(LiteApi::IApplication *app, bool readOnly, QWidget *parent) : TerminalEdit(parent), m_liteApp(app) { this->setReadOnly(readOnly); m_fmt = this->currentCharFormat(); m_defPalette = this->palette(); m_clrText = m_defPalette.foreground().color(); m_clrTag = Qt::darkBlue; m_clrError = Qt::red; m_existsTimer.start(); connect(m_liteApp,SIGNAL(loaded()),this,SLOT(appLoaded())); }
DlvDebugger::DlvDebugger(LiteApi::IApplication *app, QObject *parent) : LiteApi::IDebugger(parent), m_liteApp(app), m_envManager(0), m_tty(0) { m_process = new QProcess(this); m_asyncModel = new QStandardItemModel(this); m_asyncItem = new QStandardItem; m_asyncModel->appendRow(m_asyncItem); /* m_asyncModel->setHeaderData(0,Qt::Horizontal,"Reason"); m_asyncModel->setHeaderData(1,Qt::Horizontal,"Address"); m_asyncModel->setHeaderData(2,Qt::Horizontal,"Function"); m_asyncModel->setHeaderData(3,Qt::Horizontal,"File"); m_asyncModel->setHeaderData(4,Qt::Horizontal,"Line"); m_asyncModel->setHeaderData(5,Qt::Horizontal,"Thread ID"); m_asyncModel->setHeaderData(6,Qt::Horizontal,"Stoped Threads"); */ m_varsModel = new QStandardItemModel(0,2,this); m_varsModel->setHeaderData(0,Qt::Horizontal,"Name"); m_varsModel->setHeaderData(1,Qt::Horizontal,"Value"); //m_varsModel->setHeaderData(2,Qt::Horizontal,"Type"); m_watchModel = new QStandardItemModel(0,2,this); m_watchModel->setHeaderData(0,Qt::Horizontal,"Name"); m_watchModel->setHeaderData(1,Qt::Horizontal,"Value"); //m_watchModel->setHeaderData(2,Qt::Horizontal,"Type"); m_framesModel = new QStandardItemModel(0,5,this); m_framesModel->setHeaderData(0,Qt::Horizontal,"Level"); m_framesModel->setHeaderData(1,Qt::Horizontal,"Address"); m_framesModel->setHeaderData(2,Qt::Horizontal,"Function"); m_framesModel->setHeaderData(3,Qt::Horizontal,"File"); m_framesModel->setHeaderData(4,Qt::Horizontal,"Line"); m_libraryModel = new QStandardItemModel(0,2,this); m_libraryModel->setHeaderData(0,Qt::Horizontal,"Id"); m_libraryModel->setHeaderData(1,Qt::Horizontal,"Thread Groups"); m_gdbinit = false; m_gdbexit = false; connect(app,SIGNAL(loaded()),this,SLOT(appLoaded())); connect(m_process,SIGNAL(started()),this,SIGNAL(debugStarted())); connect(m_process,SIGNAL(finished(int)),this,SLOT(finished(int))); connect(m_process,SIGNAL(error(QProcess::ProcessError)),this,SLOT(error(QProcess::ProcessError))); connect(m_process,SIGNAL(readyReadStandardError()),this,SLOT(readStdError())); connect(m_process,SIGNAL(readyReadStandardOutput()),this,SLOT(readStdOutput())); }
bool ProjectManager::initWithApp(IApplication *app) { if (!IProjectManager::initWithApp(app)) { return false; } m_widget = new QScrollArea; m_widget->setFrameShape(QFrame::NoFrame); m_widget->setWidgetResizable(true); m_folderProject = new FolderProject(m_liteApp); //m_toolWindowAct = m_liteApp->toolWindowManager()->addToolWindow(Qt::LeftDockWidgetArea,m_widget,"projects",tr("Projects"),false); connect(m_liteApp,SIGNAL(loaded()),this,SLOT(appLoaded())); m_bAutoCloseProjectEditors = m_liteApp->settings()->value(LITEAPP_AUTOCLOSEPROEJCTFILES,true).toBool(); return true; }
bool GolangFmtPlugin::initWithApp(LiteApi::IApplication *app) { if (!LiteApi::IPlugin::initWithApp(app)) { return false; } m_liteApp->optionManager()->addFactory(new GolangFmtOptionFactory(m_liteApp,this)); m_fmt = new GolangFmt(m_liteApp,this); m_gofmtAct = new QAction(QIcon("icon:golangfmt/images/gofmt.png"),tr("gofmt"),this); m_gofmtAct->setShortcut(QKeySequence("Shift+F7")); m_goplayAct = new QAction(QIcon("icon:golangfmt/images/gofmt.png"),tr("gofmt"),this); connect(m_gofmtAct,SIGNAL(triggered()),m_fmt,SLOT(gofmt())); connect(m_goplayAct,SIGNAL(triggered()),this,SLOT(goplayFmt())); connect(m_liteApp->editorManager(),SIGNAL(editorCreated(LiteApi::IEditor*)),this,SLOT(editorCreated(LiteApi::IEditor*))); connect(m_liteApp,SIGNAL(loaded()),this,SLOT(appLoaded())); return true; }
int SasiApp::exec() { QSplashScreen* splash = 0; QPixmap splash_pixmap; QWidget* show_screen = desktop()->screen( 0 ); if ( splash_pixmap.load( SLcustomizations().GraphicsDir() + "/splash.png" ) ) { splash = new QSplashScreen(show_screen,splash_pixmap); splash->show(); } wxLogChain* logchain = 0; wxLog::SetActiveTarget( new wxLogChain( new wxLogStream( &std::cout ) ) ); //this needs to called _before_ mainwindow instance is created wxInitAllImageHandlers(); wxFileSystem::AddHandler(new wxZipFSHandler); wxSocketBase::Initialize(); usync().FastLoadUnitSyncLibInit( ); QDeclarativeView view(show_screen); QString qmldir; try { qmldir = SLcustomizations().QmlDir(); } catch ( Customizations::DataException& e ) { //for some f****d up reason the strings get internally f****d up w/o the hardcopy QList<QString> copy = e.errors_; QErrorWindow error_win ( copy ); return error_win.exec(); } AudioManager audio_manager (this); audio_manager.start(); view.engine()->addImportPath( qmldir ); #ifdef __WXMSW__ //for webkit declarative plugin view.engine()->addImportPath( QDir( QCoreApplication::applicationDirPath() + "/imports").absolutePath() ); #endif // Visual initialization view.engine()->addImageProvider("minimaps", new MinimapImageProvider); view.engine()->addImageProvider("graphics", new GraphicsProvider); view.engine()->addImageProvider("sides", new SideImageProvider); #if USE_OPENGL QGLFormat format = QGLFormat::defaultFormat(); #ifdef Q_WS_MAC format.setSampleBuffers(true); #else format.setSampleBuffers(false); #endif QGLWidget *glWidget = new QGLWidget(format, &view); view.setViewport(glWidget); view.setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate); #endif view.setAttribute(Qt::WA_OpaquePaintEvent); view.setAttribute(Qt::WA_NoSystemBackground); view.setResizeMode(QDeclarativeView::SizeRootObjectToView); MaplistModel maplist_model( usync().GetMapList() ); SkirmishModel skirmish_model; SideModel side_model( SLcustomizations().GetModname() ); PresetModel preset_model(this); ScreenResolutionModel screenres_model(this); spring().connect( &spring(), SIGNAL(springStarted()), &audio_manager, SLOT(pause())); spring().connect( &spring(), SIGNAL(springStopped()), &audio_manager, SLOT(resume())); QObject::connect((QObject*)view.engine(), SIGNAL(quit()), this, SLOT(quit())); QObject::connect((QObject*)view.engine(), SIGNAL(quit()), &audio_manager, SLOT(doQuit())); QDeclarativeContext* ctxt = view.rootContext(); ctxt->setContextProperty("maplistModel", &maplist_model ); ctxt->setContextProperty("skirmishModel", &skirmish_model ); ctxt->setContextProperty("sideModel", &side_model ); ctxt->setContextProperty("audioManager", &audio_manager ); ctxt->setContextProperty("presetModel", &preset_model ); ctxt->setContextProperty("screenresModel", &screenres_model ); const int sleep_seconds = -1; for ( int i = sleep_seconds; splash && i > 0; i-- ) { splash->showMessage( QString("sleeping for %1 seconds, just to show you this").arg( i ), Qt::AlignHCenter | Qt::AlignBottom ); processEvents(); sleep( 1 ); } // view.showFullScreen(); if ( splash ) splash->finish(&view); view.setSource(QUrl(qmldir + "/main.qml")); QObject::connect(this, SIGNAL(appLoaded()), (QObject*)view.rootObject(), SLOT(onAppLoaded())); QList<QDeclarativeError> errors = view.errors(); if ( errors.size() ) { QErrorWindow error_window ( errors ); return error_window.exec(); } view.show(); view.setFocus(); emit appLoaded(); int ret = QApplication::exec(); audio_manager.wait( 5 /*seconds*/ ); return ret; }