[Gpa-commits] r890 - trunk/src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu May 8 14:08:55 CEST 2008


Author: marcus
Date: 2008-05-08 14:08:55 +0200 (Thu, 08 May 2008)
New Revision: 890

Modified:
   trunk/src/ChangeLog
   trunk/src/filesigndlg.c
Log:
2008-05-08  Marcus Brinkmann  <marcus at g10code.de>

	* filesigndlg.c (gpa_file_sign_dialog_set_force_sig_mode): Forcing
	affects visibility now instead of sensitivity.
	(gpa_file_sign_dialog_set_force_armor): Likewise.
	(gpa_file_sign_dialog_constructor): Allow sig mode frame to be
	hidden.  Don't hide armor based on UI expert level.  Never show
	the cleartext sig mode option.


Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2008-05-08 11:08:11 UTC (rev 889)
+++ trunk/src/ChangeLog	2008-05-08 12:08:55 UTC (rev 890)
@@ -1,5 +1,12 @@
 2008-05-08  Marcus Brinkmann  <marcus at g10code.de>
 
+	* filesigndlg.c (gpa_file_sign_dialog_set_force_sig_mode): Forcing
+	affects visibility now instead of sensitivity.
+	(gpa_file_sign_dialog_set_force_armor): Likewise.
+	(gpa_file_sign_dialog_constructor): Allow sig mode frame to be
+	hidden.  Don't hide armor based on UI expert level.  Never show
+	the cleartext sig mode option.
+
 	* filesigndlg.c (gpa_file_sign_dialog_constructor): Move signer
 	list before everything else, don't use borders with frames, fix
 	mnemonic conflict, replace vbox_mode with frame_mode.

Modified: trunk/src/filesigndlg.c
===================================================================
--- trunk/src/filesigndlg.c	2008-05-08 11:08:11 UTC (rev 889)
+++ trunk/src/filesigndlg.c	2008-05-08 12:08:55 UTC (rev 890)
@@ -217,12 +217,26 @@
     (GTK_RADIO_BUTTON (radio_sign_comp), _("Clear_text signature"));
   gtk_box_pack_start (GTK_BOX (vboxMode), radio_sign, FALSE, FALSE, 0);
   dialog->radio_sign = radio_sign;
+  /* FIXME: We hide the radio button here.  It still can be activated
+     invisibly by setting the "sig-mode" property.  This is used by
+     the clipboard code, which also hides the whole sig mode selection
+     frame, so no harm done.  For the file sign mode, hiding the
+     cleartext option is the right thing to do.  But eventually, all
+     this should be freely configurable by the caller, instead of
+     relying on such knowledge.  */
+  gtk_widget_set_no_show_all (radio_sign, TRUE);
+  gtk_widget_hide (radio_sign);
 
   radio_sign_sep =
     gtk_radio_button_new_with_mnemonic_from_widget
     (GTK_RADIO_BUTTON (radio_sign_comp), _("_Detached signature"));
   gtk_box_pack_start (GTK_BOX (vboxMode), radio_sign_sep, FALSE, FALSE, 0);
   dialog->radio_sep = radio_sign_sep;
+
+  /* Allow for the frameMode to be hidden despite what show_all
+     does.  */
+  gtk_widget_show_all (frameMode);
+  gtk_widget_set_no_show_all (frameMode, TRUE);
 			      
   checkerArmor = gtk_check_button_new_with_mnemonic (_("A_rmor"));
   gtk_box_pack_start (GTK_BOX (vboxSign), checkerArmor, FALSE, FALSE, 0);
@@ -231,11 +245,6 @@
   gtk_widget_set_no_show_all (checkerArmor, TRUE);
   dialog->check_armor = checkerArmor;
 
-  if (gpa_options_get_simplified_ui (gpa_options_get_instance ()))
-    gtk_widget_hide (dialog->check_armor);
-  else
-    gtk_widget_show (dialog->check_armor);
-
   return object;
 }
 
@@ -382,34 +391,15 @@
   if (force_armor == dialog->force_armor)
     return;
 
-  gtk_widget_set_sensitive (dialog->check_armor, ! force_armor);
+  if (force_armor)
+    gtk_widget_hide (dialog->check_armor);
+  else
+    gtk_widget_show (dialog->check_armor);
+
   dialog->force_armor = force_armor;
 }
 
 
-gboolean
-gpa_file_sign_dialog_get_force_sig_mode (GpaFileSignDialog *dialog)
-{
-  g_return_val_if_fail (GPA_IS_FILE_SIGN_DIALOG (dialog), FALSE);
-
-  return dialog->force_sig_mode;
-}
-
-
-void
-gpa_file_sign_dialog_set_force_sig_mode (GpaFileSignDialog *dialog,
-				      gboolean force_sig_mode)
-{
-  g_return_if_fail (GPA_IS_FILE_SIGN_DIALOG (dialog));
-  g_return_if_fail (dialog->frame_mode != NULL);
-
-  if (force_sig_mode == dialog->force_sig_mode)
-    return;
-
-  gtk_widget_set_sensitive (dialog->frame_mode, ! force_sig_mode);
-}
-
-
 gpgme_sig_mode_t 
 gpa_file_sign_dialog_get_sig_mode (GpaFileSignDialog *dialog)
 {
@@ -449,3 +439,29 @@
   if (button != NULL)
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
 }
+
+
+gboolean
+gpa_file_sign_dialog_get_force_sig_mode (GpaFileSignDialog *dialog)
+{
+  g_return_val_if_fail (GPA_IS_FILE_SIGN_DIALOG (dialog), FALSE);
+
+  return dialog->force_sig_mode;
+}
+
+
+void
+gpa_file_sign_dialog_set_force_sig_mode (GpaFileSignDialog *dialog,
+				      gboolean force_sig_mode)
+{
+  g_return_if_fail (GPA_IS_FILE_SIGN_DIALOG (dialog));
+  g_return_if_fail (dialog->frame_mode != NULL);
+
+  if (force_sig_mode == dialog->force_sig_mode)
+    return;
+
+  if (force_sig_mode)
+    gtk_widget_hide (dialog->frame_mode);
+  else
+    gtk_widget_show (dialog->frame_mode);
+}



More information about the Gpa-commits mailing list