Example #1
0
GWEN_DIALOG *Dlg_Test1_new() {
    GWEN_DIALOG *dlg;
    int rv;
    const char *s;
    GWEN_BUFFER *tbuf;

    tbuf=GWEN_Buffer_new(0, 256, 0, 1);
    s=getenv("DIALOG_DIR");
    if (s && *s)
        GWEN_Buffer_AppendString(tbuf, s);
    else
        GWEN_Buffer_AppendString(tbuf, MEDIAPATH);
    dlg=GWEN_Dialog_new("dlg_test");
    GWEN_Dialog_SetSignalHandler(dlg, _gwenGuiSignalHandler);
    GWEN_Dialog_AddMediaPath(dlg, GWEN_Buffer_GetStart(tbuf));

    /* read dialog from dialog description file */
    GWEN_Buffer_AppendString(tbuf, GWEN_DIR_SEPARATOR_S "dlg_test.dlg");
    rv=GWEN_Dialog_ReadXmlFile(dlg, GWEN_Buffer_GetStart(tbuf));
    GWEN_Buffer_free(tbuf);
    if (rv<0) {
        DBG_INFO(GWEN_LOGDOMAIN, "here (%d).", rv);
        GWEN_Dialog_free(dlg);
        return NULL;
    }

    /* done */
    return dlg;
}
Example #2
0
GWEN_DIALOG *AB_SelectBankInfoDialog_new(AB_BANKING *ab,
                                         const char *country,
                                         const char *bankCode)
{
  GWEN_DIALOG *dlg;
  AB_SELECTBANKINFO_DIALOG *xdlg;
  GWEN_BUFFER *fbuf;
  int rv;

  dlg=GWEN_Dialog_new("ab_selectbankinfo");
  GWEN_NEW_OBJECT(AB_SELECTBANKINFO_DIALOG, xdlg);
  GWEN_INHERIT_SETDATA(GWEN_DIALOG, AB_SELECTBANKINFO_DIALOG, dlg, xdlg,
                       AB_SelectBankInfoDialog_FreeData);
  GWEN_Dialog_SetSignalHandler(dlg, AB_SelectBankInfoDialog_SignalHandler);

  /* get path of dialog description file */
  fbuf=GWEN_Buffer_new(0, 256, 0, 1);
  rv=GWEN_PathManager_FindFile(AB_PM_LIBNAME, AB_PM_DATADIR,
                               "aqbanking/dialogs/dlg_selectbankinfo.dlg",
                               fbuf);
  if (rv<0) {
    DBG_INFO(AQBANKING_LOGDOMAIN, "Dialog description file not found (%d).", rv);
    GWEN_Buffer_free(fbuf);
    GWEN_Dialog_free(dlg);
    return NULL;
  }

  /* read dialog from dialog description file */
  rv=GWEN_Dialog_ReadXmlFile(dlg, GWEN_Buffer_GetStart(fbuf));
  if (rv<0) {
    DBG_INFO(AQBANKING_LOGDOMAIN, "here (%d).", rv);
    GWEN_Buffer_free(fbuf);
    GWEN_Dialog_free(dlg);
    return NULL;
  }
  GWEN_Buffer_free(fbuf);

  xdlg->banking=ab;

  if (country)
    xdlg->country=strdup(country);
  else
    xdlg->country=strdup("de");

  if (bankCode)
    xdlg->bankCode=strdup(bankCode);
  else
    xdlg->bankCode=NULL;

  /* done */
  return dlg;
}
Example #3
0
GWEN_DIALOG *AB_CSV_EditProfileDialog_new(AB_IMEXPORTER *ie,
                                          GWEN_DB_NODE *dbProfile,
                                          const char *testFileName)
{
  AB_BANKING *ab;
  GWEN_DIALOG *dlg;
  AB_CSV_EDIT_PROFILE_DIALOG *xdlg;
  GWEN_BUFFER *fbuf;
  int rv;

  assert(ie);
  assert(dbProfile);

  ab=AB_ImExporter_GetBanking(ie);
  dlg=GWEN_Dialog_new("ab_csv_edit_profile");
  GWEN_NEW_OBJECT(AB_CSV_EDIT_PROFILE_DIALOG, xdlg);
  GWEN_INHERIT_SETDATA(GWEN_DIALOG, AB_CSV_EDIT_PROFILE_DIALOG, dlg, xdlg,
                       AB_CSV_EditProfileDialog_FreeData);
  GWEN_Dialog_SetSignalHandler(dlg, AB_CSV_EditProfileDialog_SignalHandler);

  /* get path of dialog description file */
  fbuf=GWEN_Buffer_new(0, 256, 0, 1);
  rv=GWEN_PathManager_FindFile(AB_PM_LIBNAME, AB_PM_DATADIR,
                               "aqbanking/imexporters/csv/dialogs/csv_editprofile.dlg",
                               fbuf);
  if (rv<0) {
    DBG_INFO(AQBANKING_LOGDOMAIN, "Dialog description file not found (%d).", rv);
    GWEN_Buffer_free(fbuf);
    GWEN_Dialog_free(dlg);
    return NULL;
  }

  /* read dialog from dialog description file */
  rv=GWEN_Dialog_ReadXmlFile(dlg, GWEN_Buffer_GetStart(fbuf));
  if (rv<0) {
    DBG_INFO(AQBANKING_LOGDOMAIN, "here (%d).", rv);
    GWEN_Buffer_free(fbuf);
    GWEN_Dialog_free(dlg);
    return NULL;
  }
  GWEN_Buffer_free(fbuf);

  xdlg->banking=ab;
  xdlg->imExporter=ie;
  xdlg->testFileName=testFileName;
  xdlg->dbProfile=dbProfile;

  xdlg->columns=GWEN_StringList_new();

  /* done */
  return dlg;
}
Example #4
0
GWEN_DIALOG *GWEN_DlgShowBox_new(uint32_t flags,
                                 const char *title,
                                 const char *text)
{
  GWEN_DIALOG *dlg;
  GWEN_DLGSHOWBOX *xdlg;
  GWEN_BUFFER *fbuf;
  int rv;

  dlg=GWEN_Dialog_new("dlg_gwen_showbox");
  GWEN_NEW_OBJECT(GWEN_DLGSHOWBOX, xdlg);

  GWEN_INHERIT_SETDATA(GWEN_DIALOG, GWEN_DLGSHOWBOX, dlg, xdlg,
                       GWEN_DlgShowBox_FreeData);

  GWEN_Dialog_SetSignalHandler(dlg, GWEN_DlgShowBox_SignalHandler);

  /* get path of dialog description file */
  fbuf=GWEN_Buffer_new(0, 256, 0, 1);
  rv=GWEN_PathManager_FindFile(GWEN_PM_LIBNAME, GWEN_PM_SYSDATADIR,
                               "gwenhywfar/dialogs/dlg_showbox.dlg",
                               fbuf);
  if (rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "Dialog description file not found (%d).", rv);
    GWEN_Buffer_free(fbuf);
    GWEN_Dialog_free(dlg);
    return NULL;
  }

  /* read dialog from dialog description file */
  rv=GWEN_Dialog_ReadXmlFile(dlg, GWEN_Buffer_GetStart(fbuf));
  if (rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d).", rv);
    GWEN_Buffer_free(fbuf);
    GWEN_Dialog_free(dlg);
    return NULL;
  }
  GWEN_Buffer_free(fbuf);

  xdlg->flags=flags;
  if (title)
    xdlg->title=strdup(title);
  if (text)
    xdlg->text=strdup(text);

  return dlg;
}
Example #5
0
GWEN_DIALOG *AH_NewKeyFileDialog_new(AB_BANKING *ab) {
  GWEN_DIALOG *dlg;
  AH_NEWKEYFILE_DIALOG *xdlg;
  GWEN_BUFFER *fbuf;
  int rv;

  dlg=GWEN_Dialog_new("ah_setup_newkeyfile");
  GWEN_NEW_OBJECT(AH_NEWKEYFILE_DIALOG, xdlg);
  GWEN_INHERIT_SETDATA(GWEN_DIALOG, AH_NEWKEYFILE_DIALOG, dlg, xdlg,
		       AH_NewKeyFileDialog_FreeData);
  GWEN_Dialog_SetSignalHandler(dlg, AH_NewKeyFileDialog_SignalHandler);

  /* get path of dialog description file */
  fbuf=GWEN_Buffer_new(0, 256, 0, 1);
  rv=GWEN_PathManager_FindFile(AB_PM_LIBNAME, AB_PM_DATADIR,
			       "aqbanking/backends/aqhbci/dialogs/dlg_newkeyfile.dlg",
			       fbuf);
  if (rv<0) {
    DBG_INFO(AQHBCI_LOGDOMAIN, "Dialog description file not found (%d).", rv);
    GWEN_Buffer_free(fbuf);
    GWEN_Dialog_free(dlg);
    return NULL;
  }

  /* read dialog from dialog description file */
  rv=GWEN_Dialog_ReadXmlFile(dlg, GWEN_Buffer_GetStart(fbuf));
  if (rv<0) {
    DBG_INFO(AQHBCI_LOGDOMAIN, "here (%d).", rv);
    GWEN_Gui_ShowError(I18N("Error"),
		       I18N("Could not read dialog description file [%s], maybe an installation error (%d)?"),
		       GWEN_Buffer_GetStart(fbuf), rv);
    GWEN_Buffer_free(fbuf);
    GWEN_Dialog_free(dlg);
    return NULL;
  }
  GWEN_Buffer_free(fbuf);

  xdlg->banking=ab;

  /* preset */
  xdlg->hbciVersion=210;
  xdlg->rdhVersion=0;

  /* done */
  return dlg;
}
Example #6
0
GWEN_DIALOG *APY_NewUserDialog_new(AB_BANKING *ab) {
  GWEN_DIALOG *dlg;
  APY_NEWUSER_DIALOG *xdlg;
  GWEN_BUFFER *fbuf;
  int rv;

  dlg=GWEN_Dialog_new("apy_newuser");
  GWEN_NEW_OBJECT(APY_NEWUSER_DIALOG, xdlg);
  GWEN_INHERIT_SETDATA(GWEN_DIALOG, APY_NEWUSER_DIALOG, dlg, xdlg,
		       APY_NewUserDialog_FreeData);
  GWEN_Dialog_SetSignalHandler(dlg, APY_NewUserDialog_SignalHandler);

  /* get path of dialog description file */
  fbuf=GWEN_Buffer_new(0, 256, 0, 1);
  rv=GWEN_PathManager_FindFile(AB_PM_LIBNAME, AB_PM_DATADIR,
			       "aqbanking/backends/aqpaypal/dialogs/dlg_newuser.dlg",
			       fbuf);
  if (rv<0) {
    DBG_INFO(AQPAYPAL_LOGDOMAIN, "Dialog description file not found (%d).", rv);
    GWEN_Buffer_free(fbuf);
    GWEN_Dialog_free(dlg);
    return NULL;
  }

  /* read dialog from dialog description file */
  rv=GWEN_Dialog_ReadXmlFile(dlg, GWEN_Buffer_GetStart(fbuf));
  if (rv<0) {
    DBG_INFO(AQPAYPAL_LOGDOMAIN, "here (%d).", rv);
    GWEN_Buffer_free(fbuf);
    GWEN_Dialog_free(dlg);
    return NULL;
  }
  GWEN_Buffer_free(fbuf);

  xdlg->banking=ab;

  /* preset */
  xdlg->httpVMajor=1;
  xdlg->httpVMinor=1;

  xdlg->url=strdup("https://api-3t.paypal.com/nvp");

  /* done */
  return dlg;
}
Example #7
0
GWEN_DIALOG *AO_NewUserDialog_new(AB_PROVIDER *pro)
{
  GWEN_DIALOG *dlg;
  AO_NEWUSER_DIALOG *xdlg;
  GWEN_BUFFER *fbuf;
  int rv;

  dlg=GWEN_Dialog_new("ao_newuser");
  GWEN_NEW_OBJECT(AO_NEWUSER_DIALOG, xdlg);
  GWEN_INHERIT_SETDATA(GWEN_DIALOG, AO_NEWUSER_DIALOG, dlg, xdlg,
                       AO_NewUserDialog_FreeData);
  GWEN_Dialog_SetSignalHandler(dlg, AO_NewUserDialog_SignalHandler);

  /* get path of dialog description file */
  fbuf=GWEN_Buffer_new(0, 256, 0, 1);
  rv=GWEN_PathManager_FindFile(AB_PM_LIBNAME, AB_PM_DATADIR,
                               "aqbanking/backends/aqofxconnect/dialogs/dlg_newuser.dlg",
                               fbuf);
  if (rv<0) {
    DBG_INFO(AQOFXCONNECT_LOGDOMAIN, "Dialog description file not found (%d).", rv);
    GWEN_Buffer_free(fbuf);
    GWEN_Dialog_free(dlg);
    return NULL;
  }

  /* read dialog from dialog description file */
  rv=GWEN_Dialog_ReadXmlFile(dlg, GWEN_Buffer_GetStart(fbuf));
  if (rv<0) {
    DBG_INFO(AQOFXCONNECT_LOGDOMAIN, "here (%d)", rv);
    GWEN_Buffer_free(fbuf);
    GWEN_Dialog_free(dlg);
    return NULL;
  }
  GWEN_Buffer_free(fbuf);

  xdlg->provider=pro;
  xdlg->banking=AB_Provider_GetBanking(pro);

  /* preset */
  xdlg->httpVMajor=1;
  xdlg->httpVMinor=1;

  /* done */
  return dlg;
}
Example #8
0
GWEN_DIALOG *OH_GetInstituteDialog_new(const char *dataFolder, const char *name)
{
  GWEN_DIALOG *dlg;
  OH_GETINST_DIALOG *xdlg;
  GWEN_BUFFER *fbuf;
  int rv;

  dlg=GWEN_Dialog_new("oh_getinst");
  GWEN_NEW_OBJECT(OH_GETINST_DIALOG, xdlg);
  GWEN_INHERIT_SETDATA(GWEN_DIALOG, OH_GETINST_DIALOG, dlg, xdlg,
                       OH_GetInstituteDialog_FreeData);
  GWEN_Dialog_SetSignalHandler(dlg, OH_GetInstituteDialog_SignalHandler);

  /* get path of dialog description file */
  fbuf=GWEN_Buffer_new(0, 256, 0, 1);
  rv=GWEN_PathManager_FindFile(AB_PM_LIBNAME, AB_PM_DATADIR,
                               "aqbanking/backends/aqofxconnect/dialogs/dlg_getinst.dlg",
                               fbuf);
  if (rv<0) {
    DBG_INFO(AQOFXCONNECT_LOGDOMAIN, "Dialog description file not found (%d).", rv);
    GWEN_Buffer_free(fbuf);
    GWEN_Dialog_free(dlg);
    return NULL;
  }

  /* read dialog from dialog description file */
  rv=GWEN_Dialog_ReadXmlFile(dlg, GWEN_Buffer_GetStart(fbuf));
  if (rv<0) {
    DBG_INFO(AQOFXCONNECT_LOGDOMAIN, "here (%d).", rv);
    GWEN_Buffer_free(fbuf);
    GWEN_Dialog_free(dlg);
    return NULL;
  }
  GWEN_Buffer_free(fbuf);

  xdlg->ofxHome=OfxHome_new(dataFolder);
  xdlg->matchingSpecList=OH_InstituteSpec_List_new();

  if (name)
    xdlg->name=strdup(name);

  /* done */
  return dlg;
}
Example #9
0
GWEN_DIALOG *TestDialog_new() {
  int rv;
  GWEN_DIALOG *dlg;

  /* create dialog */
  dlg=GWEN_Dialog_new("testdialog");

  /* set signal handler */
  GWEN_Dialog_SetSignalHandler(dlg, TestDialog_SignalHandler);

  /* read dialog from dialog description file */
  rv=GWEN_Dialog_ReadXmlFile(dlg, "testdialog.dlg");
  if (rv<0) {
    fprintf(stderr, "Error reading dialog file (%d)\n", rv);
    GWEN_Dialog_free(dlg);
    return NULL;
  }

  return dlg;
}
Example #10
0
GWEN_DIALOG *AB_SetupDialog_new(AB_BANKING *ab)
{
  GWEN_DIALOG *dlg;
  AB_SETUP_DIALOG *xdlg;
  GWEN_BUFFER *fbuf;
  int rv;

  dlg=GWEN_Dialog_new("ab_setup");
  GWEN_NEW_OBJECT(AB_SETUP_DIALOG, xdlg);
  GWEN_INHERIT_SETDATA(GWEN_DIALOG, AB_SETUP_DIALOG, dlg, xdlg,
                       AB_SetupDialog_FreeData);
  GWEN_Dialog_SetSignalHandler(dlg, AB_SetupDialog_SignalHandler);

  /* get path of dialog description file */
  fbuf=GWEN_Buffer_new(0, 256, 0, 1);
  rv=GWEN_PathManager_FindFile(AB_PM_LIBNAME, AB_PM_DATADIR,
                               "aqbanking/dialogs/dlg_setup.dlg",
                               fbuf);
  if (rv<0) {
    DBG_INFO(AQBANKING_LOGDOMAIN, "Dialog description file not found (%d).", rv);
    GWEN_Buffer_free(fbuf);
    GWEN_Dialog_free(dlg);
    return NULL;
  }

  /* read dialog from dialog description file */
  rv=GWEN_Dialog_ReadXmlFile(dlg, GWEN_Buffer_GetStart(fbuf));
  if (rv<0) {
    DBG_INFO(AQBANKING_LOGDOMAIN, "here (%d).", rv);
    GWEN_Buffer_free(fbuf);
    GWEN_Dialog_free(dlg);
    return NULL;
  }
  GWEN_Buffer_free(fbuf);

  xdlg->banking=ab;

  /* done */
  return dlg;
}
GWEN_DIALOG *AH_ChooseUserTypeDialog_new(AB_BANKING *ab) {
  GWEN_DIALOG *dlg;
  GWEN_BUFFER *fbuf;
  int rv;

  dlg=AB_UserTypePageDialog_new(ab, "ah_choose_usertype");
  GWEN_Dialog_SetSignalHandler(dlg, AH_ChooseUserTypeDialog_SignalHandler);

  /* get path of dialog description file */
  fbuf=GWEN_Buffer_new(0, 256, 0, 1);
  rv=GWEN_PathManager_FindFile(AB_PM_LIBNAME, AB_PM_DATADIR,
			       "aqbanking/backends/aqhbci/dialogs/dlg_choose_usertype.dlg",
			       fbuf);
  if (rv<0) {
    DBG_INFO(AQHBCI_LOGDOMAIN, "Dialog description file not found (%d).", rv);
    GWEN_Buffer_free(fbuf);
    GWEN_Dialog_free(dlg);
    return NULL;
  }

  /* read dialog from dialog description file */
  rv=GWEN_Dialog_ReadXmlFile(dlg, GWEN_Buffer_GetStart(fbuf));
  if (rv<0) {
    DBG_INFO(AQHBCI_LOGDOMAIN, "here (%d).", rv);
    GWEN_Buffer_free(fbuf);
    GWEN_Dialog_free(dlg);
    return NULL;
  }
  GWEN_Buffer_free(fbuf);

  /* add media paths for icons */
  GWEN_Dialog_AddMediaPathsFromPathManager(dlg,
					   GWEN_PM_LIBNAME,
					   GWEN_PM_SYSDATADIR,
					   "aqbanking/backends/aqhbci/dialogs");

  /* done */
  return dlg;
}