mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-08 04:44:13 +02:00
Add a Customise window: toolbars, shortcut bar, keyboard, gestures
Configuration > Personnaliser... (also at the bottom of a toolbar's right-click menu) opens one window with a tab for each page that sets how the user works: Barres d'outils, Contenu des barres, Barre de raccourcis, Raccourcis and Gestes de la souris, like SolidWorks' Tools > Customize. The tabs are the same pages the configuration dialog shows, which keeps them. OK applies every tab, Cancel none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -93,6 +93,11 @@ void QETMainWindow::initCommonActions()
|
||||
}
|
||||
});
|
||||
|
||||
customize_action_ = new QAction(QET::Icons::ConfigureToolbars, tr("&Personnaliser..."), this);
|
||||
ShortcutManager::instance().registerAction(customize_action_, "mainwindow.customize", tr("Général"), QKeySequence());
|
||||
customize_action_ -> setStatusTip(tr("Barres d'outils, barre de raccourcis, clavier et gestes de la souris, dans une seule fenêtre", "status bar tip"));
|
||||
connect(customize_action_, &QAction::triggered, qet_app, [qet_app]() { qet_app->customizeQET(); });
|
||||
|
||||
export_config_action_ = new QAction(QET::Icons::DocumentExport, tr("Enregistrer la configuration sous..."), this);
|
||||
export_config_action_ -> setStatusTip(tr("Enregistre les réglages de QElectroTech dans un fichier", "status bar tip"));
|
||||
connect(export_config_action_, &QAction::triggered, qet_app, &QETApp::exportConfiguration);
|
||||
@@ -190,6 +195,7 @@ void QETMainWindow::initCommonMenus()
|
||||
settings_menu_ = new QMenu(tr("&Configuration", "window menu"), this);
|
||||
settings_menu_ -> addAction(fullscreen_action_);
|
||||
settings_menu_ -> addAction(configure_action_);
|
||||
settings_menu_ -> addAction(customize_action_);
|
||||
settings_menu_ -> addSeparator();
|
||||
settings_menu_ -> addAction(export_config_action_);
|
||||
settings_menu_ -> addAction(import_config_action_);
|
||||
@@ -274,6 +280,22 @@ void QETMainWindow::updateFullScreenAction()
|
||||
ShortcutManager::instance().registerAction(fullscreen_action_, "mainwindow.fullscreen", tr("Général"), Qt::CTRL | Qt::SHIFT | Qt::Key_F);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief QETMainWindow::createPopupMenu
|
||||
The menu shown on a right-click on a toolbar or a dock title, and the
|
||||
Configuration > Afficher submenu: Qt's list of toolbars and docks,
|
||||
then Personnaliser..., as in most applications with toolbars.
|
||||
*/
|
||||
QMenu *QETMainWindow::createPopupMenu()
|
||||
{
|
||||
QMenu *menu = QMainWindow::createPopupMenu();
|
||||
if (menu) {
|
||||
menu -> addSeparator();
|
||||
menu -> addAction(customize_action_);
|
||||
}
|
||||
return menu;
|
||||
}
|
||||
|
||||
/**
|
||||
Check whether a sub menu dedicated to docks and toolbars can be inserted on
|
||||
top of the settings menu.
|
||||
|
||||
Reference in New Issue
Block a user