himselfv / viper

Enhanced Windows Service manager application
35 stars 2 forks source link

TriggerList: Export/Import triggers with service names #32

Closed himselfv closed 6 years ago

himselfv commented 6 years ago

Original report by me.

Right now there's an Export command in the TriggerList which exports a single merged list of all selected triggers. This might be useful when editing a single service's triggers, but for multi-service trigger list this is strange.

There's also no Import command in multi-service list, and possible implementations don't seem too useful. Who would import a nameless list of triggers and then choose a service to which to attach them?

Instead it would be good to have an Export command which produced trigger keys with full paths (including service names).

And an Import command which allowed to import such files, updating existing triggers and adding new ones. (And probably skipping the missing services, since we aren't importing services here).

This Import command would then be able to handle "full-blown" service export files too. It will simply only select the trigger keys inside. That should be part of its parsing algorithm.

When using this command in the single-service mode, it can silently execute the import when the source entries are all for the currently selected service. In other cases it can pop up a list of all available entries, letting the user choose which to import.

This ability might also be helpful with multi-service import. It might select all available entries by default so that it serves instead of a confirmation dialog, you simply verify the list and click OK.

We might still need the service-independent export format, for copying with Ctrl-C/Ctrl-V if for nothing else. But it might be shifted to be the alternative format for export.

himselfv commented 6 years ago

Done, export now always exports with full trigger registry paths and indices. There's now a dialog on import to let you choose which triggers to import. Import now always simply adds the triggers to the appropriate service.

When importing to the generic "all triggers" list, it imports each trigger to the service it had been exported from. Triggers for services which are missing from the local PC are grayed out.

When importing to the specific service, the "original service" column is hidden; any trigger can be checked, and all checked ones will be imported to the current service.