diff --git a/images/dark/add.svg b/images/dark/add.svg
new file mode 100644
index 0000000..3bcd12d
--- /dev/null
+++ b/images/dark/add.svg
@@ -0,0 +1,66 @@
+
+
diff --git a/images/light/add.svg b/images/light/add.svg
new file mode 100644
index 0000000..def3824
--- /dev/null
+++ b/images/light/add.svg
@@ -0,0 +1,66 @@
+
+
diff --git a/model/foldermodel.cpp b/model/foldermodel.cpp
index 3b05de1..217c653 100644
--- a/model/foldermodel.cpp
+++ b/model/foldermodel.cpp
@@ -1060,7 +1060,10 @@ void FolderModel::openContextMenu(QQuickItem *visualParent, Qt::KeyboardModifier
menu->addAction(m_actionCollection.action("restore"));
menu->addAction(m_actionCollection.action("open"));
+ menu->addAction(m_actionCollection.action("openInNewWindow"));
+
menu->addAction(m_actionCollection.action("openWith"));
+ menu->addSeparator();
menu->addAction(m_actionCollection.action("cut"));
menu->addAction(m_actionCollection.action("copy"));
menu->addAction(m_actionCollection.action("trash"));
@@ -1156,6 +1159,19 @@ void FolderModel::openDeleteDialog()
view->show();
}
+void FolderModel::openInNewWindow()
+{
+ if (!m_selectionModel->hasSelection())
+ return;
+
+ for (const QModelIndex &index : m_selectionModel->selectedIndexes()) {
+ KFileItem item = itemForIndex(index);
+ if (item.isDir()) {
+ QProcess::startDetached("cutefish-filemanager", QStringList() << item.url().toLocalFile());
+ }
+ }
+}
+
void FolderModel::updateSelectedItemsSize()
{
}
@@ -1483,6 +1499,9 @@ void FolderModel::createActions()
setShowHiddenFiles(!m_showHiddenFiles);
});
+ QAction *openInNewWindow = new QAction(tr("Open in new window"), this);
+ QObject::connect(openInNewWindow, &QAction::triggered, this, &FolderModel::openInNewWindow);
+
m_actionCollection.addAction(QStringLiteral("open"), open);
m_actionCollection.addAction(QStringLiteral("openWith"), openWith);
m_actionCollection.addAction(QStringLiteral("cut"), cut);
@@ -1499,6 +1518,7 @@ void FolderModel::createActions()
m_actionCollection.addAction(QStringLiteral("changeBackground"), changeBackground);
m_actionCollection.addAction(QStringLiteral("restore"), restore);
m_actionCollection.addAction(QStringLiteral("showHidden"), showHidden);
+ m_actionCollection.addAction(QStringLiteral("openInNewWindow"), openInNewWindow);
}
void FolderModel::updateActions()
@@ -1509,6 +1529,7 @@ void FolderModel::updateActions()
QList urls;
bool hasRemoteFiles = false;
bool isTrashLink = false;
+ bool hasDir = false;
const bool isTrash = (resolvedUrl().scheme() == QLatin1String("trash"));
if (indexes.isEmpty()) {
@@ -1523,6 +1544,9 @@ void FolderModel::updateActions()
items.append(item);
urls.append(item.url());
}
+
+ if (item.isDir())
+ hasDir = true;
}
}
@@ -1609,6 +1633,10 @@ void FolderModel::updateActions()
showHidden->setCheckable(true);
showHidden->setChecked(m_showHiddenFiles);
}
+
+ if (QAction *openInNewWindow = m_actionCollection.action("openInNewWindow")) {
+ openInNewWindow->setVisible(hasDir);
+ }
}
void FolderModel::addDragImage(QDrag *drag, int x, int y)
diff --git a/model/foldermodel.h b/model/foldermodel.h
index 2584c47..9750c3e 100644
--- a/model/foldermodel.h
+++ b/model/foldermodel.h
@@ -204,6 +204,7 @@ public:
Q_INVOKABLE void openInTerminal();
Q_INVOKABLE void openChangeWallpaperDialog();
Q_INVOKABLE void openDeleteDialog();
+ Q_INVOKABLE void openInNewWindow();
Q_INVOKABLE void updateSelectedItemsSize();
Q_INVOKABLE void keyboardSearch(const QString &text);
diff --git a/translations/en_US.ts b/translations/en_US.ts
index e4043f8..18bdda1 100644
--- a/translations/en_US.ts
+++ b/translations/en_US.ts
@@ -83,7 +83,7 @@
DesktopView
-
+
Desktop
@@ -114,12 +114,12 @@
FilePropertiesDialog
-
+
Properties
-
+
%1 files
@@ -137,100 +137,105 @@
%1 items
-
+
The file or folder %1 does not exist.
-
+
Select All
-
+
File Manager
-
+
Open
-
+
Open with
-
+
Cut
-
+
Copy
-
+
Paste
-
+
New Folder
-
+
Move To Trash
-
+
Empty Trash
-
+
Delete
-
+
Rename
-
+
Open in Terminal
-
+
Set as Wallpaper
-
+
Properties
-
+
Change background
-
+
Restore
-
+
Show hidden files
+
+
+
+
+
FolderPage
@@ -434,47 +439,47 @@
PropertiesDialog
-
+
Type:
-
+
Location:
-
+
Size:
-
+
Calculating...
-
+
Created:
-
+
Modified:
-
+
Accessed:
-
+
Cancel
-
+
OK
diff --git a/translations/zh_CN.ts b/translations/zh_CN.ts
index 80e6a22..443259e 100644
--- a/translations/zh_CN.ts
+++ b/translations/zh_CN.ts
@@ -83,7 +83,7 @@
DesktopView
-
+
桌面
@@ -114,12 +114,12 @@
FilePropertiesDialog
-
+
属性
-
+
%1 项
@@ -137,100 +137,105 @@
%1 项
-
+
文件或文件夹 %1 不存在
-
+
全选
-
+
文件管理器
-
+
打开
-
+
打开方式
-
+
剪切
-
+
复制
-
+
粘贴
-
+
新建文件夹
-
+
移动到回收站
-
+
清空回收站
-
+
删除
-
+
重命名
-
+
在终端中打开
-
+
设置为壁纸
-
+
属性
-
+
更改桌面背景
-
+
恢复
-
+
显示隐藏文件
+
+
+
+ 在新窗口中打开
+
FolderPage
@@ -438,47 +443,47 @@
属性
-
+
类型:
-
+
位置:
-
+
大小:
-
+
计算中...
-
+
创建时间:
-
+
修改时间:
-
+
访问时间:
-
+
取消
-
+
确定