/*************************************************************************** * MenuBar.h * * Tue Jan 23 23:29:49 2007 * Copyright 2007 Fernando TarĂ­n Morales * icemanf@gmail.com ****************************************************************************/ /* * This program 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. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA */ #ifndef MAINMENUBAR_H #define MAINMENUBAR_H #include class MainWindow; class MenuBar{ private: Glib::RefPtr m_refUIManager; Glib::RefPtr m_torrentMenu; Glib::RefPtr move_torrent_up, move_torrent_down; Glib::RefPtr move_torrent_top, move_torrent_bottom; Glib::RefPtr resume_torrent, stop_torrent, remove_torrent; Glib::RefPtr m_refActionGroup; Glib::RefPtr showTBButton; void showAboutDialog(); void hideToolBar() { m_refUIManager->get_widget("/ToolBar")->hide(); }; void showToolBar() { m_refUIManager->get_widget("/ToolBar")->show(); }; void manage_tool_bar(); public: MenuBar(MainWindow*); ~MenuBar(); bool isToolBarShown(void) { return showTBButton->get_active(); }; void setShowToolBar(bool action); void setTorrentSelected(bool value=true) { m_torrentMenu->set_sensitive(value); resume_torrent->set_sensitive(value); stop_torrent->set_sensitive(value); remove_torrent->set_sensitive(value); move_torrent_up->set_sensitive(value); move_torrent_down->set_sensitive(value); move_torrent_top->set_sensitive(value); move_torrent_bottom->set_sensitive(value); }; void setTorrentsSelected(bool value=true) { m_torrentMenu->set_sensitive(false); resume_torrent->set_sensitive(value); stop_torrent->set_sensitive(value); remove_torrent->set_sensitive(value); move_torrent_up->set_sensitive(false); move_torrent_down->set_sensitive(false); move_torrent_top->set_sensitive(false); move_torrent_bottom->set_sensitive(false); }; void setTorrentTabSelected(bool value=true) { m_torrentMenu->set_sensitive(value); resume_torrent->set_sensitive(value); stop_torrent->set_sensitive(value); remove_torrent->set_sensitive(value); move_torrent_up->set_sensitive(false); move_torrent_down->set_sensitive(false); move_torrent_top->set_sensitive(false); move_torrent_bottom->set_sensitive(false); } Gtk::Widget * getMenuBar(void) { return m_refUIManager->get_widget("/MenuBar"); }; Gtk::Widget * getToolBar(void) { return m_refUIManager->get_widget("/ToolBar"); }; }; #endif