コード例 #1
0
ファイル: bankinfo.c プロジェクト: Zauberstuhl/aqbanking
AB_BANKINFO_LIST *AB_BankInfo_List_dup(const AB_BANKINFO_LIST *stl) {
  if (stl) {
    AB_BANKINFO_LIST *nl;
    AB_BANKINFO *e;

    nl=AB_BankInfo_List_new();
    e=AB_BankInfo_List_First(stl);
    while(e) {
      AB_BANKINFO *ne;

      ne=AB_BankInfo_dup(e);
      assert(ne);
      AB_BankInfo_List_Add(ne, nl);
      e=AB_BankInfo_List_Next(e);
    } /* while (e) */
    return nl;
  }
  else
    return 0;
}
コード例 #2
0
ファイル: dlg_selectbankinfo.c プロジェクト: cstim/aqbanking
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;
}