<commit_before>#include "dialogs.h"
#include "singletons.h"
#include <gtkmm.h>
#include <vector>
#include "juci.h"
#include <iostream>

std::string open_dialog(const std::string &title,
                        const std::vector<std::pair<std::string, Gtk::ResponseType>> &buttons,
                        Gtk::FileChooserAction gtk_options,
                        const std::string &file_name = "") {
  Gtk::FileChooserDialog dialog(title, gtk_options);
  if(!Singleton::directories->current_path.empty())
    gtk_file_chooser_set_current_folder((GtkFileChooser*)dialog.gobj(), Singleton::directories->current_path.string().c_str());
  else
    gtk_file_chooser_set_current_folder((GtkFileChooser*)dialog.gobj(), boost::filesystem::current_path().string().c_str());
  if (!file_name.empty())
    gtk_file_chooser_set_filename((GtkFileChooser*)dialog.gobj(), file_name.c_str());
  dialog.set_position(Gtk::WindowPosition::WIN_POS_CENTER_ALWAYS);
  
  auto g_application=g_application_get_default(); //TODO: Post issue that Gio::Application::get_default should return pointer and not Glib::RefPtr
  auto gio_application=Glib::wrap(g_application, true);
  auto application=Glib::RefPtr<Application>::cast_static(gio_application);
  dialog.set_transient_for(*application->window);<commit_msg>Forgot to remove iostream include.<commit_after>#include "dialogs.h"
#include "singletons.h"
#include <gtkmm.h>
#include <vector>
#include "juci.h"

std::string open_dialog(const std::string &title,
                        const std::vector<std::pair<std::string, Gtk::ResponseType>> &buttons,
                        Gtk::FileChooserAction gtk_options,
                        const std::string &file_name = "") {
  Gtk::FileChooserDialog dialog(title, gtk_options);
  if(!Singleton::directories->current_path.empty())
    gtk_file_chooser_set_current_folder((GtkFileChooser*)dialog.gobj(), Singleton::directories->current_path.string().c_str());
  else
    gtk_file_chooser_set_current_folder((GtkFileChooser*)dialog.gobj(), boost::filesystem::current_path().string().c_str());
  if (!file_name.empty())
    gtk_file_chooser_set_filename((GtkFileChooser*)dialog.gobj(), file_name.c_str());
  dialog.set_position(Gtk::WindowPosition::WIN_POS_CENTER_ALWAYS);
  
  auto g_application=g_application_get_default(); //TODO: Post issue that Gio::Application::get_default should return pointer and not Glib::RefPtr
  auto gio_application=Glib::wrap(g_application, true);
  auto application=Glib::RefPtr<Application>::cast_static(gio_application);
  dialog.set_transient_for(*application->window);
{'fraction_non_alphanumeric': 0.13881349360217138, 'fraction_numerical': 0.0, 'mean_word_length': 5.825396825396825, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2524155', 'n_tokens_mistral': 841, 'n_tokens_neox': 813, 'n_words': 117}