Support for Terminal commands #21

已關閉
crtxcr 請求將 3 次程式碼提交從 wip/terminalkeyword 合併至 master
共有 3 個檔案被更改,包括 11 行新增2 行删除

查看文件

@ -223,6 +223,7 @@ EntryConfig EntryProvider::readqsrunFile(const QString &path)
}
result.col = map["col"].toInt();
result.row = map["row"].toInt();
result.isTerminalCommand = map["terminal"] == "true";
return result;
}

查看文件

@ -23,7 +23,15 @@ EntryPushButton::EntryPushButton(const EntryConfig &config) : QPushButton()
{
this->setText(config.name);
this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
QIcon icon = resolveIcon(config.iconPath);
QIcon icon;
if(config.isTerminalCommand && config.iconPath.isEmpty())
{
icon = resolveIcon("utilities-terminal");
}
else
{
icon = resolveIcon(config.iconPath);
}
this->setIcon(icon);
if(!icon.availableSizes().isEmpty())
{

查看文件

@ -123,7 +123,7 @@ void Window::executeConfig(const EntryConfig &config)
if(config.isTerminalCommand)
{
QString cmd = settingsProvider->getTerminalCommand();
cmd.replace("%c", config.command);
cmd.replace("%c", config.command + " " + config.arguments.join(' '));
QProcess::startDetached(cmd);
}
else