Rev 17932 | Rev 18645 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4430 | cbradney | 1 | /* |
2 | For general Scribus (>=1.3.2) copyright and licensing information please refer |
||
3 | to the COPYING file provided with the program. Following this notice may exist |
||
4 | a copyright and/or license notice that predates the release of Scribus 1.3.2 |
||
5 | for which a new license (GPL+exception) is in place. |
||
6 | */ |
||
2218 | cbradney | 7 | /*************************************************************************** |
1111 | tsoots | 8 | * Copyright (C) 2005 by Riku Leino * |
5116 | tsoots | 9 | * riku@scribus.info * |
1111 | tsoots | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * |
||
12 | * it under the terms of the GNU General Public License as published by * |
||
13 | * the Free Software Foundation; either version 2 of the License, or * |
||
14 | * (at your option) any later version. * |
||
15 | * * |
||
16 | * This program is distributed in the hope that it will be useful, * |
||
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||
19 | * GNU General Public License for more details. * |
||
20 | * * |
||
21 | * You should have received a copy of the GNU General Public License * |
||
22 | * along with this program; if not, write to the * |
||
23 | * Free Software Foundation, Inc., * |
||
18122 | mrdocs | 24 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * |
1111 | tsoots | 25 | ***************************************************************************/ |
26 | |||
27 | #include "undomanager.h" |
||
11576 | avox | 28 | |
29 | #include <QDebug> |
||
30 | #include <QList> |
||
31 | #include <QPixmap> |
||
32 | |||
1197 | tsoots | 33 | #include "prefscontext.h" |
34 | #include "prefsfile.h" |
||
11576 | avox | 35 | #include "prefsmanager.h" |
36 | #include "scconfig.h" |
||
37 | #include "scpaths.h" |
||
5116 | tsoots | 38 | #include "scraction.h" |
5781 | cbradney | 39 | #include "scribuscore.h" |
11576 | avox | 40 | #include "undogui.h" |
5116 | tsoots | 41 | #include "undostack.h" |
10200 | cbradney | 42 | #include "util_icon.h" |
1693 | craig | 43 | |
11576 | avox | 44 | |
45 | /**************************************************************************************/ |
||
46 | |||
47 | /** |
||
48 | This struct is use instead of std::pair<TransactionObject*, TransactionState*> now. |
||
49 | Just data, no methods. |
||
50 | */ |
||
51 | struct TransactionData : public Transaction::TransactionStateBase |
||
52 | { |
||
53 | int stackLevel; |
||
54 | UndoManager* UM; |
||
55 | UndoObject* transactionObject; // will be DummyUndoObject |
||
56 | TransactionState* transactionState; |
||
57 | }; |
||
58 | |||
59 | |||
60 | /**************************************************************************************/ |
||
61 | |||
62 | |||
63 | |||
5116 | tsoots | 64 | UndoManager* UndoManager::instance_ = 0; |
65 | bool UndoManager::undoEnabled_ = true; |
||
66 | int UndoManager::undoEnabledCounter_ = 0; |
||
1111 | tsoots | 67 | |
68 | UndoManager* UndoManager::instance() |
||
69 | { |
||
5116 | tsoots | 70 | if (instance_ == 0) |
71 | instance_ = new UndoManager(); |
||
1111 | tsoots | 72 | |
5116 | tsoots | 73 | return instance_; |
1111 | tsoots | 74 | } |
75 | |||
76 | void UndoManager::setUndoEnabled(bool isEnabled) |
||
77 | { |
||
5116 | tsoots | 78 | if (isEnabled && undoEnabledCounter_ == 0) |
1430 | tsoots | 79 | return; // nothing to do undo is already enabled. |
5116 | tsoots | 80 | else if (isEnabled && undoEnabledCounter_ > 0) |
81 | --undoEnabledCounter_; |
||
1430 | tsoots | 82 | else if (!isEnabled) |
5116 | tsoots | 83 | ++undoEnabledCounter_; |
1430 | tsoots | 84 | |
5116 | tsoots | 85 | undoEnabled_ = undoEnabledCounter_ == 0; |
86 | if (undoEnabled_) |
||
1111 | tsoots | 87 | connectGuis(); |
5116 | tsoots | 88 | else if (undoEnabledCounter_ == 1) |
1430 | tsoots | 89 | disconnectGuis(); // disconnect only once when setUndoEnabled(false) has been called |
90 | // no need to call again if next setUndoEnabled() call will also be false. |
||
1111 | tsoots | 91 | } |
92 | |||
93 | bool UndoManager::undoEnabled() |
||
94 | { |
||
5116 | tsoots | 95 | return undoEnabled_; |
1111 | tsoots | 96 | } |
97 | |||
98 | UndoManager::UndoManager() |
||
99 | { |
||
5116 | tsoots | 100 | currentUndoObjectId_ = -1; |
1190 | tsoots | 101 | if (!UndoManager::IGuides) |
102 | initIcons(); |
||
5116 | tsoots | 103 | prefs_ = PrefsManager::instance()->prefsFile->getContext("undo"); |
2198 | cbradney | 104 | languageChange(); |
5938 | tsoots | 105 | setUndoEnabled(prefs_->getBool("enabled", true)); |
1111 | tsoots | 106 | } |
107 | |||
13371 | jghali | 108 | UndoTransaction UndoManager::beginTransaction(const TransactionSettings& settings) |
109 | { |
||
110 | return UndoManager::beginTransaction(settings.targetName, settings.targetPixmap, settings.actionName, |
||
111 | settings.description, settings.actionPixmap); |
||
112 | } |
||
11576 | avox | 113 | |
114 | UndoTransaction UndoManager::beginTransaction(const QString &targetName, |
||
115 | QPixmap *targetPixmap, |
||
116 | const QString &name, |
||
117 | const QString &description, |
||
118 | QPixmap *actionPixmap) |
||
1213 | tsoots | 119 | { |
5116 | tsoots | 120 | if (!undoEnabled_) |
11576 | avox | 121 | return UndoTransaction(NULL); |
122 | |||
123 | /** @brief Dummy object for storing transaction target's name */ |
||
124 | UndoObject* transactionTarget_ = new DummyUndoObject(); |
||
125 | TransactionState* transactionState_ = new TransactionState(); |
||
5116 | tsoots | 126 | transactionTarget_->setUName(targetName); // Name which will be in action history |
1250 | tsoots | 127 | if (targetPixmap) |
5116 | tsoots | 128 | transactionTarget_->setUPixmap(targetPixmap); |
1228 | tsoots | 129 | if (name.length() > 0) // if left to 0 length action will be fetched from the |
11576 | avox | 130 | transactionState_->setName(name); // last added UndoState in this transaction |
1238 | tsoots | 131 | if (description.length() > 0) |
11576 | avox | 132 | transactionState_->setDescription(description); // tool tip for action history |
1250 | tsoots | 133 | if (actionPixmap) |
11576 | avox | 134 | transactionState_->setPixmap(actionPixmap); // for action history |
135 | |||
136 | // Holds the state and data of this transaction: |
||
137 | TransactionData *transaction = new TransactionData(); |
||
138 | transaction->transactionObject = transactionTarget_; |
||
139 | transaction->transactionState = transactionState_; |
||
140 | transaction->stackLevel = transactions_.size(); |
||
141 | transaction->UM = this; |
||
142 | |||
143 | transactions_.push_back(transaction); |
||
144 | |||
145 | // qDebug() << "UndoManager::beginTransaction" << targetName << name << transaction; |
||
146 | return UndoTransaction(transaction); |
||
1213 | tsoots | 147 | } |
148 | |||
11576 | avox | 149 | UndoTransaction::UndoTransaction(TransactionData* data) : Transaction(data) |
150 | {}; |
||
151 | |||
152 | UndoTransaction::~UndoTransaction() |
||
1213 | tsoots | 153 | { |
11576 | avox | 154 | if (m_data) |
1238 | tsoots | 155 | { |
11576 | avox | 156 | UndoTransaction::cancel(); // no virtual calls in destructor |
157 | delete m_data; |
||
158 | m_data = 0; |
||
1238 | tsoots | 159 | } |
1213 | tsoots | 160 | } |
161 | |||
11576 | avox | 162 | bool UndoTransaction::cancel() |
1213 | tsoots | 163 | { |
11576 | avox | 164 | if (!m_data) |
165 | return false; |
||
166 | |||
167 | TransactionData* data = static_cast<TransactionData*>(m_data); |
||
168 | UndoManager* UM = data->UM; |
||
169 | int stackLevel = data->stackLevel; |
||
170 | |||
171 | switch (m_data->m_status) |
||
1213 | tsoots | 172 | { |
11576 | avox | 173 | case Transaction::STATE_OPEN: |
174 | case Transaction::STATE_WILLFAIL: |
||
175 | // qDebug() << "UndoManager::cancelTransaction" << data << data->transactionObject->getUName() << data->transactionState->getName() << stackLevel; |
||
176 | data->m_status = Transaction::STATE_FAILED; |
||
177 | delete data->transactionObject; |
||
178 | data->transactionObject = 0; |
||
179 | delete data->transactionState; |
||
180 | data->transactionState = 0; |
||
181 | //brutal for now: |
||
182 | assert (stackLevel + 1 == signed(UM->transactions_.size())); |
||
183 | if (stackLevel < signed(UM->transactions_.size())) |
||
184 | { |
||
185 | UM->transactions_.erase(UM->transactions_.begin() + stackLevel); |
||
186 | } |
||
187 | return true; |
||
188 | default: |
||
189 | // do nothing; |
||
190 | // qDebug() << "UndoManager::cancelTransaction ** already closed **"; |
||
191 | return false; |
||
1213 | tsoots | 192 | } |
11576 | avox | 193 | } |
1213 | tsoots | 194 | |
11576 | avox | 195 | bool UndoTransaction::commit(const QString &targetName, |
196 | QPixmap *targetPixmap, |
||
197 | const QString &name, |
||
198 | const QString &description, |
||
199 | QPixmap *actionPixmap) |
||
200 | { |
||
201 | if (m_data && m_data->m_status == Transaction::STATE_OPEN) |
||
202 | { |
||
203 | TransactionData* data = static_cast<TransactionData*>(m_data); |
||
204 | if (targetName.length() > 0) |
||
205 | data->transactionObject->setUName(targetName); |
||
206 | if (targetPixmap) |
||
207 | data->transactionObject->setUPixmap(targetPixmap); |
||
208 | if (name.length() > 0) |
||
209 | data->transactionState->setName(name); |
||
210 | if (description.length() > 0) |
||
211 | data->transactionState->setDescription(description); |
||
212 | if (actionPixmap) |
||
213 | data->transactionState->setPixmap(actionPixmap); |
||
214 | } |
||
215 | return commit(); |
||
216 | } |
||
217 | |||
218 | |||
219 | bool UndoTransaction::commit() |
||
220 | { |
||
221 | if (!m_data) |
||
222 | return false; |
||
223 | TransactionData* data = static_cast<TransactionData*>(m_data); |
||
224 | UndoManager* UM = data->UM; |
||
225 | int stackLevel = data->stackLevel; |
||
1238 | tsoots | 226 | |
11576 | avox | 227 | if (!UM->undoEnabled_) |
1226 | tsoots | 228 | { |
11576 | avox | 229 | cancel(); |
230 | return false; |
||
1238 | tsoots | 231 | } |
11576 | avox | 232 | |
233 | UndoObject *tmpu = UM->transactions_.at(stackLevel)->transactionObject; |
||
234 | TransactionState *tmps = UM->transactions_.at(stackLevel)->transactionState; |
||
235 | |||
236 | switch (m_data->m_status) |
||
1238 | tsoots | 237 | { |
11576 | avox | 238 | case Transaction::STATE_OPEN: |
239 | // qDebug() << "UndoManager::commitTransaction" << data << data->transactionObject->getUName() << data->transactionState->getName() << stackLevel; |
||
240 | m_data->m_status = Transaction::STATE_COMMITTED; |
||
1238 | tsoots | 241 | |
11576 | avox | 242 | // brutal for now: |
243 | assert (stackLevel + 1 == signed(UM->transactions_.size())); |
||
244 | |||
245 | if (stackLevel < signed(UM->transactions_.size())) |
||
246 | { |
||
247 | UM->transactions_.erase(UM->transactions_.begin() + stackLevel); |
||
248 | } |
||
249 | |||
250 | if (tmps->sizet() > 0) // are there any actions inside the commited transaction |
||
251 | { |
||
252 | if (tmps->getName().isEmpty()) |
||
253 | tmps->useActionName(); |
||
254 | UM->action(tmpu, tmps); |
||
255 | } // if not just delete objects |
||
256 | else |
||
257 | { |
||
258 | delete tmpu; |
||
259 | tmpu = 0; |
||
260 | delete tmps; |
||
261 | tmps = 0; |
||
262 | } |
||
263 | return true; |
||
264 | break; |
||
265 | case STATE_WILLFAIL: |
||
266 | return cancel(); |
||
267 | break; |
||
268 | default: |
||
269 | // qDebug() << "UndoManager::commitTransaction ** already closed **"; |
||
270 | // nothing |
||
271 | break; |
||
1226 | tsoots | 272 | } |
11576 | avox | 273 | return false; |
1213 | tsoots | 274 | } |
275 | |||
276 | bool UndoManager::isTransactionMode() |
||
277 | { |
||
11576 | avox | 278 | return transactions_.size() > 0; |
1213 | tsoots | 279 | } |
280 | |||
1111 | tsoots | 281 | void UndoManager::registerGui(UndoGui* gui) |
282 | { |
||
2604 | tsoots | 283 | if (gui == 0) |
1111 | tsoots | 284 | return; |
285 | |||
286 | setUndoEnabled(false); |
||
287 | setState(gui); |
||
5116 | tsoots | 288 | undoGuis_.push_back(gui); |
1431 | tsoots | 289 | setUndoEnabled(true); |
1111 | tsoots | 290 | } |
291 | |||
292 | void UndoManager::setState(UndoGui* gui, int uid) |
||
293 | { |
||
294 | gui->clear(); |
||
1443 | tsoots | 295 | |
5116 | tsoots | 296 | if ( stacks_[currentDoc_].size() == 0 ) |
4293 | mrdocs | 297 | return; |
298 | |||
5116 | tsoots | 299 | StateList::iterator itstartU = stacks_[currentDoc_].undoActions_.begin(); // undo actions |
300 | StateList::iterator itendU = stacks_[currentDoc_].undoActions_.end(); |
||
301 | |||
302 | StateList::iterator itstartR = stacks_[currentDoc_].redoActions_.begin(); // redo actions |
||
303 | StateList::iterator itendR = stacks_[currentDoc_].redoActions_.end(); |
||
304 | |||
1443 | tsoots | 305 | if (uid > -1) |
1477 | tsoots | 306 | { // find the range from where actions are added when in obj. spec. mode |
5116 | tsoots | 307 | StateList::iterator it2; |
308 | for (it2 = stacks_[currentDoc_].undoActions_.begin(); |
||
309 | it2 != stacks_[currentDoc_].undoActions_.end(); ++it2) |
||
1443 | tsoots | 310 | { |
5116 | tsoots | 311 | UndoState* tmp = *it2; |
1443 | tsoots | 312 | TransactionState *ts = dynamic_cast<TransactionState*>(tmp); |
5116 | tsoots | 313 | if (ts && !ts->containsOnly(uid)) |
1443 | tsoots | 314 | { |
5116 | tsoots | 315 | if (it2 != stacks_[currentDoc_].undoActions_.begin()) |
316 | itendU = --it2; |
||
1443 | tsoots | 317 | break; |
318 | } |
||
319 | } |
||
5116 | tsoots | 320 | StateList::iterator it3; |
321 | for (it3 = stacks_[currentDoc_].redoActions_.begin(); |
||
322 | it3 != stacks_[currentDoc_].redoActions_.end(); ++it3) |
||
1477 | tsoots | 323 | { |
5116 | tsoots | 324 | UndoState* tmp = *it3; |
1477 | tsoots | 325 | TransactionState *ts = dynamic_cast<TransactionState*>(tmp); |
5116 | tsoots | 326 | if (ts && !ts->containsOnly(uid)) |
1477 | tsoots | 327 | { |
5116 | tsoots | 328 | itendR = it3; |
1477 | tsoots | 329 | break; |
330 | } |
||
331 | } |
||
1443 | tsoots | 332 | } |
1477 | tsoots | 333 | |
5116 | tsoots | 334 | if (stacks_[currentDoc_].undoItems() > 0) |
1443 | tsoots | 335 | { |
5116 | tsoots | 336 | if (itendU == stacks_[currentDoc_].undoActions_.end()) |
337 | --itendU; |
||
338 | for (; itendU >= itstartU; --itendU) // insert undo actions |
||
339 | { |
||
340 | UndoState* state = *itendU; |
||
341 | UndoObject* target = state->undoObject(); |
||
1443 | tsoots | 342 | |
5116 | tsoots | 343 | if (target && (uid == -1 || target->getUId() == static_cast<uint>(uid))) |
344 | gui->insertUndoItem(target, state); |
||
345 | if (itendU == itstartU) |
||
346 | break; |
||
347 | } |
||
348 | } |
||
349 | |||
350 | if (stacks_[currentDoc_].redoItems() > 0) |
||
351 | { |
||
12140 | jghali | 352 | if (itendR > itstartR) |
353 | --itendR; |
||
5116 | tsoots | 354 | for (; itstartR <= itendR; ++itstartR) // insert redo actions |
1443 | tsoots | 355 | { |
5116 | tsoots | 356 | UndoState* state = *itstartR; |
357 | UndoObject* target = state->undoObject(); |
||
358 | |||
359 | if (target && (uid == -1 || target->getUId() == static_cast<uint>(uid))) |
||
1443 | tsoots | 360 | gui->insertRedoItem(target, state); |
5116 | tsoots | 361 | if (itendR == itstartR) |
362 | break; |
||
1443 | tsoots | 363 | } |
1111 | tsoots | 364 | } |
365 | } |
||
366 | |||
367 | void UndoManager::connectGuis() |
||
368 | { |
||
5116 | tsoots | 369 | for (uint i = 0; i < undoGuis_.size(); ++i) |
1111 | tsoots | 370 | { |
5116 | tsoots | 371 | UndoGui *gui = undoGuis_[i]; |
1111 | tsoots | 372 | |
5116 | tsoots | 373 | connect(gui, SIGNAL(undo(int)), this, SLOT(undo(int))); |
374 | connect(gui, SIGNAL(redo(int)), this, SLOT(redo(int))); |
||
1111 | tsoots | 375 | connect(this, SIGNAL(newAction(UndoObject*, UndoState*)), |
376 | gui, SLOT(insertUndoItem(UndoObject*, UndoState*))); |
||
377 | connect(this, SIGNAL(popBack()), gui, SLOT(popBack())); |
||
378 | connect(this, SIGNAL(undoSignal(int)), gui, SLOT(updateUndo(int))); |
||
379 | connect(this, SIGNAL(redoSignal(int)), gui, SLOT(updateRedo(int))); |
||
1457 | tsoots | 380 | connect(this, SIGNAL(clearRedo()), gui, SLOT(clearRedo())); |
4985 | cbradney | 381 | gui->setEnabled(true); |
382 | gui->updateUndoActions(); |
||
1111 | tsoots | 383 | } |
384 | } |
||
385 | |||
386 | void UndoManager::disconnectGuis() |
||
387 | { |
||
5116 | tsoots | 388 | for (uint i = 0; i < undoGuis_.size(); ++i) |
1111 | tsoots | 389 | { |
5116 | tsoots | 390 | UndoGui *gui = undoGuis_[i]; |
1111 | tsoots | 391 | |
5116 | tsoots | 392 | disconnect(gui, SIGNAL(undo(int)), this, SLOT(undo(int))); |
393 | disconnect(gui, SIGNAL(redo(int)), this, SLOT(redo(int))); |
||
1111 | tsoots | 394 | disconnect(this, SIGNAL(newAction(UndoObject*, UndoState*)), |
395 | gui, SLOT(insertUndoItem(UndoObject*, UndoState*))); |
||
396 | disconnect(this, SIGNAL(popBack()), gui, SLOT(popBack())); |
||
397 | disconnect(this, SIGNAL(undoSignal(int)), gui, SLOT(updateUndo(int))); |
||
398 | disconnect(this, SIGNAL(redoSignal(int)), gui, SLOT(updateRedo(int))); |
||
1457 | tsoots | 399 | disconnect(this, SIGNAL(clearRedo()), gui, SLOT(clearRedo())); |
4985 | cbradney | 400 | gui->setEnabled(false); |
1111 | tsoots | 401 | } |
402 | } |
||
403 | |||
404 | void UndoManager::removeGui(UndoGui* gui) |
||
405 | { |
||
9783 | avox | 406 | std::vector<UndoGui*>::iterator it = undoGuis_.begin(); |
407 | while(it != undoGuis_.end()) |
||
408 | { |
||
1111 | tsoots | 409 | if (*it == gui) |
9783 | avox | 410 | it = undoGuis_.erase(it); |
411 | else |
||
412 | ++it; |
||
413 | } |
||
1111 | tsoots | 414 | } |
415 | |||
9783 | avox | 416 | |
1111 | tsoots | 417 | void UndoManager::switchStack(const QString& stackName) |
418 | { |
||
6725 | tsoots | 419 | if (stackName == currentDoc_) |
420 | return; // already current stack |
||
5116 | tsoots | 421 | currentDoc_ = stackName; |
422 | if (!stacks_.contains(currentDoc_)) |
||
423 | stacks_[currentDoc_] = UndoStack(); |
||
1111 | tsoots | 424 | |
17744 | craig | 425 | stacks_[currentDoc_].setMaxSize(prefs_->getInt("historylength", 100)); |
5116 | tsoots | 426 | for (uint i = 0; i < undoGuis_.size(); ++i) |
427 | setState(undoGuis_[i]); |
||
428 | |||
10427 | cbradney | 429 | setTexts(); |
1111 | tsoots | 430 | } |
431 | |||
1252 | tsoots | 432 | void UndoManager::renameStack(const QString& newName) |
1111 | tsoots | 433 | { |
5116 | tsoots | 434 | if (currentDoc_ == newName) |
1190 | tsoots | 435 | return; |
1829 | tsoots | 436 | |
5116 | tsoots | 437 | if (stacks_[currentDoc_].size() == 0) { |
438 | currentDoc_ = newName; |
||
1880 | tsoots | 439 | return; |
440 | } |
||
441 | |||
5116 | tsoots | 442 | UndoStack tmp(stacks_[currentDoc_]); |
10469 | cbradney | 443 | stacks_.remove(currentDoc_); |
5116 | tsoots | 444 | stacks_[newName] = tmp; |
445 | currentDoc_ = newName; |
||
1111 | tsoots | 446 | } |
447 | |||
1252 | tsoots | 448 | void UndoManager::removeStack(const QString& stackName) |
1111 | tsoots | 449 | { |
5116 | tsoots | 450 | if (stacks_.contains(stackName)) |
1111 | tsoots | 451 | { |
5116 | tsoots | 452 | stacks_[stackName].clear(); |
10469 | cbradney | 453 | stacks_.remove(stackName); |
5116 | tsoots | 454 | if (currentDoc_ == stackName) |
1111 | tsoots | 455 | { |
5116 | tsoots | 456 | for (uint i = 0; i < undoGuis_.size(); ++i) |
457 | undoGuis_[i]->clear(); |
||
458 | currentDoc_ = "__no_name__"; |
||
1111 | tsoots | 459 | } |
460 | } |
||
461 | } |
||
462 | |||
5938 | tsoots | 463 | void UndoManager::clearStack() |
464 | { |
||
465 | stacks_[currentDoc_].clear(); |
||
466 | for (uint i = 0; i < undoGuis_.size(); ++i) |
||
467 | { |
||
468 | undoGuis_[i]->clear(); |
||
469 | setState(undoGuis_[i]); |
||
470 | } |
||
471 | } |
||
472 | |||
1340 | tsoots | 473 | void UndoManager::action(UndoObject* target, UndoState* state, QPixmap *targetPixmap) |
1111 | tsoots | 474 | { |
2604 | tsoots | 475 | QPixmap *oldIcon = 0; |
1340 | tsoots | 476 | if (targetPixmap) |
477 | { |
||
478 | oldIcon = target->getUPixmap(); |
||
479 | target->setUPixmap(targetPixmap); |
||
480 | } |
||
1485 | tsoots | 481 | |
5116 | tsoots | 482 | if (!undoEnabled_) // if so flush down the state |
1228 | tsoots | 483 | { |
484 | TransactionState *ts = dynamic_cast<TransactionState*>(state); |
||
485 | if (ts) // flush the TransactionObject too |
||
486 | delete target; |
||
487 | delete state; |
||
488 | return; |
||
489 | } |
||
490 | |||
11576 | avox | 491 | if (!isTransactionMode() && |
5116 | tsoots | 492 | (currentUndoObjectId_ == -1 || currentUndoObjectId_ == static_cast<long>(target->getUId()))) |
11576 | avox | 493 | { |
494 | // qDebug() << "UndoManager: new Action" << state->getName() << "for" << currentUndoObjectId_; |
||
1226 | tsoots | 495 | emit newAction(target, state); // send action to the guis |
11576 | avox | 496 | } |
1457 | tsoots | 497 | else |
11576 | avox | 498 | { |
1457 | tsoots | 499 | emit clearRedo(); |
11576 | avox | 500 | } |
501 | if (isTransactionMode()) |
||
502 | { |
||
503 | // qDebug() << "UndoManager: Action stored for transaction:" << transactions_.back() << target->getUName() << state->getName(); |
||
504 | transactions_.back()->transactionState->pushBack(target, state); |
||
505 | } |
||
1213 | tsoots | 506 | else |
507 | { |
||
11576 | avox | 508 | // qDebug() << "UndoManager: Action executed:" << target->getUName() << state->getName(); |
5116 | tsoots | 509 | state->setUndoObject(target); |
16399 | jghali | 510 | if (stacks_[currentDoc_].action(state)) |
511 | emit popBack(); |
||
1213 | tsoots | 512 | } |
1340 | tsoots | 513 | if (targetPixmap) |
514 | target->setUPixmap(oldIcon); |
||
5116 | tsoots | 515 | |
10427 | cbradney | 516 | setTexts(); |
1111 | tsoots | 517 | } |
1477 | tsoots | 518 | |
1356 | tsoots | 519 | void UndoManager::action(UndoObject* target, UndoState* state, |
520 | const QString &targetName, QPixmap *targetPixmap) |
||
521 | { |
||
522 | QString oldName = target->getUName(); |
||
2877 | cbradney | 523 | if (!targetName.isEmpty()) |
1356 | tsoots | 524 | target->setUName(targetName); |
525 | action(target, state, targetPixmap); |
||
526 | target->setUName(oldName); |
||
527 | } |
||
1111 | tsoots | 528 | |
17641 | craig | 529 | UndoState* UndoManager::getLastUndo(){ |
17719 | craig | 530 | UndoState* state = stacks_[currentDoc_].getNextUndo(Um::GLOBAL_UNDO_MODE); |
17646 | craig | 531 | return state; |
17641 | craig | 532 | } |
533 | |||
1111 | tsoots | 534 | void UndoManager::undo(int steps) |
535 | { |
||
5116 | tsoots | 536 | if (!undoEnabled_) |
537 | return; |
||
538 | |||
13349 | jghali | 539 | emit undoRedoBegin(); |
5116 | tsoots | 540 | setUndoEnabled(false); |
541 | stacks_[currentDoc_].undo(steps, currentUndoObjectId_); |
||
542 | setUndoEnabled(true); |
||
543 | emit undoSignal(steps); |
||
544 | emit undoRedoDone(); |
||
10427 | cbradney | 545 | setTexts(); |
1111 | tsoots | 546 | } |
547 | |||
548 | void UndoManager::redo(int steps) |
||
549 | { |
||
5116 | tsoots | 550 | if (!undoEnabled_) |
551 | return; |
||
552 | |||
13349 | jghali | 553 | emit undoRedoBegin(); |
5116 | tsoots | 554 | setUndoEnabled(false); |
555 | stacks_[currentDoc_].redo(steps, currentUndoObjectId_); |
||
556 | setUndoEnabled(true); |
||
557 | emit redoSignal(steps); |
||
558 | emit undoRedoDone(); |
||
10427 | cbradney | 559 | setTexts(); |
1111 | tsoots | 560 | } |
561 | |||
5116 | tsoots | 562 | bool UndoManager::hasUndoActions(int ) |
1111 | tsoots | 563 | { |
5116 | tsoots | 564 | // TODO Needs to fixed for object specific mode |
565 | return stacks_[currentDoc_].undoItems() > 0; |
||
566 | } |
||
1477 | tsoots | 567 | |
5116 | tsoots | 568 | bool UndoManager::hasRedoActions(int ) |
569 | { |
||
570 | // TODO Needs to be fixed for object specific mode |
||
571 | return stacks_[currentDoc_].redoItems() > 0; |
||
1111 | tsoots | 572 | } |
573 | |||
5116 | tsoots | 574 | void UndoManager::showObject(int uid) |
1477 | tsoots | 575 | { |
5116 | tsoots | 576 | if (currentUndoObjectId_ == uid) |
577 | return; |
||
578 | setUndoEnabled(false); |
||
579 | currentUndoObjectId_ = uid; |
||
580 | for (uint i = 0; i < undoGuis_.size(); ++i) |
||
581 | { |
||
582 | if (uid == -2) |
||
583 | undoGuis_[i]->clear(); |
||
584 | else |
||
585 | setState(undoGuis_[i], currentUndoObjectId_); |
||
586 | } |
||
587 | setUndoEnabled(true); |
||
10427 | cbradney | 588 | setTexts(); |
1477 | tsoots | 589 | } |
590 | |||
5116 | tsoots | 591 | UndoObject* UndoManager::replaceObject(ulong uid, UndoObject *newUndoObject) |
1477 | tsoots | 592 | { |
5116 | tsoots | 593 | UndoObject *tmp = 0; |
11576 | avox | 594 | TransactionState* transaction_ = NULL; |
595 | if (transactions_.size() > 0) |
||
596 | transaction_ = transactions_.at(transactions_.size()-1)->transactionState; |
||
5116 | tsoots | 597 | for (uint i = 0; i < stacks_[currentDoc_].undoActions_.size(); ++i) |
1477 | tsoots | 598 | { |
5116 | tsoots | 599 | UndoState *tmpState = stacks_[currentDoc_].undoActions_[i]; |
600 | TransactionState *ts = dynamic_cast<TransactionState*>(tmpState); |
||
601 | if (ts) |
||
602 | tmp = ts->replace(uid, newUndoObject); |
||
603 | else if (tmpState->undoObject() && tmpState->undoObject()->getUId() == uid) |
||
1477 | tsoots | 604 | { |
5116 | tsoots | 605 | tmp = tmpState->undoObject(); |
606 | tmpState->setUndoObject(newUndoObject); |
||
1477 | tsoots | 607 | } |
608 | } |
||
17640 | craig | 609 | for (uint i = 0; i < stacks_[currentDoc_].redoActions_.size(); ++i) |
610 | { |
||
611 | UndoState *tmpState = stacks_[currentDoc_].redoActions_[i]; |
||
612 | TransactionState *ts = dynamic_cast<TransactionState*>(tmpState); |
||
613 | if (ts) |
||
614 | tmp = ts->replace(uid, newUndoObject); |
||
615 | else if (tmpState->undoObject() && tmpState->undoObject()->getUId() == uid) |
||
616 | { |
||
617 | tmp = tmpState->undoObject(); |
||
618 | tmpState->setUndoObject(newUndoObject); |
||
619 | } |
||
620 | } |
||
5116 | tsoots | 621 | if (transaction_) // replace also in the currently open transaction |
622 | tmp = transaction_->replace(uid, newUndoObject); |
||
623 | return tmp; |
||
1477 | tsoots | 624 | } |
625 | |||
5116 | tsoots | 626 | void UndoManager::setHistoryLength(int steps) |
1213 | tsoots | 627 | { |
5116 | tsoots | 628 | if (steps >= 0) |
1213 | tsoots | 629 | { |
5116 | tsoots | 630 | stacks_[currentDoc_].setMaxSize(static_cast<uint>(steps)); |
7880 | fschmid | 631 | prefs_->set("historylength", stacks_[currentDoc_].maxSize()); |
1213 | tsoots | 632 | } |
633 | } |
||
634 | |||
7880 | fschmid | 635 | void UndoManager::setAllHistoryLengths(int steps) |
636 | { |
||
637 | if (steps >= 0) |
||
638 | { |
||
639 | for (StackMap::Iterator it = stacks_.begin(); it != stacks_.end(); ++it ) |
||
640 | { |
||
10469 | cbradney | 641 | it.value().setMaxSize(static_cast<uint>(steps)); |
7880 | fschmid | 642 | } |
643 | prefs_->set("historylength", steps); |
||
644 | } |
||
645 | } |
||
646 | |||
5116 | tsoots | 647 | int UndoManager::getHistoryLength() |
1111 | tsoots | 648 | { |
5116 | tsoots | 649 | if (stacks_.size() > 0 && stacks_[currentDoc_].redoItems() > 0) |
650 | return -1; |
||
651 | return static_cast<int>(stacks_[currentDoc_].maxSize()); |
||
652 | } |
||
1477 | tsoots | 653 | |
5116 | tsoots | 654 | bool UndoManager::isGlobalMode() |
655 | { |
||
656 | return currentUndoObjectId_ == -1; |
||
657 | } |
||
1228 | tsoots | 658 | |
10427 | cbradney | 659 | void UndoManager::setTexts() |
5116 | tsoots | 660 | { |
661 | if (stacks_[currentDoc_].undoItems() > 0) |
||
662 | { |
||
663 | UndoState *state = stacks_[currentDoc_].getNextUndo(currentUndoObjectId_); |
||
664 | if (state) |
||
5781 | cbradney | 665 | ScCore->primaryMainWindow()->scrActions["editUndoAction"]->setTexts(QString(Um::MenuUndo).arg(state->getName())); |
5116 | tsoots | 666 | else |
5781 | cbradney | 667 | ScCore->primaryMainWindow()->scrActions["editUndoAction"]->setTexts(Um::MenuUndoEmpty); |
5116 | tsoots | 668 | } |
669 | else |
||
5781 | cbradney | 670 | ScCore->primaryMainWindow()->scrActions["editUndoAction"]->setTexts(Um::MenuUndoEmpty); |
1228 | tsoots | 671 | |
5116 | tsoots | 672 | if (stacks_[currentDoc_].redoItems() > 0) |
673 | { |
||
674 | UndoState *state = stacks_[currentDoc_].getNextRedo(currentUndoObjectId_); |
||
675 | if (state) |
||
5781 | cbradney | 676 | ScCore->primaryMainWindow()->scrActions["editRedoAction"]->setTexts(QString(Um::MenuRedo).arg(state->getName())); |
5116 | tsoots | 677 | else |
5781 | cbradney | 678 | ScCore->primaryMainWindow()->scrActions["editRedoAction"]->setTexts(Um::MenuRedoEmpty); |
1111 | tsoots | 679 | } |
5116 | tsoots | 680 | else |
5781 | cbradney | 681 | ScCore->primaryMainWindow()->scrActions["editRedoAction"]->setTexts(Um::MenuRedoEmpty); |
1111 | tsoots | 682 | } |
683 | |||
5116 | tsoots | 684 | void UndoManager::deleteInstance() |
1477 | tsoots | 685 | { |
5116 | tsoots | 686 | if (instance_) |
687 | delete instance_; |
||
688 | instance_ = 0; |
||
1477 | tsoots | 689 | } |
690 | |||
5116 | tsoots | 691 | UndoManager::~UndoManager() |
1477 | tsoots | 692 | { |
5116 | tsoots | 693 | StackMap::iterator it; |
694 | for (it = stacks_.begin(); it != stacks_.end(); ++it) |
||
1477 | tsoots | 695 | { |
5116 | tsoots | 696 | for (uint i = 0; i < (*it).size(); ++i) |
1477 | tsoots | 697 | { |
5116 | tsoots | 698 | (*it).clear(); |
1477 | tsoots | 699 | } |
700 | } |
||
5116 | tsoots | 701 | stacks_.clear(); |
1477 | tsoots | 702 | } |
703 | |||
5116 | tsoots | 704 | /*** TransactionState *****************************************************/ |
1213 | tsoots | 705 | |
5116 | tsoots | 706 | TransactionState::TransactionState() : UndoState("") |
1111 | tsoots | 707 | { |
5116 | tsoots | 708 | size_ = 0; |
1111 | tsoots | 709 | } |
710 | |||
5116 | tsoots | 711 | UndoState* TransactionState::at(int index) |
1111 | tsoots | 712 | { |
5116 | tsoots | 713 | if (index >= 0 && static_cast<uint>(index) < sizet()) |
714 | return states_[index]; |
||
715 | else |
||
716 | return 0; |
||
1111 | tsoots | 717 | } |
718 | |||
5116 | tsoots | 719 | bool TransactionState::contains(int uid) const |
1111 | tsoots | 720 | { |
5116 | tsoots | 721 | for (uint i = 0; i < states_.size(); ++i) |
1443 | tsoots | 722 | { |
17651 | jghali | 723 | UndoObject* undoObject = states_[i]->undoObject(); |
724 | if (undoObject && undoObject->getUId() == static_cast<uint>(uid)) |
||
5116 | tsoots | 725 | return true; |
1443 | tsoots | 726 | } |
5116 | tsoots | 727 | return false; |
1111 | tsoots | 728 | } |
729 | |||
5116 | tsoots | 730 | bool TransactionState::containsOnly(int uid) const |
1238 | tsoots | 731 | { |
5116 | tsoots | 732 | for (uint i = 0; i < states_.size(); ++i) |
1238 | tsoots | 733 | { |
17651 | jghali | 734 | UndoObject* undoObject = states_[i]->undoObject(); |
735 | if (undoObject && undoObject->getUId() != static_cast<uint>(uid)) |
||
5116 | tsoots | 736 | return false; |
1238 | tsoots | 737 | } |
5116 | tsoots | 738 | return true; |
1238 | tsoots | 739 | } |
740 | |||
5116 | tsoots | 741 | void TransactionState::pushBack(UndoObject *target, UndoState *state) |
1111 | tsoots | 742 | { |
5116 | tsoots | 743 | if (target && state) |
1197 | tsoots | 744 | { |
5116 | tsoots | 745 | state->setUndoObject(target); |
746 | states_.push_back(state); |
||
747 | ++size_; |
||
1197 | tsoots | 748 | } |
1111 | tsoots | 749 | } |
750 | |||
5116 | tsoots | 751 | uint TransactionState::sizet() |
1111 | tsoots | 752 | { |
5116 | tsoots | 753 | return size_; |
1111 | tsoots | 754 | } |
755 | |||
5116 | tsoots | 756 | void TransactionState::useActionName() |
1461 | tsoots | 757 | { |
5116 | tsoots | 758 | if (size_ > 0) |
759 | setName(states_[size_ - 1]->getName()); |
||
1461 | tsoots | 760 | } |
761 | |||
5116 | tsoots | 762 | UndoObject* TransactionState::replace(ulong uid, UndoObject *newUndoObject) |
1197 | tsoots | 763 | { |
5116 | tsoots | 764 | UndoObject *tmp = 0; |
765 | for (uint i = 0; i < states_.size(); ++i) |
||
1197 | tsoots | 766 | { |
5116 | tsoots | 767 | TransactionState *ts = dynamic_cast<TransactionState*>(states_[i]); |
768 | if (ts) // are we having a transaction_inside a transaction |
||
769 | ts->replace(uid, newUndoObject); |
||
770 | else if (states_[i]->undoObject() && states_[i]->undoObject()->getUId() == uid) |
||
1197 | tsoots | 771 | { |
5116 | tsoots | 772 | tmp = states_[i]->undoObject(); |
773 | states_[i]->setUndoObject(newUndoObject); |
||
1197 | tsoots | 774 | } |
775 | } |
||
5116 | tsoots | 776 | return tmp; |
1197 | tsoots | 777 | } |
778 | |||
5116 | tsoots | 779 | void TransactionState::undo() // undo all attached states |
1111 | tsoots | 780 | { |
5116 | tsoots | 781 | for (int i = sizet() - 1; i > -1; --i) |
13312 | fschmid | 782 | { |
783 | if ((sizet() - 1) == 0) |
||
784 | at(i)->transactionCode = 0; |
||
785 | else |
||
786 | { |
||
787 | if (i == static_cast<int>(sizet() - 1)) |
||
788 | at(i)->transactionCode = 1; |
||
789 | else if (i == 0) |
||
790 | at(i)->transactionCode = 2; |
||
791 | else |
||
792 | at(i)->transactionCode = 3; |
||
793 | } |
||
794 | if (transactionCode != 0) |
||
795 | at(i)->transactionCode = transactionCode; |
||
5116 | tsoots | 796 | at(i)->undo(); |
13312 | fschmid | 797 | } |
1111 | tsoots | 798 | } |
799 | |||
5116 | tsoots | 800 | void TransactionState::redo() // redo all attached states |
1111 | tsoots | 801 | { |
5116 | tsoots | 802 | for (uint i = 0; i < sizet(); ++i) |
13312 | fschmid | 803 | { |
804 | if ((sizet() - 1) == 0) |
||
805 | at(i)->transactionCode = 0; |
||
806 | else |
||
807 | { |
||
13349 | jghali | 808 | if (i == 0) |
13312 | fschmid | 809 | at(i)->transactionCode = 1; |
13839 | fschmid | 810 | else if (i == static_cast<uint>(sizet() - 1)) |
13312 | fschmid | 811 | at(i)->transactionCode = 2; |
812 | else |
||
813 | at(i)->transactionCode = 3; |
||
814 | } |
||
815 | if (transactionCode != 0) |
||
816 | at(i)->transactionCode = transactionCode; |
||
5116 | tsoots | 817 | at(i)->redo(); |
13312 | fschmid | 818 | } |
5116 | tsoots | 819 | } |
820 | |||
821 | TransactionState::~TransactionState() |
||
822 | { |
||
823 | for (uint i = 0; i < states_.size(); ++i) |
||
1111 | tsoots | 824 | { |
5116 | tsoots | 825 | if (states_[i]) |
1111 | tsoots | 826 | { |
5116 | tsoots | 827 | delete states_[i]; |
828 | states_[i] = 0; |
||
1111 | tsoots | 829 | } |
830 | } |
||
831 | } |
||
1190 | tsoots | 832 | |
5116 | tsoots | 833 | /*************************************************************************************/ |
2199 | cbradney | 834 | |
2198 | cbradney | 835 | void UndoManager::languageChange() |
836 | { |
||
17735 | craig | 837 | UndoManager::ConnectPath = tr("Connect path"); |
2199 | cbradney | 838 | UndoManager::AddVGuide = tr("Add vertical guide"); |
839 | UndoManager::AddHGuide = tr("Add horizontal guide"); |
||
840 | UndoManager::DelVGuide = tr("Remove vertical guide"); |
||
841 | UndoManager::DelHGuide = tr("Remove horizontal guide"); |
||
9069 | subik | 842 | UndoManager::DelVAGuide = tr("Remove vertical auto guide"); |
843 | UndoManager::DelHAGuide = tr("Remove horizontal auto guide"); |
||
2199 | cbradney | 844 | UndoManager::MoveVGuide = tr("Move vertical guide"); |
845 | UndoManager::MoveHGuide = tr("Move horizontal guide"); |
||
846 | UndoManager::LockGuides = tr("Lock guides"); |
||
847 | UndoManager::UnlockGuides = tr("Unlock guides"); |
||
17644 | craig | 848 | UndoManager::Overprint = tr("Change overprint"); |
849 | UndoManager::BlendMode = tr("Change blend mode"); |
||
850 | UndoManager::ActionPDF = tr("Change action PDF"); |
||
2199 | cbradney | 851 | UndoManager::Move = tr("Move"); |
17640 | craig | 852 | UndoManager::NewMasterPage = tr("Add master page"); |
853 | UndoManager::DelMasterPage = tr("Del master page"); |
||
854 | UndoManager::ImportMasterPage = tr("Import master page"); |
||
855 | UndoManager::DuplicateMasterPage= tr("Duplicate master page"); |
||
856 | UndoManager::UniteItem = tr("Combine Polygons"); |
||
857 | UndoManager::SplitItem = tr("Split Polygons"); |
||
2199 | cbradney | 858 | UndoManager::Resize = tr("Resize"); |
859 | UndoManager::Rotate = tr("Rotate"); |
||
860 | UndoManager::MoveFromTo = tr("X1: %1, Y1: %2, %3\nX2: %4, Y2: %5, %6"); |
||
861 | UndoManager::ResizeFromTo = tr("W1: %1, H1: %2\nW2: %3, H2: %4"); |
||
4821 | cbradney | 862 | UndoManager::ImageOffset = tr("Change Image Offset"); |
863 | UndoManager::ImageScale = tr("Change Image Scale"); |
||
864 | UndoManager::ImageOffsetFromTo = tr("X1: %1, Y1: %2\nX2: %4, Y2: %5"); |
||
865 | UndoManager::ImageScaleFromTo = tr("X: %1, Y: %2\nX: %4, Y: %5"); |
||
2199 | cbradney | 866 | UndoManager::Selection = tr("Selection"); |
867 | UndoManager::Group = tr("Group"); |
||
868 | UndoManager::SelectionGroup = tr("Selection/Group"); |
||
869 | UndoManager::Create = tr("Create"); |
||
17640 | craig | 870 | UndoManager::LevelUp = tr("Level up"); |
17932 | jghali | 871 | UndoManager::LevelDown = tr("Level down"); |
872 | UndoManager::LevelTop = tr("Send to front"); |
||
873 | UndoManager::LevelBottom = tr("Send to bottom"); |
||
2199 | cbradney | 874 | UndoManager::CreateTo = tr("X: %1, Y: %2\nW: %3, H: %4"); |
875 | UndoManager::AlignDistribute = tr("Align/Distribute"); |
||
876 | UndoManager::ItemsInvolved = tr("Items involved"); |
||
13395 | jghali | 877 | UndoManager::ItemsInvolved2 = tr("More than 20 items involved"); |
2199 | cbradney | 878 | UndoManager::Cancel = tr("Cancel"); |
879 | UndoManager::SetFill = tr("Set fill color"); |
||
880 | UndoManager::ColorFromTo = tr("Color1: %1, Color2: %2"); |
||
881 | UndoManager::SetShade = tr("Set fill color shade"); |
||
882 | UndoManager::SetLineColor = tr("Set line color"); |
||
883 | UndoManager::SetLineShade = tr("Set line color shade"); |
||
884 | UndoManager::FlipH = tr("Flip horizontally"); |
||
885 | UndoManager::FlipV = tr("Flip vertically"); |
||
886 | UndoManager::Lock = tr("Lock"); |
||
17644 | craig | 887 | UndoManager::ResTyp = tr("Change image resolution"); |
2199 | cbradney | 888 | UndoManager::UnLock = tr("Unlock"); |
889 | UndoManager::SizeLock = tr("Lock size"); |
||
17709 | craig | 890 | UndoManager::GradTypeMask = tr("Set mask gradient type"); |
2199 | cbradney | 891 | UndoManager::SizeUnLock = tr("Unlock size"); |
4698 | cbradney | 892 | UndoManager::EnablePrint = tr("Enable Item Printing"); |
893 | UndoManager::DisablePrint = tr("Disable Item Printing"); |
||
2199 | cbradney | 894 | UndoManager::Ungroup = tr("Ungroup"); |
895 | UndoManager::Delete = tr("Delete"); |
||
896 | UndoManager::Rename = tr("Rename"); |
||
897 | UndoManager::FromTo = tr("From %1\nto %2"); |
||
898 | UndoManager::ApplyMasterPage = tr("Apply Master Page"); |
||
899 | UndoManager::Paste = tr("Paste"); |
||
900 | UndoManager::Cut = tr("Cut"); |
||
17644 | craig | 901 | UndoManager::RoundCorner = tr("Change round corner"); |
2199 | cbradney | 902 | UndoManager::Transparency = tr("Set fill color transparency"); |
903 | UndoManager::LineTransparency = tr("Set line color transparency"); |
||
904 | UndoManager::LineStyle = tr("Set line style"); |
||
905 | UndoManager::LineEnd = tr("Set the style of line end"); |
||
906 | UndoManager::LineJoin = tr("Set the style of line join"); |
||
907 | UndoManager::LineWidth = tr("Set line width"); |
||
908 | UndoManager::NoStyle = tr("No style"); |
||
909 | UndoManager::CustomLineStyle = tr("Set custom line style"); |
||
910 | UndoManager::NoLineStyle = tr("Do not use custom line style"); |
||
911 | UndoManager::StartArrow = tr("Set start arrow"); |
||
912 | UndoManager::EndArrow = tr("Set end arrow"); |
||
7676 | cbradney | 913 | UndoManager::StartAndEndArrow = tr("Set start and end arrows"); |
2199 | cbradney | 914 | UndoManager::CreateTable = tr("Create table"); |
915 | UndoManager::RowsCols = tr("Rows: %1, Cols: %2"); |
||
916 | UndoManager::SetFont = tr("Set font"); |
||
917 | UndoManager::SetFontSize = tr("Set font size"); |
||
17709 | craig | 918 | UndoManager::StartArrowScale = tr("Set start arrow scale"); |
919 | UndoManager::EndArrowScale = tr("Set end arrow scale"); |
||
920 | UndoManager::SetFontSize = tr("Set font size"); |
||
2199 | cbradney | 921 | UndoManager::SetFontWidth = tr("Set font width"); |
17709 | craig | 922 | UndoManager::SetFontHeight = tr("Set font height"); |
923 | UndoManager::GradType = tr("Change fill gradient type"); |
||
924 | UndoManager::GradVal = tr("Change fill gradient values"); |
||
925 | UndoManager::GradValStroke = tr("Change stroke gradient values"); |
||
926 | UndoManager::GradCol = tr("Change gradient color"); |
||
927 | UndoManager::GradTypeStroke = tr("Change stroke gradient type"); |
||
2199 | cbradney | 928 | UndoManager::SetFontFill = tr("Set font fill color"); |
929 | UndoManager::SetFontStroke = tr("Set font stroke color"); |
||
930 | UndoManager::SetFontFillShade = tr("Set font fill color shade"); |
||
931 | UndoManager::SetFontStrokeShade = tr("Set font stroke color shade"); |
||
932 | UndoManager::SetKerning = tr("Set kerning"); |
||
933 | UndoManager::SetLineSpacing = tr("Set line spacing"); |
||
934 | UndoManager::SetStyle = tr("Set paragraph style"); |
||
935 | UndoManager::SetLanguage = tr("Set language"); |
||
936 | UndoManager::AlignText = tr("Align text"); |
||
937 | UndoManager::SetFontEffect = tr("Set font effect"); |
||
938 | UndoManager::ImageFrame = tr("Image frame"); |
||
939 | UndoManager::TextFrame = tr("Text frame"); |
||
17744 | craig | 940 | UndoManager::Layer = tr("Layer"); |
11850 | herm | 941 | UndoManager::LatexFrame = tr("Render frame"); |
2199 | cbradney | 942 | UndoManager::Polygon = tr("Polygon"); |
17709 | craig | 943 | UndoManager::EditPolygon = tr("Edit polygon"); |
17735 | craig | 944 | UndoManager::EditArc = tr("Edit arc"); |
945 | UndoManager::EditSpiral = tr("Edit spiral"); |
||
2199 | cbradney | 946 | UndoManager::BezierCurve = tr("Bezier curve"); |
947 | UndoManager::Polyline = tr("Polyline"); |
||
3676 | cbradney | 948 | UndoManager::PathText = tr("Text on a Path"); |
2199 | cbradney | 949 | UndoManager::ConvertTo = tr("Convert to"); |
950 | UndoManager::ImportSVG = tr("Import SVG image"); |
||
13957 | herm | 951 | UndoManager::ImportUniconv = tr("Import Uniconvertor image"); |
2199 | cbradney | 952 | UndoManager::ImportEPS = tr("Import EPS image"); |
12042 | subik | 953 | UndoManager::ImportBarcode = tr("Import Barcode"); |
2217 | cbradney | 954 | UndoManager::ImportOOoDraw = tr("Import OpenOffice.org Draw image"); |
11615 | fschmid | 955 | UndoManager::ImportAI = tr("Import AI drawing"); |
956 | UndoManager::ImportXfig = tr("Import XFig drawing"); |
||
17641 | craig | 957 | UndoManager::Columns = tr("Change columns"); |
958 | UndoManager::ColumnsGap = tr("Change columns gap"); |
||
13349 | jghali | 959 | UndoManager::ImportWMF = tr("Import WMF drawing"); |
17641 | craig | 960 | UndoManager::TextFrameDist = tr("Change text to frame distance"); |
2199 | cbradney | 961 | UndoManager::ScratchSpace = tr("Scratch space"); |
5620 | jghali | 962 | //UndoManager::TextFlow = tr("Text flows around the frame"); |
963 | UndoManager::ObjectFrame = tr("Text flows around the frame"); |
||
2199 | cbradney | 964 | UndoManager::BoundingBox = tr("Text flows around bounding box"); |
965 | UndoManager::ContourLine = tr("Text flows around contour line"); |
||
17709 | craig | 966 | UndoManager::ImageClip = tr("Text flows around image clipping path"); |
2199 | cbradney | 967 | UndoManager::NoTextFlow = tr("No text flow"); |
5620 | jghali | 968 | UndoManager::NoObjectFrame = tr("No object frame"); |
2199 | cbradney | 969 | UndoManager::NoBoundingBox = tr("No bounding box"); |
970 | UndoManager::NoContourLine = tr("No contour line"); |
||
17644 | craig | 971 | UndoManager::ShowImage = tr("Show image"); |
2199 | cbradney | 972 | UndoManager::PageNmbr = tr("Page %1"); |
973 | UndoManager::ImageScaling = tr("Set image scaling"); |
||
974 | UndoManager::FrameSize = tr("Frame size"); |
||
17709 | craig | 975 | UndoManager::MeshGradient = tr("Create mesh gradient"); |
976 | UndoManager::ChangeMeshGradient = tr("Change mesh gradient"); |
||
977 | UndoManager::Mode = tr("Change Mode"); |
||
2199 | cbradney | 978 | UndoManager::FreeScaling = tr("Free scaling"); |
979 | UndoManager::KeepRatio = tr("Keep aspect ratio"); |
||
980 | UndoManager::BreakRatio = tr("Break aspect ratio"); |
||
981 | UndoManager::EditContourLine = tr("Edit contour line"); |
||
982 | UndoManager::EditShape = tr("Edit shape"); |
||
13346 | subik | 983 | UndoManager::ChangeShapeType = tr("Change shape type"); |
2199 | cbradney | 984 | UndoManager::ResetContourLine = tr("Reset contour line"); |
985 | UndoManager::AddPage = tr("Add page"); |
||
986 | UndoManager::AddPages = tr("Add pages"); |
||
17641 | craig | 987 | UndoManager::ReplaceText = tr("Replace text"); |
988 | UndoManager::FirstLineOffset = tr("Change First Line Offset"); |
||
989 | UndoManager::DeleteText = tr("Delete text"); |
||
990 | UndoManager::InsertText = tr("Insert text"); |
||
991 | UndoManager::AppendText = tr("Append text"); |
||
992 | UndoManager::ImportText = tr("Import text"); |
||
993 | UndoManager::ClearText = tr("Clear text"); |
||
994 | UndoManager::AddLoremIpsum = tr("Add Lorem Ipsum"); |
||
17826 | craig | 995 | UndoManager::InsertMark = tr("Insert mark"); |
996 | UndoManager::InsertNote = tr("Insert note"); |
||
997 | UndoManager::EditMark = tr("Edit mark"); |
||
998 | UndoManager::DeleteMark = tr("Delete mark"); |
||
999 | UndoManager::DeleteNote = tr("Delete note"); |
||
1000 | UndoManager::NewNotesStyle = tr("Add note style"); |
||
1001 | UndoManager::EditNotesStyle = tr("Edit note style"); |
||
1002 | UndoManager::DeleteNotesStyle = tr("Delete note style"); |
||
1003 | UndoManager::DeleteNotesStyle = tr("Delete note style"); |
||
2199 | cbradney | 1004 | UndoManager::DeletePage = tr("Delete page"); |
1005 | UndoManager::DeletePages = tr("Delete pages"); |
||
16509 | craig | 1006 | UndoManager::ChangePageProps = tr("Change page properties"); |
2199 | cbradney | 1007 | UndoManager::AddLayer = tr("Add layer"); |
17932 | jghali | 1008 | UndoManager::DuplicateLayer = tr("Duplicate layer %1"); |
2199 | cbradney | 1009 | UndoManager::DeleteLayer = tr("Delete layer"); |
1010 | UndoManager::RenameLayer = tr("Rename layer"); |
||
1011 | UndoManager::RaiseLayer = tr("Raise layer"); |
||
17709 | craig | 1012 | UndoManager::GradPos = tr("Change gradient position"); |
2199 | cbradney | 1013 | UndoManager::LowerLayer = tr("Lower layer"); |
1014 | UndoManager::SendToLayer = tr("Send to layer"); |
||
1015 | UndoManager::PrintLayer = tr("Enable printing of layer"); |
||
1016 | UndoManager::DoNotPrintLayer = tr("Disable printing of layer"); |
||
1017 | UndoManager::SetLayerName = tr("Change name of the layer"); |
||
17932 | jghali | 1018 | UndoManager::FlowLayer = tr("Enable text flow around for lower layers"); |
1019 | UndoManager::DisableFlowLayer = tr("Disable text flow around for lower layers"); |
||
1020 | UndoManager::SetLayerBlendMode = tr("Set layer blend mode"); |
||
16497 | craig | 1021 | UndoManager::SetLayerTransparency=tr("Set layer opacity"); |
17932 | jghali | 1022 | UndoManager::SetLayerLocked = tr("Lock layer"); |
1023 | UndoManager::SetLayerUnlocked = tr("Unlock layer"); |
||
2199 | cbradney | 1024 | UndoManager::GetImage = tr("Get image"); |
10321 | mrdocs | 1025 | UndoManager::ChangeFormula = tr("Change formula"); |
17709 | craig | 1026 | UndoManager::Duplicate = tr("Duplicate"); |
4739 | tsoots | 1027 | UndoManager::MultipleDuplicate = tr("Multiple duplicate"); |
17709 | craig | 1028 | UndoManager::RemoveMeshPatch = tr("Remove mesh patch"); |
5184 | avox | 1029 | UndoManager::ApplyTextStyle = tr("Apply text style"); |
17641 | craig | 1030 | UndoManager::RemoveTextStyle = tr("Remove text style"); |
5184 | avox | 1031 | UndoManager::MenuUndo = tr("&Undo: %1", "f.e. Undo: Move"); |
5116 | tsoots | 1032 | UndoManager::MenuUndoEmpty = tr("&Undo"); |
5184 | avox | 1033 | UndoManager::MenuRedo = tr("&Redo: %1", "f.e. Redo: Move"); |
5116 | tsoots | 1034 | UndoManager::MenuRedoEmpty = tr("&Redo"); |
6139 | tsoots | 1035 | UndoManager::EditContour = tr("Edit contour line"); |
6263 | tsoots | 1036 | UndoManager::ResetControlPoint = tr("Reset control point"); |
1037 | UndoManager::ResetControlPoints = tr("Reset control points"); |
||
6266 | tsoots | 1038 | UndoManager::ImageEffects = tr("Apply image effects"); |
6820 | tsoots | 1039 | UndoManager::InsertFrame = tr("Insert frame"); |
7100 | tsoots | 1040 | UndoManager::AdjustFrameToImage = tr("Adjust frame to the image size"); |
7896 | tsoots | 1041 | UndoManager::RemoveAllGuides = tr("Remove all guides"); |
17709 | craig | 1042 | UndoManager::RemoveAllPageGuides= tr("Remove page guides"); |
7897 | tsoots | 1043 | UndoManager::Copy = tr("Copy"); |
1044 | UndoManager::CopyPage = tr("Copy page"); |
||
17213 | craig | 1045 | UndoManager::MovePage = tr("Move page"); |
17640 | craig | 1046 | UndoManager::ImportPage = tr("Import page"); |
8952 | tsoots | 1047 | UndoManager::ToOutlines = tr("Convert to outlines"); |
17932 | jghali | 1048 | UndoManager::LinkTextFrame = tr("Link text frame"); |
1049 | UndoManager::UnlinkTextFrame = tr("Unlink text frame"); |
||
17224 | craig | 1050 | UndoManager::ClearImage = tr("Clear image frame content"); |
17932 | jghali | 1051 | UndoManager::PathOperation = tr("Path Operation"); |
17640 | craig | 1052 | UndoManager::ChangePageAttrs = tr("Change Page Attributes"); |
17709 | craig | 1053 | UndoManager::Transform = tr("Transform"); |
17791 | jghali | 1054 | UndoManager::WeldItems = tr("Weld Items"); |
2198 | cbradney | 1055 | } |
1056 | |||
1190 | tsoots | 1057 | void UndoManager::initIcons() |
1058 | { |
||
1693 | craig | 1059 | QString iconDir = ScPaths::instance().iconDir(); |
1247 | tsoots | 1060 | |
1250 | tsoots | 1061 | /*** Icons for UndoObjects *******************************************/ |
9142 | cbradney | 1062 | UndoManager::IImageFrame = new QPixmap(iconDir + "16/insert-image.png"); |
1063 | UndoManager::ITextFrame = new QPixmap(iconDir + "16/insert-text-frame.png"); |
||
10321 | mrdocs | 1064 | UndoManager::ILatexFrame = new QPixmap(iconDir + "16/insert-latex.png"); |
1250 | tsoots | 1065 | UndoManager::ILine = new QPixmap(iconDir + "Stift.xpm"); |
9162 | cbradney | 1066 | UndoManager::IPolygon = new QPixmap(iconDir + "16/draw-polygon.png"); |
1067 | UndoManager::IPolyline = new QPixmap(iconDir + "16/draw-bezier-curves.png"); |
||
1250 | tsoots | 1068 | // UndoManager::IPathText = new QPixmap(iconDir + "?"; |
1254 | tsoots | 1069 | UndoManager::IGroup = new QPixmap(iconDir + "u_group.png"); |
1250 | tsoots | 1070 | /*** Icons for actions ***********************************************/ |
1071 | UndoManager::IMove = new QPixmap(iconDir + "u_move.png"); |
||
1072 | UndoManager::IResize = new QPixmap(iconDir + "u_resize.png"); |
||
1073 | UndoManager::IRotate = new QPixmap(iconDir + "u_rotate.png"); |
||
1247 | tsoots | 1074 | UndoManager::IAlignDistribute = new QPixmap(iconDir + "u_align.png"); |
1250 | tsoots | 1075 | UndoManager::IGuides = new QPixmap(iconDir + "u_margins.png"); |
1076 | UndoManager::ILockGuides = new QPixmap(iconDir + "u_margins_locked.png"); |
||
1286 | tsoots | 1077 | UndoManager::IFill = new QPixmap(iconDir + "u_fill.png"); |
1078 | UndoManager::IShade = new QPixmap(iconDir + "u_shade.png"); |
||
1340 | tsoots | 1079 | UndoManager::IFlipH = new QPixmap(iconDir + "u_fliph.png"); |
1080 | UndoManager::IFlipV = new QPixmap(iconDir + "u_flipv.png"); |
||
1290 | tsoots | 1081 | UndoManager::ILock = new QPixmap(iconDir + "u_lock.png"); |
1082 | UndoManager::IUnLock = new QPixmap(iconDir + "u_unlock.png"); |
||
4698 | cbradney | 1083 | UndoManager::IEnablePrint = new QPixmap(iconDir + "u_enableprint.png"); |
1084 | UndoManager::IDisablePrint = new QPixmap(iconDir + "u_disableprint.png"); |
||
1340 | tsoots | 1085 | UndoManager::IDelete = new QPixmap(iconDir + "u_delete.png"); |
1086 | UndoManager::ICreate = new QPixmap(iconDir + "u_create.png"); |
||
9142 | cbradney | 1087 | UndoManager::IPaste = new QPixmap(iconDir + "16/edit-paste.png"); |
1369 | tsoots | 1088 | UndoManager::ICut = new QPixmap(iconDir + "u_cut.png"); |
1371 | tsoots | 1089 | UndoManager::ITransparency = new QPixmap(iconDir + "u_transp.png"); |
1383 | tsoots | 1090 | UndoManager::ILineStyle = new QPixmap(iconDir + "u_line.png"); |
1391 | tsoots | 1091 | UndoManager::IArrow = new QPixmap(iconDir + "u_arrow.png"); |
1396 | tsoots | 1092 | UndoManager::ITable = new QPixmap(iconDir + "frame_table.png"); |
1399 | tsoots | 1093 | UndoManager::IFont = new QPixmap(iconDir + "u_font.png"); |
1440 | tsoots | 1094 | UndoManager::IImportOOoDraw = new QPixmap(iconDir + "ooo_draw.png"); |
1095 | UndoManager::ISVG = new QPixmap(iconDir + "u_svg.png"); |
||
13957 | herm | 1096 | UndoManager::IUniconv = new QPixmap(iconDir + "u_svg.png"); // using the icon for SVG for now |
1440 | tsoots | 1097 | UndoManager::IEPS = new QPixmap(iconDir + "u_eps.png"); |
11615 | fschmid | 1098 | UndoManager::IAI = new QPixmap(iconDir + "u_eps.png"); // using the icon for EPS for now |
1099 | UndoManager::IXFIG = new QPixmap(iconDir + "u_eps.png"); // using the icon for EPS for now |
||
13349 | jghali | 1100 | UndoManager::IWMF = new QPixmap(iconDir + "u_eps.png"); // using the icon for EPS for now |
1495 | tsoots | 1101 | UndoManager::IImageScaling = new QPixmap(iconDir + "u_scale_image.png"); |
1509 | tsoots | 1102 | UndoManager::IBorder = new QPixmap(iconDir + "u_shape.png"); |
9162 | cbradney | 1103 | UndoManager::IDocument = new QPixmap(iconDir + "16/document-new.png"); |
1688 | tsoots | 1104 | // UndoManager::ILayer = new QPixmap(iconDir + "u_layer.png"); |
1105 | // UndoManager::ILayerAction = new QPixmap(iconDir + "u_layer_action.png"); |
||
1697 | tsoots | 1106 | // UndoManager::IUp = new QPixmap(iconDir + "u_up.png"); |
1107 | // UndoManager::IDown = new QPixmap(iconDir + "u_down.png"); |
||
1832 | tsoots | 1108 | // UndoManager::IGetImage = new QPixmap(iconDir + "u_get_image.png"); |
4739 | tsoots | 1109 | UndoManager::IMultipleDuplicate = new QPixmap(iconDir + "u_multiple.png"); |
1190 | tsoots | 1110 | } |
17735 | craig | 1111 | QString UndoManager::ConnectPath = ""; |
2199 | cbradney | 1112 | QString UndoManager::AddVGuide = ""; |
1113 | QString UndoManager::AddHGuide = ""; |
||
1114 | QString UndoManager::DelVGuide = ""; |
||
1115 | QString UndoManager::DelHGuide = ""; |
||
9069 | subik | 1116 | QString UndoManager::DelVAGuide = ""; |
1117 | QString UndoManager::DelHAGuide = ""; |
||
17709 | craig | 1118 | QString UndoManager::Mode = ""; |
2199 | cbradney | 1119 | QString UndoManager::MoveVGuide = ""; |
1120 | QString UndoManager::MoveHGuide = ""; |
||
17640 | craig | 1121 | QString UndoManager::UniteItem = ""; |
1122 | QString UndoManager::SplitItem = ""; |
||
2199 | cbradney | 1123 | QString UndoManager::LockGuides = ""; |
1124 | QString UndoManager::UnlockGuides = ""; |
||
17644 | craig | 1125 | QString UndoManager::Overprint = ""; |
1126 | QString UndoManager::BlendMode = ""; |
||
1127 | QString UndoManager::ActionPDF = ""; |
||
2199 | cbradney | 1128 | QString UndoManager::Move = ""; |
17640 | craig | 1129 | QString UndoManager::NewMasterPage = ""; |
17709 | craig | 1130 | QString UndoManager::GradType = ""; |
1131 | QString UndoManager::GradPos = ""; |
||
1132 | QString UndoManager::GradVal = ""; |
||
1133 | QString UndoManager::GradValStroke = ""; |
||
1134 | QString UndoManager::GradCol = ""; |
||
1135 | QString UndoManager::GradTypeStroke = ""; |
||
17640 | craig | 1136 | QString UndoManager::ImportMasterPage = ""; |
1137 | QString UndoManager::DuplicateMasterPage= ""; |
||
1138 | QString UndoManager::DelMasterPage = ""; |
||
2199 | cbradney | 1139 | QString UndoManager::Resize = ""; |
1140 | QString UndoManager::Rotate = ""; |
||
1141 | QString UndoManager::MoveFromTo = ""; |
||
4821 | cbradney | 1142 | QString UndoManager::ImageOffset = ""; |
1143 | QString UndoManager::ImageScale = ""; |
||
17644 | craig | 1144 | QString UndoManager::ResTyp = ""; |
1145 | QString UndoManager::ShowImage = ""; |
||
17709 | craig | 1146 | QString UndoManager::RemoveMeshPatch = ""; |
1147 | QString UndoManager::StartArrowScale = ""; |
||
1148 | QString UndoManager::EndArrowScale = ""; |
||
4821 | cbradney | 1149 | QString UndoManager::ImageOffsetFromTo = ""; |
1150 | QString UndoManager::ImageScaleFromTo = ""; |
||
2199 | cbradney | 1151 | QString UndoManager::ResizeFromTo = ""; |
1152 | QString UndoManager::Selection = ""; |
||
1153 | QString UndoManager::Group = ""; |
||
1154 | QString UndoManager::SelectionGroup = ""; |
||
1155 | QString UndoManager::Create = ""; |
||
17644 | craig | 1156 | QString UndoManager::RoundCorner = ""; |
2199 | cbradney | 1157 | QString UndoManager::CreateTo = ""; |
1158 | QString UndoManager::AlignDistribute = ""; |
||
1159 | QString UndoManager::ItemsInvolved = ""; |
||
13395 | jghali | 1160 | QString UndoManager::ItemsInvolved2 = ""; |
1161 | uint UndoManager::ItemsInvolvedLimit = 20; |
||
2199 | cbradney | 1162 | QString UndoManager::Cancel = ""; |
17641 | craig | 1163 | QString UndoManager::TextFrameDist = ""; |
2199 | cbradney | 1164 | QString UndoManager::SetFill = ""; |
1165 | QString UndoManager::ColorFromTo = ""; |
||
1166 | QString UndoManager::SetShade = ""; |
||
1167 | QString UndoManager::SetLineColor = ""; |
||
1168 | QString UndoManager::SetLineShade = ""; |
||
1169 | QString UndoManager::FlipH = ""; |
||
1170 | QString UndoManager::FlipV = ""; |
||
1171 | QString UndoManager::Lock = ""; |
||
17640 | craig | 1172 | QString UndoManager::LevelUp = ""; |
1173 | QString UndoManager::LevelTop = ""; |
||
1174 | QString UndoManager::LevelBottom = ""; |
||
1175 | QString UndoManager::LevelDown = ""; |
||
2199 | cbradney | 1176 | QString UndoManager::UnLock = ""; |
1177 | QString UndoManager::SizeLock = ""; |
||
1178 | QString UndoManager::SizeUnLock = ""; |
||
4698 | cbradney | 1179 | QString UndoManager::EnablePrint = ""; |
1180 | QString UndoManager::DisablePrint = ""; |
||
2199 | cbradney | 1181 | QString UndoManager::Ungroup = ""; |
1182 | QString UndoManager::Delete = ""; |
||
1183 | QString UndoManager::Rename = ""; |
||
1184 | QString UndoManager::FromTo = ""; |
||
1185 | QString UndoManager::ApplyMasterPage = ""; |
||
1186 | QString UndoManager::Paste = ""; |
||
1187 | QString UndoManager::Cut = ""; |
||
1188 | QString UndoManager::Transparency = ""; |
||
1189 | QString UndoManager::LineTransparency = ""; |
||
1190 | QString UndoManager::LineStyle = ""; |
||
17641 | craig | 1191 | QString UndoManager::FirstLineOffset = ""; |
2199 | cbradney | 1192 | QString UndoManager::LineEnd = ""; |
1193 | QString UndoManager::LineJoin = ""; |
||
1194 | QString UndoManager::LineWidth = ""; |
||
1195 | QString UndoManager::NoStyle = ""; |
||
1196 | QString UndoManager::CustomLineStyle = ""; |
||
1197 | QString UndoManager::NoLineStyle = ""; |
||
1198 | QString UndoManager::StartArrow = ""; |
||
1199 | QString UndoManager::EndArrow = ""; |
||
7676 | cbradney | 1200 | QString UndoManager::StartAndEndArrow = ""; |
2199 | cbradney | 1201 | QString UndoManager::CreateTable = ""; |
1202 | QString UndoManager::RowsCols = ""; |
||
1203 | QString UndoManager::SetFont = ""; |
||
1204 | QString UndoManager::SetFontSize = ""; |
||
1205 | QString UndoManager::SetFontWidth = ""; |
||
3676 | cbradney | 1206 | QString UndoManager::SetFontHeight = ""; |
2199 | cbradney | 1207 | QString UndoManager::SetFontFill = ""; |
1208 | QString UndoManager::SetFontStroke = ""; |
||
1209 | QString UndoManager::SetFontFillShade = ""; |
||
1210 | QString UndoManager::SetFontStrokeShade = ""; |
||
1211 | QString UndoManager::SetKerning = ""; |
||
1212 | QString UndoManager::SetLineSpacing = ""; |
||
1213 | QString UndoManager::SetStyle = ""; |
||
1214 | QString UndoManager::SetLanguage = ""; |
||
1215 | QString UndoManager::AlignText = ""; |
||
1216 | QString UndoManager::SetFontEffect = ""; |
||
1217 | QString UndoManager::ImageFrame = ""; |
||
1218 | QString UndoManager::TextFrame = ""; |
||
17744 | craig | 1219 | QString UndoManager::Layer = ""; |
10321 | mrdocs | 1220 | QString UndoManager::LatexFrame = ""; |
2199 | cbradney | 1221 | QString UndoManager::Polygon = ""; |
17709 | craig | 1222 | QString UndoManager::EditPolygon = ""; |
17735 | craig | 1223 | QString UndoManager::EditArc = ""; |
1224 | QString UndoManager::EditSpiral = ""; |
||
2199 | cbradney | 1225 | QString UndoManager::BezierCurve = ""; |
1226 | QString UndoManager::Polyline = ""; |
||
3676 | cbradney | 1227 | QString UndoManager::PathText = ""; |
2199 | cbradney | 1228 | QString UndoManager::ConvertTo = ""; |
1229 | QString UndoManager::ImportSVG = ""; |
||
13957 | herm | 1230 | QString UndoManager::ImportUniconv = ""; |
2199 | cbradney | 1231 | QString UndoManager::ImportEPS = ""; |
12042 | subik | 1232 | QString UndoManager::ImportBarcode = ""; |
2199 | cbradney | 1233 | QString UndoManager::ImportOOoDraw = ""; |
11615 | fschmid | 1234 | QString UndoManager::ImportAI = ""; |
1235 | QString UndoManager::ImportXfig = ""; |
||
13349 | jghali | 1236 | QString UndoManager::ImportWMF = ""; |
2199 | cbradney | 1237 | QString UndoManager::ScratchSpace = ""; |
5620 | jghali | 1238 | QString UndoManager::ObjectFrame = ""; |
2199 | cbradney | 1239 | QString UndoManager::BoundingBox = ""; |
17709 | craig | 1240 | QString UndoManager::MeshGradient = ""; |
1241 | QString UndoManager::ChangeMeshGradient = ""; |
||
2199 | cbradney | 1242 | QString UndoManager::ContourLine = ""; |
16497 | craig | 1243 | QString UndoManager::ImageClip = ""; |
2199 | cbradney | 1244 | QString UndoManager::NoTextFlow = ""; |
5620 | jghali | 1245 | QString UndoManager::NoObjectFrame = ""; |
2199 | cbradney | 1246 | QString UndoManager::NoBoundingBox = ""; |
1247 | QString UndoManager::NoContourLine = ""; |
||
1248 | QString UndoManager::PageNmbr = ""; |
||
1249 | QString UndoManager::ImageScaling = ""; |
||
1250 | QString UndoManager::FrameSize = ""; |
||
1251 | QString UndoManager::FreeScaling = ""; |
||
1252 | QString UndoManager::KeepRatio = ""; |
||
1253 | QString UndoManager::BreakRatio = ""; |
||
1254 | QString UndoManager::EditContourLine = ""; |
||
1255 | QString UndoManager::EditShape = ""; |
||
13346 | subik | 1256 | QString UndoManager::ChangeShapeType = ""; |
2199 | cbradney | 1257 | QString UndoManager::ResetContourLine = ""; |
17709 | craig | 1258 | QString UndoManager::GradTypeMask = ""; |
2199 | cbradney | 1259 | QString UndoManager::AddPage = ""; |
1260 | QString UndoManager::AddPages = ""; |
||
17641 | craig | 1261 | QString UndoManager::DeleteText = ""; |
1262 | QString UndoManager::AppendText = ""; |
||
1263 | QString UndoManager::ImportText = ""; |
||
1264 | QString UndoManager::ClearText = ""; |
||
1265 | QString UndoManager::ReplaceText = ""; |
||
1266 | QString UndoManager::InsertText = ""; |
||
1267 | QString UndoManager::AddLoremIpsum = ""; |
||
17826 | craig | 1268 | QString UndoManager::EditMark = ""; |
1269 | QString UndoManager::InsertMark = ""; |
||
1270 | QString UndoManager::DeleteMark = ""; |
||
1271 | QString UndoManager::InsertNote = ""; |
||
1272 | QString UndoManager::DeleteNote = ""; |
||
1273 | QString UndoManager::NewNotesStyle = ""; |
||
1274 | QString UndoManager::EditNotesStyle = ""; |
||
1275 | QString UndoManager::DeleteNotesStyle = ""; |
||
2199 | cbradney | 1276 | QString UndoManager::DeletePage = ""; |
1277 | QString UndoManager::DeletePages = ""; |
||
16509 | craig | 1278 | QString UndoManager::ChangePageProps = ""; |
2199 | cbradney | 1279 | QString UndoManager::AddLayer = ""; |
16495 | craig | 1280 | QString UndoManager::DuplicateLayer = ""; |
2199 | cbradney | 1281 | QString UndoManager::DeleteLayer = ""; |
1282 | QString UndoManager::RenameLayer = ""; |
||
1283 | QString UndoManager::RaiseLayer = ""; |
||
1284 | QString UndoManager::LowerLayer = ""; |
||
1285 | QString UndoManager::SendToLayer = ""; |
||
1286 | QString UndoManager::PrintLayer = ""; |
||
1287 | QString UndoManager::DoNotPrintLayer = ""; |
||
1288 | QString UndoManager::SetLayerName = ""; |
||
16492 | craig | 1289 | QString UndoManager::FlowLayer = ""; |
1290 | QString UndoManager::DisableFlowLayer = ""; |
||
16497 | craig | 1291 | QString UndoManager::SetLayerBlendMode = ""; |
1292 | QString UndoManager::SetLayerTransparency=""; |
||
16499 | craig | 1293 | QString UndoManager::SetLayerLocked = ""; |
1294 | QString UndoManager::SetLayerUnlocked = ""; |
||
2199 | cbradney | 1295 | QString UndoManager::GetImage = ""; |
10321 | mrdocs | 1296 | QString UndoManager::ChangeFormula = ""; |
17709 | craig | 1297 | QString UndoManager::Duplicate = ""; |
4739 | tsoots | 1298 | QString UndoManager::MultipleDuplicate = ""; |
5184 | avox | 1299 | QString UndoManager::ApplyTextStyle = ""; |
17641 | craig | 1300 | QString UndoManager::RemoveTextStyle = ""; |
5116 | tsoots | 1301 | QString UndoManager::MenuUndo = ""; |
1302 | QString UndoManager::MenuUndoEmpty = ""; |
||
1303 | QString UndoManager::MenuRedo = ""; |
||
1304 | QString UndoManager::MenuRedoEmpty = ""; |
||
6139 | tsoots | 1305 | QString UndoManager::EditContour = ""; |
17641 | craig | 1306 | QString UndoManager::Columns = ""; |
1307 | QString UndoManager::ColumnsGap = ""; |
||
6263 | tsoots | 1308 | QString UndoManager::ResetControlPoint = ""; |
1309 | QString UndoManager::ResetControlPoints = ""; |
||
6266 | tsoots | 1310 | QString UndoManager::ImageEffects = ""; |
6820 | tsoots | 1311 | QString UndoManager::InsertFrame = ""; |
7100 | tsoots | 1312 | QString UndoManager::AdjustFrameToImage = ""; |
7896 | tsoots | 1313 | QString UndoManager::RemoveAllGuides = ""; |
9069 | subik | 1314 | QString UndoManager::RemoveAllPageGuides = ""; |
7897 | tsoots | 1315 | QString UndoManager::Copy = ""; |
1316 | QString UndoManager::CopyPage = ""; |
||
17640 | craig | 1317 | QString UndoManager::ImportPage = ""; |
17213 | craig | 1318 | QString UndoManager::MovePage = ""; |
8952 | tsoots | 1319 | QString UndoManager::ToOutlines = ""; |
16495 | craig | 1320 | QString UndoManager::LinkTextFrame = ""; |
1321 | QString UndoManager::UnlinkTextFrame = ""; |
||
17224 | craig | 1322 | QString UndoManager::ClearImage = ""; |
17424 | craig | 1323 | QString UndoManager::PathOperation = ""; |
17640 | craig | 1324 | QString UndoManager::ChangePageAttrs = ""; |
17709 | craig | 1325 | QString UndoManager::Transform = ""; |
17791 | jghali | 1326 | QString UndoManager::WeldItems = ""; |
5116 | tsoots | 1327 | |
1250 | tsoots | 1328 | /*** Icons for UndoObjects *******************************************/ |
2604 | tsoots | 1329 | QPixmap *UndoManager::IImageFrame = 0; |
1330 | QPixmap *UndoManager::ITextFrame = 0; |
||
10321 | mrdocs | 1331 | QPixmap *UndoManager::ILatexFrame = 0; |
2604 | tsoots | 1332 | QPixmap *UndoManager::ILine = 0; |
1333 | QPixmap *UndoManager::IPolygon = 0; |
||
1334 | QPixmap *UndoManager::IPolyline = 0; |
||
1335 | QPixmap *UndoManager::IPathText = 0; |
||
1336 | QPixmap *UndoManager::IGroup = 0; |
||
1337 | QPixmap *UndoManager::ITable = 0; |
||
1250 | tsoots | 1338 | /*** Icons for actions ***********************************************/ |
2604 | tsoots | 1339 | QPixmap *UndoManager::IMove = 0; |
1340 | QPixmap *UndoManager::IResize = 0; |
||
1341 | QPixmap *UndoManager::IRotate = 0; |
||
1342 | QPixmap *UndoManager::IGuides = 0; |
||
1343 | QPixmap *UndoManager::ILockGuides = 0; |
||
1344 | QPixmap *UndoManager::IAlignDistribute = 0; |
||
1345 | QPixmap *UndoManager::IFill = 0; |
||
1346 | QPixmap *UndoManager::IShade = 0; |
||
1347 | QPixmap *UndoManager::IFlipH = 0; |
||
1348 | QPixmap *UndoManager::IFlipV = 0; |
||
1349 | QPixmap *UndoManager::ILock = 0; |
||
1350 | QPixmap *UndoManager::IUnLock = 0; |
||
4698 | cbradney | 1351 | QPixmap *UndoManager::IEnablePrint = 0; |
1352 | QPixmap *UndoManager::IDisablePrint = 0; |
||
2604 | tsoots | 1353 | QPixmap *UndoManager::IDelete = 0; |
1354 | QPixmap *UndoManager::ICreate = 0; |
||
1355 | QPixmap *UndoManager::IPaste = 0; |
||
1356 | QPixmap *UndoManager::ICut = 0; |
||
1357 | QPixmap *UndoManager::ITransparency = 0; |
||
1358 | QPixmap *UndoManager::ILineStyle = 0; |
||
1359 | QPixmap *UndoManager::IArrow = 0; |
||
1360 | QPixmap *UndoManager::IFont = 0; |
||
1361 | QPixmap *UndoManager::ISVG = 0; |
||
13957 | herm | 1362 | QPixmap *UndoManager::IUniconv = 0; |
2604 | tsoots | 1363 | QPixmap *UndoManager::IEPS = 0; |
11615 | fschmid | 1364 | QPixmap *UndoManager::IAI = 0; |
1365 | QPixmap *UndoManager::IXFIG = 0; |
||
13349 | jghali | 1366 | QPixmap *UndoManager::IWMF = 0; |
2604 | tsoots | 1367 | QPixmap *UndoManager::IImportOOoDraw = 0; |
1368 | QPixmap *UndoManager::IImageScaling = 0; |
||
1369 | QPixmap *UndoManager::IBorder = 0; |
||
1370 | QPixmap *UndoManager::IDocument = 0; |
||
1371 | QPixmap *UndoManager::ILayer = 0; |
||
1372 | QPixmap *UndoManager::ILayerAction = 0; |
||
1373 | QPixmap *UndoManager::IUp = 0; |
||
1374 | QPixmap *UndoManager::IDown = 0; |
||
1375 | QPixmap *UndoManager::IPrint = 0; |
||
1376 | QPixmap *UndoManager::IGetImage = 0; |
||
10321 | mrdocs | 1377 | QPixmap *UndoManager::IChangeFormula = 0; |
4739 | tsoots | 1378 | QPixmap *UndoManager::IMultipleDuplicate = 0; |
1658 | tsoots | 1379 | |
13371 | jghali | 1380 | |
1381 |