Compare commits

..

No commits in common. "eaf6f44464118238317bf04d7e3d9a601c94f985" and "ff9303861a0e24c3b96af4c3e64fb598b8b57f86" have entirely different histories.

6 changed files with 65 additions and 81 deletions

View File

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

View File

@ -1,4 +1,3 @@
#include "strings.h"
#include <ncurses.h>
#include <string>
@ -13,7 +12,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,
const char *string, chtype color);
std::string spawncmd(const std::string prompt = loc_strings->command);
std::string spawncmd();
void async_clock_init();

View File

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

View File

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

View File

@ -74,9 +74,7 @@ I request the Police of the Czech Republic to:
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.*
)",
.command = "Command",
.invalid_input = "Invalid input"};
)"};
constexpr strings czech_strings{
.invalid_option = "Neplatná volba: ",
@ -150,8 +148,6 @@ Dne {9} v místě {10}.
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.*
)",
.command = "Příkaz",
.invalid_input = "Neplatný vstup"};
)"};
const strings *loc_strings;

View File

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