Manager: Add a context menu entry to open a machine's printer output folder
This commit is contained in:
@@ -73,6 +73,18 @@ VMManagerMain::VMManagerMain(QWidget *parent) :
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
QAction openPrinterFolderAction(tr("Open &printer tray..."));
|
||||||
|
contextMenu.addAction(&openPrinterFolderAction);
|
||||||
|
connect(&openPrinterFolderAction, &QAction::triggered, [indexAt] {
|
||||||
|
if (const auto printerDir = indexAt.data(VMManagerModel::Roles::ConfigDir).toString() + QString("/printer/"); !printerDir.isEmpty()) {
|
||||||
|
QDir dir(printerDir);
|
||||||
|
if (!dir.exists())
|
||||||
|
dir.mkpath(".");
|
||||||
|
|
||||||
|
QDesktopServices::openUrl(QUrl(QString("file:///") + dir.canonicalPath()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
QAction setSystemIcon(tr("Set &icon..."));
|
QAction setSystemIcon(tr("Set &icon..."));
|
||||||
contextMenu.addAction(&setSystemIcon);
|
contextMenu.addAction(&setSystemIcon);
|
||||||
connect(&setSystemIcon, &QAction::triggered, [this] {
|
connect(&setSystemIcon, &QAction::triggered, [this] {
|
||||||
|
|||||||
Reference in New Issue
Block a user