tv_rename/mainwindow.hpp

91 lines
2.1 KiB
C++
Raw Normal View History

2019-01-23 19:46:03 +00:00
#ifndef GTKMM_MAIN_WINDOW
#define GTKMM_MAIN_WINDOW
#include <gtkmm/button.h>
#include <gtkmm/checkbutton.h>
#include <gtkmm/combobox.h>
#include <gtkmm/entry.h>
#include <gtkmm/label.h>
2019-02-04 16:39:48 +00:00
#include <gtkmm/layout.h>
2019-01-23 19:46:03 +00:00
#include <gtkmm/window.h>
#include <set>
#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-01-23 19:46:03 +00:00
virtual ~MainWindow() = default;
private:
void quit();
void process();
void getNames();
void finishedSelection();
void chooseFile();
void patternHelp();
protected:
Gtk::Button m_button_dir;
Gtk::Button m_button_get_names;
Gtk::Button m_button_quit;
Gtk::Button m_button_process;
Gtk::Button m_button_pattern;
Gtk::CheckButton m_check_linux;
Gtk::CheckButton m_check_trust;
Gtk::ComboBox m_combo_language;
Gtk::ComboBox m_combo_possible;
Gtk::Entry m_entry_show;
Gtk::Entry m_entry_dir;
Gtk::Entry m_entry_pattern;
Gtk::Label m_label_language;
Gtk::Label m_label_possible;
Gtk::Label m_label_show;
Gtk::Label m_label_dir;
Gtk::Label m_label_pattern;
Gtk::Layout m_layout;
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
SeasonWindow *sw;
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