Skip to content

Commit

Permalink
Project: Added 'Open with System Editor' to file context menu
Browse files Browse the repository at this point in the history
Issue #1665
  • Loading branch information
bjorn committed Apr 10, 2020
1 parent ea4547c commit 8087d1a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/tiled/projectdock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "utils.h"

#include <QBoxLayout>
#include <QDesktopServices>
#include <QFileDialog>
#include <QFileInfo>
#include <QMenu>
Expand Down Expand Up @@ -245,6 +246,10 @@ void ProjectView::contextMenuEvent(QContextMenuEvent *event)
Utils::addFileManagerActions(menu, filePath);

if (QFileInfo { filePath }.isFile()) {
menu.addAction(tr("Open with System Editor"), [=] {
QDesktopServices::openUrl(QUrl::fromLocalFile(filePath));
});

auto objectTemplate = TemplateManager::instance()->loadObjectTemplate(filePath);
if (objectTemplate->object()) {
menu.addSeparator();
Expand Down

0 comments on commit 8087d1a

Please sign in to comment.