5 Υποβολές

Συγγραφέας SHA1 Μήνυμα Ημερομηνία
1ce3a6c397 fixup! Implement basic 'Terminal=' support for .desktop files 2020-10-05 22:57:43 +02:00
0183ad58b8 add 'terminal=true' support for .qsrun entries 2020-10-05 22:50:53 +02:00
2b1fb5b0c2 EntryPushButton: Set term icon for terminal cmds w/o icon 2020-10-05 22:28:18 +02:00
59ff382856 Implement basic 'Terminal=' support for .desktop files 2020-10-04 22:19:30 +02:00
bf8f09ec66 Delete TODO
Issue and TODO Tracker resides here:
https://gitea.quitesimple.org/crtxcr/qsrun/issues
2020-10-04 21:57:15 +02:00
7 αρχεία άλλαξαν με 31 προσθήκες και 6 διαγραφές

4
TODO

@ -1,4 +0,0 @@
- Investigate memory leaks (relevant now that we have a single user mode,
so qsrun may stay open after launch)
- Provide --help
- ESC/CTRL+Q close the app. May not be expected behaviour

@ -79,6 +79,10 @@ EntryConfig EntryProvider::readFromDesktopFile(const QString &path)
{
result.hidden = args == "true";
}
if(key == "terminal")
{
result.isTerminalCommand = args == "true";
}
}
result.type = EntryType::SYSTEM;
return result;
@ -219,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;
}

@ -27,6 +27,7 @@ class EntryConfig
public:
EntryType type = SYSTEM;
bool hidden = false;
bool isTerminalCommand = false;
QString entryPath;
QString key;
QString name;

@ -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())
{

@ -28,3 +28,8 @@ bool SettingsProvider::singleInstanceMode() const
{
return settings->value("singleInstance", true).toBool();
}
QString SettingsProvider::getTerminalCommand() const
{
return settings->value("terminal", "/usr/bin/x-terminal-emulator -e %c").toString();
}

@ -15,6 +15,7 @@ class SettingsProvider
virtual QStringList systemApplicationsEntriesPaths() const;
virtual int getMaxCols() const;
virtual bool singleInstanceMode() const;
QString getTerminalCommand() const;
};
#endif // SETTINGSPROVIDER_H

@ -120,7 +120,16 @@ void Window::populateGrid(const QVector<EntryPushButton *> &list)
void Window::executeConfig(const EntryConfig &config)
{
QProcess::startDetached(config.command, config.arguments);
if(config.isTerminalCommand)
{
QString cmd = settingsProvider->getTerminalCommand();
cmd.replace("%c", config.command + " " + config.arguments.join(' '));
QProcess::startDetached(cmd);
}
else
{
QProcess::startDetached(config.command, config.arguments);
}
this->closeWindow();
}