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