tv_rename/databasewindow.hpp

57 lines
1.6 KiB
C++
Raw Normal View History

2019-07-12 21:10:40 +00:00
#ifndef GTKMM_DATABASE_WINDOW
#define GTKMM_DATABASE_WINDOW
#include <gtkmm/liststore.h>
#include <gtkmm/treeview.h>
#include <gtkmm/window.h>
#include <unordered_set>
class DatabaseWindow : public Gtk::Window {
public:
DatabaseWindow() = delete;
DatabaseWindow( bool _linux, Glib::RefPtr< Gtk::Application > _app );
2019-07-12 21:10:40 +00:00
virtual ~DatabaseWindow();
private:
void save();
void remove();
void changed( const Gtk::TreeModel::Path & /*UNUSED*/,
const Gtk::TreeModel::iterator &row );
void quit();
void errorPath( const std::string &path );
void errorID( const std::string &show_id );
void errorLanguage( const std::string &lang );
2019-07-12 21:10:40 +00:00
std::unordered_set< size_t > changed_rows;
protected:
Gtk::TreeView *m_tree_database = new Gtk::TreeView();
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_show_id );
add( m_col_dvd );
2019-07-12 21:10:40 +00:00
}
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;
2020-01-16 10:12:22 +00:00
Gtk::TreeModelColumn< std::string > m_col_show_id;
Gtk::TreeModelColumn< std::string > m_col_dvd;
2019-07-12 21:10:40 +00:00
};
DatabaseColumns m_columns_database;
Glib::RefPtr< Gtk::ListStore > m_model;
bool linux;
Glib::RefPtr< Gtk::Application > app;
2019-07-12 21:10:40 +00:00
};
#endif // GTKMM_MAIN_WINDOW