Esempio n. 1
0
void FileBrowser::syncFileModel(bool b)
{
    if (b == false) {
        return;
    } else {
        currentEditorChanged(m_liteApp->editorManager()->currentEditor());
    }
}
Esempio n. 2
0
void GopathBrowser::setPathList(const QStringList &pathList)
{
    m_pathList = pathList;
    QStringList allPathList = systemGopathList()+m_pathList;
    m_model->setPathList(allPathList);
    m_pathTree->setCurrentIndex(m_model->startIndex());
    m_pathTree->expand(m_model->startIndex());
    LiteApi::IEnvManager* envManager = LiteApi::findExtensionObject<LiteApi::IEnvManager*>(m_liteApp,"LiteApi.IEnvManager");
    LiteApi::IEnv *env = envManager->currentEnv();
    if (env) {
#ifdef Q_OS_WIN
    env->environment().insert("LITEIDE_GOPATH",allPathList.join(";"));
#else
    env->environment().insert("LITEIDE_GOPATH",allPathList.join(":"));
#endif
    }
    currentEditorChanged(m_liteApp->editorManager()->currentEditor());
}
Esempio n. 3
0
void FileSystemWidget::setPathList(const QStringList &pathList)
{
    m_model->setRootPathList(pathList);
    currentEditorChanged(m_liteApp->editorManager()->currentEditor());
}
Esempio n. 4
0
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
{
	mUnsavedChangesDialog = NULL;
	mCurrentSyntaxMenuItem = NULL;

	setWindowTitle(tr("PonyEdit"));

	setAcceptDrops(true);

	gWindowManager = new WindowManager(this);
	gWindowManager->setMinimumWidth(200);
	setCentralWidget(gWindowManager);

	mFileList = new FileList();
	addDockWidget(Qt::LeftDockWidgetArea, mFileList, Qt::Vertical);
	mFileList->setObjectName("File List");

	mTabbedFileList = new TabbedFileList();
	addDockWidget(Qt::TopDockWidgetArea, mTabbedFileList, Qt::Horizontal);
	mTabbedFileList->setObjectName("Tabbed File List");

	if(Options::FileListType == Options::QuickList)
	{
		mFileList->setVisible(true);
		mTabbedFileList->setVisible(false);
	}
	else
	{
		mFileList->setVisible(false);
		mTabbedFileList->setVisible(true);
	}

	mStatusLine = new QLabel();
	mStatusBar = new QStatusBar();
	mStatusBar->addPermanentWidget(mStatusLine);
	setStatusBar(mStatusBar);

	createToolbar();

	createFileMenu();
	createEditMenu();
	createViewMenu();
	createToolsMenu();
	createWindowMenu();
	createHelpMenu();
	createMacDockMenu();

	createShortcuts();

	connect(gDispatcher, SIGNAL(generalErrorMessage(QString)), this, SLOT(showErrorMessage(QString)), Qt::QueuedConnection);
	connect(gDispatcher, SIGNAL(generalStatusMessage(QString)), this, SLOT(showStatusMessage(QString)), Qt::QueuedConnection);
	connect(gDispatcher, SIGNAL(selectFile(BaseFile*)), this, SLOT(fileSelected(BaseFile*)));
	connect(gWindowManager, SIGNAL(currentChanged()), this, SLOT(currentEditorChanged()), Qt::QueuedConnection);
	connect(gDispatcher, SIGNAL(syntaxChanged(BaseFile*)), this, SLOT(updateSyntaxSelection()));
	connect(&gOpenFileManager, SIGNAL(fileOpened(BaseFile*)), this, SLOT(openFileListChanged()));
	connect(&gOpenFileManager, SIGNAL(fileClosed(BaseFile*)), this, SLOT(openFileListChanged()));
	connect(gWindowManager, SIGNAL(splitChanged()), this, SLOT(viewSplittingChanged()));

	mRecentFiles = Tools::loadRecentFiles();
	updateRecentFilesMenu();

	// Set the default size to something relatively sane
	resize(QSize(800, 600));
	restoreState();

	openFileListChanged();
	viewSplittingChanged();
}