Subversion Repositories Scribus

Rev

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