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