Author: craig
Date: Sun Dec  8 16:08:38 2019
New Revision: 23404

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23404
Log:
Update old scripter for new API

Modified:
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmani.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmisc.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdobj.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdtext.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdutil.cpp

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmani.cpp
URL: 
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23404&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmani.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmani.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmani.cpp Sun Dec  8 
16:08:38 2019
@@ -61,17 +61,17 @@
 
        currentDoc->m_Selection->clear();
        // Clear the selection
-       currentView->Deselect();
+       currentView->deselectItems();
        // Select the item, which will also select its group if
        // there is one.
-       currentView->SelectItem(item);
+       currentView->selectItem(item);
 
        // scale
        currentDoc->itemSelection_SetImageScale(x, y); //CB why when this is 
done above?
        currentDoc->updatePic();
 
        // Now restore the selection.
-       currentView->Deselect();
+       currentView->deselectItems();
        if (hadOrigSelection)
                *currentDoc->m_Selection=tempSelection;
 
@@ -103,10 +103,10 @@
 
        currentDoc->m_Selection->clear();
        // Clear the selection
-       currentView->Deselect();
+       currentView->deselectItems();
        // Select the item, which will also select its group if
        // there is one.
-       currentView->SelectItem(item);
+       currentView->selectItem(item);
 
        // scale
        double newScaleX = x / item->pixm.imgInfo.xres * 72.0;
@@ -115,7 +115,7 @@
        currentDoc->updatePic();
 
        // Now restore the selection.
-       currentView->Deselect();
+       currentView->deselectItems();
        if (hadOrigSelection)
                *currentDoc->m_Selection=tempSelection;
 
@@ -146,10 +146,10 @@
 
        currentDoc->m_Selection->clear();
        // Clear the selection
-       currentView->Deselect();
+       currentView->deselectItems();
        // Select the item, which will also select its group if
        // there is one.
-       currentView->SelectItem(item);
+       currentView->selectItem(item);
 
        // offset
        double newOffsetX = x / ((item->imageXScale() != 0.0) ? 
item->imageXScale() : 1);
@@ -158,7 +158,7 @@
        currentDoc->updatePic();
 
        // Now restore the selection.
-       currentView->Deselect();
+       currentView->deselectItems();
        if (hadOrigSelection)
                *currentDoc->m_Selection=tempSelection;
 
@@ -240,10 +240,10 @@
 
        currentDoc->m_Selection->clear();
        // Clear the selection
-       currentView->Deselect();
+       currentView->deselectItems();
        // Select the item, which will also select its group if
        // there is one.
-       currentView->SelectItem(item);
+       currentView->selectItem(item);
        // Move the item, or items
        if (currentDoc->m_Selection->count() > 1)
        {
@@ -255,7 +255,7 @@
                currentDoc->moveItem(ValueToPoint(x), ValueToPoint(y), item);
                }
        // Now restore the selection.
-       currentView->Deselect();
+       currentView->deselectItems();
        if (hadOrigSelection)
                *currentDoc->m_Selection=tempSelection;
        Py_RETURN_NONE;
@@ -280,10 +280,10 @@
        bool hadOrigSelection = (tempSelection.count() != 0);
 
        // Clear the selection
-       currentView->Deselect();
+       currentView->deselectItems();
        // Select the item, which will also select its group if
        // there is one.
-       currentView->SelectItem(item);
+       currentView->selectItem(item);
        // Move the item, or items
        if (currentDoc->m_Selection->count() > 1)
        {
@@ -296,7 +296,7 @@
        else
                currentDoc->moveItem(pageUnitXToDocX(x) - item->xPos(), 
pageUnitYToDocY(y) - item->yPos(), item);
        // Now restore the selection.
-       currentView->Deselect();
+       currentView->deselectItems();
        if (hadOrigSelection)
                *currentDoc->m_Selection=tempSelection;
 
@@ -415,8 +415,8 @@
                return nullptr;
 
        ScribusMainWindow* currentWin = ScCore->primaryMainWindow();
-       currentWin->view->Deselect();
-       currentWin->view->SelectItem(i);
+       currentWin->view->deselectItems();
+       currentWin->view->selectItem(i);
        currentWin->UnGroupObj();
 
        Py_RETURN_NONE;
@@ -442,8 +442,8 @@
        ScribusDoc* currentDoc = ScCore->primaryMainWindow()->doc;
        ScribusView* currentView = ScCore->primaryMainWindow()->view;
 
-       currentView->Deselect();
-       currentView->SelectItem(i);
+       currentView->deselectItems();
+       currentView->selectItem(i);
 //     int h = currentView->frameResizeHandle;
 //     currentView->frameResizeHandle = 1;
        currentView->startGroupTransaction(Um::Resize, "", Um::IResize);
@@ -483,7 +483,7 @@
        PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
        if (i == nullptr)
                return nullptr;
-       ScCore->primaryMainWindow()->view->SelectItem(i);
+       ScCore->primaryMainWindow()->view->selectItem(i);
        Py_RETURN_NONE;
 }
 
@@ -491,7 +491,7 @@
 {
        if (!checkHaveDocument())
                return nullptr;
-       ScCore->primaryMainWindow()->view->Deselect();
+       ScCore->primaryMainWindow()->view->deselectItems();
        Py_RETURN_NONE;
 }
 
@@ -603,10 +603,10 @@
 
        currentDoc->m_Selection->clear();
        // Clear the selection
-       currentView->Deselect();
+       currentView->deselectItems();
        // Select the item, which will also select its group if
        // there is one.
-       currentView->SelectItem(item);
+       currentView->selectItem(item);
 
        // flip
        if (h == 1)
@@ -614,7 +614,7 @@
        if (v == 1)
                currentDoc->itemSelection_FlipV();
        // Now restore the selection.
-       currentView->Deselect();
+       currentView->deselectItems();
        if (hadOrigSelection)
                *currentDoc->m_Selection = tempSelection;
 

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmisc.cpp
URL: 
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23404&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmisc.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmisc.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdmisc.cpp Sun Dec  8 
16:08:38 2019
@@ -212,7 +212,7 @@
                return nullptr;
        }
        // If no name have been specified in args, process whole selection
-       currentView->SelectItem(item);
+       currentView->selectItem(item);
        if (strlen(Name) == 0)
        {
                for (int i = 0; i < currentDoc->m_Selection->count(); ++i)

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdobj.cpp
URL: 
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23404&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdobj.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdobj.cpp  (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdobj.cpp  Sun Dec  8 
16:08:38 2019
@@ -674,9 +674,9 @@
                if (selectionLength > 0)
                        selectionStart = item->itemText.startOfSelection();
                // quick hack to always apply on the right frame - pv
-               currentView->Deselect(true);
+               currentView->deselectItems(true);
                //CB I dont think we need to draw here. Its faster if we dont.
-               currentView->SelectItem(item, false);
+               currentView->selectItem(item, false);
                // Restore text selection if necessary
                if (selectionStart >= 0)
                {
@@ -757,9 +757,9 @@
                if (selectionLength > 0)
                        selectionStart = item->itemText.startOfSelection();
                // quick hack to always apply on the right frame - pv
-               currentView->Deselect(true);
+               currentView->deselectItems(true);
                //CB I dont think we need to draw here. Its faster if we dont.
-               currentView->SelectItem(item, false);
+               currentView->selectItem(item, false);
                // Restore text selection if necessary
                if (selectionStart >= 0)
                {

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdtext.cpp
URL: 
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23404&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdtext.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdtext.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdtext.cpp Sun Dec  8 
16:08:38 2019
@@ -1187,8 +1187,8 @@
        }
        if (item->invalid)
                item->layout();
-       ScCore->primaryMainWindow()->view->Deselect(true);
-       ScCore->primaryMainWindow()->view->SelectItem(item);
+       ScCore->primaryMainWindow()->view->deselectItems(true);
+       ScCore->primaryMainWindow()->view->selectItem(item);
        ScCore->primaryMainWindow()->view->TextToPath();
 
        Py_RETURN_NONE;

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdutil.cpp
URL: 
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23404&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdutil.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdutil.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdutil.cpp Sun Dec  8 
16:08:38 2019
@@ -176,7 +176,7 @@
 
 bool setSelectedItemsByName(QStringList& itemNames)
 {
-       ScCore->primaryMainWindow()->view->Deselect();
+       ScCore->primaryMainWindow()->view->deselectItems();
        // For each named item
        for (QStringList::Iterator it = itemNames.begin() ; it != 
itemNames.end() ; it++)
        {
@@ -188,7 +188,7 @@
                if (!item)
                        return false;
                // and select it
-               ScCore->primaryMainWindow()->view->SelectItem(item);
+               ScCore->primaryMainWindow()->view->selectItem(item);
        }
        return true;
 }


_______________________________________________
scribus-commit mailing list
[email protected]
http://lists.scribus.net/mailman/listinfo/scribus-commit

Reply via email to