Back to index

scribus-ng  1.3.4.dfsg+svn20071115
tabmanager.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 "tabmanager.h"
00008 #include "tabmanager.moc"
00009 #include <qvariant.h>
00010 #include <qpushbutton.h>
00011 #include <qlayout.h>
00012 #include <qtooltip.h>
00013 #include <qwhatsthis.h>
00014 #include "tabruler.h"
00015 #include "units.h"
00016 #include "scribusstructs.h"
00017 #include "commonstrings.h"
00018 
00019 extern QPixmap loadIcon(QString nam);
00020 
00021 TabManager::TabManager( QWidget* parent, int dEin, QValueList<ParagraphStyle::TabRecord> inTab, double) : QDialog( parent, "TabManager", true, 0 )
00022 {
00023        setCaption( tr( "Manage Tabulators" ) );
00024        setIcon(loadIcon("AppIcon.png"));
00025        docUnitRatio=unitGetRatioFromIndex(dEin);
00026        tmpTab = inTab;
00027        TabManagerLayout = new QVBoxLayout( this, 5, 5, "TabManagerLayout");
00028        TabList = new Tabruler(this, false, dEin, inTab, -1);
00029        TabManagerLayout->addWidget( TabList );
00030        layout10 = new QHBoxLayout;
00031        layout10->setSpacing( 6 );
00032        layout10->setMargin( 0 );
00033        QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00034        layout10->addItem( spacer );
00035        OKButton = new QPushButton( CommonStrings::tr_OK, this, "OKButton" );
00036        OKButton->setDefault( true );
00037        layout10->addWidget( OKButton );
00038        CancelButton = new QPushButton( CommonStrings::tr_Cancel, this, "CancelB" );
00039        layout10->addWidget( CancelButton );
00040        TabManagerLayout->addLayout( layout10 );
00041        resize( minimumSizeHint() );
00042        connect( OKButton, SIGNAL( clicked() ), this, SLOT( exitOK() ) );
00043        connect( CancelButton, SIGNAL( clicked() ), this, SLOT( reject() ) );
00044 }
00045 
00046 void TabManager::exitOK()
00047 {
00048        tmpTab = TabList->getTabVals();
00049        accept();
00050 }