r18549 by fschmid - Restore old behaviour of the "Recent Files" menu:
scribus-commit
scribus-commit at lists.scribus.net
Sat Oct 12 18:44:21 UTC 2013
Author: fschmid
Date: Sat Oct 12 18:44:21 2013
New Revision: 18549
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18549
Log:
Restore old behaviour of the "Recent Files" menu:
- "Open" Toolbutton with delayed popup
- Menu sorted with most recent file on top
Modified:
trunk/Scribus/scribus/menumanager.cpp
trunk/Scribus/scribus/menumanager.h
trunk/Scribus/scribus/plugins/import/pub/importpub.cpp
trunk/Scribus/scribus/scribus.cpp
trunk/Scribus/scribus/scribus.h
trunk/Scribus/scribus/ui/filetoolbar.cpp
Modified: trunk/Scribus/scribus/menumanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18549&path=/trunk/Scribus/scribus/menumanager.cpp
==============================================================================
--- trunk/Scribus/scribus/menumanager.cpp (original)
+++ trunk/Scribus/scribus/menumanager.cpp Sat Oct 12 18:44:21 2013
@@ -296,35 +296,35 @@
}
-void MenuManager::addMenuItemStringstoSpecialMenu(const QString &menuName, const QMap<QString, QPointer<ScrAction> > &menuActions)
+void MenuManager::addMenuItemStringstoSpecialMenu(const QString &menuName, const QHash<QString, QPointer<ScrAction> > &menuActions)
{
if (menuName=="FileOpenRecent" && recentFileMenu!=NULL)
{
- for( QMap<QString, QPointer<ScrAction> >::ConstIterator it = menuActions.begin(); it!=menuActions.end(); ++it )
+ for( QHash<QString, QPointer<ScrAction> >::ConstIterator it = menuActions.begin(); it!=menuActions.end(); ++it )
recentFileMenu->addAction(*it);
}
else if (menuName=="Windows" && windowsMenu!=NULL)
{
- for( QMap<QString, QPointer<ScrAction> >::ConstIterator it = menuActions.begin(); it!=menuActions.end(); ++it )
+ for( QHash<QString, QPointer<ScrAction> >::ConstIterator it = menuActions.begin(); it!=menuActions.end(); ++it )
windowsMenu->addAction(*it);
}
else if (menuName=="ItemSendToScrapbook" && itemSendtoScrapbookMenu!=NULL)
{
- for( QMap<QString, QPointer<ScrAction> >::ConstIterator it = menuActions.begin(); it!=menuActions.end(); ++it )
+ for( QHash<QString, QPointer<ScrAction> >::ConstIterator it = menuActions.begin(); it!=menuActions.end(); ++it )
{
itemSendtoScrapbookMenu->addAction(*it);
}
}
else if (menuName=="ItemLayer" && itemLayerMenu!=NULL)
{
- for( QMap<QString, QPointer<ScrAction> >::ConstIterator it = menuActions.begin(); it!=menuActions.end(); ++it )
+ for( QHash<QString, QPointer<ScrAction> >::ConstIterator it = menuActions.begin(); it!=menuActions.end(); ++it )
{
itemLayerMenu->addAction(*it);
}
}
else if (menuName=="EditPasteRecent" && editPasteRecentMenu!=NULL)
{
- for( QMap<QString, QPointer<ScrAction> >::ConstIterator it = menuActions.begin(); it!=menuActions.end(); ++it )
+ for( QHash<QString, QPointer<ScrAction> >::ConstIterator it = menuActions.begin(); it!=menuActions.end(); ++it )
{
editPasteRecentMenu->addAction(*it);
}
Modified: trunk/Scribus/scribus/menumanager.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18549&path=/trunk/Scribus/scribus/menumanager.h
==============================================================================
--- trunk/Scribus/scribus/menumanager.h (original)
+++ trunk/Scribus/scribus/menumanager.h Sat Oct 12 18:44:21 2013
@@ -80,7 +80,7 @@
void addMenuItemString(const QString& s, const QString &parent);
void addMenuItemStringstoMenuBar(const QString &menuName, const QMap<QString, QPointer<ScrAction> > &menuActions);
void addMenuItemStringstoMenu(const QString &menuName, QMenu *menuToAddTo, const QMap<QString, QPointer<ScrAction> > &menuActions);
- void addMenuItemStringstoSpecialMenu(const QString &menuName, const QMap<QString, QPointer<ScrAction> > &menuActions);
+ void addMenuItemStringstoSpecialMenu(const QString &menuName, const QHash<QString, QPointer<ScrAction> > &menuActions);
void clearMenuStrings(const QString &menuName);
void addMenuItemStringAfter(const QString &s, const QString &after, const QString &parent);
public slots:
Modified: trunk/Scribus/scribus/plugins/import/pub/importpub.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18549&path=/trunk/Scribus/scribus/plugins/import/pub/importpub.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pub/importpub.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pub/importpub.cpp Sat Oct 12 18:44:21 2013
@@ -13,6 +13,7 @@
#include <QMimeData>
#include <QRegExp>
#include <QStack>
+#include <QTextDocument>
#include <QDebug>
#include <cstdlib>
@@ -912,6 +913,9 @@
actText.replace(QChar(12), SpecialChars::FRAMEBREAK);
actText.replace(QChar(30), SpecialChars::NBHYPHEN);
actText.replace(QChar(160), SpecialChars::NBSPACE);
+ QTextDocument texDoc;
+ texDoc.setHtml(actText);
+ actText = texDoc.toPlainText();
actTextItem->itemText.insertChars(posC, actText);
actTextItem->itemText.applyStyle(posC, textStyle);
actTextItem->itemText.applyCharStyle(posC, actText.length(), textCharStyle);
Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18549&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Sat Oct 12 18:44:21 2013
@@ -3903,7 +3903,7 @@
Q_ASSERT(found);
scrLayersActions[QString("%1").arg((*it).ID)]->setChecked(true);
- for( QMap<QString, QPointer<ScrAction> >::Iterator it = scrLayersActions.begin(); it!=scrLayersActions.end(); ++it )
+ for( QHash<QString, QPointer<ScrAction> >::Iterator it = scrLayersActions.begin(); it!=scrLayersActions.end(); ++it )
{
//scrMenuMgr->addMenuItem((*it), "ItemLayer", true);
connect( (*it), SIGNAL(triggeredData(int)), doc, SLOT(itemSelection_SendToLayer(int)) );
@@ -3917,15 +3917,15 @@
{
if (HaveDoc)
{
- QMap<QString, QPointer<ScrAction> >::Iterator itend=scrLayersActions.end();
- for( QMap<QString, QPointer<ScrAction> >::Iterator it = scrLayersActions.begin(); it!=itend; ++it )
+ QHash<QString, QPointer<ScrAction> >::Iterator itend=scrLayersActions.end();
+ for( QHash<QString, QPointer<ScrAction> >::Iterator it = scrLayersActions.begin(); it!=itend; ++it )
{
disconnect( (*it), SIGNAL(triggeredData(int)), 0, 0 );
(*it)->setChecked(false);
}
if (doc->m_Selection->count()>0 && doc->m_Selection->itemAt(0))
scrLayersActions[QString("%1").arg(doc->m_Selection->itemAt(0)->LayerID)]->setChecked(true);
- for( QMap<QString, QPointer<ScrAction> >::Iterator it = scrLayersActions.begin(); it!=itend; ++it )
+ for( QHash<QString, QPointer<ScrAction> >::Iterator it = scrLayersActions.begin(); it!=itend; ++it )
connect( (*it), SIGNAL(triggeredData(int)), doc, SLOT(itemSelection_SendToLayer(int)) );
}
}
Modified: trunk/Scribus/scribus/scribus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18549&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h (original)
+++ trunk/Scribus/scribus/scribus.h Sat Oct 12 18:44:21 2013
@@ -236,12 +236,12 @@
QProcess *ExternalApp;
QMap<QString, QPointer<ScrAction> > scrActions;
- QMap<QString, QPointer<ScrAction> > scrRecentFileActions;
- QMap<QString, QPointer<ScrAction> > scrWindowsActions;
- QMap<QString, QPointer<ScrAction> > scrScrapActions;
- QMap<QString, QPointer<ScrAction> > scrLayersActions;
- QMap<QString, QPointer<ScrAction> > scrRecentPasteActions;
- QMap<QString, QPointer<ScToolBar> > scrToolBars;
+ QHash<QString, QPointer<ScrAction> > scrRecentFileActions;
+ QHash<QString, QPointer<ScrAction> > scrWindowsActions;
+ QHash<QString, QPointer<ScrAction> > scrScrapActions;
+ QHash<QString, QPointer<ScrAction> > scrLayersActions;
+ QHash<QString, QPointer<ScrAction> > scrRecentPasteActions;
+ QHash<QString, QPointer<ScToolBar> > scrToolBars;
QMultiHash<QString, QActionGroup*> scrActionGroups;
ScMWMenuManager* scrMenuMgr;
ActionManager* actionManager;
Modified: trunk/Scribus/scribus/ui/filetoolbar.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18549&path=/trunk/Scribus/scribus/ui/filetoolbar.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/filetoolbar.cpp (original)
+++ trunk/Scribus/scribus/ui/filetoolbar.cpp Sat Oct 12 18:44:21 2013
@@ -49,5 +49,6 @@
foreach (recentFileAction, parent->scrRecentFileActions)
m->addAction(recentFileAction);
tb->setMenu(m);
- tb->setPopupMode(QToolButton::MenuButtonPopup);
+// tb->setPopupMode(QToolButton::MenuButtonPopup);
+ tb->setPopupMode(QToolButton::DelayedPopup);
}
More information about the scribus-commit
mailing list