1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
|
int action = settings.GetValue(FUEL_SETTING_FILE_DBLCLICK).toInt();
if(action==FILE_DLBCLICK_ACTION_DIFF)
on_actionDiff_triggered();
else if(action==FILE_DLBCLICK_ACTION_OPEN)
on_actionOpenFile_triggered();
else if(action==FILE_DLBCLICK_ACTION_OPENCONTAINING)
on_actionOpenContaining_triggered();
}
//------------------------------------------------------------------------------
void MainWindow::on_actionOpenFile_triggered()
{
QStringList selection;
getSelectionFilenames(selection);
|
>
>
|
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
|
int action = settings.GetValue(FUEL_SETTING_FILE_DBLCLICK).toInt();
if(action==FILE_DLBCLICK_ACTION_DIFF)
on_actionDiff_triggered();
else if(action==FILE_DLBCLICK_ACTION_OPEN)
on_actionOpenFile_triggered();
else if(action==FILE_DLBCLICK_ACTION_OPENCONTAINING)
on_actionOpenContaining_triggered();
else if(action==FILE_DLBCLICK_ACTION_CUSTOM)
invokeCustomAction(0);
}
//------------------------------------------------------------------------------
void MainWindow::on_actionOpenFile_triggered()
{
QStringList selection;
getSelectionFilenames(selection);
|
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
|
ui->fileTableView->removeAction(fileActionSeparator);
if(!has_folder_actions)
menuWorkspace->removeAction(workspaceActionSeparator);
}
//------------------------------------------------------------------------------
void MainWindow::on_actionCustomAction_triggered()
{
QAction *action = qobject_cast<QAction *>(sender());
if(!action)
return;
int action_id = action->data().toInt();
Q_ASSERT(action_id < settings.GetCustomActions().size());
CustomAction &cust_action = settings.GetCustomActions()[action_id];
Q_ASSERT(cust_action.IsValid());
Q_ASSERT(!cust_action.Command.isEmpty());
QStringList file_selection;
if(cust_action.IsActive(ACTION_CONTEXT_FILES))
getSelectionFilenames(file_selection, WorkspaceFile::TYPE_ALL);
|
|
<
<
<
<
<
|
|
|
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
|
ui->fileTableView->removeAction(fileActionSeparator);
if(!has_folder_actions)
menuWorkspace->removeAction(workspaceActionSeparator);
}
//------------------------------------------------------------------------------
void MainWindow::invokeCustomAction(int actionId)
{
Q_ASSERT(actionId < settings.GetCustomActions().size());
CustomAction &cust_action = settings.GetCustomActions()[actionId];
Q_ASSERT(cust_action.IsValid());
Q_ASSERT(!cust_action.Command.isEmpty());
QStringList file_selection;
if(cust_action.IsActive(ACTION_CONTEXT_FILES))
getSelectionFilenames(file_selection, WorkspaceFile::TYPE_ALL);
|
2822
2823
2824
2825
2826
2827
2828
|
}
}
const QString &wkdir = fossil().getCurrentWorkspace();
SpawnExternalProcess(this, cust_action.Command, file_selection, path_selection, wkdir, uiCallback);
}
|
>
>
>
>
>
>
>
>
>
>
>
|
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
|
}
}
const QString &wkdir = fossil().getCurrentWorkspace();
SpawnExternalProcess(this, cust_action.Command, file_selection, path_selection, wkdir, uiCallback);
}
//------------------------------------------------------------------------------
void MainWindow::on_actionCustomAction_triggered()
{
QAction *action = qobject_cast<QAction *>(sender());
if(!action)
return;
int action_id = action->data().toInt();
invokeCustomAction(action_id);
}
|