# # # add_file "src/view/DatabaseMenuBar.cpp" # content [d24e2b05be7b3e69d787cc8fa4abbcd9993eee9a] # # add_file "src/view/DatabaseMenuBar.h" # content [322b93d735779f072a5e06212ebbf2e00b3d0095] # ============================================================ --- src/view/DatabaseMenuBar.cpp d24e2b05be7b3e69d787cc8fa4abbcd9993eee9a +++ src/view/DatabaseMenuBar.cpp d24e2b05be7b3e69d787cc8fa4abbcd9993eee9a @@ -0,0 +1,62 @@ +/*************************************************************************** + * Copyright (C) 2007 by Thomas Keller * + * address@hidden * + * * + * 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 2 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "DatabaseMenuBar.h" + +DatabaseMenuBar::DatabaseMenuBar() : MenuBar() +{ + // + // The Database menu + // + actionChangeset_browser = new QAction(tr("Changeset browser"), this); + actionChangeset_browser->setShortcut(tr("Ctrl+B")); + actionKey_management = new QAction(tr("Key management"), this); + actionKey_management->setShortcut(tr("Ctrl+K")); + actionCheckout_revision = new QAction(tr("Checkout revision"), this); + actionCheckout_revision->setShortcut(tr("Ctrl+Shift+U")); + + menuDatabase = new QMenu(tr("Database"), this); + + menuDatabase->addAction(actionChangeset_browser); + menuDatabase->addAction(actionKey_management); + menuDatabase->addSeparator(); + menuDatabase->addAction(actionCheckout_revision); + + // insert the menu before the help menu + insertAction(menuHelp->menuAction(), menuDatabase->menuAction()); + + connect( + actionChangeset_browser, SIGNAL(triggered()), + this, SIGNAL(showChangesetBrowser()) + ); + + connect( + actionKey_management, SIGNAL(triggered()), + this, SIGNAL(showKeyManagement()) + ); + + connect( + actionCheckout_revision, SIGNAL(triggered()), + this, SIGNAL(showCheckoutRevision()) + ); +} + +DatabaseMenuBar::~DatabaseMenuBar() {} + ============================================================ --- src/view/DatabaseMenuBar.h 322b93d735779f072a5e06212ebbf2e00b3d0095 +++ src/view/DatabaseMenuBar.h 322b93d735779f072a5e06212ebbf2e00b3d0095 @@ -0,0 +1,47 @@ +/*************************************************************************** + * Copyright (C) 2007 by Thomas Keller * + * address@hidden * + * * + * 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 2 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef DATABASE_MENU_BAR_H +#define DATABASE_MENU_BAR_H + +#include "MenuBar.h" + +class DatabaseMenuBar : public MenuBar +{ + Q_OBJECT +public: + DatabaseMenuBar(); + ~DatabaseMenuBar(); + +signals: + void showCheckoutRevision(); + void showChangesetBrowser(); + void showKeyManagement(); + +protected: + QAction * actionKey_management; + QAction * actionChangeset_browser; + QAction * actionCheckout_revision; + + QMenu * menuDatabase; +}; + +#endif +