Subversion Repositories Scribus

Rev

Rev 9319 | 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
*/
1993 cbradney 7
/***************************************************************************
8
        begin                : Apr 2005
9
        copyright            : (C) 2005 by Craig Bradney
10
        email                : cbradney@zip.com.au
11
***************************************************************************/
12
 
13
/***************************************************************************
14
*                                                                         *
5243 cbradney 15
*   mainWindow program is free software; you can redistribute it and/or modify  *
1993 cbradney 16
*   it under the terms of the GNU General Public License as published by  *
17
*   the Free Software Foundation; either version 2 of the License, or     *
18
*   (at your option) any later version.                                   *
19
*                                                                         *
20
***************************************************************************/
21
 
22
#include "actionmanager.h"
8521 cbradney 23
//#include "actionmanager.moc"
1993 cbradney 24
 
25
#include "scribus.h"
4688 cbradney 26
#include "scribusdoc.h"
2026 cbradney 27
#include "scribusview.h"
3934 cbradney 28
#include "selection.h"
1993 cbradney 29
#include "undomanager.h"
3809 cbradney 30
#include "util.h"
6996 avox 31
#include "text/storytext.h"
8501 cbradney 32
//Added by qt3to4:
33
#include <QPixmap>
34
#include <Q3ActionGroup>
1993 cbradney 35
 
5243 cbradney 36
QMap<QString, QKeySequence> ActionManager::defKeys;
8501 cbradney 37
Q3ValueVector< QPair<QString, QStringList> > ActionManager::defMenus;
38
Q3ValueVector< QPair<QString, QStringList> > ActionManager::defNonMenuActions;
5243 cbradney 39
 
7087 subik 40
ActionManager::ActionManager ( QObject * parent, const char * name ) :
5781 cbradney 41
        QObject ( parent, name ),
42
        mainWindow(0)
1993 cbradney 43
{
5257 cbradney 44
}
45
 
8246 cbradney 46
ActionManager::~ActionManager()
47
{
48
        delete modeActionNames;
49
        delete nonEditActionNames;
50
        delete unicodeCharActionNames;
51
}
52
 
5257 cbradney 53
void ActionManager::init(ScribusMainWindow *mw)
54
{
55
        mainWindow=mw;
5243 cbradney 56
        scrActions=&(mainWindow->scrActions);
57
        scrActionGroups=&(mainWindow->scrActionGroups);
1995 cbradney 58
        modeActionNames=new QStringList();
59
        nonEditActionNames=new QStringList();
60
        unicodeCharActionNames=new QStringList();
1993 cbradney 61
        undoManager = UndoManager::instance();
2246 subik 62
 
3580 avox 63
#ifdef Q_WS_MAC
64
        noIcon = loadIcon("noicon.xpm");
65
#endif
7087 subik 66
 
1993 cbradney 67
        createActions();
2161 cbradney 68
        languageChange();
1993 cbradney 69
}
70
 
71
void ActionManager::createActions()
72
{
73
        initFileMenuActions();
74
        initEditMenuActions();
75
        initStyleMenuActions();
76
        initItemMenuActions();
77
        initInsertMenuActions();
78
        initPageMenuActions();
79
        initViewMenuActions();
80
        initToolsMenuActions();
81
        initExtrasMenuActions();
82
        initWindowsMenuActions();
83
        initScriptMenuActions();
84
        initHelpMenuActions();
5243 cbradney 85
        initUnicodeActions(scrActions, mainWindow, unicodeCharActionNames);
4881 cbradney 86
        enableUnicodeActions(scrActions, false);
1993 cbradney 87
        initSpecialActions();
88
}
89
 
90
void ActionManager::initFileMenuActions()
91
{
5243 cbradney 92
        QString name;
1993 cbradney 93
        //File Menu
5243 cbradney 94
        name="fileNew";
8528 cbradney 95
        scrActions->insert(name, new ScrAction(loadIcon("16/document-new.png"), loadIcon("22/document-new.png"), "", defKeys[name], mainWindow, name));
5243 cbradney 96
        name="fileOpen";
8528 cbradney 97
        scrActions->insert(name, new ScrAction(loadIcon("16/document-open.png"), loadIcon("22/document-open.png"), "", defKeys[name], mainWindow, name));
5243 cbradney 98
        name="fileClose";
8528 cbradney 99
        scrActions->insert(name, new ScrAction(loadIcon("16/close.png"), loadIcon("22/close.png"), "", defKeys[name], mainWindow, name));
5243 cbradney 100
        name="fileSave";
8528 cbradney 101
        scrActions->insert(name, new ScrAction(loadIcon("16/document-save.png"), loadIcon("22/document-save.png"), "", defKeys[name], mainWindow, name));
5243 cbradney 102
        name="fileSaveAs";
8528 cbradney 103
        scrActions->insert(name, new ScrAction(loadIcon("16/document-save-as.png"), loadIcon("22/document-save-as.png"), "", defKeys[name], mainWindow, name));
5243 cbradney 104
        name="fileRevert";
8528 cbradney 105
        scrActions->insert(name, new ScrAction(loadIcon("revert.png"), QPixmap(), "", defKeys[name], mainWindow, name));
5243 cbradney 106
        name="fileCollect";
8528 cbradney 107
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
1993 cbradney 108
        //File Import Menu
5243 cbradney 109
        name="fileImportText";
8528 cbradney 110
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5715 tsoots 111
        name="fileImportText2";
8528 cbradney 112
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 113
        name="fileImportAppendText";
8528 cbradney 114
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 115
        name="fileImportImage";
8528 cbradney 116
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
1993 cbradney 117
 
118
        //File Export Menu
5243 cbradney 119
        name="fileExportText";
8528 cbradney 120
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 121
        name="fileExportAsEPS";
8528 cbradney 122
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 123
        name="fileExportAsPDF";
9532 cbradney 124
        scrActions->insert(name, new ScrAction(loadIcon("acroread16.png"), loadIcon("acroread22.png"), "", defKeys[name], mainWindow, name));
1993 cbradney 125
        //Rest of File Menu
5243 cbradney 126
        name="fileDocSetup";
8528 cbradney 127
        scrActions->insert(name, new ScrAction(loadIcon("16/document-properties.png"), loadIcon("22/document-properties.png"), "", defKeys[name], mainWindow, name));
5713 cbradney 128
        name="filePreferences";
8528 cbradney 129
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 130
        name="filePrint";
8528 cbradney 131
        scrActions->insert(name, new ScrAction(loadIcon("16/document-print.png"), loadIcon("22/document-print.png"), "", defKeys[name], mainWindow, name));
5243 cbradney 132
        name="PrintPreview";
9148 cbradney 133
        scrActions->insert(name, new ScrAction(loadIcon("16/document-print-preview.png"), loadIcon("22/document-print-preview.png"), "", defKeys[name], mainWindow, name));
5243 cbradney 134
        name="fileQuit";
8528 cbradney 135
        scrActions->insert(name, new ScrAction(loadIcon("exit.png"), QPixmap(), "", defKeys[name], mainWindow, name));
1993 cbradney 136
 
137
        //Connect our signals and slots
138
        //File Menu
5243 cbradney 139
        connect( (*scrActions)["fileNew"], SIGNAL(activated()), mainWindow, SLOT(slotFileNew()) );
140
        connect( (*scrActions)["fileOpen"], SIGNAL(activated()), mainWindow, SLOT(slotDocOpen()) );
141
        connect( (*scrActions)["fileClose"], SIGNAL(activated()), mainWindow, SLOT(slotFileClose()) );
142
        connect( (*scrActions)["filePrint"], SIGNAL(activated()), mainWindow, SLOT(slotFilePrint()) );
143
        connect( (*scrActions)["PrintPreview"], SIGNAL(activated()), mainWindow, SLOT(printPreview()) );
144
        connect( (*scrActions)["fileSave"], SIGNAL(activated()), mainWindow, SLOT(slotFileSave()) );
145
        connect( (*scrActions)["fileSaveAs"], SIGNAL(activated()), mainWindow, SLOT(slotFileSaveAs()) );
146
        connect( (*scrActions)["fileDocSetup"], SIGNAL(activated()), mainWindow, SLOT(slotDocSetup()) );
5713 cbradney 147
        connect( (*scrActions)["filePreferences"], SIGNAL(activated()), mainWindow, SLOT(slotPrefsOrg()) );
5243 cbradney 148
        connect( (*scrActions)["fileRevert"], SIGNAL(activated()), mainWindow, SLOT(slotFileRevert()) );
149
        connect( (*scrActions)["fileCollect"], SIGNAL(activated()), mainWindow, SLOT(Collect()) );
150
        connect( (*scrActions)["fileQuit"], SIGNAL(activated()), mainWindow, SLOT(slotFileQuit()) );
1993 cbradney 151
        //File Import Menu
5243 cbradney 152
        connect( (*scrActions)["fileImportText"], SIGNAL(activated()), mainWindow, SLOT(slotGetContent()) );
5715 tsoots 153
        connect( (*scrActions)["fileImportText2"], SIGNAL(activated()), mainWindow, SLOT(slotGetContent2()) );
5243 cbradney 154
        connect( (*scrActions)["fileImportAppendText"], SIGNAL(activated()), mainWindow, SLOT(slotFileAppend()) );
155
        connect( (*scrActions)["fileImportImage"], SIGNAL(activated()), mainWindow, SLOT(slotGetContent()) );
1993 cbradney 156
        //File Export Menu
5243 cbradney 157
        connect( (*scrActions)["fileExportText"], SIGNAL(activated()), mainWindow, SLOT(SaveText()) );
158
        connect( (*scrActions)["fileExportAsEPS"], SIGNAL(activated()), mainWindow, SLOT(SaveAsEps()) );
159
        connect( (*scrActions)["fileExportAsPDF"], SIGNAL(activated()), mainWindow, SLOT(SaveAsPDF()) );
1993 cbradney 160
        //The rest are plugins
161
}
162
 
163
void ActionManager::initEditMenuActions()
164
{
5243 cbradney 165
        QString name;
1993 cbradney 166
        //Edit Menu
5243 cbradney 167
        name="editUndoAction";
8528 cbradney 168
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/edit-undo.png"), loadIcon("22/edit-undo.png"), "", defKeys[name], mainWindow, name,1));
5243 cbradney 169
        name="editRedoAction";
8528 cbradney 170
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/edit-redo.png"), loadIcon("22/edit-redo.png"), "", defKeys[name], mainWindow, name, 1));
5243 cbradney 171
        name="editActionMode";
8528 cbradney 172
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
1993 cbradney 173
        (*scrActions)["editActionMode"]->setToggleAction(true);
7087 subik 174
 
5243 cbradney 175
        name="editCut";
8528 cbradney 176
        scrActions->insert(name, new ScrAction(loadIcon("16/edit-cut.png"), loadIcon("22/edit-cut.png"), "", defKeys[name], mainWindow, name));
5243 cbradney 177
        name="editCopy";
8528 cbradney 178
        scrActions->insert(name, new ScrAction(loadIcon("16/edit-copy.png"), loadIcon("22/edit-copy.png"), "", defKeys[name], mainWindow, name));
5243 cbradney 179
        name="editPaste";
8528 cbradney 180
        scrActions->insert(name, new ScrAction(loadIcon("16/edit-paste.png"), loadIcon("22/edit-paste.png"), "", defKeys[name], mainWindow, name));
5243 cbradney 181
        name="editCopyContents";
8528 cbradney 182
        scrActions->insert(name, new ScrAction(loadIcon("16/edit-copy.png"), loadIcon("22/edit-copy.png"), "", defKeys[name], mainWindow, name));
5243 cbradney 183
        name="editPasteContents";
8528 cbradney 184
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/edit-paste.png"), QPixmap(), "", defKeys[name], mainWindow, name,0));
5243 cbradney 185
        name="editPasteContentsAbs";
9142 cbradney 186
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/edit-paste.png"), QPixmap(), "", defKeys[name], mainWindow, name,1));
5243 cbradney 187
        name="editClearContents";
9142 cbradney 188
        scrActions->insert(name, new ScrAction(loadIcon("16/edit-delete.png"), loadIcon("22/edit-delete.png"), "", defKeys[name], mainWindow, name));
5243 cbradney 189
        name="editSelectAll";
8528 cbradney 190
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 191
        name="editDeselectAll";
8528 cbradney 192
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 193
        name="editSearchReplace";
8528 cbradney 194
        scrActions->insert(name, new ScrAction(loadIcon("16/edit-find-replace.png"), loadIcon("22/edit-find-replace.png"), "", defKeys[name], mainWindow, name));
5243 cbradney 195
        name="editEditWithImageEditor";
8528 cbradney 196
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 197
        name="editColors";
8528 cbradney 198
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
6368 fschmid 199
        name="editPatterns";
8528 cbradney 200
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 201
        name="editStyles";
8528 cbradney 202
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
8291 tsoots 203
//      name="editParaStyles";
204
//      scrActions->insert(name, new ScrAction(QIconSet(noIcon),"", defKeys[name], mainWindow, name));
205
//      name="editLineStyles";
206
//      scrActions->insert(name, new ScrAction(QIconSet(noIcon),"", defKeys[name], mainWindow, name));
5243 cbradney 207
        name="editMasterPages";
8528 cbradney 208
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 209
        name="editJavascripts";
8528 cbradney 210
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
2264 subik 211
 
4829 tsoots 212
        (*scrActions)["editStyles"]->setToggleAction(true);
213
 
1993 cbradney 214
        connect( (*scrActions)["editUndoAction"], SIGNAL(activatedData(int)) , undoManager, SLOT(undo(int)) );
215
        connect( (*scrActions)["editRedoAction"], SIGNAL(activatedData(int)) , undoManager, SLOT(redo(int)) );
5243 cbradney 216
        connect( (*scrActions)["editActionMode"], SIGNAL(toggled(bool)), mainWindow, SLOT(setUndoMode(bool)) );
217
        connect( (*scrActions)["editCut"], SIGNAL(activated()), mainWindow, SLOT(slotEditCut()) );
218
        connect( (*scrActions)["editCopy"], SIGNAL(activated()), mainWindow, SLOT(slotEditCopy()) );
219
        connect( (*scrActions)["editPaste"], SIGNAL(activated()), mainWindow, SLOT(slotEditPaste()) );
220
        connect( (*scrActions)["editCopyContents"], SIGNAL(activated()), mainWindow, SLOT(slotEditCopyContents()) );
221
        connect( (*scrActions)["editPasteContents"], SIGNAL(activatedData(int)), mainWindow, SLOT(slotEditPasteContents(int)) );
222
        connect( (*scrActions)["editPasteContentsAbs"], SIGNAL(activatedData(int)), mainWindow, SLOT(slotEditPasteContents(int)) );
223
        connect( (*scrActions)["editSelectAll"], SIGNAL(activated()), mainWindow, SLOT(SelectAll()) );
224
        connect( (*scrActions)["editDeselectAll"], SIGNAL(activated()), mainWindow, SLOT(deselectAll()) );
225
        connect( (*scrActions)["editSearchReplace"], SIGNAL(activated()), mainWindow, SLOT(SearchText()) );
226
        connect( (*scrActions)["editEditWithImageEditor"], SIGNAL(activated()), mainWindow, SLOT(callImageEditor()) );
227
        connect( (*scrActions)["editColors"], SIGNAL(activated()), mainWindow, SLOT(slotEditColors()) );
6368 fschmid 228
        connect( (*scrActions)["editPatterns"], SIGNAL(activated()), mainWindow, SLOT(managePatterns()) );
8005 cbradney 229
//      connect( (*scrActions)["editStyles"], SIGNAL(activated()), mainWindow, SLOT(slotStyleManager()) );
8291 tsoots 230
//      connect( (*scrActions)["editParaStyles"], SIGNAL(activated()), mainWindow, SLOT(slotEditStyles()) );
231
//      connect( (*scrActions)["editLineStyles"], SIGNAL(activated()), mainWindow, SLOT(slotEditLineStyles()) );
5243 cbradney 232
        connect( (*scrActions)["editMasterPages"], SIGNAL(activated()), mainWindow, SLOT(manageMasterPages()) );
233
        connect( (*scrActions)["editJavascripts"], SIGNAL(activated()), mainWindow, SLOT(ManageJava()) );
1993 cbradney 234
}
235
 
236
void ActionManager::initStyleMenuActions()
237
{
5243 cbradney 238
        QString name;
1993 cbradney 239
        //Text Size actions
8501 cbradney 240
        (*scrActionGroups).insert("fontSize", new Q3ActionGroup(mainWindow, "fontSize", true));
5243 cbradney 241
        name="fontSizeOther";
8528 cbradney 242
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defKeys[name], (*scrActionGroups)["fontSize"], name, -1));
5243 cbradney 243
        connect( (*scrActions)["fontSizeOther"], SIGNAL(activatedData(int)), mainWindow, SLOT(setItemFSize(int)));
1993 cbradney 244
 
245
        int font_sizes[] = {7, 9, 10, 11, 12, 14, 18, 24, 36, 48, 60, 72};
246
        size_t f_size = sizeof(font_sizes) / sizeof(*font_sizes);
247
        for (uint s = 0; s < f_size; ++s)
248
        {
249
                QString fontSizeName=QString("fontSize%1").arg(font_sizes[s]);
8528 cbradney 250
                scrActions->insert(fontSizeName, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defKeys[name], (*scrActionGroups)["fontSize"], fontSizeName, font_sizes[s]));
1993 cbradney 251
                (*scrActions)[fontSizeName]->setToggleAction(true);
5243 cbradney 252
                connect( (*scrActions)[fontSizeName], SIGNAL(activatedData(int)), mainWindow, SLOT(setItemFSize(int)));
1993 cbradney 253
        }
254
 
255
        //Alignment actions
5243 cbradney 256
        name="alignLeft";
8528 cbradney 257
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defKeys[name], mainWindow, name, 0));
5243 cbradney 258
        name="alignCenter";
8528 cbradney 259
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defKeys[name], mainWindow, name, 1));
5243 cbradney 260
        name="alignRight";
8528 cbradney 261
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defKeys[name], mainWindow, name, 2));
5243 cbradney 262
        name="alignBlock";
8528 cbradney 263
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defKeys[name], mainWindow, name, 3));
5243 cbradney 264
        name="alignForced";
8528 cbradney 265
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defKeys[name], mainWindow, name, 4));
1993 cbradney 266
 
267
        (*scrActions)["alignLeft"]->setToggleAction(true);
268
        (*scrActions)["alignCenter"]->setToggleAction(true);
269
        (*scrActions)["alignRight"]->setToggleAction(true);
270
        (*scrActions)["alignBlock"]->setToggleAction(true);
271
        (*scrActions)["alignForced"]->setToggleAction(true);
272
 
5774 avox 273
        connect( (*scrActions)["alignLeft"], SIGNAL(activatedData(int)), mainWindow, SLOT(setNewAlignment(int)));
274
        connect( (*scrActions)["alignCenter"], SIGNAL(activatedData(int)), mainWindow, SLOT(setNewAlignment(int)));
275
        connect( (*scrActions)["alignRight"], SIGNAL(activatedData(int)), mainWindow, SLOT(setNewAlignment(int)));
276
        connect( (*scrActions)["alignBlock"], SIGNAL(activatedData(int)), mainWindow, SLOT(setNewAlignment(int)));
277
        connect( (*scrActions)["alignForced"], SIGNAL(activatedData(int)), mainWindow, SLOT(setNewAlignment(int)));
1993 cbradney 278
 
279
        //Shade actions
8501 cbradney 280
        scrActionGroups->insert("shade", new Q3ActionGroup(mainWindow, "shade", true));
5243 cbradney 281
        name="shadeOther";
8528 cbradney 282
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defKeys[name], (*scrActionGroups)["shade"], name, -1));
5243 cbradney 283
        connect( (*scrActions)["shadeOther"], SIGNAL(activatedData(int)), mainWindow, SLOT(setItemShade(int)));
1993 cbradney 284
        for (uint i=0; i<=100 ; i+=10)
285
        {
286
                QString shadeName=QString("shade%1").arg(i);
8528 cbradney 287
                scrActions->insert(shadeName, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defKeys[name], (*scrActionGroups)["shade"], shadeName, i));
1993 cbradney 288
                (*scrActions)[shadeName]->setToggleAction(true);
5243 cbradney 289
                connect( (*scrActions)[shadeName], SIGNAL(activatedData(int)), mainWindow, SLOT(setItemShade(int)));
1993 cbradney 290
        }
291
 
292
        //Type Effects actions
8501 cbradney 293
        scrActionGroups->insert("typeEffects", new Q3ActionGroup(mainWindow, "typeEffects", false));
5243 cbradney 294
        name="typeEffectNormal";
8528 cbradney 295
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defKeys[name], (*scrActionGroups)["typeEffects"], name, 0));
5243 cbradney 296
        name="typeEffectUnderline";
8528 cbradney 297
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defKeys[name], (*scrActionGroups)["typeEffects"], name, 1));
5243 cbradney 298
        name="typeEffectUnderlineWords";
8528 cbradney 299
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defKeys[name], (*scrActionGroups)["typeEffects"], name, 8));
5243 cbradney 300
        name="typeEffectStrikeThrough";
8528 cbradney 301
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defKeys[name], (*scrActionGroups)["typeEffects"], name, 2));
5243 cbradney 302
        name="typeEffectAllCaps";
8528 cbradney 303
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defKeys[name], (*scrActionGroups)["typeEffects"], name, 7));
5243 cbradney 304
        name="typeEffectSmallCaps";
8528 cbradney 305
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defKeys[name], (*scrActionGroups)["typeEffects"], name, 3));
5243 cbradney 306
        name="typeEffectSuperscript";
8528 cbradney 307
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defKeys[name], (*scrActionGroups)["typeEffects"], name, 4));
5243 cbradney 308
        name="typeEffectSubscript";
8528 cbradney 309
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defKeys[name], (*scrActionGroups)["typeEffects"], name, 5));
5243 cbradney 310
        name="typeEffectOutline";
8528 cbradney 311
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defKeys[name], (*scrActionGroups)["typeEffects"], name, 6));
5243 cbradney 312
        name="typeEffectShadow";
8528 cbradney 313
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defKeys[name], (*scrActionGroups)["typeEffects"], name, 9));
1993 cbradney 314
        (*scrActions)["typeEffectNormal"]->setToggleAction(true);
315
        (*scrActions)["typeEffectUnderline"]->setToggleAction(true);
2188 fschmid 316
        (*scrActions)["typeEffectUnderlineWords"]->setToggleAction(true);
1993 cbradney 317
        (*scrActions)["typeEffectStrikeThrough"]->setToggleAction(true);
2185 fschmid 318
        (*scrActions)["typeEffectAllCaps"]->setToggleAction(true);
1993 cbradney 319
        (*scrActions)["typeEffectSmallCaps"]->setToggleAction(true);
320
        (*scrActions)["typeEffectSuperscript"]->setToggleAction(true);
321
        (*scrActions)["typeEffectSubscript"]->setToggleAction(true);
322
        (*scrActions)["typeEffectOutline"]->setToggleAction(true);
2229 fschmid 323
        (*scrActions)["typeEffectShadow"]->setToggleAction(true);
5243 cbradney 324
        connect( (*scrActions)["typeEffectNormal"], SIGNAL(activatedData(int)), mainWindow, SLOT(setItemTypeStyle(int)));
325
        connect( (*scrActions)["typeEffectUnderline"], SIGNAL(activatedData(int)), mainWindow, SLOT(setItemTypeStyle(int)));
326
        connect( (*scrActions)["typeEffectUnderlineWords"], SIGNAL(activatedData(int)), mainWindow, SLOT(setItemTypeStyle(int)));
327
        connect( (*scrActions)["typeEffectStrikeThrough"], SIGNAL(activatedData(int)), mainWindow, SLOT(setItemTypeStyle(int)));
328
        connect( (*scrActions)["typeEffectSmallCaps"], SIGNAL(activatedData(int)), mainWindow, SLOT(setItemTypeStyle(int)));
329
        connect( (*scrActions)["typeEffectAllCaps"], SIGNAL(activatedData(int)), mainWindow, SLOT(setItemTypeStyle(int)));
330
        connect( (*scrActions)["typeEffectSuperscript"], SIGNAL(activatedData(int)), mainWindow, SLOT(setItemTypeStyle(int)));
331
        connect( (*scrActions)["typeEffectSubscript"], SIGNAL(activatedData(int)), mainWindow, SLOT(setItemTypeStyle(int)));
332
        connect( (*scrActions)["typeEffectOutline"], SIGNAL(activatedData(int)), mainWindow, SLOT(setItemTypeStyle(int)));
333
        connect( (*scrActions)["typeEffectShadow"], SIGNAL(activatedData(int)), mainWindow, SLOT(setItemTypeStyle(int)));
1993 cbradney 334
 
335
        //Other Style menu items that get added in various places
5243 cbradney 336
        name="styleImageEffects";
337
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
338
        name="styleTabulators";
339
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
340
        connect( (*scrActions)["styleImageEffects"], SIGNAL(activated()), mainWindow, SLOT(ImageEffects()));
341
        connect( (*scrActions)["styleTabulators"], SIGNAL(activated()), mainWindow, SLOT(EditTabs()));
1993 cbradney 342
 
343
}
344
 
345
void ActionManager::initItemMenuActions()
346
{
5243 cbradney 347
        QString name;
1993 cbradney 348
        //Item Menu
5243 cbradney 349
        name="itemDuplicate";
350
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
351
        name="itemMulDuplicate";
352
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
353
        name="itemDelete";
354
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
355
        name="itemGroup";
356
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
357
        name="itemUngroup";
358
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
359
        name="itemLock";
360
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
361
        name="itemLockSize";
362
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
363
        name="itemPrintingEnabled";
364
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
365
        name="itemFlipH";
366
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
367
        name="itemFlipV";
368
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
4695 cbradney 369
        (*scrActions)["itemLock"]->setToggleAction(true, true);
370
        (*scrActions)["itemLockSize"]->setToggleAction(true, true);
4698 cbradney 371
        (*scrActions)["itemPrintingEnabled"]->setToggleAction(true, true);
4699 cbradney 372
        (*scrActions)["itemFlipH"]->setToggleAction(true, true);
373
        (*scrActions)["itemFlipV"]->setToggleAction(true, true);
5243 cbradney 374
        name="itemLowerToBottom";
8528 cbradney 375
        scrActions->insert(name, new ScrAction(loadIcon("16/go-bottom.png"), loadIcon("22/go-bottom.png"), "", defKeys[name], mainWindow, name));
5243 cbradney 376
        name="itemRaiseToTop";
8528 cbradney 377
        scrActions->insert(name, new ScrAction(loadIcon("16/go-top.png"), loadIcon("22/go-top.png"), "", defKeys[name], mainWindow, name));
5243 cbradney 378
        name="itemLower";
8528 cbradney 379
        scrActions->insert(name, new ScrAction(loadIcon("16/go-down.png"), loadIcon("22/go-down.png"), "", defKeys[name], mainWindow, name));
5243 cbradney 380
        name="itemRaise";
8528 cbradney 381
        scrActions->insert(name, new ScrAction(loadIcon("16/go-up.png"), loadIcon("22/go-up.png"), "", defKeys[name], mainWindow, name));
5243 cbradney 382
        name="itemSendToScrapbook";
383
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
6410 fschmid 384
        name="itemSendToPattern";
385
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 386
        name="itemImageInfo";
387
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
388
        name="itemAttributes";
389
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
390
        name="itemImageIsVisible";
391
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
392
        name="itemUpdateImage";
393
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
394
        name="itemAdjustFrameToImage";
395
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
396
        name="itemExtendedImageProperties";
397
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
398
        name="itemPreviewLow";
8528 cbradney 399
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defKeys[name], mainWindow, name, 2));
5243 cbradney 400
        name="itemPreviewNormal";
8528 cbradney 401
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defKeys[name], mainWindow, name, 1));
5243 cbradney 402
        name="itemPreviewFull";
8528 cbradney 403
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defKeys[name], mainWindow, name, 0));
5243 cbradney 404
        name="itemPDFIsBookmark";
405
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
1993 cbradney 406
        (*scrActions)["itemPDFIsBookmark"]->setToggleAction(true);
5243 cbradney 407
        name="itemPDFIsAnnotation";
408
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
1993 cbradney 409
        (*scrActions)["itemPDFIsAnnotation"]->setToggleAction(true);
5243 cbradney 410
        name="itemPDFAnnotationProps";
411
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
412
        name="itemPDFFieldProps";
413
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
2246 subik 414
 
1993 cbradney 415
        (*scrActions)["itemPDFIsBookmark"]->setEnabled(false);
416
        (*scrActions)["itemPDFIsAnnotation"]->setEnabled(false);
417
        (*scrActions)["itemPDFAnnotationProps"]->setEnabled(false);
418
        (*scrActions)["itemPDFFieldProps"]->setEnabled(false);
2246 subik 419
 
2026 cbradney 420
        (*scrActions)["itemImageIsVisible"]->setToggleAction(true);
2256 cbradney 421
        (*scrActions)["itemPreviewLow"]->setToggleAction(true);
422
        (*scrActions)["itemPreviewNormal"]->setToggleAction(true);
423
        (*scrActions)["itemPreviewFull"]->setToggleAction(true);
2246 subik 424
 
5243 cbradney 425
        name="itemShapeEdit";
426
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
1993 cbradney 427
        (*scrActions)["itemShapeEdit"]->setToggleAction(true);
5243 cbradney 428
        name="itemAttachTextToPath";
429
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
430
        name="itemDetachTextFromPath";
431
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
432
        name="itemCombinePolygons";
433
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
434
        name="itemSplitPolygons";
435
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
436
        name="itemConvertToBezierCurve";
437
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
438
        name="itemConvertToImageFrame";
439
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
440
        name="itemConvertToOutlines";
441
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
442
        name="itemConvertToPolygon";
443
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
444
        name="itemConvertToTextFrame";
445
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
1993 cbradney 446
 
5243 cbradney 447
        connect( (*scrActions)["itemDuplicate"], SIGNAL(activated()), mainWindow, SLOT(ObjektDup()) );
448
        connect( (*scrActions)["itemMulDuplicate"], SIGNAL(activated()), mainWindow, SLOT(ObjektDupM()) );
449
        connect( (*scrActions)["itemGroup"], SIGNAL(activated()), mainWindow, SLOT(GroupObj()) );
450
        connect( (*scrActions)["itemUngroup"], SIGNAL(activated()), mainWindow, SLOT(UnGroupObj()) );
451
        connect( (*scrActions)["itemPDFAnnotationProps"], SIGNAL(activated()), mainWindow, SLOT(ModifyAnnot()) );
452
        connect( (*scrActions)["itemPDFFieldProps"], SIGNAL(activated()), mainWindow, SLOT(ModifyAnnot()) );
453
        connect( (*scrActions)["itemSendToScrapbook"], SIGNAL(activated()), mainWindow, SLOT(PutScrap()) );
6410 fschmid 454
        connect( (*scrActions)["itemSendToPattern"], SIGNAL(activated()), mainWindow, SLOT(PutToPatterns()) );
5243 cbradney 455
        connect( (*scrActions)["itemAttributes"], SIGNAL(activated()), mainWindow, SLOT(objectAttributes()) );
456
        connect( (*scrActions)["itemShapeEdit"], SIGNAL(activated()), mainWindow, SLOT(ToggleFrameEdit()) );
457
        connect( (*scrActions)["itemImageInfo"], SIGNAL(activated()), mainWindow, SLOT(getImageInfo()) );
1993 cbradney 458
}
459
 
460
void ActionManager::initInsertMenuActions()
461
{
5243 cbradney 462
        QString name;
1993 cbradney 463
        //Insert Menu
6083 cbradney 464
        name="insertFrame";
8528 cbradney 465
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 466
        name="insertGlyph";
8528 cbradney 467
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
7087 subik 468
        (*scrActions)["insertGlyph"]->setToggleAction(true);
5243 cbradney 469
        name="insertSampleText";
8528 cbradney 470
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
7350 fschmid 471
        name="stickyTools";
8528 cbradney 472
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
7350 fschmid 473
        (*scrActions)["stickyTools"]->setToggleAction(true);
2246 subik 474
 
6083 cbradney 475
        connect( (*scrActions)["insertFrame"], SIGNAL(activated()), mainWindow, SLOT(slotInsertFrame()) );
5243 cbradney 476
        connect( (*scrActions)["insertGlyph"], SIGNAL(activated()), mainWindow, SLOT(slotCharSelect()) );
477
        connect( (*scrActions)["insertSampleText"], SIGNAL(activated()), mainWindow, SLOT(insertSampleText()) );
7350 fschmid 478
        connect( (*scrActions)["stickyTools"], SIGNAL(activated()), mainWindow, SLOT(ToggleStickyTools()) );
1993 cbradney 479
}
480
 
481
void ActionManager::initPageMenuActions()
482
{
5243 cbradney 483
        QString name;
1993 cbradney 484
        //Page menu
5243 cbradney 485
        name="pageInsert";
486
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
487
        name="pageImport";
488
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
489
        name="pageDelete";
490
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
491
        name="pageCopy";
492
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
493
        name="pageMove";
494
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
495
        name="pageApplyMasterPage";
496
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
497
        name="pageCopyToMasterPage";
498
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
499
        name="pageManageGuides";
500
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5087 subik 501
        (*scrActions)["pageManageGuides"]->setToggleAction(true);
5243 cbradney 502
        name="pageManageMargins";
503
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
1993 cbradney 504
 
5243 cbradney 505
        connect( (*scrActions)["pageInsert"], SIGNAL(activated()), mainWindow, SLOT(slotNewPageM()) );
506
        connect( (*scrActions)["pageImport"], SIGNAL(activated()), mainWindow, SLOT(slotPageImport()) );
507
        connect( (*scrActions)["pageDelete"], SIGNAL(activated()), mainWindow, SLOT(DeletePage()) );
508
        connect( (*scrActions)["pageCopy"], SIGNAL(activated()), mainWindow, SLOT(CopyPage()) );
509
        connect( (*scrActions)["pageMove"], SIGNAL(activated()), mainWindow, SLOT(MovePage()) );
510
        connect( (*scrActions)["pageApplyMasterPage"], SIGNAL(activated()), mainWindow, SLOT(ApplyMasterPage()) );
511
        connect( (*scrActions)["pageCopyToMasterPage"], SIGNAL(activated()), mainWindow, SLOT(duplicateToMasterPage()) );
512
        connect( (*scrActions)["pageManageMargins"], SIGNAL(activated()), mainWindow, SLOT(changePageMargins()) );
1993 cbradney 513
}
514
 
515
void ActionManager::initViewMenuActions()
516
{
5243 cbradney 517
        QString name;
518
        name="viewFitInWindow";
8528 cbradney 519
        scrActions->insert(name, new ScrAction(ScrAction::DataDouble, QPixmap(), QPixmap(), "", defKeys[name], mainWindow, name, 0, -100.0));
7164 fschmid 520
        name="viewFitWidth";
8528 cbradney 521
        scrActions->insert(name, new ScrAction(ScrAction::DataDouble, QPixmap(), QPixmap(), "", defKeys[name], mainWindow, name, 0, -200.0));
5243 cbradney 522
        name="viewFit50";
8528 cbradney 523
        scrActions->insert(name, new ScrAction(ScrAction::DataDouble, QPixmap(), QPixmap(), "", defKeys[name], mainWindow, name, 0, 50.0));
5243 cbradney 524
        name="viewFit75";
8528 cbradney 525
        scrActions->insert(name, new ScrAction(ScrAction::DataDouble, QPixmap(), QPixmap(), "", defKeys[name], mainWindow, name, 0, 75.0));
5243 cbradney 526
        name="viewFit100";
8528 cbradney 527
        scrActions->insert(name, new ScrAction(ScrAction::DataDouble, loadIcon("16/zoom-original.png"), loadIcon("22/zoom-original.png"), "", defKeys[name], mainWindow, name, 0, 100.0));
5243 cbradney 528
        name="viewFit200";
8528 cbradney 529
        scrActions->insert(name, new ScrAction(ScrAction::DataDouble, QPixmap(), QPixmap(), "", defKeys[name], mainWindow, name, 0, 200.0));
7587 cbradney 530
        name="viewFitPreview";
8528 cbradney 531
        scrActions->insert(name, new ScrAction(ScrAction::DataDouble, QPixmap(), QPixmap(), "", defKeys[name], mainWindow, name, 0, 20.0));
5243 cbradney 532
        name="viewShowMargins";
533
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
7051 fschmid 534
        name="viewShowBleeds";
535
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 536
        name="viewShowFrames";
537
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5584 fschmid 538
        name="viewShowLayerMarkers";
539
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 540
        name="viewShowImages";
541
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
542
        name="viewShowGrid";
543
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
544
        name="viewShowGuides";
545
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5384 cbradney 546
        name="viewShowColumnBorders";
547
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 548
        name="viewShowBaseline";
549
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
550
        name="viewShowTextChain";
551
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
552
        name="viewShowTextControls";
553
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
554
        name="viewShowRulers";
555
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
556
        name="viewRulerMode";
557
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
558
        name="viewSnapToGrid";
559
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
560
        name="viewSnapToGuides";
561
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
562
//      scrActions->insert("viewNewView", new ScrAction("", defKeys[name], mainWindow, name));
1993 cbradney 563
 
7587 cbradney 564
        (*scrActions)["viewFitPreview"]->setToggleAction(true);
1993 cbradney 565
        (*scrActions)["viewShowMargins"]->setToggleAction(true);
7051 fschmid 566
        (*scrActions)["viewShowBleeds"]->setToggleAction(true);
1993 cbradney 567
        (*scrActions)["viewShowFrames"]->setToggleAction(true);
5584 fschmid 568
        (*scrActions)["viewShowLayerMarkers"]->setToggleAction(true);
1993 cbradney 569
        (*scrActions)["viewShowImages"]->setToggleAction(true);
570
        (*scrActions)["viewShowGrid"]->setToggleAction(true);
571
        (*scrActions)["viewShowGuides"]->setToggleAction(true);
5384 cbradney 572
        (*scrActions)["viewShowColumnBorders"]->setToggleAction(true);
1993 cbradney 573
        (*scrActions)["viewShowBaseline"]->setToggleAction(true);
574
        (*scrActions)["viewShowTextChain"]->setToggleAction(true);
2353 fschmid 575
        (*scrActions)["viewShowTextControls"]->setToggleAction(true);
4651 cbradney 576
        (*scrActions)["viewShowRulers"]->setToggleAction(true);
2863 fschmid 577
        (*scrActions)["viewRulerMode"]->setToggleAction(true);
1993 cbradney 578
        (*scrActions)["viewSnapToGrid"]->setToggleAction(true);
579
        (*scrActions)["viewSnapToGuides"]->setToggleAction(true);
580
 
7587 cbradney 581
        (*scrActions)["viewFitPreview"]->setOn(false);
1993 cbradney 582
        (*scrActions)["viewShowMargins"]->setOn(true);
7051 fschmid 583
        (*scrActions)["viewShowBleeds"]->setOn(true);
1993 cbradney 584
        (*scrActions)["viewShowFrames"]->setOn(true);
5584 fschmid 585
        (*scrActions)["viewShowLayerMarkers"]->setOn(false);
1993 cbradney 586
        (*scrActions)["viewShowImages"]->setOn(true);
587
        (*scrActions)["viewShowGuides"]->setOn(true);
5384 cbradney 588
        (*scrActions)["viewShowColumnBorders"]->setOn(false);
4651 cbradney 589
        (*scrActions)["viewShowRulers"]->setOn(true);
2863 fschmid 590
        (*scrActions)["viewRulerMode"]->setOn(true);
1993 cbradney 591
 
5243 cbradney 592
        connect( (*scrActions)["viewFitInWindow"], SIGNAL(activatedData(double)), mainWindow, SLOT(slotZoom(double)) );
7164 fschmid 593
        connect( (*scrActions)["viewFitWidth"], SIGNAL(activatedData(double)), mainWindow, SLOT(slotZoom(double)) );
5243 cbradney 594
        connect( (*scrActions)["viewFit50"], SIGNAL(activatedData(double)), mainWindow, SLOT(slotZoom(double)) );
595
        connect( (*scrActions)["viewFit75"], SIGNAL(activatedData(double)), mainWindow, SLOT(slotZoom(double)) );
596
        connect( (*scrActions)["viewFit100"], SIGNAL(activatedData(double)), mainWindow, SLOT(slotZoom(double)) );
597
        connect( (*scrActions)["viewFit200"], SIGNAL(activatedData(double)), mainWindow, SLOT(slotZoom(double)) );
598
        connect( (*scrActions)["viewShowMargins"], SIGNAL(activated()), mainWindow, SLOT(ToggleMarks()) );
7051 fschmid 599
        connect( (*scrActions)["viewShowBleeds"], SIGNAL(activated()), mainWindow, SLOT(ToggleBleeds()) );
5243 cbradney 600
        connect( (*scrActions)["viewShowFrames"], SIGNAL(activated()), mainWindow, SLOT(ToggleFrames()) );
5584 fschmid 601
        connect( (*scrActions)["viewShowLayerMarkers"], SIGNAL(activated()), mainWindow, SLOT(ToggleLayerMarkers()) );
5243 cbradney 602
        connect( (*scrActions)["viewShowImages"], SIGNAL(activated()), mainWindow, SLOT(TogglePics()) );
603
        connect( (*scrActions)["viewShowGrid"], SIGNAL(activated()), mainWindow, SLOT(ToggleRaster()) );
604
        connect( (*scrActions)["viewShowGuides"], SIGNAL(activated()), mainWindow, SLOT(ToggleGuides()) );
5384 cbradney 605
        connect( (*scrActions)["viewShowColumnBorders"], SIGNAL(activated()), mainWindow, SLOT(ToggleColumnBorders()) );
5243 cbradney 606
        connect( (*scrActions)["viewShowBaseline"], SIGNAL(activated()), mainWindow, SLOT(ToggleBase()) );
607
        connect( (*scrActions)["viewShowTextChain"], SIGNAL(activated()), mainWindow, SLOT(ToggleTextLinks()) );
608
        connect( (*scrActions)["viewShowTextControls"], SIGNAL(activated()), mainWindow, SLOT(ToggleTextControls()) );
609
        connect( (*scrActions)["viewShowRulers"], SIGNAL(activated()), mainWindow, SLOT(ToggleRulers()) );
610
        connect( (*scrActions)["viewRulerMode"], SIGNAL(activated()), mainWindow, SLOT(ToggleRulerMode()) );
611
        connect( (*scrActions)["viewSnapToGrid"], SIGNAL(activated()), mainWindow, SLOT(ToggleURaster()) );
612
        connect( (*scrActions)["viewSnapToGuides"], SIGNAL(activated()), mainWindow, SLOT(ToggleUGuides()) );
613
//      connect( (*scrActions)["viewNewView"], SIGNAL(activated()), mainWindow, SLOT(newView()) );
1993 cbradney 614
 
615
}
616
 
617
void ActionManager::initToolsMenuActions()
618
{
5243 cbradney 619
        QString name;
1993 cbradney 620
        //Tool menu
5243 cbradney 621
        name="toolsProperties";
8528 cbradney 622
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 623
        name="toolsOutline";
8528 cbradney 624
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 625
        name="toolsScrapbook";
8528 cbradney 626
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 627
        name="toolsLayers";
8528 cbradney 628
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 629
        name="toolsPages";
8528 cbradney 630
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 631
        name="toolsBookmarks";
8528 cbradney 632
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 633
        name="toolsMeasurements";
8528 cbradney 634
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/measure.png"), loadIcon("22/measure.png"), "", defKeys[name], mainWindow, name, modeMeasurementTool));
5243 cbradney 635
        name="toolsActionHistory";
8528 cbradney 636
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 637
        name="toolsPreflightVerifier";
8528 cbradney 638
        scrActions->insert(name, new ScrAction(loadIcon("16/preflight-verifier.png"), loadIcon("22/preflight-verifier.png"),"", defKeys[name], mainWindow, name));
5243 cbradney 639
        name="toolsAlignDistribute";
8528 cbradney 640
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 641
        name="toolsToolbarTools";
8528 cbradney 642
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
5243 cbradney 643
        name="toolsToolbarPDF";
8528 cbradney 644
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
2246 subik 645
 
1993 cbradney 646
        //toolbar only items
5243 cbradney 647
        name="toolsSelect";
8528 cbradney 648
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("22/pointer.png"), loadIcon("22/pointer.png"), "", defKeys[name], mainWindow, name, modeNormal));
5243 cbradney 649
        name="toolsInsertTextFrame";
8528 cbradney 650
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/insert-text-frame.png"), loadIcon("22/insert-text-frame.png"), "", defKeys[name], mainWindow, name, modeDrawText));
5243 cbradney 651
        name="toolsInsertImageFrame";
8528 cbradney 652
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/insert-image.png"), loadIcon("22/insert-image.png"), "", defKeys[name], mainWindow, name, modeDrawPicture));
5243 cbradney 653
        name="toolsInsertTableFrame";
8528 cbradney 654
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/insert-table.png"), loadIcon("22/insert-table.png"), "", defKeys[name], mainWindow, name, modeDrawTable));
5243 cbradney 655
        name="toolsInsertShape";
8528 cbradney 656
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defKeys[name], mainWindow, name, modeDrawShapes));
5243 cbradney 657
        name="toolsInsertPolygon";
8528 cbradney 658
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/draw-polygon.png"), loadIcon("22/draw-polygon.png"), "", defKeys[name], mainWindow, name, modeDrawRegularPolygon));
5243 cbradney 659
        name="toolsInsertLine";
8528 cbradney 660
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("Stift16.xpm"), loadIcon("Stift.xpm"), "", defKeys[name], mainWindow, name, modeDrawLine));
5243 cbradney 661
        name="toolsInsertBezier";
8528 cbradney 662
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/draw-path.png"), loadIcon("22/draw-path.png"), "", defKeys[name], mainWindow, name, modeDrawBezierLine));
5243 cbradney 663
        name="toolsInsertFreehandLine";
8528 cbradney 664
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("22/draw-freehand.png"), loadIcon("22/draw-freehand.png"), "", defKeys[name], mainWindow, name, modeDrawFreehandLine));
5243 cbradney 665
        name="toolsRotate";
8528 cbradney 666
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("22/transform-rotate.png"), loadIcon("22/transform-rotate.png"), "", defKeys[name], mainWindow, name, modeRotation));
5243 cbradney 667
        name="toolsZoom";
8528 cbradney 668
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/zoom.png"), loadIcon("22/zoom.png"), "", defKeys[name], mainWindow, name, modeMagnifier));
5243 cbradney 669
        name="toolsZoomIn";
8528 cbradney 670
        scrActions->insert(name, new ScrAction(loadIcon("16/zoom-in.png"), loadIcon("22/zoom-in.png"), "", defKeys[name], mainWindow, name));
5243 cbradney 671
        name="toolsZoomOut";
8528 cbradney 672
        scrActions->insert(name, new ScrAction(loadIcon("16/zoom-out.png"), loadIcon("22/zoom-out.png"), "", defKeys[name], mainWindow, name));
5243 cbradney 673
        name="toolsEditContents";
8528 cbradney 674
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("Editm.xpm"), loadIcon("Editm.xpm"), "", defKeys[name], mainWindow, name, modeEdit));
5243 cbradney 675
        name="toolsEditWithStoryEditor";
8528 cbradney 676
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/story-editor.png"), loadIcon("22/story-editor.png"), "", defKeys[name], mainWindow, name, modeStoryEditor));
5243 cbradney 677
        name="toolsLinkTextFrame";
8528 cbradney 678
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("22/text-frame-link.png"), loadIcon("22/text-frame-link.png"), "", defKeys[name], mainWindow, name, modeLinkFrames));
5243 cbradney 679
        name="toolsUnlinkTextFrame";
8528 cbradney 680
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("22/text-frame-unlink.png"), loadIcon("22/text-frame-unlink.png"), "", defKeys[name], mainWindow, name, modeUnlinkFrames));
5243 cbradney 681
        name="toolsEyeDropper";
8528 cbradney 682
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("22/color-picker.png"), loadIcon("22/color-picker.png"), "", defKeys[name], mainWindow, name, modeEyeDropper));
5243 cbradney 683
        name="toolsCopyProperties";
8528 cbradney 684
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("wizard.png"), loadIcon("wizard.png"), "", defKeys[name], mainWindow, name, modeCopyProperties));
7087 subik 685
 
5277 cbradney 686
        //PDF toolbar
687
        name="toolsPDFPushButton";
8528 cbradney 688
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("22/insert-button.png"), QPixmap(), "", defKeys[name], mainWindow, name, modeInsertPDFButton));
5277 cbradney 689
        name="toolsPDFTextField";
8528 cbradney 690
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("22/text-field.png"), QPixmap(), "", defKeys[name], mainWindow, name, modeInsertPDFTextfield));
5277 cbradney 691
        name="toolsPDFCheckBox";
8528 cbradney 692
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("22/checkbox.png"), QPixmap(), "", defKeys[name], mainWindow, name, modeInsertPDFCheckbox));
5277 cbradney 693
        name="toolsPDFComboBox";
8528 cbradney 694
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("22/combobox.png"), QPixmap(), "", defKeys[name], mainWindow, name, modeInsertPDFCombobox));
5277 cbradney 695
        name="toolsPDFListBox";
8528 cbradney 696
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("22/list-box.png"), QPixmap(), "", defKeys[name], mainWindow, name, modeInsertPDFListbox));
5277 cbradney 697
        name="toolsPDFAnnotText";
8528 cbradney 698
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("22/pdf-annotations.png"), QPixmap(), "", defKeys[name], mainWindow, name, modeInsertPDFTextAnnotation));
5277 cbradney 699
        name="toolsPDFAnnotLink";
8528 cbradney 700
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("goto.png"), QPixmap(), "", defKeys[name], mainWindow, name, modeInsertPDFLinkAnnotation));
2246 subik 701
 
1993 cbradney 702
        (*scrActions)["toolsProperties"]->setToggleAction(true);
703
        (*scrActions)["toolsOutline"]->setToggleAction(true);
704
        (*scrActions)["toolsScrapbook"]->setToggleAction(true);
705
        (*scrActions)["toolsLayers"]->setToggleAction(true);
706
        (*scrActions)["toolsPages"]->setToggleAction(true);
707
        (*scrActions)["toolsBookmarks"]->setToggleAction(true);
708
        (*scrActions)["toolsMeasurements"]->setToggleAction(true);
709
        (*scrActions)["toolsActionHistory"]->setToggleAction(true);
710
        (*scrActions)["toolsPreflightVerifier"]->setToggleAction(true);
2355 cbradney 711
        (*scrActions)["toolsAlignDistribute"]->setToggleAction(true);
1993 cbradney 712
        (*scrActions)["toolsToolbarTools"]->setToggleAction(true);
713
        (*scrActions)["toolsToolbarPDF"]->setToggleAction(true);
2246 subik 714
 
1993 cbradney 715
        (*scrActions)["toolsSelect"]->setToggleAction(true);
716
        (*scrActions)["toolsInsertTextFrame"]->setToggleAction(true);
717
        (*scrActions)["toolsInsertImageFrame"]->setToggleAction(true);
718
        (*scrActions)["toolsInsertTableFrame"]->setToggleAction(true);
719
        (*scrActions)["toolsInsertShape"]->setToggleAction(true);
720
        (*scrActions)["toolsInsertPolygon"]->setToggleAction(true);
721
        (*scrActions)["toolsInsertLine"]->setToggleAction(true);
722
        (*scrActions)["toolsInsertBezier"]->setToggleAction(true);
723
        (*scrActions)["toolsInsertFreehandLine"]->setToggleAction(true);
724
        (*scrActions)["toolsRotate"]->setToggleAction(true);
725
        (*scrActions)["toolsZoom"]->setToggleAction(true);
726
        (*scrActions)["toolsEditContents"]->setToggleAction(true);
727
        (*scrActions)["toolsEditWithStoryEditor"]->setToggleAction(true);
728
        (*scrActions)["toolsLinkTextFrame"]->setToggleAction(true);
729
        (*scrActions)["toolsUnlinkTextFrame"]->setToggleAction(true);
730
        (*scrActions)["toolsEyeDropper"]->setToggleAction(true);
731
        (*scrActions)["toolsCopyProperties"]->setToggleAction(true);
7087 subik 732
 
5277 cbradney 733
        (*scrActions)["toolsPDFPushButton"]->setToggleAction(true);
734
        (*scrActions)["toolsPDFTextField"]->setToggleAction(true);
735
        (*scrActions)["toolsPDFCheckBox"]->setToggleAction(true);
736
        (*scrActions)["toolsPDFComboBox"]->setToggleAction(true);
737
        (*scrActions)["toolsPDFListBox"]->setToggleAction(true);
738
        (*scrActions)["toolsPDFAnnotText"]->setToggleAction(true);
739
        (*scrActions)["toolsPDFAnnotLink"]->setToggleAction(true);
2246 subik 740
 
1993 cbradney 741
        *modeActionNames << "toolsSelect" << "toolsInsertTextFrame" << "toolsInsertImageFrame" << "toolsInsertTableFrame";
742
        *modeActionNames << "toolsInsertShape" << "toolsInsertPolygon" << "toolsInsertLine" << "toolsInsertBezier";
743
        *modeActionNames << "toolsInsertFreehandLine" << "toolsRotate" << "toolsZoom" << "toolsEditContents";
744
        *modeActionNames << "toolsEditWithStoryEditor" << "toolsLinkTextFrame" << "toolsUnlinkTextFrame";
745
        *modeActionNames << "toolsEyeDropper" << "toolsCopyProperties";
5277 cbradney 746
        *modeActionNames << "toolsPDFPushButton" << "toolsPDFTextField" << "toolsPDFCheckBox" << "toolsPDFComboBox" << "toolsPDFListBox" << "toolsPDFAnnotText" << "toolsPDFAnnotLink";
1993 cbradney 747
 
5357 cbradney 748
        for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
749
                (*scrActions)[*it]->setEnabled(false);
750
 
751
 
2104 cbradney 752
        *nonEditActionNames << "itemLowerToBottom" << "itemRaiseToTop" << "itemRaise" << "itemLower";
2246 subik 753
 
5243 cbradney 754
        connect( (*scrActions)["toolsActionHistory"], SIGNAL(toggled(bool)), mainWindow, SLOT(setUndoPalette(bool)) );
2246 subik 755
 
1993 cbradney 756
        connectModeActions();
757
}
758
 
759
void ActionManager::initExtrasMenuActions()
760
{
5243 cbradney 761
        QString name;
762
        name="extrasManagePictures";
763
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
764
        name="extrasHyphenateText";
765
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
766
        name="extrasDeHyphenateText";
767
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
768
        name="extrasGenerateTableOfContents";
769
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
1993 cbradney 770
 
5243 cbradney 771
        connect( (*scrActions)["extrasManagePictures"], SIGNAL(activated()), mainWindow, SLOT(StatusPic()) );
772
        connect( (*scrActions)["extrasGenerateTableOfContents"], SIGNAL(activated()), mainWindow, SLOT(generateTableOfContents()) );
1993 cbradney 773
}
774
 
775
 
776
void ActionManager::initWindowsMenuActions()
777
{
5243 cbradney 778
        QString name;
779
        name="windowsCascade";
8528 cbradney 780
        scrActions->insert(name, new ScrAction( "", defKeys[name], mainWindow, name));
5243 cbradney 781
        name="windowsTile";
8528 cbradney 782
        scrActions->insert(name, new ScrAction( "", defKeys[name], mainWindow, name));
1993 cbradney 783
}
784
 
785
void ActionManager::initScriptMenuActions()
786
{
787
}
788
 
789
void ActionManager::initHelpMenuActions()
790
{
5243 cbradney 791
        QString name;
792
        name="helpAboutScribus";
793
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
794
        name="helpAboutPlugins";
795
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
796
        name="helpAboutQt";
797
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
798
        name="helpTooltips";
799
        scrActions->insert(name, new ScrAction("", defKeys[name], mainWindow, name));
800
        name="helpManual";
9148 cbradney 801
        scrActions->insert(name, new ScrAction(loadIcon("16/help-browser.png"), QPixmap(), "", defKeys[name], mainWindow, name));
1993 cbradney 802
 
803
        (*scrActions)["helpTooltips"]->setToggleAction(true);
804
        (*scrActions)["helpTooltips"]->setOn(true);
805
 
5243 cbradney 806
        connect( (*scrActions)["helpAboutScribus"], SIGNAL(activated()), mainWindow, SLOT(slotHelpAbout()) );
807
        connect( (*scrActions)["helpAboutPlugins"], SIGNAL(activated()), mainWindow, SLOT(slotHelpAboutPlugins()) );
808
        connect( (*scrActions)["helpAboutQt"], SIGNAL(activated()), mainWindow, SLOT(slotHelpAboutQt()) );
809
        connect( (*scrActions)["helpTooltips"], SIGNAL(activated()), mainWindow, SLOT(ToggleTips()) );
810
        connect( (*scrActions)["helpManual"], SIGNAL(activated()), mainWindow, SLOT(slotOnlineHelp()) );
1993 cbradney 811
}
812
 
8501 cbradney 813
void ActionManager::initUnicodeActions(QMap<QString, QPointer<ScrAction> > *actionMap, QWidget *actionParent, QStringList *actionNamesList)
1993 cbradney 814
{
5243 cbradney 815
        QString name;
1993 cbradney 816
        //typography
5243 cbradney 817
        name="unicodeSmartHyphen";
8528 cbradney 818
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeSmartHyphen",SpecialChars::SHYPHEN.unicode()));
5243 cbradney 819
        name="unicodeNonBreakingHyphen";
8528 cbradney 820
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeNonBreakingHyphen", SpecialChars::NBHYPHEN.unicode()));
5243 cbradney 821
        name="unicodeNonBreakingSpace";
8528 cbradney 822
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeNonBreakingSpace",SpecialChars::NBSPACE.unicode()));
5243 cbradney 823
        name="unicodePageNumber";
8528 cbradney 824
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodePageNumber",SpecialChars::PAGENUMBER.unicode()));
4720 cbradney 825
        //Spaces
5243 cbradney 826
        name="unicodeSpaceEN";
8528 cbradney 827
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeSpaceEN",0x2002));
5243 cbradney 828
        name="unicodeSpaceEM";
8528 cbradney 829
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeSpaceEM",0x2003));
5243 cbradney 830
        name="unicodeSpaceThin";
8528 cbradney 831
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeSpaceThin",0x2009));
5243 cbradney 832
        name="unicodeSpaceThick";
8528 cbradney 833
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeSpaceThick",0x2004));
5243 cbradney 834
        name="unicodeSpaceMid";
8528 cbradney 835
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeSpaceMid",0x2005));
5243 cbradney 836
        name="unicodeSpaceHair";
8528 cbradney 837
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeSpaceHair",0x200A));
4564 cbradney 838
        //Breaks
5243 cbradney 839
        name="unicodeNewLine";
8528 cbradney 840
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeNewLine",SpecialChars::LINEBREAK.unicode()));
5243 cbradney 841
        name="unicodeFrameBreak";
8528 cbradney 842
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeFrameBreak",SpecialChars::FRAMEBREAK.unicode()));
5243 cbradney 843
        name="unicodeColumnBreak";
8528 cbradney 844
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeColumnBreak",SpecialChars::COLBREAK.unicode()));
7038 avox 845
        name="unicodeZerowidthSpace";
8528 cbradney 846
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeZerowidthSpace",SpecialChars::ZWSPACE.unicode()));
7038 avox 847
        name="unicodeZerowidthNonBreakingSpace";
8528 cbradney 848
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeZerowidthNonBreakingSpace",SpecialChars::ZWNBSPACE.unicode()));
4564 cbradney 849
        //Special
5243 cbradney 850
        name="unicodeCopyRight";
8528 cbradney 851
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeCopyRight",0x0A9));
5243 cbradney 852
        name="unicodeRegdTM";
8528 cbradney 853
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeRegdTM",0x00AE));
5243 cbradney 854
        name="unicodeTM";
8528 cbradney 855
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeTM",0x2122));
5243 cbradney 856
        name="unicodeBullet";
8528 cbradney 857
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeBullet",0x2022));
5243 cbradney 858
        name="unicodeMidpoint";
8528 cbradney 859
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeMidpoint",0x00B7));
5243 cbradney 860
        name="unicodeSolidus";
8528 cbradney 861
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeSolidus",0x2044));
4564 cbradney 862
        //Dashes
5243 cbradney 863
        name="unicodeDashEm";
8528 cbradney 864
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeDashEm",0x2014));
5243 cbradney 865
        name="unicodeDashEn";
8528 cbradney 866
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeDashEn",0x2013));
5243 cbradney 867
        name="unicodeDashFigure";
8528 cbradney 868
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeDashFigure",0x2012));
5243 cbradney 869
        name="unicodeDashQuotation";
8528 cbradney 870
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeDashQuotation",0x2015));
4564 cbradney 871
        //Quotes
5243 cbradney 872
        name="unicodeQuoteApostrophe";
8528 cbradney 873
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, name, 0x0027));
5243 cbradney 874
        name="unicodeQuoteStraight";
8528 cbradney 875
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, name, 0x0022));
5243 cbradney 876
        name="unicodeQuoteSingleLeft";
8528 cbradney 877
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, name, 0x2018));
5243 cbradney 878
        name="unicodeQuoteSingleRight";
8528 cbradney 879
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, name, 0x2019));
5243 cbradney 880
        name="unicodeQuoteDoubleLeft";
8528 cbradney 881
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, name, 0x201C));
5243 cbradney 882
        name="unicodeQuoteDoubleRight";
8528 cbradney 883
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, name, 0x201D));
5243 cbradney 884
        name="unicodeQuoteSingleReversed";
8528 cbradney 885
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, name, 0x201B));
5243 cbradney 886
        name="unicodeQuoteDoubleReversed";
8528 cbradney 887
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, name, 0x201F));
5243 cbradney 888
        name="unicodeQuoteSingleLeftGuillemet";
8528 cbradney 889
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, name, 0x2039));
5243 cbradney 890
        name="unicodeQuoteSingleRightGuillemet";
8528 cbradney 891
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, name, 0x203A));
5243 cbradney 892
        name="unicodeQuoteDoubleLeftGuillemet";
8528 cbradney 893
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeQuoteDoubleLeftGuillemet",0x00AB));
5243 cbradney 894
        name="unicodeQuoteDoubleRightGuillemet";
8528 cbradney 895
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeQuoteDoubleRightGuillemet",0x00BB));
5243 cbradney 896
        name="unicodeQuoteLowSingleComma";
8528 cbradney 897
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeQuoteLowSingleComma",0x201A));
5243 cbradney 898
        name="unicodeQuoteLowDoubleComma";
8528 cbradney 899
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeQuoteLowDoubleComma",0x201E));
5243 cbradney 900
        name="unicodeQuoteCJKSingleLeft";
8528 cbradney 901
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeQuoteCJKSingleLeft",0x300C));
5243 cbradney 902
        name="unicodeQuoteCJKSingleRight";
8528 cbradney 903
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeQuoteCJKSingleRight",0x300D));
5243 cbradney 904
        name="unicodeQuoteCJKDoubleLeft";
8528 cbradney 905
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeQuoteCJKDoubleLeft",0x300E));
5243 cbradney 906
        name="unicodeQuoteCJKDoubleRight";
8528 cbradney 907
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, "unicodeQuoteCJKDoubleRight",0x300F));
4564 cbradney 908
        //Ligatures
5243 cbradney 909
        name="unicodeLigature_ff";
8528 cbradney 910
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, name, 0xFB00));
5243 cbradney 911
        name="unicodeLigature_fi";
8528 cbradney 912
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, name, 0xFB01));
5243 cbradney 913
        name="unicodeLigature_fl";
8528 cbradney 914
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, name, 0xFB02));
5243 cbradney 915
        name="unicodeLigature_ffi";
8528 cbradney 916
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, name, 0xFB03));
5243 cbradney 917
        name="unicodeLigature_ffl";
8528 cbradney 918
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, name, 0xFB04));
5243 cbradney 919
        name="unicodeLigature_ft";
8528 cbradney 920
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, name, 0xFB05));
5243 cbradney 921
        name="unicodeLigature_st";
8528 cbradney 922
        actionMap->insert(name, new ScrAction(ScrAction::UnicodeChar, QPixmap(), QPixmap(), "", defKeys[name], actionParent, name, 0xFB06));
7087 subik 923
 
2391 cbradney 924
        //Spaces and special characters
7087 subik 925
 
4564 cbradney 926
        *actionNamesList << "unicodeSmartHyphen" << "unicodeNonBreakingHyphen" << "unicodeNonBreakingSpace" << "unicodePageNumber";
4720 cbradney 927
        *actionNamesList << "unicodeSpaceEN" << "unicodeSpaceEM" << "unicodeSpaceThin" << "unicodeSpaceThick" << "unicodeSpaceMid" << "unicodeSpaceHair";
2391 cbradney 928
        //Breaks
7038 avox 929
        *actionNamesList << "unicodeNewLine" << "unicodeFrameBreak" << "unicodeColumnBreak" << "unicodeZerowidthSpace";
2391 cbradney 930
        //Copyrights and TMs
4564 cbradney 931
        *actionNamesList << "unicodeCopyRight" << "unicodeRegdTM" << "unicodeTM";
4720 cbradney 932
        //Slashes
933
        *actionNamesList << "unicodeSolidus";
2391 cbradney 934
        //Bullets
4720 cbradney 935
        *actionNamesList << "unicodeBullet" << "unicodeMidpoint";
2391 cbradney 936
        //Dashes
4564 cbradney 937
        *actionNamesList << "unicodeDashEm" << "unicodeDashEn" << "unicodeDashFigure" << "unicodeDashQuotation";
2391 cbradney 938
        //Straight quotes
4564 cbradney 939
        *actionNamesList << "unicodeQuoteApostrophe" << "unicodeQuoteStraight";
2391 cbradney 940
        //Double quotes
4564 cbradney 941
        *actionNamesList << "unicodeQuoteDoubleLeft" << "unicodeQuoteDoubleRight" << "unicodeQuoteSingleLeft" << "unicodeQuoteSingleRight";
5261 cbradney 942
        //Alternative single quotes
4564 cbradney 943
        *actionNamesList << "unicodeQuoteSingleReversed" << "unicodeQuoteDoubleReversed";
2391 cbradney 944
        //French quotes
4564 cbradney 945
        *actionNamesList << "unicodeQuoteSingleLeftGuillemet" << "unicodeQuoteSingleRightGuillemet" << "unicodeQuoteDoubleLeftGuillemet" << "unicodeQuoteDoubleRightGuillemet";
2391 cbradney 946
        //German quotes
4564 cbradney 947
        *actionNamesList << "unicodeQuoteLowSingleComma" << "unicodeQuoteLowDoubleComma";
2391 cbradney 948
        //CJK Quotes
4564 cbradney 949
        *actionNamesList << "unicodeQuoteCJKSingleLeft" << "unicodeQuoteCJKSingleRight" << "unicodeQuoteCJKDoubleLeft" << "unicodeQuoteCJKDoubleRight";
950
        //Ligatures
951
        *actionNamesList << "unicodeLigature_ff" << "unicodeLigature_fi" << "unicodeLigature_fl" << "unicodeLigature_ffi" << "unicodeLigature_ffl" << "unicodeLigature_ft" << "unicodeLigature_st";
4557 cbradney 952
        for ( QStringList::Iterator it = actionNamesList->begin(); it != actionNamesList->end(); ++it )
8080 cbradney 953
                connect( (*actionMap)[*it], SIGNAL(activatedUnicodeShortcut(const QString&, int)), actionParent, SLOT(specialActionKeyEvent(const QString&, int)) );
4557 cbradney 954
}
1993 cbradney 955
 
4557 cbradney 956
void ActionManager::initSpecialActions()
957
{
5243 cbradney 958
        QString name;
1993 cbradney 959
        //GUI
5261 cbradney 960
        name="specialToggleAllPalettes";
8528 cbradney 961
        scrActions->insert(name, new ScrAction(ScrAction::DataQString, QPixmap(), QPixmap(), "", defKeys[name], mainWindow, name, 0,0.0,name));
5261 cbradney 962
        name="specialToggleAllGuides";
8528 cbradney 963
        scrActions->insert(name, new ScrAction(ScrAction::DataQString, QPixmap(), QPixmap(), "", defKeys[name], mainWindow, name, 0,0.0,name));
1993 cbradney 964
 
5261 cbradney 965
        connect( (*scrActions)["specialToggleAllPalettes"], SIGNAL(activated()), mainWindow, SLOT(ToggleAllPalettes()) );
966
        connect( (*scrActions)["specialToggleAllGuides"], SIGNAL(activated()), mainWindow, SLOT(ToggleAllGuides()) );
1993 cbradney 967
}
968
 
969
void ActionManager::disconnectModeActions()
970
{
971
        for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
5243 cbradney 972
                disconnect( (*scrActions)[*it], SIGNAL(toggledData(bool, int)) , mainWindow, SLOT(setAppModeByToggle(bool, int)) );
1993 cbradney 973
}
2246 subik 974
 
1993 cbradney 975
void ActionManager::connectModeActions()
976
{
977
        for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
5243 cbradney 978
                connect( (*scrActions)[*it], SIGNAL(toggledData(bool, int)) , mainWindow, SLOT(setAppModeByToggle(bool, int)) );
1993 cbradney 979
}
980
 
4688 cbradney 981
void ActionManager::disconnectNewDocActions()
982
{
7739 cbradney 983
        disconnect( (*scrActions)["itemAdjustFrameToImage"], 0, 0, 0 );
4688 cbradney 984
        disconnect( (*scrActions)["itemLock"], 0, 0, 0);
985
        disconnect( (*scrActions)["itemLockSize"], 0, 0, 0);
4698 cbradney 986
        disconnect( (*scrActions)["itemPrintingEnabled"], 0, 0, 0);
4699 cbradney 987
        disconnect( (*scrActions)["itemFlipH"], 0, 0, 0);
988
        disconnect( (*scrActions)["itemFlipV"], 0, 0, 0);
7739 cbradney 989
        disconnect( (*scrActions)["itemCombinePolygons"], 0, 0, 0);
990
        disconnect( (*scrActions)["itemSplitPolygons"], 0, 0, 0);
4688 cbradney 991
        disconnect( (*scrActions)["itemUpdateImage"], 0, 0, 0 );
4713 cbradney 992
        disconnect( (*scrActions)["itemDelete"], 0, 0, 0);
993
        disconnect( (*scrActions)["extrasHyphenateText"], 0, 0, 0 );
994
        disconnect( (*scrActions)["extrasDeHyphenateText"], 0, 0, 0 );
995
 
4688 cbradney 996
}
997
 
998
void ActionManager::connectNewDocActions(ScribusDoc *currDoc)
999
{
1000
        if (currDoc==NULL)
1001
                return;
1002
        connect( (*scrActions)["itemLock"], SIGNAL(activated()), currDoc, SLOT(itemSelection_ToggleLock()) );
1003
        connect( (*scrActions)["itemLockSize"], SIGNAL(activated()), currDoc, SLOT(itemSelection_ToggleSizeLock()));
4698 cbradney 1004
        connect( (*scrActions)["itemPrintingEnabled"], SIGNAL(activated()), currDoc, SLOT(itemSelection_TogglePrintEnabled()));
4699 cbradney 1005
        connect( (*scrActions)["itemFlipH"], SIGNAL(activated()), currDoc, SLOT(itemSelection_FlipH()));
1006
        connect( (*scrActions)["itemFlipV"], SIGNAL(activated()), currDoc, SLOT(itemSelection_FlipV()));
7739 cbradney 1007
        connect( (*scrActions)["itemCombinePolygons"], SIGNAL(activated()), currDoc, SLOT(itemSelection_UniteItems()) );
1008
        connect( (*scrActions)["itemSplitPolygons"], SIGNAL(activated()), currDoc, SLOT(itemSelection_SplitItems()) );
4688 cbradney 1009
        connect( (*scrActions)["itemUpdateImage"], SIGNAL(activated()), currDoc, SLOT(updatePic()) );
4713 cbradney 1010
        connect( (*scrActions)["extrasHyphenateText"], SIGNAL(activated()), currDoc, SLOT(itemSelection_DoHyphenate()) );
1011
        connect( (*scrActions)["extrasDeHyphenateText"], SIGNAL(activated()), currDoc, SLOT(itemSelection_DoDeHyphenate()) );
1012
        connect( (*scrActions)["itemDelete"], SIGNAL(activated()), currDoc, SLOT(itemSelection_DeleteItem()) );
7739 cbradney 1013
        connect( (*scrActions)["itemAdjustFrameToImage"], SIGNAL(activated()), currDoc, SLOT(itemSelection_adjustFrametoImageSize()) );
4688 cbradney 1014
}
1015
 
2026 cbradney 1016
void ActionManager::disconnectNewViewActions()
1017
{
7587 cbradney 1018
        disconnect( (*scrActions)["viewFitPreview"], 0, 0, 0);
2026 cbradney 1019
        disconnect( (*scrActions)["toolsZoomIn"], 0, 0, 0);
1020
        disconnect( (*scrActions)["toolsZoomOut"], 0, 0, 0);
2104 cbradney 1021
        disconnect( (*scrActions)["itemLowerToBottom"], 0, 0, 0);
2026 cbradney 1022
        disconnect( (*scrActions)["itemImageIsVisible"], 0, 0, 0);
2256 cbradney 1023
        disconnect( (*scrActions)["itemPreviewLow"], SIGNAL(activatedData(int)), 0, 0 );
1024
        disconnect( (*scrActions)["itemPreviewNormal"], SIGNAL(activatedData(int)), 0,0 );
1025
        disconnect( (*scrActions)["itemPreviewFull"], SIGNAL(activatedData(int)), 0, 0 );
2026 cbradney 1026
        disconnect( (*scrActions)["itemRaise"], 0, 0, 0);
1027
        disconnect( (*scrActions)["itemLower"], 0, 0, 0);
1028
        disconnect( (*scrActions)["itemConvertToBezierCurve"], 0, 0, 0);
1029
        disconnect( (*scrActions)["itemConvertToImageFrame"], 0, 0, 0);
1030
        disconnect( (*scrActions)["itemConvertToOutlines"], 0, 0, 0);
1031
        disconnect( (*scrActions)["itemConvertToPolygon"], 0, 0, 0);
1032
        disconnect( (*scrActions)["itemConvertToTextFrame"], 0, 0, 0);
1033
        disconnect( (*scrActions)["itemAttachTextToPath"], 0, 0, 0);
1034
        disconnect( (*scrActions)["itemDetachTextFromPath"], 0, 0, 0);
2260 cbradney 1035
        disconnect( (*scrActions)["itemExtendedImageProperties"], 0, 0, 0 );
2026 cbradney 1036
}
2246 subik 1037
 
2026 cbradney 1038
void ActionManager::connectNewViewActions(ScribusView *currView)
1039
{
1040
        if (currView==NULL)
1041
                return;
7587 cbradney 1042
        connect( (*scrActions)["viewFitPreview"], SIGNAL(activated()), currView, SLOT(togglePreview()) );
2026 cbradney 1043
        connect( (*scrActions)["toolsZoomIn"], SIGNAL(activated()) , currView, SLOT(slotZoomIn()) );
1044
        connect( (*scrActions)["toolsZoomOut"], SIGNAL(activated()) , currView, SLOT(slotZoomOut()) );
2104 cbradney 1045
        connect( (*scrActions)["itemLowerToBottom"], SIGNAL(activated()), currView, SLOT(ToBack()) );
1046
        connect( (*scrActions)["itemRaiseToTop"], SIGNAL(activated()), currView, SLOT(ToFront()) );
2026 cbradney 1047
        connect( (*scrActions)["itemRaise"], SIGNAL(activated()), currView, SLOT(RaiseItem()) );
1048
        connect( (*scrActions)["itemLower"], SIGNAL(activated()), currView, SLOT(LowerItem()) );
1049
        connect( (*scrActions)["itemConvertToBezierCurve"], SIGNAL(activated()), currView, SLOT(ToBezierFrame()) );
1050
        connect( (*scrActions)["itemConvertToImageFrame"], SIGNAL(activated()), currView, SLOT(ToPicFrame()) );
1051
        connect( (*scrActions)["itemConvertToOutlines"], SIGNAL(activated()), currView, SLOT(TextToPath()) );
1052
        connect( (*scrActions)["itemConvertToPolygon"], SIGNAL(activated()), currView, SLOT(ToPolyFrame()) );
1053
        connect( (*scrActions)["itemConvertToTextFrame"], SIGNAL(activated()), currView, SLOT(ToTextFrame()) );
1054
        connect( (*scrActions)["itemAttachTextToPath"], SIGNAL(activated()), currView, SLOT(ToPathText()) );
1055
        connect( (*scrActions)["itemDetachTextFromPath"], SIGNAL(activated()), currView, SLOT(FromPathText()) );
2260 cbradney 1056
        connect( (*scrActions)["itemExtendedImageProperties"], SIGNAL(activated()), currView, SLOT(editExtendedImageProperties()) );
2026 cbradney 1057
}
1058
 
1059
void ActionManager::disconnectNewSelectionActions()
1060
{
1061
        disconnect( (*scrActions)["itemImageIsVisible"], 0, 0, 0);
4705 cbradney 1062
        //Only disconnect activatedData for data based actions or you will disconnect the internal signal
1063
        disconnect( (*scrActions)["itemPreviewLow"], SIGNAL(activatedData(int)) , 0, 0);
1064
        disconnect( (*scrActions)["itemPreviewNormal"], SIGNAL(activatedData(int)) , 0, 0);
1065
        disconnect( (*scrActions)["itemPreviewFull"], SIGNAL(activatedData(int)) , 0, 0);
1066
        disconnect( (*scrActions)["editClearContents"], 0, 0, 0);
2026 cbradney 1067
}
1068
 
5784 jghali 1069
void ActionManager::connectNewSelectionActions(ScribusView* /*currView*/, ScribusDoc* currDoc)
2026 cbradney 1070
{
4705 cbradney 1071
        connect( (*scrActions)["itemImageIsVisible"], SIGNAL(toggled(bool)), currDoc, SLOT(itemSelection_ToggleImageShown()) );
1072
        connect( (*scrActions)["itemPreviewLow"], SIGNAL(activatedData(int)), currDoc, SLOT(itemSelection_ChangePreviewResolution(int)) );
1073
        connect( (*scrActions)["itemPreviewNormal"], SIGNAL(activatedData(int)), currDoc, SLOT(itemSelection_ChangePreviewResolution(int)) );
1074
        connect( (*scrActions)["itemPreviewFull"], SIGNAL(activatedData(int)), currDoc, SLOT(itemSelection_ChangePreviewResolution(int)) );
1075
        connect( (*scrActions)["editClearContents"], SIGNAL(activated()), currDoc, SLOT(itemSelection_ClearItem()) );
2026 cbradney 1076
}
2246 subik 1077
 
1993 cbradney 1078
void ActionManager::saveActionShortcutsPreEditMode()
1079
{
1080
        for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
1081
                (*scrActions)[*it]->saveShortcut();
1082
        for ( QStringList::Iterator it = nonEditActionNames->begin(); it != nonEditActionNames->end(); ++it )
2246 subik 1083
                (*scrActions)[*it]->saveShortcut();
1993 cbradney 1084
 
1085
}
1086
 
1087
void ActionManager::restoreActionShortcutsPostEditMode()
1088
{
1089
        for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
1090
                (*scrActions)[*it]->restoreShortcut();
1091
        for ( QStringList::Iterator it = nonEditActionNames->begin(); it != nonEditActionNames->end(); ++it )
2246 subik 1092
                (*scrActions)[*it]->restoreShortcut();
1993 cbradney 1093
}
1094
 
8501 cbradney 1095
void ActionManager::enableActionStringList(QMap<QString, QPointer<ScrAction> > *actionMap, QStringList *list, bool enabled, bool checkingUnicode, const QString& fontName)
1993 cbradney 1096
{
1097
        for ( QStringList::Iterator it = list->begin(); it != list->end(); ++it )
1098
        {
1099
                if(!checkingUnicode)
4881 cbradney 1100
                        (*actionMap)[*it]->setEnabled(enabled);
1993 cbradney 1101
                else
1102
                {
1103
                        //For UnicodeChar actions, only enable when the current font has that character.
5243 cbradney 1104
                        if (mainWindow->HaveDoc && (*actionMap)[*it]->actionType()==ScrAction::UnicodeChar)
1993 cbradney 1105
                        {
4881 cbradney 1106
                                int charCode=(*actionMap)[*it]->actionInt();
2246 subik 1107
                                if(charCode==-1 ||
4881 cbradney 1108
                                        charCode==24 ||
1109
                                        charCode==26 ||
1110
                                        charCode==27 ||
1111
                                        charCode==28 ||
1112
                                        charCode==29 ||
1113
                                        charCode==30 ||
7087 subik 1114
                                        ((*mainWindow->doc->AllFonts)[fontName].usable() &&
5980 avox 1115
                                        (*mainWindow->doc->AllFonts)[fontName].canRender(charCode)) )
4881 cbradney 1116
                                                (*actionMap)[*it]->setEnabled(true);
1117
                                else
1118
                                        (*actionMap)[*it]->setEnabled(false);
1993 cbradney 1119
                        }
1120
                }
1121
        }
1122
}
1995 cbradney 1123
 
8501 cbradney 1124
void ActionManager::enableUnicodeActions(QMap<QString, QPointer<ScrAction> > *actionMap, bool enabled, const QString& fontName)
1995 cbradney 1125
{
4881 cbradney 1126
        enableActionStringList(actionMap, unicodeCharActionNames, enabled, enabled, fontName);
7201 cbradney 1127
        (*actionMap)["insertGlyph"]->setEnabled(enabled);
1995 cbradney 1128
}
2103 cbradney 1129
 
2108 cbradney 1130
void ActionManager::setPDFActions(ScribusView *currView)
2103 cbradney 1131
{
2108 cbradney 1132
        if (currView==NULL)
2103 cbradney 1133
                return;
5243 cbradney 1134
        PageItem* currItem = mainWindow->doc->m_Selection->itemAt(0);
2103 cbradney 1135
        if (currItem==NULL)
1136
                return;
1137
 
1138
        disconnect( (*scrActions)["itemPDFIsBookmark"], 0, 0, 0);
1139
        disconnect( (*scrActions)["itemPDFIsAnnotation"], 0, 0, 0);
2246 subik 1140
 
3625 avox 1141
        if (!currItem->asTextFrame())
2103 cbradney 1142
        {
1143
                (*scrActions)["itemPDFIsAnnotation"]->setEnabled(false);
1144
                (*scrActions)["itemPDFIsBookmark"]->setEnabled(false);
1145
                (*scrActions)["itemPDFIsAnnotation"]->setOn(false);
1146
                (*scrActions)["itemPDFIsBookmark"]->setOn(false);
1147
                (*scrActions)["itemPDFAnnotationProps"]->setEnabled(false);
1148
                (*scrActions)["itemPDFFieldProps"]->setEnabled(false);
1149
                return;
1150
        }
1151
 
1152
        (*scrActions)["itemPDFIsAnnotation"]->setEnabled(true);
1153
        (*scrActions)["itemPDFIsBookmark"]->setEnabled(true);
4084 cbradney 1154
        (*scrActions)["itemPDFIsAnnotation"]->setOn(currItem->isAnnotation());
2103 cbradney 1155
        (*scrActions)["itemPDFIsBookmark"]->setOn(currItem->isBookmark);
4084 cbradney 1156
        if (currItem->isAnnotation())
2103 cbradney 1157
        {
4084 cbradney 1158
                int aType=currItem->annotation().Type();
1159
                bool setter=((aType == 0) || (aType == 1) || (aType > 9));
2103 cbradney 1160
                (*scrActions)["itemPDFAnnotationProps"]->setEnabled(setter);
1161
                (*scrActions)["itemPDFFieldProps"]->setEnabled(!setter);
1162
        }
1163
        else
1164
        {
1165
                (*scrActions)["itemPDFAnnotationProps"]->setEnabled(false);
1166
                (*scrActions)["itemPDFFieldProps"]->setEnabled(false);
1167
        }
2108 cbradney 1168
        connect( (*scrActions)["itemPDFIsAnnotation"], SIGNAL(activated()), currView, SLOT(ToggleAnnotation()) );
1169
        connect( (*scrActions)["itemPDFIsBookmark"], SIGNAL(activated()), currView, SLOT(ToggleBookmark()) );
2103 cbradney 1170
}
2161 cbradney 1171
 
1172
void ActionManager::languageChange()
1173
{
2170 cbradney 1174
        //File Menu
2352 fschmid 1175
        (*scrActions)["fileNew"]->setTexts( tr("&New"));
1176
        (*scrActions)["fileOpen"]->setTexts( tr("&Open..."));
1177
        (*scrActions)["fileClose"]->setTexts( tr("&Close"));
1178
        (*scrActions)["fileSave"]->setTexts( tr("&Save"));
1179
        (*scrActions)["fileSaveAs"]->setTexts( tr("Save &As..."));
1180
        (*scrActions)["fileRevert"]->setTexts( tr("Re&vert to Saved"));
1181
        (*scrActions)["fileCollect"]->setTexts( tr("Collect for O&utput..."));
1182
        (*scrActions)["fileImportText"]->setTexts( tr("Get Text..."));
1183
        (*scrActions)["fileImportAppendText"]->setTexts( tr("Append &Text..."));
1184
        (*scrActions)["fileImportImage"]->setTexts( tr("Get Image..."));
1185
        (*scrActions)["fileExportText"]->setTexts( tr("Save &Text..."));
5357 cbradney 1186
        (*scrActions)["fileExportAsEPS"]->setTexts( tr("Save as &EPS..."));
2352 fschmid 1187
        (*scrActions)["fileExportAsPDF"]->setTexts( tr("Save as P&DF..."));
1188
        (*scrActions)["fileDocSetup"]->setTexts( tr("Document &Setup..."));
7087 subik 1189
        (*scrActions)["filePreferences"]->setTexts( tr("P&references..."));
2352 fschmid 1190
        (*scrActions)["filePrint"]->setTexts( tr("&Print..."));
3165 fschmid 1191
        (*scrActions)["PrintPreview"]->setTexts( tr("Print Previe&w"));
2352 fschmid 1192
        (*scrActions)["fileQuit"]->setTexts( tr("&Quit"));
2170 cbradney 1193
        //Edit Menu
2352 fschmid 1194
        (*scrActions)["editUndoAction"]->setTexts( tr("&Undo"));
1195
        (*scrActions)["editRedoAction"]->setTexts( tr("&Redo"));
1196
        (*scrActions)["editActionMode"]->setTexts( tr("&Item Action Mode"));
1197
        (*scrActions)["editCut"]->setTexts( tr("Cu&t"));
1198
        (*scrActions)["editCopy"]->setTexts( tr("&Copy"));
1199
        (*scrActions)["editPaste"]->setTexts( tr("&Paste"));
4952 cbradney 1200
        (*scrActions)["editCopyContents"]->setTexts( tr("&Copy"));
1201
        (*scrActions)["editPasteContents"]->setTexts( tr("&Paste"));
1202
        (*scrActions)["editPasteContentsAbs"]->setTexts( tr("Paste (&Absolute)"));
1203
        (*scrActions)["editClearContents"]->setTexts( tr("C&lear"));
2352 fschmid 1204
        (*scrActions)["editSelectAll"]->setTexts( tr("Select &All"));
1205
        (*scrActions)["editDeselectAll"]->setTexts( tr("&Deselect All"));
1206
        (*scrActions)["editSearchReplace"]->setTexts( tr("&Search/Replace..."));
1207
        (*scrActions)["editEditWithImageEditor"]->setTexts( tr("Edit Image..."));
1208
        (*scrActions)["editColors"]->setTexts( tr("C&olors..."));
6368 fschmid 1209
        (*scrActions)["editPatterns"]->setTexts( tr("Patterns..."));
4829 tsoots 1210
        (*scrActions)["editStyles"]->setTexts( tr("S&tyles..."));
8291 tsoots 1211
//      (*scrActions)["editParaStyles"]->setTexts( tr("&Paragraph Styles..."));
1212
//      (*scrActions)["editLineStyles"]->setTexts( tr("&Line Styles..."));
2352 fschmid 1213
        (*scrActions)["editMasterPages"]->setTexts( tr("&Master Pages..."));
3142 cbradney 1214
        (*scrActions)["editJavascripts"]->setTexts( tr("&JavaScripts..."));
2246 subik 1215
 
2170 cbradney 1216
        int font_sizes[] = {7, 9, 10, 11, 12, 14, 18, 24, 36, 48, 60, 72};
1217
        size_t f_size = sizeof(font_sizes) / sizeof(*font_sizes);
1218
        for (uint s = 0; s < f_size; ++s)
1219
        {
1220
                QString fontSizeName=QString("fontSize%1").arg(font_sizes[s]);
2352 fschmid 1221
                (*scrActions)[fontSizeName]->setTexts( tr("%1 pt").arg(font_sizes[s]));
2170 cbradney 1222
        }
2352 fschmid 1223
        (*scrActions)["fontSizeOther"]->setTexts( tr("&Other..."));
1224
        (*scrActions)["alignLeft"]->setTexts( tr("&Left"));
1225
        (*scrActions)["alignCenter"]->setTexts( tr("&Center"));
1226
        (*scrActions)["alignRight"]->setTexts( tr("&Right"));
1227
        (*scrActions)["alignBlock"]->setTexts( tr("&Block"));
1228
        (*scrActions)["alignForced"]->setTexts( tr("&Forced"));
2170 cbradney 1229
 
1230
        for (uint i=0; i<=100 ; i+=10)
1231
        {
1232
                QString shadeName=QString("shade%1").arg(i);
2352 fschmid 1233
                (*scrActions)[shadeName]->setTexts( tr("&%1 %").arg(i));
2170 cbradney 1234
        }
1235
 
2352 fschmid 1236
        (*scrActions)["shadeOther"]->setTexts( tr("&Other..."));
1237
        (*scrActions)["typeEffectNormal"]->setTexts( tr("&Normal"));
1238
        (*scrActions)["typeEffectUnderline"]->setTexts( tr("&Underline"));
1239
        (*scrActions)["typeEffectUnderlineWords"]->setTexts( tr("Underline &Words"));
1240
        (*scrActions)["typeEffectStrikeThrough"]->setTexts( tr("&Strike Through"));
1241
        (*scrActions)["typeEffectAllCaps"]->setTexts( tr("&All Caps"));
1242
        (*scrActions)["typeEffectSmallCaps"]->setTexts( tr("Small &Caps"));
1243
        (*scrActions)["typeEffectSuperscript"]->setTexts( tr("Su&perscript"));
1244
        (*scrActions)["typeEffectSubscript"]->setTexts( tr("Su&bscript"));
4847 cbradney 1245
        (*scrActions)["typeEffectOutline"]->setTexts( tr("&Outline", "type effect"));
2352 fschmid 1246
        (*scrActions)["typeEffectShadow"]->setTexts( tr("S&hadow"));
2170 cbradney 1247
 
4572 cbradney 1248
        (*scrActions)["styleImageEffects"]->setTexts( tr("&Image Effects"));
2352 fschmid 1249
        (*scrActions)["styleTabulators"]->setTexts( tr("&Tabulators..."));
2246 subik 1250
 
2170 cbradney 1251
        //Item Menu
2352 fschmid 1252
        (*scrActions)["itemDuplicate"]->setTexts( tr("D&uplicate"));
1253
        (*scrActions)["itemMulDuplicate"]->setTexts( tr("&Multiple Duplicate"));
1254
        (*scrActions)["itemDelete"]->setTexts( tr("&Delete"));
1255
        (*scrActions)["itemGroup"]->setTexts( tr("&Group"));
1256
        (*scrActions)["itemUngroup"]->setTexts( tr("&Ungroup"));
1257
        (*scrActions)["itemLock"]->setTexts( tr("Is &Locked"));
1258
        (*scrActions)["itemLockSize"]->setTexts( tr("Si&ze is Locked"));
4698 cbradney 1259
        (*scrActions)["itemPrintingEnabled"]->setTexts( tr("&Printing Enabled"));
4699 cbradney 1260
        (*scrActions)["itemFlipH"]->setTexts( tr("&Flip Horizontally"));
1261
        (*scrActions)["itemFlipV"]->setTexts( tr("&Flip Vertically"));
2352 fschmid 1262
        (*scrActions)["itemLowerToBottom"]->setTexts( tr("Lower to &Bottom"));
1263
        (*scrActions)["itemRaiseToTop"]->setTexts( tr("Raise to &Top"));
1264
        (*scrActions)["itemLower"]->setTexts( tr("&Lower"));
1265
        (*scrActions)["itemRaise"]->setTexts( tr("&Raise"));
1266
        (*scrActions)["itemSendToScrapbook"]->setTexts( tr("Send to S&crapbook"));
6410 fschmid 1267
        (*scrActions)["itemSendToPattern"]->setTexts( tr("Send to Patterns"));
2352 fschmid 1268
        (*scrActions)["itemAttributes"]->setTexts( tr("&Attributes..."));
3706 fschmid 1269
        (*scrActions)["itemImageInfo"]->setTexts( tr("More Info..."));
2352 fschmid 1270
        (*scrActions)["itemImageIsVisible"]->setTexts( tr("I&mage Visible"));
1271
        (*scrActions)["itemUpdateImage"]->setTexts( tr("&Update Image"));
1272
        (*scrActions)["itemAdjustFrameToImage"]->setTexts( tr("Adjust Frame to Image"));
1273
        (*scrActions)["itemExtendedImageProperties"]->setTexts( tr("Extended Image Properties"));
1274
        (*scrActions)["itemPreviewLow"]->setTexts( tr("&Low Resolution"));
1275
        (*scrActions)["itemPreviewNormal"]->setTexts( tr("&Normal Resolution"));
1276
        (*scrActions)["itemPreviewFull"]->setTexts( tr("&Full Resolution"));
1277
        (*scrActions)["itemPDFIsBookmark"]->setTexts( tr("Is PDF &Bookmark"));
1278
        (*scrActions)["itemPDFIsAnnotation"]->setTexts( tr("Is PDF A&nnotation"));
1279
        (*scrActions)["itemPDFAnnotationProps"]->setTexts( tr("Annotation P&roperties"));
1280
        (*scrActions)["itemPDFFieldProps"]->setTexts( tr("Field P&roperties"));
1281
        (*scrActions)["itemShapeEdit"]->setTexts( tr("&Edit Shape..."));
1282
        (*scrActions)["itemAttachTextToPath"]->setTexts( tr("&Attach Text to Path"));
1283
        (*scrActions)["itemDetachTextFromPath"]->setTexts( tr("&Detach Text from Path"));
1284
        (*scrActions)["itemCombinePolygons"]->setTexts( tr("&Combine Polygons"));
1285
        (*scrActions)["itemSplitPolygons"]->setTexts( tr("Split &Polygons"));
1286
        (*scrActions)["itemConvertToBezierCurve"]->setTexts( tr("&Bezier Curve"));
1287
        (*scrActions)["itemConvertToImageFrame"]->setTexts( tr("&Image Frame"));
4847 cbradney 1288
        (*scrActions)["itemConvertToOutlines"]->setTexts( tr("&Outlines", "Convert to oulines"));
2352 fschmid 1289
        (*scrActions)["itemConvertToPolygon"]->setTexts( tr("&Polygon"));
1290
        (*scrActions)["itemConvertToTextFrame"]->setTexts( tr("&Text Frame"));
2170 cbradney 1291
 
1292
        //Insert Menu
6083 cbradney 1293
        (*scrActions)["insertFrame"]->setTexts( tr("&Frame..."));
2352 fschmid 1294
        (*scrActions)["insertGlyph"]->setTexts( tr("&Glyph..."));
1295
        (*scrActions)["insertSampleText"]->setTexts( tr("Sample Text"));
7350 fschmid 1296
        (*scrActions)["stickyTools"]->setTexts( tr("Sticky Tools"));
2246 subik 1297
 
2170 cbradney 1298
        //Page menu
2352 fschmid 1299
        (*scrActions)["pageInsert"]->setTexts( tr("&Insert..."));
1300
        (*scrActions)["pageImport"]->setTexts( tr("Im&port..."));
1301
        (*scrActions)["pageDelete"]->setTexts( tr("&Delete..."));
1302
        (*scrActions)["pageCopy"]->setTexts( tr("&Copy..."));
1303
        (*scrActions)["pageMove"]->setTexts( tr("&Move..."));
1304
        (*scrActions)["pageApplyMasterPage"]->setTexts( tr("&Apply Master Page..."));
3187 fschmid 1305
        (*scrActions)["pageCopyToMasterPage"]->setTexts( tr("Convert to Master Page..."));
2352 fschmid 1306
        (*scrActions)["pageManageGuides"]->setTexts( tr("Manage &Guides..."));
2872 fschmid 1307
        (*scrActions)["pageManageMargins"]->setTexts( tr("Manage Page Properties..."));
2246 subik 1308
 
2170 cbradney 1309
        //View Menu
7164 fschmid 1310
        (*scrActions)["viewFitInWindow"]->setTexts( tr("&Fit to Height"));
1311
        (*scrActions)["viewFitWidth"]->setTexts( tr("Fit to Width"));
2352 fschmid 1312
        (*scrActions)["viewFit50"]->setTexts( tr("&50%"));
1313
        (*scrActions)["viewFit75"]->setTexts( tr("&75%"));
1314
        (*scrActions)["viewFit100"]->setTexts( tr("&100%"));
1315
        (*scrActions)["viewFit200"]->setTexts( tr("&200%"));
7587 cbradney 1316
        (*scrActions)["viewFitPreview"]->setTexts( tr("Preview Mode"));
2352 fschmid 1317
        (*scrActions)["viewShowMargins"]->setTexts( tr("Show &Margins"));
7051 fschmid 1318
        (*scrActions)["viewShowBleeds"]->setTexts( tr("Show Bleeds"));
2352 fschmid 1319
        (*scrActions)["viewShowFrames"]->setTexts( tr("Show &Frames"));
5584 fschmid 1320
        (*scrActions)["viewShowLayerMarkers"]->setTexts( tr("Show Layer Indicators"));
2352 fschmid 1321
        (*scrActions)["viewShowImages"]->setTexts( tr("Show &Images"));
1322
        (*scrActions)["viewShowGrid"]->setTexts( tr("Show &Grid"));
1323
        (*scrActions)["viewShowGuides"]->setTexts( tr("Show G&uides"));
5384 cbradney 1324
        (*scrActions)["viewShowColumnBorders"]->setTexts( tr("Show Text Frame Columns"));
2352 fschmid 1325
        (*scrActions)["viewShowBaseline"]->setTexts( tr("Show &Baseline Grid"));
1326
        (*scrActions)["viewShowTextChain"]->setTexts( tr("Show &Text Chain"));
2353 fschmid 1327
        (*scrActions)["viewShowTextControls"]->setTexts( tr("Show Control Characters"));
4651 cbradney 1328
        (*scrActions)["viewShowRulers"]->setTexts( tr("Show Rulers"));
2863 fschmid 1329
        (*scrActions)["viewRulerMode"]->setTexts( tr("Rulers relative to Page"));
2352 fschmid 1330
        (*scrActions)["viewSnapToGrid"]->setTexts( tr("Sn&ap to Grid"));
1331
        (*scrActions)["viewSnapToGuides"]->setTexts( tr("Sna&p to Guides"));
1332
//      (*scrActions)["viewNewView"]->setTexts( tr("New View"));
2170 cbradney 1333
 
1334
        //Tool menu
2352 fschmid 1335
        (*scrActions)["toolsProperties"]->setTexts( tr("&Properties"));
4554 cbradney 1336
        (*scrActions)["toolsOutline"]->setTexts( tr("&Outline", "Document Outline Palette"));
2352 fschmid 1337
        (*scrActions)["toolsScrapbook"]->setTexts( tr("&Scrapbook"));
1338
        (*scrActions)["toolsLayers"]->setTexts( tr("&Layers"));
2589 cbradney 1339
        (*scrActions)["toolsPages"]->setTexts( tr("&Arrange Pages"));
2352 fschmid 1340
        (*scrActions)["toolsBookmarks"]->setTexts( tr("&Bookmarks"));
1341
        (*scrActions)["toolsMeasurements"]->setTexts( tr("&Measurements"));
1342
        (*scrActions)["toolsActionHistory"]->setTexts( tr("Action &History"));
1343
        (*scrActions)["toolsPreflightVerifier"]->setTexts( tr("Preflight &Verifier"));
2364 cbradney 1344
        (*scrActions)["toolsAlignDistribute"]->setTexts( tr("&Align and Distribute"));
2352 fschmid 1345
        (*scrActions)["toolsToolbarTools"]->setTexts( tr("&Tools"));
1346
        (*scrActions)["toolsToolbarPDF"]->setTexts( tr("P&DF Tools"));
2246 subik 1347
 
2170 cbradney 1348
        //toolbar only items
2352 fschmid 1349
        (*scrActions)["toolsSelect"]->setTexts( tr("Select Item"));
1350
        (*scrActions)["toolsInsertTextFrame"]->setMenuText( tr("&Text Frame"));
1351
        (*scrActions)["toolsInsertImageFrame"]->setMenuText( tr("&Image Frame"));
1352
        (*scrActions)["toolsInsertTableFrame"]->setMenuText( tr("T&able"));
1353
        (*scrActions)["toolsInsertShape"]->setMenuText( tr("&Shape"));
1354
        (*scrActions)["toolsInsertPolygon"]->setMenuText( tr("&Polygon"));
1355
        (*scrActions)["toolsInsertLine"]->setMenuText( tr("&Line"));
1356
        (*scrActions)["toolsInsertBezier"]->setMenuText( tr("&Bezier Curve"));
1357
        (*scrActions)["toolsInsertFreehandLine"]->setMenuText( tr("&Freehand Line"));
1358
        (*scrActions)["toolsRotate"]->setTexts( tr("Rotate Item"));
1359
        (*scrActions)["toolsZoom"]->setTexts( tr("Zoom in or out"));
1360
        (*scrActions)["toolsZoomIn"]->setTexts( tr("Zoom in"));
1361
        (*scrActions)["toolsZoomOut"]->setTexts( tr("Zoom out"));
1362
        (*scrActions)["toolsEditContents"]->setTexts( tr("Edit Contents of Frame"));
1363
        (*scrActions)["toolsEditWithStoryEditor"]->setMenuText( tr("Edit Text..."));
1364
        (*scrActions)["toolsLinkTextFrame"]->setTexts( tr("Link Text Frames"));
1365
        (*scrActions)["toolsUnlinkTextFrame"]->setTexts( tr("Unlink Text Frames"));
1366
        (*scrActions)["toolsEyeDropper"]->setTexts( tr("&Eye Dropper"));
1367
        (*scrActions)["toolsCopyProperties"]->setTexts( tr("Copy Item Properties"));
2246 subik 1368
 
2352 fschmid 1369
        (*scrActions)["toolsEditWithStoryEditor"]->setText( tr("Edit the text with the Story Editor"));
2246 subik 1370
 
2352 fschmid 1371
        (*scrActions)["toolsInsertTextFrame"]->setText( tr("Insert Text Frame"));
1372
        (*scrActions)["toolsInsertImageFrame"]->setText( tr("Insert Image Frame"));
1373
        (*scrActions)["toolsInsertTableFrame"]->setText( tr("Insert Table"));
1374
        (*scrActions)["toolsInsertShape"]->setText( tr("Insert Shape"));
1375
        (*scrActions)["toolsInsertPolygon"]->setText( tr("Insert Polygon"));
1376
        (*scrActions)["toolsInsertLine"]->setText( tr("Insert Line"));
1377
        (*scrActions)["toolsInsertBezier"]->setText( tr("Insert Bezier Curve"));
1378
        (*scrActions)["toolsInsertFreehandLine"]->setText( tr("Insert Freehand Line"));
7087 subik 1379
 
5277 cbradney 1380
        (*scrActions)["toolsPDFPushButton"]->setTexts( tr("Insert PDF Push Button"));
1381
        (*scrActions)["toolsPDFTextField"]->setTexts( tr("Insert PDF Text Field"));
1382
        (*scrActions)["toolsPDFCheckBox"]->setTexts( tr("Insert PDF Check Box"));
1383
        (*scrActions)["toolsPDFComboBox"]->setTexts( tr("Insert PDF Combo Box"));
1384
        (*scrActions)["toolsPDFListBox"]->setTexts( tr("Insert PDF List Box"));
1385
        (*scrActions)["toolsPDFAnnotText"]->setTexts( tr("Insert Text Annotation"));
1386
        (*scrActions)["toolsPDFAnnotLink"]->setTexts( tr("Insert Link Annotation"));
2170 cbradney 1387
 
7087 subik 1388
 
2170 cbradney 1389
        //Extras Menu
2352 fschmid 1390
        (*scrActions)["extrasManagePictures"]->setTexts( tr("&Manage Pictures"));
1391
        (*scrActions)["extrasHyphenateText"]->setTexts( tr("&Hyphenate Text"));
2621 fschmid 1392
        (*scrActions)["extrasDeHyphenateText"]->setTexts( tr("Dehyphenate Text"));
2352 fschmid 1393
        (*scrActions)["extrasGenerateTableOfContents"]->setTexts( tr("&Generate Table Of Contents"));
2170 cbradney 1394
 
3097 cbradney 1395
        //Windows Menu
1396
        (*scrActions)["windowsCascade"]->setMenuText( tr("&Cascade"));
1397
        (*scrActions)["windowsTile"]->setMenuText( tr("&Tile"));
1398
 
2170 cbradney 1399
        //Help Menu
2352 fschmid 1400
        (*scrActions)["helpAboutScribus"]->setTexts( tr("&About Scribus"));
3247 craig 1401
        (*scrActions)["helpAboutPlugins"]->setTexts( tr("&About Plug-ins"));
2352 fschmid 1402
        (*scrActions)["helpAboutQt"]->setTexts( tr("About &Qt"));
1403
        (*scrActions)["helpTooltips"]->setTexts( tr("Toolti&ps"));
1404
        (*scrActions)["helpManual"]->setTexts( tr("Scribus &Manual..."));
2170 cbradney 1405
 
4557 cbradney 1406
        //GUI
5261 cbradney 1407
        (*scrActions)["specialToggleAllPalettes"]->setTexts( tr("Toggle Palettes"));
1408
        (*scrActions)["specialToggleAllGuides"]->setTexts( tr("Toggle Guides"));
7087 subik 1409
 
4557 cbradney 1410
        languageChangeUnicodeActions(scrActions);
1411
}
2246 subik 1412
 
8501 cbradney 1413
void ActionManager::languageChangeUnicodeActions(QMap<QString, QPointer<ScrAction> > *actionMap)
4557 cbradney 1414
{
2170 cbradney 1415
        //typography
4564 cbradney 1416
        (*actionMap)["unicodeSmartHyphen"]->setMenuText( tr("Smart &Hyphen"));
1417
        (*actionMap)["unicodeNonBreakingHyphen"]->setMenuText( tr("Non Breaking Dash"));
1418
        (*actionMap)["unicodeNonBreakingSpace"]->setMenuText( tr("Non Breaking &Space"));
1419
        (*actionMap)["unicodePageNumber"]->setMenuText( tr("Page &Number"));
1420
        (*actionMap)["unicodeNewLine"]->setMenuText( tr("New Line"));
1421
        (*actionMap)["unicodeFrameBreak"]->setMenuText( tr("Frame Break"));
1422
        (*actionMap)[