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