mirror of
https://github.com/tnodir/fort
synced 2024-11-15 05:25:56 +00:00
UI: Add ability to "Open Folder" of selected app.
This commit is contained in:
parent
d766d0084a
commit
65991e7fe3
@ -18,6 +18,7 @@
|
||||
<file>images/cross.png</file>
|
||||
<file>images/cut.png</file>
|
||||
<file>images/database_save.png</file>
|
||||
<file>images/folder_go.png</file>
|
||||
<file>images/link.png</file>
|
||||
<file>images/page_copy.png</file>
|
||||
<file>images/page_paste.png</file>
|
||||
|
@ -35,6 +35,7 @@
|
||||
<file>qml/pages/apps/AppsColumn.qml</file>
|
||||
<file>qml/pages/apps/AppsTextColumn.qml</file>
|
||||
<file>qml/pages/apps/GroupOptionsButton.qml</file>
|
||||
<file>qml/pages/log/AppInfoRow.qml</file>
|
||||
<file>qml/pages/log/AppListView.qml</file>
|
||||
<file>qml/pages/log/GraphButton.qml</file>
|
||||
<file>qml/pages/log/IpListView.qml</file>
|
||||
|
BIN
src/ui/images/folder_go.png
Normal file
BIN
src/ui/images/folder_go.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 694 B |
@ -144,9 +144,9 @@ BasePage {
|
||||
}
|
||||
}
|
||||
|
||||
TextFieldFrame {
|
||||
AppInfoRow {
|
||||
Layout.fillWidth: true
|
||||
text: currentAppPath || ""
|
||||
appPath: currentAppPath
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -264,9 +264,9 @@ BasePage {
|
||||
}
|
||||
}
|
||||
|
||||
TextFieldFrame {
|
||||
AppInfoRow {
|
||||
Layout.fillWidth: true
|
||||
text: currentAppPath || ""
|
||||
appPath: currentAppPath
|
||||
}
|
||||
}
|
||||
}
|
||||
|
24
src/ui/qml/pages/log/AppInfoRow.qml
Normal file
24
src/ui/qml/pages/log/AppInfoRow.qml
Normal file
@ -0,0 +1,24 @@
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Layouts 1.12
|
||||
import "../../controls"
|
||||
import com.fortfirewall 1.0
|
||||
|
||||
RowLayout {
|
||||
|
||||
visible: !!appPath
|
||||
|
||||
property string appPath
|
||||
|
||||
TextFieldFrame {
|
||||
Layout.fillWidth: true
|
||||
text: appPath
|
||||
}
|
||||
|
||||
RoundButtonTip {
|
||||
icon.source: "qrc:/images/folder_go.png"
|
||||
tipText: translationManager.trTrigger
|
||||
&& qsTranslate("qml", "Open Folder")
|
||||
onClicked: osUtil.openFolder(appPath)
|
||||
}
|
||||
}
|
@ -1,5 +1,8 @@
|
||||
#include "osutil.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QProcess>
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <qt_windows.h>
|
||||
|
||||
@ -16,6 +19,14 @@ QString OsUtil::pidToPath(quint32 pid, bool isKernelPath)
|
||||
return pi.path(isKernelPath);
|
||||
}
|
||||
|
||||
void OsUtil::openFolder(const QString &filePath)
|
||||
{
|
||||
const QString nativePath = QDir::toNativeSeparators(filePath);
|
||||
|
||||
QProcess::execute(QString("explorer.exe /select,%1")
|
||||
.arg(nativePath));
|
||||
}
|
||||
|
||||
bool OsUtil::createGlobalMutex(const char *name)
|
||||
{
|
||||
return CreateMutexA(nullptr, FALSE, name)
|
||||
|
@ -12,6 +12,8 @@ public:
|
||||
|
||||
Q_INVOKABLE static QString pidToPath(quint32 pid, bool isKernelPath = false);
|
||||
|
||||
Q_INVOKABLE static void openFolder(const QString &filePath);
|
||||
|
||||
static bool createGlobalMutex(const char *name);
|
||||
|
||||
static quint32 lastErrorCode();
|
||||
|
Loading…
Reference in New Issue
Block a user