| 162 | |
| 163 | |
| 164 | void AutomationPatternView::constructContextMenu( QMenu * _cm ) |
| 165 | { |
| 166 | QAction * a = new QAction( embed::getIconPixmap( "automation" ), |
| 167 | tr( "Open in Automation editor" ), _cm ); |
| 168 | _cm->insertAction( _cm->actions()[0], a ); |
| 169 | connect(a, SIGNAL(triggered()), this, SLOT(openInAutomationEditor())); |
| 170 | _cm->insertSeparator( _cm->actions()[1] ); |
| 171 | |
| 172 | _cm->addSeparator(); |
| 173 | |
| 174 | _cm->addAction( embed::getIconPixmap( "edit_erase" ), |
| 175 | tr( "Clear" ), m_pat, SLOT( clear() ) ); |
| 176 | _cm->addSeparator(); |
| 177 | |
| 178 | _cm->addAction( embed::getIconPixmap( "reload" ), tr( "Reset name" ), |
| 179 | this, SLOT( resetName() ) ); |
| 180 | _cm->addAction( embed::getIconPixmap( "edit_rename" ), |
| 181 | tr( "Change name" ), |
| 182 | this, SLOT( changeName() ) ); |
| 183 | _cm->addAction( embed::getIconPixmap( "record" ), |
| 184 | tr( "Set/clear record" ), |
| 185 | this, SLOT( toggleRecording() ) ); |
| 186 | _cm->addAction( embed::getIconPixmap( "flip_y" ), |
| 187 | tr( "Flip Vertically (Visible)" ), |
| 188 | this, SLOT( flipY() ) ); |
| 189 | _cm->addAction( embed::getIconPixmap( "flip_x" ), |
| 190 | tr( "Flip Horizontally (Visible)" ), |
| 191 | this, SLOT( flipX() ) ); |
| 192 | if( !m_pat->m_objects.isEmpty() ) |
| 193 | { |
| 194 | _cm->addSeparator(); |
| 195 | QMenu * m = new QMenu( tr( "%1 Connections" ). |
| 196 | arg( m_pat->m_objects.count() ), _cm ); |
| 197 | for( AutomationPattern::objectVector::iterator it = |
| 198 | m_pat->m_objects.begin(); |
| 199 | it != m_pat->m_objects.end(); ++it ) |
| 200 | { |
| 201 | if( *it ) |
| 202 | { |
| 203 | a = new QAction( tr( "Disconnect \"%1\"" ). |
| 204 | arg( ( *it )->fullDisplayName() ), m ); |
| 205 | a->setData( ( *it )->id() ); |
| 206 | m->addAction( a ); |
| 207 | } |
| 208 | } |
| 209 | connect( m, SIGNAL( triggered( QAction * ) ), |
| 210 | this, SLOT( disconnectObject( QAction * ) ) ); |
| 211 | _cm->addMenu( m ); |
| 212 | } |
| 213 | |
| 214 | _cm->addSeparator(); |
| 215 | } |
| 216 | |
| 217 | |
| 218 |
nothing calls this directly
no test coverage detected