diff --git a/src/ui/fort_images.qrc b/src/ui/fort_images.qrc index 37beadd2..dacadb25 100644 --- a/src/ui/fort_images.qrc +++ b/src/ui/fort_images.qrc @@ -22,6 +22,7 @@ images/cross.png images/cut.png images/database_save.png + images/folder_explore.png images/link.png images/page_copy.png images/page_paste.png diff --git a/src/ui/fortmanager.cpp b/src/ui/fortmanager.cpp index f04a49ec..9389bec8 100644 --- a/src/ui/fortmanager.cpp +++ b/src/ui/fortmanager.cpp @@ -1,6 +1,7 @@ #include "fortmanager.h" #include +#include #include #include #include @@ -421,6 +422,13 @@ void FortManager::showInfoBox(const QString &text, QMessageBox::information(&m_window, title, text); } +QStringList FortManager::getOpenFileNames(const QString &title) +{ + return QFileDialog::getOpenFileNames( + nullptr, title, QString(), QString(), + nullptr, QFileDialog::ReadOnly); +} + bool FortManager::saveOriginConf(const QString &message) { if (!saveSettings(m_firewallConf)) diff --git a/src/ui/fortmanager.h b/src/ui/fortmanager.h index b93c25e5..78084d09 100644 --- a/src/ui/fortmanager.h +++ b/src/ui/fortmanager.h @@ -79,6 +79,8 @@ public slots: void showInfoBox(const QString &text, const QString &title = QString()); + QStringList getOpenFileNames(const QString &title = QString()); + bool saveOriginConf(const QString &message); bool saveConf(bool onlyFlags = false); bool applyConf(bool onlyFlags = false); diff --git a/src/ui/i18n/i18n_ru.qm b/src/ui/i18n/i18n_ru.qm index 66d617e3..8ebba6b0 100644 Binary files a/src/ui/i18n/i18n_ru.qm and b/src/ui/i18n/i18n_ru.qm differ diff --git a/src/ui/i18n/i18n_ru.ts b/src/ui/i18n/i18n_ru.ts index 126dc977..9ddacfa7 100644 --- a/src/ui/i18n/i18n_ru.ts +++ b/src/ui/i18n/i18n_ru.ts @@ -50,42 +50,42 @@ FortManager - + Password input Ввод пароля - + Please enter the password Наберите пароль пожалуйста - + Options Опции - + Traffic Graph График трафика - + Filter Enabled Фильтр включен - + Stop Traffic Остановить трафик - + Stop Internet Traffic Остановить Интернет трафик - + Quit Выйти @@ -370,17 +370,17 @@ Перенести выделенные строки в 'Блокировать' - + Block Блокировать - + Allow Разрешить - + # All programs in the sub-path: # Все программы по под-пути: @@ -862,9 +862,14 @@ - + # Examples: # Примеры: + + + Select File + Выбрать файл + diff --git a/src/ui/images/folder_explore.png b/src/ui/images/folder_explore.png new file mode 100644 index 00000000..0ba93918 Binary files /dev/null and b/src/ui/images/folder_explore.png differ diff --git a/src/ui/qml/box/TextArea2SplitBox.qml b/src/ui/qml/box/TextArea2SplitBox.qml index bbb5a22c..14427e5a 100644 --- a/src/ui/qml/box/TextArea2SplitBox.qml +++ b/src/ui/qml/box/TextArea2SplitBox.qml @@ -15,6 +15,8 @@ T.SplitView { property string textMoveAllFrom2To1 property string textMoveSelectedFrom2To1 + property bool selectFileEnabled + property string settingsPropName readonly property real handleWidth: 40 @@ -160,6 +162,20 @@ T.SplitView { tipText: textMoveAllFrom2To1 onClicked: moveAllLines(textArea2, textArea1) } + + RoundButtonTipSmall { + visible: selectFileEnabled + icon.source: "qrc:/images/folder_explore.png" + tipText: translationManager.trTrigger + && qsTranslate("qml", "Select File") + onClicked: { + const area = textArea1.activeFocus ? textArea1 : textArea2; + const filePaths = fortManager.getOpenFileNames(); + if (filePaths.length > 0) { + appendText(area, filePaths.join('\n')); + } + } + } } } } diff --git a/src/ui/qml/controls/RoundButtonTip.qml b/src/ui/qml/controls/RoundButtonTip.qml index 935772f3..af332695 100644 --- a/src/ui/qml/controls/RoundButtonTip.qml +++ b/src/ui/qml/controls/RoundButtonTip.qml @@ -4,6 +4,7 @@ import QtQuick.Controls 2.13 RoundButton { id: bt hoverEnabled: true + focusPolicy: Qt.NoFocus property string tipText diff --git a/src/ui/qml/pages/apps/AppsColumn.qml b/src/ui/qml/pages/apps/AppsColumn.qml index 4d94eeb1..79fd0b8e 100644 --- a/src/ui/qml/pages/apps/AppsColumn.qml +++ b/src/ui/qml/pages/apps/AppsColumn.qml @@ -108,6 +108,8 @@ ColumnLayout { textMoveSelectedFrom2To1: translationManager.trTrigger && qsTranslate("qml", "Move Selected Lines to 'Block'") + selectFileEnabled: true + settingsPropName: "windowAppsSplit" AppsTextColumn {