Back to index

scribus-ng  1.3.4.dfsg+svn20071115
odtdia.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  /***************************************************************************
00008   *   Copyright (C) 2004 by Riku Leino                                      *
00009   *   tsoots@gmail.com                                                      *
00010   *                                                                         *
00011   *   This program is free software; you can redistribute it and/or modify  *
00012   *   it under the terms of the GNU General Public License as published by  *
00013   *   the Free Software Foundation; either version 2 of the License, or     *
00014   *   (at your option) any later version.                                   *
00015   *                                                                         *
00016   *   This program is distributed in the hope that it will be useful,       *
00017   *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018   *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00019   *   GNU General Public License for more details.                          *
00020   *                                                                         *
00021   *   You should have received a copy of the GNU General Public License     *
00022   *   along with this program; if not, write to the                         *
00023   *   Free Software Foundation, Inc.,                                       *
00024   *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00025  ***************************************************************************/
00026 
00027 #include "odtdia.h"
00028 
00029 #ifdef HAVE_XML
00030 
00031 #include "odtdia.moc"
00032 #include <qtooltip.h>
00033 #include "scribusapi.h"
00034 
00035 extern QPixmap SCRIBUS_API loadIcon(QString nam);
00036 
00037 OdtDialog::OdtDialog(bool update, bool prefix, bool pack) : QDialog(0, "sxwdia", true, 0)
00038 {
00039        setCaption( tr("OpenDocument Importer Options"));
00040        setIcon(loadIcon("AppIcon.png"));
00041 
00042        QBoxLayout* layout = new QVBoxLayout(this);
00043 
00044        QBoxLayout* hlayout = new QHBoxLayout(0, 5, 5, "hlayout");
00045        updateCheck = new QCheckBox( tr("Overwrite Paragraph Styles"), this,
00046 "updateCheck");
00047        updateCheck->setChecked(update);
00048        QToolTip::add(updateCheck, "<qt>" + tr("Enabling this will overwrite existing styles in the current Scribus document") + "</qt>");
00049        hlayout->addWidget(updateCheck);
00050        layout->addLayout(hlayout);
00051 
00052        QBoxLayout* palayout = new QHBoxLayout(0,5,5, "palayout");
00053        packCheck = new QCheckBox( tr("Merge Paragraph Styles"), this, "packCheck");
00054        packCheck->setChecked(pack);
00055        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>");
00056        palayout->addWidget(packCheck);
00057        layout->addLayout(palayout);
00058 
00059        QBoxLayout* playout = new QHBoxLayout(0, 5, 5, "playout");
00060        prefixCheck = new QCheckBox( tr("Use document name as a prefix for paragraph styles"), this, "prefixCheck");
00061        prefixCheck->setChecked(prefix);
00062        QToolTip::add(prefixCheck, "<qt>" + tr("Prepend the document name to the paragraph style name in Scribus.") +"</qt>");
00063        playout->addWidget(prefixCheck);
00064        layout->addLayout(playout);
00065 
00066        QBoxLayout* dlayout = new QHBoxLayout(0, 5, 5, "dlayout");
00067        doNotAskCheck = new QCheckBox( tr("Do not ask again"), this,
00068 "doNotAskCheck");
00069        doNotAskCheck->setChecked(false);
00070        QToolTip::add(doNotAskCheck, "<qt>" + tr("Make these settings the default and do not prompt again when importing an OASIS OpenDocument.") +"</qt>");
00071        //dlayout->addStretch(10);
00072        dlayout->addWidget(doNotAskCheck);
00073        layout->addLayout(dlayout);
00074 
00075        QBoxLayout* blayout = new QHBoxLayout(0, 5, 5, "blayout");
00076        blayout->addStretch(10);
00077        okButton = new QPushButton( tr("OK"), this, "okButton");
00078        blayout->addWidget(okButton);
00079        cancelButton = new QPushButton( tr("Cancel"), this, "cancelButton");
00080        blayout->addWidget(cancelButton);
00081        layout->addLayout(blayout);
00082 
00083        connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
00084        connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
00085 }
00086 
00087 bool OdtDialog::shouldUpdate()
00088 {
00089        return updateCheck->isChecked();
00090 }
00091 
00092 bool OdtDialog::usePrefix()
00093 {
00094        return prefixCheck->isChecked();
00095 }
00096 
00097 bool OdtDialog::askAgain()
00098 {
00099        return !(doNotAskCheck->isChecked());
00100 }
00101 
00102 bool OdtDialog::packStyles()
00103 {
00104        return packCheck->isChecked();
00105 }
00106 
00107 OdtDialog::~OdtDialog()
00108 {
00109 
00110 }
00111 
00112 #endif // HAVE_XML