Back to index

scribus-ng  1.3.4.dfsg+svn20071115
sxwdia.cpp
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 #include "sxwdia.h"
00008 
00009 #ifdef HAVE_XML
00010 
00011 #include "scribusapi.h"
00012 #include "sxwdia.moc"
00013 #include <qtooltip.h>
00014 
00015 extern QPixmap SCRIBUS_API loadIcon(QString nam);
00016 
00017 SxwDialog::SxwDialog(bool update, bool prefix, bool pack) : QDialog(0, "sxwdia", true, 0)
00018 {
00019        setCaption( tr("OpenOffice.org Writer Importer Options"));
00020        setIcon(loadIcon("AppIcon.png"));
00021 
00022        QBoxLayout* layout = new QVBoxLayout(this);
00023 
00024        QBoxLayout* hlayout = new QHBoxLayout(0, 5, 5, "hlayout");
00025        updateCheck = new QCheckBox( tr("Overwrite Paragraph Styles"), this,
00026 "updateCheck");
00027        updateCheck->setChecked(update);
00028        QToolTip::add(updateCheck, "<qt>" + tr("Enabling this will overwrite existing styles in the current Scribus document") + "</qt>");
00029        hlayout->addWidget(updateCheck);
00030        layout->addLayout(hlayout);
00031        
00032        QBoxLayout* palayout = new QHBoxLayout(0,5,5, "palayout");
00033        packCheck = new QCheckBox( tr("Merge Paragraph Styles"), this, "packCheck");
00034        packCheck->setChecked(pack);
00035        QToolTip::add(packCheck, "<qt>" + tr("Merge paragraph styles by attributes. This will result in fewer similar paragraph styles, will retain style attributes, even if the original document's styles are named differently.") +"</qt>");
00036        palayout->addWidget(packCheck);
00037        layout->addLayout(palayout);
00038 
00039        QBoxLayout* playout = new QHBoxLayout(0, 5, 5, "playout");
00040        prefixCheck = new QCheckBox( tr("Use document name as a prefix for paragraph styles"), this, "prefixCheck");
00041        prefixCheck->setChecked(prefix);
00042        QToolTip::add(prefixCheck, "<qt>" + tr("Prepend the document name to the paragraph style name in Scribus.") +"</qt>");
00043        playout->addWidget(prefixCheck);
00044        layout->addLayout(playout);
00045 
00046        QBoxLayout* dlayout = new QHBoxLayout(0, 5, 5, "dlayout");
00047        doNotAskCheck = new QCheckBox( tr("Do not ask again"), this,
00048 "doNotAskCheck");
00049        doNotAskCheck->setChecked(false);
00050        QToolTip::add(doNotAskCheck, "<qt>" + tr("Make these settings the default and do not prompt again when importing an OpenOffice.org 1.x document.") +"</qt>");
00051        //dlayout->addStretch(10);
00052        dlayout->addWidget(doNotAskCheck);
00053        layout->addLayout(dlayout);
00054 
00055        QBoxLayout* blayout = new QHBoxLayout(0, 5, 5, "blayout");
00056        blayout->addStretch(10);
00057        okButton = new QPushButton( tr("OK"), this, "okButton");
00058        blayout->addWidget(okButton);
00059        cancelButton = new QPushButton( tr("Cancel"), this, "cancelButton");
00060        blayout->addWidget(cancelButton);
00061        layout->addLayout(blayout);
00062 
00063        connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
00064        connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
00065 }
00066 
00067 bool SxwDialog::shouldUpdate()
00068 {
00069        return updateCheck->isChecked();
00070 }
00071 
00072 bool SxwDialog::usePrefix()
00073 {
00074        return prefixCheck->isChecked();
00075 }
00076 
00077 bool SxwDialog::askAgain()
00078 {
00079        return !(doNotAskCheck->isChecked());
00080 }
00081 
00082 bool SxwDialog::packStyles()
00083 {
00084        return packCheck->isChecked();     
00085 }
00086 
00087 SxwDialog::~SxwDialog()
00088 {
00089 
00090 }
00091 
00092 #endif // HAVE_XML