Subversion Repositories Scribus

Rev

Rev 5261 | Rev 5267 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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