MCPcopy Create free account
hub / github.com/dail8859/NotepadNext / updateFileStatusBasedUi

Method updateFileStatusBasedUi

src/dialogs/MainWindow.cpp:1608–1634  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1606}
1607
1608void MainWindow::updateFileStatusBasedUi(ScintillaNext *editor)
1609{
1610 qInfo(Q_FUNC_INFO);
1611
1612 bool isFile = editor->isFile();
1613 QString fileName;
1614
1615 if (isFile) {
1616 fileName = editor->getFilePath();
1617 }
1618 else {
1619 fileName = editor->getName();
1620 }
1621
1622 QString title = QStringLiteral("[*]%1").arg(fileName);
1623 if (app->isRunningAsAdmin()) {
1624 title += QStringLiteral(" - [%1]").arg(tr("Administrator"));
1625 }
1626 setWindowTitle(title);
1627
1628 ui->actionReload->setEnabled(isFile);
1629 ui->actionMoveToTrash->setEnabled(isFile);
1630 ui->actionCopyFullPath->setEnabled(isFile);
1631 ui->actionCopyFileDirectory->setEnabled(isFile);
1632 ui->actionShowInExplorer->setEnabled(isFile);
1633 ui->actionOpenTerminalHere->setEnabled(isFile);
1634}
1635
1636bool MainWindow::isAnyUnsaved() const
1637{

Callers

nothing calls this directly

Calls 5

isFileMethod · 0.80
getFilePathMethod · 0.80
isRunningAsAdminMethod · 0.80
getNameMethod · 0.45
setEnabledMethod · 0.45

Tested by

no test coverage detected