void MainWindow::createActions() { changeTexAct = new QAction(tr("Change"), this); connect(changeTexAct, SIGNAL(triggered()), scene1, SLOT(changeTex())); stopTimAct = new QAction(tr("Stop"), this); connect(stopTimAct, SIGNAL(triggered()), scene1, SLOT(stopTmr())); startTimAct = new QAction(tr("Start"), this); connect(startTimAct, SIGNAL(triggered()), scene1, SLOT(startTmr())); }
Fenetre::Fenetre(QWidget *parent) : courant(0), QMainWindow(parent) { //************************* courant = NULL; folder = NULL; resize(1200, 512); //*************************** Menu *************************** QMenu* mFile = menuBar()->addMenu("&File"); QMenu* mEdit = menuBar()->addMenu("&Edit"); QMenu* mView = menuBar()->addMenu("&View"); QMenu* mNouveau = mFile->addMenu("New"); QAction* mactionAnnuler = mEdit->addAction("Annuler"); QAction* mactionRefaire = mEdit->addAction("Refaire"); QAction* mactionSupprimer = mEdit->addAction("Supprimer"); QMenu* mTag = mEdit->addMenu("Tags"); QAction* mactionSupprimerTag = mTag->addAction("Supprimer"); QMenu* mDocument = mEdit->addMenu("Documents"); QAction* mactionUp = mDocument->addAction("Monter"); QAction* mactionDown = mDocument->addAction("Descendre"); QMenu* mExport = mEdit->addMenu("Exporter"); QAction* mactionOuvrir = mFile->addAction("Ouvrir un espace de travail"); QAction* mactionNew = mFile->addAction("Nouvel espace de travail"); QAction* mactionSaveAs = mFile->addAction("Enregistrer sous..."); QAction* mactionNewArticle = mNouveau->addAction("Article"); QAction* mactionNewImage = mNouveau->addAction("Image"); QAction* mactionNewAudio = mNouveau->addAction("Audio"); QAction* mactionNewVideo = mNouveau->addAction("Video"); QAction* mactionNewDocument = mNouveau->addAction("Document"); QAction* mactionExportHTML = mExport->addAction("Html"); QAction* mactionExportTex = mExport->addAction("Tex"); QAction* mactionExportTexte = mExport->addAction("Texte"); QAction* mactionOption=mEdit->addAction("Setting"); QAction* mactionAddTag = mNouveau->addAction("Tag"); QAction* mactionSave = mFile->addAction("Sauvegarder"); mFile->addSeparator(); QMenu* ouvrirCorbeille = mFile->addMenu("Corbeille"); QAction* mactionRestaurer = ouvrirCorbeille->addAction("Restaurer"); QAction* mactionVider = ouvrirCorbeille->addAction("Vider la Corbeille"); mactionViewEdit = mView->addAction("Onglet Editeur"); mactionViewHTML = mView->addAction("Onglet Html"); mactionViewTex = mView->addAction("Onglet Tex"); mactionViewTexte = mView->addAction("Onglet Texte"); mFile->addSeparator(); QAction* actionQuitter = mFile->addAction("&Quitter"); actionQuitter->setIcon(QIcon("icon/quitter.png")); mactionNewArticle->setIcon(QIcon("icon/article.png")); mactionNewImage->setIcon(QIcon("icon/image.png")); mactionNewAudio->setIcon(QIcon("icon/audio.png")); mactionNewVideo->setIcon(QIcon("icon/video.png")); mNouveau->setIcon(QIcon("icon/plus.png")); mactionDown->setIcon(QIcon("icon/down.png")); mactionUp->setIcon(QIcon("icon/up.png")); mactionAddTag->setIcon(QIcon("icon/tag.png")); mactionSave->setIcon(QIcon("icon/save.png")); mactionExportHTML->setIcon(QIcon("icon/html.png")); mactionExportTex->setIcon(QIcon("icon/tex.png")); mactionExportTexte->setIcon(QIcon("icon/texte.png")); mactionAnnuler->setIcon(QIcon("icon/undo.png")); mactionRefaire->setIcon(QIcon("icon/redo.png")); mactionSupprimer->setIcon(QIcon("icon/cross.png")); mactionRestaurer->setIcon(QIcon("icon/corbeille.png")); mactionNewDocument->setIcon(QIcon("icon/document.png")); mactionOption->setIcon(QIcon("icon/setting.png")); mactionOuvrir->setShortcut(QKeySequence("Ctrl+O")); actionQuitter->setShortcut(QKeySequence("Ctrl+Q")); mactionSave->setShortcut(QKeySequence("Ctrl+S")); mactionAnnuler->setShortcut(QKeySequence("Ctrl+Z")); mactionRefaire->setShortcut(QKeySequence("Ctrl+Y")); mactionSupprimer->setShortcut(tr("Delete")); //** VIEW **// mactionViewEdit->setCheckable(true); mactionViewEdit->setChecked(true); mactionViewHTML->setCheckable(true); mactionViewTex->setCheckable(true); mactionViewTexte->setCheckable(true); //Bar de statue QStatusBar* statusBar = new QStatusBar; statusBar->addWidget(new QLabel("Projet Lo21 - Pauline Crouillère / Emilien Notarianni")); this->setStatusBar(statusBar); // Création de la barre d'outils QToolBar *toolBarFichier = addToolBar("Fichier"); toolBarFichier->addAction(mactionNewArticle); toolBarFichier->addAction(mactionNewImage); toolBarFichier->addAction(mactionNewAudio); toolBarFichier->addAction(mactionNewVideo); toolBarFichier->addAction(mactionNewDocument); toolBarFichier->addSeparator(); toolBarFichier->addAction(mactionAddTag); toolBarFichier->addSeparator(); toolBarFichier->addAction(mactionUp); toolBarFichier->addAction(mactionDown); toolBarFichier->addSeparator(); toolBarFichier->addAction(mactionExportHTML); toolBarFichier->addAction(mactionExportTex); toolBarFichier->addAction(mactionExportTexte); toolBarFichier->addSeparator(); toolBarFichier->addAction(mactionRestaurer); toolBarFichier->addSeparator(); toolBarFichier->addAction(mactionSupprimer); toolBarFichier->addSeparator(); toolBarFichier->addAction(actionQuitter); /*************************************************************/ couche = new QHBoxLayout(); lw = new LeftWindows(); ow = new OngletWindows(); couche->addWidget(lw); couche->addWidget(ow); couche->setMargin(0); couche->setAlignment(Qt::AlignTop); centerWindows = new QWidget(); centerWindows->setLayout(couche); setCentralWidget(centerWindows); //************************** CONNECT **************************/ QObject::connect(mactionNewArticle, SIGNAL(triggered()), this, SLOT(newArticle())); QObject::connect(mactionNewDocument, SIGNAL(triggered()), this, SLOT(newDocument())); QObject::connect(mactionNewImage, SIGNAL(triggered()), this, SLOT(newImage())); QObject::connect(mactionNewAudio, SIGNAL(triggered()), this, SLOT(newAudio())); QObject::connect(mactionNewVideo, SIGNAL(triggered()), this, SLOT(newVideo())); QObject::connect(mactionAddTag, SIGNAL(triggered()), this, SLOT(newTag())); QObject::connect(mactionOuvrir,SIGNAL(triggered()),this, SLOT(ouvrirDialogue())); QObject::connect(actionQuitter,SIGNAL(triggered()),qApp, SLOT(quit())); QObject::connect(mactionUp,SIGNAL(triggered()),this, SLOT(docUp())); QObject::connect(mactionDown,SIGNAL(triggered()),this, SLOT(docDown())); QObject::connect(mactionRestaurer, SIGNAL(triggered()), this, SLOT(ouvrirCorbeille())); QObject::connect(mactionSave, SIGNAL(triggered()), this, SLOT(asave())); QObject::connect(mactionExportHTML, SIGNAL(triggered()), this, SLOT(exportHTML())); QObject::connect(mactionExportTex, SIGNAL(triggered()), this, SLOT(exportTex())); QObject::connect(mactionExportTexte, SIGNAL(triggered()), this, SLOT(exportTexte())); QObject::connect(mactionSupprimer, SIGNAL(triggered()), this, SLOT(deleteInCorbeille())); QObject::connect(mactionVider, SIGNAL(triggered()), this, SLOT(viderLaCorbeille())); //TODO QObject::connect(mactionAnnuler, SIGNAL(triggered()), qApp, SLOT(undo())); QObject::connect(mactionRefaire, SIGNAL(triggered()), qApp, SLOT(redo())); // QObject::connect(mactionSaveAs, SIGNAL(triggered()), this, SLOT(copieWorkSpace())); QObject::connect(mactionNew, SIGNAL(triggered()), this, SLOT(newWorkSpace())); QObject::connect(mactionOption, SIGNAL(triggered()), this, SLOT(setting())); QObject::connect(mactionViewEdit, SIGNAL(triggered()), this, SLOT(changeEdit())); QObject::connect(mactionViewHTML, SIGNAL(triggered()), this, SLOT(changeHtml())); QObject::connect(mactionViewTex,SIGNAL(triggered()),this, SLOT(changeTex())); QObject::connect(mactionViewTexte,SIGNAL(triggered()),this, SLOT(changeTexte())); QObject::connect(ow, SIGNAL(currentChanged(int)), this, SLOT(changeOnglet(int))); QObject::connect(mactionSupprimerTag, SIGNAL(triggered()), this, SLOT(supprimeTag())); }