Subversion Repositories Scribus

Rev

Rev 18070 | Rev 18466 | 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
*                                                                         *
5243 cbradney 15
*   mainWindow 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 "scribus.h"
10328 cbradney 24
#include "scribuscore.h"
4688 cbradney 25
#include "scribusdoc.h"
2026 cbradney 26
#include "scribusview.h"
3934 cbradney 27
#include "selection.h"
10181 cbradney 28
#include "text/storytext.h"
1993 cbradney 29
#include "undomanager.h"
10311 cbradney 30
#include "urllauncher.h"
10200 cbradney 31
#include "util_icon.h"
1993 cbradney 32
 
10181 cbradney 33
 
5243 cbradney 34
QMap<QString, QKeySequence> ActionManager::defKeys;
12940 cbradney 35
QVector< QPair<QString, QStringList> > ActionManager::defMenuNames;
9857 cbradney 36
QVector< QPair<QString, QStringList> > ActionManager::defMenus;
12940 cbradney 37
QVector< QPair<QString, QStringList> > ActionManager::defNonMenuNames;
9857 cbradney 38
QVector< QPair<QString, QStringList> > ActionManager::defNonMenuActions;
5243 cbradney 39
 
10427 cbradney 40
ActionManager::ActionManager ( QObject * parent ) :
41
        QObject ( parent),
5781 cbradney 42
        mainWindow(0)
1993 cbradney 43
{
5257 cbradney 44
}
45
 
8246 cbradney 46
ActionManager::~ActionManager()
47
{
9911 cbradney 48
        while (!scrActions->isEmpty())
49
        {
50
                ScrAction *value = (*scrActions->begin());
51
                scrActions->erase(scrActions->begin());
52
                delete value;
53
        }
54
        scrActions->clear();
8246 cbradney 55
        delete modeActionNames;
56
        delete nonEditActionNames;
57
        delete unicodeCharActionNames;
58
}
59
 
5257 cbradney 60
void ActionManager::init(ScribusMainWindow *mw)
61
{
62
        mainWindow=mw;
5243 cbradney 63
        scrActions=&(mainWindow->scrActions);
64
        scrActionGroups=&(mainWindow->scrActionGroups);
1995 cbradney 65
        modeActionNames=new QStringList();
66
        nonEditActionNames=new QStringList();
67
        unicodeCharActionNames=new QStringList();
1993 cbradney 68
        undoManager = UndoManager::instance();
2246 subik 69
 
3580 avox 70
#ifdef Q_WS_MAC
71
        noIcon = loadIcon("noicon.xpm");
72
#endif
7087 subik 73
 
1993 cbradney 74
        createActions();
12940 cbradney 75
        createDefaultMenus();
76
        createDefaultNonMenuActions();
2161 cbradney 77
        languageChange();
17723 craig 78
        setActionTooltips(scrActions);
1993 cbradney 79
}
80
 
81
void ActionManager::createActions()
82
{
83
        initFileMenuActions();
84
        initEditMenuActions();
85
        initStyleMenuActions();
86
        initItemMenuActions();
87
        initInsertMenuActions();
88
        initPageMenuActions();
89
        initViewMenuActions();
90
        initToolsMenuActions();
91
        initExtrasMenuActions();
92
        initWindowsMenuActions();
93
        initScriptMenuActions();
94
        initHelpMenuActions();
5243 cbradney 95
        initUnicodeActions(scrActions, mainWindow, unicodeCharActionNames);
4881 cbradney 96
        enableUnicodeActions(scrActions, false);
1993 cbradney 97
        initSpecialActions();
98
}
99
 
100
void ActionManager::initFileMenuActions()
101
{
5243 cbradney 102
        QString name;
1993 cbradney 103
        //File Menu
5243 cbradney 104
        name="fileNew";
11765 cbradney 105
        scrActions->insert(name, new ScrAction(loadIcon("16/document-new.png"), loadIcon("22/document-new.png"), "", defaultKey(name), mainWindow));
13188 fschmid 106
        name="fileNewFromTemplate";
107
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 108
        name="fileOpen";
11765 cbradney 109
        scrActions->insert(name, new ScrAction(loadIcon("16/document-open.png"), loadIcon("22/document-open.png"), "", defaultKey(name), mainWindow));
5243 cbradney 110
        name="fileClose";
11765 cbradney 111
        scrActions->insert(name, new ScrAction(loadIcon("16/close.png"), loadIcon("22/close.png"), "", defaultKey(name), mainWindow));
5243 cbradney 112
        name="fileSave";
11765 cbradney 113
        scrActions->insert(name, new ScrAction(loadIcon("16/document-save.png"), loadIcon("22/document-save.png"), "", defaultKey(name), mainWindow));
5243 cbradney 114
        name="fileSaveAs";
11765 cbradney 115
        scrActions->insert(name, new ScrAction(loadIcon("16/document-save-as.png"), loadIcon("22/document-save-as.png"), "", defaultKey(name), mainWindow));
5243 cbradney 116
        name="fileRevert";
11765 cbradney 117
        scrActions->insert(name, new ScrAction(loadIcon("revert.png"), QPixmap(), "", defaultKey(name), mainWindow));
5243 cbradney 118
        name="fileCollect";
11765 cbradney 119
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
1993 cbradney 120
        //File Import Menu
5243 cbradney 121
        name="fileImportText";
11765 cbradney 122
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5715 tsoots 123
        name="fileImportText2";
11765 cbradney 124
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 125
        name="fileImportAppendText";
11765 cbradney 126
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 127
        name="fileImportImage";
11765 cbradney 128
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
12110 fschmid 129
        name="fileImportVector";
130
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
1993 cbradney 131
 
132
        //File Export Menu
5243 cbradney 133
        name="fileExportText";
11765 cbradney 134
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 135
        name="fileExportAsEPS";
11765 cbradney 136
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 137
        name="fileExportAsPDF";
11765 cbradney 138
        scrActions->insert(name, new ScrAction(loadIcon("acroread16.png"), loadIcon("acroread22.png"), "", defaultKey(name), mainWindow));
1993 cbradney 139
        //Rest of File Menu
15834 fschmid 140
//      name="fileDocSetup";
141
//      scrActions->insert(name, new ScrAction(loadIcon("16/document-properties.png"), loadIcon("22/document-properties.png"), "", defaultKey(name), mainWindow));
14871 cbradney 142
        name="fileDocSetup150";
143
        scrActions->insert(name, new ScrAction(loadIcon("16/document-properties.png"), loadIcon("22/document-properties.png"), "", defaultKey(name), mainWindow));
15834 fschmid 144
//      name="filePreferences";
145
//      scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
146
//      (*scrActions)[name]->setMenuRole(QAction::NoRole);
13761 cbradney 147
        name="filePreferences150";
148
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
15106 cbradney 149
        (*scrActions)[name]->setMenuRole(QAction::PreferencesRole);
5243 cbradney 150
        name="filePrint";
11765 cbradney 151
        scrActions->insert(name, new ScrAction(loadIcon("16/document-print.png"), loadIcon("22/document-print.png"), "", defaultKey(name), mainWindow));
5243 cbradney 152
        name="PrintPreview";
11765 cbradney 153
        scrActions->insert(name, new ScrAction(loadIcon("16/document-print-preview.png"), loadIcon("22/document-print-preview.png"), "", defaultKey(name), mainWindow));
5243 cbradney 154
        name="fileQuit";
11765 cbradney 155
        scrActions->insert(name, new ScrAction(loadIcon("exit.png"), QPixmap(), "", defaultKey(name), mainWindow));
11158 avox 156
        (*scrActions)[name]->setMenuRole(QAction::QuitRole);
1993 cbradney 157
 
158
        //Connect our signals and slots
159
        //File Menu
10725 jghali 160
        connect( (*scrActions)["fileNew"], SIGNAL(triggered()), mainWindow, SLOT(slotFileNew()) );
13188 fschmid 161
        connect( (*scrActions)["fileNewFromTemplate"], SIGNAL(triggered()), mainWindow, SLOT(newFileFromTemplate()) );
10725 jghali 162
        connect( (*scrActions)["fileOpen"], SIGNAL(triggered()), mainWindow, SLOT(slotDocOpen()) );
163
        connect( (*scrActions)["fileClose"], SIGNAL(triggered()), mainWindow, SLOT(slotFileClose()) );
164
        connect( (*scrActions)["filePrint"], SIGNAL(triggered()), mainWindow, SLOT(slotFilePrint()) );
165
        connect( (*scrActions)["PrintPreview"], SIGNAL(triggered()), mainWindow, SLOT(printPreview()) );
166
        connect( (*scrActions)["fileSave"], SIGNAL(triggered()), mainWindow, SLOT(slotFileSave()) );
167
        connect( (*scrActions)["fileSaveAs"], SIGNAL(triggered()), mainWindow, SLOT(slotFileSaveAs()) );
17000 fschmid 168
        connect( (*scrActions)["fileDocSetup150"], SIGNAL(triggered()), mainWindow, SLOT(slotDocSetup()) );
169
        connect( (*scrActions)["filePreferences150"], SIGNAL(triggered()), mainWindow, SLOT(slotPrefsOrg()) );
10725 jghali 170
        connect( (*scrActions)["fileRevert"], SIGNAL(triggered()), mainWindow, SLOT(slotFileRevert()) );
15207 cbradney 171
        connect( (*scrActions)["fileCollect"], SIGNAL(triggered()), mainWindow, SLOT(fileCollect()) );
10725 jghali 172
        connect( (*scrActions)["fileQuit"], SIGNAL(triggered()), mainWindow, SLOT(slotFileQuit()) );
1993 cbradney 173
        //File Import Menu
10725 jghali 174
        connect( (*scrActions)["fileImportText"], SIGNAL(triggered()), mainWindow, SLOT(slotGetContent()) );
175
        connect( (*scrActions)["fileImportText2"], SIGNAL(triggered()), mainWindow, SLOT(slotGetContent2()) );
176
        connect( (*scrActions)["fileImportAppendText"], SIGNAL(triggered()), mainWindow, SLOT(slotFileAppend()) );
177
        connect( (*scrActions)["fileImportImage"], SIGNAL(triggered()), mainWindow, SLOT(slotGetContent()) );
12110 fschmid 178
        connect( (*scrActions)["fileImportVector"], SIGNAL(triggered()), mainWindow, SLOT(importVectorFile()) );
1993 cbradney 179
        //File Export Menu
10725 jghali 180
        connect( (*scrActions)["fileExportText"], SIGNAL(triggered()), mainWindow, SLOT(SaveText()) );
181
        connect( (*scrActions)["fileExportAsEPS"], SIGNAL(triggered()), mainWindow, SLOT(SaveAsEps()) );
182
        connect( (*scrActions)["fileExportAsPDF"], SIGNAL(triggered()), mainWindow, SLOT(SaveAsPDF()) );
1993 cbradney 183
        //The rest are plugins
12320 cbradney 184
 
185
 
186
        (*scrActions)["fileClose"]->setShortcutContext(Qt::WidgetShortcut);
1993 cbradney 187
}
188
 
189
void ActionManager::initEditMenuActions()
190
{
5243 cbradney 191
        QString name;
1993 cbradney 192
        //Edit Menu
5243 cbradney 193
        name="editUndoAction";
11765 cbradney 194
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/edit-undo.png"), loadIcon("22/edit-undo.png"), "", defaultKey(name), mainWindow, 1));
5243 cbradney 195
        name="editRedoAction";
11765 cbradney 196
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/edit-redo.png"), loadIcon("22/edit-redo.png"), "", defaultKey(name), mainWindow, 1));
5243 cbradney 197
        name="editActionMode";
11765 cbradney 198
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
1993 cbradney 199
        (*scrActions)["editActionMode"]->setToggleAction(true);
7087 subik 200
 
5243 cbradney 201
        name="editCut";
11765 cbradney 202
        scrActions->insert(name, new ScrAction(loadIcon("16/edit-cut.png"), loadIcon("22/edit-cut.png"), "", defaultKey(name), mainWindow));
5243 cbradney 203
        name="editCopy";
11765 cbradney 204
        scrActions->insert(name, new ScrAction(loadIcon("16/edit-copy.png"), loadIcon("22/edit-copy.png"), "", defaultKey(name), mainWindow));
5243 cbradney 205
        name="editPaste";
11765 cbradney 206
        scrActions->insert(name, new ScrAction(loadIcon("16/edit-paste.png"), loadIcon("22/edit-paste.png"), "", defaultKey(name), mainWindow));
5243 cbradney 207
        name="editCopyContents";
11765 cbradney 208
        scrActions->insert(name, new ScrAction(loadIcon("16/edit-copy.png"), loadIcon("22/edit-copy.png"), "", defaultKey(name), mainWindow));
5243 cbradney 209
        name="editPasteContents";
11765 cbradney 210
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/edit-paste.png"), QPixmap(), "", defaultKey(name), mainWindow, 0));
5243 cbradney 211
        name="editPasteContentsAbs";
11765 cbradney 212
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/edit-paste.png"), QPixmap(), "", defaultKey(name), mainWindow, 1));
16559 craig 213
        name="editPasteImageFromClipboard";
214
        scrActions->insert(name, new ScrAction(loadIcon("16/edit-paste.png"), loadIcon("22/edit-paste.png"), "", defaultKey(name), mainWindow));
5243 cbradney 215
        name="editClearContents";
11765 cbradney 216
        scrActions->insert(name, new ScrAction(loadIcon("16/edit-delete.png"), loadIcon("22/edit-delete.png"), "", defaultKey(name), mainWindow));
5243 cbradney 217
        name="editSelectAll";
11765 cbradney 218
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
11893 cbradney 219
        name="editSelectAllOnLayer";
220
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 221
        name="editDeselectAll";
11765 cbradney 222
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 223
        name="editSearchReplace";
11765 cbradney 224
        scrActions->insert(name, new ScrAction(loadIcon("16/edit-find-replace.png"), loadIcon("22/edit-find-replace.png"), "", defaultKey(name), mainWindow));
5243 cbradney 225
        name="editEditWithImageEditor";
11765 cbradney 226
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
12400 cbradney 227
        name="editEditRenderSource";
11765 cbradney 228
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 229
        name="editColors";
11765 cbradney 230
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
11895 fschmid 231
        name="editReplaceColors";
232
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 233
        name="editStyles";
11765 cbradney 234
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 235
        name="editMasterPages";
11765 cbradney 236
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 237
        name="editJavascripts";
11765 cbradney 238
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
17826 craig 239
        name="editMarks";
240
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
241
        name="editNotesStyles";
242
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
2264 subik 243
 
4829 tsoots 244
        (*scrActions)["editStyles"]->setToggleAction(true);
17826 craig 245
        (*scrActions)["editMarks"]->setToggleAction(true);
246
        (*scrActions)["editNotesStyles"]->setToggleAction(true);
4829 tsoots 247
 
10728 cbradney 248
        connect( (*scrActions)["editUndoAction"], SIGNAL(triggeredData(int)) , undoManager, SLOT(undo(int)) );
249
        connect( (*scrActions)["editRedoAction"], SIGNAL(triggeredData(int)) , undoManager, SLOT(redo(int)) );
5243 cbradney 250
        connect( (*scrActions)["editActionMode"], SIGNAL(toggled(bool)), mainWindow, SLOT(setUndoMode(bool)) );
10725 jghali 251
        connect( (*scrActions)["editCut"], SIGNAL(triggered()), mainWindow, SLOT(slotEditCut()) );
252
        connect( (*scrActions)["editCopy"], SIGNAL(triggered()), mainWindow, SLOT(slotEditCopy()) );
253
        connect( (*scrActions)["editPaste"], SIGNAL(triggered()), mainWindow, SLOT(slotEditPaste()) );
254
        connect( (*scrActions)["editCopyContents"], SIGNAL(triggered()), mainWindow, SLOT(slotEditCopyContents()) );
10728 cbradney 255
        connect( (*scrActions)["editPasteContents"], SIGNAL(triggeredData(int)), mainWindow, SLOT(slotEditPasteContents(int)) );
256
        connect( (*scrActions)["editPasteContentsAbs"], SIGNAL(triggeredData(int)), mainWindow, SLOT(slotEditPasteContents(int)) );
16559 craig 257
        connect( (*scrActions)["editPasteImageFromClipboard"], SIGNAL(triggered()), mainWindow, SLOT(slotGetClipboardImage()) );
10725 jghali 258
        connect( (*scrActions)["editSelectAll"], SIGNAL(triggered()), mainWindow, SLOT(SelectAll()) );
11893 cbradney 259
        connect( (*scrActions)["editSelectAllOnLayer"], SIGNAL(triggered()), mainWindow, SLOT(SelectAllOnLayer()) );
10725 jghali 260
        connect( (*scrActions)["editDeselectAll"], SIGNAL(triggered()), mainWindow, SLOT(deselectAll()) );
261
        connect( (*scrActions)["editSearchReplace"], SIGNAL(triggered()), mainWindow, SLOT(SearchText()) );
262
        connect( (*scrActions)["editEditWithImageEditor"], SIGNAL(triggered()), mainWindow, SLOT(callImageEditor()) );
12400 cbradney 263
        connect( (*scrActions)["editEditRenderSource"], SIGNAL(triggered()), mainWindow, SLOT(callImageEditor()) );
15611 fschmid 264
        connect( (*scrActions)["editColors"], SIGNAL(triggered()), mainWindow, SLOT(managePaints()) );
11895 fschmid 265
        connect( (*scrActions)["editReplaceColors"], SIGNAL(triggered()), mainWindow, SLOT(slotReplaceColors()) );
10725 jghali 266
        connect( (*scrActions)["editMasterPages"], SIGNAL(triggered()), mainWindow, SLOT(manageMasterPages()) );
267
        connect( (*scrActions)["editJavascripts"], SIGNAL(triggered()), mainWindow, SLOT(ManageJava()) );
1993 cbradney 268
}
269
 
270
void ActionManager::initStyleMenuActions()
271
{
5243 cbradney 272
        QString name;
1993 cbradney 273
        //Text Size actions
9857 cbradney 274
        (*scrActionGroups).insert("fontSize", new QActionGroup(mainWindow));
5243 cbradney 275
        name="fontSizeOther";
11765 cbradney 276
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), (*scrActionGroups).value("fontSize"), -1));
10728 cbradney 277
        connect( (*scrActions)["fontSizeOther"], SIGNAL(triggeredData(int)), mainWindow, SLOT(setItemFSize(int)));
1993 cbradney 278
 
279
        int font_sizes[] = {7, 9, 10, 11, 12, 14, 18, 24, 36, 48, 60, 72};
280
        size_t f_size = sizeof(font_sizes) / sizeof(*font_sizes);
281
        for (uint s = 0; s < f_size; ++s)
282
        {
283
                QString fontSizeName=QString("fontSize%1").arg(font_sizes[s]);
11765 cbradney 284
                scrActions->insert(fontSizeName, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), (*scrActionGroups).value("fontSize"), font_sizes[s]));
1993 cbradney 285
                (*scrActions)[fontSizeName]->setToggleAction(true);
10728 cbradney 286
                connect( (*scrActions)[fontSizeName], SIGNAL(triggeredData(int)), mainWindow, SLOT(setItemFSize(int)));
1993 cbradney 287
        }
288
 
289
        //Alignment actions
5243 cbradney 290
        name="alignLeft";
11765 cbradney 291
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 0));
5243 cbradney 292
        name="alignCenter";
11765 cbradney 293
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 1));
5243 cbradney 294
        name="alignRight";
11765 cbradney 295
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 2));
5243 cbradney 296
        name="alignBlock";
11765 cbradney 297
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 3));
5243 cbradney 298
        name="alignForced";
11765 cbradney 299
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 4));
1993 cbradney 300
 
301
        (*scrActions)["alignLeft"]->setToggleAction(true);
302
        (*scrActions)["alignCenter"]->setToggleAction(true);
303
        (*scrActions)["alignRight"]->setToggleAction(true);
304
        (*scrActions)["alignBlock"]->setToggleAction(true);
305
        (*scrActions)["alignForced"]->setToggleAction(true);
306
 
10728 cbradney 307
        connect( (*scrActions)["alignLeft"], SIGNAL(triggeredData(int)), mainWindow, SLOT(setNewAlignment(int)));
308
        connect( (*scrActions)["alignCenter"], SIGNAL(triggeredData(int)), mainWindow, SLOT(setNewAlignment(int)));
309
        connect( (*scrActions)["alignRight"], SIGNAL(triggeredData(int)), mainWindow, SLOT(setNewAlignment(int)));
310
        connect( (*scrActions)["alignBlock"], SIGNAL(triggeredData(int)), mainWindow, SLOT(setNewAlignment(int)));
311
        connect( (*scrActions)["alignForced"], SIGNAL(triggeredData(int)), mainWindow, SLOT(setNewAlignment(int)));
1993 cbradney 312
 
313
        //Shade actions
12471 cbradney 314
/*
9857 cbradney 315
        scrActionGroups->insert("shade", new QActionGroup(mainWindow));
5243 cbradney 316
        name="shadeOther";
11765 cbradney 317
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), (*scrActionGroups).value("shade"), -1));
10728 cbradney 318
        connect( (*scrActions)["shadeOther"], SIGNAL(triggeredData(int)), mainWindow, SLOT(setItemShade(int)));
1993 cbradney 319
        for (uint i=0; i<=100 ; i+=10)
320
        {
321
                QString shadeName=QString("shade%1").arg(i);
11765 cbradney 322
                scrActions->insert(shadeName, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), (*scrActionGroups).value("shade"), i));
1993 cbradney 323
                (*scrActions)[shadeName]->setToggleAction(true);
10728 cbradney 324
                connect( (*scrActions)[shadeName], SIGNAL(triggeredData(int)), mainWindow, SLOT(setItemShade(int)));
1993 cbradney 325
        }
12471 cbradney 326
*/
1993 cbradney 327
 
328
        //Type Effects actions
9857 cbradney 329
        scrActionGroups->insert("typeEffects", new QActionGroup(mainWindow));
5243 cbradney 330
        name="typeEffectNormal";
11765 cbradney 331
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), (*scrActionGroups).value("typeEffects"), 0));
5243 cbradney 332
        name="typeEffectUnderline";
11765 cbradney 333
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), (*scrActionGroups).value("typeEffects"), 1));
5243 cbradney 334
        name="typeEffectUnderlineWords";
11765 cbradney 335
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), (*scrActionGroups).value("typeEffects"), 8));
5243 cbradney 336
        name="typeEffectStrikeThrough";
11765 cbradney 337
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), (*scrActionGroups).value("typeEffects"), 2));
5243 cbradney 338
        name="typeEffectAllCaps";
11765 cbradney 339
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), (*scrActionGroups).value("typeEffects"), 7));
5243 cbradney 340
        name="typeEffectSmallCaps";
11765 cbradney 341
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), (*scrActionGroups).value("typeEffects"), 3));
5243 cbradney 342
        name="typeEffectSuperscript";
11765 cbradney 343
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), (*scrActionGroups).value("typeEffects"), 4));
5243 cbradney 344
        name="typeEffectSubscript";
11765 cbradney 345
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), (*scrActionGroups).value("typeEffects"), 5));
5243 cbradney 346
        name="typeEffectOutline";
11765 cbradney 347
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), (*scrActionGroups).value("typeEffects"), 6));
5243 cbradney 348
        name="typeEffectShadow";
11765 cbradney 349
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), (*scrActionGroups).value("typeEffects"), 9));
1993 cbradney 350
        (*scrActions)["typeEffectNormal"]->setToggleAction(true);
351
        (*scrActions)["typeEffectUnderline"]->setToggleAction(true);
2188 fschmid 352
        (*scrActions)["typeEffectUnderlineWords"]->setToggleAction(true);
1993 cbradney 353
        (*scrActions)["typeEffectStrikeThrough"]->setToggleAction(true);
2185 fschmid 354
        (*scrActions)["typeEffectAllCaps"]->setToggleAction(true);
1993 cbradney 355
        (*scrActions)["typeEffectSmallCaps"]->setToggleAction(true);
356
        (*scrActions)["typeEffectSuperscript"]->setToggleAction(true);
357
        (*scrActions)["typeEffectSubscript"]->setToggleAction(true);
358
        (*scrActions)["typeEffectOutline"]->setToggleAction(true);
2229 fschmid 359
        (*scrActions)["typeEffectShadow"]->setToggleAction(true);
10728 cbradney 360
        connect( (*scrActions)["typeEffectNormal"], SIGNAL(triggeredData(int)), mainWindow, SLOT(setItemTypeStyle(int)));
361
        connect( (*scrActions)["typeEffectUnderline"], SIGNAL(triggeredData(int)), mainWindow, SLOT(setItemTypeStyle(int)));
362
        connect( (*scrActions)["typeEffectUnderlineWords"], SIGNAL(triggeredData(int)), mainWindow, SLOT(setItemTypeStyle(int)));
363
        connect( (*scrActions)["typeEffectStrikeThrough"], SIGNAL(triggeredData(int)), mainWindow, SLOT(setItemTypeStyle(int)));
364
        connect( (*scrActions)["typeEffectSmallCaps"], SIGNAL(triggeredData(int)), mainWindow, SLOT(setItemTypeStyle(int)));
365
        connect( (*scrActions)["typeEffectAllCaps"], SIGNAL(triggeredData(int)), mainWindow, SLOT(setItemTypeStyle(int)));
366
        connect( (*scrActions)["typeEffectSuperscript"], SIGNAL(triggeredData(int)), mainWindow, SLOT(setItemTypeStyle(int)));
367
        connect( (*scrActions)["typeEffectSubscript"], SIGNAL(triggeredData(int)), mainWindow, SLOT(setItemTypeStyle(int)));
368
        connect( (*scrActions)["typeEffectOutline"], SIGNAL(triggeredData(int)), mainWindow, SLOT(setItemTypeStyle(int)));
369
        connect( (*scrActions)["typeEffectShadow"], SIGNAL(triggeredData(int)), mainWindow, SLOT(setItemTypeStyle(int)));
1993 cbradney 370
 
371
        //Other Style menu items that get added in various places
5243 cbradney 372
        name="styleImageEffects";
11765 cbradney 373
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 374
        name="styleTabulators";
11765 cbradney 375
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
10725 jghali 376
        connect( (*scrActions)["styleImageEffects"], SIGNAL(triggered()), mainWindow, SLOT(ImageEffects()));
377
        connect( (*scrActions)["styleTabulators"], SIGNAL(triggered()), mainWindow, SLOT(EditTabs()));
1993 cbradney 378
 
379
}
380
 
381
void ActionManager::initItemMenuActions()
382
{
5243 cbradney 383
        QString name;
1993 cbradney 384
        //Item Menu
5243 cbradney 385
        name="itemDuplicate";
11765 cbradney 386
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 387
        name="itemMulDuplicate";
11765 cbradney 388
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
15309 cbradney 389
        name="itemTransform";
390
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 391
        name="itemDelete";
11765 cbradney 392
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 393
        name="itemGroup";
11765 cbradney 394
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 395
        name="itemUngroup";
11765 cbradney 396
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
17905 fschmid 397
        name="itemGroupAdjust";
398
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 399
        name="itemLock";
11765 cbradney 400
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 401
        name="itemLockSize";
11765 cbradney 402
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 403
        name="itemPrintingEnabled";
11765 cbradney 404
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 405
        name="itemFlipH";
11765 cbradney 406
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 407
        name="itemFlipV";
11765 cbradney 408
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
4695 cbradney 409
        (*scrActions)["itemLock"]->setToggleAction(true, true);
410
        (*scrActions)["itemLockSize"]->setToggleAction(true, true);
4698 cbradney 411
        (*scrActions)["itemPrintingEnabled"]->setToggleAction(true, true);
4699 cbradney 412
        (*scrActions)["itemFlipH"]->setToggleAction(true, true);
413
        (*scrActions)["itemFlipV"]->setToggleAction(true, true);
5243 cbradney 414
        name="itemLowerToBottom";
11765 cbradney 415
        scrActions->insert(name, new ScrAction(loadIcon("16/go-bottom.png"), loadIcon("22/go-bottom.png"), "", defaultKey(name), mainWindow));
5243 cbradney 416
        name="itemRaiseToTop";
11765 cbradney 417
        scrActions->insert(name, new ScrAction(loadIcon("16/go-top.png"), loadIcon("22/go-top.png"), "", defaultKey(name), mainWindow));
5243 cbradney 418
        name="itemLower";
11765 cbradney 419
        scrActions->insert(name, new ScrAction(loadIcon("16/go-down.png"), loadIcon("22/go-down.png"), "", defaultKey(name), mainWindow));
5243 cbradney 420
        name="itemRaise";
11765 cbradney 421
        scrActions->insert(name, new ScrAction(loadIcon("16/go-up.png"), loadIcon("22/go-up.png"), "", defaultKey(name), mainWindow));
6410 fschmid 422
        name="itemSendToPattern";
11765 cbradney 423
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
18068 fschmid 424
        name="itemSendToInline";
425
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 426
        name="itemImageInfo";
11765 cbradney 427
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 428
        name="itemAttributes";
11765 cbradney 429
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 430
        name="itemImageIsVisible";
11765 cbradney 431
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 432
        name="itemUpdateImage";
11765 cbradney 433
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
16856 craig 434
        name="tableInsertRows";
435
        scrActions->insert(name, new ScrAction(loadIcon("16/insert-table-rows.png"), loadIcon("22/insert-table-rows.png"), "", defaultKey(name), mainWindow));
436
        name="tableInsertColumns";
437
        scrActions->insert(name, new ScrAction(loadIcon("16/insert-table-columns.png"), loadIcon("22/insert-table-columns.png"), "", defaultKey(name), mainWindow));
438
        name="tableDeleteRows";
439
        scrActions->insert(name, new ScrAction(loadIcon("16/delete-table-rows.png"), loadIcon("22/delete-table-rows.png"), "", defaultKey(name), mainWindow));
440
        name="tableDeleteColumns";
441
        scrActions->insert(name, new ScrAction(loadIcon("16/delete-table-columns.png"), loadIcon("22/delete-table-columns.png"), "", defaultKey(name), mainWindow));
442
        name="tableMergeCells";
443
        scrActions->insert(name, new ScrAction(loadIcon("16/merge-table-cells.png"), loadIcon("22/merge-table-cells.png"), "", defaultKey(name), mainWindow));
444
        name="tableSplitCells";
445
        scrActions->insert(name, new ScrAction(loadIcon("16/split-table-cells.png"), loadIcon("22/split-table-cells.png"), "", defaultKey(name), mainWindow));
446
        name="tableSetRowHeights";
447
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
448
        name="tableSetColumnWidths";
449
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
450
        name="tableDistributeRowsEvenly";
451
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
452
        name="tableDistributeColumnsEvenly";
453
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
454
        name="tableAdjustFrameToTable";
455
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
17595 craig 456
        name="itemAdjustFrameHeightToText";
457
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
16856 craig 458
        name = "tableAdjustTableToFrame";
459
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 460
        name="itemAdjustFrameToImage";
11765 cbradney 461
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
12591 fschmid 462
        name = "itemAdjustImageToFrame";
463
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 464
        name="itemExtendedImageProperties";
11765 cbradney 465
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
14796 fschmid 466
        name="itemToggleInlineImage";
467
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 468
        name="itemPreviewLow";
11765 cbradney 469
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 2));
5243 cbradney 470
        name="itemPreviewNormal";
11765 cbradney 471
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 1));
5243 cbradney 472
        name="itemPreviewFull";
11765 cbradney 473
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 0));
5243 cbradney 474
        name="itemPDFIsBookmark";
11765 cbradney 475
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
1993 cbradney 476
        (*scrActions)["itemPDFIsBookmark"]->setToggleAction(true);
5243 cbradney 477
        name="itemPDFIsAnnotation";
11765 cbradney 478
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
1993 cbradney 479
        (*scrActions)["itemPDFIsAnnotation"]->setToggleAction(true);
5243 cbradney 480
        name="itemPDFAnnotationProps";
11765 cbradney 481
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 482
        name="itemPDFFieldProps";
11765 cbradney 483
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
2246 subik 484
 
2026 cbradney 485
        (*scrActions)["itemImageIsVisible"]->setToggleAction(true);
2256 cbradney 486
        (*scrActions)["itemPreviewLow"]->setToggleAction(true);
487
        (*scrActions)["itemPreviewNormal"]->setToggleAction(true);
488
        (*scrActions)["itemPreviewFull"]->setToggleAction(true);
14796 fschmid 489
        (*scrActions)["itemToggleInlineImage"]->setToggleAction(true);
2246 subik 490
 
5243 cbradney 491
        name="itemShapeEdit";
11765 cbradney 492
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
1993 cbradney 493
        (*scrActions)["itemShapeEdit"]->setToggleAction(true);
5243 cbradney 494
        name="itemAttachTextToPath";
11765 cbradney 495
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 496
        name="itemDetachTextFromPath";
11765 cbradney 497
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 498
        name="itemCombinePolygons";
11765 cbradney 499
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 500
        name="itemSplitPolygons";
11765 cbradney 501
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 502
        name="itemConvertToBezierCurve";
11765 cbradney 503
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 504
        name="itemConvertToImageFrame";
11765 cbradney 505
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 506
        name="itemConvertToOutlines";
11765 cbradney 507
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 508
        name="itemConvertToPolygon";
11765 cbradney 509
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 510
        name="itemConvertToTextFrame";
11765 cbradney 511
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
18068 fschmid 512
        name="itemConvertToSymbolFrame";
513
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
1993 cbradney 514
 
16926 fschmid 515
        name="itemsUnWeld";
516
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
517
        name="itemWeld";
518
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
16944 fschmid 519
        name="itemEditWeld";
520
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
16926 fschmid 521
 
10953 subik 522
        connect( (*scrActions)["itemDuplicate"], SIGNAL(triggered()), mainWindow, SLOT(duplicateItem()) );
523
        connect( (*scrActions)["itemMulDuplicate"], SIGNAL(triggered()), mainWindow, SLOT(duplicateItemMulti()) );
15309 cbradney 524
        connect( (*scrActions)["itemTransform"], SIGNAL(triggered()), mainWindow, SLOT(slotItemTransform()) );
10725 jghali 525
        connect( (*scrActions)["itemGroup"], SIGNAL(triggered()), mainWindow, SLOT(GroupObj()) );
526
        connect( (*scrActions)["itemUngroup"], SIGNAL(triggered()), mainWindow, SLOT(UnGroupObj()) );
17905 fschmid 527
        connect( (*scrActions)["itemGroupAdjust"], SIGNAL(triggered()), mainWindow, SLOT(AdjustGroupObj()) );
10725 jghali 528
        connect( (*scrActions)["itemPDFAnnotationProps"], SIGNAL(triggered()), mainWindow, SLOT(ModifyAnnot()) );
529
        connect( (*scrActions)["itemPDFFieldProps"], SIGNAL(triggered()), mainWindow, SLOT(ModifyAnnot()) );
530
        connect( (*scrActions)["itemSendToPattern"], SIGNAL(triggered()), mainWindow, SLOT(PutToPatterns()) );
18068 fschmid 531
        connect( (*scrActions)["itemSendToInline"], SIGNAL(triggered()), mainWindow, SLOT(PutToInline()) );
532
        connect( (*scrActions)["itemConvertToSymbolFrame"], SIGNAL(triggered()), mainWindow, SLOT(ConvertToSymbol()) );
10725 jghali 533
        connect( (*scrActions)["itemAttributes"], SIGNAL(triggered()), mainWindow, SLOT(objectAttributes()) );
534
        connect( (*scrActions)["itemShapeEdit"], SIGNAL(triggered()), mainWindow, SLOT(toggleNodeEdit()) );
535
        connect( (*scrActions)["itemImageInfo"], SIGNAL(triggered()), mainWindow, SLOT(getImageInfo()) );
14796 fschmid 536
        connect( (*scrActions)["itemToggleInlineImage"], SIGNAL(triggered()), mainWindow, SLOT(toogleInlineState()) );
1993 cbradney 537
}
538
 
539
void ActionManager::initInsertMenuActions()
540
{
5243 cbradney 541
        QString name;
1993 cbradney 542
        //Insert Menu
6083 cbradney 543
        name="insertFrame";
11765 cbradney 544
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 545
        name="insertGlyph";
11765 cbradney 546
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
7087 subik 547
        (*scrActions)["insertGlyph"]->setToggleAction(true);
5243 cbradney 548
        name="insertSampleText";
11765 cbradney 549
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
7350 fschmid 550
        name="stickyTools";
11765 cbradney 551
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
7350 fschmid 552
        (*scrActions)["stickyTools"]->setToggleAction(true);
2246 subik 553
 
17826 craig 554
        //Marks
555
        name="insertMarkAnchor";
556
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
557
        (*scrActions)[name]->setEnabled(true);
558
        name="insertMarkVariableText";
559
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
560
        (*scrActions)[name]->setEnabled(true);
561
        name="insertMarkItem";
562
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
563
        (*scrActions)[name]->setEnabled(true);
564
        name="insertMark2Mark";
565
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
566
        (*scrActions)[name]->setEnabled(true);
567
        name="insertMarkNote";
568
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
569
        (*scrActions)[name]->setEnabled(true);
570
//      name="insertMarkIndex";
571
//      scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
572
//      (*scrActions)[name]->setEnabled(true);
573
        name="editMark";
574
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
575
        (*scrActions)[name]->setEnabled(false);
576
        name="itemUpdateMarks";
577
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
578
        (*scrActions)[name]->setEnabled(false);
579
 
10725 jghali 580
        connect( (*scrActions)["insertFrame"], SIGNAL(triggered()), mainWindow, SLOT(slotInsertFrame()) );
581
        connect( (*scrActions)["insertGlyph"], SIGNAL(triggered()), mainWindow, SLOT(slotCharSelect()) );
582
        connect( (*scrActions)["insertSampleText"], SIGNAL(triggered()), mainWindow, SLOT(insertSampleText()) );
583
        connect( (*scrActions)["stickyTools"], SIGNAL(triggered()), mainWindow, SLOT(ToggleStickyTools()) );
17826 craig 584
 
585
        connect( (*scrActions)["insertMarkAnchor"], SIGNAL(triggered()), mainWindow, SLOT(slotInsertMarkAnchor()) );
586
        connect( (*scrActions)["insertMarkVariableText"], SIGNAL(triggered()), mainWindow, SLOT(slotInsertMarkVariableText()) );
587
        connect( (*scrActions)["insertMarkItem"], SIGNAL(triggered()), mainWindow, SLOT(slotInsertMarkItem()) );
588
        connect( (*scrActions)["insertMark2Mark"], SIGNAL(triggered()), mainWindow, SLOT(slotInsertMark2Mark()) );
589
        connect( (*scrActions)["insertMarkNote"], SIGNAL(triggered()), mainWindow, SLOT(slotInsertMarkNote()) );
590
//      connect( (*scrActions)["insertMarkIndex"], SIGNAL(triggered()), mainWindow, SLOT(slotInsertMarkIndex()) );
591
        connect( (*scrActions)["editMark"], SIGNAL(triggered()), mainWindow, SLOT(slotEditMark()) );
592
        connect( (*scrActions)["itemUpdateMarks"], SIGNAL(triggered()), mainWindow, SLOT(slotUpdateMarks()) );
1993 cbradney 593
}
594
 
595
void ActionManager::initPageMenuActions()
596
{
5243 cbradney 597
        QString name;
1993 cbradney 598
        //Page menu
5243 cbradney 599
        name="pageInsert";
11765 cbradney 600
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 601
        name="pageImport";
11765 cbradney 602
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 603
        name="pageDelete";
11765 cbradney 604
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 605
        name="pageCopy";
11765 cbradney 606
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 607
        name="pageMove";
11765 cbradney 608
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 609
        name="pageApplyMasterPage";
11765 cbradney 610
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 611
        name="pageCopyToMasterPage";
11765 cbradney 612
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 613
        name="pageManageGuides";
11765 cbradney 614
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5087 subik 615
        (*scrActions)["pageManageGuides"]->setToggleAction(true);
5243 cbradney 616
        name="pageManageMargins";
11765 cbradney 617
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
1993 cbradney 618
 
10725 jghali 619
        connect( (*scrActions)["pageInsert"], SIGNAL(triggered()), mainWindow, SLOT(slotNewPageM()) );
620
        connect( (*scrActions)["pageImport"], SIGNAL(triggered()), mainWindow, SLOT(slotPageImport()) );
17213 craig 621
        connect( (*scrActions)["pageDelete"], SIGNAL(triggered()), mainWindow, SLOT(deletePage()) );
622
        connect( (*scrActions)["pageCopy"], SIGNAL(triggered()), mainWindow, SLOT(copyPage()) );
623
        connect( (*scrActions)["pageMove"], SIGNAL(triggered()), mainWindow, SLOT(movePage()) );
10725 jghali 624
        connect( (*scrActions)["pageApplyMasterPage"], SIGNAL(triggered()), mainWindow, SLOT(ApplyMasterPage()) );
625
        connect( (*scrActions)["pageCopyToMasterPage"], SIGNAL(triggered()), mainWindow, SLOT(duplicateToMasterPage()) );
626
        connect( (*scrActions)["pageManageMargins"], SIGNAL(triggered()), mainWindow, SLOT(changePageMargins()) );
1993 cbradney 627
}
628
 
629
void ActionManager::initViewMenuActions()
630
{
5243 cbradney 631
        QString name;
632
        name="viewFitInWindow";
11765 cbradney 633
        scrActions->insert(name, new ScrAction(ScrAction::DataDouble, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 0, -100.0));
7164 fschmid 634
        name="viewFitWidth";
11765 cbradney 635
        scrActions->insert(name, new ScrAction(ScrAction::DataDouble, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 0, -200.0));
5243 cbradney 636
        name="viewFit50";
11765 cbradney 637
        scrActions->insert(name, new ScrAction(ScrAction::DataDouble, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 0, 50.0));
5243 cbradney 638
        name="viewFit75";
11765 cbradney 639
        scrActions->insert(name, new ScrAction(ScrAction::DataDouble, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 0, 75.0));
5243 cbradney 640
        name="viewFit100";
11765 cbradney 641
        scrActions->insert(name, new ScrAction(ScrAction::DataDouble, loadIcon("16/zoom-original.png"), loadIcon("22/zoom-original.png"), "", defaultKey(name), mainWindow, 0, 100.0));
5243 cbradney 642
        name="viewFit200";
11765 cbradney 643
        scrActions->insert(name, new ScrAction(ScrAction::DataDouble, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 0, 200.0));
9744 jghali 644
        name="viewFit400";
11765 cbradney 645
        scrActions->insert(name, new ScrAction(ScrAction::DataDouble, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 0, 400.0));
17665 craig 646
        name="viewPreviewMode";
11765 cbradney 647
        scrActions->insert(name, new ScrAction(ScrAction::DataDouble, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 0, 20.0));
5243 cbradney 648
        name="viewShowMargins";
11765 cbradney 649
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
7051 fschmid 650
        name="viewShowBleeds";
11765 cbradney 651
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 652
        name="viewShowFrames";
11765 cbradney 653
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5584 fschmid 654
        name="viewShowLayerMarkers";
11765 cbradney 655
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 656
        name="viewShowImages";
11765 cbradney 657
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 658
        name="viewShowGrid";
11765 cbradney 659
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 660
        name="viewShowGuides";
11765 cbradney 661
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5384 cbradney 662
        name="viewShowColumnBorders";
11765 cbradney 663
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 664
        name="viewShowBaseline";
11765 cbradney 665
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 666
        name="viewShowTextChain";
11765 cbradney 667
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 668
        name="viewShowTextControls";
11765 cbradney 669
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 670
        name="viewShowRulers";
11765 cbradney 671
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 672
        name="viewRulerMode";
11765 cbradney 673
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 674
        name="viewSnapToGrid";
11765 cbradney 675
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 676
        name="viewSnapToGuides";
11765 cbradney 677
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
17744 craig 678
        name="viewSnapToElements";
679
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
11146 cbradney 680
        name="viewShowContextMenu";
11765 cbradney 681
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
12754 fschmid 682
        name="showMouseCoordinates";
683
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
11765 cbradney 684
//      scrActions->insert("viewNewView", new ScrAction("", defaultKey(name), mainWindow));
1993 cbradney 685
 
17665 craig 686
        (*scrActions)["viewPreviewMode"]->setToggleAction(true);
1993 cbradney 687
        (*scrActions)["viewShowMargins"]->setToggleAction(true);
7051 fschmid 688
        (*scrActions)["viewShowBleeds"]->setToggleAction(true);
1993 cbradney 689
        (*scrActions)["viewShowFrames"]->setToggleAction(true);
5584 fschmid 690
        (*scrActions)["viewShowLayerMarkers"]->setToggleAction(true);
1993 cbradney 691
        (*scrActions)["viewShowImages"]->setToggleAction(true);
692
        (*scrActions)["viewShowGrid"]->setToggleAction(true);
693
        (*scrActions)["viewShowGuides"]->setToggleAction(true);
5384 cbradney 694
        (*scrActions)["viewShowColumnBorders"]->setToggleAction(true);
1993 cbradney 695
        (*scrActions)["viewShowBaseline"]->setToggleAction(true);
696
        (*scrActions)["viewShowTextChain"]->setToggleAction(true);
2353 fschmid 697
        (*scrActions)["viewShowTextControls"]->setToggleAction(true);
4651 cbradney 698
        (*scrActions)["viewShowRulers"]->setToggleAction(true);
2863 fschmid 699
        (*scrActions)["viewRulerMode"]->setToggleAction(true);
1993 cbradney 700
        (*scrActions)["viewSnapToGrid"]->setToggleAction(true);
701
        (*scrActions)["viewSnapToGuides"]->setToggleAction(true);
17744 craig 702
        (*scrActions)["viewSnapToElements"]->setToggleAction(true);
12754 fschmid 703
        (*scrActions)["showMouseCoordinates"]->setToggleAction(true);
1993 cbradney 704
 
17665 craig 705
        (*scrActions)["viewPreviewMode"]->setChecked(false);
10427 cbradney 706
        (*scrActions)["viewShowMargins"]->setChecked(true);
707
        (*scrActions)["viewShowBleeds"]->setChecked(true);
708
        (*scrActions)["viewShowFrames"]->setChecked(true);
709
        (*scrActions)["viewShowLayerMarkers"]->setChecked(false);
710
        (*scrActions)["viewShowImages"]->setChecked(true);
711
        (*scrActions)["viewShowGuides"]->setChecked(true);
712
        (*scrActions)["viewShowColumnBorders"]->setChecked(false);
713
        (*scrActions)["viewShowRulers"]->setChecked(true);
714
        (*scrActions)["viewRulerMode"]->setChecked(true);
12754 fschmid 715
        (*scrActions)["showMouseCoordinates"]->setChecked(true);
1993 cbradney 716
 
10728 cbradney 717
        connect( (*scrActions)["viewFitInWindow"], SIGNAL(triggeredData(double)), mainWindow, SLOT(slotZoom(double)) );
718
        connect( (*scrActions)["viewFitWidth"], SIGNAL(triggeredData(double)), mainWindow, SLOT(slotZoom(double)) );
719
        connect( (*scrActions)["viewFit50"], SIGNAL(triggeredData(double)), mainWindow, SLOT(slotZoom(double)) );
720
        connect( (*scrActions)["viewFit75"], SIGNAL(triggeredData(double)), mainWindow, SLOT(slotZoom(double)) );
721
        connect( (*scrActions)["viewFit100"], SIGNAL(triggeredData(double)), mainWindow, SLOT(slotZoom(double)) );
722
        connect( (*scrActions)["viewFit200"], SIGNAL(triggeredData(double)), mainWindow, SLOT(slotZoom(double)) );
723
        connect( (*scrActions)["viewFit400"], SIGNAL(triggeredData(double)), mainWindow, SLOT(slotZoom(double)) );
10725 jghali 724
        connect( (*scrActions)["viewShowMargins"], SIGNAL(triggered()), mainWindow, SLOT(ToggleMarks()) );
725
        connect( (*scrActions)["viewShowBleeds"], SIGNAL(triggered()), mainWindow, SLOT(ToggleBleeds()) );
726
        connect( (*scrActions)["viewShowFrames"], SIGNAL(triggered()), mainWindow, SLOT(ToggleFrames()) );
727
        connect( (*scrActions)["viewShowLayerMarkers"], SIGNAL(triggered()), mainWindow, SLOT(ToggleLayerMarkers()) );
728
        connect( (*scrActions)["viewShowImages"], SIGNAL(triggered()), mainWindow, SLOT(TogglePics()) );
18027 jghali 729
        connect( (*scrActions)["viewShowGrid"], SIGNAL(triggered()), mainWindow, SLOT(ToggleGrid()) );
10725 jghali 730
        connect( (*scrActions)["viewShowGuides"], SIGNAL(triggered()), mainWindow, SLOT(ToggleGuides()) );
731
        connect( (*scrActions)["viewShowColumnBorders"], SIGNAL(triggered()), mainWindow, SLOT(ToggleColumnBorders()) );
732
        connect( (*scrActions)["viewShowBaseline"], SIGNAL(triggered()), mainWindow, SLOT(ToggleBase()) );
733
        connect( (*scrActions)["viewShowTextChain"], SIGNAL(triggered()), mainWindow, SLOT(ToggleTextLinks()) );
734
        connect( (*scrActions)["viewShowTextControls"], SIGNAL(triggered()), mainWindow, SLOT(ToggleTextControls()) );
735
        connect( (*scrActions)["viewShowRulers"], SIGNAL(triggered()), mainWindow, SLOT(ToggleRulers()) );
736
        connect( (*scrActions)["viewRulerMode"], SIGNAL(triggered()), mainWindow, SLOT(ToggleRulerMode()) );
18027 jghali 737
        connect( (*scrActions)["viewSnapToGrid"], SIGNAL(triggered()), mainWindow, SLOT(ToggleUGrid()) );
10725 jghali 738
        connect( (*scrActions)["viewSnapToGuides"], SIGNAL(triggered()), mainWindow, SLOT(ToggleUGuides()) );
17744 craig 739
        connect( (*scrActions)["viewSnapToElements"], SIGNAL(triggered()), mainWindow, SLOT(ToggleUElements()) );
12754 fschmid 740
        connect( (*scrActions)["showMouseCoordinates"], SIGNAL(triggered()), mainWindow, SLOT(ToggleMouseTips()) );
10725 jghali 741
//      connect( (*scrActions)["viewNewView"], SIGNAL(triggered()), mainWindow, SLOT(newView()) );
1993 cbradney 742
 
743
}
744
 
745
void ActionManager::initToolsMenuActions()
746
{
5243 cbradney 747
        QString name;
1993 cbradney 748
        //Tool menu
5243 cbradney 749
        name="toolsProperties";
11765 cbradney 750
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 751
        name="toolsOutline";
11765 cbradney 752
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 753
        name="toolsScrapbook";
11765 cbradney 754
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 755
        name="toolsLayers";
11765 cbradney 756
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 757
        name="toolsPages";
11765 cbradney 758
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 759
        name="toolsBookmarks";
11765 cbradney 760
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 761
        name="toolsMeasurements";
11765 cbradney 762
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/measure.png"), loadIcon("22/measure.png"), "", defaultKey(name), mainWindow, modeMeasurementTool));
5243 cbradney 763
        name="toolsActionHistory";
11765 cbradney 764
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 765
        name="toolsPreflightVerifier";
11765 cbradney 766
        scrActions->insert(name, new ScrAction(loadIcon("16/preflight-verifier.png"), loadIcon("22/preflight-verifier.png"),"", defaultKey(name), mainWindow));
5243 cbradney 767
        name="toolsAlignDistribute";
11765 cbradney 768
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
15060 fschmid 769
        name="toolsSymbols";
770
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
17405 fschmid 771
        name="toolsInline";
772
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 773
        name="toolsToolbarTools";
11765 cbradney 774
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 775
        name="toolsToolbarPDF";
11765 cbradney 776
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
2246 subik 777
 
1993 cbradney 778
        //toolbar only items
5243 cbradney 779
        name="toolsSelect";
11765 cbradney 780
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/pointer.png"), loadIcon("22/pointer.png"), "", defaultKey(name), mainWindow, modeNormal));
5243 cbradney 781
        name="toolsInsertTextFrame";
11765 cbradney 782
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/insert-text-frame.png"), loadIcon("22/insert-text-frame.png"), "", defaultKey(name), mainWindow, modeDrawText));
5243 cbradney 783
        name="toolsInsertImageFrame";
11765 cbradney 784
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/insert-image.png"), loadIcon("22/insert-image.png"), "", defaultKey(name), mainWindow, modeDrawImage));
12400 cbradney 785
        name="toolsInsertRenderFrame";
15455 craig 786
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/insert-renderframe.png"), loadIcon("22/insert-renderframe.png"), "", defaultKey(name), mainWindow, modeDrawLatex));
16856 craig 787
        name="toolsInsertTable";
788
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/insert-table.png"), loadIcon("22/insert-table.png"), "", defaultKey(name), mainWindow, modeDrawTable2));
5243 cbradney 789
        name="toolsInsertShape";
11765 cbradney 790
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, modeDrawShapes));
5243 cbradney 791
        name="toolsInsertPolygon";
11765 cbradney 792
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/draw-polygon.png"), loadIcon("22/draw-polygon.png"), "", defaultKey(name), mainWindow, modeDrawRegularPolygon));
16215 fschmid 793
        name="toolsInsertArc";
794
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/draw-arc.png"), loadIcon("22/draw-arc.png"), "", defaultKey(name), mainWindow, modeDrawArc));
16311 fschmid 795
        name="toolsInsertSpiral";
796
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/draw-spiral.png"), loadIcon("22/draw-spiral.png"), "", defaultKey(name), mainWindow, modeDrawSpiral));
5243 cbradney 797
        name="toolsInsertLine";
11765 cbradney 798
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("Stift16.xpm"), loadIcon("Stift.xpm"), "", defaultKey(name), mainWindow, modeDrawLine));
5243 cbradney 799
        name="toolsInsertBezier";
11765 cbradney 800
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/draw-path.png"), loadIcon("22/draw-path.png"), "", defaultKey(name), mainWindow, modeDrawBezierLine));
5243 cbradney 801
        name="toolsInsertFreehandLine";
11765 cbradney 802
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/draw-freehand.png"), loadIcon("22/draw-freehand.png"), "", defaultKey(name), mainWindow, modeDrawFreehandLine));
15847 fschmid 803
        name="toolsInsertCalligraphicLine";
804
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/draw-calligraphic.png"), loadIcon("22/draw-calligraphic.png"), "", defaultKey(name), mainWindow, modeDrawCalligraphicLine));
5243 cbradney 805
        name="toolsRotate";
11765 cbradney 806
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/transform-rotate.png"), loadIcon("22/transform-rotate.png"), "", defaultKey(name), mainWindow, modeRotation));
5243 cbradney 807
        name="toolsZoom";
11765 cbradney 808
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/zoom.png"), loadIcon("22/zoom.png"), "", defaultKey(name), mainWindow, modeMagnifier));
5243 cbradney 809
        name="toolsZoomIn";
11765 cbradney 810
        scrActions->insert(name, new ScrAction(loadIcon("16/zoom-in.png"), loadIcon("22/zoom-in.png"), "", defaultKey(name), mainWindow));
5243 cbradney 811
        name="toolsZoomOut";
11765 cbradney 812
        scrActions->insert(name, new ScrAction(loadIcon("16/zoom-out.png"), loadIcon("22/zoom-out.png"), "", defaultKey(name), mainWindow));
5243 cbradney 813
        name="toolsEditContents";
11765 cbradney 814
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("Editm16.png"), loadIcon("Editm.xpm"), "", defaultKey(name), mainWindow, modeEdit));
5243 cbradney 815
        name="toolsEditWithStoryEditor";
11765 cbradney 816
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/story-editor.png"), loadIcon("22/story-editor.png"), "", defaultKey(name), mainWindow, modeStoryEditor));
5243 cbradney 817
        name="toolsLinkTextFrame";
11765 cbradney 818
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/text-frame-link.png"), loadIcon("22/text-frame-link.png"), "", defaultKey(name), mainWindow, modeLinkFrames));
5243 cbradney 819
        name="toolsUnlinkTextFrame";
11765 cbradney 820
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/text-frame-unlink.png"), loadIcon("22/text-frame-unlink.png"), "", defaultKey(name), mainWindow, modeUnlinkFrames));
5243 cbradney 821
        name="toolsEyeDropper";
11765 cbradney 822
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/color-picker.png"), loadIcon("22/color-picker.png"), "", defaultKey(name), mainWindow, modeEyeDropper));
5243 cbradney 823
        name="toolsCopyProperties";
11765 cbradney 824
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("wizard16.png"), loadIcon("wizard.png"), "", defaultKey(name), mainWindow, modeCopyProperties));
17565 craig 825
        name="toolsUnlinkTextFrameWithTextCopy";
826
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, modeUnlinkFrames));
827
        name="toolsUnlinkTextFrameWithTextCut";
828
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, modeUnlinkFrames));
7087 subik 829
 
5277 cbradney 830
        //PDF toolbar
831
        name="toolsPDFPushButton";
11765 cbradney 832
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/insert-button.png"), loadIcon("22/insert-button.png"), "", defaultKey(name), mainWindow, modeInsertPDFButton));
17952 fschmid 833
        name="toolsPDFRadioButton";
834
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/radiobutton.png"), loadIcon("22/radiobutton.png"), "", defaultKey(name), mainWindow, modeInsertPDFRadioButton));
5277 cbradney 835
        name="toolsPDFTextField";
11765 cbradney 836
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/text-field.png"), loadIcon("22/text-field.png"), "", defaultKey(name), mainWindow, modeInsertPDFTextfield));
5277 cbradney 837
        name="toolsPDFCheckBox";
11765 cbradney 838
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/checkbox.png"), loadIcon("22/checkbox.png"), "", defaultKey(name), mainWindow, modeInsertPDFCheckbox));
5277 cbradney 839
        name="toolsPDFComboBox";
11765 cbradney 840
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/combobox.png"), loadIcon("22/combobox.png"), "", defaultKey(name), mainWindow, modeInsertPDFCombobox));
5277 cbradney 841
        name="toolsPDFListBox";
11765 cbradney 842
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/list-box.png"), loadIcon("22/list-box.png"), "", defaultKey(name), mainWindow, modeInsertPDFListbox));
5277 cbradney 843
        name="toolsPDFAnnotText";
11765 cbradney 844
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/pdf-annotations.png"), loadIcon("22/pdf-annotations.png"), "", defaultKey(name), mainWindow, modeInsertPDFTextAnnotation));
5277 cbradney 845
        name="toolsPDFAnnotLink";
11765 cbradney 846
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("goto16.png"), loadIcon("goto.png"), "", defaultKey(name), mainWindow, modeInsertPDFLinkAnnotation));
13839 fschmid 847
#ifdef HAVE_OSG
848
        name="toolsPDFAnnot3D";
849
        scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/annot3d.png"), loadIcon("22/annot3d.png"), "", defaultKey(name), mainWindow, modeInsertPDF3DAnnotation));
850
#endif
10181 cbradney 851
        //Set the applicaton wide palette shortcuts
852
        (*scrActions)["toolsProperties"]->setShortcutContext(Qt::ApplicationShortcut);
853
        (*scrActions)["toolsScrapbook"]->setShortcutContext(Qt::ApplicationShortcut);
854
        (*scrActions)["toolsLayers"]->setShortcutContext(Qt::ApplicationShortcut);
855
        (*scrActions)["toolsPages"]->setShortcutContext(Qt::ApplicationShortcut);
856
        (*scrActions)["toolsBookmarks"]->setShortcutContext(Qt::ApplicationShortcut);
857
        (*scrActions)["toolsActionHistory"]->setShortcutContext(Qt::ApplicationShortcut);
858
        (*scrActions)["toolsPreflightVerifier"]->setShortcutContext(Qt::ApplicationShortcut);
859
        (*scrActions)["toolsAlignDistribute"]->setShortcutContext(Qt::ApplicationShortcut);
15060 fschmid 860
        (*scrActions)["toolsSymbols"]->setShortcutContext(Qt::ApplicationShortcut);
17405 fschmid 861
        (*scrActions)["toolsInline"]->setShortcutContext(Qt::ApplicationShortcut);
10953 subik 862
 
863
 
1993 cbradney 864
        (*scrActions)["toolsProperties"]->setToggleAction(true);
865
        (*scrActions)["toolsOutline"]->setToggleAction(true);
866
        (*scrActions)["toolsScrapbook"]->setToggleAction(true);
867
        (*scrActions)["toolsLayers"]->setToggleAction(true);
868
        (*scrActions)["toolsPages"]->setToggleAction(true);
869
        (*scrActions)["toolsBookmarks"]->setToggleAction(true);
870
        (*scrActions)["toolsMeasurements"]->setToggleAction(true);
871
        (*scrActions)["toolsActionHistory"]->setToggleAction(true);
872
        (*scrActions)["toolsPreflightVerifier"]->setToggleAction(true);
2355 cbradney 873
        (*scrActions)["toolsAlignDistribute"]->setToggleAction(true);
15060 fschmid 874
        (*scrActions)["toolsSymbols"]->setToggleAction(true);
17405 fschmid 875
        (*scrActions)["toolsInline"]->setToggleAction(true);
1993 cbradney 876
        (*scrActions)["toolsToolbarTools"]->setToggleAction(true);
877
        (*scrActions)["toolsToolbarPDF"]->setToggleAction(true);
2246 subik 878
 
17317 fschmid 879
        *modeActionNames << "toolsSelect" << "toolsInsertTextFrame" << "toolsInsertImageFrame" << "toolsInsertTable";
16311 fschmid 880
        *modeActionNames << "toolsInsertShape" << "toolsInsertPolygon" << "toolsInsertArc" << "toolsInsertSpiral" << "toolsInsertLine" << "toolsInsertBezier";
15847 fschmid 881
        *modeActionNames << "toolsInsertFreehandLine" << "toolsInsertCalligraphicLine" << "toolsInsertRenderFrame" << "toolsRotate" << "toolsZoom" << "toolsEditContents";
17708 craig 882
        *modeActionNames << "toolsEditWithStoryEditor" << "toolsLinkTextFrame" << "toolsUnlinkTextFrame"; //<< "toolsUnlinkTextFrameWithTextCopy" << "toolsUnlinkTextFrameWithTextCut";
1993 cbradney 883
        *modeActionNames << "toolsEyeDropper" << "toolsCopyProperties";
17952 fschmid 884
        *modeActionNames << "toolsPDFPushButton" << "toolsPDFRadioButton" << "toolsPDFTextField" << "toolsPDFCheckBox" << "toolsPDFComboBox" << "toolsPDFListBox" << "toolsPDFAnnotText" << "toolsPDFAnnotLink";
13839 fschmid 885
#ifdef HAVE_OSG
886
        *modeActionNames << "toolsPDFAnnot3D";
887
#endif
5357 cbradney 888
        for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
11791 cbradney 889
        {
5357 cbradney 890
                (*scrActions)[*it]->setEnabled(false);
11791 cbradney 891
                (*scrActions)[*it]->setToggleAction(true);
892
        }
5357 cbradney 893
 
894
 
2104 cbradney 895
        *nonEditActionNames << "itemLowerToBottom" << "itemRaiseToTop" << "itemRaise" << "itemLower";
2246 subik 896
 
5243 cbradney 897
        connect( (*scrActions)["toolsActionHistory"], SIGNAL(toggled(bool)), mainWindow, SLOT(setUndoPalette(bool)) );
2246 subik 898
 
1993 cbradney 899
        connectModeActions();
900
}
901
 
902
void ActionManager::initExtrasMenuActions()
903
{
5243 cbradney 904
        QString name;
11439 cbradney 905
        name="extrasManageImages";
11765 cbradney 906
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 907
        name="extrasHyphenateText";
11765 cbradney 908
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 909
        name="extrasDeHyphenateText";
11765 cbradney 910
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 911
        name="extrasGenerateTableOfContents";
11765 cbradney 912
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
18047 craig 913
        name="extrasUpdateDocument";
914
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
1993 cbradney 915
 
11439 cbradney 916
        connect( (*scrActions)["extrasManageImages"], SIGNAL(triggered()), mainWindow, SLOT(StatusPic()) );
10725 jghali 917
        connect( (*scrActions)["extrasGenerateTableOfContents"], SIGNAL(triggered()), mainWindow, SLOT(generateTableOfContents()) );
18047 craig 918
        connect( (*scrActions)["extrasUpdateDocument"], SIGNAL(triggered()), mainWindow, SLOT(updateDocument()) );
1993 cbradney 919
}
920
 
921
 
922
void ActionManager::initWindowsMenuActions()
923
{
5243 cbradney 924
        QString name;
925
        name="windowsCascade";
11765 cbradney 926
        scrActions->insert(name, new ScrAction( "", defaultKey(name), mainWindow));
5243 cbradney 927
        name="windowsTile";
11765 cbradney 928
        scrActions->insert(name, new ScrAction( "", defaultKey(name), mainWindow));
1993 cbradney 929
}
930
 
931
void ActionManager::initScriptMenuActions()
932
{
933
}
934
 
935
void ActionManager::initHelpMenuActions()
936
{
5243 cbradney 937
        QString name;
938
        name="helpAboutScribus";
11765 cbradney 939
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
11165 avox 940
        (*scrActions)[name]->setMenuRole(QAction::AboutRole);
5243 cbradney 941
        name="helpAboutPlugins";
11765 cbradney 942
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
11158 avox 943
        (*scrActions)[name]->setMenuRole(QAction::ApplicationSpecificRole);
5243 cbradney 944
        name="helpAboutQt";
11765 cbradney 945
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
11158 avox 946
        (*scrActions)[name]->setMenuRole(QAction::AboutQtRole);
5243 cbradney 947
        name="helpTooltips";
11765 cbradney 948
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5243 cbradney 949
        name="helpManual";
11765 cbradney 950
        scrActions->insert(name, new ScrAction(loadIcon("16/help-browser.png"), QPixmap(), "", defaultKey(name), mainWindow));
10311 cbradney 951
        name="helpOnlineWWW";
11765 cbradney 952
        scrActions->insert(name, new ScrAction(ScrAction::DataQString, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 0, 0.0, "http://www.scribus.net"));
10311 cbradney 953
        name="helpOnlineDocs";
11765 cbradney 954
        scrActions->insert(name, new ScrAction(ScrAction::DataQString, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 0, 0.0, "http://docs.scribus.net"));
10311 cbradney 955
        name="helpOnlineWiki";
11765 cbradney 956
        scrActions->insert(name, new ScrAction(ScrAction::DataQString, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 0, 0.0, "http://wiki.scribus.net"));
10325 cbradney 957
        name="helpOnlineTutorial1";
11765 cbradney 958
        scrActions->insert(name, new ScrAction(ScrAction::DataQString, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 0, 0.0, ""));
10913 jghali 959
        name="helpCheckUpdates";
11765 cbradney 960
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
1993 cbradney 961
 
962
        (*scrActions)["helpTooltips"]->setToggleAction(true);
10427 cbradney 963
        (*scrActions)["helpTooltips"]->setChecked(true);
1993 cbradney 964
 
10725 jghali 965
        connect( (*scrActions)["helpAboutScribus"], SIGNAL(triggered()), mainWindow, SLOT(slotHelpAbout()) );
966
        connect( (*scrActions)["helpAboutPlugins"], SIGNAL(triggered()), mainWindow, SLOT(slotHelpAboutPlugins()) );
967
        connect( (*scrActions)["helpAboutQt"], SIGNAL(triggered()), mainWindow, SLOT(slotHelpAboutQt()) );
968
        connect( (*scrActions)["helpTooltips"], SIGNAL(triggered()), mainWindow, SLOT(ToggleTips()) );
969
        connect( (*scrActions)["helpManual"], SIGNAL(triggered()), mainWindow, SLOT(slotOnlineHelp()) );
10913 jghali 970
        connect( (*scrActions)["helpCheckUpdates"], SIGNAL(triggered()), mainWindow, SLOT(slotHelpCheckUpdates()) );
10311 cbradney 971
        UrlLauncher* ul=UrlLauncher::instance();
10728 cbradney 972
        connect( (*scrActions)["helpOnlineWWW"], SIGNAL(triggeredData(QString)), ul, SLOT(launchUrlExt(const QString)) );
973
        connect( (*scrActions)["helpOnlineDocs"], SIGNAL(triggeredData(QString)), ul, SLOT(launchUrlExt(const QString)) );
974
        connect( (*scrActions)["helpOnlineWiki"], SIGNAL(triggeredData(QString)), ul, SLOT(launchUrlExt(const QString)) );
975
        connect( (*scrActions)["helpOnlineTutorial1"], SIGNAL(triggeredData(QString)), ul, SLOT(launchUrlExt(const QString)) );
1993 cbradney 976
}
977
 
8501 cbradney 978
void ActionManager::initUnicodeActions(QMap<QString, QPointer<ScrAction> > *actionMap, QWidget *actionParent, QStringList *actionNamesList)
1993 cbradney 979
{
5243 cbradney 980
        QString name;
1993 cbradney 981
        //typography
15009 jghali 982
        name="unicodeSoftHyphen";
11791 cbradney 983
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, SpecialChars::SHYPHEN.unicode(), name));
5243 cbradney 984
        name="unicodeNonBreakingHyphen";
11791 cbradney 985
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, SpecialChars::NBHYPHEN.unicode(), name));
5243 cbradney 986
        name="unicodeNonBreakingSpace";
11791 cbradney 987
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, SpecialChars::NBSPACE.unicode(), name));
5243 cbradney 988
        name="unicodePageNumber";
11791 cbradney 989
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, SpecialChars::PAGENUMBER.unicode(), name));
11713 fschmid 990
        name="unicodePageCount";
11791 cbradney 991
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, SpecialChars::PAGECOUNT.unicode(), name));
4720 cbradney 992
        //Spaces
5243 cbradney 993
        name="unicodeSpaceEN";
11791 cbradney 994
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x2002, name));
5243 cbradney 995
        name="unicodeSpaceEM";
11791 cbradney 996
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x2003, name));
5243 cbradney 997
        name="unicodeSpaceThin";
11791 cbradney 998
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x2009, name));
5243 cbradney 999
        name="unicodeSpaceThick";
11791 cbradney 1000
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x2004, name));
5243 cbradney 1001
        name="unicodeSpaceMid";
11791 cbradney 1002
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x2005, name));
5243 cbradney 1003
        name="unicodeSpaceHair";
11791 cbradney 1004
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x200A, name));
4564 cbradney 1005
        //Breaks
5243 cbradney 1006
        name="unicodeNewLine";
11791 cbradney 1007
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, SpecialChars::LINEBREAK.unicode(), name));
5243 cbradney 1008
        name="unicodeFrameBreak";
11791 cbradney 1009
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, SpecialChars::FRAMEBREAK.unicode(), name));
5243 cbradney 1010
        name="unicodeColumnBreak";
11791 cbradney 1011
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, SpecialChars::COLBREAK.unicode(), name));
7038 avox 1012
        name="unicodeZerowidthSpace";
11791 cbradney 1013
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, SpecialChars::ZWSPACE.unicode(), name));
7038 avox 1014
        name="unicodeZerowidthNonBreakingSpace";
11791 cbradney 1015
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, SpecialChars::ZWNBSPACE.unicode(), name));
4564 cbradney 1016
        //Special
5243 cbradney 1017
        name="unicodeCopyRight";
11791 cbradney 1018
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x0A9, name));
5243 cbradney 1019
        name="unicodeRegdTM";
11791 cbradney 1020
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x00AE, name));
5243 cbradney 1021
        name="unicodeTM";
11791 cbradney 1022
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x2122, name));
5243 cbradney 1023
        name="unicodeBullet";
11791 cbradney 1024
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x2022, name));
5243 cbradney 1025
        name="unicodeMidpoint";
11791 cbradney 1026
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x00B7, name));
5243 cbradney 1027
        name="unicodeSolidus";
11791 cbradney 1028
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x2044, name));
4564 cbradney 1029
        //Dashes
5243 cbradney 1030
        name="unicodeDashEm";
11791 cbradney 1031
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x2014, name));
5243 cbradney 1032
        name="unicodeDashEn";
11791 cbradney 1033
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x2013, name));
5243 cbradney 1034
        name="unicodeDashFigure";
11791 cbradney 1035
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x2012, name));
5243 cbradney 1036
        name="unicodeDashQuotation";
11791 cbradney 1037
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x2015, name));
4564 cbradney 1038
        //Quotes
5243 cbradney 1039
        name="unicodeQuoteApostrophe";
11791 cbradney 1040
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x0027, name));
5243 cbradney 1041
        name="unicodeQuoteStraight";
11791 cbradney 1042
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x0022, name));
5243 cbradney 1043
        name="unicodeQuoteSingleLeft";
11791 cbradney 1044
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x2018, name));
5243 cbradney 1045
        name="unicodeQuoteSingleRight";
11791 cbradney 1046
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x2019, name));
5243 cbradney 1047
        name="unicodeQuoteDoubleLeft";
11791 cbradney 1048
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x201C, name));
5243 cbradney 1049
        name="unicodeQuoteDoubleRight";
11791 cbradney 1050
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x201D, name));
5243 cbradney 1051
        name="unicodeQuoteSingleReversed";
11791 cbradney 1052
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x201B, name));
5243 cbradney 1053
        name="unicodeQuoteDoubleReversed";
11791 cbradney 1054
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x201F, name));
5243 cbradney 1055
        name="unicodeQuoteSingleLeftGuillemet";
11791 cbradney 1056
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x2039, name));
5243 cbradney 1057
        name="unicodeQuoteSingleRightGuillemet";
11791 cbradney 1058
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x203A, name));
5243 cbradney 1059
        name="unicodeQuoteDoubleLeftGuillemet";
11791 cbradney 1060
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x00AB, name));
5243 cbradney 1061
        name="unicodeQuoteDoubleRightGuillemet";
11791 cbradney 1062
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x00BB, name));
5243 cbradney 1063
        name="unicodeQuoteLowSingleComma";
11791 cbradney 1064
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x201A, name));
5243 cbradney 1065
        name="unicodeQuoteLowDoubleComma";
11791 cbradney 1066
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x201E, name));
5243 cbradney 1067
        name="unicodeQuoteCJKSingleLeft";
11791 cbradney 1068
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x300C, name));
5243 cbradney 1069
        name="unicodeQuoteCJKSingleRight";
11791 cbradney 1070
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x300D, name));
5243 cbradney 1071
        name="unicodeQuoteCJKDoubleLeft";
11791 cbradney 1072
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x300E, name));
5243 cbradney 1073
        name="unicodeQuoteCJKDoubleRight";
11791 cbradney 1074
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0x300F, name));
4564 cbradney 1075
        //Ligatures
5243 cbradney 1076
        name="unicodeLigature_ff";
11791 cbradney 1077
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0xFB00, name));
5243 cbradney 1078
        name="unicodeLigature_fi";
11791 cbradney 1079
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0xFB01, name));
5243 cbradney 1080
        name="unicodeLigature_fl";
11791 cbradney 1081
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0xFB02, name));
5243 cbradney 1082
        name="unicodeLigature_ffi";
11791 cbradney 1083
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0xFB03, name));
5243 cbradney 1084
        name="unicodeLigature_ffl";
11791 cbradney 1085
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0xFB04, name));
5243 cbradney 1086
        name="unicodeLigature_ft";
11791 cbradney 1087
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0xFB05, name));
5243 cbradney 1088
        name="unicodeLigature_st";
11791 cbradney 1089
        actionMap->insert(name, new ScrAction(defaultKey(name), actionParent, 0xFB06, name));
7087 subik 1090
 
2391 cbradney 1091
        //Spaces and special characters
7087 subik 1092
 
15009 jghali 1093
        *actionNamesList << "unicodeSoftHyphen" << "unicodeNonBreakingHyphen" << "unicodeNonBreakingSpace" << "unicodePageNumber" << "unicodePageCount";
4720 cbradney 1094
        *actionNamesList << "unicodeSpaceEN" << "unicodeSpaceEM" << "unicodeSpaceThin" << "unicodeSpaceThick" << "unicodeSpaceMid" << "unicodeSpaceHair";
2391 cbradney 1095
        //Breaks
7038 avox 1096
        *actionNamesList << "unicodeNewLine" << "unicodeFrameBreak" << "unicodeColumnBreak" << "unicodeZerowidthSpace";
2391 cbradney 1097
        //Copyrights and TMs
4564 cbradney 1098
        *actionNamesList << "unicodeCopyRight" << "unicodeRegdTM" << "unicodeTM";
4720 cbradney 1099
        //Slashes
1100
        *actionNamesList << "unicodeSolidus";
2391 cbradney 1101
        //Bullets
4720 cbradney 1102
        *actionNamesList << "unicodeBullet" << "unicodeMidpoint";
2391 cbradney 1103
        //Dashes
4564 cbradney 1104
        *actionNamesList << "unicodeDashEm" << "unicodeDashEn" << "unicodeDashFigure" << "unicodeDashQuotation";
2391 cbradney 1105
        //Straight quotes
4564 cbradney 1106
        *actionNamesList << "unicodeQuoteApostrophe" << "unicodeQuoteStraight";
2391 cbradney 1107
        //Double quotes
4564 cbradney 1108
        *actionNamesList << "unicodeQuoteDoubleLeft" << "unicodeQuoteDoubleRight" << "unicodeQuoteSingleLeft" << "unicodeQuoteSingleRight";
5261 cbradney 1109
        //Alternative single quotes
4564 cbradney 1110
        *actionNamesList << "unicodeQuoteSingleReversed" << "unicodeQuoteDoubleReversed";
2391 cbradney 1111
        //French quotes
4564 cbradney 1112
        *actionNamesList << "unicodeQuoteSingleLeftGuillemet" << "unicodeQuoteSingleRightGuillemet" << "unicodeQuoteDoubleLeftGuillemet" << "unicodeQuoteDoubleRightGuillemet";
2391 cbradney 1113
        //German quotes
4564 cbradney 1114
        *actionNamesList << "unicodeQuoteLowSingleComma" << "unicodeQuoteLowDoubleComma";
2391 cbradney 1115
        //CJK Quotes
4564 cbradney 1116
        *actionNamesList << "unicodeQuoteCJKSingleLeft" << "unicodeQuoteCJKSingleRight" << "unicodeQuoteCJKDoubleLeft" << "unicodeQuoteCJKDoubleRight";
1117
        //Ligatures
1118
        *actionNamesList << "unicodeLigature_ff" << "unicodeLigature_fi" << "unicodeLigature_fl" << "unicodeLigature_ffi" << "unicodeLigature_ffl" << "unicodeLigature_ft" << "unicodeLigature_st";
4557 cbradney 1119
        for ( QStringList::Iterator it = actionNamesList->begin(); it != actionNamesList->end(); ++it )
10728 cbradney 1120
                connect( (*actionMap)[*it], SIGNAL(triggeredUnicodeShortcut(const QString&, int)), actionParent, SLOT(specialActionKeyEvent(const QString&, int)) );
4557 cbradney 1121
}
1993 cbradney 1122
 
4557 cbradney 1123
void ActionManager::initSpecialActions()
1124
{
5243 cbradney 1125
        QString name;
1993 cbradney 1126
        //GUI
5261 cbradney 1127
        name="specialToggleAllPalettes";
15302 cbradney 1128
//      scrActions->insert(name, new ScrAction(ScrAction::DataQString, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 0,0.0,name));
1129
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
5261 cbradney 1130
        name="specialToggleAllGuides";
15302 cbradney 1131
//      scrActions->insert(name, new ScrAction(ScrAction::DataQString, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 0,0.0,name));
1132
        scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
11624 cbradney 1133
        name="specialUnicodeSequenceBegin";
11765 cbradney 1134
        scrActions->insert(name, new ScrAction( "", defaultKey(name), mainWindow));
10725 jghali 1135
        connect( (*scrActions)["specialToggleAllPalettes"], SIGNAL(triggered()), mainWindow, SLOT(ToggleAllPalettes()) );
1136
        connect( (*scrActions)["specialToggleAllGuides"], SIGNAL(triggered()), mainWindow, SLOT(ToggleAllGuides()) );
1993 cbradney 1137
}
1138
 
17723 craig 1139
void ActionManager::setActionTooltips(QMap<QString, QPointer<ScrAction> > *actionMap)
1140
{
1141
        for( QMap<QString, QPointer<ScrAction> >::Iterator it = actionMap->begin(); it!=actionMap->end(); ++it )
1142
                it.value()->setToolTipFromTextAndShortcut();
1143
}
1144
 
1993 cbradney 1145
void ActionManager::disconnectModeActions()
1146
{
1147
        for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
5243 cbradney 1148
                disconnect( (*scrActions)[*it], SIGNAL(toggledData(bool, int)) , mainWindow, SLOT(setAppModeByToggle(bool, int)) );
1993 cbradney 1149
}
2246 subik 1150
 
1993 cbradney 1151
void ActionManager::connectModeActions()
1152
{
1153
        for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
5243 cbradney 1154
                connect( (*scrActions)[*it], SIGNAL(toggledData(bool, int)) , mainWindow, SLOT(setAppModeByToggle(bool, int)) );
1993 cbradney 1155
}
1156
 
4688 cbradney 1157
void ActionManager::disconnectNewDocActions()
1158
{
16856 craig 1159
        disconnect( (*scrActions)["tableInsertRows"], 0, 0, 0 );
1160
        disconnect( (*scrActions)["tableInsertColumns"], 0, 0, 0 );
1161
        disconnect( (*scrActions)["tableDeleteRows"], 0, 0, 0 );
1162
        disconnect( (*scrActions)["tableDeleteColumns"], 0, 0, 0 );
1163
        disconnect( (*scrActions)["tableMergeCells"], 0, 0, 0 );
1164
        disconnect( (*scrActions)["tableSplitCells"], 0, 0, 0 );
1165
        disconnect( (*scrActions)["tableSetRowHeights"], 0, 0, 0 );
1166
        disconnect( (*scrActions)["tableSetColumnWidths"], 0, 0, 0 );
1167
        disconnect( (*scrActions)["tableDistributeRowsEvenly"], 0, 0, 0 );
1168
        disconnect( (*scrActions)["tableDistributeColumnsEvenly"], 0, 0, 0 );
1169
        disconnect( (*scrActions)["tableAdjustFrameToTable"], 0, 0, 0 );
1170
        disconnect( (*scrActions)["tableAdjustTableToFrame"], 0, 0, 0 );
17595 craig 1171
        disconnect( (*scrActions)["itemAdjustFrameHeightToText"], 0, 0, 0 );
7739 cbradney 1172
        disconnect( (*scrActions)["itemAdjustFrameToImage"], 0, 0, 0 );
12591 fschmid 1173
        disconnect( (*scrActions)["itemAdjustImageToFrame"], 0, 0, 0 );
4688 cbradney 1174
        disconnect( (*scrActions)["itemLock"], 0, 0, 0);
1175
        disconnect( (*scrActions)["itemLockSize"], 0, 0, 0);
4698 cbradney 1176
        disconnect( (*scrActions)["itemPrintingEnabled"], 0, 0, 0);
4699 cbradney 1177
        disconnect( (*scrActions)["itemFlipH"], 0, 0, 0);
1178
        disconnect( (*scrActions)["itemFlipV"], 0, 0, 0);
7739 cbradney 1179
        disconnect( (*scrActions)["itemCombinePolygons"], 0, 0, 0);
1180
        disconnect( (*scrActions)["itemSplitPolygons"], 0, 0, 0);
4688 cbradney 1181
        disconnect( (*scrActions)["itemUpdateImage"], 0, 0, 0 );
4713 cbradney 1182
        disconnect( (*scrActions)["itemDelete"], 0, 0, 0);
1183
        disconnect( (*scrActions)["extrasHyphenateText"], 0, 0, 0 );
1184
        disconnect( (*scrActions)["extrasDeHyphenateText"], 0, 0, 0 );
16926 fschmid 1185
        disconnect( (*scrActions)["itemsUnWeld"], 0, 0, 0);
1186
        disconnect( (*scrActions)["itemWeld"], 0, 0, 0);
16944 fschmid 1187
        disconnect( (*scrActions)["itemEditWeld"], 0, 0, 0);
17062 fschmid 1188
        disconnect( (*scrActions)["itemLowerToBottom"], 0, 0, 0);
1189
        disconnect( (*scrActions)["itemRaiseToTop"], 0, 0, 0);
1190
        disconnect( (*scrActions)["itemLower"], 0, 0, 0);
1191
        disconnect( (*scrActions)["itemRaise"], 0, 0, 0);
17565 craig 1192
        disconnect( (*scrActions)["toolsUnlinkTextFrameWithTextCopy"], 0, 0, 0 );
1193
        disconnect( (*scrActions)["toolsUnlinkTextFrameWithTextCut"], 0, 0, 0 );
4688 cbradney 1194
}
1195
 
1196
void ActionManager::connectNewDocActions(ScribusDoc *currDoc)
1197
{
1198
        if (currDoc==NULL)
1199
                return;
10725 jghali 1200
        connect( (*scrActions)["itemLock"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_ToggleLock()) );
1201
        connect( (*scrActions)["itemLockSize"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_ToggleSizeLock()));
1202
        connect( (*scrActions)["itemPrintingEnabled"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_TogglePrintEnabled()));
1203
        connect( (*scrActions)["itemFlipH"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_FlipH()));
1204
        connect( (*scrActions)["itemFlipV"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_FlipV()));
1205
        connect( (*scrActions)["itemCombinePolygons"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_UniteItems()) );
1206
        connect( (*scrActions)["itemSplitPolygons"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_SplitItems()) );
1207
        connect( (*scrActions)["itemUpdateImage"], SIGNAL(triggered()), currDoc, SLOT(updatePic()) );
1208
        connect( (*scrActions)["extrasHyphenateText"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_DoHyphenate()) );
1209
        connect( (*scrActions)["extrasDeHyphenateText"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_DoDeHyphenate()) );
1210
        connect( (*scrActions)["itemDelete"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_DeleteItem()) );
16856 craig 1211
        connect( (*scrActions)["tableInsertRows"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_InsertTableRows()));
1212
        connect( (*scrActions)["tableInsertColumns"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_InsertTableColumns()));
1213
        connect( (*scrActions)["tableDeleteRows"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_DeleteTableRows()));
1214
        connect( (*scrActions)["tableDeleteColumns"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_DeleteTableColumns()));
1215
        connect( (*scrActions)["tableMergeCells"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_MergeTableCells()));
1216
        connect( (*scrActions)["tableSplitCells"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_SplitTableCells()));
1217
        connect( (*scrActions)["tableSetRowHeights"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_SetTableRowHeights()));
1218
        connect( (*scrActions)["tableSetColumnWidths"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_SetTableColumnWidths()));
1219
        connect( (*scrActions)["tableDistributeRowsEvenly"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_DistributeTableRowsEvenly()));
1220
        connect( (*scrActions)["tableDistributeColumnsEvenly"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_DistributeTableColumnsEvenly()));
1221
        connect( (*scrActions)["tableAdjustFrameToTable"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_AdjustFrameToTable()));
1222
        connect( (*scrActions)["tableAdjustTableToFrame"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_AdjustTableToFrame()));
17595 craig 1223
        connect( (*scrActions)["itemAdjustFrameHeightToText"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_AdjustFrameHeightToText()) );
12420 cbradney 1224
        connect( (*scrActions)["itemAdjustFrameToImage"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_AdjustFrametoImageSize()) );
12591 fschmid 1225
        connect( (*scrActions)["itemAdjustImageToFrame"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_AdjustImagetoFrameSize()) );
16926 fschmid 1226
        connect( (*scrActions)["itemsUnWeld"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_UnWeld()) );
1227
        connect( (*scrActions)["itemWeld"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_Weld()) );
16944 fschmid 1228
        connect( (*scrActions)["itemEditWeld"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_EditWeld()) );
17062 fschmid 1229
        connect( (*scrActions)["itemLowerToBottom"], SIGNAL(triggered()), currDoc, SLOT(sendItemSelectionToBack()) );
1230
        connect( (*scrActions)["itemRaiseToTop"], SIGNAL(triggered()), currDoc, SLOT(bringItemSelectionToFront()) );
1231
        connect( (*scrActions)["itemLower"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_LowerItem()) );
1232
        connect( (*scrActions)["itemRaise"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_RaiseItem()) );
17565 craig 1233
        connect( (*scrActions)["toolsUnlinkTextFrameWithTextCopy"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_UnlinkTextFrameWithText()) );
1234
        connect( (*scrActions)["toolsUnlinkTextFrameWithTextCut"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_UnlinkTextFrameWithTextCut()) );
4688 cbradney 1235
}
1236
 
2026 cbradney 1237
void ActionManager::disconnectNewViewActions()
1238
{
17665 craig 1239
        disconnect( (*scrActions)["viewPreviewMode"], 0, 0, 0);
2026 cbradney 1240
        disconnect( (*scrActions)["toolsZoomIn"], 0, 0, 0);
1241
        disconnect( (*scrActions)["toolsZoomOut"], 0, 0, 0);
1242
        disconnect( (*scrActions)["itemImageIsVisible"], 0, 0, 0);
10728 cbradney 1243
        disconnect( (*scrActions)["itemPreviewLow"], SIGNAL(triggeredData(int)), 0, 0 );
1244
        disconnect( (*scrActions)["itemPreviewNormal"], SIGNAL(triggeredData(int)), 0,0 );
1245
        disconnect( (*scrActions)["itemPreviewFull"], SIGNAL(triggeredData(int)), 0, 0 );
2026 cbradney 1246
        disconnect( (*scrActions)["itemConvertToBezierCurve"], 0, 0, 0);
1247
        disconnect( (*scrActions)["itemConvertToImageFrame"], 0, 0, 0);
1248
        disconnect( (*scrActions)["itemConvertToOutlines"], 0, 0, 0);
1249
        disconnect( (*scrActions)["itemConvertToPolygon"], 0, 0, 0);
1250
        disconnect( (*scrActions)["itemConvertToTextFrame"], 0, 0, 0);
1251
        disconnect( (*scrActions)["itemAttachTextToPath"], 0, 0, 0);
1252
        disconnect( (*scrActions)["itemDetachTextFromPath"], 0, 0, 0);
2260 cbradney 1253
        disconnect( (*scrActions)["itemExtendedImageProperties"], 0, 0, 0 );
2026 cbradney 1254
}
2246 subik 1255
 
2026 cbradney 1256
void ActionManager::connectNewViewActions(ScribusView *currView)
1257
{
1258
        if (currView==NULL)
1259
                return;
17665 craig 1260
        connect( (*scrActions)["viewPreviewMode"], SIGNAL(triggered()), currView, SLOT(togglePreview()) );
10725 jghali 1261
        connect( (*scrActions)["toolsZoomIn"], SIGNAL(triggered()) , currView, SLOT(slotZoomIn()) );
1262
        connect( (*scrActions)["toolsZoomOut"], SIGNAL(triggered()) , currView, SLOT(slotZoomOut()) );
1263
        connect( (*scrActions)["itemConvertToBezierCurve"], SIGNAL(triggered()), currView, SLOT(ToBezierFrame()) );
1264
        connect( (*scrActions)["itemConvertToImageFrame"], SIGNAL(triggered()), currView, SLOT(ToPicFrame()) );
1265
        connect( (*scrActions)["itemConvertToOutlines"], SIGNAL(triggered()), currView, SLOT(TextToPath()) );
1266
        connect( (*scrActions)["itemConvertToPolygon"], SIGNAL(triggered()), currView, SLOT(ToPolyFrame()) );
1267
        connect( (*scrActions)["itemConvertToTextFrame"], SIGNAL(triggered()), currView, SLOT(ToTextFrame()) );
1268
        connect( (*scrActions)["itemAttachTextToPath"], SIGNAL(triggered()), currView, SLOT(ToPathText()) );
1269
        connect( (*scrActions)["itemDetachTextFromPath"], SIGNAL(triggered()), currView, SLOT(FromPathText()) );
1270
        connect( (*scrActions)["itemExtendedImageProperties"], SIGNAL(triggered()), currView, SLOT(editExtendedImageProperties()) );
2026 cbradney 1271
}
1272
 
1273
void ActionManager::disconnectNewSelectionActions()
1274
{
1275
        disconnect( (*scrActions)["itemImageIsVisible"], 0, 0, 0);
10728 cbradney 1276
        //Only disconnect triggeredData for data based actions or you will disconnect the internal signal
1277
        disconnect( (*scrActions)["itemPreviewLow"], SIGNAL(triggeredData(int)) , 0, 0);
1278
        disconnect( (*scrActions)["itemPreviewNormal"], SIGNAL(triggeredData(int)) , 0, 0);
1279
        disconnect( (*scrActions)["itemPreviewFull"], SIGNAL(triggeredData(int)) , 0, 0);
4705 cbradney 1280
        disconnect( (*scrActions)["editClearContents"], 0, 0, 0);
2026 cbradney 1281
}
1282
 
5784 jghali 1283
void ActionManager::connectNewSelectionActions(ScribusView* /*currView*/, ScribusDoc* currDoc)
2026 cbradney 1284
{
4705 cbradney 1285
        connect( (*scrActions)["itemImageIsVisible"], SIGNAL(toggled(bool)), currDoc, SLOT(itemSelection_ToggleImageShown()) );
10728 cbradney 1286
        connect( (*scrActions)["itemPreviewLow"], SIGNAL(triggeredData(int)), currDoc, SLOT(itemSelection_ChangePreviewResolution(int)) );
1287
        connect( (*scrActions)["itemPreviewNormal"], SIGNAL(triggeredData(int)), currDoc, SLOT(itemSelection_ChangePreviewResolution(int)) );
1288
        connect( (*scrActions)["itemPreviewFull"], SIGNAL(triggeredData(int)), currDoc, SLOT(itemSelection_ChangePreviewResolution(int)) );
10725 jghali 1289
        connect( (*scrActions)["editClearContents"], SIGNAL(triggered()), currDoc, SLOT(itemSelection_ClearItem()) );
2026 cbradney 1290
}
2246 subik 1291
 
1993 cbradney 1292
void ActionManager::saveActionShortcutsPreEditMode()
1293
{
1294
        for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
11158 avox 1295
        {
1296
                (*scrActions)[*it]->setShortcutContext(Qt::WidgetShortcut);  // in theory, this should be enough, but...
1993 cbradney 1297
                (*scrActions)[*it]->saveShortcut();
11158 avox 1298
#ifdef Q_WS_MAC
1299
                if ((*scrActions)[*it]->menu() != NULL)
1300
                        (*scrActions)[*it]->setEnabled(false);
1301
#endif          
1302
        }
1993 cbradney 1303
        for ( QStringList::Iterator it = nonEditActionNames->begin(); it != nonEditActionNames->end(); ++it )
11158 avox 1304
        {
1305
                (*scrActions)[*it]->setShortcutContext(Qt::WidgetShortcut);  // in theory, this should be enough, but...
2246 subik 1306
                (*scrActions)[*it]->saveShortcut();
11158 avox 1307
        }
1993 cbradney 1308
}
1309
 
1310
void ActionManager::restoreActionShortcutsPostEditMode()
1311
{
1312
        for ( QStringList::Iterator it = modeActionNames->begin(); it != modeActionNames->end(); ++it )
11158 avox 1313
        {
1314
                (*scrActions)[*it]->setShortcutContext(Qt::WindowShortcut);  // see above
1993 cbradney 1315
                (*scrActions)[*it]->restoreShortcut();
11158 avox 1316
#ifdef Q_WS_MAC
1317
                (*scrActions)[*it]->setEnabled(true);
1318
#endif          
1319
        }
1993 cbradney 1320
        for ( QStringList::Iterator it = nonEditActionNames->begin(); it != nonEditActionNames->end(); ++it )
11158 avox 1321
        {
1322
                (*scrActions)[*it]->setShortcutContext(Qt::WindowShortcut);  // see above
2246 subik 1323
                (*scrActions)[*it]->restoreShortcut();
11158 avox 1324
        }
1993 cbradney 1325
}
1326
 
8501 cbradney 1327
void ActionManager::enableActionStringList(QMap<QString, QPointer<ScrAction> > *actionMap, QStringList *list, bool enabled, bool checkingUnicode, const QString& fontName)
1993 cbradney 1328
{
1329
        for ( QStringList::Iterator it = list->begin(); it != list->end(); ++it )
1330
        {
1331
                if(!checkingUnicode)
4881 cbradney 1332
                        (*actionMap)[*it]->setEnabled(enabled);
1993 cbradney 1333
                else
1334
                {
1335
                        //For UnicodeChar actions, only enable when the current font has that character.
5243 cbradney 1336
                        if (mainWindow->HaveDoc && (*actionMap)[*it]->actionType()==ScrAction::UnicodeChar)
1993 cbradney 1337
                        {
4881 cbradney 1338
                                int charCode=(*actionMap)[*it]->actionInt();
2246 subik 1339
                                if(charCode==-1 ||
11713 fschmid 1340
                                        charCode==23 ||
4881 cbradney 1341
                                        charCode==24 ||
1342
                                        charCode==26 ||
1343
                                        charCode==27 ||
1344
                                        charCode==28 ||
1345
                                        charCode==29 ||
1346
                                        charCode==30 ||
7087 subik 1347
                                        ((*mainWindow->doc->AllFonts)[fontName].usable() &&
5980 avox 1348
                                        (*mainWindow->doc->AllFonts)[fontName].canRender(charCode)) )
4881 cbradney 1349
                                                (*actionMap)[*it]->setEnabled(true);
1350
                                else
1351
                                        (*actionMap)[*it]->setEnabled(false);
1993 cbradney 1352
                        }
1353
                }
1354
        }
1355
}
1995 cbradney 1356
 
8501 cbradney 1357
void ActionManager::enableUnicodeActions(QMap<QString, QPointer<ScrAction> > *actionMap, bool enabled, const QString& fontName)
1995 cbradney 1358
{
4881 cbradney 1359
        enableActionStringList(actionMap, unicodeCharActionNames, enabled, enabled, fontName);
7201 cbradney 1360
        (*actionMap)["insertGlyph"]->setEnabled(enabled);
1995 cbradney 1361
}
2103 cbradney 1362
 
2108 cbradney 1363
void ActionManager::setPDFActions(ScribusView *currView)
2103 cbradney 1364
{
2108 cbradney 1365
        if (currView==NULL)
2103 cbradney 1366
                return;
5243 cbradney 1367
        PageItem* currItem = mainWindow->doc->m_Selection->itemAt(0);
2103 cbradney 1368
        if (currItem==NULL)
1369
                return;
1370
 
1371
        disconnect( (*scrActions)["itemPDFIsBookmark"], 0, 0, 0);
1372
        disconnect( (*scrActions)["itemPDFIsAnnotation"], 0, 0, 0);
2246 subik 1373
 
3625 avox 1374
        if (!currItem->asTextFrame())
2103 cbradney 1375
        {
1376
                (*scrActions)["itemPDFIsAnnotation"]->setEnabled(false);
1377
                (*scrActions)["itemPDFIsBookmark"]->setEnabled(false);
10427 cbradney 1378
                (*scrActions)["itemPDFIsAnnotation"]->setChecked(false);
1379
                (*scrActions)["itemPDFIsBookmark"]->setChecked(false);
2103 cbradney 1380
                (*scrActions)["itemPDFAnnotationProps"]->setEnabled(false);
1381
                (*scrActions)["itemPDFFieldProps"]->setEnabled(false);
1382
                return;
1383
        }
1384
 
1385
        (*scrActions)["itemPDFIsAnnotation"]->setEnabled(true);
1386
        (*scrActions)["itemPDFIsBookmark"]->setEnabled(true);
10427 cbradney 1387
        (*scrActions)["itemPDFIsAnnotation"]->setChecked(currItem->isAnnotation());
1388
        (*scrActions)["itemPDFIsBookmark"]->setChecked(currItem->isBookmark);
4084 cbradney 1389
        if (currItem->isAnnotation())
2103 cbradney 1390
        {
4084 cbradney 1391
                int aType=currItem->annotation().Type();
17911 fschmid 1392
                bool setter=((aType == 0) || (aType == 1) || ((aType > Annotation::Listbox) && (aType < Annotation::Annot3D)));
2103 cbradney 1393
                (*scrActions)["itemPDFAnnotationProps"]->setEnabled(setter);
1394
                (*scrActions)["itemPDFFieldProps"]->setEnabled(!setter);
1395
        }
1396
        else
1397
        {
1398
                (*scrActions)["itemPDFAnnotationProps"]->setEnabled(false);
1399
                (*scrActions)["itemPDFFieldProps"]->setEnabled(false);
1400
        }
10725 jghali 1401
        connect( (*scrActions)["itemPDFIsAnnotation"], SIGNAL(triggered()), currView, SLOT(ToggleAnnotation()) );
1402
        connect( (*scrActions)["itemPDFIsBookmark"], SIGNAL(triggered()), currView, SLOT(ToggleBookmark()) );
2103 cbradney 1403
}
2161 cbradney 1404
 
10859 cbradney 1405
void ActionManager::changeEvent(QEvent *e)
1406
{
1407
        if (e->type() == QEvent::LanguageChange)
1408
        {
1409
                languageChange();
1410
        }
1411
}
1412
 
2161 cbradney 1413
void ActionManager::languageChange()
1414
{
12940 cbradney 1415
        createDefaultMenuNames();
12941 cbradney 1416
        createDefaultNonMenuNames();
12940 cbradney 1417
 
2170 cbradney 1418
        //File Menu
2352 fschmid 1419
        (*scrActions)["fileNew"]->setTexts( tr("&New"));
13188 fschmid 1420
        (*scrActions)["fileNewFromTemplate"]->setTexts( tr("New &from Template..."));
2352 fschmid 1421
        (*scrActions)["fileOpen"]->setTexts( tr("&Open..."));
1422
        (*scrActions)["fileClose"]->setTexts( tr("&Close"));
1423
        (*scrActions)["fileSave"]->setTexts( tr("&Save"));
1424
        (*scrActions)["fileSaveAs"]->setTexts( tr("Save &As..."));
1425
        (*scrActions)["fileRevert"]->setTexts( tr("Re&vert to Saved"));
1426
        (*scrActions)["fileCollect"]->setTexts( tr("Collect for O&utput..."));
1427
        (*scrActions)["fileImportText"]->setTexts( tr("Get Text..."));
1428
        (*scrActions)["fileImportAppendText"]->setTexts( tr("Append &Text..."));
1429
        (*scrActions)["fileImportImage"]->setTexts( tr("Get Image..."));
12110 fschmid 1430
        (*scrActions)["fileImportVector"]->setTexts( tr("Get Vector File..."));
1431
 
2352 fschmid 1432
        (*scrActions)["fileExportText"]->setTexts( tr("Save &Text..."));
5357 cbradney 1433
        (*scrActions)["fileExportAsEPS"]->setTexts( tr("Save as &EPS..."));
2352 fschmid 1434
        (*scrActions)["fileExportAsPDF"]->setTexts( tr("Save as P&DF..."));
15834 fschmid 1435
//      (*scrActions)["fileDocSetup"]->setTexts( tr("Document &Setup (old)..."));
15106 cbradney 1436
        (*scrActions)["fileDocSetup150"]->setTexts( tr("Document &Setup..."));
15834 fschmid 1437
//      (*scrActions)["filePreferences"]->setTexts( tr("P&references (old)..."));
15106 cbradney 1438
        (*scrActions)["filePreferences150"]->setTexts( tr("P&references..."));
2352 fschmid 1439
        (*scrActions)["filePrint"]->setTexts( tr("&Print..."));
17667 craig 1440
        (*scrActions)["PrintPreview"]->setTexts( tr("Print Previe&w"));
2352 fschmid 1441
        (*scrActions)["fileQuit"]->setTexts( tr("&Quit"));
2170 cbradney 1442
        //Edit Menu
2352 fschmid 1443
        (*scrActions)["editUndoAction"]->setTexts( tr("&Undo"));
1444
        (*scrActions)["editRedoAction"]->setTexts( tr("&Redo"));
1445
        (*scrActions)["editActionMode"]->setTexts( tr("&Item Action Mode"));
1446
        (*scrActions)["editCut"]->setTexts( tr("Cu&t"));
1447
        (*scrActions)["editCopy"]->setTexts( tr("&Copy"));
1448
        (*scrActions)["editPaste"]->setTexts( tr("&Paste"));
4952 cbradney 1449
        (*scrActions)["editCopyContents"]->setTexts( tr("&Copy"));
1450
        (*scrActions)["editPasteContents"]->setTexts( tr("&Paste"));
1451
        (*scrActions)["editPasteContentsAbs"]->setTexts( tr("Paste (&Absolute)"));
16559 craig 1452
        (*scrActions)["editPasteImageFromClipboard"]->setTexts( tr("Paste Image from Clipboard"));
4952 cbradney 1453
        (*scrActions)["editClearContents"]->setTexts( tr("C&lear"));
2352 fschmid 1454
        (*scrActions)["editSelectAll"]->setTexts( tr("Select &All"));
11919 fschmid 1455
        (*scrActions)["editSelectAllOnLayer"]->setTexts( tr("Advanced Select All..."));
2352 fschmid 1456
        (*scrActions)["editDeselectAll"]->setTexts( tr("&Deselect All"));
1457
        (*scrActions)["editSearchReplace"]->setTexts( tr("&Search/Replace..."));
1458
        (*scrActions)["editEditWithImageEditor"]->setTexts( tr("Edit Image..."));
12400 cbradney 1459
        (*scrActions)["editEditRenderSource"]->setTexts( tr("Edit Source..."));
18136 jghali 1460
        (*scrActions)["editColors"]->setTexts( tr("Colors and Fills..."));
11895 fschmid 1461
        (*scrActions)["editReplaceColors"]-