Subversion Repositories Scribus

Rev

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