Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 23267 → Rev 23268

/trunk/Scribus/scribus/actionmanager.cpp
2528,8 → 2528,11
itnmenua->second << "unicodeLigature_st";
}
 
void ActionManager::handleMultipleSelections(bool isMultiple)
void ActionManager::handleMultipleSelections()
{
bool isMultiple = true;
if (mainWindow->HaveDoc && (mainWindow->doc->m_Selection->count() <= 1))
isMultiple = false;
(*scrActions)["itemAttributes"]->setEnabled(!isMultiple);
}
 
/trunk/Scribus/scribus/actionmanager.h
89,7 → 89,7
public slots:
void languageChange();
void handleMultipleSelections(bool isMultiple);
void handleMultipleSelections();
protected:
void initFileMenuActions();
/trunk/Scribus/scribus/scribus.cpp
2569,11 → 2569,11
connect(pageSelector, SIGNAL(GotoPage(int)), this, SLOT(setCurrentPage(int)));
pageSelector->setEnabled(true);
}
if (view!=nullptr)
if (view != nullptr)
{
actionManager->disconnectNewViewActions();
if (ScCore->usingGUI())
doc->m_Selection->disconnect(SIGNAL(selectionIsMultiple(bool)));
doc->m_Selection->disconnect(SIGNAL(selectionChanged()));
}
view = ActWin->view();
bool b = zoomSpinBox->blockSignals(true);
2583,7 → 2583,7
actionManager->disconnectNewDocActions();
actionManager->connectNewDocActions(doc);
if (ScCore->usingGUI())
connect(doc->m_Selection, SIGNAL(selectionIsMultiple(bool)), actionManager, SLOT( handleMultipleSelections(bool)));
connect(doc->m_Selection, SIGNAL(selectionChanged()), actionManager, SLOT(handleMultipleSelections()));
pagePalette->setView(view);
alignDistributePalette->setDoc(doc);
if (!doc->isLoading())
/trunk/Scribus/scribus/selection.cpp
27,8 → 27,7
QObject(parent),
m_isGUISelection(false),
m_delaySignals(0),
m_sigSelectionChanged(false),
m_sigSelectionIsMultiple(false)
m_sigSelectionChanged(false)
{
m_groupX = m_groupY = m_groupW = m_groupH = 0;
m_visualGX = m_visualGY = m_visualGW = m_visualGH = 0;
38,8 → 37,7
QObject(parent),
m_isGUISelection(guiSelection),
m_delaySignals(0),
m_sigSelectionChanged(false),
m_sigSelectionIsMultiple(false)
m_sigSelectionChanged(false)
{
m_groupX = m_groupY = m_groupW = m_groupH = 0;
m_visualGX = m_visualGY = m_visualGW = m_visualGH = 0;
55,8 → 53,7
// We do not copy m_delaySignals as that can potentially
// cause much trouble balancing delaySignalOff/On right
m_delaySignals(0),
m_sigSelectionChanged(other.m_sigSelectionChanged),
m_sigSelectionIsMultiple(other.m_sigSelectionIsMultiple)
m_sigSelectionChanged(other.m_sigSelectionChanged)
{
if (m_isGUISelection && !m_SelList.isEmpty())
{
63,7 → 60,7
m_SelList[0]->connectToGUI();
m_SelList[0]->emitAllToGUI();
m_SelList[0]->setSelected(true);
emit selectionIsMultiple(m_SelList.count() > 1);
emit selectionChanged();
}
m_groupX = other.m_groupX;
m_groupY = other.m_groupY;
85,19 → 82,18
for (SelectionList::Iterator it = m_SelList.begin(); it != itend; ++it)
(*it)->setSelected(false);
}
m_SelList=other.m_SelList;
m_SelList = other.m_SelList;
// Do not copy m_isGUISelection for consistency with cpy ctor
/* m_isGUISelection = other.m_isGUISelection; */
// We do not copy m_delaySignals as that can potentially
// cause much trouble balancing delaySignalOff/On right
m_sigSelectionChanged = other.m_sigSelectionChanged;
m_sigSelectionIsMultiple = other.m_sigSelectionIsMultiple;
if (m_isGUISelection && !m_SelList.isEmpty())
{
m_SelList[0]->connectToGUI();
m_SelList[0]->emitAllToGUI();
m_SelList[0]->setSelected(true);
emit selectionIsMultiple(m_SelList.count() > 1);
emit selectionChanged();
}
return *this;
}
114,7 → 110,7
}
m_SelList = other.m_SelList;
if (m_isGUISelection && !m_SelList.isEmpty())
m_sigSelectionIsMultiple = true;
m_sigSelectionChanged = true;
if (emptyOther)
other.clear();
sendSignals();
128,9 → 124,9
{
if (!m_SelList.isEmpty())
{
SelectionList::Iterator itend=m_SelList.end();
SelectionList::Iterator it=m_SelList.begin();
while (it!=itend)
SelectionList::Iterator itend = m_SelList.end();
SelectionList::Iterator it = m_SelList.begin();
while (it != itend)
{
(*it)->isSingleSel=false;
if (m_isGUISelection)
170,7 → 166,6
ret = m_SelList.first()->connectToGUI();
m_SelList.first()->emitAllToGUI();
m_sigSelectionChanged = true;
m_sigSelectionIsMultiple = true;
}
sendSignals(false);
return ret;
202,7 → 197,6
{
item->setSelected(true);
m_sigSelectionChanged = true;
m_sigSelectionIsMultiple = true;
}
sendSignals();
return true;
231,10 → 225,7
 
m_SelList.append(toAdd);
if (m_isGUISelection)
{
m_sigSelectionChanged = true;
m_sigSelectionIsMultiple = true;
}
sendSignals();
return true;
}
252,7 → 243,6
{
item->setSelected(true);
m_sigSelectionChanged = true;
m_sigSelectionIsMultiple = true;
}
sendSignals();
return true;
262,7 → 252,7
 
PageItem *Selection::itemAt_(int index)
{
if (!m_SelList.isEmpty() && index<m_SelList.count())
if (!m_SelList.isEmpty() && index < m_SelList.count())
{
QPointer<PageItem> pi = m_SelList[index];
//If not nullptr return it, otherwise remove from the list and return nullptr
654,10 → 644,7
connectItemToGUI();
if (m_sigSelectionChanged)
emit selectionChanged();
if (m_sigSelectionIsMultiple)
emit selectionIsMultiple(m_SelList.count() > 1);
m_sigSelectionChanged = false;
m_sigSelectionIsMultiple = false;
}
}
 
/trunk/Scribus/scribus/selection.h
203,12 → 203,10
 
int m_delaySignals;
bool m_sigSelectionChanged;
bool m_sigSelectionIsMultiple;
 
void sendSignals(bool guiConnect = true);
signals:
void selectionIsMultiple(bool);
void selectionChanged();
};