Esempio n. 1
0
RubySupportPart::RubySupportPart(QObject *parent, const char *name, const QStringList& )
  : KDevLanguageSupport (&data, parent, name ? name : "RubySupportPart" )
{
  setInstance(RubySupportFactory::instance());
  setXMLFile("kdevrubysupport.rc");

  KAction *action;
  action = new KAction( i18n("&Run"), "exec", SHIFT + Key_F9,
                        this, SLOT(slotRun()),
                        actionCollection(), "build_execute" );
  action->setToolTip(i18n("Run"));
  action->setWhatsThis(i18n("<b>Run</b><p>Starts an application."));
  action->setIcon("ruby_run.png");

  action = new KAction( i18n("Run Test Under Cursor"), "exec", ALT + Key_F9,
                        this, SLOT(slotRunTestUnderCursor()),
                        actionCollection(), "build_execute_test_function" );
  action->setToolTip(i18n("Run Test Under Cursor"));
  action->setWhatsThis(i18n("<b>Run Test Under Cursor</b><p>Runs the function under the cursor as test."));

  action = new KAction( i18n("Launch Browser"), "network", 0, this, SLOT(slotBrowse()), actionCollection(), "build_launch_browser" );
  action->setToolTip(i18n("Launch Browser"));
  action->setWhatsThis(i18n("<b>Launch Browser</b><p>Opens a web browser pointing to the Ruby Rails server") );

  action = new KAction( i18n("Switch To Controller"), 0, CTRL+ALT+Key_1, this, SLOT(slotSwitchToController()), actionCollection(), "switch_to_controller" );
  action = new KAction( i18n("Switch To Model"), 0, CTRL+ALT+Key_2, this, SLOT(slotSwitchToModel()), actionCollection(), "switch_to_model" );
  action = new KAction( i18n("Switch To View"), 0, CTRL+ALT+Key_3, this, SLOT(slotSwitchToView()), actionCollection(), "switch_to_view" );
  action = new KAction( i18n("Switch To Test"), 0, CTRL+ALT+Key_4, this, SLOT(slotSwitchToTest()), actionCollection(), "switch_to_test" );

  kdDebug() << "Creating RubySupportPart" << endl;

  m_shellWidget = new KDevShellWidget( 0, "irb console");
  m_shellWidget->setIcon( SmallIcon("ruby_config.png", KIcon::SizeMedium, KIcon::DefaultState, RubySupportPart::instance()));
  m_shellWidget->setCaption(i18n("Ruby Shell"));
  mainWindow()->embedOutputView( m_shellWidget, i18n("Ruby Shell"), i18n("Ruby Shell"));
  mainWindow()->raiseView( m_shellWidget );

  connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) );
  connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) );
  connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
        this, SLOT(contextMenu(QPopupMenu *, const Context *)) );
  connect( partController(), SIGNAL(savedFile(const KURL&)),
  	this, SLOT(savedFile(const KURL&)) );
  connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)),
        this, SLOT(projectConfigWidget(KDialogBase*)) );
}
Esempio n. 2
0
PICComponent::PICComponent( ICNDocument *icnDocument, bool newItem, const char *id )
	: Component( icnDocument, newItem, id ? id : "pic" )
{
	m_name = i18n("PIC Micro");
	
	if ( _def_PICComponent_fileName.isEmpty() )
		_def_PICComponent_fileName = i18n("<Enter location of PIC Program>");
	
	m_bCreatedInitialPackage = false;
	m_bLoadingProgram = false;
	m_pGpsim = 0L;
	
	addButton( "run", QRect(), KIcon( "media-playback-start" ) );
	addButton( "pause", QRect(), KIcon( "media-playback-pause" ) );
	addButton( "reset", QRect(), KIcon( "process-stop" ) );
	addButton( "reload", QRect(), KIcon( "view-refresh" ) );
	
	connect( KTechlab::self(), SIGNAL(recentFileAdded(const KUrl &)), this, SLOT(slotUpdateFileList()) );
	
	connect( ProjectManager::self(),	SIGNAL(projectOpened()),		this, SLOT(slotUpdateFileList()) );
	connect( ProjectManager::self(),	SIGNAL(projectClosed()),		this, SLOT(slotUpdateFileList()) );
	connect( ProjectManager::self(),	SIGNAL(projectCreated()),		this, SLOT(slotUpdateFileList()) );
	connect( ProjectManager::self(),	SIGNAL(subprojectCreated()),	this, SLOT(slotUpdateFileList()) );
	connect( ProjectManager::self(),	SIGNAL(filesAdded()),			this, SLOT(slotUpdateFileList()) );
	connect( ProjectManager::self(),	SIGNAL(filesRemoved()),			this, SLOT(slotUpdateFileList()) );
	
	createProperty( "program", Variant::Type::FileName );
	property("program")->setCaption( i18n("Program") );
	QString filter;
	filter = QString("*.flowcode *.cod *.asm *.basic *.c|%1").arg(i18n("All Supported Files"));
	filter += QString("\n*.flowcode|FlowCode (*.flowcode)");
	filter += QString("\n*.cod|%1 (*.cod)").arg(i18n("Symbol File"));
	filter += QString("\n*.asm|%1 (*.asm)").arg(i18n("Assembly Code"));
	filter += QString("\n*.basic *.microbe|Microbe (*.basic, *.microbe)");
	filter += QString("\n*.c|C (*.c)");
	filter += QString("\n*|%1").arg(i18n("All Files"));
	property("program")->setFilter( filter );
	
	// Used for restoring the pins on file loading before we have had a change
	// to compile the PIC program
	createProperty( "lastPackage", Variant::Type::String );
	property("lastPackage")->setHidden( true );
	
// 	//HACK This is to enable loading with pre-0.3 files (which didn't set a "lastPackage"
// 	// property). This will allow a P16F84 PIC to be initialized (which agrees with pre-0.3
// 	// behaviour), but it will also load it if
	
	// This to allow loading of the PIC component from pre-0.3 files (which didn't set a
	// "lastPackage" property).
	if ( !newItem )
		property("lastPackage")->setValue("P16F84");
	
	slotUpdateFileList();
	slotUpdateBtns();
	
	initPackage( 0 );
}
Esempio n. 3
0
PythonSupportPart::PythonSupportPart(QObject *parent, const char *name, const QStringList &)
    : KDevLanguageSupport(&data, parent, name ? name : "PythonSupportPart")
{
    setInstance(PythonSupportFactory::instance());

    setXMLFile("kdevpythonsupport.rc");

    connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) );
    connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) );
    connect( partController(), SIGNAL(savedFile(const KURL&)),
             this, SLOT(savedFile(const KURL&)) );
    connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)),
             this, SLOT(projectConfigWidget(KDialogBase*)) );
    connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
             this, SLOT(contextMenu(QPopupMenu *, const Context *)) );

    KAction *action;

    action = new KAction( i18n("Execute Program"), "exec", 0,
                          this, SLOT(slotExecute()),
                          actionCollection(), "build_exec" );
    action->setToolTip( i18n("Execute program") );
    action->setWhatsThis(i18n("<b>Execute program</b><p>Runs the Python program."));

    action = new KAction( i18n("Execute String..."), "exec", 0,
                          this, SLOT(slotExecuteString()),
                          actionCollection(), "build_execstring" );
    action->setToolTip( i18n("Execute string") );
    action->setWhatsThis(i18n("<b>Execute String</b><p>Executes a string as Python code."));

    action = new KAction( i18n("Start Python Interpreter"), "exec", 0,
                          this, SLOT(slotStartInterpreter()),
                          actionCollection(), "build_runinterpreter" );
    action->setToolTip( i18n("Start Python interpreter") );
    action->setWhatsThis(i18n("<b>Start python interpreter</b><p>Starts the Python interpreter without a program"));

    action = new KAction( i18n("Python Documentation..."), 0,
                          this, SLOT(slotPydoc()),
                          actionCollection(), "help_pydoc" );
    action->setToolTip( i18n("Python documentation") );
    action->setWhatsThis(i18n("<b>Python documentation</b><p>Shows a Python documentation page."));
}
Esempio n. 4
0
BashSupportPart::BashSupportPart(QObject *parent, const char *name, const QStringList& )
: KDevLanguageSupport (&data, parent, name ? name : "BashSupportPart" )
{
	setInstance(BashSupportFactory::instance());
	setXMLFile("kdevbashsupport.rc");

	KAction *action;
	action = new KAction( i18n("&Run"), "exec",Key_F9,this, SLOT(slotRun()),actionCollection(), "build_execute" );
    action->setToolTip(i18n("Run"));
    action->setWhatsThis(i18n("<b>Run</b><p>Starts an application."));

	kdDebug() << "Creating BashSupportPart" << endl;

	connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)),
		this, SLOT(projectConfigWidget(KDialogBase*)) );
	connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) );
	connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) );
	connect( partController(), SIGNAL(savedFile(const KURL&)), this, SLOT(savedFile(const KURL&)) );
 	connect(partController(), SIGNAL(activePartChanged(KParts::Part*)),
		this, SLOT(slotActivePartChanged(KParts::Part *)));

	m_cc = new BashCodeCompletion();
}
Esempio n. 5
0
	SettingsPage::SettingsPage( MainWindow* w, SettingsDialog* parent )
		: QWidget( parent ),
		  _dialog( parent )
	{
		Q_ASSERT( w );
		connect( w, SIGNAL( projectOpened( Project* ) ),
				 this, SLOT( onProjectOpened( Project* ) )
		);
		connect( w, SIGNAL( projectLoaded( Project* ) ),
				 this, SLOT( onProjectLoaded( Project* ) )
		);
		connect( w, SIGNAL( projectClosed() ),
				 this, SLOT( onProjectClosed() )
		);
	}
Esempio n. 6
0
// 将该projectName项目从已打开项目列表中删除.
void ProjectManager::closeProject(const QString &projectName)
{
	if (!allProjectMap.contains(projectName))
		return;

	openedProjectList.removeAll(projectName);
	closedProjectList << projectName;
	historySettings->setValue(projectName + "/Status", "Off");
	historySettings->sync();
	emit projectClosed(projectName);
	
	if (currentProject == projectName) {
		currentProject = QString();
		ifNoCurrentProject();
	}
}