r19009 by craig - Rearrange the Status bar, and move the view items like colour mgmt, color blindness and preview to a new toolbar to save status bar space
scribus-commit
scribus-commit at lists.scribus.net
Sat Apr 5 21:35:37 UTC 2014
Author: craig
Date: Sat Apr 5 21:35:36 2014
New Revision: 19009
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19009
Log:
Rearrange the Status bar, and move the view items like colour mgmt, color blindness and preview to a new toolbar to save status bar space
Modified:
trunk/Scribus/scribus/CMakeLists.txt
trunk/Scribus/scribus/actionmanager.cpp
trunk/Scribus/scribus/appmodehelper.cpp
trunk/Scribus/scribus/scraction.cpp
trunk/Scribus/scribus/scribus.cpp
trunk/Scribus/scribus/scribus.h
trunk/Scribus/scribus/scribusdoc.cpp
trunk/Scribus/scribus/scribusdoc.h
trunk/Scribus/scribus/scribusview.cpp
trunk/Scribus/scribus/scribusview.h
trunk/Scribus/scribus/ui/pageselector.cpp
Modified: trunk/Scribus/scribus/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19009&path=/trunk/Scribus/scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/CMakeLists.txt (original)
+++ trunk/Scribus/scribus/CMakeLists.txt Sat Apr 5 21:35:36 2014
@@ -491,6 +491,7 @@
ui/filetoolbar.h
ui/modetoolbar.h
ui/pdftoolbar.h
+ ui/viewtoolbar.h
ui/unicodesearch.h
ui/useprintermarginsdialog.h
ui/vruler.h
@@ -946,6 +947,7 @@
ui/helpnavigation.cpp
ui/modetoolbar.cpp
ui/pdftoolbar.cpp
+ ui/viewtoolbar.cpp
ui/unicodesearch.cpp
ui/vruler.cpp
ui/useprintermarginsdialog.cpp
Modified: trunk/Scribus/scribus/actionmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19009&path=/trunk/Scribus/scribus/actionmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/actionmanager.cpp (original)
+++ trunk/Scribus/scribus/actionmanager.cpp Sat Apr 5 21:35:36 2014
@@ -644,7 +644,11 @@
name="viewFit400";
scrActions->insert(name, new ScrAction(ScrAction::DataDouble, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 0, 400.0));
name="viewPreviewMode";
- scrActions->insert(name, new ScrAction(ScrAction::DataDouble, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 0, 20.0));
+ scrActions->insert(name, new ScrAction(loadIcon("previewOn.png"), loadIcon("previewOn.png"), "", defaultKey(name), mainWindow));
+ name="viewEditInPreview";
+ scrActions->insert(name, new ScrAction(loadIcon("16/editdoc.png"), loadIcon("16/editdoc.png"), "", defaultKey(name), mainWindow));
+ name="viewToggleCMS";
+ scrActions->insert(name, new ScrAction(loadIcon("cmsOn.png"), loadIcon("cmsOn.png"), "", defaultKey(name), mainWindow));
name="viewShowMargins";
scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
name="viewShowBleeds";
@@ -681,9 +685,20 @@
scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
name="showMouseCoordinates";
scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
+
+ name="viewToggleCM";
+ scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
+// name="viewVisionNormal";
+// name="viewVisionProtanopia";
+// name="viewVisionDeuteranopia";
+// name="viewVisionTritanopia";
+// name="viewVisionFullColorBlind";
+
// scrActions->insert("viewNewView", new ScrAction("", defaultKey(name), mainWindow));
(*scrActions)["viewPreviewMode"]->setToggleAction(true);
+ (*scrActions)["viewEditInPreview"]->setToggleAction(true);
+ (*scrActions)["viewToggleCMS"]->setToggleAction(true);
(*scrActions)["viewShowMargins"]->setToggleAction(true);
(*scrActions)["viewShowBleeds"]->setToggleAction(true);
(*scrActions)["viewShowFrames"]->setToggleAction(true);
@@ -703,6 +718,8 @@
(*scrActions)["showMouseCoordinates"]->setToggleAction(true);
(*scrActions)["viewPreviewMode"]->setChecked(false);
+ (*scrActions)["viewEditInPreview"]->setChecked(false);
+ (*scrActions)["viewToggleCMS"]->setChecked(false);
(*scrActions)["viewShowMargins"]->setChecked(true);
(*scrActions)["viewShowBleeds"]->setChecked(true);
(*scrActions)["viewShowFrames"]->setChecked(true);
@@ -773,6 +790,8 @@
name="toolsToolbarTools";
scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
name="toolsToolbarPDF";
+ scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
+ name="toolsToolbarView";
scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
//toolbar only items
@@ -875,6 +894,7 @@
(*scrActions)["toolsInline"]->setToggleAction(true);
(*scrActions)["toolsToolbarTools"]->setToggleAction(true);
(*scrActions)["toolsToolbarPDF"]->setToggleAction(true);
+ (*scrActions)["toolsToolbarView"]->setToggleAction(true);
*modeActionNames << "toolsSelect" << "toolsInsertTextFrame" << "toolsInsertImageFrame" << "toolsInsertTable";
*modeActionNames << "toolsInsertShape" << "toolsInsertPolygon" << "toolsInsertArc" << "toolsInsertSpiral" << "toolsInsertLine" << "toolsInsertBezier";
@@ -1127,10 +1147,8 @@
QString name;
//GUI
name="specialToggleAllPalettes";
-// scrActions->insert(name, new ScrAction(ScrAction::DataQString, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 0,0.0,name));
scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
name="specialToggleAllGuides";
-// scrActions->insert(name, new ScrAction(ScrAction::DataQString, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, 0,0.0,name));
scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
name="specialUnicodeSequenceBegin";
scrActions->insert(name, new ScrAction( "", defaultKey(name), mainWindow));
@@ -1238,7 +1256,10 @@
void ActionManager::disconnectNewViewActions()
{
+ //qDebug()<<"disconnectNewViewActions"<<mainWindow->doc->DocName;
disconnect( (*scrActions)["viewPreviewMode"], 0, 0, 0);
+ disconnect( (*scrActions)["viewEditInPreview"], 0, 0, 0);
+ disconnect( (*scrActions)["viewToggleCMS"], 0, 0, 0);
disconnect( (*scrActions)["toolsZoomIn"], 0, 0, 0);
disconnect( (*scrActions)["toolsZoomOut"], 0, 0, 0);
disconnect( (*scrActions)["itemImageIsVisible"], 0, 0, 0);
@@ -1252,14 +1273,17 @@
disconnect( (*scrActions)["itemConvertToTextFrame"], 0, 0, 0);
disconnect( (*scrActions)["itemAttachTextToPath"], 0, 0, 0);
disconnect( (*scrActions)["itemDetachTextFromPath"], 0, 0, 0);
- disconnect( (*scrActions)["itemExtendedImageProperties"], 0, 0, 0 );
+ disconnect( (*scrActions)["itemExtendedImageProperties"], 0, 0, 0);
}
void ActionManager::connectNewViewActions(ScribusView *currView)
{
if (currView==NULL)
return;
- connect( (*scrActions)["viewPreviewMode"], SIGNAL(triggered()), currView, SLOT(togglePreview()) );
+ //qDebug()<<"connectNewViewActions"<<currView->Doc->DocName;
+ connect( (*scrActions)["viewPreviewMode"], SIGNAL(toggled(bool)), currView, SLOT(togglePreview(bool)) );
+ connect( (*scrActions)["viewEditInPreview"], SIGNAL(toggled(bool)), currView, SLOT(togglePreviewEdit(bool)) );
+ connect( (*scrActions)["viewToggleCMS"], SIGNAL(toggled(bool)), currView, SLOT(toggleCMS(bool)));
connect( (*scrActions)["toolsZoomIn"], SIGNAL(triggered()) , currView, SLOT(slotZoomIn()) );
connect( (*scrActions)["toolsZoomOut"], SIGNAL(triggered()) , currView, SLOT(slotZoomOut()) );
connect( (*scrActions)["itemConvertToBezierCurve"], SIGNAL(triggered()), currView, SLOT(ToBezierFrame()) );
@@ -1591,6 +1615,8 @@
(*scrActions)["viewFit200"]->setTexts( tr("&200%"));
(*scrActions)["viewFit400"]->setTexts( tr("&400%"));
(*scrActions)["viewPreviewMode"]->setTexts( tr("Preview Mode"));
+ (*scrActions)["viewEditInPreview"]->setTexts( tr("Edit in Preview Mode") );
+ (*scrActions)["viewToggleCMS"]->setTexts( tr("Toggle Color Management System"));
(*scrActions)["viewShowMargins"]->setTexts( tr("Show &Margins"));
(*scrActions)["viewShowBleeds"]->setTexts( tr("Show Bleeds"));
(*scrActions)["viewShowFrames"]->setTexts( tr("Show &Frames"));
@@ -1625,6 +1651,7 @@
(*scrActions)["toolsInline"]->setTexts( tr("Inline Frames"));
(*scrActions)["toolsToolbarTools"]->setTexts( tr("&Tools"));
(*scrActions)["toolsToolbarPDF"]->setTexts( tr("P&DF Tools"));
+ (*scrActions)["toolsToolbarView"]->setTexts( tr("&View Tools"));
//toolbar only items
(*scrActions)["toolsSelect"]->setTexts( tr("Select Item"));
@@ -2222,6 +2249,8 @@
<< "viewFit200"
<< "viewFit400"
<< "viewPreviewMode"
+ << "viewEditInPreview"
+ << "viewToggleCMS"
<< "viewShowMargins"
<< "viewShowBleeds"
<< "viewShowFrames"
@@ -2276,7 +2305,8 @@
<< "toolsSymbols"
<< "toolsInline"
<< "toolsToolbarTools"
- << "toolsToolbarPDF";
+ << "toolsToolbarPDF"
+ << "toolsToolbarView";
//Help
++itmenu;
itmenu->second
Modified: trunk/Scribus/scribus/appmodehelper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19009&path=/trunk/Scribus/scribus/appmodehelper.cpp
==============================================================================
--- trunk/Scribus/scribus/appmodehelper.cpp (original)
+++ trunk/Scribus/scribus/appmodehelper.cpp Sat Apr 5 21:35:36 2014
@@ -519,7 +519,6 @@
void AppModeHelper::setPreviewMode(bool b)
{
bool b2=!b;
- (*scrActions)["viewPreviewMode"]->setChecked(b);
(*scrActions)["viewShowMargins"]->setEnabled(b2);
(*scrActions)["viewShowFrames"]->setEnabled(b2);
(*scrActions)["viewShowLayerMarkers"]->setEnabled(b2);
Modified: trunk/Scribus/scribus/scraction.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19009&path=/trunk/Scribus/scribus/scraction.cpp
==============================================================================
--- trunk/Scribus/scribus/scraction.cpp (original)
+++ trunk/Scribus/scribus/scraction.cpp Sat Apr 5 21:35:36 2014
@@ -251,9 +251,12 @@
{
QString sct(shortcut().toString());
if (sct.isEmpty())
- QAction::setStatusTip("<qt>" + statusText + "</qt>");
+ QAction::setStatusTip(statusText);
else
- QAction::setStatusTip("<qt>" + statusText + " (" + sct + ")" + "</qt>");
+ QAction::setStatusTip(statusText + " (" + sct + ")");
+ // QAction::setStatusTip("<qt>" + statusText + "</qt>");
+ //else
+ // QAction::setStatusTip("<qt>" + statusText + " (" + sct + ")" + "</qt>");
}
int ScrAction::getMenuIndex() const
Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19009&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Sat Apr 5 21:35:36 2014
@@ -246,6 +246,7 @@
#include "ui/filetoolbar.h"
#include "ui/modetoolbar.h"
#include "ui/pdftoolbar.h"
+#include "ui/viewtoolbar.h"
#include "undogui.h"
#include "undomanager.h"
#include "undostate.h"
@@ -404,7 +405,7 @@
prefsManager->setupMainWindow(this);
- previewQualitySwitcher->setCurrentIndex(prefsManager->appPrefs.itemToolPrefs.imageLowResType);
+ viewToolBar->previewQualitySwitcher->setCurrentIndex(prefsManager->appPrefs.itemToolPrefs.imageLowResType);
if (primaryMainWindow)
ScCore->setSplashStatus( tr("Initializing Story Editor") );
storyEditor = new StoryEditor(this);
@@ -486,15 +487,19 @@
undoManager->registerGui(uWidget);
modeToolBar = new ModeToolBar(this);
pdfToolBar = new PDFToolBar(this);
+ viewToolBar = new ViewToolBar(this);
addScToolBar(fileToolBar, fileToolBar->objectName());
addScToolBar(editToolBar, editToolBar->objectName());
addScToolBar(modeToolBar, modeToolBar->objectName());
addScToolBar(pdfToolBar, pdfToolBar->objectName());
+ addScToolBar(viewToolBar, viewToolBar->objectName());
connect(modeToolBar, SIGNAL(visibilityChanged(bool)), scrActions["toolsToolbarTools"], SLOT(setChecked(bool)));
connect(scrActions["toolsToolbarPDF"], SIGNAL(toggled(bool)), pdfToolBar, SLOT(setVisible(bool)));
connect(pdfToolBar, SIGNAL(visibilityChanged(bool)), scrActions["toolsToolbarPDF"], SLOT(setChecked(bool)));
connect(scrActions["toolsToolbarTools"], SIGNAL(toggled(bool)), modeToolBar, SLOT(setVisible(bool)) );
+ connect(viewToolBar, SIGNAL(visibilityChanged(bool)), scrActions["toolsToolbarView"], SLOT(setChecked(bool)));
+ connect(scrActions["toolsToolbarView"], SIGNAL(toggled(bool)), viewToolBar, SLOT(setVisible(bool)) );
}
@@ -1160,6 +1165,7 @@
scrMenuMgr->addMenuItemString("SEPARATOR", "Windows");
scrMenuMgr->addMenuItemString("toolsToolbarTools", "Windows");
scrMenuMgr->addMenuItemString("toolsToolbarPDF", "Windows");
+ scrMenuMgr->addMenuItemString("toolsToolbarView", "Windows");
scrMenuMgr->addMenuItemStringstoMenuBar("Windows", scrActions);
}
@@ -1187,11 +1193,6 @@
layerMenu->setFont(fo);
layerMenu->setFocusPolicy(Qt::NoFocus);
layerMenu->setSizeAdjustPolicy(QComboBox::AdjustToContents);
- visualMenu = new QComboBox( this );
- visualMenu->setFocusPolicy(Qt::NoFocus);
- visualMenu->setFont(fo);
- visualMenu->setEnabled(false);
- visualMenu->setSizeAdjustPolicy(QComboBox::AdjustToContents);
pageSelector = new PageSelector(this, 1);
pageSelector->setFont(fo);
@@ -1206,27 +1207,6 @@
zoomInToolbarButton->setAutoRaise(OPTION_FLAT_BUTTON);
zoomInToolbarButton->setDefaultAction(scrActions["toolsZoomIn"]);
zoomOutToolbarButton->setDefaultAction(scrActions["toolsZoomOut"]);
- cmsToolbarButton = new QToolButton(this);
- previewToolbarButton = new QToolButton(this);
- cmsToolbarButton->setAutoRaise(OPTION_FLAT_BUTTON);
- cmsToolbarButton->setCheckable(true);
- QIcon ic2;
- ic2.addPixmap(loadIcon("cmsOff.png"), QIcon::Normal, QIcon::Off);
- ic2.addPixmap(loadIcon("cmsOn.png"), QIcon::Normal, QIcon::On);
- cmsToolbarButton->setIcon(ic2);
- previewToolbarButton->setAutoRaise(OPTION_FLAT_BUTTON);
- previewToolbarButton->setCheckable(true);
- QIcon ic;
- ic.addPixmap(loadIcon("previewOff.png"), QIcon::Normal, QIcon::Off);
- ic.addPixmap(loadIcon("previewOn.png"), QIcon::Normal, QIcon::On);
- previewToolbarButton->setIcon(ic);
- editOnPreviewToolbarButton = new QToolButton(this);
- editOnPreviewToolbarButton->setAutoRaise(OPTION_FLAT_BUTTON);
- editOnPreviewToolbarButton->setCheckable(true);
- QIcon ic3;
- ic3.addPixmap(loadIcon("16/editdoc.png"), QIcon::Normal, QIcon::Off);
- ic3.addPixmap(loadIcon("16/editdoc.png"), QIcon::Normal, QIcon::On);
- editOnPreviewToolbarButton->setIcon(ic3);
#else
zoomDefaultToolbarButton = new QPushButton(this);
zoomDefaultToolbarButton->setFocusPolicy(Qt::NoFocus);
@@ -1243,42 +1223,16 @@
zoomInToolbarButton->setDefault( false );
zoomInToolbarButton->setAutoDefault( false );
zoomInToolbarButton->setFlat(OPTION_FLAT_BUTTON);
- zoomInToolbarButton->addAction(m_ScMW->scrActions["toolsZoomIn"]);
- zoomOutToolbarButton->addAction(m_ScMW->scrActions["toolsZoomOut"]);
- cmsToolbarButton = new QPushButton(this);
- cmsToolbarButton->setFocusPolicy(Qt::NoFocus);
- cmsToolbarButton->setDefault( false );
- cmsToolbarButton->setAutoDefault( false );
- cmsToolbarButton->setFlat(OPTION_FLAT_BUTTON);
- cmsToolbarButton->setIcon(loadIcon("cmsOn.png"));
- previewToolbarButton = new QPushButton(this);
- previewToolbarButton->setFocusPolicy(Qt::NoFocus);
- previewToolbarButton->setDefault( false );
- previewToolbarButton->setAutoDefault( false );
- previewToolbarButton->setFlat(OPTION_FLAT_BUTTON);
- previewToolbarButton->setIcon(loadIcon("previewOn.png"));
- editOnPreviewToolbarButton = new QPushButton(this);
- editOnPreviewToolbarButton->setFocusPolicy(Qt::NoFocus);
- editOnPreviewToolbarButton->setDefault( false );
- editOnPreviewToolbarButton->setAutoDefault( false );
- editOnPreviewToolbarButton->setFlat(OPTION_FLAT_BUTTON);
- editOnPreviewToolbarButton->setIcon(loadIcon("16/editdoc.png"));
+ zoomInToolbarButton->addAction(scrActions["toolsZoomIn"]);
+ zoomOutToolbarButton->addAction(scrActions["toolsZoomOut"]);
#endif
zoomDefaultToolbarButton->setIcon(QIcon(loadIcon("16/zoom-original.png")));
zoomOutToolbarButton->setIcon(QIcon(loadIcon("16/zoom-out.png")));
zoomInToolbarButton->setIcon(QIcon(loadIcon("16/zoom-in.png")));
- cmsAdjustMenu = new QMenu();
- idCmsAdjustMenu = cmsAdjustMenu->addAction( "Configure CMS...", this, SLOT(adjustCMS()));
- cmsToolbarButton->setMenu(cmsAdjustMenu);
-#if OPTION_USE_QTOOLBUTTON
- cmsToolbarButton->setPopupMode(QToolButton::DelayedPopup);
-#endif
- previewQualitySwitcher = new QComboBox( this );
- previewQualitySwitcher->setFocusPolicy(Qt::NoFocus);
- previewQualitySwitcher->setFont(fo);
- previewQualitySwitcher->addItem(tr("High"));
- previewQualitySwitcher->addItem(tr("Normal"));
- previewQualitySwitcher->addItem(tr("Low"));
+ zoomOutToolbarButton->resize(10,10);
+// cmsAdjustMenu = new QMenu();
+// idCmsAdjustMenu = cmsAdjustMenu->addAction( "Configure CMS...", this, SLOT(adjustCMS()));
+// cmsToolbarButton->setMenu(cmsAdjustMenu);
mainWindowStatusLabel = new QLabel( " ", statusBar());
@@ -1298,27 +1252,27 @@
statusBarLanguageChange();
- statusBar()->addPermanentWidget(unitSwitcher,0);
- statusBar()->addPermanentWidget(zoomSpinBox,0);
- statusBar()->addPermanentWidget(zoomOutToolbarButton,0);
- statusBar()->addPermanentWidget(zoomDefaultToolbarButton,0);
- statusBar()->addPermanentWidget(zoomInToolbarButton,0);
- statusBar()->addPermanentWidget(layerMenu,0);
- statusBar()->addPermanentWidget(pageSelector,0);
- statusBar()->addPermanentWidget(cmsToolbarButton,0);
- statusBar()->addPermanentWidget(editOnPreviewToolbarButton,0);
- statusBar()->addPermanentWidget(previewToolbarButton,0);
- statusBar()->addPermanentWidget(previewQualitySwitcher,0);
- statusBar()->addPermanentWidget(visualMenu,0);
- statusBar()->addPermanentWidget(mainWindowStatusLabel, 6);
- statusBar()->addPermanentWidget(mainWindowProgressBar, 0);
+
+ statusBar()->setFont(fo);
+ statusBar()->addPermanentWidget(mainWindowStatusLabel, 5);
+ QLabel *s=new QLabel("");
+ QLabel *s2=new QLabel("");
+ statusBar()->addPermanentWidget(s,1);
+ statusBar()->addPermanentWidget(zoomSpinBox,1);
+ statusBar()->addPermanentWidget(zoomOutToolbarButton,1);
+ statusBar()->addPermanentWidget(zoomDefaultToolbarButton,1);
+ statusBar()->addPermanentWidget(zoomInToolbarButton,1);
+ statusBar()->addPermanentWidget(pageSelector,1);
+ statusBar()->addPermanentWidget(layerMenu,1);
+ statusBar()->addPermanentWidget(s2,2);
statusBar()->addPermanentWidget(mainWindowXPosLabel, 0);
statusBar()->addPermanentWidget(mainWindowXPosDataLabel, 1);
statusBar()->addPermanentWidget(mainWindowYPosLabel, 0);
statusBar()->addPermanentWidget(mainWindowYPosDataLabel, 1);
+ statusBar()->addPermanentWidget(unitSwitcher,0);
+ statusBar()->addPermanentWidget(mainWindowProgressBar, 0);
connect(statusBar(), SIGNAL(messageChanged(const QString &)), this, SLOT(setTempStatusBarText(const QString &)));
- editOnPreviewToolbarButton->hide();
}
@@ -1335,8 +1289,8 @@
}
xn -= doc->rulerXoffset;
yn -= doc->rulerYoffset;
- mainWindowXPosDataLabel->setText(value2String(xn, doc->unitIndex(), true, true));
- mainWindowYPosDataLabel->setText(value2String(yn, doc->unitIndex(), true, true));
+ mainWindowXPosDataLabel->setText(value2String(xn, doc->unitIndex(), true, false));
+ mainWindowYPosDataLabel->setText(value2String(yn, doc->unitIndex(), true, false));
}
void ScribusMainWindow::setStatusBarTextPosition(double base, double xp)
@@ -2179,7 +2133,7 @@
tempView->setScale(prefsManager->displayScale());
if (requiresGUI)
{
- actionManager->connectNewViewActions(tempView);
+ //done in newactinw actionManager->connectNewViewActions(tempView);
alignDistributePalette->setDoc(tempDoc);
docCheckerPalette->clearErrorList();
symbolPalette->setDoc(tempDoc);
@@ -2221,8 +2175,7 @@
connect(ScCore->fileWatcher, SIGNAL(dirChanged(QString )), tempDoc, SLOT(updatePictDir(QString )));
connect(doc, SIGNAL(updateAutoSaveClock()), view->clockLabel, SLOT(resetTime()));
view->clockLabel->resetTime();
- //scrActions["fileSave"]->setEnabled(false);
- cmsToolbarButton->setChecked(tempDoc->HasCMS);
+ scrActions["viewToggleCMS"]->setChecked(tempDoc->HasCMS);
undoManager->switchStack(tempDoc->DocName);
styleManager->setDoc(tempDoc);
marksManager->setDoc(tempDoc);
@@ -2378,17 +2331,13 @@
disconnect(zoomOutToolbarButton, SIGNAL(clicked()), doc->view(), SLOT(slotZoomOut()));
disconnect(zoomInToolbarButton, SIGNAL(clicked()), doc->view(), SLOT(slotZoomIn()));
disconnect(layerMenu, SIGNAL(activated(int)), doc->view(), SLOT(GotoLa(int)));
- disconnect(previewToolbarButton, SIGNAL(clicked()), doc->view(), SLOT(togglePreview()));
- disconnect(editOnPreviewToolbarButton, SIGNAL(clicked()), doc->view(), SLOT(togglePreviewEdit()));
- disconnect(cmsToolbarButton, SIGNAL(clicked()), doc->view(), SLOT(toggleCMS()));
- disconnect(previewQualitySwitcher, SIGNAL(activated(int)), this, SLOT(changePreviewQuality(int)));
- disconnect(visualMenu, SIGNAL(activated(int)), doc->view(), SLOT(switchPreviewVisual(int)));
+ disconnect(viewToolBar->previewQualitySwitcher, SIGNAL(activated(int)), this, SLOT(changePreviewQuality(int)));
+ disconnect(viewToolBar->visualMenu, SIGNAL(activated(int)), doc->view(), SLOT(switchPreviewVisual(int)));
disconnect(pageSelector);
}
doc = ActWin->doc();
undoManager->switchStack(doc->DocName);
-
if ((doc != NULL) && doc->hasGUI())
{
@@ -2403,16 +2352,18 @@
connect(zoomOutToolbarButton, SIGNAL(clicked()), doc->view(), SLOT(slotZoomOut()));
connect(zoomInToolbarButton, SIGNAL(clicked()), doc->view(), SLOT(slotZoomIn()));
connect(layerMenu, SIGNAL(activated(int)), doc->view(), SLOT(GotoLa(int)));
- previewToolbarButton->setChecked(doc->drawAsPreview);
- visualMenu->setEnabled(doc->drawAsPreview);
- connect(previewToolbarButton, SIGNAL(clicked()), doc->view(), SLOT(togglePreview()));
- connect(editOnPreviewToolbarButton, SIGNAL(clicked()), doc->view(), SLOT(togglePreviewEdit()));
- cmsToolbarButton->setChecked(doc->HasCMS);
- connect(cmsToolbarButton, SIGNAL(clicked()), doc->view(), SLOT(toggleCMS()));
- previewQualitySwitcher->setCurrentIndex(doc->previewQuality);
- connect(previewQualitySwitcher, SIGNAL(activated(int)), this, SLOT(changePreviewQuality(int)));
- visualMenu->setCurrentIndex(doc->previewVisual);
- connect(visualMenu, SIGNAL(activated(int)), doc->view(), SLOT(switchPreviewVisual(int)));
+ scrActions["viewPreviewMode"]->blockSignals(true);
+ scrActions["viewPreviewMode"]->setChecked(doc->drawAsPreview);
+ scrActions["viewPreviewMode"]->blockSignals(false);
+ scrActions["viewEditInPreview"]->setEnabled(doc->drawAsPreview);
+ scrActions["viewToggleCMS"]->blockSignals(true);
+ scrActions["viewToggleCMS"]->setChecked(doc->HasCMS);
+ scrActions["viewToggleCMS"]->blockSignals(false);
+ viewToolBar->previewQualitySwitcher->setCurrentIndex(doc->previewQuality());
+ connect(viewToolBar->previewQualitySwitcher, SIGNAL(activated(int)), this, SLOT(changePreviewQuality(int)));
+ viewToolBar->visualMenu->setCurrentIndex(doc->previewVisual);
+ connect(viewToolBar->visualMenu, SIGNAL(activated(int)), doc->view(), SLOT(switchPreviewVisual(int)));
+ viewToolBar->setDoc(doc);
pageSelector->setMaximum(doc->masterPageMode() ? 1 : doc->Pages->count());
slotSetCurrentPage(doc->currentPageNumber());
connect(pageSelector, SIGNAL(GotoPage(int)), this, SLOT(setCurrentPage(int)));
@@ -4295,7 +4246,7 @@
doc->updateNumbers(true);
emit UpdateRequest(reqNumUpdate);
doc->setCurrentPage(doc->DocPages.at(0));
- cmsToolbarButton->setChecked(doc->HasCMS);
+ scrActions["viewToggleCMS"]->setChecked(doc->HasCMS);
view->zoom();
view->GotoPage(0);
connect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(newActWin(QMdiSubWindow *)));
@@ -4315,7 +4266,7 @@
doc->First = bookmarkPalette->BView->First;
doc->Last = bookmarkPalette->BView->Last;
if (doc->drawAsPreview)
- view->togglePreview();
+ view->togglePreview(true);
}
else
{
@@ -7478,9 +7429,7 @@
qApp->restoreOverrideCursor();
setStatusBarInfoText("");
mainWindowProgressBar->reset();
- previewQualitySwitcher->blockSignals(true);
- previewQualitySwitcher->setCurrentIndex(doc->itemToolPrefs().imageLowResType);
- previewQualitySwitcher->blockSignals(false);
+ viewToolBar->setDoc(doc);
}
if (oldDocPrefs.typoPrefs != newDocPrefs.typoPrefs)
{
@@ -7502,7 +7451,7 @@
scrActions["viewRulerMode"]->setChecked(doc->guidesPrefs().rulerMode);
scrActions["extrasGenerateTableOfContents"]->setEnabled(doc->hasTOCSetup());
scrActions["extrasUpdateDocument"]->setEnabled(true);
- cmsToolbarButton->setChecked(doc->HasCMS);
+ scrActions["viewToggleCMS"]->setChecked(doc->HasCMS);
//doc emits changed() via this
doc->setMasterPageMode(true);
view->reformPages();
@@ -8377,7 +8326,7 @@
scrMenuMgr->setMenuEnabled("FileOpenRecent", false);
scrActions["fileClose"]->setToolTip( tr("Click here to leave master page edit mode."));
scrActions["fileClose"]->setIcon(loadIcon("22/exit.png"));
- previewToolbarButton->setEnabled(false);
+ scrActions["viewPreviewMode"]->setEnabled(false);
}
void ScribusMainWindow::editMasterPagesEnd()
@@ -8395,8 +8344,8 @@
appModeHelper.setMasterPageEditMode(false, doc);
scrActions["fileClose"]->setToolTip( tr("Close"));
scrActions["fileClose"]->setIcon(loadIcon("22/close.png"));
+ scrActions["viewPreviewMode"]->setEnabled(true);
scrMenuMgr->setMenuEnabled("FileOpenRecent", true);
- previewToolbarButton->setEnabled(true);
uint pageCount=doc->DocPages.count();
for (uint c=0; c<pageCount; ++c)
Apply_MasterPage(doc->DocPages.at(c)->MPageNam, c, false);
@@ -9347,6 +9296,7 @@
if (undoManager!=NULL)
undoManager->languageChange();
statusBarLanguageChange();
+ viewToolBar->languageChange();
}
}
@@ -9358,28 +9308,11 @@
zoomInToolbarButton->setToolTip( tr("Zoom in by the stepping value in Tools preferences"));
layerMenu->setToolTip( tr("Select the current layer"));
unitSwitcher->setToolTip( tr("Select the current unit"));
- cmsToolbarButton->setToolTip( tr("Enable/disable Color Management"));
- idCmsAdjustMenu->setText( tr("Configure CMS..."));
- previewToolbarButton->setToolTip( tr("Enable/disable the Preview Mode"));
- editOnPreviewToolbarButton->setToolTip( tr("Enable/disable editing the Preview Mode"));
mainWindowXPosLabel->setText( tr("X:"));
mainWindowYPosLabel->setText( tr("Y:"));
mainWindowXPosDataLabel->setText(" ");
mainWindowYPosDataLabel->setText(" ");
mainWindowStatusLabel->setText( tr("Ready"));
-
- previewQualitySwitcher->setToolTip( tr("Select the image preview quality"));
- visualMenu->setToolTip( tr("Select the visual appearance of the display. You can choose between normal and several color blindness forms"));
-
- visualMenu->blockSignals(true);
- visualMenu->clear();
- visualMenu->addItem(CommonStrings::trVisionNormal);
- visualMenu->addItem(CommonStrings::trVisionProtanopia);
- visualMenu->addItem(CommonStrings::trVisionDeuteranopia);
- visualMenu->addItem(CommonStrings::trVisionTritanopia);
- visualMenu->addItem(CommonStrings::trVisionFullColorBlind);
- visualMenu->setCurrentIndex(0);
- visualMenu->blockSignals(false);
}
void ScribusMainWindow::setDefaultPrinter(const QString& name, const QString& file, const QString& command)
@@ -10910,6 +10843,7 @@
}
}
+/*
void ScribusMainWindow::adjustCMS()
{
if (!HaveDoc)
@@ -10928,10 +10862,10 @@
}
delete dia;
}
+*/
void ScribusMainWindow::changePreviewQuality(int index)
{
- doc->previewQuality=index;
doc->allItems_ChangePreviewResolution(index);
doc->view()->DrawNew();
}
Modified: trunk/Scribus/scribus/scribus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19009&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h (original)
+++ trunk/Scribus/scribus/scribus.h Sat Apr 5 21:35:36 2014
@@ -106,6 +106,7 @@
class UndoManager;
class UndoPalette;
class UndoState;
+class ViewToolBar;
extern SCRIBUS_API ScribusQApp* ScQApp;
@@ -213,26 +214,18 @@
QToolButton *zoomDefaultToolbarButton;
QToolButton *zoomOutToolbarButton;
QToolButton *zoomInToolbarButton;
- QToolButton *cmsToolbarButton;
- QToolButton *previewToolbarButton;
- QToolButton *editOnPreviewToolbarButton;
#else
QPushButton *zoomDefaultToolbarButton;
QPushButton *zoomOutToolbarButton;
QPushButton *zoomInToolbarButton;
- QPushButton *cmsToolbarButton;
- QPushButton *previewToolbarButton;
- QPushButton *editOnPreviewToolbarButton;
#endif
QComboBox *layerMenu; //Menu for layers at bottom of view
QComboBox *unitSwitcher; //Menu for units at bottom of view
- QComboBox *previewQualitySwitcher; //Menu for image preview quality
- QComboBox *visualMenu;
-
-
- QMenu *cmsAdjustMenu;
- QAction *idCmsAdjustMenu;
-
+ EditToolBar *editToolBar;
+ FileToolBar *fileToolBar;
+ ModeToolBar* modeToolBar;
+ PDFToolBar* pdfToolBar;
+ ViewToolBar* viewToolBar;
QLabel* mainWindowXPosLabel;
QLabel* mainWindowXPosDataLabel;
QLabel* mainWindowYPosLabel;
@@ -576,7 +569,7 @@
void testQT_slot2(double);
void testQT_slot3(int);
void testQT_slot4();
- void adjustCMS();
+ //void adjustCMS();
void changePreviewQuality(int index);
signals:
@@ -619,10 +612,7 @@
QLabel* mainWindowStatusLabel;
QString statusLabelText;
QPixmap noIcon;
- EditToolBar *editToolBar;
- FileToolBar *fileToolBar;
- ModeToolBar* modeToolBar;
- PDFToolBar* pdfToolBar;
+
QToolButton* DatOpe;
QToolButton* DatSav;
QToolButton* DatClo;
Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19009&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sat Apr 5 21:35:36 2014
@@ -293,8 +293,7 @@
drawAsPreview = false;
viewAsPreview = false;
editOnPreview = false;
- previewVisual = -1;
- previewQuality = 1;
+ previewVisual = 0;
dontResize = false;
//create default numeration
NumStruct * numS = new NumStruct;
@@ -415,8 +414,7 @@
drawAsPreview = false;
viewAsPreview = false;
editOnPreview = false;
- previewVisual = -1;
- previewQuality = 1;
+ previewVisual = 0;
dontResize = false;
currentEditedTextframe = NULL;
}
@@ -10599,6 +10597,11 @@
m_ScMW->mainWindowProgressBar->reset();
}
+int ScribusDoc::previewQuality()
+{
+ return itemToolPrefs().imageLowResType;
+}
+
void ScribusDoc::removePict(QString name)
{
Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19009&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h (original)
+++ trunk/Scribus/scribus/scribusdoc.h Sat Apr 5 21:35:36 2014
@@ -1126,6 +1126,7 @@
int m_lowResType;
};
void recalcPicturesRes(bool applyNewRes = false);
+ int previewQuality();
void connectDocSignals();
void disconnectDocSignals();
void removeLayer(int l, bool dl = false); //FIXME: Make protected once scripter function no longer uses this directly
@@ -1347,7 +1348,6 @@
bool viewAsPreview;
bool editOnPreview;
int previewVisual;
- int previewQuality;
struct OpenNodesList
{
int type;
Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19009&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Sat Apr 5 21:35:36 2014
@@ -116,6 +116,7 @@
#include "ui/scrapbookpalette.h"
#include "ui/storyeditor.h"
#include "ui/symbolpalette.h"
+#include "ui/viewtoolbar.h"
#include "ui/vruler.h"
#include "undomanager.h"
#include "units.h"
@@ -257,9 +258,9 @@
endEditButton->setToolTip( tr("Click here to leave this special edit mode."));
}
-void ScribusView::toggleCMS()
-{
- Doc->enableCMS(!Doc->HasCMS);
+void ScribusView::toggleCMS(bool cmsOn)
+{
+ Doc->enableCMS(cmsOn);
m_ScMW->requestUpdate(reqCmsOptionsUpdate);
DrawNew();
}
@@ -275,30 +276,31 @@
DrawNew();
}
-void ScribusView::togglePreviewEdit()
-{
- Doc->editOnPreview = !Doc->editOnPreview;
+void ScribusView::togglePreviewEdit(bool edit)
+{
+ Doc->editOnPreview = edit;
m_ScMW->setPreviewToolbar();
m_EditModeWasOn = true;
DrawNew();
}
-void ScribusView::togglePreview()
+void ScribusView::togglePreview(bool inPreview)
{
this->requestMode(modeNormal);
Deselect(true);
undoManager->setUndoEnabled(false);
- m_canvas->m_viewMode.viewAsPreview = !m_canvas->m_viewMode.viewAsPreview;
- Doc->drawAsPreview = m_canvas->m_viewMode.viewAsPreview;
+ m_canvas->m_viewMode.viewAsPreview = inPreview;
+ Doc->drawAsPreview = inPreview;
bool recalc = false;
Doc->editOnPreview = false;
- m_ScMW->editOnPreviewToolbarButton->setChecked(false);
+ m_ScMW->scrActions["viewEditInPreview"]->setChecked(false);
m_AnnotChanged = false;
m_EditModeWasOn = false;
m_ChangedState = Doc->isModified();
- if (m_canvas->m_viewMode.viewAsPreview)
- {
- m_ScMW->editOnPreviewToolbarButton->show();
+
+ if (inPreview)
+ {
+ m_ScMW->scrActions["viewEditInPreview"]->setEnabled(true);
storedFramesShown = Doc->guidesPrefs().framesShown;
Doc->guidesPrefs().framesShown = false;
storedShowControls = Doc->guidesPrefs().showControls;
@@ -316,30 +318,24 @@
{
if (m_AnnotChanged)
Doc->ResetFormFields();
- m_ScMW->editOnPreviewToolbarButton->hide();
+ m_ScMW->scrActions["viewEditInPreview"]->setEnabled(false);
Doc->guidesPrefs().framesShown = storedFramesShown;
Doc->guidesPrefs().showControls = storedShowControls;
- m_ScMW->visualMenu->blockSignals(true);
- if (m_ScMW->visualMenu->currentIndex() != Doc->previewVisual)
+ if (m_ScMW->viewToolBar->visualMenu->currentIndex() != Doc->previewVisual)
recalc = true;
m_canvas->m_viewMode.previewVisual = 0;
Doc->previewVisual = 0;
- m_ScMW->visualMenu->setCurrentIndex(0);
- m_ScMW->visualMenu->blockSignals(false);
- }
- m_ScMW->appModeHelper.setPreviewMode(m_canvas->m_viewMode.viewAsPreview);
+ m_ScMW->viewToolBar->setDoc(Doc);
+ }
+ m_ScMW->appModeHelper.setPreviewMode(inPreview);
m_ScMW->setPreviewToolbar();
-#if OPTION_USE_QTOOLBUTTON
- m_ScMW->previewToolbarButton->setChecked(m_canvas->m_viewMode.viewAsPreview);
-#endif
- m_ScMW->visualMenu->setEnabled(m_canvas->m_viewMode.viewAsPreview);
+ m_ScMW->viewToolBar->setViewPreviewMode(inPreview);
ScGuardedPtr<ScribusDoc> docPtr = Doc->guardedPtr();
if (recalc)
{
Doc->recalculateColors();
Doc->recalcPicturesRes();
}
-// repaintContents(QRect());
if (docPtr) // document may have been destroyed in-between
{
DrawNew();
Modified: trunk/Scribus/scribus/scribusview.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19009&path=/trunk/Scribus/scribus/scribusview.h
==============================================================================
--- trunk/Scribus/scribus/scribusview.h (original)
+++ trunk/Scribus/scribus/scribusview.h Sat Apr 5 21:35:36 2014
@@ -234,10 +234,10 @@
public slots: // Public slots
void languageChange();
- void toggleCMS();
+ void toggleCMS(bool cmsOn);
void switchPreviewVisual(int vis);
- void togglePreviewEdit();
- void togglePreview();
+ void togglePreviewEdit(bool edit);
+ void togglePreview(bool inPreview);
void unitChange();
void setRulersShown(bool isShown);
/** Zooms in or out */
Modified: trunk/Scribus/scribus/ui/pageselector.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19009&path=/trunk/Scribus/scribus/ui/pageselector.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pageselector.cpp (original)
+++ trunk/Scribus/scribus/ui/pageselector.cpp Sat Apr 5 21:35:36 2014
@@ -42,22 +42,21 @@
lastButton = new QToolButton( this );
lastButton->setAutoRaise(OPTION_FLAT_BUTTON);
#else
- Start = new QPushButton( this );
- Start->setDefault( false );
- Start->setAutoDefault( false );
- Start->setFlat(OPTION_FLAT_BUTTON);
- Back = new QPushButton( this );
- Back->setDefault( false );
- Back->setAutoDefault( false );
- Back->setFlat(OPTION_FLAT_BUTTON);
- Forward = new QPushButton( this );
- Forward->setDefault( false );
- Forward->setAutoDefault( false );
- Forward->setFlat(OPTION_FLAT_BUTTON);
- Last = new QPushButton( this );
- Last->setDefault( false );
- Last->setAutoDefault( false );
- Last->setFlat(OPTION_FLAT_BUTTON);
+ startButton = new QPushButton( this );
+ startButton->setDefault( false );
+ startButton->setAutoDefault( false );
+ startButton->setFlat(OPTION_FLAT_BUTTON);
+ backButton = new QPushButton( this );
+ backButton->setDefault( false );
+ backButton->setAutoDefault( false );
+ backButton->setFlat(OPTION_FLAT_BUTTON);
+ forwardButton->setDefault( false );
+ forwardButton->setAutoDefault( false );
+ forwardButton->setFlat(OPTION_FLAT_BUTTON);
+ lastButton = new QPushButton( this );
+ lastButton->setDefault( false );
+ lastButton->setAutoDefault( false );
+ lastButton->setFlat(OPTION_FLAT_BUTTON);
#endif
startButton->setIcon(QIcon(loadIcon("16/go-first.png")));
startButton->setFocusPolicy(Qt::NoFocus);
More information about the scribus-commit
mailing list