예제 #1
0
static void set_ipv6_privacy(const char *privacy)
{
	if (g_strcmp0(privacy, "enabled") == 0)
		toggle_button("ipv6_priv_enabled");
	else if (g_strcmp0(privacy, "prefered") == 0)
		toggle_button("ipv6_priv_prefered");
	else
		toggle_button("ipv6_priv_disabled");
}
예제 #2
0
static void set_proxy_method(const char *method)
{
	if (g_strcmp0(method, "auto") == 0) {
		toggle_button("proxy_auto");
		enable_proxy_config(FALSE);
	} else if (g_strcmp0(method, "direct") == 0) {
		toggle_button("proxy_direct");
		enable_proxy_config(FALSE);
	} else {
		toggle_button("proxy_manual");
		enable_proxy_config(TRUE);
	}
}
예제 #3
0
static void set_ipv4_method(const char *method)
{
	if (g_strcmp0(method, "dhcp") == 0) {
		toggle_button("ipv4_dhcp");
		enable_ipv4_config(FALSE);
	} else if (g_strcmp0(method, "manual") == 0) {
		toggle_button("ipv4_manual");
		enable_ipv4_config(TRUE);
	} else {
		toggle_button("ipv4_off");
		enable_ipv4_config(FALSE);
	}
}
예제 #4
0
static void set_ipv6_method(const char *method)
{
	gboolean privacy_enabled = FALSE;

	if (g_strcmp0(method, "auto") == 0) {
		toggle_button("ipv6_auto");
		enable_ipv6_config(FALSE);

		privacy_enabled = TRUE;
	} else if (g_strcmp0(method, "manual") == 0) {
		toggle_button("ipv6_manual");
		enable_ipv6_config(TRUE);
	} else {
		toggle_button("ipv6_off");
		enable_ipv6_config(FALSE);
	}

	set_widget_sensitive(builder, "ipv6_priv_box", privacy_enabled);
}
예제 #5
0
파일: inspectors.cpp 프로젝트: gpg/gpgol
/* Called for a click on an inspector button.  BUTTON is the button
   object and TAG is the tag value (which is guaranteed not to be
   NULL).  INSTID is the instance ID of the button. */
void
proc_inspector_button_click (LPDISPATCH button, const char *tag, int instid)
{
  LPMESSAGE message;
  HWND hwnd = NULL; /* Fixme  */

  if (!tagcmp (tag, "GpgOL_Inspector_Encrypt"))
    {  
      toggle_button (button, tag, instid);
    }
  else if (!tagcmp (tag, "GpgOL_Inspector_Sign"))
    {  
      toggle_button (button, tag, instid);
    }
  else if (!tagcmp (tag, "GpgOL_Inspector_Verify")
           || !tagcmp (tag, "GpgOL_Inspector_Crypto_Info"))
    {
      LPDISPATCH inspector;

      message = get_message_from_button (instid, &inspector);
      if (message)
        {
          if (message_incoming_handler (message, hwnd, true))
            message_display_handler (message, inspector, hwnd);
          message->Release ();
        }
      if (inspector)
        {
          update_crypto_info (inspector);
          inspector->Release ();
        }
    }
  else if (!tagcmp (tag, "GpgOL_Inspector_Debug-0"))
    {
      log_debug ("%s:%s: command Debug0 (showInfo) called\n",
                 SRCNAME, __func__);
      message = get_message_from_button (instid, NULL);
      if (message)
        {
          message_show_info (message, hwnd);
          message->Release ();
        }
    }
  else if (!tagcmp (tag, "GpgOL_Inspector_Debug-1"))
    {
      log_debug ("%s:%s: command Debug1 (not used) called\n",
                 SRCNAME, __func__);
    }
  else if (!tagcmp (tag, "GpgOL_Inspector_Debug-2"))
    {
      log_debug ("%s:%s: command Debug2 (change message class) called", 
                 SRCNAME, __func__);
      message = get_message_from_button (instid, NULL);
      if (message)
        {
          /* We sync here. */
          mapi_change_message_class (message, 1);
          message->Release ();
        }
    }
  else if (!tagcmp (tag, "GpgOL_Inspector_Debug-3"))
    {
      log_debug ("%s:%s: command Debug3 (revert_message_class) called", 
                 SRCNAME, __func__);
      message = get_message_from_button (instid, NULL);
      if (message)
        {
          int rc = gpgol_message_revert (message, 1, 
                                         KEEP_OPEN_READWRITE|FORCE_SAVE);
          log_debug ("%s:%s: gpgol_message_revert returns %d\n", 
                     SRCNAME, __func__, rc);
          message->Release ();
        }
    }

}