Compare commits

...

2 Commits

Author SHA1 Message Date
eaf6f44464 fix typo
All checks were successful
build_test / build (push) Successful in 6m14s
2025-05-28 15:16:18 +02:00
0a07589e0e preparation for file integration 2025-05-28 15:15:32 +02:00
6 changed files with 81 additions and 65 deletions

View File

@ -1,5 +1,6 @@
#include "gameske_funkce.h" #include "gameske_funkce.h"
#include "memory.h" #include "memory.h"
#include "strings.h"
#include <chrono> #include <chrono>
#include <clocale> #include <clocale>
#include <cstddef> #include <cstddef>
@ -104,7 +105,7 @@ void print_in_middle(WINDOW *win, int starty, int startx, int width,
refresh(); refresh();
} }
std::string spawncmd() { std::string spawncmd(const std::string prompt) {
char cmd[100] = {0}; char cmd[100] = {0};
int pos = 0; int pos = 0;
int ch; int ch;
@ -115,7 +116,7 @@ std::string spawncmd() {
keypad(cmd_win, TRUE); keypad(cmd_win, TRUE);
box(cmd_win, 0, 0); box(cmd_win, 0, 0);
mvwprintw(cmd_win, 1, 1, "Command: "); mvwprintw(cmd_win, 1, 1, "%s: ", prompt.c_str());
curs_set(1); curs_set(1);
wrefresh(cmd_win); wrefresh(cmd_win);

View File

@ -1,3 +1,4 @@
#include "strings.h"
#include <ncurses.h> #include <ncurses.h>
#include <string> #include <string>
@ -12,7 +13,7 @@ size_t spawn_menu(uint16_t begin_y, uint16_t begin_x, const char **choices,
void print_in_middle(WINDOW *win, int starty, int startx, int width, void print_in_middle(WINDOW *win, int starty, int startx, int width,
const char *string, chtype color); const char *string, chtype color);
std::string spawncmd(); std::string spawncmd(const std::string prompt = loc_strings->command);
void async_clock_init(); void async_clock_init();

View File

@ -1,11 +1,3 @@
#include <curses.h>
#include <menu.h>
#include <ncurses.h>
#include <cstdint>
#include <cstring>
#include <filesystem>
#include <iostream>
#include <vector>
#include "const.h" #include "const.h"
#include "cups.h" #include "cups.h"
#include "editor_easy.h" #include "editor_easy.h"
@ -13,6 +5,15 @@
#include "memory.h" #include "memory.h"
#include "strings.h" #include "strings.h"
#include "types.h" #include "types.h"
#include <cstdint>
#include <cstring>
#include <curses.h>
#include <filesystem>
#include <iostream>
#include <menu.h>
#include <ncurses.h>
#include <string>
#include <vector>
std::vector<allocation> main_menu_allocated; std::vector<allocation> main_menu_allocated;
#define COMPLAINTS_DIR "complaints" #define COMPLAINTS_DIR "complaints"
@ -113,12 +114,19 @@ void menu() {
current_allocated = &main_menu_allocated; current_allocated = &main_menu_allocated;
break; break;
case "easy_edit"_sh: case "easy_edit"_sh:
case "ee"_sh: case "ee"_sh: {
std::clog << vytvorTrestniOznameni(); std::string name = spawncmd("Reference Name");
break; if (name == "") {
default:
print_in_middle(main_menu.win, 10, 0, 40, print_in_middle(main_menu.win, 10, 0, 40,
loc_strings->unknown_command, COLOR_PAIR(1)); loc_strings->unknown_command, COLOR_PAIR(1));
}
std::clog << vytvorTrestniOznameni();
break;
}
default:
print_in_middle(main_menu.win, 10, 0, 40, loc_strings->unknown_command,
COLOR_PAIR(1));
break; break;
} }
} }

View File

@ -1,7 +1,7 @@
#include <curses.h>
#include <csignal>
#include <iostream>
#include "memory.h" #include "memory.h"
#include <csignal>
#include <curses.h>
#include <iostream>
void safe_exit(int code) { void safe_exit(int code) {
switch (code) { switch (code) {
case SIGTERM: case SIGTERM:
@ -18,7 +18,7 @@ void safe_exit(int code) {
break; break;
case SIGSEGV: case SIGSEGV:
std::cerr << "\nreceived SIGSEGV(segmentaiton fault) exiting...\nIf this " std::cerr << "\nreceived SIGSEGV(segmentation fault) exiting...\nIf this "
"repeats please report it as a bug\n"; "repeats please report it as a bug\n";
break; break;

View File

@ -74,7 +74,9 @@ I request the Police of the Czech Republic to:
Signature of the complainant: {0} Signature of the complainant: {0}
*This is not a legal document, but only a template for informational purposes. For legal advice, please consult a qualified attorney.* *This is not a legal document, but only a template for informational purposes. For legal advice, please consult a qualified attorney.*
)"}; )",
.command = "Command",
.invalid_input = "Invalid input"};
constexpr strings czech_strings{ constexpr strings czech_strings{
.invalid_option = "Neplatná volba: ", .invalid_option = "Neplatná volba: ",
@ -148,6 +150,8 @@ Dne {9} v místě {10}.
Podpis oznamovatele: {0} Podpis oznamovatele: {0}
*Toto není právní dokument, ale pouze vzor pro informativní účely. Pro právní poradenství se obraťte na kvalifikovaného právníka.* *Toto není právní dokument, ale pouze vzor pro informativní účely. Pro právní poradenství se obraťte na kvalifikovaného právníka.*
)"}; )",
.command = "Příkaz",
.invalid_input = "Neplatný vstup"};
const strings *loc_strings; const strings *loc_strings;

View File

@ -34,6 +34,8 @@ typedef struct {
const char *enter_all_information_and_press_f10; const char *enter_all_information_and_press_f10;
const char *criminal_complaint_template; const char *criminal_complaint_template;
const char *command;
const char *invalid_input;
} strings; } strings;
extern const strings english_strings; extern const strings english_strings;