diff options
Diffstat (limited to 'src/ui/util.c')
-rw-r--r-- | src/ui/util.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/ui/util.c b/src/ui/util.c index c626759a..d8a66bab 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -1442,3 +1442,58 @@ iWidget *makeIdentityCreation_Widget(void) { | |||
1442 | centerSheet_Widget(dlg); | 1442 | centerSheet_Widget(dlg); |
1443 | return dlg; | 1443 | return dlg; |
1444 | } | 1444 | } |
1445 | |||
1446 | iWidget *makeCertificateImport_Widget(void) { | ||
1447 | iWidget *dlg = makeSheet_Widget("certimport"); | ||
1448 | setId_Widget( | ||
1449 | addChildFlags_Widget(dlg, | ||
1450 | iClob(new_LabelWidget(uiHeading_ColorEscape "IMPORT CERTIFICATE", NULL)), | ||
1451 | frameless_WidgetFlag), | ||
1452 | "certimport.heading"); | ||
1453 | addAction_Widget(dlg, SDLK_v, KMOD_PRIMARY, "certimport.paste"); | ||
1454 | addChild_Widget(dlg, iClob(makePadding_Widget(gap_UI))); | ||
1455 | iLabelWidget *crt = new_LabelWidget("No Certificate", NULL); | ||
1456 | setFont_LabelWidget(crt, uiContent_FontId); | ||
1457 | addChildFlags_Widget(dlg, iClob(crt), 0); | ||
1458 | setFrameColor_Widget(as_Widget(crt), uiTextDim_ColorId); | ||
1459 | iLabelWidget *key = new_LabelWidget("No Private Key", NULL); | ||
1460 | setFont_LabelWidget(key, uiContent_FontId); | ||
1461 | addChild_Widget(dlg, iClob(makePadding_Widget(gap_UI))); | ||
1462 | addChildFlags_Widget(dlg, iClob(key), 0); | ||
1463 | setFrameColor_Widget(as_Widget(key), uiTextDim_ColorId); | ||
1464 | addChild_Widget(dlg, iClob(makePadding_Widget(gap_UI))); | ||
1465 | iWidget *page = new_Widget(); { | ||
1466 | setFlags_Widget(page, arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag, iTrue); | ||
1467 | iWidget *headings = addChildFlags_Widget( | ||
1468 | page, iClob(new_Widget()), arrangeVertical_WidgetFlag | arrangeSize_WidgetFlag); | ||
1469 | iWidget *values = addChildFlags_Widget( | ||
1470 | page, iClob(new_Widget()), arrangeVertical_WidgetFlag | arrangeSize_WidgetFlag); | ||
1471 | addChild_Widget(headings, iClob(makeHeading_Widget("Save as:"))); | ||
1472 | void *inputs[2]; | ||
1473 | addChild_Widget(values, iClob(inputs[0] = new_InputWidget(0))); | ||
1474 | setHint_InputWidget(inputs[0], "filename (no extension)"); | ||
1475 | addChild_Widget(headings, iClob(makeHeading_Widget("Notes:"))); | ||
1476 | addChild_Widget(values, iClob(inputs[1] = new_InputWidget(0))); | ||
1477 | setHint_InputWidget(inputs[1], "e.g., site name"); | ||
1478 | as_Widget(inputs[0])->rect.size.x = gap_UI * 60; | ||
1479 | as_Widget(inputs[1])->rect.size.x = gap_UI * 60; | ||
1480 | } | ||
1481 | addChild_Widget(dlg, iClob(page)); | ||
1482 | arrange_Widget(dlg); | ||
1483 | setSize_Widget(as_Widget(crt), init_I2(width_Widget(dlg), gap_UI * 15)); | ||
1484 | setSize_Widget(as_Widget(key), init_I2(width_Widget(dlg), gap_UI * 15)); | ||
1485 | /* Buttons. */ | ||
1486 | iWidget *div = new_Widget(); { | ||
1487 | setFlags_Widget(div, arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag, iTrue); | ||
1488 | addChild_Widget(div, iClob(newKeyMods_LabelWidget("Cancel", SDLK_ESCAPE, 0, "cancel"))); | ||
1489 | iLabelWidget *accept = addChild_Widget( | ||
1490 | div, | ||
1491 | iClob(newKeyMods_LabelWidget( | ||
1492 | uiTextAction_ColorEscape "Import", SDLK_RETURN, KMOD_PRIMARY, "certimport.accept"))); | ||
1493 | setFont_LabelWidget(accept, uiLabelBold_FontId); | ||
1494 | } | ||
1495 | addChild_Widget(dlg, iClob(div)); | ||
1496 | addChild_Widget(get_Window()->root, iClob(dlg)); | ||
1497 | centerSheet_Widget(dlg); | ||
1498 | return dlg; | ||
1499 | } | ||