mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 05:52:22 -04:00

* add SaveCustomColours rpc method * restore custom colour palette on editor init * save custom colour palette on colour picker open and input there doesn't seem to be an event fired when the picker is cancelled/closed, so it's still possible for work to be lost * save colours on `change` instead of `input` `input` is supposed to be fired on every adjustment to the picker whereas `change` is only fired when the picker is accepted, but qt seems to treat both as the latter, so this is currently a no-op * Store colors in the collection One minor tweak to the logic while I was there: an invalid color no longer invalidates all the rest. --------- Co-authored-by: Damien Elmes <gpg@ankiweb.net>
45 lines
1.3 KiB
Protocol Buffer
45 lines
1.3 KiB
Protocol Buffer
// Copyright: Ankitects Pty Ltd and contributors
|
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
syntax = "proto3";
|
|
|
|
option java_multiple_files = true;
|
|
|
|
package anki.frontend;
|
|
|
|
import "anki/scheduler.proto";
|
|
import "anki/generic.proto";
|
|
import "anki/search.proto";
|
|
|
|
service FrontendService {
|
|
// Returns values from the reviewer
|
|
rpc GetSchedulingStatesWithContext(generic.Empty)
|
|
returns (SchedulingStatesWithContext);
|
|
// Updates reviewer state
|
|
rpc SetSchedulingStates(SetSchedulingStatesRequest) returns (generic.Empty);
|
|
|
|
// Notify Qt layer so window modality can be updated.
|
|
rpc ImportDone(generic.Empty) returns (generic.Empty);
|
|
|
|
rpc SearchInBrowser(search.SearchNode) returns (generic.Empty);
|
|
|
|
// Force closing the deck options.
|
|
rpc deckOptionsRequireClose(generic.Empty) returns (generic.Empty);
|
|
// Warns python that the deck option web view is ready to receive requests.
|
|
rpc deckOptionsReady(generic.Empty) returns (generic.Empty);
|
|
|
|
// Save colour picker's custom colour palette
|
|
rpc SaveCustomColours(generic.Empty) returns (generic.Empty);
|
|
}
|
|
|
|
service BackendFrontendService {}
|
|
|
|
message SchedulingStatesWithContext {
|
|
scheduler.SchedulingStates states = 1;
|
|
scheduler.SchedulingContext context = 2;
|
|
}
|
|
|
|
message SetSchedulingStatesRequest {
|
|
string key = 1;
|
|
scheduler.SchedulingStates states = 2;
|
|
}
|