diff options
| author | craig <craig@11d20701-8431-0410-a711-e3c959e3b870> | 2012-01-01 11:40:09 +0000 |
|---|---|---|
| committer | craig <craig@11d20701-8431-0410-a711-e3c959e3b870> | 2012-01-01 11:40:09 +0000 |
| commit | 7ed83b6c6666eb8b6b104c211ae7e52907350372 (patch) | |
| tree | 4430b556abac0ad660a0aacf1887d77f85d8be02 /scribus/newtemp.cpp | |
| download | scribus-7ed83b6c6666eb8b6b104c211ae7e52907350372.tar.gz scribus-7ed83b6c6666eb8b6b104c211ae7e52907350372.tar.xz scribus-7ed83b6c6666eb8b6b104c211ae7e52907350372.zip | |
Branch 1.3.5 tree to 1.4.x tree, goodbye 1.3.x
git-svn-id: svn://scribus.net/branches/Version14x/Scribus@17163 11d20701-8431-0410-a711-e3c959e3b870
Diffstat (limited to 'scribus/newtemp.cpp')
| -rw-r--r-- | scribus/newtemp.cpp | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/scribus/newtemp.cpp b/scribus/newtemp.cpp new file mode 100644 index 0000000..dcd3bad --- /dev/null +++ b/scribus/newtemp.cpp @@ -0,0 +1,90 @@ +/* +For general Scribus (>=1.3.2) copyright and licensing information please refer +to the COPYING file provided with the program. Following this notice may exist +a copyright and/or license notice that predates the release of Scribus 1.3.2 +for which a new license (GPL+exception) is in place. +*/ +#include "newtemp.h" + +#include <QPixmap> +#include <QSpacerItem> +#include <QHBoxLayout> +#include <QVBoxLayout> +#include <QLineEdit> +#include <QComboBox> +#include <QLabel> +#include <QPushButton> + +#include "page.h" +#include "pagestructs.h" +#include "scribusdoc.h" +#include "commonstrings.h" +#include "util_icon.h" + +NewTm::NewTm( QWidget* parent, QString text, QString titel, ScribusDoc *doc, const QString& answerText) + : QDialog( parent ) +{ + setModal(true); + setWindowTitle(titel); + setWindowIcon(QIcon(loadIcon ( "AppIcon.png" ))); + QueryLayout = new QVBoxLayout( this ); + QueryLayout->setSpacing( 5 ); + QueryLayout->setMargin( 5 ); + Layout2 = new QHBoxLayout; + Layout2->setSpacing( 5 ); + Layout2->setMargin( 0 ); + Answer = new QLineEdit( this ); + Frage = new QLabel( text, this ); + Frage->setBuddy(Answer); +// Qt4 Frage->setFrameShape( QLabel::MShape ); +// Qt4 Frage->setFrameShadow( QLabel::MShadow ); + Frage->adjustSize(); + Layout2->addWidget( Frage ); + Layout2->addWidget( Answer ); + QueryLayout->addLayout( Layout2 ); + if (doc->currentPageLayout != singlePage) + { + Layout3 = new QHBoxLayout; + Layout3->setSpacing( 5 ); + Layout3->setMargin( 0 ); + Links = new QComboBox( this ); + QStringList::Iterator pNames; + for(pNames = doc->pageSets[doc->currentPageLayout].pageNames.begin(); pNames != doc->pageSets[doc->currentPageLayout].pageNames.end(); ++pNames ) + { + //Links->insertItem((*pNames)); + Links->addItem(CommonStrings::translatePageSetLocString((*pNames))); + } + if (doc->currentPage()->LeftPg == 1) + Links->setCurrentIndex(0); + else if (doc->currentPage()->LeftPg == 0) + Links->setCurrentIndex(Links->count()-1); + else + Links->setCurrentIndex(doc->currentPage()->LeftPg-1); + Links->setEditable(false); + Layout3->addWidget( Links ); + QueryLayout->addLayout( Layout3 ); + } + Layout1 = new QHBoxLayout; + Layout1->setSpacing( 5 ); + Layout1->setMargin( 0 ); + QSpacerItem* spacer = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum ); + Layout1->addItem( spacer ); + PushButton1 = new QPushButton( CommonStrings::tr_OK, this ); + PushButton1->setDefault( true ); + Layout1->addWidget( PushButton1 ); + PushButton2 = new QPushButton( CommonStrings::tr_Cancel, this ); + Layout1->addWidget( PushButton2 ); + QueryLayout->addLayout( Layout1 ); + if (!answerText.isEmpty()) + { + Answer->setText(answerText); + Answer->setMinimumWidth(sizeHint().width()); + Answer->selectAll(); + } + setMinimumSize(sizeHint()); + Answer->setFocus(); + + // signals and slots connections + connect( PushButton1, SIGNAL( clicked() ), this, SLOT( accept() ) ); + connect( PushButton2, SIGNAL( clicked() ), this, SLOT( reject() ) ); +} |
