mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 22:00:35 +01:00
QETTemplateEditor now inherits from QETMainWindow.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1506 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -31,7 +31,7 @@
|
|||||||
@param parent parent QWidget of this window
|
@param parent parent QWidget of this window
|
||||||
*/
|
*/
|
||||||
QETTitleBlockTemplateEditor::QETTitleBlockTemplateEditor(QWidget *parent) :
|
QETTitleBlockTemplateEditor::QETTitleBlockTemplateEditor(QWidget *parent) :
|
||||||
QMainWindow(parent),
|
QETMainWindow(parent),
|
||||||
opened_from_file_(false),
|
opened_from_file_(false),
|
||||||
read_only_(false),
|
read_only_(false),
|
||||||
duplicate_(false),
|
duplicate_(false),
|
||||||
@@ -45,7 +45,6 @@ QETTitleBlockTemplateEditor::QETTitleBlockTemplateEditor(QWidget *parent) :
|
|||||||
initWidgets();
|
initWidgets();
|
||||||
initActions();
|
initActions();
|
||||||
initMenus();
|
initMenus();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -117,7 +116,7 @@ bool QETTitleBlockTemplateEditor::event(QEvent *event) {
|
|||||||
}
|
}
|
||||||
first_activation_ = false;
|
first_activation_ = false;
|
||||||
}
|
}
|
||||||
return(QMainWindow::event(event));
|
return(QETMainWindow::event(event));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -292,8 +291,6 @@ void QETTitleBlockTemplateEditor::newTemplate() {
|
|||||||
Initialize the various actions.
|
Initialize the various actions.
|
||||||
*/
|
*/
|
||||||
void QETTitleBlockTemplateEditor::initActions() {
|
void QETTitleBlockTemplateEditor::initActions() {
|
||||||
QETApp *qet_app = QETApp::instance();
|
|
||||||
|
|
||||||
new_ = new QAction(QET::Icons::DocumentNew, tr("&Nouveau", "menu entry"), this);
|
new_ = new QAction(QET::Icons::DocumentNew, tr("&Nouveau", "menu entry"), this);
|
||||||
open_ = new QAction(QET::Icons::DocumentOpen, tr("&Ouvrir", "menu entry"), this);
|
open_ = new QAction(QET::Icons::DocumentOpen, tr("&Ouvrir", "menu entry"), this);
|
||||||
open_from_file_ = new QAction(QET::Icons::DocumentOpen, tr("Ouvrir depuis un fichier", "menu entry"), this);
|
open_from_file_ = new QAction(QET::Icons::DocumentOpen, tr("Ouvrir depuis un fichier", "menu entry"), this);
|
||||||
@@ -307,9 +304,6 @@ void QETTitleBlockTemplateEditor::initActions() {
|
|||||||
zoom_out_ = new QAction(QET::Icons::ZoomOut, tr("Zoom arri\350re", "menu entry"), this);
|
zoom_out_ = new QAction(QET::Icons::ZoomOut, tr("Zoom arri\350re", "menu entry"), this);
|
||||||
zoom_fit_ = new QAction(QET::Icons::ZoomFitBest, tr("Zoom adapt\351", "menu entry"), this);
|
zoom_fit_ = new QAction(QET::Icons::ZoomFitBest, tr("Zoom adapt\351", "menu entry"), this);
|
||||||
zoom_reset_ = new QAction(QET::Icons::ZoomOriginal, tr("Pas de zoom", "menu entry"), this);
|
zoom_reset_ = new QAction(QET::Icons::ZoomOriginal, tr("Pas de zoom", "menu entry"), this);
|
||||||
configure_ = new QAction(QET::Icons::Configure, tr("&Configurer QElectroTech", "menu entry"), this);
|
|
||||||
about_qet_ = new QAction(QET::Icons::QETLogo, tr("\300 &propos de QElectroTech", "menu entry"), this);
|
|
||||||
about_qt_ = new QAction(QET::Icons::QtLogo, tr("\300 propos de &Qt", "menu entry"), this);
|
|
||||||
merge_cells_ = new QAction( tr("&Fusionner les cellules", "menu entry"), this);
|
merge_cells_ = new QAction( tr("&Fusionner les cellules", "menu entry"), this);
|
||||||
split_cell_ = new QAction( tr("&S\351parer les cellules", "menu entry"), this);
|
split_cell_ = new QAction( tr("&S\351parer les cellules", "menu entry"), this);
|
||||||
|
|
||||||
@@ -331,10 +325,6 @@ void QETTitleBlockTemplateEditor::initActions() {
|
|||||||
zoom_fit_ -> setShortcut(QKeySequence(tr("Ctrl+9", "shortcut to enable fit zoom")));
|
zoom_fit_ -> setShortcut(QKeySequence(tr("Ctrl+9", "shortcut to enable fit zoom")));
|
||||||
zoom_reset_ -> setShortcut(QKeySequence(tr("Ctrl+0", "shortcut to reset zoom")));
|
zoom_reset_ -> setShortcut(QKeySequence(tr("Ctrl+0", "shortcut to reset zoom")));
|
||||||
|
|
||||||
configure_ -> setStatusTip(tr("Permet de r\351gler diff\351rents param\350tres de QElectroTech", "status bar tip"));
|
|
||||||
about_qet_ -> setStatusTip(tr("Affiche des informations sur QElectroTech", "status bar tip"));
|
|
||||||
about_qt_ -> setStatusTip(tr("Affiche des informations sur la biblioth\350que Qt", "status bar tip"));
|
|
||||||
|
|
||||||
connect(new_, SIGNAL(triggered()), this, SLOT(newTemplate()));
|
connect(new_, SIGNAL(triggered()), this, SLOT(newTemplate()));
|
||||||
connect(open_, SIGNAL(triggered()), this, SLOT(open()));
|
connect(open_, SIGNAL(triggered()), this, SLOT(open()));
|
||||||
connect(open_from_file_, SIGNAL(triggered()), this, SLOT(openFromFile()));
|
connect(open_from_file_, SIGNAL(triggered()), this, SLOT(openFromFile()));
|
||||||
@@ -346,9 +336,6 @@ void QETTitleBlockTemplateEditor::initActions() {
|
|||||||
connect(zoom_out_, SIGNAL(triggered()), template_edition_area_view_, SLOT(zoomOut()));
|
connect(zoom_out_, SIGNAL(triggered()), template_edition_area_view_, SLOT(zoomOut()));
|
||||||
connect(zoom_fit_, SIGNAL(triggered()), template_edition_area_view_, SLOT(zoomFit()));
|
connect(zoom_fit_, SIGNAL(triggered()), template_edition_area_view_, SLOT(zoomFit()));
|
||||||
connect(zoom_reset_, SIGNAL(triggered()), template_edition_area_view_, SLOT(zoomReset()));
|
connect(zoom_reset_, SIGNAL(triggered()), template_edition_area_view_, SLOT(zoomReset()));
|
||||||
connect(configure_, SIGNAL(triggered()), qet_app, SLOT(configureQET()));
|
|
||||||
connect(about_qet_, SIGNAL(triggered()), qet_app, SLOT(aboutQET()));
|
|
||||||
connect(about_qt_, SIGNAL(triggered()), qet_app, SLOT(aboutQt()));
|
|
||||||
connect(merge_cells_, SIGNAL(triggered()), template_edition_area_view_, SLOT(mergeSelectedCells()));
|
connect(merge_cells_, SIGNAL(triggered()), template_edition_area_view_, SLOT(mergeSelectedCells()));
|
||||||
connect(split_cell_, SIGNAL(triggered()), template_edition_area_view_, SLOT(splitSelectedCell()));
|
connect(split_cell_, SIGNAL(triggered()), template_edition_area_view_, SLOT(splitSelectedCell()));
|
||||||
}
|
}
|
||||||
@@ -360,14 +347,6 @@ void QETTitleBlockTemplateEditor::initMenus() {
|
|||||||
file_menu_ = new QMenu(tr("&Fichier", "menu title"), this);
|
file_menu_ = new QMenu(tr("&Fichier", "menu title"), this);
|
||||||
edit_menu_ = new QMenu(tr("&\311dition", "menu title"), this);
|
edit_menu_ = new QMenu(tr("&\311dition", "menu title"), this);
|
||||||
display_menu_ = new QMenu(tr("Afficha&ge", "menu title"), this);
|
display_menu_ = new QMenu(tr("Afficha&ge", "menu title"), this);
|
||||||
config_menu_ = new QMenu(tr("&Configuration", "menu title"), this);
|
|
||||||
help_menu_ = new QMenu(tr("&Aide", "menu title"), this);
|
|
||||||
|
|
||||||
file_menu_ -> setTearOffEnabled(true);
|
|
||||||
edit_menu_ -> setTearOffEnabled(true);
|
|
||||||
config_menu_ -> setTearOffEnabled(true);
|
|
||||||
display_menu_ -> setTearOffEnabled(true);
|
|
||||||
help_menu_ -> setTearOffEnabled(true);
|
|
||||||
|
|
||||||
file_menu_ -> addAction(new_);
|
file_menu_ -> addAction(new_);
|
||||||
file_menu_ -> addAction(open_);
|
file_menu_ -> addAction(open_);
|
||||||
@@ -389,16 +368,9 @@ void QETTitleBlockTemplateEditor::initMenus() {
|
|||||||
display_menu_ -> addAction(zoom_fit_);
|
display_menu_ -> addAction(zoom_fit_);
|
||||||
display_menu_ -> addAction(zoom_reset_);
|
display_menu_ -> addAction(zoom_reset_);
|
||||||
|
|
||||||
config_menu_ -> addAction(configure_);
|
insertMenu(settings_menu_, file_menu_);
|
||||||
|
insertMenu(settings_menu_, edit_menu_);
|
||||||
help_menu_ -> addAction(about_qet_);
|
insertMenu(settings_menu_, display_menu_);
|
||||||
help_menu_ -> addAction(about_qt_);
|
|
||||||
|
|
||||||
menuBar() -> addMenu(file_menu_);
|
|
||||||
menuBar() -> addMenu(edit_menu_);
|
|
||||||
menuBar() -> addMenu(display_menu_);
|
|
||||||
menuBar() -> addMenu(config_menu_);
|
|
||||||
menuBar() -> addMenu(help_menu_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#ifndef TITLEBLOCK_SLASH_QET_TEMPLATE_EDITOR_H
|
#ifndef TITLEBLOCK_SLASH_QET_TEMPLATE_EDITOR_H
|
||||||
#define TITLEBLOCK_SLASH_QET_TEMPLATE_EDITOR_H
|
#define TITLEBLOCK_SLASH_QET_TEMPLATE_EDITOR_H
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
|
#include "qetmainwindow.h"
|
||||||
#include "qet.h"
|
#include "qet.h"
|
||||||
#include "templateview.h"
|
#include "templateview.h"
|
||||||
#include "templatelocation.h"
|
#include "templatelocation.h"
|
||||||
@@ -32,7 +33,7 @@ class QETProject;
|
|||||||
editor. This editor aims at allowing users to easily create their own title
|
editor. This editor aims at allowing users to easily create their own title
|
||||||
block templates.
|
block templates.
|
||||||
*/
|
*/
|
||||||
class QETTitleBlockTemplateEditor : public QMainWindow {
|
class QETTitleBlockTemplateEditor : public QETMainWindow {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
// constructor, destructor
|
// constructor, destructor
|
||||||
@@ -45,13 +46,11 @@ class QETTitleBlockTemplateEditor : public QMainWindow {
|
|||||||
// attributes
|
// attributes
|
||||||
private:
|
private:
|
||||||
/// menus TODO
|
/// menus TODO
|
||||||
QMenu *file_menu_, *edit_menu_,/* *paste_from_menu_, */*display_menu_,/* *tools_menu_,*/ *config_menu_, *help_menu_;
|
QMenu *file_menu_, *edit_menu_,/* *paste_from_menu_, */*display_menu_,/* *tools_menu_*/;
|
||||||
/// actions
|
/// actions
|
||||||
QAction *new_, *open_, *open_from_file_, *save_, *save_as_, *save_as_file_, *quit_;
|
QAction *new_, *open_, *open_from_file_, *save_, *save_as_, *save_as_file_, *quit_;
|
||||||
QAction *undo_, *redo_, *merge_cells_, *split_cell_;
|
QAction *undo_, *redo_, *merge_cells_, *split_cell_;
|
||||||
QAction *zoom_in_, *zoom_out_, *zoom_fit_, *zoom_reset_;
|
QAction *zoom_in_, *zoom_out_, *zoom_fit_, *zoom_reset_;
|
||||||
QAction *configure_;
|
|
||||||
QAction *about_qt_, *about_qet_;
|
|
||||||
/// Location of the currently edited template
|
/// Location of the currently edited template
|
||||||
TitleBlockTemplateLocation location_;
|
TitleBlockTemplateLocation location_;
|
||||||
/// Filepath of the currently edited template, if opened from a file
|
/// Filepath of the currently edited template, if opened from a file
|
||||||
|
|||||||
Reference in New Issue
Block a user