some debugging for odf editing
authorKonrad Rosenbaum <konrad@silmor.de>
Sat, 24 Mar 2012 19:27:58 +0000 (20:27 +0100)
committerKonrad Rosenbaum <konrad@silmor.de>
Sat, 24 Mar 2012 19:27:58 +0000 (20:27 +0100)
src/dialogs/orderwin.cpp
src/templates/odfedit.cpp

index ea0485d..e1b157c 100644 (file)
@@ -89,7 +89,7 @@ class MOWTableView:public QTableView
                        //constrain to absolute maximum
                        if(absmax.width()<vsz.width())vsz.setWidth(absmax.width());
                        if(absmax.height()<vsz.height())vsz.setHeight(absmax.height());
-                       qDebug()<<"ret min"<<vsz;
+//                     qDebug()<<"ret min"<<vsz;
                        return vsz;
                }
        private:
@@ -198,7 +198,7 @@ MOrderWindow::MOrderWindow(QWidget*par,const MOOrder&o)
        
        vl->addSpacing(10);
        vl->update();
-       QSize sz=size();qDebug()<<"size"<<sz;
+       QSize sz=size();//qDebug()<<"size"<<sz;
        
        vl->addWidget(m_table=new MOWTableView,10);
        m_table->setModel(m_model=new QStandardItemModel(this));
@@ -429,6 +429,7 @@ void MOrderWindow::printBill()
                QMessageBox::warning(this,tr("Warning"),tr("Unable to get template file (bill). Giving up."));
                return;
        }
+       qDebug()<<"printing bill using template"<<tf.cacheFileName();
        //mark order as shipped?
        if(m_order.status()==MOOrder::Placed)
        if(QMessageBox::question(this,tr("Mark as shipped?"),tr("Mark this order as shipped now?"),QMessageBox::Yes|QMessageBox::No,QMessageBox::Yes)==QMessageBox::Yes){
@@ -458,6 +459,7 @@ void MOrderWindow::saveBill()
                QMessageBox::warning(this,tr("Warning"),tr("Unable to get template file (bill). Giving up."));
                return;
        }
+       qDebug()<<"saving bill using template"<<tf.cacheFileName();
        //get target file name
        QFileDialog fd(this);
        fd.setAcceptMode(QFileDialog::AcceptSave);
@@ -548,6 +550,7 @@ void MOrderWindow::getVariable(QString vn,QVariant&value)
                        getLoopVariable(sl[0],it,sl[1],value);
                }
        }
+//     qDebug()<<"got variable"<<vn<<"value"<<value;
 }
 
 void MOrderWindow::getLoopIterations(QString loopname,int&iterations)
@@ -556,10 +559,12 @@ void MOrderWindow::getLoopIterations(QString loopname,int&iterations)
        if(loopname=="ACCTICKETS")iterations=printBuffer.tickinfo.size();
        if(loopname=="VOUCHERS")iterations=printBuffer.vouchers.size();
        if(loopname=="ADDRESSLINES")iterations=m_order.fullInvoiceAddress().split("\n").size();
+//     qDebug()<<"loop"<<loopname<<"has"<<iterations<<"iterations";
 }
 
 void MOrderWindow::setLoopIteration(QString loopname, int iteration)
 {
+//     qDebug()<<"setting loop iter"<<loopname<<iteration;
        int max=-1;
        if(iteration<0)return;
        getLoopIterations(loopname,max);
index 0cf7ae0..4ac33d1 100644 (file)
@@ -419,6 +419,7 @@ void MOdfEditor::saveFile ( QString fn)
                QMessageBox::warning(this,tr("Warning"),tr("Unable to write to file %1").arg(fn));
                return;
        }
+       qDebug()<<"saving template to file"<<fn;
        saveTemplate(fd);
        fd.close();
 }
@@ -440,6 +441,7 @@ void MOdfEditor::testSave()
                tf.setAutoRemove(false);
                tf.open();
                d->mTestFile=tf.fileName();
+               qDebug()<<"created template test file"<<d->mTestFile;
        }
        //save the file
        saveFile(d->mTestFile);