Subversion Repositories Scribus

Rev

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