2019-01-23 19:46:03 +00:00
|
|
|
#ifndef GTKMM_MAIN_WINDOW
|
|
|
|
#define GTKMM_MAIN_WINDOW
|
|
|
|
|
2019-07-12 21:10:40 +00:00
|
|
|
#include <gtkmm/box.h>
|
2019-01-23 19:46:03 +00:00
|
|
|
#include <gtkmm/button.h>
|
|
|
|
#include <gtkmm/checkbutton.h>
|
|
|
|
#include <gtkmm/combobox.h>
|
2019-07-12 21:10:40 +00:00
|
|
|
#include <gtkmm/container.h>
|
2019-01-23 19:46:03 +00:00
|
|
|
#include <gtkmm/entry.h>
|
|
|
|
#include <gtkmm/label.h>
|
2019-02-04 16:39:48 +00:00
|
|
|
#include <gtkmm/layout.h>
|
2019-07-12 21:10:40 +00:00
|
|
|
#include <gtkmm/menubar.h>
|
|
|
|
#include <gtkmm/menuitem.h>
|
2019-01-23 19:46:03 +00:00
|
|
|
#include <gtkmm/window.h>
|
|
|
|
#include <set>
|
2019-07-12 21:10:40 +00:00
|
|
|
#include <iostream>
|
2019-01-23 19:46:03 +00:00
|
|
|
|
|
|
|
#include "network.hpp"
|
|
|
|
#include "seasonwindow.hpp"
|
|
|
|
|
|
|
|
class MainWindow : public Gtk::Window {
|
|
|
|
public:
|
2019-02-04 16:39:48 +00:00
|
|
|
MainWindow( const Glib::RefPtr< Gtk::Application > &ptr );
|
2019-07-12 21:10:40 +00:00
|
|
|
virtual ~MainWindow();
|
2019-01-23 19:46:03 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void quit();
|
|
|
|
void process();
|
|
|
|
void getNames();
|
|
|
|
void finishedSelection();
|
|
|
|
void chooseFile();
|
|
|
|
void patternHelp();
|
2019-07-12 21:10:40 +00:00
|
|
|
void dbUpdate();
|
|
|
|
void dbClean();
|
|
|
|
void dbRefresh();
|
|
|
|
void dbAdd();
|
|
|
|
void dbManage();
|
2019-01-23 19:46:03 +00:00
|
|
|
|
|
|
|
protected:
|
2019-07-12 21:10:40 +00:00
|
|
|
Gtk::Button *m_button_dir = new Gtk::Button();
|
|
|
|
Gtk::Button *m_button_rename = new Gtk::Button();
|
|
|
|
Gtk::Button *m_button_db_add = new Gtk::Button();
|
|
|
|
Gtk::Button *m_button_quit = new Gtk::Button();
|
|
|
|
Gtk::Button *m_button_process = new Gtk::Button();
|
|
|
|
Gtk::Button *m_button_pattern = new Gtk::Button();
|
2019-01-23 19:46:03 +00:00
|
|
|
|
2019-07-12 21:10:40 +00:00
|
|
|
Gtk::CheckButton *m_check_linux = new Gtk::CheckButton();
|
|
|
|
Gtk::CheckButton *m_check_trust = new Gtk::CheckButton();
|
2019-01-23 19:46:03 +00:00
|
|
|
|
2019-07-12 21:10:40 +00:00
|
|
|
Gtk::ComboBox *m_combo_language = new Gtk::ComboBox();
|
|
|
|
Gtk::ComboBox *m_combo_possible = new Gtk::ComboBox();
|
2019-01-23 19:46:03 +00:00
|
|
|
|
2019-07-12 21:10:40 +00:00
|
|
|
Gtk::Entry *m_entry_show = new Gtk::Entry();
|
|
|
|
Gtk::Entry *m_entry_dir = new Gtk::Entry();
|
|
|
|
Gtk::Entry *m_entry_pattern = new Gtk::Entry();
|
2019-01-23 19:46:03 +00:00
|
|
|
|
2019-07-12 21:10:40 +00:00
|
|
|
Gtk::Label *m_label_language = new Gtk::Label();
|
|
|
|
Gtk::Label *m_label_possible = new Gtk::Label();
|
|
|
|
Gtk::Label *m_label_show = new Gtk::Label();
|
|
|
|
Gtk::Label *m_label_dir = new Gtk::Label();
|
|
|
|
Gtk::Label *m_label_pattern = new Gtk::Label();
|
2019-01-23 19:46:03 +00:00
|
|
|
|
|
|
|
Curl c;
|
|
|
|
|
|
|
|
class LanguageColumns : public Gtk::TreeModel::ColumnRecord {
|
|
|
|
public:
|
|
|
|
LanguageColumns() {
|
2019-02-04 16:39:48 +00:00
|
|
|
add( m_col_code );
|
|
|
|
add( m_col_language );
|
2019-01-23 19:46:03 +00:00
|
|
|
}
|
2019-02-04 16:39:48 +00:00
|
|
|
Gtk::TreeModelColumn< std::string > m_col_code;
|
|
|
|
Gtk::TreeModelColumn< std::string > m_col_language;
|
2019-01-23 19:46:03 +00:00
|
|
|
};
|
|
|
|
|
2019-02-04 16:39:48 +00:00
|
|
|
class UrlColumns : public Gtk::TreeModel::ColumnRecord {
|
2019-01-23 19:46:03 +00:00
|
|
|
public:
|
|
|
|
UrlColumns() {
|
2019-02-04 16:39:48 +00:00
|
|
|
add( m_col_url );
|
|
|
|
add( m_col_show );
|
2019-01-23 19:46:03 +00:00
|
|
|
}
|
2019-02-04 16:39:48 +00:00
|
|
|
Gtk::TreeModelColumn< Glib::ustring > m_col_url;
|
|
|
|
Gtk::TreeModelColumn< Glib::ustring > m_col_show;
|
2019-01-23 19:46:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
LanguageColumns m_columns_language;
|
|
|
|
UrlColumns m_columns_url;
|
|
|
|
|
2019-02-04 16:39:48 +00:00
|
|
|
Glib::RefPtr< Gtk::Application > app;
|
2019-01-23 19:46:03 +00:00
|
|
|
|
2019-07-12 21:10:40 +00:00
|
|
|
std::unique_ptr<SeasonWindow> sw{nullptr};
|
2019-02-04 16:39:48 +00:00
|
|
|
std::vector< int > selected;
|
|
|
|
std::map< int, std::set< std::string > > files;
|
2019-01-23 19:46:03 +00:00
|
|
|
std::string path;
|
|
|
|
std::string language_code;
|
|
|
|
std::string default_pattern;
|
|
|
|
};
|
|
|
|
|
2019-02-04 16:39:48 +00:00
|
|
|
#endif // GTKMM_MAIN_WINDOW
|