Subversion Repositories Scribus

Rev

Rev 4829 | Rev 4847 | 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);
65
        enableUnicodeActions(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()) );
4713 cbradney 326
        //connect( (*scrActions)["itemDelete"], SIGNAL(activated()), ScMW, SLOT(DeleteObjekt()) );
4026 craig 327
        connect( (*scrActions)["itemGroup"], SIGNAL(activated()), ScMW, SLOT(GroupObj()) );
328
        connect( (*scrActions)["itemUngroup"], SIGNAL(activated()), ScMW, SLOT(UnGroupObj()) );
329
        //connect( (*scrActions)["itemLock"], SIGNAL(activated()), ScMW, SLOT(ToggleObjLock()) );
330
        //connect( (*scrActions)["itemLockSize"], SIGNAL(activated()), ScMW, SLOT(ToggleObjSizeLock()) );
331
        //connect( (*scrActions)["itemPDFIsAnnotation"], SIGNAL(activated()), ScMW, SLOT(ToggleObjPDFAnnotation()) );
332
        //connect( (*scrActions)["itemPDFIsBookmark"], SIGNAL(activated()), ScMW, SLOT(ToggleObjPDFBookmark()) );
333
        connect( (*scrActions)["itemPDFAnnotationProps"], SIGNAL(activated()), ScMW, SLOT(ModifyAnnot()) );
334
        connect( (*scrActions)["itemPDFFieldProps"], SIGNAL(activated()), ScMW, SLOT(ModifyAnnot()) );
335
        //connect( (*scrActions)["itemLowerToBottom"], SIGNAL(activated()), ScMW, SLOT(Objekt2Back()) );
336
        //connect( (*scrActions)["itemRaiseToTop"], SIGNAL(activated()), ScMW, SLOT(Objekt2Front()) );
337
        //connect( (*scrActions)["itemLower"], SIGNAL(activated()), ScMW, SLOT(ObjektLower()) );
338
        //connect( (*scrActions)["itemRaise"], SIGNAL(activated()), ScMW, SLOT(ObjektRaise()) );
339
        connect( (*scrActions)["itemSendToScrapbook"], SIGNAL(activated()), ScMW, SLOT(PutScrap()) );
340
        connect( (*scrActions)["itemAttributes"], SIGNAL(activated()), ScMW, SLOT(objectAttributes()) );
341
        connect( (*scrActions)["itemShapeEdit"], SIGNAL(activated()), ScMW, SLOT(ToggleFrameEdit()) );
342
        connect( (*scrActions)["itemImageInfo"], SIGNAL(activated()), ScMW, SLOT(getImageInfo()) );
343
        //connect( (*scrActions)["itemAttachTextToPath"], SIGNAL(activated()), ScMW, SLOT(Pfadtext()) );
344
        //connect( (*scrActions)["itemDetachTextFromPath"], SIGNAL(activated()), ScMW, SLOT(noPfadtext()) );
345
        //connect( (*scrActions)["itemCombinePolygons"], SIGNAL(activated()), ScMW, SLOT(UniteOb()) );
346
        //connect( (*scrActions)["itemSplitPolygons"], SIGNAL(activated()), ScMW, SLOT(SplitUniteOb()) );
347
        //connect( (*scrActions)["itemConvertToBezierCurve"], SIGNAL(activated()), ScMW, SLOT(convertToBezierCurve()) );
348
        //connect( (*scrActions)["itemConvertToImageFrame"], SIGNAL(activated()), ScMW, SLOT(convertToImageFrame()) );
349
        //connect( (*scrActions)["itemConvertToOutlines"], SIGNAL(activated()), ScMW, SLOT(convertToOutlines()) );
350
        //connect( (*scrActions)["itemConvertToPolygon"], SIGNAL(activated()), ScMW, SLOT(convertToPolygon()) );
351
        //connect( (*scrActions)["itemConvertToTextFrame"], SIGNAL(activated()), ScMW, SLOT(convertToTextFrame()) );
1993 cbradney 352
}
353
 
354
void ActionManager::initInsertMenuActions()
355
{
356
        //Insert Menu
4026 craig 357
        scrActions->insert("insertGlyph", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "insertGlyph"));
358
        scrActions->insert("insertSampleText", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "insertSampleText"));
2246 subik 359
 
4026 craig 360
        connect( (*scrActions)["insertGlyph"], SIGNAL(activated()), ScMW, SLOT(slotCharSelect()) );
361
        connect( (*scrActions)["insertSampleText"], SIGNAL(activated()), ScMW, SLOT(insertSampleText()) );
1993 cbradney 362
}
363
 
364
void ActionManager::initPageMenuActions()
365
{
366
        //Page menu
4026 craig 367
        scrActions->insert("pageInsert", new ScrAction(ScMW, "pageInsert"));
368
        scrActions->insert("pageImport", new ScrAction(ScMW, "pageImport"));
369
        scrActions->insert("pageDelete", new ScrAction(ScMW, "pageDelete"));
370
        scrActions->insert("pageCopy", new ScrAction(ScMW, "pageCopy"));
371
        scrActions->insert("pageMove", new ScrAction(ScMW, "pageMove"));
372
        scrActions->insert("pageApplyMasterPage", new ScrAction(ScMW, "pageApplyMasterPage"));
373
        scrActions->insert("pageCopyToMasterPage", new ScrAction(ScMW, "pageCopyToMasterPage"));
374
        scrActions->insert("pageManageGuides", new ScrAction(ScMW, "pageManageGuides"));
375
        scrActions->insert("pageManageMargins", new ScrAction(ScMW, "pageManageMargins"));
1993 cbradney 376
 
4026 craig 377
        connect( (*scrActions)["pageInsert"], SIGNAL(activated()), ScMW, SLOT(slotNewPageM()) );
378
        connect( (*scrActions)["pageImport"], SIGNAL(activated()), ScMW, SLOT(slotPageImport()) );
379
        connect( (*scrActions)["pageDelete"], SIGNAL(activated()), ScMW, SLOT(DeletePage()) );
380
        connect( (*scrActions)["pageCopy"], SIGNAL(activated()), ScMW, SLOT(CopyPage()) );
381
        connect( (*scrActions)["pageMove"], SIGNAL(activated()), ScMW, SLOT(MovePage()) );
382
        connect( (*scrActions)["pageApplyMasterPage"], SIGNAL(activated()), ScMW, SLOT(ApplyMasterPage()) );
383
        connect( (*scrActions)["pageCopyToMasterPage"], SIGNAL(activated()), ScMW, SLOT(duplicateToMasterPage()) );
384
        connect( (*scrActions)["pageManageGuides"], SIGNAL(activated()), ScMW, SLOT(ManageGuides()) );
385
        connect( (*scrActions)["pageManageMargins"], SIGNAL(activated()), ScMW, SLOT(changePageMargins()) );
1993 cbradney 386
}
387
 
388
void ActionManager::initViewMenuActions()
389
{
4026 craig 390
        scrActions->insert("viewFitInWindow", new ScrAction(ScrAction::DataDouble, QIconSet(), "", CTRL+Key_0, ScMW, "viewFitInWindow", 0, -100.0));
391
        scrActions->insert("viewFit50", new ScrAction(ScrAction::DataDouble, QIconSet(), "", QKeySequence(), ScMW, "viewFit50", 0, 50.0));
392
        scrActions->insert("viewFit75", new ScrAction(ScrAction::DataDouble, QIconSet(), "", QKeySequence(), ScMW, "viewFit75", 0, 75.0));
393
        scrActions->insert("viewFit100", new ScrAction(ScrAction::DataDouble, QIconSet(), "", CTRL+Key_1, ScMW, "viewFit100", 0, 100.0));
394
        scrActions->insert("viewFit200", new ScrAction(ScrAction::DataDouble, QIconSet(), "", QKeySequence(), ScMW, "viewFit200", 0, 200.0));
395
        scrActions->insert("viewFit20", new ScrAction(ScrAction::DataDouble, QIconSet(), "", QKeySequence(), ScMW, "viewFit20", 0, 20.0));
396
        scrActions->insert("viewShowMargins", new ScrAction(ScMW, "viewShowMargins"));
397
        scrActions->insert("viewShowFrames", new ScrAction(ScMW, "viewShowFrames"));
398
        scrActions->insert("viewShowImages", new ScrAction(ScMW, "viewShowImages"));
399
        scrActions->insert("viewShowGrid", new ScrAction(ScMW, "viewShowGrid"));
400
        scrActions->insert("viewShowGuides", new ScrAction(ScMW, "viewShowGuides"));
401
        scrActions->insert("viewShowBaseline", new ScrAction(ScMW, "viewShowBaseline"));
402
        scrActions->insert("viewShowTextChain", new ScrAction(ScMW, "viewShowTextChain"));
403
        scrActions->insert("viewShowTextControls", new ScrAction(ScMW, "viewShowTextControls"));
4651 cbradney 404
        scrActions->insert("viewShowRulers", new ScrAction("", CTRL+SHIFT+Key_R, ScMW, "viewShowRulers"));
4026 craig 405
        scrActions->insert("viewRulerMode", new ScrAction(ScMW, "viewRulerMode"));
406
        scrActions->insert("viewSnapToGrid", new ScrAction(ScMW, "viewSnapToGrid"));
407
        scrActions->insert("viewSnapToGuides", new ScrAction(ScMW, "viewSnapToGuides"));
408
//      scrActions->insert("viewNewView", new ScrAction(ScMW, "viewNewView"));
1993 cbradney 409
 
410
        (*scrActions)["viewShowMargins"]->setToggleAction(true);
411
        (*scrActions)["viewShowFrames"]->setToggleAction(true);
412
        (*scrActions)["viewShowImages"]->setToggleAction(true);
413
        (*scrActions)["viewShowGrid"]->setToggleAction(true);
414
        (*scrActions)["viewShowGuides"]->setToggleAction(true);
415
        (*scrActions)["viewShowBaseline"]->setToggleAction(true);
416
        (*scrActions)["viewShowTextChain"]->setToggleAction(true);
2353 fschmid 417
        (*scrActions)["viewShowTextControls"]->setToggleAction(true);
4651 cbradney 418
        (*scrActions)["viewShowRulers"]->setToggleAction(true);
2863 fschmid 419
        (*scrActions)["viewRulerMode"]->setToggleAction(true);
1993 cbradney 420
        (*scrActions)["viewSnapToGrid"]->setToggleAction(true);
421
        (*scrActions)["viewSnapToGuides"]->setToggleAction(true);
422
 
423
        (*scrActions)["viewShowMargins"]->setOn(true);
424
        (*scrActions)["viewShowFrames"]->setOn(true);
425
        (*scrActions)["viewShowImages"]->setOn(true);
426
        (*scrActions)["viewShowGuides"]->setOn(true);
4651 cbradney 427
        (*scrActions)["viewShowRulers"]->setOn(true);
2863 fschmid 428
        (*scrActions)["viewRulerMode"]->setOn(true);
1993 cbradney 429
 
4026 craig 430
        connect( (*scrActions)["viewFitInWindow"], SIGNAL(activatedData(double)), ScMW, SLOT(slotZoom(double)) );
431
        connect( (*scrActions)["viewFit50"], SIGNAL(activatedData(double)), ScMW, SLOT(slotZoom(double)) );
432
        connect( (*scrActions)["viewFit75"], SIGNAL(activatedData(double)), ScMW, SLOT(slotZoom(double)) );
433
        connect( (*scrActions)["viewFit100"], SIGNAL(activatedData(double)), ScMW, SLOT(slotZoom(double)) );
434
        connect( (*scrActions)["viewFit200"], SIGNAL(activatedData(double)), ScMW, SLOT(slotZoom(double)) );
435
        connect( (*scrActions)["viewFit20"], SIGNAL(activatedData(double)), ScMW, SLOT(slotZoom(double)) );
436
        connect( (*scrActions)["viewShowMargins"], SIGNAL(activated()), ScMW, SLOT(ToggleMarks()) );
437
        connect( (*scrActions)["viewShowFrames"], SIGNAL(activated()), ScMW, SLOT(ToggleFrames()) );
438
        connect( (*scrActions)["viewShowImages"], SIGNAL(activated()), ScMW, SLOT(TogglePics()) );
439
        connect( (*scrActions)["viewShowGrid"], SIGNAL(activated()), ScMW, SLOT(ToggleRaster()) );
440
        connect( (*scrActions)["viewShowGuides"], SIGNAL(activated()), ScMW, SLOT(ToggleGuides()) );
441
        connect( (*scrActions)["viewShowBaseline"], SIGNAL(activated()), ScMW, SLOT(ToggleBase()) );
442
        connect( (*scrActions)["viewShowTextChain"], SIGNAL(activated()), ScMW, SLOT(ToggleTextLinks()) );
443
        connect( (*scrActions)["viewShowTextControls"], SIGNAL(activated()), ScMW, SLOT(ToggleTextControls()) );
4651 cbradney 444
        connect( (*scrActions)["viewShowRulers"], SIGNAL(activated()), ScMW, SLOT(ToggleRulers()) );
445
        connect( (*scrActions)["viewRulerMode"], SIGNAL(activated()), ScMW, SLOT(ToggleRulerMode()) );
4026 craig 446
        connect( (*scrActions)["viewSnapToGrid"], SIGNAL(activated()), ScMW, SLOT(ToggleURaster()) );
447
        connect( (*scrActions)["viewSnapToGuides"], SIGNAL(activated()), ScMW, SLOT(ToggleUGuides()) );
448
//      connect( (*scrActions)["viewNewView"], SIGNAL(activated()), ScMW, SLOT(newView()) );
1993 cbradney 449
 
450
}
451
 
452
void ActionManager::initToolsMenuActions()
453
{
454
        //Tool menu
4781 cbradney 455
        scrActions->insert("toolsProperties", new ScrAction(QIconSet(noIcon),"", Key_F2, ScMW, "toolsProperties"));
4026 craig 456
        scrActions->insert("toolsOutline", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "toolsOutline"));
457
        scrActions->insert("toolsScrapbook", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "toolsScrapbook"));
458
        scrActions->insert("toolsLayers", new ScrAction(QIconSet(noIcon),"", QKeySequence(Key_F6), ScMW, "toolsLayers"));
459
        scrActions->insert("toolsPages", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "toolsPages"));
460
        scrActions->insert("toolsBookmarks", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "toolsBookmarks"));
461
        scrActions->insert("toolsMeasurements", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("dist.png"), loadIcon("dist22.png")), "", QKeySequence(), ScMW, "toolsMeasurements", modeMeasurementTool));
462
        scrActions->insert("toolsActionHistory", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "toolsActionHistory"));
463
        scrActions->insert("toolsPreflightVerifier", new ScrAction(QIconSet(loadIcon("launch16.png"), loadIcon("launch.png")),"", QKeySequence(), ScMW, "toolsPreflightVerifier"));
464
        scrActions->insert("toolsAlignDistribute", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "toolsAlignDistribute"));
465
        scrActions->insert("toolsToolbarTools", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "toolsToolbarTools"));
466
        scrActions->insert("toolsToolbarPDF", new ScrAction(QIconSet(noIcon),"", QKeySequence(), ScMW, "toolsToolbarPDF"));
2246 subik 467
 
1993 cbradney 468
        //toolbar only items
4026 craig 469
        scrActions->insert("toolsSelect", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Kreuz.xpm"), loadIcon("Kreuz.xpm")), "", QKeySequence(Key_C), ScMW, "toolsSelect", modeNormal));
470
        scrActions->insert("toolsInsertTextFrame", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Text16.xpm"), loadIcon("Text.xpm")), "", QKeySequence(Key_T), ScMW, "toolsInsertTextFrame", modeDrawText));
471
        scrActions->insert("toolsInsertImageFrame", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Bild16.xpm"), loadIcon("Bild.xpm")), "", QKeySequence(Key_I), ScMW, "toolsInsertImageFrame", modeDrawPicture));
472
        scrActions->insert("toolsInsertTableFrame", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("frame_table16.png"), loadIcon("frame_table.png")), "", QKeySequence(Key_A), ScMW, "toolsInsertTableFrame", modeDrawTable));
473
        scrActions->insert("toolsInsertShape", new ScrAction(ScrAction::DataInt,QIconSet(), "", QKeySequence(Key_S), ScMW, "toolsInsertShape", modeDrawShapes));
474
        scrActions->insert("toolsInsertPolygon", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("spline16.png"), loadIcon("spline.png")), "", QKeySequence(Key_P), ScMW, "toolsInsertPolygon", modeDrawRegularPolygon));
475
        scrActions->insert("toolsInsertLine", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Stift16.xpm"), loadIcon("Stift.xpm")), "", QKeySequence(Key_L), ScMW, "toolsInsertLine", modeDrawLine));
476
        scrActions->insert("toolsInsertBezier", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("beziertool16.png"), loadIcon("beziertool.png")), "", QKeySequence(Key_B), ScMW, "toolsInsertBezier", modeDrawBezierLine));
477
        scrActions->insert("toolsInsertFreehandLine", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Stiftalt16.xpm"), loadIcon("Stiftalt.xpm")), "", QKeySequence(Key_F), ScMW, "toolsInsertFreehandLine", modeDrawFreehandLine));
2246 subik 478
 
4026 craig 479
        scrActions->insert("toolsRotate", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Rotieren.xpm"), loadIcon("Rotieren.xpm")), "", QKeySequence(Key_R), ScMW, "toolsRotate", modeRotation));
480
        scrActions->insert("toolsZoom", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Lupe.xpm"), loadIcon("Lupe.xpm")), "", QKeySequence(Key_Z), ScMW, "toolsZoom", modeMagnifier));
481
        scrActions->insert("toolsZoomIn", new ScrAction(QIconSet(loadIcon("viewmagin.png"), loadIcon("viewmagin.png")), "", QKeySequence(CTRL+Key_Plus), ScMW, "toolsZoomIn"));
482
        scrActions->insert("toolsZoomOut", new ScrAction(QIconSet(loadIcon("viewmagout.png"), loadIcon("viewmagout.png")), "", QKeySequence(CTRL+Key_Minus), ScMW, "toolsZoomOut"));
483
        scrActions->insert("toolsEditContents", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Editm.xpm"), loadIcon("Editm.xpm")), "", QKeySequence(Key_E), ScMW, "toolsEditContents", modeEdit));
484
        scrActions->insert("toolsEditWithStoryEditor", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("signature2.png"), loadIcon("signature.png")), "", QKeySequence(CTRL+Key_Y), ScMW, "toolsEditWithStoryEditor", modeStoryEditor));
485
        scrActions->insert("toolsLinkTextFrame", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Lock.xpm"), loadIcon("Lock.xpm")), "", QKeySequence(Key_N), ScMW, "toolsLinkTextFrame", modeLinkFrames));
486
        scrActions->insert("toolsUnlinkTextFrame", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("Unlock.xpm"), loadIcon("Unlock.xpm")), "", QKeySequence(Key_U), ScMW, "toolsUnlinkTextFrame", modeUnlinkFrames));
487
        scrActions->insert("toolsEyeDropper", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("colorpicker.png"), loadIcon("colorpicker.png")), "", QKeySequence(Key_Y), ScMW, "toolsEyeDropper", modeEyeDropper));
488
        scrActions->insert("toolsCopyProperties", new ScrAction(ScrAction::DataInt,QIconSet(loadIcon("wizard.png"), loadIcon("wizard.png")), "", QKeySequence(), ScMW, "toolsCopyProperties", modeCopyProperties));
2246 subik 489
 
1993 cbradney 490
        (*scrActions)["toolsProperties"]->setToggleAction(true);
491
        (*scrActions)["toolsOutline"]->setToggleAction(true);
492
        (*scrActions)["toolsScrapbook"]->setToggleAction(true);
493
        (*scrActions)["toolsLayers"]->setToggleAction(true);
494
        (*scrActions)["toolsPages"]->setToggleAction(true);
495
        (*scrActions)["toolsBookmarks"]->setToggleAction(true);
496
        (*scrActions)["toolsMeasurements"]->setToggleAction(true);
497
        (*scrActions)["toolsActionHistory"]->setToggleAction(true);
498
        (*scrActions)["toolsPreflightVerifier"]->setToggleAction(true);
2355 cbradney 499
        (*scrActions)["toolsAlignDistribute"]->setToggleAction(true);
1993 cbradney 500
        (*scrActions)["toolsToolbarTools"]->setToggleAction(true);
501
        (*scrActions)["toolsToolbarPDF"]->setToggleAction(true);
2246 subik 502
 
1993 cbradney 503
        (*scrActions)["toolsSelect"]->setToggleAction(true);
504
        (*scrActions)["toolsInsertTextFrame"]->setToggleAction(true);
505
        (*scrActions)["toolsInsertImageFrame"]->setToggleAction(true);
506
        (*scrActions)["toolsInsertTableFrame"]->setToggleAction(true);
507
        (*scrActions)["toolsInsertShape"]->setToggleAction(true);
508
        (*scrActions)["toolsInsertPolygon"]->setToggleAction(true);
509
        (*scrActions)["toolsInsertLine"]->setToggleAction(true);
510
        (*scrActions)["toolsInsertBezier"]->setToggleAction(true);
511
        (*scrActions)["toolsInsertFreehandLine"]->setToggleAction(true);
512
        (*scrActions)["toolsRotate"]->setToggleAction(true);
513
        (*scrActions)["toolsZoom"]->setToggleAction(true);
514
        (*scrActions)["toolsEditContents"]->setToggleAction(true);
515
        (*scrActions)["toolsEditWithStoryEditor"]->setToggleAction(true);
516
        (*scrActions)["toolsLinkTextFrame"]->setToggleAction(true);
517
        (*scrActions)["toolsUnlinkTextFrame"]->setToggleAction(true);
518
        (*scrActions)["toolsEyeDropper"]->setToggleAction(true);
519
        (*scrActions)["toolsCopyProperties"]->setToggleAction(true);
2246 subik 520
 
1993 cbradney 521
        *modeActionNames << "toolsSelect" << "toolsInsertTextFrame" << "toolsInsertImageFrame" << "toolsInsertTableFrame";
522
        *modeActionNames << "toolsInsertShape" << "toolsInsertPolygon" << "toolsInsertLine" << "toolsInsertBezier";
523
        *modeActionNames << "toolsInsertFreehandLine" << "toolsRotate" << "toolsZoom" << "toolsEditContents";
524
        *modeActionNames << "toolsEditWithStoryEditor" << "toolsLinkTextFrame" << "toolsUnlinkTextFrame";
525
        *modeActionNames << "toolsEyeDropper" << "toolsCopyProperties";
526
 
2104 cbradney 527
        *nonEditActionNames << "itemLowerToBottom" << "itemRaiseToTop" << "itemRaise" << "itemLower";
2246 subik 528
 
4026 craig 529
        connect( (*scrActions)["toolsActionHistory"], SIGNAL(toggled(bool)), ScMW, SLOT(setUndoPalette(bool)) );
2246 subik 530
 
1993 cbradney 531
        connectModeActions();
532
}
533
 
534
void ActionManager::initExtrasMenuActions()
535
{
4026 craig 536
        scrActions->insert("extrasManagePictures", new ScrAction(ScMW, "extrasManagePictures"));
537
        scrActions->insert("extrasHyphenateText", new ScrAction(ScMW, "extrasHyphenateText"));
538
        scrActions->insert("extrasDeHyphenateText", new ScrAction(ScMW, "extrasDeHyphenateText"));
539
        scrActions->insert("extrasGenerateTableOfContents", new ScrAction(ScMW, "extrasGenerateTableOfContents"));
1993 cbradney 540
 
4026 craig 541
        connect( (*scrActions)["extrasManagePictures"], SIGNAL(activated()), ScMW, SLOT(StatusPic()) );
542
        connect( (*scrActions)["extrasGenerateTableOfContents"], SIGNAL(activated()), ScMW, SLOT(generateTableOfContents()) );
1993 cbradney 543
}
544
 
545
 
546
void ActionManager::initWindowsMenuActions()
547
{
4026 craig 548
        scrActions->insert("windowsCascade", new ScrAction( QIconSet(noIcon),"", QKeySequence(), ScMW, "windowsCascade"));
549
        scrActions->insert("windowsTile", new ScrAction( QIconSet(noIcon),"", QKeySequence(), ScMW, "windowstile"));
1993 cbradney 550
}
551
 
552
void ActionManager::initScriptMenuActions()
553
{
554
}
555
 
556
void ActionManager::initHelpMenuActions()
557
{
4026 craig 558
        scrActions->insert("helpAboutScribus", new ScrAction(ScMW, "helpAboutScribus"));
559
        scrActions->insert("helpAboutPlugins", new ScrAction(ScMW, "helpAboutPlugins"));
560
        scrActions->insert("helpAboutQt", new ScrAction(ScMW, "helpAboutQt"));
561
        scrActions->insert("helpTooltips", new ScrAction(ScMW, "helpTooltips"));
562
        scrActions->insert("helpManual", new ScrAction("", Key_F1, ScMW, "helpManual"));
1993 cbradney 563
 
564
        (*scrActions)["helpTooltips"]->setToggleAction(true);
565
        (*scrActions)["helpTooltips"]->setOn(true);
566
 
4026 craig 567
        connect( (*scrActions)["helpAboutScribus"], SIGNAL(activated()), ScMW, SLOT(slotHelpAbout()) );
568
        connect( (*scrActions)["helpAboutPlugins"], SIGNAL(activated()), ScMW, SLOT(slotHelpAboutPlugins()) );
569
        connect( (*scrActions)["helpAboutQt"], SIGNAL(activated()), ScMW, SLOT(slotHelpAboutQt()) );
570
        connect( (*scrActions)["helpTooltips"], SIGNAL(activated()), ScMW, SLOT(ToggleTips()) );
571
        connect( (*scrActions)["helpManual"], SIGNAL(activated()), ScMW, SLOT(slotOnlineHelp()) );
1993 cbradney 572
}
573
 
4557 cbradney 574
void ActionManager::initUnicodeActions(QMap<QString, QGuardedPtr<ScrAction> > *actionMap, QWidget *actionParent, QStringList *actionNamesList)
1993 cbradney 575
{
576
        //typography
4564 cbradney 577
        actionMap->insert("unicodeSmartHyphen", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", CTRL+SHIFT+Key_Minus, actionParent, "unicodeSmartHyphen",-1));
578
        actionMap->insert("unicodeNonBreakingHyphen", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", CTRL+ALT+Key_Minus, actionParent, "unicodeNonBreakingHyphen",24));
579
        actionMap->insert("unicodeNonBreakingSpace", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", CTRL+Key_Space, actionParent, "unicodeNonBreakingSpace",29));
580
        actionMap->insert("unicodePageNumber", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", CTRL+SHIFT+ALT+Key_P, actionParent, "unicodePageNumber",30));
4720 cbradney 581
        //Spaces
582
        actionMap->insert("unicodeSpaceEN", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeSpaceEN",0x2002));
583
        actionMap->insert("unicodeSpaceEM", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeSpaceEM",0x2003));
584
        actionMap->insert("unicodeSpaceThin", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeSpaceThin",0x2009));
585
        actionMap->insert("unicodeSpaceThick", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeSpaceThick",0x2004));
586
        actionMap->insert("unicodeSpaceMid", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeSpaceMid",0x2005));
587
        actionMap->insert("unicodeSpaceHair", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeSpaceHair",0x200A));
4564 cbradney 588
        //Breaks
589
        actionMap->insert("unicodeNewLine", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", SHIFT+Key_Return, actionParent, "unicodeNewLine",28));
590
        actionMap->insert("unicodeFrameBreak", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", CTRL+Key_Return, actionParent, "unicodeFrameBreak",27));
591
        actionMap->insert("unicodeColumnBreak", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", CTRL+SHIFT+Key_Return, actionParent, "unicodeColumnBreak",26));
592
        //Special
593
        actionMap->insert("unicodeCopyRight", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeCopyRight",0x0A9));
594
        actionMap->insert("unicodeRegdTM", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeRegdTM",0x00AE));
595
        actionMap->insert("unicodeTM", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeTM",0x2122));
596
        actionMap->insert("unicodeBullet", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeBullet",0x2022));
4720 cbradney 597
        actionMap->insert("unicodeMidpoint", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeMidpoint",0x00B7));
598
        actionMap->insert("unicodeSolidus", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeSolidus",0x2044));
4564 cbradney 599
        //Dashes
600
        actionMap->insert("unicodeDashEm", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeDashEm",0x2014));
601
        actionMap->insert("unicodeDashEn", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeDashEn",0x2013));
602
        actionMap->insert("unicodeDashFigure", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeDashFigure",0x2012));
603
        actionMap->insert("unicodeDashQuotation", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeDashQuotation",0x2015));
604
        //Quotes
605
        actionMap->insert("unicodeQuoteApostrophe", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteApostrophe",0x0027));
606
        actionMap->insert("unicodeQuoteStraight", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteStraight",0x0022));
607
        actionMap->insert("unicodeQuoteSingleLeft", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteSingleLeft",0x2018));
608
        actionMap->insert("unicodeQuoteSingleRight", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteSingleRight",0x2019));
609
        actionMap->insert("unicodeQuoteDoubleLeft", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteDoubleLeft",0x201C));
610
        actionMap->insert("unicodeQuoteDoubleRight", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteDoubleRight",0x201D));
611
        actionMap->insert("unicodeQuoteSingleReversed", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteSingleReversed",0x201B));
612
        actionMap->insert("unicodeQuoteDoubleReversed", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteDoubleReversed",0x201F));
613
        actionMap->insert("unicodeQuoteSingleLeftGuillemet", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteSingleLeftGuillemet",0x2039));
614
        actionMap->insert("unicodeQuoteSingleRightGuillemet", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteSingleRightGuillemet",0x203A));
615
        actionMap->insert("unicodeQuoteDoubleLeftGuillemet", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteDoubleLeftGuillemet",0x00AB));
616
        actionMap->insert("unicodeQuoteDoubleRightGuillemet", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteDoubleRightGuillemet",0x00BB));
617
        actionMap->insert("unicodeQuoteLowSingleComma", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteLowSingleComma",0x201A));
618
        actionMap->insert("unicodeQuoteLowDoubleComma", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteLowDoubleComma",0x201E));
619
        actionMap->insert("unicodeQuoteCJKSingleLeft", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteCJKSingleLeft",0x300C));
620
        actionMap->insert("unicodeQuoteCJKSingleRight", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteCJKSingleRight",0x300D));
621
        actionMap->insert("unicodeQuoteCJKDoubleLeft", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteCJKDoubleLeft",0x300E));
622
        actionMap->insert("unicodeQuoteCJKDoubleRight", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeQuoteCJKDoubleRight",0x300F));
623
        //Ligatures
624
        actionMap->insert("unicodeLigature_ff", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeLigature_ff",0xFB00));
625
        actionMap->insert("unicodeLigature_fi", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeLigature_fi",0xFB01));
626
        actionMap->insert("unicodeLigature_fl", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeLigature_fl",0xFB02));
627
        actionMap->insert("unicodeLigature_ffi", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeLigature_ffi",0xFB03));
628
        actionMap->insert("unicodeLigature_ffl", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeLigature_ffl",0xFB04));
629
        actionMap->insert("unicodeLigature_ft", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeLigature_ft",0xFB05));
630
        actionMap->insert("unicodeLigature_st", new ScrAction(ScrAction::UnicodeChar, QIconSet(), "", QKeySequence(), actionParent, "unicodeLigature_st",0xFB06));
631
 
2391 cbradney 632
        //Spaces and special characters
4564 cbradney 633
        *actionNamesList << "unicodeSmartHyphen" << "unicodeNonBreakingHyphen" << "unicodeNonBreakingSpace" << "unicodePageNumber";
4720 cbradney 634
        *actionNamesList << "unicodeSpaceEN" << "unicodeSpaceEM" << "unicodeSpaceThin" << "unicodeSpaceThick" << "unicodeSpaceMid" << "unicodeSpaceHair";
2391 cbradney 635
        //Breaks
4564 cbradney 636
        *actionNamesList << "unicodeNewLine" << "unicodeFrameBreak" << "unicodeColumnBreak";
2391 cbradney 637
        //Copyrights and TMs
4564 cbradney 638
        *actionNamesList << "unicodeCopyRight" << "unicodeRegdTM" << "unicodeTM";
4720 cbradney 639
        //Slashes
640
        *actionNamesList << "unicodeSolidus";
2391 cbradney 641
        //Bullets
4720 cbradney 642
        *actionNamesList << "unicodeBullet" << "unicodeMidpoint";
2391 cbradney 643
        //Dashes
4564 cbradney 644
        *actionNamesList << "unicodeDashEm" << "unicodeDashEn" << "unicodeDashFigure" << "unicodeDashQuotation";
2391 cbradney 645
        //Straight quotes
4564 cbradney 646
        *actionNamesList << "unicodeQuoteApostrophe" << "unicodeQuoteStraight";
2391 cbradney 647
        //Double quotes
4564 cbradney 648
        *actionNamesList << "unicodeQuoteDoubleLeft" << "unicodeQuoteDoubleRight" << "unicodeQuoteSingleLeft" << "unicodeQuoteSingleRight";
2391 cbradney 649
        //Alternative single quotes
4564 cbradney 650
        *actionNamesList << "unicodeQuoteSingleReversed" << "unicodeQuoteDoubleReversed";
2391 cbradney 651
        //French quotes
4564 cbradney 652
        *actionNamesList << "unicodeQuoteSingleLeftGuillemet" << "unicodeQuoteSingleRightGuillemet" << "unicodeQuoteDoubleLeftGuillemet" << "unicodeQuoteDoubleRightGuillemet";
2391 cbradney 653
        //German quotes
4564 cbradney 654
        *actionNamesList << "unicodeQuoteLowSingleComma" << "unicodeQuoteLowDoubleComma";
2391 cbradney 655
        //CJK Quotes
4564 cbradney 656
        *actionNamesList << "unicodeQuoteCJKSingleLeft" << "unicodeQuoteCJKSingleRight" << "unicodeQuoteCJKDoubleLeft" << "unicodeQuoteCJKDoubleRight";
657
        //Ligatures
658
        *actionNamesList << "unicodeLigature_ff" << "unicodeLigature_fi" << "unicodeLigature_fl" << "unicodeLigature_ffi" << "unicodeLigature_ffl" << "unicodeLigature_ft" << "unicodeLigature_st";
659
 
4557 cbradney 660
        for ( QStringList::Iterator it = actionNamesList->begin(); it != actionNamesList->end(); ++it )
661
                connect( (*actionMap)[*it], SIGNAL(activatedUnicodeShortcut(QString, int)), actionParent, SLOT(specialActionKeyEvent(QString, int)) );
662
}
1993 cbradney 663
 
4557 cbradney 664
void ActionManager::initSpecialActions()
665
{
1993 cbradney 666
        //GUI
4026 craig 667
        scrActions->insert("specialToggleAllPalettes", new ScrAction(ScrAction::DataQString, QIconSet(), "", Key_F10, ScMW, "specialToggleAllPalettes",0,0.0,"specialToggleAllPalettes"));
668
        scrActions->insert("specialToggleAllGuides", new ScrAction(ScrAction::DataQString, QIconSet(), "", Key_F11, ScMW, "specialToggleAllGuides",0,0.0,"specialToggleAllGuides"));
1993 cbradney 669
 
4026 craig 670
        connect( (*scrActions)["specialToggleAllPalettes"], SIGNAL(activated()), ScMW, SLOT(ToggleAllPalettes()) );
671
        connect( (*scrActions)["specialToggleAllGuides"], SIGNAL(activated()), ScMW, SLOT(ToggleAllGuides()) );
1993 cbradney 672
}
673
 
674
void ActionManager::disconnectModeActions()
675
{
676
        for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
4026 craig 677
                disconnect( (*scrActions)[*it], SIGNAL(toggledData(bool, int)) , ScMW, SLOT(setAppModeByToggle(bool, int)) );
1993 cbradney 678
}
2246 subik 679
 
1993 cbradney 680
void ActionManager::connectModeActions()
681
{
682
        for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
4026 craig 683
                connect( (*scrActions)[*it], SIGNAL(toggledData(bool, int)) , ScMW, SLOT(setAppModeByToggle(bool, int)) );
1993 cbradney 684
}
685
 
4688 cbradney 686
void ActionManager::disconnectNewDocActions()
687
{
688
        disconnect( (*scrActions)["itemLock"], 0, 0, 0);
689
        disconnect( (*scrActions)["itemLockSize"], 0, 0, 0);
4698 cbradney 690
        disconnect( (*scrActions)["itemPrintingEnabled"], 0, 0, 0);
4699 cbradney 691
        disconnect( (*scrActions)["itemFlipH"], 0, 0, 0);
692
        disconnect( (*scrActions)["itemFlipV"], 0, 0, 0);
4688 cbradney 693
        disconnect( (*scrActions)["itemUpdateImage"], 0, 0, 0 );
4713 cbradney 694
        disconnect( (*scrActions)["itemDelete"], 0, 0, 0);
695
        disconnect( (*scrActions)["extrasHyphenateText"], 0, 0, 0 );
696
        disconnect( (*scrActions)["extrasDeHyphenateText"], 0, 0, 0 );
697
 
4688 cbradney 698
}
699
 
700
void ActionManager::connectNewDocActions(ScribusDoc *currDoc)
701
{
702
        if (currDoc==NULL)
703
                return;
704
        connect( (*scrActions)["itemLock"], SIGNAL(activated()), currDoc, SLOT(itemSelection_ToggleLock()) );
705
        connect( (*scrActions)["itemLockSize"], SIGNAL(activated()), currDoc, SLOT(itemSelection_ToggleSizeLock()));
4698 cbradney 706
        connect( (*scrActions)["itemPrintingEnabled"], SIGNAL(activated()), currDoc, SLOT(itemSelection_TogglePrintEnabled()));
4699 cbradney 707
        connect( (*scrActions)["itemFlipH"], SIGNAL(activated()), currDoc, SLOT(itemSelection_FlipH()));
708
        connect( (*scrActions)["itemFlipV"], SIGNAL(activated()), currDoc, SLOT(itemSelection_FlipV()));
4688 cbradney 709
        connect( (*scrActions)["itemUpdateImage"], SIGNAL(activated()), currDoc, SLOT(updatePic()) );
4713 cbradney 710
        connect( (*scrActions)["extrasHyphenateText"], SIGNAL(activated()), currDoc, SLOT(itemSelection_DoHyphenate()) );
711
        connect( (*scrActions)["extrasDeHyphenateText"], SIGNAL(activated()), currDoc, SLOT(itemSelection_DoDeHyphenate()) );
712
        connect( (*scrActions)["itemDelete"], SIGNAL(activated()), currDoc, SLOT(itemSelection_DeleteItem()) );
4688 cbradney 713
}
714
 
2026 cbradney 715
void ActionManager::disconnectNewViewActions()
716
{
717
        disconnect( (*scrActions)["toolsZoomIn"], 0, 0, 0);
718
        disconnect( (*scrActions)["toolsZoomOut"], 0, 0, 0);
2104 cbradney 719
        disconnect( (*scrActions)["itemLowerToBottom"], 0, 0, 0);
2026 cbradney 720
        disconnect( (*scrActions)["itemImageIsVisible"], 0, 0, 0);
2256 cbradney 721
        disconnect( (*scrActions)["itemPreviewLow"], SIGNAL(activatedData(int)), 0, 0 );
722
        disconnect( (*scrActions)["itemPreviewNormal"], SIGNAL(activatedData(int)), 0,0 );
723
        disconnect( (*scrActions)["itemPreviewFull"], SIGNAL(activatedData(int)), 0, 0 );
2026 cbradney 724
        disconnect( (*scrActions)["itemRaise"], 0, 0, 0);
725
        disconnect( (*scrActions)["itemLower"], 0, 0, 0);
726
        disconnect( (*scrActions)["itemCombinePolygons"], 0, 0, 0);
727
        disconnect( (*scrActions)["itemSplitPolygons"], 0, 0, 0);
728
        disconnect( (*scrActions)["itemConvertToBezierCurve"], 0, 0, 0);
729
        disconnect( (*scrActions)["itemConvertToImageFrame"], 0, 0, 0);
730
        disconnect( (*scrActions)["itemConvertToOutlines"], 0, 0, 0);
731
        disconnect( (*scrActions)["itemConvertToPolygon"], 0, 0, 0);
732
        disconnect( (*scrActions)["itemConvertToTextFrame"], 0, 0, 0);
733
        disconnect( (*scrActions)["itemAttachTextToPath"], 0, 0, 0);
734
        disconnect( (*scrActions)["itemDetachTextFromPath"], 0, 0, 0);
4688 cbradney 735
        //disconnect( (*scrActions)["itemLock"], 0, 0, 0);
736
        //disconnect( (*scrActions)["itemLockSize"], 0, 0, 0);
2259 cbradney 737
        disconnect( (*scrActions)["itemAdjustFrameToImage"], 0, 0, 0 );
4688 cbradney 738
        //disconnect( (*scrActions)["itemUpdateImage"], 0, 0, 0 );
2260 cbradney 739
        disconnect( (*scrActions)["itemExtendedImageProperties"], 0, 0, 0 );
2026 cbradney 740
}
2246 subik 741
 
2026 cbradney 742
void ActionManager::connectNewViewActions(ScribusView *currView)
743
{
744
        if (currView==NULL)
745
                return;
746
        connect( (*scrActions)["toolsZoomIn"], SIGNAL(activated()) , currView, SLOT(slotZoomIn()) );
747
        connect( (*scrActions)["toolsZoomOut"], SIGNAL(activated()) , currView, SLOT(slotZoomOut()) );
2104 cbradney 748
        connect( (*scrActions)["itemLowerToBottom"], SIGNAL(activated()), currView, SLOT(ToBack()) );
749
        connect( (*scrActions)["itemRaiseToTop"], SIGNAL(activated()), currView, SLOT(ToFront()) );
2026 cbradney 750
        connect( (*scrActions)["itemRaise"], SIGNAL(activated()), currView, SLOT(RaiseItem()) );
751
        connect( (*scrActions)["itemLower"], SIGNAL(activated()), currView, SLOT(LowerItem()) );
752
        connect( (*scrActions)["itemCombinePolygons"], SIGNAL(activated()), currView, SLOT(UniteObj()) );
753
        connect( (*scrActions)["itemSplitPolygons"], SIGNAL(activated()), currView, SLOT(SplitObj()) );
754
        connect( (*scrActions)["itemConvertToBezierCurve"], SIGNAL(activated()), currView, SLOT(ToBezierFrame()) );
755
        connect( (*scrActions)["itemConvertToImageFrame"], SIGNAL(activated()), currView, SLOT(ToPicFrame()) );
756
        connect( (*scrActions)["itemConvertToOutlines"], SIGNAL(activated()), currView, SLOT(TextToPath()) );
757
        connect( (*scrActions)["itemConvertToPolygon"], SIGNAL(activated()), currView, SLOT(ToPolyFrame()) );
758
        connect( (*scrActions)["itemConvertToTextFrame"], SIGNAL(activated()), currView, SLOT(ToTextFrame()) );
759
        connect( (*scrActions)["itemAttachTextToPath"], SIGNAL(activated()), currView, SLOT(ToPathText()) );
760
        connect( (*scrActions)["itemDetachTextFromPath"], SIGNAL(activated()), currView, SLOT(FromPathText()) );
4688 cbradney 761
        //connect( (*scrActions)["itemLock"], SIGNAL(activated()), currView, SLOT(ToggleLock()) );
762
        //connect( (*scrActions)["itemLockSize"], SIGNAL(activated()), currView, SLOT(ToggleSizeLock()) );
3942 cbradney 763
        connect( (*scrActions)["itemAdjustFrameToImage"], SIGNAL(activated()), currView, SLOT(adjustFrametoImageSize()) );
4688 cbradney 764
        //connect( (*scrActions)["itemUpdateImage"], SIGNAL(activated()), currView, SLOT(UpdatePic()) );
2260 cbradney 765
        connect( (*scrActions)["itemExtendedImageProperties"], SIGNAL(activated()), currView, SLOT(editExtendedImageProperties()) );
2026 cbradney 766
}
767
 
768
void ActionManager::disconnectNewSelectionActions()
769
{
770
        disconnect( (*scrActions)["itemImageIsVisible"], 0, 0, 0);
4705 cbradney 771
        //Only disconnect activatedData for data based actions or you will disconnect the internal signal
772
        disconnect( (*scrActions)["itemPreviewLow"], SIGNAL(activatedData(int)) , 0, 0);
773
        disconnect( (*scrActions)["itemPreviewNormal"], SIGNAL(activatedData(int)) , 0, 0);
774
        disconnect( (*scrActions)["itemPreviewFull"], SIGNAL(activatedData(int)) , 0, 0);
775
        disconnect( (*scrActions)["editClearContents"], 0, 0, 0);
2026 cbradney 776
}
777
 
4688 cbradney 778
void ActionManager::connectNewSelectionActions(ScribusView *currView, ScribusDoc* currDoc)
2026 cbradney 779
{
4705 cbradney 780
        connect( (*scrActions)["itemImageIsVisible"], SIGNAL(toggled(bool)), currDoc, SLOT(itemSelection_ToggleImageShown()) );
781
        connect( (*scrActions)["itemPreviewLow"], SIGNAL(activatedData(int)), currDoc, SLOT(itemSelection_ChangePreviewResolution(int)) );
782
        connect( (*scrActions)["itemPreviewNormal"], SIGNAL(activatedData(int)), currDoc, SLOT(itemSelection_ChangePreviewResolution(int)) );
783
        connect( (*scrActions)["itemPreviewFull"], SIGNAL(activatedData(int)), currDoc, SLOT(itemSelection_ChangePreviewResolution(int)) );
784
        connect( (*scrActions)["editClearContents"], SIGNAL(activated()), currDoc, SLOT(itemSelection_ClearItem()) );
2026 cbradney 785
}
2246 subik 786
 
1993 cbradney 787
void ActionManager::saveActionShortcutsPreEditMode()
788
{
789
        for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
790
                (*scrActions)[*it]->saveShortcut();
791
        for ( QStringList::Iterator it = nonEditActionNames->begin(); it != nonEditActionNames->end(); ++it )
2246 subik 792
                (*scrActions)[*it]->saveShortcut();
1993 cbradney 793
 
794
}
795
 
796
void ActionManager::restoreActionShortcutsPostEditMode()
797
{
798
        for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
799
                (*scrActions)[*it]->restoreShortcut();
800
        for ( QStringList::Iterator it = nonEditActionNames->begin(); it != nonEditActionNames->end(); ++it )
2246 subik 801
                (*scrActions)[*it]->restoreShortcut();
1993 cbradney 802
}
803
 
1995 cbradney 804
void ActionManager::enableActionStringList(QStringList *list, bool enabled, bool checkingUnicode)
1993 cbradney 805
{
806
        for ( QStringList::Iterator it = list->begin(); it != list->end(); ++it )
807
        {
808
                if(!checkingUnicode)
809
                        (*scrActions)[*it]->setEnabled(enabled);
810
                else
811
                {
812
                        //For UnicodeChar actions, only enable when the current font has that character.
4026 craig 813
                        if (ScMW->HaveDoc && (*scrActions)[*it]->actionType()==ScrAction::UnicodeChar)
1993 cbradney 814
                        {
815
                                int charCode=(*scrActions)[*it]->actionInt();
2246 subik 816
                                if(charCode==-1 ||
2407 fschmid 817
                                   charCode==24 ||
2384 fschmid 818
                                   charCode==26 ||
2352 fschmid 819
                                   charCode==27 ||
820
                                   charCode==28 ||
2246 subik 821
                                   charCode==29 ||
822
                                   charCode==30 ||
4026 craig 823
                                   (*ScMW->doc->AllFonts)[ScMW->doc->CurrFont]->CharWidth.contains(charCode) )
1993 cbradney 824
                                        (*scrActions)[*it]->setEnabled(enabled);
825
                        }
826
                }
827
        }
828
}
1995 cbradney 829
 
830
void ActionManager::enableUnicodeActions(bool enabled)
831
{
832
        enableActionStringList(unicodeCharActionNames, enabled, enabled);
833
}
2103 cbradney 834
 
2108 cbradney 835
void ActionManager::setPDFActions(ScribusView *currView)
2103 cbradney 836
{
2108 cbradney 837
        if (currView==NULL)
2103 cbradney 838
                return;
3934 cbradney 839
        //PageItem* currItem = currView->SelItem.at(0);
4026 craig 840
        PageItem* currItem = ScMW->doc->selection->itemAt(0);
2103 cbradney 841
        if (currItem==NULL)
842
                return;
843
 
844
        disconnect( (*scrActions)["itemPDFIsBookmark"], 0, 0, 0);
845
        disconnect( (*scrActions)["itemPDFIsAnnotation"], 0, 0, 0);
2246 subik 846
 
3625 avox 847
        if (!currItem->asTextFrame())
2103 cbradney 848
        {
849
                (*scrActions)["itemPDFIsAnnotation"]->setEnabled(false);
850
                (*scrActions)["itemPDFIsBookmark"]->setEnabled(false);
851
                (*scrActions)["itemPDFIsAnnotation"]->setOn(false);
852
                (*scrActions)["itemPDFIsBookmark"]->setOn(false);
853
                (*scrActions)["itemPDFAnnotationProps"]->setEnabled(false);
854
                (*scrActions)["itemPDFFieldProps"]->setEnabled(false);
855
                return;
856
        }
857
 
858
        (*scrActions)["itemPDFIsAnnotation"]->setEnabled(true);
859
        (*scrActions)["itemPDFIsBookmark"]->setEnabled(true);
4084 cbradney 860
        (*scrActions)["itemPDFIsAnnotation"]->setOn(currItem->isAnnotation());
2103 cbradney 861
        (*scrActions)["itemPDFIsBookmark"]->setOn(currItem->isBookmark);
4084 cbradney 862
        if (currItem->isAnnotation())
2103 cbradney 863
        {
4084 cbradney 864
                int aType=currItem->annotation().Type();
865
                bool setter=((aType == 0) || (aType == 1) || (aType > 9));
2103 cbradney 866
                (*scrActions)["itemPDFAnnotationProps"]->setEnabled(setter);
867
                (*scrActions)["itemPDFFieldProps"]->setEnabled(!setter);
868
        }
869
        else
870
        {
871
                (*scrActions)["itemPDFAnnotationProps"]->setEnabled(false);
872
                (*scrActions)["itemPDFFieldProps"]->setEnabled(false);
873
        }
2108 cbradney 874
        connect( (*scrActions)["itemPDFIsAnnotation"], SIGNAL(activated()), currView, SLOT(ToggleAnnotation()) );
875
        connect( (*scrActions)["itemPDFIsBookmark"], SIGNAL(activated()), currView, SLOT(ToggleBookmark()) );
2103 cbradney 876
}
2161 cbradney 877
 
878
void ActionManager::languageChange()
879
{
2170 cbradney 880
        //File Menu
2352 fschmid 881
        (*scrActions)["fileNew"]->setTexts( tr("&New"));
882
        (*scrActions)["fileOpen"]->setTexts( tr("&Open..."));
883
        (*scrActions)["fileClose"]->setTexts( tr("&Close"));
884
        (*scrActions)["fileSave"]->setTexts( tr("&Save"));
885
        (*scrActions)["fileSaveAs"]->setTexts( tr("Save &As..."));
886
        (*scrActions)["fileRevert"]->setTexts( tr("Re&vert to Saved"));
887
        (*scrActions)["fileCollect"]->setTexts( tr("Collect for O&utput..."));
888
        (*scrActions)["fileImportText"]->setTexts( tr("Get Text..."));
889
        (*scrActions)["fileImportAppendText"]->setTexts( tr("Append &Text..."));
890
        (*scrActions)["fileImportImage"]->setTexts( tr("Get Image..."));
891
        (*scrActions)["fileExportText"]->setTexts( tr("Save &Text..."));
892
        (*scrActions)["fileExportAsEPS"]->setTexts( tr("Save Page as &EPS..."));
893
        (*scrActions)["fileExportAsPDF"]->setTexts( tr("Save as P&DF..."));
894
        (*scrActions)["fileDocSetup"]->setTexts( tr("Document &Setup..."));
895
        (*scrActions)["filePrint"]->setTexts( tr("&Print..."));
3165 fschmid 896
        (*scrActions)["PrintPreview"]->setTexts( tr("Print Previe&w"));
2352 fschmid 897
        (*scrActions)["fileQuit"]->setTexts( tr("&Quit"));
2170 cbradney 898
        //Edit Menu
2352 fschmid 899
        (*scrActions)["editUndoAction"]->setTexts( tr("&Undo"));
900
        (*scrActions)["editRedoAction"]->setTexts( tr("&Redo"));
901
        (*scrActions)["editActionMode"]->setTexts( tr("&Item Action Mode"));
902
        (*scrActions)["editCut"]->setTexts( tr("Cu&t"));
903
        (*scrActions)["editCopy"]->setTexts( tr("&Copy"));
904
        (*scrActions)["editPaste"]->setTexts( tr("&Paste"));
4579 cbradney 905
        (*scrActions)["editCopyContents"]->setTexts( tr("Copy Contents"));
906
        (*scrActions)["editPasteContents"]->setTexts( tr("Paste Contents"));
4831 cbradney 907
        (*scrActions)["editPasteContentsAbs"]->setTexts( tr("Paste Contents (Absolute)"));
2352 fschmid 908
        (*scrActions)["editClearContents"]->setTexts( tr("C&lear Contents"));
909
        (*scrActions)["editSelectAll"]->setTexts( tr("Select &All"));
910
        (*scrActions)["editDeselectAll"]->setTexts( tr("&Deselect All"));
911
        (*scrActions)["editSearchReplace"]->setTexts( tr("&Search/Replace..."));
912
        (*scrActions)["editEditWithImageEditor"]->setTexts( tr("Edit Image..."));
913
        (*scrActions)["editColors"]->setTexts( tr("C&olors..."));
4829 tsoots 914
        (*scrActions)["editStyles"]->setTexts( tr("S&tyles..."));
2352 fschmid 915
        (*scrActions)["editParaStyles"]->setTexts( tr("&Paragraph Styles..."));
916
        (*scrActions)["editLineStyles"]->setTexts( tr("&Line Styles..."));
917
        (*scrActions)["editMasterPages"]->setTexts( tr("&Master Pages..."));
3142 cbradney 918
        (*scrActions)["editJavascripts"]->setTexts( tr("&JavaScripts..."));
2352 fschmid 919
        (*scrActions)["editPreferences"]->setTexts( tr("P&references..."));
2246 subik 920
 
2170 cbradney 921
        int font_sizes[] = {7, 9, 10, 11, 12, 14, 18, 24, 36, 48, 60, 72};
922
        size_t f_size = sizeof(font_sizes) / sizeof(*font_sizes);
923
        for (uint s = 0; s < f_size; ++s)
924
        {
925
                QString fontSizeName=QString("fontSize%1").arg(font_sizes[s]);
2352 fschmid 926
                (*scrActions)[fontSizeName]->setTexts( tr("%1 pt").arg(font_sizes[s]));
2170 cbradney 927
        }
2352 fschmid 928
        (*scrActions)["fontSizeOther"]->setTexts( tr("&Other..."));
929
        (*scrActions)["alignLeft"]->setTexts( tr("&Left"));
930
        (*scrActions)["alignCenter"]->setTexts( tr("&Center"));
931
        (*scrActions)["alignRight"]->setTexts( tr("&Right"));
932
        (*scrActions)["alignBlock"]->setTexts( tr("&Block"));
933
        (*scrActions)["alignForced"]->setTexts( tr("&Forced"));
2170 cbradney 934
 
935
        for (uint i=0; i<=100 ; i+=10)
936
        {
937
                QString shadeName=QString("shade%1").arg(i);
2352 fschmid 938
                (*scrActions)[shadeName]->setTexts( tr("&%1 %").arg(i));
2170 cbradney 939
        }
940
 
2352 fschmid 941
        (*scrActions)["shadeOther"]->setTexts( tr("&Other..."));
942
        (*scrActions)["typeEffectNormal"]->setTexts( tr("&Normal"));
943
        (*scrActions)["typeEffectUnderline"]->setTexts( tr("&Underline"));
944
        (*scrActions)["typeEffectUnderlineWords"]->setTexts( tr("Underline &Words"));
945
        (*scrActions)["typeEffectStrikeThrough"]->setTexts( tr("&Strike Through"));
946
        (*scrActions)["typeEffectAllCaps"]->setTexts( tr("&All Caps"));
947
        (*scrActions)["typeEffectSmallCaps"]->setTexts( tr("Small &Caps"));
948
        (*scrActions)["typeEffectSuperscript"]->setTexts( tr("Su&perscript"));
949
        (*scrActions)["typeEffectSubscript"]->setTexts( tr("Su&bscript"));
950
        (*scrActions)["typeEffectOutline"]->setTexts( tr("&Outline"));
951
        (*scrActions)["typeEffectShadow"]->setTexts( tr("S&hadow"));
2170 cbradney 952
 
4572 cbradney 953
        (*scrActions)["styleImageEffects"]->setTexts( tr("&Image Effects"));
2352 fschmid 954
        (*scrActions)["styleTabulators"]->setTexts( tr("&Tabulators..."));
2246 subik 955
 
2170 cbradney 956
        //Item Menu
2352 fschmid 957
        (*scrActions)["itemDuplicate"]->setTexts( tr("D&uplicate"));
958
        (*scrActions)["itemMulDuplicate"]->setTexts( tr("&Multiple Duplicate"));
959
        (*scrActions)["itemDelete"]->setTexts( tr("&Delete"));
960
        (*scrActions)["itemGroup"]->setTexts( tr("&Group"));
961
        (*scrActions)["itemUngroup"]->setTexts( tr("&Ungroup"));
962
        (*scrActions)["itemLock"]->setTexts( tr("Is &Locked"));
963
        (*scrActions)["itemLockSize"]->setTexts( tr("Si&ze is Locked"));
4698 cbradney 964
        (*scrActions)["itemPrintingEnabled"]->setTexts( tr("&Printing Enabled"));
4699 cbradney 965
        (*scrActions)["itemFlipH"]->setTexts( tr("&Flip Horizontally"));
966
        (*scrActions)["itemFlipV"]->setTexts( tr("&Flip Vertically"));
2352 fschmid 967
        (*scrActions)["itemLowerToBottom"]->setTexts( tr("Lower to &Bottom"));
968
        (*scrActions)["itemRaiseToTop"]->setTexts( tr("Raise to &Top"));
969
        (*scrActions)["itemLower"]->setTexts( tr("&Lower"));
970
        (*scrActions)["itemRaise"]->setTexts( tr("&Raise"));
971
        (*scrActions)["itemSendToScrapbook"]->setTexts( tr("Send to S&crapbook"));
972
        (*scrActions)["itemAttributes"]->setTexts( tr("&Attributes..."));
3706 fschmid 973
        (*scrActions)["itemImageInfo"]->setTexts( tr("More Info..."));
2352 fschmid 974
        (*scrActions)["itemImageIsVisible"]->setTexts( tr("I&mage Visible"));
975
        (*scrActions)["itemUpdateImage"]->setTexts( tr("&Update Image"));
976
        (*scrActions)["itemAdjustFrameToImage"]->setTexts( tr("Adjust Frame to Image"));
977
        (*scrActions)["itemExtendedImageProperties"]->setTexts( tr("Extended Image Properties"));
978
        (*scrActions)["itemPreviewLow"]->setTexts( tr("&Low Resolution"));
979
        (*scrActions)["itemPreviewNormal"]->setTexts( tr("&Normal Resolution"));
980
        (*scrActions)["itemPreviewFull"]->setTexts( tr("&Full Resolution"));
981
        (*scrActions)["itemPDFIsBookmark"]->setTexts( tr("Is PDF &Bookmark"));
982
        (*scrActions)["itemPDFIsAnnotation"]->setTexts( tr("Is PDF A&nnotation"));
983
        (*scrActions)["itemPDFAnnotationProps"]->setTexts( tr("Annotation P&roperties"));
984
        (*scrActions)["itemPDFFieldProps"]->setTexts( tr("Field P&roperties"));
985
        (*scrActions)["itemShapeEdit"]->setTexts( tr("&Edit Shape..."));
986
        (*scrActions)["itemAttachTextToPath"]->setTexts( tr("&Attach Text to Path"));
987
        (*scrActions)["itemDetachTextFromPath"]->setTexts( tr("&Detach Text from Path"));
988
        (*scrActions)["itemCombinePolygons"]->setTexts( tr("&Combine Polygons"));
989
        (*scrActions)["itemSplitPolygons"]->setTexts( tr("Split &Polygons"));
990
        (*scrActions)["itemConvertToBezierCurve"]->setTexts( tr("&Bezier Curve"));
991
        (*scrActions)["itemConvertToImageFrame"]->setTexts( tr("&Image Frame"));
992
        (*scrActions)["itemConvertToOutlines"]->setTexts( tr("&Outlines"));
993
        (*scrActions)["itemConvertToPolygon"]->setTexts( tr("&Polygon"));
994
        (*scrActions)["itemConvertToTextFrame"]->setTexts( tr("&Text Frame"));
2170 cbradney 995
 
996
        //Insert Menu
2352 fschmid 997
        (*scrActions)["insertGlyph"]->setTexts( tr("&Glyph..."));
998
        (*scrActions)["insertSampleText"]->setTexts( tr("Sample Text"));
2246 subik 999
 
2170 cbradney 1000
        //Page menu
2352 fschmid 1001
        (*scrActions)["pageInsert"]->setTexts( tr("&Insert..."));
1002
        (*scrActions)["pageImport"]->setTexts( tr("Im&port..."));
1003
        (*scrActions)["pageDelete"]->setTexts( tr("&Delete..."));
1004
        (*scrActions)["pageCopy"]->setTexts( tr("&Copy..."));
1005
        (*scrActions)["pageMove"]->setTexts( tr("&Move..."));
1006
        (*scrActions)["pageApplyMasterPage"]->setTexts( tr("&Apply Master Page..."));
3187 fschmid 1007
        (*scrActions)["pageCopyToMasterPage"]->setTexts( tr("Convert to Master Page..."));
2352 fschmid 1008
        (*scrActions)["pageManageGuides"]->setTexts( tr("Manage &Guides..."));
2872 fschmid 1009
        (*scrActions)["pageManageMargins"]->setTexts( tr("Manage Page Properties..."));
2246 subik 1010
 
2170 cbradney 1011
        //View Menu
2352 fschmid 1012
        (*scrActions)["viewFitInWindow"]->setTexts( tr("&Fit in window"));
1013
        (*scrActions)["viewFit50"]->setTexts( tr("&50%"));
1014
        (*scrActions)["viewFit75"]->setTexts( tr("&75%"));
1015
        (*scrActions)["viewFit100"]->setTexts( tr("&100%"));
1016
        (*scrActions)["viewFit200"]->setTexts( tr("&200%"));
1017
        (*scrActions)["viewFit20"]->setTexts( tr("&Thumbnails"));
1018
        (*scrActions)["viewShowMargins"]->setTexts( tr("Show &Margins"));
1019
        (*scrActions)["viewShowFrames"]->setTexts( tr("Show &Frames"));
1020
        (*scrActions)["viewShowImages"]->setTexts( tr("Show &Images"));
1021
        (*scrActions)["viewShowGrid"]->setTexts( tr("Show &Grid"));
1022
        (*scrActions)["viewShowGuides"]->setTexts( tr("Show G&uides"));
1023
        (*scrActions)["viewShowBaseline"]->setTexts( tr("Show &Baseline Grid"));
1024
        (*scrActions)["viewShowTextChain"]->setTexts( tr("Show &Text Chain"));
2353 fschmid 1025
        (*scrActions)["viewShowTextControls"]->setTexts( tr("Show Control Characters"));
4651 cbradney 1026
        (*scrActions)["viewShowRulers"]->setTexts( tr("Show Rulers"));
2863 fschmid 1027
        (*scrActions)["viewRulerMode"]->setTexts( tr("Rulers relative to Page"));
2352 fschmid 1028
        (*scrActions)["viewSnapToGrid"]->setTexts( tr("Sn&ap to Grid"));
1029
        (*scrActions)["viewSnapToGuides"]->setTexts( tr("Sna&p to Guides"));
1030
//      (*scrActions)["viewNewView"]->setTexts( tr("New View"));
2170 cbradney 1031
 
1032
        //Tool menu
2352 fschmid 1033
        (*scrActions)["toolsProperties"]->setTexts( tr("&Properties"));
4554 cbradney 1034
        (*scrActions)["toolsOutline"]->setTexts( tr("&Outline", "Document Outline Palette"));
2352 fschmid 1035
        (*scrActions)["toolsScrapbook"]->setTexts( tr("&Scrapbook"));
1036
        (*scrActions)["toolsLayers"]->setTexts( tr("&Layers"));
2589 cbradney 1037
        (*scrActions)["toolsPages"]->setTexts( tr("&Arrange Pages"));
2352 fschmid 1038
        (*scrActions)["toolsBookmarks"]->setTexts( tr("&Bookmarks"));
1039
        (*scrActions)["toolsMeasurements"]->setTexts( tr("&Measurements"));
1040
        (*scrActions)["toolsActionHistory"]->setTexts( tr("Action &History"));
1041
        (*scrActions)["toolsPreflightVerifier"]->setTexts( tr("Preflight &Verifier"));
2364 cbradney 1042
        (*scrActions)["toolsAlignDistribute"]->setTexts( tr("&Align and Distribute"));
2352 fschmid 1043
        (*scrActions)["toolsToolbarTools"]->setTexts( tr("&Tools"));
1044
        (*scrActions)["toolsToolbarPDF"]->setTexts( tr("P&DF Tools"));
2246 subik 1045
 
2170 cbradney 1046
        //toolbar only items
2352 fschmid 1047
        (*scrActions)["toolsSelect"]->setTexts( tr("Select Item"));
1048
        (*scrActions)["toolsInsertTextFrame"]->setMenuText( tr("&Text Frame"));
1049
        (*scrActions)["toolsInsertImageFrame"]->setMenuText( tr("&Image Frame"));
1050
        (*scrActions)["toolsInsertTableFrame"]->setMenuText( tr("T&able"));
1051
        (*scrActions)["toolsInsertShape"]->setMenuText( tr("&Shape"));
1052
        (*scrActions)["toolsInsertPolygon"]->setMenuText( tr("&Polygon"));
1053
        (*scrActions)["toolsInsertLine"]->setMenuText( tr("&Line"));
1054
        (*scrActions)["toolsInsertBezier"]->setMenuText( tr("&Bezier Curve"));
1055
        (*scrActions)["toolsInsertFreehandLine"]->setMenuText( tr("&Freehand Line"));
1056
        (*scrActions)["toolsRotate"]->setTexts( tr("Rotate Item"));
1057
        (*scrActions)["toolsZoom"]->setTexts( tr("Zoom in or out"));
1058
        (*scrActions)["toolsZoomIn"]->setTexts( tr("Zoom in"));
1059
        (*scrActions)["toolsZoomOut"]->setTexts( tr("Zoom out"));
1060
        (*scrActions)["toolsEditContents"]->setTexts( tr("Edit Contents of Frame"));
1061
        (*scrActions)["toolsEditWithStoryEditor"]->setMenuText( tr("Edit Text..."));
1062
        (*scrActions)["toolsLinkTextFrame"]->setTexts( tr("Link Text Frames"));
1063
        (*scrActions)["toolsUnlinkTextFrame"]->setTexts( tr("Unlink Text Frames"));
1064
        (*scrActions)["toolsEyeDropper"]->setTexts( tr("&Eye Dropper"));
1065
        (*scrActions)["toolsCopyProperties"]->setTexts( tr("Copy Item Properties"));
2246 subik 1066
 
2352 fschmid 1067
        (*scrActions)["toolsEditWithStoryEditor"]->setText( tr("Edit the text with the Story Editor"));
2246 subik 1068
 
2352 fschmid 1069
        (*scrActions)["toolsInsertTextFrame"]->setText( tr("Insert Text Frame"));
1070
        (*scrActions)["toolsInsertImageFrame"]->setText( tr("Insert Image Frame"));
1071
        (*scrActions)["toolsInsertTableFrame"]->setText( tr("Insert Table"));
1072
        (*scrActions)["toolsInsertShape"]->setText( tr("Insert Shape"));
1073
        (*scrActions)["toolsInsertPolygon"]->setText( tr("Insert Polygon"));
1074
        (*scrActions)["toolsInsertLine"]->setText( tr("Insert Line"));
1075
        (*scrActions)["toolsInsertBezier"]->setText( tr("Insert Bezier Curve"));
1076
        (*scrActions)["toolsInsertFreehandLine"]->setText( tr("Insert Freehand Line"));
2170 cbradney 1077
 
1078
        //Extras Menu
2352 fschmid 1079
        (*scrActions)["extrasManagePictures"]->setTexts( tr("&Manage Pictures"));
1080
        (*scrActions)["extrasHyphenateText"]->setTexts( tr("&Hyphenate Text"));
2621 fschmid 1081
        (*scrActions)["extrasDeHyphenateText"]->setTexts( tr("Dehyphenate Text"));
2352 fschmid 1082
        (*scrActions)["extrasGenerateTableOfContents"]->setTexts( tr("&Generate Table Of Contents"));
2170 cbradney 1083
 
3097 cbradney 1084
        //Windows Menu
1085
        (*scrActions)["windowsCascade"]->setMenuText( tr("&Cascade"));
1086
        (*scrActions)["windowsTile"]->setMenuText( tr("&Tile"));
1087
 
2170 cbradney 1088
        //Help Menu
2352 fschmid 1089
        (*scrActions)["helpAboutScribus"]->setTexts( tr("&About Scribus"));
3247 craig 1090
        (*scrActions)["helpAboutPlugins"]->setTexts( tr("&About Plug-ins"));
2352 fschmid 1091
        (*scrActions)["helpAboutQt"]->setTexts( tr("About &Qt"));
1092
        (*scrActions)["helpTooltips"]->setTexts( tr("Toolti&ps"));
1093
        (*scrActions)["helpManual"]->setTexts( tr("Scribus &Manual..."));
2170 cbradney 1094
 
4557 cbradney 1095
        //GUI
1096
        (*scrActions)["specialToggleAllPalettes"]->setTexts( tr("Toggle Palettes"));
1097
        (*scrActions)["specialToggleAllGuides"]->setTexts( tr("Toggle Guides"));
1098
 
1099
        languageChangeUnicodeActions(scrActions);
1100
}
2246 subik 1101
 
4557 cbradney 1102
void ActionManager::languageChangeUnicodeActions(QMap<QString, QGuardedPtr<ScrAction> > *actionMap)
1103
{
2170 cbradney 1104
        //typography
4564 cbradney 1105
        (*actionMap)["unicodeSmartHyphen"]->setMenuText( tr("Smart &Hyphen"));
1106
        (*actionMap)["unicodeNonBreakingHyphen"]->setMenuText( tr("Non Breaking Dash"));
1107
        (*actionMap)["unicodeNonBreakingSpace"]->setMenuText( tr("Non Breaking &Space"));
1108
        (*actionMap)["unicodePageNumber"]->setMenuText( tr("Page &Number"));
1109
        (*actionMap)["unicodeNewLine"]->setMenuText( tr("New Line"));
1110
        (*actionMap)["unicodeFrameBreak"]->setMenuText( tr("Frame Break"));
1111
        (*actionMap)["unicodeColumnBreak"]->setMenuText( tr("Column Break"));
1112
        (*actionMap)["unicodeCopyRight"]->setTexts( tr("Copyright"));
1113
        (*actionMap)["unicodeRegdTM"]->setTexts( tr("Registered Trademark"));
1114
        (*actionMap)["unicodeTM"]->setTexts( tr("Trademark"));
4720 cbradney 1115
        (*actionMap)["unicodeSolidus"]->setTexts( tr("Solidus"));
4564 cbradney 1116
        (*actionMap)["unicodeBullet"]->setTexts( tr("Bullet"));
4720 cbradney 1117
        (*actionMap)["unicodeMidpoint"]->setTexts( tr("Middle Dot"));
4564 cbradney 1118
        (*actionMap)["unicodeDashEm"]->setTexts( tr("Em Dash"));
1119
        (*actionMap)["unicodeDashEn"]->setTexts( tr("En Dash"));
1120
        (*actionMap)["unicodeDashFigure"]->setTexts( tr("Figure Dash"));
1121
        (*actionMap)["unicodeDashQuotation"]->setTexts( tr("Quotation Dash"));
2246 subik 1122
 
4564 cbradney 1123
        (*actionMap)["unicodeQuoteApostrophe"]->setTexts( tr("Apostrophe"));
1124
        (*actionMap)["unicodeQuoteStraight"]->setTexts( tr("Straight Double"));
1125
        (*actionMap)["unicodeQuoteSingleLeft"]->setTexts( tr("Single Left"));
1126
        (*actionMap)["unicodeQuoteSingleRight"]->setTexts( tr("Single Right"));
1127
        (*actionMap)["unicodeQuoteDoubleLeft"]->setTexts( tr("Double Left"));
1128
        (*actionMap)["unicodeQuoteDoubleRight"]->setTexts( tr("Double Right"));
1129
        (*actionMap)["unicodeQuoteSingleReversed"]->setTexts( tr("Single Reversed"));
1130
        (*actionMap)["unicodeQuoteDoubleReversed"]->setTexts( tr("Double Reversed"));
1131
        (*actionMap)["unicodeQuoteSingleLeftGuillemet"]->setTexts( tr("Single Left Guillemet"));
1132
        (*actionMap)["unicodeQuoteSingleRightGuillemet"]->setTexts( tr("Single Right Guillemet"));
1133
        (*actionMap)["unicodeQuoteDoubleLeftGuillemet"]->setTexts( tr("Double Left Guillemet"));
1134
        (*actionMap)["unicodeQuoteDoubleRightGuillemet"]->setTexts( tr("Double Right Guillemet"));
1135
        (*actionMap)["unicodeQuoteLowSingleComma"]->setTexts( tr("Low Single Comma"));
1136
        (*actionMap)["unicodeQuoteLowDoubleComma"]->setTexts( tr("Low Double Comma"));
1137
        (*actionMap)["unicodeQuoteCJKSingleLeft"]->setTexts( tr("CJK Single Left"));
1138
        (*actionMap)["unicodeQuoteCJKSingleRight"]->setTexts( tr("CJK Single Right"));
1139
        (*actionMap)["unicodeQuoteCJKDoubleLeft"]->setTexts( tr("CJK Double Left"));
1140
        (*actionMap)["unicodeQuoteCJKDoubleRight"]->setTexts( tr("CJK Double Right"));
2246 subik 1141
 
4720 cbradney 1142
        (*actionMap)["unicodeSpaceEN"]->setTexts( tr("En Space"));
1143
        (*actionMap)["unicodeSpaceEM"]->setTexts( tr("Em Space"));
1144
        (*actionMap)["unicodeSpaceThin"]->setTexts( tr("Thin Space"));
1145
        (*actionMap)["unicodeSpaceThick"]->setTexts( tr("Thick Space"));
1146
        (*actionMap)["unicodeSpaceMid"]->setTexts( tr("Mid Space"));
1147
        (*actionMap)["unicodeSpaceHair"]->setTexts( tr("Hair Space"));
1148
 
4564 cbradney 1149
        (*actionMap)["unicodeSmartHyphen"]->setText( tr("Insert Smart Hyphen"));
1150
        (*actionMap)["unicodeNonBreakingHyphen"]->setText( tr("Insert Non Breaking Dash"));
1151
        (*actionMap)["unicodeNonBreakingSpace"]->setText( tr("Insert Non Breaking Space"));
1152
        (*actionMap)["unicodePageNumber"]->setText( tr("Insert Page Number"));
1153
        (*actionMap)["unicodeNewLine"]->setText( tr("New Line"));
1154
        (*actionMap)["unicodeFrameBreak"]->setText( tr("Frame Break"));
1155
        (*actionMap)["unicodeColumnBreak"]->setText( tr("Column Break"));
1156
 
1157
        (*actionMap)["unicodeLigature_ff"]->setTexts( tr("ff"));
1158
        (*actionMap)["unicodeLigature_fi"]->setTexts( tr("fi"));
1159
        (*actionMap)["unicodeLigature_fl"]->setTexts( tr("fl"));
1160
        (*actionMap)["unicodeLigature_ffi"]->setTexts( tr("ffi"));
1161
        (*actionMap)["unicodeLigature_ffl"]->setTexts( tr("ffl"));
1162
        (*actionMap)["unicodeLigature_ft"]->setTexts( tr("ft"));
1163
        (*actionMap)["unicodeLigature_st"]->setTexts( tr("st"));
2161 cbradney 1164
}
2256 cbradney 1165