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