Пример #1
0
void PhpPlugin::RunXDebugDiagnostics()
{
    PHPXDebugSetupWizard wiz(EventNotifier::Get()->TopFrame());
    if(wiz.RunWizard(wiz.GetFirstPage())) {
    }
#if 0
    XDebugTester xdebugTester;
    if(xdebugTester.RunTest()) {
        // Display the result
        wxString html;
        html << "<html><body>";
        html << "<table>";

        html << "<tr valign=\"top\" align=\"left\"><th>What?</th><th>Result</th><th>Description</th></tr>";
        const XDebugTester::ResultMap_t& result = xdebugTester.GetResults();
        XDebugTester::ResultMap_t::const_iterator iter = result.begin();
        for(; iter != result.end(); ++iter) {
            html << "<tr valign=\"top\" align=\"left\">";
            html << "<td>" << iter->first << "</td>";
            html << "<td>" << iter->second.first << "</td>";
            html << "<td>" << iter->second.second << "</td>";
            html << "</tr>";
        }

        html << "</table></body></html>";

        XDebugDiagDlg dlg(EventNotifier::Get()->TopFrame());
        dlg.Load(html);
        dlg.ShowModal();
    }
#endif
}
void tkUserManagerPrivate::on_createNewUserAct_triggered()
{
    int createdRow = m_UserTableView->model()->rowCount();
    if ( ! m_UserTableView->model()->insertRows( createdRow, 1 ) ) {
        tkLog::addError( this, "Cannot create new user : can not add row to model");
        return;
    }
    QModelIndex index = m_UserTableView->model()->index( createdRow, USER_NAME );
//    m_UserTableView->model()->setData( index, tr( "New User" ) );
    tkUserWizard wiz(m_Parent);
    wiz.setModelRow( createdRow );
    int r = wiz.exec();
    if ( r == QDialog::Rejected ) {
        if ( ! m_UserTableView->model()->removeRows( createdRow, 1 ) ) {
            tkLog::addError( this, "Cannot delete new user : can not delete row to model");
            return;
        } else
            m_Parent->statusBar()->showMessage( tr( "No user created" ), 2000 );
    } else {
        m_UserTableView->selectRow( createdRow );
        on_userTableView_activated( index );
        m_Parent->statusBar()->showMessage( tr( "User created" ), 2000 );
    }
    qApp->setActiveWindow( m_Parent );
    m_Parent->activateWindow();
}
Пример #3
0
void PhpPlugin::OnNewProject(clNewProjectEvent& e)
{
    if(!PHPWorkspace::Get()->IsOpen()) {
        e.Skip();
#if 0
        // No workspace is opened yet, let codelite process this event normally
        e.Skip();
        clNewProjectEvent::Template phpTemplate;
        phpTemplate.m_category = "PHP";
        phpTemplate.m_categoryPng = "m_bmpElephant";
        phpTemplate.m_template = "PHP Project";
        phpTemplate.m_templatePng = "m_bmpPhpFile";
        phpTemplate.m_debugger = "XDebug";
        phpTemplate.m_toolchain = "PHP Tools";
        phpTemplate.m_allowSeparateFolder = true;
        e.GetTemplates().push_back(phpTemplate);
#endif
    } else {
        // we have a PHP workspace opened - handle it ourself
        NewPHPProjectWizard wiz(EventNotifier::Get()->TopFrame());
        if(wiz.RunWizard(wiz.GetFirstPage())) {
            m_workspaceView->CallAfter(&PHPWorkspaceView::CreateNewProject, wiz.GetCreateData());
        }
    }
}
Пример #4
0
// -----------------------------------------------
//   MENU SLOTS
// -----------------------------------------------
// ==== File Menu ====
void LPMain::menuAddPool(QAction *act){
  QString dataset = act->text();
  qDebug() << "Start Wizard for new managing pool:" << dataset;
  LPWizard wiz(this);
  wiz.setDataset(dataset);
  wiz.exec();
  //See if the wizard was cancelled or not
  if(!wiz.cancelled){
    ui->statusbar->showMessage(QString(tr("Enabling dataset management: %1")).arg(dataset),0);
    //run the proper commands to get the dataset enabled
    qDebug() << "Setup Snapshots:" << dataset << " Frequency:" << wiz.localTime;
    if( LPBackend::setupDataset(dataset, wiz.localTime, wiz.totalSnapshots) ){
      /*if(wiz.enableReplication){
      	 qDebug() << "Setting up replication:" << dataset << " Frequency:" << wiz.remoteTime;
	 LPBackend::setupReplication(dataset, wiz.remoteHost, wiz.remoteUser, wiz.remotePort, wiz.remoteDataset, wiz.remoteTime);     
	 QMessageBox::information(this,tr("Reminder"),tr("Don't forget to save your SSH key to a USB stick so that you can restore your system from the remote host later!!"));
      }*/
      if(wiz.enableScrub){
      qDebug() << "Settings up scrub:" << dataset << "Frequency:" << wiz.scrubSchedule << "Day:" << wiz.scrubDay << "Time:" << wiz.scrubTime;
      LPBackend::setupScrub(dataset, wiz.scrubTime, wiz.scrubDay, wiz.scrubSchedule);
      }
    }
    ui->statusbar->clearMessage();
    //Now update the list of pools
    updatePoolList();
    if(wiz.openAdvancedConfig){
      QTimer::singleShot(100,this, SLOT(openConfigGUI()) );
    }
  }	
}
Пример #5
0
void wxCrafterTab::OnNewCBProject(wxCommandEvent& event)
{
    NewCodeBlocksProjectWizard wiz(NULL);
    if ( wiz.RunWizard( wiz.GetFirstPage() ) ) {
        // create the project
        ProjectInfo pi = wiz.GetProjectDetails();
        DoCreateProject( pi );
    }
}
Пример #6
0
static void DoFirstTimeWizard()
{
	// first time startup, so give the user the choice of user mode:
	while(true)
	{
		// PCSX2's FTWizard allows improptu restarting of the wizard without cancellation.
		// This is typically used to change the user's language selection.

		FirstTimeWizard wiz( NULL );
		if( wiz.RunWizard( wiz.GetFirstPage() ) ) break;
		if (wiz.GetReturnCode() != pxID_RestartWizard)
			throw Exception::StartupAborted( L"User canceled FirstTime Wizard." );

		Console.WriteLn( Color_StrongBlack, "Restarting First Time Wizard!" );
	}
}
Пример #7
0
void mainUI::slotAddDataset(QAction *act){
  QString dataset = act->text();
  qDebug() << "Start Wizard for new dataset:" << dataset;
  LPWizard wiz(this);
  wiz.setDataset(dataset);
  wiz.exec();
  //See if the wizard was cancelled or not
  if(!wiz.cancelled){
    //run the proper commands to get the dataset enabled
    if( LPBackend::setupDataset(dataset, wiz.localTime, wiz.totalSnapshots) ){
      if(wiz.enableReplication){
	 LPBackend::setupReplication(dataset, wiz.remoteHost, wiz.remoteUser, wiz.remotePort, wiz.remoteDataset, wiz.remoteTime);     
	 QMessageBox::information(this,tr("Reminder"),tr("Don't forget to save your SSH key to a USB stick so that you can restore your system from the remote host later!!"));
      }
    }
  }
  //Now update the UI/Hash
  setupUI();
}
Пример #8
0
BOOL CLangModelsDoc::OnNewDocument()
{
	if(!theApp.getProject())
		return FALSE;

	if (!CTabbedTreeDoc::OnNewDocument())
		return FALSE;

	ASSERTX(m_pCurrentInterface);
/*	if(gsNewLangAbrev.GetLength())	// invoked by the projectdoc import code
	{
		m_pLang = new CCarlaLanguage(gsNewLangAbrev);
		ASSERTX(gsDirContainingCarlaSet.GetLength());
		m_pLang->m_sDirContainingCarlaSet = gsDirContainingCarlaSet;
	}
	else	// invoked by the user and the File menu
	{
*/
	m_pLang = new CCarlaLanguage(this);


	// create a new language or import one from files?
	CDlgNewLanguage dlg;
	if(IDCANCEL == dlg.DoModal())
	{	MessageBox( NULL, "Language creation cancelled.", "Note:", MB_OK);
		return FALSE;
	}

	if(dlg.m_iCreationMethod ==0)
	{
		// to do: put up new language wizard
		CWizNewFromScratch wiz(m_pLang->getMFS()->getRootDicList());
		if(IDCANCEL == wiz.DoModal())
		{
			MessageBox( NULL, "Language creation cancelled.", "Note:", MB_OK);
			return FALSE;
		}
		wiz.m_dictRootUnifiedPage.OnOK(); // dump the list into the mfs
		m_pLang->getMFS()->setUnifiedDictMode(wiz.m_dictRootUnifiedPage.m_bUnifiedMode);
		m_pLang->getMFS()->exchangeAffixDictPaths(	wiz.m_dictAffixesPage.m_sPrefixPath,
													wiz.m_dictAffixesPage.m_sInfixPath,
													wiz.m_dictAffixesPage.m_sSuffixPath,
													TRUE); // read the page

		m_pLang->populateWithDefaults();

		m_pLang->readLangDisplayPage(wiz.m_langDisplayPage);
	//	m_pLang->setAbrev(wiz.m_langDisplayPage.m_sAbrev);
	//	m_pLang->setName(wiz.m_langDisplayPage.m_sName);
	//	m_pLang->setFont(&wiz.m_langDisplayPage.m_logFont);
		// cast is because it is normally const (shame, shame)
	//	((CTextDisplayInfo*)m_pLang->getDisplayInfo())->m_bShowMorphnamesInLangFont = wiz.m_langDisplayPage.m_bShowMorphnamesInLangFont;


		m_pLang->getAnalysisModel().processTestPropertyPages(&wiz.m_affixesPage, &wiz.m_categoryPropogationPage, &wiz.m_finalCatTestPage);
		m_pLang->getCommonModel().readWizPages(&wiz.m_finalCatTestPage);
		m_pLang->addDefaultListOfProcessors();
	}
	else	// import from files
	{
		CWizNewFromFiles* pWiz = new CWizNewFromFiles(m_pLang->getMFS()->getRootDicList());
		if(IDCANCEL == pWiz->DoModal())
		{
			MessageBox( NULL, "Language creation cancelled.", "Note:", MB_OK);
			return FALSE;
		}
		pWiz->m_dictRootUnifiedPage.OnOK(); // dump the list into the mfs
		m_pLang->getMFS()->setUnifiedDictMode(pWiz->m_dictRootUnifiedPage.m_bUnifiedMode);
		m_pLang->getMFS()->exchangeAffixDictPaths(pWiz->m_dictAffixesPage.m_sPrefixPath,
													pWiz->m_dictAffixesPage.m_sInfixPath,
													pWiz->m_dictAffixesPage.m_sSuffixPath,
													TRUE); // read the page

		//m_pLang->OnEditProperties(FALSE);
		m_pLang->readLangDisplayPage(pWiz->m_langDisplayPage);


	m_pLang->m_pFilesWiz = pWiz;	// now when it saves, it will read the dlg,
										// do the conversion, and delete this dialog.

	}
	m_pFunctionalInterface->setupForLang(m_pLang);
	m_pCarlaMenuInterface->setupForLang(m_pLang);
	SetModifiedFlag(TRUE);
	// tell the project that this lang is available
	getProject()->registerLangDoc(this);
//	OnSaveDocument(getProject()->getProjectDir());
	return TRUE;
}
Пример #9
0
void WizardsPlugin::DoCreateNewPlugin()
{
    //Load the wizard
    PluginWizard wiz(wxTheApp->GetTopWindow());
    NewPluginData data;
    if (wiz.Run(data)) {
        //load the template file and replace all variables with the
        //actual values provided by user
        wxString filename(m_mgr->GetStartupDirectory() + wxT("/templates/gizmos/liteeditor-plugin.project.wizard"));
        wxString content;
        if (!ReadFileWithConversion(filename, content)) {
            return;
        }
        
        // Convert the paths provided by user to relative paths
        wxFileName fn(data.GetCodelitePath(), "");
        if ( !fn.MakeRelativeTo( wxFileName(data.GetProjectPath()).GetPath()) ) {
            wxLogMessage(wxT("Warning: Failed to convert paths to relative path."));
        }

#ifdef __WXMSW__
        wxString dllExt(wxT("dll"));
#else
        wxString dllExt(wxT("so"));
#endif

        wxString clpath = fn.GetFullPath();
        fn.Normalize(); // Remove all .. and . from the path
        
        if ( clpath.EndsWith("/") || clpath.EndsWith("\\") ) {
            clpath.RemoveLast();
        }
        
        content.Replace(wxT("$(CodeLitePath)"), clpath);
        content.Replace(wxT("$(DllExt)"), dllExt);
        content.Replace(wxT("$(PluginName)"), data.GetPluginName());
        wxString baseFileName = data.GetPluginName();
        baseFileName.MakeLower();
        content.Replace(wxT("$(BaseFileName)"), baseFileName);
        content.Replace(wxT("$(ProjectName)"), data.GetPluginName());

        //save the file to the disk
        wxString projectFileName;
        projectFileName << data.GetProjectPath();
        {
            wxLogNull noLog;
            ::wxMkdir( wxFileName(data.GetProjectPath()).GetPath() );
        }
        wxFFile file;
        if (!file.Open(projectFileName, wxT("w+b"))) {
            return;
        }

        file.Write(content);
        file.Close();

        //Create the plugin source and header files
        wxFileName srcFile(wxFileName(data.GetProjectPath()).GetPath(), baseFileName);
        srcFile.SetExt("cpp");
        
        wxFileName headerFile(wxFileName(data.GetProjectPath()).GetPath(), baseFileName);
        headerFile.SetExt("h");

        //---------------------------------------------------------------
        //write the content of the file based on the file template
        //---------------------------------------------------------------

        //Generate the source files
        filename = m_mgr->GetStartupDirectory() + wxT("/templates/gizmos/plugin.cpp.wizard");
        content.Clear();
        if (!ReadFileWithConversion(filename, content)) {
            wxMessageBox(_("Failed to load wizard's file 'plugin.cpp.wizard'"), _("CodeLite"), wxICON_WARNING | wxOK);
            return;
        }

        // Expand macros
        content.Replace(wxT("$(PluginName)"), data.GetPluginName());
        content.Replace(wxT("$(BaseFileName)"), baseFileName);
        content.Replace(wxT("$(PluginShortName)"), data.GetPluginName());
        content.Replace(wxT("$(PluginLongName)"), data.GetPluginDescription());
        content.Replace(wxT("$(UserName)"), wxGetUserName().c_str());
        
        // Notify the formatter plugin to format the plugin source files
        clSourceFormatEvent evtFormat(wxEVT_FORMAT_STRING);
        evtFormat.SetInputString( content );
        EventNotifier::Get()->ProcessEvent( evtFormat );
        content = evtFormat.GetFormattedString();
        
        // Write it down
        file.Open(srcFile.GetFullPath(), wxT("w+b"));
        file.Write(content);
        file.Close();
        
        //create the header file
        filename = m_mgr->GetStartupDirectory() + wxT("/templates/gizmos/plugin.h.wizard");
        content.Clear();
        if (!ReadFileWithConversion(filename, content)) {
            wxMessageBox(_("Failed to load wizard's file 'plugin.h.wizard'"), _("CodeLite"), wxICON_WARNING | wxOK);
            return;
        }

        // Expand macros
        content.Replace(wxT("$(PluginName)"), data.GetPluginName());
        content.Replace(wxT("$(BaseFileName)"), baseFileName);
        content.Replace(wxT("$(PluginShortName)"), data.GetPluginName());
        content.Replace(wxT("$(PluginLongName)"), data.GetPluginDescription());
        content.Replace(wxT("$(UserName)"), wxGetUserName().c_str());

        // format the content
        evtFormat.SetString(content);
        EventNotifier::Get()->ProcessEvent( evtFormat );
        content = evtFormat.GetString();
        
        // Write it down
        file.Open(headerFile.GetFullPath(), wxT("w+b"));
        file.Write(content);
        file.Close();

        //add the new project to the workspace
        wxString errMsg;

        //convert the path to be full path as required by the
        //workspace manager
        m_mgr->AddProject(projectFileName);
    }
}