Subversion Repositories Scribus

Rev

Rev 1254 | Rev 1260 | 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
 
3 paul 43
#include "scribus.h"
44
#include "scribus.moc"
45
#include "newfile.h"
46
#include "page.h"
47
#include "query.h"
48
#include "mdup.h"
49
#include "docinfo.h"
50
#include "reformdoc.h"
51
#include "serializer.h"
52
#include "align.h"
53
#include "fmitem.h"
54
#include "fontprefs.h"
55
#include "libprefs/prefs.h"
1158 cbradney 56
#include "prefstable.h"
3 paul 57
#include "pdfopts.h"
58
#include "inspage.h"
59
#include "delpages.h"
60
#include "movepage.h"
61
#include "helpbrowser.h"
62
#include "scribusXml.h"
63
#include "libabout/about.h"
910 fschmid 64
#include "libpostscript/pslib.h"
3 paul 65
#include "druck.h"
66
#include "editformats.h"
67
#include "muster.h"
68
#include "applytemplate.h"
69
#include "picstatus.h"
70
#include "customfdialog.h"
71
#include "cmsprefs.h"
72
#include "annot.h"
73
#include "annota.h"
74
#include "javadocs.h"
151 Franz 75
#include "colorm.h"
265 Franz 76
#include "mpalette.h"
284 Franz 77
#include "measurements.h"
364 Franz 78
#include "gtgettext.h"
506 fschmid 79
#include "fileloader.h"
740 fschmid 80
#include "arrowchooser.h"
788 fschmid 81
#include "tabtypography.h"
879 fschmid 82
#include "tabguides.h"
1194 fschmid 83
#include "tabtools.h"
1114 tsoots 84
#include "undogui.h"
1151 fschmid 85
#include "filewatcher.h"
1202 fschmid 86
#include "charselect.h"
1232 fschmid 87
#include "checkDocument.h"
1235 fschmid 88
#include "tabcheckdoc.h"
617 cbradney 89
#ifdef _MSC_VER
90
 #if (_MSC_VER >= 1200)
91
  #include "win-config.h"
92
 #endif
128 Franz 93
#else
94
 #include "config.h"
95
#endif
96
 
3 paul 97
#include "fpoint.h"
98
#include "fpointarray.h"
99
#include "hysettings.h"
100
#include "guidemanager.h"
284 Franz 101
#include "keymanager.h"
3 paul 102
#include "mergedoc.h"
27 Franz 103
#include "lineformats.h"
102 Franz 104
#include "story.h"
123 Franz 105
#include "autoform.h"
140 Franz 106
#include "tabmanager.h"
164 Franz 107
#include "search.h"
169 Franz 108
#include "fontcombo.h"
415 Franz 109
#include "prefsfile.h"
1114 tsoots 110
#include "undomanager.h"
731 fschmid 111
#include "polygonwidget.h"
766 cbradney 112
#include "werktoolb.h"
806 cbradney 113
#include "units.h"
838 cbradney 114
#include "hruler.h"
115
#include "vruler.h"
1208 cbradney 116
#include "scraction.h"
117
#include "menumanager.h"
134 Franz 118
 
3 paul 119
extern QPixmap loadIcon(QString nam);
90 Franz 120
extern bool overwrite(QWidget *parent, QString filename);
1065 cbradney 121
extern void CopyPageItem(struct CopyPasteBuffer *Buffer, PageItem *b);
203 Franz 122
extern void ReOrderText(ScribusDoc *doc, ScribusView *view);
204 Franz 123
extern int copyFile(QString source, QString target);
124
extern int moveFile(QString source, QString target);
3 paul 125
 
126
using namespace std;
127
 
128
#ifdef HAVE_CMS
129
cmsHPROFILE CMSoutputProf;
130
cmsHPROFILE CMSprinterProf;
131
cmsHTRANSFORM stdTrans;
132
cmsHTRANSFORM stdProof;
133
cmsHTRANSFORM stdTransImg;
272 Franz 134
cmsHTRANSFORM stdProofImg;
3 paul 135
bool SoftProofing;
136
bool Gamut;
137
bool CMSuse;
138
int IntentMonitor;
139
int IntentPrinter;
140
#endif
141
bool CMSavail;
142
ProfilesL InputProfiles;
80 Franz 143
double UmReFaktor;
3 paul 144
QString DocDir;
119 Franz 145
ScribusApp* ScApp;
415 Franz 146
PrefsFile* prefsFile;
3 paul 147
 
188 Franz 148
ScribusApp::ScribusApp()
272 Franz 149
{} // ScribusApp::ScribusApp()
188 Franz 150
 
767 cbradney 151
/*
152
 * retval 0 - ok, 1 - no fonts, ...
153
 */
154
int ScribusApp::initScribus(bool showSplash, const QString newGuiLanguage)
188 Franz 155
{
767 cbradney 156
        int retVal=0;
1155 fschmid 157
        ExternalApp = 0;
770 cbradney 158
        guiLanguage = newGuiLanguage;
767 cbradney 159
        initSplash(showSplash);
1208 cbradney 160
        setUsesBigPixmaps(true);
173 Franz 161
        ScApp = this;
355 Franz 162
        CurrStED = NULL;
272 Franz 163
        setCaption( tr("Scribus " VERSION));
118 Franz 164
        setKeyCompression(false);
272 Franz 165
        setIcon(loadIcon("AppIcon.png"));
1208 cbradney 166
        scrActions.clear();
167
        scrActions.setAutoDelete(true);
168
        scrDLLActions.clear();
169
        scrRecentFileActions.clear();
170
        scrRecentFileActions.setAutoDelete(true);
171
        scrMenuMgr = new MenuManager(this->menuBar());
766 cbradney 172
 
1197 tsoots 173
        PrefsPfad = getPreferencesLocation();
174
        prefsFile = new PrefsFile(QDir::convertSeparators(PrefsPfad + "/prefs13.xml"));
175
        convertToXMLPreferences(PrefsPfad);
176
 
1247 tsoots 177
        undoManager = UndoManager::instance();
178
 
272 Franz 179
        initMenuBar();
180
        initStatusBar();
766 cbradney 181
        initToolBars();
490 cbradney 182
        qApp->processEvents();
675 cbradney 183
 
3 paul 184
        BuFromApp = false;
1158 cbradney 185
 
767 cbradney 186
        initFonts();
187
 
272 Franz 188
        if (NoFonts)
767 cbradney 189
                retVal=1;
272 Franz 190
        else
191
        {
831 cbradney 192
                initDefaultValues();
777 fschmid 193
                buildFontMenu();
194
                initDefaultPrefs();
801 cbradney 195
                initArrowStyles();
1230 cbradney 196
                initKeyboardShortcuts();               
3 paul 197
                resize(610, 600);
272 Franz 198
                QVBox* vb = new QVBox( this );
199
                vb->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
200
                wsp = new QWorkspace( vb );
201
                setCentralWidget( vb );
3 paul 202
                connect(wsp, SIGNAL(windowActivated(QWidget *)), this, SLOT(newActWin(QWidget *)));
770 cbradney 203
 
801 cbradney 204
                initPalettes();
770 cbradney 205
 
1155 fschmid 206
                fileWatcher = new FileWatcher(this);
669 cbradney 207
                if (splashScreen != NULL)
208
                        splashScreen->setStatus( tr("Reading Preferences"));
490 cbradney 209
                qApp->processEvents();
68 Franz 210
                ReadPrefs();
801 cbradney 211
 
831 cbradney 212
                HaveGS = system(Prefs.gs_exe+" -h > /dev/null 2>&1");
213
                HavePngAlpha = system(Prefs.gs_exe+" -sDEVICE=pngalpha -c quit > /dev/null 2>&1");
214
                DocDir = Prefs.DocDir;
801 cbradney 215
 
669 cbradney 216
                if (splashScreen != NULL)
217
                        splashScreen->setStatus( tr("Getting ICC Profiles"));
831 cbradney 218
                CMSavail = false;
3 paul 219
                GetCMSProfiles();
803 cbradney 220
                initCMS();
831 cbradney 221
 
669 cbradney 222
                if (splashScreen != NULL)
223
                        splashScreen->setStatus( tr("Init Hyphenator"));
490 cbradney 224
                qApp->processEvents();
766 cbradney 225
                initHyphenator();
801 cbradney 226
 
669 cbradney 227
                if (splashScreen != NULL)
228
                        splashScreen->setStatus( tr("Reading Scrapbook"));
801 cbradney 229
                initScrapbook();
230
 
669 cbradney 231
                if (splashScreen != NULL)
232
                        splashScreen->setStatus( tr("Initializing Plugins"));
490 cbradney 233
                qApp->processEvents();
766 cbradney 234
                initPlugs();
1230 cbradney 235
 
236
                if (splashScreen != NULL)
237
                        splashScreen->setStatus( tr("Setting up Shortcuts"));
238
                qApp->processEvents();
239
                SetShortCut();
240
 
1208 cbradney 241
                connect(fileWatcher, SIGNAL(fileDeleted(QString )), this, SLOT(removeRecent(QString)));
3 paul 242
                connect(this, SIGNAL(TextIFont(QString)), this, SLOT(AdjustFontMenu(QString)));
243
                connect(this, SIGNAL(TextISize(int)), this, SLOT(setFSizeMenu(int)));
244
                connect(this, SIGNAL(TextISize(int)), Mpal, SLOT(setSize(int)));
80 Franz 245
                connect(this, SIGNAL(TextUSval(double)), Mpal, SLOT(setExtra(double)));
3 paul 246
                connect(this, SIGNAL(TextStil(int)), Mpal, SLOT(setStil(int)));
68 Franz 247
                connect(this, SIGNAL(TextScale(int)), Mpal, SLOT(setTScale(int)));
248
                connect(this, SIGNAL(TextFarben(QString, QString, int, int)), Mpal, SLOT(setActFarben(QString, QString, int, int)));
766 cbradney 249
 
801 cbradney 250
                initCrashHandler();
3 paul 251
        }
767 cbradney 252
        closeSplash();
253
        return retVal;
3 paul 254
}
255
 
767 cbradney 256
void ScribusApp::initSplash(bool showSplash)
257
{
258
        if (showSplash)
259
        {
260
                splashScreen = new SplashScreen();
261
                splashScreen->setStatus(QObject::tr("Initializing..."));
262
        }
263
        else
264
                splashScreen = NULL;
265
}
266
 
267
void ScribusApp::closeSplash()
268
{
269
        if (splashScreen!=NULL)
270
        {
271
                splashScreen->close();
272
                delete splashScreen;
273
                splashScreen = NULL;
274
        }
275
}
276
 
766 cbradney 277
void ScribusApp::initToolBars()
278
{
279
        WerkTools2 = new QToolBar( tr("File"), this);
1208 cbradney 280
        scrActions["fileNew"]->addTo(WerkTools2);
281
        scrActions["fileOpen"]->addTo(WerkTools2);
1210 cbradney 282
        scrMenuMgr->addMenuToWidgetOfAction("FileOpenRecent", scrActions["fileOpen"]);
1208 cbradney 283
        scrActions["fileSave"]->addTo(WerkTools2);
284
        scrActions["fileClose"]->addTo(WerkTools2);
285
        scrActions["filePrint"]->addTo(WerkTools2);
1255 cbradney 286
        scrActions["toolsPreflightVerifier"]->addTo(WerkTools2);
1208 cbradney 287
        scrActions["fileExportAsPDF"]->addTo(WerkTools2);
288
 
1255 cbradney 289
/*
1208 cbradney 290
        scrActions["fileClose"]->setEnabled(false);
291
        scrActions["filePrint"]->setEnabled(false);
292
        scrActions["fileSave"]->setEnabled(false);
293
        scrActions["fileExportAsPDF"]->setEnabled(false);
1255 cbradney 294
*/
1114 tsoots 295
        editToolBar = new QToolBar(tr("Edit"), this);
296
        UndoWidget* uWidget = new UndoWidget(editToolBar, "uWidget");
1247 tsoots 297
        undoManager->registerGui(uWidget);
1114 tsoots 298
 
766 cbradney 299
        WerkTools = new WerkToolB(this);
300
        setDockEnabled(WerkTools, DockLeft, false);
301
        setDockEnabled(WerkTools, DockRight, false);
302
        WerkTools->Sichtbar = true;
303
        WerkTools->setEnabled(false);
304
        WerkToolsP = new WerkToolBP(this);
305
        setDockEnabled(WerkToolsP, DockLeft, false);
306
        setDockEnabled(WerkToolsP, DockRight, false);
307
        WerkToolsP->setEnabled(false);
308
        WerkToolsP->Sichtbar = true;
801 cbradney 309
 
310
        connect(WerkTools, SIGNAL(NewMode(int)), this, SLOT(ModeFromTB(int)));
311
        connect(WerkTools, SIGNAL(Schliessen()), this, SLOT(ToggleTools()));
312
        connect(WerkToolsP, SIGNAL(NewMode(int)), this, SLOT(ModeFromTB(int)));
313
        connect(WerkToolsP, SIGNAL(Schliessen()), this, SLOT(TogglePDFTools()));
766 cbradney 314
}
315
 
767 cbradney 316
void ScribusApp::initFonts()
317
{
318
        if (splashScreen!=NULL) {
319
                splashScreen->setStatus( tr("Searching for Fonts"));
320
                qApp->processEvents();
321
        }
322
        NoFonts=GetAllFonts();
323
        if (NoFonts)
324
        {
325
                if (splashScreen!=NULL)
326
                        splashScreen->close(); // 10/10/2004 pv fix #1200
327
                QString mess = tr("There are no Postscript fonts on your system");
328
                mess += "\n" + tr("Exiting now");
329
                QMessageBox::critical(this, tr("Fatal Error"), mess, 1, 0, 0);
330
        }
829 cbradney 331
        else
332
        if (splashScreen!=NULL)
333
        {
334
                splashScreen->setStatus( tr("Font System Initialized"));
335
                qApp->processEvents();
336
        }
767 cbradney 337
}
766 cbradney 338
 
770 cbradney 339
void ScribusApp::initDefaultPrefs()
340
{
341
        /** Default font and size **/
342
        SCFontsIterator it(Prefs.AvailFonts);
1194 fschmid 343
        Prefs.toolSettings.defFont = it.currentKey();
344
        Prefs.toolSettings.defSize = 120;
770 cbradney 345
        Prefs.AppFontSize = qApp->font().pointSize();
346
 
347
        /** Default colours **/
348
        Prefs.DColors.clear();
872 cbradney 349
        QString pfadC = LIBDIR;
350
        QString pfadC2 = pfadC + "rgbscribus.txt";
770 cbradney 351
        QFile fiC(pfadC2);
352
        if (!fiC.exists())
353
        {
354
                Prefs.DColors.insert("White", CMYKColor(0, 0, 0, 0));
355
                Prefs.DColors.insert("Black", CMYKColor(0, 0, 0, 255));
356
                Prefs.DColors.insert("Blue", CMYKColor(255, 255, 0, 0));
357
                Prefs.DColors.insert("Cyan", CMYKColor(255, 0, 0, 0));
358
                Prefs.DColors.insert("Green", CMYKColor(255, 0, 255, 0));
359
                Prefs.DColors.insert("Red", CMYKColor(0, 255, 255, 0));
360
                Prefs.DColors.insert("Yellow", CMYKColor(0, 0, 255, 0));
361
                Prefs.DColors.insert("Magenta", CMYKColor(0, 255, 0, 0));
362
                Prefs.DColorSet = "Scribus-Small";
363
        }
364
        else
365
        {
366
                if (fiC.open(IO_ReadOnly))
367
                {
368
                        QString ColorEn, Cname;
369
                        int Rval, Gval, Bval;
370
                        QTextStream tsC(&fiC);
371
                        ColorEn = tsC.readLine();
372
                        while (!tsC.atEnd())
373
                        {
374
                                ColorEn = tsC.readLine();
375
                                QTextStream CoE(&ColorEn, IO_ReadOnly);
376
                                CoE >> Rval;
377
                                CoE >> Gval;
378
                                CoE >> Bval;
379
                                CoE >> Cname;
380
                                CMYKColor tmp;
381
                                tmp.setColorRGB(Rval, Gval, Bval);
382
                                Prefs.DColors.insert(Cname, tmp);
383
                        }
384
                        fiC.close();
385
                }
386
                Prefs.DColorSet = "X11 RGB-Set";
387
        }
388
 
389
        Prefs.Wheelval = 40;
879 fschmid 390
        Prefs.guidesSettings.marginsShown = true;
391
        Prefs.guidesSettings.framesShown = true;
392
        Prefs.guidesSettings.gridShown = false;
393
        Prefs.guidesSettings.guidesShown = false;
394
        Prefs.guidesSettings.baseShown = false;
395
        Prefs.guidesSettings.showPic = true;
396
        Prefs.guidesSettings.linkShown = false;
397
        Prefs.guidesSettings.grabRad = 4;
398
        Prefs.guidesSettings.guideRad = 10;
399
        Prefs.guidesSettings.minorGrid = 20;
400
        Prefs.guidesSettings.majorGrid = 100;
401
        Prefs.guidesSettings.minorColor = QColor(green);
402
        Prefs.guidesSettings.majorColor = QColor(green);
403
        Prefs.guidesSettings.margColor = QColor(blue);
404
        Prefs.guidesSettings.guideColor = QColor(darkBlue);
405
        Prefs.guidesSettings.baseColor = QColor(lightGray);
823 fschmid 406
        Prefs.typographicSetttings.valueSuperScript = 33;
407
        Prefs.typographicSetttings.scalingSuperScript = 100;
408
        Prefs.typographicSetttings.valueSubScript = 33;
409
        Prefs.typographicSetttings.scalingSubScript = 100;
410
        Prefs.typographicSetttings.valueSmallCaps = 75;
411
        Prefs.typographicSetttings.autoLineSpacing = 20;
412
        Prefs.typographicSetttings.valueBaseGrid = 14.4;
413
        Prefs.typographicSetttings.offsetBaseGrid = 0.0;
770 cbradney 414
        Prefs.GUI = "Default";
1194 fschmid 415
        Prefs.toolSettings.dPen = "Black";
416
        Prefs.toolSettings.dBrush = "Black";
417
        Prefs.toolSettings.dShade = 100;
418
        Prefs.toolSettings.dShade2 = 100;
419
        Prefs.toolSettings.dLineArt = SolidLine;
420
        Prefs.toolSettings.dWidth = 1;
421
        Prefs.toolSettings.dPenLine = "Black";
422
        Prefs.toolSettings.dPenText = "Black";
423
        Prefs.toolSettings.dStrokeText = "Black";
1120 fschmid 424
        Prefs.DpapColor = QColor(white);
1194 fschmid 425
        Prefs.toolSettings.dCols = 1;
426
        Prefs.toolSettings.dGap = 0.0;
427
        Prefs.toolSettings.dShadeLine = 100;
428
        Prefs.toolSettings.dLstyleLine = SolidLine;
429
        Prefs.toolSettings.dWidthLine = 1;
430
        Prefs.toolSettings.dStartArrow = 0;
431
        Prefs.toolSettings.dEndArrow = 0;
432
        Prefs.toolSettings.magMin = 10;
433
        Prefs.toolSettings.magMax = 3200;
434
        Prefs.toolSettings.magStep = 25;
435
        Prefs.toolSettings.dBrushPict = "White";
436
        Prefs.toolSettings.shadePict = 100;
437
        Prefs.toolSettings.scaleX = 1;
438
        Prefs.toolSettings.scaleY = 1;
1187 fschmid 439
        Prefs.guidesSettings.before = true;
1065 cbradney 440
        Prefs.docUnitIndex = 0;
1194 fschmid 441
        Prefs.toolSettings.polyC = 4;
442
        Prefs.toolSettings.polyF = 0.5;
443
        Prefs.toolSettings.polyS = false;
444
        Prefs.toolSettings.polyFd = 0;
445
        Prefs.toolSettings.polyR = 0;
1232 fschmid 446
        Prefs.checkPalSettings.visible = false;
844 fschmid 447
        Prefs.mainToolBarSettings.visible = true;
448
        Prefs.pdfToolBarSettings.visible = true;
449
        Prefs.mPaletteSettings.visible = false;
450
        Prefs.measurePalSettings.visible = false;
451
        Prefs.treePalSettings.visible = false;
452
        Prefs.scrapPalSettings.visible = false;
453
        Prefs.layerPalSettings.visible = false;
454
        Prefs.bookmPalSettings.visible = false;
455
        Prefs.pagePalSettings.visible = false;
456
        Prefs.measurePalSettings.xPosition = 0;
457
        Prefs.measurePalSettings.yPosition = 0;
458
        Prefs.treePalSettings.xPosition = 0;
459
        Prefs.treePalSettings.yPosition = 0;
460
        Prefs.scrapPalSettings.xPosition = 0;
461
        Prefs.scrapPalSettings.yPosition = 0;
462
        Prefs.scrapPalSettings.width = 100;
463
        Prefs.scrapPalSettings.height = 200;
464
        Prefs.pagePalSettings.xPosition = 0;
465
        Prefs.pagePalSettings.yPosition = 0;
466
        Prefs.bookmPalSettings.xPosition = 0;
467
        Prefs.bookmPalSettings.yPosition = 0;
468
        Prefs.layerPalSettings.xPosition = 0;
469
        Prefs.layerPalSettings.yPosition = 0;
770 cbradney 470
        Prefs.PSize = 40;
471
        Prefs.SaveAtQ = true;
472
        Prefs.ClipMargin = true;
473
        Prefs.GCRMode = true;
474
        Prefs.RecentDocs.clear();
475
        Prefs.RecentDCount = 5;
1065 cbradney 476
        Prefs.marginColored = false;
770 cbradney 477
        Prefs.PageFormat = 4;
478
        Prefs.Ausrichtung = 0;
479
        Prefs.PageBreite = 595;
480
        Prefs.PageHoehe = 842;
481
        Prefs.RandOben = 9;
482
        Prefs.RandUnten = 40;
483
        Prefs.RandLinks = 9;
484
        Prefs.RandRechts = 9;
485
        Prefs.DoppelSeiten = false;
486
        Prefs.ErsteLinks = false;
1194 fschmid 487
        Prefs.toolSettings.scaleType = true;
488
        Prefs.toolSettings.aspectRatio = true;
770 cbradney 489
        Prefs.MinWordLen = 3;
490
        Prefs.HyCount = 2;
491
        Prefs.Language = "";
492
        Prefs.Automatic = true;
493
        Prefs.AutoCheck = false;
494
        Prefs.AutoSave = false;
495
        Prefs.AutoSaveTime = 600000;
496
        Prefs.DisScale = 1.0;
497
        Prefs.DocDir = QDir::homeDirPath();
498
        Prefs.ProfileDir = "";
499
        Prefs.ScriptDir = "";
500
        Prefs.TemplateDir = "";
501
        Prefs.CustomColorSets.clear();
502
        Prefs.PrPr_Mode = false;
503
        Prefs.Gcr_Mode = true;
504
        Prefs.PrPr_AlphaText = false;
505
        Prefs.PrPr_AlphaGraphics = false;
506
        Prefs.PrPr_Transparency = false;
507
        Prefs.PrPr_C = true;
508
        Prefs.PrPr_M = true;
509
        Prefs.PrPr_Y = true;
510
        Prefs.PrPr_K = true;
511
        Prefs.gimp_exe = "gimp";
512
        Prefs.gs_antiGraph = true;
513
        Prefs.gs_antiText = true;
514
        Prefs.gs_exe = "gs";
515
        Prefs.STEcolor = QColor(white);
516
        Prefs.STEfont = font().toString();
517
        Prefs.DCMSset.DefaultMonitorProfile = "";
518
        Prefs.DCMSset.DefaultPrinterProfile = "";
519
        Prefs.DCMSset.DefaultInputProfile = "";
520
        Prefs.DCMSset.DefaultInputProfile2 = "";
521
        Prefs.DCMSset.CMSinUse = false;
522
        Prefs.DCMSset.SoftProofOn = false;
523
        Prefs.DCMSset.GamutCheck = false;
524
        Prefs.DCMSset.BlackPoint = true;
525
        Prefs.DCMSset.DefaultIntentMonitor = 1;
526
        Prefs.DCMSset.DefaultIntentMonitor2 = 1;
527
        Prefs.DCMSset.DefaultIntentPrinter = 0;
528
        Prefs.GFontSub.clear();
801 cbradney 529
        Prefs.ScratchLeft = 100;
530
        Prefs.ScratchRight = 100;
531
        Prefs.ScratchTop = 20;
532
        Prefs.ScratchBottom = 20;
1235 fschmid 533
        Prefs.checkerSettings.ignoreErrors = false;
534
        Prefs.checkerSettings.autoCheck = true;
535
        Prefs.checkerSettings.checkGlyphs = true;
536
        Prefs.checkerSettings.checkOrphans = true;
537
        Prefs.checkerSettings.checkOverflow = true;
538
        Prefs.checkerSettings.checkPictures = true;
539
        Prefs.checkerSettings.checkResolution = true;
540
        Prefs.checkerSettings.checkTransparency = true;
541
        Prefs.checkerSettings.minResolution = 72.0;
801 cbradney 542
}
770 cbradney 543
 
801 cbradney 544
 
545
void ScribusApp::initDefaultValues()
546
{
831 cbradney 547
        dirs = prefsFile->getContext("dirs");
801 cbradney 548
        HaveDoc = 0;
549
        singleClose = false;
550
        ScriptRunning = false;
551
        DLLReturn = "";
552
        DLLinput = "";
553
        view = NULL;
554
        doc = NULL;
555
        Buffer2 = "";
556
        UniCinp = false;
557
        UniCinC = 0;
558
        UniCinS = "";
559
        DispX = 10;
560
        DispY = 10;
561
        DocNr = 1;
562
        UmReFaktor = 1.0;
563
        PrinterUsed = false;
564
        PDef.Pname = "";
565
        PDef.Dname = "";
566
        PDef.Command = "";
567
        keyrep = false;
1204 tsoots 568
        _arrowKeyDown = false;
801 cbradney 569
        ClipB = QApplication::clipboard();
570
        PalettesStat[0] = false;
571
        GuidesStat[0] = false;
572
 
573
        connect(ClipB, SIGNAL(dataChanged()), this, SLOT(ClipChange()));
770 cbradney 574
}
575
 
801 cbradney 576
void ScribusApp::initKeyboardShortcuts()
577
{
1230 cbradney 578
        //Set up key entries
579
        //CB TODO Need to rewrite this key management stuff.. these would be much simpler done in the action themselves.
580
 
581
        //FILE MENU
582
        SetKeyEntry(0, scrActions["fileNew"]->cleanMenuText(), 0, scrActions["fileNew"]->accel(), "fileNew");
583
        SetKeyEntry(1, scrActions["fileOpen"]->cleanMenuText(), 0, scrActions["fileOpen"]->accel(), "fileOpen");
584
        SetKeyEntry(2, scrActions["fileClose"]->cleanMenuText(), 0, scrActions["fileClose"]->accel(), "fileClose");
585
        SetKeyEntry(3, scrActions["fileSave"]->cleanMenuText(), 0, scrActions["fileSave"]->accel(), "fileSave");
586
        SetKeyEntry(4, scrActions["fileSaveAs"]->cleanMenuText(), 0, scrActions["fileSaveAs"]->accel(), "fileSaveAs");
587
        //SetKeyEntry(, scrActions["fileRevert"]->cleanMenuText(), 0, scrActions["fileRevert"]->accel(), "fileRevert");
588
        //SetKeyEntry(, scrActions["fileCollect"]->cleanMenuText(), 0, scrActions["fileCollect"]->accel(), "fileCollect");
589
        SetKeyEntry(6, scrActions["fileDocSetup"]->cleanMenuText(), 0, scrActions["fileDocSetup"]->accel(), "fileDocSetup");
590
        SetKeyEntry(8, scrActions["fileQuit"]->cleanMenuText(), 0, scrActions["fileQuit"]->accel(), "fileQuit");
591
        //Included import & export options
592
        //SetKeyEntry(, scrActions["fileImportText"]->cleanMenuText(), 0, scrActions["fileImportText"]->accel(), "fileImportText");
593
        //SetKeyEntry(, scrActions["fileImportAppendText"]->cleanMenuText(), 0, scrActions["fileImportAppendText"]->accel(), "fileImportAppendText");
594
        //SetKeyEntry(, scrActions["fileImportImage"]->cleanMenuText(), 0, scrActions["fileImportImage"]->accel(), "fileImportImage");  
595
        //SetKeyEntry(, scrActions["fileImportPage"]->cleanMenuText(), 0, scrActions["fileImportPage"]->accel(), "fileImportPage");
596
        //SetKeyEntry(, scrActions["fileExportText"]->cleanMenuText(), 0, scrActions["fileExportText"]->accel(), "fileExportText");
597
        //SetKeyEntry(, scrActions["fileExportAsEPS"]->cleanMenuText(), 0, scrActions["fileExportAsEPS"]->accel(), "fileExportAsEPS");
598
        //SetKeyEntry(, scrActions["fileExportAsPDF"]->cleanMenuText(), 0, scrActions["fileExportAsPDF"]->accel(), "fileExportAsPDF");
599
 
600
        //EDIT MENU
601
        SetKeyEntry(9, scrActions["editCut"]->cleanMenuText(), 0, scrActions["editCut"]->accel(), "editCut");
602
        SetKeyEntry(10, scrActions["editCopy"]->cleanMenuText(), 0, scrActions["editCopy"]->accel(), "editCopy");
603
        SetKeyEntry(11, scrActions["editPaste"]->cleanMenuText(), 0, scrActions["editPaste"]->accel(), "editPaste");
604
        SetKeyEntry(12, scrActions["editClear"]->cleanMenuText(), 0, scrActions["editClear"]->accel(), "editClear");
605
        SetKeyEntry(13, scrActions["editSelectAll"]->cleanMenuText(), 0, scrActions["editSelectAll"]->accel(), "editSelectAll");
606
        SetKeyEntry(14, scrActions["editColors"]->cleanMenuText(), 0, scrActions["editColors"]->accel(), "editColors");
607
        SetKeyEntry(15, scrActions["editParaStyles"]->cleanMenuText(), 0, scrActions["editParaStyles"]->accel(), "editParaStyles");
608
        SetKeyEntry(16, scrActions["editTemplates"]->cleanMenuText(), 0, scrActions["editTemplates"]->accel(), "editTemplates");
609
        SetKeyEntry(17, scrActions["editFonts"]->cleanMenuText(), 0, scrActions["editFonts"]->accel(), "editFonts");
610
        //SetKeyEntry(, scrActions["editSearchReplace"]->cleanMenuText(), 0, scrActions["editSearchReplace"]->accel(), "editSearchReplace");
611
        //SetKeyEntry(, scrActions["editLineStyles"]->cleanMenuText(), 0, scrActions["editLineStyles"]->accel(), "editLineStyles");
1236 cbradney 612
 
1230 cbradney 613
        //SetKeyEntry(, scrActions["editFonts"]->cleanMenuText(), 0, scrActions["editFonts"]->accel(), "editFonts");
1236 cbradney 614
        SetKeyEntry(19, tr("Select New Font"), 0, 0);
1246 cbradney 615
 
616
        //ITEM MENU
617
        SetKeyEntry(20, scrActions["itemDuplicate"]->cleanMenuText(), 0, scrActions["itemDuplicate"]->accel(), "itemDuplicate");
618
        SetKeyEntry(21, scrActions["itemMulDuplicate"]->cleanMenuText(), 0, scrActions["itemMulDuplicate"]->accel(), "itemMulDuplicate");
619
        SetKeyEntry(22, scrActions["itemDelete"]->cleanMenuText(), 0, scrActions["itemDelete"]->accel(), "itemDelete");
620
        SetKeyEntry(23, scrActions["itemGroup"]->cleanMenuText(), 0, scrActions["itemGroup"]->accel(), "itemGroup");
621
        SetKeyEntry(24, scrActions["itemUngroup"]->cleanMenuText(), 0, scrActions["itemUngroup"]->accel(), "itemUngroup");
622
        SetKeyEntry(25, scrActions["itemSendToBack"]->cleanMenuText(), 0, scrActions["itemSendToBack"]->accel(), "itemSendToBack");
623
        SetKeyEntry(26, scrActions["itemBringToFront"]->cleanMenuText(), 0, scrActions["itemBringToFront"]->accel(), "itemBringToFront");
624
        SetKeyEntry(27, scrActions["itemLower"]->cleanMenuText(), 0, scrActions["itemLower"]->accel(), "itemLower");
625
        SetKeyEntry(28, scrActions["itemRaise"]->cleanMenuText(), 0, scrActions["itemRaise"]->accel(), "itemRaise");
626
        SetKeyEntry(29, scrActions["itemAlignDist"]->cleanMenuText(), 0, scrActions["itemAlignDist"]->accel(), "itemAlignDist");
627
        SetKeyEntry(67, scrActions["itemLock"]->cleanMenuText(), 0, scrActions["itemLock"]->accel(), "itemLock");
628
 
629
        //SetKeyEntry(, scrActions["itemShapeEdit"]->cleanMenuText(), 0, scrActions["itemShapeEdit"]->accel(), "itemShapeEdit");
630
                //CBSetKeyEntry(61, tr("Attach Text to Path"), M_ItemAttachTextToPath, 0);
631
        //SetKeyEntry(, scrActions["itemAttachTextToPath"]->cleanMenuText(), 0, scrActions["itemAttachTextToPath"]->accel(), "itemAttachTextToPath");
632
        //SetKeyEntry(, scrActions["itemDetachTextFromPath"]->cleanMenuText(), 0, scrActions["itemDetachTextFromPath"]->accel(), "itemDetachTextFromPath");
633
        //SetKeyEntry(, scrActions["itemCombinePolygons"]->cleanMenuText(), 0, scrActions["itemCombinePolygons"]->accel(), "itemCombinePolygons");
634
        //SetKeyEntry(, scrActions["itemSplitPolygons"]->cleanMenuText(), 0, scrActions["itemSplitPolygons"]->accel(), "itemSplitPolygons");
635
        //SetKeyEntry(, scrActions["itemConvertToOutlines"]->cleanMenuText(), 0, scrActions["itemConvertToOutlines"]->accel(), "itemConvertToOutlines");
636
 
637
        //PAGE MENU
638
        SetKeyEntry(30, scrActions["pageInsert"]->cleanMenuText(), 0, scrActions["pageInsert"]->accel(), "pageInsert");
639
        SetKeyEntry(31, scrActions["pageDelete"]->cleanMenuText(), 0, scrActions["pageDelete"]->accel(), "pageDelete");
640
        SetKeyEntry(32, scrActions["pageMove"]->cleanMenuText(), 0, scrActions["pageMove"]->accel(), "pageMove");
641
        SetKeyEntry(33, scrActions["pageApplyTemplate"]->cleanMenuText(), 0, scrActions["pageApplyTemplate"]->accel(), "pageApplyTemplate");
642
        SetKeyEntry(49, scrActions["pageManageGuides"]->cleanMenuText(), 0, scrActions["pageManageGuides"]->accel(), "pageManageGuides");
643
        SetKeyEntry(61, scrActions["pageCopy"]->cleanMenuText(), 0, scrActions["pageCopy"]->accel(), "pageCopy");
644
 
645
        //VIEW MENU
646
        SetKeyEntry(34, scrActions["viewFitInWindow"]->cleanMenuText(), 0, scrActions["viewFitInWindow"]->accel(), "viewFitInWindow");
647
        SetKeyEntry(35, scrActions["viewFit50"]->cleanMenuText(), 0, scrActions["viewFit50"]->accel(), "viewFit50");
648
        SetKeyEntry(36, scrActions["viewFit75"]->cleanMenuText(), 0, scrActions["viewFit75"]->accel(), "viewFit75");
649
        SetKeyEntry(37, scrActions["viewFit100"]->cleanMenuText(), 0, scrActions["viewFit100"]->accel(), "viewFit100");
650
        SetKeyEntry(38, scrActions["viewFit200"]->cleanMenuText(), 0, scrActions["viewFit200"]->accel(), "viewFit200");
651
        SetKeyEntry(39, scrActions["viewFit20"]->cleanMenuText(), 0, scrActions["viewFit20"]->accel(), "viewFit20");
652
        SetKeyEntry(40, scrActions["viewShowMargins"]->cleanMenuText(), 0, scrActions["viewShowMargins"]->accel(), "viewShowMargins");
653
        SetKeyEntry(41, scrActions["viewShowFrames"]->cleanMenuText(), 0, scrActions["viewShowFrames"]->accel(), "viewShowFrames");
654
        SetKeyEntry(42, scrActions["viewShowImages"]->cleanMenuText(), 0, scrActions["viewShowImages"]->accel(), "viewShowImages");
655
        SetKeyEntry(43, scrActions["viewShowGrid"]->cleanMenuText(), 0, scrActions["viewShowGrid"]->accel(), "viewShowGrid");
656
        SetKeyEntry(44, scrActions["viewSnapToGrid"]->cleanMenuText(), 0, scrActions["viewSnapToGrid"]->accel(), "viewSnapToGrid");
657
 
1255 cbradney 658
        //TOOLS MENU
659
        /*
660
        SetKeyEntry(46, tr("Properties"), viewMpal, 0);
661
        SetKeyEntry(47, tr("Outline"), viewTpal, 0);
662
        SetKeyEntry(48, tr("Scrapbook"), viewBpal, 0);
663
        SetKeyEntry(45, tr("Tools"), toolbarMenuTools, 0);
664
        SetKeyEntry(55, tr("Tooltips"), tip, 0);
665
        */
1230 cbradney 666
        //EXTRAS
801 cbradney 667
        SetKeyEntry(56, tr("Smart Hyphen"), 0, CTRL+Key_Minus);
668
        SetKeyEntry(57, tr("Align Left"), 0, CTRL+Key_L);
669
        SetKeyEntry(58, tr("Align Right"), 0, CTRL+Key_R);
670
        SetKeyEntry(59, tr("Align Center"), 0, CTRL+Key_E);
671
        SetKeyEntry(60, tr("Insert Page Number"), 0, CTRL+Key_NumberSign);
1236 cbradney 672
 
1246 cbradney 673
 
1236 cbradney 674
        SetKeyEntry(62, tr("Show Layers"), viewLpal, 0);
675
 
676
        SetKeyEntry(63, scrActions["editJavascripts"]->cleanMenuText(), 0, scrActions["editJavascripts"]->accel(), "editJavascripts");
677
        SetKeyEntry(64, scrActions["editUndoAction"]->cleanMenuText(), 0, scrActions["editUndoAction"]->accel(), "editUndoAction");
678
        SetKeyEntry(65, scrActions["editRedoAction"]->cleanMenuText(), 0, scrActions["editRedoAction"]->accel(), "editRedoAction");
679
 
680
        SetKeyEntry(66, tr("Show Page Palette"), viewSepal, 0);
681
 
1114 tsoots 682
        SetKeyEntry(68, tr("Non Breaking Space"), 0, CTRL+Key_Space);
1236 cbradney 683
 
801 cbradney 684
}
685
 
686
void ScribusApp::initArrowStyles()
687
{
1065 cbradney 688
        struct ArrowDesc arrow;
801 cbradney 689
        FPointArray points;
690
        QWMatrix arrowScaling;
691
        arrowScaling.scale(0.5, 0.5);
692
        arrow.name = "Arrow1L";
693
        arrow.userArrow = false;
694
        points.addQuadPoint(0, 0, 0, 0, 0, 0, 0, 0);
695
        points.addQuadPoint(-5, -5, -5, -5, -5, -5, -5, -5);
696
        points.addQuadPoint(12, 0, 12, 0, 12, 0, 12, 0);
697
        points.addQuadPoint(-5, 5, -5, 5, -5, 5, -5, 5);
698
        points.addQuadPoint(0, 0, 0, 0, 0, 0, 0, 0);
699
        arrow.points = points.copy();
700
        Prefs.arrowStyles.append(arrow);
701
        arrow.name = "Arrow1M";
702
        points.map(arrowScaling);
703
        arrow.points = points.copy();
704
        Prefs.arrowStyles.append(arrow);
705
        arrow.name = "Arrow1S";
706
        points.map(arrowScaling);
707
        arrow.points = points.copy();
708
        Prefs.arrowStyles.append(arrow);
709
        arrow.name = "SquareL";
710
        points.resize(0);
711
        points.addQuadPoint(-5, -5, -5, -5, -5, -5, -5, -5);
712
        points.addQuadPoint(5, -5, 5, -5, 5, -5, 5, -5);
713
        points.addQuadPoint(5, 5, 5, 5, 5, 5, 5, 5);
714
        points.addQuadPoint(-5, 5, -5, 5, -5, 5, -5, 5);
715
        points.addQuadPoint(-5, -5, -5, -5, -5, -5, -5, -5);
716
        arrow.points = points.copy();
717
        Prefs.arrowStyles.append(arrow);
718
        arrow.name = "SquareM";
719
        points.map(arrowScaling);
720
        arrow.points = points.copy();
721
        Prefs.arrowStyles.append(arrow);
722
        arrow.name = "SquareS";
723
        points.map(arrowScaling);
724
        arrow.points = points.copy();
725
        Prefs.arrowStyles.append(arrow);
726
        arrow.name = "TriangleInL";
727
        points.resize(0);
728
        points.addQuadPoint(5.77, 0, 5.77, 0, 5.77, 0, 5.77, 0);
729
        points.addQuadPoint(-2.88, 5, -2.88, 5, -2.88, 5, -2.88, 5);
730
        points.addQuadPoint(-2.88, -5, -2.88, -5, -2.88, -5, -2.88, -5);
731
        points.addQuadPoint(5.77, 0, 5.77, 0, 5.77, 0, 5.77, 0);
732
        arrow.points = points.copy();
733
        Prefs.arrowStyles.append(arrow);
734
        arrow.name = "TriangleInM";
735
        points.map(arrowScaling);
736
        arrow.points = points.copy();
737
        Prefs.arrowStyles.append(arrow);
738
        arrow.name = "TriangleInS";
739
        points.map(arrowScaling);
740
        arrow.points = points.copy();
741
        Prefs.arrowStyles.append(arrow);
742
        arrow.name = "TriangleOutL";
743
        points.resize(0);
744
        points.addQuadPoint(-5.77, 0, -5.77, 0, -5.77, 0, -5.77, 0);
745
        points.addQuadPoint(2.88, 5, 2.88, 5, 2.88, 5, 2.88, 5);
746
        points.addQuadPoint(2.88, -5, 2.88, -5, 2.88, -5, 2.88, -5);
747
        points.addQuadPoint(-5.77, 0, -5.77, 0, -5.77, 0, -5.77, 0);
748
        arrow.points = points.copy();
749
        Prefs.arrowStyles.append(arrow);
750
        arrow.name = "TriangleOutM";
751
        points.map(arrowScaling);
752
        arrow.points = points.copy();
753
        Prefs.arrowStyles.append(arrow);
754
        arrow.name = "TriangleOutS";
755
        points.map(arrowScaling);
756
        arrow.points = points.copy();
757
        Prefs.arrowStyles.append(arrow);
758
}
759
 
760
void ScribusApp::initPalettes()
761
{
762
        Tpal = new Tree(this, 0);
763
        Mpal = new Mpalette(this, &Prefs);
764
        Mpal->Cpal->SetColors(Prefs.DColors);
765
        Mpal->Cpal->UseTrans(true);
766
        Mpal->Fonts->RebuildList(&Prefs, 0);
767
        Npal = new NodePalette(this);
768
        Lpal = new LayerPalette(this);
769
        ScBook = new Biblio(this, &Prefs);
770
        Sepal = new SeitenPal(this);
771
        BookPal = new BookPalette(this);
772
        MaPal = new Measurements(this);
773
        MaPal->hide();
1232 fschmid 774
        docChecker = new CheckDocument(this, false);
775
        docChecker->hide();
801 cbradney 776
 
1114 tsoots 777
        undoPalette = new UndoPalette(this, "undoPalette");
1247 tsoots 778
        undoManager->registerGui(undoPalette);
1255 cbradney 779
        connect(undoPalette, SIGNAL(closePalette(bool)), this, SLOT(setUndoPalette(bool)));
780
 
801 cbradney 781
        connect(MaPal, SIGNAL(Schliessen(bool)), this, SLOT(setMapal(bool)));
782
        connect(Mpal, SIGNAL(DocChanged()), this, SLOT(slotDocCh()));
783
        connect(Mpal, SIGNAL(NewAbStyle(int)), this, SLOT(setNewAbStyle(int)));
784
        connect(Mpal, SIGNAL(BackHome()), this, SLOT(Aktiv()));
785
        connect(Mpal, SIGNAL(Stellung(int)), this, SLOT(setItemHoch(int)));
786
        connect(Mpal, SIGNAL(Schliessen()), this, SLOT(ToggleMpal()));
787
        connect(Mpal, SIGNAL(EditCL()), this, SLOT(ToggleFrameEdit()));
788
        connect(Mpal, SIGNAL(NewTF(QString)), this, SLOT(SetNewFont(QString)));
789
        connect(Mpal, SIGNAL(UpdtGui(int)), this, SLOT(HaveNewSel(int)));
790
        connect(Mpal->Cpal, SIGNAL(NewPen(QString)), this, SLOT(setPenFarbe(QString)));
791
        connect(Mpal->Cpal, SIGNAL(NewBrush(QString)), this, SLOT(setBrushFarbe(QString)));
792
        connect(Mpal->Cpal, SIGNAL(NewPenShade(int)), this, SLOT(setPenShade(int)));
793
        connect(Mpal->Cpal, SIGNAL(NewBrushShade(int)), this, SLOT(setBrushShade(int)));
794
        connect(Mpal->Cpal, SIGNAL(NewTrans(double)), this, SLOT(SetTranspar(double)));
795
        connect(Mpal->Cpal, SIGNAL(NewTransS(double)), this, SLOT(SetTransparS(double)));
796
        connect(Mpal->Cpal, SIGNAL(NewGradient(int)), this, SLOT(setGradFill(int)));
797
        connect(Mpal->Cpal->gradEdit->Preview, SIGNAL(gradientChanged()), this, SLOT(updtGradFill()));
798
        connect(Mpal->Cpal, SIGNAL(gradientChanged()), this, SLOT(updtGradFill()));
799
        connect(Mpal->Cpal, SIGNAL(QueryItem()), this, SLOT(GetBrushPen()));
1232 fschmid 800
        connect(docChecker, SIGNAL(closePal()), this, SLOT(ToggleCheckPal()));
801
        connect(docChecker, SIGNAL(rescan()), this, SLOT(slotCheckDoc()));
1235 fschmid 802
        connect(docChecker, SIGNAL(selectElement(int, int)), this, SLOT(SelectFromOutl(int, int)));
1244 fschmid 803
        connect(docChecker, SIGNAL(selectPage(int)), this, SLOT(SelectFromOutlS(int)));
801 cbradney 804
        connect(Tpal, SIGNAL(Schliessen()), this, SLOT(ToggleTpal()));
805
        connect(Tpal, SIGNAL(CloseMpal()), this, SLOT(ToggleMpal()));
806
        connect(Tpal, SIGNAL(CloseSpal()), this, SLOT(ToggleBpal()));
807
        connect(Tpal, SIGNAL(SelectElement(int, int)), this, SLOT(SelectFromOutl(int, int)));
808
        connect(Tpal, SIGNAL(SelectSeite(int)), this, SLOT(SelectFromOutlS(int)));
809
        connect(Tpal, SIGNAL(ToggleAllPalettes()), this, SLOT(ToggleAllPalettes()));
810
        connect(Mpal->Spal, SIGNAL(newStyle(int)), this, SLOT(setNewAbStyle(int)));
811
        connect(Mpal, SIGNAL(EditLSt()), this, SLOT(slotEditLineStyles()));
812
        connect(Mpal, SIGNAL(ToggleAllPalettes()), this, SLOT(ToggleAllPalettes()));
813
        connect(Mpal, SIGNAL(CloseTpal()), this, SLOT(ToggleTpal()));
814
        connect(Mpal, SIGNAL(CloseBpal()), this, SLOT(ToggleBpal()));
815
        connect(Npal, SIGNAL(Schliessen()), this, SLOT(NoFrameEdit()));
816
        connect(Lpal, SIGNAL(LayerActivated(int)), this, SLOT(changeLayer(int)));
817
        connect(Lpal, SIGNAL(LayerRemoved(int, bool)), this, SLOT(LayerRemove(int, bool)));
818
        connect(Lpal, SIGNAL(LayerChanged()), this, SLOT(showLayer()));
819
        connect(Lpal, SIGNAL(Schliessen()), this, SLOT(ToggleLpal()));
820
        connect(Lpal->Table, SIGNAL(Schliessen()), this, SLOT(ToggleLpal()));
821
        connect(Lpal->Table, SIGNAL(ToggleAllPalettes()), this, SLOT(ToggleAllPalettes()));
822
        connect(Sepal, SIGNAL(Schliessen()), this, SLOT(ToggleSepal()));
823
        connect(Sepal, SIGNAL(EditTemp(QString)), this, SLOT(ManageTemp(QString)));
824
        connect(Sepal->PageView, SIGNAL(UseTemp(QString, int)), this, SLOT(Apply_Temp(QString, int)));
825
        connect(Sepal->PageView, SIGNAL(NewPage(int, QString)), this, SLOT(slotNewPageP(int, QString)));
826
        connect(Sepal->Trash, SIGNAL(DelPage(int)), this, SLOT(DeletePage2(int)));
827
        connect(Sepal, SIGNAL(GotoSeite(int)), this, SLOT(SelectFromOutlS(int)));
828
        connect(Sepal, SIGNAL(ToggleAllPalettes()), this, SLOT(ToggleAllPalettes()));
829
        connect(BookPal->BView, SIGNAL(MarkMoved()), this, SLOT(StoreBookmarks()));
830
        connect(BookPal->BView, SIGNAL(ChangeBMNr(int, int, int)), this, SLOT(ChBookmarks(int, int, int)));
831
        connect(BookPal->BView, SIGNAL(SelectElement(int, int)), this, SLOT(SelectFromOutl(int, int)));
832
        connect(BookPal, SIGNAL(Schliessen()), this, SLOT(ToggleBookpal()));
833
        connect(BookPal, SIGNAL(ToggleAllPalettes()), this, SLOT(ToggleAllPalettes()));
834
}
835
 
836
void ScribusApp::initScrapbook()
837
{
1144 cbradney 838
        QString scrapbookFile = PrefsPfad+"/scrap13.scs";
801 cbradney 839
        QFileInfo scrapbookFileInfo = QFileInfo(scrapbookFile);
840
        if (scrapbookFileInfo.exists())
841
                ScBook->BibWin->ReadContents(scrapbookFile);
842
        ScBook->ScFilename = scrapbookFile;
843
        ScBook->AdjustMenu();
844
        connect(ScBook, SIGNAL(Schliessen()), this, SLOT(ToggleBpal()));
845
        connect(ScBook->BibWin, SIGNAL(ToggleAllPalettes()), this, SLOT(ToggleAllPalettes()));
846
        connect(ScBook->BibWin, SIGNAL(Schliessen()), this, SLOT(ToggleBpal()));
847
        connect(ScBook->BibWin, SIGNAL(CloseTpal()), this, SLOT(ToggleTpal()));
848
        connect(ScBook->BibWin, SIGNAL(CloseMpal()), this, SLOT(ToggleMpal()));
849
}
850
 
851
void ScribusApp::initCrashHandler()
852
{
853
        typedef void (*HandlerType)(int);
854
        HandlerType handler     = 0;
855
        handler = ScribusApp::defaultCrashHandler;
856
        if (!handler)
857
                handler = SIG_DFL;
858
        sigset_t mask;
859
        sigemptyset(&mask);
860
#ifdef SIGSEGV
861
        signal (SIGSEGV, handler);
862
        sigaddset(&mask, SIGSEGV);
863
#endif
864
#ifdef SIGFPE
865
        signal (SIGFPE, handler);
866
        sigaddset(&mask, SIGFPE);
867
#endif
868
#ifdef SIGILL
869
        signal (SIGILL, handler);
870
        sigaddset(&mask, SIGILL);
871
#endif
872
#ifdef SIGABRT
873
        signal (SIGABRT, handler);
874
        sigaddset(&mask, SIGABRT);
875
#endif
876
        sigprocmask(SIG_UNBLOCK, &mask, 0);
877
}
878
 
770 cbradney 879
const QString ScribusApp::getGuiLanguage()
880
{
881
        return guiLanguage;
882
}
883
 
675 cbradney 884
/*!
885
 \fn QString ScribusApp::getPreferencesLocation()
886
 \author Craig Bradney
887
 \date Thu 18 Nov 2004
888
 \brief Get the user's preference file location. Rename any existing old preferences files
889
 \param None
890
 \retval QString Location of the user's preferences
891
 */
892
 
893
QString ScribusApp::getPreferencesLocation()
894
{
895
        QString Pff = QDir::convertSeparators(QDir::homeDirPath()+"/.scribus");
896
        QFileInfo Pffi = QFileInfo(Pff);
897
        QString PrefsPfad;
1144 cbradney 898
        //If we are using ~/.scribus
675 cbradney 899
        if (Pffi.exists())
900
        {
901
                if (Pffi.isDir())
902
                        PrefsPfad = Pff;
903
                else
904
                        PrefsPfad = QDir::homeDirPath();
905
        }
1144 cbradney 906
        else // Move to using ~/.scribus/scribus.* from ~/.scribus.*
675 cbradney 907
        {
1144 cbradney 908
                QDir prefsDirectory = QDir();
909
                prefsDirectory.mkdir(Pff);
675 cbradney 910
                PrefsPfad = Pff;
1144 cbradney 911
                QString oldPR = QDir::convertSeparators(QDir::homeDirPath()+"/.scribus.rc");
912
                QFileInfo oldPi = QFileInfo(oldPR);
913
                if (oldPi.exists())
914
                        moveFile(oldPR, Pff+"/scribus.rc");
915
                QString oldPR2 = QDir::convertSeparators(QDir::homeDirPath()+"/.scribusfont.rc");
916
                QFileInfo oldPi2 = QFileInfo(oldPR2);
917
                if (oldPi2.exists())
918
                        moveFile(oldPR2, Pff+"/scribusfont.rc");
919
                QString oldPR3 = QDir::convertSeparators(QDir::homeDirPath()+"/.scribusscrap.scs");
920
                QFileInfo oldPi3 = QFileInfo(oldPR3);
921
                if (oldPi3.exists())
922
                        moveFile(oldPR3, Pff+"/scrap.scs");
675 cbradney 923
        }
1144 cbradney 924
 
925
        //Now make copies for 1.3 use and leave the old ones alone for <1.3.0 usage
926
        QString oldPR =QDir::convertSeparators(PrefsPfad+"/scribus.rc");
927
        QString oldPR2=QDir::convertSeparators(PrefsPfad+"/scribusfont.rc");
928
        QString oldPR3=QDir::convertSeparators(PrefsPfad+"/scrap.scs");
929
        QString oldPR4=QDir::convertSeparators(PrefsPfad+"/prefs.xml");
930
        QString newPR =QDir::convertSeparators(PrefsPfad+"/scribus13.rc");
931
        QString newPR2=QDir::convertSeparators(PrefsPfad+"/scribusfont13.rc");
932
        QString newPR3=QDir::convertSeparators(PrefsPfad+"/scrap13.scs");
933
        QString newPR4=QDir::convertSeparators(PrefsPfad+"/prefs13.xml");
934
 
935
        bool existsOldPR =QFile::exists(oldPR);
936
        bool existsOldPR2=QFile::exists(oldPR2);
937
        bool existsOldPR3=QFile::exists(oldPR3);
938
        bool existsOldPR4=QFile::exists(oldPR4);
939
        bool existsNewPR =QFile::exists(newPR);
940
        bool existsNewPR2=QFile::exists(newPR2);
941
        bool existsNewPR3=QFile::exists(newPR3);
942
        bool existsNewPR4=QFile::exists(newPR4);       
943
 
944
        //Only check for these two as they will be autocreated if they dont exist.
945
        if( (existsOldPR && !existsNewPR) || (existsOldPR4 && !existsNewPR4) )
946
        {
947
                if (splashScreen)
948
                        splashScreen->hide();
949
                if ( (QMessageBox::question( this, tr("Migrate Old Scribus Settings?"),
950
                                tr("Scribus has detected existing Scribus 1.2 preferences files.\n"
951
                                        "Do you want to migrate them to the new Scribus version?"),
1208 cbradney 952
                                QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, QMessageBox::NoButton))==QMessageBox::Yes )
1144 cbradney 953
                {
954
                        if (existsOldPR && !existsNewPR)
955
                                copyFile(oldPR, newPR);
956
                        if (existsOldPR2 && !existsNewPR2)
957
                                copyFile(oldPR2, newPR2);
958
                        if (existsOldPR3 && !existsNewPR3)
959
                                copyFile(oldPR3, newPR3);
960
                        if (existsOldPR4 && !existsNewPR4)
961
                                copyFile(oldPR4, newPR4);
962
                }
963
                if (splashScreen)
964
                        splashScreen->show();
965
        }
675 cbradney 966
        return PrefsPfad;
967
}
968
 
1144 cbradney 969
/*!
970
 \fn QString ScribusApp::convertToXMLPreferences(QString prefsLocation)
971
 \author Craig Bradney
972
 \date Sun 09 Jan 2005
973
 \brief Convert 1.2 prefs to 1.3 prefs
974
 \param prefsLocation Location of user preferences
975
 \retval None
976
 */
1208 cbradney 977
void ScribusApp::convertToXMLPreferences(const QString prefsLocation)
1144 cbradney 978
{
979
 
980
}
981
 
1227 cbradney 982
void ScribusApp::initFileMenuActions()
1208 cbradney 983
{
984
        //File Menu
1230 cbradney 985
        scrActions.insert("fileNew", new ScrAction(QIconSet(loadIcon("DateiNeu16.png"), loadIcon("DateiNeu.xpm")), tr("&New"), CTRL+Key_N, this, "fileNew"));  
1208 cbradney 986
        scrActions.insert("fileOpen", new ScrAction(QIconSet(loadIcon("DateiOpen16.png"), loadIcon("DateiOpen.xpm")), tr("&Open..."), CTRL+Key_O, this, "fileOpen"));
987
        scrActions.insert("fileClose", new ScrAction(QIconSet(loadIcon("DateiClos16.png"), loadIcon("DateiClose.png")), tr("&Close"), CTRL+Key_W, this, "fileClose"));
988
        scrActions.insert("fileSave", new ScrAction(QIconSet(loadIcon("DateiSave16.png"), loadIcon("DateiSave2.png")), tr("&Save"), CTRL+Key_S, this, "fileSave"));
989
        scrActions.insert("fileSaveAs", new ScrAction(QPixmap(loadIcon("filesaveas.png")), tr("Save &As..."), QKeySequence(), this, "fileSaveAs"));
990
        scrActions.insert("fileRevert", new ScrAction(QPixmap(loadIcon("revert.png")), tr("Re&vert to Saved"), QKeySequence(), this, "fileRevert"));
991
        scrActions.insert("fileCollect", new ScrAction(tr("Collect for O&utput..."), QKeySequence(), this, "fileCollect"));
992
        //File Import Menu
993
        scrActions.insert("fileImportText", new ScrAction(tr("Get Text..."), QKeySequence(), this, "fileImportText"));
994
        scrActions.insert("fileImportAppendText", new ScrAction(tr("Append &Text..."), QKeySequence(), this, "fileImportAppendText"));
995
        scrActions.insert("fileImportImage", new ScrAction(tr("Get Image..."), QKeySequence(), this, "fileImportImage"));
996
 
997
        scrActions.insert("fileImportEPS", new ScrAction(tr("Import EPS..."), QKeySequence(), this, "fileImportEPS"));
998
        scrActions.insert("fileImportPage", new ScrAction(tr("Import Page(s)..."), QKeySequence(), this, "fileImportPage"));
999
        scrActions.insert("fileImportOOorgDraw", new ScrAction(tr("Import OpenOffice.org Draw..."), QKeySequence(), this, "fileImportOOorgDraw"));
1000
        scrActions.insert("fileImportSVG", new ScrAction(tr("Import SVG..."), QKeySequence(), this, "fileImportSVG"));
1001
 
1002
        //File Export Menu
1003
        scrActions.insert("fileExportText", new ScrAction(tr("Save &Text..."), QKeySequence(), this, "fileExportText"));
1004
        scrActions.insert("fileExportAsEPS", new ScrAction(tr("Save Page as &EPS..."), QKeySequence(), this, "fileExportAsEPS"));
1005
        scrActions.insert("fileExportAsPDF", new ScrAction(loadIcon("acrobat.png"), tr("Save as P&DF..."), QKeySequence(), this, "fileExportAsPDF"));
1006
        scrActions.insert("fileExportAsImage", new ScrAction(tr("Save as &Image..."), QKeySequence(), this, "fileExportAsImage"));
1007
        scrActions.insert("fileExportAsSVG", new ScrAction(tr("Save Page as &SVG..."), QKeySequence(), this, "fileExportAsSVG"));
1008
        //Rest of File Menu
1009
        scrActions.insert("fileDocInfo", new ScrAction(loadIcon("documentinfo.png"), tr("Document &Information..."), CTRL+Key_I, this, "fileDocSetup"));
1010
        scrActions.insert("fileDocSetup", new ScrAction(tr("Document &Setup..."), QKeySequence(), this, "fileDocSetup"));
1011
        scrActions.insert("filePrint", new ScrAction(QIconSet(loadIcon("DateiPrint16.png"), loadIcon("DateiPrint.xpm")), tr("&Print..."), CTRL+Key_P, this, "filePrint"));
1012
        scrActions.insert("fileQuit", new ScrAction(QPixmap(loadIcon("exit.png")), tr("&Quit"), CTRL+Key_Q, this, "fileQuit"));
1013
 
1227 cbradney 1014
        //Set some tooltips, unsure yet whether to use these, probably not as they arent flexible like normal actions ones can be
1015
        /*
1016
        scrActions["fileNew"]->setToolTip(tr("Create a new document"));
1017
        scrActions["fileOpen"]->setToolTip(tr("Open a document"));
1018
        scrActions["fileSave"]->setToolTip(tr("Save the current document"));
1019
        scrActions["fileClose"]->setToolTip(tr("Close the current document"));
1020
        scrActions["filePrint"]->setToolTip(tr("Print the current document"));
1021
        scrActions["fileExportAsPDF"]->setToolTip(tr("Save the current document as PDF"));
1022
        */
1208 cbradney 1023
        //Connect our signals and slots
1024
        //File Menu
1025
        connect( scrActions["fileNew"], SIGNAL(activated()) , this, SLOT(slotFileNew()) );
1026
        connect( scrActions["fileOpen"], SIGNAL(activated()) , this, SLOT(slotDocOpen()) );
1027
        connect( scrActions["fileClose"], SIGNAL(activated()) , this, SLOT(slotFileClose()) );
1028
        connect( scrActions["filePrint"], SIGNAL(activated()) , this, SLOT(slotFilePrint()) );
1029
        connect( scrActions["fileSave"], SIGNAL(activated()) , this, SLOT(slotFileSave()) );
1030
        connect( scrActions["fileSave"], SIGNAL(activated()) , this, SLOT(slotFileSave()) );
1031
        connect( scrActions["fileSaveAs"], SIGNAL(activated()) , this, SLOT(slotFileSaveAs()) );
1032
        connect( scrActions["fileDocInfo"], SIGNAL(activated()) , this, SLOT(InfoDoc()) );
1033
        connect( scrActions["fileDocSetup"], SIGNAL(activated()) , this, SLOT(SetupDoc()) );
1034
        connect( scrActions["fileRevert"], SIGNAL(activated()) , this, SLOT(slotFileRevert()) );
1035
        connect( scrActions["fileCollect"], SIGNAL(activated()) , this, SLOT(Collect()) );
1036
        connect( scrActions["fileQuit"], SIGNAL(activated()) , this, SLOT(slotFileQuit()) );
1037
        //File Import Menu
1038
        connect( scrActions["fileImportText"], SIGNAL(activated()) , this, SLOT(slotFileOpen()) );
1039
        connect( scrActions["fileImportAppendText"], SIGNAL(activated()) , this, SLOT(slotFileAppend()) );
1040
        connect( scrActions["fileImportImage"], SIGNAL(activated()) , this, SLOT(slotFileOpen()) );    
1041
        connect( scrActions["fileImportPage"], SIGNAL(activated()) , this, SLOT(slotDocMerge()) );
1042
        //File Export Menu
1043
        connect( scrActions["fileExportText"], SIGNAL(activated()) , this, SLOT(SaveText()) );
1044
        connect( scrActions["fileExportAsEPS"], SIGNAL(activated()) , this, SLOT(SaveAsEps()) );
1045
        connect( scrActions["fileExportAsPDF"], SIGNAL(activated()) , this, SLOT(SaveAsPDF()) );
1046
        //The rest are plugins
1047
}
1048
 
1227 cbradney 1049
void ScribusApp::initEditMenuActions()
1050
{
1051
        //Edit Menu
1052
        scrActions.insert("editUndoAction", new ScrAction(QIconSet(loadIcon("u_undo16.png"), loadIcon("u_undo.png")), tr("&Undo"), CTRL+Key_Z, this, "editUndo"));
1053
        scrActions.insert("editRedoAction", new ScrAction(QIconSet(loadIcon("u_redo16.png"), loadIcon("u_redo.png")), tr("&Redo"), CTRL+SHIFT+Key_Z, this, "editRedo"));
1054
        scrActions.insert("editActionMode", new ScrAction(tr("&Item Action Mode"), QKeySequence(), this, "editActionMode"));
1055
        scrActions.insert("editCut", new ScrAction(QIconSet(loadIcon("editcut.png"), loadIcon("editcut.png")), tr("Cu&t"), CTRL+Key_X, this, "editCut"));
1056
        scrActions.insert("editCopy", new ScrAction(QIconSet(loadIcon("editcopy.png"), loadIcon("editcopy.png")), tr("&Copy"), CTRL+Key_C, this, "editCopy"));
1057
        scrActions.insert("editPaste", new ScrAction(QIconSet(loadIcon("editpaste.png"), loadIcon("editpaste.png")), tr("&Paste"), CTRL+Key_V, this, "editPaste"));
1058
        scrActions.insert("editClear", new ScrAction(QIconSet(loadIcon("editClear.png"), loadIcon("editClear.png")), tr("C&lear"), QKeySequence(), this, "editClear"));
1059
        scrActions.insert("editSelectAll", new ScrAction(tr("Select &All"), CTRL+Key_A, this, "editSelectall"));
1060
        scrActions.insert("editSearchReplace", new ScrAction(QIconSet(loadIcon("find16.png"), loadIcon("find16.png")),  tr("&Search/Replace..."), QKeySequence(), this, "editSearchReplace"));
1061
 
1062
        scrActions.insert("editColors", new ScrAction(tr("C&olors..."), QKeySequence(), this, "editColors"));
1063
        scrActions.insert("editParaStyles", new ScrAction(tr("&Paragraph Styles..."), QKeySequence(), this, "editParaStyles"));
1064
        scrActions.insert("editLineStyles", new ScrAction(tr("&Line Styles..."), QKeySequence(), this, "editLineStyles"));
1065
        scrActions.insert("editTemplates", new ScrAction(tr("&Templates..."), QKeySequence(), this, "editTemplates"));
1066
        scrActions.insert("editJavascripts", new ScrAction(tr("&Javascripts..."), QKeySequence(), this, "editJavascripts"));
1067
        scrActions.insert("editPreferences", new ScrAction(tr("P&references..."), QKeySequence(), this, "editPreferences"));
1068
        scrActions.insert("editFonts", new ScrAction(tr("&Fonts..."), QKeySequence(), this, "editFonts"));
1069
 
1070
        connect( scrActions["editUndoAction"], SIGNAL(activated()) , this, SLOT(UnDoAction()) );
1071
        connect( scrActions["editRedoAction"], SIGNAL(activated()) , this, SLOT(RedoAction()) );
1072
        //TODO connect( scrActions["editActionMode"], SIGNAL(activated()) , this, SLOT(RedoAction()) );
1073
        connect( scrActions["editCut"], SIGNAL(activated()) , this, SLOT(slotEditCut()) );
1074
        connect( scrActions["editCopy"], SIGNAL(activated()) , this, SLOT(slotEditCopy()) );
1075
        connect( scrActions["editPaste"], SIGNAL(activated()) , this, SLOT(slotEditPaste()) );
1076
        connect( scrActions["editClear"], SIGNAL(activated()) , this, SLOT(DeleteText()) );
1077
        connect( scrActions["editSelectAll"], SIGNAL(activated()) , this, SLOT(SelectAll()) );
1078
        connect( scrActions["editSearchReplace"], SIGNAL(activated()), this, SLOT(SearchText()) );
1079
        connect( scrActions["editColors"], SIGNAL(activated()) , this, SLOT(slotEditColors()) );
1080
        connect( scrActions["editParaStyles"], SIGNAL(activated()) , this, SLOT(slotEditStyles()) );
1081
        connect( scrActions["editLineStyles"], SIGNAL(activated()) , this, SLOT(slotEditLineStyles()) );
1082
        connect( scrActions["editTemplates"], SIGNAL(activated()) , this, SLOT(ManageTemp()) );
1083
        connect( scrActions["editJavascripts"], SIGNAL(activated()) , this, SLOT(ManageJava()) );
1084
        connect( scrActions["editPreferences"], SIGNAL(activated()) , this, SLOT(slotPrefsOrg()) );
1085
        connect( scrActions["editFonts"], SIGNAL(activated()) , this, SLOT(slotFontOrg()) );
1086
}
1087
 
1236 cbradney 1088
void ScribusApp::initStyleMenuActions()
1089
{
1090
}
1091
 
1092
void ScribusApp::initItemMenuActions()
1093
{
1094
        //Item Menu
1095
        scrActions.insert("itemDuplicate", new ScrAction(tr("D&uplicate"), CTRL+Key_D, this, "itemDuplicate"));
1096
        scrActions.insert("itemMulDuplicate", new ScrAction(tr("&Multiple Duplicate"), QKeySequence(), this, "itemMulDuplicate"));
1097
        scrActions.insert("itemDelete", new ScrAction(tr("&Delete"), CTRL+Key_K, this, "itemDelete"));
1098
        scrActions.insert("itemGroup", new ScrAction(tr("&Group"), CTRL+Key_G, this, "itemGroup"));
1099
        scrActions.insert("itemUngroup", new ScrAction(tr("&Ungroup"), CTRL+Key_U, this, "itemUngroup"));
1100
        scrActions.insert("itemLock", new ScrAction(tr("Is &Locked"), CTRL+Key_F, this, "itemLock"));
1101
        scrActions["itemLock"]->setToggleAction(true);
1102
        scrActions.insert("itemSendToBack", new ScrAction(tr("Send to &Back"), QKeySequence(), this, "itemSendToBack"));
1103
        scrActions.insert("itemBringToFront", new ScrAction(tr("Bring to &Front"), QKeySequence(), this, "itemBringToFront"));
1104
        scrActions.insert("itemLower", new ScrAction(tr("&Lower"), QKeySequence(), this, "itemLower"));
1105
        scrActions.insert("itemRaise", new ScrAction(tr("&Raise"), QKeySequence(), this, "itemRaise"));
1106
        scrActions.insert("itemAlignDist", new ScrAction(tr("Distribute/&Align..."), QKeySequence(), this, "itemAlignDist"));
1107
 
1108
        scrActions.insert("itemShapeEdit", new ScrAction(tr("&Edit Shape..."), QKeySequence(), this, "itemShapeEdit"));
1109
        scrActions["itemShapeEdit"]->setToggleAction(true);
1110
        scrActions.insert("itemAttachTextToPath", new ScrAction(tr("&Attach Text to Path"), QKeySequence(), this, "itemAttachTextToPath"));
1111
        scrActions.insert("itemDetachTextFromPath", new ScrAction(tr("&Detach Text from Path"), QKeySequence(), this, "itemDetachTextFromPath"));
1112
        scrActions.insert("itemCombinePolygons", new ScrAction(tr("&Combine Polygons"), QKeySequence(), this, "itemCombinePolygons"));
1113
        scrActions.insert("itemSplitPolygons", new ScrAction(tr("Split &Polygons"), QKeySequence(), this, "itemSplitPolygons"));
1114
        scrActions.insert("itemConvertToOutlines", new ScrAction(tr("C&onvert to Outlines"), QKeySequence(), this, "itemConvertToOutlines"));
1115
 
1116
        connect( scrActions["itemDuplicate"], SIGNAL(activated()) , this, SLOT(ObjektDup()) );
1117
        connect( scrActions["itemMulDuplicate"], SIGNAL(activated()) , this, SLOT(ObjektDupM()) );
1118
        connect( scrActions["itemDelete"], SIGNAL(activated()) , this, SLOT(DeleteObjekt()) );
1119
        connect( scrActions["itemGroup"], SIGNAL(activated()) , this, SLOT(GroupObj()) );
1120
        connect( scrActions["itemUngroup"], SIGNAL(activated()) , this, SLOT(UnGroupObj()) );
1121
        connect( scrActions["itemLock"], SIGNAL(activated()) , this, SLOT(ToggleObjLock()) );
1122
        connect( scrActions["itemSendToBack"], SIGNAL(activated()) , this, SLOT(Objekt2Back()) );
1123
        connect( scrActions["itemBringToFront"], SIGNAL(activated()) , this, SLOT(Objekt2Front()) );
1124
        connect( scrActions["itemLower"], SIGNAL(activated()) , this, SLOT(ObjektLower()) );
1125
        connect( scrActions["itemRaise"], SIGNAL(activated()) , this, SLOT(ObjektRaise()) );
1126
        connect( scrActions["itemAlignDist"], SIGNAL(activated()) , this, SLOT(ObjektAlign()) );
1127
        connect( scrActions["itemShapeEdit"], SIGNAL(activated()) , this, SLOT(ToggleFrameEdit()) );
1128
        connect( scrActions["itemAttachTextToPath"], SIGNAL(activated()) , this, SLOT(Pfadtext()) );
1129
        connect( scrActions["itemDetachTextFromPath"], SIGNAL(activated()) , this, SLOT(noPfadtext()) );
1130
        connect( scrActions["itemCombinePolygons"], SIGNAL(activated()) , this, SLOT(UniteOb()) );
1131
        connect( scrActions["itemSplitPolygons"], SIGNAL(activated()) , this, SLOT(SplitUniteOb()) );
1132
        connect( scrActions["itemConvertToOutlines"], SIGNAL(activated()) , this, SLOT(TraceText()) );
1133
}
1134
 
1135
void ScribusApp::initPageMenuActions()
1136
{
1137
        //Page menu
1138
        scrActions.insert("pageInsert", new ScrAction(tr("&Insert..."), QKeySequence(), this, "PageInsert"));
1139
        scrActions.insert("pageDelete", new ScrAction(tr("&Delete..."), QKeySequence(), this, "pageDelete"));
1140
        scrActions.insert("pageCopy", new ScrAction(tr("&Copy..."), QKeySequence(), this, "pageCopy"));
1141
        scrActions.insert("pageMove", new ScrAction(tr("&Move..."), QKeySequence(), this, "pageMove"));
1142
        scrActions.insert("pageApplyTemplate", new ScrAction(tr("&Apply Template..."), QKeySequence(), this, "pageApplyTemplate"));
1143
        scrActions.insert("pageManageGuides", new ScrAction(tr("Manage &Guides..."), QKeySequence(), this, "pageManageGuides"));
1144
 
1145
        connect( scrActions["pageInsert"], SIGNAL(activated()) , this, SLOT(slotNewPageM()) );
1146
        connect( scrActions["pageDelete"], SIGNAL(activated()) , this, SLOT(DeletePage()) );
1147
        connect( scrActions["pageCopy"], SIGNAL(activated()) , this, SLOT(CopyPage()) );
1148
        connect( scrActions["pageMove"], SIGNAL(activated()) , this, SLOT(MovePage()) );
1149
        connect( scrActions["pageApplyTemplate"], SIGNAL(activated()) , this, SLOT(ApplyTemp()) );
1150
        connect( scrActions["pageManageGuides"], SIGNAL(activated()) , this, SLOT(ManageGuides()) );
1151
}
1152
 
1153
void ScribusApp::initViewMenuActions()
1154
{
1246 cbradney 1155
        scrActions.insert("viewFitInWindow", new ScrAction(tr("&Fit in window"), CTRL+Key_0, this, "viewFitInWindow"));
1156
        scrActions.insert("viewFit50", new ScrAction(tr("&50%"), QKeySequence(), this, "viewFit50"));
1157
        scrActions.insert("viewFit75", new ScrAction(tr("&75%"), QKeySequence(), this, "viewFit75"));
1158
        scrActions.insert("viewFit100", new ScrAction(tr("&100%"), CTRL+Key_1, this, "viewFit100"));
1159
        scrActions.insert("viewFit200", new ScrAction(tr("&200%"), QKeySequence(), this, "viewFit200"));
1160
        scrActions.insert("viewFit20", new ScrAction(tr("&Thumbnails"), QKeySequence(), this, "viewFit20"));
1161
        scrActions.insert("viewShowMargins", new ScrAction(tr("Show &Margins"), QKeySequence(), this, "viewShowMargins"));
1162
        scrActions.insert("viewShowFrames", new ScrAction(tr("Show &Frames"), QKeySequence(), this, "viewShowFrames"));
1163
        scrActions.insert("viewShowImages", new ScrAction(tr("Show &Images"), QKeySequence(), this, "viewShowImages"));
1164
        scrActions.insert("viewShowGrid", new ScrAction(tr("Show &Grid"), QKeySequence(), this, "viewShowGrid"));
1165
        scrActions.insert("viewShowGuides", new ScrAction(tr("Show G&uides"), QKeySequence(), this, "viewShowGuides"));
1166
        scrActions.insert("viewShowBaseline", new ScrAction(tr("Show &Baseline Grid"), QKeySequence(), this, "viewShowBaseline"));
1167
        scrActions.insert("viewShowTextChain", new ScrAction(tr("Show &Text Chain"), QKeySequence(), this, "viewShowTextChain"));
1168
        scrActions.insert("viewSnapToGrid", new ScrAction(tr("Sn&ap to Grid"), QKeySequence(), this, "viewSnapToGrid"));
1169
        scrActions.insert("viewSnapToGuides", new ScrAction(tr("Sna&p to Guides"), QKeySequence(), this, "viewSnapToGuides"));
1170
 
1171
        scrActions["viewShowMargins"]->setToggleAction(true);
1172
        scrActions["viewShowFrames"]->setToggleAction(true);
1173
        scrActions["viewShowImages"]->setToggleAction(true);
1174
        scrActions["viewShowGrid"]->setToggleAction(true);
1175
        scrActions["viewShowGuides"]->setToggleAction(true);
1176
        scrActions["viewShowBaseline"]->setToggleAction(true);
1177
        scrActions["viewShowTextChain"]->setToggleAction(true);
1178
        scrActions["viewSnapToGrid"]->setToggleAction(true);
1179
        scrActions["viewSnapToGuides"]->setToggleAction(true);
1180
 
1181
        scrActions["viewShowMargins"]->setOn(true);
1182
        scrActions["viewShowFrames"]->setOn(true);
1183
        scrActions["viewShowImages"]->setOn(true);
1184
        scrActions["viewShowGuides"]->setOn(true);
1185
 
1186
        connect( scrActions["viewFitInWindow"], SIGNAL(activated()) , this, SLOT(slotZoomFit()) );
1187
        connect( scrActions["viewFit50"], SIGNAL(activated()) , this, SLOT(slotZoom50()) );
1188
        connect( scrActions["viewFit75"], SIGNAL(activated()) , this, SLOT(slotZoom75()) );
1189
        connect( scrActions["viewFit100"], SIGNAL(activated()) , this, SLOT(slotZoom100()) );
1190
        connect( scrActions["viewFit200"], SIGNAL(activated()) , this, SLOT(slotZoom200()) );
1191
        connect( scrActions["viewFit20"], SIGNAL(activated()) , this, SLOT(slotZoom20()) );
1192
        connect( scrActions["viewShowMargins"], SIGNAL(activated()) , this, SLOT(ToggleMarks()) );
1193
        connect( scrActions["viewShowFrames"], SIGNAL(activated()) , this, SLOT(ToggleFrames()) );
1194
        connect( scrActions["viewShowImages"], SIGNAL(activated()) , this, SLOT(TogglePics()) );
1195
        connect( scrActions["viewShowGrid"], SIGNAL(activated()) , this, SLOT(ToggleRaster()) );
1196
        connect( scrActions["viewShowGuides"], SIGNAL(activated()) , this, SLOT(ToggleGuides()) );
1197
        connect( scrActions["viewShowBaseline"], SIGNAL(activated()) , this, SLOT(ToggleBase()) );
1198
        connect( scrActions["viewShowTextChain"], SIGNAL(activated()) , this, SLOT(ToggleTextLinks()) );
1199
        connect( scrActions["viewSnapToGrid"], SIGNAL(activated()) , this, SLOT(ToggleURaster()) );    
1200
        connect( scrActions["viewSnapToGuides"], SIGNAL(activated()) , this, SLOT(ToggleUGuides()) );  
1201
 
1236 cbradney 1202
}
1203
 
1204
void ScribusApp::initToolsMenuActions()
1205
{
1255 cbradney 1206
        //Tool menu
1207
        scrActions.insert("toolsProperties", new ScrAction(tr("&Properties"), QKeySequence(), this, "toolsProperties"));
1208
        scrActions.insert("toolsOutline", new ScrAction(tr("&Outline"), QKeySequence(), this, "toolsOutline"));
1209
        scrActions.insert("toolsScrapbook", new ScrAction(tr("&Scrapbook"), QKeySequence(), this, "toolsScrapbook"));
1210
        scrActions.insert("toolsLayers", new ScrAction(tr("&Layers"), QKeySequence(), this, "toolsLayers"));
1211
        scrActions.insert("toolsPages", new ScrAction(tr("P&age Palette"), QKeySequence(), this, "toolsPages"));
1212
        scrActions.insert("toolsBookmarks", new ScrAction(tr("&Bookmarks"), QKeySequence(), this, "toolsBookmarks"));
1213
        scrActions.insert("toolsActionHistory", new ScrAction(tr("Action &History"), QKeySequence(), this, "toolsActionHistory"));
1214
        scrActions.insert("toolsPreflightVerifier", new ScrAction(QIconSet(loadIcon("launch16.png"), loadIcon("launch.png")),tr("Preflight &Verifier"), QKeySequence(), this, "toolsPreflightVerifier"));
1215
        scrActions.insert("toolsToolbarTools", new ScrAction(tr("&Tools"), QKeySequence(), this, "toolsToolbarTools"));
1216
        scrActions.insert("toolsToolbarPDF", new ScrAction(tr("P&DF Tools"), QKeySequence(), this, "toolsToolbarPDF"));
1217
 
1218
        scrActions["toolsProperties"]->setToggleAction(true);
1219
        scrActions["toolsOutline"]->setToggleAction(true);
1220
        scrActions["toolsScrapbook"]->setToggleAction(true);
1221
        scrActions["toolsLayers"]->setToggleAction(true);
1222
        scrActions["toolsPages"]->setToggleAction(true);
1223
        scrActions["toolsBookmarks"]->setToggleAction(true);
1224
        scrActions["toolsActionHistory"]->setToggleAction(true);
1225
        scrActions["toolsPreflightVerifier"]->setToggleAction(true);
1226
        scrActions["toolsToolbarTools"]->setToggleAction(true);
1227
        scrActions["toolsToolbarPDF"]->setToggleAction(true);
1228
 
1229
        connect( scrActions["toolsProperties"], SIGNAL(activated()) , this, SLOT(ToggleMpal()) );
1230
        connect( scrActions["toolsOutline"], SIGNAL(activated()) , this, SLOT(ToggleTpal()) );
1231
        connect( scrActions["toolsScrapbook"], SIGNAL(activated()) , this, SLOT(ToggleBpal()) );
1232
        connect( scrActions["toolsLayers"], SIGNAL(activated()) , this, SLOT(ToggleLpal()) );
1233
        connect( scrActions["toolsPages"], SIGNAL(activated()) , this, SLOT(ToggleSepal()) );
1234
        connect( scrActions["toolsBookmarks"], SIGNAL(activated()) , this, SLOT(ToggleBookpal()) );
1235
        connect( scrActions["toolsActionHistory"], SIGNAL(activated()) , this, SLOT(ToggleUndoPalette()) );
1236
        connect( scrActions["toolsPreflightVerifier"], SIGNAL(activated()) , this, SLOT(ToggleCheckPal()) );
1237
        connect( scrActions["toolsToolbarTools"], SIGNAL(activated()) , this, SLOT(ToggleTools()) );
1238
        connect( scrActions["toolsToolbarPDF"], SIGNAL(activated()) , this, SLOT(TogglePDFTools()) );
1239
 
1240
 
1236 cbradney 1241
}
1242
 
1243
void ScribusApp::initExtrasMenuActions()
1244
{
1245
}
1246
 
1247
void ScribusApp::initWindowsMenuActions()
1248
{
1249
}
1250
 
1251
void ScribusApp::initScriptMenuActions()
1252
{
1253
}
1254
 
1255
void ScribusApp::initHelpMenuActions()
1256
{
1257
}
1258
 
3 paul 1259
void ScribusApp::initMenuBar()
1260
{
1261
        int MenID;
1262
        QFont tmp;
1263
        RecentDocs.clear();
1208 cbradney 1264
 
1227 cbradney 1265
        initFileMenuActions();
1266
        initEditMenuActions();
1236 cbradney 1267
        initStyleMenuActions();
1268
        initItemMenuActions();
1269
        initPageMenuActions();
1270
        initViewMenuActions();
1271
        initToolsMenuActions();
1272
        initExtrasMenuActions();
1273
        initWindowsMenuActions();
1274
        initScriptMenuActions();
1275
        initHelpMenuActions();
1208 cbradney 1276
 
1277
        scrMenuMgr->createMenu("File", tr("&File"));
1278
        scrMenuMgr->addMenuItem(scrActions["fileNew"], "File");
1279
        scrMenuMgr->addMenuItem(scrActions["fileOpen"], "File");
1280
        recentFileMenuName="FileOpenRecent";
1281
        scrMenuMgr->createMenu(recentFileMenuName, tr("Open &Recent"), "File");
1282
        scrMenuMgr->addMenuSeparator("File");
1283
        scrMenuMgr->addMenuItem(scrActions["fileClose"], "File");
1284
        scrMenuMgr->addMenuItem(scrActions["fileSave"], "File");
1285
        scrMenuMgr->addMenuItem(scrActions["fileSaveAs"], "File");
1286
        scrMenuMgr->addMenuItem(scrActions["fileRevert"], "File");
1287
        scrMenuMgr->addMenuItem(scrActions["fileCollect"], "File");
1288
        scrMenuMgr->addMenuSeparator("File");
1289
        scrMenuMgr->createMenu("FileImport", tr("&Import"), "File");
1290
        scrMenuMgr->addMenuItem(scrActions["fileImportText"], "FileImport");
1291
        scrMenuMgr->addMenuItem(scrActions["fileImportAppendText"], "FileImport");
1292
        scrMenuMgr->addMenuItem(scrActions["fileImportImage"], "FileImport");
1293
        scrMenuMgr->addMenuItem(scrActions["fileImportPage"], "FileImport");
1294
        scrMenuMgr->createMenu("FileExport", tr("&Export"), "File");
1295
        scrMenuMgr->addMenuItem(scrActions["fileExportText"], "FileExport");
1296
        scrMenuMgr->addMenuItem(scrActions["fileExportAsEPS"], "FileExport");
1297
        scrMenuMgr->addMenuItem(scrActions["fileExportAsPDF"], "FileExport");
1298
        scrMenuMgr->addMenuSeparator("File");
1299
        scrMenuMgr->addMenuItem(scrActions["fileDocInfo"], "File");
1300
        scrMenuMgr->addMenuItem(scrActions["fileDocSetup"], "File");
1301
        scrMenuMgr->addMenuItem(scrActions["filePrint"], "File");
1302
        scrMenuMgr->addMenuSeparator("File");
1303
        scrMenuMgr->addMenuItem(scrActions["fileQuit"], "File");
1304
 
1305
        scrActions["fileClose"]->setEnabled(false);    
1306
        scrActions["fileSave"]->setEnabled(false);
1307
        scrActions["fileSaveAs"]->setEnabled(false);
1308
        scrActions["fileRevert"]->setEnabled(false);
1309
        scrActions["fileCollect"]->setEnabled(false);
1310
        scrActions["fileImportText"]->setEnabled(false);
1311
        scrActions["fileImportImage"]->setEnabled(false);
1312
        scrActions["fileImportAppendText"]->setEnabled(false);
1313
        scrActions["fileImportPage"]->setEnabled(false);
1314
        scrActions["fileExportText"]->setEnabled(false);
1315
        scrActions["fileExportAsEPS"]->setEnabled(false);
1316
        scrActions["fileExportAsPDF"]->setEnabled(false);
1317
        scrMenuMgr->setMenuEnabled("FileExport", false);
1318
        scrActions["fileDocInfo"]->setEnabled(false);
1319
        scrActions["fileDocSetup"]->setEnabled(false);
1320
        scrActions["filePrint"]->setEnabled(false);
1321
 
1227 cbradney 1322
        scrMenuMgr->createMenu("Edit", tr("&Edit"));
1323
        scrMenuMgr->addMenuItem(scrActions["editUndoAction"], "Edit");
1324
        scrMenuMgr->addMenuItem(scrActions["editRedoAction"], "Edit");
1325
        scrMenuMgr->addMenuItem(scrActions["editActionMode"], "Edit");
1326
        scrMenuMgr->addMenuSeparator("Edit");
1327
        scrMenuMgr->addMenuItem(scrActions["editCut"], "Edit");
1328
        scrMenuMgr->addMenuItem(scrActions["editCopy"], "Edit");
1329
        scrMenuMgr->addMenuItem(scrActions["editPaste"], "Edit");
1330
        scrMenuMgr->addMenuItem(scrActions["editClear"], "Edit");
1331
        scrMenuMgr->addMenuItem(scrActions["editSelectAll"], "Edit");
1332
        scrMenuMgr->addMenuSeparator("Edit");
1333
        scrMenuMgr->addMenuItem(scrActions["editSearchReplace"], "Edit");
1334
        scrMenuMgr->addMenuSeparator("Edit");
1335
        scrMenuMgr->addMenuItem(scrActions["editColors"], "Edit");
1336
        scrMenuMgr->addMenuItem(scrActions["editParaStyles"], "Edit");
1337
        scrMenuMgr->addMenuItem(scrActions["editLineStyles"], "Edit");
1338
        scrMenuMgr->addMenuItem(scrActions["editTemplates"], "Edit");
1339
        scrMenuMgr->addMenuItem(scrActions["editJavascripts"], "Edit");
1340
        scrMenuMgr->addMenuSeparator("Edit");
1341
        scrMenuMgr->addMenuItem(scrActions["editPreferences"], "Edit");
1342
        scrMenuMgr->addMenuItem(scrActions["editFonts"], "Edit");
1343
 
1344
        scrActions["editUndoAction"]->setEnabled(false);
1345
        scrActions["editRedoAction"]->setEnabled(false);
1346
        scrActions["editActionMode"]->setEnabled(false);
1347
        scrActions["editCut"]->setEnabled(false);
1348
        scrActions["editCopy"]->setEnabled(false);
1349
        scrActions["editPaste"]->setEnabled(false);
1350
        scrActions["editClear"]->setEnabled(false);
1351
        scrActions["editSelectAll"]->setEnabled(false);
1352
        scrActions["editSearchReplace"]->setEnabled(false);
1353
        scrActions["editParaStyles"]->setEnabled(false);
1354
        scrActions["editLineStyles"]->setEnabled(false);
1355
        scrActions["editTemplates"]->setEnabled(false);
1356
        scrActions["editJavascripts"]->setEnabled(false);
1357
 
1358
        //Style Menu
3 paul 1359
        StilMenu = new QPopupMenu();
1236 cbradney 1360
 
1361
        //Item Menu
1362
        scrMenuMgr->createMenu("Item", tr("&Item"));
1363
        scrMenuMgr->addMenuItem(scrActions["itemDuplicate"], "Item");
1364
        scrMenuMgr->addMenuItem(scrActions["itemMulDuplicate"], "Item");
1365
        scrMenuMgr->addMenuItem(scrActions["itemDelete"], "Item");
1366
        scrMenuMgr->addMenuSeparator("Item");
1367
        scrMenuMgr->addMenuItem(scrActions["itemGroup"], "Item");
1368
        scrMenuMgr->addMenuItem(scrActions["itemUngroup"], "Item");
1369
        scrMenuMgr->addMenuItem(scrActions["itemLock"], "Item");
1370
        scrMenuMgr->addMenuSeparator("Item");
1371
        scrMenuMgr->addMenuItem(scrActions["itemSendToBack"], "Item");
1372
        scrMenuMgr->addMenuItem(scrActions["itemBringToFront"], "Item");
1373
        scrMenuMgr->addMenuItem(scrActions["itemLower"], "Item");
1374
        scrMenuMgr->addMenuItem(scrActions["itemRaise"], "Item");
1375
        scrMenuMgr->addMenuItem(scrActions["itemAlignDist"], "Item");
1376
        scrMenuMgr->addMenuSeparator("Item");
1377
        scrMenuMgr->createMenu("ItemShapes", tr("&Shape"), "Item");
1378
        // CB TODO
1379
        //Shape menu
169 Franz 1380
        SCustom = new Autoforms(0);
1236 cbradney 1381
        scrMenuMgr->addMenuItem(SCustom, "ItemShapes");
272 Franz 1382
        connect(SCustom, SIGNAL(FormSel(int, int, double *)), this, SLOT(MakeFrame(int, int, double *)));
1236 cbradney 1383
        scrMenuMgr->addMenuItem(scrActions["itemShapeEdit"], "ItemShapes");
1384
        scrMenuMgr->addMenuItem(scrActions["itemAttachTextToPath"], "Item");
1385
        scrMenuMgr->addMenuItem(scrActions["itemDetachTextFromPath"], "Item");
1386
        scrMenuMgr->addMenuItem(scrActions["itemCombinePolygons"], "Item");
1387
        scrMenuMgr->addMenuItem(scrActions["itemCombinePolygons"], "Item");
1388
        scrMenuMgr->addMenuItem(scrActions["itemSplitPolygons"], "Item");
1389
        scrMenuMgr->addMenuItem(scrActions["itemConvertToOutlines"], "Item");
1390
        scrMenuMgr->setMenuEnabled("ItemShapes", false);
1391
        scrActions["itemAlignDist"]->setEnabled(false);
1392
        scrActions["itemGroup"]->setEnabled(false);
1393
        scrActions["itemUngroup"]->setEnabled(false);
1394
        scrActions["itemAttachTextToPath"]->setEnabled(false);
1395
        scrActions["itemDetachTextFromPath"]->setEnabled(false);
1396
        scrActions["itemCombinePolygons"]->setEnabled(false);
1397
        scrActions["itemSplitPolygons"]->setEnabled(false);
1398
        scrActions["itemLock"]->setEnabled(false);
1399
        scrActions["itemConvertToOutlines"]->setEnabled(false);
1400
 
1401
        //Page menu
1402
        scrMenuMgr->createMenu("Page", tr("&Page"));
1403
        scrMenuMgr->addMenuItem(scrActions["pageInsert"], "Page");
1404
        scrMenuMgr->addMenuItem(scrActions["pageDelete"], "Page");
1405
        scrMenuMgr->addMenuItem(scrActions["pageCopy"], "Page");
1406
        scrMenuMgr->addMenuItem(scrActions["pageMove"], "Page");
1407
        scrMenuMgr->addMenuItem(scrActions["pageApplyTemplate"], "Page");
1408
        scrMenuMgr->addMenuItem(scrActions["pageManageGuides"], "Page");
1409
        scrActions["pageDelete"]->setEnabled(false);
1410
        scrActions["pageMove"]->setEnabled(false);
1411
 
1412
 
1413
        //View menu
1246 cbradney 1414
        scrMenuMgr->createMenu("View", tr("&View"));
1415
        scrMenuMgr->addMenuItem(scrActions["viewFitInWindow"], "View");
1416
        scrMenuMgr->addMenuItem(scrActions["viewFit50"], "View");
1417
        scrMenuMgr->addMenuItem(scrActions["viewFit75"], "View");
1418
        scrMenuMgr->addMenuItem(scrActions["viewFit100"], "View");
1419
        scrMenuMgr->addMenuItem(scrActions["viewFit200"], "View");
1420
        scrMenuMgr->addMenuItem(scrActions["viewFit20"], "View");
1421
        scrMenuMgr->addMenuSeparator("View");
1422
        scrMenuMgr->addMenuItem(scrActions["viewShowMargins"], "View");
1423
        scrMenuMgr->addMenuItem(scrActions["viewShowFrames"], "View");
1424
        scrMenuMgr->addMenuItem(scrActions["viewShowImages"], "View");
1425
        scrMenuMgr->addMenuItem(scrActions["viewShowGrid"], "View");
1426
        scrMenuMgr->addMenuItem(scrActions["viewShowGuides"], "View");
1427
        scrMenuMgr->addMenuItem(scrActions["viewShowBaselineGrid"], "View");
1428
        scrMenuMgr->addMenuItem(scrActions["viewShowTextChain"], "View");
1429
        scrMenuMgr->addMenuSeparator("View");
1430
        scrMenuMgr->addMenuItem(scrActions["viewSnapToGrid"], "View");
1431
        scrMenuMgr->addMenuItem(scrActions["viewSnapToGuides"], "View");
1236 cbradney 1432
 
1433
        //Tool menu
1255 cbradney 1434
        scrMenuMgr->createMenu("Tools", tr("&Tools"));
1435
        scrMenuMgr->addMenuItem(scrActions["toolsProperties"], "Tools");
1436
        scrMenuMgr->addMenuItem(scrActions["toolsOutline"], "Tools");
1437
        scrMenuMgr->addMenuItem(scrActions["toolsScrapbook"], "Tools");
1438
        scrMenuMgr->addMenuItem(scrActions["toolsLayers"], "Tools");
1439
        scrMenuMgr->addMenuItem(scrActions["toolsPages"], "Tools");
1440
        scrMenuMgr->addMenuItem(scrActions["toolsBookmarks"], "Tools");
1441
        scrMenuMgr->addMenuItem(scrActions["toolsActionHistory"], "Tools");
1442
        scrMenuMgr->addMenuItem(scrActions["toolsPreflightVerifier"], "Tools");
1443
        scrMenuMgr->addMenuSeparator("Tools");
1444
        scrMenuMgr->addMenuItem(scrActions["toolsToolbarTools"], "Tools");
1445
        scrMenuMgr->addMenuItem(scrActions["toolsToolbarPDF"], "Tools");
1236 cbradney 1446
 
1255 cbradney 1447
        scrActions["toolsPreflightVerifier"]->setEnabled(false);
1448
 
1236 cbradney 1449
        //Extra menu
3 paul 1450
        extraMenu=new QPopupMenu();
308 Franz 1451
        MenID = extraMenu->insertItem( tr("&Manage Pictures"), this, SLOT(StatusPic()));
3 paul 1452
        SetKeyEntry(51, tr("Manage Pictures"), MenID, 0);
308 Franz 1453
        hyph = extraMenu->insertItem( tr("&Hyphenate Text"), this, SLOT(doHyphenate()));
3 paul 1454
        extraMenu->setItemEnabled(hyph, 0);
1455
        SetKeyEntry(50, tr("Hyphenate Text"), hyph, 0);
1208 cbradney 1456
        M_ExtraCharSelect = extraMenu->insertItem( tr("Insert Special"), this, SLOT(slotCharSelect()));
1457
        extraMenu->setItemEnabled(M_ExtraCharSelect, 0);
284 Franz 1458
 
1236 cbradney 1459
        //Window menu
3 paul 1460
        windowsMenu = new QPopupMenu();
1461
        windowsMenu->setCheckable( true );
1462
        connect(windowsMenu, SIGNAL(aboutToShow()), this, SLOT(windowsMenuAboutToShow()));
1463
        helpMenu=new QPopupMenu();
308 Franz 1464
        MenID = helpMenu->insertItem( tr("&About Scribus"), this, SLOT(slotHelpAbout()));
3 paul 1465
        SetKeyEntry(52, tr("About Scribus"), MenID, 0);
308 Franz 1466
        MenID = helpMenu->insertItem( tr("About &Qt"), this, SLOT(slotHelpAboutQt()));
3 paul 1467
        SetKeyEntry(53, tr("About Qt"), MenID, 0);
1468
        helpMenu->insertSeparator();
800 fschmid 1469
        tip = helpMenu->insertItem( tr("Toolti&ps"), this, SLOT(ToggleTips()));
1470
        tipsOn = true;
1471
        helpMenu->setItemChecked(tip, tipsOn);
308 Franz 1472
        MenID = helpMenu->insertItem( tr("Scribus &Manual..."), this, SLOT(slotOnlineHelp()));
3 paul 1473
        SetKeyEntry(54, tr("Online-Help..."), MenID, 0);
456 fschmid 1474
 
1227 cbradney 1475
/*
1476
        editMenu->insertItem( tr("Test"), this, SLOT(slotTest()));
456 fschmid 1477
        editMenu->insertItem( tr("Test2"), this, SLOT(slotTest2()));
1478
*/
1208 cbradney 1479
 
1480
        scrMenuMgr->addMenuToMenuBar("File");
1227 cbradney 1481
        scrMenuMgr->addMenuToMenuBar("Edit");
308 Franz 1482
        Stm = menuBar()->insertItem( tr("St&yle"), StilMenu);
175 Franz 1483
        menuBar()->setItemEnabled(Stm, 0);
1236 cbradney 1484
        scrMenuMgr->addMenuToMenuBar("Item");
1485
        scrMenuMgr->addMenuToMenuBar("Page");
1486
        scrMenuMgr->setMenuEnabled("Item", false);
1487
        scrMenuMgr->setMenuEnabled("Page", false);
1246 cbradney 1488
        scrMenuMgr->addMenuToMenuBar("View");
1489
        scrMenuMgr->setMenuEnabled("View", false);
1255 cbradney 1490
        scrMenuMgr->addMenuToMenuBar("Tools");
238 Franz 1491
        exmn = menuBar()->insertItem( tr("E&xtras"), extraMenu);
3 paul 1492
        menuBar()->setItemEnabled(exmn, 0);
272 Franz 1493
        WinMen = menuBar()->insertItem( tr("&Windows"), windowsMenu );
1494
        menuBar()->setItemEnabled(WinMen, 0);
3 paul 1495
        menuBar()->insertSeparator();
237 Franz 1496
        menuBar()->insertItem( tr("&Help"), helpMenu);
1236 cbradney 1497
 
1498
        //Alignment menu
1208 cbradney 1499
        alignMenu = new QPopupMenu();
1500
        alignMenu->insertItem( tr("&Left"));
1501
        alignMenu->insertItem( tr("&Center"));
1502
        alignMenu->insertItem( tr("&Right"));
1503
        alignMenu->insertItem( tr("&Block"));
1504
        alignMenu->insertItem( tr("&Forced"));
1236 cbradney 1505
 
1506
        //Color menu
3 paul 1507
        ColorMenu = new QPopupMenu();
148 Franz 1508
        ColorMenC = new QComboBox(false);
1509
        ColorMenC->setEditable(false);
1510
        ColorMenu->insertItem(ColorMenC);
1236 cbradney 1511
 
1512
        //Text size menu
3 paul 1513
        SizeTMenu = new QPopupMenu();
308 Franz 1514
        SizeTMenu->insertItem( tr("&Other..."));
617 cbradney 1515
        QString ar_sizes[] = {" 7", " 9", "10", "11", "12", "14", "18", "24", "36", "48", "60", "72"};
274 Franz 1516
        size_t f_size = sizeof(ar_sizes) / sizeof(*ar_sizes);
1517
        for (uint s = 0; s < f_size; ++s)
1518
                SizeTMenu->insertItem(ar_sizes[s] + tr(" pt"));
1236 cbradney 1519
 
1520
        //Shade menu
3 paul 1521
        ShadeMenu = new QPopupMenu();
308 Franz 1522
        ShadeMenu->insertItem( tr("&Other..."));
3 paul 1523
        ShadeMenu->insertItem("0 %");
1524
        ShadeMenu->insertItem("10 %");
1525
        ShadeMenu->insertItem("20 %");
1526
        ShadeMenu->insertItem("30 %");
1527
        ShadeMenu->insertItem("40 %");
1528
        ShadeMenu->insertItem("50 %");
1529
        ShadeMenu->insertItem("60 %");
1530
        ShadeMenu->insertItem("70 %");
1531
        ShadeMenu->insertItem("80 %");
1532
        ShadeMenu->insertItem("90 %");
1533
        ShadeMenu->insertItem("100 %");
1236 cbradney 1534
 
1535
        //Font menu
3 paul 1536
        FontMenu = new QPopupMenu();
1236 cbradney 1537
 
1538
        //Type style menu
3 paul 1539
        TypeStyleMenu = new QPopupMenu();
112 Franz 1540
        TypeStyleMenu->insertItem( tr("Normal"));
3 paul 1541
        tmp = qApp->font();
1542
        tmp.setUnderline(true);
112 Franz 1543
        TypeStyleMenu->insertItem(new FmItem( tr("Underline"), tmp));
3 paul 1544
        tmp = qApp->font();
1545
        tmp.setStrikeOut(true);
112 Franz 1546
        TypeStyleMenu->insertItem(new FmItem( tr("Strikethru"), tmp));
1547
        TypeStyleMenu->insertItem( tr("Small Caps"));
1548
        TypeStyleMenu->insertItem( tr("Superscript"));
1549
        TypeStyleMenu->insertItem( tr("Subscript"));
1550
        TypeStyleMenu->insertItem( tr("Outlined"));
801 cbradney 1551
 
1247 tsoots 1552
        connect(undoManager, SIGNAL(newAction(UndoObject*, UndoState*)),
1114 tsoots 1553
                this, SLOT(refreshUndoRedoItems()));
1247 tsoots 1554
        connect(undoManager, SIGNAL(undoRedoDone()), this, SLOT(refreshUndoRedoItems()));
801 cbradney 1555
        connect(ColorMenC, SIGNAL(activated(int)), this, SLOT(setItemFarbe(int)));
1556
        connect(ShadeMenu, SIGNAL(activated(int)), this, SLOT(setItemShade(int)));
1557
        connect(FontMenu, SIGNAL(activated(int)), this, SLOT(setItemFont(int)));
1558
        connect(SizeTMenu, SIGNAL(activated(int)), this, SLOT(setItemFSize(int)));
1559
        connect(TypeStyleMenu, SIGNAL(activated(int)), this, SLOT(setItemTypeStyle(int)));
1208 cbradney 1560
        connect(alignMenu, SIGNAL(activated(int)), this, SLOT(setItemTextAli(int)));
3 paul 1561
}
1562
 
1563
void ScribusApp::initStatusBar()
1564
{
809 cbradney 1565
        FMess = new QLabel( "           ", statusBar(), "ft");
3 paul 1566
        FProg = new QProgressBar(statusBar(), "p");
272 Franz 1567
        FProg->setCenterIndicator(true);
3 paul 1568
        FProg->setFixedWidth( 100 );
809 cbradney 1569
        FProg->reset();
1570
        XMess = new QLabel( tr("X-Pos:"), statusBar(), "xt");
1571
        YMess = new QLabel( tr("Y-Pos:"), statusBar(), "yt");
1572
        XDat = new QLabel( "         ", statusBar(), "dt");
1573
        YDat = new QLabel( "         ", statusBar(), "ydt");
1574
 
1575
        statusBar()->addWidget(FMess, 3, true);
3 paul 1576
        statusBar()->addWidget(FProg, 0, true);
1577
        statusBar()->addWidget(XMess, 0, true);
1578
        statusBar()->addWidget(XDat, 1, true);
1579
        statusBar()->addWidget(YMess, 0, true);
1580
        statusBar()->addWidget(YDat, 1, true);
1581
}
1582
 
80 Franz 1583
void ScribusApp::ReportMP(double xp, double yp)
3 paul 1584
{
1065 cbradney 1585
        QString suffix=unitGetSuffixFromIndex(doc->docUnitIndex);
1586
        int multiplier=unitGetDecimalsFromIndex(doc->docUnitIndex);
806 cbradney 1587
        double divisor = static_cast<double>(multiplier);
1065 cbradney 1588
        int precision=precision = unitGetPrecisionFromIndex(doc->docUnitIndex);
809 cbradney 1589
        QString tmp;
806 cbradney 1590
        XDat->setText(tmp.setNum(qRound(xp*UmReFaktor * multiplier) / divisor, 'f', precision) + suffix);
1591
        YDat->setText(tmp.setNum(qRound(yp*UmReFaktor * multiplier) / divisor, 'f', precision) + suffix);
3 paul 1592
}
1593
 
1230 cbradney 1594
void ScribusApp::SetKeyEntry(int Nr, QString text, int Men, int KeyC, QString actName)
3 paul 1595
{
1596
        Keys ke;
1597
        ke.Name = text;
1598
        ke.MenuID = Men;
1599
        ke.KeyID = KeyC;
1230 cbradney 1600
        if (actName!="")
1601
        {
1602
                if (scrActions[actName])
1603
                        ke.actionName=actName;
1604
                else
1605
                        qDebug(QString("Action Name: %1 does not exist").arg(actName));
1606
        }
3 paul 1607
        Prefs.KeyActions.insert(Nr, ke);
1608
}
1609
 
1610
void ScribusApp::DeleteSel(PageItem *b)
1611
{
238 Franz 1612
        int FirstSel = 0;
1613
        bool first = false;
1065 cbradney 1614
        for (ScText *it = b->itemText.first(); it != 0; it = b->itemText.next())
272 Franz 1615
        {
1616
                if (it->cselect)
1617
                {
238 Franz 1618
                        first = true;
1065 cbradney 1619
                        b->itemText.remove();
1620
                        it = b->itemText.prev();
272 Franz 1621
                        if (it == 0)
1065 cbradney 1622
                                it = b->itemText.first();
272 Franz 1623
                }
238 Franz 1624
                if (!first)
1625
                        FirstSel++;
272 Franz 1626
        }
1065 cbradney 1627
        if (b->itemText.count() != 0)
238 Franz 1628
        {
1065 cbradney 1629
                if (b->itemText.first()->cselect)
3 paul 1630
                {
1065 cbradney 1631
                        b->itemText.remove();
3 paul 1632
                        b->CPos = 0;
238 Franz 1633
                }
3 paul 1634
                else
238 Franz 1635
                        b->CPos = FirstSel;
1636
        }
3 paul 1637
        else
1638
                b->CPos = 0;
272 Franz 1639
        b->HasSel = false;
1640
        DisableTxEdit();
3 paul 1641
}
1642
 
1643
void ScribusApp::setTBvals(PageItem *b)
1644
{
1065 cbradney 1645
        if (b->itemText.count() != 0)
272 Franz 1646
        {
1065 cbradney 1647
                int ChPos = QMIN(b->CPos, static_cast<int>(b->itemText.count()-1));
1648
                doc->CurrentStyle = b->itemText.at(ChPos)->cstyle & 127;
1649
                doc->currentParaStyle = b->itemText.at(ChPos)->cab;
1650
                setAbsValue(doc->currentParaStyle);
1651
                Mpal->setAli(doc->currentParaStyle);
1652
                doc->CurrFont = b->itemText.at(ChPos)->cfont;
1653
                doc->CurrFontSize = b->itemText.at(ChPos)->csize;
1654
                doc->CurrTextFill = b->itemText.at(ChPos)->ccolor;
1655
                doc->CurrTextFillSh = b->itemText.at(ChPos)->cshade;
1656
                doc->CurrTextStroke = b->itemText.at(ChPos)->cstroke;
1657
                doc->CurrTextStrokeSh = b->itemText.at(ChPos)->cshade2;
1658
                doc->CurrTextScale = b->itemText.at(ChPos)->cscale;
68 Franz 1659
                emit TextFarben(doc->CurrTextStroke, doc->CurrTextFill, doc->CurrTextStrokeSh, doc->CurrTextFillSh);
1660
                emit TextIFont(doc->CurrFont);
272 Franz 1661
                emit TextISize(doc->CurrFontSize);
1065 cbradney 1662
                emit TextUSval(b->itemText.at(ChPos)->cextra);
272 Franz 1663
                emit TextStil(doc->CurrentStyle);
68 Franz 1664
                emit TextScale(doc->CurrTextScale);
272 Franz 1665
        }
3 paul 1666
}
1667
 
1668
void ScribusApp::wheelEvent(QWheelEvent *w)
1669
{
1670
        if (HaveDoc)
239 Franz 1671
        {
276 Franz 1672
                if ((w->orientation() != Qt::Vertical) || ( w->state() & ShiftButton ))
3 paul 1673
                {
239 Franz 1674
                        if (w->delta() < 0)
240 Franz 1675
                                view->scrollBy(Prefs.Wheelval, 0);
239 Franz 1676
                        else
240 Franz 1677
                                view->scrollBy(-Prefs.Wheelval, 0);
239 Franz 1678
                }
3 paul 1679
                else
239 Franz 1680
                {
1681
                        if (w->delta() < 0)
240 Franz 1682
                                view->scrollBy(0, Prefs.Wheelval);
239 Franz 1683
                        else
240 Franz 1684
                                view->scrollBy(0, -Prefs.Wheelval);
239 Franz 1685
                }
3 paul 1686
                w->accept();
239 Franz 1687
        }
3 paul 1688
}
1689
 
1690
void ScribusApp::keyPressEvent(QKeyEvent *k)
1691
{
146 Franz 1692
        QWidgetList windows;
237 Franz 1693
        QWidget* w = NULL;
1065 cbradney 1694
        struct ScText *hg;
3 paul 1695
        int kk = k->key();
1696
        int as = k->ascii();
80 Franz 1697
        double altx, alty;
3 paul 1698
        QString uc = k->text();
1699
        QString cr, Tcha, Twort;
1700
        uint Tcoun;
237 Franz 1701
        int len, pos, c;
92 Franz 1702
        if (keyrep)
1703
                return;
1704
        keyrep = true;
3 paul 1705
        switch (k->state())
272 Franz 1706
        {
1707
        case ShiftButton:
1708
                KeyMod = 0x00200000;
1709
                break;
1710
        case AltButton:
1711
                KeyMod = 0x00800000;
1712
                break;
1713
        case ControlButton:
1714
                KeyMod = 0x00400000;
1715
                break;
1716
        default:
1717
                KeyMod = 0;
1718
                break;
1719
        }
276 Franz 1720
        if (kk == Key_F10)
1721
        {
1722
                keyrep = false;
1723
                ToggleAllPalettes();
1724
                return;
1725
        }
1726
        if ((kk == Key_F11) && (HaveDoc))
1727
        {
1728
                keyrep = false;
1729
                ToggleAllGuides();
1730
                return;
1731
        }
292 Franz 1732
        if ((kk == Key_Escape) && (HaveDoc))
1733
        {
1734
                keyrep = false;
855 fschmid 1735
                PageItem *b;
1736
                if ((view->SelItem.count() != 0))
1737
                {
1738
                        b = view->SelItem.at(0);
1065 cbradney 1739
                        switch (doc->appMode)
855 fschmid 1740
                        {
1065 cbradney 1741
                                case NormalMode:
855 fschmid 1742
                                        b->Sizing = false;
1743
                                        if (doc->SubMode != -1)
1744
                                        {
1745
                                                view->Deselect(false);
1746
//                                              if (!doc->TemplateMode)
1065 cbradney 1747
//                                                      Tpal->slotRemoveElement(doc->currentPage->PageNr, b->ItemNr);
855 fschmid 1748
                                                doc->Items.remove(b->ItemNr);
1749
                                        }
1750
                                        break;
1229 fschmid 1751
                                case LinkFrames:
1752
                                case UnlinkFrames:
1065 cbradney 1753
                                case EditMode:
855 fschmid 1754
                                        break;
1065 cbradney 1755
                                case DrawBezierLine:
855 fschmid 1756
                                        b->PoLine.resize(b->PoLine.size()-2);
1757
                                        if (b->PoLine.size() < 4)
1758
                                        {
1759
                                                view->Deselect(false);
1760
//                                              if (!doc->TemplateMode)
1065 cbradney 1761
//                                                      Tpal->slotRemoveElement(doc->currentPage->PageNr, b->ItemNr);
855 fschmid 1762
                                                doc->Items.remove(b->ItemNr);
1763
                                        }
1764
                                        else
1765
                                        {
1766
                                                view->SizeItem(b->PoLine.WidthHeight().x(), b->PoLine.WidthHeight().y(), b->ItemNr, false, false);
1767
                                                view->SetPolyClip(b, qRound(QMAX(b->Pwidth / 2, 1)));
1768
                                                view->AdjustItemSize(b);
1769
                                                b->ContourLine = b->PoLine.copy();
1770
                                                b->ClipEdited = true;
1771
                                                b->FrameType = 3;
1772
                                                slotDocCh();
1773
                                        }
1774
                                        view->FirstPoly = true;
1775
                                        break;
1776
                                default:
1777
                                        view->Deselect(false);
1778
//                                      if (!doc->TemplateMode)
1065 cbradney 1779
//                                              Tpal->slotRemoveElement(doc->currentPage->PageNr, b->ItemNr);
855 fschmid 1780
                                        doc->Items.remove(b->ItemNr);
1781
                                        break;
1782
                        }
1783
                }
1784
                view->Mpressed = false;
1785
                doc->DragP = false;
1786
                doc->leaveDrag = false;
1787
                view->Imoved = false;
1788
                view->mCG = false;
1789
                view->MidButt = false;
1790
                doc->SubMode = -1;
292 Franz 1791
                NoFrameEdit();
1792
                slotSelect();
1793
                return;
1794
        }
232 Franz 1795
        ButtonState buttonState = k->state();
272 Franz 1796
        if ((HaveDoc) && (!view->LE->hasFocus()) && (!view->PGS->PageCombo->hasFocus()))
1797
        {
1065 cbradney 1798
                if ((doc->appMode != EditMode) && (view->SelItem.count() == 0))
272 Franz 1799
                {
1800
                        switch (kk)
146 Franz 1801
                        {
272 Franz 1802
                        case Key_Space:
1803
                                keyrep = false;
1065 cbradney 1804
                                if (doc->appMode == PanningMode)
1805
                                        setAppMode(NormalMode);
272 Franz 1806
                                else
1807
                                {
1065 cbradney 1808
                                        setAppMode(PanningMode);
272 Franz 1809
                                        qApp->setOverrideCursor(QCursor(loadIcon("HandC.xpm")), true);
1810
                                }
1811
                                return;
1812
                                break;
1813
                        case Key_Prior:
1814
                                view->scrollBy(0, -Prefs.Wheelval);
1815
                                keyrep = false;
1816
                                return;
1817
                                break;
1818
                        case Key_Next:
1819
                                view->scrollBy(0, Prefs.Wheelval);
1820
                                keyrep = false;
1821
                                return;
1822
                                break;
1823
                        case Key_Tab:
1824
                                keyrep = false;
1825
                                windows = wsp->windowList();
1826
                                if (windows.count() > 1)
1827
                                {
1828
                                        for (int i = 0; i < static_cast<int>(windows.count()); ++i)
250 Franz 1829
                                        {
272 Franz 1830
                                                if (wsp->activeWindow() == windows.at(i))
1831
                                                {
1832
                                                        if (i == static_cast<int>(windows.count()-1))
1833
                                                                w = windows.at(0);
1834
                                                        else
1835
                                                                w = windows.at(i+1);
1836
                                                        break;
1837
                                                }
250 Franz 1838
                                        }
272 Franz 1839
                                        doc->OpenNodes = Tpal->buildReopenVals();
1232 fschmid 1840
                                        docChecker->clearErrorList();
272 Franz 1841
                                        if ( w )
1842
                                                w->showNormal();
1843
                                        newActWin(w);
1844
                                }
1845
                                return;
1846
                                break;
1847
                        }
1848
                }
456 fschmid 1849
                if (view->SelItem.count() != 0)
272 Franz 1850
                {
456 fschmid 1851
                        PageItem *b = view->SelItem.at(0);
358 Franz 1852
                        if (kk == Key_F9)
1853
                        {
1854
                                keyrep = false;
1065 cbradney 1855
                                if (doc->appMode == EditMode)
1856
                                        setAppMode(NormalMode);
358 Franz 1857
                                else
1065 cbradney 1858
                                        setAppMode(EditMode);
358 Franz 1859
                                return;
1860
                        }
1065 cbradney 1861
                        switch (doc->appMode)
272 Franz 1862
                        {
1065 cbradney 1863
                        case NormalMode:
272 Franz 1864
                                switch (kk)
1865
                                {
360 Franz 1866
                                case Key_Backspace:
272 Franz 1867
                                case Key_Delete:
1868
                                        if (!doc->EditClip)
997 fschmid 1869
                                                view->DeleteItem();
272 Franz 1870
                                        break;
360 Franz 1871
                                case Key_Prior:
1872
                                        if (!b->Locked)
456 fschmid 1873
                                                view->RaiseItem();
360 Franz 1874
                                        break;
1875
                                case Key_Next:
1876
                                        if (!b->Locked)
456 fschmid 1877
                                                view->LowerItem();
360 Franz 1878
                                        break;
272 Franz 1879
                                case Key_Left:
1880
                                        if (!b->Locked)
1881
                                        {
1882
                                                if ( buttonState & ShiftButton )
456 fschmid 1883
                                                        view->moveGroup(-10, 0);
272 Franz 1884
                                                else if ( buttonState & ControlButton )
456 fschmid 1885
                                                        view->moveGroup(-0.1, 0);
272 Franz 1886
                                                else
456 fschmid 1887
                                                        view->moveGroup(-1, 0);
272 Franz 1888
                                        }
1889
                                        break;
1890
                                case Key_Right:
1891
                                        if (!b->Locked)
1892
                                        {
1893
                                                if ( buttonState & ShiftButton )
456 fschmid 1894
                                                        view->moveGroup(10, 0);
272 Franz 1895
                                                else if ( buttonState & ControlButton )
456 fschmid 1896
                                                        view->moveGroup(0.1, 0);
272 Franz 1897
                                                else
456 fschmid 1898
                                                        view->moveGroup(1, 0);
272 Franz 1899
                                        }
1900
                                        break;
1901
                                case Key_Up:
1902
                                        if (!b->Locked)
1903
                                        {
1904
                                                if ( buttonState & ShiftButton )
456 fschmid 1905
                                                        view->moveGroup(0, -10);
272 Franz 1906
                                                else if ( buttonState & ControlButton )
456 fschmid 1907
                                                        view->moveGroup(0, -0.1);
272 Franz 1908
                                                else
456 fschmid 1909
                                                        view->moveGroup(0, -1);
272 Franz 1910
                                        }
1911
                                        break;
1912
                                case Key_Down:
1913
                                        if (!b->Locked)
1914
                                        {
1915
                                                if ( buttonState & ShiftButton )
456 fschmid 1916
                                                        view->moveGroup(0, 10);
272 Franz 1917
                                                else if ( buttonState & ControlButton )
456 fschmid 1918
                                                        view->moveGroup(0, 0.1);
272 Franz 1919
                                                else
456 fschmid 1920