Rev 2556 | Rev 2570 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
3 | paul | 1 | /*************************************************************************** |
2 | scribus.cpp - description |
||
3 | ------------------- |
||
4 | begin : Fre Apr 6 21:09:31 CEST 2001 |
||
5 | copyright : (C) 2001 by Franz Schmid |
||
6 | email : Franz.Schmid@altmuehlnet.de |
||
7 | ***************************************************************************/ |
||
8 | |||
9 | /*************************************************************************** |
||
10 | * * |
||
11 | * This program is free software; you can redistribute it and/or modify * |
||
12 | * it under the terms of the GNU General Public License as published by * |
||
13 | * the Free Software Foundation; either version 2 of the License, or * |
||
14 | * (at your option) any later version. * |
||
15 | * * |
||
16 | ***************************************************************************/ |
||
17 | |||
18 | #include <qaccel.h> |
||
19 | #include <qapplication.h> |
||
204 | Franz | 20 | #include <qeventloop.h> |
3 | paul | 21 | #include <qcolordialog.h> |
22 | #include <qcolor.h> |
||
23 | #include <qiconset.h> |
||
24 | #include <qtextstream.h> |
||
25 | #include <qstylefactory.h> |
||
26 | #include <qregexp.h> |
||
27 | #include <qtextcodec.h> |
||
28 | #include <qcursor.h> |
||
29 | #include <qvbox.h> |
||
1208 | cbradney | 30 | #include <qpixmap.h> |
31 | #include <qkeysequence.h> |
||
32 | |||
3 | paul | 33 | #include <cstdio> |
34 | #include <cstdlib> |
||
391 | Franz | 35 | #include <cmath> |
3 | paul | 36 | #include <dlfcn.h> |
135 | Franz | 37 | #include <unistd.h> |
3 | paul | 38 | #include <iostream> |
119 | Franz | 39 | #include <signal.h> |
80 | Franz | 40 | #include <string> |
1208 | cbradney | 41 | |
42 | |||
2160 | cbradney | 43 | #include "scribusapp.h" |
3 | paul | 44 | #include "scribus.h" |
45 | #include "scribus.moc" |
||
46 | #include "newfile.h" |
||
47 | #include "page.h" |
||
48 | #include "query.h" |
||
49 | #include "mdup.h" |
||
50 | #include "docinfo.h" |
||
51 | #include "reformdoc.h" |
||
52 | #include "serializer.h" |
||
2355 | cbradney | 53 | #include "aligndistribute.h" |
3 | paul | 54 | #include "fmitem.h" |
55 | #include "fontprefs.h" |
||
1641 | cbradney | 56 | #include "prefs.h" |
1158 | cbradney | 57 | #include "prefstable.h" |
3 | paul | 58 | #include "pdfopts.h" |
59 | #include "inspage.h" |
||
60 | #include "delpages.h" |
||
61 | #include "movepage.h" |
||
62 | #include "helpbrowser.h" |
||
63 | #include "scribusXml.h" |
||
1641 | cbradney | 64 | #include "about.h" |
910 | fschmid | 65 | #include "libpostscript/pslib.h" |
3 | paul | 66 | #include "druck.h" |
67 | #include "editformats.h" |
||
68 | #include "muster.h" |
||
1806 | cbradney | 69 | #include "applytemplatedialog.h" |
3 | paul | 70 | #include "picstatus.h" |
71 | #include "customfdialog.h" |
||
72 | #include "cmsprefs.h" |
||
73 | #include "annot.h" |
||
74 | #include "annota.h" |
||
75 | #include "javadocs.h" |
||
151 | Franz | 76 | #include "colorm.h" |
265 | Franz | 77 | #include "mpalette.h" |
1525 | cbradney | 78 | #include "bookpalette.h" |
79 | #include "seiten.h" |
||
80 | #include "layers.h" |
||
81 | #include "frameedit.h" |
||
82 | #include "splash.h" |
||
284 | Franz | 83 | #include "measurements.h" |
364 | Franz | 84 | #include "gtgettext.h" |
506 | fschmid | 85 | #include "fileloader.h" |
740 | fschmid | 86 | #include "arrowchooser.h" |
788 | fschmid | 87 | #include "tabtypography.h" |
879 | fschmid | 88 | #include "tabguides.h" |
1194 | fschmid | 89 | #include "tabtools.h" |
1114 | tsoots | 90 | #include "undogui.h" |
1151 | fschmid | 91 | #include "filewatcher.h" |
1202 | fschmid | 92 | #include "charselect.h" |
1232 | fschmid | 93 | #include "checkDocument.h" |
1235 | fschmid | 94 | #include "tabcheckdoc.h" |
1307 | fschmid | 95 | #include "tabpdfoptions.h" |
1641 | cbradney | 96 | #include "docitemattrprefs.h" |
1644 | cbradney | 97 | #include "pageitemattributes.h" |
1694 | cbradney | 98 | #include "tocindexprefs.h" |
2441 | cbradney | 99 | #include "tocgenerator.h" |
617 | cbradney | 100 | #ifdef _MSC_VER |
101 | #if (_MSC_VER >= 1200) |
||
102 | #include "win-config.h" |
||
103 | #endif |
||
128 | Franz | 104 | #else |
105 | #include "config.h" |
||
106 | #endif |
||
107 | |||
3 | paul | 108 | #include "fpoint.h" |
109 | #include "fpointarray.h" |
||
110 | #include "hysettings.h" |
||
111 | #include "guidemanager.h" |
||
284 | Franz | 112 | #include "keymanager.h" |
3 | paul | 113 | #include "mergedoc.h" |
27 | Franz | 114 | #include "lineformats.h" |
102 | Franz | 115 | #include "story.h" |
123 | Franz | 116 | #include "autoform.h" |
140 | Franz | 117 | #include "tabmanager.h" |
164 | Franz | 118 | #include "search.h" |
169 | Franz | 119 | #include "fontcombo.h" |
415 | Franz | 120 | #include "prefsfile.h" |
1114 | tsoots | 121 | #include "undomanager.h" |
731 | fschmid | 122 | #include "polygonwidget.h" |
766 | cbradney | 123 | #include "werktoolb.h" |
806 | cbradney | 124 | #include "units.h" |
838 | cbradney | 125 | #include "hruler.h" |
126 | #include "vruler.h" |
||
1208 | cbradney | 127 | #include "scraction.h" |
128 | #include "menumanager.h" |
||
1293 | tsoots | 129 | #include "undostate.h" |
1414 | fschmid | 130 | #include "tree.h" |
1500 | cbradney | 131 | #include "scrap.h" |
1549 | subik | 132 | #include "pluginmanager.h" |
1693 | craig | 133 | #include "scpaths.h" |
1972 | craig | 134 | #include "pdfoptions.h" |
1993 | cbradney | 135 | #include "actionmanager.h" |
2024 | cbradney | 136 | #include "documentinformation.h" |
2056 | fschmid | 137 | #include "effectsdialog.h" |
2111 | cbradney | 138 | #include "documentchecker.h" |
2531 | craig | 139 | #include "util.h" |
134 | Franz | 140 | |
3 | paul | 141 | using namespace std; |
142 | |||
143 | #ifdef HAVE_CMS |
||
144 | cmsHPROFILE CMSoutputProf; |
||
145 | cmsHPROFILE CMSprinterProf; |
||
1781 | fschmid | 146 | cmsHTRANSFORM stdTransG; |
147 | cmsHTRANSFORM stdProofG; |
||
148 | cmsHTRANSFORM stdTransImgG; |
||
149 | cmsHTRANSFORM stdProofImgG; |
||
150 | cmsHTRANSFORM stdTransCMYKG; |
||
151 | cmsHTRANSFORM stdProofCMYKG; |
||
152 | cmsHTRANSFORM stdTransRGBG; |
||
1488 | fschmid | 153 | bool BlackPoint; |
3 | paul | 154 | bool SoftProofing; |
155 | bool Gamut; |
||
156 | bool CMSuse; |
||
157 | int IntentMonitor; |
||
158 | int IntentPrinter; |
||
159 | #endif |
||
160 | bool CMSavail; |
||
161 | ProfilesL InputProfiles; |
||
162 | QString DocDir; |
||
2536 | cbradney | 163 | extern ScribusApp* ScApp; |
164 | extern ScribusQApp* ScQApp; |
||
415 | Franz | 165 | PrefsFile* prefsFile; |
3 | paul | 166 | |
188 | Franz | 167 | ScribusApp::ScribusApp() |
2161 | cbradney | 168 | { |
2199 | cbradney | 169 | scribusInitialized=false; |
2164 | subik | 170 | actionManager=NULL; |
2178 | cbradney | 171 | scrMenuMgr=NULL; |
2199 | cbradney | 172 | undoManager=NULL; |
2161 | cbradney | 173 | } // ScribusApp::ScribusApp() |
188 | Franz | 174 | |
767 | cbradney | 175 | /* |
176 | * retval 0 - ok, 1 - no fonts, ... |
||
177 | */ |
||
2295 | cbradney | 178 | int ScribusApp::initScribus(bool showSplash, bool showFontInfo, const QString newGuiLanguage) |
188 | Franz | 179 | { |
767 | cbradney | 180 | int retVal=0; |
1155 | fschmid | 181 | ExternalApp = 0; |
770 | cbradney | 182 | guiLanguage = newGuiLanguage; |
767 | cbradney | 183 | initSplash(showSplash); |
1208 | cbradney | 184 | setUsesBigPixmaps(true); |
355 | Franz | 185 | CurrStED = NULL; |
272 | Franz | 186 | setCaption( tr("Scribus " VERSION)); |
118 | Franz | 187 | setKeyCompression(false); |
272 | Franz | 188 | setIcon(loadIcon("AppIcon.png")); |
1325 | cbradney | 189 | scrActionGroups.clear(); |
190 | scrActionGroups.setAutoDelete(true); |
||
1208 | cbradney | 191 | scrActions.clear(); |
192 | scrRecentFileActions.clear(); |
||
1260 | cbradney | 193 | scrWindowsActions.clear(); |
2408 | cbradney | 194 | scrLayersActions.clear(); |
1208 | cbradney | 195 | scrMenuMgr = new MenuManager(this->menuBar()); |
766 | cbradney | 196 | |
1197 | tsoots | 197 | PrefsPfad = getPreferencesLocation(); |
2556 | craig | 198 | bool importingFrom12=copy12Preferences(PrefsPfad); |
1197 | tsoots | 199 | prefsFile = new PrefsFile(QDir::convertSeparators(PrefsPfad + "/prefs13.xml")); |
2556 | craig | 200 | if (importingFrom12) |
201 | convert12Preferences(PrefsPfad); |
||
1197 | tsoots | 202 | |
2556 | craig | 203 | |
1247 | tsoots | 204 | undoManager = UndoManager::instance(); |
1443 | tsoots | 205 | objectSpecificUndo = false; |
1549 | subik | 206 | pluginManager = new PluginManager(); |
2441 | cbradney | 207 | tocGenerator = new TOCGenerator(); |
1780 | cbradney | 208 | initDefaultValues(); |
2143 | subik | 209 | |
2187 | cbradney | 210 | actionManager = new ActionManager(this, "actionManager"); |
272 | Franz | 211 | initMenuBar(); |
212 | initStatusBar(); |
||
766 | cbradney | 213 | initToolBars(); |
490 | cbradney | 214 | qApp->processEvents(); |
675 | cbradney | 215 | |
3 | paul | 216 | BuFromApp = false; |
1485 | tsoots | 217 | |
2295 | cbradney | 218 | initFonts(showFontInfo); |
767 | cbradney | 219 | |
272 | Franz | 220 | if (NoFonts) |
767 | cbradney | 221 | retVal=1; |
272 | Franz | 222 | else |
223 | { |
||
777 | fschmid | 224 | buildFontMenu(); |
225 | initDefaultPrefs(); |
||
801 | cbradney | 226 | initArrowStyles(); |
3 | paul | 227 | resize(610, 600); |
272 | Franz | 228 | QVBox* vb = new QVBox( this ); |
229 | vb->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken ); |
||
230 | wsp = new QWorkspace( vb ); |
||
231 | setCentralWidget( vb ); |
||
3 | paul | 232 | connect(wsp, SIGNAL(windowActivated(QWidget *)), this, SLOT(newActWin(QWidget *))); |
770 | cbradney | 233 | |
801 | cbradney | 234 | initPalettes(); |
770 | cbradney | 235 | |
1155 | fschmid | 236 | fileWatcher = new FileWatcher(this); |
1485 | tsoots | 237 | |
1550 | cbradney | 238 | if (splashScreen != NULL) |
239 | splashScreen->setStatus( tr("Initializing Plugins")); |
||
240 | qApp->processEvents(); |
||
241 | pluginManager->initPlugs(); |
||
1596 | subik | 242 | |
1437 | cbradney | 243 | initKeyboardShortcuts(); |
1485 | tsoots | 244 | |
1437 | cbradney | 245 | if (splashScreen != NULL) |
669 | cbradney | 246 | splashScreen->setStatus( tr("Reading Preferences")); |
490 | cbradney | 247 | qApp->processEvents(); |
2143 | subik | 248 | //<<CB TODO Reset keyboard shortcuts of all 1.3 users as too many |
2569 | cbradney | 249 | // have conflicts if they dont nuke their settings. |
250 | // - Remove for 1.3.0 release: importingFrom12=true; |
||
1823 | cbradney | 251 | //>>CB |
1392 | cbradney | 252 | ReadPrefs(importingFrom12); |
2494 | cbradney | 253 | |
254 | if (splashScreen != NULL) |
||
255 | splashScreen->setStatus( tr("Initializing Story Editor")); |
||
256 | qApp->processEvents(); |
||
257 | storyEditor = new StoryEditor(this); |
||
801 | cbradney | 258 | |
831 | cbradney | 259 | HaveGS = system(Prefs.gs_exe+" -h > /dev/null 2>&1"); |
260 | HavePngAlpha = system(Prefs.gs_exe+" -sDEVICE=pngalpha -c quit > /dev/null 2>&1"); |
||
261 | DocDir = Prefs.DocDir; |
||
801 | cbradney | 262 | |
669 | cbradney | 263 | if (splashScreen != NULL) |
2114 | cbradney | 264 | splashScreen->setStatus( tr("Reading ICC Profiles")); |
831 | cbradney | 265 | CMSavail = false; |
3 | paul | 266 | GetCMSProfiles(); |
803 | cbradney | 267 | initCMS(); |
831 | cbradney | 268 | |
669 | cbradney | 269 | if (splashScreen != NULL) |
2114 | cbradney | 270 | splashScreen->setStatus( tr("Initializing Hyphenator")); |
490 | cbradney | 271 | qApp->processEvents(); |
766 | cbradney | 272 | initHyphenator(); |
801 | cbradney | 273 | |
669 | cbradney | 274 | if (splashScreen != NULL) |
275 | splashScreen->setStatus( tr("Reading Scrapbook")); |
||
801 | cbradney | 276 | initScrapbook(); |
277 | |||
669 | cbradney | 278 | if (splashScreen != NULL) |
1230 | cbradney | 279 | splashScreen->setStatus( tr("Setting up Shortcuts")); |
280 | qApp->processEvents(); |
||
281 | SetShortCut(); |
||
1485 | tsoots | 282 | |
1441 | cbradney | 283 | emit prefsChanged(); |
1485 | tsoots | 284 | |
1208 | cbradney | 285 | connect(fileWatcher, SIGNAL(fileDeleted(QString )), this, SLOT(removeRecent(QString))); |
3 | paul | 286 | connect(this, SIGNAL(TextIFont(QString)), this, SLOT(AdjustFontMenu(QString))); |
287 | connect(this, SIGNAL(TextISize(int)), this, SLOT(setFSizeMenu(int))); |
||
1545 | cbradney | 288 | connect(this, SIGNAL(TextISize(int)), propertiesPalette, SLOT(setSize(int))); |
2382 | fschmid | 289 | connect(this, SIGNAL(TextUSval(int)), propertiesPalette, SLOT(setExtra(int))); |
1545 | cbradney | 290 | connect(this, SIGNAL(TextStil(int)), propertiesPalette, SLOT(setStil(int))); |
291 | connect(this, SIGNAL(TextScale(int)), propertiesPalette, SLOT(setTScale(int))); |
||
2230 | fschmid | 292 | connect(this, SIGNAL(TextScaleV(int)), propertiesPalette, SLOT(setTScaleV(int))); |
2234 | fschmid | 293 | connect(this, SIGNAL(TextBase(int)), propertiesPalette, SLOT(setTBase(int))); |
2247 | fschmid | 294 | connect(this, SIGNAL(TextShadow(int, int )), propertiesPalette, SLOT(setShadowOffs(int, int ))); |
2257 | fschmid | 295 | connect(this, SIGNAL(TextOutline(int)), propertiesPalette, SLOT(setOutlineW(int))); |
2262 | fschmid | 296 | connect(this, SIGNAL(TextUnderline(int, int)), propertiesPalette, SLOT(setUnderline(int, int))); |
2272 | fschmid | 297 | connect(this, SIGNAL(TextStrike(int, int)), propertiesPalette, SLOT(setStrike(int, int))); |
1545 | cbradney | 298 | connect(this, SIGNAL(TextFarben(QString, QString, int, int)), propertiesPalette, SLOT(setActFarben(QString, QString, int, int))); |
3 | paul | 299 | } |
767 | cbradney | 300 | closeSplash(); |
2199 | cbradney | 301 | scribusInitialized=true; |
2223 | cbradney | 302 | //pluginManager->languageChange(); |
767 | cbradney | 303 | return retVal; |
3 | paul | 304 | } |
305 | |||
767 | cbradney | 306 | void ScribusApp::initSplash(bool showSplash) |
307 | { |
||
308 | if (showSplash) |
||
309 | { |
||
310 | splashScreen = new SplashScreen(); |
||
311 | splashScreen->setStatus(QObject::tr("Initializing...")); |
||
312 | } |
||
313 | else |
||
314 | splashScreen = NULL; |
||
315 | } |
||
316 | |||
317 | void ScribusApp::closeSplash() |
||
318 | { |
||
319 | if (splashScreen!=NULL) |
||
320 | { |
||
321 | splashScreen->close(); |
||
322 | delete splashScreen; |
||
323 | splashScreen = NULL; |
||
324 | } |
||
325 | } |
||
326 | |||
766 | cbradney | 327 | void ScribusApp::initToolBars() |
328 | { |
||
329 | WerkTools2 = new QToolBar( tr("File"), this); |
||
1208 | cbradney | 330 | scrActions["fileNew"]->addTo(WerkTools2); |
331 | scrActions["fileOpen"]->addTo(WerkTools2); |
||
1210 | cbradney | 332 | scrMenuMgr->addMenuToWidgetOfAction("FileOpenRecent", scrActions["fileOpen"]); |
1208 | cbradney | 333 | scrActions["fileSave"]->addTo(WerkTools2); |
334 | scrActions["fileClose"]->addTo(WerkTools2); |
||
335 | scrActions["filePrint"]->addTo(WerkTools2); |
||
1255 | cbradney | 336 | scrActions["toolsPreflightVerifier"]->addTo(WerkTools2); |
1208 | cbradney | 337 | scrActions["fileExportAsPDF"]->addTo(WerkTools2); |
1485 | tsoots | 338 | |
2397 | cbradney | 339 | editToolBar = new QToolBar( tr("Edit"), this); |
1114 | tsoots | 340 | UndoWidget* uWidget = new UndoWidget(editToolBar, "uWidget"); |
1247 | tsoots | 341 | undoManager->registerGui(uWidget); |
1485 | tsoots | 342 | |
766 | cbradney | 343 | WerkTools = new WerkToolB(this); |
344 | setDockEnabled(WerkTools, DockLeft, false); |
||
345 | setDockEnabled(WerkTools, DockRight, false); |
||
346 | WerkTools->Sichtbar = true; |
||
347 | WerkTools->setEnabled(false); |
||
348 | WerkToolsP = new WerkToolBP(this); |
||
349 | setDockEnabled(WerkToolsP, DockLeft, false); |
||
350 | setDockEnabled(WerkToolsP, DockRight, false); |
||
351 | WerkToolsP->setEnabled(false); |
||
352 | WerkToolsP->Sichtbar = true; |
||
801 | cbradney | 353 | |
354 | connect(WerkTools, SIGNAL(Schliessen()), this, SLOT(ToggleTools())); |
||
1770 | cbradney | 355 | connect(WerkToolsP, SIGNAL(NewMode(int)), this, SLOT(setAppMode(int))); |
801 | cbradney | 356 | connect(WerkToolsP, SIGNAL(Schliessen()), this, SLOT(TogglePDFTools())); |
766 | cbradney | 357 | } |
358 | |||
2295 | cbradney | 359 | void ScribusApp::initFonts(bool showFontInfo) |
767 | cbradney | 360 | { |
361 | if (splashScreen!=NULL) { |
||
362 | splashScreen->setStatus( tr("Searching for Fonts")); |
||
363 | qApp->processEvents(); |
||
364 | } |
||
2295 | cbradney | 365 | NoFonts=GetAllFonts(showFontInfo); |
767 | cbradney | 366 | if (NoFonts) |
367 | { |
||
368 | if (splashScreen!=NULL) |
||
369 | splashScreen->close(); // 10/10/2004 pv fix #1200 |
||
1801 | cbradney | 370 | QString mess = tr("There are no fonts found on your system."); |
371 | mess += "\n" + tr("Exiting now."); |
||
767 | cbradney | 372 | QMessageBox::critical(this, tr("Fatal Error"), mess, 1, 0, 0); |
373 | } |
||
829 | cbradney | 374 | else |
1485 | tsoots | 375 | if (splashScreen!=NULL) |
829 | cbradney | 376 | { |
377 | splashScreen->setStatus( tr("Font System Initialized")); |
||
378 | qApp->processEvents(); |
||
379 | } |
||
767 | cbradney | 380 | } |
766 | cbradney | 381 | |
770 | cbradney | 382 | void ScribusApp::initDefaultPrefs() |
383 | { |
||
384 | /** Default font and size **/ |
||
385 | SCFontsIterator it(Prefs.AvailFonts); |
||
1194 | fschmid | 386 | Prefs.toolSettings.defFont = it.currentKey(); |
387 | Prefs.toolSettings.defSize = 120; |
||
770 | cbradney | 388 | Prefs.AppFontSize = qApp->font().pointSize(); |
389 | |||
390 | /** Default colours **/ |
||
391 | Prefs.DColors.clear(); |
||
1693 | craig | 392 | QString pfadC = ScPaths::instance().libDir(); |
872 | cbradney | 393 | QString pfadC2 = pfadC + "rgbscribus.txt"; |
770 | cbradney | 394 | QFile fiC(pfadC2); |
395 | if (!fiC.exists()) |
||
396 | { |
||
397 | Prefs.DColors.insert("White", CMYKColor(0, 0, 0, 0)); |
||
398 | Prefs.DColors.insert("Black", CMYKColor(0, 0, 0, 255)); |
||
399 | Prefs.DColors.insert("Blue", CMYKColor(255, 255, 0, 0)); |
||
400 | Prefs.DColors.insert("Cyan", CMYKColor(255, 0, 0, 0)); |
||
401 | Prefs.DColors.insert("Green", CMYKColor(255, 0, 255, 0)); |
||
402 | Prefs.DColors.insert("Red", CMYKColor(0, 255, 255, 0)); |
||
403 | Prefs.DColors.insert("Yellow", CMYKColor(0, 0, 255, 0)); |
||
404 | Prefs.DColors.insert("Magenta", CMYKColor(0, 255, 0, 0)); |
||
405 | Prefs.DColorSet = "Scribus-Small"; |
||
406 | } |
||
407 | else |
||
408 | { |
||
409 | if (fiC.open(IO_ReadOnly)) |
||
410 | { |
||
411 | QString ColorEn, Cname; |
||
412 | int Rval, Gval, Bval; |
||
413 | QTextStream tsC(&fiC); |
||
414 | ColorEn = tsC.readLine(); |
||
415 | while (!tsC.atEnd()) |
||
416 | { |
||
417 | ColorEn = tsC.readLine(); |
||
418 | QTextStream CoE(&ColorEn, IO_ReadOnly); |
||
419 | CoE >> Rval; |
||
420 | CoE >> Gval; |
||
421 | CoE >> Bval; |
||
422 | CoE >> Cname; |
||
423 | CMYKColor tmp; |
||
424 | tmp.setColorRGB(Rval, Gval, Bval); |
||
425 | Prefs.DColors.insert(Cname, tmp); |
||
426 | } |
||
427 | fiC.close(); |
||
428 | } |
||
429 | Prefs.DColorSet = "X11 RGB-Set"; |
||
430 | } |
||
431 | |||
432 | Prefs.Wheelval = 40; |
||
879 | fschmid | 433 | Prefs.guidesSettings.marginsShown = true; |
434 | Prefs.guidesSettings.framesShown = true; |
||
435 | Prefs.guidesSettings.gridShown = false; |
||
436 | Prefs.guidesSettings.guidesShown = false; |
||
437 | Prefs.guidesSettings.baseShown = false; |
||
438 | Prefs.guidesSettings.showPic = true; |
||
2353 | fschmid | 439 | Prefs.guidesSettings.showControls = false; |
879 | fschmid | 440 | Prefs.guidesSettings.linkShown = false; |
441 | Prefs.guidesSettings.grabRad = 4; |
||
442 | Prefs.guidesSettings.guideRad = 10; |
||
443 | Prefs.guidesSettings.minorGrid = 20; |
||
444 | Prefs.guidesSettings.majorGrid = 100; |
||
445 | Prefs.guidesSettings.minorColor = QColor(green); |
||
446 | Prefs.guidesSettings.majorColor = QColor(green); |
||
447 | Prefs.guidesSettings.margColor = QColor(blue); |
||
448 | Prefs.guidesSettings.guideColor = QColor(darkBlue); |
||
449 | Prefs.guidesSettings.baseColor = QColor(lightGray); |
||
823 | fschmid | 450 | Prefs.typographicSetttings.valueSuperScript = 33; |
451 | Prefs.typographicSetttings.scalingSuperScript = 100; |
||
452 | Prefs.typographicSetttings.valueSubScript = 33; |
||
453 | Prefs.typographicSetttings.scalingSubScript = 100; |
||
454 | Prefs.typographicSetttings.valueSmallCaps = 75; |
||
455 | Prefs.typographicSetttings.autoLineSpacing = 20; |
||
2163 | fschmid | 456 | Prefs.typographicSetttings.valueUnderlinePos = -1; |
457 | Prefs.typographicSetttings.valueUnderlineWidth = -1; |
||
458 | Prefs.typographicSetttings.valueStrikeThruPos = -1; |
||
459 | Prefs.typographicSetttings.valueStrikeThruWidth = -1; |
||
823 | fschmid | 460 | Prefs.typographicSetttings.valueBaseGrid = 14.4; |
461 | Prefs.typographicSetttings.offsetBaseGrid = 0.0; |
||
770 | cbradney | 462 | Prefs.GUI = "Default"; |
1194 | fschmid | 463 | Prefs.toolSettings.dPen = "Black"; |
464 | Prefs.toolSettings.dBrush = "Black"; |
||
465 | Prefs.toolSettings.dShade = 100; |
||
466 | Prefs.toolSettings.dShade2 = 100; |
||
467 | Prefs.toolSettings.dLineArt = SolidLine; |
||
468 | Prefs.toolSettings.dWidth = 1; |
||
469 | Prefs.toolSettings.dPenLine = "Black"; |
||
470 | Prefs.toolSettings.dPenText = "Black"; |
||
471 | Prefs.toolSettings.dStrokeText = "Black"; |
||
2219 | fschmid | 472 | Prefs.toolSettings.tabFillChar = ""; |
2285 | fschmid | 473 | Prefs.toolSettings.dTabWidth = 36.0; |
1120 | fschmid | 474 | Prefs.DpapColor = QColor(white); |
1194 | fschmid | 475 | Prefs.toolSettings.dCols = 1; |
476 | Prefs.toolSettings.dGap = 0.0; |
||
477 | Prefs.toolSettings.dShadeLine = 100; |
||
478 | Prefs.toolSettings.dLstyleLine = SolidLine; |
||
479 | Prefs.toolSettings.dWidthLine = 1; |
||
480 | Prefs.toolSettings.dStartArrow = 0; |
||
481 | Prefs.toolSettings.dEndArrow = 0; |
||
482 | Prefs.toolSettings.magMin = 10; |
||
483 | Prefs.toolSettings.magMax = 3200; |
||
484 | Prefs.toolSettings.magStep = 25; |
||
485 | Prefs.toolSettings.dBrushPict = "White"; |
||
486 | Prefs.toolSettings.shadePict = 100; |
||
487 | Prefs.toolSettings.scaleX = 1; |
||
488 | Prefs.toolSettings.scaleY = 1; |
||
1187 | fschmid | 489 | Prefs.guidesSettings.before = true; |
1065 | cbradney | 490 | Prefs.docUnitIndex = 0; |
1194 | fschmid | 491 | Prefs.toolSettings.polyC = 4; |
492 | Prefs.toolSettings.polyF = 0.5; |
||
493 | Prefs.toolSettings.polyS = false; |
||
494 | Prefs.toolSettings.polyFd = 0; |
||
495 | Prefs.toolSettings.polyR = 0; |
||
844 | fschmid | 496 | Prefs.mainToolBarSettings.visible = true; |
497 | Prefs.pdfToolBarSettings.visible = true; |
||
770 | cbradney | 498 | Prefs.PSize = 40; |
499 | Prefs.SaveAtQ = true; |
||
500 | Prefs.ClipMargin = true; |
||
501 | Prefs.GCRMode = true; |
||
502 | Prefs.RecentDocs.clear(); |
||
503 | Prefs.RecentDCount = 5; |
||
1065 | cbradney | 504 | Prefs.marginColored = false; |
1542 | cbradney | 505 | Prefs.pageSize = "A4"; |
1545 | cbradney | 506 | Prefs.pageOrientation = 0; |
507 | Prefs.PageWidth = 595; |
||
508 | Prefs.PageHeight = 842; |
||
1975 | mrdocs | 509 | Prefs.RandOben = 40; |
770 | cbradney | 510 | Prefs.RandUnten = 40; |
1975 | mrdocs | 511 | Prefs.RandLinks = 40; |
512 | Prefs.RandRechts = 40; |
||
1545 | cbradney | 513 | Prefs.FacingPages = false; |
514 | Prefs.LeftPageFirst = false; |
||
1194 | fschmid | 515 | Prefs.toolSettings.scaleType = true; |
516 | Prefs.toolSettings.aspectRatio = true; |
||
2025 | fschmid | 517 | Prefs.toolSettings.lowResType = 1; |
2040 | fschmid | 518 | Prefs.toolSettings.useEmbeddedPath = false; |
770 | cbradney | 519 | Prefs.MinWordLen = 3; |
520 | Prefs.HyCount = 2; |
||
521 | Prefs.Language = ""; |
||
522 | Prefs.Automatic = true; |
||
523 | Prefs.AutoCheck = false; |
||
524 | Prefs.AutoSave = false; |
||
525 | Prefs.AutoSaveTime = 600000; |
||
526 | Prefs.DisScale = 1.0; |
||
527 | Prefs.DocDir = QDir::homeDirPath(); |
||
528 | Prefs.ProfileDir = ""; |
||
529 | Prefs.ScriptDir = ""; |
||
2093 | cbradney | 530 | Prefs.documentTemplatesDir = ""; |
770 | cbradney | 531 | Prefs.CustomColorSets.clear(); |
532 | Prefs.PrPr_Mode = false; |
||
533 | Prefs.Gcr_Mode = true; |
||
534 | Prefs.PrPr_AlphaText = false; |
||
535 | Prefs.PrPr_AlphaGraphics = false; |
||
536 | Prefs.PrPr_Transparency = false; |
||
537 | Prefs.PrPr_C = true; |
||
538 | Prefs.PrPr_M = true; |
||
539 | Prefs.PrPr_Y = true; |
||
540 | Prefs.PrPr_K = true; |
||
2150 | cbradney | 541 | Prefs.imageEditorExecutable = "gimp"; |
1545 | cbradney | 542 | Prefs.gs_AntiAliasGraphics = true; |
543 | Prefs.gs_AntiAliasText = true; |
||
770 | cbradney | 544 | Prefs.gs_exe = "gs"; |
545 | Prefs.STEcolor = QColor(white); |
||
546 | Prefs.STEfont = font().toString(); |
||
547 | Prefs.DCMSset.DefaultMonitorProfile = ""; |
||
548 | Prefs.DCMSset.DefaultPrinterProfile = ""; |
||
549 | Prefs.DCMSset.DefaultInputProfile = ""; |
||
550 | Prefs.DCMSset.DefaultInputProfile2 = ""; |
||
551 | Prefs.DCMSset.CMSinUse = false; |
||
552 | Prefs.DCMSset.SoftProofOn = false; |
||
553 | Prefs.DCMSset.GamutCheck = false; |
||
554 | Prefs.DCMSset.BlackPoint = true; |
||
555 | Prefs.DCMSset.DefaultIntentMonitor = 1; |
||
556 | Prefs.DCMSset.DefaultIntentMonitor2 = 1; |
||
557 | Prefs.DCMSset.DefaultIntentPrinter = 0; |
||
558 | Prefs.GFontSub.clear(); |
||
801 | cbradney | 559 | Prefs.ScratchLeft = 100; |
560 | Prefs.ScratchRight = 100; |
||
561 | Prefs.ScratchTop = 20; |
||
562 | Prefs.ScratchBottom = 20; |
||
1468 | fschmid | 563 | Prefs.askBeforeSubstituite = true; |
2263 | fschmid | 564 | Prefs.haveStylePreview = true; |
1261 | fschmid | 565 | struct checkerPrefs checkerSettings; |
566 | checkerSettings.ignoreErrors = false; |
||
567 | checkerSettings.autoCheck = true; |
||
568 | checkerSettings.checkGlyphs = true; |
||
569 | checkerSettings.checkOrphans = true; |
||
570 | checkerSettings.checkOverflow = true; |
||
571 | checkerSettings.checkPictures = true; |
||
572 | checkerSettings.checkResolution = true; |
||
573 | checkerSettings.checkTransparency = true; |
||
1284 | fschmid | 574 | checkerSettings.checkAnnotations = false; |
575 | checkerSettings.checkRasterPDF = true; |
||
1261 | fschmid | 576 | checkerSettings.minResolution = 72.0; |
577 | Prefs.checkerProfiles.insert( tr("Postscript"), checkerSettings); |
||
1926 | cbradney | 578 | Prefs.checkerProfiles.insert( tr("PDF 1.3"), checkerSettings); |
1261 | fschmid | 579 | checkerSettings.checkTransparency = false; |
1926 | cbradney | 580 | Prefs.checkerProfiles.insert( tr("PDF 1.4"), checkerSettings); |
1261 | fschmid | 581 | checkerSettings.checkTransparency = true; |
1284 | fschmid | 582 | checkerSettings.checkAnnotations = true; |
1261 | fschmid | 583 | checkerSettings.minResolution = 144.0; |
584 | Prefs.checkerProfiles.insert( tr("PDF/X-3"), checkerSettings); |
||
585 | Prefs.curCheckProfile = tr("Postscript"); |
||
1545 | cbradney | 586 | Prefs.PDF_Options.Thumbnails = false; |
587 | Prefs.PDF_Options.Articles = false; |
||
588 | Prefs.PDF_Options.Compress = true; |
||
589 | Prefs.PDF_Options.CompressMethod = 0; |
||
590 | Prefs.PDF_Options.Quality = 0; |
||
591 | Prefs.PDF_Options.RecalcPic = false; |
||
592 | Prefs.PDF_Options.Bookmarks = false; |
||
593 | Prefs.PDF_Options.PicRes = 300; |
||
1973 | craig | 594 | Prefs.PDF_Options.Version = PDFOptions::PDFVersion_14; |
1545 | cbradney | 595 | Prefs.PDF_Options.Resolution = 300; |
596 | Prefs.PDF_Options.Binding = 0; |
||
597 | Prefs.PDF_Options.EmbedList.clear(); |
||
598 | Prefs.PDF_Options.SubsetList.clear(); |
||
599 | Prefs.PDF_Options.MirrorH = false; |
||
600 | Prefs.PDF_Options.MirrorV = false; |
||
601 | Prefs.PDF_Options.RotateDeg = 0; |
||
602 | Prefs.PDF_Options.PresentMode = false; |
||
603 | Prefs.PDF_Options.Datei = ""; |
||
604 | Prefs.PDF_Options.PresentVals.clear(); |
||
605 | Prefs.PDF_Options.isGrayscale = false; |
||
606 | Prefs.PDF_Options.UseRGB = true; |
||
607 | Prefs.PDF_Options.UseProfiles = false; |
||
608 | Prefs.PDF_Options.UseProfiles2 = false; |
||
609 | Prefs.PDF_Options.SolidProf = ""; |
||
610 | Prefs.PDF_Options.SComp = 3; |
||
611 | Prefs.PDF_Options.ImageProf = ""; |
||
612 | Prefs.PDF_Options.PrintProf = ""; |
||
613 | Prefs.PDF_Options.Info = ""; |
||
614 | Prefs.PDF_Options.Intent = 0; |
||
615 | Prefs.PDF_Options.Intent2 = 0; |
||
616 | Prefs.PDF_Options.BleedTop = 0; |
||
617 | Prefs.PDF_Options.BleedLeft = 0; |
||
618 | Prefs.PDF_Options.BleedRight = 0; |
||
619 | Prefs.PDF_Options.BleedBottom = 0; |
||
620 | Prefs.PDF_Options.EmbeddedI = false; |
||
621 | Prefs.PDF_Options.Encrypt = false; |
||
622 | Prefs.PDF_Options.PassOwner = ""; |
||
623 | Prefs.PDF_Options.PassUser = ""; |
||
624 | Prefs.PDF_Options.Permissions = -4; |
||
625 | Prefs.PDF_Options.UseLPI = false; |
||
626 | Prefs.PDF_Options.LPISettings.clear(); |
||
2143 | subik | 627 | |
1642 | cbradney | 628 | //Attribute setup |
1641 | cbradney | 629 | Prefs.defaultItemAttributes.clear(); |
1701 | cbradney | 630 | Prefs.defaultToCSetups.clear(); |
801 | cbradney | 631 | } |
770 | cbradney | 632 | |
801 | cbradney | 633 | |
634 | void ScribusApp::initDefaultValues() |
||
635 | { |
||
831 | cbradney | 636 | dirs = prefsFile->getContext("dirs"); |
1780 | cbradney | 637 | HaveDoc = false; |
801 | cbradney | 638 | singleClose = false; |
639 | ScriptRunning = false; |
||
640 | view = NULL; |
||
641 | doc = NULL; |
||
642 | Buffer2 = ""; |
||
643 | UniCinp = false; |
||
644 | UniCinC = 0; |
||
645 | UniCinS = ""; |
||
646 | DispX = 10; |
||
647 | DispY = 10; |
||
648 | DocNr = 1; |
||
649 | PrinterUsed = false; |
||
650 | PDef.Pname = ""; |
||
651 | PDef.Dname = ""; |
||
652 | PDef.Command = ""; |
||
653 | keyrep = false; |
||
1204 | tsoots | 654 | _arrowKeyDown = false; |
801 | cbradney | 655 | ClipB = QApplication::clipboard(); |
656 | PalettesStat[0] = false; |
||
657 | GuidesStat[0] = false; |
||
658 | |||
659 | connect(ClipB, SIGNAL(dataChanged()), this, SLOT(ClipChange())); |
||
770 | cbradney | 660 | } |
661 | |||
801 | cbradney | 662 | void ScribusApp::initKeyboardShortcuts() |
663 | { |
||
1478 | cbradney | 664 | for( QMap<QString, QGuardedPtr<ScrAction> >::Iterator it = scrActions.begin(); it!=scrActions.end(); ++it ) |
1525 | cbradney | 665 | { |
2178 | cbradney | 666 | if ((ScrAction*)(it.data())!=NULL) |
667 | SetKeyEntry(it.key(), it.data()->cleanMenuText(), QString(it.data()->accel()),0); |
||
668 | //else |
||
669 | // qDebug(it.key()); |
||
1525 | cbradney | 670 | //qDebug(QString("|-\n|%1||%2||%3").arg(it.key()).arg(it.data()->cleanMenuText()).arg(QString(it.data()->accel()))); |
671 | } |
||
801 | cbradney | 672 | } |
673 | |||
674 | void ScribusApp::initArrowStyles() |
||
675 | { |
||
1065 | cbradney | 676 | struct ArrowDesc arrow; |
801 | cbradney | 677 | FPointArray points; |
678 | QWMatrix arrowScaling; |
||
679 | arrowScaling.scale(0.5, 0.5); |
||
680 | arrow.name = "Arrow1L"; |
||
681 | arrow.userArrow = false; |
||
682 | points.addQuadPoint(0, 0, 0, 0, 0, 0, 0, 0); |
||
683 | points.addQuadPoint(-5, -5, -5, -5, -5, -5, -5, -5); |
||
684 | points.addQuadPoint(12, 0, 12, 0, 12, 0, 12, 0); |
||
685 | points.addQuadPoint(-5, 5, -5, 5, -5, 5, -5, 5); |
||
686 | points.addQuadPoint(0, 0, 0, 0, 0, 0, 0, 0); |
||
687 | arrow.points = points.copy(); |
||
688 | Prefs.arrowStyles.append(arrow); |
||
689 | arrow.name = "Arrow1M"; |
||
690 | points.map(arrowScaling); |
||
691 | arrow.points = points.copy(); |
||
692 | Prefs.arrowStyles.append(arrow); |
||
693 | arrow.name = "Arrow1S"; |
||
694 | points.map(arrowScaling); |
||
695 | arrow.points = points.copy(); |
||
696 | Prefs.arrowStyles.append(arrow); |
||
697 | arrow.name = "SquareL"; |
||
698 | points.resize(0); |
||
699 | points.addQuadPoint(-5, -5, -5, -5, -5, -5, -5, -5); |
||
700 | points.addQuadPoint(5, -5, 5, -5, 5, -5, 5, -5); |
||
701 | points.addQuadPoint(5, 5, 5, 5, 5, 5, 5, 5); |
||
702 | points.addQuadPoint(-5, 5, -5, 5, -5, 5, -5, 5); |
||
703 | points.addQuadPoint(-5, -5, -5, -5, -5, -5, -5, -5); |
||
704 | arrow.points = points.copy(); |
||
705 | Prefs.arrowStyles.append(arrow); |
||
706 | arrow.name = "SquareM"; |
||
707 | points.map(arrowScaling); |
||
708 | arrow.points = points.copy(); |
||
709 | Prefs.arrowStyles.append(arrow); |
||
710 | arrow.name = "SquareS"; |
||
711 | points.map(arrowScaling); |
||
712 | arrow.points = points.copy(); |
||
713 | Prefs.arrowStyles.append(arrow); |
||
714 | arrow.name = "TriangleInL"; |
||
715 | points.resize(0); |
||
716 | points.addQuadPoint(5.77, 0, 5.77, 0, 5.77, 0, 5.77, 0); |
||
717 | points.addQuadPoint(-2.88, 5, -2.88, 5, -2.88, 5, -2.88, 5); |
||
718 | points.addQuadPoint(-2.88, -5, -2.88, -5, -2.88, -5, -2.88, -5); |
||
719 | points.addQuadPoint(5.77, 0, 5.77, 0, 5.77, 0, 5.77, 0); |
||
720 | arrow.points = points.copy(); |
||
721 | Prefs.arrowStyles.append(arrow); |
||
722 | arrow.name = "TriangleInM"; |
||
723 | points.map(arrowScaling); |
||
724 | arrow.points = points.copy(); |
||
725 | Prefs.arrowStyles.append(arrow); |
||
726 | arrow.name = "TriangleInS"; |
||
727 | points.map(arrowScaling); |
||
728 | arrow.points = points.copy(); |
||
729 | Prefs.arrowStyles.append(arrow); |
||
730 | arrow.name = "TriangleOutL"; |
||
731 | points.resize(0); |
||
732 | points.addQuadPoint(-5.77, 0, -5.77, 0, -5.77, 0, -5.77, 0); |
||
733 | points.addQuadPoint(2.88, 5, 2.88, 5, 2.88, 5, 2.88, 5); |
||
734 | points.addQuadPoint(2.88, -5, 2.88, -5, 2.88, -5, 2.88, -5); |
||
735 | points.addQuadPoint(-5.77, 0, -5.77, 0, -5.77, 0, -5.77, 0); |
||
736 | arrow.points = points.copy(); |
||
737 | Prefs.arrowStyles.append(arrow); |
||
738 | arrow.name = "TriangleOutM"; |
||
739 | points.map(arrowScaling); |
||
740 | arrow.points = points.copy(); |
||
741 | Prefs.arrowStyles.append(arrow); |
||
742 | arrow.name = "TriangleOutS"; |
||
743 | points.map(arrowScaling); |
||
744 | arrow.points = points.copy(); |
||
745 | Prefs.arrowStyles.append(arrow); |
||
746 | } |
||
747 | |||
748 | void ScribusApp::initPalettes() |
||
749 | { |
||
1493 | cbradney | 750 | //CB TODO hide the publicly available members of some palettes |
751 | // these must be filtered too as they take control of the palettes events |
||
1545 | cbradney | 752 | outlinePalette = new Tree(this, this); |
753 | connect( scrActions["toolsOutline"], SIGNAL(toggled(bool)) , outlinePalette, SLOT(setPaletteShown(bool)) ); |
||
754 | connect( outlinePalette, SIGNAL(paletteShown(bool)), scrActions["toolsOutline"], SLOT(setOn(bool))); |
||
755 | outlinePalette->setPrefsContext("OutlinePalette"); |
||
756 | outlinePalette->reportDisplay->installEventFilter(this); |
||
757 | propertiesPalette = new Mpalette(this, &Prefs); |
||
758 | connect( scrActions["toolsProperties"], SIGNAL(toggled(bool)) , propertiesPalette, SLOT(setPaletteShown(bool)) ); |
||
759 | connect( propertiesPalette, SIGNAL(paletteShown(bool)), scrActions["toolsProperties"], SLOT(setOn(bool))); |
||
760 | propertiesPalette->setPrefsContext("PropertiesPalette"); |
||
761 | propertiesPalette->Cpal->SetColors(Prefs.DColors); |
||
762 | propertiesPalette->Cpal->UseTrans(true); |
||
2508 | fschmid | 763 | propertiesPalette->Fonts->RebuildList(0); |
1545 | cbradney | 764 | propertiesPalette->installEventFilter(this); |
765 | nodePalette = new NodePalette(this); |
||
766 | nodePalette->setPrefsContext("NodePalette"); |
||
767 | nodePalette->installEventFilter(this); |
||
1549 | subik | 768 | |
1545 | cbradney | 769 | layerPalette = new LayerPalette(this); |
770 | connect( scrActions["toolsLayers"], SIGNAL(toggled(bool)) , layerPalette, SLOT(setPaletteShown(bool)) ); |
||
771 | connect( layerPalette, SIGNAL(paletteShown(bool)), scrActions["toolsLayers"], SLOT(setOn(bool))); |
||
772 | layerPalette->setPrefsContext("LayerPalette"); |
||
773 | layerPalette->installEventFilter(this); |
||
774 | layerPalette->Table->installEventFilter(this); |
||
775 | scrapbookPalette = new Biblio(this, &Prefs); |
||
776 | connect( scrActions["toolsScrapbook"], SIGNAL(toggled(bool)) , scrapbookPalette, SLOT(setPaletteShown(bool)) ); |
||
777 | connect( scrapbookPalette, SIGNAL(paletteShown(bool)), scrActions["toolsScrapbook"], SLOT(setOn(bool))); |
||
778 | scrapbookPalette->setPrefsContext("ScrapbookPalette"); |
||
779 | scrapbookPalette->installEventFilter(this); |
||
780 | pagePalette = new SeitenPal(this); |
||
781 | connect( scrActions["toolsPages"], SIGNAL(toggled(bool)) , pagePalette, SLOT(setPaletteShown(bool)) ); |
||
782 | connect( scrActions["toolsPages"], SIGNAL(toggled(bool)) , this, SLOT(setPagePalette(bool)) ); |
||
783 | connect( pagePalette, SIGNAL(paletteShown(bool)), scrActions["toolsPages"], SLOT(setOn(bool))); |
||
784 | pagePalette->setPrefsContext("PagePalette"); |
||
785 | pagePalette->installEventFilter(this); |
||
786 | bookmarkPalette = new BookPalette(this); |
||
787 | connect( scrActions["toolsBookmarks"], SIGNAL(toggled(bool)) , bookmarkPalette, SLOT(setPaletteShown(bool)) ); |
||
788 | connect( bookmarkPalette, SIGNAL(paletteShown(bool)), scrActions["toolsBookmarks"], SLOT(setOn(bool))); |
||
789 | bookmarkPalette->setPrefsContext("BookmarkPalette"); |
||
790 | bookmarkPalette->installEventFilter(this); |
||
791 | measurementPalette = new Measurements(this); |
||
792 | connect( scrActions["toolsMeasurements"], SIGNAL(toggled(bool)) , measurementPalette, SLOT(setPaletteShown(bool)) ); |
||
1525 | cbradney | 793 | connect( scrActions["toolsMeasurements"], SIGNAL(toggledData(bool, int)) , this, SLOT(setAppModeByToggle(bool, int)) ); |
1545 | cbradney | 794 | connect( measurementPalette, SIGNAL(paletteShown(bool)), scrActions["toolsMeasurements"], SLOT(setOn(bool))); |
795 | measurementPalette->setPrefsContext("MeasurementPalette"); |
||
796 | measurementPalette->installEventFilter(this); |
||
797 | measurementPalette->hide(); |
||
798 | docCheckerPalette = new CheckDocument(this, false); |
||
799 | connect( scrActions["toolsPreflightVerifier"], SIGNAL(toggled(bool)) , docCheckerPalette, SLOT(setPaletteShown(bool)) ); |
||
800 | connect( docCheckerPalette, SIGNAL(paletteShown(bool)), scrActions["toolsPreflightVerifier"], SLOT(setOn(bool))); |
||
1825 | fschmid | 801 | connect( docCheckerPalette, SIGNAL(paletteShown(bool)), this, SLOT(docCheckToggle(bool))); |
1545 | cbradney | 802 | docCheckerPalette->setPrefsContext("DocCheckerPalette"); |
803 | docCheckerPalette->installEventFilter(this); |
||
804 | docCheckerPalette->hide(); |
||
2355 | cbradney | 805 | |
806 | alignDistributePalette = new AlignDistributePalette(this, "AlignDistributePalette", false); |
||
807 | connect( scrActions["toolsAlignDistribute"], SIGNAL(toggled(bool)) , alignDistributePalette, SLOT(setPaletteShown(bool)) ); |
||
808 | connect( alignDistributePalette, SIGNAL(paletteShown(bool)), scrActions["toolsAlignDistribute"], SLOT(setOn(bool))); |
||
809 | connect( alignDistributePalette, SIGNAL(documentChanged()), this, SLOT(slotDocCh())); |
||
810 | alignDistributePalette->setPrefsContext("AlignDistributePalette"); |
||
811 | alignDistributePalette->installEventFilter(this); |
||
812 | alignDistributePalette->hide(); |
||
813 | |||
1448 | cbradney | 814 | undoPalette = new UndoPalette(this, "undoPalette"); |
1493 | cbradney | 815 | undoPalette->installEventFilter(this); |
1448 | cbradney | 816 | undoManager->registerGui(undoPalette); |
1493 | cbradney | 817 | connect(undoPalette, SIGNAL(paletteShown(bool)), this, SLOT(setUndoPalette(bool))); |
1448 | cbradney | 818 | connect(undoPalette, SIGNAL(objectMode(bool)), this, SLOT(setUndoMode(bool))); |
1485 | tsoots | 819 | |
1545 | cbradney | 820 | connect(propertiesPalette, SIGNAL(DocChanged()), this, SLOT(slotDocCh())); |
821 | connect(propertiesPalette, SIGNAL(NewAbStyle(int)), this, SLOT(setNewAbStyle(int))); |
||
822 | connect(propertiesPalette, SIGNAL(BackHome()), this, SLOT(Aktiv())); |
||
823 | connect(propertiesPalette, SIGNAL(Stellung(int)), this, SLOT(setItemHoch(int))); |
||
824 | connect(propertiesPalette, SIGNAL(EditCL()), this, SLOT(ToggleFrameEdit())); |
||
825 | connect(propertiesPalette, SIGNAL(NewTF(QString)), this, SLOT(SetNewFont(QString))); |
||
826 | connect(propertiesPalette, SIGNAL(UpdtGui(int)), this, SLOT(HaveNewSel(int))); |
||
827 | connect(propertiesPalette->Cpal, SIGNAL(NewPen(QString)), this, SLOT(setPenFarbe(QString))); |
||
828 | connect(propertiesPalette->Cpal, SIGNAL(NewBrush(QString)), this, SLOT(setBrushFarbe(QString))); |
||
829 | connect(propertiesPalette->Cpal, SIGNAL(NewPenShade(int)), this, SLOT(setPenShade(int))); |
||
830 | connect(propertiesPalette->Cpal, SIGNAL(NewBrushShade(int)), this, SLOT(setBrushShade(int))); |
||
2026 | cbradney | 831 | connect(propertiesPalette->Cpal, SIGNAL(NewTrans(double)), this, SLOT(setItemFillTransparency(double))); |
832 | connect(propertiesPalette->Cpal, SIGNAL(NewTransS(double)), this, SLOT(setItemLineTransparency(double))); |
||
1545 | cbradney | 833 | connect(propertiesPalette->Cpal, SIGNAL(NewGradient(int)), this, SLOT(setGradFill(int))); |
834 | connect(propertiesPalette->Cpal->gradEdit->Preview, SIGNAL(gradientChanged()), this, SLOT(updtGradFill())); |
||
835 | connect(propertiesPalette->Cpal, SIGNAL(gradientChanged()), this, SLOT(updtGradFill())); |
||
836 | connect(propertiesPalette->Cpal, SIGNAL(QueryItem()), this, SLOT(GetBrushPen())); |
||
837 | connect(docCheckerPalette, SIGNAL(selectElement(int, int)), this, SLOT(SelectFromOutl(int, int))); |
||
838 | connect(docCheckerPalette, SIGNAL(selectPage(int)), this, SLOT(SelectFromOutlS(int))); |
||
2093 | cbradney | 839 | connect(docCheckerPalette, SIGNAL(selectMasterPage(QString)), this, SLOT(manageMasterPages(QString))); |
1545 | cbradney | 840 | connect(outlinePalette, SIGNAL(selectElement(int, int, bool)), this, SLOT(SelectFromOutl(int, int, bool))); |
841 | connect(outlinePalette, SIGNAL(selectPage(int)), this, SLOT(SelectFromOutlS(int))); |
||
2093 | cbradney | 842 | connect(outlinePalette, SIGNAL(selectMasterPage(QString)), this, SLOT(manageMasterPages(QString))); |
1545 | cbradney | 843 | connect(propertiesPalette->Spal, SIGNAL(newStyle(int)), this, SLOT(setNewAbStyle(int))); |
844 | connect(propertiesPalette, SIGNAL(EditLSt()), this, SLOT(slotEditLineStyles())); |
||
845 | connect(nodePalette, SIGNAL(Schliessen()), this, SLOT(NoFrameEdit())); |
||
846 | connect(layerPalette, SIGNAL(LayerActivated(int)), this, SLOT(changeLayer(int))); |
||
847 | connect(layerPalette, SIGNAL(LayerRemoved(int, bool)), this, SLOT(LayerRemove(int, bool))); |
||
848 | connect(layerPalette, SIGNAL(LayerChanged()), this, SLOT(showLayer())); |
||
2093 | cbradney | 849 | connect(pagePalette, SIGNAL(EditTemp(QString)), this, SLOT(manageMasterPages(QString))); |
850 | connect(pagePalette->PageView, SIGNAL(UseTemp(QString, int)), this, SLOT(Apply_MasterPage(QString, int))); |
||
1545 | cbradney | 851 | connect(pagePalette->PageView, SIGNAL(NewPage(int, QString)), this, SLOT(slotNewPageP(int, QString))); |
852 | connect(pagePalette->Trash, SIGNAL(DelPage(int)), this, SLOT(DeletePage2(int))); |
||
853 | connect(pagePalette, SIGNAL(GotoSeite(int)), this, SLOT(SelectFromOutlS(int))); |
||
854 | connect(bookmarkPalette->BView, SIGNAL(MarkMoved()), this, SLOT(StoreBookmarks())); |
||
855 | connect(bookmarkPalette->BView, SIGNAL(ChangeBMNr(int, int, int)), this, SLOT(ChBookmarks(int, int, int))); |
||
856 | connect(bookmarkPalette->BView, SIGNAL(SelectElement(int, int)), this, SLOT(SelectFromOutl(int, int))); |
||
801 | cbradney | 857 | } |
858 | |||
859 | void ScribusApp::initScrapbook() |
||
860 | { |
||
1554 | cbradney | 861 | QString scrapbookFile = QDir::convertSeparators(PrefsPfad+"/scrap13.scs"); |
801 | cbradney | 862 | QFileInfo scrapbookFileInfo = QFileInfo(scrapbookFile); |
863 | if (scrapbookFileInfo.exists()) |
||
2144 | cbradney | 864 | scrapbookPalette->readContents(scrapbookFile); |
865 | scrapbookPalette->setScrapbookFileName(scrapbookFile); |
||
1545 | cbradney | 866 | scrapbookPalette->AdjustMenu(); |
801 | cbradney | 867 | } |
868 | |||
770 | cbradney | 869 | const QString ScribusApp::getGuiLanguage() |
870 | { |
||
871 | return guiLanguage; |
||
872 | } |
||
873 | |||
1525 | cbradney | 874 | bool ScribusApp::warningVersion(QWidget *parent) |
875 | { |
||
876 | bool retval = false; |
||
2143 | subik | 877 | int t = QMessageBox::warning(parent, QObject::tr("Scribus Development Version"), "<qt>" + |
2132 | cbradney | 878 | QObject::tr("You are running a development version of Scribus 1.3.x. The current document you are working with was originally created in Scribus 1.2.2 or lower. The process of saving will make this file unusable again in Scribus 1.2.2 unless you use File->Save As. Are you sure you wish to proceed with this operation?") + "</qt>", |
1525 | cbradney | 879 | QObject::tr("&Cancel"), QObject::tr("&Proceed"), "", 1, 0); |
880 | if (t == 1) |
||
881 | retval = true; |
||
882 | return retval; |
||
883 | } |
||
884 | |||
675 | cbradney | 885 | /*! |
886 | \fn QString ScribusApp::getPreferencesLocation() |
||
887 | \author Craig Bradney |
||
888 | \date Thu 18 Nov 2004 |
||
889 | \brief Get the user's preference file location. Rename any existing old preferences files |
||
890 | \param None |
||
891 | \retval QString Location of the user's preferences |
||
892 | */ |
||
893 | |||
894 | QString ScribusApp::getPreferencesLocation() |
||
895 | { |
||
896 | QString Pff = QDir::convertSeparators(QDir::homeDirPath()+"/.scribus"); |
||
897 | QFileInfo Pffi = QFileInfo(Pff); |
||
898 | QString PrefsPfad; |
||
1144 | cbradney | 899 | //If we are using ~/.scribus |
675 | cbradney | 900 | if (Pffi.exists()) |
901 | { |
||
902 | if (Pffi.isDir()) |
||
903 | PrefsPfad = Pff; |
||
904 | else |
||
905 | PrefsPfad = QDir::homeDirPath(); |
||
906 | } |
||
1144 | cbradney | 907 | else // Move to using ~/.scribus/scribus.* from ~/.scribus.* |
675 | cbradney | 908 | { |
1144 | cbradney | 909 | QDir prefsDirectory = QDir(); |
910 | prefsDirectory.mkdir(Pff); |
||
675 | cbradney | 911 | PrefsPfad = Pff; |
1144 | cbradney | 912 | QString oldPR = QDir::convertSeparators(QDir::homeDirPath()+"/.scribus.rc"); |
913 | QFileInfo oldPi = QFileInfo(oldPR); |
||
914 | if (oldPi.exists()) |
||
915 | moveFile(oldPR, Pff+"/scribus.rc"); |
||
916 | QString oldPR2 = QDir::convertSeparators(QDir::homeDirPath()+"/.scribusfont.rc"); |
||
917 | QFileInfo oldPi2 = QFileInfo(oldPR2); |
||
918 | if (oldPi2.exists()) |
||
919 | moveFile(oldPR2, Pff+"/scribusfont.rc"); |
||
920 | QString oldPR3 = QDir::convertSeparators(QDir::homeDirPath()+"/.scribusscrap.scs"); |
||
921 | QFileInfo oldPi3 = QFileInfo(oldPR3); |
||
922 | if (oldPi3.exists()) |
||
923 | moveFile(oldPR3, Pff+"/scrap.scs"); |
||
675 | cbradney | 924 | } |
1392 | cbradney | 925 | return PrefsPfad; |
926 | } |
||
927 | |||
928 | /*! |
||
2556 | craig | 929 | \fn bool ScribusApp::copy12Preferences(const QString prefsLocation) |
1392 | cbradney | 930 | \author Craig Bradney |
931 | \date Sun 09 Jan 2005 |
||
2556 | craig | 932 | \brief Copy 1.2 prefs XML before loading, and copy rc files we don't yet convert |
1392 | cbradney | 933 | \param prefsLocation Location of user preferences |
2556 | craig | 934 | \retval bool true if prefs were imported |
1392 | cbradney | 935 | */ |
2556 | craig | 936 | bool ScribusApp::copy12Preferences(const QString prefsLocation) |
1392 | cbradney | 937 | { |
1144 | cbradney | 938 | //Now make copies for 1.3 use and leave the old ones alone for <1.3.0 usage |
1554 | cbradney | 939 | QString oldPR[5], newPR[5]; |
940 | oldPR[0]=QDir::convertSeparators(prefsLocation+"/scribus.rc"); |
||
2510 | craig | 941 | oldPR[1]=QDir::convertSeparators(prefsLocation+"/scrap.scs"); |
942 | oldPR[2]=QDir::convertSeparators(prefsLocation+"/prefs.xml"); |
||
943 | oldPR[3]=QDir::convertSeparators(prefsLocation+"/scripter.rc"); |
||
1554 | cbradney | 944 | newPR[0]=QDir::convertSeparators(prefsLocation+"/scribus13.rc"); |
2510 | craig | 945 | newPR[1]=QDir::convertSeparators(prefsLocation+"/scrap13.scs"); |
946 | newPR[2]=QDir::convertSeparators(prefsLocation+"/prefs13.xml"); |
||
947 | newPR[3]=QDir::convertSeparators(prefsLocation+"/scripter13.rc"); |
||
1485 | tsoots | 948 | |
1554 | cbradney | 949 | bool existsOldPR[5], existsNewPR[5]; |
950 | for (uint i=0;i<5;++i) |
||
951 | { |
||
952 | existsOldPR[i] =QFile::exists(oldPR[i]); |
||
953 | existsNewPR[i] =QFile::exists(newPR[i]); |
||
954 | } |
||
1485 | tsoots | 955 | |
1392 | cbradney | 956 | bool retVal=false; |
1144 | cbradney | 957 | //Only check for these two as they will be autocreated if they dont exist. |
1554 | cbradney | 958 | if( (existsOldPR[0] && !existsNewPR[0]) || (existsOldPR[3] && !existsNewPR[3]) ) |
1144 | cbradney | 959 | { |
1392 | cbradney | 960 | retVal=true; // converting from 1.2 prefs |
1144 | cbradney | 961 | if (splashScreen) |
962 | splashScreen->hide(); |
||
963 | if ( (QMessageBox::question( this, tr("Migrate Old Scribus Settings?"), |
||
1392 | cbradney | 964 | tr("Scribus has detected existing Scribus 1.2 preferences files.\n" |
965 | "Do you want to migrate them to the new Scribus version?"), |
||
966 | QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, QMessageBox::NoButton))==QMessageBox::Yes ) |
||
1144 | cbradney | 967 | { |
1554 | cbradney | 968 | for (uint i=0;i<5;++i) |
969 | { |
||
970 | if (existsOldPR[i] && !existsNewPR[i]) |
||
971 | copyFile(oldPR[i], newPR[i]); |
||
972 | } |
||
1144 | cbradney | 973 | } |
974 | if (splashScreen) |
||
975 | splashScreen->show(); |
||
976 | } |
||
2510 | craig | 977 | |
1392 | cbradney | 978 | return retVal; |
675 | cbradney | 979 | } |
980 | |||
2556 | craig | 981 | /*! |
982 | \fn void ScribusApp::convert12Preferences(const QString prefsLocation) |
||
983 | \author Craig Ringer |
||
984 | \date Sun 26 June 2005 |
||
985 | \brief Import 1.2.x prefs rc data into new prefs xml |
||
986 | \param prefsLocation Location of user preferences |
||
987 | \retval None |
||
988 | */ |
||
989 | void ScribusApp::convert12Preferences(const QString prefsLocation) |
||
990 | { |
||
991 | // Import 1.2 font search path prefs |
||
992 | QFile fontPrefsFile12(QDir::convertSeparators(prefsLocation+"/scribusfont.rc")); |
||
993 | if (fontPrefsFile12.open(IO_ReadOnly)) |
||
994 | { |
||
995 | PrefsContext *pc = prefsFile->getContext("Fonts"); |
||
996 | PrefsTable *fontPrefs = pc->getTable("ExtraFontDirs"); |
||
997 | QTextStream tsx(&fontPrefsFile12); |
||
998 | QString extraPath = tsx.read(); |
||
999 | fontPrefsFile12.close(); |
||
1000 | QStringList extraFonts = QStringList::split("\n",extraPath); |
||
1001 | for (int i = 0; i < extraFonts.count(); ++i) |
||
1002 | fontPrefs->set(i, 0, extraFonts[i]); |
||
1003 | } |
||
1004 | } |
||
1005 | |||
3 | paul | 1006 | void ScribusApp::initMenuBar() |
1007 | { |
||
1008 | QFont tmp; |
||
1009 | RecentDocs.clear(); |
||
1208 | cbradney | 1010 | |
1011 | scrMenuMgr->createMenu("File", tr("&File")); |
||
1012 | scrMenuMgr->addMenuItem(scrActions["fileNew"], "File"); |
||
1013 | scrMenuMgr->addMenuItem(scrActions["fileOpen"], "File"); |
||
1014 | recentFileMenuName="FileOpenRecent"; |
||
1015 | scrMenuMgr->createMenu(recentFileMenuName, tr("Open &Recent"), "File"); |
||
1016 | scrMenuMgr->addMenuSeparator("File"); |
||
1017 | scrMenuMgr->addMenuItem(scrActions["fileClose"], "File"); |
||
1018 | scrMenuMgr->addMenuItem(scrActions["fileSave"], "File"); |
||
1019 | scrMenuMgr->addMenuItem(scrActions["fileSaveAs"], "File"); |
||
1020 | scrMenuMgr->addMenuItem(scrActions["fileRevert"], "File"); |
||
1021 | scrMenuMgr->addMenuItem(scrActions["fileCollect"], "File"); |
||
1022 | scrMenuMgr->addMenuSeparator("File"); |
||
1023 | scrMenuMgr->createMenu("FileImport", tr("&Import"), "File"); |
||
1024 | scrMenuMgr->addMenuItem(scrActions["fileImportText"], "FileImport"); |
||
1025 | scrMenuMgr->addMenuItem(scrActions["fileImportAppendText"], "FileImport"); |
||
1026 | scrMenuMgr->addMenuItem(scrActions["fileImportImage"], "FileImport"); |
||
1027 | scrMenuMgr->createMenu("FileExport", tr("&Export"), "File"); |
||
1028 | scrMenuMgr->addMenuItem(scrActions["fileExportText"], "FileExport"); |
||
1029 | scrMenuMgr->addMenuItem(scrActions["fileExportAsEPS"], "FileExport"); |
||
1030 | scrMenuMgr->addMenuItem(scrActions["fileExportAsPDF"], "FileExport"); |
||
1031 | scrMenuMgr->addMenuSeparator("File"); |
||
1032 | scrMenuMgr->addMenuItem(scrActions["fileDocSetup"], "File"); |
||
1033 | scrMenuMgr->addMenuItem(scrActions["filePrint"], "File"); |
||
1034 | scrMenuMgr->addMenuSeparator("File"); |
||
1035 | scrMenuMgr->addMenuItem(scrActions["fileQuit"], "File"); |
||
1036 | |||
1485 | tsoots | 1037 | scrActions["fileClose"]->setEnabled(false); |
1208 | cbradney | 1038 | scrActions["fileSave"]->setEnabled(false); |
1039 | scrActions["fileSaveAs"]->setEnabled(false); |
||
1040 | scrActions["fileRevert"]->setEnabled(false); |
||
1041 | scrActions["fileCollect"]->setEnabled(false); |
||
1042 | scrActions["fileImportText"]->setEnabled(false); |
||
1043 | scrActions["fileImportImage"]->setEnabled(false); |
||
1044 | scrActions["fileImportAppendText"]->setEnabled(false); |
||
2093 | cbradney | 1045 | scrActions["pageImport"]->setEnabled(false); |
1208 | cbradney | 1046 | scrActions["fileExportText"]->setEnabled(false); |
1047 | scrActions["fileExportAsEPS"]->setEnabled(false); |
||
1048 | scrActions["fileExportAsPDF"]->setEnabled(false); |
||
1049 | scrMenuMgr->setMenuEnabled("FileExport", false); |
||
1050 | scrActions["fileDocSetup"]->setEnabled(false); |
||
1051 | scrActions["filePrint"]->setEnabled(false); |
||
1485 | tsoots | 1052 | |
1227 | cbradney | 1053 | scrMenuMgr->createMenu("Edit", tr("&Edit")); |
1054 | scrMenuMgr->addMenuItem(scrActions["editUndoAction"], "Edit"); |
||
1055 | scrMenuMgr->addMenuItem(scrActions["editRedoAction"], "Edit"); |
||
1056 | scrMenuMgr->addMenuItem(scrActions["editActionMode"], "Edit"); |
||
1057 | scrMenuMgr->addMenuSeparator("Edit"); |
||
1058 | scrMenuMgr->addMenuItem(scrActions["editCut"], "Edit"); |
||
1059 | scrMenuMgr->addMenuItem(scrActions["editCopy"], "Edit"); |
||
1060 | scrMenuMgr->addMenuItem(scrActions["editPaste"], "Edit"); |
||
1963 | cbradney | 1061 | scrMenuMgr->addMenuItem(scrActions["editClearContents"], "Edit"); |
1227 | cbradney | 1062 | scrMenuMgr->addMenuItem(scrActions["editSelectAll"], "Edit"); |
1837 | cbradney | 1063 | scrMenuMgr->addMenuItem(scrActions["editDeselectAll"], "Edit"); |
1227 | cbradney | 1064 | scrMenuMgr->addMenuSeparator("Edit"); |
1065 | scrMenuMgr->addMenuItem(scrActions["editSearchReplace"], "Edit"); |
||
1981 | cbradney | 1066 | scrMenuMgr->addMenuItem(scrActions["toolsEditWithStoryEditor"], "Edit"); |
2259 | cbradney | 1067 | scrMenuMgr->addMenuItem(scrActions["editEditWithImageEditor"], "Edit"); |
1227 | cbradney | 1068 | scrMenuMgr->addMenuSeparator("Edit"); |
1069 | scrMenuMgr->addMenuItem(scrActions["editColors"], "Edit"); |
||
1070 | scrMenuMgr->addMenuItem(scrActions["editParaStyles"], "Edit"); |
||
1071 | scrMenuMgr->addMenuItem(scrActions["editLineStyles"], "Edit"); |
||
2093 | cbradney | 1072 | scrMenuMgr->addMenuItem(scrActions["editMasterPages"], "Edit"); |
1227 | cbradney | 1073 | scrMenuMgr->addMenuItem(scrActions["editJavascripts"], "Edit"); |
1074 | scrMenuMgr->addMenuSeparator("Edit"); |
||
1075 | scrMenuMgr->addMenuItem(scrActions["editPreferences"], "Edit"); |
||
1076 | scrActions["editUndoAction"]->setEnabled(false); |
||
1077 | scrActions["editRedoAction"]->setEnabled(false); |
||
1446 | tsoots | 1078 | scrActions["editActionMode"]->setEnabled(true); |
1227 | cbradney | 1079 | scrActions["editCut"]->setEnabled(false); |
1080 | scrActions["editCopy"]->setEnabled(false); |
||
1081 | scrActions["editPaste"]->setEnabled(false); |
||
1963 | cbradney | 1082 | scrActions["editClearContents"]->setEnabled(false); |
1227 | cbradney | 1083 | scrActions["editSelectAll"]->setEnabled(false); |
1837 | cbradney | 1084 | scrActions["editDeselectAll"]->setEnabled(false); |
1227 | cbradney | 1085 | scrActions["editSearchReplace"]->setEnabled(false); |
1086 | scrActions["editParaStyles"]->setEnabled(false); |
||
1087 | scrActions["editLineStyles"]->setEnabled(false); |
||
2093 | cbradney | 1088 | scrActions["editMasterPages"]->setEnabled(false); |
1227 | cbradney | 1089 | scrActions["editJavascripts"]->setEnabled(false); |
1996 | cbradney | 1090 | scrActions["toolsEditWithStoryEditor"]->setEnabled(false); |
2279 | cbradney | 1091 | scrActions["editEditWithImageEditor"]->setEnabled(false); |
1227 | cbradney | 1092 | |
1093 | //Style Menu |
||
1325 | cbradney | 1094 | scrMenuMgr->createMenu("Style", tr("St&yle")); |
1437 | cbradney | 1095 | //Color menu |
1096 | // CB TODO |
||
1097 | scrMenuMgr->createMenu("Color", tr("&Color")); |
||
1098 | ColorMenC = new QComboBox(false); |
||
1099 | ColorMenC->setEditable(false); |
||
1100 | scrMenuMgr->addMenuItem(ColorMenC, "Color"); |
||
1485 | tsoots | 1101 | |
1437 | cbradney | 1102 | //Text size menu |
1103 | scrMenuMgr->createMenu("FontSize", tr("&Size")); |
||
1104 | scrActionGroups["fontSize"]->addTo(scrMenuMgr->getLocalPopupMenu("FontSize")); |
||
1485 | tsoots | 1105 | |
1437 | cbradney | 1106 | //Shade menu |
1107 | scrMenuMgr->createMenu("Shade", tr("&Shade")); |
||
1108 | scrActionGroups["shade"]->addTo(scrMenuMgr->getLocalPopupMenu("Shade")); |
||
1485 | tsoots | 1109 | |
1437 | cbradney | 1110 | //Font menu |
1111 | scrMenuMgr->createMenu("Font", tr("&Font")); |
||
1112 | FontMenu = scrMenuMgr->getLocalPopupMenu("Font"); |
||
1485 | tsoots | 1113 | |
1437 | cbradney | 1114 | //Type style menu |
1115 | scrMenuMgr->createMenu("TypeEffects", tr("&Effects")); |
||
1116 | scrActionGroups["typeEffects"]->addTo(scrMenuMgr->getLocalPopupMenu("TypeEffects")); |
||
1485 | tsoots | 1117 | |
1236 | cbradney | 1118 | //Item Menu |
1119 | scrMenuMgr->createMenu("Item", tr("&Item")); |
||
1120 | scrMenuMgr->addMenuItem(scrActions["itemDuplicate"], "Item"); |
||
1121 | scrMenuMgr->addMenuItem(scrActions["itemMulDuplicate"], "Item"); |
||
1122 | scrMenuMgr->addMenuItem(scrActions["itemDelete"], "Item"); |
||
1123 | scrMenuMgr->addMenuSeparator("Item"); |
||
1124 | scrMenuMgr->addMenuItem(scrActions["itemGroup"], "Item"); |
||
1125 | scrMenuMgr->addMenuItem(scrActions["itemUngroup"], "Item"); |
||
1126 | scrMenuMgr->addMenuItem(scrActions["itemLock"], "Item"); |
||
1858 | cbradney | 1127 | scrMenuMgr->addMenuItem(scrActions["itemLockSize"], "Item"); |
2256 | cbradney | 1128 | scrMenuMgr->addMenuSeparator("Item"); |
2026 | cbradney | 1129 | scrMenuMgr->addMenuItem(scrActions["itemImageIsVisible"], "Item"); |
2260 | cbradney | 1130 | scrMenuMgr->addMenuItem(scrActions["itemUpdateImage"], "Item"); |
2259 | cbradney | 1131 | scrMenuMgr->addMenuItem(scrActions["itemAdjustFrameToImage"], "Item"); |
2260 | cbradney | 1132 | scrMenuMgr->addMenuItem(scrActions["itemExtendedImageProperties"], "Item"); |
2256 | cbradney | 1133 | scrMenuMgr->createMenu("ItemPreviewSettings", "Preview Settings", "Item"); |
1134 | scrMenuMgr->addMenuItem(scrActions["itemPreviewLow"], "ItemPreviewSettings"); |
||
1135 | scrMenuMgr->addMenuItem(scrActions["itemPreviewNormal"], "ItemPreviewSettings"); |
||
1136 | scrMenuMgr->addMenuItem(scrActions["itemPreviewFull"], "ItemPreviewSettings"); |
||
1236 | cbradney | 1137 | scrMenuMgr->addMenuSeparator("Item"); |
2256 | cbradney | 1138 | scrMenuMgr->createMenu("ItemLevel", "Level"); |
1858 | cbradney | 1139 | scrMenuMgr->addMenuToMenu("ItemLevel", "Item"); |
2104 | cbradney | 1140 | scrMenuMgr->addMenuItem(scrActions["itemRaise"], "ItemLevel"); |
1858 | cbradney | 1141 | scrMenuMgr->addMenuItem(scrActions["itemLower"], "ItemLevel"); |
2104 | cbradney | 1142 | scrMenuMgr->addMenuItem(scrActions["itemRaiseToTop"], "ItemLevel"); |
1143 | scrMenuMgr->addMenuItem(scrActions["itemLowerToBottom"], "ItemLevel"); |
||
2408 | cbradney | 1144 | scrMenuMgr->createMenu("ItemLayer", "Send to La&yer"); |
1145 | scrMenuMgr->addMenuToMenu("ItemLayer", "Item"); |
||
1146 | layerMenuName="ItemLayer"; |
||
1981 | cbradney | 1147 | scrMenuMgr->addMenuItem(scrActions["itemSendToScrapbook"], "Item"); |
1236 | cbradney | 1148 | scrMenuMgr->addMenuSeparator("Item"); |
2256 | cbradney | 1149 | scrMenuMgr->addMenuItem(scrActions["itemAttributes"], "Item"); |
1981 | cbradney | 1150 | scrMenuMgr->createMenu("ItemPDFOptions", tr("&PDF Options")); |
1151 | scrMenuMgr->addMenuToMenu("ItemPDFOptions", "Item"); |
||
1152 | scrMenuMgr->addMenuItem(scrActions["itemPDFIsAnnotation"], "ItemPDFOptions"); |
||
2143 | subik | 1153 | scrMenuMgr->addMenuItem(scrActions["itemPDFIsBookmark"], "ItemPDFOptions"); |
1981 | cbradney | 1154 | scrMenuMgr->addMenuItem(scrActions["itemPDFAnnotationProps"], "ItemPDFOptions"); |
1155 | scrMenuMgr->addMenuItem(scrActions["itemPDFFieldProps"], "ItemPDFOptions"); |
||
1236 | cbradney | 1156 | scrMenuMgr->createMenu("ItemShapes", tr("&Shape"), "Item"); |
1157 | // CB TODO |
||
1158 | //Shape menu |
||
169 | Franz | 1159 | SCustom = new Autoforms(0); |
1236 | cbradney | 1160 | scrMenuMgr->addMenuItem(SCustom, "ItemShapes"); |
272 | Franz | 1161 | connect(SCustom, SIGNAL(FormSel(int, int, double *)), this, SLOT(MakeFrame(int, int, double *))); |
1236 | cbradney | 1162 | scrMenuMgr->addMenuItem(scrActions["itemShapeEdit"], "ItemShapes"); |
1858 | cbradney | 1163 | scrMenuMgr->createMenu("ItemConvertTo", tr("C&onvert To")); |
1164 | scrMenuMgr->addMenuToMenu("ItemConvertTo", "Item"); |
||
1165 | scrMenuMgr->addMenuItem(scrActions["itemConvertToBezierCurve"], "ItemConvertTo"); |
||
1166 | scrMenuMgr->addMenuItem(scrActions["itemConvertToImageFrame"], "ItemConvertTo"); |
||
1167 | scrMenuMgr->addMenuItem(scrActions["itemConvertToOutlines"], "ItemConvertTo"); |
||
1168 | scrMenuMgr->addMenuItem(scrActions["itemConvertToPolygon"], "ItemConvertTo"); |
||
1169 | scrMenuMgr->addMenuItem(scrActions["itemConvertToTextFrame"], "ItemConvertTo"); |
||
2143 | subik | 1170 | |
1236 | cbradney | 1171 | scrMenuMgr->addMenuItem(scrActions["itemAttachTextToPath"], "Item"); |
1172 | scrMenuMgr->addMenuItem(scrActions["itemDetachTextFromPath"], "Item"); |
||
1173 | scrMenuMgr->addMenuItem(scrActions["itemCombinePolygons"], "Item"); |
||
1174 | scrMenuMgr->addMenuItem(scrActions["itemSplitPolygons"], "Item"); |
||
1175 | scrMenuMgr->setMenuEnabled("ItemShapes", false); |
||
1176 | scrActions["itemGroup"]->setEnabled(false); |
||
1177 | scrActions["itemUngroup"]->setEnabled(false); |
||
1178 | scrActions["itemAttachTextToPath"]->setEnabled(false); |
||
1179 | scrActions["itemDetachTextFromPath"]->setEnabled(false); |
||
1180 | scrActions["itemCombinePolygons"]->setEnabled(false); |
||
1181 | scrActions["itemSplitPolygons"]->setEnabled(false); |
||
1182 | scrActions["itemLock"]->setEnabled(false); |
||
1858 | cbradney | 1183 | scrActions["itemLockSize"]->setEnabled(false); |
2026 | cbradney | 1184 | scrActions["itemImageIsVisible"]->setEnabled(false); |
1858 | cbradney | 1185 | scrMenuMgr->setMenuEnabled("ItemConvertTo", false); |
1186 | scrActions["itemConvertToBezierCurve"]->setEnabled(false); |
||
1187 | scrActions["itemConvertToImageFrame"]->setEnabled(false); |
||
1236 | cbradney | 1188 | scrActions["itemConvertToOutlines"]->setEnabled(false); |
1858 | cbradney | 1189 | scrActions["itemConvertToPolygon"]->setEnabled(false); |
1190 | scrActions["itemConvertToTextFrame"]->setEnabled(false); |
||
1485 | tsoots | 1191 | |
1801 | cbradney | 1192 | //Insert menu |
1193 | scrMenuMgr->createMenu("Insert", tr("I&nsert")); |
||
1194 | scrMenuMgr->addMenuItem(scrActions["toolsInsertTextFrame"], "Insert"); |
||
1195 | scrMenuMgr->addMenuItem(scrActions["toolsInsertImageFrame"], "Insert"); |
||
1196 | scrMenuMgr->addMenuItem(scrActions["toolsInsertTableFrame"], "Insert"); |
||
1197 | scrMenuMgr->addMenuItem(scrActions["toolsInsertShape"], "Insert"); |
||
1198 | scrMenuMgr->addMenuItem(scrActions["toolsInsertPolygon"], "Insert"); |
||
1199 | scrMenuMgr->addMenuItem(scrActions["toolsInsertLine"], "Insert"); |
||
1200 | scrMenuMgr->addMenuItem(scrActions["toolsInsertBezier"], "Insert"); |
||
1201 | scrMenuMgr->addMenuItem(scrActions["toolsInsertFreehandLine"], "Insert"); |
||
1202 | scrMenuMgr->addMenuSeparator("Insert"); |
||
1903 | cbradney | 1203 | scrMenuMgr->addMenuItem(scrActions["insertGlyph"], "Insert"); |
2143 | subik | 1204 | |
2226 | cbradney | 1205 | scrMenuMgr->createMenu("InsertChar", tr("Character"), "Insert"); |
1206 | //scrMenuMgr->addMenuToMenu("InsertChar", "Insert"); |
||
1903 | cbradney | 1207 | scrMenuMgr->addMenuItem(scrActions["specialPageNumber"], "InsertChar"); |
1208 | scrMenuMgr->addMenuItem(scrActions["specialSmartHyphen"], "InsertChar"); |
||
2407 | fschmid | 1209 | scrMenuMgr->addMenuItem(scrActions["specialNonBreakingHyphen"], "InsertChar"); |
2039 | cbradney | 1210 | scrMenuMgr->addMenuSeparator("InsertChar"); |
1903 | cbradney | 1211 | scrMenuMgr->addMenuItem(scrActions["specialCopyRight"], "InsertChar"); |
1212 | scrMenuMgr->addMenuItem(scrActions["specialRegdTM"], "InsertChar"); |
||
1213 | scrMenuMgr->addMenuItem(scrActions["specialTM"], "InsertChar"); |
||
1214 | scrMenuMgr->addMenuItem(scrActions["specialBullet"], "InsertChar"); |
||
1215 | scrMenuMgr->addMenuSeparator("InsertChar"); |
||
1216 | scrMenuMgr->addMenuItem(scrActions["specialDashEm"], "InsertChar"); |
||
1217 | scrMenuMgr->addMenuItem(scrActions["specialDashEn"], "InsertChar"); |
||
1218 | scrMenuMgr->addMenuItem(scrActions["specialDashFigure"], "InsertChar"); |
||
1219 | scrMenuMgr->addMenuItem(scrActions["specialDashQuotation"], "InsertChar"); |
||
2143 | subik | 1220 | |
2226 | cbradney | 1221 | scrMenuMgr->createMenu("InsertQuote", tr("Quote"), "Insert"); |
1222 | //scrMenuMgr->addMenuToMenu("InsertQuote", "Insert"); |
||
2039 | cbradney | 1223 | scrMenuMgr->addMenuItem(scrActions["specialQuoteApostrophe"], "InsertQuote"); |
1224 | scrMenuMgr->addMenuItem(scrActions["specialQuoteStraight"], "InsertQuote"); |
||
1225 | scrMenuMgr->addMenuSeparator("InsertQuote"); |
||
1226 | scrMenuMgr->addMenuItem(scrActions["specialQuoteSingleLeft"], "InsertQuote"); |
||
1227 | scrMenuMgr->addMenuItem(scrActions["specialQuoteSingleRight"], "InsertQuote"); |
||
1228 | scrMenuMgr->addMenuItem(scrActions["specialQuoteDoubleLeft"], "InsertQuote"); |
||
1229 | scrMenuMgr->addMenuItem(scrActions["specialQuoteDoubleRight"], "InsertQuote"); |
||
1230 | scrMenuMgr->addMenuSeparator("InsertQuote"); |
||
1231 | scrMenuMgr->addMenuItem(scrActions["specialQuoteSingleReversed"], "InsertQuote"); |
||
1232 | scrMenuMgr->addMenuItem(scrActions["specialQuoteDoubleReversed"], "InsertQuote"); |
||
1233 | scrMenuMgr->addMenuSeparator("InsertQuote"); |
||
1234 | scrMenuMgr->addMenuItem(scrActions["specialQuoteSingleLeftGuillemet"], "InsertQuote"); |
||
1235 | scrMenuMgr->addMenuItem(scrActions["specialQuoteSingleRightGuillemet"], "InsertQuote"); |
||
1236 | scrMenuMgr->addMenuItem(scrActions["specialQuoteDoubleLeftGuillemet"], "InsertQuote"); |
||
1237 | scrMenuMgr->addMenuItem(scrActions["specialQuoteDoubleRightGuillemet"], "InsertQuote"); |
||
1238 | scrMenuMgr->addMenuSeparator("InsertQuote"); |
||
1239 | scrMenuMgr->addMenuItem(scrActions["specialQuoteLowSingleComma"], "InsertQuote"); |
||
1240 | scrMenuMgr->addMenuItem(scrActions["specialQuoteLowDoubleComma"], "InsertQuote"); |
||
1241 | scrMenuMgr->addMenuItem(scrActions["specialQuoteDoubleTurnedComma"], "InsertQuote"); |
||
1242 | scrMenuMgr->addMenuSeparator("InsertQuote"); |
||
1243 | scrMenuMgr->addMenuItem(scrActions["specialQuoteCJKSingleLeft"], "InsertQuote"); |
||
1244 | scrMenuMgr->addMenuItem(scrActions["specialQuoteCJKSingleRight"], "InsertQuote"); |
||
1245 | scrMenuMgr->addMenuItem(scrActions["specialQuoteCJKDoubleLeft"], "InsertQuote"); |
||
1246 | scrMenuMgr->addMenuItem(scrActions["specialQuoteCJKDoubleRight"], "InsertQuote"); |
||
1903 | cbradney | 1247 | |
2226 | cbradney | 1248 | scrMenuMgr->createMenu("InsertSpace", tr("Space"), "Insert"); |
1249 | //scrMenuMgr->addMenuToMenu("InsertSpace", "Insert"); |
||
1903 | cbradney | 1250 | scrMenuMgr->addMenuItem(scrActions["specialNonBreakingSpace"], "InsertSpace"); |
2352 | fschmid | 1251 | scrMenuMgr->addMenuItem(scrActions["specialNewLine"], "InsertSpace"); |
1252 | scrMenuMgr->addMenuItem(scrActions["specialFrameBreak"], "InsertSpace"); |
||
2384 | fschmid | 1253 | scrMenuMgr->addMenuItem(scrActions["specialColumnBreak"], "InsertSpace"); |
1903 | cbradney | 1254 | scrMenuMgr->addMenuSeparator("Insert"); |
1818 | cbradney | 1255 | scrMenuMgr->addMenuItem(scrActions["insertSampleText"], "Insert"); |
1903 | cbradney | 1256 | scrActions["insertGlyph"]->setEnabled(false); |
2143 | subik | 1257 | |
1236 | cbradney | 1258 | //Page menu |
1259 | scrMenuMgr->createMenu("Page", tr("&Page")); |
||
1260 | scrMenuMgr->addMenuItem(scrActions["pageInsert"], "Page"); |
||
2143 | subik | 1261 | scrMenuMgr->addMenuItem(scrActions["pageImport"], "Page"); |
1236 | cbradney | 1262 | scrMenuMgr->addMenuItem(scrActions["pageDelete"], "Page"); |
1263 | scrMenuMgr->addMenuItem(scrActions["pageCopy"], "Page"); |
||
1264 | scrMenuMgr->addMenuItem(scrActions["pageMove"], "Page"); |
||
2093 | cbradney | 1265 | scrMenuMgr->addMenuItem(scrActions["pageApplyMasterPage"], "Page"); |
1236 | cbradney | 1266 | scrMenuMgr->addMenuItem(scrActions["pageManageGuides"], "Page"); |
1267 | scrActions["pageDelete"]->setEnabled(false); |
||
1268 | scrActions["pageMove"]->setEnabled(false); |
||
1485 | tsoots | 1269 | |
1236 | cbradney | 1270 | //View menu |
1246 | cbradney | 1271 | scrMenuMgr->createMenu("View", tr("&View")); |
1272 | scrMenuMgr->addMenuItem(scrActions["viewFitInWindow"], "View"); |
||
1273 | scrMenuMgr->addMenuItem(scrActions["viewFit50"], "View"); |
||
1274 | scrMenuMgr->addMenuItem(scrActions["viewFit75"], "View"); |
||
1275 | scrMenuMgr->addMenuItem(scrActions["viewFit100"], "View"); |
||
1276 | scrMenuMgr->addMenuItem(scrActions["viewFit200"], "View"); |
||
1277 | scrMenuMgr->addMenuItem(scrActions["viewFit20"], "View"); |
||
1278 | scrMenuMgr->addMenuSeparator("View"); |
||
1279 | scrMenuMgr->addMenuItem(scrActions["viewShowMargins"], "View"); |
||
1280 | scrMenuMgr->addMenuItem(scrActions["viewShowFrames"], "View"); |
||
1281 | scrMenuMgr->addMenuItem(scrActions["viewShowImages"], "View"); |
||
1282 | scrMenuMgr->addMenuItem(scrActions["viewShowGrid"], "View"); |
||
1283 | scrMenuMgr->addMenuItem(scrActions["viewShowGuides"], "View"); |
||
1334 | cbradney | 1284 | scrMenuMgr->addMenuItem(scrActions["viewShowBaseline"], "View"); |
1246 | cbradney | 1285 | scrMenuMgr->addMenuItem(scrActions["viewShowTextChain"], "View"); |
2353 | fschmid | 1286 | scrMenuMgr->addMenuItem(scrActions["viewShowTextControls"], "View"); |
1246 | cbradney | 1287 | scrMenuMgr->addMenuSeparator("View"); |
1288 | scrMenuMgr->addMenuItem(scrActions["viewSnapToGrid"], "View"); |
||
1289 | scrMenuMgr->addMenuItem(scrActions["viewSnapToGuides"], "View"); |
||
1330 | fschmid | 1290 | // scrMenuMgr->addMenuItem(scrActions["viewNewView"], "View"); |
1485 | tsoots | 1291 | |
1236 | cbradney | 1292 | //Tool menu |
1255 | cbradney | 1293 | scrMenuMgr->createMenu("Tools", tr("&Tools")); |
1294 | scrMenuMgr->addMenuItem(scrActions["toolsProperties"], "Tools"); |
||
1295 | scrMenuMgr->addMenuItem(scrActions["toolsOutline"], "Tools"); |
||
1296 | scrMenuMgr->addMenuItem(scrActions["toolsScrapbook"], "Tools"); |
||
1297 | scrMenuMgr->addMenuItem(scrActions["toolsLayers"], "Tools"); |
||
1298 | scrMenuMgr->addMenuItem(scrActions["toolsPages"], "Tools"); |
||
1299 | scrMenuMgr->addMenuItem(scrActions["toolsBookmarks"], "Tools"); |
||
1525 | cbradney | 1300 | scrMenuMgr->addMenuItem(scrActions["toolsMeasurements"], "Tools"); |
1255 | cbradney | 1301 | scrMenuMgr->addMenuItem(scrActions["toolsActionHistory"], "Tools"); |
1302 | scrMenuMgr->addMenuItem(scrActions["toolsPreflightVerifier"], "Tools"); |
||
2355 | cbradney | 1303 | scrMenuMgr->addMenuItem(scrActions["toolsAlignDistribute"], "Tools"); |
1255 | cbradney | 1304 | scrMenuMgr->addMenuSeparator("Tools"); |
1305 | scrMenuMgr->addMenuItem(scrActions["toolsToolbarTools"], "Tools"); |
||
1485 | tsoots | 1306 | scrMenuMgr->addMenuItem(scrActions["toolsToolbarPDF"], "Tools"); |
1265 | cbradney | 1307 | //scrActions["toolsPreflightVerifier"]->setEnabled(false); |
1485 | tsoots | 1308 | |
1236 | cbradney | 1309 | //Extra menu |
1260 | cbradney | 1310 | scrMenuMgr->createMenu("Extras", tr("E&xtras")); |
1311 | scrMenuMgr->addMenuItem(scrActions["extrasManagePictures"], "Extras"); |
||
1312 | scrMenuMgr->addMenuItem(scrActions["extrasHyphenateText"], "Extras"); |
||
1694 | cbradney | 1313 | scrMenuMgr->addMenuItem(scrActions["extrasGenerateTableOfContents"], "Extras"); |
2143 | subik | 1314 | |
1260 | cbradney | 1315 | scrMenuMgr->setMenuEnabled("Extras", false); |
1316 | scrActions["extrasHyphenateText"]->setEnabled(false); |
||
1485 | tsoots | 1317 | |
1236 | cbradney | 1318 | //Window menu |
1260 | cbradney | 1319 | scrMenuMgr->createMenu("Windows", tr("&Windows")); |
1320 | connect(scrMenuMgr->getLocalPopupMenu("Windows"), SIGNAL(aboutToShow()), this, SLOT(windowsMenuAboutToShow())); |
||
1485 | tsoots | 1321 | |
1260 | cbradney | 1322 | //Help menu |
1269 | cbradney | 1323 | scrMenuMgr->createMenu("Help", tr("&Help")); |
1324 | scrMenuMgr->addMenuItem(scrActions["helpAboutScribus"], "Help"); |
||
1325 | scrMenuMgr->addMenuItem(scrActions["helpAboutQt"], "Help"); |
||
1326 | scrMenuMgr->addMenuSeparator("Help"); |
||
1327 | scrMenuMgr->addMenuItem(scrActions["helpTooltips"], "Help"); |
||
1328 | scrMenuMgr->addMenuItem(scrActions["helpManual"], "Help"); |
||
1485 | tsoots | 1329 | |
1208 | cbradney | 1330 | scrMenuMgr->addMenuToMenuBar("File"); |
1227 | cbradney | 1331 | scrMenuMgr->addMenuToMenuBar("Edit"); |
1325 | cbradney | 1332 | scrMenuMgr->addMenuToMenuBar("Style"); |
1333 | scrMenuMgr->setMenuEnabled("Style", false); |
||
1236 | cbradney | 1334 | scrMenuMgr->addMenuToMenuBar("Item"); |
1801 | cbradney | 1335 | scrMenuMgr->setMenuEnabled("Item", false); |
1336 | scrMenuMgr->addMenuToMenuBar("Insert"); |
||
1337 | scrMenuMgr->setMenuEnabled("Insert", false); |
||
1236 | cbradney | 1338 | scrMenuMgr->addMenuToMenuBar("Page"); |
1339 | scrMenuMgr->setMenuEnabled("Page", false); |
||
1246 | cbradney | 1340 | scrMenuMgr->addMenuToMenuBar("View"); |
1341 | scrMenuMgr->setMenuEnabled("View", false); |
||
1255 | cbradney | 1342 | scrMenuMgr->addMenuToMenuBar("Tools"); |
1260 | cbradney | 1343 | scrMenuMgr->addMenuToMenuBar("Extras"); |
1344 | scrMenuMgr->setMenuEnabled("Extras", false); |
||
1345 | scrMenuMgr->addMenuToMenuBar("Windows"); |
||
1346 | scrMenuMgr->setMenuEnabled("Windows", false); |
||
3 | paul | 1347 | menuBar()->insertSeparator(); |
1269 | cbradney | 1348 | scrMenuMgr->addMenuToMenuBar("Help"); |
1349 | |||
1236 | cbradney | 1350 | //Alignment menu |
1325 | cbradney | 1351 | scrMenuMgr->createMenu("Alignment", tr("&Alignment")); |
1337 | cbradney | 1352 | scrMenuMgr->addMenuItem(scrActions["alignLeft"], "Alignment"); |
1353 | scrMenuMgr->addMenuItem(scrActions["alignCenter"], "Alignment"); |
||
1354 | scrMenuMgr->addMenuItem(scrActions["alignRight"], "Alignment"); |
||
1355 | scrMenuMgr->addMenuItem(scrActions["alignBlock"], "Alignment"); |
||
1356 | scrMenuMgr->addMenuItem(scrActions["alignForced"], "Alignment"); |
||
1443 | tsoots | 1357 | |
801 | cbradney | 1358 | connect(ColorMenC, SIGNAL(activated(int)), this, SLOT(setItemFarbe(int))); |
1359 | connect(FontMenu, SIGNAL(activated(int)), this, SLOT(setItemFont(int))); |
||
3 | paul | 1360 | } |
1361 | |||
1362 | void ScribusApp::initStatusBar() |
||
1363 | { |
||
2433 | cbradney | 1364 | mainWindowStatusLabel = new QLabel( " ", statusBar(), "ft"); |
1365 | mainWindowProgressBar = new QProgressBar(statusBar(), "p"); |
||
1366 | mainWindowProgressBar->setCenterIndicator(true); |
||
1367 | mainWindowProgressBar->setFixedWidth( 100 ); |
||
1368 | mainWindowProgressBar->reset(); |
||
1369 | mainWindowXPosLabel = new QLabel( "X-Pos:", statusBar(), "xt"); |
||
1370 | mainWindowYPosLabel = new QLabel( "Y-Pos:", statusBar(), "yt"); |
||
1371 | mainWindowXPosDataLabel = new QLabel( " ", statusBar(), "dt"); |
||
1372 | mainWindowYPosDataLabel = new QLabel( " ", statusBar(), "ydt"); |
||
809 | cbradney | 1373 | |
2433 | cbradney | 1374 | statusBar()->addWidget(mainWindowStatusLabel, 3, true); |
1375 | statusBar()->addWidget(mainWindowProgressBar, 0, true); |
||
1376 | statusBar()->addWidget(mainWindowXPosLabel, 0, true); |
||
1377 | statusBar()->addWidget(mainWindowXPosDataLabel, 1, true); |
||
1378 | statusBar()->addWidget(mainWindowYPosLabel, 0, true); |
||
1379 | statusBar()->addWidget(mainWindowYPosDataLabel, 1, true); |
||
3 | paul | 1380 | } |
1381 | |||
2150 | cbradney | 1382 | void ScribusApp::setMousePositionOnStatusBar(double xp, double yp) |
3 | paul | 1383 | { |
1065 | cbradney | 1384 | QString suffix=unitGetSuffixFromIndex(doc->docUnitIndex); |
1385 | int multiplier=unitGetDecimalsFromIndex(doc->docUnitIndex); |
||
2150 | cbradney | 1386 | double divisor=static_cast<double>(multiplier); |
1387 | int precision=unitGetPrecisionFromIndex(doc->docUnitIndex); |
||
809 | cbradney | 1388 | QString tmp; |
2433 | cbradney | 1389 | mainWindowXPosDataLabel->setText(tmp.setNum(qRound(xp*doc->unitRatio * multiplier) / divisor, 'f', precision) + suffix); |
1390 | mainWindowYPosDataLabel->setText(tmp.setNum(qRound(yp*doc->unitRatio * multiplier) / divisor, 'f', precision) + suffix); |
||
3 | paul | 1391 | } |
1392 | |||
1437 | cbradney | 1393 | void ScribusApp::SetKeyEntry(QString actName, QString cleanMenuText, QString keyseq, int rowNumber) |
3 | paul | 1394 | { |
1395 | Keys ke; |
||
1230 | cbradney | 1396 | if (actName!="") |
1397 | { |
||
1398 | if (scrActions[actName]) |
||
1392 | cbradney | 1399 | { |
1230 | cbradney | 1400 | ke.actionName=actName; |
1392 | cbradney | 1401 | ke.keySequence = keyseq; |
1402 | ke.cleanMenuText=cleanMenuText; |
||
1437 | cbradney | 1403 | ke.tableRow=rowNumber; |
1392 | cbradney | 1404 | Prefs.KeyActions.insert(actName, ke); |
1405 | } |
||
1230 | cbradney | 1406 | else |
1748 | craig | 1407 | qDebug("%s", QString("Action Name: %1 does not exist").arg(actName).ascii()); |
1230 | cbradney | 1408 | } |
3 | paul | 1409 | } |
1410 | |||
2150 | cbradney | 1411 | void ScribusApp::deleteSelectedTextFromFrame(PageItem *currItem) |
3 | paul | 1412 | { |
2150 | cbradney | 1413 | int firstSelection = 0; |
238 | Franz | 1414 | bool first = false; |
1957 | cbradney | 1415 | for (ScText *it = currItem->itemText.first(); it != 0; it = currItem->itemText.next()) |
272 | Franz | 1416 | { |
1417 | if (it->cselect) |
||
1418 | { |
||
238 | Franz | 1419 | first = true; |
2434 | fschmid | 1420 | if ((it->ch == QChar(25)) && (it->cembedded != 0)) |
2499 | fschmid | 1421 | { |
2447 | fschmid | 1422 | doc->FrameItems.remove(it->cembedded); |
2499 | fschmid | 1423 | delete it->cembedded; |
1424 | } |
||
1957 | cbradney | 1425 | currItem->itemText.remove(); |
1426 | it = currItem->itemText.prev(); |
||
272 | Franz | 1427 | if (it == 0) |
1957 | cbradney | 1428 | it = currItem->itemText.first(); |
272 | Franz | 1429 | } |
238 | Franz | 1430 | if (!first) |
2150 | cbradney | 1431 | firstSelection++; |
272 | Franz | 1432 | } |
1957 | cbradney | 1433 | if (currItem->itemText.count() != 0) |
238 | Franz | 1434 | { |
1957 | cbradney | 1435 | if (currItem->itemText.first()->cselect) |
3 | paul | 1436 | { |
1957 | cbradney | 1437 | currItem->itemText.remove(); |
1438 | currItem->CPos = 0; |
||
238 | Franz | 1439 | } |
3 | paul | 1440 | else |
2150 | cbradney | 1441 | currItem->CPos = firstSelection; |
238 | Franz | 1442 | } |
3 | paul | 1443 | else |
1957 | cbradney | 1444 | currItem->CPos = 0; |
1445 | currItem->HasSel = false; |
||
2447 | fschmid | 1446 | for (uint a = 0; a < doc->FrameItems.count(); ++a) |
2443 | fschmid | 1447 | { |
2447 | fschmid | 1448 | doc->FrameItems.at(a)->ItemNr = a; |
2443 | fschmid | 1449 | } |
272 | Franz | 1450 | DisableTxEdit(); |
3 | paul | 1451 | } |
1452 | |||
1957 | cbradney | 1453 | void ScribusApp::setTBvals(PageItem *currItem) |
3 | paul | 1454 | { |
1957 | cbradney | 1455 | if (currItem->itemText.count() != 0) |
272 | Franz | 1456 | { |
1957 | cbradney | 1457 | int ChPos = QMIN(currItem->CPos, static_cast<int>(currItem->itemText.count()-1)); |
2185 | fschmid | 1458 | doc->CurrentStyle = currItem->itemText.at(ChPos)->cstyle & 1919; |
1957 | cbradney | 1459 | doc->currentParaStyle = currItem->itemText.at(ChPos)->cab; |
1065 | cbradney | 1460 | setAbsValue(doc->currentParaStyle); |
1545 | cbradney | 1461 | propertiesPalette->setAli(doc->currentParaStyle); |
1957 | cbradney | 1462 | doc->CurrFont = currItem->itemText.at(ChPos)->cfont->SCName; |
1463 | doc->CurrFontSize = currItem->itemText.at(ChPos)->csize; |
||
1464 | doc->CurrTextFill = currItem->itemText.at(ChPos)->ccolor; |
||
1465 | doc->CurrTextFillSh = currItem->itemText.at(ChPos)->cshade; |
||
1466 | doc->CurrTextStroke = currItem->itemText.at(ChPos)->cstroke; |
||
1467 | doc->CurrTextStrokeSh = currItem->itemText.at(ChPos)->cshade2; |
||
1468 | doc->CurrTextScale = currItem->itemText.at(ChPos)->cscale; |
||
2230 | fschmid | 1469 | doc->CurrTextScaleV = currItem->itemText.at(ChPos)->cscalev; |
2234 | fschmid | 1470 | doc->CurrTextBase = currItem->itemText.at(ChPos)->cbase; |
2247 | fschmid | 1471 | doc->CurrTextShadowX = currItem->itemText.at(ChPos)->cshadowx; |
1472 | doc->CurrTextShadowY = currItem->itemText.at(ChPos)->cshadowy; |
||
2257 | fschmid | 1473 | doc->CurrTextOutline = currItem->itemText.at(ChPos)->coutline; |
2262 | fschmid | 1474 | doc->CurrTextUnderPos = currItem->itemText.at(ChPos)->cunderpos; |
1475 | doc->CurrTextUnderWidth = currItem->itemText.at(ChPos)->cunderwidth; |
||
2272 | fschmid | 1476 | doc->CurrTextStrikePos = currItem->itemText.at(ChPos)->cstrikepos; |
1477 | doc->CurrTextStrikeWidth = currItem->itemText.at(ChPos)->cstrikewidth; |
||
2262 | fschmid | 1478 | emit TextUnderline(doc->CurrTextUnderPos, doc->CurrTextUnderWidth); |
2272 | fschmid | 1479 | emit TextStrike(doc->CurrTextStrikePos, doc->CurrTextStrikeWidth); |
2247 | fschmid | 1480 | emit TextShadow(doc->CurrTextShadowX, doc->CurrTextShadowY); |
68 | Franz | 1481 | emit TextFarben(doc->CurrTextStroke, doc->CurrTextFill, doc->CurrTextStrokeSh, doc->CurrTextFillSh); |
1482 | emit TextIFont(doc->CurrFont); |
||
272 | Franz | 1483 | emit TextISize(doc->CurrFontSize); |
1957 | cbradney | 1484 | emit TextUSval(currItem->itemText.at(ChPos)->cextra); |
272 | Franz | 1485 | emit TextStil(doc->CurrentStyle); |
68 | Franz | 1486 | emit TextScale(doc->CurrTextScale); |
2230 | fschmid | 1487 | emit TextScaleV(doc->CurrTextScaleV); |
2234 | fschmid | 1488 | emit TextBase(doc->CurrTextBase); |
2257 | fschmid | 1489 | emit TextOutline(doc->CurrTextOutline); |
272 | Franz | 1490 | } |
3 | paul | 1491 | } |
1492 | |||
1493 | void ScribusApp::wheelEvent(QWheelEvent *w) |
||
1494 | { |
||
1495 | if (HaveDoc) |
||
239 | Franz | 1496 | { |
276 | Franz | 1497 | if ((w->orientation() != Qt::Vertical) || ( w->state() & ShiftButton )) |
3 | paul | 1498 | { |
239 | Franz | 1499 | if (w->delta() < 0) |
240 | Franz | 1500 | view->scrollBy(Prefs.Wheelval, 0); |
239 | Franz | 1501 | else |
240 | Franz | 1502 | view->scrollBy(-Prefs.Wheelval, 0); |
239 | Franz | 1503 | } |
3 | paul | 1504 | else |
239 | Franz | 1505 | { |
1506 | if (w->delta() < 0) |
||
240 | Franz | 1507 | view->scrollBy(0, Prefs.Wheelval); |
239 | Franz | 1508 | else |
240 | Franz | 1509 | view->scrollBy(0, -Prefs.Wheelval); |
239 | Franz | 1510 | } |
3 | paul | 1511 | w->accept(); |
239 | Franz | 1512 | } |
3 | paul | 1513 | } |
1514 | |||
1485 | tsoots | 1515 | //Special keys assigned to actions are stolen by the action and not passed to |
1445 | cbradney | 1516 | //keyPressEvent so process them here. |
1903 | cbradney | 1517 | void ScribusApp::specialActionKeyEvent(QString actionName, int unicodevalue) |
1445 | cbradney | 1518 | { |
1519 | if (HaveDoc) |
||
1520 | { |
||
1521 | if (doc->appMode==EditMode) |
||
1522 | { |
||
1523 | if (view->SelItem.count() == 1) |
||
1524 | { |
||
1525 | struct ScText *hg = new ScText; |
||
1957 | cbradney | 1526 | PageItem *currItem = view->SelItem.at(0); |
1903 | cbradney | 1527 | if (unicodevalue!=-1) |
1445 | cbradney | 1528 | { |
1903 | cbradney | 1529 | hg->ch = QString(QChar(unicodevalue)); |
1789 | fschmid | 1530 | hg->cfont = (*doc->AllFonts)[doc->CurrFont]; |
1445 | cbradney | 1531 | hg->csize = doc->CurrFontSize; |
1532 | hg->ccolor = doc->CurrTextFill; |
||
1533 | hg->cshade = doc->CurrTextFillSh; |
||
1534 | hg->cstroke = doc->CurrTextStroke; |
||
1535 | hg->cshade2 = doc->CurrTextStrokeSh; |
||
1536 | hg->cscale = doc->CurrTextScale; |
||
2230 | fschmid | 1537 | hg->cscalev = doc->CurrTextScaleV; |
2234 | fschmid | 1538 | hg->cbase = doc->CurrTextBase; |
2247 | fschmid | 1539 | hg->cshadowx = doc->CurrTextShadowX; |
1540 | hg->cshadowy = doc->CurrTextShadowY; |
||
2257 | fschmid | 1541 | hg->coutline = doc->CurrTextOutline; |
2262 | fschmid | 1542 | hg->cunderpos = doc->CurrTextUnderPos; |
1543 | hg->cunderwidth = doc->CurrTextUnderWidth; |
||
2272 | fschmid | 1544 | hg->cstrikepos = doc->CurrTextStrikePos; |
1545 | hg->cstrikewidth = doc->CurrTextStrikeWidth; |
||
1445 | cbradney | 1546 | hg->cselect = false; |
1547 | hg->cstyle = doc->CurrentStyle; |
||
1548 | hg->cab = doc->currentParaStyle; |
||
1549 | if (doc->docParagraphStyles[doc->currentParaStyle].Font != "") |
||
1550 | { |
||
1789 | fschmid | 1551 | hg->cfont = (*doc->AllFonts)[doc->docParagraphStyles[doc->currentParaStyle].Font]; |
1445 | cbradney | 1552 | hg->csize = doc->docParagraphStyles[doc->currentParaStyle].FontSize; |
1553 | } |
||
1554 | hg->cextra = 0; |
||
1555 | hg->xp = 0; |
||
1556 | hg->yp = 0; |
||
1557 | hg->PRot = 0; |
||
1558 | hg->PtransX = 0; |
||
1559 | hg->PtransY = 0; |
||
2434 | fschmid | 1560 | hg->cembedded = 0; |
1957 | cbradney | 1561 | currItem->itemText.insert(currItem->CPos, hg); |
1562 | currItem->CPos += 1; |
||
1563 | currItem->Tinput = true; |
||
1564 | view->RefreshItem(currItem); |
||
1445 | cbradney | 1565 | } |
1903 | cbradney | 1566 | else if (actionName=="specialSmartHyphen") //ignore the char as we use an attribute if the text item, for now. |
1445 | cbradney | 1567 | { |
1957 | cbradney | 1568 | currItem->itemText.at(QMAX(currItem->CPos-1,0))->cstyle ^= 128; |
1569 | currItem->Tinput = true; |
||
1570 | view->RefreshItem(currItem); |
||
1485 | tsoots | 1571 | } |
1445 | cbradney | 1572 | } |
1573 | } |
||
1574 | } |
||
1575 | } |
||
1576 | |||
1493 | cbradney | 1577 | /*! |
1578 | \brief Receive key events from palettes such as palette hiding events. Possibly eaier way but this is cleaner than before. No need to modify all those palettes and each new one in future. |
||
1579 | */ |
||
1525 | cbradney | 1580 | bool ScribusApp::eventFilter( QObject */*o*/, QEvent *e ) |
1493 | cbradney | 1581 | { |
1525 | cbradney | 1582 | bool retVal; |
1493 | cbradney | 1583 | if ( e->type() == QEvent::KeyPress ) { |
1584 | QKeyEvent *k = (QKeyEvent *)e; |
||
2357 | cbradney | 1585 | int keyMod=0; |
1586 | if (k->state() & ShiftButton) |
||
1587 | keyMod |= SHIFT; |
||
1588 | if (k->state() & ControlButton) |
||
1589 | keyMod |= CTRL; |
||
1590 | if (k->state() & AltButton) |
||
1591 | keyMod |= ALT; |
||
2369 | cbradney | 1592 | |
1493 | cbradney | 1593 | QKeySequence currKeySeq = QKeySequence(k->key() | keyMod); |
1525 | cbradney | 1594 | retVal=true; |
2357 | cbradney | 1595 | //Palette actions |
1493 | cbradney | 1596 | if (currKeySeq == scrActions["specialToggleAllPalettes"]->accel()) |
1597 | scrActions["specialToggleAllPalettes"]->activate(); |
||
1598 | else |
||
1599 | if (currKeySeq == scrActions["toolsProperties"]->accel()) |
||
1600 | scrActions["toolsProperties"]->toggle(); |
||
1601 | else |
||
1602 | if (currKeySeq == scrActions["toolsOutline"]->accel()) |
||
1603 | scrActions["toolsOutline"]->toggle(); |
||
1604 | else |
||
1605 | if (currKeySeq == scrActions["toolsScrapbook"]->accel()) |
||
1606 | scrActions["toolsScrapbook"]->toggle(); |
||
1607 | else |
||
1608 | if (currKeySeq == scrActions["toolsLayers"]->accel()) |
||
1609 | scrActions["toolsLayers"]->toggle(); |
||
1610 | else |
||
1611 | if (currKeySeq == scrActions["toolsPages"]->accel()) |
||
1612 | scrActions["toolsPages"]->toggle(); |
||
1613 | else |
||
1614 | if (currKeySeq == scrActions["toolsBookmarks"]->accel()) |
||
1615 | scrActions["toolsBookmarks"]->toggle(); |
||
1616 | else |
||
1617 | if (currKeySeq == scrActions["toolsActionHistory"]->accel()) |
||
1618 | scrActions["toolsActionHistory"]->toggle(); |
||
1619 | else |
||
1620 | if (currKeySeq == scrActions["toolsPreflightVerifier"]->accel()) |
||
1621 | scrActions["toolsPreflightVerifier"]->toggle(); |
||
1525 | cbradney | 1622 | else |
2355 | cbradney | 1623 | if (currKeySeq == scrActions["toolsAlignDistribute"]->accel()) |
1624 | scrActions["toolsAlignDistribute"]->toggle(); |
||
1625 | else |
||
2357 | cbradney | 1626 | //Undo actions |
1627 | if (currKeySeq == scrActions["editUndoAction"]->accel() && scrActions["editUndoAction"]->isEnabled()) |
||
1628 | scrActions["editUndoAction"]->activate(); |
||
1629 | else |
||
1630 | if (currKeySeq == scrActions["editRedoAction"]->accel() && scrActions["editRedoAction"]->isEnabled()) |
||
1631 | scrActions["editRedoAction"]->activate(); |
||
1632 | else |
||
1633 | //Other actions |
||
1565 | cbradney | 1634 | if (currKeySeq == scrActions["fileQuit"]->accel()) |
1635 | scrActions["fileQuit"]->activate(); |
||
2143 | subik | 1636 | else |
1525 | cbradney | 1637 | retVal=false; |
1493 | cbradney | 1638 | } |
1525 | cbradney | 1639 | else |
1640 | retVal=false; |
||
1493 | cbradney | 1641 | //Return false to pass event to object |
1642 | return retVal; |
||
1643 | } |
||
1644 | |||
3 | paul | 1645 | void ScribusApp::keyPressEvent(QKeyEvent *k) |
1646 | { |
||
146 | Franz | 1647 | QWidgetList windows; |
237 | Franz | 1648 | QWidget* w = NULL; |
1065 | cbradney | 1649 | struct ScText *hg; |
3 | paul | 1650 | int kk = k->key(); |
1651 | int as = k->ascii(); |
||
80 | Franz | 1652 | double altx, alty; |
3 | paul | 1653 | QString uc = k->text(); |
1654 | QString cr, Tcha, Twort; |
||
1655 | uint Tcoun; |
||
237 | Franz | 1656 | int len, pos, c; |
92 | Franz | 1657 | if (keyrep) |
1658 | return; |
||
1659 | keyrep = true; |
||
3 | paul | 1660 | switch (k->state()) |
272 | Franz | 1661 | { |
1662 | case ShiftButton: |
||
1554 | cbradney | 1663 | KeyMod = SHIFT; |
272 | Franz | 1664 | break; |
1665 | case AltButton: |
||
1554 | cbradney | 1666 | KeyMod = ALT; |
272 | Franz | 1667 | break; |
1668 | case ControlButton: |
||
1554 | cbradney | 1669 | KeyMod = CTRL; |
272 | Franz | 1670 | break; |
1671 | default: |
||
1672 | KeyMod = 0; |
||
1673 | break; |
||
1674 | } |
||
292 | Franz | 1675 | if ((kk == Key_Escape) && (HaveDoc)) |
1676 | { |
||
1677 | keyrep = false; |
||
1957 | cbradney | 1678 | PageItem *currItem; |
855 | fschmid | 1679 | if ((view->SelItem.count() != 0)) |
1680 | { |
||
1957 | cbradney | 1681 | currItem = view->SelItem.at(0); |
1065 | cbradney | 1682 | switch (doc->appMode) |
855 | fschmid | 1683 | { |
1065 | cbradney | 1684 | case NormalMode: |
1957 | cbradney | 1685 | currItem->Sizing = false; |
855 | fschmid | 1686 | if (doc->SubMode != -1) |
1687 | { |
||
1688 | view->Deselect(false); |
||
1957 | cbradney | 1689 | doc->Items.remove(currItem->ItemNr); |
855 | fschmid | 1690 | } |
1691 | break; |
||
1229 | fschmid | 1692 | case LinkFrames: |
1693 | case UnlinkFrames: |
||
1065 | cbradney | 1694 | case EditMode: |
1827 | fschmid | 1695 | case Rotation: |
1696 | view->Deselect(false); |
||
1697 | case PanningMode: |
||
855 | fschmid | 1698 | break; |
1065 | cbradney | 1699 | case DrawBezierLine: |
1957 | cbradney | 1700 | currItem->PoLine.resize(currItem->PoLine.size()-2); |
1701 | if (currItem->PoLine.size() < 4) |
||
855 | fschmid | 1702 | { |
1703 | view->Deselect(false); |
||
1957 | cbradney | 1704 | doc->Items.remove(currItem->ItemNr); |
855 | fschmid | 1705 | } |
1706 | else |
||
1707 | { |
||
1957 | cbradney | 1708 | view->SizeItem(currItem->PoLine.WidthHeight().x(), currItem->PoLine.WidthHeight().y(), currItem->ItemNr, false, false); |
1709 | view->SetPolyClip(currItem, qRound(QMAX(currItem->Pwidth / 2, 1))); |
||
1710 | view->AdjustItemSize(currItem); |
||
1711 | currItem->ContourLine = currItem->PoLine.copy(); |
||
1712 | currItem->ClipEdited = true; |
||
1713 | currItem->FrameType = 3; |
||
855 | fschmid | 1714 | slotDocCh(); |
1715 | } |
||
1716 | view->FirstPoly = true; |
||
1717 | break; |
||
1718 | default: |
||
1719 | view->Deselect(false); |
||
1957 | cbradney | 1720 | doc->Items.remove(currItem->ItemNr); |
855 | fschmid | 1721 | break; |
1722 | } |
||
1723 | } |
||
1724 | view->Mpressed = false; |
||
1725 | doc->DragP = false; |
||
1726 | doc->leaveDrag = false; |
||
1727 | view->Imoved = false; |
||
1728 | view->mCG = false; |
||
1729 | view->MidButt = false; |
||
1730 | doc->SubMode = -1; |
||
1827 | fschmid | 1731 | doc->ElemToLink = NULL; |
292 | Franz | 1732 | NoFrameEdit(); |
1733 | slotSelect(); |
||
1734 | return; |
||
1735 | } |
||
232 | Franz | 1736 | ButtonState buttonState = k->state(); |
272 | Franz | 1737 | if ((HaveDoc) && (!view->LE->hasFocus()) && (!view->PGS->PageCombo->hasFocus())) |
1738 | { |
||
1065 | cbradney | 1739 | if ((doc->appMode != EditMode) && (view->SelItem.count() == 0)) |
272 | Franz | 1740 | { |
1741 | switch (kk) |
||
146 | Franz | 1742 | { |
272 | Franz | 1743 | case Key_Space: |
1744 | keyrep = false; |
||
1065 | cbradney | 1745 | if (doc->appMode == PanningMode) |
1746 | setAppMode(NormalMode); |
||
272 | Franz | 1747 | else |
1748 | { |
||
1065 | cbradney | 1749 | setAppMode(PanningMode); |
272 | Franz | 1750 | qApp->setOverrideCursor(QCursor(loadIcon("HandC.xpm")), true); |
1751 | } |
||
1752 | return; |
||
1753 | break; |
||
1754 | case Key_Prior: |
||
1755 | view->scrollBy(0, -Prefs.Wheelval); |
||
1756 | keyrep = false; |
||
1757 | return; |
||
1758 | break; |
||
1759 | case Key_Next: |
||
1760 | view->scrollBy(0, Prefs.Wheelval); |
||
1761 | keyrep = false; |
||
1762 | return; |
||
1763 | break; |
||
1764 | case Key_Tab: |
||
1765 | keyrep = false; |
||
1766 | windows = wsp->windowList(); |
||
1767 | if (windows.count() > 1) |
||
1768 | { |
||
1769 | for (int i = 0; i < static_cast<int>(windows.count()); ++i) |
||
250 | Franz | 1770 | { |
272 | Franz | 1771 | if (wsp->activeWindow() == windows.at(i)) |
1772 | { |
||
1773 | if (i == static_cast<int>(windows.count()-1)) |
||
1774 | w = windows.at(0); |
||
1775 | else |
||
1776 | w = windows.at(i+1); |
||
1777 | break; |
||
1778 | } |
||
250 | Franz | 1779 | } |
1545 | cbradney | 1780 | doc->OpenNodes = outlinePalette->buildReopenVals(); |
1781 | docCheckerPalette->clearErrorList(); |
||
272 | Franz | 1782 | if ( w ) |
1783 | w->showNormal(); |
||
1784 | newActWin(w); |
||
1785 | } |
||
1786 | return; |
||
1787 | break; |
||
1788 | } |
||
1789 | } |
||
456 | fschmid | 1790 | if (view->SelItem.count() != 0) |
272 | Franz | 1791 | { |
1957 | cbradney | 1792 | PageItem *currItem = view->SelItem.at(0); |
1065 | cbradney | 1793 | switch (doc->appMode) |
272 | Franz | 1794 | { |
1065 | cbradney | 1795 | case NormalMode: |
272 | Franz | 1796 | switch (kk) |
1797 | { |
||
360 | Franz | 1798 | case Key_Backspace: |
272 | Franz | 1799 | case Key_Delete: |
1800 | if (!doc->EditClip) |
||
2148 | fschmid | 1801 | { |
997 | fschmid | 1802 | view->DeleteItem(); |
2148 | fschmid | 1803 | slotDocCh(); |
1804 | } |
||
272 | Franz | 1805 | break; |
360 | Franz | 1806 | case Key_Prior: |
1957 | cbradney | 1807 | if (!currItem->locked()) |
2148 | fschmid | 1808 | { |
456 | fschmid | 1809 | view->RaiseItem(); |
2148 | fschmid | 1810 | slotDocCh(); |
1811 | } |
||
360 | Franz | 1812 | break; |
1813 | case Key_Next: |
||
1957 | cbradney | 1814 | if (!currItem->locked()) |
2148 | fschmid | 1815 | { |
456 | fschmid | 1816 | view->LowerItem(); |
2148 | fschmid | 1817 | slotDocCh(); |
1818 | } |
||
360 | Franz | 1819 | break; |
272 | Franz | 1820 | case Key_Left: |
1957 | cbradney | 1821 | if (!currItem->locked()) |
272 | Franz | 1822 | { |
1823 | if ( buttonState & ShiftButton ) |
||
456 | fschmid | 1824 | view->moveGroup(-10, 0); |
272 | Franz | 1825 | else if ( buttonState & ControlButton ) |
456 | fschmid | 1826 | view->moveGroup(-0.1, 0); |
272 | Franz | 1827 | else |
456 | fschmid | 1828 | view->moveGroup(-1, 0); |
2148 | fschmid | 1829 | slotDocCh(); |
272 | Franz | 1830 | } |
1831 | break; |
||
1832 | case Key_Right: |
||
1957 | cbradney | 1833 | if (!currItem->locked()) |
272 | Franz | 1834 | { |
1835 | if ( buttonState & ShiftButton ) |
||
456 | fschmid | 1836 | view->moveGroup(10, 0); |
272 | Franz | 1837 | else if ( buttonState & ControlButton ) |
456 | fschmid | 1838 | view->moveGroup(0.1, 0); |
272 | Franz | 1839 | else |
456 | fschmid | 1840 | view->moveGroup(1, 0); |
2148 | fschmid | 1841 | slotDocCh(); |
272 | Franz | 1842 | } |
1843 | break; |
||
1844 | case Key_Up: |
||
1957 | cbradney | 1845 | if (!currItem->locked()) |
272 | Franz | 1846 | { |
1847 | if ( buttonState & ShiftButton ) |
||
456 | fschmid | 1848 | view->moveGroup(0, -10); |
272 | Franz | 1849 | else if ( buttonState & ControlButton ) |
456 | fschmid | 1850 | view->moveGroup(0, -0.1); |
272 | Franz | 1851 | else |
456 | fschmid | 1852 | view->moveGroup(0, -1); |
2148 | fschmid | 1853 | slotDocCh(); |
272 | Franz | 1854 | } |
1855 | break; |
||
1856 | case Key_Down: |
||
1957 | cbradney | 1857 | if (!currItem->locked()) |
272 | Franz | 1858 | { |
1859 | if ( buttonState & ShiftButton ) |
||
456 | fschmid | 1860 | view->moveGroup(0, 10); |
272 | Franz | 1861 | else if ( buttonState & ControlButton ) |
456 | fschmid | 1862 | view->moveGroup(0, 0.1); |
272 | Franz | 1863 | else |
456 | fschmid | 1864 | view->moveGroup(0, 1); |
2148 | fschmid | 1865 | slotDocCh(); |
272 | Franz | 1866 | } |
1867 | break; |
||
1868 | default: |
||
1869 | break; |
||
1870 | } |
||
1871 | break; |
||
1065 | cbradney | 1872 | case EditMode: |
1957 | cbradney | 1873 | int oldPos = currItem->CPos; // 15-mar-2004 jjsa for cursor movement with Shift + Arrow key |
1874 | view->oldCp = currItem->CPos; |
||
1875 | if (currItem->itemType() == PageItem::ImageFrame) |
||
1298 | fschmid | 1876 | { |
1877 | switch (kk) |
||
1878 | { |
||
1879 | case Key_Left: |
||
1957 | cbradney | 1880 | if (!currItem->locked()) |
1298 | fschmid | 1881 | { |
1882 | if ( buttonState & ShiftButton ) |
||
1957 | cbradney | 1883 | view->MoveItemI(-10, 0, currItem->ItemNr, true); |
1298 | fschmid | 1884 | else if ( buttonState & ControlButton ) |
1957 | cbradney | 1885 | view->MoveItemI(-0.1, 0, currItem->ItemNr, true); |
1298 | fschmid | 1886 | else |
1957 | cbradney | 1887 | view->MoveItemI(-1, 0, currItem->ItemNr, true); |
1298 | fschmid | 1888 | } |
1889 | break; |
||
1890 | case Key_Right: |
||
1957 | cbradney | 1891 | if (!currItem->locked()) |
1298 | fschmid | 1892 | { |
1893 | if ( buttonState & ShiftButton ) |
||
1957 | cbradney | 1894 | view->MoveItemI(10, 0, currItem->ItemNr, true); |
1298 | fschmid | 1895 | else if ( buttonState & ControlButton ) |
1957 | cbradney | 1896 | view->MoveItemI(0.1, 0, currItem->ItemNr, true); |
1298 | fschmid | 1897 | else |
1957 | cbradney | 1898 | view->MoveItemI(1, 0, currItem->ItemNr, true); |
1298 | fschmid | 1899 | } |
1900 | break; |
||
1901 | case Key_Up: |
||
1957 | cbradney | 1902 | if (!currItem->locked()) |
1298 | fschmid | 1903 | { |
1904 | if ( buttonState & ShiftButton ) |
||
1957 | cbradney | 1905 | view->MoveItemI(0, -10, currItem->ItemNr, true); |
1298 | fschmid | 1906 | else if ( buttonState & ControlButton ) |
1957 | cbradney | 1907 | view->MoveItemI(0, -0.1, currItem->ItemNr, true); |
1298 | fschmid | 1908 | else |
1957 | cbradney | 1909 | view->MoveItemI(0, -1, currItem->ItemNr, true); |
1298 | fschmid | 1910 | } |
1911 | break; |
||
1912 | case Key_Down: |
||
1957 | cbradney | 1913 | if (!currItem->locked()) |
1298 | fschmid | 1914 | { |
1915 | if ( buttonState & ShiftButton ) |
||
1957 | cbradney | 1916 | view->MoveItemI(0, 10, currItem->ItemNr, true); |
1298 | fschmid | 1917 |