diff --git a/model/foldermodel.cpp b/model/foldermodel.cpp
index 5e47e4c..b0d8373 100644
--- a/model/foldermodel.cpp
+++ b/model/foldermodel.cpp
@@ -825,8 +825,8 @@ void FolderModel::openContextMenu(QQuickItem *visualParent, Qt::KeyboardModifier
const QModelIndexList indexes = m_selectionModel->selectedIndexes();
QMenu *menu = new QMenu;
+ // Open folder menu.
if (indexes.isEmpty()) {
- // Open folder menu.
QAction *selectAll = new QAction(tr("Select All"), this);
connect(selectAll, &QAction::triggered, this, &FolderModel::selectAll);
@@ -838,6 +838,11 @@ void FolderModel::openContextMenu(QQuickItem *visualParent, Qt::KeyboardModifier
menu->addSeparator();
menu->addAction(m_actionCollection.action("terminal"));
}
+
+ if (m_isDesktop) {
+ menu->addAction(m_actionCollection.action("changeBackground"));
+ }
+
menu->addSeparator();
menu->addAction(m_actionCollection.action("emptyTrash"));
menu->addAction(m_actionCollection.action("properties"));
@@ -912,6 +917,11 @@ void FolderModel::openInTerminal()
KToolInvocation::invokeTerminal(QString(), url);
}
+void FolderModel::openChangeWallpaperDialog()
+{
+ QProcess::startDetached("cutefish-settings", QStringList() << "-m" << "background");
+}
+
void FolderModel::selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
{
QModelIndexList indices = selected.indexes();
@@ -1065,6 +1075,9 @@ void FolderModel::createActions()
QAction *properties = new QAction(tr("Properties"), this);
QObject::connect(properties, &QAction::triggered, this, &FolderModel::openPropertiesDialog);
+ QAction *changeBackground = new QAction(tr("Change background"), this);
+ QObject::connect(changeBackground, &QAction::triggered, this, &FolderModel::openChangeWallpaperDialog);
+
m_actionCollection.addAction(QStringLiteral("open"), open);
m_actionCollection.addAction(QStringLiteral("cut"), cut);
m_actionCollection.addAction(QStringLiteral("copy"), copy);
@@ -1077,6 +1090,7 @@ void FolderModel::createActions()
m_actionCollection.addAction(QStringLiteral("terminal"), terminal);
m_actionCollection.addAction(QStringLiteral("wallpaper"), wallpaper);
m_actionCollection.addAction(QStringLiteral("properties"), properties);
+ m_actionCollection.addAction(QStringLiteral("changeBackground"), changeBackground);
}
void FolderModel::updateActions()
diff --git a/model/foldermodel.h b/model/foldermodel.h
index 9de7766..b479c9e 100644
--- a/model/foldermodel.h
+++ b/model/foldermodel.h
@@ -177,6 +177,7 @@ public:
Q_INVOKABLE void openContextMenu(QQuickItem *visualParent = nullptr, Qt::KeyboardModifiers modifiers = Qt::NoModifier);
Q_INVOKABLE void openPropertiesDialog();
Q_INVOKABLE void openInTerminal();
+ Q_INVOKABLE void openChangeWallpaperDialog();
bool isDesktop() const;
void setIsDesktop(bool isDesktop);
diff --git a/translations/en_US.ts b/translations/en_US.ts
new file mode 100644
index 0000000..6c6666c
--- /dev/null
+++ b/translations/en_US.ts
@@ -0,0 +1,354 @@
+
+
+
+
+ CreateFolderDialog
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DateHelper
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DesktopView
+
+
+
+
+
+
+
+ EmptyTrashDialog
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ FolderModel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ FolderPage
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ OptionsMenu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PlacesModel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PropertiesDialog
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ main
+
+
+
+
+
+
+
diff --git a/translations/zh_CN.ts b/translations/zh_CN.ts
index 64a6e97..da4a191 100644
--- a/translations/zh_CN.ts
+++ b/translations/zh_CN.ts
@@ -4,26 +4,64 @@
CreateFolderDialog
-
+
新文件夹名
-
+
新文件夹
-
+
取消
-
+
确定
+
+ DateHelper
+
+
+
+ 现在
+
+
+
+
+ 一分钟前
+
+
+
+
+ %1分钟前
+
+
+
+
+ 一小时前
+
+
+
+
+ %1小时前
+
+
+
+
+ 一天前
+
+
+
+
+ %1天前
+
+
DesktopView
@@ -32,112 +70,178 @@
桌面
+
+ EmptyTrashDialog
+
+
+
+ 文件管理器
+
+
+
+
+ 是否要从回收站中永久删除所有文件?
+
+
+
+
+ 取消
+
+
+
+
+ 清空回收站
+
+
FolderModel
-
+
%1 项
-
+
%1 项
-
+
全选
-
+
打开
-
+
剪切
-
+
复制
-
+
粘贴
-
+
新建文件夹
-
+
移动到回收站
-
+
清空回收站
-
+
删除
-
+
重命名
-
+
在终端中打开
-
+
设置为壁纸
-
+
属性
+
+
+
+ 更改桌面背景
+
FolderPage
-
+
空文件夹
-
+
+
+ 打开
+
+
+
+
+ 属性
+
+
+
%1 项
-
+
%1 项
-
+
选中了 %1 项
-
+
清空回收站
+
+ OptionsMenu
+
+
+
+ 图标视图
+
+
+
+
+ 列表视图
+
+
+
+
+ 名称
+
+
+
+
+ 日期
+
+
+
+
+ 大小
+
+
PlacesModel
@@ -184,52 +288,52 @@
PropertiesDialog
-
+
属性
-
+
类型:
-
+
位置:
-
+
大小:
-
+
计算中...
-
+
创建时间:
-
+
修改时间:
-
+
访问时间:
-
+
取消
-
+
确定
@@ -242,7 +346,7 @@
main
-
+
文件管理器