Dateien, die als Parameter übergeben werden, werden nach dem Start direkt geladen
This commit is contained in:
68
barecode/src/editor/EditorPanel.h
Normal file
68
barecode/src/editor/EditorPanel.h
Normal file
@@ -0,0 +1,68 @@
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTabWidget>
|
||||
#include <QVBoxLayout>
|
||||
#include <QHash>
|
||||
#include <QString>
|
||||
|
||||
class EditorTab;
|
||||
class Settings;
|
||||
class SearchPanel;
|
||||
class FileSearchPanel;
|
||||
class FunctionListDialog;
|
||||
class DeadCodeDialog;
|
||||
class FunctionIndex;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// EditorPanel – Rechtes Panel: Tab-Leiste + Editoren + Such/Ersetzen-Panel.
|
||||
// ---------------------------------------------------------------------------
|
||||
class EditorPanel : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EditorPanel(Settings *settings, QWidget *parent = nullptr);
|
||||
|
||||
public slots:
|
||||
void openFile(const QString &filePath);
|
||||
void saveCurrentFile();
|
||||
void saveCurrentFileAs();
|
||||
void saveAllFiles();
|
||||
void setSearchRoot(const QString &path);
|
||||
void showSearchPanel();
|
||||
void showFileSearchPanel();
|
||||
void showFunctionList();
|
||||
void showDeadCode();
|
||||
void goToLine(const QString &filePath, int line);
|
||||
|
||||
// Session
|
||||
QStringList openFilePaths() const;
|
||||
QString activeFilePath() const;
|
||||
void restoreSession(const QStringList &files, const QString &activeFile);
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
signals:
|
||||
void currentFileSaved(const QString &filePath);
|
||||
|
||||
private slots:
|
||||
void onTabCloseRequested(int index);
|
||||
void onCurrentTabChanged(int index);
|
||||
|
||||
private:
|
||||
void setupUi();
|
||||
int findTabForFile(const QString &filePath) const;
|
||||
EditorTab *currentTab() const;
|
||||
|
||||
Settings *m_settings = nullptr;
|
||||
QVBoxLayout *m_layout = nullptr;
|
||||
QTabWidget *m_tabWidget = nullptr;
|
||||
SearchPanel *m_searchPanel = nullptr;
|
||||
FileSearchPanel *m_fileSearch = nullptr;
|
||||
FunctionListDialog *m_funcDialog = nullptr;
|
||||
DeadCodeDialog *m_deadCode = nullptr;
|
||||
FunctionIndex *m_funcIndex = nullptr;
|
||||
|
||||
QHash<QString, EditorTab *> m_openTabs;
|
||||
};
|
||||
Reference in New Issue
Block a user