Example #1
0
static void setUpComboFromSingleStrings(GWEN_DIALOG *dlg,
                                        const char *comboBoxName,
                                        const char **strings,
                                        const char *s)
{
  int i;
  int j;
  const char *t;

  GWEN_Dialog_SetIntProperty(dlg, comboBoxName, GWEN_DialogProperty_ClearValues, 0, 0, 0);
  j=-1;
  for (i=0; ; i++) {
    t=strings[i];
    if (t==NULL)
      break;
    GWEN_Dialog_SetCharProperty(dlg, comboBoxName, GWEN_DialogProperty_AddValue, 0, t, 0);
    if (s && *s && strcmp(s, t)==0)
      j=i;
  }
  if (j==-1) {
    if (s && *s) {
      GWEN_Dialog_SetCharProperty(dlg, comboBoxName, GWEN_DialogProperty_AddValue, 0, s, 0);
      j=i;
    }
    else
      j=0;
  }
  GWEN_Dialog_SetIntProperty(dlg, comboBoxName, GWEN_DialogProperty_Value, 0, j, 0);
}
Example #2
0
int APY_NewUserDialog_HandleValueChanged(GWEN_DIALOG *dlg, const char *sender) {
  if (strcasecmp(sender, "wiz_username_edit")==0 ||
      strcasecmp(sender, "wiz_userid_edit")==0 ||
      strcasecmp(sender, "wiz_url_edit")==0 ||
      strcasecmp(sender, "wiz_apiuserid_edit")==0 ||
      strcasecmp(sender, "wiz_apipass_edit")==0 ||
      strcasecmp(sender, "wiz_apisig_edit")==0) {
    int rv;

    if (GWEN_Dialog_GetIntProperty(dlg, "wiz_stack", GWEN_DialogProperty_Value, 0, -1)==PAGE_USER) {
      rv=APY_NewUserDialog_GetUserPageData(dlg);
      if (rv<0)
	GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 0, 0);
      else
	GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 1, 0);
    }
    else if (GWEN_Dialog_GetIntProperty(dlg, "wiz_stack", GWEN_DialogProperty_Value, 0, -1)==PAGE_SECRET) {
      rv=APY_NewUserDialog_GetSecretPageData(dlg);
      if (rv<0)
	GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 0, 0);
      else
	GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 1, 0);
    }
    return GWEN_DialogEvent_ResultHandled;
  }
  return GWEN_DialogEvent_ResultNotHandled;
}
Example #3
0
void GWEN_DlgShowBox_Init(GWEN_DIALOG *dlg) {
  GWEN_DLGSHOWBOX *xdlg;
  int i;
  GWEN_DB_NODE *dbParams;

  assert(dlg);
  xdlg=GWEN_INHERIT_GETDATA(GWEN_DIALOG, GWEN_DLGSHOWBOX, dlg);
  assert(xdlg);

  dbParams=GWEN_Dialog_GetPreferences(dlg);
  assert(dbParams);

  /* read width */
  i=GWEN_DB_GetIntValue(dbParams, "dialog_width", 0, -1);
  if (i>=DIALOG_MINWIDTH)
    GWEN_Dialog_SetIntProperty(dlg, "", GWEN_DialogProperty_Width, 0, i, 0);

  /* read height */
  i=GWEN_DB_GetIntValue(dbParams, "dialog_height", 0, -1);
  if (i>=DIALOG_MINHEIGHT)
    GWEN_Dialog_SetIntProperty(dlg, "", GWEN_DialogProperty_Height, 0, i, 0);

  /* special stuff */
  if (xdlg->title)
    GWEN_Dialog_SetCharProperty(dlg, "", GWEN_DialogProperty_Title, 0, xdlg->title, 0);

  if (xdlg->text)
    GWEN_Dialog_SetCharProperty(dlg, "descrLabel", GWEN_DialogProperty_Title, 0, xdlg->text, 0);


  xdlg->wasInit=1;
}
Example #4
0
static void setUpComboFromDoubleStrings(GWEN_DIALOG *dlg,
                                        const char *comboBoxName,
                                        const char **strings,
                                        const char *s)
{
  int i;
  int j;
  const char *t1;
  const char *t2;

  GWEN_Dialog_SetIntProperty(dlg, comboBoxName, GWEN_DialogProperty_ClearValues, 0, 0, 0);
  j=-1;
  for (i=0; ; i+=2) {
    t1=strings[i];
    if (t1==NULL)
      break;
    t2=strings[i+1];
    GWEN_Dialog_SetCharProperty(dlg, comboBoxName, GWEN_DialogProperty_AddValue, 0, I18N(t2), 0);
    if (s && *s && strcasecmp(s, t1)==0)
      j=i/2;
  }
  if (j==-1) {
    if (s && *s) {
      GWEN_Dialog_SetCharProperty(dlg, comboBoxName, GWEN_DialogProperty_AddValue, 0, s, 0);
      j=i/2;
    }
    else
      j=0;
  }
  GWEN_Dialog_SetIntProperty(dlg, comboBoxName, GWEN_DialogProperty_Value, 0, j, 0);
}
Example #5
0
static int GWENHYWFAR_CB _gwenGuiSignalHandler(GWEN_DIALOG *dlg,
    GWEN_DIALOG_EVENTTYPE t,
    const char *sender) {
  fprintf(stderr,
          "Received event %d from widget [%s]\n", t, sender);

  switch(t) {
  case GWEN_DialogEvent_TypeInit:
    fprintf(stderr, "Init\n");
    GWEN_Dialog_SetCharProperty(dlg, "button1",
                                GWEN_DialogProperty_Title,
                                0,
                                "Click this button to close",
                                0);

    GWEN_Dialog_SetIntProperty(dlg, "",
                               GWEN_DialogProperty_Width,
                               0,
                               640,
                               0);
    GWEN_Dialog_SetIntProperty(dlg, "",
                               GWEN_DialogProperty_Height,
                               0,
                               480,
                               0);

    break;

  case GWEN_DialogEvent_TypeFini:
    fprintf(stderr, "Fini\n");
    break;
  case GWEN_DialogEvent_TypeValueChanged:
    fprintf(stderr, "ValueChanged\n");
    if (strcasecmp(sender, "listbox1")==0) {
      fprintf(stderr, "Selected list entry %d\n",
              GWEN_Dialog_GetIntProperty(dlg, "listbox1", GWEN_DialogProperty_Value, 0, -1));
    }
    break;

  case GWEN_DialogEvent_TypeActivated:
    fprintf(stderr, "Activated\n");
    if (strcasecmp(sender, "button1")==0)
      return GWEN_DialogEvent_ResultAccept;
    break;
  case GWEN_DialogEvent_TypeEnabled:
    fprintf(stderr, "Enabled\n");
    break;
  case GWEN_DialogEvent_TypeDisabled:
    fprintf(stderr, "Disabled\n");
    break;
  case GWEN_DialogEvent_TypeClose:
    fprintf(stderr, "Close\n");
    return GWEN_DialogEvent_ResultNotHandled;
  case GWEN_DialogEvent_TypeLast:
    fprintf(stderr, "Last, ignored\n");
    return GWEN_DialogEvent_ResultNotHandled;
  }
  return GWEN_DialogEvent_ResultHandled;
}
void AB_SetupNewUserDialog_Init(GWEN_DIALOG *dlg) {
  AB_SETUP_NEWUSER_DIALOG *xdlg;
  GWEN_DB_NODE *dbPrefs;
  int i;

  assert(dlg);
  xdlg=GWEN_INHERIT_GETDATA(GWEN_DIALOG, AB_SETUP_NEWUSER_DIALOG, dlg);
  assert(xdlg);

  dbPrefs=GWEN_Dialog_GetPreferences(dlg);

  GWEN_Dialog_SetCharProperty(dlg,
			      "",
			      GWEN_DialogProperty_Title,
			      0,
			      I18N("New User Wizard"),
			      0);

  /* select first page */
  GWEN_Dialog_SetIntProperty(dlg, "wiz_stack", GWEN_DialogProperty_Value, 0, 0, 0);

  /* setup intro page */
  GWEN_Dialog_SetCharProperty(dlg,
			      "wiz_begin_label",
			      GWEN_DialogProperty_Title,
			      0,
                              I18N("<html>"
                                   "<p>This dialog assists you in creating an online banking user."
				   "The following steps are:</p>"
                                   "<ul>"
				   "<li>select the banking protocol</li>"
				   "<li>select the type of user to create</li>"
                                   "</ul>"
                                   "</html>"
                                   "This dialog assists you in creating an online banking user.\n"
                                   "The following steps are:\n"
                                   " - select the banking protocol\n"
				   " - select the type of user to create\n"),
			      0);

  /* read width */
  i=GWEN_DB_GetIntValue(dbPrefs, "dialog_width", 0, -1);
  if (i>=DIALOG_MINWIDTH)
      GWEN_Dialog_SetIntProperty(dlg, "", GWEN_DialogProperty_Width, 0, i, 0);

  /* read height */
  i=GWEN_DB_GetIntValue(dbPrefs, "dialog_height", 0, -1);
  if (i>=DIALOG_MINHEIGHT)
      GWEN_Dialog_SetIntProperty(dlg, "", GWEN_DialogProperty_Height, 0, i, 0);

  /* disable next and previous buttons */
  GWEN_Dialog_SetIntProperty(dlg, "wiz_prev_button", GWEN_DialogProperty_Enabled, 0, 0, 0);
  GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 1, 0);
}
Example #7
0
void OH_GetInstituteDialog_UpdateList(GWEN_DIALOG *dlg)
{
  OH_GETINST_DIALOG *xdlg;
  const OH_INSTITUTE_SPEC_LIST *sl;

  assert(dlg);
  xdlg=GWEN_INHERIT_GETDATA(GWEN_DIALOG, OH_GETINST_DIALOG, dlg);
  assert(xdlg);

  /* clear bank info list */
  GWEN_Dialog_SetIntProperty(dlg, "listBox", GWEN_DialogProperty_ClearValues, 0, 0, 0);
  OH_InstituteSpec_List_Clear(xdlg->matchingSpecList);
  OH_InstituteData_free(xdlg->selectedData);
  xdlg->selectedData=NULL;

  sl=OfxHome_GetSpecs(xdlg->ofxHome);
  if (sl) {
    GWEN_BUFFER *tbuf;
    const OH_INSTITUTE_SPEC *os;
    const char *s;

    s=GWEN_Dialog_GetCharProperty(dlg, "nameEdit", GWEN_DialogProperty_Value, 0, NULL);
    tbuf=GWEN_Buffer_new(0, 256, 0, 1);
    os=OH_InstituteSpec_List_First(sl);
    while (os) {
      const char *bname;

      bname=OH_InstituteSpec_GetName(os);
      /* only add matching entries */
      if ((s && bname && GWEN_Text_StrCaseStr(bname, s)!=NULL) ||
          !(s && *s)) {
        OH_InstituteSpec_List_Add(OH_InstituteSpec_dup(os), xdlg->matchingSpecList);
        createListBoxString(os, tbuf);

        GWEN_Dialog_SetCharProperty(dlg,
                                    "listBox",
                                    GWEN_DialogProperty_AddValue,
                                    0,
                                    GWEN_Buffer_GetStart(tbuf),
                                    0);
        GWEN_Buffer_Reset(tbuf);
      }
      os=OH_InstituteSpec_List_Next(os);
    }

    GWEN_Buffer_free(tbuf);
  }

  if (GWEN_Dialog_GetIntProperty(dlg, "listBox", GWEN_DialogProperty_Value, 0, -1)>=0)
    GWEN_Dialog_SetIntProperty(dlg, "okButton", GWEN_DialogProperty_Enabled, 0, 1, 0);
  else
    GWEN_Dialog_SetIntProperty(dlg, "okButton", GWEN_DialogProperty_Enabled, 0, 0, 0);
}
int AB_SetupNewUserDialog_EnterPage(GWEN_DIALOG *dlg, int page, int forwards) {
  AB_SETUP_NEWUSER_DIALOG *xdlg;

  assert(dlg);
  xdlg=GWEN_INHERIT_GETDATA(GWEN_DIALOG, AB_SETUP_NEWUSER_DIALOG, dlg);
  assert(xdlg);

  switch(page) {
  case PAGE_BEGIN:
    GWEN_Dialog_SetIntProperty(dlg, "wiz_prev_button", GWEN_DialogProperty_Enabled, 0, 0, 0);
    GWEN_Dialog_SetIntProperty(dlg, "wiz_stack", GWEN_DialogProperty_Value, 0, page, 0);
    return GWEN_DialogEvent_ResultHandled;

  case PAGE_BACKEND:
    GWEN_Dialog_SetCharProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Title, 0, I18N("Next"), 0);
    GWEN_Dialog_SetIntProperty(dlg, "wiz_prev_button", GWEN_DialogProperty_Enabled, 0, 1, 0);
    GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 1, 0);
    GWEN_Dialog_SetIntProperty(dlg, "wiz_stack", GWEN_DialogProperty_Value, 0, page, 0);
    return GWEN_DialogEvent_ResultHandled;

  default:
    if (forwards){
      DBG_NOTICE(0, "About to enter page %d", page);
      GWEN_Dialog_SetCharProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Title, 0, I18N("Run"), 0);
      GWEN_Dialog_SetIntProperty(dlg, "wiz_stack", GWEN_DialogProperty_Value, 0, page, 0);
      return GWEN_DialogEvent_ResultHandled;
    }
    return GWEN_DialogEvent_ResultHandled;
  }

  return GWEN_DialogEvent_ResultHandled;
}
Example #9
0
int AH_NewKeyFileDialog_HandleValueChanged(GWEN_DIALOG *dlg, const char *sender) {
  if (strcasecmp(sender, "wiz_filename_edit")==0 ||
      strcasecmp(sender, "wiz_bankcode_edit")==0 ||
      strcasecmp(sender, "wiz_url_edit")==0 ||
      strcasecmp(sender, "wiz_username_edit")==0 ||
      strcasecmp(sender, "wiz_userid_edit")==0 ||
      strcasecmp(sender, "wiz_customerid_edit")==0) {
    int rv;

    if (GWEN_Dialog_GetIntProperty(dlg, "wiz_stack", GWEN_DialogProperty_Value, 0, -1)==PAGE_FILE) {
      rv=AH_NewKeyFileDialog_GetFilePageData(dlg);
      if (rv<0)
	GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 0, 0);
      else
	GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 1, 0);
    }
    else if (GWEN_Dialog_GetIntProperty(dlg, "wiz_stack", GWEN_DialogProperty_Value, 0, -1)==PAGE_BANK) {
      rv=AH_NewKeyFileDialog_GetBankPageData(dlg);
      if (rv<0)
	GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 0, 0);
      else
	GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 1, 0);
    }
    else if (GWEN_Dialog_GetIntProperty(dlg, "wiz_stack", GWEN_DialogProperty_Value, 0, -1)==PAGE_USER) {
      rv=AH_NewKeyFileDialog_GetUserPageData(dlg);
      if (rv<0)
	GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 0, 0);
      else
	GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 1, 0);
    }
    return GWEN_DialogEvent_ResultHandled;
  }
  return GWEN_DialogEvent_ResultNotHandled;
}
Example #10
0
int AH_NewKeyFileDialog_HandleActivatedFileButton(GWEN_DIALOG *dlg) {
  AH_NEWKEYFILE_DIALOG *xdlg;
  int rv;
  const char *s;
  GWEN_BUFFER *pathBuffer;

  assert(dlg);
  xdlg=GWEN_INHERIT_GETDATA(GWEN_DIALOG, AH_NEWKEYFILE_DIALOG, dlg);
  assert(xdlg);

  pathBuffer=GWEN_Buffer_new(0, 256, 0, 1);
  s=GWEN_Dialog_GetCharProperty(dlg, "wiz_filename_edit", GWEN_DialogProperty_Value, 0, NULL);
  if (s && *s)
    GWEN_Buffer_AppendString(pathBuffer, s);
  rv=GWEN_Gui_GetFileName(I18N("Create Keyfile"),
			  GWEN_Gui_FileNameType_SaveFileName,
			  0,
			  I18N("All Files (*)\tOHBCI Files (*ohbci;*.medium)"),
			  pathBuffer,
			  GWEN_Dialog_GetGuiId(dlg));
  if (rv==0) {
    GWEN_Dialog_SetCharProperty(dlg,
				"wiz_filename_edit",
				GWEN_DialogProperty_Value,
				0,
				GWEN_Buffer_GetStart(pathBuffer),
				0);
    rv=AH_NewKeyFileDialog_GetFilePageData(dlg);
    if (rv<0)
      GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 0, 0);
    else
      GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 1, 0);
  }
  else {
    DBG_NOTICE(AQHBCI_LOGDOMAIN, "here (%d)", rv);
  }
  GWEN_Buffer_free(pathBuffer);
  return GWEN_DialogEvent_ResultHandled;
}
Example #11
0
int OH_GetInstituteDialog_HandleActivated(GWEN_DIALOG *dlg, const char *sender)
{
  OH_GETINST_DIALOG *xdlg;

  assert(dlg);
  xdlg=GWEN_INHERIT_GETDATA(GWEN_DIALOG, OH_GETINST_DIALOG, dlg);
  assert(xdlg);

  DBG_ERROR(0, "Activated: %s", sender);
  if (strcasecmp(sender, "listBox")==0) {
    OH_INSTITUTE_SPEC *os;

    os=OH_GetInstituteDialog_DetermineSelectedBankInfo(dlg);
    GWEN_Dialog_SetIntProperty(dlg, "okButton", GWEN_DialogProperty_Enabled, 0, os?1:0, 0);

    return GWEN_DialogEvent_ResultHandled;
  }
  else if (strcasecmp(sender, "nameEdit")==0) {
    OH_GetInstituteDialog_UpdateList(dlg);
    return GWEN_DialogEvent_ResultHandled;
  }
  else if (strcasecmp(sender, "okButton")==0) {
    OH_INSTITUTE_SPEC *os;

    os=OH_GetInstituteDialog_DetermineSelectedBankInfo(dlg);
    if (os) {
      const OH_INSTITUTE_DATA *od;

      od=OfxHome_GetData(xdlg->ofxHome, OH_InstituteSpec_GetId(os));
      if (od) {
        OH_InstituteData_free(xdlg->selectedData);
        xdlg->selectedData=OH_InstituteData_dup(od);
        return GWEN_DialogEvent_ResultAccept;
      }
      else {
        DBG_ERROR(AQOFXCONNECT_LOGDOMAIN, "No institute data for id=%d",
                  OH_InstituteSpec_GetId(os));
      }
    }
    return GWEN_DialogEvent_ResultHandled;
  }
  else if (strcasecmp(sender, "abortButton")==0)
    return GWEN_DialogEvent_ResultReject;
  else if (strcasecmp(sender, "wiz_help_button")==0) {
    /* TODO: open a help dialog */
  }

  return GWEN_DialogEvent_ResultNotHandled;
}
Example #12
0
int AB_SelectBankInfoDialog_HandleActivated(GWEN_DIALOG *dlg, const char *sender)
{
  AB_SELECTBANKINFO_DIALOG *xdlg;

  assert(dlg);
  xdlg=GWEN_INHERIT_GETDATA(GWEN_DIALOG, AB_SELECTBANKINFO_DIALOG, dlg);
  assert(xdlg);

  DBG_NOTICE(0, "Activated: %s", sender);
  if (strcasecmp(sender, "blzEdit")==0 ||
      strcasecmp(sender, "bicEdit")==0 ||
      strcasecmp(sender, "nameEdit")==0 ||
      strcasecmp(sender, "locationEdit")==0) {
    AB_SelectBankInfoDialog_UpdateList(dlg);
    return GWEN_DialogEvent_ResultHandled;
  }
  else if (strcasecmp(sender, "listBox")==0) {
    AB_BANKINFO *bi;

    bi=AB_SelectBankInfoDialog_DetermineSelectedBankInfo(dlg);
    GWEN_Dialog_SetIntProperty(dlg, "okButton", GWEN_DialogProperty_Enabled, 0, bi?1:0, 0);
    return GWEN_DialogEvent_ResultHandled;
  }
  else if (strcasecmp(sender, "okButton")==0) {
    AB_BANKINFO *bi;

    bi=AB_SelectBankInfoDialog_DetermineSelectedBankInfo(dlg);
    if (bi)
      xdlg->selectedBankInfo=AB_BankInfo_dup(bi);
    return GWEN_DialogEvent_ResultAccept;
  }
  else if (strcasecmp(sender, "abortButton")==0)
    return GWEN_DialogEvent_ResultReject;
  else if (strcasecmp(sender, "wiz_help_button")==0) {
    /* TODO: open a help dialog */
  }

  return GWEN_DialogEvent_ResultNotHandled;
}
void AH_ChooseUserTypeDialog_Init(GWEN_DIALOG *dlg) {
  GWEN_Dialog_SetCharProperty(dlg, "hbciIntroLabel", GWEN_DialogProperty_Title, 0,
                              I18N("<html>"
                                   "<p>The HBCI module supports a broad range of security "
				   "media. Please choose the user setup mode from the following "
                                   "list.</p>"
                                   "<p>Click on the <i>run</i> button below to create the user.</p>"
                                   "</html>"
                                   "The HBCI module supports a broad range of security\n"
                                   "media. Please choose the user setup mode from the following\n"
                                   "list.\n"
                                   "Click on the RUN button below to create the user."
                                  ),
			      0);

  switch(AB_UserTypePageDialog_GetSelectedType(dlg)) {
  case AqHBCI_NewUserDialog_CodeGeneric:
  case AqHBCI_NewUserDialog_CodeExistingPinTan:
    GWEN_Dialog_SetIntProperty(dlg, "hbciPinTanRadio", GWEN_DialogProperty_Value, 0, 1, 0);
    break;

  case AqHBCI_NewUserDialog_CodeCreateKeyFile:
    GWEN_Dialog_SetIntProperty(dlg, "hbciCreateKeyFileRadio", GWEN_DialogProperty_Value, 0, 1, 0);
    break;
  case AqHBCI_NewUserDialog_CodeExistingKeyFile:
    GWEN_Dialog_SetIntProperty(dlg, "hbciImportKeyFileRadio", GWEN_DialogProperty_Value, 0, 1, 0);
    break;
  case AqHBCI_NewUserDialog_CodeCreateChipcard:
    GWEN_Dialog_SetIntProperty(dlg, "hbciInitChipcardRadio", GWEN_DialogProperty_Value, 0, 1, 0);
    break;
  case AqHBCI_NewUserDialog_CodeExistingChipcard:
    GWEN_Dialog_SetIntProperty(dlg, "hbciUseChipcardRadio", GWEN_DialogProperty_Value, 0, 1, 0);
    break;
  }

  /* temporarily disable not-implemented buttons */
  GWEN_Dialog_SetIntProperty(dlg, "hbciInitChipcardRadio", GWEN_DialogProperty_Enabled, 0, 0, 0);
}
Example #14
0
int AO_NewUserDialog_HandleValueChanged(GWEN_DIALOG *dlg, const char *sender)
{
  if (strcasecmp(sender, "wiz_username_edit")==0 ||
      strcasecmp(sender, "wiz_userid_edit")==0 ||
      strcasecmp(sender, "wiz_url_edit")==0 ||
      strcasecmp(sender, "wiz_brokerid_edit")==0 ||
      strcasecmp(sender, "wiz_fid_edit")==0 ||
      strcasecmp(sender, "wiz_org_edit")==0 ||
      strcasecmp(sender, "wiz_appid_edit")==0 ||
      strcasecmp(sender, "wiz_appver_edit")==0 ||
      strcasecmp(sender, "wiz_headerver_edit")==0) {
    int rv;

    if (GWEN_Dialog_GetIntProperty(dlg, "wiz_stack", GWEN_DialogProperty_Value, 0, -1)==PAGE_BANK) {
      rv=AO_NewUserDialog_GetBankPageData(dlg);
      if (rv<0)
        GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 0, 0);
      else
        GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 1, 0);
    }
    else if (GWEN_Dialog_GetIntProperty(dlg, "wiz_stack", GWEN_DialogProperty_Value, 0, -1)==PAGE_USER) {
      rv=AO_NewUserDialog_GetUserPageData(dlg);
      if (rv<0)
        GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 0, 0);
      else
        GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 1, 0);
    }
    else if (GWEN_Dialog_GetIntProperty(dlg, "wiz_stack", GWEN_DialogProperty_Value, 0, -1)==PAGE_APP) {
      rv=AO_NewUserDialog_GetAppPageData(dlg);
      if (rv<0)
        GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 0, 0);
      else
        GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 1, 0);
    }
    return GWEN_DialogEvent_ResultHandled;
  }
  return GWEN_DialogEvent_ResultNotHandled;
}
Example #15
0
int AH_NewKeyFileDialog_HandleActivatedBankCode(GWEN_DIALOG *dlg) {
  AH_NEWKEYFILE_DIALOG *xdlg;
  GWEN_DIALOG *dlg2;
  int rv;

  assert(dlg);
  xdlg=GWEN_INHERIT_GETDATA(GWEN_DIALOG, AH_NEWKEYFILE_DIALOG, dlg);
  assert(xdlg);

  dlg2=AB_SelectBankInfoDialog_new(xdlg->banking, "de", NULL);
  if (dlg2==NULL) {
    DBG_ERROR(AQHBCI_LOGDOMAIN, "Could not create dialog");
    GWEN_Gui_ShowError(I18N("Error"), "%s", I18N("Could not create dialog, maybe an installation error?"));
    return GWEN_DialogEvent_ResultHandled;
  }

  rv=GWEN_Gui_ExecDialog(dlg2, 0);
  if (rv==0) {
    /* rejected */
    GWEN_Dialog_free(dlg2);
    return GWEN_DialogEvent_ResultHandled;
  }
  else {
    const AB_BANKINFO *bi;

    bi=AB_SelectBankInfoDialog_GetSelectedBankInfo(dlg2);
    if (bi) {
      const char *s;
      AB_BANKINFO_SERVICE *sv;

      s=AB_BankInfo_GetBankId(bi);
      GWEN_Dialog_SetCharProperty(dlg,
				  "wiz_bankcode_edit",
				  GWEN_DialogProperty_Value,
				  0,
				  (s && *s)?s:"",
				  0);

      s=AB_BankInfo_GetBankName(bi);
      GWEN_Dialog_SetCharProperty(dlg,
				  "wiz_bankname_edit",
				  GWEN_DialogProperty_Value,
				  0,
				  (s && *s)?s:"",
				  0);
      sv=AB_BankInfoService_List_First(AB_BankInfo_GetServices(bi));
      while(sv) {
	const char *s;

	s=AB_BankInfoService_GetType(sv);
	if (s && *s && strcasecmp(s, "HBCI")==0) {
	  s=AB_BankInfoService_GetMode(sv);
	  if (s && *s && strncasecmp(s, "RDH", 3)==0)
	    break;
	}
	sv=AB_BankInfoService_List_Next(sv);
      }

      if (sv) {
	/* RDH service found */
	s=AB_BankInfoService_GetMode(sv);
	if (s && *s) {
	  if (strcasecmp(s, "RDH1")==0)
	    xdlg->rdhVersion=1;
	  else if (strcasecmp(s, "RDH2")==0)
	    xdlg->rdhVersion=2;
	  else if (strcasecmp(s, "RDH3")==0)
	    xdlg->rdhVersion=3;
	  else if (strcasecmp(s, "RDH4")==0)
	    xdlg->rdhVersion=4;
	  else if (strcasecmp(s, "RDH5")==0)
	    xdlg->rdhVersion=5;
	  else if (strcasecmp(s, "RDH6")==0)
	    xdlg->rdhVersion=6;
	  else if (strcasecmp(s, "RDH7")==0)
	    xdlg->rdhVersion=7;
	  else if (strcasecmp(s, "RDH8")==0)
	    xdlg->rdhVersion=8;
	  else if (strcasecmp(s, "RDH9")==0)
	    xdlg->rdhVersion=9;
	  else if (strcasecmp(s, "RDH10")==0)
	    xdlg->rdhVersion=10;
	  else if (strcasecmp(s, "RDH")==0)
	    xdlg->rdhVersion=1;
	}

	s=AB_BankInfoService_GetAddress(sv);
	GWEN_Dialog_SetCharProperty(dlg,
				    "wiz_url_edit",
				    GWEN_DialogProperty_Value,
				    0,
				    (s && *s)?s:"",
				    0);
	s=AB_BankInfoService_GetPversion(sv);
	if (s && *s) {
	  if (strcasecmp(s, "2.01")==0 ||
	      strcasecmp(s, "2")==0)
	    xdlg->hbciVersion=201;
	  else if (strcasecmp(s, "2.10")==0 ||
		   strcasecmp(s, "2.1")==0)
	    xdlg->hbciVersion=210;
	  else if (strcasecmp(s, "2.20")==0 ||
		   strcasecmp(s, "2.2")==0)
	    xdlg->hbciVersion=220;
	  else if (strcasecmp(s, "3.00")==0 ||
		   strcasecmp(s, "3.0")==0 ||
		   strcasecmp(s, "3")==0)
	    xdlg->hbciVersion=300;
	  else if (strcasecmp(s, "4.00")==0 ||
		   strcasecmp(s, "4.0")==0 ||
		   strcasecmp(s, "4")==0)
	    xdlg->hbciVersion=400;
	}
      }
    }
  }

  GWEN_Dialog_free(dlg2);

  if (AH_NewKeyFileDialog_GetBankPageData(dlg)<0)
    GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 0, 0);
  else
    GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 1, 0);

  return GWEN_DialogEvent_ResultHandled;
}
Example #16
0
static int GWENHYWFAR_CB _gwenGuiSignalHandler(GWEN_DIALOG *dlg,
        GWEN_DIALOG_EVENTTYPE t,
        const char *sender) {
    fprintf(stderr,
            "Received event %d from widget [%s]\n", t, sender);

    switch(t) {
    case GWEN_DialogEvent_TypeInit:
        fprintf(stderr, "Init\n");
        GWEN_Dialog_SetCharProperty(dlg, "combo1",
                                    GWEN_DialogProperty_AddValue,
                                    0,
                                    "Erster Text in Combo1",
                                    0);
        GWEN_Dialog_SetCharProperty(dlg, "combo1",
                                    GWEN_DialogProperty_AddValue,
                                    0,
                                    "Zweiter Text in Combo1",
                                    0);
        GWEN_Dialog_SetIntProperty(dlg, "combo1",
                                   GWEN_DialogProperty_Value,
                                   0,
                                   0,
                                   0);


        GWEN_Dialog_SetCharProperty(dlg, "combo2",
                                    GWEN_DialogProperty_AddValue,
                                    0,
                                    "Erster Text in Combo2",
                                    0);
        GWEN_Dialog_SetCharProperty(dlg, "combo2",
                                    GWEN_DialogProperty_AddValue,
                                    0,
                                    "Zweiter Text in Combo2",
                                    0);
        GWEN_Dialog_SetIntProperty(dlg, "combo2",
                                   GWEN_DialogProperty_Value,
                                   0,
                                   0,
                                   0);

        GWEN_Dialog_SetCharProperty(dlg, "listbox1",
                                    GWEN_DialogProperty_Title,
                                    0,
                                    "Column1\tColumn2\tColumn3",
                                    0);

        GWEN_Dialog_SetCharProperty(dlg, "listbox1",
                                    GWEN_DialogProperty_AddValue,
                                    0,
                                    "Zeile 1 Spalte 1\tZeile 1 Spalte 2\tZeile 1 Spalte 3",
                                    0);
        GWEN_Dialog_SetCharProperty(dlg, "listbox1",
                                    GWEN_DialogProperty_AddValue,
                                    0,
                                    "Zeile 2 Spalte 1\tZeile 2 Spalte 2\tZeile 2 Spalte 3",
                                    0);
        GWEN_Dialog_SetIntProperty(dlg, "listbox1",
                                   GWEN_DialogProperty_ColumnWidth,
                                   0,
                                   100,
                                   0);
        GWEN_Dialog_SetIntProperty(dlg, "listbox1",
                                   GWEN_DialogProperty_ColumnWidth,
                                   1,
                                   200,
                                   0);

        GWEN_Dialog_SetCharProperty(dlg, "labelWithHtmlImage",
                                    GWEN_DialogProperty_Title,
                                    0,
                                    "<html>This label contains text which should also contain an image:"
                                    "<img src=\"chipcard.png\">"
                                    "<p>And here the text should continue, followed by another image:"
                                    "<img src=\"disk.png\"></p>"
                                    "And again, this should be on the following line.</html>"
                                    "This label would contain an image if it were able to use "
                                    "HTML.",
                                    0);

        GWEN_Dialog_SetCharProperty(dlg, "textBrowser1",
                                    GWEN_DialogProperty_Value,
                                    0,
                                    "<html>"
                                    "<p>This is <b>bold</b> text, while this one is <i>italic</i>.</p>"
                                    "This is a list:"
                                    "<ul>"
                                    "<li>first item</li>"
                                    "<li>second item</li>"
                                    "<li>third item</li>"
                                    "<li>fourth item</li>"
                                    "</ul>"
                                    "<p>This paragraph should follow the list.</p>"
                                    "</html>"
                                    "This is BOLD text, while this one is would be i t a l i c.\n"
                                    "This is a list:\n"
                                    "- first item\n"
                                    "- second item\n"
                                    "- third item\n"
                                    "- fourth item\n"
                                    "This paragraph should follow the list.",
                                    0);

        GWEN_Dialog_SetIntProperty(dlg, "progressBar1",
                                   GWEN_DialogProperty_MinValue,
                                   0,
                                   0,
                                   0);
        GWEN_Dialog_SetIntProperty(dlg, "progressBar1",
                                   GWEN_DialogProperty_MaxValue,
                                   0,
                                   10,
                                   0);


        GWEN_Dialog_SetIntProperty(dlg, "",
                                   GWEN_DialogProperty_Width,
                                   0,
                                   640,
                                   0);
        GWEN_Dialog_SetIntProperty(dlg, "",
                                   GWEN_DialogProperty_Height,
                                   0,
                                   480,
                                   0);

        break;

    case GWEN_DialogEvent_TypeFini:
        fprintf(stderr, "Fini\n");
        break;
    case GWEN_DialogEvent_TypeValueChanged:
        fprintf(stderr, "ValueChanged\n");
        if (strcasecmp(sender, "listbox1")==0) {
            fprintf(stderr, "Selected list entry %d\n",
                    GWEN_Dialog_GetIntProperty(dlg, "listbox1", GWEN_DialogProperty_Value, 0, -1));
        }
        else if (strcasecmp(sender, "editPass1")==0) {
            const char *s;

            s=GWEN_Dialog_GetCharProperty(dlg, "editPass1", GWEN_DialogProperty_Value, 0, NULL);
            if (!(s && *s))
                s="<empty>";
            GWEN_Dialog_SetCharProperty(dlg, "editPass2", GWEN_DialogProperty_Value, 0, s, 0);
        }
        break;

    case GWEN_DialogEvent_TypeActivated:
        fprintf(stderr, "Activated\n");
        if (strcasecmp(sender, "listbox1")==0) {
            int idx;

            idx=GWEN_Dialog_GetIntProperty(dlg, "listbox1", GWEN_DialogProperty_Value, 0, -1);
            fprintf(stderr, "Selected list entry %d\n", idx);
            if (idx>=0) {
                const char *s;

                s=GWEN_Dialog_GetCharProperty(dlg, "listbox1", GWEN_DialogProperty_Value, idx, NULL);
                if (s && *s) {
                    fprintf(stderr, "Text of selected list entry %d: [%s]\n", idx, s);
                }
            }
        }
        else if (strcasecmp(sender, "combo1")==0) {
            int idx;

            idx=GWEN_Dialog_GetIntProperty(dlg, "combo1", GWEN_DialogProperty_Value, 0, -1);
            fprintf(stderr, "Selected list entry %d\n", idx);
            if (idx>=0) {
                const char *s;

                s=GWEN_Dialog_GetCharProperty(dlg, "combo1", GWEN_DialogProperty_Value, idx, NULL);
                if (s && *s) {
                    fprintf(stderr, "Text of selected list entry %d: [%s]\n", idx, s);
                }
            }

        }
        else if (strcasecmp(sender, "okButton")==0)
            return GWEN_DialogEvent_ResultAccept;
        else if (strcasecmp(sender, "abortButton")==0)
            return GWEN_DialogEvent_ResultReject;
        else if (strcasecmp(sender, "progressMinus")==0) {
            int v;

            v=GWEN_Dialog_GetIntProperty(dlg, "progressBar1", GWEN_DialogProperty_Value, 0, -1);
            if (v>0)
                GWEN_Dialog_SetIntProperty(dlg, "progressBar1", GWEN_DialogProperty_Value, 0, v-1, 0);
            return GWEN_DialogEvent_ResultHandled;
        }
        else if (strcasecmp(sender, "progressPlus")==0) {
            int v;

            v=GWEN_Dialog_GetIntProperty(dlg, "progressBar1", GWEN_DialogProperty_Value, 0, -1);
            if (v<10)
                GWEN_Dialog_SetIntProperty(dlg, "progressBar1", GWEN_DialogProperty_Value, 0, v+1, 0);
            return GWEN_DialogEvent_ResultHandled;
        }
        else if (strcasecmp(sender, "prevPageButton")==0) {
            int v;

            v=GWEN_Dialog_GetIntProperty(dlg, "stack1", GWEN_DialogProperty_Value, 0, -1);
            if (v>0)
                GWEN_Dialog_SetIntProperty(dlg, "stack1", GWEN_DialogProperty_Value, 0, v-1, 0);
            return GWEN_DialogEvent_ResultHandled;
        }
        else if (strcasecmp(sender, "nextPageButton")==0) {
            int v;

            v=GWEN_Dialog_GetIntProperty(dlg, "stack1", GWEN_DialogProperty_Value, 0, -1);
            if (v<3)
                GWEN_Dialog_SetIntProperty(dlg, "stack1", GWEN_DialogProperty_Value, 0, v+1, 0);
            return GWEN_DialogEvent_ResultHandled;
        }
        break;

    case GWEN_DialogEvent_TypeEnabled:
        fprintf(stderr, "Enabled\n");
        break;
    case GWEN_DialogEvent_TypeDisabled:
        fprintf(stderr, "Disabled\n");
        break;
    case GWEN_DialogEvent_TypeClose:
        fprintf(stderr, "Close\n");
        return GWEN_DialogEvent_ResultNotHandled;
    case GWEN_DialogEvent_TypeLast:
        fprintf(stderr, "Last, ignored\n");
        return GWEN_DialogEvent_ResultNotHandled;
    }
    return GWEN_DialogEvent_ResultHandled;
}
Example #17
0
void APY_NewUserDialog_Init(GWEN_DIALOG *dlg) {
  APY_NEWUSER_DIALOG *xdlg;
  GWEN_DB_NODE *dbPrefs;
  int i;

  assert(dlg);
  xdlg=GWEN_INHERIT_GETDATA(GWEN_DIALOG, APY_NEWUSER_DIALOG, dlg);
  assert(xdlg);

  dbPrefs=GWEN_Dialog_GetPreferences(dlg);

  GWEN_Dialog_SetCharProperty(dlg,
			      "",
			      GWEN_DialogProperty_Title,
			      0,
			      I18N("Paypal Setup Wizard"),
			      0);

  /* select first page */
  GWEN_Dialog_SetIntProperty(dlg, "wiz_stack", GWEN_DialogProperty_Value, 0, 0, 0);

  /* setup intro page */
  GWEN_Dialog_SetCharProperty(dlg,
			      "wiz_begin_label",
			      GWEN_DialogProperty_Title,
			      0,
			      I18N("<html>"
                                   "<p>This dialog assists you in setting up a Paypal User.</p>"
				   "<p>Please note that you have to apply for API access with Paypal. "
				   "The following procedure helps you getting there:</p>"
				   "<p>Login into your Paypal account via web browser, enter the <i>My Profile</i> "
				   "page, click  <i>API access</i> under <i>Account information</i>.</p>"
                                   "<p>Choose <b>Option 2</b>.</p>"
                                   "</html>"
                                   "This dialog assists you in setting up a Paypal User.\n"
				   "Please note that you have to apply for API access with Paypal.\n"
				   "The following procedure helps you getting there:\n"
				   "Login into your Paypal account via web browser, enter the \"My Profile\"\n"
				   "page, click  \"API access\" under \"Account information\".\n"
                                   "Choose OPTION 2."
                                  ),
			      0);

  /* setup user page */
  GWEN_Dialog_SetCharProperty(dlg,
			      "wiz_user_label",
			      GWEN_DialogProperty_Title,
			      0,
                              I18N("<html>"
                                   "<p>You can find the information needed here after logging into your "
				   "Paypal account via web browser. The information can then be found "
                                   "under <i>My Profile</i>, <i>Account Information</i>, <i>API Access</i>.</p>"
                                   "</html>"
                                   "You can find the information needed here after logging into your\n"
				   "Paypal account via web browser. The information can then be found\n"
                                   "under <\"My Profile\", \"Account Information\", \"API Access\"."
                                  ),
                              0);

  GWEN_Dialog_SetCharProperty(dlg,
			      "wiz_url_edit",
			      GWEN_DialogProperty_Value,
			      0,
			      "https://api-3t.paypal.com/nvp",
			      0);


  /* setup secret page */
  GWEN_Dialog_SetCharProperty(dlg,
			      "wiz_secret_label",
			      GWEN_DialogProperty_Title,
			      0,
                              I18N("<html>"
                                   "<p>Enter the API password and signature as it is found on the "
                                   "Paypal page described in the previous steps.</p>"
				   "<p><font color=\"red\"><b>"
				   "The API password and API signature are extremely sensitive "
				   "information which you must under no circumstances reveal to "
				   "anybody!</b></font></p>"
				   "<p>That being said, these credentials are also quite hard to "
				   "remember, so AqBanking stores them in a file which is very well "
				   "encrypted.</p>"
				   "<p>When the user is created in the next step you will be asked for "
                                   "the password to be set for that credential file.</p>"
                                   "</html>"
                                   "Enter the API password and signature as it is found on the\n"
                                   "Paypal page described in the previous steps.\n"
                                   "The API password and API signature are extremely sensitive\n"
                                   "information which you must under no circumstances reveal to\n"
                                   "anybody!\n"
                                   "That being said, these credentials are also quite hard to\n"
				   "remember, so AqBanking stores them in a file which is very well\n"
                                   "encrypted.\n"
				   "When the user is created in the next step you will be asked for\n"
                                   "the password to be set for that credential file."
                                  ),
			      0);

  /* setup creation page */
  GWEN_Dialog_SetCharProperty(dlg,
			      "wiz_create_label",
			      GWEN_DialogProperty_Title,
			      0,
                              I18N("<html>"
                                   "<p>We are now ready to create the user.</p>"
				   "<p>Click the <i>next</i> button to proceed or <i>abort</i> to abort.</p>"
				   "<p>If you proceed you will be asked to enter a new password. This is the password "
				   "for the credentials file described in previous steps.</p>"
                                   "<p>Please be carefull to enter a sufficiently secure password</p>"
                                   "</html>"
                                   "We are now ready to create the user.\n"
                                   "Click the \"next\" button to proceed or \"abort\" to abort.\n"
				   "If you proceed you will be asked to enter a new password. This is the password\n"
                                   "for the credentials file described in previous steps.\n"
                                   "Please be carefull to enter a sufficiently secure password."
                                  ),
			      0);

  /* setup extro page */
  GWEN_Dialog_SetCharProperty(dlg,
			      "wiz_end_label",
			      GWEN_DialogProperty_Title,
			      0,
			      I18N("The user has been successfully setup."),
			      0);

  /* read width */
  i=GWEN_DB_GetIntValue(dbPrefs, "dialog_width", 0, -1);
  if (i>=DIALOG_MINWIDTH)
    GWEN_Dialog_SetIntProperty(dlg, "", GWEN_DialogProperty_Width, 0, i, 0);

  /* read height */
  i=GWEN_DB_GetIntValue(dbPrefs, "dialog_height", 0, -1);
  if (i>=DIALOG_MINHEIGHT)
    GWEN_Dialog_SetIntProperty(dlg, "", GWEN_DialogProperty_Height, 0, i, 0);

  /* disable next and previous buttons */
  GWEN_Dialog_SetIntProperty(dlg, "wiz_prev_button", GWEN_DialogProperty_Enabled, 0, 0, 0);
  GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 1, 0);
}
Example #18
0
static int GWENHYWFAR_CB TestDialog_SignalHandler(GWEN_DIALOG *dlg,
						  GWEN_DIALOG_EVENTTYPE t,
						  const char *sender) {
  fprintf(stderr,
	  "Received event %d from widget [%s]\n", t, sender);

  switch(t) {
  case GWEN_DialogEvent_TypeInit:
    /* This is the init event. It is issued immediately before showing the
     * dialog on screen. Only after this signal has been received the properties
     * of a dialog are accessible.
     */
    fprintf(stderr, "Init\n");
    /* add some entries to the ComboBox "combo1" */
    GWEN_Dialog_SetCharProperty(dlg, "combo1",
				GWEN_DialogProperty_AddValue,
				0,
				"Erster Text in Combo1",
				0);
    GWEN_Dialog_SetCharProperty(dlg, "combo1",
				GWEN_DialogProperty_AddValue,
				0,
				"Zweiter Text in Combo1",
				0);
    /* select first entry (entry 0) of the ComboBo "combo1" */
    GWEN_Dialog_SetIntProperty(dlg, "combo1",
			       GWEN_DialogProperty_Value,
			       0,
			       0,
			       0);

    /* same for ComboBox "combo2" */
    GWEN_Dialog_SetCharProperty(dlg, "combo2",
				GWEN_DialogProperty_AddValue,
				0,
				"Erster Text in Combo2",
				0);
    GWEN_Dialog_SetCharProperty(dlg, "combo2",
				GWEN_DialogProperty_AddValue,
				0,
				"Zweiter Text in Combo2",
				0);
    GWEN_Dialog_SetIntProperty(dlg, "combo2",
			       GWEN_DialogProperty_Value,
			       0,
			       0,
			       0);

    /* set the title of the ListBox "listbox1". Please note that multiple
     * columns can be specified here (separated by TAB, i.e. '\t')
     */
    GWEN_Dialog_SetCharProperty(dlg, "listbox1",
				GWEN_DialogProperty_Title,
				0,
				"Column1\tColumn2",
				0);
    /* add some entries to the ListBox "listbox1". As with the title
     * multiple columns can be specified (separated by TAB).
     */
    GWEN_Dialog_SetCharProperty(dlg, "listbox1",
				GWEN_DialogProperty_AddValue,
				0,
				"Zeile 1 Spalte 1\tZeile 1 Spalte 2",
				0);

    GWEN_Dialog_SetCharProperty(dlg, "listbox1",
				GWEN_DialogProperty_AddValue,
				0,
				"Zeile 2 Spalte 1\tZeile 2 Spalte 2",
				0);

    /* for every column of a ListBox the width can be specified. This is done
     * by modification of the property "ColumnWidth". In this example we set
     * the width of column 0 to 100 pixel and that of column 1 to 200 pixel.
     */
    GWEN_Dialog_SetIntProperty(dlg, "listbox1",
			       GWEN_DialogProperty_ColumnWidth,
			       0,
                               100,
			       0);
    GWEN_Dialog_SetIntProperty(dlg, "listbox1",
			       GWEN_DialogProperty_ColumnWidth,
			       1,
			       200,
			       0);

    /* Set the width and height of the dialog itself to 640x480 pixel.
     * As you can see specifying the dialog itself is done by providing
     * an empty widget name.
     */
    GWEN_Dialog_SetIntProperty(dlg, "",
			       GWEN_DialogProperty_Width,
			       0,
			       640,
			       0);
   GWEN_Dialog_SetIntProperty(dlg, "",
			       GWEN_DialogProperty_Height,
			       0,
			       480,
			       0);

    break;

  case GWEN_DialogEvent_TypeFini:
    /* this is the fini signal. It is emitted immediately after hiding
     * the dialog from screen. After this signal handler returns the
     * properties of this dialog are no longer accessible.
     */
    fprintf(stderr, "Fini\n");
    break;

  case GWEN_DialogEvent_TypeValueChanged:
    /* this signal is emitted by some of the widgets when its value
     * has changed. For LineEdit widgets this event occurrs when something
     * is entered into the text field, for a ListBox this is emitted when
     * another entry from the ListBox is selected.
     */
    fprintf(stderr, "ValueChanged\n");
    if (strcasecmp(sender, "listbox1")==0) {
      fprintf(stderr, "Selected list entry %d\n",
	      GWEN_Dialog_GetIntProperty(dlg, "listbox1", GWEN_DialogProperty_Value, 0, -1));
    }
    break;

    /* this signal is emitted by some widgets upon activation, e.g. a Button
     * widget sends this signal when it is clicked.
     */
  case GWEN_DialogEvent_TypeActivated:
    fprintf(stderr, "Activated\n");
    if (strcasecmp(sender, "okButton")==0)
      return GWEN_DialogEvent_ResultAccept;
    else if (strcasecmp(sender, "abortButton")==0)
      return GWEN_DialogEvent_ResultReject;
    break;

  case GWEN_DialogEvent_TypeClose:
    /* this signal is emitted by the dialog when closing of the dialog is
     * requested (e.g. by clicking the little X in the title bar).
     * If the dialog doesn't want to be closed you can return
     * GWEN_DialogEvent_ResultReject here.
     */
    fprintf(stderr, "Close\n");
    return GWEN_DialogEvent_ResultNotHandled;

  default:
    fprintf(stderr, "Unhandled signal, ignored\n");
    return GWEN_DialogEvent_ResultNotHandled;
  }
  return GWEN_DialogEvent_ResultHandled;
}
Example #19
0
void AO_NewUserDialog_Init(GWEN_DIALOG *dlg)
{
  AO_NEWUSER_DIALOG *xdlg;
  GWEN_DB_NODE *dbPrefs;
  int i;
  const AO_APPINFO *ai;

  assert(dlg);
  xdlg=GWEN_INHERIT_GETDATA(GWEN_DIALOG, AO_NEWUSER_DIALOG, dlg);
  assert(xdlg);

  dbPrefs=GWEN_Dialog_GetPreferences(dlg);

  GWEN_Dialog_SetCharProperty(dlg,
                              "",
                              GWEN_DialogProperty_Title,
                              0,
                              I18N("OFX DirectConnect Setup Wizard"),
                              0);

  /* select first page */
  GWEN_Dialog_SetIntProperty(dlg, "wiz_stack", GWEN_DialogProperty_Value, 0, 0, 0);

  /* setup intro page */
  GWEN_Dialog_SetCharProperty(dlg,
                              "wiz_begin_label",
                              GWEN_DialogProperty_Title,
                              0,
                              I18N("<html>"
                                   "<p>This dialog assists you in setting up an OFX DirectConnect User.</p>"
                                   "</html>"
                                   "This dialog assists you in setting up an OFX DirectConnect User."),
                              0);

  /* setup bank page */
  GWEN_Dialog_SetCharProperty(dlg,
                              "wiz_bank_label",
                              GWEN_DialogProperty_Title,
                              0,
                              I18N("<html>"
                                   "<p>Please enter your bank settings below.</p>"
                                   "<p>Click the <b>Select</b> button to choose from a list of "
                                   "known banks. That will connect to <i>www.ofxhome.com</i> and "
                                   "try to retrieve information about your bank.</p>"
                                   "<p>If you had to manually enter this information because your "
                                   "bank was unknown to <i>www.ofxhome.com</i> you are kindly "
                                   "asked to submit your bank server information there to help "
                                   "the next user.</p>"
                                   "</html>"
                                   "Click the SELECT button to choose from a list of\n"
                                   "known banks. That will connect to \"www.ofxhome.com\" and\n"
                                   "try to retrieve information about your bank.\n"
                                   "If you had to manually enter this information because your\n"
                                   "bank was unknown to \"www.ofxhome.com\" you are kindly\n"
                                   "asked to submit your bank server information there to help\n"
                                   "the next user."),
                              0);

  /* setup user page */
  GWEN_Dialog_SetCharProperty(dlg,
                              "wiz_user_label",
                              GWEN_DialogProperty_Title,
                              0,
                              I18N("<html>"
                                   "<p>Please enter your user settings below.</p>"
                                   "<p><i>User Name</i> is your real name, <i>User Id</i> is "
                                   "assigned to you by the bank after applying for OFX DirectConnect "
                                   "and <i>Client UID</i> is used by some banks only. If you do not have such "
                                   "a value in your documents from the bank just leave it blank.</p>"
                                   "</html>"
                                   "Please enter your user settings below.\n"
                                   "\"User Name\" is your real name, \"User Id\" is\n"
                                   "assigned to you by the bank after applying for OFX DirectConnect\n"
                                   "and \"Client UID\" is used by some banks. If you do not have such\n"
                                   "a value in your documents from the bank just leave it blank."),
                              0);


  /* setup application page */
  GWEN_Dialog_SetCharProperty(dlg,
                              "wiz_app_label",
                              GWEN_DialogProperty_Title,
                              0,
                              I18N("<html>"
                                   "<p>Please choose the application you want AqBanking to emulate. "
                                   "Not all banks support all applications and versions, you might have "
                                   "to try multiple settings.</p>"
                                   "</html>"
                                   "Please choose the application you want AqBanking to emulate.\n"
                                   "Not all banks support all applications and versions, you might have\n"
                                   "to try multiple settings."),
                              0);

  GWEN_Dialog_SetIntProperty(dlg, "wiz_app_combo", GWEN_DialogProperty_ClearValues, 0, 0, 0);
  GWEN_Dialog_SetCharProperty(dlg, "wiz_app_combo", GWEN_DialogProperty_AddValue, 0, I18N("-- select --"), 0);

  ai=AO_Provider_GetAppInfos(xdlg->provider);
  if (ai) {
    const AO_APPINFO *first;

    first=ai;
    while (ai->appName) {
      GWEN_Dialog_SetCharProperty(dlg, "wiz_app_combo", GWEN_DialogProperty_AddValue, 0, I18N(ai->appName), 0);
      ai++;
    }

    if (first->appName) {
      GWEN_Dialog_SetIntProperty(dlg, "wiz_app_combo", GWEN_DialogProperty_Value, 0, 1, 0);
      if (first->appId)
        GWEN_Dialog_SetCharProperty(dlg, "wiz_appid_edit", GWEN_DialogProperty_Value, 0, first->appId, 0);
      if (first->appVer)
        GWEN_Dialog_SetCharProperty(dlg, "wiz_appver_edit", GWEN_DialogProperty_Value, 0, first->appVer, 0);
    }
  }

  GWEN_Dialog_SetCharProperty(dlg, "wiz_headerver_edit", GWEN_DialogProperty_Value, 0, "102", 0);

  /* setup creation page */
  GWEN_Dialog_SetCharProperty(dlg,
                              "wiz_create_label",
                              GWEN_DialogProperty_Title,
                              0,
                              I18N("<html>"
                                   "<p>We are now ready to create the user.</p>"
                                   "<p>Click the <i>next</i> button to proceed or <i>abort</i> to abort.</p>"
                                   "</html>"
                                   "We are now ready to create the user.\n"
                                   "Click the NEXT button to proceed or ABORT to abort."),
                              0);

  /* setup extro page */
  GWEN_Dialog_SetCharProperty(dlg,
                              "wiz_end_label",
                              GWEN_DialogProperty_Title,
                              0,
                              I18N("<html>"
                                   "<p>The user has been successfully setup.</p>"
                                   "<p>You can now try to retrieve the list of accounts the "
                                   "bank allows you to manage via OFX DirectConnect.</p>"
                                   "<p>Please note that not every banks supports this. If your "
                                   "bank does not support account list download you will have to "
                                   "add the account manually.</p>"
                                   "</html>"
                                   "The user has been successfully setup.\n"
                                   "You can now try to retrieve the list of accounts the\n"
                                   "bank allows you to manage via OFX DirectConnect.\n"
                                   "Please note that not every banks supports this. If your\n"
                                   "bank does not support account list download you will have to\n"
                                   "add the account manually."
                                  ),
                              0);

  /* read width */
  i=GWEN_DB_GetIntValue(dbPrefs, "dialog_width", 0, -1);
  if (i>=DIALOG_MINWIDTH)
    GWEN_Dialog_SetIntProperty(dlg, "", GWEN_DialogProperty_Width, 0, i, 0);

  /* read height */
  i=GWEN_DB_GetIntValue(dbPrefs, "dialog_height", 0, -1);
  if (i>=DIALOG_MINHEIGHT)
    GWEN_Dialog_SetIntProperty(dlg, "", GWEN_DialogProperty_Height, 0, i, 0);

  /* disable next and previous buttons */
  GWEN_Dialog_SetIntProperty(dlg, "wiz_prev_button", GWEN_DialogProperty_Enabled, 0, 0, 0);
  GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 1, 0);
}
Example #20
0
void AB_SelectBankInfoDialog_UpdateList(GWEN_DIALOG *dlg)
{
  AB_SELECTBANKINFO_DIALOG *xdlg;
  AB_BANKINFO *tbi;
  const char *s;
  AB_BANKINFO_LIST2 *bl;
  int rv;

  assert(dlg);
  xdlg=GWEN_INHERIT_GETDATA(GWEN_DIALOG, AB_SELECTBANKINFO_DIALOG, dlg);
  assert(xdlg);

  /* clear bank info list */
  GWEN_Dialog_SetIntProperty(dlg, "listBox", GWEN_DialogProperty_ClearValues, 0, 0, 0);
  if (xdlg->matchingBankInfos)
    AB_BankInfo_List2_freeAll(xdlg->matchingBankInfos);
  xdlg->matchingBankInfos=NULL;

  /* setup template */
  tbi=AB_BankInfo_new();

  /* set country */
  AB_BankInfo_SetCountry(tbi, xdlg->country);

  /* set bank code */
  s=GWEN_Dialog_GetCharProperty(dlg, "blzEdit", GWEN_DialogProperty_Value, 0, NULL);
  if (s && *s) {
    int len;
    char *cpy;

    len=strlen(s);
    cpy=(char *) malloc(len+2);
    assert(cpy);
    memmove(cpy, s, len+1); /* copy including terminating zero char */
    removeAllSpaces((uint8_t *)cpy);
    len=strlen(cpy);
    if (len) {
      /* append joker */
      cpy[len]='*';
      cpy[len+1]=0;
    }
    AB_BankInfo_SetBankId(tbi, cpy);
    free(cpy);
  }

  /* set bank code */
  s=GWEN_Dialog_GetCharProperty(dlg, "bicEdit", GWEN_DialogProperty_Value, 0, NULL);
  if (s && *s) {
    int len;
    char *cpy;

    len=strlen(s);
    cpy=(char *) malloc(len+2);
    assert(cpy);
    memmove(cpy, s, len+1); /* copy including terminating zero char */
    removeAllSpaces((uint8_t *)cpy);
    len=strlen(cpy);
    if (len) {
      /* append joker */
      cpy[len]='*';
      cpy[len+1]=0;
    }
    AB_BankInfo_SetBic(tbi, cpy);
    free(cpy);
  }

  /* set bank name */
  s=GWEN_Dialog_GetCharProperty(dlg, "nameEdit", GWEN_DialogProperty_Value, 0, NULL);
  if (s && *s) {
    GWEN_BUFFER *tbuf;

    tbuf=GWEN_Buffer_new(0, 256, 0, 1);
    GWEN_Buffer_AppendString(tbuf, s);
    GWEN_Text_CondenseBuffer(tbuf);
    GWEN_Buffer_AppendString(tbuf, "*");
    AB_BankInfo_SetBankName(tbi, GWEN_Buffer_GetStart(tbuf));
    GWEN_Buffer_free(tbuf);
  }

  /* set bank name */
  s=GWEN_Dialog_GetCharProperty(dlg, "locationEdit", GWEN_DialogProperty_Value, 0, NULL);
  if (s && *s) {
    GWEN_BUFFER *tbuf;

    tbuf=GWEN_Buffer_new(0, 256, 0, 1);
    GWEN_Buffer_AppendString(tbuf, s);
    GWEN_Text_CondenseBuffer(tbuf);
    GWEN_Buffer_AppendString(tbuf, "*");
    AB_BankInfo_SetLocation(tbi, GWEN_Buffer_GetStart(tbuf));
    GWEN_Buffer_free(tbuf);
  }

  bl=AB_BankInfo_List2_new();
  rv=AB_Banking_GetBankInfoByTemplate(xdlg->banking, xdlg->country, tbi, bl);
  if (rv<0) {
    DBG_INFO(AQBANKING_LOGDOMAIN, "here (%d)", rv);
    AB_BankInfo_List2_freeAll(bl);
  }
  else {
    AB_BANKINFO_LIST2_ITERATOR *it;

    it=AB_BankInfo_List2_First(bl);
    if (it) {
      AB_BANKINFO *bi;
      GWEN_BUFFER *tbuf;

      tbuf=GWEN_Buffer_new(0, 256, 0, 1);
      bi=AB_BankInfo_List2Iterator_Data(it);
      while (bi) {
        createListBoxString(bi, tbuf);

        GWEN_Dialog_SetCharProperty(dlg,
                                    "listBox",
                                    GWEN_DialogProperty_AddValue,
                                    0,
                                    GWEN_Buffer_GetStart(tbuf),
                                    0);
        GWEN_Buffer_Reset(tbuf);
        bi=AB_BankInfo_List2Iterator_Next(it);
      }

      GWEN_Buffer_free(tbuf);
      AB_BankInfo_List2Iterator_free(it);
    }
    xdlg->matchingBankInfos=bl;
  }

  AB_BankInfo_free(tbi);

  if (GWEN_Dialog_GetIntProperty(dlg, "listBox", GWEN_DialogProperty_Value, 0, -1)>=0)
    GWEN_Dialog_SetIntProperty(dlg, "okButton", GWEN_DialogProperty_Enabled, 0, 1, 0);
  else
    GWEN_Dialog_SetIntProperty(dlg, "okButton", GWEN_DialogProperty_Enabled, 0, 0, 0);
}
Example #21
0
void AH_NewKeyFileDialog_Init(GWEN_DIALOG *dlg) {
  AH_NEWKEYFILE_DIALOG *xdlg;
  GWEN_DB_NODE *dbPrefs;
  int i;

  assert(dlg);
  xdlg=GWEN_INHERIT_GETDATA(GWEN_DIALOG, AH_NEWKEYFILE_DIALOG, dlg);
  assert(xdlg);

  dbPrefs=GWEN_Dialog_GetPreferences(dlg);

  GWEN_Dialog_SetCharProperty(dlg,
			      "",
			      GWEN_DialogProperty_Title,
			      0,
			      I18N("HBCI Keyfile Setup Wizard"),
			      0);

  /* select first page */
  GWEN_Dialog_SetIntProperty(dlg, "wiz_stack", GWEN_DialogProperty_Value, 0, 0, 0);

  /* setup intro page */
  GWEN_Dialog_SetCharProperty(dlg,
			      "wiz_begin_label",
			      GWEN_DialogProperty_Title,
			      0,
			      I18N("This dialog assists you in setting up a Keyfile User.\n"),
			      0);

  /* setup bank page */
  GWEN_Dialog_SetCharProperty(dlg,
			      "wiz_bank_label",
			      GWEN_DialogProperty_Title,
			      0,
			      I18N("<html>"
                                   "<p>Please select the bank.</p>"
				   "<p>AqBanking has an internal database which "
				   "contains HBCI/FinTS information about many banks.<p>"
				   "<p>If there is an entry for your bank this dialog will use the "
                                   "information from the database.</p>"
                                   "</html>"
                                   "Please select the bank.\n"
                                   "AqBanking has an internal database which contains\n"
                                   "HBCI/FinTS information about many banks.\n"
                                   "If there is an entry for your bank this dialog will use the\n"
                                   "information from the database."),
			      0);

  /* setup user page */
  GWEN_Dialog_SetCharProperty(dlg,
			      "wiz_user_label",
			      GWEN_DialogProperty_Title,
			      0,
                              I18N("<html>"
                                   "<p>For most banks the customer id must be the same as the user id.</p>"
				   "<p>However, some banks actually use the customer id, so please look into "
				   "the documentation provided by your bank to discover whether this is the "
                                   "case with your bank.</p>"
                                   "</html>"
                                   "For most banks the customer id must be the same as the user id.\n"
                                   "However, some banks actually use the customer id, so please look into\n"
				   "the documentation provided by your bank to discover whether this is the\n"
                                   "case with your bank."),
			      0);

  /* setup creation page */
  GWEN_Dialog_SetCharProperty(dlg,
			      "wiz_create_label",
			      GWEN_DialogProperty_Title,
			      0,
                              I18N("<html>"
                                   "<p>We are now ready to create the user and exchange keys with the server.</p>"
                                   "<p>Click the <i>next</i> button to proceed or <i>abort</i> to abort.</p>"
                                   "</html>"
                                   "We are now ready to create the user and exchange keys with the server.\n"
                                   "Click the NEXT button to proceed or ABORT to abort."),
			      0);

  /* setup extro page */
  GWEN_Dialog_SetCharProperty(dlg,
			      "wiz_end_label",
			      GWEN_DialogProperty_Title,
			      0,
                              I18N("<html>"
                                   "<p>The user has been successfully created.</p>"
                                   "<p>You must now <b>print</b> the INI letter (click the button below) "
                                   "and <b>send</b> it to the bank.</p> "
                                   "<p>The activation of your account by the bank can take a few days.</p>"
                                   "</html>"
                                   "The user has been successfully created.\n"
                                   "You must now PRINT the INI letter (click the button below)\n"
                                   "and SEND it to the bank.\n"
                                   "The activation of your account by the bank can take a few days."),
				   0);

  /* read width */
  i=GWEN_DB_GetIntValue(dbPrefs, "dialog_width", 0, -1);
  if (i>=DIALOG_MINWIDTH)
    GWEN_Dialog_SetIntProperty(dlg, "", GWEN_DialogProperty_Width, 0, i, 0);

  /* read height */
  i=GWEN_DB_GetIntValue(dbPrefs, "dialog_height", 0, -1);
  if (i>=DIALOG_MINHEIGHT)
    GWEN_Dialog_SetIntProperty(dlg, "", GWEN_DialogProperty_Height, 0, i, 0);

  /* disable next and previous buttons */
  GWEN_Dialog_SetIntProperty(dlg, "wiz_prev_button", GWEN_DialogProperty_Enabled, 0, 0, 0);
  GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 1, 0);
}
Example #22
0
int AB_CSV_EditProfileDialog_fromGui(GWEN_DIALOG *dlg, GWEN_DB_NODE *db)
{
  const char *s;
  int i;

  s=GWEN_Dialog_GetCharProperty(dlg, "nameEdit", GWEN_DialogProperty_Value, 0, NULL);
  if (s && *s)
    GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "name", s);
  else {
    GWEN_Gui_MessageBox(GWEN_GUI_MSG_FLAGS_TYPE_ERROR |
                        GWEN_GUI_MSG_FLAGS_CONFIRM_B1 |
                        GWEN_GUI_MSG_FLAGS_SEVERITY_NORMAL,
                        I18N("Input Error"),
                        I18N("Please enter a name for the profile."),
                        I18N("Continue"), 0, 0, 0);
    /* change focus */
    GWEN_Dialog_SetIntProperty(dlg, "nameEdit", GWEN_DialogProperty_Focus, 0, 1, 0);
    return GWEN_ERROR_BAD_DATA;
  }

  s=GWEN_Dialog_GetCharProperty(dlg, "versionEdit", GWEN_DialogProperty_Value, 0, "");
  if (s && *s)
    GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "version", s);

  s=GWEN_Dialog_GetCharProperty(dlg, "shortDescrEdit", GWEN_DialogProperty_Value, 0, "");
  if (s && *s)
    GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "shortDescr", s);

  s=GWEN_Dialog_GetCharProperty(dlg, "longDescrEdit", GWEN_DialogProperty_Value, 0, "");
  if (s && *s)
    GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "longDescr", s);

  i=GWEN_Dialog_GetIntProperty(dlg, "importCheck", GWEN_DialogProperty_Value, 0, 1);
  GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "import", i);

  i=GWEN_Dialog_GetIntProperty(dlg, "exportCheck", GWEN_DialogProperty_Value, 0, 1);
  GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "export", i);

  i=GWEN_Dialog_GetIntProperty(dlg, "ignoreLinesSpin", GWEN_DialogProperty_Value, 0, 0);
  GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "params/ignoreLines", i);

  i=setDbValueFromDoubleStringsCombo(dlg, db, "params/delimiter", "delimiterCombo", csv_delimiters);
  if (i<0) {
    GWEN_Gui_MessageBox(GWEN_GUI_MSG_FLAGS_TYPE_ERROR |
                        GWEN_GUI_MSG_FLAGS_CONFIRM_B1 |
                        GWEN_GUI_MSG_FLAGS_SEVERITY_NORMAL,
                        I18N("Input Error"),
                        I18N("Please select a field delimiter."),
                        I18N("Continue"), 0, 0, 0);
    GWEN_Dialog_SetIntProperty(dlg, "tabBook", GWEN_DialogProperty_Value, 0, 0, 0);
    GWEN_Dialog_SetIntProperty(dlg, "delimiterCombo", GWEN_DialogProperty_Focus, 0, 1, 0);
    return GWEN_ERROR_BAD_DATA;
  }

  i=setDbValueFromDoubleStringsCombo(dlg, db, "subject", "subjectCombo", csv_subjects);
  if (i<0) {
    GWEN_Dialog_SetIntProperty(dlg, "tabBook", GWEN_DialogProperty_Value, 0, 0, 0);
    GWEN_Dialog_SetIntProperty(dlg, "subjectCombo", GWEN_DialogProperty_Focus, 0, 1, 0);
    return GWEN_ERROR_BAD_DATA;
  }

  s=GWEN_Dialog_GetCharProperty(dlg, "dateFormatCombo", GWEN_DialogProperty_Value, 0, "");
  if (!(s && *s)) {
    GWEN_Gui_MessageBox(GWEN_GUI_MSG_FLAGS_TYPE_ERROR |
                        GWEN_GUI_MSG_FLAGS_CONFIRM_B1 |
                        GWEN_GUI_MSG_FLAGS_SEVERITY_NORMAL,
                        I18N("Input Error"),
                        I18N("Please select a date format."),
                        I18N("Continue"), 0, 0, 0);
    GWEN_Dialog_SetIntProperty(dlg, "tabBook", GWEN_DialogProperty_Value, 0, 0, 0);
    GWEN_Dialog_SetIntProperty(dlg, "dateFormatCombo", GWEN_DialogProperty_Focus, 0, 1, 0);
    return GWEN_ERROR_BAD_DATA;
  }
  GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "dateFormat", s);

  i=setDbValueFromDoubleStringsCombo(dlg, db, "valueFormat", "amountFormatCombo", csv_amountFormats);
  if (i<0) {
    GWEN_Gui_MessageBox(GWEN_GUI_MSG_FLAGS_TYPE_ERROR |
                        GWEN_GUI_MSG_FLAGS_CONFIRM_B1 |
                        GWEN_GUI_MSG_FLAGS_SEVERITY_NORMAL,
                        I18N("Input Error"),
                        I18N("Please select a value format."),
                        I18N("Continue"), 0, 0, 0);
    GWEN_Dialog_SetIntProperty(dlg, "tabBook", GWEN_DialogProperty_Value, 0, 0, 0);
    GWEN_Dialog_SetIntProperty(dlg, "amountFormatCombo", GWEN_DialogProperty_Focus, 0, 1, 0);
    return GWEN_ERROR_BAD_DATA;
  }

  i=GWEN_Dialog_GetIntProperty(dlg, "headerCheck", GWEN_DialogProperty_Value, 0, 0);
  GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "params/title", i);

  i=GWEN_Dialog_GetIntProperty(dlg, "quoteCheck", GWEN_DialogProperty_Value, 0, 1);
  GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "params/quote", i);

  /* get columns */
  GWEN_DB_ClearGroup(db, "params/columns");
  for (i=0; i<DIALOG_MAX_COLUMNS; i++) {
    char varName[32];
    char comboName[32];
    int rv;

    snprintf(varName, sizeof(varName)-1, "params/columns/%d", i+1);
    snprintf(comboName, sizeof(comboName)-1, "col%dCombo", i+1);

    rv=setColumnValueFromCombo(dlg, db, varName, comboName, csv_columns);
    if (rv<0) {
      GWEN_Gui_MessageBox(GWEN_GUI_MSG_FLAGS_TYPE_ERROR |
                          GWEN_GUI_MSG_FLAGS_CONFIRM_B1 |
                          GWEN_GUI_MSG_FLAGS_SEVERITY_NORMAL,
                          I18N("Input Error"),
                          I18N("Please select a valid column type."),
                          I18N("Continue"), 0, 0, 0);
      GWEN_Dialog_SetIntProperty(dlg, "tabBook", GWEN_DialogProperty_Value, 0, 1, 0);
      GWEN_Dialog_SetIntProperty(dlg, comboName, GWEN_DialogProperty_Focus, 0, 1, 0);
      return GWEN_ERROR_BAD_DATA;
    }
  }

  return 0;
}
Example #23
0
void AB_CSV_EditProfileDialog_Init(GWEN_DIALOG *dlg)
{
  AB_CSV_EDIT_PROFILE_DIALOG *xdlg;
  int i;
  const char *s;
  GWEN_DB_NODE *dbPrefs;

  assert(dlg);
  xdlg=GWEN_INHERIT_GETDATA(GWEN_DIALOG, AB_CSV_EDIT_PROFILE_DIALOG, dlg);
  assert(xdlg);

  /* setup dialog size */
  dbPrefs=GWEN_Dialog_GetPreferences(dlg);

  /* read width */
  i=GWEN_DB_GetIntValue(dbPrefs, "dialog_width", 0, -1);
  if (i>=DIALOG_MINWIDTH)
    GWEN_Dialog_SetIntProperty(dlg, "", GWEN_DialogProperty_Width, 0, i, 0);

  /* read height */
  i=GWEN_DB_GetIntValue(dbPrefs, "dialog_height", 0, -1);
  if (i>=DIALOG_MINHEIGHT)
    GWEN_Dialog_SetIntProperty(dlg, "", GWEN_DialogProperty_Height, 0, i, 0);

  GWEN_Dialog_SetCharProperty(dlg,
                              "",
                              GWEN_DialogProperty_Title,
                              0,
                              I18N("Edit CSV Profile"),
                              0);

  /* setup dialog widgets */
  s=GWEN_DB_GetCharValue(xdlg->dbProfile, "name", 0, NULL);
  if (s && *s)
    GWEN_Dialog_SetCharProperty(dlg, "nameEdit", GWEN_DialogProperty_Value, 0, s, 0);

  s=GWEN_DB_GetCharValue(xdlg->dbProfile, "version", 0, NULL);
  if (s && *s)
    GWEN_Dialog_SetCharProperty(dlg, "versionEdit", GWEN_DialogProperty_Value, 0, s, 0);

  s=GWEN_DB_GetCharValue(xdlg->dbProfile, "shortDescr", 0, NULL);
  if (s && *s)
    GWEN_Dialog_SetCharProperty(dlg, "shortDescrEdit", GWEN_DialogProperty_Value, 0, s, 0);

  s=GWEN_DB_GetCharValue(xdlg->dbProfile, "longDescr", 0, NULL);
  if (s && *s)
    GWEN_Dialog_SetCharProperty(dlg, "longDescrEdit", GWEN_DialogProperty_Value, 0, s, 0);

  i=GWEN_DB_GetIntValue(xdlg->dbProfile, "import", 0, 1);
  GWEN_Dialog_SetIntProperty(dlg, "importCheck", GWEN_DialogProperty_Value, 0, i?1:0, 0);

  i=GWEN_DB_GetIntValue(xdlg->dbProfile, "export", 0, 1);
  GWEN_Dialog_SetIntProperty(dlg, "exportCheck", GWEN_DialogProperty_Value, 0, i?1:0, 0);

  GWEN_Dialog_SetIntProperty(dlg, "ignoreLinesSpin", GWEN_DialogProperty_MinValue, 0, 0, 0);
  GWEN_Dialog_SetIntProperty(dlg, "ignoreLinesSpin", GWEN_DialogProperty_MaxValue, 0, 1000, 0);
  i=GWEN_DB_GetIntValue(xdlg->dbProfile, "params/ignoreLines", 0, 0);
  GWEN_Dialog_SetIntProperty(dlg, "ignoreLinesSpin", GWEN_DialogProperty_Value, 0, i, 0);

  i=GWEN_DB_GetIntValue(xdlg->dbProfile, "params/title", 0, 0);
  GWEN_Dialog_SetIntProperty(dlg, "headerCheck", GWEN_DialogProperty_Value, 0, i?1:0, 0);

  i=GWEN_DB_GetIntValue(xdlg->dbProfile, "params/quote", 0, 1);
  GWEN_Dialog_SetIntProperty(dlg, "quoteCheck", GWEN_DialogProperty_Value, 0, i?1:0, 0);

  /* setup delimiter combo box */
  s=GWEN_DB_GetCharValue(xdlg->dbProfile, "params/delimiter", 0, NULL);
  setUpComboFromDoubleStrings(dlg, "delimiterCombo", csv_delimiters, s);

  /* setup subject combo box */
  s=GWEN_DB_GetCharValue(xdlg->dbProfile, "subject", 0, NULL);
  setUpComboFromDoubleStrings(dlg, "subjectCombo", csv_subjects, s);

  /* setup date format combo box */
  s=GWEN_DB_GetCharValue(xdlg->dbProfile, "dateFormat", 0, NULL);
  setUpComboFromSingleStrings(dlg, "dateFormatCombo", csv_dateFormats, s);

  /* setup amount format combo box */
  s=GWEN_DB_GetCharValue(xdlg->dbProfile, "valueFormat", 0, NULL);
  setUpComboFromDoubleStrings(dlg, "amountFormatCombo", csv_amountFormats, s);


  /* setup columns page */
  for (i=0; i<DIALOG_MAX_COLUMNS; i++) {
    char varName[32];
    char comboName[32];
    char editName[32];

    snprintf(varName, sizeof(varName)-1, "params/columns/%d", i+1);
    snprintf(comboName, sizeof(comboName)-1, "col%dCombo", i+1);
    snprintf(editName, sizeof(editName)-1, "col%dDataEdit", i+1);

    s=GWEN_DB_GetCharValue(xdlg->dbProfile, varName, 0, NULL);
    setUpComboFromDoubleStrings(dlg, comboName, csv_columns, s);
  }

  if (xdlg->testFileName)
    readTestData(dlg);

}
Example #24
0
int AH_NewKeyFileDialog_EnterPage(GWEN_DIALOG *dlg, int page, int forwards) {
  AH_NEWKEYFILE_DIALOG *xdlg;
  int rv;

  assert(dlg);
  xdlg=GWEN_INHERIT_GETDATA(GWEN_DIALOG, AH_NEWKEYFILE_DIALOG, dlg);
  assert(xdlg);

  switch(page) {
  case PAGE_BEGIN:
    GWEN_Dialog_SetIntProperty(dlg, "wiz_prev_button", GWEN_DialogProperty_Enabled, 0, 0, 0);
    GWEN_Dialog_SetIntProperty(dlg, "wiz_stack", GWEN_DialogProperty_Value, 0, page, 0);
    return GWEN_DialogEvent_ResultHandled;

  case PAGE_FILE:
    GWEN_Dialog_SetIntProperty(dlg, "wiz_prev_button", GWEN_DialogProperty_Enabled, 0, 1, 0);
    rv=AH_NewKeyFileDialog_GetFilePageData(dlg);
    if (rv<0)
      GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 0, 0);
    else
      GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 1, 0);
    GWEN_Dialog_SetIntProperty(dlg, "wiz_stack", GWEN_DialogProperty_Value, 0, page, 0);
    return GWEN_DialogEvent_ResultHandled;

  case PAGE_BANK:
    GWEN_Dialog_SetIntProperty(dlg, "wiz_prev_button", GWEN_DialogProperty_Enabled, 0, 1, 0);
    rv=AH_NewKeyFileDialog_GetBankPageData(dlg);
    if (rv<0)
      GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 0, 0);
    else
      GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 1, 0);
    GWEN_Dialog_SetIntProperty(dlg, "wiz_stack", GWEN_DialogProperty_Value, 0, page, 0);
    return GWEN_DialogEvent_ResultHandled;

  case PAGE_USER:
    GWEN_Dialog_SetIntProperty(dlg, "wiz_prev_button", GWEN_DialogProperty_Enabled, 0, 1, 0);
    rv=AH_NewKeyFileDialog_GetUserPageData(dlg);
    if (rv<0)
      GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 0, 0);
    else
      GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 1, 0);
    GWEN_Dialog_SetIntProperty(dlg, "wiz_stack", GWEN_DialogProperty_Value, 0, page, 0);
    return GWEN_DialogEvent_ResultHandled;

  case PAGE_CREATE:
    if (!forwards)
      GWEN_Dialog_SetCharProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Title, 0, I18N("Next"), 0);
    GWEN_Dialog_SetIntProperty(dlg, "wiz_stack", GWEN_DialogProperty_Value, 0, page, 0);
    return GWEN_DialogEvent_ResultHandled;

  case PAGE_END:
    GWEN_Dialog_SetIntProperty(dlg, "wiz_stack", GWEN_DialogProperty_Value, 0, page, 0);
    GWEN_Dialog_SetCharProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Title, 0, I18N("Finish"), 0);
    GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 1, 0);
    GWEN_Dialog_SetIntProperty(dlg, "wiz_prev_button", GWEN_DialogProperty_Enabled, 0, 0, 0);
    GWEN_Dialog_SetIntProperty(dlg, "wiz_abort_button", GWEN_DialogProperty_Enabled, 0, 0, 0);
    return GWEN_DialogEvent_ResultHandled;

  default:
    return GWEN_DialogEvent_ResultHandled;
  }

  return GWEN_DialogEvent_ResultHandled;
}
Example #25
0
static void AB_SetupDialog_Reload(GWEN_DIALOG *dlg)
{
  AB_SETUP_DIALOG *xdlg;
  AB_USER *u;
  AB_ACCOUNT *a;
  int i;

  assert(dlg);
  xdlg=GWEN_INHERIT_GETDATA(GWEN_DIALOG, AB_SETUP_DIALOG, dlg);
  assert(xdlg);

  /* user list */
  i=0;
  GWEN_Dialog_SetIntProperty(dlg, "userListBox", GWEN_DialogProperty_ClearValues, 0, 0, 0);
  if (xdlg->currentUserList)
    AB_User_List_free(xdlg->currentUserList);
  xdlg->currentUserList=AB_User_List_new();
  AB_SetupDialog_LoadUsers(dlg, xdlg->currentUserList);
  if (AB_User_List_GetCount(xdlg->currentUserList)) {
    GWEN_BUFFER *tbuf;

    tbuf=GWEN_Buffer_new(0, 256, 0, 1);

    u=AB_User_List_First(xdlg->currentUserList);
    while (u) {
      createUserListBoxString(u, tbuf);
      GWEN_Dialog_SetCharProperty(dlg,
                                  "userListBox",
                                  GWEN_DialogProperty_AddValue,
                                  0,
                                  GWEN_Buffer_GetStart(tbuf),
                                  0);
      i++;
      GWEN_Buffer_Reset(tbuf);

      u=AB_User_List_Next(u);
    }
    GWEN_Buffer_free(tbuf);
  } /* if user list not empty */
  GWEN_Dialog_SetIntProperty(dlg, "userListBox", GWEN_DialogProperty_Sort, 0, 0, 0);
  if (i)
    GWEN_Dialog_SetIntProperty(dlg, "userListBox", GWEN_DialogProperty_Value, 0, 0, 0);

  /* account list */
  i=0;
  GWEN_Dialog_SetIntProperty(dlg, "accountListBox", GWEN_DialogProperty_ClearValues, 0, 0, 0);
  if (xdlg->currentAccountList)
    AB_Account_List_free(xdlg->currentAccountList);
  xdlg->currentAccountList=AB_Account_List_new();
  AB_SetupDialog_LoadAccounts(dlg, xdlg->currentAccountList);
  if (AB_Account_List_GetCount(xdlg->currentAccountList)) {
    GWEN_BUFFER *tbuf;

    tbuf=GWEN_Buffer_new(0, 256, 0, 1);

    a=AB_Account_List_First(xdlg->currentAccountList);
    while (a) {
      createAccountListBoxString(a, tbuf);
      GWEN_Dialog_SetCharProperty(dlg,
                                  "accountListBox",
                                  GWEN_DialogProperty_AddValue,
                                  0,
                                  GWEN_Buffer_GetStart(tbuf),
                                  0);
      i++;
      GWEN_Buffer_Reset(tbuf);

      a=AB_Account_List_Next(a);
    }
    GWEN_Buffer_free(tbuf);
  } /* if account list not empty */
  GWEN_Dialog_SetIntProperty(dlg, "accountListBox", GWEN_DialogProperty_Sort, 0, 0, 0);
  if (i)
    GWEN_Dialog_SetIntProperty(dlg, "accountListBox", GWEN_DialogProperty_Value, 0, 0, 0);

  AB_SetupDialog_UserChanged(dlg);
  AB_SetupDialog_AccountChanged(dlg);
}
Example #26
0
void AB_SelectBankInfoDialog_Init(GWEN_DIALOG *dlg)
{
  AB_SELECTBANKINFO_DIALOG *xdlg;
  GWEN_DB_NODE *dbPrefs;
  int i;
  int j;

  assert(dlg);
  xdlg=GWEN_INHERIT_GETDATA(GWEN_DIALOG, AB_SELECTBANKINFO_DIALOG, dlg);
  assert(xdlg);

  dbPrefs=GWEN_Dialog_GetPreferences(dlg);

  GWEN_Dialog_SetCharProperty(dlg, "blzEdit", GWEN_DialogProperty_Value, 0, xdlg->bankCode, 0);
  GWEN_Dialog_SetCharProperty(dlg,
                              "",
                              GWEN_DialogProperty_Title,
                              0,
                              I18N("Select a Bank"),
                              0);

  GWEN_Dialog_SetCharProperty(dlg,
                              "listBox",
                              GWEN_DialogProperty_Title,
                              0,
                              I18N("Bank Code\tBIC\tName\tLocation\tProtocols"),
                              0);
  GWEN_Dialog_SetIntProperty(dlg,
                             "listBox",
                             GWEN_DialogProperty_SelectionMode,
                             0,
                             GWEN_Dialog_SelectionMode_Single,
                             0);


  /* read width */
  i=GWEN_DB_GetIntValue(dbPrefs, "dialog_width", 0, -1);
  if (i>=DIALOG_MINWIDTH)
    GWEN_Dialog_SetIntProperty(dlg, "", GWEN_DialogProperty_Width, 0, i, 0);

  /* read height */
  i=GWEN_DB_GetIntValue(dbPrefs, "dialog_height", 0, -1);
  if (i>=DIALOG_MINHEIGHT)
    GWEN_Dialog_SetIntProperty(dlg, "", GWEN_DialogProperty_Height, 0, i, 0);

  /* read bank column widths */
  for (i=0; i<5; i++) {
    j=GWEN_DB_GetIntValue(dbPrefs, "bank_list_columns", i, -1);
    if (j<LIST_MINCOLWIDTH)
      j=LIST_MINCOLWIDTH;
    GWEN_Dialog_SetIntProperty(dlg, "listBox", GWEN_DialogProperty_ColumnWidth, i, j, 0);
  }
  /* get sort column */
  i=GWEN_DB_GetIntValue(dbPrefs, "bank_list_sortbycolumn", 0, -1);
  j=GWEN_DB_GetIntValue(dbPrefs, "bank_list_sortdir", 0, -1);
  if (i>=0 && j>=0)
    GWEN_Dialog_SetIntProperty(dlg, "listBox", GWEN_DialogProperty_SortDirection, i, j, 0);

  /* disable ok button */
  GWEN_Dialog_SetIntProperty(dlg, "okButton", GWEN_DialogProperty_Enabled, 0, 0, 0);
}
Example #27
0
void AB_SetupDialog_Init(GWEN_DIALOG *dlg)
{
  AB_SETUP_DIALOG *xdlg;
  GWEN_DB_NODE *dbPrefs;
  int i;
  int j;

  assert(dlg);
  xdlg=GWEN_INHERIT_GETDATA(GWEN_DIALOG, AB_SETUP_DIALOG, dlg);
  assert(xdlg);

  dbPrefs=GWEN_Dialog_GetPreferences(dlg);

  GWEN_Dialog_SetCharProperty(dlg,
                              "",
                              GWEN_DialogProperty_Title,
                              0,
                              I18N("AqBanking Setup"),
                              0);

  /* user list */
  GWEN_Dialog_SetCharProperty(dlg,
                              "userListBox",
                              GWEN_DialogProperty_Title,
                              0,
                              I18N("Id\tBank Code\tUser Id\tCustomer Id\tUser Name\tModule"),
                              0);
  GWEN_Dialog_SetIntProperty(dlg,
                             "userListBox",
                             GWEN_DialogProperty_SelectionMode,
                             0,
                             GWEN_Dialog_SelectionMode_Single,
                             0);

  /* account list */
  GWEN_Dialog_SetCharProperty(dlg,
                              "accountListBox",
                              GWEN_DialogProperty_Title,
                              0,
                              I18N("Id\tBank Code\tBank Name\tAccount Number\tAccount Name\tOwner Name\tModule"),
                              0);
  GWEN_Dialog_SetIntProperty(dlg,
                             "accountListBox",
                             GWEN_DialogProperty_SelectionMode,
                             0,
                             GWEN_Dialog_SelectionMode_Single,
                             0);

  /* read width */
  i=GWEN_DB_GetIntValue(dbPrefs, "dialog_width", 0, -1);
  if (i>=DIALOG_MINWIDTH)
    GWEN_Dialog_SetIntProperty(dlg, "", GWEN_DialogProperty_Width, 0, i, 0);

  /* read height */
  i=GWEN_DB_GetIntValue(dbPrefs, "dialog_height", 0, -1);
  if (i>=DIALOG_MINHEIGHT)
    GWEN_Dialog_SetIntProperty(dlg, "", GWEN_DialogProperty_Height, 0, i, 0);

  /* read user column widths */
  for (i=0; i<6; i++) {
    j=GWEN_DB_GetIntValue(dbPrefs, "user_list_columns", i, -1);
    if (j<USER_LIST_MINCOLWIDTH)
      j=USER_LIST_MINCOLWIDTH;
    GWEN_Dialog_SetIntProperty(dlg, "userListBox", GWEN_DialogProperty_ColumnWidth, i, j, 0);
  }
  /* get sort column */
  i=GWEN_DB_GetIntValue(dbPrefs, "user_list_sortbycolumn", 0, -1);
  j=GWEN_DB_GetIntValue(dbPrefs, "user_list_sortdir", 0, -1);
  if (i>=0 && j>=0)
    GWEN_Dialog_SetIntProperty(dlg, "userListBox", GWEN_DialogProperty_SortDirection, i, j, 0);

  /* read account column widths */
  for (i=0; i<7; i++) {
    j=GWEN_DB_GetIntValue(dbPrefs, "account_list_columns", i, -1);
    if (j<ACCOUNT_LIST_MINCOLWIDTH)
      j=ACCOUNT_LIST_MINCOLWIDTH;
    GWEN_Dialog_SetIntProperty(dlg, "accountListBox", GWEN_DialogProperty_ColumnWidth, i, j, 0);
  }
  /* get sort column */
  i=GWEN_DB_GetIntValue(dbPrefs, "account_list_sortbycolumn", 0, -1);
  j=GWEN_DB_GetIntValue(dbPrefs, "account_list_sortdir", 0, -1);
  if (i>=0 && j>=0)
    GWEN_Dialog_SetIntProperty(dlg, "accountListBox", GWEN_DialogProperty_SortDirection, i, j, 0);

  /* activate providers */
  AB_SetupDialog_ActivateProviders(dlg);

  /* reload accounts and users */
  AB_SetupDialog_Reload(dlg);
}
Example #28
0
void OH_GetInstituteDialog_Init(GWEN_DIALOG *dlg) {
  OH_GETINST_DIALOG *xdlg;
  GWEN_DB_NODE *dbPrefs;
  int i;
  int j;

  assert(dlg);
  xdlg=GWEN_INHERIT_GETDATA(GWEN_DIALOG, OH_GETINST_DIALOG, dlg);
  assert(xdlg);

  dbPrefs=GWEN_Dialog_GetPreferences(dlg);

  GWEN_Dialog_SetCharProperty(dlg,
			      "",
			      GWEN_DialogProperty_Title,
			      0,
			      I18N("Select a Bank"),
			      0);

  GWEN_Dialog_SetCharProperty(dlg,
			      "listBox",
			      GWEN_DialogProperty_Title,
			      0,
			      I18N("Bank Name"),
			      0);
  GWEN_Dialog_SetIntProperty(dlg,
			     "listBox",
			     GWEN_DialogProperty_SelectionMode,
			     0,
			     GWEN_Dialog_SelectionMode_Single,
			     0);

  GWEN_Dialog_SetCharProperty(dlg,
			      "infoLabel",
			      GWEN_DialogProperty_Title,
			      0,
                              I18N("<html>"
                                   "<p>Please start typing in the name of your bank. The list "
                                   "below will be updated to show matching banks.</p>"
                                   "<p>Choose the bank from list below and click <b>ok</b>.</p>"
                                   "</html>"
                                   "Please start typing in the name of your bank. The list\n"
                                   "below will be updated to show matching banks.\n"
                                   "Choose the bank from list below and click OK."),
                              0);

  /* read width */
  i=GWEN_DB_GetIntValue(dbPrefs, "dialog_width", 0, -1);
  if (i>=DIALOG_MINWIDTH)
    GWEN_Dialog_SetIntProperty(dlg, "", GWEN_DialogProperty_Width, 0, i, 0);

  /* read height */
  i=GWEN_DB_GetIntValue(dbPrefs, "dialog_height", 0, -1);
  if (i>=DIALOG_MINHEIGHT)
    GWEN_Dialog_SetIntProperty(dlg, "", GWEN_DialogProperty_Height, 0, i, 0);

  /* read bank column widths */
  for (i=0; i<1; i++) {
    j=GWEN_DB_GetIntValue(dbPrefs, "bank_list_columns", i, -1);
    if (j<LIST_MINCOLWIDTH)
      j=LIST_MINCOLWIDTH;
    GWEN_Dialog_SetIntProperty(dlg, "listBox", GWEN_DialogProperty_ColumnWidth, i, j, 0);
  }
  /* get sort column */
  i=GWEN_DB_GetIntValue(dbPrefs, "bank_list_sortbycolumn", 0, -1);
  j=GWEN_DB_GetIntValue(dbPrefs, "bank_list_sortdir", 0, -1);
  if (i>=0 && j>=0)
    GWEN_Dialog_SetIntProperty(dlg, "listBox", GWEN_DialogProperty_SortDirection, i, j, 0);

  /* disable ok button */
  GWEN_Dialog_SetIntProperty(dlg, "okButton", GWEN_DialogProperty_Enabled, 0, 0, 0);
}
Example #29
0
int AO_NewUserDialog_HandleActivatedBankSelect(GWEN_DIALOG *dlg)
{
  AO_NEWUSER_DIALOG *xdlg;
  int rv;
  GWEN_DIALOG *dlg2;
  GWEN_BUFFER *tbuf;

  assert(dlg);
  xdlg=GWEN_INHERIT_GETDATA(GWEN_DIALOG, AO_NEWUSER_DIALOG, dlg);
  assert(xdlg);

  /* get data dir */
  tbuf=GWEN_Buffer_new(0, 256, 0, 1);
  rv=AB_Banking_GetProviderUserDataDir(xdlg->banking, "aqofxconnect", tbuf);
  if (rv<0) {
    DBG_INFO(AQOFXCONNECT_LOGDOMAIN, "here (%d)", rv);
    GWEN_Buffer_free(tbuf);
    return GWEN_DialogEvent_ResultHandled;
  }
  GWEN_Buffer_AppendString(tbuf, GWEN_DIR_SEPARATOR_S "ofxhome");

  /* possibly create data folder */
  rv=GWEN_Directory_GetPath(GWEN_Buffer_GetStart(tbuf), GWEN_PATH_FLAGS_CHECKROOT);
  if (rv<0) {
    DBG_INFO(AQOFXCONNECT_LOGDOMAIN, "here (%d)", rv);
    GWEN_Buffer_free(tbuf);
    return GWEN_DialogEvent_ResultHandled;
  }

  dlg2=OH_GetInstituteDialog_new(GWEN_Buffer_GetStart(tbuf), NULL);
  GWEN_Buffer_free(tbuf);
  if (dlg2==NULL) {
    DBG_INFO(AQOFXCONNECT_LOGDOMAIN, "Could not create dialog");
    return GWEN_DialogEvent_ResultHandled;
  }
  rv=GWEN_Gui_ExecDialog(dlg2, 0);
  if (rv<=0) {
    DBG_DEBUG(AQOFXCONNECT_LOGDOMAIN, "Dialog: rejected (%d)", rv);
    return GWEN_DialogEvent_ResultHandled;
  }
  else {
    const OH_INSTITUTE_DATA *od;

    DBG_DEBUG(AQOFXCONNECT_LOGDOMAIN, "Dialog: rejected (%d)", rv);
    od=OH_GetInstituteDialog_GetSelectedInstitute(dlg2);
    if (od) {
      const char *s;

      s=OH_InstituteData_GetName(od);
      if (s && *s)
        GWEN_Dialog_SetCharProperty(dlg, "wiz_bankname_edit", GWEN_DialogProperty_Value, 0, s, 0);

      s=OH_InstituteData_GetFid(od);
      if (s && *s)
        GWEN_Dialog_SetCharProperty(dlg, "wiz_fid_edit", GWEN_DialogProperty_Value, 0, s, 0);
      s=OH_InstituteData_GetOrg(od);
      if (s && *s)
        GWEN_Dialog_SetCharProperty(dlg, "wiz_org_edit", GWEN_DialogProperty_Value, 0, s, 0);
      s=OH_InstituteData_GetUrl(od);
      if (s && *s)
        GWEN_Dialog_SetCharProperty(dlg, "wiz_url_edit", GWEN_DialogProperty_Value, 0, s, 0);
      rv=AO_NewUserDialog_GetBankPageData(dlg);
      if (rv<0)
        GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 0, 0);
      else
        GWEN_Dialog_SetIntProperty(dlg, "wiz_next_button", GWEN_DialogProperty_Enabled, 0, 1, 0);
    }
  }
  GWEN_Dialog_free(dlg2);
  return GWEN_DialogEvent_ResultHandled;
}