⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qtconfig.cc

📁 GNUnet是一个安全的点对点网络框架
💻 CC
字号:
#include <Qt/qapplication.h>extern "C" {  #include "platform.h"  #include "gnunet_util.h"  #include "gnunet_directories.h"  #include "gnunet_setup_lib.h"}#include "setupWizard.h"static struct GNUNET_GE_Context *ectx;static struct GNUNET_GC_Configuration *cfg;static struct GNUNET_GNS_Context *gns;static char *cfgFilename;static int config_daemon;/** * All gnunet-setup command line options */static struct GNUNET_CommandLineOption gnunetsetupOptions[] = {  GNUNET_COMMAND_LINE_OPTION_CFG_FILE (&cfgFilename),   /* -c */  {'d', "daemon", NULL,   gettext_noop ("generate configuration for gnunetd, the GNUnet daemon"),   0, &GNUNET_getopt_configure_set_one, &config_daemon},  GNUNET_COMMAND_LINE_OPTION_HELP (gettext_noop ("Tool to setup GNUnet.")),     /* -h */  GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION),  /* -v */  GNUNET_COMMAND_LINE_OPTION_VERBOSE,  GNUNET_COMMAND_LINE_OPTION_END,};static const char *INFO = "gnunetsetup_qt [OPTIONS] qconfig|wizard-qt"  "";static voidgns2cfg (struct GNUNET_GNS_TreeNode *pos){  int i;  char *val;  if (pos == NULL)    return;  i = 0;  while (pos->children[i] != NULL)    {      gns2cfg (pos->children[i]);      i++;    }  if (i != 0)    return;  if ((pos->section == NULL) || (pos->option == NULL))    return;  if (GNUNET_NO ==      GNUNET_GC_have_configuration_value (cfg, pos->section, pos->option))    {      val = GNUNET_GNS_get_default_value_as_string (pos->type, &pos->value);      if (val != NULL)        {          GNUNET_GC_set_configuration_value_string (cfg,                                                    ectx,                                                    pos->section, pos->option,                                                    val);          GNUNET_free (val);        }    }}extern "C" {intqt_wizard_mainsetup_qt (int argc,                          char *const *argv,                          struct GNUNET_PluginHandle *self,                          struct GNUNET_GE_Context *ectx,                          struct GNUNET_GC_Configuration *cfg,                          struct GNUNET_GNS_Context *gns,                          const char *filename, int is_daemon)  {    QApplication *app;    GSetupWizard *wiz;    int ret;        GNUNET_GE_ASSERT (ectx, is_daemon);#ifdef WINDOWS  FreeConsole ();#endif    app = new QApplication(argc, (char **) argv);    wiz = new GSetupWizard(NULL, ectx, cfg, filename);    wiz->show();        ret = app->exec();    delete wiz;    delete app;      return ret;  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -