mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02:00
do not hardcode translations for shortcuts: let the system do it for you!
This commit is contained in:
parent
f308ea6b93
commit
317c90c769
@ -151,7 +151,7 @@ void AutoNumberingDockWidget::setProject(QETProject *project,
|
||||
//Set Combobox Context
|
||||
setContext();
|
||||
|
||||
ui->m_configure_pb->setShortcut(QKeySequence( tr("Ctrl+Shift+P")));
|
||||
ui->m_configure_pb->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_P);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -962,25 +962,25 @@ void QETElementEditor::setupActions()
|
||||
|
||||
ui->m_new_action -> setShortcut(QKeySequence::New);
|
||||
ui->m_open_action -> setShortcut(QKeySequence::Open);
|
||||
ui->m_open_from_file_action -> setShortcut(tr("Ctrl+Shift+O"));
|
||||
ui->m_open_from_file_action -> setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_O);
|
||||
ui->m_save_action -> setShortcut(QKeySequence::Save);
|
||||
ui->m_save_as_file_action -> setShortcut(tr("Ctrl+Shift+S"));
|
||||
ui->m_save_as_file_action -> setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_S);
|
||||
ui->m_select_all_act -> setShortcut(QKeySequence::SelectAll);
|
||||
ui->m_deselect_all_action -> setShortcut(QKeySequence(tr("Ctrl+Shift+A")));
|
||||
ui->m_revert_selection_action -> setShortcut(QKeySequence(tr("Ctrl+I")));
|
||||
ui->m_deselect_all_action -> setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_A);
|
||||
ui->m_revert_selection_action -> setShortcut(Qt::CTRL | Qt::Key_I);
|
||||
ui->m_cut_action -> setShortcut(QKeySequence::Cut);
|
||||
ui->m_copy_action -> setShortcut(QKeySequence::Copy);
|
||||
ui->m_paste_action -> setShortcut(QKeySequence::Paste);
|
||||
ui->m_paste_in_area_action -> setShortcut(tr("Ctrl+Shift+V"));
|
||||
ui->m_edit_names_action -> setShortcut(QKeySequence(tr("Ctrl+E")));
|
||||
ui->m_edit_author_action -> setShortcut(tr("Ctrl+Y"));
|
||||
ui->m_paste_in_area_action -> setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_V);
|
||||
ui->m_edit_names_action -> setShortcut(Qt::CTRL | Qt::Key_E);
|
||||
ui->m_edit_author_action -> setShortcut(Qt::CTRL | Qt::Key_Y);
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
ui->m_delete_action -> setShortcut(QKeySequence(Qt::Key_Delete));
|
||||
ui->m_quit_action -> setShortcut(QKeySequence(tr("Ctrl+Q")));
|
||||
ui->m_delete_action -> setShortcut(Qt::Key_Delete);
|
||||
ui->m_quit_action -> setShortcut(Qt::CTRL | Qt::Key_Q);
|
||||
#else
|
||||
ui->m_delete_action -> setShortcut(QKeySequence(tr("Backspace")));
|
||||
ui->m_quit_action -> setShortcut(QKeySequence(tr("Ctrl+W")));
|
||||
ui->m_delete_action -> setShortcut(Qt::Key_Backspace);
|
||||
ui->m_quit_action -> setShortcut(Qt::CTRL | Qt::Key_W);
|
||||
#endif
|
||||
|
||||
//Depth action
|
||||
@ -1001,8 +1001,8 @@ void QETElementEditor::setupActions()
|
||||
//Zoom action
|
||||
ui->m_zoom_in_action -> setShortcut(QKeySequence::ZoomIn);
|
||||
ui->m_zoom_out_action -> setShortcut(QKeySequence::ZoomOut);
|
||||
ui->m_zoom_fit_best_action -> setShortcut(QKeySequence(tr("Ctrl+9")));
|
||||
ui->m_zoom_original_action -> setShortcut(QKeySequence(tr("Ctrl+0")));
|
||||
ui->m_zoom_fit_best_action -> setShortcut(Qt::CTRL | Qt::Key_9);
|
||||
ui->m_zoom_original_action -> setShortcut(Qt::CTRL | Qt::Key_0);
|
||||
|
||||
//Add primitive actions
|
||||
m_add_part_action_grp = new QActionGroup(this);
|
||||
|
@ -738,10 +738,10 @@ QActionGroup *QET::depthActionGroup(QObject *parent)
|
||||
edit_lower ->setStatusTip(QObject::tr("Éloigne la ou les sélections"));
|
||||
edit_backward->setStatusTip(QObject::tr("Envoie en arrière plan la ou les sélections"));
|
||||
|
||||
edit_raise ->setShortcut(QKeySequence(QObject::tr("Ctrl+Shift+Up")));
|
||||
edit_lower ->setShortcut(QKeySequence(QObject::tr("Ctrl+Shift+Down")));
|
||||
edit_backward->setShortcut(QKeySequence(QObject::tr("Ctrl+Shift+End")));
|
||||
edit_forward ->setShortcut(QKeySequence(QObject::tr("Ctrl+Shift+Home")));
|
||||
edit_raise ->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_Up);
|
||||
edit_lower ->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_Down);
|
||||
edit_backward->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_End);
|
||||
edit_forward ->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_Home);
|
||||
|
||||
edit_forward ->setData(QET::BringForward);
|
||||
edit_raise ->setData(QET::Raise);
|
||||
|
@ -264,7 +264,7 @@ void QETDiagramEditor::setUpActions()
|
||||
{
|
||||
//Export to another file type (jpeg, dxf etc...)
|
||||
m_export_to_images = new QAction(QET::Icons::DocumentExport, tr("E&xporter"), this);
|
||||
m_export_to_images->setShortcut(QKeySequence(tr("Ctrl+Shift+X")));
|
||||
m_export_to_images->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_X);
|
||||
m_export_to_images->setStatusTip(tr("Exporte le folio courant dans un autre format", "status bar tip"));
|
||||
connect(m_export_to_images, &QAction::triggered, [this]() {
|
||||
ProjectView *current_project = currentProjectView();
|
||||
@ -296,7 +296,7 @@ void QETDiagramEditor::setUpActions()
|
||||
|
||||
//Quit editor
|
||||
m_quit_editor = new QAction(QET::Icons::ApplicationExit, tr("&Quitter"), this);
|
||||
m_quit_editor->setShortcut(QKeySequence(tr("Ctrl+Q")));
|
||||
m_quit_editor->setShortcut(Qt::CTRL | Qt::Key_Q);
|
||||
m_quit_editor->setStatusTip(tr("Ferme l'application QElectroTech", "status bar tip"));
|
||||
connect(m_quit_editor, &QAction::triggered, this, &QETDiagramEditor::close);
|
||||
|
||||
@ -339,7 +339,7 @@ void QETDiagramEditor::setUpActions()
|
||||
|
||||
//Reset conductor path
|
||||
m_conductor_reset = new QAction(QET::Icons::ConductorSettings, tr("Réinitialiser les conducteurs"), this);
|
||||
m_conductor_reset->setShortcut( QKeySequence( tr("Ctrl+K") ) );
|
||||
m_conductor_reset->setShortcut(Qt::CTRL | Qt::Key_K);
|
||||
m_conductor_reset->setStatusTip(tr("Recalcule les chemins des conducteurs sans tenir compte des modifications", "status bar tip"));
|
||||
connect(m_conductor_reset, &QAction::triggered, [this]() {
|
||||
if (DiagramView *dv = currentDiagramView())
|
||||
@ -380,7 +380,7 @@ void QETDiagramEditor::setUpActions()
|
||||
|
||||
//Edit current diagram properties
|
||||
m_edit_diagram_properties = new QAction(QET::Icons::DialogInformation, tr("Propriétés du folio"), this);
|
||||
m_edit_diagram_properties->setShortcut( QKeySequence( tr("Ctrl+L")));
|
||||
m_edit_diagram_properties->setShortcut(Qt::CTRL | Qt::Key_L);
|
||||
m_edit_diagram_properties -> setStatusTip(tr("Édite les propriétés du folio (dimensions, informations du cartouche, propriétés des conducteurs...)", "status bar tip"));
|
||||
connect(m_edit_diagram_properties, &QAction::triggered, [this]() {
|
||||
if (ProjectView *project_view = currentProjectView())
|
||||
@ -398,7 +398,7 @@ void QETDiagramEditor::setUpActions()
|
||||
|
||||
//Add new folio to current project
|
||||
m_project_add_diagram = new QAction(QET::Icons::DiagramAdd, tr("Ajouter un folio"), this);
|
||||
m_project_add_diagram->setShortcut(QKeySequence(tr("Ctrl+T")));
|
||||
m_project_add_diagram->setShortcut(Qt::CTRL | Qt::Key_T);
|
||||
connect(m_project_add_diagram, &QAction::triggered, [this]() {
|
||||
if (ProjectView *current_project = currentProjectView()) {
|
||||
current_project->project()->addNewDiagram();
|
||||
@ -592,10 +592,10 @@ void QETDiagramEditor::setUpActions()
|
||||
m_edit_selection = m_selection_actions_group.addAction( QET::Icons::ElementEdit, tr("Éditer l'item sélectionné") );
|
||||
m_group_selected_texts = m_selection_actions_group.addAction(QET::Icons::textGroup, tr("Grouper les textes sélectionnés"));
|
||||
|
||||
m_delete_selection->setShortcut(QKeySequence::Delete);
|
||||
m_rotate_selection->setShortcut(QKeySequence( tr("SPACE")));
|
||||
m_rotate_texts ->setShortcut(QKeySequence( tr("Ctrl+SPACE")));
|
||||
m_edit_selection ->setShortcut(QKeySequence( tr("Ctrl+E")));
|
||||
m_delete_selection->setShortcut(Qt::Key_Delete);
|
||||
m_rotate_selection->setShortcut(Qt::Key_Space);
|
||||
m_rotate_texts ->setShortcut(Qt::CTRL | Qt::Key_Space);
|
||||
m_edit_selection ->setShortcut(Qt::CTRL | Qt::Key_E);
|
||||
|
||||
m_delete_selection->setStatusTip( tr("Enlève les éléments sélectionnés du folio", "status bar tip"));
|
||||
m_rotate_selection->setStatusTip( tr("Pivote les éléments et textes sélectionnés", "status bar tip"));
|
||||
@ -618,7 +618,7 @@ void QETDiagramEditor::setUpActions()
|
||||
|
||||
select_all ->setShortcut(QKeySequence::SelectAll);
|
||||
select_nothing->setShortcut(QKeySequence::Deselect);
|
||||
select_invert ->setShortcut(QKeySequence( tr("Ctrl+I")));
|
||||
select_invert ->setShortcut(Qt::CTRL | Qt::Key_I);
|
||||
|
||||
select_all ->setStatusTip( tr("Sélectionne tous les éléments du folio", "status bar tip") );
|
||||
select_nothing->setStatusTip( tr("Désélectionne tous les éléments du folio", "status bar tip") );
|
||||
@ -640,9 +640,9 @@ void QETDiagramEditor::setUpActions()
|
||||
|
||||
zoom_in ->setShortcut(QKeySequence::ZoomIn);
|
||||
zoom_out ->setShortcut(QKeySequence::ZoomOut);
|
||||
zoom_content->setShortcut(QKeySequence( tr("Ctrl+8")));
|
||||
zoom_fit ->setShortcut(QKeySequence( tr("Ctrl+9")));
|
||||
zoom_reset ->setShortcut(QKeySequence( tr("Ctrl+0")));
|
||||
zoom_content->setShortcut(Qt::CTRL | Qt::Key_8);
|
||||
zoom_fit ->setShortcut(Qt::CTRL | Qt::Key_9);
|
||||
zoom_reset ->setShortcut(Qt::CTRL | Qt::Key_0);
|
||||
|
||||
zoom_in ->setStatusTip(tr("Agrandit le folio", "status bar tip"));
|
||||
zoom_out ->setStatusTip(tr("Rétrécit le folio", "status bar tip"));
|
||||
|
@ -392,23 +392,23 @@ void QETTitleBlockTemplateEditor::initActions()
|
||||
|
||||
new_ -> setShortcut(QKeySequence::New);
|
||||
open_ -> setShortcut(QKeySequence::Open);
|
||||
open_from_file_ -> setShortcut(tr("Ctrl+Shift+O", "shortcut to open a template from a file"));
|
||||
open_from_file_ -> setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_O);
|
||||
save_ -> setShortcut(QKeySequence::Save);
|
||||
save_as_file_ -> setShortcut(tr("Ctrl+Shift+S", "shortcut to save a template to a file"));
|
||||
quit_ -> setShortcut(QKeySequence(tr("Ctrl+Q", "shortcut to quit")));
|
||||
save_as_file_ -> setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_S);
|
||||
quit_ -> setShortcut(Qt::CTRL | Qt::Key_Q);
|
||||
undo_ -> setShortcut(QKeySequence::Undo);
|
||||
redo_ -> setShortcut(QKeySequence::Redo);
|
||||
cut_ -> setShortcut(QKeySequence::Cut);
|
||||
copy_ -> setShortcut(QKeySequence::Copy);
|
||||
paste_ -> setShortcut(QKeySequence::Paste);
|
||||
edit_logos_ -> setShortcut(QKeySequence(tr("Ctrl+T", "shortcut to manage embedded logos")));
|
||||
edit_info_ -> setShortcut(QKeySequence(tr("Ctrl+Y", "shortcut to edit extra information")));
|
||||
merge_cells_ -> setShortcut(QKeySequence(tr("Ctrl+J", "shortcut to merge cells")));
|
||||
split_cell_ -> setShortcut(QKeySequence(tr("Ctrl+K", "shortcut to split merged cell")));
|
||||
edit_logos_ -> setShortcut(Qt::CTRL | Qt::Key_T);
|
||||
edit_info_ -> setShortcut(Qt::CTRL | Qt::Key_Y);
|
||||
merge_cells_ -> setShortcut(Qt::CTRL | Qt::Key_J);
|
||||
split_cell_ -> setShortcut(Qt::CTRL | Qt::Key_K);
|
||||
zoom_in_ -> setShortcut(QKeySequence::ZoomIn);
|
||||
zoom_out_ -> setShortcut(QKeySequence::ZoomOut);
|
||||
zoom_fit_ -> setShortcut(QKeySequence(tr("Ctrl+9", "shortcut to enable fit zoom")));
|
||||
zoom_reset_ -> setShortcut(QKeySequence(tr("Ctrl+0", "shortcut to reset zoom")));
|
||||
zoom_fit_ -> setShortcut(Qt::CTRL | Qt::Key_9);
|
||||
zoom_reset_ -> setShortcut(Qt::CTRL | Qt::Key_0);
|
||||
|
||||
connect(new_, SIGNAL(triggered()), this, SLOT(newTemplate()));
|
||||
connect(open_, SIGNAL(triggered()), this, SLOT(open()));
|
||||
|
Loading…
x
Reference in New Issue
Block a user