Subversion Repositories Scribus

Rev

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

Rev Author Line No. Line
4430 cbradney 1
/*
2
For general Scribus (>=1.3.2) copyright and licensing information please refer
3
to the COPYING file provided with the program. Following this notice may exist
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
5
for which a new license (GPL+exception) is in place.
6
*/
1993 cbradney 7
/***************************************************************************
8
        begin                : Apr 2005
9
        copyright            : (C) 2005 by Craig Bradney
10
        email                : cbradney@zip.com.au
11
***************************************************************************/
12
 
13
/***************************************************************************
14
*                                                                         *
4026 craig 15
*   ScMW program is free software; you can redistribute it and/or modify  *
1993 cbradney 16
*   it under the terms of the GNU General Public License as published by  *
17
*   the Free Software Foundation; either version 2 of the License, or     *
18
*   (at your option) any later version.                                   *
19
*                                                                         *
20
***************************************************************************/
21
 
22
#include "actionmanager.h"
23
#include "actionmanager.moc"
24
 
25
#include "scribus.h"
4688 cbradney 26
#include "scribusdoc.h"
2026 cbradney 27
#include "scribusview.h"
3934 cbradney 28
#include "selection.h"
1993 cbradney 29
#include "undomanager.h"
3809 cbradney 30
#include "util.h"
1993 cbradney 31
 
2246 subik 32
ActionManager::ActionManager ( QObject * parent, const char * name ) : QObject ( parent, name )
1993 cbradney 33
{
4026 craig 34
        ScMW=(ScribusMainWindow *)parent;
35
        scrActions=&(ScMW->scrActions);
36
        scrActionGroups=&(ScMW->scrActionGroups);
1995 cbradney 37
        modeActionNames=new QStringList();
38
        nonEditActionNames=new QStringList();
39
        unicodeCharActionNames=new QStringList();
1993 cbradney 40
        undoManager = UndoManager::instance();
2246 subik 41
 
3580 avox 42
#ifdef Q_WS_MAC
43
        noIcon = loadIcon("noicon.xpm");
44
#endif
45
 
1993 cbradney 46
        createActions();
2161 cbradney 47
        languageChange();
1993 cbradney 48
}
49
 
50
void ActionManager::createActions()
51
{
52
        initFileMenuActions();
53
        initEditMenuActions();
54
        initStyleMenuActions();
55
        initItemMenuActions();
56
        initInsertMenuActions();
57
        initPageMenuActions();
58
        initViewMenuActions();
59
        initToolsMenuActions();
60
        initExtrasMenuActions();
61
        initWindowsMenuActions();
62
        initScriptMenuActions();
63
        initHelpMenuActions();
4557 cbradney 64
        initUnicodeActions(scrActions, ScMW, unicodeCharActionNames);
4881 cbradney 65
        enableUnicodeActions(scrActions, false);
1993 cbradney 66
        initSpecialActions();
67
}
68
 
69
void ActionManager::initFileMenuActions()
70
{
71
        //File Menu
4026 craig 72
        scrActions->insert("fileNew", new ScrAction(QIconSet(loadIcon("DateiNeu16.png"), loadIcon("DateiNeu.xpm")), "", CTRL+Key_N, ScMW, "fileNew"));
73
        scrActions->insert("fileOpen", new ScrAction(QIconSet(loadIcon("DateiOpen16.png"), loadIcon("DateiOpen.xpm")), "", CTRL+Key_O, ScMW, "fileOpen"));
74
        scrActions->insert("fileClose", new ScrAction(QIconSet(loadIcon("DateiClos16.png"), loadIcon("DateiClose.png")), "", CTRL+Key_W, ScMW, "fileClose"));
75
        scrActions->insert("fileSave", new ScrAction(QIconSet(loadIcon("DateiSave16.png"), loadIcon("DateiSave2.png")), "", CTRL+Key_S, ScMW, "fileSave"));
76
        scrActions->insert("fileSaveAs", new ScrAction(loadIcon("filesaveas.png"), "", CTRL+SHIFT+Key_S, ScMW, "fileSaveAs"));
77
        scrActions->insert("fileRevert", new ScrAction(loadIcon("revert.png"), "", QKeySequence(), ScMW, "fileRevert"));
78
        scrActions->insert("fileCollect", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "fileCollect"));
1993 cbradney 79
        //File Import Menu
4620 cbradney 80
        scrActions->insert("fileImportText", new ScrAction(QIconSet(noIcon),"", CTRL+Key_D, ScMW, "fileImportText"));
4026 craig 81
        scrActions->insert("fileImportAppendText", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "fileImportAppendText"));
4620 cbradney 82
        scrActions->insert("fileImportImage", new ScrAction(QIconSet(noIcon),"", CTRL+Key_D, ScMW, "fileImportImage"));
1993 cbradney 83
 
84
        //File Export Menu
4026 craig 85
        scrActions->insert("fileExportText", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "fileExportText"));
86
        scrActions->insert("fileExportAsEPS", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "fileExportAsEPS"));
87
        scrActions->insert("fileExportAsPDF", new ScrAction(loadIcon("acrobat.png"), "", QKeySequence(), ScMW, "fileExportAsPDF"));
1993 cbradney 88
        //Rest of File Menu
4026 craig 89
        scrActions->insert("fileDocSetup", new ScrAction(QPixmap(loadIcon("scribusdoc16.png")), "", 0, ScMW, "fileDocSetup"));
90
        scrActions->insert("filePrint", new ScrAction(QIconSet(loadIcon("DateiPrint16.png"), loadIcon("DateiPrint.xpm")), "", CTRL+Key_P, ScMW, "filePrint"));
91
        scrActions->insert("PrintPreview", new ScrAction(QIconSet(noIcon), "", CTRL+ALT+Key_P, ScMW, "PrintPreview"));
92
        scrActions->insert("fileQuit", new ScrAction(QPixmap(loadIcon("exit.png")), "", CTRL+Key_Q, ScMW, "fileQuit"));
1993 cbradney 93
 
94
        //Connect our signals and slots
95
        //File Menu
4026 craig 96
        connect( (*scrActions)["fileNew"], SIGNAL(activated()), ScMW, SLOT(slotFileNew()) );
97
        connect( (*scrActions)["fileOpen"], SIGNAL(activated()), ScMW, SLOT(slotDocOpen()) );
98
        connect( (*scrActions)["fileClose"], SIGNAL(activated()), ScMW, SLOT(slotFileClose()) );
99
        connect( (*scrActions)["filePrint"], SIGNAL(activated()), ScMW, SLOT(slotFilePrint()) );
100
        connect( (*scrActions)["PrintPreview"], SIGNAL(activated()), ScMW, SLOT(printPreview()) );
101
        connect( (*scrActions)["fileSave"], SIGNAL(activated()), ScMW, SLOT(slotFileSave()) );
102
        connect( (*scrActions)["fileSaveAs"], SIGNAL(activated()), ScMW, SLOT(slotFileSaveAs()) );
103
        connect( (*scrActions)["fileDocSetup"], SIGNAL(activated()), ScMW, SLOT(slotDocSetup()) );
104
        connect( (*scrActions)["fileRevert"], SIGNAL(activated()), ScMW, SLOT(slotFileRevert()) );
105
        connect( (*scrActions)["fileCollect"], SIGNAL(activated()), ScMW, SLOT(Collect()) );
106
        connect( (*scrActions)["fileQuit"], SIGNAL(activated()), ScMW, SLOT(slotFileQuit()) );
1993 cbradney 107
        //File Import Menu
4026 craig 108
        connect( (*scrActions)["fileImportText"], SIGNAL(activated()), ScMW, SLOT(slotGetContent()) );
109
        connect( (*scrActions)["fileImportAppendText"], SIGNAL(activated()), ScMW, SLOT(slotFileAppend()) );
110
        connect( (*scrActions)["fileImportImage"], SIGNAL(activated()), ScMW, SLOT(slotGetContent()) );
1993 cbradney 111
        //File Export Menu
4026 craig 112
        connect( (*scrActions)["fileExportText"], SIGNAL(activated()), ScMW, SLOT(SaveText()) );
113
        connect( (*scrActions)["fileExportAsEPS"], SIGNAL(activated()), ScMW, SLOT(SaveAsEps()) );
114
        connect( (*scrActions)["fileExportAsPDF"], SIGNAL(activated()), ScMW, SLOT(SaveAsPDF()) );
1993 cbradney 115
        //The rest are plugins
116
}
117
 
118
void ActionManager::initEditMenuActions()
119
{
120
        //Edit Menu
4026 craig 121
        scrActions->insert("editUndoAction", new ScrAction(ScrAction::DataInt, QIconSet(loadIcon("u_undo16.png"), loadIcon("u_undo.png")), "", CTRL+Key_Z, ScMW, "editUndoAction",1));
122
        scrActions->insert("editRedoAction", new ScrAction(ScrAction::DataInt, QIconSet(loadIcon("u_redo16.png"), loadIcon("u_redo.png")), "", CTRL+SHIFT+Key_Z, ScMW, "editRedoAction", 1));
123
        scrActions->insert("editActionMode", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "editActionMode"));
1993 cbradney 124
        (*scrActions)["editActionMode"]->setToggleAction(true);
4831 cbradney 125
 
4026 craig 126
        scrActions->insert("editCut", new ScrAction(QIconSet(loadIcon("editcut.png"), loadIcon("editcut22.png")), "", CTRL+Key_X, ScMW, "editCut"));
127
        scrActions->insert("editCopy", new ScrAction(QIconSet(loadIcon("editcopy.png"), loadIcon("editcopy.png")), "", CTRL+Key_C, ScMW, "editCopy"));
128
        scrActions->insert("editPaste", new ScrAction(QIconSet(loadIcon("editpaste.png"), loadIcon("editpaste.png")), "", CTRL+Key_V, ScMW, "editPaste"));
4579 cbradney 129
        scrActions->insert("editCopyContents", new ScrAction(QIconSet(loadIcon("editcopy.png"), loadIcon("editcopy.png")), "", CTRL+SHIFT+Key_C, ScMW, "editCopyContents"));
4831 cbradney 130
        scrActions->insert("editPasteContents", new ScrAction(ScrAction::DataInt, QIconSet(loadIcon("editpaste.png")), "", CTRL+SHIFT+Key_V, ScMW, "editPasteContents",0));
131
        scrActions->insert("editPasteContentsAbs", new ScrAction(ScrAction::DataInt, QIconSet(loadIcon("editpaste.png")), "", CTRL+SHIFT+ALT+Key_V, ScMW, "editPasteContentsAbs",1));
4026 craig 132
        scrActions->insert("editClearContents", new ScrAction(QIconSet(loadIcon("editdelete.png"), loadIcon("editdelete22.png")), "", QKeySequence(), ScMW, "editClearContents"));
4831 cbradney 133
 
4026 craig 134
        scrActions->insert("editSelectAll", new ScrAction(QIconSet(noIcon), "", CTRL+Key_A, ScMW, "editSelectAll"));
135
        scrActions->insert("editDeselectAll", new ScrAction(QIconSet(noIcon), "", CTRL+SHIFT+Key_A, ScMW, "editDeselectAll"));
136
        scrActions->insert("editSearchReplace", new ScrAction(QIconSet(loadIcon("find16.png"), loadIcon("find16.png")), "", QKeySequence(CTRL+Key_F), ScMW, "editSearchReplace"));
2264 subik 137
 
4026 craig 138
        scrActions->insert("editEditWithImageEditor", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "editEditWithImageEditor"));
1993 cbradney 139
 
4026 craig 140
        scrActions->insert("editColors", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "editColors"));
4829 tsoots 141
        scrActions->insert("editStyles", new ScrAction(QIconSet(noIcon), "", QKeySequence(), ScMW, "editStyles"));
4026 craig 142
        scrActions->insert("editParaStyles", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "editParaStyles"));
143
        scrActions->insert("editLineStyles", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "editLineStyles"));
144
        scrActions->insert("editMasterPages", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "editMasterPages"));
145
        scrActions->insert("editJavascripts", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "editJavascripts"));
146
        scrActions->insert("editPreferences", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "editPreferences"));
1993 cbradney 147
 
4829 tsoots 148
        (*scrActions)["editStyles"]->setToggleAction(true);
149
 
1993 cbradney 150
        connect( (*scrActions)["editUndoAction"], SIGNAL(activatedData(int)) , undoManager, SLOT(undo(int)) );
151
        connect( (*scrActions)["editRedoAction"], SIGNAL(activatedData(int)) , undoManager, SLOT(redo(int)) );
4026 craig 152
        connect( (*scrActions)["editActionMode"], SIGNAL(toggled(bool)), ScMW, SLOT(setUndoMode(bool)) );
153
        connect( (*scrActions)["editCut"], SIGNAL(activated()), ScMW, SLOT(slotEditCut()) );
154
        connect( (*scrActions)["editCopy"], SIGNAL(activated()), ScMW, SLOT(slotEditCopy()) );
155
        connect( (*scrActions)["editPaste"], SIGNAL(activated()), ScMW, SLOT(slotEditPaste()) );
4579 cbradney 156
        connect( (*scrActions)["editCopyContents"], SIGNAL(activated()), ScMW, SLOT(slotEditCopyContents()) );
4831 cbradney 157
        connect( (*scrActions)["editPasteContents"], SIGNAL(activatedData(int)), ScMW, SLOT(slotEditPasteContents(int)) );
158
        connect( (*scrActions)["editPasteContentsAbs"], SIGNAL(activatedData(int)), ScMW, SLOT(slotEditPasteContents(int)) );
4026 craig 159
        connect( (*scrActions)["editSelectAll"], SIGNAL(activated()), ScMW, SLOT(SelectAll()) );
160
        connect( (*scrActions)["editDeselectAll"], SIGNAL(activated()), ScMW, SLOT(deselectAll()) );
161
        connect( (*scrActions)["editSearchReplace"], SIGNAL(activated()), ScMW, SLOT(SearchText()) );
162
        connect( (*scrActions)["editEditWithImageEditor"], SIGNAL(activated()), ScMW, SLOT(callImageEditor()) );
163
        connect( (*scrActions)["editColors"], SIGNAL(activated()), ScMW, SLOT(slotEditColors()) );
4829 tsoots 164
        connect( (*scrActions)["editStyles"], SIGNAL(activated()), ScMW, SLOT(slotStyleManager()) );
4026 craig 165
        connect( (*scrActions)["editParaStyles"], SIGNAL(activated()), ScMW, SLOT(slotEditStyles()) );
166
        connect( (*scrActions)["editLineStyles"], SIGNAL(activated()), ScMW, SLOT(slotEditLineStyles()) );
167
        connect( (*scrActions)["editMasterPages"], SIGNAL(activated()), ScMW, SLOT(manageMasterPages()) );
168
        connect( (*scrActions)["editJavascripts"], SIGNAL(activated()), ScMW, SLOT(ManageJava()) );
169
        connect( (*scrActions)["editPreferences"], SIGNAL(activated()), ScMW, SLOT(slotPrefsOrg()) );
1993 cbradney 170
}
171
 
172
void ActionManager::initStyleMenuActions()
173
{
174
        //Text Size actions
4026 craig 175
        (*scrActionGroups).insert("fontSize", new QActionGroup(ScMW, "fontSize", true));
2170 cbradney 176
        scrActions->insert("fontSizeOther", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), (*scrActionGroups)["fontSize"], "fontSizeOther", -1));
4026 craig 177
        connect( (*scrActions)["fontSizeOther"], SIGNAL(activatedData(int)), ScMW, SLOT(setItemFSize(int)));
1993 cbradney 178
 
179
        int font_sizes[] = {7, 9, 10, 11, 12, 14, 18, 24, 36, 48, 60, 72};
180
        size_t f_size = sizeof(font_sizes) / sizeof(*font_sizes);
181
        for (uint s = 0; s < f_size; ++s)
182
        {
183
                QString fontSizeName=QString("fontSize%1").arg(font_sizes[s]);
2170 cbradney 184
                scrActions->insert(fontSizeName, new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), (*scrActionGroups)["fontSize"], fontSizeName, font_sizes[s]));
1993 cbradney 185
                (*scrActions)[fontSizeName]->setToggleAction(true);
4026 craig 186
                connect( (*scrActions)[fontSizeName], SIGNAL(activatedData(int)), ScMW, SLOT(setItemFSize(int)));
1993 cbradney 187
        }
188
 
189
        //Alignment actions
4026 craig 190
        scrActions->insert("alignLeft", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), ScMW, "alignLeft", 0));
191
        scrActions->insert("alignCenter", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), ScMW, "alignCenter", 1));
192
        scrActions->insert("alignRight", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), ScMW, "alignRight", 2));
193
        scrActions->insert("alignBlock", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), ScMW, "alignBlock", 3));
194
        scrActions->insert("alignForced", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), ScMW, "alignForced", 4));
1993 cbradney 195
 
196
        (*scrActions)["alignLeft"]->setToggleAction(true);
197
        (*scrActions)["alignCenter"]->setToggleAction(true);
198
        (*scrActions)["alignRight"]->setToggleAction(true);
199
        (*scrActions)["alignBlock"]->setToggleAction(true);
200
        (*scrActions)["alignForced"]->setToggleAction(true);
201
 
4026 craig 202
        connect( (*scrActions)["alignLeft"], SIGNAL(activatedData(int)), ScMW, SLOT(setNewAbStyle(int)));
203
        connect( (*scrActions)["alignCenter"], SIGNAL(activatedData(int)), ScMW, SLOT(setNewAbStyle(int)));
204
        connect( (*scrActions)["alignRight"], SIGNAL(activatedData(int)), ScMW, SLOT(setNewAbStyle(int)));
205
        connect( (*scrActions)["alignBlock"], SIGNAL(activatedData(int)), ScMW, SLOT(setNewAbStyle(int)));
206
        connect( (*scrActions)["alignForced"], SIGNAL(activatedData(int)), ScMW, SLOT(setNewAbStyle(int)));
1993 cbradney 207
 
208
        //Shade actions
4026 craig 209
        scrActionGroups->insert("shade", new QActionGroup(ScMW, "shade", true));
2170 cbradney 210
        scrActions->insert("shadeOther", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), (*scrActionGroups)["shade"], "shadeOther", -1));
4026 craig 211
        connect( (*scrActions)["shadeOther"], SIGNAL(activatedData(int)), ScMW, SLOT(setItemShade(int)));
1993 cbradney 212
        for (uint i=0; i<=100 ; i+=10)
213
        {
214
                QString shadeName=QString("shade%1").arg(i);
2170 cbradney 215
                scrActions->insert(shadeName, new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), (*scrActionGroups)["shade"], shadeName, i));
1993 cbradney 216
                (*scrActions)[shadeName]->setToggleAction(true);
4026 craig 217
                connect( (*scrActions)[shadeName], SIGNAL(activatedData(int)), ScMW, SLOT(setItemShade(int)));
1993 cbradney 218
        }
219
 
220
        //Type Effects actions
4026 craig 221
        scrActionGroups->insert("typeEffects", new QActionGroup(ScMW, "typeEffects", false));
2186 cbradney 222
        scrActions->insert("typeEffectNormal", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), (*scrActionGroups)["typeEffects"], "typeEffectNormal", 0));
223
        scrActions->insert("typeEffectUnderline", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), (*scrActionGroups)["typeEffects"], "typeEffectUnderline", 1));
2188 fschmid 224
        scrActions->insert("typeEffectUnderlineWords", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), (*scrActionGroups)["typeEffects"], "typeEffectUnderlineWords", 8));
2186 cbradney 225
        scrActions->insert("typeEffectStrikeThrough", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), (*scrActionGroups)["typeEffects"], "typeEffectStrikeThrough", 2));
226
        scrActions->insert("typeEffectAllCaps", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), (*scrActionGroups)["typeEffects"], "typeEffectAllCaps", 7));
227
        scrActions->insert("typeEffectSmallCaps", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), (*scrActionGroups)["typeEffects"], "typeEffectSmallCaps", 3));
228
        scrActions->insert("typeEffectSuperscript", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), (*scrActionGroups)["typeEffects"], "typeEffectSuperscript", 4));
229
        scrActions->insert("typeEffectSubscript", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), (*scrActionGroups)["typeEffects"], "typeEffectSubscript", 5));
230
        scrActions->insert("typeEffectOutline", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), (*scrActionGroups)["typeEffects"], "typeEffectOutline", 6));
2229 fschmid 231
        scrActions->insert("typeEffectShadow", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), (*scrActionGroups)["typeEffects"], "typeEffectShadow", 9));
1993 cbradney 232
        (*scrActions)["typeEffectNormal"]->setToggleAction(true);
233
        (*scrActions)["typeEffectUnderline"]->setToggleAction(true);
2188 fschmid 234
        (*scrActions)["typeEffectUnderlineWords"]->setToggleAction(true);
1993 cbradney 235
        (*scrActions)["typeEffectStrikeThrough"]->setToggleAction(true);
2185 fschmid 236
        (*scrActions)["typeEffectAllCaps"]->setToggleAction(true);
1993 cbradney 237
        (*scrActions)["typeEffectSmallCaps"]->setToggleAction(true);
238
        (*scrActions)["typeEffectSuperscript"]->setToggleAction(true);
239
        (*scrActions)["typeEffectSubscript"]->setToggleAction(true);
240
        (*scrActions)["typeEffectOutline"]->setToggleAction(true);
2229 fschmid 241
        (*scrActions)["typeEffectShadow"]->setToggleAction(true);
4026 craig 242
        connect( (*scrActions)["typeEffectNormal"], SIGNAL(activatedData(int)), ScMW, SLOT(setItemTypeStyle(int)));
243
        connect( (*scrActions)["typeEffectUnderline"], SIGNAL(activatedData(int)), ScMW, SLOT(setItemTypeStyle(int)));
244
        connect( (*scrActions)["typeEffectUnderlineWords"], SIGNAL(activatedData(int)), ScMW, SLOT(setItemTypeStyle(int)));
245
        connect( (*scrActions)["typeEffectStrikeThrough"], SIGNAL(activatedData(int)), ScMW, SLOT(setItemTypeStyle(int)));
246
        connect( (*scrActions)["typeEffectSmallCaps"], SIGNAL(activatedData(int)), ScMW, SLOT(setItemTypeStyle(int)));
247
        connect( (*scrActions)["typeEffectAllCaps"], SIGNAL(activatedData(int)), ScMW, SLOT(setItemTypeStyle(int)));
248
        connect( (*scrActions)["typeEffectSuperscript"], SIGNAL(activatedData(int)), ScMW, SLOT(setItemTypeStyle(int)));
249
        connect( (*scrActions)["typeEffectSubscript"], SIGNAL(activatedData(int)), ScMW, SLOT(setItemTypeStyle(int)));
250
        connect( (*scrActions)["typeEffectOutline"], SIGNAL(activatedData(int)), ScMW, SLOT(setItemTypeStyle(int)));
251
        connect( (*scrActions)["typeEffectShadow"], SIGNAL(activatedData(int)), ScMW, SLOT(setItemTypeStyle(int)));
1993 cbradney 252
 
253
        //Other Style menu items that get added in various places
4572 cbradney 254
        scrActions->insert("styleImageEffects", new ScrAction("", CTRL+Key_E, ScMW, "styleImageEffects"));
4026 craig 255
        scrActions->insert("styleTabulators", new ScrAction(ScMW, "styleTabulators"));
4572 cbradney 256
        connect( (*scrActions)["styleImageEffects"], SIGNAL(activated()), ScMW, SLOT(ImageEffects()));
4026 craig 257
        connect( (*scrActions)["styleTabulators"], SIGNAL(activated()), ScMW, SLOT(EditTabs()));
1993 cbradney 258
 
259
}
260
 
261
void ActionManager::initItemMenuActions()
262
{
263
        //Item Menu
4620 cbradney 264
        scrActions->insert("itemDuplicate", new ScrAction("", CTRL+ALT+SHIFT+Key_D, ScMW, "itemDuplicate"));
4026 craig 265
        scrActions->insert("itemMulDuplicate", new ScrAction(ScMW, "itemMulDuplicate"));
266
        scrActions->insert("itemDelete", new ScrAction("", CTRL+Key_K, ScMW, "itemDelete"));
267
        scrActions->insert("itemGroup", new ScrAction("", CTRL+Key_G, ScMW, "itemGroup"));
4620 cbradney 268
        scrActions->insert("itemUngroup", new ScrAction("", CTRL+SHIFT+Key_G, ScMW, "itemUngroup"));
4026 craig 269
        scrActions->insert("itemLock", new ScrAction("", CTRL+Key_L, ScMW, "itemLock"));
270
        scrActions->insert("itemLockSize", new ScrAction("", CTRL+SHIFT+Key_L, ScMW, "itemLockSize"));
4698 cbradney 271
        scrActions->insert("itemPrintingEnabled", new ScrAction("", QKeySequence(), ScMW, "itemPrintingEnabled"));
4699 cbradney 272
        scrActions->insert("itemFlipH", new ScrAction("", QKeySequence(), ScMW, "itemFlipH"));
273
        scrActions->insert("itemFlipV", new ScrAction("", QKeySequence(), ScMW, "itemFlipV"));
4695 cbradney 274
        (*scrActions)["itemLock"]->setToggleAction(true, true);
275
        (*scrActions)["itemLockSize"]->setToggleAction(true, true);
4698 cbradney 276
        (*scrActions)["itemPrintingEnabled"]->setToggleAction(true, true);
4699 cbradney 277
        (*scrActions)["itemFlipH"]->setToggleAction(true, true);
278
        (*scrActions)["itemFlipV"]->setToggleAction(true, true);
4026 craig 279
        scrActions->insert("itemLowerToBottom", new ScrAction(QIconSet(loadIcon("lower-to-bottom.png"), loadIcon("lower-to-bottom.png")), "", QKeySequence(Key_End), ScMW, "itemLowerToBottom"));
280
        scrActions->insert("itemRaiseToTop", new ScrAction(QIconSet(loadIcon("raise-to-top.png"), loadIcon("raise-to-top.png")), "", QKeySequence(Key_Home), ScMW, "itemRaiseToTop"));
281
        scrActions->insert("itemLower", new ScrAction(QIconSet(loadIcon("lower.png"), loadIcon("lower.png")), "", QKeySequence(CTRL+Key_End), ScMW, "itemLower"));
282
        scrActions->insert("itemRaise", new ScrAction(QIconSet(loadIcon("raise.png"), loadIcon("raise.png")), "", QKeySequence(CTRL+Key_Home), ScMW, "itemRaise"));
2355 cbradney 283
 
4026 craig 284
        scrActions->insert("itemSendToScrapbook", new ScrAction(ScMW, "itemSendToScrapbook"));
2246 subik 285
 
4026 craig 286
        scrActions->insert("itemImageInfo", new ScrAction(ScMW, "itemImageInfo"));
287
        scrActions->insert("itemAttributes", new ScrAction(ScMW, "itemAttributes"));
288
        scrActions->insert("itemImageIsVisible", new ScrAction(ScMW, "itemImageIsVisible"));
289
        scrActions->insert("itemUpdateImage", new ScrAction(ScMW, "itemUpdateImage"));
290
        scrActions->insert("itemAdjustFrameToImage", new ScrAction(ScMW, "itemAdjustFrameToImage"));
291
        scrActions->insert("itemExtendedImageProperties", new ScrAction(ScMW, "itemExtendedImageProperties"));
292
        scrActions->insert("itemPreviewLow", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), ScMW, "itemPreviewLow", 2));
293
        scrActions->insert("itemPreviewNormal", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), ScMW, "itemPreviewNormal", 1));
294
        scrActions->insert("itemPreviewFull", new ScrAction(ScrAction::DataInt, QIconSet(), "", QKeySequence(), ScMW, "itemPreviewFull", 0));
295
        scrActions->insert("itemPDFIsBookmark", new ScrAction(ScMW, "itemPDFIsBookmark"));
1993 cbradney 296
        (*scrActions)["itemPDFIsBookmark"]->setToggleAction(true);
4026 craig 297
        scrActions->insert("itemPDFIsAnnotation", new ScrAction(ScMW, "itemPDFIsAnnotation"));
1993 cbradney 298
        (*scrActions)["itemPDFIsAnnotation"]->setToggleAction(true);
4026 craig 299
        scrActions->insert("itemPDFAnnotationProps", new ScrAction(ScMW, "itemPDFAnnotationProps"));
300
        scrActions->insert("itemPDFFieldProps", new ScrAction(ScMW, "itemPDFFieldProps"));
2246 subik 301
 
1993 cbradney 302
        (*scrActions)["itemPDFIsBookmark"]->setEnabled(false);
303
        (*scrActions)["itemPDFIsAnnotation"]->setEnabled(false);
304
        (*scrActions)["itemPDFAnnotationProps"]->setEnabled(false);
305
        (*scrActions)["itemPDFFieldProps"]->setEnabled(false);
2246 subik 306
 
2026 cbradney 307
        (*scrActions)["itemImageIsVisible"]->setToggleAction(true);
2256 cbradney 308
        (*scrActions)["itemPreviewLow"]->setToggleAction(true);
309
        (*scrActions)["itemPreviewNormal"]->setToggleAction(true);
310
        (*scrActions)["itemPreviewFull"]->setToggleAction(true);
2246 subik 311
 
4026 craig 312
        scrActions->insert("itemShapeEdit", new ScrAction(ScMW, "itemShapeEdit"));
1993 cbradney 313
        (*scrActions)["itemShapeEdit"]->setToggleAction(true);
4026 craig 314
        scrActions->insert("itemAttachTextToPath", new ScrAction(ScMW, "itemAttachTextToPath"));
315
        scrActions->insert("itemDetachTextFromPath", new ScrAction(ScMW, "itemDetachTextFromPath"));
316
        scrActions->insert("itemCombinePolygons", new ScrAction(ScMW, "itemCombinePolygons"));
317
        scrActions->insert("itemSplitPolygons", new ScrAction(ScMW, "itemSplitPolygons"));
318
        scrActions->insert("itemConvertToBezierCurve", new ScrAction(ScMW, "itemConvertToBezierCurve"));
319
        scrActions->insert("itemConvertToImageFrame", new ScrAction(ScMW, "itemConvertToImageFrame"));
320
        scrActions->insert("itemConvertToOutlines", new ScrAction(ScMW, "itemConvertToOutlines"));
321
        scrActions->insert("itemConvertToPolygon", new ScrAction(ScMW, "itemConvertToPolygon"));
322
        scrActions->insert("itemConvertToTextFrame", new ScrAction(ScMW, "itemConvertToTextFrame"));
1993 cbradney 323
 
4026 craig 324
        connect( (*scrActions)["itemDuplicate"], SIGNAL(activated()), ScMW, SLOT(ObjektDup()) );
325
        connect( (*scrActions)["itemMulDuplicate"], SIGNAL(activated()), ScMW, SLOT(ObjektDupM()) );
326
        connect( (*scrActions)["itemGroup"], SIGNAL(activated()), ScMW, SLOT(GroupObj()) );
327
        connect( (*scrActions)["itemUngroup"], SIGNAL(activated()), ScMW, SLOT(UnGroupObj()) );
328
        connect( (*scrActions)["itemPDFAnnotationProps"], SIGNAL(activated()), ScMW, SLOT(ModifyAnnot()) );
329
        connect( (*scrActions)["itemPDFFieldProps"], SIGNAL(activated()), ScMW, SLOT(ModifyAnnot()) );
330
        connect( (*scrActions)["itemSendToScrapbook"], SIGNAL(activated()), ScMW, SLOT(PutScrap()) );
331
        connect( (*scrActions)["itemAttributes"], SIGNAL(activated()), ScMW, SLOT(objectAttributes()) );
332
        connect( (*scrActions)["itemShapeEdit"], SIGNAL(activated()), ScMW, SLOT(ToggleFrameEdit()) );
333
        connect( (*scrActions)["itemImageInfo"], SIGNAL(activated()), ScMW, SLOT(getImageInfo()) );
1993 cbradney 334
}
335
 
336
void ActionManager::initInsertMenuActions()
337
{
338
        //Insert Menu
4026 craig 339
        scrActions->insert("insertGlyph", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "insertGlyph"));
340
        scrActions->insert("insertSampleText", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "insertSampleText"));
2246 subik 341
 
4026 craig 342
        connect( (*scrActions)["insertGlyph"], SIGNAL(activated()), ScMW, SLOT(slotCharSelect()) );
343
        connect( (*scrActions)["insertSampleText"], SIGNAL(activated()), ScMW, SLOT(insertSampleText()) );
1993 cbradney 344
}
345
 
346
void ActionManager::initPageMenuActions()
347
{
348
        //Page menu
4026 craig 349
        scrActions->insert("pageInsert", new ScrAction(ScMW, "pageInsert"));
350
        scrActions->insert("pageImport", new ScrAction(ScMW, "pageImport"));
351
        scrActions->insert("pageDelete", new ScrAction(ScMW, "pageDelete"));
352
        scrActions->insert("pageCopy", new ScrAction(ScMW, "pageCopy"));
353
        scrActions->insert("pageMove", new ScrAction(ScMW, "pageMove"));
354
        scrActions->insert("pageApplyMasterPage", new ScrAction(ScMW, "pageApplyMasterPage"));
355
        scrActions->insert("pageCopyToMasterPage", new ScrAction(ScMW, "pageCopyToMasterPage"));
356
        scrActions->insert("pageManageGuides", new ScrAction(ScMW, "pageManageGuides"));
357
        scrActions->insert("pageManageMargins", new ScrAction(ScMW, "pageManageMargins"));
1993 cbradney 358
 
4026 craig 359
        connect( (*scrActions)["pageInsert"], SIGNAL(activated()), ScMW, SLOT(slotNewPageM()) );
360
        connect( (*scrActions)["pageImport"], SIGNAL(activated()), ScMW, SLOT(slotPageImport()) );
361
        connect( (*scrActions)["pageDelete"], SIGNAL(activated()), ScMW, SLOT(DeletePage()) );
362
        connect( (*scrActions)["pageCopy"], SIGNAL(activated()), ScMW, SLOT(CopyPage()) );
363
        connect( (*scrActions)["pageMove"], SIGNAL(activated()), ScMW, SLOT(MovePage()) );
364
        connect( (*scrActions)["pageApplyMasterPage"], SIGNAL(activated()), ScMW, SLOT(ApplyMasterPage()) );
365
        connect( (*scrActions)["pageCopyToMasterPage"], SIGNAL(activated()), ScMW, SLOT(duplicateToMasterPage()) );
366
        connect( (*scrActions)["pageManageGuides"], SIGNAL(activated()), ScMW, SLOT(ManageGuides()) );
367
        connect( (*scrActions)["pageManageMargins"], SIGNAL(activated()), ScMW, SLOT(changePageMargins()) );
1993 cbradney 368
}
369
 
370
void ActionManager::initViewMenuActions()
371
{
4026 craig 372
        scrActions->insert("viewFitInWindow", new ScrAction(ScrAction::DataDouble, QIconSet(), "", CTRL+Key_0, ScMW, "viewFitInWindow", 0, -100.0));
373
        scrActions->insert("viewFit50", new ScrAction(ScrAction::DataDouble, QIconSet(), "", QKeySequence(), ScMW, "viewFit50", 0, 50.0));
374
        scrActions->insert("viewFit75", new ScrAction(ScrAction::DataDouble, QIconSet(), "", QKeySequence(), ScMW, "viewFit75", 0, 75.0));
375
        scrActions->insert("viewFit100", new ScrAction(ScrAction::DataDouble, QIconSet(), "", CTRL+Key_1, ScMW, "viewFit100", 0, 100.0));
376
        scrActions->insert("viewFit200", new ScrAction(ScrAction::DataDouble, QIconSet(), "", QKeySequence(), ScMW, "viewFit200", 0, 200.0));
377
        scrActions->insert("viewFit20", new ScrAction(ScrAction::DataDouble, QIconSet(), "", QKeySequence(), ScMW, "viewFit20", 0, 20.0));
378
        scrActions->insert("viewShowMargins", new ScrAction(ScMW, "viewShowMargins"));
379
        scrActions->insert("viewShowFrames", new ScrAction(ScMW, "viewShowFrames"));
380
        scrActions->insert("viewShowImages", new ScrAction(ScMW, "viewShowImages"));
381
        scrActions->insert("viewShowGrid", new ScrAction(ScMW, "viewShowGrid"));
382
        scrActions->insert("viewShowGuides", new ScrAction(ScMW, "viewShowGuides"));
383
        scrActions->insert("viewShowBaseline", new ScrAction(ScMW, "viewShowBaseline"));
384
        scrActions->insert("viewShowTextChain", new ScrAction(ScMW, "viewShowTextChain"));
385
        scrActions->insert("viewShowTextControls", new ScrAction(ScMW, "viewShowTextControls"));
4651 cbradney 386
        scrActions->insert("viewShowRulers", new ScrAction("", CTRL+SHIFT+Key_R, ScMW, "viewShowRulers"));
4026 craig 387
        scrActions->insert("viewRulerMode", new ScrAction(ScMW, "viewRulerMode"));
388
        scrActions->insert("viewSnapToGrid", new ScrAction(ScMW, "viewSnapToGrid"));
389
        scrActions->insert("viewSnapToGuides", new ScrAction(ScMW, "viewSnapToGuides"));
390
//      scrActions->insert("viewNewView", new ScrAction(ScMW, "viewNewView"));
1993 cbradney 391
 
392
        (*scrActions)["viewShowMargins"]->setToggleAction(true);
393
        (*scrActions)["viewShowFrames"]->setToggleAction(true);
394
        (*scrActions)["viewShowImages"]->setToggleAction(true);
395
        (*scrActions)["viewShowGrid"]->setToggleAction(true);
396
        (*scrActions)["viewShowGuides"]->setToggleAction(true);
397
        (*scrActions)["viewShowBaseline"]->setToggleAction(true);
398
        (*scrActions)["viewShowTextChain"]->setToggleAction(true);
2353 fschmid 399
        (*scrActions)["viewShowTextControls"]->setToggleAction(true);
4651 cbradney 400
        (*scrActions)["viewShowRulers"]->setToggleAction(true);
2863 fschmid 401
        (*scrActions)["viewRulerMode"]->setToggleAction(true);
1993 cbradney 402
        (*scrActions)["viewSnapToGrid"]->setToggleAction(true);
403
        (*scrActions)["viewSnapToGuides"]->setToggleAction(true);
404
 
405
        (*scrActions)["viewShowMargins"]->setOn(true);
406
        (*scrActions)["viewShowFrames"]->setOn(true);
407
        (*scrActions)["viewShowImages"]->setOn(true);
408
        (*scrActions)["viewShowGuides"]->setOn(true);
4651 cbradney 409
        (*scrActions)["viewShowRulers"]->setOn(true);
2863 fschmid 410
        (*scrActions)["viewRulerMode"]->setOn(true);
1993 cbradney 411
 
4026 craig 412
        connect( (*scrActions)["viewFitInWindow"], SIGNAL(activatedData(double)), ScMW, SLOT(slotZoom(double)) );
413
        connect( (*scrActions)["viewFit50"], SIGNAL(activatedData(double)), ScMW, SLOT(slotZoom(double)) );
414
        connect( (*scrActions)["viewFit75"], SIGNAL(activatedData(double)), ScMW, SLOT(slotZoom(double)) );
415
        connect( (*scrActions)["viewFit100"], SIGNAL(activatedData(double)), ScMW, SLOT(slotZoom(double)) );
416
        connect( (*scrActions)["viewFit200"], SIGNAL(activatedData(double)), ScMW, SLOT(slotZoom(double)) );
417
        connect( (*scrActions)["viewFit20"], SIGNAL(activatedData(double)), ScMW, SLOT(slotZoom(double)) );
418
        connect( (*scrActions)["viewShowMargins"], SIGNAL(activated()), ScMW, SLOT(ToggleMarks()) );
419
        connect( (*scrActions)["viewShowFrames"], SIGNAL(activated()), ScMW, SLOT(ToggleFrames()) );
420
        connect( (*scrActions)["viewShowImages"], SIGNAL(activated()), ScMW, SLOT(TogglePics()) );
421
        connect( (*scrActions)["viewShowGrid"], SIGNAL(activated()), ScMW, SLOT(ToggleRaster()) );
422
        connect( (*scrActions)["viewShowGuides"], SIGNAL(activated()), ScMW, SLOT(ToggleGuides()) );
423
        connect( (*scrActions)["viewShowBaseline"], SIGNAL(activated()), ScMW, SLOT(ToggleBase()) );
424
        connect( (*scrActions)["viewShowTextChain"], SIGNAL(activated()), ScMW, SLOT(ToggleTextLinks()) );
425
        connect( (*scrActions)["viewShowTextControls"], SIGNAL(activated()), ScMW, SLOT(ToggleTextControls()) );
4651 cbradney 426
        connect( (*scrActions)["viewShowRulers"], SIGNAL(activated()), ScMW, SLOT(ToggleRulers()) );
427
        connect( (*scrActions)["viewRulerMode"], SIGNAL(activated()), ScMW, SLOT(ToggleRulerMode()) );
4026 craig 428
        connect( (*scrActions)["viewSnapToGrid"], SIGNAL(activated()), ScMW, SLOT(ToggleURaster()) );
429
        connect( (*scrActions)["viewSnapToGuides"], SIGNAL(activated()), ScMW, SLOT(ToggleUGuides()) );
430
//      connect( (*scrActions)["viewNewView"], SIGNAL(activated()), ScMW, SLOT(newView()) );
1993 cbradney 431
 
432
}
433
 
434
void ActionManager::initToolsMenuActions()
435
{
436
        //Tool menu
4781 cbradney 437
        scrActions->insert("toolsProperties", new ScrAction(QIconSet(noIcon),"", Key_F2, ScMW, "toolsProperties"));
4026 craig 438
        scrActions->insert("toolsOutline", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "toolsOutline"));
439
        scrActions->insert("toolsScrapbook", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "toolsScrapbook"));
440
        scrActions->insert("toolsLayers", new ScrAction(QIconSet(noIcon),"", QKeySequence(Key_F6), ScMW, "toolsLayers"));
441
        scrActions->insert("toolsPages", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "toolsPages"));
442
        scrActions->insert("toolsBookmarks", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "toolsBookmarks"));
443
        scrActions->insert("toolsMeasurements", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("dist.png"), loadIcon("dist22.png")), "", QKeySequence(), ScMW, "toolsMeasurements", modeMeasurementTool));
444
        scrActions->insert("toolsActionHistory", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "toolsActionHistory"));
445
        scrActions->insert("toolsPreflightVerifier", new ScrAction(QIconSet(loadIcon("launch16.png"), loadIcon("launch.png")),"", QKeySequence(), ScMW, "toolsPreflightVerifier"));
446
        scrActions->insert("toolsAlignDistribute", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "toolsAlignDistribute"));
447
        scrActions->insert("toolsToolbarTools", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "toolsToolbarTools"));
448
        scrActions->insert("toolsToolbarPDF", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "toolsToolbarPDF"));
2246 subik 449
 
1993 cbradney 450
        //toolbar only items
4026 craig 451
        scrActions->insert("toolsSelect", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Kreuz.xpm"), loadIcon("Kreuz.xpm")), "", QKeySequence(Key_C), ScMW, "toolsSelect", modeNormal));
452
        scrActions->insert("toolsInsertTextFrame", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Text16.xpm"), loadIcon("Text.xpm")), "", QKeySequence(Key_T), ScMW, "toolsInsertTextFrame", modeDrawText));
453
        scrActions->insert("toolsInsertImageFrame", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Bild16.xpm"), loadIcon("Bild.xpm")), "", QKeySequence(Key_I), ScMW, "toolsInsertImageFrame", modeDrawPicture));
454
        scrActions->insert("toolsInsertTableFrame", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("frame_table16.png"), loadIcon("frame_table.png")), "", QKeySequence(Key_A), ScMW, "toolsInsertTableFrame", modeDrawTable));
455
        scrActions->insert("toolsInsertShape", new ScrAction(ScrAction::DataInt,QIconSet(), "", QKeySequence(Key_S), ScMW, "toolsInsertShape", modeDrawShapes));
456
        scrActions->insert("toolsInsertPolygon", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("spline16.png"), loadIcon("spline.png")), "", QKeySequence(Key_P), ScMW, "toolsInsertPolygon", modeDrawRegularPolygon));
457
        scrActions->insert("toolsInsertLine", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Stift16.xpm"), loadIcon("Stift.xpm")), "", QKeySequence(Key_L), ScMW, "toolsInsertLine", modeDrawLine));
458
        scrActions->insert("toolsInsertBezier", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("beziertool16.png"), loadIcon("beziertool.png")), "", QKeySequence(Key_B), ScMW, "toolsInsertBezier", modeDrawBezierLine));
459
        scrActions->insert("toolsInsertFreehandLine", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Stiftalt16.xpm"), loadIcon("Stiftalt.xpm")), "", QKeySequence(Key_F), ScMW, "toolsInsertFreehandLine", modeDrawFreehandLine));
2246 subik 460
 
4026 craig 461
        scrActions->insert("toolsRotate", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Rotieren.xpm"), loadIcon("Rotieren.xpm")), "", QKeySequence(Key_R), ScMW, "toolsRotate", modeRotation));
462
        scrActions->insert("toolsZoom", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Lupe.xpm"), loadIcon("Lupe.xpm")), "", QKeySequence(Key_Z), ScMW, "toolsZoom", modeMagnifier));
463
        scrActions->insert("toolsZoomIn", new ScrAction(QIconSet(loadIcon("viewmagin.png"), loadIcon("viewmagin.png")), "", QKeySequence(CTRL+Key_Plus), ScMW, "toolsZoomIn"));
464
        scrActions->insert("toolsZoomOut", new ScrAction(QIconSet(loadIcon("viewmagout.png"), loadIcon("viewmagout.png")), "", QKeySequence(CTRL+Key_Minus), ScMW, "toolsZoomOut"));
465
        scrActions->insert("toolsEditContents", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Editm.xpm"), loadIcon("Editm.xpm")), "", QKeySequence(Key_E), ScMW, "toolsEditContents", modeEdit));
466
        scrActions->insert("toolsEditWithStoryEditor", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("signature2.png"), loadIcon("signature.png")), "", QKeySequence(CTRL+Key_Y), ScMW, "toolsEditWithStoryEditor", modeStoryEditor));
467
        scrActions->insert("toolsLinkTextFrame", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Lock.xpm"), loadIcon("Lock.xpm")), "", QKeySequence(Key_N), ScMW, "toolsLinkTextFrame", modeLinkFrames));
468
        scrActions->insert("toolsUnlinkTextFrame", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Unlock.xpm"), loadIcon("Unlock.xpm")), "", QKeySequence(Key_U), ScMW, "toolsUnlinkTextFrame", modeUnlinkFrames));
469
        scrActions->insert("toolsEyeDropper", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("colorpicker.png"), loadIcon("colorpicker.png")), "", QKeySequence(Key_Y), ScMW, "toolsEyeDropper", modeEyeDropper));
470
        scrActions->insert("toolsCopyProperties", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("wizard.png"), loadIcon("wizard.png")), "", QKeySequence(), ScMW, "toolsCopyProperties", modeCopyProperties));
2246 subik 471
 
1993 cbradney 472
        (*scrActions)["toolsProperties"]->setToggleAction(true);
473
        (*scrActions)["toolsOutline"]->setToggleAction(true);
474
        (*scrActions)["toolsScrapbook"]->setToggleAction(true);
475
        (*scrActions)["toolsLayers"]->setToggleAction(true);
476
        (*scrActions)["toolsPages"]->setToggleAction(true);
477
        (*scrActions)["toolsBookmarks"]->setToggleAction(true);
478
        (*scrActions)["toolsMeasurements"]->setToggleAction(true);
479
        (*scrActions)["toolsActionHistory"]->setToggleAction(true);
480
        (*scrActions)["toolsPreflightVerifier"]->setToggleAction(true);
2355 cbradney 481
        (*scrActions)["toolsAlignDistribute"]->setToggleAction(true);
1993 cbradney 482
        (*scrActions)["toolsToolbarTools"]->setToggleAction(true);
483
        (*scrActions)["toolsToolbarPDF"]->setToggleAction(true);
2246 subik 484
 
1993 cbradney 485
        (*scrActions)["toolsSelect"]->setToggleAction(true);
486
        (*scrActions)["toolsInsertTextFrame"]->setToggleAction(true);
487
        (*scrActions)["toolsInsertImageFrame"]->setToggleAction(true);
488
        (*scrActions)["toolsInsertTableFrame"]->setToggleAction(true);
489
        (*scrActions)["toolsInsertShape"]->setToggleAction(true);
490
        (*scrActions)["toolsInsertPolygon"]->setToggleAction(true);
491
        (*scrActions)["toolsInsertLine"]->setToggleAction(true);
492
        (*scrActions)["toolsInsertBezier"]->setToggleAction(true);
493
        (*scrActions)["toolsInsertFreehandLine"]->setToggleAction(true);
494
        (*scrActions)["toolsRotate"]->setToggleAction(true);
495
        (*scrActions)["toolsZoom"]->setToggleAction(true);
496
        (*scrActions)["toolsEditContents"]->setToggleAction(true);
497
        (*scrActions)["toolsEditWithStoryEditor"]->setToggleAction(true);
498
        (*scrActions)["toolsLinkTextFrame"]->setToggleAction(true);
499
        (*scrActions)["toolsUnlinkTextFrame"]->setToggleAction(true);
500
        (*scrActions)["toolsEyeDropper"]->setToggleAction(true);
501
        (*scrActions)["toolsCopyProperties"]->setToggleAction(true);
2246 subik 502
 
1993 cbradney 503
        *modeActionNames << "toolsSelect" << "toolsInsertTextFrame" << "toolsInsertImageFrame" << "toolsInsertTableFrame";
504
        *modeActionNames << "toolsInsertShape" << "toolsInsertPolygon" << "toolsInsertLine" << "toolsInsertBezier";
505
        *modeActionNames << "toolsInsertFreehandLine" << "toolsRotate" << "toolsZoom" << "toolsEditContents";
506
        *modeActionNames << "toolsEditWithStoryEditor" << "toolsLinkTextFrame" << "toolsUnlinkTextFrame";
507
        *modeActionNames << "toolsEyeDropper" << "toolsCopyProperties";
508
 
2104 cbradney 509
        *nonEditActionNames << "itemLowerToBottom" << "itemRaiseToTop" << "itemRaise" << "itemLower";
2246 subik 510
 
4026 craig 511
        connect( (*scrActions)["toolsActionHistory"], SIGNAL(toggled(bool)), ScMW, SLOT(setUndoPalette(bool)) );
2246 subik 512
 
1993 cbradney 513
        connectModeActions();
514
}
515
 
516
void ActionManager::initExtrasMenuActions()
517
{
4026 craig 518
        scrActions->insert("extrasManagePictures", new ScrAction(ScMW, "extrasManagePictures"));
519
        scrActions->insert("extrasHyphenateText", new ScrAction(ScMW, "extrasHyphenateText"));
520
        scrActions->insert("extrasDeHyphenateText", new ScrAction(ScMW, "extrasDeHyphenateText"));
521
        scrActions->insert("extrasGenerateTableOfContents", new ScrAction(ScMW, "extrasGenerateTableOfContents"));
1993 cbradney 522
 
4026 craig 523
        connect( (*scrActions)["extrasManagePictures"], SIGNAL(activated()), ScMW, SLOT(StatusPic()) );
524
        connect( (*scrActions)["extrasGenerateTableOfContents"], SIGNAL(activated()), ScMW, SLOT(generateTableOfContents()) );
1993 cbradney 525
}
526
 
527
 
528
void ActionManager::initWindowsMenuActions()
529
{
4026 craig 530
        scrActions->insert("windowsCascade", new ScrAction( QIconSet(noIcon),"", QKeySequence(), ScMW, "windowsCascade"));
531
        scrActions->insert("windowsTile", new ScrAction( QIconSet(noIcon),"", QKeySequence(), ScMW, "windowstile"));
1993 cbradney 532
}
533
 
534
void ActionManager::initScriptMenuActions()
535
{
536
}
537
 
538
void ActionManager::initHelpMenuActions()
539
{
4026 craig 540
        scrActions->insert("helpAboutScribus", new ScrAction(ScMW, "helpAboutScribus"));
541
        scrActions->insert("helpAboutPlugins", new ScrAction(ScMW, "helpAboutPlugins"));
542
        scrActions->insert("helpAboutQt", new ScrAction(ScMW, "helpAboutQt"));
543
        scrActions->insert("helpTooltips", new ScrAction(ScMW, "helpTooltips"));
544
        scrActions->insert("helpManual", new ScrAction("", Key_F1, ScMW, "helpManual"));
1993 cbradney 545
 
546
        (*scrActions)["helpTooltips"]->setToggleAction(true);
547
        (*scrActions)["helpTooltips"]->setOn(true);
548
 
4026 craig 549
        connect( (*scrActions)["helpAboutScribus"], SIGNAL(activated()), ScMW, SLOT(slotHelpAbout()) );
550
        connect( (*scrActions)["helpAboutPlugins"], SIGNAL(activated()), ScMW, SLOT(slotHelpAboutPlugins()) );
551
        connect( (*scrActions)["helpAboutQt"], SIGNAL(activated()), ScMW, SLOT(slotHelpAboutQt()) );
552
        connect( (*scrActions)["helpTooltips"], SIGNAL(activated()), ScMW, SLOT(ToggleTips()) );
553
        connect( (*scrActions)["helpManual"], SIGNAL(activated()), ScMW, SLOT(slotOnlineHelp()) );
1993 cbradney 554
}
555
 
4557 cbradney 556
void ActionManager::initUnicodeActions(QMap<QString, QGuardedPtr<ScrAction> > *actionMap, QWidget *actionParent, QStringList *actionNamesList)
1993 cbradney 557
{
558
        //typography
4564 cbradney 559
        actionMap->insert("unicodeSmartHyphen", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", CTRL+SHIFT+Key_Minus, actionParent, "unicodeSmartHyphen",-1));
560
        actionMap->insert("unicodeNonBreakingHyphen", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", CTRL+ALT+Key_Minus, actionParent, "unicodeNonBreakingHyphen",24));
561
        actionMap->insert("unicodeNonBreakingSpace", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", CTRL+Key_Space, actionParent, "unicodeNonBreakingSpace",29));
562
        actionMap->insert("unicodePageNumber", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", CTRL+SHIFT+ALT+Key_P, actionParent, "unicodePageNumber",30));
4720 cbradney 563
        //Spaces
564
        actionMap->insert("unicodeSpaceEN", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeSpaceEN",0x2002));
565
        actionMap->insert("unicodeSpaceEM", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeSpaceEM",0x2003));
566
        actionMap->insert("unicodeSpaceThin", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeSpaceThin",0x2009));
567
        actionMap->insert("unicodeSpaceThick", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeSpaceThick",0x2004));
568
        actionMap->insert("unicodeSpaceMid", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeSpaceMid",0x2005));
569
        actionMap->insert("unicodeSpaceHair", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeSpaceHair",0x200A));
4564 cbradney 570
        //Breaks
571
        actionMap->insert("unicodeNewLine", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", SHIFT+Key_Return, actionParent, "unicodeNewLine",28));
572
        actionMap->insert("unicodeFrameBreak", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", CTRL+Key_Return, actionParent, "unicodeFrameBreak",27));
573
        actionMap->insert("unicodeColumnBreak", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", CTRL+SHIFT+Key_Return, actionParent, "unicodeColumnBreak",26));
574
        //Special
575
        actionMap->insert("unicodeCopyRight", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeCopyRight",0x0A9));
576
        actionMap->insert("unicodeRegdTM", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeRegdTM",0x00AE));
577
        actionMap->insert("unicodeTM", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeTM",0x2122));
578
        actionMap->insert("unicodeBullet", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeBullet",0x2022));
4720 cbradney 579
        actionMap->insert("unicodeMidpoint", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeMidpoint",0x00B7));
580
        actionMap->insert("unicodeSolidus", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeSolidus",0x2044));
4564 cbradney 581
        //Dashes
582
        actionMap->insert("unicodeDashEm", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeDashEm",0x2014));
583
        actionMap->insert("unicodeDashEn", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeDashEn",0x2013));
584
        actionMap->insert("unicodeDashFigure", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeDashFigure",0x2012));
585
        actionMap->insert("unicodeDashQuotation", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeDashQuotation",0x2015));
586
        //Quotes
587
        actionMap->insert("unicodeQuoteApostrophe", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteApostrophe",0x0027));
588
        actionMap->insert("unicodeQuoteStraight", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteStraight",0x0022));
589
        actionMap->insert("unicodeQuoteSingleLeft", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteSingleLeft",0x2018));
590
        actionMap->insert("unicodeQuoteSingleRight", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteSingleRight",0x2019));
591
        actionMap->insert("unicodeQuoteDoubleLeft", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteDoubleLeft",0x201C));
592
        actionMap->insert("unicodeQuoteDoubleRight", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteDoubleRight",0x201D));
593
        actionMap->insert("unicodeQuoteSingleReversed", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteSingleReversed",0x201B));
594
        actionMap->insert("unicodeQuoteDoubleReversed", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteDoubleReversed",0x201F));
595
        actionMap->insert("unicodeQuoteSingleLeftGuillemet", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteSingleLeftGuillemet",0x2039));
596
        actionMap->insert("unicodeQuoteSingleRightGuillemet", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteSingleRightGuillemet",0x203A));
597
        actionMap->insert("unicodeQuoteDoubleLeftGuillemet", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteDoubleLeftGuillemet",0x00AB));
598
        actionMap->insert("unicodeQuoteDoubleRightGuillemet", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteDoubleRightGuillemet",0x00BB));
599
        actionMap->insert("unicodeQuoteLowSingleComma", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteLowSingleComma",0x201A));
600
        actionMap->insert("unicodeQuoteLowDoubleComma", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteLowDoubleComma",0x201E));
601
        actionMap->insert("unicodeQuoteCJKSingleLeft", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteCJKSingleLeft",0x300C));
602
        actionMap->insert("unicodeQuoteCJKSingleRight", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteCJKSingleRight",0x300D));
603
        actionMap->insert("unicodeQuoteCJKDoubleLeft", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteCJKDoubleLeft",0x300E));
604
        actionMap->insert("unicodeQuoteCJKDoubleRight", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteCJKDoubleRight",0x300F));
605
        //Ligatures
606
        actionMap->insert("unicodeLigature_ff", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeLigature_ff",0xFB00));
607
        actionMap->insert("unicodeLigature_fi", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeLigature_fi",0xFB01));
608
        actionMap->insert("unicodeLigature_fl", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeLigature_fl",0xFB02));
609
        actionMap->insert("unicodeLigature_ffi", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeLigature_ffi",0xFB03));
610
        actionMap->insert("unicodeLigature_ffl", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeLigature_ffl",0xFB04));
611
        actionMap->insert("unicodeLigature_ft", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeLigature_ft",0xFB05));
612
        actionMap->insert("unicodeLigature_st", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeLigature_st",0xFB06));
613
 
2391 cbradney 614
        //Spaces and special characters
4564 cbradney 615
        *actionNamesList << "unicodeSmartHyphen" << "unicodeNonBreakingHyphen" << "unicodeNonBreakingSpace" << "unicodePageNumber";
4720 cbradney 616
        *actionNamesList << "unicodeSpaceEN" << "unicodeSpaceEM" << "unicodeSpaceThin" << "unicodeSpaceThick" << "unicodeSpaceMid" << "unicodeSpaceHair";
2391 cbradney 617
        //Breaks
4564 cbradney 618
        *actionNamesList << "unicodeNewLine" << "unicodeFrameBreak" << "unicodeColumnBreak";
2391 cbradney 619
        //Copyrights and TMs
4564 cbradney 620
        *actionNamesList << "unicodeCopyRight" << "unicodeRegdTM" << "unicodeTM";
4720 cbradney 621
        //Slashes
622
        *actionNamesList << "unicodeSolidus";
2391 cbradney 623
        //Bullets
4720 cbradney 624
        *actionNamesList << "unicodeBullet" << "unicodeMidpoint";
2391 cbradney 625
        //Dashes
4564 cbradney 626
        *actionNamesList << "unicodeDashEm" << "unicodeDashEn" << "unicodeDashFigure" << "unicodeDashQuotation";
2391 cbradney 627
        //Straight quotes
4564 cbradney 628
        *actionNamesList << "unicodeQuoteApostrophe" << "unicodeQuoteStraight";
2391 cbradney 629
        //Double quotes
4564 cbradney 630
        *actionNamesList << "unicodeQuoteDoubleLeft" << "unicodeQuoteDoubleRight" << "unicodeQuoteSingleLeft" << "unicodeQuoteSingleRight";
2391 cbradney 631
        //Alternative single quotes
4564 cbradney 632
        *actionNamesList << "unicodeQuoteSingleReversed" << "unicodeQuoteDoubleReversed";
2391 cbradney 633
        //French quotes
4564 cbradney 634
        *actionNamesList << "unicodeQuoteSingleLeftGuillemet" << "unicodeQuoteSingleRightGuillemet" << "unicodeQuoteDoubleLeftGuillemet" << "unicodeQuoteDoubleRightGuillemet";
2391 cbradney 635
        //German quotes
4564 cbradney 636
        *actionNamesList << "unicodeQuoteLowSingleComma" << "unicodeQuoteLowDoubleComma";
2391 cbradney 637
        //CJK Quotes
4564 cbradney 638
        *actionNamesList << "unicodeQuoteCJKSingleLeft" << "unicodeQuoteCJKSingleRight" << "unicodeQuoteCJKDoubleLeft" << "unicodeQuoteCJKDoubleRight";
639
        //Ligatures
640
        *actionNamesList << "unicodeLigature_ff" << "unicodeLigature_fi" << "unicodeLigature_fl" << "unicodeLigature_ffi" << "unicodeLigature_ffl" << "unicodeLigature_ft" << "unicodeLigature_st";
641
 
4557 cbradney 642
        for ( QStringList::Iterator it = actionNamesList->begin(); it != actionNamesList->end(); ++it )
643
                connect( (*actionMap)[*it], SIGNAL(activatedUnicodeShortcut(QString, int)), actionParent, SLOT(specialActionKeyEvent(QString, int)) );
644
}
1993 cbradney 645
 
4557 cbradney 646
void ActionManager::initSpecialActions()
647
{
1993 cbradney 648
        //GUI
4026 craig 649
        scrActions->insert("specialToggleAllPalettes", new ScrAction(ScrAction::DataQString, QIconSet(), "", Key_F10, ScMW, "specialToggleAllPalettes",0,0.0,"specialToggleAllPalettes"));
650
        scrActions->insert("specialToggleAllGuides", new ScrAction(ScrAction::DataQString, QIconSet(), "", Key_F11, ScMW, "specialToggleAllGuides",0,0.0,"specialToggleAllGuides"));
1993 cbradney 651
 
4026 craig 652
        connect( (*scrActions)["specialToggleAllPalettes"], SIGNAL(activated()), ScMW, SLOT(ToggleAllPalettes()) );
653
        connect( (*scrActions)["specialToggleAllGuides"], SIGNAL(activated()), ScMW, SLOT(ToggleAllGuides()) );
1993 cbradney 654
}
655
 
656
void ActionManager::disconnectModeActions()
657
{
658
        for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
4026 craig 659
                disconnect( (*scrActions)[*it], SIGNAL(toggledData(bool, int)) , ScMW, SLOT(setAppModeByToggle(bool, int)) );
1993 cbradney 660
}
2246 subik 661
 
1993 cbradney 662
void ActionManager::connectModeActions()
663
{
664
        for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
4026 craig 665
                connect( (*scrActions)[*it], SIGNAL(toggledData(bool, int)) , ScMW, SLOT(setAppModeByToggle(bool, int)) );
1993 cbradney 666
}
667
 
4688 cbradney 668
void ActionManager::disconnectNewDocActions()
669
{
670
        disconnect( (*scrActions)["itemLock"], 0, 0, 0);
671
        disconnect( (*scrActions)["itemLockSize"], 0, 0, 0);
4698 cbradney 672
        disconnect( (*scrActions)["itemPrintingEnabled"], 0, 0, 0);
4699 cbradney 673
        disconnect( (*scrActions)["itemFlipH"], 0, 0, 0);
674
        disconnect( (*scrActions)["itemFlipV"], 0, 0, 0);
4688 cbradney 675
        disconnect( (*scrActions)["itemUpdateImage"], 0, 0, 0 );
4713 cbradney 676
        disconnect( (*scrActions)["itemDelete"], 0, 0, 0);
677
        disconnect( (*scrActions)["extrasHyphenateText"], 0, 0, 0 );
678
        disconnect( (*scrActions)["extrasDeHyphenateText"], 0, 0, 0 );
679
 
4688 cbradney 680
}
681
 
682
void ActionManager::connectNewDocActions(ScribusDoc *currDoc)
683
{
684
        if (currDoc==NULL)
685
                return;
686
        connect( (*scrActions)["itemLock"], SIGNAL(activated()), currDoc, SLOT(itemSelection_ToggleLock()) );
687
        connect( (*scrActions)["itemLockSize"], SIGNAL(activated()), currDoc, SLOT(itemSelection_ToggleSizeLock()));
4698 cbradney 688
        connect( (*scrActions)["itemPrintingEnabled"], SIGNAL(activated()), currDoc, SLOT(itemSelection_TogglePrintEnabled()));
4699 cbradney 689
        connect( (*scrActions)["itemFlipH"], SIGNAL(activated()), currDoc, SLOT(itemSelection_FlipH()));
690
        connect( (*scrActions)["itemFlipV"], SIGNAL(activated()), currDoc, SLOT(itemSelection_FlipV()));
4688 cbradney 691
        connect( (*scrActions)["itemUpdateImage"], SIGNAL(activated()), currDoc, SLOT(updatePic()) );
4713 cbradney 692
        connect( (*scrActions)["extrasHyphenateText"], SIGNAL(activated()), currDoc, SLOT(itemSelection_DoHyphenate()) );
693
        connect( (*scrActions)["extrasDeHyphenateText"], SIGNAL(activated()), currDoc, SLOT(itemSelection_DoDeHyphenate()) );
694
        connect( (*scrActions)["itemDelete"], SIGNAL(activated()), currDoc, SLOT(itemSelection_DeleteItem()) );
4688 cbradney 695
}
696
 
2026 cbradney 697
void ActionManager::disconnectNewViewActions()
698
{
699
        disconnect( (*scrActions)["toolsZoomIn"], 0, 0, 0);
700
        disconnect( (*scrActions)["toolsZoomOut"], 0, 0, 0);
2104 cbradney 701
        disconnect( (*scrActions)["itemLowerToBottom"], 0, 0, 0);
2026 cbradney 702
        disconnect( (*scrActions)["itemImageIsVisible"], 0, 0, 0);
2256 cbradney 703
        disconnect( (*scrActions)["itemPreviewLow"], SIGNAL(activatedData(int)), 0, 0 );
704
        disconnect( (*scrActions)["itemPreviewNormal"], SIGNAL(activatedData(int)), 0,0 );
705
        disconnect( (*scrActions)["itemPreviewFull"], SIGNAL(activatedData(int)), 0, 0 );
2026 cbradney 706
        disconnect( (*scrActions)["itemRaise"], 0, 0, 0);
707
        disconnect( (*scrActions)["itemLower"], 0, 0, 0);
708
        disconnect( (*scrActions)["itemCombinePolygons"], 0, 0, 0);
709
        disconnect( (*scrActions)["itemSplitPolygons"], 0, 0, 0);
710
        disconnect( (*scrActions)["itemConvertToBezierCurve"], 0, 0, 0);
711
        disconnect( (*scrActions)["itemConvertToImageFrame"], 0, 0, 0);
712
        disconnect( (*scrActions)["itemConvertToOutlines"], 0, 0, 0);
713
        disconnect( (*scrActions)["itemConvertToPolygon"], 0, 0, 0);
714
        disconnect( (*scrActions)["itemConvertToTextFrame"], 0, 0, 0);
715
        disconnect( (*scrActions)["itemAttachTextToPath"], 0, 0, 0);
716
        disconnect( (*scrActions)["itemDetachTextFromPath"], 0, 0, 0);
2259 cbradney 717
        disconnect( (*scrActions)["itemAdjustFrameToImage"], 0, 0, 0 );
2260 cbradney 718
        disconnect( (*scrActions)["itemExtendedImageProperties"], 0, 0, 0 );
2026 cbradney 719
}
2246 subik 720
 
2026 cbradney 721
void ActionManager::connectNewViewActions(ScribusView *currView)
722
{
723
        if (currView==NULL)
724
                return;
725
        connect( (*scrActions)["toolsZoomIn"], SIGNAL(activated()) , currView, SLOT(slotZoomIn()) );
726
        connect( (*scrActions)["toolsZoomOut"], SIGNAL(activated()) , currView, SLOT(slotZoomOut()) );
2104 cbradney 727
        connect( (*scrActions)["itemLowerToBottom"], SIGNAL(activated()), currView, SLOT(ToBack()) );
728
        connect( (*scrActions)["itemRaiseToTop"], SIGNAL(activated()), currView, SLOT(ToFront()) );
2026 cbradney 729
        connect( (*scrActions)["itemRaise"], SIGNAL(activated()), currView, SLOT(RaiseItem()) );
730
        connect( (*scrActions)["itemLower"], SIGNAL(activated()), currView, SLOT(LowerItem()) );
731
        connect( (*scrActions)["itemCombinePolygons"], SIGNAL(activated()), currView, SLOT(UniteObj()) );
732
        connect( (*scrActions)["itemSplitPolygons"], SIGNAL(activated()), currView, SLOT(SplitObj()) );
733
        connect( (*scrActions)["itemConvertToBezierCurve"], SIGNAL(activated()), currView, SLOT(ToBezierFrame()) );
734
        connect( (*scrActions)["itemConvertToImageFrame"], SIGNAL(activated()), currView, SLOT(ToPicFrame()) );
735
        connect( (*scrActions)["itemConvertToOutlines"], SIGNAL(activated()), currView, SLOT(TextToPath()) );
736
        connect( (*scrActions)["itemConvertToPolygon"], SIGNAL(activated()), currView, SLOT(ToPolyFrame()) );
737
        connect( (*scrActions)["itemConvertToTextFrame"], SIGNAL(activated()), currView, SLOT(ToTextFrame()) );
738
        connect( (*scrActions)["itemAttachTextToPath"], SIGNAL(activated()), currView, SLOT(ToPathText()) );
739
        connect( (*scrActions)["itemDetachTextFromPath"], SIGNAL(activated()), currView, SLOT(FromPathText()) );
3942 cbradney 740
        connect( (*scrActions)["itemAdjustFrameToImage"], SIGNAL(activated()), currView, SLOT(adjustFrametoImageSize()) );
2260 cbradney 741
        connect( (*scrActions)["itemExtendedImageProperties"], SIGNAL(activated()), currView, SLOT(editExtendedImageProperties()) );
2026 cbradney 742
}
743
 
744
void ActionManager::disconnectNewSelectionActions()
745
{
746
        disconnect( (*scrActions)["itemImageIsVisible"], 0, 0, 0);
4705 cbradney 747
        //Only disconnect activatedData for data based actions or you will disconnect the internal signal
748
        disconnect( (*scrActions)["itemPreviewLow"], SIGNAL(activatedData(int)) , 0, 0);
749
        disconnect( (*scrActions)["itemPreviewNormal"], SIGNAL(activatedData(int)) , 0, 0);
750
        disconnect( (*scrActions)["itemPreviewFull"], SIGNAL(activatedData(int)) , 0, 0);
751
        disconnect( (*scrActions)["editClearContents"], 0, 0, 0);
2026 cbradney 752
}
753
 
4688 cbradney 754
void ActionManager::connectNewSelectionActions(ScribusView *currView, ScribusDoc* currDoc)
2026 cbradney 755
{
4705 cbradney 756
        connect( (*scrActions)["itemImageIsVisible"], SIGNAL(toggled(bool)), currDoc, SLOT(itemSelection_ToggleImageShown()) );
757
        connect( (*scrActions)["itemPreviewLow"], SIGNAL(activatedData(int)), currDoc, SLOT(itemSelection_ChangePreviewResolution(int)) );
758
        connect( (*scrActions)["itemPreviewNormal"], SIGNAL(activatedData(int)), currDoc, SLOT(itemSelection_ChangePreviewResolution(int)) );
759
        connect( (*scrActions)["itemPreviewFull"], SIGNAL(activatedData(int)), currDoc, SLOT(itemSelection_ChangePreviewResolution(int)) );
760
        connect( (*scrActions)["editClearContents"], SIGNAL(activated()), currDoc, SLOT(itemSelection_ClearItem()) );
2026 cbradney 761
}
2246 subik 762
 
1993 cbradney 763
void ActionManager::saveActionShortcutsPreEditMode()
764
{
765
        for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
766
                (*scrActions)[*it]->saveShortcut();
767
        for ( QStringList::Iterator it = nonEditActionNames->begin(); it != nonEditActionNames->end(); ++it )
2246 subik 768
                (*scrActions)[*it]->saveShortcut();
1993 cbradney 769
 
770
}
771
 
772
void ActionManager::restoreActionShortcutsPostEditMode()
773
{
774
        for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
775
                (*scrActions)[*it]->restoreShortcut();
776
        for ( QStringList::Iterator it = nonEditActionNames->begin(); it != nonEditActionNames->end(); ++it )
2246 subik 777
                (*scrActions)[*it]->restoreShortcut();
1993 cbradney 778
}
779
 
4881 cbradney 780
void ActionManager::enableActionStringList(QMap<QString, QGuardedPtr<ScrAction> > *actionMap, QStringList *list, bool enabled, bool checkingUnicode, const QString& fontName)
1993 cbradney 781
{
782
        for ( QStringList::Iterator it = list->begin(); it != list->end(); ++it )
783
        {
784
                if(!checkingUnicode)
4881 cbradney 785
                        (*actionMap)[*it]->setEnabled(enabled);
1993 cbradney 786
                else
787
                {
788
                        //For UnicodeChar actions, only enable when the current font has that character.
4881 cbradney 789
                        if (ScMW->HaveDoc && (*actionMap)[*it]->actionType()==ScrAction::UnicodeChar)
1993 cbradney 790
                        {
4881 cbradney 791
                                int charCode=(*actionMap)[*it]->actionInt();
2246 subik 792
                                if(charCode==-1 ||
4881 cbradney 793
                                        charCode==24 ||
794
                                        charCode==26 ||
795
                                        charCode==27 ||
796
                                        charCode==28 ||
797
                                        charCode==29 ||
798
                                        charCode==30 ||
799
                                        ((*ScMW->doc->AllFonts)[fontName]!=0 &&
800
                                        (*ScMW->doc->AllFonts)[fontName]->CharWidth.contains(charCode)) )
801
                                                (*actionMap)[*it]->setEnabled(true);
802
                                else
803
                                        (*actionMap)[*it]->setEnabled(false);
1993 cbradney 804
                        }
805
                }
806
        }
807
}
1995 cbradney 808
 
4881 cbradney 809
void ActionManager::enableUnicodeActions(QMap<QString, QGuardedPtr<ScrAction> > *actionMap, bool enabled, const QString& fontName)
1995 cbradney 810
{
4881 cbradney 811
        enableActionStringList(actionMap, unicodeCharActionNames, enabled, enabled, fontName);
1995 cbradney 812
}
2103 cbradney 813
 
2108 cbradney 814
void ActionManager::setPDFActions(ScribusView *currView)
2103 cbradney 815
{
2108 cbradney 816
        if (currView==NULL)
2103 cbradney 817
                return;
4847 cbradney 818
        PageItem* currItem = ScMW->doc->m_Selection->itemAt(0);
2103 cbradney 819
        if (currItem==NULL)
820
                return;
821
 
822
        disconnect( (*scrActions)["itemPDFIsBookmark"], 0, 0, 0);
823
        disconnect( (*scrActions)["itemPDFIsAnnotation"], 0, 0, 0);
2246 subik 824
 
3625 avox 825
        if (!currItem->asTextFrame())
2103 cbradney 826
        {
827
                (*scrActions)["itemPDFIsAnnotation"]->setEnabled(false);
828
                (*scrActions)["itemPDFIsBookmark"]->setEnabled(false);
829
                (*scrActions)["itemPDFIsAnnotation"]->setOn(false);
830
                (*scrActions)["itemPDFIsBookmark"]->setOn(false);
831
                (*scrActions)["itemPDFAnnotationProps"]->setEnabled(false);
832
                (*scrActions)["itemPDFFieldProps"]->setEnabled(false);
833
                return;
834
        }
835
 
836
        (*scrActions)["itemPDFIsAnnotation"]->setEnabled(true);
837
        (*scrActions)["itemPDFIsBookmark"]->setEnabled(true);
4084 cbradney 838
        (*scrActions)["itemPDFIsAnnotation"]->setOn(currItem->isAnnotation());
2103 cbradney 839
        (*scrActions)["itemPDFIsBookmark"]->setOn(currItem->isBookmark);
4084 cbradney 840
        if (currItem->isAnnotation())
2103 cbradney 841
        {
4084 cbradney 842
                int aType=currItem->annotation().Type();
843
                bool setter=((aType == 0) || (aType == 1) || (aType > 9));
2103 cbradney 844
                (*scrActions)["itemPDFAnnotationProps"]->setEnabled(setter);
845
                (*scrActions)["itemPDFFieldProps"]->setEnabled(!setter);
846
        }
847
        else
848
        {
849
                (*scrActions)["itemPDFAnnotationProps"]->setEnabled(false);
850
                (*scrActions)["itemPDFFieldProps"]->setEnabled(false);
851
        }
2108 cbradney 852
        connect( (*scrActions)["itemPDFIsAnnotation"], SIGNAL(activated()), currView, SLOT(ToggleAnnotation()) );
853
        connect( (*scrActions)["itemPDFIsBookmark"], SIGNAL(activated()), currView, SLOT(ToggleBookmark()) );
2103 cbradney 854
}
2161 cbradney 855
 
856
void ActionManager::languageChange()
857
{
2170 cbradney 858
        //File Menu
2352 fschmid 859
        (*scrActions)["fileNew"]->setTexts( tr("&New"));
860
        (*scrActions)["fileOpen"]->setTexts( tr("&Open..."));
861
        (*scrActions)["fileClose"]->setTexts( tr("&Close"));
862
        (*scrActions)["fileSave"]->setTexts( tr("&Save"));
863
        (*scrActions)["fileSaveAs"]->setTexts( tr("Save &As..."));
864
        (*scrActions)["fileRevert"]->setTexts( tr("Re&vert to Saved"));
865
        (*scrActions)["fileCollect"]->setTexts( tr("Collect for O&utput..."));
866
        (*scrActions)["fileImportText"]->setTexts( tr("Get Text..."));
867
        (*scrActions)["fileImportAppendText"]->setTexts( tr("Append &Text..."));
868
        (*scrActions)["fileImportImage"]->setTexts( tr("Get Image..."));
869
        (*scrActions)["fileExportText"]->setTexts( tr("Save &Text..."));
870
        (*scrActions)["fileExportAsEPS"]->setTexts( tr("Save Page as &EPS..."));
871
        (*scrActions)["fileExportAsPDF"]->setTexts( tr("Save as P&DF..."));
872
        (*scrActions)["fileDocSetup"]->setTexts( tr("Document &Setup..."));
873
        (*scrActions)["filePrint"]->setTexts( tr("&Print..."));
3165 fschmid 874
        (*scrActions)["PrintPreview"]->setTexts( tr("Print Previe&w"));
2352 fschmid 875
        (*scrActions)["fileQuit"]->setTexts( tr("&Quit"));
2170 cbradney 876
        //Edit Menu
2352 fschmid 877
        (*scrActions)["editUndoAction"]->setTexts( tr("&Undo"));
878
        (*scrActions)["editRedoAction"]->setTexts( tr("&Redo"));
879
        (*scrActions)["editActionMode"]->setTexts( tr("&Item Action Mode"));
880
        (*scrActions)["editCut"]->setTexts( tr("Cu&t"));
881
        (*scrActions)["editCopy"]->setTexts( tr("&Copy"));
882
        (*scrActions)["editPaste"]->setTexts( tr("&Paste"));
4579 cbradney 883
        (*scrActions)["editCopyContents"]->setTexts( tr("Copy Contents"));
884
        (*scrActions)["editPasteContents"]->setTexts( tr("Paste Contents"));
4831 cbradney 885
        (*scrActions)["editPasteContentsAbs"]->setTexts( tr("Paste Contents (Absolute)"));
2352 fschmid 886
        (*scrActions)["editClearContents"]->setTexts( tr("C&lear Contents"));
887
        (*scrActions)["editSelectAll"]->setTexts( tr("Select &All"));
888
        (*scrActions)["editDeselectAll"]->setTexts( tr("&Deselect All"));
889
        (*scrActions)["editSearchReplace"]->setTexts( tr("&Search/Replace..."));
890
        (*scrActions)["editEditWithImageEditor"]->setTexts( tr("Edit Image..."));
891
        (*scrActions)["editColors"]->setTexts( tr("C&olors..."));
4829 tsoots 892
        (*scrActions)["editStyles"]->setTexts( tr("S&tyles..."));
2352 fschmid 893
        (*scrActions)["editParaStyles"]->setTexts( tr("&Paragraph Styles..."));
894
        (*scrActions)["editLineStyles"]->setTexts( tr("&Line Styles..."));
895
        (*scrActions)["editMasterPages"]->setTexts( tr("&Master Pages..."));
3142 cbradney 896
        (*scrActions)["editJavascripts"]->setTexts( tr("&JavaScripts..."));
2352 fschmid 897
        (*scrActions)["editPreferences"]->setTexts( tr("P&references..."));
2246 subik 898
 
2170 cbradney 899
        int font_sizes[] = {7, 9, 10, 11, 12, 14, 18, 24, 36, 48, 60, 72};
900
        size_t f_size = sizeof(font_sizes) / sizeof(*font_sizes);
901
        for (uint s = 0; s < f_size; ++s)
902
        {
903
                QString fontSizeName=QString("fontSize%1").arg(font_sizes[s]);
2352 fschmid 904
                (*scrActions)[fontSizeName]->setTexts( tr("%1 pt").arg(font_sizes[s]));
2170 cbradney 905
        }
2352 fschmid 906
        (*scrActions)["fontSizeOther"]->setTexts( tr("&Other..."));
907
        (*scrActions)["alignLeft"]->setTexts( tr("&Left"));
908
        (*scrActions)["alignCenter"]->setTexts( tr("&Center"));
909
        (*scrActions)["alignRight"]->setTexts( tr("&Right"));
910
        (*scrActions)["alignBlock"]->setTexts( tr("&Block"));
911
        (*scrActions)["alignForced"]->setTexts( tr("&Forced"));
2170 cbradney 912
 
913
        for (uint i=0; i<=100 ; i+=10)
914
        {
915
                QString shadeName=QString("shade%1").arg(i);
2352 fschmid 916
                (*scrActions)[shadeName]->setTexts( tr("&%1 %").arg(i));
2170 cbradney 917
        }
918
 
2352 fschmid 919
        (*scrActions)["shadeOther"]->setTexts( tr("&Other..."));
920
        (*scrActions)["typeEffectNormal"]->setTexts( tr("&Normal"));
921
        (*scrActions)["typeEffectUnderline"]->setTexts( tr("&Underline"));
922
        (*scrActions)["typeEffectUnderlineWords"]->setTexts( tr("Underline &Words"));
923
        (*scrActions)["typeEffectStrikeThrough"]->setTexts( tr("&Strike Through"));
924
        (*scrActions)["typeEffectAllCaps"]->setTexts( tr("&All Caps"));
925
        (*scrActions)["typeEffectSmallCaps"]->setTexts( tr("Small &Caps"));
926
        (*scrActions)["typeEffectSuperscript"]->setTexts( tr("Su&perscript"));
927
        (*scrActions)["typeEffectSubscript"]->setTexts( tr("Su&bscript"));
4847 cbradney 928
        (*scrActions)["typeEffectOutline"]->setTexts( tr("&Outline", "type effect"));
2352 fschmid 929
        (*scrActions)["typeEffectShadow"]->setTexts( tr("S&hadow"));
2170 cbradney 930
 
4572 cbradney 931
        (*scrActions)["styleImageEffects"]->setTexts( tr("&Image Effects"));
2352 fschmid 932
        (*scrActions)["styleTabulators"]->setTexts( tr("&Tabulators..."));
2246 subik 933
 
2170 cbradney 934
        //Item Menu
2352 fschmid 935
        (*scrActions)["itemDuplicate"]->setTexts( tr("D&uplicate"));
936
        (*scrActions)["itemMulDuplicate"]->setTexts( tr("&Multiple Duplicate"));
937
        (*scrActions)["itemDelete"]->setTexts( tr("&Delete"));
938
        (*scrActions)["itemGroup"]->setTexts( tr("&Group"));
939
        (*scrActions)["itemUngroup"]->setTexts( tr("&Ungroup"));
940
        (*scrActions)["itemLock"]->setTexts( tr("Is &Locked"));
941
        (*scrActions)["itemLockSize"]->setTexts( tr("Si&ze is Locked"));
4698 cbradney 942
        (*scrActions)["itemPrintingEnabled"]->setTexts( tr("&Printing Enabled"));
4699 cbradney 943
        (*scrActions)["itemFlipH"]->setTexts( tr("&Flip Horizontally"));
944
        (*scrActions)["itemFlipV"]->setTexts( tr("&Flip Vertically"));
2352 fschmid 945
        (*scrActions)["itemLowerToBottom"]->setTexts( tr("Lower to &Bottom"));
946
        (*scrActions)["itemRaiseToTop"]->setTexts( tr("Raise to &Top"));
947
        (*scrActions)["itemLower"]->setTexts( tr("&Lower"));
948
        (*scrActions)["itemRaise"]->setTexts( tr("&Raise"));
949
        (*scrActions)["itemSendToScrapbook"]->setTexts( tr("Send to S&crapbook"));
950
        (*scrActions)["itemAttributes"]->setTexts( tr("&Attributes..."));
3706 fschmid 951
        (*scrActions)["itemImageInfo"]->setTexts( tr("More Info..."));
2352 fschmid 952
        (*scrActions)["itemImageIsVisible"]->setTexts( tr("I&mage Visible"));
953
        (*scrActions)["itemUpdateImage"]->setTexts( tr("&Update Image"));
954
        (*scrActions)["itemAdjustFrameToImage"]->setTexts( tr("Adjust Frame to Image"));
955
        (*scrActions)["itemExtendedImageProperties"]->setTexts( tr("Extended Image Properties"));
956
        (*scrActions)["itemPreviewLow"]->setTexts( tr("&Low Resolution"));
957
        (*scrActions)["itemPreviewNormal"]->setTexts( tr("&Normal Resolution"));
958
        (*scrActions)["itemPreviewFull"]->setTexts( tr("&Full Resolution"));
959
        (*scrActions)["itemPDFIsBookmark"]->setTexts( tr("Is PDF &Bookmark"));
960
        (*scrActions)["itemPDFIsAnnotation"]->setTexts( tr("Is PDF A&nnotation"));
961
        (*scrActions)["itemPDFAnnotationProps"]->setTexts( tr("Annotation P&roperties"));
962
        (*scrActions)["itemPDFFieldProps"]->setTexts( tr("Field P&roperties"));
963
        (*scrActions)["itemShapeEdit"]->setTexts( tr("&Edit Shape..."));
964
        (*scrActions)["itemAttachTextToPath"]->setTexts( tr("&Attach Text to Path"));
965
        (*scrActions)["itemDetachTextFromPath"]->setTexts( tr("&Detach Text from Path"));
966
        (*scrActions)["itemCombinePolygons"]->setTexts( tr("&Combine Polygons"));
967
        (*scrActions)["itemSplitPolygons"]->setTexts( tr("Split &Polygons"));
968
        (*scrActions)["itemConvertToBezierCurve"]->setTexts( tr("&Bezier Curve"));
969
        (*scrActions)["itemConvertToImageFrame"]->setTexts( tr("&Image Frame"));
4847 cbradney 970
        (*scrActions)["itemConvertToOutlines"]->setTexts( tr("&Outlines", "Convert to oulines"));
2352 fschmid 971
        (*scrActions)["itemConvertToPolygon"]->setTexts( tr("&Polygon"));
972
        (*scrActions)["itemConvertToTextFrame"]->setTexts( tr("&Text Frame"));
2170 cbradney 973
 
974
        //Insert Menu
2352 fschmid 975
        (*scrActions)["insertGlyph"]->setTexts( tr("&Glyph..."));
976
        (*scrActions)["insertSampleText"]->setTexts( tr("Sample Text"));
2246 subik 977
 
2170 cbradney 978
        //Page menu
2352 fschmid 979
        (*scrActions)["pageInsert"]->setTexts( tr("&Insert..."));
980
        (*scrActions)["pageImport"]->setTexts( tr("Im&port..."));
981
        (*scrActions)["pageDelete"]->setTexts( tr("&Delete..."));
982
        (*scrActions)["pageCopy"]->setTexts( tr("&Copy..."));
983
        (*scrActions)["pageMove"]->setTexts( tr("&Move..."));
984
        (*scrActions)["pageApplyMasterPage"]->setTexts( tr("&Apply Master Page..."));
3187 fschmid 985
        (*scrActions)["pageCopyToMasterPage"]->setTexts( tr("Convert to Master Page..."));
2352 fschmid 986
        (*scrActions)["pageManageGuides"]->setTexts( tr("Manage &Guides..."));
2872 fschmid 987
        (*scrActions)["pageManageMargins"]->setTexts( tr("Manage Page Properties..."));
2246 subik 988
 
2170 cbradney 989
        //View Menu
2352 fschmid 990
        (*scrActions)["viewFitInWindow"]->setTexts( tr("&Fit in window"));
991
        (*scrActions)["viewFit50"]->setTexts( tr("&50%"));
992
        (*scrActions)["viewFit75"]->setTexts( tr("&75%"));
993
        (*scrActions)["viewFit100"]->setTexts( tr("&100%"));
994
        (*scrActions)["viewFit200"]->setTexts( tr("&200%"));
995
        (*scrActions)["viewFit20"]->setTexts( tr("&Thumbnails"));
996
        (*scrActions)["viewShowMargins"]->setTexts( tr("Show &Margins"));
997
        (*scrActions)["viewShowFrames"]->setTexts( tr("Show &Frames"));
998
        (*scrActions)["viewShowImages"]->setTexts( tr("Show &Images"));
999
        (*scrActions)["viewShowGrid"]->setTexts( tr("Show &Grid"));
1000
        (*scrActions)["viewShowGuides"]->setTexts( tr("Show G&uides"));
1001
        (*scrActions)["viewShowBaseline"]->setTexts( tr("Show &Baseline Grid"));
1002
        (*scrActions)["viewShowTextChain"]->setTexts( tr("Show &Text Chain"));
2353 fschmid 1003
        (*scrActions)["viewShowTextControls"]->setTexts( tr("Show Control Characters"));
4651 cbradney 1004
        (*scrActions)["viewShowRulers"]->setTexts( tr("Show Rulers"));
2863 fschmid 1005
        (*scrActions)["viewRulerMode"]->setTexts( tr("Rulers relative to Page"));
2352 fschmid 1006
        (*scrActions)["viewSnapToGrid"]->setTexts( tr("Sn&ap to Grid"));
1007
        (*scrActions)["viewSnapToGuides"]->setTexts( tr("Sna&p to Guides"));
1008
//      (*scrActions)["viewNewView"]->setTexts( tr("New View"));
2170 cbradney 1009
 
1010
        //Tool menu
2352 fschmid 1011
        (*scrActions)["toolsProperties"]->setTexts( tr("&Properties"));
4554 cbradney 1012
        (*scrActions)["toolsOutline"]->setTexts( tr("&Outline", "Document Outline Palette"));
2352 fschmid 1013
        (*scrActions)["toolsScrapbook"]->setTexts( tr("&Scrapbook"));
1014
        (*scrActions)["toolsLayers"]->setTexts( tr("&Layers"));
2589 cbradney 1015
        (*scrActions)["toolsPages"]->setTexts( tr("&Arrange Pages"));
2352 fschmid 1016
        (*scrActions)["toolsBookmarks"]->setTexts( tr("&Bookmarks"));
1017
        (*scrActions)["toolsMeasurements"]->setTexts( tr("&Measurements"));
1018
        (*scrActions)["toolsActionHistory"]->setTexts( tr("Action &History"));
1019
        (*scrActions)["toolsPreflightVerifier"]->setTexts( tr("Preflight &Verifier"));
2364 cbradney 1020
        (*scrActions)["toolsAlignDistribute"]->setTexts( tr("&Align and Distribute"));
2352 fschmid 1021
        (*scrActions)["toolsToolbarTools"]->setTexts( tr("&Tools"));
1022
        (*scrActions)["toolsToolbarPDF"]->setTexts( tr("P&DF Tools"));
2246 subik 1023
 
2170 cbradney 1024
        //toolbar only items
2352 fschmid 1025
        (*scrActions)["toolsSelect"]->setTexts( tr("Select Item"));
1026
        (*scrActions)["toolsInsertTextFrame"]->setMenuText( tr("&Text Frame"));
1027
        (*scrActions)["toolsInsertImageFrame"]->setMenuText( tr("&Image Frame"));
1028
        (*scrActions)["toolsInsertTableFrame"]->setMenuText( tr("T&able"));
1029
        (*scrActions)["toolsInsertShape"]->setMenuText( tr("&Shape"));
1030
        (*scrActions)["toolsInsertPolygon"]->setMenuText( tr("&Polygon"));
1031
        (*scrActions)["toolsInsertLine"]->setMenuText( tr("&Line"));
1032
        (*scrActions)["toolsInsertBezier"]->setMenuText( tr("&Bezier Curve"));
1033
        (*scrActions)["toolsInsertFreehandLine"]->setMenuText( tr("&Freehand Line"));
1034
        (*scrActions)["toolsRotate"]->setTexts( tr("Rotate Item"));
1035
        (*scrActions)["toolsZoom"]->setTexts( tr("Zoom in or out"));
1036
        (*scrActions)["toolsZoomIn"]->setTexts( tr("Zoom in"));
1037
        (*scrActions)["toolsZoomOut"]->setTexts( tr("Zoom out"));
1038
        (*scrActions)["toolsEditContents"]->setTexts( tr("Edit Contents of Frame"));
1039
        (*scrActions)["toolsEditWithStoryEditor"]->setMenuText( tr("Edit Text..."));
1040
        (*scrActions)["toolsLinkTextFrame"]->setTexts( tr("Link Text Frames"));
1041
        (*scrActions)["toolsUnlinkTextFrame"]->setTexts( tr("Unlink Text Frames"));
1042
        (*scrActions)["toolsEyeDropper"]->setTexts( tr("&Eye Dropper"));
1043
        (*scrActions)["toolsCopyProperties"]->setTexts( tr("Copy Item Properties"));
2246 subik 1044
 
2352 fschmid 1045
        (*scrActions)["toolsEditWithStoryEditor"]->setText( tr("Edit the text with the Story Editor"));
2246 subik 1046
 
2352 fschmid 1047
        (*scrActions)["toolsInsertTextFrame"]->setText( tr("Insert Text Frame"));
1048
        (*scrActions)["toolsInsertImageFrame"]->setText( tr("Insert Image Frame"));
1049
        (*scrActions)["toolsInsertTableFrame"]->setText( tr("Insert Table"));
1050
        (*scrActions)["toolsInsertShape"]->setText( tr("Insert Shape"));
1051
        (*scrActions)["toolsInsertPolygon"]->setText( tr("Insert Polygon"));
1052
        (*scrActions)["toolsInsertLine"]->setText( tr("Insert Line"));
1053
        (*scrActions)["toolsInsertBezier"]->setText( tr("Insert Bezier Curve"));
1054
        (*scrActions)["toolsInsertFreehandLine"]->setText( tr("Insert Freehand Line"));
2170 cbradney 1055
 
1056
        //Extras Menu
2352 fschmid 1057
        (*scrActions)["extrasManagePictures"]->setTexts( tr("&Manage Pictures"));
1058
        (*scrActions)["extrasHyphenateText"]->setTexts( tr("&Hyphenate Text"));
2621 fschmid 1059
        (*scrActions)["extrasDeHyphenateText"]->setTexts( tr("Dehyphenate Text"));
2352 fschmid 1060
        (*scrActions)["extrasGenerateTableOfContents"]->setTexts( tr("&Generate Table Of Contents"));
2170 cbradney 1061
 
3097 cbradney 1062
        //Windows Menu
1063
        (*scrActions)["windowsCascade"]->setMenuText( tr("&Cascade"));
1064
        (*scrActions)["windowsTile"]->setMenuText( tr("&Tile"));
1065
 
2170 cbradney 1066
        //Help Menu
2352 fschmid 1067
        (*scrActions)["helpAboutScribus"]->setTexts( tr("&About Scribus"));
3247 craig 1068
        (*scrActions)["helpAboutPlugins"]->setTexts( tr("&About Plug-ins"));
2352 fschmid 1069
        (*scrActions)["helpAboutQt"]->setTexts( tr("About &Qt"));
1070
        (*scrActions)["helpTooltips"]->setTexts( tr("Toolti&ps"));
1071
        (*scrActions)["helpManual"]->setTexts( tr("Scribus &Manual..."));
2170 cbradney 1072
 
4557 cbradney 1073
        //GUI
1074
        (*scrActions)["specialToggleAllPalettes"]->setTexts( tr("Toggle Palettes"));
1075
        (*scrActions)["specialToggleAllGuides"]->setTexts( tr("Toggle Guides"));
1076
 
1077
        languageChangeUnicodeActions(scrActions);
1078
}
2246 subik 1079
 
4557 cbradney 1080
void ActionManager::languageChangeUnicodeActions(QMap<QString, QGuardedPtr<ScrAction> > *actionMap)
1081
{
2170 cbradney 1082
        //typography
4564 cbradney 1083
        (*actionMap)["unicodeSmartHyphen"]->setMenuText( tr("Smart &Hyphen"));
1084
        (*actionMap)["unicodeNonBreakingHyphen"]->setMenuText( tr("Non Breaking Dash"));
1085
        (*actionMap)["unicodeNonBreakingSpace"]->setMenuText( tr("Non Breaking &Space"));
1086
        (*actionMap)["unicodePageNumber"]->setMenuText( tr("Page &Number"));
1087
        (*actionMap)["unicodeNewLine"]->setMenuText( tr("New Line"));
1088
        (*actionMap)["unicodeFrameBreak"]->setMenuText( tr("Frame Break"));
1089
        (*actionMap)["unicodeColumnBreak"]->setMenuText( tr("Column Break"));
1090
        (*actionMap)["unicodeCopyRight"]->setTexts( tr("Copyright"));
1091
        (*actionMap)["unicodeRegdTM"]->setTexts( tr("Registered Trademark"));
1092
        (*actionMap)["unicodeTM"]->setTexts( tr("Trademark"));
4720 cbradney 1093
        (*actionMap)["unicodeSolidus"]->setTexts( tr("Solidus"));
4564 cbradney 1094
        (*actionMap)["unicodeBullet"]->setTexts( tr("Bullet"));
4720 cbradney 1095
        (*actionMap)["unicodeMidpoint"]->setTexts( tr("Middle Dot"));
4564 cbradney 1096
        (*actionMap)["unicodeDashEm"]->setTexts( tr("Em Dash"));
1097
        (*actionMap)["unicodeDashEn"]->setTexts( tr("En Dash"));
1098
        (*actionMap)["unicodeDashFigure"]->setTexts( tr("Figure Dash"));
1099
        (*actionMap)["unicodeDashQuotation"]->setTexts( tr("Quotation Dash"));
2246 subik 1100
 
4564 cbradney 1101
        (*actionMap)["unicodeQuoteApostrophe"]->setTexts( tr("Apostrophe"));
1102
        (*actionMap)["unicodeQuoteStraight"]->setTexts( tr("Straight Double"));
1103
        (*actionMap)["unicodeQuoteSingleLeft"]->setTexts( tr("Single Left"));
1104
        (*actionMap)["unicodeQuoteSingleRight"]->setTexts( tr("Single Right"));
1105
        (*actionMap)["unicodeQuoteDoubleLeft"]->setTexts( tr("Double Left"));
1106
        (*actionMap)["unicodeQuoteDoubleRight"]->setTexts( tr("Double Right"));
1107
        (*actionMap)["unicodeQuoteSingleReversed"]->setTexts( tr("Single Reversed"));
1108
        (*actionMap)["unicodeQuoteDoubleReversed"]->setTexts( tr("Double Reversed"));
1109
        (*actionMap)["unicodeQuoteSingleLeftGuillemet"]->setTexts( tr("Single Left Guillemet"));
1110
        (*actionMap)["unicodeQuoteSingleRightGuillemet"]->setTexts( tr("Single Right Guillemet"));
1111
        (*actionMap)["unicodeQuoteDoubleLeftGuillemet"]->setTexts( tr("Double Left Guillemet"));
1112
        (*actionMap)["unicodeQuoteDoubleRightGuillemet"]->setTexts( tr("Double Right Guillemet"));
1113
        (*actionMap)["unicodeQuoteLowSingleComma"]->setTexts( tr("Low Single Comma"));
1114
        (*actionMap)["unicodeQuoteLowDoubleComma"]->setTexts( tr("Low Double Comma"));
1115
        (*actionMap)["unicodeQuoteCJKSingleLeft"]->setTexts( tr("CJK Single Left"));
1116
        (*actionMap)["unicodeQuoteCJKSingleRight"]->setTexts( tr("CJK Single Right"));
1117
        (*actionMap)["unicodeQuoteCJKDoubleLeft"]->setTexts( tr("CJK Double Left"));
1118
        (*actionMap)["unicodeQuoteCJKDoubleRight"]->setTexts( tr("CJK Double Right"));
2246 subik 1119
 
4720 cbradney 1120
        (*actionMap)["unicodeSpaceEN"]->setTexts( tr("En Space"));
1121
        (*actionMap)["unicodeSpaceEM"]->setTexts( tr("Em Space"));
1122
        (*actionMap)["unicodeSpaceThin"]->setTexts( tr("Thin Space"));
1123
        (*actionMap)["unicodeSpaceThick"]->setTexts( tr("Thick Space"));
1124
        (*actionMap)["unicodeSpaceMid"]->setTexts( tr("Mid Space"));
1125
        (*actionMap)["unicodeSpaceHair"]->setTexts( tr("Hair Space"));
1126
 
4564 cbradney 1127
        (*actionMap)["unicodeSmartHyphen"]->setText( tr("Insert Smart Hyphen"));
1128
        (*actionMap)["unicodeNonBreakingHyphen"]->setText( tr("Insert Non Breaking Dash"));
1129
        (*actionMap)["unicodeNonBreakingSpace"]->setText( tr("Insert Non Breaking Space"));
1130
        (*actionMap)["unicodePageNumber"]->setText( tr("Insert Page Number"));
1131
        (*actionMap)["unicodeNewLine"]->setText( tr("New Line"));
1132
        (*actionMap)["unicodeFrameBreak"]->setText( tr("Frame Break"));
1133
        (*actionMap)["unicodeColumnBreak"]->setText( tr("Column Break"));
1134
 
1135
        (*actionMap)["unicodeLigature_ff"]->setTexts( tr("ff"));
1136
        (*actionMap)["unicodeLigature_fi"]->setTexts( tr("fi"));
1137
        (*actionMap)["unicodeLigature_fl"]->setTexts( tr("fl"));
1138
        (*actionMap)["unicodeLigature_ffi"]->setTexts( tr("ffi"));
1139
        (*actionMap)["unicodeLigature_ffl"]->setTexts( tr("ffl"));
1140
        (*actionMap)["unicodeLigature_ft"]->setTexts( tr("ft"));
1141
        (*actionMap)["unicodeLigature_st"]->setTexts( tr("st"));
2161 cbradney 1142
}
2256 cbradney 1143