From 129d8d9a5922eb3d4df9320418fb98dfbbadc053 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Tue, 5 Mar 2024 20:05:46 +0100 Subject: save previous search query to config and load on startup --- src/main.cpp | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index eb9cee4..306564d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,28 +7,14 @@ #include "search.h" #include "platform.h" #include "image.h" +#include "config.h" #include -// Search params. -utf8_int8_t path_buffer[MAX_INPUT_LENGTH]; -utf8_int8_t filter_buffer[MAX_INPUT_LENGTH]; -utf8_int8_t query_buffer[MAX_INPUT_LENGTH]; -int ts_thread_count = 4; -int max_file_size = 100; // in MBs - // Popups bool open_settings_window = false; bool open_about_window = false; -// Localization -int current_locale_index = 0; -int locales_count = 2; -char* locales[] = { - "English", - "Dutch" -}; - static void _ts_create_popups() { ImGuiIO& io = ImGui::GetIO(); if (open_settings_window) { @@ -45,8 +31,6 @@ static void _ts_create_popups() { ImGui::DragInt("File Size", &max_file_size, 50.0f, 1, 10000, "%dMB"); ImGui::SetItemTooltip("Files larger than this will not be searched"); - ImGui::Combo("Language", ¤t_locale_index, locales, locales_count); - ImGui::Dummy({0, 70}); ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f); if (ImGui::Button("Close")) { @@ -128,9 +112,7 @@ static int _ts_create_menu() { } void ts_init() { - snprintf(path_buffer, MAX_INPUT_LENGTH, "%s", "C:\\Users\\aldri\\Desktop\\Vault\\Projects\\allegro5"); - snprintf(filter_buffer, MAX_INPUT_LENGTH, "%s", "*.c,.h,.cpp"); - snprintf(query_buffer, MAX_INPUT_LENGTH, "%s", "test"); + // idk } int _tb_query_input_cb(ImGuiInputTextCallbackData* data) { -- cgit v1.2.3-70-g09d2