Changeset View
Changeset View
Standalone View
Standalone View
plugins/dockers/griddocker/griddocker_dock.cpp
Show All 28 Lines | |||||
29 | #include "kis_image.h" | 29 | #include "kis_image.h" | ||
30 | #include "kis_paint_device.h" | 30 | #include "kis_paint_device.h" | ||
31 | #include "kis_signal_compressor.h" | 31 | #include "kis_signal_compressor.h" | ||
32 | #include "grid_config_widget.h" | 32 | #include "grid_config_widget.h" | ||
33 | #include "kis_grid_manager.h" | 33 | #include "kis_grid_manager.h" | ||
34 | #include "kis_grid_config.h" | 34 | #include "kis_grid_config.h" | ||
35 | #include "kis_guides_manager.h" | 35 | #include "kis_guides_manager.h" | ||
36 | #include "kis_guides_config.h" | 36 | #include "kis_guides_config.h" | ||
37 | #include "kis_action.h" | ||||
37 | 38 | | |||
38 | 39 | | |||
39 | GridDockerDock::GridDockerDock( ) | 40 | GridDockerDock::GridDockerDock( ) | ||
40 | : QDockWidget(i18n("Grid and Guides")) | 41 | : QDockWidget(i18n("Grid and Guides")) | ||
41 | , m_canvas(0) | 42 | , m_canvas(0) | ||
42 | { | 43 | { | ||
43 | m_configWidget = new GridConfigWidget(this); | 44 | m_configWidget = new GridConfigWidget(this); | ||
44 | connect(m_configWidget, SIGNAL(gridValueChanged()), SLOT(slotGuiGridConfigChanged())); | 45 | connect(m_configWidget, SIGNAL(gridValueChanged()), SLOT(slotGuiGridConfigChanged())); | ||
Show All 22 Lines | 56 | { | |||
67 | 68 | | |||
68 | if (m_canvas) { | 69 | if (m_canvas) { | ||
69 | m_canvasConnections.addConnection( | 70 | m_canvasConnections.addConnection( | ||
70 | m_canvas->viewManager()->gridManager(), | 71 | m_canvas->viewManager()->gridManager(), | ||
71 | SIGNAL(sigRequestUpdateGridConfig(const KisGridConfig&)), | 72 | SIGNAL(sigRequestUpdateGridConfig(const KisGridConfig&)), | ||
72 | this, | 73 | this, | ||
73 | SLOT(slotGridConfigUpdateRequested(const KisGridConfig&))); | 74 | SLOT(slotGridConfigUpdateRequested(const KisGridConfig&))); | ||
74 | 75 | | |||
76 | KisAction* action = m_canvas->viewManager()->actionManager()->actionByName("view_ruler"); | ||||
77 | | ||||
78 | m_canvasConnections.addConnection(m_configWidget,SIGNAL(showRulersChanged(bool)),action,SLOT(setChecked(bool))); | ||||
79 | m_canvasConnections.addConnection(action,SIGNAL(toggled(bool)),m_configWidget,SLOT(setShowRulers(bool))); | ||||
80 | m_configWidget->setShowRulers(action->isChecked()); | ||||
81 | | ||||
75 | m_canvasConnections.addConnection( | 82 | m_canvasConnections.addConnection( | ||
76 | m_canvas->viewManager()->guidesManager(), | 83 | m_canvas->viewManager()->guidesManager(), | ||
77 | SIGNAL(sigRequestUpdateGuidesConfig(const KisGuidesConfig&)), | 84 | SIGNAL(sigRequestUpdateGuidesConfig(const KisGuidesConfig&)), | ||
78 | this, | 85 | this, | ||
79 | SLOT(slotGuidesConfigUpdateRequested(const KisGuidesConfig&))); | 86 | SLOT(slotGuidesConfigUpdateRequested(const KisGuidesConfig&))); | ||
80 | 87 | | |||
81 | QRect rc = m_canvas->image()->bounds(); | 88 | QRect rc = m_canvas->image()->bounds(); | ||
82 | m_configWidget->setGridDivision(rc.width() / 2, rc.height() / 2); | 89 | m_configWidget->setGridDivision(rc.width() / 2, rc.height() / 2); | ||
Show All 29 Lines |