Σύγκριση υποβολών

...

3 Υποβολές

Συγγραφέας SHA1 Μήνυμα Ημερομηνία
Albert S. 2df37212dd EntryPushButton: Don't allow moving dynamic buttons 2020-10-19 21:45:33 +02:00
Albert S. b13815a924 executeConfig: Open terminal if Shift pressed 2020-10-19 21:45:33 +02:00
Albert S. bb74d156c9 Introduce new button type 'DYNAMIC' for PATH suggestions
Fixes #23
2020-10-19 21:45:33 +02:00
3 αρχεία άλλαξαν με 7 προσθήκες και 4 διαγραφές

@ -19,7 +19,8 @@ enum EntryType
{
USER,
INHERIT,
SYSTEM
SYSTEM,
DYNAMIC
};
class EntryConfig

@ -106,7 +106,7 @@ void EntryPushButton::mousePressEvent(QMouseEvent *event)
{
this->userEntryMenu.exec(QCursor::pos());
}
else
else if(this->config.type == EntryType::SYSTEM)
{
this->systemEntryMenu.exec(QCursor::pos());
}
@ -116,7 +116,7 @@ void EntryPushButton::mousePressEvent(QMouseEvent *event)
void EntryPushButton::mouseMoveEvent(QMouseEvent *event)
{
if(this->config.type == EntryType::SYSTEM)
if(this->config.type == EntryType::SYSTEM || this->config.type == EntryType::DYNAMIC)
{
return;
}

@ -120,7 +120,7 @@ void Window::populateGrid(const QVector<EntryPushButton *> &list)
void Window::executeConfig(const EntryConfig &config)
{
if(config.isTerminalCommand)
if(config.isTerminalCommand || QApplication::keyboardModifiers().testFlag(Qt::ShiftModifier))
{
QString cmd = settingsProvider->getTerminalCommand();
cmd.replace("%c", config.command);
@ -266,6 +266,7 @@ void Window::addPATHSuggestion(const QString &text)
e.row = 0;
e.command = suggestions[0];
e.iconPath = suggestions[0];
e.type = EntryType::DYNAMIC;
EntryPushButton *button = createEntryButton(e);
clearGrid();
grid->addWidget(button, 0, 0);
@ -343,6 +344,7 @@ void Window::lineEditTextChanged(QString text)
}
e.command = arguments[0];
e.iconPath = "utilities-terminal";
e.type = EntryType::DYNAMIC;
EntryPushButton *button = createEntryButton(e);
clearGrid();