Subversion Repositories Scribus

Rev

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

Rev Author Line No. Line
1993 cbradney 1
/***************************************************************************
2
        begin                : Apr 2005
3
        copyright            : (C) 2005 by Craig Bradney
4
        email                : cbradney@zip.com.au
5
***************************************************************************/
6
 
7
/***************************************************************************
8
*                                                                         *
9
*   ScApp program is free software; you can redistribute it and/or modify  *
10
*   it under the terms of the GNU General Public License as published by  *
11
*   the Free Software Foundation; either version 2 of the License, or     *
12
*   (at your option) any later version.                                   *
13
*                                                                         *
14
***************************************************************************/
15
 
16
#include "actionmanager.h"
17
#include "actionmanager.moc"
18
 
19
#include "scribus.h"
2026 cbradney 20
#include "scribusview.h"
1993 cbradney 21
#include "undomanager.h"
2178 cbradney 22
#include "pluginmanager.h"
1993 cbradney 23
 
24
ActionManager::ActionManager ( QObject * parent, const char * name ) : QObject ( parent, name )
25
{
26
        ScApp=(ScribusApp *)parent;
27
        scrActions=&(ScApp->scrActions);
28
        scrActionGroups=&(ScApp->scrActionGroups);
1995 cbradney 29
        modeActionNames=new QStringList();
30
        nonEditActionNames=new QStringList();
31
        unicodeCharActionNames=new QStringList();
1993 cbradney 32
        undoManager = UndoManager::instance();
33
 
34
        createActions();
2161 cbradney 35
        languageChange();
1993 cbradney 36
}
37
 
38
void ActionManager::createActions()
39
{
40
        initFileMenuActions();
41
        initEditMenuActions();
42
        initStyleMenuActions();
43
        initItemMenuActions();
44
        initInsertMenuActions();
45
        initPageMenuActions();
46
        initViewMenuActions();
47
        initToolsMenuActions();
48
        initExtrasMenuActions();
49
        initWindowsMenuActions();
50
        initScriptMenuActions();
51
        initHelpMenuActions();
52
        initSpecialActions();
53
}
54
 
55
void ActionManager::initFileMenuActions()
56
{
57
        //File Menu
2161 cbradney 58
        scrActions->insert("fileNew", new ScrAction(QIconSet(loadIcon("DateiNeu16.png"), loadIcon("DateiNeu.xpm")), "", CTRL+Key_N, ScApp, "fileNew"));
2170 cbradney 59
        scrActions->insert("fileOpen", new ScrAction(QIconSet(loadIcon("DateiOpen16.png"), loadIcon("DateiOpen.xpm")), "", CTRL+Key_O, ScApp, "fileOpen"));
60
        scrActions->insert("fileClose", new ScrAction(QIconSet(loadIcon("DateiClos16.png"), loadIcon("DateiClose.png")), "", CTRL+Key_W, ScApp, "fileClose"));
61
        scrActions->insert("fileSave", new ScrAction(QIconSet(loadIcon("DateiSave16.png"), loadIcon("DateiSave2.png")), "", CTRL+Key_S, ScApp, "fileSave"));
62
        scrActions->insert("fileSaveAs", new ScrAction(QPixmap(loadIcon("filesaveas.png")), "", CTRL+SHIFT+Key_S, ScApp, "fileSaveAs"));
63
        scrActions->insert("fileRevert", new ScrAction(QPixmap(loadIcon("revert.png")), "", QKeySequence(), ScApp, "fileRevert"));
64
        scrActions->insert("fileCollect", new ScrAction(ScApp, "fileCollect"));
1993 cbradney 65
        //File Import Menu
2170 cbradney 66
        scrActions->insert("fileImportText", new ScrAction(ScApp, "fileImportText"));
67
        scrActions->insert("fileImportAppendText", new ScrAction(ScApp, "fileImportAppendText"));
68
        scrActions->insert("fileImportImage", new ScrAction(ScApp, "fileImportImage"));
1993 cbradney 69
 
70
        //File Export Menu
2170 cbradney 71
        scrActions->insert("fileExportText", new ScrAction(ScApp, "fileExportText"));
72
        scrActions->insert("fileExportAsEPS", new ScrAction(ScApp, "fileExportAsEPS"));
73
        scrActions->insert("fileExportAsPDF", new ScrAction(loadIcon("acrobat.png"), "", QKeySequence(), ScApp, "fileExportAsPDF"));
1993 cbradney 74
        //Rest of File Menu
2170 cbradney 75
        scrActions->insert("fileDocInfo", new ScrAction(loadIcon("documentinfo.png"), "", CTRL+Key_I, ScApp, "fileDocInfo"));
76
        scrActions->insert("fileDocSetup", new ScrAction(ScApp, "fileDocSetup"));
77
        scrActions->insert("filePrint", new ScrAction(QIconSet(loadIcon("DateiPrint16.png"), loadIcon("DateiPrint.xpm")), "", CTRL+Key_P, ScApp, "filePrint"));
78
        scrActions->insert("fileQuit", new ScrAction(QPixmap(loadIcon("exit.png")), "", CTRL+Key_Q, ScApp, "fileQuit"));
1993 cbradney 79
 
80
        //Connect our signals and slots
81
        //File Menu
82
        connect( (*scrActions)["fileNew"], SIGNAL(activated()), ScApp, SLOT(slotFileNew()) );
83
        connect( (*scrActions)["fileOpen"], SIGNAL(activated()), ScApp, SLOT(slotDocOpen()) );
84
        connect( (*scrActions)["fileClose"], SIGNAL(activated()), ScApp, SLOT(slotFileClose()) );
85
        connect( (*scrActions)["filePrint"], SIGNAL(activated()), ScApp, SLOT(slotFilePrint()) );
86
        connect( (*scrActions)["fileSave"], SIGNAL(activated()), ScApp, SLOT(slotFileSave()) );
87
        connect( (*scrActions)["fileSaveAs"], SIGNAL(activated()), ScApp, SLOT(slotFileSaveAs()) );
88
        connect( (*scrActions)["fileDocInfo"], SIGNAL(activated()), ScApp, SLOT(InfoDoc()) );
89
        connect( (*scrActions)["fileDocSetup"], SIGNAL(activated()), ScApp, SLOT(SetupDoc()) );
90
        connect( (*scrActions)["fileRevert"], SIGNAL(activated()), ScApp, SLOT(slotFileRevert()) );
91
        connect( (*scrActions)["fileCollect"], SIGNAL(activated()), ScApp, SLOT(Collect()) );
92
        connect( (*scrActions)["fileQuit"], SIGNAL(activated()), ScApp, SLOT(slotFileQuit()) );
93
        //File Import Menu
94
        connect( (*scrActions)["fileImportText"], SIGNAL(activated()), ScApp, SLOT(slotFileOpen()) );
95
        connect( (*scrActions)["fileImportAppendText"], SIGNAL(activated()), ScApp, SLOT(slotFileAppend()) );
96
        connect( (*scrActions)["fileImportImage"], SIGNAL(activated()), ScApp, SLOT(slotFileOpen()) );
97
        //File Export Menu
98
        connect( (*scrActions)["fileExportText"], SIGNAL(activated()), ScApp, SLOT(SaveText()) );
99
        connect( (*scrActions)["fileExportAsEPS"], SIGNAL(activated()), ScApp, SLOT(SaveAsEps()) );
100
        connect( (*scrActions)["fileExportAsPDF"], SIGNAL(activated()), ScApp, SLOT(SaveAsPDF()) );
101
        //The rest are plugins
102
}
103
 
104
void ActionManager::initEditMenuActions()
105
{
106
        //Edit Menu
2170 cbradney 107
        scrActions->insert("editUndoAction", new ScrAction(ScrAction::DataInt, QIconSet(loadIcon("u_undo16.png"), loadIcon("u_undo.png")), "", CTRL+Key_Z, ScApp, "editUndoAction",1));
108
        scrActions->insert("editRedoAction", new ScrAction(ScrAction::DataInt, QIconSet(loadIcon("u_redo16.png"), loadIcon("u_redo.png")), "", CTRL+SHIFT+Key_Z, ScApp, "editRedoAction", 1));
109
        scrActions->insert("editActionMode", new ScrAction(ScApp, "editActionMode"));
1993 cbradney 110
        (*scrActions)["editActionMode"]->setToggleAction(true);
2170 cbradney 111
        scrActions->insert("editCut", new ScrAction(QIconSet(loadIcon("editcut.png"), loadIcon("editcut.png")), "", CTRL+Key_X, ScApp, "editCut"));
112
        scrActions->insert("editCopy", new ScrAction(QIconSet(loadIcon("editcopy.png"), loadIcon("editcopy.png")), "", CTRL+Key_C, ScApp, "editCopy"));
113
        scrActions->insert("editPaste", new ScrAction(QIconSet(loadIcon("editpaste.png"), loadIcon("editpaste.png")), "", CTRL+Key_V, ScApp, "editPaste"));
114
        scrActions->insert("editClearContents", new ScrAction(QIconSet(loadIcon("editdelete.png"), loadIcon("editdelete.png")), "", QKeySequence(), ScApp, "editClearContents"));
115
        scrActions->insert("editSelectAll", new ScrAction("", CTRL+Key_A, ScApp, "editSelectAll"));
116
        scrActions->insert("editDeselectAll", new ScrAction("", CTRL+SHIFT+Key_A, ScApp, "editDeselectAll"));
117
        scrActions->insert("editSearchReplace", new ScrAction(QIconSet(loadIcon("find16.png"), loadIcon("find16.png")), "", QKeySequence(CTRL+Key_F), ScApp, "editSearchReplace"));
1993 cbradney 118
 
2170 cbradney 119
        scrActions->insert("editColors", new ScrAction(ScApp, "editColors"));
120
        scrActions->insert("editParaStyles", new ScrAction(ScApp, "editParaStyles"));
121
        scrActions->insert("editLineStyles", new ScrAction(ScApp, "editLineStyles"));
122
        scrActions->insert("editMasterPages", new ScrAction(ScApp, "editMasterPages"));
123
        scrActions->insert("editJavascripts", new ScrAction(ScApp, "editJavascripts"));
124
        scrActions->insert("editPreferences", new ScrAction(ScApp, "editPreferences"));
1993 cbradney 125
 
126
        connect( (*scrActions)["editUndoAction"], SIGNAL(activatedData(int)) , undoManager, SLOT(undo(int)) );
127
        connect( (*scrActions)["editRedoAction"], SIGNAL(activatedData(int)) , undoManager, SLOT(redo(int)) );
128
        connect( (*scrActions)["editActionMode"], SIGNAL(toggled(bool)), ScApp, SLOT(setUndoMode(bool)) );
129
        connect( (*scrActions)["editCut"], SIGNAL(activated()), ScApp, SLOT(slotEditCut()) );
130
        connect( (*scrActions)["editCopy"], SIGNAL(activated()), ScApp, SLOT(slotEditCopy()) );
131
        connect( (*scrActions)["editPaste"], SIGNAL(activated()), ScApp, SLOT(slotEditPaste()) );
132
        connect( (*scrActions)["editClearContents"], SIGNAL(activated()), ScApp, SLOT(clearContents()) );
133
        connect( (*scrActions)["editSelectAll"], SIGNAL(activated()), ScApp, SLOT(SelectAll()) );
134
        connect( (*scrActions)["editDeselectAll"], SIGNAL(activated()), ScApp, SLOT(deselectAll()) );
135
        connect( (*scrActions)["editSearchReplace"], SIGNAL(activated()), ScApp, SLOT(SearchText()) );
136
        connect( (*scrActions)["editColors"], SIGNAL(activated()), ScApp, SLOT(slotEditColors()) );
137
        connect( (*scrActions)["editParaStyles"], SIGNAL(activated()), ScApp, SLOT(slotEditStyles()) );
138
        connect( (*scrActions)["editLineStyles"], SIGNAL(activated()), ScApp, SLOT(slotEditLineStyles()) );
2093 cbradney 139
        connect( (*scrActions)["editMasterPages"], SIGNAL(activated()), ScApp, SLOT(manageMasterPages()) );
1993 cbradney 140
        connect( (*scrActions)["editJavascripts"], SIGNAL(activated()), ScApp, SLOT(ManageJava()) );
141
        connect( (*scrActions)["editPreferences"], SIGNAL(activated()), ScApp, SLOT(slotPrefsOrg()) );
142
}
143
 
144
void ActionManager::initStyleMenuActions()
145
{
146
        //Text Size actions
147
        (*scrActionGroups).insert("fontSize", new QActionGroup(ScApp, "fontSize", true));
2170 cbradney 148
        scrActions->insert("fontSizeOther", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), (*scrActionGroups)["fontSize"], "fontSizeOther", -1));
1993 cbradney 149
        connect( (*scrActions)["fontSizeOther"], SIGNAL(activatedData(int)), ScApp, SLOT(setItemFSize(int)));
150
 
151
        int font_sizes[] = {7, 9, 10, 11, 12, 14, 18, 24, 36, 48, 60, 72};
152
        size_t f_size = sizeof(font_sizes) / sizeof(*font_sizes);
153
        for (uint s = 0; s < f_size; ++s)
154
        {
155
                QString fontSizeName=QString("fontSize%1").arg(font_sizes[s]);
2170 cbradney 156
                scrActions->insert(fontSizeName, new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), (*scrActionGroups)["fontSize"], fontSizeName, font_sizes[s]));
1993 cbradney 157
                (*scrActions)[fontSizeName]->setToggleAction(true);
158
                connect( (*scrActions)[fontSizeName], SIGNAL(activatedData(int)), ScApp, SLOT(setItemFSize(int)));
159
        }
160
 
161
        //Alignment actions
2170 cbradney 162
        scrActions->insert("alignLeft", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), ScApp, "alignLeft", 0));
163
        scrActions->insert("alignCenter", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), ScApp, "alignCenter", 1));
164
        scrActions->insert("alignRight", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), ScApp, "alignRight", 2));
165
        scrActions->insert("alignBlock", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), ScApp, "alignBlock", 3));
166
        scrActions->insert("alignForced", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), ScApp, "alignForced", 4));
1993 cbradney 167
 
168
        (*scrActions)["alignLeft"]->setToggleAction(true);
169
        (*scrActions)["alignCenter"]->setToggleAction(true);
170
        (*scrActions)["alignRight"]->setToggleAction(true);
171
        (*scrActions)["alignBlock"]->setToggleAction(true);
172
        (*scrActions)["alignForced"]->setToggleAction(true);
173
 
174
        connect( (*scrActions)["alignLeft"], SIGNAL(activatedData(int)), ScApp, SLOT(setNewAbStyle(int)));
175
        connect( (*scrActions)["alignCenter"], SIGNAL(activatedData(int)), ScApp, SLOT(setNewAbStyle(int)));
176
        connect( (*scrActions)["alignRight"], SIGNAL(activatedData(int)), ScApp, SLOT(setNewAbStyle(int)));
177
        connect( (*scrActions)["alignBlock"], SIGNAL(activatedData(int)), ScApp, SLOT(setNewAbStyle(int)));
178
        connect( (*scrActions)["alignForced"], SIGNAL(activatedData(int)), ScApp, SLOT(setNewAbStyle(int)));
179
 
180
        //Shade actions
181
        scrActionGroups->insert("shade", new QActionGroup(ScApp, "shade", true));
2170 cbradney 182
        scrActions->insert("shadeOther", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), (*scrActionGroups)["shade"], "shadeOther", -1));
1993 cbradney 183
        connect( (*scrActions)["shadeOther"], SIGNAL(activatedData(int)), ScApp, SLOT(setItemShade(int)));
184
        for (uint i=0; i<=100 ; i+=10)
185
        {
186
                QString shadeName=QString("shade%1").arg(i);
2170 cbradney 187
                scrActions->insert(shadeName, new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), (*scrActionGroups)["shade"], shadeName, i));
1993 cbradney 188
                (*scrActions)[shadeName]->setToggleAction(true);
189
                connect( (*scrActions)[shadeName], SIGNAL(activatedData(int)), ScApp, SLOT(setItemShade(int)));
190
        }
191
 
192
        //Type Effects actions
193
        scrActionGroups->insert("typeEffects", new QActionGroup(ScApp, "typeEffects", false));
194
        scrActions->insert("typeEffectNormal", new ScrAction(ScrAction::DataInt, QIconSet(), tr("&Normal"), QKeySequence(), (*scrActionGroups)["typeEffects"], "typeEffectNormal", 0));
195
        scrActions->insert("typeEffectUnderline", new ScrAction(ScrAction::DataInt, QIconSet(), tr("&Underline"), QKeySequence(), (*scrActionGroups)["typeEffects"], "typeEffectUnderline", 1));
196
        scrActions->insert("typeEffectStrikeThrough", new ScrAction(ScrAction::DataInt, QIconSet(), tr("&Strike Through"), QKeySequence(), (*scrActionGroups)["typeEffects"], "typeEffectStrikeThrough", 2));
2185 fschmid 197
        scrActions->insert("typeEffectAllCaps", new ScrAction(ScrAction::DataInt, QIconSet(), tr("&All Caps"), QKeySequence(), (*scrActionGroups)["typeEffects"], "typeEffectAllCaps", 7));
1993 cbradney 198
        scrActions->insert("typeEffectSmallCaps", new ScrAction(ScrAction::DataInt, QIconSet(), tr("Small &Caps"), QKeySequence(), (*scrActionGroups)["typeEffects"], "typeEffectSmallCaps", 3));
199
        scrActions->insert("typeEffectSuperscript", new ScrAction(ScrAction::DataInt, QIconSet(), tr("Su&perscript"), QKeySequence(), (*scrActionGroups)["typeEffects"], "typeEffectSuperscript", 4));
200
        scrActions->insert("typeEffectSubscript", new ScrAction(ScrAction::DataInt, QIconSet(), tr("Su&bscript"), QKeySequence(), (*scrActionGroups)["typeEffects"], "typeEffectSubscript", 5));
201
        scrActions->insert("typeEffectOutline", new ScrAction(ScrAction::DataInt, QIconSet(), tr("&Outline"), QKeySequence(), (*scrActionGroups)["typeEffects"], "typeEffectOutline", 6));
202
        (*scrActions)["typeEffectNormal"]->setToggleAction(true);
203
        (*scrActions)["typeEffectUnderline"]->setToggleAction(true);
204
        (*scrActions)["typeEffectStrikeThrough"]->setToggleAction(true);
2185 fschmid 205
        (*scrActions)["typeEffectAllCaps"]->setToggleAction(true);
1993 cbradney 206
        (*scrActions)["typeEffectSmallCaps"]->setToggleAction(true);
207
        (*scrActions)["typeEffectSuperscript"]->setToggleAction(true);
208
        (*scrActions)["typeEffectSubscript"]->setToggleAction(true);
209
        (*scrActions)["typeEffectOutline"]->setToggleAction(true);
210
        connect( (*scrActions)["typeEffectNormal"], SIGNAL(activatedData(int)), ScApp, SLOT(setItemTypeStyle(int)));
211
        connect( (*scrActions)["typeEffectUnderline"], SIGNAL(activatedData(int)), ScApp, SLOT(setItemTypeStyle(int)));
212
        connect( (*scrActions)["typeEffectStrikeThrough"], SIGNAL(activatedData(int)), ScApp, SLOT(setItemTypeStyle(int)));
213
        connect( (*scrActions)["typeEffectSmallCaps"], SIGNAL(activatedData(int)), ScApp, SLOT(setItemTypeStyle(int)));
2185 fschmid 214
        connect( (*scrActions)["typeEffectAllCaps"], SIGNAL(activatedData(int)), ScApp, SLOT(setItemTypeStyle(int)));
1993 cbradney 215
        connect( (*scrActions)["typeEffectSuperscript"], SIGNAL(activatedData(int)), ScApp, SLOT(setItemTypeStyle(int)));
216
        connect( (*scrActions)["typeEffectSubscript"], SIGNAL(activatedData(int)), ScApp, SLOT(setItemTypeStyle(int)));
217
        connect( (*scrActions)["typeEffectOutline"], SIGNAL(activatedData(int)), ScApp, SLOT(setItemTypeStyle(int)));
218
 
219
        //Other Style menu items that get added in various places
2056 fschmid 220
        scrActions->insert("styleInvertPict", new ScrAction(tr("&Image Effects"), QKeySequence(), ScApp, "styleInvertPict"));
1993 cbradney 221
        scrActions->insert("styleTabulators", new ScrAction(tr("&Tabulators..."), QKeySequence(), ScApp, "styleTabulators"));
2056 fschmid 222
        connect( (*scrActions)["styleInvertPict"], SIGNAL(activated()), ScApp, SLOT(ImageEffects()));
1993 cbradney 223
        connect( (*scrActions)["styleTabulators"], SIGNAL(activated()), ScApp, SLOT(EditTabs()));
224
 
225
}
226
 
227
void ActionManager::initItemMenuActions()
228
{
229
        //Item Menu
2170 cbradney 230
        scrActions->insert("itemDuplicate", new ScrAction("", CTRL+Key_D, ScApp, "itemDuplicate"));
231
        scrActions->insert("itemMulDuplicate", new ScrAction(ScApp, "itemMulDuplicate"));
232
        scrActions->insert("itemDelete", new ScrAction("", CTRL+Key_K, ScApp, "itemDelete"));
233
        scrActions->insert("itemGroup", new ScrAction("", CTRL+Key_G, ScApp, "itemGroup"));
234
        scrActions->insert("itemUngroup", new ScrAction("", CTRL+Key_U, ScApp, "itemUngroup"));
235
        scrActions->insert("itemLock", new ScrAction("", CTRL+Key_L, ScApp, "itemLock"));
236
        scrActions->insert("itemLockSize", new ScrAction("", CTRL+SHIFT+Key_L, ScApp, "itemLockSize"));
1993 cbradney 237
        (*scrActions)["itemLock"]->setToggleAction(true);
238
        (*scrActions)["itemLockSize"]->setToggleAction(true);
2170 cbradney 239
        scrActions->insert("itemLowerToBottom", new ScrAction(QIconSet(loadIcon("lower-to-bottom.png"), loadIcon("lower-to-bottom.png")), "", QKeySequence(Key_End), ScApp, "itemLowerToBottom"));
240
        scrActions->insert("itemRaiseToTop", new ScrAction(QIconSet(loadIcon("raise-to-top.png"), loadIcon("raise-to-top.png")), "", QKeySequence(Key_Home), ScApp, "itemRaiseToTop"));
241
        scrActions->insert("itemLower", new ScrAction(QIconSet(loadIcon("lower.png"), loadIcon("lower.png")), "", QKeySequence(CTRL+Key_End), ScApp, "itemLower"));
242
        scrActions->insert("itemRaise", new ScrAction(QIconSet(loadIcon("raise.png"), loadIcon("raise.png")), "", QKeySequence(CTRL+Key_Home), ScApp, "itemRaise"));
243
        scrActions->insert("itemAlignDist", new ScrAction(ScApp, "itemAlignDist"));
244
        scrActions->insert("itemSendToScrapbook", new ScrAction(ScApp, "itemSendToScrapbook"));
1993 cbradney 245
 
2170 cbradney 246
        scrActions->insert("itemAttributes", new ScrAction(ScApp, "itemAttributes"));
247
        scrActions->insert("itemImageIsVisible", new ScrAction(ScApp, "itemImageIsVisible"));
248
        scrActions->insert("itemPDFIsBookmark", new ScrAction(ScApp, "itemPDFIsBookmark"));
1993 cbradney 249
        (*scrActions)["itemPDFIsBookmark"]->setToggleAction(true);
2170 cbradney 250
        scrActions->insert("itemPDFIsAnnotation", new ScrAction(ScApp, "itemPDFIsAnnotation"));
1993 cbradney 251
        (*scrActions)["itemPDFIsAnnotation"]->setToggleAction(true);
2170 cbradney 252
        scrActions->insert("itemPDFAnnotationProps", new ScrAction(ScApp, "itemPDFAnnotationProps"));
253
        scrActions->insert("itemPDFFieldProps", new ScrAction(ScApp, "itemPDFFieldProps"));
1993 cbradney 254
 
255
        (*scrActions)["itemPDFIsBookmark"]->setEnabled(false);
256
        (*scrActions)["itemPDFIsAnnotation"]->setEnabled(false);
257
        (*scrActions)["itemPDFAnnotationProps"]->setEnabled(false);
258
        (*scrActions)["itemPDFFieldProps"]->setEnabled(false);
2026 cbradney 259
 
260
        (*scrActions)["itemImageIsVisible"]->setToggleAction(true);
1993 cbradney 261
 
2170 cbradney 262
        scrActions->insert("itemShapeEdit", new ScrAction(ScApp, "itemShapeEdit"));
1993 cbradney 263
        (*scrActions)["itemShapeEdit"]->setToggleAction(true);
2170 cbradney 264
        scrActions->insert("itemAttachTextToPath", new ScrAction(ScApp, "itemAttachTextToPath"));
265
        scrActions->insert("itemDetachTextFromPath", new ScrAction(ScApp, "itemDetachTextFromPath"));
266
        scrActions->insert("itemCombinePolygons", new ScrAction(ScApp, "itemCombinePolygons"));
267
        scrActions->insert("itemSplitPolygons", new ScrAction(ScApp, "itemSplitPolygons"));
268
        scrActions->insert("itemConvertToBezierCurve", new ScrAction(ScApp, "itemConvertToBezierCurve"));
269
        scrActions->insert("itemConvertToImageFrame", new ScrAction(ScApp, "itemConvertToImageFrame"));
270
        scrActions->insert("itemConvertToOutlines", new ScrAction(ScApp, "itemConvertToOutlines"));
271
        scrActions->insert("itemConvertToPolygon", new ScrAction(ScApp, "itemConvertToPolygon"));
272
        scrActions->insert("itemConvertToTextFrame", new ScrAction(ScApp, "itemConvertToTextFrame"));
1993 cbradney 273
 
274
        connect( (*scrActions)["itemDuplicate"], SIGNAL(activated()), ScApp, SLOT(ObjektDup()) );
275
        connect( (*scrActions)["itemMulDuplicate"], SIGNAL(activated()), ScApp, SLOT(ObjektDupM()) );
276
        connect( (*scrActions)["itemDelete"], SIGNAL(activated()), ScApp, SLOT(DeleteObjekt()) );
277
        connect( (*scrActions)["itemGroup"], SIGNAL(activated()), ScApp, SLOT(GroupObj()) );
278
        connect( (*scrActions)["itemUngroup"], SIGNAL(activated()), ScApp, SLOT(UnGroupObj()) );
2108 cbradney 279
        //connect( (*scrActions)["itemLock"], SIGNAL(activated()), ScApp, SLOT(ToggleObjLock()) );
280
        //connect( (*scrActions)["itemLockSize"], SIGNAL(activated()), ScApp, SLOT(ToggleObjSizeLock()) );
2103 cbradney 281
        //connect( (*scrActions)["itemPDFIsAnnotation"], SIGNAL(activated()), ScApp, SLOT(ToggleObjPDFAnnotation()) );
282
        //connect( (*scrActions)["itemPDFIsBookmark"], SIGNAL(activated()), ScApp, SLOT(ToggleObjPDFBookmark()) );
1993 cbradney 283
        connect( (*scrActions)["itemPDFAnnotationProps"], SIGNAL(activated()), ScApp, SLOT(ModifyAnnot()) );
284
        connect( (*scrActions)["itemPDFFieldProps"], SIGNAL(activated()), ScApp, SLOT(ModifyAnnot()) );
2104 cbradney 285
        //connect( (*scrActions)["itemLowerToBottom"], SIGNAL(activated()), ScApp, SLOT(Objekt2Back()) );
286
        //connect( (*scrActions)["itemRaiseToTop"], SIGNAL(activated()), ScApp, SLOT(Objekt2Front()) );
2026 cbradney 287
        //connect( (*scrActions)["itemLower"], SIGNAL(activated()), ScApp, SLOT(ObjektLower()) );
288
        //connect( (*scrActions)["itemRaise"], SIGNAL(activated()), ScApp, SLOT(ObjektRaise()) );
1993 cbradney 289
        connect( (*scrActions)["itemAlignDist"], SIGNAL(activated()), ScApp, SLOT(ObjektAlign()) );
290
        connect( (*scrActions)["itemSendToScrapbook"], SIGNAL(activated()), ScApp, SLOT(PutScrap()) );
291
        connect( (*scrActions)["itemAttributes"], SIGNAL(activated()), ScApp, SLOT(objectAttributes()) );
292
        connect( (*scrActions)["itemShapeEdit"], SIGNAL(activated()), ScApp, SLOT(ToggleFrameEdit()) );
2026 cbradney 293
        //connect( (*scrActions)["itemAttachTextToPath"], SIGNAL(activated()), ScApp, SLOT(Pfadtext()) );
294
        //connect( (*scrActions)["itemDetachTextFromPath"], SIGNAL(activated()), ScApp, SLOT(noPfadtext()) );
295
        //connect( (*scrActions)["itemCombinePolygons"], SIGNAL(activated()), ScApp, SLOT(UniteOb()) );
296
        //connect( (*scrActions)["itemSplitPolygons"], SIGNAL(activated()), ScApp, SLOT(SplitUniteOb()) );
297
        //connect( (*scrActions)["itemConvertToBezierCurve"], SIGNAL(activated()), ScApp, SLOT(convertToBezierCurve()) );
298
        //connect( (*scrActions)["itemConvertToImageFrame"], SIGNAL(activated()), ScApp, SLOT(convertToImageFrame()) );
299
        //connect( (*scrActions)["itemConvertToOutlines"], SIGNAL(activated()), ScApp, SLOT(convertToOutlines()) );
300
        //connect( (*scrActions)["itemConvertToPolygon"], SIGNAL(activated()), ScApp, SLOT(convertToPolygon()) );
301
        //connect( (*scrActions)["itemConvertToTextFrame"], SIGNAL(activated()), ScApp, SLOT(convertToTextFrame()) );
1993 cbradney 302
}
303
 
304
void ActionManager::initInsertMenuActions()
305
{
306
        //Insert Menu
2170 cbradney 307
        scrActions->insert("insertGlyph", new ScrAction(ScApp, "insertGlyph"));
308
        scrActions->insert("insertSampleText", new ScrAction(ScApp, "insertSampleText"));
1993 cbradney 309
 
310
        connect( (*scrActions)["insertGlyph"], SIGNAL(activated()), ScApp, SLOT(slotCharSelect()) );
311
        connect( (*scrActions)["insertSampleText"], SIGNAL(activated()), ScApp, SLOT(insertSampleText()) );
312
}
313
 
314
void ActionManager::initPageMenuActions()
315
{
316
        //Page menu
2170 cbradney 317
        scrActions->insert("pageInsert", new ScrAction(ScApp, "pageInsert"));
318
        scrActions->insert("pageImport", new ScrAction(ScApp, "pageImport"));
319
        scrActions->insert("pageDelete", new ScrAction(ScApp, "pageDelete"));
320
        scrActions->insert("pageCopy", new ScrAction(ScApp, "pageCopy"));
321
        scrActions->insert("pageMove", new ScrAction(ScApp, "pageMove"));
322
        scrActions->insert("pageApplyMasterPage", new ScrAction(ScApp, "pageApplyMasterPage"));
323
        scrActions->insert("pageManageGuides", new ScrAction(ScApp, "pageManageGuides"));
1993 cbradney 324
 
325
        connect( (*scrActions)["pageInsert"], SIGNAL(activated()), ScApp, SLOT(slotNewPageM()) );
2093 cbradney 326
        connect( (*scrActions)["pageImport"], SIGNAL(activated()), ScApp, SLOT(slotPageImport()) );
1993 cbradney 327
        connect( (*scrActions)["pageDelete"], SIGNAL(activated()), ScApp, SLOT(DeletePage()) );
328
        connect( (*scrActions)["pageCopy"], SIGNAL(activated()), ScApp, SLOT(CopyPage()) );
329
        connect( (*scrActions)["pageMove"], SIGNAL(activated()), ScApp, SLOT(MovePage()) );
2093 cbradney 330
        connect( (*scrActions)["pageApplyMasterPage"], SIGNAL(activated()), ScApp, SLOT(ApplyMasterPage()) );
1993 cbradney 331
        connect( (*scrActions)["pageManageGuides"], SIGNAL(activated()), ScApp, SLOT(ManageGuides()) );
332
}
333
 
334
void ActionManager::initViewMenuActions()
335
{
2170 cbradney 336
        scrActions->insert("viewFitInWindow", new ScrAction(ScrAction::DataDouble, QIconSet(), "", CTRL+Key_0, ScApp, "viewFitInWindow", 0, -100.0));
337
        scrActions->insert("viewFit50", new ScrAction(ScrAction::DataDouble, QIconSet(), "", QKeySequence(), ScApp, "viewFit50", 0, 50.0));
338
        scrActions->insert("viewFit75", new ScrAction(ScrAction::DataDouble, QIconSet(), "", QKeySequence(), ScApp, "viewFit75", 0, 75.0));
339
        scrActions->insert("viewFit100", new ScrAction(ScrAction::DataDouble, QIconSet(), "", CTRL+Key_1, ScApp, "viewFit100", 0, 100.0));
340
        scrActions->insert("viewFit200", new ScrAction(ScrAction::DataDouble, QIconSet(), "", QKeySequence(), ScApp, "viewFit200", 0, 200.0));
341
        scrActions->insert("viewFit20", new ScrAction(ScrAction::DataDouble, QIconSet(), "", QKeySequence(), ScApp, "viewFit20", 0, 20.0));
342
        scrActions->insert("viewShowMargins", new ScrAction(ScApp, "viewShowMargins"));
343
        scrActions->insert("viewShowFrames", new ScrAction(ScApp, "viewShowFrames"));
344
        scrActions->insert("viewShowImages", new ScrAction(ScApp, "viewShowImages"));
345
        scrActions->insert("viewShowGrid", new ScrAction(ScApp, "viewShowGrid"));
346
        scrActions->insert("viewShowGuides", new ScrAction(ScApp, "viewShowGuides"));
347
        scrActions->insert("viewShowBaseline", new ScrAction(ScApp, "viewShowBaseline"));
348
        scrActions->insert("viewShowTextChain", new ScrAction(ScApp, "viewShowTextChain"));
349
        scrActions->insert("viewSnapToGrid", new ScrAction(ScApp, "viewSnapToGrid"));
350
        scrActions->insert("viewSnapToGuides", new ScrAction(ScApp, "viewSnapToGuides"));
351
//      scrActions->insert("viewNewView", new ScrAction(ScApp, "viewNewView"));
1993 cbradney 352
 
353
        (*scrActions)["viewShowMargins"]->setToggleAction(true);
354
        (*scrActions)["viewShowFrames"]->setToggleAction(true);
355
        (*scrActions)["viewShowImages"]->setToggleAction(true);
356
        (*scrActions)["viewShowGrid"]->setToggleAction(true);
357
        (*scrActions)["viewShowGuides"]->setToggleAction(true);
358
        (*scrActions)["viewShowBaseline"]->setToggleAction(true);
359
        (*scrActions)["viewShowTextChain"]->setToggleAction(true);
360
        (*scrActions)["viewSnapToGrid"]->setToggleAction(true);
361
        (*scrActions)["viewSnapToGuides"]->setToggleAction(true);
362
 
363
        (*scrActions)["viewShowMargins"]->setOn(true);
364
        (*scrActions)["viewShowFrames"]->setOn(true);
365
        (*scrActions)["viewShowImages"]->setOn(true);
366
        (*scrActions)["viewShowGuides"]->setOn(true);
367
 
368
        connect( (*scrActions)["viewFitInWindow"], SIGNAL(activatedData(double)), ScApp, SLOT(slotZoom(double)) );
369
        connect( (*scrActions)["viewFit50"], SIGNAL(activatedData(double)), ScApp, SLOT(slotZoom(double)) );
370
        connect( (*scrActions)["viewFit75"], SIGNAL(activatedData(double)), ScApp, SLOT(slotZoom(double)) );
371
        connect( (*scrActions)["viewFit100"], SIGNAL(activatedData(double)), ScApp, SLOT(slotZoom(double)) );
372
        connect( (*scrActions)["viewFit200"], SIGNAL(activatedData(double)), ScApp, SLOT(slotZoom(double)) );
373
        connect( (*scrActions)["viewFit20"], SIGNAL(activatedData(double)), ScApp, SLOT(slotZoom(double)) );
374
        connect( (*scrActions)["viewShowMargins"], SIGNAL(activated()), ScApp, SLOT(ToggleMarks()) );
375
        connect( (*scrActions)["viewShowFrames"], SIGNAL(activated()), ScApp, SLOT(ToggleFrames()) );
376
        connect( (*scrActions)["viewShowImages"], SIGNAL(activated()), ScApp, SLOT(TogglePics()) );
377
        connect( (*scrActions)["viewShowGrid"], SIGNAL(activated()), ScApp, SLOT(ToggleRaster()) );
378
        connect( (*scrActions)["viewShowGuides"], SIGNAL(activated()), ScApp, SLOT(ToggleGuides()) );
379
        connect( (*scrActions)["viewShowBaseline"], SIGNAL(activated()), ScApp, SLOT(ToggleBase()) );
380
        connect( (*scrActions)["viewShowTextChain"], SIGNAL(activated()), ScApp, SLOT(ToggleTextLinks()) );
381
        connect( (*scrActions)["viewSnapToGrid"], SIGNAL(activated()), ScApp, SLOT(ToggleURaster()) );
382
        connect( (*scrActions)["viewSnapToGuides"], SIGNAL(activated()), ScApp, SLOT(ToggleUGuides()) );
383
//      connect( (*scrActions)["viewNewView"], SIGNAL(activated()), ScApp, SLOT(newView()) );
384
 
385
}
386
 
387
void ActionManager::initToolsMenuActions()
388
{
389
        //Tool menu
2170 cbradney 390
        scrActions->insert("toolsProperties", new ScrAction(ScApp, "toolsProperties"));
391
        scrActions->insert("toolsOutline", new ScrAction(ScApp, "toolsOutline"));
392
        scrActions->insert("toolsScrapbook", new ScrAction(ScApp, "toolsScrapbook"));
393
        scrActions->insert("toolsLayers", new ScrAction("", QKeySequence(Key_F6), ScApp, "toolsLayers"));
394
        scrActions->insert("toolsPages", new ScrAction(ScApp, "toolsPages"));
395
        scrActions->insert("toolsBookmarks", new ScrAction(ScApp, "toolsBookmarks"));
396
        scrActions->insert("toolsMeasurements", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("dist.png"), loadIcon("dist.png")), "", QKeySequence(), ScApp, "toolsMeasurements", MeasurementTool));
397
        scrActions->insert("toolsActionHistory", new ScrAction(ScApp, "toolsActionHistory"));
398
        scrActions->insert("toolsPreflightVerifier", new ScrAction(QIconSet(loadIcon("launch16.png"), loadIcon("launch.png")),"", QKeySequence(), ScApp, "toolsPreflightVerifier"));
399
        scrActions->insert("toolsToolbarTools", new ScrAction(ScApp, "toolsToolbarTools"));
400
        scrActions->insert("toolsToolbarPDF", new ScrAction(ScApp, "toolsToolbarPDF"));
1993 cbradney 401
 
402
        //toolbar only items
2170 cbradney 403
        scrActions->insert("toolsSelect", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Kreuz.xpm"), loadIcon("Kreuz.xpm")), "", QKeySequence(Key_C), ScApp, "toolsSelect", NormalMode));
1993 cbradney 404
 
2170 cbradney 405
        scrActions->insert("toolsInsertTextFrame", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Text16.xpm"), loadIcon("Text.xpm")), "", QKeySequence(Key_T), ScApp, "toolsInsertTextFrame", DrawText));
406
        scrActions->insert("toolsInsertImageFrame", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Bild16.xpm"), loadIcon("Bild.xpm")), "", QKeySequence(Key_I), ScApp, "toolsInsertImageFrame", DrawPicture));
407
        scrActions->insert("toolsInsertTableFrame", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("frame_table16.png"), loadIcon("frame_table.png")), "", QKeySequence(Key_A), ScApp, "toolsInsertTableFrame", DrawTable));
408
        scrActions->insert("toolsInsertShape", new ScrAction(ScrAction::DataInt,QIconSet(), "", QKeySequence(Key_S), ScApp, "toolsInsertShape", DrawShapes));
409
        scrActions->insert("toolsInsertPolygon", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("spline16.png"), loadIcon("spline.png")), "", QKeySequence(Key_P), ScApp, "toolsInsertPolygon", DrawRegularPolygon));
410
        scrActions->insert("toolsInsertLine", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Stift16.xpm"), loadIcon("Stift.xpm")), "", QKeySequence(Key_L), ScApp, "toolsInsertLine", DrawLine));
411
        scrActions->insert("toolsInsertBezier", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("beziertool16.png"), loadIcon("beziertool.png")), "", QKeySequence(Key_B), ScApp, "toolsInsertBezier", DrawBezierLine));
412
        scrActions->insert("toolsInsertFreehandLine", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Stiftalt16.xpm"), loadIcon("Stiftalt.xpm")), "", QKeySequence(Key_F), ScApp, "toolsInsertFreehandLine", DrawFreehandLine));
1993 cbradney 413
 
2170 cbradney 414
        scrActions->insert("toolsRotate", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Rotieren.xpm"), loadIcon("Rotieren.xpm")), "", QKeySequence(Key_R), ScApp, "toolsRotate", Rotation));
415
        scrActions->insert("toolsZoom", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Lupe.xpm"), loadIcon("Lupe.xpm")), "", QKeySequence(Key_Z), ScApp, "toolsZoom", Magnifier));
416
        scrActions->insert("toolsZoomIn", new ScrAction(QIconSet(loadIcon("Gross.xpm"), loadIcon("Gross.xpm")), "", QKeySequence(CTRL+Key_Plus), ScApp, "toolsZoomIn"));
417
        scrActions->insert("toolsZoomOut", new ScrAction(QIconSet(loadIcon("Klein.xpm"), loadIcon("Klein.xpm")), "", QKeySequence(CTRL+Key_Minus), ScApp, "toolsZoomOut"));
418
        scrActions->insert("toolsEditContents", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Editm.xpm"), loadIcon("Editm.xpm")), "", QKeySequence(Key_E), ScApp, "toolsEditContents", EditMode));
419
        scrActions->insert("toolsEditWithStoryEditor", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("signature.png"), loadIcon("signature.png")), "", QKeySequence(CTRL+Key_Y), ScApp, "toolsEditWithStoryEditor", StartStoryEditor));
420
        scrActions->insert("toolsLinkTextFrame", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Lock.xpm"), loadIcon("Lock.xpm")), "", QKeySequence(Key_N), ScApp, "toolsLinkTextFrame", LinkFrames));
421
        scrActions->insert("toolsUnlinkTextFrame", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Unlock.xpm"), loadIcon("Unlock.xpm")), "", QKeySequence(Key_U), ScApp, "toolsUnlinkTextFrame", UnlinkFrames));
422
        scrActions->insert("toolsEyeDropper", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("colorpicker.png"), loadIcon("colorpicker.png")), "", QKeySequence(Key_Y), ScApp, "toolsEyeDropper", EyeDropper));
423
        scrActions->insert("toolsCopyProperties", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("wizard.png"), loadIcon("wizard.png")), "", QKeySequence(), ScApp, "toolsCopyProperties", CopyProperties));
1993 cbradney 424
 
425
        (*scrActions)["toolsProperties"]->setToggleAction(true);
426
        (*scrActions)["toolsOutline"]->setToggleAction(true);
427
        (*scrActions)["toolsScrapbook"]->setToggleAction(true);
428
        (*scrActions)["toolsLayers"]->setToggleAction(true);
429
        (*scrActions)["toolsPages"]->setToggleAction(true);
430
        (*scrActions)["toolsBookmarks"]->setToggleAction(true);
431
        (*scrActions)["toolsMeasurements"]->setToggleAction(true);
432
        (*scrActions)["toolsActionHistory"]->setToggleAction(true);
433
        (*scrActions)["toolsPreflightVerifier"]->setToggleAction(true);
434
        (*scrActions)["toolsToolbarTools"]->setToggleAction(true);
435
        (*scrActions)["toolsToolbarPDF"]->setToggleAction(true);
436
 
437
        (*scrActions)["toolsSelect"]->setToggleAction(true);
438
        (*scrActions)["toolsInsertTextFrame"]->setToggleAction(true);
439
        (*scrActions)["toolsInsertImageFrame"]->setToggleAction(true);
440
        (*scrActions)["toolsInsertTableFrame"]->setToggleAction(true);
441
        (*scrActions)["toolsInsertShape"]->setToggleAction(true);
442
        (*scrActions)["toolsInsertPolygon"]->setToggleAction(true);
443
        (*scrActions)["toolsInsertLine"]->setToggleAction(true);
444
        (*scrActions)["toolsInsertBezier"]->setToggleAction(true);
445
        (*scrActions)["toolsInsertFreehandLine"]->setToggleAction(true);
446
        (*scrActions)["toolsRotate"]->setToggleAction(true);
447
        (*scrActions)["toolsZoom"]->setToggleAction(true);
448
        (*scrActions)["toolsEditContents"]->setToggleAction(true);
449
        (*scrActions)["toolsEditWithStoryEditor"]->setToggleAction(true);
450
        (*scrActions)["toolsLinkTextFrame"]->setToggleAction(true);
451
        (*scrActions)["toolsUnlinkTextFrame"]->setToggleAction(true);
452
        (*scrActions)["toolsEyeDropper"]->setToggleAction(true);
453
        (*scrActions)["toolsCopyProperties"]->setToggleAction(true);
454
 
455
        *modeActionNames << "toolsSelect" << "toolsInsertTextFrame" << "toolsInsertImageFrame" << "toolsInsertTableFrame";
456
        *modeActionNames << "toolsInsertShape" << "toolsInsertPolygon" << "toolsInsertLine" << "toolsInsertBezier";
457
        *modeActionNames << "toolsInsertFreehandLine" << "toolsRotate" << "toolsZoom" << "toolsEditContents";
458
        *modeActionNames << "toolsEditWithStoryEditor" << "toolsLinkTextFrame" << "toolsUnlinkTextFrame";
459
        *modeActionNames << "toolsEyeDropper" << "toolsCopyProperties";
460
 
2104 cbradney 461
        *nonEditActionNames << "itemLowerToBottom" << "itemRaiseToTop" << "itemRaise" << "itemLower";
1993 cbradney 462
 
463
        connect( (*scrActions)["toolsActionHistory"], SIGNAL(toggled(bool)), ScApp, SLOT(setUndoPalette(bool)) );
464
        connect( (*scrActions)["toolsToolbarTools"], SIGNAL(toggled(bool)), ScApp, SLOT(setTools(bool)) );
465
        connect( (*scrActions)["toolsToolbarPDF"], SIGNAL(toggled(bool)), ScApp, SLOT(setPDFTools(bool)) );
466
 
467
        connectModeActions();
468
}
469
 
470
void ActionManager::initExtrasMenuActions()
471
{
2170 cbradney 472
        scrActions->insert("extrasManagePictures", new ScrAction(ScApp, "extrasManagePictures"));
473
        scrActions->insert("extrasHyphenateText", new ScrAction(ScApp, "extrasHyphenateText"));
474
        scrActions->insert("extrasGenerateTableOfContents", new ScrAction(ScApp, "extrasGenerateTableOfContents"));
1993 cbradney 475
 
476
        connect( (*scrActions)["extrasManagePictures"], SIGNAL(activated()), ScApp, SLOT(StatusPic()) );
477
        connect( (*scrActions)["extrasHyphenateText"], SIGNAL(activated()), ScApp, SLOT(doHyphenate()) );
478
        connect( (*scrActions)["extrasGenerateTableOfContents"], SIGNAL(activated()), ScApp, SLOT(generateTableOfContents()) );
479
}
480
 
481
 
482
void ActionManager::initWindowsMenuActions()
483
{
484
}
485
 
486
void ActionManager::initScriptMenuActions()
487
{
488
}
489
 
490
void ActionManager::initHelpMenuActions()
491
{
2170 cbradney 492
        scrActions->insert("helpAboutScribus", new ScrAction(ScApp, "helpAboutScribus"));
493
        scrActions->insert("helpAboutQt", new ScrAction(ScApp, "helpAboutQt"));
494
        scrActions->insert("helpTooltips", new ScrAction(ScApp, "helpTooltips"));
495
        scrActions->insert("helpManual", new ScrAction("", Key_F1, ScApp, "helpManual"));
1993 cbradney 496
 
497
        (*scrActions)["helpTooltips"]->setToggleAction(true);
498
        (*scrActions)["helpTooltips"]->setOn(true);
499
 
500
        connect( (*scrActions)["helpAboutScribus"], SIGNAL(activated()), ScApp, SLOT(slotHelpAbout()) );
501
        connect( (*scrActions)["helpAboutQt"], SIGNAL(activated()), ScApp, SLOT(slotHelpAboutQt()) );
502
        connect( (*scrActions)["helpTooltips"], SIGNAL(activated()), ScApp, SLOT(ToggleTips()) );
503
        connect( (*scrActions)["helpManual"], SIGNAL(activated()), ScApp, SLOT(slotOnlineHelp()) );
504
}
505
 
506
void ActionManager::initSpecialActions()
507
{
508
        //typography
2170 cbradney 509
        scrActions->insert("specialSmartHyphen", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", CTRL+SHIFT+Key_Minus, ScApp, "specialSmartHyphen",-1));
510
        scrActions->insert("specialNonBreakingSpace", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", CTRL+Key_Space, ScApp, "specialNonBreakingSpace",29));
511
        scrActions->insert("specialPageNumber", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", CTRL+SHIFT+ALT+Key_P, ScApp, "specialPageNumber",30));
512
        scrActions->insert("specialCopyRight", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialCopyRight",0x0A9));
513
        scrActions->insert("specialRegdTM", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialRegdTM",0x00AE));
514
        scrActions->insert("specialTM", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialTM",0x2122));
515
        scrActions->insert("specialBullet", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialBullet",0x2022));
516
        scrActions->insert("specialDashEm", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialDashEm",0x2014));
517
        scrActions->insert("specialDashEn", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialDashEn",0x2013));
518
        scrActions->insert("specialDashFigure", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialDashFigure",0x2012));
519
        scrActions->insert("specialDashQuotation", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialDashQuotation",0x2015));
1993 cbradney 520
 
2170 cbradney 521
        scrActions->insert("specialQuoteApostrophe", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialQuoteApostrophe",0x0027));
522
        scrActions->insert("specialQuoteStraight", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialQuoteStraight",0x0022));
523
        scrActions->insert("specialQuoteSingleLeft", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialQuoteSingleLeft",0x2018));
524
        scrActions->insert("specialQuoteSingleRight", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialQuoteSingleRight",0x2019));
525
        scrActions->insert("specialQuoteDoubleLeft", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialQuoteDoubleLeft",0x201C));
526
        scrActions->insert("specialQuoteDoubleRight", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialQuoteDoubleRight",0x201D));
527
        scrActions->insert("specialQuoteSingleReversed", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialQuoteSingleReversed",0x201B));
528
        scrActions->insert("specialQuoteDoubleReversed", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialQuoteDoubleReversed",0x201F));
529
        scrActions->insert("specialQuoteSingleLeftGuillemet", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialQuoteSingleLeftGuillemet",0x2039));
530
        scrActions->insert("specialQuoteSingleRightGuillemet", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialQuoteSingleRightGuillemet",0x203A));
531
        scrActions->insert("specialQuoteDoubleLeftGuillemet", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialQuoteDoubleLeftGuillemet",0x00AB));
532
        scrActions->insert("specialQuoteDoubleRightGuillemet", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialQuoteDoubleRightGuillemet",0x00BB));
533
        scrActions->insert("specialQuoteLowSingleComma", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialQuoteLowSingleComma",0x201A));
534
        scrActions->insert("specialQuoteLowDoubleComma", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialQuoteLowDoubleComma",0x201E));
535
        scrActions->insert("specialQuoteDoubleTurnedComma", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialQuoteDoubleTurnedComma",0x201C));
536
        scrActions->insert("specialQuoteCJKSingleLeft", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialQuoteCJKSingleLeft",0x300C));
537
        scrActions->insert("specialQuoteCJKSingleRight", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialQuoteCJKSingleRight",0x300D));
538
        scrActions->insert("specialQuoteCJKDoubleLeft", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialQuoteCJKDoubleLeft",0x300E));
539
        scrActions->insert("specialQuoteCJKDoubleRight", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), ScApp, "specialQuoteCJKDoubleRight",0x300F));
1993 cbradney 540
 
541
        *unicodeCharActionNames << "specialSmartHyphen" << "specialNonBreakingSpace" << "specialPageNumber";
542
        *unicodeCharActionNames << "specialCopyRight" << "specialRegdTM" << "specialTM";
543
        *unicodeCharActionNames << "specialBullet";
544
        *unicodeCharActionNames << "specialDashEm" << "specialDashEn" << "specialDashFigure" << "specialDashQuotation";
2039 cbradney 545
        *unicodeCharActionNames << "specialQuoteApostrophe" << "specialQuoteStraight";
1993 cbradney 546
        *unicodeCharActionNames << "specialQuoteDoubleLeft" << "specialQuoteDoubleRight" << "specialQuoteSingleLeft" << "specialQuoteSingleRight";
2039 cbradney 547
        *unicodeCharActionNames << "specialQuoteSingleReversed" << "specialQuoteDoubleReversed";
548
        *unicodeCharActionNames << "specialQuoteSingleLeftGuillemet" << "specialQuoteSingleRightGuillemet" << "specialQuoteDoubleLeftGuillemet" << "specialQuoteDoubleRightGuillemet";
549
        *unicodeCharActionNames << "specialQuoteLowSingleComma" << "specialQuoteLowDoubleComma" << "specialQuoteDoubleTurnedComma";
550
        *unicodeCharActionNames << "specialQuoteCJKSingleLeft" << "specialQuoteCJKSingleRight" << "specialQuoteCJKDoubleLeft" << "specialQuoteCJKDoubleRight";
551
 
1993 cbradney 552
        for ( QStringList::Iterator it = unicodeCharActionNames->begin(); it != unicodeCharActionNames->end(); ++it )
553
                connect( (*scrActions)[*it], SIGNAL(activatedUnicodeShortcut(QString, int)), ScApp, SLOT(specialActionKeyEvent(QString, int)) );
2039 cbradney 554
        enableUnicodeActions(false);
1993 cbradney 555
 
556
        //GUI
2170 cbradney 557
        scrActions->insert("specialToggleAllPalettes", new ScrAction(ScrAction::DataQString, QIconSet(), "", Key_F10, ScApp, "specialToggleAllPalettes",0,0.0,"specialToggleAllPalettes"));
558
        scrActions->insert("specialToggleAllGuides", new ScrAction(ScrAction::DataQString, QIconSet(), "", Key_F11, ScApp, "specialToggleAllGuides",0,0.0,"specialToggleAllGuides"));
1993 cbradney 559
 
560
        connect( (*scrActions)["specialToggleAllPalettes"], SIGNAL(activated()), ScApp, SLOT(ToggleAllPalettes()) );
561
        connect( (*scrActions)["specialToggleAllGuides"], SIGNAL(activated()), ScApp, SLOT(ToggleAllGuides()) );
562
}
563
 
564
void ActionManager::disconnectModeActions()
565
{
566
        for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
567
                disconnect( (*scrActions)[*it], SIGNAL(toggledData(bool, int)) , ScApp, SLOT(setAppModeByToggle(bool, int)) );
568
}
569
 
570
void ActionManager::connectModeActions()
571
{
572
        for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
573
                connect( (*scrActions)[*it], SIGNAL(toggledData(bool, int)) , ScApp, SLOT(setAppModeByToggle(bool, int)) );
574
}
575
 
2026 cbradney 576
void ActionManager::disconnectNewViewActions()
577
{
578
        disconnect( (*scrActions)["toolsZoomIn"], 0, 0, 0);
579
        disconnect( (*scrActions)["toolsZoomOut"], 0, 0, 0);
2104 cbradney 580
        disconnect( (*scrActions)["itemLowerToBottom"], 0, 0, 0);
2026 cbradney 581
        disconnect( (*scrActions)["itemImageIsVisible"], 0, 0, 0);
582
        disconnect( (*scrActions)["itemRaise"], 0, 0, 0);
583
        disconnect( (*scrActions)["itemLower"], 0, 0, 0);
584
        disconnect( (*scrActions)["itemCombinePolygons"], 0, 0, 0);
585
        disconnect( (*scrActions)["itemSplitPolygons"], 0, 0, 0);
586
        disconnect( (*scrActions)["itemConvertToBezierCurve"], 0, 0, 0);
587
        disconnect( (*scrActions)["itemConvertToImageFrame"], 0, 0, 0);
588
        disconnect( (*scrActions)["itemConvertToOutlines"], 0, 0, 0);
589
        disconnect( (*scrActions)["itemConvertToPolygon"], 0, 0, 0);
590
        disconnect( (*scrActions)["itemConvertToTextFrame"], 0, 0, 0);
591
        disconnect( (*scrActions)["itemAttachTextToPath"], 0, 0, 0);
592
        disconnect( (*scrActions)["itemDetachTextFromPath"], 0, 0, 0);
2108 cbradney 593
        disconnect( (*scrActions)["itemLock"], 0, 0, 0);
594
        disconnect( (*scrActions)["itemLockSize"], 0, 0, 0);
2026 cbradney 595
}
596
 
597
void ActionManager::connectNewViewActions(ScribusView *currView)
598
{
599
        if (currView==NULL)
600
                return;
601
        connect( (*scrActions)["toolsZoomIn"], SIGNAL(activated()) , currView, SLOT(slotZoomIn()) );
602
        connect( (*scrActions)["toolsZoomOut"], SIGNAL(activated()) , currView, SLOT(slotZoomOut()) );
2104 cbradney 603
        connect( (*scrActions)["itemLowerToBottom"], SIGNAL(activated()), currView, SLOT(ToBack()) );
604
        connect( (*scrActions)["itemRaiseToTop"], SIGNAL(activated()), currView, SLOT(ToFront()) );
2026 cbradney 605
        connect( (*scrActions)["itemRaise"], SIGNAL(activated()), currView, SLOT(RaiseItem()) );
606
        connect( (*scrActions)["itemLower"], SIGNAL(activated()), currView, SLOT(LowerItem()) );
607
        connect( (*scrActions)["itemCombinePolygons"], SIGNAL(activated()), currView, SLOT(UniteObj()) );
608
        connect( (*scrActions)["itemSplitPolygons"], SIGNAL(activated()), currView, SLOT(SplitObj()) );
609
        connect( (*scrActions)["itemConvertToBezierCurve"], SIGNAL(activated()), currView, SLOT(ToBezierFrame()) );
610
        connect( (*scrActions)["itemConvertToImageFrame"], SIGNAL(activated()), currView, SLOT(ToPicFrame()) );
611
        connect( (*scrActions)["itemConvertToOutlines"], SIGNAL(activated()), currView, SLOT(TextToPath()) );
612
        connect( (*scrActions)["itemConvertToPolygon"], SIGNAL(activated()), currView, SLOT(ToPolyFrame()) );
613
        connect( (*scrActions)["itemConvertToTextFrame"], SIGNAL(activated()), currView, SLOT(ToTextFrame()) );
614
        connect( (*scrActions)["itemAttachTextToPath"], SIGNAL(activated()), currView, SLOT(ToPathText()) );
615
        connect( (*scrActions)["itemDetachTextFromPath"], SIGNAL(activated()), currView, SLOT(FromPathText()) );
2108 cbradney 616
        connect( (*scrActions)["itemLock"], SIGNAL(activated()), currView, SLOT(ToggleLock()) );
617
        connect( (*scrActions)["itemLockSize"], SIGNAL(activated()), currView, SLOT(ToggleSizeLock()) );
2026 cbradney 618
}
619
 
620
void ActionManager::disconnectNewSelectionActions()
621
{
622
        disconnect( (*scrActions)["itemImageIsVisible"], 0, 0, 0);
623
}
624
 
625
void ActionManager::connectNewSelectionActions(ScribusView *currView)
626
{
627
        connect( (*scrActions)["itemImageIsVisible"], SIGNAL(toggled(bool)) , currView, SLOT(TogglePic()) );
628
}
629
 
1993 cbradney 630
void ActionManager::saveActionShortcutsPreEditMode()
631
{
632
        for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
633
                (*scrActions)[*it]->saveShortcut();
634
        for ( QStringList::Iterator it = nonEditActionNames->begin(); it != nonEditActionNames->end(); ++it )
635
                (*scrActions)[*it]->saveShortcut();    
636
 
637
}
638
 
639
void ActionManager::restoreActionShortcutsPostEditMode()
640
{
641
        for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
642
                (*scrActions)[*it]->restoreShortcut();
643
        for ( QStringList::Iterator it = nonEditActionNames->begin(); it != nonEditActionNames->end(); ++it )
644
                (*scrActions)[*it]->restoreShortcut(); 
645
}
646
 
1995 cbradney 647
void ActionManager::enableActionStringList(QStringList *list, bool enabled, bool checkingUnicode)
1993 cbradney 648
{
649
        for ( QStringList::Iterator it = list->begin(); it != list->end(); ++it )
650
        {
651
                if(!checkingUnicode)
652
                        (*scrActions)[*it]->setEnabled(enabled);
653
                else
654
                {
655
                        //For UnicodeChar actions, only enable when the current font has that character.
656
                        if (ScApp->HaveDoc && (*scrActions)[*it]->actionType()==ScrAction::UnicodeChar)
657
                        {
658
                                int charCode=(*scrActions)[*it]->actionInt();
2039 cbradney 659
                                if(charCode==-1 ||
660
                                   charCode==29 ||
661
                                   charCode==30 ||
662
                                   (*ScApp->doc->AllFonts)[ScApp->doc->CurrFont]->CharWidth.contains(charCode) )
1993 cbradney 663
                                        (*scrActions)[*it]->setEnabled(enabled);
664
                        }
665
                }
666
        }
667
}
1995 cbradney 668
 
669
void ActionManager::enableUnicodeActions(bool enabled)
670
{
671
        enableActionStringList(unicodeCharActionNames, enabled, enabled);
672
}
2103 cbradney 673
 
2108 cbradney 674
void ActionManager::setPDFActions(ScribusView *currView)
2103 cbradney 675
{
2108 cbradney 676
        if (currView==NULL)
2103 cbradney 677
                return;
2108 cbradney 678
        PageItem* currItem = currView->SelItem.at(0);
2103 cbradney 679
        if (currItem==NULL)
680
                return;
681
 
682
        disconnect( (*scrActions)["itemPDFIsBookmark"], 0, 0, 0);
683
        disconnect( (*scrActions)["itemPDFIsAnnotation"], 0, 0, 0);
684
 
685
        if (currItem->itemType()!=PageItem::TextFrame)
686
        {
687
                (*scrActions)["itemPDFIsAnnotation"]->setEnabled(false);
688
                (*scrActions)["itemPDFIsBookmark"]->setEnabled(false);
689
                (*scrActions)["itemPDFIsAnnotation"]->setOn(false);
690
                (*scrActions)["itemPDFIsBookmark"]->setOn(false);
691
                (*scrActions)["itemPDFAnnotationProps"]->setEnabled(false);
692
                (*scrActions)["itemPDFFieldProps"]->setEnabled(false);
693
                return;
694
        }
695
 
696
        (*scrActions)["itemPDFIsAnnotation"]->setEnabled(true);
697
        (*scrActions)["itemPDFIsBookmark"]->setEnabled(true);
698
        (*scrActions)["itemPDFIsAnnotation"]->setOn(currItem->isAnnotation);
699
        (*scrActions)["itemPDFIsBookmark"]->setOn(currItem->isBookmark);
700
        if (currItem->isAnnotation)
701
        {
702
                bool setter=((currItem->AnType == 0) || (currItem->AnType == 1) || (currItem->AnType > 9));
703
                (*scrActions)["itemPDFAnnotationProps"]->setEnabled(setter);
704
                (*scrActions)["itemPDFFieldProps"]->setEnabled(!setter);
705
        }
706
        else
707
        {
708
                (*scrActions)["itemPDFAnnotationProps"]->setEnabled(false);
709
                (*scrActions)["itemPDFFieldProps"]->setEnabled(false);
710
        }
2108 cbradney 711
        connect( (*scrActions)["itemPDFIsAnnotation"], SIGNAL(activated()), currView, SLOT(ToggleAnnotation()) );
712
        connect( (*scrActions)["itemPDFIsBookmark"], SIGNAL(activated()), currView, SLOT(ToggleBookmark()) );
2103 cbradney 713
}
2161 cbradney 714
 
715
void ActionManager::languageChange()
716
{
2170 cbradney 717
        //File Menu
2161 cbradney 718
        (*scrActions)["fileNew"]->setMenuText(tr("&New"));
2170 cbradney 719
        (*scrActions)["fileOpen"]->setMenuText(tr("&Open..."));
720
        (*scrActions)["fileClose"]->setMenuText(tr("&Close"));
721
        (*scrActions)["fileSave"]->setMenuText(tr("&Save"));
722
        (*scrActions)["fileSaveAs"]->setMenuText(tr("Save &As..."));
723
        (*scrActions)["fileRevert"]->setMenuText(tr("Re&vert to Saved"));
724
        (*scrActions)["fileCollect"]->setMenuText(tr("Collect for O&utput..."));
725
        (*scrActions)["fileImportText"]->setMenuText(tr("Get Text..."));
726
        (*scrActions)["fileImportAppendText"]->setMenuText(tr("Append &Text..."));
727
        (*scrActions)["fileImportImage"]->setMenuText(tr("Get Image..."));
728
        (*scrActions)["fileExportText"]->setMenuText(tr("Save &Text..."));
729
        (*scrActions)["fileExportAsEPS"]->setMenuText(tr("Save Page as &EPS..."));
730
        (*scrActions)["fileExportAsPDF"]->setMenuText(tr("Save as P&DF..."));
731
        (*scrActions)["fileDocInfo"]->setMenuText(tr("Document &Information..."));
732
        (*scrActions)["fileDocSetup"]->setMenuText(tr("Document &Setup..."));
733
        (*scrActions)["filePrint"]->setMenuText(tr("&Print..."));
734
        (*scrActions)["fileQuit"]->setMenuText(tr("&Quit"));
735
        //Edit Menu
736
        (*scrActions)["editUndoAction"]->setMenuText(tr("&Undo"));
737
        (*scrActions)["editRedoAction"]->setMenuText(tr("&Redo"));
738
        (*scrActions)["editActionMode"]->setMenuText(tr("&Item Action Mode"));
739
        (*scrActions)["editCut"]->setMenuText(tr("Cu&t"));
740
        (*scrActions)["editCopy"]->setMenuText(tr("&Copy"));
741
        (*scrActions)["editPaste"]->setMenuText(tr("&Paste"));
742
        (*scrActions)["editClearContents"]->setMenuText(tr("C&lear Contents"));
743
        (*scrActions)["editSelectAll"]->setMenuText(tr("Select &All"));
744
        (*scrActions)["editDeselectAll"]->setMenuText(tr("&Deselect All"));
745
        (*scrActions)["editSearchReplace"]->setMenuText(tr("&Search/Replace..."));
746
        (*scrActions)["editColors"]->setMenuText(tr("C&olors..."));
747
        (*scrActions)["editParaStyles"]->setMenuText(tr("&Paragraph Styles..."));
748
        (*scrActions)["editLineStyles"]->setMenuText(tr("&Line Styles..."));
749
        (*scrActions)["editMasterPages"]->setMenuText(tr("&Master Pages..."));
750
        (*scrActions)["editJavascripts"]->setMenuText(tr("&Javascripts..."));
751
        (*scrActions)["editPreferences"]->setMenuText(tr("P&references..."));
752
 
753
        int font_sizes[] = {7, 9, 10, 11, 12, 14, 18, 24, 36, 48, 60, 72};
754
        size_t f_size = sizeof(font_sizes) / sizeof(*font_sizes);
755
        for (uint s = 0; s < f_size; ++s)
756
        {
757
                QString fontSizeName=QString("fontSize%1").arg(font_sizes[s]);
758
                (*scrActions)[fontSizeName]->setMenuText(tr("%1 pt").arg(font_sizes[s]));
759
        }
760
        (*scrActions)["fontSizeOther"]->setMenuText(tr("&Other..."));
761
        (*scrActions)["alignLeft"]->setMenuText(tr("&Left"));
762
        (*scrActions)["alignCenter"]->setMenuText(tr("&Center"));
763
        (*scrActions)["alignRight"]->setMenuText(tr("&Right"));
764
        (*scrActions)["alignBlock"]->setMenuText(tr("&Block"));
765
        (*scrActions)["alignForced"]->setMenuText(tr("&Forced"));
766
 
767
        for (uint i=0; i<=100 ; i+=10)
768
        {
769
                QString shadeName=QString("shade%1").arg(i);
770
                (*scrActions)[shadeName]->setMenuText(tr("&%1 %").arg(i));
771
        }
772
 
773
        (*scrActions)["shadeOther"]->setMenuText(tr("&Other..."));
774
        (*scrActions)["typeEffectNormal"]->setMenuText(tr("&Normal"));
775
        (*scrActions)["typeEffectUnderline"]->setMenuText(tr("&Underline"));
776
        (*scrActions)["typeEffectStrikeThrough"]->setMenuText(tr("&Strike Through"));
2185 fschmid 777
        (*scrActions)["typeEffectAllCaps"]->setMenuText(tr("&All Caps"));
2170 cbradney 778
        (*scrActions)["typeEffectSmallCaps"]->setMenuText(tr("Small &Caps"));
779
        (*scrActions)["typeEffectSuperscript"]->setMenuText(tr("Su&perscript"));
780
        (*scrActions)["typeEffectSubscript"]->setMenuText(tr("Su&bscript"));
781
        (*scrActions)["typeEffectOutline"]->setMenuText(tr("&Outline"));
782
 
783
        (*scrActions)["styleInvertPict"]->setMenuText(tr("&Image Effects"));
784
        (*scrActions)["styleTabulators"]->setMenuText(tr("&Tabulators..."));
785
 
786
        //Item Menu
787
        (*scrActions)["itemDuplicate"]->setMenuText(tr("D&uplicate"));
788
        (*scrActions)["itemMulDuplicate"]->setMenuText(tr("&Multiple Duplicate"));
789
        (*scrActions)["itemDelete"]->setMenuText(tr("&Delete"));
790
        (*scrActions)["itemGroup"]->setMenuText(tr("&Group"));
791
        (*scrActions)["itemUngroup"]->setMenuText(tr("&Ungroup"));
792
        (*scrActions)["itemLock"]->setMenuText(tr("Is &Locked"));
793
        (*scrActions)["itemLockSize"]->setMenuText(tr("Si&ze is Locked"));
794
        (*scrActions)["itemLowerToBottom"]->setMenuText(tr("Lower to &Bottom"));
795
        (*scrActions)["itemRaiseToTop"]->setMenuText(tr("Raise to &Top"));
796
        (*scrActions)["itemLower"]->setMenuText(tr("&Lower"));
797
        (*scrActions)["itemRaise"]->setMenuText(tr("&Raise"));
798
        (*scrActions)["itemAlignDist"]->setMenuText(tr("Distribute/&Align..."));
799
        (*scrActions)["itemSendToScrapbook"]->setMenuText(tr("Send to S&crapbook"));
800
        (*scrActions)["itemAttributes"]->setMenuText(tr("&Attributes..."));
801
        (*scrActions)["itemImageIsVisible"]->setMenuText(tr("I&mage Visible"));
802
        (*scrActions)["itemPDFIsBookmark"]->setMenuText(tr("Is PDF &Bookmark"));
803
        (*scrActions)["itemPDFIsAnnotation"]->setMenuText(tr("Is PDF A&nnotation"));
804
        (*scrActions)["itemPDFAnnotationProps"]->setMenuText(tr("Annotation P&roperties"));
805
        (*scrActions)["itemPDFFieldProps"]->setMenuText(tr("Field P&roperties"));
806
        (*scrActions)["itemShapeEdit"]->setMenuText(tr("&Edit Shape..."));
807
        (*scrActions)["itemAttachTextToPath"]->setMenuText(tr("&Attach Text to Path"));
808
        (*scrActions)["itemDetachTextFromPath"]->setMenuText(tr("&Detach Text from Path"));
809
        (*scrActions)["itemCombinePolygons"]->setMenuText(tr("&Combine Polygons"));
810
        (*scrActions)["itemSplitPolygons"]->setMenuText(tr("Split &Polygons"));
811
        (*scrActions)["itemConvertToBezierCurve"]->setMenuText(tr("&Bezier Curve"));
812
        (*scrActions)["itemConvertToImageFrame"]->setMenuText(tr("&Image Frame"));
813
        (*scrActions)["itemConvertToOutlines"]->setMenuText(tr("&Outlines"));
814
        (*scrActions)["itemConvertToPolygon"]->setMenuText(tr("&Polygon"));
815
        (*scrActions)["itemConvertToTextFrame"]->setMenuText(tr("&Text Frame"));
816
 
817
        //Insert Menu
818
        (*scrActions)["insertGlyph"]->setMenuText(tr("&Glyph..."));
819
        (*scrActions)["insertSampleText"]->setMenuText(tr("Sample Text"));
820
 
821
        //Page menu
822
        (*scrActions)["pageInsert"]->setMenuText(tr("&Insert..."));
823
        (*scrActions)["pageImport"]->setMenuText(tr("Im&port..."));
824
        (*scrActions)["pageDelete"]->setMenuText(tr("&Delete..."));
825
        (*scrActions)["pageCopy"]->setMenuText(tr("&Copy..."));
826
        (*scrActions)["pageMove"]->setMenuText(tr("&Move..."));
827
        (*scrActions)["pageApplyMasterPage"]->setMenuText(tr("&Apply Master Page..."));
828
        (*scrActions)["pageManageGuides"]->setMenuText(tr("Manage &Guides..."));
829
 
830
        //View Menu
831
        (*scrActions)["viewFitInWindow"]->setMenuText(tr("&Fit in window"));
832
        (*scrActions)["viewFit50"]->setMenuText(tr("&50%"));
833
        (*scrActions)["viewFit75"]->setMenuText(tr("&75%"));
834
        (*scrActions)["viewFit100"]->setMenuText(tr("&100%"));
835
        (*scrActions)["viewFit200"]->setMenuText(tr("&200%"));
836
        (*scrActions)["viewFit20"]->setMenuText(tr("&Thumbnails"));
837
        (*scrActions)["viewShowMargins"]->setMenuText(tr("Show &Margins"));
838
        (*scrActions)["viewShowFrames"]->setMenuText(tr("Show &Frames"));
839
        (*scrActions)["viewShowImages"]->setMenuText(tr("Show &Images"));
840
        (*scrActions)["viewShowGrid"]->setMenuText(tr("Show &Grid"));
841
        (*scrActions)["viewShowGuides"]->setMenuText(tr("Show G&uides"));
842
        (*scrActions)["viewShowBaseline"]->setMenuText(tr("Show &Baseline Grid"));
843
        (*scrActions)["viewShowTextChain"]->setMenuText(tr("Show &Text Chain"));
844
        (*scrActions)["viewSnapToGrid"]->setMenuText(tr("Sn&ap to Grid"));
845
        (*scrActions)["viewSnapToGuides"]->setMenuText(tr("Sna&p to Guides"));
846
//      (*scrActions)["viewNewView"]->setMenuText(tr("New View"));
847
 
848
        //Tool menu
849
        (*scrActions)["toolsProperties"]->setMenuText(tr("&Properties"));
850
        (*scrActions)["toolsOutline"]->setMenuText(tr("&Outline"));
851
        (*scrActions)["toolsScrapbook"]->setMenuText(tr("&Scrapbook"));
852
        (*scrActions)["toolsLayers"]->setMenuText(tr("&Layers"));
853
        (*scrActions)["toolsPages"]->setMenuText(tr("P&age Palette"));
854
        (*scrActions)["toolsBookmarks"]->setMenuText(tr("&Bookmarks"));
855
        (*scrActions)["toolsMeasurements"]->setMenuText(tr("&Measurements"));
856
        (*scrActions)["toolsActionHistory"]->setMenuText(tr("Action &History"));
857
        (*scrActions)["toolsPreflightVerifier"]->setMenuText(tr("Preflight &Verifier"));
858
        (*scrActions)["toolsToolbarTools"]->setMenuText(tr("&Tools"));
859
        (*scrActions)["toolsToolbarPDF"]->setMenuText(tr("P&DF Tools"));
860
 
861
        //toolbar only items
862
        (*scrActions)["toolsSelect"]->setMenuText(tr("Select Item"));
863
        (*scrActions)["toolsInsertTextFrame"]->setMenuText(tr("&Text Frame"));
864
        (*scrActions)["toolsInsertImageFrame"]->setMenuText(tr("&Image Frame"));
865
        (*scrActions)["toolsInsertTableFrame"]->setMenuText(tr("T&able"));
866
        (*scrActions)["toolsInsertShape"]->setMenuText(tr("&Shape"));
867
        (*scrActions)["toolsInsertPolygon"]->setMenuText(tr("&Polygon"));
868
        (*scrActions)["toolsInsertLine"]->setMenuText(tr("&Line"));
869
        (*scrActions)["toolsInsertBezier"]->setMenuText(tr("&Bezier Curve"));
870
        (*scrActions)["toolsInsertFreehandLine"]->setMenuText(tr("&Freehand Line"));
871
        (*scrActions)["toolsRotate"]->setMenuText(tr("Rotate Item"));
872
        (*scrActions)["toolsZoom"]->setMenuText(tr("Zoom in or out"));
873
        (*scrActions)["toolsZoomIn"]->setMenuText(tr("Zoom in"));
874
        (*scrActions)["toolsZoomOut"]->setMenuText(tr("Zoom out"));
875
        (*scrActions)["toolsEditContents"]->setMenuText(tr("Edit Contents of Frame"));
876
        (*scrActions)["toolsEditWithStoryEditor"]->setMenuText(tr("Text..."));
877
        (*scrActions)["toolsLinkTextFrame"]->setMenuText(tr("Link Text Frames"));
878
        (*scrActions)["toolsUnlinkTextFrame"]->setMenuText(tr("Unlink Text Frames"));
879
        (*scrActions)["toolsEyeDropper"]->setMenuText(tr("&Eye Dropper"));
880
        (*scrActions)["toolsCopyProperties"]->setMenuText(tr("Copy Item Properties"));
881
 
882
        (*scrActions)["toolsEditWithStoryEditor"]->setText(tr("Edit the text with the Story Editor"));
883
 
884
        (*scrActions)["toolsInsertTextFrame"]->setText(tr("Insert Text Frame"));
885
        (*scrActions)["toolsInsertImageFrame"]->setText(tr("Insert Image Frame"));
886
        (*scrActions)["toolsInsertTableFrame"]->setText(tr("Insert Table"));
887
        (*scrActions)["toolsInsertShape"]->setText(tr("Insert Shape"));
888
        (*scrActions)["toolsInsertPolygon"]->setText(tr("Insert Polygon"));
889
        (*scrActions)["toolsInsertLine"]->setText(tr("Insert Line"));
890
        (*scrActions)["toolsInsertBezier"]->setText(tr("Insert Bezier Curve"));
891
        (*scrActions)["toolsInsertFreehandLine"]->setText(tr("Insert Freehand Line"));
892
 
893
        //Extras Menu
894
        (*scrActions)["extrasManagePictures"]->setMenuText(tr("&Manage Pictures"));
895
        (*scrActions)["extrasHyphenateText"]->setMenuText(tr("&Hyphenate Text"));
896
        (*scrActions)["extrasGenerateTableOfContents"]->setMenuText(tr("&Generate Table Of Contents"));
897
 
898
        //Help Menu
899
        (*scrActions)["helpAboutScribus"]->setMenuText(tr("&About Scribus"));
900
        (*scrActions)["helpAboutQt"]->setMenuText(tr("About &Qt"));
901
        (*scrActions)["helpTooltips"]->setMenuText(tr("Toolti&ps"));
902
        (*scrActions)["helpManual"]->setMenuText(tr("Scribus &Manual..."));
903
 
904
 
905
        //typography
906
        (*scrActions)["specialSmartHyphen"]->setMenuText(tr("Smart &Hyphen"));
907
        (*scrActions)["specialNonBreakingSpace"]->setMenuText(tr("Non Breaking &Space"));
908
        (*scrActions)["specialPageNumber"]->setMenuText(tr("Page &Number"));
909
        (*scrActions)["specialCopyRight"]->setMenuText(tr("Copyright"));
910
        (*scrActions)["specialRegdTM"]->setMenuText(tr("Registered Trademark"));
911
        (*scrActions)["specialTM"]->setMenuText(tr("Trademark"));
912
        (*scrActions)["specialBullet"]->setMenuText(tr("Bullet"));
913
        (*scrActions)["specialDashEm"]->setMenuText(tr("Em Dash"));
914
        (*scrActions)["specialDashEn"]->setMenuText(tr("En Dash"));
915
        (*scrActions)["specialDashFigure"]->setMenuText(tr("Figure Dash"));
916
        (*scrActions)["specialDashQuotation"]->setMenuText(tr("Quotation Dash"));
917
 
918
        (*scrActions)["specialQuoteApostrophe"]->setMenuText(tr("Apostrophe"));
919
        (*scrActions)["specialQuoteStraight"]->setMenuText(tr("Straight Double"));
920
        (*scrActions)["specialQuoteSingleLeft"]->setMenuText(tr("Single Left"));
921
        (*scrActions)["specialQuoteSingleRight"]->setMenuText(tr("Single Right"));
922
        (*scrActions)["specialQuoteDoubleLeft"]->setMenuText(tr("Double Left"));
923
        (*scrActions)["specialQuoteDoubleRight"]->setMenuText(tr("Double Right"));
924
        (*scrActions)["specialQuoteSingleReversed"]->setMenuText(tr("Single Reversed"));
925
        (*scrActions)["specialQuoteDoubleReversed"]->setMenuText(tr("Double Reversed"));
926
        (*scrActions)["specialQuoteSingleLeftGuillemet"]->setMenuText(tr("Single Left Guillemet"));
927
        (*scrActions)["specialQuoteSingleRightGuillemet"]->setMenuText(tr("Single Right Guillemet"));
928
        (*scrActions)["specialQuoteDoubleLeftGuillemet"]->setMenuText(tr("Double Left Guillemet"));
929
        (*scrActions)["specialQuoteDoubleRightGuillemet"]->setMenuText(tr("Double Right Guillemet"));
930
        (*scrActions)["specialQuoteLowSingleComma"]->setMenuText(tr("Low Single Comma"));
931
        (*scrActions)["specialQuoteLowDoubleComma"]->setMenuText(tr("Low Double Comma"));
932
        (*scrActions)["specialQuoteDoubleTurnedComma"]->setMenuText(tr("Double Turned Comma"));
933
        (*scrActions)["specialQuoteCJKSingleLeft"]->setMenuText(tr("CJK Single Left"));
934
        (*scrActions)["specialQuoteCJKSingleRight"]->setMenuText(tr("CJK Single Right"));
935
        (*scrActions)["specialQuoteCJKDoubleLeft"]->setMenuText(tr("CJK Double Left"));
936
        (*scrActions)["specialQuoteCJKDoubleRight"]->setMenuText(tr("CJK Double Right"));
937
 
938
        (*scrActions)["specialSmartHyphen"]->setText("Insert Smart Hyphen");
939
        (*scrActions)["specialNonBreakingSpace"]->setText("Insert Non Breaking Space");
940
        (*scrActions)["specialPageNumber"]->setText("Insert Page Number");
941
 
942
        //GUI
943
        (*scrActions)["specialToggleAllPalettes"]->setMenuText(tr("Toggle Palettes"));
2178 cbradney 944
        (*scrActions)["specialToggleAllGuides"]->setMenuText(tr("Toggle Guides"));
945
 
946
        //qDebug(ScApp->pluginManager->pluginMap[7].name);
947
//      if ((ScrAction*)((*scrActions)["SaveAsDocumentTemplate"])!=NULL)
948
//              (*scrActions)["SaveAsDocumentTemplate"]->setMenuText(ScApp->pluginManager->pluginMap[7].name);
2161 cbradney 949
}