GODT-2210: v3.0 splash screen.
Other: new splash screen content.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -32,12 +32,10 @@ service Bridge {
|
||||
// App related calls
|
||||
rpc CheckTokens(google.protobuf.StringValue) returns (google.protobuf.StringValue);
|
||||
rpc AddLogEntry(AddLogEntryRequest) returns (google.protobuf.Empty);
|
||||
rpc GuiReady (google.protobuf.Empty) returns (google.protobuf.Empty);
|
||||
rpc GuiReady (google.protobuf.Empty) returns (GuiReadyResponse);
|
||||
rpc Quit (google.protobuf.Empty) returns (google.protobuf.Empty);
|
||||
rpc Restart (google.protobuf.Empty) returns (google.protobuf.Empty);
|
||||
rpc ShowOnStartup(google.protobuf.Empty) returns (google.protobuf.BoolValue);
|
||||
rpc ShowSplashScreen(google.protobuf.Empty) returns (google.protobuf.BoolValue);
|
||||
rpc IsFirstGuiStart(google.protobuf.Empty) returns (google.protobuf.BoolValue);
|
||||
rpc SetIsAutostartOn(google.protobuf.BoolValue) returns (google.protobuf.Empty);
|
||||
rpc IsAutostartOn(google.protobuf.Empty) returns (google.protobuf.BoolValue);
|
||||
rpc SetIsBetaEnabled(google.protobuf.BoolValue) returns (google.protobuf.Empty);
|
||||
@ -126,6 +124,15 @@ message AddLogEntryRequest {
|
||||
string message = 3;
|
||||
};
|
||||
|
||||
|
||||
//**********************************************************
|
||||
// GuiReady
|
||||
//**********************************************************
|
||||
message GuiReadyResponse {
|
||||
bool showSplashScreen = 1;
|
||||
}
|
||||
|
||||
|
||||
//**********************************************************
|
||||
// Bug reporting related messages.
|
||||
//**********************************************************
|
||||
|
||||
@ -27,12 +27,10 @@ type BridgeClient interface {
|
||||
// App related calls
|
||||
CheckTokens(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*wrapperspb.StringValue, error)
|
||||
AddLogEntry(ctx context.Context, in *AddLogEntryRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
GuiReady(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
GuiReady(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GuiReadyResponse, error)
|
||||
Quit(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
Restart(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
ShowOnStartup(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error)
|
||||
ShowSplashScreen(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error)
|
||||
IsFirstGuiStart(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error)
|
||||
SetIsAutostartOn(ctx context.Context, in *wrapperspb.BoolValue, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
IsAutostartOn(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error)
|
||||
SetIsBetaEnabled(ctx context.Context, in *wrapperspb.BoolValue, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
@ -116,8 +114,8 @@ func (c *bridgeClient) AddLogEntry(ctx context.Context, in *AddLogEntryRequest,
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *bridgeClient) GuiReady(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
func (c *bridgeClient) GuiReady(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GuiReadyResponse, error) {
|
||||
out := new(GuiReadyResponse)
|
||||
err := c.cc.Invoke(ctx, "/grpc.Bridge/GuiReady", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -152,24 +150,6 @@ func (c *bridgeClient) ShowOnStartup(ctx context.Context, in *emptypb.Empty, opt
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *bridgeClient) ShowSplashScreen(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error) {
|
||||
out := new(wrapperspb.BoolValue)
|
||||
err := c.cc.Invoke(ctx, "/grpc.Bridge/ShowSplashScreen", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *bridgeClient) IsFirstGuiStart(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error) {
|
||||
out := new(wrapperspb.BoolValue)
|
||||
err := c.cc.Invoke(ctx, "/grpc.Bridge/IsFirstGuiStart", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *bridgeClient) SetIsAutostartOn(ctx context.Context, in *wrapperspb.BoolValue, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/grpc.Bridge/SetIsAutostartOn", in, out, opts...)
|
||||
@ -632,12 +612,10 @@ type BridgeServer interface {
|
||||
// App related calls
|
||||
CheckTokens(context.Context, *wrapperspb.StringValue) (*wrapperspb.StringValue, error)
|
||||
AddLogEntry(context.Context, *AddLogEntryRequest) (*emptypb.Empty, error)
|
||||
GuiReady(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
|
||||
GuiReady(context.Context, *emptypb.Empty) (*GuiReadyResponse, error)
|
||||
Quit(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
|
||||
Restart(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
|
||||
ShowOnStartup(context.Context, *emptypb.Empty) (*wrapperspb.BoolValue, error)
|
||||
ShowSplashScreen(context.Context, *emptypb.Empty) (*wrapperspb.BoolValue, error)
|
||||
IsFirstGuiStart(context.Context, *emptypb.Empty) (*wrapperspb.BoolValue, error)
|
||||
SetIsAutostartOn(context.Context, *wrapperspb.BoolValue) (*emptypb.Empty, error)
|
||||
IsAutostartOn(context.Context, *emptypb.Empty) (*wrapperspb.BoolValue, error)
|
||||
SetIsBetaEnabled(context.Context, *wrapperspb.BoolValue) (*emptypb.Empty, error)
|
||||
@ -706,7 +684,7 @@ func (UnimplementedBridgeServer) CheckTokens(context.Context, *wrapperspb.String
|
||||
func (UnimplementedBridgeServer) AddLogEntry(context.Context, *AddLogEntryRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method AddLogEntry not implemented")
|
||||
}
|
||||
func (UnimplementedBridgeServer) GuiReady(context.Context, *emptypb.Empty) (*emptypb.Empty, error) {
|
||||
func (UnimplementedBridgeServer) GuiReady(context.Context, *emptypb.Empty) (*GuiReadyResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GuiReady not implemented")
|
||||
}
|
||||
func (UnimplementedBridgeServer) Quit(context.Context, *emptypb.Empty) (*emptypb.Empty, error) {
|
||||
@ -718,12 +696,6 @@ func (UnimplementedBridgeServer) Restart(context.Context, *emptypb.Empty) (*empt
|
||||
func (UnimplementedBridgeServer) ShowOnStartup(context.Context, *emptypb.Empty) (*wrapperspb.BoolValue, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ShowOnStartup not implemented")
|
||||
}
|
||||
func (UnimplementedBridgeServer) ShowSplashScreen(context.Context, *emptypb.Empty) (*wrapperspb.BoolValue, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ShowSplashScreen not implemented")
|
||||
}
|
||||
func (UnimplementedBridgeServer) IsFirstGuiStart(context.Context, *emptypb.Empty) (*wrapperspb.BoolValue, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method IsFirstGuiStart not implemented")
|
||||
}
|
||||
func (UnimplementedBridgeServer) SetIsAutostartOn(context.Context, *wrapperspb.BoolValue) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SetIsAutostartOn not implemented")
|
||||
}
|
||||
@ -989,42 +961,6 @@ func _Bridge_ShowOnStartup_Handler(srv interface{}, ctx context.Context, dec fun
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Bridge_ShowSplashScreen_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(emptypb.Empty)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(BridgeServer).ShowSplashScreen(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.Bridge/ShowSplashScreen",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BridgeServer).ShowSplashScreen(ctx, req.(*emptypb.Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Bridge_IsFirstGuiStart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(emptypb.Empty)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(BridgeServer).IsFirstGuiStart(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/grpc.Bridge/IsFirstGuiStart",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BridgeServer).IsFirstGuiStart(ctx, req.(*emptypb.Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Bridge_SetIsAutostartOn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(wrapperspb.BoolValue)
|
||||
if err := dec(in); err != nil {
|
||||
@ -1923,14 +1859,6 @@ var Bridge_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "ShowOnStartup",
|
||||
Handler: _Bridge_ShowOnStartup_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ShowSplashScreen",
|
||||
Handler: _Bridge_ShowSplashScreen_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "IsFirstGuiStart",
|
||||
Handler: _Bridge_IsFirstGuiStart_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SetIsAutostartOn",
|
||||
Handler: _Bridge_SetIsAutostartOn_Handler,
|
||||
|
||||
@ -210,10 +210,6 @@ func (s *Service) Loop() error {
|
||||
go s.monitorParentPID()
|
||||
}
|
||||
|
||||
defer func() {
|
||||
_ = s.bridge.SetFirstStartGUI(false)
|
||||
}()
|
||||
|
||||
go func() {
|
||||
defer s.panicHandler.HandlePanic()
|
||||
s.watchEvents()
|
||||
|
||||
@ -91,11 +91,15 @@ func (s *Service) AddLogEntry(ctx context.Context, request *AddLogEntryRequest)
|
||||
}
|
||||
|
||||
// GuiReady implement the GuiReady gRPC service call.
|
||||
func (s *Service) GuiReady(ctx context.Context, _ *emptypb.Empty) (*emptypb.Empty, error) {
|
||||
func (s *Service) GuiReady(ctx context.Context, _ *emptypb.Empty) (*GuiReadyResponse, error) {
|
||||
s.log.Debug("GuiReady")
|
||||
|
||||
s.initializationDone.Do(s.initializing.Done)
|
||||
return &emptypb.Empty{}, nil
|
||||
|
||||
// Splash screen should be displayed only to users who start v3 for the first time after upgrading from v2.
|
||||
return &GuiReadyResponse{
|
||||
ShowSplashScreen: (!s.bridge.GetFirstStart()) && s.bridge.GetLastVersion().LessThan(semver.MustParse("3.0.0")),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Quit implement the Quit gRPC service call.
|
||||
@ -139,24 +143,6 @@ func (s *Service) ShowOnStartup(ctx context.Context, _ *emptypb.Empty) (*wrapper
|
||||
return wrapperspb.Bool(s.showOnStartup), nil
|
||||
}
|
||||
|
||||
func (s *Service) ShowSplashScreen(ctx context.Context, _ *emptypb.Empty) (*wrapperspb.BoolValue, error) {
|
||||
s.log.Debug("ShowSplashScreen")
|
||||
|
||||
if s.bridge.GetFirstStart() {
|
||||
return wrapperspb.Bool(false), nil
|
||||
}
|
||||
|
||||
// Current splash screen contains update on rebranding. Therefore, it
|
||||
// should be shown only if the last used version was less than 2.2.0.
|
||||
return wrapperspb.Bool(s.bridge.GetLastVersion().LessThan(semver.MustParse("2.2.0"))), nil
|
||||
}
|
||||
|
||||
func (s *Service) IsFirstGuiStart(ctx context.Context, _ *emptypb.Empty) (*wrapperspb.BoolValue, error) {
|
||||
s.log.Debug("IsFirstGuiStart")
|
||||
|
||||
return wrapperspb.Bool(s.bridge.GetFirstStartGUI()), nil
|
||||
}
|
||||
|
||||
func (s *Service) SetIsAutostartOn(ctx context.Context, isOn *wrapperspb.BoolValue) (*emptypb.Empty, error) {
|
||||
s.log.WithField("show", isOn.Value).Debug("SetIsAutostartOn")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user