00001 /* 00002 Copyright © 2010 guillaume belz 00003 00004 This file is part of QExtend. 00005 00006 QExtend is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 any later version. 00010 00011 QExtend is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with QExtend. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00020 #include "actionmanager.hpp" 00021 #include <QtGui/QMenu> 00022 #include <QtGui/QAction> 00023 #include <QtGui/QMainWindow> 00024 00025 using namespace QExtend; 00026 00027 00028 //************************************************** 00029 //* create defaults menus 00030 //************************************************** 00031 00032 /*QAction* standardMenuNew(ActionManager* manager) 00033 { 00034 QAction* action = new QAction(manager); 00035 action->setIcon(QIcon::fromTheme("document-new")); 00036 action->setText(tr("&New")); 00037 action->setIconText(tr("New")); 00038 action->setShortcut(QKeySequence::New); 00039 action->setStatusTip(tr("Create new file")); 00040 action->setWhatsThis(tr("Create new file")); 00041 action->setToolTip(tr("Create new file")); 00042 action->setProperty("order", QVariant(100)); 00043 connect(action, SIGNAL(triggered()), manager, SIGNAL(newFile())); 00044 manager->addAction(action); 00045 return action; 00046 }*/ 00047 00048 00049 //************************************************** 00050 //* sort functions 00051 //************************************************** 00052 00053 /*ActionManager::ActionManager(QMainWindow* mainWindow) : 00054 m_mainWindow(mainWindow), 00055 m_actions(NULL), 00056 m_options() 00057 { 00058 } 00059 00060 ActionManager::~ActionManager() 00061 { 00062 m_actions.removeObjects(); 00063 } 00064 00065 QAction* ActionManager::addAction(QAction* action) 00066 { 00067 } 00068 00069 QMenu* ActionManager::addMenu() 00070 { 00071 00072 } 00073 00074 QAction* ActionManager::action(QString name) 00075 { 00076 00077 } 00078 00079 QMenu* ActionManager::menu(QString name) 00080 { 00081 00082 } 00083 00084 void ActionManager::remove(QString name) 00085 { 00086 00087 } 00088 00089 void ActionManager::sort(const char* property, bool inverse) 00090 { 00091 00092 } 00093 00094 void ActionManager::setOptions(const Options options) 00095 { 00096 00097 } 00098 00099 bool ActionManager::option(Option f) 00100 { 00101 return m_options.testFlag(f); 00102 } 00103 00104 void ActionManager::update() 00105 { 00106 00107 } 00108 00109 //ActionManager::ActionManager() 00110 00111 00112 m_menuFile = new QMenu(tr("&File")); 00113 QToolBar* tb = new QToolBar(); 00114 saveObject(m_menuFile); 00115 if(m_enabledActionNew) 00116 { 00117 // icons in X11 from : http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html 00118 // TODO : ad standard icons for win and mac 00119 m_actionNew = new QAction(tr("&New"), this); 00120 m_actionNew->setIcon(QIcon::fromTheme("document-new")); 00121 m_actionNew->setShortcuts(QKeySequence::New); 00122 m_actionNew->setStatusTip(tr("Create new file")); 00123 connect(m_actionNew, SIGNAL(triggered()), this, SIGNAL(newFile())); 00124 m_menuFile->addAction(m_actionNew); 00125 tb->addAction(m_actionNew); 00126 saveObject(m_actionNew); 00127 } 00128 if(m_enabledActionOpen) 00129 { 00130 m_actionOpen = new QAction("&Open", this); 00131 m_actionOpen->setIcon(QIcon::fromTheme("document-open")); 00132 m_actionOpen->setShortcuts(QKeySequence::Open); 00133 m_actionOpen->setStatusTip(tr("Open an existing file")); 00134 connect(m_actionOpen, SIGNAL(triggered()), this, SIGNAL(openFile())); 00135 m_menuFile->addAction(m_actionOpen); 00136 tb->addAction(m_actionOpen); 00137 saveObject(m_actionOpen); 00138 } 00139 m_mainWindow->menuBar()->addMenu(m_menuFile); 00140 m_mainWindow->addToolBar(tb);*/
Les sources présentées sur cette page sont libres de droits et vous pouvez les utiliser à votre convenance. Par contre, la page de présentation constitue une œuvre intellectuelle protégée par les droits d'auteur. Copyright © 2010 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site ni de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon vous encourez selon la loi jusqu'à trois ans de prison et jusqu'à 300 000 € de dommages et intérêts.