2021-04-06 23:10:57 +08:00
|
|
|
#include "editorlist.h"
|
2021-04-07 21:13:15 +08:00
|
|
|
#include "editor.h"
|
2021-04-06 23:10:57 +08:00
|
|
|
|
2021-04-07 21:13:15 +08:00
|
|
|
EditorList::EditorList(QTabWidget* leftPageWidget,
|
|
|
|
QTabWidget* rightPageWidget,
|
|
|
|
QSplitter* splitter,
|
|
|
|
QWidget* panel):
|
|
|
|
mLeftPageWidget(leftPageWidget),
|
|
|
|
mRightPageWidget(rightPageWidget),
|
|
|
|
mSplitter(splitter),
|
|
|
|
mPanel(panel),
|
|
|
|
mUpdateCount(0)
|
2021-04-06 23:10:57 +08:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2021-04-07 21:13:15 +08:00
|
|
|
|
|
|
|
Editor* EditorList::NewEditor(const QString& filename, FileEncodingType encoding,
|
|
|
|
bool inProject, bool newFile,
|
|
|
|
QTabWidget* page) {
|
|
|
|
QTabWidget * parentPageControl = NULL;
|
|
|
|
if (page == NULL)
|
|
|
|
parentPageControl = GetNewEditorPageControl();
|
|
|
|
else
|
|
|
|
parentPageControl = page;
|
|
|
|
return new Editor(parentPageControl,filename,encoding,inProject,newFile,parentPageControl);
|
|
|
|
//UpdateLayout;
|
|
|
|
}
|
|
|
|
|
|
|
|
QTabWidget* EditorList::GetNewEditorPageControl() {
|
|
|
|
//todo: return widget depends on layout
|
|
|
|
return mLeftPageWidget;
|
|
|
|
}
|
|
|
|
|