summaryrefslogtreecommitdiff
path: root/src/ui/util.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-11-08 14:41:07 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-11-08 14:41:07 +0200
commitc4b66eac507cba69963397c287a4afe6e34a3162 (patch)
treeb436d3bc9b5e4146aeb1ae0e62cbd197fac19123 /src/ui/util.c
parentd417d6c53449db1cf3cd95e01389fc51616190aa (diff)
Revised identity creation dialog
Make it clear what "temporary" means, and put all the mandatory fields at the top.
Diffstat (limited to 'src/ui/util.c')
-rw-r--r--src/ui/util.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/ui/util.c b/src/ui/util.c
index e65e089d..ec0d904d 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -1216,8 +1216,25 @@ iWidget *makeIdentityCreation_Widget(void) {
1216 iWidget *values = addChildFlags_Widget( 1216 iWidget *values = addChildFlags_Widget(
1217 page, iClob(new_Widget()), arrangeVertical_WidgetFlag | arrangeSize_WidgetFlag); 1217 page, iClob(new_Widget()), arrangeVertical_WidgetFlag | arrangeSize_WidgetFlag);
1218 iInputWidget *inputs[6]; 1218 iInputWidget *inputs[6];
1219 addChild_Widget(headings, iClob(makeHeading_Widget("Valid until:")));
1220 setId_Widget(addChild_Widget(values, iClob(newHint_InputWidget(19, "YYYY-MM-DD HH:MM:SS"))), "ident.until");
1219 addChild_Widget(headings, iClob(makeHeading_Widget("Common name:"))); 1221 addChild_Widget(headings, iClob(makeHeading_Widget("Common name:")));
1220 setId_Widget(addChild_Widget(values, iClob(inputs[0] = new_InputWidget(0))), "ident.common"); 1222 setId_Widget(addChild_Widget(values, iClob(inputs[0] = new_InputWidget(0))), "ident.common");
1223 /* Temporary? */ {
1224 addChild_Widget(headings, iClob(makeHeading_Widget("Temporary:")));
1225 iWidget *tmpGroup = new_Widget();
1226 setFlags_Widget(tmpGroup, arrangeSize_WidgetFlag | arrangeHorizontal_WidgetFlag, iTrue);
1227 addChild_Widget(tmpGroup, iClob(makeToggle_Widget("ident.temp")));
1228 setId_Widget(
1229 addChildFlags_Widget(
1230 tmpGroup,
1231 iClob(new_LabelWidget(uiTextCaution_ColorEscape "\u26a0 not saved to disk", NULL)),
1232 hidden_WidgetFlag),
1233 "ident.temp.note");
1234 addChild_Widget(values, iClob(tmpGroup));
1235 }
1236 addChild_Widget(headings, iClob(makePadding_Widget(gap_UI)));
1237 addChild_Widget(values, iClob(makePadding_Widget(gap_UI)));
1221 addChild_Widget(headings, iClob(makeHeading_Widget("Email:"))); 1238 addChild_Widget(headings, iClob(makeHeading_Widget("Email:")));
1222 setId_Widget(addChild_Widget(values, iClob(inputs[1] = newHint_InputWidget(0, "optional"))), "ident.email"); 1239 setId_Widget(addChild_Widget(values, iClob(inputs[1] = newHint_InputWidget(0, "optional"))), "ident.email");
1223 addChild_Widget(headings, iClob(makeHeading_Widget("User ID:"))); 1240 addChild_Widget(headings, iClob(makeHeading_Widget("User ID:")));
@@ -1228,10 +1245,6 @@ iWidget *makeIdentityCreation_Widget(void) {
1228 setId_Widget(addChild_Widget(values, iClob(inputs[4] = newHint_InputWidget(0, "optional"))), "ident.org"); 1245 setId_Widget(addChild_Widget(values, iClob(inputs[4] = newHint_InputWidget(0, "optional"))), "ident.org");
1229 addChild_Widget(headings, iClob(makeHeading_Widget("Country:"))); 1246 addChild_Widget(headings, iClob(makeHeading_Widget("Country:")));
1230 setId_Widget(addChild_Widget(values, iClob(inputs[5] = newHint_InputWidget(0, "optional"))), "ident.country"); 1247 setId_Widget(addChild_Widget(values, iClob(inputs[5] = newHint_InputWidget(0, "optional"))), "ident.country");
1231 addChild_Widget(headings, iClob(makeHeading_Widget("Valid until:")));
1232 setId_Widget(addChild_Widget(values, iClob(newHint_InputWidget(19, "YYYY-MM-DD HH:MM:SS"))), "ident.until");
1233 addChild_Widget(headings, iClob(makeHeading_Widget("Temporary:")));
1234 addChild_Widget(values, iClob(makeToggle_Widget("ident.temp")));
1235 arrange_Widget(dlg); 1248 arrange_Widget(dlg);
1236 for (size_t i = 0; i < iElemCount(inputs); ++i) { 1249 for (size_t i = 0; i < iElemCount(inputs); ++i) {
1237 as_Widget(inputs[i])->rect.size.x = 100 * gap_UI - headings->rect.size.x; 1250 as_Widget(inputs[i])->rect.size.x = 100 * gap_UI - headings->rect.size.x;