comparison libgui/graphics/MouseModeActionGroup.cc @ 18692:fe0e34be5576

maint: untabify recently added code files. * Backend.cc, BaseControl.cc, ButtonControl.cc, Canvas.cc, Canvas.h, CheckBoxControl.cc, Container.cc, ContextMenu.cc, EditControl.cc, Figure.cc, Figure.h, GLCanvas.h, ListBoxControl.cc, Menu.cc, MouseModeActionGroup.cc, Object.cc, Object.h, ObjectFactory.cc, ObjectProxy.cc, Panel.cc, PopupMenuControl.cc, PushButtonControl.cc, PushTool.cc, QtHandlesUtils.cc, QtHandlesUtils.h, RadioButtonControl.cc, SliderControl.cc, TextControl.cc, ToggleButtonControl.cc, ToggleTool.cc, ToolBar.cc, ToolBarButton.cc, __init_qt__.cc, pt-jit.cc, ov-classdef.cc, ov-classdef.h: Untabify code.
author Rik <rik@octave.org>
date Sun, 27 Apr 2014 18:02:47 -0700
parents 523878f76518
children dbb207d10d7c
comparison
equal deleted inserted replaced
18691:9a6646cc7c3e 18692:fe0e34be5576
35 35
36 MouseModeActionGroup::MouseModeActionGroup (QObject* parent) 36 MouseModeActionGroup::MouseModeActionGroup (QObject* parent)
37 : QObject (parent), m_current (0) 37 : QObject (parent), m_current (0)
38 { 38 {
39 m_actions.append (new QAction (QIcon (":/images/rotate.png"), 39 m_actions.append (new QAction (QIcon (":/images/rotate.png"),
40 tr ("Rotate"), this)); 40 tr ("Rotate"), this));
41 m_actions.append (new QAction (QIcon (":/images/zoom.png"), 41 m_actions.append (new QAction (QIcon (":/images/zoom.png"),
42 tr ("Zoom"), this)); 42 tr ("Zoom"), this));
43 m_actions.append (new QAction (QIcon (":/images/pan.png"), 43 m_actions.append (new QAction (QIcon (":/images/pan.png"),
44 tr ("Pan"), this)); 44 tr ("Pan"), this));
45 m_actions.append (new QAction (QIcon (":/images/select.png"), 45 m_actions.append (new QAction (QIcon (":/images/select.png"),
46 tr ("Select"), this)); 46 tr ("Select"), this));
47 m_actions[2]->setEnabled (false); 47 m_actions[2]->setEnabled (false);
48 m_actions[3]->setEnabled (false); 48 m_actions[3]->setEnabled (false);
49 49
50 foreach (QAction* a, m_actions) 50 foreach (QAction* a, m_actions)
51 { 51 {
61 void MouseModeActionGroup::actionToggled (bool checked) 61 void MouseModeActionGroup::actionToggled (bool checked)
62 { 62 {
63 if (! checked) 63 if (! checked)
64 { 64 {
65 if (sender () == m_current) 65 if (sender () == m_current)
66 { 66 {
67 m_current = 0; 67 m_current = 0;
68 emit modeChanged (NoMode); 68 emit modeChanged (NoMode);
69 } 69 }
70 } 70 }
71 else 71 else
72 { 72 {
73 int i = m_actions.indexOf (qobject_cast<QAction*> (sender ())); 73 int i = m_actions.indexOf (qobject_cast<QAction*> (sender ()));
74 74
75 if (i >= 0) 75 if (i >= 0)
76 { 76 {
77 m_current = m_actions[i]; 77 m_current = m_actions[i];
78 for (int j = 0; j < m_actions.size (); j++) 78 for (int j = 0; j < m_actions.size (); j++)
79 if (j != i) 79 if (j != i)
80 m_actions[j]->setChecked (false); 80 m_actions[j]->setChecked (false);
81 emit modeChanged (static_cast<MouseMode> (i+1)); 81 emit modeChanged (static_cast<MouseMode> (i+1));
82 } 82 }
83 } 83 }
84 } 84 }
85 85
86 MouseMode MouseModeActionGroup::mouseMode (void) const 86 MouseMode MouseModeActionGroup::mouseMode (void) const
87 { 87 {