Changeset View
Changeset View
Standalone View
Standalone View
plugins/defaultTools/connectionTool/ConnectionTool.cpp
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | 63 | ConnectionTool::ConnectionTool(KoCanvasBase * canvas) | |||
---|---|---|---|---|---|
69 | , m_currentStrategy(0) | 69 | , m_currentStrategy(0) | ||
70 | , m_oldSnapStrategies(0) | 70 | , m_oldSnapStrategies(0) | ||
71 | , m_resetPaint(true) | 71 | , m_resetPaint(true) | ||
72 | { | 72 | { | ||
73 | QPixmap connectPixmap; | 73 | QPixmap connectPixmap; | ||
74 | connectPixmap.load(":/cursor_connect.png"); | 74 | connectPixmap.load(":/cursor_connect.png"); | ||
75 | m_connectCursor = QCursor(connectPixmap, 4, 1); | 75 | m_connectCursor = QCursor(connectPixmap, 4, 1); | ||
76 | 76 | | |||
77 | m_editConnectionPoint = new QAction(i18n("Edit connection points"), this); | 77 | KisActionRegistry * actionRegistry = KisActionRegistry::instance(); | ||
78 | m_editConnectionPoint = actionRegistry->makeQAction("toggle-edit-mode", this); | ||||
78 | m_editConnectionPoint->setCheckable(true); | 79 | m_editConnectionPoint->setCheckable(true); | ||
79 | addAction("toggle-edit-mode", m_editConnectionPoint); | 80 | addAction("toggle-edit-mode", m_editConnectionPoint); | ||
80 | 81 | | |||
81 | m_alignPercent = new QAction(QString("%"), this); | 82 | m_alignPercent = actionRegistry->makeQAction("align-relative", this); | ||
82 | m_alignPercent->setCheckable(true); | 83 | m_alignPercent->setCheckable(true); | ||
83 | addAction("align-relative", m_alignPercent); | 84 | addAction("align-relative", m_alignPercent); | ||
84 | m_alignLeft = new QAction(koIcon("align-horizontal-left"), i18n("Align to left edge"), this); | 85 | m_alignLeft = actionRegistry->makeQAction("align-left", this); | ||
85 | m_alignLeft->setCheckable(true); | 86 | m_alignLeft->setCheckable(true); | ||
86 | addAction("align-left", m_alignLeft); | 87 | addAction("align-left", m_alignLeft); | ||
87 | m_alignCenterH = new QAction(koIcon("align-horizontal-center"), i18n("Align to horizontal center"), this); | 88 | m_alignCenterH = actionRegistry->makeQAction("align-centerh", this); | ||
88 | m_alignCenterH->setCheckable(true); | 89 | m_alignCenterH->setCheckable(true); | ||
89 | addAction("align-centerh", m_alignCenterH); | 90 | addAction("align-centerh", m_alignCenterH); | ||
90 | m_alignRight = new QAction(koIcon("align-horizontal-right"), i18n("Align to right edge"), this); | 91 | m_alignRight = actionRegistry->makeQAction("align-right", this); | ||
91 | m_alignRight->setCheckable(true); | 92 | m_alignRight->setCheckable(true); | ||
92 | addAction("align-right", m_alignRight); | 93 | addAction("align-right", m_alignRight); | ||
93 | m_alignTop = new QAction(koIcon("align-vertical-top"), i18n("Align to top edge"), this); | 94 | m_alignTop = actionRegistry->makeQAction("align-top", this); | ||
94 | m_alignTop->setCheckable(true); | 95 | m_alignTop->setCheckable(true); | ||
95 | addAction("align-top", m_alignTop); | 96 | addAction("align-top", m_alignTop); | ||
96 | m_alignCenterV = new QAction(koIcon("align-vertical-center"), i18n("Align to vertical center"), this); | 97 | m_alignCenterV = actionRegistry->makeQAction("align-centerv", this); | ||
97 | m_alignCenterV->setCheckable(true); | 98 | m_alignCenterV->setCheckable(true); | ||
98 | addAction("align-centerv", m_alignCenterV); | 99 | addAction("align-centerv", m_alignCenterV); | ||
99 | m_alignBottom = new QAction(koIcon("align-vertical-bottom"), i18n("Align to bottom edge"), this); | 100 | m_alignBottom = actionRegistry->makeQAction("align-bottom", this); | ||
100 | m_alignBottom->setCheckable(true); | 101 | m_alignBottom->setCheckable(true); | ||
101 | addAction("align-bottom", m_alignBottom); | 102 | addAction("align-bottom", m_alignBottom); | ||
102 | 103 | | |||
103 | m_escapeAll = new QAction(koIcon("escape-direction-all"), i18n("Escape in all directions"), this); | 104 | m_escapeAll = actionRegistry->makeQAction("escape-all", this); | ||
104 | m_escapeAll->setCheckable(true); | 105 | m_escapeAll->setCheckable(true); | ||
105 | addAction("escape-all", m_escapeAll); | 106 | addAction("escape-all", m_escapeAll); | ||
106 | m_escapeHorizontal = new QAction(koIcon("escape-direction-horizontal"), i18n("Escape in horizontal directions"), this); | 107 | m_escapeHorizontal = actionRegistry->makeQAction("escape-horizontal", this); | ||
107 | m_escapeHorizontal->setCheckable(true); | 108 | m_escapeHorizontal->setCheckable(true); | ||
108 | addAction("escape-horizontal", m_escapeHorizontal); | 109 | addAction("escape-horizontal", m_escapeHorizontal); | ||
109 | m_escapeVertical = new QAction(koIcon("escape-direction-vertical"), i18n("Escape in vertical directions"), this); | 110 | m_escapeVertical = actionRegistry->makeQAction("escape-vertical", this); | ||
110 | m_escapeVertical->setCheckable(true); | 111 | m_escapeVertical->setCheckable(true); | ||
111 | addAction("escape-vertical", m_escapeVertical); | 112 | addAction("escape-vertical", m_escapeVertical); | ||
112 | m_escapeLeft = new QAction(koIcon("escape-direction-left"), i18n("Escape in left direction"), this); | 113 | m_escapeLeft = actionRegistry->makeQAction("escape-left", this); | ||
113 | m_escapeLeft->setCheckable(true); | 114 | m_escapeLeft->setCheckable(true); | ||
114 | addAction("escape-left", m_escapeLeft); | 115 | addAction("escape-left", m_escapeLeft); | ||
115 | m_escapeRight = new QAction(koIcon("escape-direction-right"), i18n("Escape in right direction"), this); | 116 | m_escapeRight = actionRegistry->makeQAction("escape-right", this); | ||
116 | m_escapeRight->setCheckable(true); | 117 | m_escapeRight->setCheckable(true); | ||
117 | addAction("escape-right", m_escapeRight); | 118 | addAction("escape-right", m_escapeRight); | ||
118 | m_escapeUp = new QAction(koIcon("escape-direction-up"), i18n("Escape in up direction"), this); | 119 | m_escapeUp = actionRegistry->makeQAction("escape-up", this); | ||
119 | m_escapeUp->setCheckable(true); | 120 | m_escapeUp->setCheckable(true); | ||
120 | addAction("escape-up", m_escapeUp); | 121 | addAction("escape-up", m_escapeUp); | ||
121 | m_escapeDown = new QAction(koIcon("escape-direction-down"), i18n("Escape in down direction"), this); | 122 | m_escapeDown = actionRegistry->makeQAction("escape-down", this); | ||
122 | m_escapeDown->setCheckable(true); | 123 | m_escapeDown->setCheckable(true); | ||
123 | addAction("escape-down", m_escapeDown); | 124 | addAction("escape-down", m_escapeDown); | ||
124 | 125 | | |||
125 | m_alignHorizontal = new QActionGroup(this); | 126 | m_alignHorizontal = new QActionGroup(this); | ||
126 | m_alignHorizontal->setExclusive(true); | 127 | m_alignHorizontal->setExclusive(true); | ||
127 | m_alignHorizontal->addAction(m_alignLeft); | 128 | m_alignHorizontal->addAction(m_alignLeft); | ||
128 | m_alignHorizontal->addAction(m_alignCenterH); | 129 | m_alignHorizontal->addAction(m_alignCenterH); | ||
129 | m_alignHorizontal->addAction(m_alignRight); | 130 | m_alignHorizontal->addAction(m_alignRight); | ||
▲ Show 20 Lines • Show All 827 Lines • Show Last 20 Lines |