aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/UefiShellUfmCommandLib/actions.c34
-rw-r--r--Library/UefiShellUfmCommandLib/actions.h1
2 files changed, 35 insertions, 0 deletions
diff --git a/Library/UefiShellUfmCommandLib/actions.c b/Library/UefiShellUfmCommandLib/actions.c
index ac869e6..174eb3e 100644
--- a/Library/UefiShellUfmCommandLib/actions.c
+++ b/Library/UefiShellUfmCommandLib/actions.c
@@ -9,8 +9,10 @@
#include "menu-bar.h"
#include "command-bar.h"
+#include "dialog-box.h"
#include "panel.h"
#include "filemanager.h"
+#include "cmds.h"
#include "actions.h"
#define MENUBAR (fm_ctx.menubar)
@@ -19,6 +21,9 @@
#define LEFT_PANEL (fm_ctx.left)
#define RIGHT_PANEL (fm_ctx.right)
+STATIC CONST CHAR16 mkdir_title[] = L" Create a new directory ";
+STATIC CONST CHAR16 mkdir_label[] = L"Enter directory name:";
+
STATIC EFI_STATUS shell_exec2(CONST CHAR16 *farg,
CONST CHAR16 *sarg, EFI_STATUS *cmd_status)
{
@@ -118,6 +123,35 @@ BOOLEAN hexedit(VOID)
return TRUE;
}
+BOOLEAN mkdir(VOID)
+{
+ struct dbox_ctx *dbox;
+ UINTN line = PANEL->curline;
+ EFI_STATUS status;
+ BOOLEAN status_op;
+
+ if(!PANEL->cwd)
+ return FALSE;
+
+ dbox = dbox_alloc(fm_ctx.scr, mkdir_title, mkdir_label, TRUE, L"");
+ if(!dbox)
+ return FALSE;
+
+ dbox_refresh(dbox);
+ status_op = dbox_handle(dbox);
+ if(status_op) {
+ status = make_directory(dbox->in->buffer);
+ if(status == EFI_SUCCESS) {
+ panel_cd_to(PANEL, PANEL->cwd);
+ panel_move_cursor(PANEL, line);
+ }
+ }
+
+ redraw();
+ dbox_release(dbox);
+ return TRUE;
+}
+
BOOLEAN show_filesystems(VOID)
{
return panel_cd_to(PANEL, NULL);
diff --git a/Library/UefiShellUfmCommandLib/actions.h b/Library/UefiShellUfmCommandLib/actions.h
index c6a7031..57e967c 100644
--- a/Library/UefiShellUfmCommandLib/actions.h
+++ b/Library/UefiShellUfmCommandLib/actions.h
@@ -24,6 +24,7 @@ BOOLEAN execute(VOID);
BOOLEAN mark(VOID);
BOOLEAN edit(VOID);
BOOLEAN hexedit(VOID);
+BOOLEAN mkdir(VOID);
BOOLEAN show_filesystems(VOID);
BOOLEAN do_nothing(VOID);
BOOLEAN quit(VOID);