Changeset View
Changeset View
Standalone View
Standalone View
krusader/ActionMan/useractionpage.cpp
Show First 20 Lines • Show All 116 Lines • ▼ Show 20 Line(s) | 56 | { | |||
---|---|---|---|---|---|
117 | QSplitter *split = new QSplitter(this); | 117 | QSplitter *split = new QSplitter(this); | ||
118 | layout->addWidget(split, 1000); // again a very large stretch-factor to fix the height of the toolbar | 118 | layout->addWidget(split, 1000); // again a very large stretch-factor to fix the height of the toolbar | ||
119 | 119 | | |||
120 | actionTree = new UserActionListView(split); | 120 | actionTree = new UserActionListView(split); | ||
121 | actionTree->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); | 121 | actionTree->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); | ||
122 | actionProperties = new ActionProperty(split); | 122 | actionProperties = new ActionProperty(split); | ||
123 | actionProperties->setEnabled(false); // if there are any actions in the list, the first is displayed and this widget is enabled | 123 | actionProperties->setEnabled(false); // if there are any actions in the list, the first is displayed and this widget is enabled | ||
124 | 124 | | |||
125 | connect(actionTree, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), SLOT(slotChangeCurrent())); | 125 | connect(actionTree, &UserActionListView::currentItemChanged, this, &UserActionPage::slotChangeCurrent); | ||
126 | connect(newButton, SIGNAL(clicked()), SLOT(slotNewAction())); | 126 | connect(newButton, &QToolButton::clicked, this, &UserActionPage::slotNewAction); | ||
127 | connect(removeButton, SIGNAL(clicked()), SLOT(slotRemoveAction())); | 127 | connect(removeButton, &QToolButton::clicked, this, &UserActionPage::slotRemoveAction); | ||
128 | connect(importButton, SIGNAL(clicked()), SLOT(slotImport())); | 128 | connect(importButton, &QToolButton::clicked, this, &UserActionPage::slotImport); | ||
129 | connect(exportButton, SIGNAL(clicked()), SLOT(slotExport())); | 129 | connect(exportButton, &QToolButton::clicked, this, &UserActionPage::slotExport); | ||
130 | connect(copyButton, SIGNAL(clicked()), SLOT(slotToClip())); | 130 | connect(copyButton, &QToolButton::clicked, this, &UserActionPage::slotToClip); | ||
131 | connect(pasteButton, SIGNAL(clicked()), SLOT(slotFromClip())); | 131 | connect(pasteButton, &QToolButton::clicked, this, &UserActionPage::slotFromClip); | ||
132 | 132 | | |||
133 | // forwards the changed signal of the properties | 133 | // forwards the changed signal of the properties | ||
134 | connect(actionProperties, SIGNAL(changed()), SIGNAL(changed())); | 134 | connect(actionProperties, SIGNAL(changed()), SIGNAL(changed())); | ||
135 | 135 | | |||
136 | actionTree->setFirstActionCurrent(); | 136 | actionTree->setFirstActionCurrent(); | ||
137 | actionTree->setFocus(); | 137 | actionTree->setFocus(); | ||
138 | } | 138 | } | ||
139 | 139 | | |||
140 | UserActionPage::~UserActionPage() | 140 | UserActionPage::~UserActionPage() | ||
141 | { | 141 | { | ||
142 | } | 142 | } | ||
143 | 143 | | |||
144 | bool UserActionPage::continueInSpiteOfChanges() | 144 | bool UserActionPage::continueInSpiteOfChanges() | ||
145 | { | 145 | { | ||
146 | if (! actionProperties->isModified()) | 146 | if (! actionProperties->isModified()) | ||
147 | return true; | 147 | return true; | ||
148 | 148 | | |||
149 | int answer = KMessageBox::questionYesNoCancel(this, | 149 | int answer = KMessageBox::questionYesNoCancel(this, | ||
150 | i18n("The current action has been modified. Do you want to apply these changes?") | 150 | i18n("The current action has been modified. Do you want to apply these changes?") | ||
151 | ); | 151 | ); | ||
152 | if (answer == KMessageBox::Cancel) { | 152 | if (answer == KMessageBox::Cancel) { | ||
153 | disconnect(actionTree, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(slotChangeCurrent())); | 153 | disconnect(actionTree, &UserActionListView::currentItemChanged, this, &UserActionPage::slotChangeCurrent); | ||
154 | actionTree->setCurrentAction(actionProperties->action()); | 154 | actionTree->setCurrentAction(actionProperties->action()); | ||
155 | connect(actionTree, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), SLOT(slotChangeCurrent())); | 155 | connect(actionTree, &UserActionListView::currentItemChanged, this, &UserActionPage::slotChangeCurrent); | ||
156 | return false; | 156 | return false; | ||
157 | } | 157 | } | ||
158 | if (answer == KMessageBox::Yes) { | 158 | if (answer == KMessageBox::Yes) { | ||
159 | if (! actionProperties->validProperties()) { | 159 | if (! actionProperties->validProperties()) { | ||
160 | disconnect(actionTree, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(slotChangeCurrent())); | 160 | disconnect(actionTree, &UserActionListView::currentItemChanged, this, &UserActionPage::slotChangeCurrent); | ||
161 | actionTree->setCurrentAction(actionProperties->action()); | 161 | actionTree->setCurrentAction(actionProperties->action()); | ||
162 | connect(actionTree, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), SLOT(slotChangeCurrent())); | 162 | connect(actionTree, &UserActionListView::currentItemChanged, this, &UserActionPage::slotChangeCurrent); | ||
163 | return false; | 163 | return false; | ||
164 | } | 164 | } | ||
165 | slotUpdateAction(); | 165 | slotUpdateAction(); | ||
166 | } // if Yes | 166 | } // if Yes | ||
167 | return true; | 167 | return true; | ||
168 | } | 168 | } | ||
169 | 169 | | |||
170 | void UserActionPage::slotChangeCurrent() | 170 | void UserActionPage::slotChangeCurrent() | ||
▲ Show 20 Lines • Show All 186 Lines • Show Last 20 Lines |