Suchen in Dateien hinzugefügt
This commit is contained in:
@@ -35,6 +35,12 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
{
|
||||
m_projectManager->openProject(lastPath);
|
||||
}
|
||||
|
||||
// Letzte Session wiederherstellen (geöffnete Dateien + aktiver Tab)
|
||||
m_editor->restoreSession(
|
||||
m_settings->lastOpenFiles(),
|
||||
m_settings->lastActiveFile()
|
||||
);
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow() = default;
|
||||
@@ -110,6 +116,9 @@ void MainWindow::setupMenuBar()
|
||||
m_actSearch = mBearbeiten->addAction(tr("&Suchen / Ersetzen…"), this, &MainWindow::onShowSearch);
|
||||
m_actSearch->setShortcut(QKeySequence::Find);
|
||||
|
||||
m_actFileSearch = mBearbeiten->addAction(tr("In &Dateien suchen…"), this, &MainWindow::onShowFileSearch);
|
||||
m_actFileSearch->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_F);
|
||||
|
||||
// ---- Ansicht ----
|
||||
QMenu *mAnsicht = menuBar()->addMenu(tr("&Ansicht"));
|
||||
|
||||
@@ -272,10 +281,16 @@ void MainWindow::onAbout()
|
||||
// ---------------------------------------------------------------------------
|
||||
// Slots – Projekt
|
||||
// ---------------------------------------------------------------------------
|
||||
void MainWindow::onShowFileSearch()
|
||||
{
|
||||
m_editor->showFileSearchPanel();
|
||||
}
|
||||
|
||||
void MainWindow::onProjectOpened(const QString &path)
|
||||
{
|
||||
setWindowTitle(QString("BareCode – %1").arg(path));
|
||||
m_fileTree->setRootPath(path);
|
||||
m_editor->setSearchRoot(path);
|
||||
statusBar()->showMessage(tr("Projekt geöffnet: %1").arg(path), 4000);
|
||||
}
|
||||
|
||||
@@ -283,6 +298,7 @@ void MainWindow::onProjectClosed()
|
||||
{
|
||||
setWindowTitle("BareCode");
|
||||
m_fileTree->clearRoot();
|
||||
m_editor->setSearchRoot(QString());
|
||||
statusBar()->showMessage(tr("Projekt geschlossen"), 3000);
|
||||
}
|
||||
|
||||
@@ -294,6 +310,10 @@ void MainWindow::saveWindowState()
|
||||
QSettings s(QSettings::IniFormat, QSettings::UserScope, "BareCode", "BareCode");
|
||||
s.setValue("window/geometry", saveGeometry());
|
||||
s.setValue("window/state", saveState());
|
||||
|
||||
// Session speichern
|
||||
m_settings->setLastOpenFiles(m_editor->openFilePaths());
|
||||
m_settings->setLastActiveFile(m_editor->activeFilePath());
|
||||
}
|
||||
|
||||
void MainWindow::restoreWindowState()
|
||||
|
||||
Reference in New Issue
Block a user