Custom actions now support explicit single selections
FossilOrigin-Name: e422f84c485ada3ae538712434ae64ea80021f8b
This commit is contained in:
parent
30d6cf3da4
commit
509a5d2fe1
18
manifest
18
manifest
@ -1,5 +1,5 @@
|
||||
C Refactored\scustom\saction\sprocess\sinvocation\sinto\sa\sseparate\sfunction\n
|
||||
D 2015-07-10T15:49:00.994
|
||||
C Custom\sactions\snow\ssupport\sexplicit\ssingle\sselections\n\n
|
||||
D 2015-07-10T18:06:40.135
|
||||
F .travis.yml 77966888a81c4ceee1fcc79bce842c9667ad8a35
|
||||
F debian/changelog eb4304dfcb6bb66850ec740838090eb50ce1249b
|
||||
F debian/compat b6abd567fa79cbe0196d093a067271361dc6ca8b
|
||||
@ -224,7 +224,7 @@ F src/FslSettingsDialog.cpp 2531d3709f0eab66651671e3edead2ca720d07d5
|
||||
F src/FslSettingsDialog.h dfe2a61884a55a74cbb9206b6f6b482b979725e7
|
||||
F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c
|
||||
F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261
|
||||
F src/MainWindow.cpp ad1e2f3dd64ea0774feb7c13371c02bfac9f3f4b
|
||||
F src/MainWindow.cpp 6b31ae5eca52bc128a0a9dd3d3dc153545de7f8c
|
||||
F src/MainWindow.h 573ffe960044afb446505949da50e0fb5ec2f75f
|
||||
F src/RemoteDialog.cpp 8540cc5e2e41c4127ed8a028d84691604fa6ecac
|
||||
F src/RemoteDialog.h 5e0438c2bd7c79b1bb44bfbd58c2181b544a9e5d
|
||||
@ -233,8 +233,8 @@ F src/RevisionDialog.h b718c3009342eaabad39c8a11a253a4e4fef7a73
|
||||
F src/SearchBox.cpp d4209c575baa9933e1ce5ed376e785b289a145ba
|
||||
F src/SearchBox.h 0c78d3a68136dab3e0e71b83ae36f22bd2688ab2
|
||||
F src/Settings.cpp 258d3f466f6a125ce2b8519d6d57a312cbc44a3f
|
||||
F src/Settings.h 02bee6bd1178dc456fc80b277edd0843e535649c
|
||||
F src/SettingsDialog.cpp b0d0bfc45534b7bed148776d4c3865a68d59ec15
|
||||
F src/Settings.h c743065c1388ae431aa46c2e02470fb3c08b6a79
|
||||
F src/SettingsDialog.cpp 1b092c050753afa96f0d23e85775ecf32f6d939a
|
||||
F src/SettingsDialog.h 5eb3ae2cbb00ab5544e1889860f5376f69fe47cd
|
||||
F src/Utils.cpp 876942a44202611d3c778c67f6d0a344e241a000
|
||||
F src/Utils.h 4613424aaeb6910689b5821a2dd44ca0b6dd301f
|
||||
@ -251,8 +251,8 @@ F ui/FslSettingsDialog.ui eb3d4cb764cab90b01e82922237d8c42d6ce1749
|
||||
F ui/MainWindow.ui 10181826a25056ed5aba2b23a7d110159be7c043
|
||||
F ui/RemoteDialog.ui 95a4750d972ed8c49bb10b95db91ff16cfe2dd0b
|
||||
F ui/RevisionDialog.ui 27c3b98c665fec014a50cbf3352c0627f75e68cd
|
||||
F ui/SettingsDialog.ui b5858067cdb16c3f132af4cf8332e4ad255c915c
|
||||
P 381aa49e9b6b5d5424ee6dbd69d0890634d5bf08
|
||||
R a7fde02a076af76b8e8f49221c822309
|
||||
F ui/SettingsDialog.ui 47b9a31e28ad523f14a1c4cd361270b6babbdf7d
|
||||
P bf36bf1c733da77a39ab9a8b7c63b892c11ef93c
|
||||
R acadfb6b4bc5dcb566aa9c59fbff87eb
|
||||
U kostas
|
||||
Z 13ebcbf30d3401de44fb0e771c5a69f1
|
||||
Z 902db766b484bf48a8c240b796fa1687
|
||||
|
@ -1 +1 @@
|
||||
bf36bf1c733da77a39ab9a8b7c63b892c11ef93c
|
||||
e422f84c485ada3ae538712434ae64ea80021f8b
|
@ -1097,6 +1097,8 @@ void MainWindow::applySettings()
|
||||
action.Command = store->value("Command").toString();
|
||||
if(store->contains("Context"))
|
||||
action.Context = static_cast<CustomActionContext>(store->value("Context").toInt());
|
||||
if(store->contains("MultipleSelection"))
|
||||
action.MultipleSelection = store->value("MultipleSelection").toBool();
|
||||
|
||||
++last_action;
|
||||
}
|
||||
@ -1156,6 +1158,7 @@ void MainWindow::updateSettings()
|
||||
store->setValue("Description", action.Description);
|
||||
store->setValue("Command", action.Command);
|
||||
store->setValue("Context", static_cast<int>(action.Context));
|
||||
store->setValue("MultipleSelection", action.MultipleSelection);
|
||||
++active_actions;
|
||||
}
|
||||
store->endArray();
|
||||
@ -2801,6 +2804,24 @@ void MainWindow::on_actionCustomAction_triggered()
|
||||
if(cust_action.IsActive(ACTION_CONTEXT_FOLDERS))
|
||||
getSelectionPaths(path_selection);
|
||||
|
||||
// Trim excess items for single selection
|
||||
if(!cust_action.MultipleSelection)
|
||||
{
|
||||
if(!file_selection.empty())
|
||||
{
|
||||
QString item = *file_selection.begin();
|
||||
file_selection.clear();
|
||||
file_selection.push_back(item);
|
||||
path_selection.clear();
|
||||
}
|
||||
else if(!path_selection.empty())
|
||||
{
|
||||
QString item = *path_selection.begin();
|
||||
path_selection.clear();
|
||||
path_selection.insert(item);
|
||||
}
|
||||
}
|
||||
|
||||
const QString &wkdir = fossil().getCurrentWorkspace();
|
||||
|
||||
SpawnExternalProcess(this, cust_action.Command, file_selection, path_selection, wkdir, uiCallback);
|
||||
|
@ -39,7 +39,7 @@ enum CustomActionContext
|
||||
|
||||
enum
|
||||
{
|
||||
MAX_CUSTOM_ACTIONS = 5
|
||||
MAX_CUSTOM_ACTIONS = 9
|
||||
};
|
||||
|
||||
struct CustomAction
|
||||
@ -48,6 +48,7 @@ struct CustomAction
|
||||
QString Description;
|
||||
QString Command;
|
||||
CustomActionContext Context;
|
||||
bool MultipleSelection;
|
||||
|
||||
CustomAction()
|
||||
{
|
||||
@ -69,6 +70,7 @@ struct CustomAction
|
||||
Description.clear();
|
||||
Command.clear();
|
||||
Context = ACTION_CONTEXT_FILES;
|
||||
MultipleSelection = true;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -165,6 +165,7 @@ void SettingsDialog::GetCustomAction(int index)
|
||||
ui->lineCustomActionDescription->setText(action.Description);
|
||||
ui->lineCustomActionCommand->setText(action.Command);
|
||||
ui->cmbCustomActionContext->setCurrentIndex(action.Context-1);
|
||||
ui->chkCustomActionMultipleSelection->setChecked(action.MultipleSelection);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -175,6 +176,7 @@ void SettingsDialog::PutCustomAction(int index)
|
||||
action.Description = ui->lineCustomActionDescription->text().trimmed();
|
||||
action.Command = QDir::fromNativeSeparators(ui->lineCustomActionCommand->text().trimmed());
|
||||
action.Context = static_cast<CustomActionContext>(ui->cmbCustomActionContext->currentIndex()+1);
|
||||
action.MultipleSelection = ui->chkCustomActionMultipleSelection->isChecked();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -10,7 +10,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>449</width>
|
||||
<height>408</height>
|
||||
<height>428</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -211,16 +211,6 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Context</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="cmbCustomActionContext"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
@ -233,7 +223,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="3" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_10">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineCustomActionCommand">
|
||||
@ -263,6 +253,30 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Context</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QComboBox" name="cmbCustomActionContext"/>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QCheckBox" name="chkCustomActionMultipleSelection">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Multiple Selection</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
x
Reference in New Issue
Block a user