tv_rename/databasewindow.hpp
2019-07-12 23:10:40 +02:00

63 lines
1.6 KiB
C++

#ifndef GTKMM_DATABASE_WINDOW
#define GTKMM_DATABASE_WINDOW
#include <gtkmm/button.h>
#include <gtkmm/entry.h>
#include <gtkmm/label.h>
#include <gtkmm/layout.h>
#include <gtkmm/liststore.h>
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/treeview.h>
#include <gtkmm/window.h>
#include <set>
#include <unordered_set>
#include <iostream>
#include "network.hpp"
#include "seasonwindow.hpp"
class DatabaseWindow : public Gtk::Window {
public:
DatabaseWindow() = delete;
DatabaseWindow( bool _linux, Curl &_c);
virtual ~DatabaseWindow();
private:
void save();
void remove();
void changed( const Gtk::TreeModel::Path &/*UNUSED*/, const Gtk::TreeModel::iterator &row );
std::unordered_set< size_t > changed_rows;
protected:
Gtk::Button *m_button_save = new Gtk::Button();
Gtk::Button *m_button_remove = new Gtk::Button();
Gtk::TreeView *m_tree_database = new Gtk::TreeView();
Gtk::ScrolledWindow *m_scrolled_window = new Gtk::ScrolledWindow();
class DatabaseColumns : public Gtk::TreeModel::ColumnRecord {
public:
DatabaseColumns() {
add(m_col_id);
add(m_col_show);
add(m_col_path);
add(m_col_lang);
add(m_col_url);
}
Gtk::TreeModelColumn< size_t > m_col_id;
Gtk::TreeModelColumn< std::string > m_col_show;
Gtk::TreeModelColumn< std::string > m_col_path;
Gtk::TreeModelColumn< std::string > m_col_lang;
Gtk::TreeModelColumn< std::string > m_col_url;
};
DatabaseColumns m_columns_database;
Glib::RefPtr< Gtk::ListStore > m_model;
Curl &c;
bool linux;
};
#endif // GTKMM_MAIN_WINDOW