r18972 by craig - Move doc window status bar controls to main window status bar, relates to many existing bugs. All items moved over, but some will likely be removed to close out some bugs we have for GUI tidiness
scribus-commit
scribus-commit at lists.scribus.net
Tue Apr 1 06:24:14 UTC 2014
Author: craig
Date: Tue Apr 1 06:24:13 2014
New Revision: 18972
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18972
Log:
Move doc window status bar controls to main window status bar, relates to many existing bugs. All items moved over, but some will likely be removed to close out some bugs we have for GUI tidiness
Modified:
trunk/Scribus/scribus/canvasmode.cpp
trunk/Scribus/scribus/canvasmode_copyproperties.cpp
trunk/Scribus/scribus/canvasmode_create.cpp
trunk/Scribus/scribus/canvasmode_drawbezier.cpp
trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp
trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
trunk/Scribus/scribus/canvasmode_edit.cpp
trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp
trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp
trunk/Scribus/scribus/canvasmode_editweldpoint.cpp
trunk/Scribus/scribus/canvasmode_framelinks.cpp
trunk/Scribus/scribus/canvasmode_magnifier.cpp
trunk/Scribus/scribus/canvasmode_nodeedit.cpp
trunk/Scribus/scribus/canvasmode_normal.cpp
trunk/Scribus/scribus/canvasmode_objimport.cpp
trunk/Scribus/scribus/canvasmode_rotate.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.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/scribuswin.cpp
trunk/Scribus/scribus/scribuswin.h
trunk/Scribus/scribus/ui/pageselector.cpp
trunk/Scribus/scribus/ui/pageselector.h
Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp (original)
+++ trunk/Scribus/scribus/canvasmode.cpp Tue Apr 1 06:24:13 2014
@@ -1173,7 +1173,7 @@
}
Qt::KeyboardModifiers buttonModifiers = e->modifiers();
/**If we have a doc and we are not changing the page or zoom level in the status bar */
- if ((!m_view->zoomSpinBox->hasFocus()) && (!m_view->pageSelector->hasFocus()))
+ if ((!m_view->m_ScMW->zoomSpinBox->hasFocus()) && (!m_view->m_ScMW->pageSelector->hasFocus()))
{
//Show our context menu
QKeySequence currKeySeq = QKeySequence(kk | keyMod);
@@ -1716,7 +1716,7 @@
case Qt::Key_Up:
case Qt::Key_Down:
m_arrowKeyDown = false;
- if ((!m_view->zoomSpinBox->hasFocus()) && (!m_view->pageSelector->hasFocus()))
+ if ((!m_view->m_ScMW->zoomSpinBox->hasFocus()) && (!m_view->m_ScMW->pageSelector->hasFocus()))
{
int docSelectionCount=m_doc->m_Selection->count();
if ((docSelectionCount != 0) && (m_doc->appMode == modeEditClip) && (m_doc->nodeEdit.hasNodeSelected()))
Modified: trunk/Scribus/scribus/canvasmode_copyproperties.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/canvasmode_copyproperties.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_copyproperties.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_copyproperties.cpp Tue Apr 1 06:24:13 2014
@@ -281,7 +281,7 @@
if (m_doc->currentPageNumber() != pgNum)
{
m_doc->setCurrentPage(m_doc->Pages->at(unsigned(pgNum)));
- m_view->setMenTxt(unsigned(pgNum));
+ m_view->m_ScMW->setMenTxt(unsigned(pgNum));
m_view->DrawNew();
}
}
Modified: trunk/Scribus/scribus/canvasmode_create.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/canvasmode_create.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_create.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_create.cpp Tue Apr 1 06:24:13 2014
@@ -461,7 +461,7 @@
if (docCurrPageNo != j)
{
m_doc->setCurrentPage(m_doc->Pages->at(j));
- m_view->setMenTxt(j);
+ m_view->m_ScMW->setMenTxt(j);
m_view->DrawNew();
}
}
Modified: trunk/Scribus/scribus/canvasmode_drawbezier.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/canvasmode_drawbezier.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawbezier.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_drawbezier.cpp Tue Apr 1 06:24:13 2014
@@ -427,8 +427,8 @@
// m_doc->itemAddCommit(m_doc->m_Selection->itemAt(0)->ItemNr);
// }
//Make sure the Zoom spinbox and page selector dont have focus if we click on the canvas
- m_view->zoomSpinBox->clearFocus();
- m_view->pageSelector->clearFocus();
+ m_view->m_ScMW->zoomSpinBox->clearFocus();
+ m_view->m_ScMW->pageSelector->clearFocus();
if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action
{
currItem = m_doc->m_Selection->itemAt(0);
@@ -463,7 +463,7 @@
if (docCurrPageNo != j)
{
m_doc->setCurrentPage(m_doc->Pages->at(j));
- m_view->setMenTxt(j);
+ m_view->m_ScMW->setMenTxt(j);
m_view->DrawNew();
}
}
Modified: trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp Tue Apr 1 06:24:13 2014
@@ -322,8 +322,8 @@
m_doc->itemAddCommit(m_doc->m_Selection->itemAt(0));
}
//Make sure the Zoom spinbox and page selector dont have focus if we click on the canvas
- m_view->zoomSpinBox->clearFocus();
- m_view->pageSelector->clearFocus();
+ m_view->m_ScMW->zoomSpinBox->clearFocus();
+ m_view->m_ScMW->pageSelector->clearFocus();
if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action
{
currItem = m_doc->m_Selection->itemAt(0);
@@ -350,7 +350,7 @@
if (docCurrPageNo != j)
{
m_doc->setCurrentPage(m_doc->Pages->at(j));
- m_view->setMenTxt(j);
+ m_view->m_ScMW->setMenTxt(j);
m_view->DrawNew();
}
}
Modified: trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawfreehand.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_drawfreehand.cpp Tue Apr 1 06:24:13 2014
@@ -308,8 +308,8 @@
m_doc->itemAddCommit(m_doc->m_Selection->itemAt(0));
}
//Make sure the Zoom spinbox and page selector dont have focus if we click on the canvas
- m_view->zoomSpinBox->clearFocus();
- m_view->pageSelector->clearFocus();
+ m_view->m_ScMW->zoomSpinBox->clearFocus();
+ m_view->m_ScMW->pageSelector->clearFocus();
if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action
{
currItem = m_doc->m_Selection->itemAt(0);
@@ -336,7 +336,7 @@
if (docCurrPageNo != j)
{
m_doc->setCurrentPage(m_doc->Pages->at(j));
- m_view->setMenTxt(j);
+ m_view->m_ScMW->setMenTxt(j);
m_view->DrawNew();
}
}
Modified: trunk/Scribus/scribus/canvasmode_edit.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/canvasmode_edit.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_edit.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_edit.cpp Tue Apr 1 06:24:13 2014
@@ -108,9 +108,9 @@
return;
}
- if (currItem->asImageFrame() && !currItem->locked())
- {
- currItem->handleModeEditKey(e, m_keyRepeat);
+ if (currItem->asImageFrame() && !currItem->locked())
+ {
+ currItem->handleModeEditKey(e, m_keyRepeat);
}
if (currItem->asTextFrame())
{
@@ -133,18 +133,18 @@
}
blinkTextCursor();
- currItem->handleModeEditKey(e, m_keyRepeat);
- if (currItem->isAutoNoteFrame() && currItem->asNoteFrame()->notesList().isEmpty())
- {
- if (!currItem->asNoteFrame()->isEndNotesFrame())
- {
- currItem->asNoteFrame()->masterFrame()->invalidateLayout(false);
- currItem->asNoteFrame()->masterFrame()->updateLayout();
- }
- }
+ currItem->handleModeEditKey(e, m_keyRepeat);
+ if (currItem->isAutoNoteFrame() && currItem->asNoteFrame()->notesList().isEmpty())
+ {
+ if (!currItem->asNoteFrame()->isEndNotesFrame())
+ {
+ currItem->asNoteFrame()->masterFrame()->invalidateLayout(false);
+ currItem->asNoteFrame()->masterFrame()->updateLayout();
+ }
+ }
m_keyRepeat = oldKeyRepeat;
- if (!currItem->isTextFrame() || (currItem->isAutoNoteFrame() && currItem->asNoteFrame()->notesList().isEmpty()))
- m_ScMW->slotDocCh(false);
+ if (!currItem->isTextFrame() || (currItem->isAutoNoteFrame() && currItem->asNoteFrame()->notesList().isEmpty()))
+ m_ScMW->slotDocCh(false);
m_doc->regionsChanged()->update(QRectF());
}
m_keyRepeat = false;
@@ -819,7 +819,7 @@
if (currItem->OwnPage != -1)
{
m_doc->setCurrentPage(m_doc->Pages->at(currItem->OwnPage));
- m_view->setMenTxt(currItem->OwnPage);
+ m_view->m_ScMW->setMenTxt(currItem->OwnPage);
}
//CB done with emitAllToGUI
//emit HaveSel(currItem->itemType());
@@ -846,7 +846,7 @@
if (docCurrPageNo != i)
{
m_doc->setCurrentPage(m_doc->Pages->at(i));
- m_view->setMenTxt(i);
+ m_view->m_ScMW->setMenTxt(i);
}
break;
}
@@ -919,8 +919,8 @@
m_doc->itemAddCommit(m_doc->m_Selection->itemAt(0));
}
//Make sure the Zoom spinbox and page selector dont have focus if we click on the canvas
- m_view->zoomSpinBox->clearFocus();
- m_view->pageSelector->clearFocus();
+ m_view->m_ScMW->zoomSpinBox->clearFocus();
+ m_view->m_ScMW->pageSelector->clearFocus();
if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action
{
currItem = m_doc->m_Selection->itemAt(0);
@@ -990,7 +990,7 @@
if (m_doc->currentPageNumber() != pgNum)
{
m_doc->setCurrentPage(m_doc->Pages->at(unsigned(pgNum)));
- m_view->setMenTxt(unsigned(pgNum));
+ m_view->m_ScMW->setMenTxt(unsigned(pgNum));
m_view->DrawNew();
}
}
Modified: trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp Tue Apr 1 06:24:13 2014
@@ -394,7 +394,7 @@
m_keyRepeat = true;
e->accept();
Qt::KeyboardModifiers buttonModifiers = e->modifiers();
- if ((!m_view->zoomSpinBox->hasFocus()) && (!m_view->pageSelector->hasFocus()))
+ if ((!m_view->m_ScMW->zoomSpinBox->hasFocus()) && (!m_view->m_ScMW->pageSelector->hasFocus()))
{
if (m_doc->m_Selection->count() != 0)
{
Modified: trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp Tue Apr 1 06:24:13 2014
@@ -339,7 +339,7 @@
}
Qt::KeyboardModifiers buttonModifiers = e->modifiers();
- if ((!m_view->zoomSpinBox->hasFocus()) && (!m_view->pageSelector->hasFocus()))
+ if ((!m_view->m_ScMW->zoomSpinBox->hasFocus()) && (!m_view->m_ScMW->pageSelector->hasFocus()))
{
if (m_doc->m_Selection->count() != 0)
{
Modified: trunk/Scribus/scribus/canvasmode_editweldpoint.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/canvasmode_editweldpoint.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editweldpoint.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editweldpoint.cpp Tue Apr 1 06:24:13 2014
@@ -200,7 +200,7 @@
}
Qt::KeyboardModifiers buttonModifiers = e->modifiers();
- if ((!m_view->zoomSpinBox->hasFocus()) && (!m_view->pageSelector->hasFocus()))
+ if ((!m_view->m_ScMW->zoomSpinBox->hasFocus()) && (!m_view->m_ScMW->pageSelector->hasFocus()))
{
if (m_doc->m_Selection->count() != 0)
{
Modified: trunk/Scribus/scribus/canvasmode_framelinks.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/canvasmode_framelinks.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_framelinks.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_framelinks.cpp Tue Apr 1 06:24:13 2014
@@ -309,8 +309,8 @@
for (int i = 0; i < m_doc->m_Selection->count(); ++i)
m_doc->m_Selection->itemAt(i)->checkChanges(true);
//Make sure the Zoom spinbox and page selector dont have focus if we click on the canvas
- m_view->zoomSpinBox->clearFocus();
- m_view->pageSelector->clearFocus();
+ m_view->m_ScMW->zoomSpinBox->clearFocus();
+ m_view->m_ScMW->pageSelector->clearFocus();
}
void CanvasMode_FrameLinks::selectPage(QMouseEvent *m)
@@ -331,7 +331,7 @@
if (docCurrPageNo != j)
{
m_doc->setCurrentPage(m_doc->Pages->at(j));
- m_view->setMenTxt(j);
+ m_view->m_ScMW->setMenTxt(j);
m_view->DrawNew();
}
}
@@ -396,7 +396,7 @@
if (m_doc->currentPageNumber() != pgNum)
{
m_doc->setCurrentPage(m_doc->Pages->at(unsigned(pgNum)));
- m_view->setMenTxt(unsigned(pgNum));
+ m_view->m_ScMW->setMenTxt(unsigned(pgNum));
m_view->DrawNew();
}
}
Modified: trunk/Scribus/scribus/canvasmode_magnifier.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/canvasmode_magnifier.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_magnifier.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_magnifier.cpp Tue Apr 1 06:24:13 2014
@@ -236,6 +236,6 @@
m_canvas->m_viewMode.operItemResizing = false;
m_view->MidButt = false;
//Make sure the Zoom spinbox and page selector dont have focus if we click on the canvas
- m_view->zoomSpinBox->clearFocus();
- m_view->pageSelector->clearFocus();
-}
+ m_view->m_ScMW->zoomSpinBox->clearFocus();
+ m_view->m_ScMW->pageSelector->clearFocus();
+}
Modified: trunk/Scribus/scribus/canvasmode_nodeedit.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/canvasmode_nodeedit.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_nodeedit.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_nodeedit.cpp Tue Apr 1 06:24:13 2014
@@ -482,8 +482,8 @@
m_doc->itemAddCommit(m_doc->m_Selection->itemAt(0));
}
//Make sure the Zoom spinbox and page selector dont have focus if we click on the canvas
- m_view->zoomSpinBox->clearFocus();
- m_view->pageSelector->clearFocus();
+ m_view->m_ScMW->zoomSpinBox->clearFocus();
+ m_view->m_ScMW->pageSelector->clearFocus();
if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action
{
currItem = m_doc->m_Selection->itemAt(0);
Modified: trunk/Scribus/scribus/canvasmode_normal.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/canvasmode_normal.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_normal.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_normal.cpp Tue Apr 1 06:24:13 2014
@@ -1158,7 +1158,7 @@
if (currItem->OwnPage != -1)
{
m_doc->setCurrentPage(m_doc->Pages->at(currItem->OwnPage));
- m_view->setMenTxt(currItem->OwnPage);
+ m_view->m_ScMW->setMenTxt(currItem->OwnPage);
}
//CB done with emitAllToGUI
//emit HaveSel(currItem->itemType());
@@ -1191,7 +1191,7 @@
if (docCurrPageNo != i)
{
m_doc->setCurrentPage(m_doc->Pages->at(i));
- m_view->setMenTxt(i);
+ m_view->m_ScMW->setMenTxt(i);
}
break;
}
@@ -1283,8 +1283,8 @@
}
}
//Make sure the Zoom spinbox and page selector dont have focus if we click on the canvas
- m_view->zoomSpinBox->clearFocus();
- m_view->pageSelector->clearFocus();
+ m_view->m_ScMW->zoomSpinBox->clearFocus();
+ m_view->m_ScMW->pageSelector->clearFocus();
if (m_doc->m_Selection->count() > 0)
{
if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action
@@ -1694,7 +1694,7 @@
if (m_doc->currentPageNumber() != pgNum)
{
m_doc->setCurrentPage(m_doc->Pages->at(unsigned(pgNum)));
- m_view->setMenTxt(unsigned(pgNum));
+ m_view->m_ScMW->setMenTxt(unsigned(pgNum));
pageChanged = true;
}
}
Modified: trunk/Scribus/scribus/canvasmode_objimport.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/canvasmode_objimport.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_objimport.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_objimport.cpp Tue Apr 1 06:24:13 2014
@@ -207,11 +207,11 @@
m_canvas->m_viewMode.operItemResizing = false;
m_view->MidButt = false;
//Make sure the Zoom spinbox and page selector dont have focus if we click on the canvas
- m_view->zoomSpinBox->clearFocus();
- m_view->pageSelector->clearFocus();
-}
-
-
-
-
-
+ m_view->m_ScMW->zoomSpinBox->clearFocus();
+ m_view->m_ScMW->pageSelector->clearFocus();
+}
+
+
+
+
+
Modified: trunk/Scribus/scribus/canvasmode_rotate.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/canvasmode_rotate.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_rotate.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_rotate.cpp Tue Apr 1 06:24:13 2014
@@ -26,6 +26,7 @@
#include "pageitem.h"
#include "ui/pageselector.h"
#include "prefsmanager.h"
+#include "scribus.h"
#include "scribusdoc.h"
#include "scribusview.h"
#include "selection.h"
@@ -369,8 +370,8 @@
for (int i = 0; i < m_doc->m_Selection->count(); ++i)
m_doc->m_Selection->itemAt(i)->checkChanges(true);
//Make sure the Zoom spinbox and page selector dont have focus if we click on the canvas
- m_view->zoomSpinBox->clearFocus();
- m_view->pageSelector->clearFocus();
+ m_view->m_ScMW->zoomSpinBox->clearFocus();
+ m_view->m_ScMW->pageSelector->clearFocus();
}
void CanvasMode_Rotate::mouseMoveEvent(QMouseEvent *m)
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp Tue Apr 1 06:24:13 2014
@@ -1360,7 +1360,7 @@
allItems.clear();
}
- setCurrentComboItem(m_View->unitSwitcher, unitGetStrFromIndex(m_Doc->unitIndex()));
+ setCurrentComboItem(m_ScMW->unitSwitcher, unitGetStrFromIndex(m_Doc->unitIndex()));
if (m_mwProgressBar!=0)
m_mwProgressBar->setValue(DOC.childNodes().count());
Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Tue Apr 1 06:24:13 2014
@@ -143,6 +143,7 @@
#include "serializer.h"
#include "ui/about.h"
#include "ui/aboutplugins.h"
+#include "ui/adjustcmsdialog.h"
#include "ui/aligndistribute.h"
#include "ui/annot.h"
#include "ui/annota.h"
@@ -399,6 +400,7 @@
prefsManager->setupMainWindow(this);
+ previewQualitySwitcher->setCurrentIndex(prefsManager->appPrefs.itemToolPrefs.imageLowResType);
if (primaryMainWindow)
ScCore->setSplashStatus( tr("Initializing Story Editor") );
storyEditor = new StoryEditor(this);
@@ -1160,16 +1162,145 @@
void ScribusMainWindow::initStatusBar()
{
+ QFont fo = QFont(font());
+ int posi = fo.pointSize() - (ScCore->isWinGUI() ? 1 : 2);
+ fo.setPointSize(posi);
+ unitSwitcher = new QComboBox( this );
+ unitSwitcher->setFocusPolicy(Qt::NoFocus);
+ unitSwitcher->setFont(fo);
+ int maxUindex = unitGetMaxIndex() - 2;
+ for (int i = 0; i <= maxUindex; ++i)
+ unitSwitcher->addItem(unitGetStrFromIndex(i));
+ zoomSpinBox = new ScrSpinBox( 1, 32000, this, 6 );
+ zoomSpinBox->setTabAdvance(false);
+ zoomSpinBox->setFont(fo);
+ zoomSpinBox->setValue( 100 );
+ zoomSpinBox->setSingleStep(10);
+ zoomSpinBox->setFocusPolicy(Qt::ClickFocus);
+ zoomSpinBox->setSuffix( tr( " %" ) );
+ layerMenu = new QComboBox( this );
+ layerMenu->setEditable(false);
+ 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);
+ pageSelector->setFocusPolicy(Qt::ClickFocus);
+
+#if OPTION_USE_QTOOLBUTTON
+ zoomOutToolbarButton = new QToolButton(this);
+ zoomDefaultToolbarButton = new QToolButton(this);
+ zoomInToolbarButton = new QToolButton(this);
+ zoomDefaultToolbarButton->setAutoRaise(OPTION_FLAT_BUTTON);
+ zoomOutToolbarButton->setAutoRaise(OPTION_FLAT_BUTTON);
+ 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);
+ zoomDefaultToolbarButton->setDefault( false );
+ zoomDefaultToolbarButton->setAutoDefault( false );
+ zoomDefaultToolbarButton->setFlat(OPTION_FLAT_BUTTON);
+ zoomOutToolbarButton = new QPushButton(this);
+ zoomOutToolbarButton->setFocusPolicy(Qt::NoFocus);
+ zoomOutToolbarButton->setDefault( false );
+ zoomOutToolbarButton->setAutoDefault( false );
+ zoomOutToolbarButton->setFlat(OPTION_FLAT_BUTTON);
+ zoomInToolbarButton = new QPushButton(this);
+ zoomInToolbarButton->setFocusPolicy(Qt::NoFocus);
+ 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"));
+#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"));
+
+
mainWindowStatusLabel = new QLabel( " ", statusBar());
mainWindowProgressBar = new QProgressBar(statusBar());
mainWindowProgressBar->setAlignment(Qt::AlignHCenter);
mainWindowProgressBar->setFixedWidth( 100 );
mainWindowProgressBar->reset();
- mainWindowXPosLabel = new QLabel( tr("X-Pos:"), statusBar());
- mainWindowYPosLabel = new QLabel( tr("Y-Pos:"), statusBar());
+ mainWindowXPosLabel = new QLabel( tr("X:"), statusBar());
+ mainWindowYPosLabel = new QLabel( tr("Y:"), statusBar());
mainWindowXPosDataLabel = new QLabel( " ", statusBar());
mainWindowYPosDataLabel = new QLabel( " ", statusBar());
+ 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()->addPermanentWidget(mainWindowXPosLabel, 0);
@@ -1177,6 +1308,8 @@
statusBar()->addPermanentWidget(mainWindowYPosLabel, 0);
statusBar()->addPermanentWidget(mainWindowYPosDataLabel, 1);
connect(statusBar(), SIGNAL(messageChanged(const QString &)), this, SLOT(setTempStatusBarText(const QString &)));
+
+ editOnPreviewToolbarButton->hide();
}
@@ -1518,7 +1651,7 @@
}
Qt::KeyboardModifiers buttonModifiers = k->modifiers();
/**If we have a doc and we are not changing the page or zoom level in the status bar */
- if ((HaveDoc) && (!view->zoomSpinBox->hasFocus()) && (!view->pageSelector->hasFocus()))
+ if ((HaveDoc) && (!zoomSpinBox->hasFocus()) && (!pageSelector->hasFocus()))
{
//Show our context menu
QKeySequence currKeySeq = QKeySequence(kk | keyMod);
@@ -1684,7 +1817,7 @@
case Qt::Key_Up:
case Qt::Key_Down:
_arrowKeyDown = false;
- if ((HaveDoc) && (!view->zoomSpinBox->hasFocus()) && (!view->pageSelector->hasFocus()))
+ if ((HaveDoc) && (!zoomSpinBox->hasFocus()) && (!pageSelector->hasFocus()))
{
int docSelectionCount=doc->m_Selection->count();
if ((docSelectionCount != 0) && (doc->appMode == modeEditClip) && (doc->nodeEdit.hasNodeSelected()))
@@ -2080,7 +2213,7 @@
connect(doc, SIGNAL(updateAutoSaveClock()), view->clockLabel, SLOT(resetTime()));
view->clockLabel->resetTime();
//scrActions["fileSave"]->setEnabled(false);
- tempView->cmsToolbarButton->setChecked(tempDoc->HasCMS);
+ cmsToolbarButton->setChecked(tempDoc->HasCMS);
undoManager->switchStack(tempDoc->DocName);
styleManager->setDoc(tempDoc);
marksManager->setDoc(tempDoc);
@@ -2230,11 +2363,23 @@
disconnect(undoManager, SIGNAL(undoRedoDone()) , doc->view(), SLOT(DrawNew()));
disconnect(doc, SIGNAL(addBookmark(PageItem *)), this, SLOT(AddBookMark(PageItem *)));
disconnect(doc, SIGNAL(deleteBookmark(PageItem *)), this, SLOT(DelBookMark(PageItem *)));
-
+ disconnect(unitSwitcher, SIGNAL(activated(int)), doc->view(), SLOT(ChgUnit(int)));
+ disconnect(zoomSpinBox, SIGNAL(valueChanged(double)), doc->view(), SLOT(setZoom()));
+ disconnect(zoomDefaultToolbarButton, SIGNAL(clicked()), doc->view(), SLOT(slotZoom100()));
+ 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(pageSelector);
}
doc = ActWin->doc();
undoManager->switchStack(doc->DocName);
+
if ((doc != NULL) && doc->hasGUI())
{
@@ -2243,7 +2388,25 @@
connect(undoManager, SIGNAL(undoRedoDone()) , doc->view(), SLOT(DrawNew()));
connect(doc, SIGNAL(addBookmark(PageItem *)), this, SLOT(AddBookMark(PageItem *)));
connect(doc, SIGNAL(deleteBookmark(PageItem *)), this, SLOT(DelBookMark(PageItem *)));
-
+ connect(unitSwitcher, SIGNAL(activated(int)), doc->view(), SLOT(ChgUnit(int)));
+ connect(zoomSpinBox, SIGNAL(valueChanged(double)), doc->view(), SLOT(setZoom()));
+ connect(zoomDefaultToolbarButton, SIGNAL(clicked()), doc->view(), SLOT(slotZoom100()));
+ 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)));
+ pageSelector->setMaximum(doc->masterPageMode() ? 1 : doc->Pages->count());
+ setMenTxt(doc->currentPageNumber());
+ connect(pageSelector, SIGNAL(GotoPage(int)), this, SLOT(setCurrentPage(int)));
}
if (view!=NULL)
@@ -2255,6 +2418,9 @@
}
view = ActWin->view();
+
+ zoomSpinBox->setValue(view->scale() * 100.0 / PrefsManager::instance()->appPrefs.displayPrefs.displayScale);
+ connect(zoomSpinBox, SIGNAL(valueChanged(double)), doc->view(), SLOT(setZoom()));
actionManager->connectNewViewActions(view);
actionManager->disconnectNewDocActions();
actionManager->connectNewDocActions(doc);
@@ -2358,8 +2524,8 @@
symbolPalette->setDoc(doc);
inlinePalette->setDoc(doc);
rebuildLayersList();
- view->updateLayerMenu();
- view->setLayerMenuText(doc->activeLayerName());
+ updateLayerMenu();
+ setLayerMenuText(doc->activeLayerName());
//Do not set this!, it doesnt get valid pointers unless its in EditClip mode and its not
//if we are switching windows #4357
//nodePalette->setDoc(doc, view);
@@ -2402,8 +2568,8 @@
if (outlinePalette->isVisible())
outlinePalette->BuildTree();
rebuildLayersList();
- view->updateLayerMenu();
- view->setLayerMenuText(doc->activeLayerName());
+ updateLayerMenu();
+ setLayerMenuText(doc->activeLayerName());
slotChangeUnit(doc->unitIndex());
windowsMenuAboutToShow();
@@ -2412,6 +2578,7 @@
// Use Qt::UniqueConnection here to avoid multiple identical signal connections
connect(view, SIGNAL(changeUN(int)), this, SLOT(slotChangeUnit(int)), Qt::UniqueConnection);
connect(view, SIGNAL(changeLA(int)), layerPalette, SLOT(markActiveLayer(int)), Qt::UniqueConnection);
+ connect(this, SIGNAL(changeLayers(int)), layerPalette, SLOT(markActiveLayer(int)), Qt::UniqueConnection);
connect(view->horizRuler, SIGNAL(MarkerMoved(double, double)), this, SLOT(setStatusBarTextPosition(double, double)), Qt::UniqueConnection);
connect(view->horizRuler, SIGNAL(DocChanged(bool)), this, SLOT(slotDocCh(bool)), Qt::UniqueConnection);
connect(view, SIGNAL(ClipPo(double, double)), nodePalette, SLOT(SetXY(double, double)), Qt::UniqueConnection);
@@ -3711,7 +3878,7 @@
// }
slotDocCh();
rebuildLayersList();
- view->updateLayerMenu();
+ updateLayerMenu();
layerPalette->rebuildList();
doc->setLoading(false);
ret = true;
@@ -3878,7 +4045,8 @@
symbolPalette->setDoc(doc);
outlinePalette->setDoc(doc);
fileLoader->informReplacementFonts();
- setCurrentComboItem(view->unitSwitcher, unitGetStrFromIndex(doc->unitIndex()));
+ setCurrentComboItem(unitSwitcher, unitGetStrFromIndex(doc->unitIndex()));
+ zoomSpinBox->setValue(view->scale());
view->unitChange();
setScriptRunning(false);
view->Deselect(true);
@@ -4118,7 +4286,7 @@
doc->updateNumbers(true);
emit UpdateRequest(reqNumUpdate);
doc->setCurrentPage(doc->DocPages.at(0));
- view->cmsToolbarButton->setChecked(doc->HasCMS);
+ cmsToolbarButton->setChecked(doc->HasCMS);
view->zoom();
view->GotoPage(0);
connect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(newActWin(QMdiSubWindow *)));
@@ -5663,6 +5831,7 @@
{
doc->addPage(w, masterPageName, true);
view->addPage(w, mov);
+ setMenTxt(w);
}
@@ -6138,8 +6307,8 @@
symbolPalette->setEnabled(false);
styleManager->setEnabled(false);
alignDistributePalette->setEnabled(false);
- view->pageSelector->setEnabled(false);
- view->layerMenu->setEnabled(false);
+ pageSelector->setEnabled(false);
+ layerMenu->setEnabled(false);
if (!doc->m_Selection->isEmpty())
{
PageItem *currItem = doc->m_Selection->itemAt(0);
@@ -6195,8 +6364,8 @@
alignDistributePalette->setEnabled(true);
symbolPalette->setEnabled(true);
inlinePalette->setEnabled(true);
- view->pageSelector->setEnabled(true);
- view->layerMenu->setEnabled(true);
+ pageSelector->setEnabled(true);
+ layerMenu->setEnabled(true);
// bool tmpClip = doc->EditClip; // for enabling undo if exiting shape edit mode
if (HaveDoc)
{
@@ -6345,8 +6514,8 @@
}
if (oldMode == modeEdit)
{
- view->zoomSpinBox->setFocusPolicy(Qt::ClickFocus);
- view->pageSelector->setFocusPolicy(Qt::ClickFocus);
+ zoomSpinBox->setFocusPolicy(Qt::ClickFocus);
+ pageSelector->setFocusPolicy(Qt::ClickFocus);
scrActions["editClearContents"]->setEnabled(false);
charPalette->setEnabled(false, 0);
// view->slotDoCurs(false);
@@ -6735,7 +6904,8 @@
}
if (tmpSelection.count() != 0)
doc->itemSelection_DeleteItem(&tmpSelection);
- disconnect(view->pageSelector, SIGNAL(GotoPage(int)), view, SLOT(GotoPa(int)));
+ //disconnect(view->pageSelector, SIGNAL(GotoPage(int)), view, SLOT(GotoPa(int)));
+ pageSelector->blockSignals(true);
view->updatesOn(false);
for (int a = to - 1; a >= from - 1; a--)
{
@@ -6762,8 +6932,9 @@
if (!isMasterPage) // Master pages are not added to sections when created
doc->removePageFromSection(a);
}
- view->pageSelector->setMaximum(doc->Pages->count());
- connect(view->pageSelector, SIGNAL(GotoPage(int)), view, SLOT(GotoPa(int)));
+ pageSelector->setMaximum(doc->Pages->count());
+ //connect(view->pageSelector, SIGNAL(GotoPage(int)), view, SLOT(GotoPa(int)));
+ pageSelector->blockSignals(false);
undoManager->setUndoEnabled(false); // ugly hack to disable object moving when undoing page deletion
view->reformPagesView();
undoManager->setUndoEnabled(true); // ugly hack continues
@@ -7230,7 +7401,7 @@
int h = qRound(qMin(scw_v->visibleHeight() / scw_v->scale(), scw->doc()->currentPage()->height()));
scw_v->rememberOldZoomLocation(w / 2 + x,h / 2 + y);
scw_v->zoom((scw_v->scale() / oldPrefs.displayPrefs.displayScale) * prefsManager->displayScale());
- scw_v->zoomSpinBox->setMaximum(doc->opToolPrefs().magMax);
+ zoomSpinBox->setMaximum(doc->opToolPrefs().magMax);
}
if (shadowChanged)
scw->view()->DrawNew();
@@ -7298,9 +7469,9 @@
qApp->restoreOverrideCursor();
setStatusBarInfoText("");
mainWindowProgressBar->reset();
- view->previewQualitySwitcher->blockSignals(true);
- view->previewQualitySwitcher->setCurrentIndex(doc->itemToolPrefs().imageLowResType);
- view->previewQualitySwitcher->blockSignals(false);
+ previewQualitySwitcher->blockSignals(true);
+ previewQualitySwitcher->setCurrentIndex(doc->itemToolPrefs().imageLowResType);
+ previewQualitySwitcher->blockSignals(false);
}
if (oldDocPrefs.typoPrefs != newDocPrefs.typoPrefs)
{
@@ -7322,7 +7493,7 @@
scrActions["viewRulerMode"]->setChecked(doc->guidesPrefs().rulerMode);
scrActions["extrasGenerateTableOfContents"]->setEnabled(doc->hasTOCSetup());
scrActions["extrasUpdateDocument"]->setEnabled(true);
- view->cmsToolbarButton->setChecked(doc->HasCMS);
+ cmsToolbarButton->setChecked(doc->HasCMS);
//doc emits changed() via this
doc->setMasterPageMode(true);
view->reformPages();
@@ -7890,6 +8061,33 @@
return scrapbookPalette->getOpenScrapbooksNames();
}
+void ScribusMainWindow::updateLayerMenu()
+{
+ disconnect(layerMenu, SIGNAL(activated(int)), this, SLOT(GotoLa(int)));
+ layerMenu->clear();
+ QStringList newNames;
+ doc->orderedLayerList(&newNames);
+ for (QStringList::Iterator it=newNames.begin(); it!=newNames.end(); ++it)
+ {
+ QPixmap pm(20,15);
+ pm.fill(doc->Layers.layerByName(*it)->markerColor);
+ layerMenu->addItem(pm, *it);
+ }
+ connect(layerMenu, SIGNAL(activated(int)), this, SLOT(GotoLa(int)));
+}
+
+
+void ScribusMainWindow::GotoLa(int l)
+{
+ int level = doc->layerCount()-l-1;
+ int layerID=doc->layerIDFromLevel(level);
+ if (layerID==-1)
+ return;
+ doc->setActiveLayer(layerID);
+ changeLayer(doc->activeLayer());
+ emit changeLayers(layerID);
+}
+
//CB-->Doc, stop _storing_ bookmarks in the palette
void ScribusMainWindow::StoreBookmarks()
{
@@ -7947,7 +8145,7 @@
}
doc->setUnitIndex(unitIndex);
- setCurrentComboItem(view->unitSwitcher, unitGetStrFromIndex(doc->unitIndex()));
+ setCurrentComboItem(unitSwitcher, unitGetStrFromIndex(doc->unitIndex()));
view->unitChange();
propertiesPalette->unitChange();
nodePalette->unitChange();
@@ -8170,7 +8368,7 @@
scrMenuMgr->setMenuEnabled("FileOpenRecent", false);
scrActions["fileClose"]->setToolTip( tr("Click here to leave master page edit mode."));
scrActions["fileClose"]->setIcon(loadIcon("22/exit.png"));
- view->previewToolbarButton->setEnabled(false);
+ previewToolbarButton->setEnabled(false);
}
void ScribusMainWindow::editMasterPagesEnd()
@@ -8189,7 +8387,7 @@
scrActions["fileClose"]->setToolTip( tr("Close"));
scrActions["fileClose"]->setIcon(loadIcon("22/close.png"));
scrMenuMgr->setMenuEnabled("FileOpenRecent", true);
- view->previewToolbarButton->setEnabled(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);
@@ -8659,8 +8857,10 @@
rebuildLayersList();
layerPalette->rebuildList();
layerPalette->markActiveLayer();
- view->updateLayerMenu();
- view->setLayerMenuText(doc->activeLayerName());
+ updateLayerMenu();
+ setLayerMenuText(doc->activeLayerName());
+ updateLayerMenu();
+ setLayerMenuText(doc->activeLayerName());
view->DrawNew();
bool setter = !doc->layerLocked( doc->activeLayer() );
scrMenuMgr->setMenuEnabled("EditPasteRecent", ((scrapbookPalette->tempBView->objectMap.count() > 0) && (setter)));
@@ -8669,9 +8869,45 @@
appModeHelper.changeLayer(doc, (ScMimeData::clipboardHasScribusData() || (scrapbookPalette->tempHasContents())));
}
+void ScribusMainWindow::setLayerMenuText(const QString &layerName)
+{
+ disconnect(layerMenu, SIGNAL(activated(int)), this, SLOT(GotoLa(int)));
+ if (layerMenu->count() != 0)
+ setCurrentComboItem(layerMenu, layerName);
+ connect(layerMenu, SIGNAL(activated(int)), this, SLOT(GotoLa(int)));
+}
+
void ScribusMainWindow::showLayer()
{
view->DrawNew();
+}
+
+//TODO: use this only from this class, or just from doc->setcurrentpage
+void ScribusMainWindow::setMenTxt(int Seite)
+{
+ if (scriptIsRunning())
+ return;
+ //disconnect(pageSelector);
+ pageSelector->blockSignals(true);
+ pageSelector->setMaximum(doc->masterPageMode() ? 1 : doc->Pages->count());
+ if ((!doc->isLoading()) && (!doc->masterPageMode()))
+ pageSelector->GotoPg(Seite);
+ pageSelector->blockSignals(false);
+ //connect(pageSelector, SIGNAL(GotoPage(int)), doc->view(), SLOT(GotoPa(int)));
+}
+
+void ScribusMainWindow::setCurrentPage(int p)
+{
+ qDebug()<<"Requested Page:"<<p;
+ doc->view()->Deselect();
+ int p0=p-1; //p is what the user see.. p0 is our count from 0
+ doc->setCurrentPage(doc->Pages->at(p0));
+ if (scriptIsRunning())
+ return;
+ setMenTxt(p0);
+ doc->view()->SetCPo(doc->currentPage()->xOffset() - 10, doc->currentPage()->yOffset() - 10);
+ HaveNewSel(-1);
+ doc->view()->setFocus();
}
void ScribusMainWindow::initHyphenator()
@@ -9104,13 +9340,40 @@
scrMenuMgr->languageChange();
if (undoManager!=NULL)
undoManager->languageChange();
-
- mainWindowXPosLabel->setText( tr("X-Pos:"));
- mainWindowYPosLabel->setText( tr("Y-Pos:"));
- mainWindowXPosDataLabel->setText(" ");
- mainWindowYPosDataLabel->setText(" ");
- mainWindowStatusLabel->setText( tr("Ready"));
- }
+ statusBarLanguageChange();
+ }
+}
+
+void ScribusMainWindow::statusBarLanguageChange()
+{
+ zoomSpinBox->setToolTip( tr("Current zoom level"));
+ zoomDefaultToolbarButton->setToolTip( tr("Zoom to 100%"));
+ zoomOutToolbarButton->setToolTip( tr("Zoom out by the stepping value in Tools preferences"));
+ 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)
@@ -10617,3 +10880,29 @@
d.exec();
*/
}
+
+void ScribusMainWindow::adjustCMS()
+{
+ if (!HaveDoc)
+ return;
+ AdjustCmsDialog* dia = new AdjustCmsDialog(this, doc);
+ if (dia->exec())
+ {
+ dia->tabColorManagement->updateDocSettings(doc);
+ if (dia->tabColorManagement->changed)
+ {
+ doc->enableCMS(doc->cmsSettings().CMSinUse);
+ cmsToolbarButton->setChecked(doc->HasCMS);
+ requestUpdate(reqCmsOptionsUpdate);
+ doc->view()->DrawNew();
+ }
+ }
+ 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=18972&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h (original)
+++ trunk/Scribus/scribus/scribus.h Tue Apr 1 06:24:13 2014
@@ -167,7 +167,7 @@
void SwitchWin();
void RestoreBookMarks();
QStringList scrapbookNames();
-
+ void updateLayerMenu();
void emergencySave();
/**
@@ -206,6 +206,32 @@
QProgressBar* mainWindowProgressBar;
+ ScrSpinBox* zoomSpinBox; //zoom spinbox at bottom of view
+ PageSelector* pageSelector; //Page selector at bottom of view
+#if OPTION_USE_QTOOLBUTTON
+ 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;
+
QLabel* mainWindowXPosLabel;
QLabel* mainWindowXPosDataLabel;
QLabel* mainWindowYPosLabel;
@@ -252,6 +278,7 @@
public slots:
void languageChange();
+ void statusBarLanguageChange();
void specialActionKeyEvent(const QString& actionName, int unicodevalue);
void newView();
void ToggleStickyTools();
@@ -283,7 +310,10 @@
void PutToPatterns();
void ConvertToSymbol();
void changeLayer(int);
+ void setLayerMenuText(const QString &);
void showLayer();
+ void setMenTxt(int Seite);
+ void setCurrentPage(int p);
void ManageJava();
void editSelectedSymbolStart();
void editSymbolStart(QString temp);
@@ -297,7 +327,7 @@
void newFileFromTemplate();
bool slotPageImport();
bool loadPage(QString fileName, int Nr, bool Mpa, const QString& renamedPageName=QString::null);
-
+ void GotoLa(int l);
void slotGetContent();
void slotGetContent2(); // kk2006
void slotGetClipboardImage();
@@ -541,6 +571,8 @@
void slotUpdateMarks();
bool editMarkDlg(Mark *mrk, PageItem_TextFrame* currItem = NULL);
void testQTQuick2_1();
+ void adjustCMS();
+ void changePreviewQuality(int index);
signals:
void AppModeChanged(int oldMode, int newMode);
@@ -548,6 +580,7 @@
//deprecated: (av)
void TextEffects(int);
void UpdateRequest(int updateFlags);
+ void changeLayers(int);
protected:
/*!
Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Tue Apr 1 06:24:13 2014
@@ -294,6 +294,7 @@
viewAsPreview = false;
editOnPreview = false;
previewVisual = -1;
+ previewQuality = 1;
dontResize = false;
//create default numeration
NumStruct * numS = new NumStruct;
@@ -415,6 +416,7 @@
viewAsPreview = false;
editOnPreview = false;
previewVisual = -1;
+ previewQuality = 1;
dontResize = false;
currentEditedTextframe = NULL;
}
@@ -10808,8 +10810,7 @@
tmpSelection.clear();
//FIXME signal these
m_ScMW->rebuildLayersList();
- //FIXME: stop using m_View
- m_View->updateLayerMenu();
+ m_ScMW->updateLayerMenu();
setActiveLayer(newLayerID);
}
Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h (original)
+++ trunk/Scribus/scribus/scribusdoc.h Tue Apr 1 06:24:13 2014
@@ -1347,6 +1347,7 @@
bool viewAsPreview;
bool editOnPreview;
int previewVisual;
+ int previewQuality;
struct OpenNodesList
{
int type;
@@ -1412,6 +1413,7 @@
void updateAutoSaveClock();
void addBookmark(PageItem *);
void deleteBookmark(PageItem *);
+ void changeLayers(int);
public slots:
void selectionChanged();
Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Tue Apr 1 06:24:13 2014
@@ -101,7 +101,6 @@
#include "selection.h"
#include "selectionrubberband.h"
#include "serializer.h"
-#include "ui/adjustcmsdialog.h"
#include "ui/extimageprops.h"
#include "ui/guidemanager.h"
#include "ui/hruler.h"
@@ -181,118 +180,6 @@
// in case ClearType is not enabled
int posi = fo.pointSize() - (ScCore->isWinGUI() ? 1 : 2);
fo.setPointSize(posi);
- unitSwitcher = new QComboBox( this );
- unitSwitcher->setFocusPolicy(Qt::NoFocus);
- unitSwitcher->setFont(fo);
- int maxUindex = unitGetMaxIndex() - 2;
- for (int i = 0; i <= maxUindex; ++i)
- unitSwitcher->addItem(unitGetStrFromIndex(i));
- previewQualitySwitcher = new QComboBox( this );
- previewQualitySwitcher->setFocusPolicy(Qt::NoFocus);
- previewQualitySwitcher->setFont(fo);
- previewQualitySwitcher->addItem(tr("High"));
- previewQualitySwitcher->addItem(tr("Normal"));
- previewQualitySwitcher->addItem(tr("Low"));
-// setCurrentComboItem(previewQualitySwitcher, tr("Normal"));
- previewQualitySwitcher->setCurrentIndex(Prefs->itemToolPrefs.imageLowResType);
-
- zoomSpinBox = new ScrSpinBox( 1, 32000, this, 6 );
- zoomSpinBox->setTabAdvance(false);
- zoomSpinBox->setFont(fo);
- zoomSpinBox->setValue( 100 );
- zoomSpinBox->setSingleStep(10);
- zoomSpinBox->setFocusPolicy(Qt::ClickFocus);
- zoomSpinBox->setSuffix( tr( " %" ) );
-#if OPTION_USE_QTOOLBUTTON
- zoomOutToolbarButton = new QToolButton(this);
- zoomDefaultToolbarButton = new QToolButton(this);
- zoomInToolbarButton = new QToolButton(this);
- cmsToolbarButton = new QToolButton(this);
- previewToolbarButton = new QToolButton(this);
- zoomDefaultToolbarButton->setAutoRaise(OPTION_FLAT_BUTTON);
- zoomOutToolbarButton->setAutoRaise(OPTION_FLAT_BUTTON);
- zoomInToolbarButton->setAutoRaise(OPTION_FLAT_BUTTON);
- zoomInToolbarButton->setDefaultAction(m_ScMW->scrActions["toolsZoomIn"]);
- zoomOutToolbarButton->setDefaultAction(m_ScMW->scrActions["toolsZoomOut"]);
- 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);
- zoomDefaultToolbarButton->setDefault( false );
- zoomDefaultToolbarButton->setAutoDefault( false );
- zoomDefaultToolbarButton->setFlat(OPTION_FLAT_BUTTON);
- zoomOutToolbarButton = new QPushButton(this);
- zoomOutToolbarButton->setFocusPolicy(Qt::NoFocus);
- zoomOutToolbarButton->setDefault( false );
- zoomOutToolbarButton->setAutoDefault( false );
- zoomOutToolbarButton->setFlat(OPTION_FLAT_BUTTON);
- zoomInToolbarButton = new QPushButton(this);
- zoomInToolbarButton->setFocusPolicy(Qt::NoFocus);
- 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"));
-#endif
- cmsAdjustMenu = new QMenu();
- idCmsAdjustMenu = cmsAdjustMenu->addAction( "Configure CMS...", this, SLOT(adjustCMS()));
- cmsToolbarButton->setMenu(cmsAdjustMenu);
-#if OPTION_USE_QTOOLBUTTON
- cmsToolbarButton->setPopupMode(QToolButton::DelayedPopup);
-#endif
- //zoomDefaultToolbarButton->setText("1:1");
- zoomDefaultToolbarButton->setIcon(QIcon(loadIcon("16/zoom-original.png")));
- zoomOutToolbarButton->setIcon(QIcon(loadIcon("16/zoom-out.png")));
- zoomInToolbarButton->setIcon(QIcon(loadIcon("16/zoom-in.png")));
- pageSelector = new PageSelector(this, Doc->Pages->count());
- pageSelector->setFont(fo);
- pageSelector->setFocusPolicy(Qt::ClickFocus);
- layerMenu = new QComboBox( this );
- layerMenu->setEditable(false);
- 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);
horizRuler = new Hruler(this, Doc);
vertRuler = new Vruler(this, Doc);
horizRuler->installEventFilter(this);
@@ -328,18 +215,6 @@
// m_SnapCounter = 0;
Doc->regionsChanged()->connectObserver(this);
-// connect(zoomOutToolbarButton, SIGNAL(clicked()), this, SLOT(slotZoomOut()));
-// connect(zoomInToolbarButton, SIGNAL(clicked()), this, SLOT(slotZoomIn()));
- connect(zoomDefaultToolbarButton, SIGNAL(clicked()), this, SLOT(slotZoom100()));
- connect(zoomSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setZoom()));
- connect(pageSelector, SIGNAL(GotoPage(int)), this, SLOT(GotoPa(int)));
- connect(layerMenu, SIGNAL(activated(int)), this, SLOT(GotoLa(int)));
- connect(unitSwitcher, SIGNAL(activated(int)), this, SLOT(ChgUnit(int)));
- connect(previewQualitySwitcher, SIGNAL(activated(int)), this, SLOT(changePreviewQuality(int)));
- connect(previewToolbarButton, SIGNAL(clicked()), this, SLOT(togglePreview()));
- connect(editOnPreviewToolbarButton, SIGNAL(clicked()), this, SLOT(togglePreviewEdit()));
- connect(cmsToolbarButton, SIGNAL(clicked()), this, SLOT(toggleCMS()));
- connect(visualMenu, SIGNAL(activated(int)), this, SLOT(switchPreviewVisual(int)));
connect(this, SIGNAL(HaveSel(int)), Doc, SLOT(selectionChanged()));
// Commented out to fix bug #7865
// m_dragTimer = new QTimer(this);
@@ -353,7 +228,7 @@
endEditButton->setGeometry(m_vhRulerHW + 1, height() - m_vhRulerHW - endEditButton->minimumSizeHint().height() - 1, endEditButton->minimumSizeHint().width(), endEditButton->minimumSizeHint().height());
endEditButton->setVisible(false);
connect(endEditButton, SIGNAL(clicked()), m_ScMW, SLOT(slotFileClose()));
- editOnPreviewToolbarButton->hide();
+
m_oldSnapToElem = Doc->SnapElement;
languageChange();
}
@@ -379,31 +254,7 @@
void ScribusView::languageChange()
{
- zoomDefaultToolbarButton->setToolTip( tr("Zoom to 100%"));
- zoomOutToolbarButton->setToolTip( tr("Zoom out by the stepping value in Tools preferences"));
- zoomInToolbarButton->setToolTip( tr("Zoom in by the stepping value in Tools preferences"));
- zoomSpinBox->setToolTip( tr("Current zoom level"));
- cmsToolbarButton->setToolTip("");
- previewToolbarButton->setToolTip("");
- layerMenu->setToolTip( tr("Select the current layer"));
- unitSwitcher->setToolTip( tr("Select the current unit"));
- previewQualitySwitcher->setToolTip( tr("Select the image preview quality"));
- visualMenu->setToolTip("");
- 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"));
- visualMenu->setToolTip( tr("Select the visual appearance of the display. You can choose between normal and several color blindness forms"));
endEditButton->setToolTip( tr("Click here to leave this special edit mode."));
- disconnect(visualMenu, SIGNAL(activated(int)), this, SLOT(switchPreviewVisual(int)));
- visualMenu->clear();
- visualMenu->addItem(CommonStrings::trVisionNormal);
- visualMenu->addItem(CommonStrings::trVisionProtanopia);
- visualMenu->addItem(CommonStrings::trVisionDeuteranopia);
- visualMenu->addItem(CommonStrings::trVisionTritanopia);
- visualMenu->addItem(CommonStrings::trVisionFullColorBlind);
- visualMenu->setCurrentIndex(m_canvas->previewVisual());
- connect(visualMenu, SIGNAL(activated(int)), this, SLOT(switchPreviewVisual(int)));
}
void ScribusView::toggleCMS()
@@ -413,22 +264,6 @@
DrawNew();
}
-void ScribusView::adjustCMS()
-{
- AdjustCmsDialog* dia = new AdjustCmsDialog(this, Doc);
- if (dia->exec())
- {
- dia->tabColorManagement->updateDocSettings(Doc);
- if (dia->tabColorManagement->changed)
- {
- Doc->enableCMS(Doc->cmsSettings().CMSinUse);
- cmsToolbarButton->setChecked(Doc->HasCMS);
- m_ScMW->requestUpdate(reqCmsOptionsUpdate);
- DrawNew();
- }
- }
- delete dia;
-}
void ScribusView::switchPreviewVisual(int vis)
{
@@ -457,13 +292,13 @@
Doc->drawAsPreview = m_canvas->m_viewMode.viewAsPreview;
bool recalc = false;
Doc->editOnPreview = false;
- editOnPreviewToolbarButton->setChecked(false);
+ m_ScMW->editOnPreviewToolbarButton->setChecked(false);
m_AnnotChanged = false;
m_EditModeWasOn = false;
m_ChangedState = Doc->isModified();
if (m_canvas->m_viewMode.viewAsPreview)
{
- editOnPreviewToolbarButton->show();
+ m_ScMW->editOnPreviewToolbarButton->show();
storedFramesShown = Doc->guidesPrefs().framesShown;
Doc->guidesPrefs().framesShown = false;
storedShowControls = Doc->guidesPrefs().showControls;
@@ -481,23 +316,23 @@
{
if (m_AnnotChanged)
Doc->ResetFormFields();
- editOnPreviewToolbarButton->hide();
+ m_ScMW->editOnPreviewToolbarButton->hide();
Doc->guidesPrefs().framesShown = storedFramesShown;
Doc->guidesPrefs().showControls = storedShowControls;
- disconnect(visualMenu, SIGNAL(activated(int)), this, SLOT(switchPreviewVisual(int)));
- if (visualMenu->currentIndex() != Doc->previewVisual)
+ m_ScMW->visualMenu->blockSignals(true);
+ if (m_ScMW->visualMenu->currentIndex() != Doc->previewVisual)
recalc = true;
m_canvas->m_viewMode.previewVisual = 0;
Doc->previewVisual = 0;
- visualMenu->setCurrentIndex(0);
- connect(visualMenu, SIGNAL(activated(int)), this, SLOT(switchPreviewVisual(int)));
+ m_ScMW->visualMenu->setCurrentIndex(0);
+ m_ScMW->visualMenu->blockSignals(false);
}
m_ScMW->appModeHelper.setPreviewMode(m_canvas->m_viewMode.viewAsPreview);
m_ScMW->setPreviewToolbar();
#if OPTION_USE_QTOOLBUTTON
- previewToolbarButton->setChecked(m_canvas->m_viewMode.viewAsPreview);
+ m_ScMW->previewToolbarButton->setChecked(m_canvas->m_viewMode.viewAsPreview);
#endif
- visualMenu->setEnabled(m_canvas->m_viewMode.viewAsPreview);
+ m_ScMW->visualMenu->setEnabled(m_canvas->m_viewMode.viewAsPreview);
ScGuardedPtr<ScribusDoc> docPtr = Doc->guardedPtr();
if (recalc)
{
@@ -1304,7 +1139,7 @@
if (docCurrPageNo != i)
{
Doc->setCurrentPage(Doc->Pages->at(i));
- setMenTxt(i);
+ m_ScMW->setMenTxt(i);
DrawNew();
}
break;
@@ -2166,7 +2001,7 @@
//Note this picks up the new page or master page depending on the mode.
// reformPages(mov);
Doc->reformPages(mov);
- setMenTxt(nr);
+ m_ScMW->setMenTxt(nr);
m_canvas->m_viewMode.m_MouseButtonPressed = false;
Doc->DragP = false;
Doc->leaveDrag = false;
@@ -2197,7 +2032,7 @@
if (!Doc->isLoading())
{
setRulerPos(contentsX(), contentsY());
- setMenTxt(Doc->currentPage()->pageNr());
+ m_ScMW->setMenTxt(Doc->currentPage()->pageNr());
}
}
@@ -2358,17 +2193,6 @@
// evSpon = false;
}*/
-void ScribusView::setMenTxt(int Seite)
-{
- if (m_ScMW->scriptIsRunning())
- return;
- disconnect(pageSelector, SIGNAL(GotoPage(int)), this, SLOT(GotoPa(int)));
- pageSelector->setMaximum(Doc->masterPageMode() ? 1 : Doc->Pages->count());
- if ((!Doc->isLoading()) && (!Doc->masterPageMode()))
- pageSelector->GotoPg(Seite);
- connect(pageSelector, SIGNAL(GotoPage(int)), this, SLOT(GotoPa(int)));
-}
-
void ScribusView::setZoom()
{
int x = qRound(qMax(contentsX() / m_canvas->scale(), 0.0));
@@ -2376,7 +2200,8 @@
int w = qRound(qMin(visibleWidth() / m_canvas->scale(), Doc->currentPage()->width()));
int h = qRound(qMin(visibleHeight() / m_canvas->scale(), Doc->currentPage()->height()));
rememberOldZoomLocation(w / 2 + x,h / 2 + y);
- zoom(oldX, oldY, zoomSpinBox->value() / 100.0 * Prefs->displayPrefs.displayScale, false);
+ //zoom(oldX, oldY, zoomSpinBox->value() / 100.0 * Prefs->displayPrefs.displayScale, false);
+ zoom(oldX, oldY, m_ScMW->zoomSpinBox->value() / 100.0 * Prefs->displayPrefs.displayScale, false);
setFocus();
}
@@ -2500,10 +2325,10 @@
m_canvas->resetRenderMode();
updateContents();
setRulerPos(contentsX(), contentsY());
- setMenTxt(Doc->currentPage()->pageNr());
- disconnect(zoomSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setZoom()));
- zoomSpinBox->setValue(m_canvas->scale()/Prefs->displayPrefs.displayScale*100);
- connect(zoomSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setZoom()));
+ m_ScMW->setMenTxt(Doc->currentPage()->pageNr());
+ disconnect(m_ScMW->zoomSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setZoom()));
+ m_ScMW->zoomSpinBox->setValue(m_canvas->scale()/Prefs->displayPrefs.displayScale*100);
+ connect(m_ScMW->zoomSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setZoom()));
}
void ScribusView::SetCCPo(double x, double y)
@@ -2522,29 +2347,6 @@
return;
QPoint nx = m_canvas->canvasToLocal(FPoint(x, y));
setContentsPos(nx.x(), nx.y());
-}
-
-void ScribusView::updateLayerMenu()
-{
- disconnect(layerMenu, SIGNAL(activated(int)), this, SLOT(GotoLa(int)));
- layerMenu->clear();
- QStringList newNames;
- Doc->orderedLayerList(&newNames);
- for (QStringList::Iterator it=newNames.begin(); it!=newNames.end(); ++it)
- {
- QPixmap pm(20,15);
- pm.fill(Doc->Layers.layerByName(*it)->markerColor);
- layerMenu->addItem(pm, *it);
- }
- connect(layerMenu, SIGNAL(activated(int)), this, SLOT(GotoLa(int)));
-}
-
-void ScribusView::setLayerMenuText(const QString &layerName)
-{
- disconnect(layerMenu, SIGNAL(activated(int)), this, SLOT(GotoLa(int)));
- if (layerMenu->count() != 0)
- setCurrentComboItem(layerMenu, layerName);
- connect(layerMenu, SIGNAL(activated(int)), this, SLOT(GotoLa(int)));
}
void ScribusView::GotoLa(int l)
@@ -2567,11 +2369,6 @@
horizRuler->update();
}
-void ScribusView::changePreviewQuality(int index)
-{
- Doc->allItems_ChangePreviewResolution(index);
- DrawNew();
-}
void ScribusView::GotoPa(int Seite)
{
@@ -2585,7 +2382,7 @@
Doc->setCurrentPage(Doc->Pages->at(Seite));
if (m_ScMW->scriptIsRunning())
return;
- setMenTxt(Seite);
+ m_ScMW->setMenTxt(Seite);
SetCPo(Doc->currentPage()->xOffset() - 10, Doc->currentPage()->yOffset() - 10);
m_ScMW->HaveNewSel(-1);
}
@@ -2599,7 +2396,7 @@
this->requestMode(modeNormal);
Doc->setMasterPageMode(true);
Doc->setCurrentPage(Doc->Pages->at(nr));
- pageSelector->setEnabled(false);
+ m_ScMW->pageSelector->setEnabled(false);
updateOn = false;
zoom();
oldX = qRound(Doc->currentPage()->xOffset()- 10);
@@ -2616,7 +2413,7 @@
if (Doc->masterPageMode())
this->requestMode(modeNormal);
Doc->setMasterPageMode(false);
- pageSelector->setEnabled(true);
+ m_ScMW->pageSelector->setEnabled(true);
endEditButton->setVisible(false);
resizeContents(qRound((Doc->maxCanvasCoordinate.x() - Doc->minCanvasCoordinate.x()) * m_canvas->scale()), qRound((Doc->maxCanvasCoordinate.y() - Doc->minCanvasCoordinate.y()) * m_canvas->scale()));
}
@@ -2629,8 +2426,8 @@
this->requestMode(modeNormal);
Doc->setSymbolEditMode(true, symbolName);
Doc->setCurrentPage(Doc->Pages->at(0));
- pageSelector->setEnabled(false);
- layerMenu->setEnabled(false);
+ m_ScMW->pageSelector->setEnabled(false);
+ m_ScMW->layerMenu->setEnabled(false);
updateOn = false;
zoom();
oldX = qRound(Doc->currentPage()->xOffset()- 10);
@@ -2651,8 +2448,8 @@
updatesOn(true);
endEditButton->setVisible(false);
Doc->setCurrentPage(Doc->Pages->at(0));
- pageSelector->setEnabled(true);
- layerMenu->setEnabled(true);
+ m_ScMW->pageSelector->setEnabled(true);
+ m_ScMW->layerMenu->setEnabled(true);
resizeContents(qRound((Doc->maxCanvasCoordinate.x() - Doc->minCanvasCoordinate.x()) * m_canvas->scale()), qRound((Doc->maxCanvasCoordinate.y() - Doc->minCanvasCoordinate.y()) * m_canvas->scale()));
}
@@ -2664,8 +2461,8 @@
this->requestMode(modeNormal);
Doc->setInlineEditMode(true, id);
Doc->setCurrentPage(Doc->Pages->at(0));
- pageSelector->setEnabled(false);
- layerMenu->setEnabled(false);
+ m_ScMW->pageSelector->setEnabled(false);
+ m_ScMW->layerMenu->setEnabled(false);
updateOn = false;
zoom();
oldX = qRound(Doc->currentPage()->xOffset()- 10);
@@ -2686,8 +2483,8 @@
updatesOn(true);
endEditButton->setVisible(false);
Doc->setCurrentPage(Doc->Pages->at(0));
- pageSelector->setEnabled(true);
- layerMenu->setEnabled(true);
+ m_ScMW->pageSelector->setEnabled(true);
+ m_ScMW->layerMenu->setEnabled(true);
resizeContents(qRound((Doc->maxCanvasCoordinate.x() - Doc->minCanvasCoordinate.x()) * m_canvas->scale()), qRound((Doc->maxCanvasCoordinate.y() - Doc->minCanvasCoordinate.y()) * m_canvas->scale()));
}
@@ -4136,9 +3933,9 @@
m_canvas->setScale(Scale);
- zoomSpinBox->blockSignals(true);
- zoomSpinBox->setValue(m_canvas->scale()/Prefs->displayPrefs.displayScale*100);
- zoomSpinBox->blockSignals(false);
+ m_ScMW->zoomSpinBox->blockSignals(true);
+ m_ScMW->zoomSpinBox->setValue(m_canvas->scale()/Prefs->displayPrefs.displayScale*100);
+ m_ScMW->zoomSpinBox->blockSignals(false);
unitChange();
}
Modified: trunk/Scribus/scribus/scribusview.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/scribusview.h
==============================================================================
--- trunk/Scribus/scribus/scribusview.h (original)
+++ trunk/Scribus/scribus/scribusview.h Tue Apr 1 06:24:13 2014
@@ -120,30 +120,9 @@
void stopGesture();
/** Vergroesserungseingabefeld */
- ScrSpinBox* zoomSpinBox; //zoom spinbox at bottom of view
- PageSelector* pageSelector; //Page selector at bottom of view
RulerMover *rulerMover; //Widget between the two rulers for dragging the ruler origin
Hruler *horizRuler;
Vruler *vertRuler;
-#if OPTION_USE_QTOOLBUTTON
- 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;
ClockWidget *clockLabel;
QPushButton *endEditButton;
/** Dokument zu dem die Seite gehoert */
@@ -187,7 +166,6 @@
void reformPages(bool moveObjects = true);
void reformPagesView();
- void updateLayerMenu();
void showMasterPage(int nr);
void hideMasterPage();
void showSymbolPage(QString symbolName);
@@ -269,19 +247,10 @@
void slotZoomOut(int mx=0,int my=0);
/** Redraws everything */
void DrawNew();
- void setMenTxt(int Seite);
- void setLayerMenuText(const QString &);
void GotoPa(int Seite);
void GotoLa(int l);
void GotoPage(int Seite);
void ChgUnit(int art);
-
- /*! \brief Change canvas preview quality for image items.
- Called by previewQualitySwitcher (signal).
- See void ScribusDoc::allItems_ChangePreviewResolution(int id)
- for changing itself
- */
- void changePreviewQuality(int index);
void SetCPo(double x, double y);
void SetCCPo(double x, double y);
@@ -306,8 +275,6 @@
int m_previousMode;
QMenu *pmen3;
QMenu *pmenResolution;
- QMenu *cmsAdjustMenu;
- QAction *idCmsAdjustMenu;
QPoint m_pressLocation;
QTime m_moveTimer;
QTimer *m_dragTimer;
Modified: trunk/Scribus/scribus/scribuswin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/scribuswin.cpp
==============================================================================
--- trunk/Scribus/scribus/scribuswin.cpp (original)
+++ trunk/Scribus/scribus/scribuswin.cpp Tue Apr 1 06:24:13 2014
@@ -44,7 +44,6 @@
setWindowIcon(loadIcon("AppIcon2.png"));
setAttribute(Qt::WA_DeleteOnClose);
m_Doc = doc;
- currentDir = QDir::currentPath();
}
void ScribusWin::setMainWindow(ScribusMainWindow *mw)
@@ -57,38 +56,8 @@
m_View = newView;
++m_Doc->viewCount;
winIndex = ++m_Doc->viewID;
- statusFrame = new QFrame(this);
- statusFrameLayout = new QHBoxLayout(statusFrame);
- statusFrameLayout->setMargin(0);
- statusFrameLayout->setSpacing(0);
- m_View->unitSwitcher->setParent(statusFrame);
- m_View->previewQualitySwitcher->setParent(statusFrame);
- m_View->layerMenu->setParent(statusFrame);
- m_View->zoomOutToolbarButton->setParent(statusFrame);
- m_View->zoomDefaultToolbarButton->setParent(statusFrame);
- m_View->zoomInToolbarButton->setParent(statusFrame);
- m_View->pageSelector->setParent(statusFrame);
- m_View->zoomSpinBox->setParent(statusFrame);
- m_View->cmsToolbarButton->setParent(statusFrame);
- m_View->previewToolbarButton->setParent(statusFrame);
- m_View->visualMenu->setParent(statusFrame);
- statusFrameLayout->addWidget(m_View->unitSwitcher);
- statusFrameLayout->addWidget(m_View->zoomSpinBox);
- statusFrameLayout->addWidget(m_View->zoomOutToolbarButton);
- statusFrameLayout->addWidget(m_View->zoomDefaultToolbarButton);
- statusFrameLayout->addWidget(m_View->zoomInToolbarButton);
- statusFrameLayout->addWidget(m_View->pageSelector);
- statusFrameLayout->addWidget(m_View->layerMenu);
- QSpacerItem* spacer = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum );
- statusFrameLayout->addItem( spacer );
- statusFrameLayout->addWidget(m_View->cmsToolbarButton);
- statusFrameLayout->addWidget(m_View->editOnPreviewToolbarButton);
- statusFrameLayout->addWidget(m_View->previewToolbarButton);
- statusFrameLayout->addWidget(m_View->previewQualitySwitcher);
- statusFrameLayout->addWidget(m_View->visualMenu);
- statusBar()->addPermanentWidget(statusFrame, 4);
- currentDir = QDir::currentPath();
setCentralWidget(newView);
+ setStatusBar(0);
}
void ScribusWin::slotSaved(QString newName)
Modified: trunk/Scribus/scribus/scribuswin.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/scribuswin.h
==============================================================================
--- trunk/Scribus/scribus/scribuswin.h (original)
+++ trunk/Scribus/scribus/scribuswin.h Tue Apr 1 06:24:13 2014
@@ -56,8 +56,6 @@
ScribusDoc* doc() const { return m_Doc;}
QMdiSubWindow* getSubWin() { return subWindow; }
void setSubWin(QMdiSubWindow *win) { subWindow = win; }
- void setMenuStatus(int index, bool value) { if (index>=0 && index <=6) MenuStat[index]=value;}
- bool menuStatus(int index) const { if (index>=0 && index <=6) return MenuStat[index]; else return false; }
public slots:
void slotSaved(QString newName);
@@ -66,14 +64,12 @@
void AutoSaved();
protected:
- QString currentDir;
QHBoxLayout* statusFrameLayout;
ScribusMainWindow* m_MainWindow;
ScribusView* m_View;
ScribusDoc* m_Doc;
- QFrame *statusFrame;
+ //QFrame *statusFrame;
QMdiSubWindow* subWindow;
- bool MenuStat[7];
int winIndex;
};
Modified: trunk/Scribus/scribus/ui/pageselector.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/ui/pageselector.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pageselector.cpp (original)
+++ trunk/Scribus/scribus/ui/pageselector.cpp Tue Apr 1 06:24:13 2014
@@ -169,6 +169,12 @@
return APage;
}
+void PageSelector::setCurrentPage(int i)
+{
+// int j=qMax(LastPG, i);
+// APage
+}
+
void PageSelector::GotoPgE(int a)
{
clearFocus();
@@ -190,7 +196,8 @@
void PageSelector::GotoPg(int a)
{
- disconnect( PageCombo, SIGNAL( activated(int) ), this, SLOT( GotoPgE(int) ) );
+ //disconnect( PageCombo, SIGNAL( activated(int) ), this, SLOT( GotoPgE(int) ) );
+ PageCombo->blockSignals(true);
PageCombo->setCurrentIndex(a);
setCurrentComboItem(PageCombo, QString::number(a+1));
APage = a+1;
@@ -208,7 +215,8 @@
Forward->setEnabled(false);
Last->setEnabled(false);
}
- connect( PageCombo, SIGNAL( activated(int) ), this, SLOT( GotoPgE(int) ) );
+ PageCombo->blockSignals(false);
+ //connect( PageCombo, SIGNAL( activated(int) ), this, SLOT( GotoPgE(int) ) );
}
void PageSelector::setMaximum(int a)
Modified: trunk/Scribus/scribus/ui/pageselector.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18972&path=/trunk/Scribus/scribus/ui/pageselector.h
==============================================================================
--- trunk/Scribus/scribus/ui/pageselector.h (original)
+++ trunk/Scribus/scribus/ui/pageselector.h Tue Apr 1 06:24:13 2014
@@ -36,6 +36,7 @@
void focusPolicy(Qt::FocusPolicy policy);
void setFont ( const QFont & );
int getCurrentPage();
+ void setCurrentPage(int i);
#if OPTION_USE_QTOOLBUTTON
QToolButton* Start;
More information about the scribus-commit
mailing list