Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 5225 → Rev 5226

/branches/Version13x/Scribus/scribus/mpalette.cpp
1050,8 → 1050,9
connect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
connect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
setPrintingEnabled(i->printEnabled());
setLocked(i->locked());
setSizeLocked(i->sizeLocked());
//CB not needed, done from pageitem->emitalltogui or individual emit.
//setLocked(i->locked());
//setSizeLocked(i->sizeLocked());
if ((i->isTableItem) && (i->isSingleSel))
{
setter = true;
1352,7 → 1353,7
if (ScMW->ScriptRunning)
return;
int visID;
PageItem *i;
PageItem *i=0;
disconnect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
if (doc->m_Selection->count()>1)
{
1391,14 → 1392,29
TabStack->setItemEnabled(0, true);
NameEdit->setEnabled(false);
TabStack->setItemEnabled(5, true);
FlipH->setToggleButton( true );
FlipV->setToggleButton( true );
FlipH->setOn(false);
FlipV->setOn(false);
}
else
{
if (nr!=-1)
{
i=doc->m_Selection->itemAt(0);
HaveItem=true;
EditShape->setEnabled(!i->locked());
ShapeGroup->setEnabled(nr!=5 && nr!=7 && nr!=8 && !i->locked());
}
else
{
EditShape->setEnabled(false);
ShapeGroup->setEnabled(false);
}
NameEdit->setEnabled(true);
ShapeGroup->setEnabled(false);
RoundRect->setEnabled(false);
// ShapeGroup->setEnabled(false);
// RoundRect->setEnabled(false);
Distance->setEnabled(false);
EditShape->setEnabled(false);
LineMode->setEnabled(false);
TopLeft->setEnabled(true);
TopRight->setEnabled(true);
1417,9 → 1433,21
connect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
connect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
*/
//CB Why not for lines?
FlipH->setEnabled(nr!=-1 && nr!=5);
FlipV->setEnabled(nr!=-1 && nr!=5);
//CB If Toggle is not possible, then we need to enable it so we can turn it off
//It then gets reset below for items where its valid
if ((nr>4) && (nr<9))
{
FlipH->setToggleButton(true);
FlipV->setToggleButton(true);
FlipH->setOn(false);
FlipV->setOn(false);
}
FlipH->setToggleButton((nr>=0) && (nr<5));
FlipV->setToggleButton((nr>=0) && (nr<5));
//CB Why cant we do this for lines?
FlipH->setEnabled((nr!=-1) && (nr!=5));
FlipV->setEnabled((nr!=-1) && (nr!=5));
switch (nr)
{
case -1:
1429,6 → 1457,7
heightLabel->setText( tr( "&Height:" ) );
//Rot->setEnabled(true);
//Height->setEnabled(true);
RoundRect->setEnabled(false);
HaveItem = false;
Xpos->setValue(0);
Ypos->setValue(0);
1448,18 → 1477,14
TabStack->setItemEnabled(2, false);
TabStack->setItemEnabled(3, true);
TabStack->setItemEnabled(4, true);
ShapeGroup->setEnabled(true);
i = doc->m_Selection->itemAt(0);
if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
RoundRect->setEnabled(true);
RoundRect->setEnabled(!i->locked());
else
RoundRect->setEnabled(false);
if ((doc->m_Selection->itemAt(0)->FrameType == 0) || (doc->m_Selection->itemAt(0)->FrameType == 2))
RoundRect->setEnabled(true);
EditShape->setEnabled(true);
RoundRect->setEnabled(!i->locked());
if (visID == 2)
TabStack->setCurrentIndex(0);
HaveItem = true;
break;
case 4:
TabStack->setItemEnabled(1, true);
1466,17 → 1491,13
TabStack->setItemEnabled(2, true);
TabStack->setItemEnabled(3, false);
TabStack->setItemEnabled(4, true);
ShapeGroup->setEnabled(true);
i = doc->m_Selection->itemAt(0);
if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
RoundRect->setEnabled(true);
RoundRect->setEnabled(!i->locked());
else
RoundRect->setEnabled(false);
Distance->setEnabled(true);
EditShape->setEnabled(true);
if (visID == 3)
TabStack->setCurrentIndex(0);
HaveItem = true;
break;
case 5:
TabStack->setItemEnabled(1, false);
1483,6 → 1504,7
TabStack->setItemEnabled(2, false);
TabStack->setItemEnabled(3, false);
TabStack->setItemEnabled(4, true);
RoundRect->setEnabled(false);
LineMode->setEnabled(true);
TopLeft->setEnabled(false);
TopRight->setEnabled(false);
1491,7 → 1513,6
Center->setEnabled(false);
if ((visID == 1) || (visID == 2) || (visID == 3))
TabStack->setCurrentIndex(0);
HaveItem = true;
break;
case 1:
case 3:
1500,16 → 1521,12
TabStack->setItemEnabled(2, false);
TabStack->setItemEnabled(3, false);
TabStack->setItemEnabled(4, true);
ShapeGroup->setEnabled(true);
EditShape->setEnabled(true);
i = doc->m_Selection->itemAt(0);
if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
RoundRect->setEnabled(true);
RoundRect->setEnabled(!i->locked());
else
RoundRect->setEnabled(false);
if ((visID == 2) || (visID == 3))
TabStack->setCurrentIndex(0);
HaveItem = true;
break;
case 7:
TabStack->setItemEnabled(1, true);
1516,10 → 1533,9
TabStack->setItemEnabled(2, false);
TabStack->setItemEnabled(3, false);
TabStack->setItemEnabled(4, true);
EditShape->setEnabled(true);
RoundRect->setEnabled(false);
if ((visID == 2) || (visID == 3))
TabStack->setCurrentIndex(0);
HaveItem = true;
break;
case 8:
TabStack->setItemEnabled(1, true);
1526,10 → 1542,9
TabStack->setItemEnabled(2, true);
TabStack->setItemEnabled(3, false);
TabStack->setItemEnabled(4, true);
EditShape->setEnabled(true);
RoundRect->setEnabled(false);
if (visID == 3)
TabStack->setCurrentIndex(0);
HaveItem = true;
break;
}
}
2957,7 → 2972,6
if ((HaveDoc) && (HaveItem))
{
ScMW->view->LowerItem();
emit DocChanged();
}
}
 
2968,7 → 2982,6
if ((HaveDoc) && (HaveItem))
{
ScMW->view->RaiseItem();
emit DocChanged();
}
}
 
2979,7 → 2992,6
if ((HaveDoc) && (HaveItem))
{
ScMW->view->ToFront();
emit DocChanged();
}
}
 
2990,7 → 3002,6
if ((HaveDoc) && (HaveItem))
{
ScMW->view->ToBack();
emit DocChanged();
}
}
 
4097,11 → 4108,11
Height->setReadOnly(isLocked);
Rot->setReadOnly(isLocked);
EditShape->setEnabled(!isLocked);
ShapeGroup->setEnabled(!isLocked);
LayerGroup->setEnabled(!isLocked);
Locked->setOn(isLocked);
if ((HaveDoc) && (HaveItem))
{
ShapeGroup->setEnabled(!CurItem->asLine() && !CurItem->asPolyLine() && !CurItem->asPathText() && !isLocked);
if (((CurItem->asTextFrame()) || (CurItem->asImageFrame()) || (CurItem->asPolygon())) && (!CurItem->ClipEdited) && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)))
RoundRect->setEnabled(!isLocked);
else
/branches/Version13x/Scribus/scribus/pageitem_imageframe.h
55,7 → 55,7
~PageItem_ImageFrame() {};
 
virtual PageItem_ImageFrame * asImageFrame() { return this; }
virtual void handleModeEditKey(QKeyEvent *k, bool& keyRepeat);
virtual void clearContents();
protected:
/branches/Version13x/Scribus/scribus/scribusdoc.cpp
1070,6 → 1070,7
Pages->append(Buf.at(b));
break;
}
changed();
}
 
int ScribusDoc::addAutomaticTextFrame(const int pageNumber)
2022,6 → 2023,7
Ap->initialMargins.Left = Mp->Margins.Left;
Ap->initialMargins.Right = Mp->Margins.Right;
//TODO make a return false if not possible to apply the master page
changed();
return true;
}
 
3337,6 → 3339,7
GroupCounter = GrMax + 1;
}
setUsesAutomaticTextFrames(autoText);
changed();
}
 
void ScribusDoc::setLocationBasedPageLRMargins(const uint pageIndex)
4336,6 → 4339,7
}
if (selectedItemCount > 1)
undoManager->commit();
changed();
}
}
 
5214,7 → 5218,7
if (docSelectionCount > 1)
undoManager->commit();
changed();
emit firstSelectedItemType(m_Selection->itemAt(0)->itemType());
emit firstSelectedItemType(m_Selection->itemAt(0)->itemType());
}
}
 
5238,7 → 5242,7
if (selectedItemCount > 1)
undoManager->commit();
changed();
emit firstSelectedItemType(m_Selection->itemAt(0)->itemType());
emit firstSelectedItemType(m_Selection->itemAt(0)->itemType());
}
}
 
/branches/Version13x/Scribus/scribus/pageitem_imageframe.cpp
160,3 → 160,38
// emit UpdtObj(Doc->currentPage->pageNr(), ItemNr);
}
 
void PageItem_ImageFrame::handleModeEditKey(QKeyEvent *k, bool& keyRepeat)
{
double moveBy=1.0;
ButtonState buttonState = k->state();
if ((buttonState & ShiftButton) && !(buttonState & ControlButton))
moveBy=10.0;
else if ((buttonState & ShiftButton) && (buttonState & ControlButton) && !(buttonState & AltButton))
moveBy=0.1;
else if ((buttonState & ShiftButton) && (buttonState & ControlButton) && (buttonState & AltButton))
moveBy=0.01;
moveBy/=m_Doc->unitRatio();//Lets allow movement by the current doc ratio, not only points
double dX=0.0,dY=0.0;
int kk = k->key();
switch (kk)
{
case Key_Left:
dX=-moveBy;
break;
case Key_Right:
dX=moveBy;
break;
case Key_Up:
dY=-moveBy;
break;
case Key_Down:
dY=moveBy;
break;
}
if (dX!=0.0 || dY!=0.0)
{
moveImageInFrame(dX, dY);
ScribusView* view = m_Doc->view();
view->updateContents(getRedrawBounding(view->scale()));
}
}
/branches/Version13x/Scribus/scribus/scribus.cpp
679,7 → 679,7
scrMenuMgr->addMenuItem(scrActions["editEditWithImageEditor"], "Edit");
scrMenuMgr->addMenuSeparator("Edit");
scrMenuMgr->addMenuItem(scrActions["editColors"], "Edit");
// scrMenuMgr->addMenuItem(scrActions["editStyles"], "Edit");
scrMenuMgr->addMenuItem(scrActions["editStyles"], "Edit");
scrMenuMgr->addMenuItem(scrActions["editParaStyles"], "Edit");
scrMenuMgr->addMenuItem(scrActions["editLineStyles"], "Edit");
scrMenuMgr->addMenuItem(scrActions["editMasterPages"], "Edit");
1460,7 → 1460,6
if (!currItem->locked())
{
view->RaiseItem();
slotDocCh();
}
break;
case Key_Next:
1467,7 → 1466,6
if (!currItem->locked())
{
view->LowerItem();
slotDocCh();
}
break;
case Key_Left:
1661,6 → 1659,8
case modeEdit:
if (currItem->asImageFrame() && !currItem->locked())
{
currItem->handleModeEditKey(k, keyrep);
/*
double dX=0.0,dY=0.0;
switch (kk)
{
1681,7 → 1681,7
{
currItem->moveImageInFrame(dX, dY);
view->updateContents(currItem->getRedrawBounding(view->scale()));
}
}*/
}
view->oldCp = currItem->CPos;
if (currItem->itemType() == PageItem::TextFrame)
1708,13 → 1708,10
 
void ScribusMainWindow::keyReleaseEvent(QKeyEvent *k)
{
if (k->state() & ControlButton)
if (HaveDoc && (k->state() & ControlButton))
{
if (HaveDoc)
{
if ((doc->appMode == modePanning) && (k->state() & Qt::RightButton))
setAppMode(modeNormal);
}
if ((doc->appMode == modePanning) && (k->state() & Qt::RightButton))
setAppMode(modeNormal);
}
if (k->isAutoRepeat() || !_arrowKeyDown)
return;
1816,11 → 1813,10
bool autoframes = dia->AutoFrame->isChecked();
int orientation = dia->Orient;
int pageCount=dia->PgNum->value();
PageSize *ps2 = new PageSize(dia->pageSizeComboBox->currentText());
QString pagesize = ps2->getPageName();
PageSize ps2(dia->pageSizeComboBox->currentText());
QString pagesize = ps2.getPageName();
doFileNew(pageWidth, pageHeight, topMargin, leftMargin, rightMargin, bottomMargin, columnDistance, numberCols, autoframes, facingPages, dia->ComboBox3->currentItem(), firstPage, orientation, 1, pagesize, pageCount);
doc->pageSets[facingPages].FirstPage = firstPage;
delete ps2;
HaveNewDoc();
}
else
1866,12 → 1862,11
bool autoframes = dia->AutoFrame->isChecked();
int orientation = dia->Orient;
int pageCount=dia->PgNum->value();
PageSize *ps2 = new PageSize(dia->pageSizeComboBox->currentText());
QString pagesize = ps2->getPageName();
PageSize ps2(dia->pageSizeComboBox->currentText());
QString pagesize = ps2.getPageName();
retVal = doFileNew(pageWidth, pageHeight, topMargin, leftMargin, rightMargin, bottomMargin, columnDistance, numberCols, autoframes, facingPages, dia->ComboBox3->currentItem(), firstPage, orientation, 1, pagesize, pageCount);
doc->pageSets[facingPages].FirstPage = firstPage;
mainWindowStatusLabel->setText( tr("Ready"));
delete ps2;
HaveNewDoc();
}
else
2814,7 → 2809,7
if (currItem->FrameType > 3)
SCustom->setPixmap(SCustom->getIconPixmap(currItem->FrameType-2));
actionManager->connectNewSelectionActions(view, doc);
propertiesPalette->NewSel(Nr);
// propertiesPalette->NewSel(Nr);
}
else
propertiesPalette->NewSel(Nr);
3733,10 → 3728,12
gtGetText* gt = new gtGetText();
gt->run(true);
delete gt;
//CB Hyphenating now emits doc changed, plus we change lang as appropriate
if (doc->docHyphenator->AutoCheck)
doc->docHyphenator->slotHyphenate(doc->m_Selection->itemAt(0));
doc->itemSelection_DoHyphenate();
//doc->docHyphenator->slotHyphenate(doc->m_Selection->itemAt(0));
view->DrawNew();
slotDocCh();
//slotDocCh();
}
}
 
5664,8 → 5661,6
emit TextStil(s);
}
 
 
//CB-->Doc ????
void ScribusMainWindow::setItemHoch(int h)
{
if (doc->m_Selection->count() != 0)
5673,7 → 5668,6
doc->CurrentStyle = h;
setStilvalue(doc->CurrentStyle);
doc->chTyStyle(h);
slotDocCh();
}
}
 
5851,16 → 5845,15
int to = dia->getToPage();
int wie = dia->getWhere();
int wo = dia->getWherePage();
if ((from != wo) || (wie == 2))
if ((from != wo) || (wie == 2 && (to!=doc->Pages->count())))
{
doc->movePage(from-1, to, wo-1, wie);
view->reformPages();
view->DrawNew();
pagePalette->RebuildPage();
outlinePalette->BuildTree();
outlinePalette->reopenTree(doc->OpenNodes);
}
slotDocCh();
view->DrawNew();
pagePalette->RebuildPage();
outlinePalette->BuildTree();
outlinePalette->reopenTree(doc->OpenNodes);
}
delete dia;
}
5878,7 → 5871,6
doc->copyPage(pageNumberToCopy, wo, whereToInsert, copyCount);
view->Deselect(true);
view->DrawNew();
slotDocCh(); //FIXME emit from doc
pagePalette->RebuildPage();
outlinePalette->BuildTree();
}
5912,7 → 5904,6
sizeName, doc->currentPage()->pageNr());
view->reformPages(dia->getMoveObjects());
view->DrawNew();
slotDocCh();
}
delete dia;
}
7611,7 → 7602,6
if (reb)
{
view->DrawNew();
slotDocCh();
pagePalette->Rebuild();
}
}