Custom actions now expect macros for file and folder expansion
Custom actions now trigger even without a selection Use native path separators in custom actions FossilOrigin-Name: e017a9126cf63ed060dd88accfcabbd9726e9aa7
This commit is contained in:
parent
83217d8e26
commit
8a2c6293c2
14
manifest
14
manifest
@ -1,5 +1,5 @@
|
||||
C Updated\stool-tips\sfor\scustom\sactions\n
|
||||
D 2015-08-21T10:05:45.185
|
||||
C Custom\sactions\snow\sexpect\smacros\sfor\sfile\sand\sfolder\sexpansion\nCustom\sactions\snow\strigger\seven\swithout\sa\sselection\nUse\snative\spath\sseparators\sin\scustom\sactions\n
|
||||
D 2015-08-21T10:54:20.418
|
||||
F .travis.yml 77966888a81c4ceee1fcc79bce842c9667ad8a35
|
||||
F debian/changelog eb4304dfcb6bb66850ec740838090eb50ce1249b
|
||||
F debian/compat b6abd567fa79cbe0196d093a067271361dc6ca8b
|
||||
@ -241,9 +241,9 @@ F src/SearchBox.cpp d4209c575baa9933e1ce5ed376e785b289a145ba
|
||||
F src/SearchBox.h 0c78d3a68136dab3e0e71b83ae36f22bd2688ab2
|
||||
F src/Settings.cpp 258d3f466f6a125ce2b8519d6d57a312cbc44a3f
|
||||
F src/Settings.h 0a10b0b83fe804bdc7dac58eed06b5b6ee422055
|
||||
F src/SettingsDialog.cpp 042bd3dbe715b0497541b6853a32c4d1f9ac1da9
|
||||
F src/SettingsDialog.cpp fa0c70eaf0fa7edb15de302d041cdb552fe523d5
|
||||
F src/SettingsDialog.h 5eb3ae2cbb00ab5544e1889860f5376f69fe47cd
|
||||
F src/Utils.cpp abde90735cc999f8ce71c98aa3d9eaf642e9e7f2
|
||||
F src/Utils.cpp a375d6b641658b49d84462773d1e052de0c716dd
|
||||
F src/Utils.h c6341ee49a8fc35f215facb196d70bf9b1f2fc0f
|
||||
F src/Workspace.cpp feab8b238a99cf1a60731aedf07af96010d9795d
|
||||
F src/Workspace.h 54eef32658b13a34fe78ae26887420e8ff358eaa
|
||||
@ -260,7 +260,7 @@ F ui/MainWindow.ui f9774e6dddb9462d8072bffd6c511bee7f470b9d
|
||||
F ui/RemoteDialog.ui 95a4750d972ed8c49bb10b95db91ff16cfe2dd0b
|
||||
F ui/RevisionDialog.ui 27c3b98c665fec014a50cbf3352c0627f75e68cd
|
||||
F ui/SettingsDialog.ui 2e1b6ce7a49100088c5649292c1319e62e0302e1
|
||||
P 14ddcd158900cd672a4c3d88e8465f7ff88f14d2
|
||||
R 13c0a9d34022fcab44e2092809405ed0
|
||||
P 9b67709b92eae80e70f8ae2b775014092f820fdf
|
||||
R 53802be5132d1fc255734da4b05ec8a0
|
||||
U Kostas
|
||||
Z c23b2b3c597255a7e49b40764d226f17
|
||||
Z 11e2710ccd6ed208d70aec7542a52542
|
||||
|
@ -1 +1 @@
|
||||
9b67709b92eae80e70f8ae2b775014092f820fdf
|
||||
e017a9126cf63ed060dd88accfcabbd9726e9aa7
|
@ -89,7 +89,7 @@ void SettingsDialog::on_buttonBox_accepted()
|
||||
{
|
||||
CustomAction &a = currentCustomActions[i];
|
||||
a.Description = a.Description.trimmed();
|
||||
a.Command = QDir::fromNativeSeparators(a.Command.trimmed());
|
||||
a.Command = a.Command.trimmed();
|
||||
}
|
||||
|
||||
PutCustomAction(ui->cmbCustomAction->currentIndex());
|
||||
@ -157,8 +157,14 @@ QString SettingsDialog::LangNameToId(const QString &name)
|
||||
void SettingsDialog::on_btnSelectCustomFileActionCommand_clicked()
|
||||
{
|
||||
QString path = SelectExe(this, tr("Select command"));
|
||||
if(!path.isEmpty())
|
||||
ui->lineCustomActionCommand->setText(QDir::toNativeSeparators(path));
|
||||
if(path.isEmpty())
|
||||
return;
|
||||
|
||||
// Quote path if it contains spaces
|
||||
if(path.indexOf(' ')!=-1)
|
||||
path = '"' + path + '"';
|
||||
|
||||
ui->lineCustomActionCommand->setText(QDir::toNativeSeparators(path));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -178,7 +184,7 @@ void SettingsDialog::PutCustomAction(int index)
|
||||
Q_ASSERT(index>=0 && index < currentCustomActions.size());
|
||||
CustomAction &action = currentCustomActions[index];
|
||||
action.Description = ui->lineCustomActionDescription->text().trimmed();
|
||||
action.Command = QDir::fromNativeSeparators(ui->lineCustomActionCommand->text().trimmed());
|
||||
action.Command = ui->lineCustomActionCommand->text().trimmed();
|
||||
action.Context = static_cast<CustomActionContext>(ui->cmbCustomActionContext->currentIndex()+1);
|
||||
action.MultipleSelection = ui->chkCustomActionMultipleSelection->isChecked();
|
||||
}
|
||||
|
@ -581,7 +581,7 @@ bool SpawnExternalProcess(QObject *processParent, const QString& command, const
|
||||
{
|
||||
// Add in-place
|
||||
QString n = p;
|
||||
n.replace(MACRO_WORKSPACE, workspaceDir, Qt::CaseInsensitive);
|
||||
n.replace(MACRO_WORKSPACE, QDir::toNativeSeparators(workspaceDir), Qt::CaseInsensitive);
|
||||
params.push_back(n);
|
||||
continue;
|
||||
}
|
||||
@ -591,39 +591,31 @@ bool SpawnExternalProcess(QObject *processParent, const QString& command, const
|
||||
}
|
||||
|
||||
// Build file params
|
||||
foreach(const QString &f, fileList)
|
||||
if(!macro_file.isEmpty())
|
||||
{
|
||||
QString path = QFileInfo(workspaceDir + PATH_SEPARATOR + f).absoluteFilePath();
|
||||
|
||||
// Apply macro
|
||||
if(!macro_file.isEmpty())
|
||||
foreach(const QString &f, fileList)
|
||||
{
|
||||
QString path = QDir::toNativeSeparators(QFileInfo(workspaceDir + PATH_SEPARATOR + f).absoluteFilePath());
|
||||
|
||||
QString macro = macro_file;
|
||||
path = macro.replace(MACRO_FILE, path, Qt::CaseInsensitive);
|
||||
params.append(path);
|
||||
}
|
||||
|
||||
params.append(path);
|
||||
}
|
||||
|
||||
|
||||
// Build folder params
|
||||
foreach(const QString &f, pathSet)
|
||||
if(!macro_folder.isEmpty())
|
||||
{
|
||||
QString path = QFileInfo(workspaceDir + PATH_SEPARATOR + f).absoluteFilePath();
|
||||
|
||||
// Apply macro
|
||||
if(!macro_folder.isEmpty())
|
||||
foreach(const QString &f, pathSet)
|
||||
{
|
||||
QString path = QDir::toNativeSeparators(QFileInfo(workspaceDir + PATH_SEPARATOR + f).absoluteFilePath());
|
||||
|
||||
QString macro = macro_folder;
|
||||
path = macro.replace(MACRO_FOLDER, path, Qt::CaseInsensitive);
|
||||
params.append(path);
|
||||
}
|
||||
params.append(path);
|
||||
}
|
||||
|
||||
// Skip action if nothing is available
|
||||
if(params.empty())
|
||||
return false;
|
||||
|
||||
uiCallback.logText("<b>"+cmd + " "+params.join(" ")+"</b><br>", true);
|
||||
|
||||
QProcess proc(processParent);
|
||||
|
Loading…
x
Reference in New Issue
Block a user