some ui stuff
This commit is contained in:
18
config.h
18
config.h
@@ -118,11 +118,11 @@ static const char size_unit[] = { 'B', 'K', 'M', 'G', 'T', 'P' }; /* this define
|
||||
|
||||
static const char ui_btm_text_storage_left[] = "total free";
|
||||
static const char ui_btm_current_dir_size[] = "sum of dir,";
|
||||
static const char ui_open_with_text_0[] = "open"; /*ui_open_with_text_0 \"selected_file\" ui_open_with_text_1*/
|
||||
static const char ui_open_with_text_1[] = "with:";
|
||||
static const char ui_rename_text_0[] = "rename"; /*ui_rename_text_0 \"selected_file\" ui_rename_text_1*/
|
||||
static const char ui_rename_text_1[] = "to:";
|
||||
static const char ui_delete_text[] = "delete:";
|
||||
static const char ui_open_with_text[] = "open "SETTINGS_COMMAND_REPLACE_STR" with:";
|
||||
static const char ui_rename_text[] = "rename "SETTINGS_COMMAND_REPLACE_STR" to:";
|
||||
static const char ui_mkdir_text[] = "mkdir:";
|
||||
static const char ui_touch_text[] = "touch:";
|
||||
static const char ui_delete_text[] = "delete: "SETTINGS_COMMAND_REPLACE_STR;
|
||||
|
||||
/* {{{ */
|
||||
static const unsigned long binding_count = sizeof(key_binding) / sizeof(binding);
|
||||
@@ -139,10 +139,10 @@ static const unsigned long mimetype_default_count;
|
||||
static const unsigned long file_extension_default_count;
|
||||
static const char size_unit[];
|
||||
static const char size_unit_count;
|
||||
static const char ui_open_with_text_0[];
|
||||
static const char ui_open_with_text_1[];
|
||||
static const char ui_rename_text_0[];
|
||||
static const char ui_rename_text_1[];
|
||||
static const char ui_open_with_text[];
|
||||
static const char ui_rename_text[];
|
||||
static const char ui_mkdir_text[];
|
||||
static const char ui_touch_text[];
|
||||
static const char ui_delete_text[];
|
||||
#endif
|
||||
/* }}} */
|
||||
|
||||
@@ -133,7 +133,7 @@ int read_string(WINDOW *win, int y, int x, char *str){
|
||||
} else if (ch == 127) { /* backspace */
|
||||
if (pass > 0) {
|
||||
pass--;
|
||||
mvwdelch(win, y, pass);
|
||||
mvwdelch(win, y, x + pass);
|
||||
}
|
||||
} else if (ch == 27) { /* esc key */
|
||||
err = 1;
|
||||
@@ -293,7 +293,8 @@ void makedir(){
|
||||
wclear(win_b);
|
||||
file tmp;
|
||||
tmp.file_name = malloc(INPUT_BUFFER_SIZE);
|
||||
if (read_string(win_b, 0, 0, tmp.file_name) == 0) {
|
||||
mvwprintw(win_b, 0, 0, ui_mkdir_text);
|
||||
if (read_string(win_b, 0, strlen(ui_mkdir_text)+1, tmp.file_name) == 0) {
|
||||
char *cmd = parse_cmd("mkdir ", &tmp);
|
||||
system(cmd);
|
||||
free(cmd);
|
||||
@@ -305,7 +306,8 @@ void makefile(){
|
||||
wclear(win_b);
|
||||
file tmp;
|
||||
tmp.file_name = malloc(INPUT_BUFFER_SIZE);
|
||||
if (read_string(win_b, 0, 0, tmp.file_name) == 0) {
|
||||
mvwprintw(win_b, 0, 0, ui_touch_text);
|
||||
if (read_string(win_b, 0, strlen(ui_touch_text)+1, tmp.file_name) == 0) {
|
||||
char *cmd = parse_cmd("touch ", &tmp);
|
||||
system(cmd);
|
||||
free(cmd);
|
||||
|
||||
Reference in New Issue
Block a user