// src/graphical_preferences_editor.hh - Copyright 2005, 2006, University
//               of Padova, dept. of Pure and Applied
//               Mathematics
//
// This file is part of SGPEMv2.
//
// This is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// SGPEMv2 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with SGPEMv2. If not, see http://www.gnu.org/licenses/.


#ifndef GRAPHICAL_PREFERENCES_EDITOR_HH
#define GRAPHICAL_PREFERENCES_EDITOR_HH 1

#include "sgpemv2/config.h"
#include "sgpemv2/global_preferences.hh"

#include <gtkmm/builder.h>
#include <gtkmm/liststore.h>
#include <gtkmm/dialog.h>
#include <gtkmm/treeview.h>
#include <gtkmm/spinbutton.h>

#include <string>

namespace sgpem
{

    class PreferencesEditor
    {

    public:

        explicit PreferencesEditor(const std::string& uifile = UIDIR "/configure-dialog.ui");


        void
        on_close();

        void
        on_add_plugins_dir();

        void
        on_remove_plugins_dir();

        void
        on_add_policies_dir();

        void
        on_remove_policies_dir();

        void
        on_set_speed();


        ~PreferencesEditor();

    private:

            void
            update_policies();

            void
            update_plugins();

        Glib::RefPtr<Gtk::Builder> _refXml;
        Gtk::Dialog* preferences_dialog;

        Gtk::TreeView* plugins_dirs_treeview;
        Glib::RefPtr<Gtk::ListStore> plugins_dirs_model;

        Gtk::TreeView* plugins_treeview;
        Glib::RefPtr<Gtk::ListStore> plugins_model;

        Gtk::TreeView* policies_dirs_treeview;
        Glib::RefPtr<Gtk::ListStore> policies_dirs_model;

        Gtk::TreeView* policies_treeview;
        Glib::RefPtr<Gtk::ListStore> policies_model;

        Gtk::SpinButton* speed_spin;

    };

} // ~ namespace

#endif // ~ GRAPHICAL_PREFERENCES_EDITOR_HH
