Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 4880 → Rev 4881

/branches/Version13x/Scribus/scribus/actionmanager.h
58,8 → 58,8
void connectNewSelectionActions(ScribusView *,ScribusDoc *);
void saveActionShortcutsPreEditMode();
void restoreActionShortcutsPostEditMode();
void enableActionStringList(QStringList *list, bool enabled, bool checkingUnicode=false);
void enableUnicodeActions(bool enabled);
void enableActionStringList(QMap<QString, QGuardedPtr<ScrAction> > *actionMap, QStringList *list, bool enabled, bool checkingUnicode=false, const QString& fontName=QString::null);
void enableUnicodeActions(QMap<QString, QGuardedPtr<ScrAction> > *actionMap, bool enabled, const QString& fontName=QString::null);
void setPDFActions(ScribusView *);
public slots:
/branches/Version13x/Scribus/scribus/story.cpp
2635,7 → 2635,9
return;
};
}
Editor->prevFont = Editor->CurrFont;
Editor->CurrFont = f;
updateUnicodeActions();
struct PtiSmall hg;
hg.cfont = Editor->CurrFont;
Editor->updateSel(2, &hg);
2768,6 → 2770,7
Editor->CurrTextFillSh = currItem->ShTxtFill;
Editor->CurrTextStroke = currItem->TxtStroke;
Editor->CurrTextStrokeSh = currItem->ShTxtStroke;
Editor->prevFont = Editor->CurrFont;
Editor->CurrFont = currItem->font();
Editor->CurrFontSize = currItem->fontSize();
Editor->CurrentStyle = currItem->TxTStyle;
2835,6 → 2838,7
}
Editor->setStyle(Editor->CurrentStyle);
firstSet = true;
updateUnicodeActions();
return;
}
chars = Editor->StyledText.at(p);
2843,6 → 2847,7
{
if (Editor->currentParaStyle > 4)
{
Editor->prevFont = Editor->CurrFont;
Editor->CurrFont = currDoc->docParagraphStyles[Editor->currentParaStyle].Font;
Editor->CurrFontSize = currDoc->docParagraphStyles[Editor->currentParaStyle].FontSize;
Editor->CurrentStyle = currDoc->docParagraphStyles[Editor->currentParaStyle].FontEffect;
2878,6 → 2883,7
Editor->CurrTextFillSh = hg->cshade;
Editor->CurrTextStroke = hg->cstroke;
Editor->CurrTextStrokeSh = hg->cshade2;
Editor->prevFont = Editor->CurrFont;
Editor->CurrFont = hg->cfont;
Editor->CurrFontSize = hg->csize;
Editor->CurrentStyle = hg->cstyle & 1919;
2941,6 → 2947,7
FontTools->SetScale(Editor->CurrTextScale);
FontTools->SetScaleV(Editor->CurrTextScaleV);
AlignTools->SetAlign(Editor->currentParaStyle);
updateUnicodeActions();
updateStatus();
}
 
3363,6 → 3370,7
{
if (!currDoc->docParagraphStyles[Editor->currentParaStyle].Font.isEmpty())
{
Editor->prevFont = Editor->CurrFont;
Editor->CurrFont = currDoc->docParagraphStyles[Editor->currentParaStyle].Font;
Editor->CurrFontSize = currDoc->docParagraphStyles[Editor->currentParaStyle].FontSize;
Editor->CurrentStyle = currDoc->docParagraphStyles[Editor->currentParaStyle].FontEffect;
3385,6 → 3393,7
Editor->CurrTextFillSh = currItem->ShTxtFill;
Editor->CurrTextStroke = currItem->TxtStroke;
Editor->CurrTextStrokeSh = currItem->ShTxtStroke;
Editor->prevFont = Editor->CurrFont;
Editor->CurrFont = currItem->font();
Editor->CurrFontSize = currItem->fontSize();
Editor->CurrentStyle = currItem->TxTStyle;
3509,6 → 3518,7
{
if (!currDoc->docParagraphStyles[Editor->currentParaStyle].Font.isEmpty())
{
Editor->prevFont = Editor->CurrFont;
Editor->CurrFont = currDoc->docParagraphStyles[Editor->currentParaStyle].Font;
Editor->CurrFontSize = currDoc->docParagraphStyles[Editor->currentParaStyle].FontSize;
Editor->CurrentStyle = currDoc->docParagraphStyles[Editor->currentParaStyle].FontEffect;
3531,6 → 3541,7
Editor->CurrTextFillSh = currItem->ShTxtFill;
Editor->CurrTextStroke = currItem->TxtStroke;
Editor->CurrTextStrokeSh = currItem->ShTxtStroke;
Editor->prevFont = Editor->CurrFont;
Editor->CurrFont = currItem->font();
Editor->CurrFontSize = currItem->fontSize();
Editor->CurrentStyle = currItem->TxTStyle;
3700,3 → 3711,9
EditorBar->setRepaint(true);
EditorBar->doRepaint();
}
 
void StoryEditor::updateUnicodeActions()
{
if (Editor->prevFont!=Editor->CurrFont)
ScMW->actionManager->enableUnicodeActions(&seActions, true, Editor->CurrFont);
}
/branches/Version13x/Scribus/scribus/actionmanager.cpp
62,7 → 62,7
initScriptMenuActions();
initHelpMenuActions();
initUnicodeActions(scrActions, ScMW, unicodeCharActionNames);
enableUnicodeActions(false);
enableUnicodeActions(scrActions, false);
initSpecialActions();
}
 
323,32 → 323,14
 
connect( (*scrActions)["itemDuplicate"], SIGNAL(activated()), ScMW, SLOT(ObjektDup()) );
connect( (*scrActions)["itemMulDuplicate"], SIGNAL(activated()), ScMW, SLOT(ObjektDupM()) );
//connect( (*scrActions)["itemDelete"], SIGNAL(activated()), ScMW, SLOT(DeleteObjekt()) );
connect( (*scrActions)["itemGroup"], SIGNAL(activated()), ScMW, SLOT(GroupObj()) );
connect( (*scrActions)["itemUngroup"], SIGNAL(activated()), ScMW, SLOT(UnGroupObj()) );
//connect( (*scrActions)["itemLock"], SIGNAL(activated()), ScMW, SLOT(ToggleObjLock()) );
//connect( (*scrActions)["itemLockSize"], SIGNAL(activated()), ScMW, SLOT(ToggleObjSizeLock()) );
//connect( (*scrActions)["itemPDFIsAnnotation"], SIGNAL(activated()), ScMW, SLOT(ToggleObjPDFAnnotation()) );
//connect( (*scrActions)["itemPDFIsBookmark"], SIGNAL(activated()), ScMW, SLOT(ToggleObjPDFBookmark()) );
connect( (*scrActions)["itemPDFAnnotationProps"], SIGNAL(activated()), ScMW, SLOT(ModifyAnnot()) );
connect( (*scrActions)["itemPDFFieldProps"], SIGNAL(activated()), ScMW, SLOT(ModifyAnnot()) );
//connect( (*scrActions)["itemLowerToBottom"], SIGNAL(activated()), ScMW, SLOT(Objekt2Back()) );
//connect( (*scrActions)["itemRaiseToTop"], SIGNAL(activated()), ScMW, SLOT(Objekt2Front()) );
//connect( (*scrActions)["itemLower"], SIGNAL(activated()), ScMW, SLOT(ObjektLower()) );
//connect( (*scrActions)["itemRaise"], SIGNAL(activated()), ScMW, SLOT(ObjektRaise()) );
connect( (*scrActions)["itemSendToScrapbook"], SIGNAL(activated()), ScMW, SLOT(PutScrap()) );
connect( (*scrActions)["itemAttributes"], SIGNAL(activated()), ScMW, SLOT(objectAttributes()) );
connect( (*scrActions)["itemShapeEdit"], SIGNAL(activated()), ScMW, SLOT(ToggleFrameEdit()) );
connect( (*scrActions)["itemImageInfo"], SIGNAL(activated()), ScMW, SLOT(getImageInfo()) );
//connect( (*scrActions)["itemAttachTextToPath"], SIGNAL(activated()), ScMW, SLOT(Pfadtext()) );
//connect( (*scrActions)["itemDetachTextFromPath"], SIGNAL(activated()), ScMW, SLOT(noPfadtext()) );
//connect( (*scrActions)["itemCombinePolygons"], SIGNAL(activated()), ScMW, SLOT(UniteOb()) );
//connect( (*scrActions)["itemSplitPolygons"], SIGNAL(activated()), ScMW, SLOT(SplitUniteOb()) );
//connect( (*scrActions)["itemConvertToBezierCurve"], SIGNAL(activated()), ScMW, SLOT(convertToBezierCurve()) );
//connect( (*scrActions)["itemConvertToImageFrame"], SIGNAL(activated()), ScMW, SLOT(convertToImageFrame()) );
//connect( (*scrActions)["itemConvertToOutlines"], SIGNAL(activated()), ScMW, SLOT(convertToOutlines()) );
//connect( (*scrActions)["itemConvertToPolygon"], SIGNAL(activated()), ScMW, SLOT(convertToPolygon()) );
//connect( (*scrActions)["itemConvertToTextFrame"], SIGNAL(activated()), ScMW, SLOT(convertToTextFrame()) );
}
 
void ActionManager::initInsertMenuActions()
732,10 → 714,7
disconnect( (*scrActions)["itemConvertToTextFrame"], 0, 0, 0);
disconnect( (*scrActions)["itemAttachTextToPath"], 0, 0, 0);
disconnect( (*scrActions)["itemDetachTextFromPath"], 0, 0, 0);
//disconnect( (*scrActions)["itemLock"], 0, 0, 0);
//disconnect( (*scrActions)["itemLockSize"], 0, 0, 0);
disconnect( (*scrActions)["itemAdjustFrameToImage"], 0, 0, 0 );
//disconnect( (*scrActions)["itemUpdateImage"], 0, 0, 0 );
disconnect( (*scrActions)["itemExtendedImageProperties"], 0, 0, 0 );
}
 
758,10 → 737,7
connect( (*scrActions)["itemConvertToTextFrame"], SIGNAL(activated()), currView, SLOT(ToTextFrame()) );
connect( (*scrActions)["itemAttachTextToPath"], SIGNAL(activated()), currView, SLOT(ToPathText()) );
connect( (*scrActions)["itemDetachTextFromPath"], SIGNAL(activated()), currView, SLOT(FromPathText()) );
//connect( (*scrActions)["itemLock"], SIGNAL(activated()), currView, SLOT(ToggleLock()) );
//connect( (*scrActions)["itemLockSize"], SIGNAL(activated()), currView, SLOT(ToggleSizeLock()) );
connect( (*scrActions)["itemAdjustFrameToImage"], SIGNAL(activated()), currView, SLOT(adjustFrametoImageSize()) );
//connect( (*scrActions)["itemUpdateImage"], SIGNAL(activated()), currView, SLOT(UpdatePic()) );
connect( (*scrActions)["itemExtendedImageProperties"], SIGNAL(activated()), currView, SLOT(editExtendedImageProperties()) );
}
 
801,35 → 777,38
(*scrActions)[*it]->restoreShortcut();
}
 
void ActionManager::enableActionStringList(QStringList *list, bool enabled, bool checkingUnicode)
void ActionManager::enableActionStringList(QMap<QString, QGuardedPtr<ScrAction> > *actionMap, QStringList *list, bool enabled, bool checkingUnicode, const QString& fontName)
{
for ( QStringList::Iterator it = list->begin(); it != list->end(); ++it )
{
if(!checkingUnicode)
(*scrActions)[*it]->setEnabled(enabled);
(*actionMap)[*it]->setEnabled(enabled);
else
{
//For UnicodeChar actions, only enable when the current font has that character.
if (ScMW->HaveDoc && (*scrActions)[*it]->actionType()==ScrAction::UnicodeChar)
if (ScMW->HaveDoc && (*actionMap)[*it]->actionType()==ScrAction::UnicodeChar)
{
int charCode=(*scrActions)[*it]->actionInt();
int charCode=(*actionMap)[*it]->actionInt();
if(charCode==-1 ||
charCode==24 ||
charCode==26 ||
charCode==27 ||
charCode==28 ||
charCode==29 ||
charCode==30 ||
(*ScMW->doc->AllFonts)[ScMW->doc->CurrFont]->CharWidth.contains(charCode) )
(*scrActions)[*it]->setEnabled(enabled);
charCode==24 ||
charCode==26 ||
charCode==27 ||
charCode==28 ||
charCode==29 ||
charCode==30 ||
((*ScMW->doc->AllFonts)[fontName]!=0 &&
(*ScMW->doc->AllFonts)[fontName]->CharWidth.contains(charCode)) )
(*actionMap)[*it]->setEnabled(true);
else
(*actionMap)[*it]->setEnabled(false);
}
}
}
}
 
void ActionManager::enableUnicodeActions(bool enabled)
void ActionManager::enableUnicodeActions(QMap<QString, QGuardedPtr<ScrAction> > *actionMap, bool enabled, const QString& fontName)
{
enableActionStringList(unicodeCharActionNames, enabled, enabled);
enableActionStringList(actionMap, unicodeCharActionNames, enabled, enabled, fontName);
}
 
void ActionManager::setPDFActions(ScribusView *currView)
/branches/Version13x/Scribus/scribus/pageitem_textframe.cpp
2257,20 → 2257,6
{
//Control Home for start of frame text
pos=0;
/*
// paragraph begin
if ( pos < len &&
itemText.at(pos)->ch.at(0).latin1() == 13 )
--pos;
while(pos > 0 )
if ( itemText.at(pos)->ch.at(0).latin1() == 13 )
{
++pos;
break;
}
else
--pos;
*/
}
CPos = pos;
if ( buttonState & ShiftButton )
2324,21 → 2310,6
{
//Control End for end of frame text
pos=static_cast<int>(itemText.count());
/*
// go to end of paragraph
if ( itemText.at(CPos)->ch.at(0).latin1() == 13 )
{
break;
}
pos = CPos;
while ( pos < len )
{
if ( itemText.at(pos)->ch.at(0).latin1() == 13 )
break;
else
++pos;
}
*/
CPos = pos;
}
if ( buttonState & ShiftButton )
/branches/Version13x/Scribus/scribus/scribus.cpp
2376,7 → 2376,7
scrActions["itemPreviewFull"]->setOn(false);
}
if ((Nr==-1) || (Nr!=-1 && !currItem->asTextFrame()))
actionManager->enableUnicodeActions(false);
actionManager->enableUnicodeActions(&scrActions, false);
scrActions["insertSampleText"]->setEnabled(false);
 
view->horizRuler->ItemPosValid = false;
2494,7 → 2494,7
scrActions["editSelectAll"]->setEnabled(true);
scrActions["insertGlyph"]->setEnabled(true);
if (currItem->asTextFrame())
actionManager->enableUnicodeActions(true);
actionManager->enableUnicodeActions(&scrActions, true, doc->CurrFont);
view->horizRuler->setItemPosition(currItem->xPos(), currItem->width());
if (currItem->lineColor() != CommonStrings::None)
view->horizRuler->lineCorr = currItem->lineWidth() / 2.0;
3117,7 → 3117,6
 
bool ScribusMainWindow::loadDoc(QString fileName)
{
bool undoWasEnabled=undoManager->undoEnabled();
undoManager->setUndoEnabled(false);
QFileInfo fi(fileName);
if (!fi.exists())
3219,7 → 3218,7
mainWindowStatusLabel->setText("");
mainWindowProgressBar->reset();
ActWin = NULL;
undoManager->setUndoEnabled(undoWasEnabled);
undoManager->setUndoEnabled(true);
if (windows.count() != 0)
newActWin(ActWinOld);
return false;
5183,6 → 5182,8
}
else
{
//CB Enable/Disable undo in frame edit mode
//undoManager->setUndoEnabled(false);
slotSelect();
nodePalette->setDoc(doc, view);
nodePalette->MoveN();
5261,6 → 5262,8
HaveNewSel(-1);
}
actionManager->connectModeActions();
//CB Enable/Disable undo in frame edit mode
//undoManager->setUndoEnabled(true);
}
 
void ScribusMainWindow::slotSelect()
5361,7 → 5364,7
scrActions["editPaste"]->setEnabled(false);
scrActions["insertGlyph"]->setEnabled(true);
if (currItem!=NULL && currItem->asTextFrame())
actionManager->enableUnicodeActions(true);
actionManager->enableUnicodeActions(&scrActions, true, doc->CurrFont);
if (!Buffer2.isNull())
{
// if (!Buffer2.startsWith("<SCRIBUSELEM"))
/branches/Version13x/Scribus/scribus/story.h
133,6 → 133,7
int CurrTextKern;
QString CurrTextStroke;
QString CurrTextFill;
QString prevFont;
QString CurrFont;
QString unicodeInputString;
QString tBuffer;
412,6 → 413,7
 
protected:
void initActions();
void updateUnicodeActions();
void buildMenus();
void buildGUI();
void connectSignals();