Improve handling of upgrades and macros default tip
authorMichael Smith <smithm@netapps.com.au>
Tue Apr 27 18:00:29 2010 +1000 (2010-04-27)
changeset 16217668c875392
parent 161 48b2ab05200e
Improve handling of upgrades and macros
command.c
mkrpn.c
     1.1 --- a/command.c	Tue Apr 27 08:14:03 2010 +1000
     1.2 +++ b/command.c	Tue Apr 27 18:00:29 2010 +1000
     1.3 @@ -596,12 +596,22 @@
     1.4  }
     1.5  
     1.6  int keyItemCount = 0;
     1.7 +char keyLabel[LABEL_SIZE];
     1.8  
     1.9  /* Add a new soft key */
    1.10  int keyItemExists(void *arg,int argc,char **argv,char **columnNames)
    1.11  {
    1.12 -  printf("keyItemExists: start\n");
    1.13 +  int indx;
    1.14 +  
    1.15 +  for(indx = 0; indx < argc; indx++)
    1.16 +  {
    1.17 +    if(!strcmp(columnNames[indx],"LABEL"))
    1.18 +    {
    1.19 +      strcpy(keyLabel,argv[indx]);
    1.20 +    }
    1.21 +  }
    1.22    keyItemCount++;
    1.23 +  printf("keyItemExists: %d\n",keyItemCount);
    1.24    return(0);
    1.25  }
    1.26  
    1.27 @@ -613,7 +623,10 @@
    1.28    db_execute(keyItemExists,db_command);
    1.29    if(keyItemCount)
    1.30    {
    1.31 -    createCommandWherePossible(label,sequence);
    1.32 +    if(strcmp(keyLabel,label)) /* Not a match */
    1.33 +    {
    1.34 +      createCommandWherePossible(label,sequence);
    1.35 +    }
    1.36    }
    1.37    else
    1.38    {
     2.1 --- a/mkrpn.c	Tue Apr 27 08:14:03 2010 +1000
     2.2 +++ b/mkrpn.c	Tue Apr 27 18:00:29 2010 +1000
     2.3 @@ -277,11 +277,11 @@
     2.4    elm_init(argc,argv);
     2.5    enter_text_initialise("Cancel","Save");
     2.6    createWindow();
     2.7 -  getSoftKeys();
     2.8    if(db_app_upgraded("MKRPN",VERSION))
     2.9    {
    2.10      createBuiltInMacros();
    2.11    }
    2.12 +  getSoftKeys();
    2.13    setFunctionSet(0);
    2.14    updateEntry();
    2.15    ecore_main_loop_begin();