admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Quintiq file version 2.0
#parent: ToolbarMain/ValueHolderImportProfileMessage
Response OnValueChanged () id:Response_ToolbarMain_ValueHolderImportProfileMessage_OnValueChanged
{
  #keys: '[132894.0.410538737]'
  Body:
  [*
    // When error messages change, we need to update the tooltip and image of Import profiles button
    
    image := 'IMPORT2';
    tooltip := Translations::MP_Designer_ImportProfiles_Tooltip();
    message := '';
    
    syncStatus := this.Value();
    
    // Only change icon image and tooltip when synchronization in progress
    if( not ( syncStatus = ''
              or syncStatus = Translations::MPSync_Synchronization_Complete() ) )
    {
      if( syncStatus = Translations::MPSync_Synchronization_Fail() )
      {
        image := 'DATA_ERROR';
        message := MacroPlan.SynchronizationErrorMessage();
      }
      else
      {
        image := 'HOURGLASS';
        message := syncStatus;
      }
    }
    
    /* Preserve broker error message so that user aware
       synchronization failed because of broker import error      */
    if( MPSync.ImportErrorMessage() <> '' )
    {
      image := 'DATA_ERROR';
      message := MPSync.ImportErrorMessage()
                 + '<br>'
                 + message;
    }
    
    if( message <> '' )
    {
      tooltip := tooltip + '<br>'
                 + message
                 + '</html>'
    }
    
    ButtonToolbarImportProfiles.SetProperty( 'Tooltip', tooltip );
    ButtonToolbarImportProfiles.SetProperty( 'Image', image );
  *]
  CanBindMultiple: false
  DefinitionID: 'Responsedef_ValueHolder_OnValueChanged'
  Precondition:
  [*
    return not isnull( MacroPlan );
  *]
}