[elvystrac] r2234 - make sure some panel will be ALWAYS displayed

  • From: elvys@xxxxxxxxxxxxxxxxxxxxxx
  • To: elvystrac@xxxxxxxxxxxxx
  • Date: Sun, 11 Apr 2010 18:49:10 +0200

Author: JirkaH
Date: 2010-04-11 18:49:10 +0200 (Sun, 11 Apr 2010)
New Revision: 2234

Modified:
   trunk/client/elvys-client/src/category.cpp
   trunk/client/elvys-client/src/panel.cpp
   trunk/client/elvys-client/src/xmlpaneldocparser.cpp
Log:
make sure some panel will be ALWAYS displayed


Modified: trunk/client/elvys-client/src/category.cpp
===================================================================
--- trunk/client/elvys-client/src/category.cpp  2010-04-11 13:39:17 UTC (rev 
2233)
+++ trunk/client/elvys-client/src/category.cpp  2010-04-11 16:49:10 UTC (rev 
2234)
@@ -22,7 +22,10 @@
        docParser = new XMLPanelDocParser();
        connect(this, SIGNAL(docuMaintananceStarted()), this, 
SLOT(docMaintananceStarted()));
        connect(this, SIGNAL(docuMaintananceFinished()), this, 
SLOT(docMaintananceFinished()));
+       connect(layoutMaint, SIGNAL(maintananceFinished()), this, 
SLOT(showAndHidePanels())); // make sure that after layout change we will have 
spare panel
+       connect(this, SIGNAL(docuMaintananceFinished()), this, 
SLOT(docMaintananceFinished()));
 
+
        connect(layoutMaint, SIGNAL(layoutAboutToChange()), this, 
SLOT(destroyLayout()));
        connect(layoutMaint, SIGNAL(maintananceFinished()), this, 
SLOT(newLayout()));   
 
@@ -218,6 +221,7 @@
                panelsToDelete.remove(id);
                deletePanel(id);
        }
+       showAndHidePanels();
 }
 
 /** Deletes panel with id @a panelId.
@@ -244,8 +248,7 @@
                                updatePanelNames();
                        }
                }               
-               delete panel;
-               showAndHidePanels();
+               delete panel;           
        }       
 }
 
@@ -266,7 +269,6 @@
        Panel * panel;
        int nullDocPanels = 0;
        QList<Panel *> panels = this->findChildren<Panel *>();
-
        //first we have to get know if there are any panels to hide (one panel 
mus stay visible)
        foreach (panel, panels) {
                if (panel->numRealDocuments() == 0) {
@@ -310,7 +312,7 @@
                                removeTab(indexOf(panel));
                        }
                }
-       } else { // we will hide all empty panels
+       } else { // we will hide all empty panels               
                activePanels = 0;
                foreach (panel, panels) {
                        if (panel->numRealDocuments() == 0) {                   
        
@@ -474,8 +476,7 @@
 
 void Category::newPanelDocuments(int panelId) {
        Panel * panel = NULL;
-       panelsFound.insert(panelId, true);
-       qDebug() << "Category" << objectName() << "panel" << panelId << "added 
to panelsFound";
+       panelsFound.insert(panelId, true);      
 
        if ( (panel = findChild<Panel *>(QString::number(panelId))) == NULL ) {
                qDebug() << "Category" << objectName() << ": no such panel" << 
panelId << ". Creating new one";

Modified: trunk/client/elvys-client/src/panel.cpp
===================================================================
--- trunk/client/elvys-client/src/panel.cpp     2010-04-11 13:39:17 UTC (rev 
2233)
+++ trunk/client/elvys-client/src/panel.cpp     2010-04-11 16:49:10 UTC (rev 
2234)
@@ -213,7 +213,7 @@
        return findChildren<Document *>().count();
 }
 
-int Panel::numRealDocuments() {                
+int Panel::numRealDocuments() {                        
        QList<DummyDocument *> dummyDocuments = findChildren<DummyDocument *>();
 
        return numDocuments() - dummyDocuments.count();

Modified: trunk/client/elvys-client/src/xmlpaneldocparser.cpp
===================================================================
--- trunk/client/elvys-client/src/xmlpaneldocparser.cpp 2010-04-11 13:39:17 UTC 
(rev 2233)
+++ trunk/client/elvys-client/src/xmlpaneldocparser.cpp 2010-04-11 16:49:10 UTC 
(rev 2234)
@@ -80,7 +80,6 @@
                return false;
        }
 
-       qDebug() << Q_FUNC_INFO << "emitting new panel" << panelId;
        emit newPanelDocuments(panelId);
 
        skipElement(); //skip reading of this document, as it is read by 
another class


Other related posts:

  • » [elvystrac] r2234 - make sure some panel will be ALWAYS displayed - elvys