Subversion Repositories Scribus

Rev

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

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