summaryrefslogtreecommitdiffstats
path: root/kbarcode/batchwizard.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-29 00:55:34 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-29 00:55:34 +0000
commitc4189d200e71c7ef82e9a6e34935ad225154d658 (patch)
treef7f29a1159e0402472ff2ab22617a8113f66263c /kbarcode/batchwizard.cpp
parent2f888b1578e65ec1bc514996eb509fcaf34462d6 (diff)
downloadkbarcode-c4189d200e71c7ef82e9a6e34935ad225154d658.tar.gz
kbarcode-c4189d200e71c7ef82e9a6e34935ad225154d658.zip
TQt4 port kbarcode
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kbarcode@1233956 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbarcode/batchwizard.cpp')
-rw-r--r--kbarcode/batchwizard.cpp428
1 files changed, 212 insertions, 216 deletions
diff --git a/kbarcode/batchwizard.cpp b/kbarcode/batchwizard.cpp
index defcca8..7ae3b04 100644
--- a/kbarcode/batchwizard.cpp
+++ b/kbarcode/batchwizard.cpp
@@ -29,19 +29,19 @@
#include "tokenprovider.h"
#include "xmlutils.h"
-#include <qbuffer.h>
-#include <qcheckbox.h>
-#include <qclipboard.h>
-#include <qcursor.h>
-#include <qdom.h>
-#include <qheader.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qradiobutton.h>
-#include <qsqlselectcursor.h>
-#include <qtooltip.h>
-#include <qvbuttongroup.h>
-#include <qwidgetstack.h>
+#include <tqbuffer.h>
+#include <tqcheckbox.h>
+#include <tqclipboard.h>
+#include <tqcursor.h>
+#include <tqdom.h>
+#include <tqheader.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqradiobutton.h>
+#include <tqsqlselectcursor.h>
+#include <tqtooltip.h>
+#include <tqvbuttongroup.h>
+#include <tqwidgetstack.h>
#include <kabc/addressee.h>
#include <kabc/addresseelist.h>
@@ -61,15 +61,15 @@
#include <kpopupmenu.h>
#include <kpushbutton.h>
#include <kurlrequester.h>
-#include <qtable.h>
-#include <qvbox.h>
+#include <tqtable.h>
+#include <tqvbox.h>
#define PNG_FORMAT "PNG"
class AddressListViewItem : public KListViewItem {
public:
- AddressListViewItem(QListView *parent, KABC::Addressee & addr )
- : KListViewItem( parent ), m_address( addr )
+ AddressListViewItem(TQListView *tqparent, KABC::Addressee & addr )
+ : KListViewItem( tqparent ), m_address( addr )
{
this->setText( 0, m_address.givenName() );
this->setText( 1, m_address.familyName() );
@@ -85,9 +85,9 @@ private:
};
-BatchWizard::BatchWizard( QWidget* parent, const char* name )
+BatchWizard::BatchWizard( TQWidget* tqparent, const char* name )
: DCOPObject("BatchPrinting"),
- KWizard( parent, name )
+ KWizard( tqparent, name )
{
setupPage1();
setupPage2();
@@ -111,10 +111,10 @@ BatchWizard::~BatchWizard()
void BatchWizard::setupPage1()
{
- page1 = new QWidget( this, "page1" );
- QVBoxLayout* pageLayout = new QVBoxLayout( page1, 11, 6, "pageLayout");
+ page1 = new TQWidget( this, "page1" );
+ TQVBoxLayout* pageLayout = new TQVBoxLayout( page1, 11, 6, "pageLayout");
- QLabel* label = new QLabel( i18n("<qt>This wizard will guide you through the process "
+ TQLabel* label = new TQLabel( i18n("<qt>This wizard will guide you through the process "
"of printing many labels with KBarcode.<br>The first step "
"is to select the KBarcode label file you want to print.</qt>"), page1 );
pageLayout->addWidget( label );
@@ -123,10 +123,10 @@ void BatchWizard::setupPage1()
m_url->setMode( KFile::File | KFile::ExistingOnly | KFile::LocalOnly );
m_url->setFilter( "*.kbarcode" );
- label = new QLabel( i18n("&Filename:"), page1 );
+ label = new TQLabel( i18n("&Filename:"), page1 );
label->setBuddy( m_url );
- QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding );
+ TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Expanding );
pageLayout->addWidget( label );
pageLayout->addWidget( m_url );
@@ -134,37 +134,37 @@ void BatchWizard::setupPage1()
addPage( page1, i18n("File Selection") );
- connect( m_url, SIGNAL( textChanged( const QString & ) ), this, SLOT( enableControls() ) );
+ connect( m_url, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( enableControls() ) );
}
void BatchWizard::setupPage2()
{
- page2 = new QWidget( this, "page2" );
- QVBoxLayout* pageLayout = new QVBoxLayout( page2, 11, 6, "pageLayout");
+ page2 = new TQWidget( this, "page2" );
+ TQVBoxLayout* pageLayout = new TQVBoxLayout( page2, 11, 6, "pageLayout");
- QVButtonGroup* group = new QVButtonGroup( page2 );
+ TQVButtonGroup* group = new TQVButtonGroup( page2 );
- radioSimple = new QRadioButton( i18n("Print &labels without data"), group );
- radioSqlArticles = new QRadioButton( i18n("Print &articles from KBarcodes SQL database"), group );
- radioVarImport = new QRadioButton( i18n("Import &variables and print"), group );
- radioAddressBook = new QRadioButton( i18n("Print &contacts from your addressbook"), group );
+ radioSimple = new TQRadioButton( i18n("Print &labels without data"), group );
+ radioSqlArticles = new TQRadioButton( i18n("Print &articles from KBarcodes SQL database"), group );
+ radioVarImport = new TQRadioButton( i18n("Import &variables and print"), group );
+ radioAddressBook = new TQRadioButton( i18n("Print &contacts from your addressbook"), group );
radioSimple->setChecked( true );
- QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding );
+ TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Expanding );
pageLayout->addWidget( group );
pageLayout->addItem( spacer );
- connect( radioSimple, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioSqlArticles, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioVarImport, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioAddressBook, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
+ connect( radioSimple, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioSqlArticles, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioVarImport, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioAddressBook, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
addPage( page2, i18n("Data Source") );
}
void BatchWizard::setupPage3()
{
- page3 = new QWidgetStack( this, "page3" );
+ page3 = new TQWidgetStack( this, "page3" );
setupStackPage1();
setupStackPage2();
@@ -176,10 +176,10 @@ void BatchWizard::setupPage3()
void BatchWizard::setupPage4()
{
- page4 = new QVBox( this, "page4" );
+ page4 = new TQVBox( this, "page4" );
page4->setSpacing( 5 );
- QHBox* hbox = new QHBox( page4 );
+ TQHBox* hbox = new TQHBox( page4 );
hbox->setSpacing( 5 );
buttonTableInsert = new KPushButton( i18n("Insert Row"), hbox );
@@ -187,33 +187,33 @@ void BatchWizard::setupPage4()
buttonTableRemove = new KPushButton( i18n("Delete Row"), hbox );
buttonTableRemove->setIconSet( BarIconSet( "editdelete") );
- m_varTable = new QTable( page4 );
+ m_varTable = new TQTable( page4 );
m_varTable->setReadOnly( false );
- m_varTable->setSelectionMode( QTable::SingleRow );
+ m_varTable->setSelectionMode( TQTable::SingleRow );
addPage( page4, i18n("Import Variables") );
- connect( buttonTableInsert, SIGNAL( clicked() ), this, SLOT( slotTableInsert() ) );
- connect( buttonTableRemove, SIGNAL( clicked() ), this, SLOT( slotTableRemove() ) );
+ connect( buttonTableInsert, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotTableInsert() ) );
+ connect( buttonTableRemove, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotTableRemove() ) );
}
void BatchWizard::setupPage5()
{
- TokenProvider serial( this );
+ TokenProvider serial( TQT_TQPAINTDEVICE(this) );
- page5 = new QVBox( this, "page5" );
+ page5 = new TQVBox( this, "page5" );
- new QLabel( i18n( "<qt>KBarcode has support for placing serial numbers on labels. "
+ new TQLabel( i18n( "<qt>KBarcode has support for placing serial numbers on labels. "
"If you did not use the [serial] token on your label in "
"a text field or a barcode, you can skip this page.<br>"
"Serial start is a free form start value containing at least one "
"number. This number is increased for every printed label on the "
"print out.</qt>"), page5 );
- QHBox* hbox = new QHBox( page5 );
+ TQHBox* hbox = new TQHBox( page5 );
hbox->setSpacing( 5 );
- new QLabel( i18n( "Serial start:" ), hbox );
+ new TQLabel( i18n( "Serial start:" ), hbox );
serialStart = new KLineEdit( serial.serial(), hbox );
serialInc = new KIntNumInput( 1, hbox );
@@ -225,81 +225,81 @@ void BatchWizard::setupPage5()
void BatchWizard::setupPage10()
{
- page10 = new QWidget( this, "page10" );
- QVBoxLayout* pageLayout = new QVBoxLayout( page10, 11, 6, "pageLayout");
+ page10 = new TQWidget( this, "page10" );
+ TQVBoxLayout* pageLayout = new TQVBoxLayout( page10, 11, 6, "pageLayout");
- QVButtonGroup* group = new QVButtonGroup( page10 );
+ TQVButtonGroup* group = new TQVButtonGroup( page10 );
- radioPrinter = new QRadioButton( i18n("&Print to a system printer or to a file"), group );
- radioImage = new QRadioButton( i18n("&Create images"), group );
+ radioPrinter = new TQRadioButton( i18n("&Print to a system printer or to a file"), group );
+ radioImage = new TQRadioButton( i18n("&Create images"), group );
- imageBox = new QVBox( group );
+ imageBox = new TQVBox( group );
imageBox->setMargin( 10 );
- radioBarcode = new QRadioButton( i18n("Print to a special &barcode printer"), group );
+ radioBarcode = new TQRadioButton( i18n("Print to a special &barcode printer"), group );
- QHBox* directoryBox = new QHBox( imageBox );
+ TQHBox* directoryBox = new TQHBox( imageBox );
directoryBox->setSpacing( 5 );
- QLabel* label = new QLabel( i18n("Output &Directory:"), directoryBox );
+ TQLabel* label = new TQLabel( i18n("Output &Directory:"), directoryBox );
imageDirPath = new KURLRequester( directoryBox );
imageDirPath->setMode( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly );
label->setBuddy( directoryBox );
- QHBox* formatBox = new QHBox( imageBox );
- label = new QLabel( i18n("Output File &Format:"), formatBox );
+ TQHBox* formatBox = new TQHBox( imageBox );
+ label = new TQLabel( i18n("Output File &Format:"), formatBox );
- QStringList formats = KImageIO::types( KImageIO::Writing );
+ TQStringList formats = KImageIO::types( KImageIO::Writing );
comboFormat = new KComboBox( false, formatBox );
comboFormat->insertStringList( formats );
- if( formats.contains( PNG_FORMAT ) )
- comboFormat->setCurrentItem( formats.findIndex( PNG_FORMAT ) );
+ if( formats.tqcontains( PNG_FORMAT ) )
+ comboFormat->setCurrentItem( formats.tqfindIndex( PNG_FORMAT ) );
label->setBuddy( comboFormat );
- QVButtonGroup* imageNameGroup = new QVButtonGroup( i18n("&Filename:"), imageBox );
- radioImageFilenameArticle = new QRadioButton( i18n("Use &article number for filename"), imageNameGroup );
- radioImageFilenameBarcode = new QRadioButton( i18n("Use &barcode number for filename"), imageNameGroup );
- radioImageFilenameCustom = new QRadioButton( i18n("Use &custom filename:"), imageNameGroup );
+ TQVButtonGroup* imageNameGroup = new TQVButtonGroup( i18n("&Filename:"), imageBox );
+ radioImageFilenameArticle = new TQRadioButton( i18n("Use &article number for filename"), imageNameGroup );
+ radioImageFilenameBarcode = new TQRadioButton( i18n("Use &barcode number for filename"), imageNameGroup );
+ radioImageFilenameCustom = new TQRadioButton( i18n("Use &custom filename:"), imageNameGroup );
editImageFilename = new KLineEdit( imageNameGroup );
radioImageFilenameBarcode->setChecked( true );
- labelInfo = new QLabel( page10 );
+ labelInfo = new TQLabel( page10 );
radioPrinter->setChecked( true );
- checkKeepOpen = new QCheckBox( i18n("&Keep window open after printing."), page10 );
+ checkKeepOpen = new TQCheckBox( i18n("&Keep window open after printing."), page10 );
- QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding );
+ TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Expanding );
pageLayout->addWidget( group );
pageLayout->addItem( spacer );
pageLayout->addWidget( labelInfo );
pageLayout->addWidget( checkKeepOpen );
- connect( radioPrinter, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioImage, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioBarcode, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
+ connect( radioPrinter, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioImage, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioBarcode, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
- connect( radioImageFilenameArticle, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioImageFilenameBarcode, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioImageFilenameCustom, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
+ connect( radioImageFilenameArticle, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioImageFilenameBarcode, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioImageFilenameCustom, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
- connect( imageDirPath, SIGNAL( textChanged( const QString & ) ), this, SLOT( enableControls() ) );
+ connect( imageDirPath, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( enableControls() ) );
addPage( page10, i18n("Output Device") );
}
void BatchWizard::setupStackPage1()
{
- stack1 = new QVBox( page3, "stack1" );
+ stack1 = new TQVBox( page3, "stack1" );
stack1->setSpacing( 5 );
- QHBox* hbox = new QHBox( stack1 );
+ TQHBox* hbox = new TQHBox( stack1 );
hbox->setSpacing( 5 );
- new QLabel( i18n( "Customer name and no.:" ), hbox );
+ new TQLabel( i18n( "Customer name and no.:" ), hbox );
customerName = new KComboBox( false, hbox );
customerId = new KComboBox( false, hbox );
- QHBox* hButtonBox = new QHBox( stack1 );
+ TQHBox* hButtonBox = new TQHBox( stack1 );
hButtonBox->setSpacing( 5 );
buttonAdd = new KPushButton( i18n( "&Add..." ), hButtonBox );
@@ -309,9 +309,9 @@ void BatchWizard::setupStackPage1()
buttonRemoveAll = new KPushButton( i18n("R&emove All"), hButtonBox );
KPopupMenu* mnuImport = new KPopupMenu( this );
- mnuImport->insertItem( i18n("Import from File ..."), this, SLOT( loadFromFile() ) );
- mnuImport->insertItem( i18n("Import from Clipboard ..."), this, SLOT( loadFromClipboard() ) );
- mnuImport->insertItem( i18n("Import barcode_basic"), this, SLOT( addAllItems() ) );
+ mnuImport->insertItem( i18n("Import from File ..."), this, TQT_SLOT( loadFromFile() ) );
+ mnuImport->insertItem( i18n("Import from Clipboard ..."), this, TQT_SLOT( loadFromClipboard() ) );
+ mnuImport->insertItem( i18n("Import barcode_basic"), this, TQT_SLOT( addAllItems() ) );
buttonImport->setPopup( mnuImport );
sqlList = new KListView( stack1 );
@@ -320,60 +320,60 @@ void BatchWizard::setupStackPage1()
sqlList->addColumn( i18n("Article Number") );
sqlList->addColumn( i18n("Group") );
sqlList->setAllColumnsShowFocus( true );
- connect( sqlList, SIGNAL(doubleClicked(QListViewItem*,const QPoint &,int)),
- this, SLOT(changeItem(QListViewItem*,const QPoint &,int)));
+ connect( sqlList, TQT_SIGNAL(doubleClicked(TQListViewItem*,const TQPoint &,int)),
+ this, TQT_SLOT(changeItem(TQListViewItem*,const TQPoint &,int)));
- connect( customerName, SIGNAL( activated(int) ), this, SLOT( customerNameChanged(int) ) );
- connect( customerId, SIGNAL( activated(int) ), this, SLOT( customerIdChanged(int) ) );
- connect( buttonAdd, SIGNAL( clicked() ), this, SLOT( addItem() ) );
- connect( buttonEdit, SIGNAL( clicked() ), this, SLOT( editItem() ) );
- connect( buttonRemove, SIGNAL( clicked() ), this, SLOT( removeItem() ) );
- connect( buttonRemoveAll, SIGNAL( clicked() ), sqlList, SLOT( clear() ) );
- connect( buttonRemoveAll, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
+ connect( customerName, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( customerNameChanged(int) ) );
+ connect( customerId, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( customerIdChanged(int) ) );
+ connect( buttonAdd, TQT_SIGNAL( clicked() ), this, TQT_SLOT( addItem() ) );
+ connect( buttonEdit, TQT_SIGNAL( clicked() ), this, TQT_SLOT( editItem() ) );
+ connect( buttonRemove, TQT_SIGNAL( clicked() ), this, TQT_SLOT( removeItem() ) );
+ connect( buttonRemoveAll, TQT_SIGNAL( clicked() ), sqlList, TQT_SLOT( clear() ) );
+ connect( buttonRemoveAll, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
page3->addWidget( stack1 );
}
void BatchWizard::setupStackPage2()
{
- stack2 = new QHBox( page3, "stack2" );
+ stack2 = new TQHBox( page3, "stack2" );
stack2->setSpacing( 5 );
- QVButtonGroup* group = new QVButtonGroup( stack2 );
- radioImportManual = new QRadioButton( i18n("Enter &data manually"), group );
- radioImportSql = new QRadioButton( i18n("Import variables from a &SQL table"), group );
- labelSqlQuery = new QLabel( i18n("Please enter a sql &query:"), group );
+ TQVButtonGroup* group = new TQVButtonGroup( stack2 );
+ radioImportManual = new TQRadioButton( i18n("Enter &data manually"), group );
+ radioImportSql = new TQRadioButton( i18n("Import variables from a &SQL table"), group );
+ labelSqlQuery = new TQLabel( i18n("Please enter a sql &query:"), group );
importSqlQuery = new KLineEdit( group );
labelSqlQuery->setBuddy( importSqlQuery );
- radioImportCSV = new QRadioButton( i18n("Import from a &CSV file"), group );
- labelCsvFile= new QLabel( i18n("Please select a csv &file:"), group );
+ radioImportCSV = new TQRadioButton( i18n("Import from a &CSV file"), group );
+ labelCsvFile= new TQLabel( i18n("Please select a csv &file:"), group );
importCsvFile = new KURLRequester( group );
labelCsvFile->setBuddy( importCsvFile );
- labelEncoding = new QLabel( i18n("&Encoding:"), group );
+ labelEncoding = new TQLabel( i18n("&Encoding:"), group );
comboEncoding = new EncodingCombo( group );
labelEncoding->setBuddy( comboEncoding );
radioImportManual->setChecked( true );
- QVBox* box = new QVBox( stack2 );
+ TQVBox* box = new TQVBox( stack2 );
box->setSpacing( 5 );
- new QLabel( i18n("Available Variables:"), box );
+ new TQLabel( i18n("Available Variables:"), box );
m_varList = new KListBox( box );
- connect( radioImportManual, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioImportSql, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( radioImportCSV, SIGNAL( clicked() ), this, SLOT( enableControls() ) );
- connect( importSqlQuery, SIGNAL( textChanged( const QString & ) ), this, SLOT( enableControls() ) );
- connect( importCsvFile, SIGNAL( textChanged( const QString & ) ), this, SLOT( enableControls() ) );
+ connect( radioImportManual, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioImportSql, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( radioImportCSV, TQT_SIGNAL( clicked() ), this, TQT_SLOT( enableControls() ) );
+ connect( importSqlQuery, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( enableControls() ) );
+ connect( importCsvFile, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( enableControls() ) );
page3->addWidget( stack2 );
}
void BatchWizard::setupStackPage3()
{
- stack3 = new QVBox( page3, "stack3" );
+ stack3 = new TQVBox( page3, "stack3" );
numLabels = new KIntNumInput( 1, stack3 );
numLabels->setRange( 1, 100000, 1, true );
@@ -384,19 +384,19 @@ void BatchWizard::setupStackPage3()
void BatchWizard::setupStackPage4()
{
- stack4 = new QWidget( page3, "stack4" );
+ stack4 = new TQWidget( page3, "stack4" );
- QHBoxLayout* mainLayout = new QHBoxLayout( stack4 );
+ TQHBoxLayout* mainLayout = new TQHBoxLayout( stack4 );
- QVBox* list1 = new QVBox( stack4 );
- QVBox* list2 = new QVBox( stack4 );
+ TQVBox* list1 = new TQVBox( stack4 );
+ TQVBox* list2 = new TQVBox( stack4 );
- QFrame* buttons = new QFrame( stack4 );
+ TQFrame* buttons = new TQFrame( stack4 );
buttons->setMargin( 10 );
- QVBoxLayout* layout = new QVBoxLayout( buttons );
- QSpacerItem* spacer1 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding );
- QSpacerItem* spacer2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding );
+ TQVBoxLayout* tqlayout = new TQVBoxLayout( buttons );
+ TQSpacerItem* spacer1 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Expanding );
+ TQSpacerItem* spacer2 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Expanding );
buttonAddAllAddress = new KPushButton( buttons );
buttonAddAddress = new KPushButton( buttons );
@@ -408,17 +408,17 @@ void BatchWizard::setupStackPage4()
buttonRemoveAddress->setIconSet( BarIconSet( "1leftarrow" ) );
buttonRemoveAllAddress->setIconSet( BarIconSet( "2leftarrow" ) );
- QToolTip::add( buttonAddAllAddress, i18n("Add all contacts to the list of contacts which will be printed.") );
- QToolTip::add( buttonAddAddress, i18n("Add selected contacts to the list of contacts which will be printed.") );
- QToolTip::add( buttonRemoveAddress, i18n("Remove selected contacts from the list of contacts which will be printed.") );
- QToolTip::add( buttonRemoveAllAddress, i18n("Remove all contacts from the list of contacts which will be printed.") );
+ TQToolTip::add( buttonAddAllAddress, i18n("Add all contacts to the list of contacts which will be printed.") );
+ TQToolTip::add( buttonAddAddress, i18n("Add selected contacts to the list of contacts which will be printed.") );
+ TQToolTip::add( buttonRemoveAddress, i18n("Remove selected contacts from the list of contacts which will be printed.") );
+ TQToolTip::add( buttonRemoveAllAddress, i18n("Remove all contacts from the list of contacts which will be printed.") );
- layout->addItem( spacer1 );
- layout->addWidget( buttonAddAllAddress );
- layout->addWidget( buttonAddAddress );
- layout->addWidget( buttonRemoveAddress );
- layout->addWidget( buttonRemoveAllAddress );
- layout->addItem( spacer2 );
+ tqlayout->addItem( spacer1 );
+ tqlayout->addWidget( buttonAddAllAddress );
+ tqlayout->addWidget( buttonAddAddress );
+ tqlayout->addWidget( buttonRemoveAddress );
+ tqlayout->addWidget( buttonRemoveAllAddress );
+ tqlayout->addItem( spacer2 );
mainLayout->addWidget( list1 );
mainLayout->addWidget( buttons );
@@ -427,8 +427,8 @@ void BatchWizard::setupStackPage4()
mainLayout->setStretchFactor( list1, 2 );
mainLayout->setStretchFactor( list2, 2 );
- new QLabel( i18n("All Addresses"), list1 );
- new QLabel( i18n("Selected Addresses"), list2 );
+ new TQLabel( i18n("All Addresses"), list1 );
+ new TQLabel( i18n("Selected Addresses"), list2 );
listAddress = new KListView( list1 );
listAddress->addColumn( i18n("Given Name"), 0 );
@@ -437,9 +437,9 @@ void BatchWizard::setupStackPage4()
listAddress->setMultiSelection( true );
listAddress->setAllColumnsShowFocus( true );
- listAddress->setColumnWidthMode( 0, QListView::Maximum );
- listAddress->setColumnWidthMode( 1, QListView::Maximum );
- listAddress->setColumnWidthMode( 2, QListView::Maximum );
+ listAddress->setColumnWidthMode( 0, TQListView::Maximum );
+ listAddress->setColumnWidthMode( 1, TQListView::Maximum );
+ listAddress->setColumnWidthMode( 2, TQListView::Maximum );
listSelectedAddress = new KListView( list2 );
listSelectedAddress->addColumn( i18n("Given Name"), 0 );
@@ -448,14 +448,14 @@ void BatchWizard::setupStackPage4()
listSelectedAddress->setMultiSelection( true );
listSelectedAddress->setAllColumnsShowFocus( true );
- listSelectedAddress->setColumnWidthMode( 0, QListView::Maximum );
- listSelectedAddress->setColumnWidthMode( 1, QListView::Maximum );
- listSelectedAddress->setColumnWidthMode( 2, QListView::Maximum );
+ listSelectedAddress->setColumnWidthMode( 0, TQListView::Maximum );
+ listSelectedAddress->setColumnWidthMode( 1, TQListView::Maximum );
+ listSelectedAddress->setColumnWidthMode( 2, TQListView::Maximum );
- connect( buttonAddAddress, SIGNAL( clicked() ), this, SLOT( slotAddAddress() ) );
- connect( buttonRemoveAddress, SIGNAL( clicked() ), this, SLOT( slotRemoveAddress() ) );
- connect( buttonAddAllAddress, SIGNAL( clicked() ), this, SLOT( slotAddAllAddress() ) );
- connect( buttonRemoveAllAddress, SIGNAL( clicked() ), this, SLOT( slotRemoveAllAddress() ) );
+ connect( buttonAddAddress, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAddAddress() ) );
+ connect( buttonRemoveAddress, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotRemoveAddress() ) );
+ connect( buttonAddAllAddress, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAddAllAddress() ) );
+ connect( buttonRemoveAllAddress, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotRemoveAllAddress() ) );
page3->addWidget( stack4 );
}
@@ -466,7 +466,7 @@ void BatchWizard::setupSql()
if( !tables->isConnected() )
return;
- QSqlCursor cur( TABLE_CUSTOMER );
+ TQSqlCursor cur( TABLE_CUSTOMER );
cur.select();
customerId->clear();
customerName->clear();
@@ -517,7 +517,7 @@ void BatchWizard::enableControls()
setFinishEnabled( page10, true );
}
-void BatchWizard::showPage( QWidget* p )
+void BatchWizard::showPage( TQWidget* p )
{
if( p == page3 )
{
@@ -546,19 +546,19 @@ void BatchWizard::showPage( QWidget* p )
void BatchWizard::accept()
{
- printNow( QString::null );
+ printNow( TQString() );
}
-void BatchWizard::printNow( const QString & printer, bool bUserInteraction )
+void BatchWizard::printNow( const TQString & printer, bool bUserInteraction )
{
BatchPrinter* batch = NULL;
KPrinter* prn = NULL;
int batchType = 0;
// let's check if the label file does even exist!
- if( !QFile::exists( m_url->url() ) )
+ if( !TQFile::exists( m_url->url() ) )
{
- KMessageBox::error( this, QString( i18n("The label file %1 was not found") ).arg( m_url->url()) );
+ KMessageBox::error( this, TQString( i18n("The label file %1 was not found") ).tqarg( m_url->url()) );
return;
}
@@ -569,7 +569,7 @@ void BatchWizard::printNow( const QString & printer, bool bUserInteraction )
{
PrintLabelDlg pld( this, "pld" );
pld.setLabelsEnabled( false );
- if( pld.exec() != QDialog::Accepted )
+ if( pld.exec() != TQDialog::Accepted )
return;
move = pld.position();
@@ -588,7 +588,7 @@ void BatchWizard::printNow( const QString & printer, bool bUserInteraction )
else if( radioBarcode->isChecked() )
{
BarcodePrinterDlg dlg(this);
- if( dlg.exec() != QDialog::Accepted )
+ if( dlg.exec() != TQDialog::Accepted )
return;
batch = new BatchPrinter( dlg.printToFile() ? dlg.fileName() : dlg.deviceName(),
@@ -614,7 +614,7 @@ void BatchWizard::printNow( const QString & printer, bool bUserInteraction )
if( !checkKeepOpen->isChecked() )
KWizard::accept();
- KApplication::setOverrideCursor( QCursor( Qt::ArrowCursor ), true );
+ KApplication::setOverrideCursor( TQCursor( TQt::ArrowCursor ), true );
setupBatchPrinter( batch, batchType );
KApplication::restoreOverrideCursor();
@@ -625,18 +625,18 @@ void BatchWizard::printNow( const QString & printer, bool bUserInteraction )
void BatchWizard::setupBatchPrinter( BatchPrinter* batch, int m )
{
Definition* def = NULL;
- QString description;
+ TQString description;
bool kbarcode18;
fillByteArray();
- QDomDocument doc( "KBarcodeLabel" );
+ TQDomDocument doc( "KBarcodeLabel" );
if ( !doc.setContent( m_bytearray ) )
return;
XMLUtils util;
util.readXMLHeader( &doc, description, kbarcode18, &def );
- QBuffer buffer( m_bytearray );
+ TQBuffer buffer( m_bytearray );
if( !buffer.open( IO_ReadOnly ) )
return;
@@ -655,8 +655,8 @@ void BatchWizard::setupBatchPrinter( BatchPrinter* batch, int m )
sqlList->setSorting( 3, true );
sqlList->sort();
- QValueList<BatchPrinter::data>* dlist = new QValueList<BatchPrinter::data>;
- QListViewItem* item = sqlList->firstChild();
+ TQValueList<BatchPrinter::data>* dlist = new TQValueList<BatchPrinter::data>;
+ TQListViewItem* item = sqlList->firstChild();
while( item )
{
BatchPrinter::data m_data;
@@ -677,7 +677,7 @@ void BatchWizard::setupBatchPrinter( BatchPrinter* batch, int m )
batch->setLabels( numLabels->value() );
// do a dirty drick, TODO: refactor BatchPrinter in the future
- QValueList<BatchPrinter::data>* dlist = new QValueList<BatchPrinter::data>;
+ TQValueList<BatchPrinter::data>* dlist = new TQValueList<BatchPrinter::data>;
BatchPrinter::data m_data;
m_data.number = numLabels->value();
dlist->append( m_data );
@@ -689,7 +689,7 @@ void BatchWizard::setupBatchPrinter( BatchPrinter* batch, int m )
TVariableList* tVariableList = new TVariableList;
for( int i=0; i<m_varTable->numRows(); i++ )
{
- QMap<QString, QString> map;
+ TQMap<TQString, TQString> map;
for( int z=0; z<m_varTable->numCols(); z++ )
map[ m_varTable->horizontalHeader()->label( z ) ] = m_varTable->text( i, z );
tVariableList->append( map );
@@ -700,7 +700,7 @@ void BatchWizard::setupBatchPrinter( BatchPrinter* batch, int m )
else if( radioAddressBook->isChecked() )
{
KABC::AddresseeList* list = new KABC::AddresseeList;
- QListViewItem* item = listSelectedAddress->firstChild();
+ TQListViewItem* item = listSelectedAddress->firstChild();
while( item )
{
list->append( static_cast<AddressListViewItem*>(item)->address() );
@@ -725,18 +725,18 @@ void BatchWizard::addItem()
{
DSSmallDialogs::AddItemsDialog aid( this, "aid" );
aid.setGroupCompletion( compGroup );
- connect( &aid, SIGNAL( add( const QString &, const QString &, int) ),
- this, SLOT( slotAddItem( const QString &, const QString &, int) ) );
+ connect( &aid, TQT_SIGNAL( add( const TQString &, const TQString &, int) ),
+ this, TQT_SLOT( slotAddItem( const TQString &, const TQString &, int) ) );
aid.exec();
}
-bool BatchWizard::slotAddItem( const QString & article, const QString & group, int count )
+bool BatchWizard::slotAddItem( const TQString & article, const TQString & group, int count )
{
return this->addItem( article, group, count, true );
}
-bool BatchWizard::addItem( const QString & article, const QString & group, int count, bool msg )
+bool BatchWizard::addItem( const TQString & article, const TQString & group, int count, bool msg )
{
if( !article.isEmpty() && !existsArticle( article ) ) {
if( msg )
@@ -744,10 +744,10 @@ bool BatchWizard::addItem( const QString & article, const QString & group, int c
return false;
}
- QString temp;
+ TQString temp;
temp.sprintf("%0*i", 5, sqlList->childCount() + 1 );
- KListViewItem* item = new KListViewItem( sqlList, temp, QString( "%1" ).arg( count ),
+ KListViewItem* item = new KListViewItem( sqlList, temp, TQString( "%1" ).tqarg( count ),
article, group );
sqlList->insertItem( item );
@@ -757,22 +757,22 @@ bool BatchWizard::addItem( const QString & article, const QString & group, int c
return true;
}
-void BatchWizard::addGroupCompletion( const QString & group )
+void BatchWizard::addGroupCompletion( const TQString & group )
{
if( !group.isEmpty() )
{
- QStringList slist = compGroup->items();
- if(!slist.contains( group ) )
+ TQStringList slist = compGroup->items();
+ if(!slist.tqcontains( group ) )
compGroup->addItem( group );
}
}
-bool BatchWizard::existsArticle( const QString & article )
+bool BatchWizard::existsArticle( const TQString & article )
{
if( article.isEmpty() )
return false;
- QSqlQuery query( "select uid from barcode_basic where article_no='" + article + "'" );
+ TQSqlQuery query( "select uid from barcode_basic where article_no='" + article + "'" );
while ( query.next() )
return true;
@@ -781,12 +781,12 @@ bool BatchWizard::existsArticle( const QString & article )
void BatchWizard::editItem()
{
- QListViewItem* item = sqlList->selectedItem();
+ TQListViewItem* item = sqlList->selectedItem();
if( item )
- changeItem( item, QPoint(0,0), 0 );
+ changeItem( item, TQPoint(0,0), 0 );
}
-void BatchWizard::changeItem( QListViewItem* item, const QPoint &, int )
+void BatchWizard::changeItem( TQListViewItem* item, const TQPoint &, int )
{
if(!item)
return;
@@ -795,9 +795,9 @@ void BatchWizard::changeItem( QListViewItem* item, const QPoint &, int )
item->text( 1 ).toInt(), this, "aid" );
aid.setGroupCompletion( compGroup );
- if( aid.exec() == QDialog::Accepted )
+ if( aid.exec() == TQDialog::Accepted )
{
- item->setText( 1, QString::number( aid.count() ) );
+ item->setText( 1, TQString::number( aid.count() ) );
item->setText( 2, aid.articleNo() );
item->setText( 3, aid.groupName() );
addGroupCompletion( aid.groupName() );
@@ -807,18 +807,18 @@ void BatchWizard::changeItem( QListViewItem* item, const QPoint &, int )
void BatchWizard::removeItem()
{
- QListViewItem* item = sqlList->firstChild();
+ TQListViewItem* item = sqlList->firstChild();
while( item )
{
if( item->isSelected() )
{
- QListViewItem* it = item->nextSibling();
+ TQListViewItem* it = item->nextSibling();
delete item;
while( it )
{
int a = it->text( 0 ).toInt();
- QString temp;
+ TQString temp;
temp.sprintf("%0*i", 5, a - 1 );
it->setText( 0, temp );
it = it->nextSibling();
@@ -847,13 +847,13 @@ void BatchWizard::customerNameChanged( int index )
void BatchWizard::addAllItems()
{
DSSmallDialogs::AddAllDialog* dlg = new DSSmallDialogs::AddAllDialog( this, "dlg" );
- if( dlg->exec() == QDialog::Accepted )
+ if( dlg->exec() == TQDialog::Accepted )
{
- QString temp;
- QString group = dlg->groupName();
- const QString num = QString::number( dlg->numberLabels() );
+ TQString temp;
+ TQString group = dlg->groupName();
+ const TQString num = TQString::number( dlg->numberLabels() );
- QSqlQuery query("SELECT article_no FROM " TABLE_BASIC );
+ TQSqlQuery query("SELECT article_no FROM " TABLE_BASIC );
while( query.next() )
{
temp.sprintf("%0*i", 5, sqlList->childCount() + 1 );
@@ -866,21 +866,21 @@ void BatchWizard::addAllItems()
void BatchWizard::loadFromFile()
{
- QString f = KFileDialog::getOpenFileName( 0, 0, this );
+ TQString f = KFileDialog::getOpenFileName( 0, 0, this );
if( !f.isEmpty() )
loadFromFile( f );
}
void BatchWizard::loadFromClipboard()
{
- QClipboard *cb = KApplication::clipboard();
+ TQClipboard *cb = KApplication::tqclipboard();
loadData( cb->text() );
}
-void BatchWizard::loadFromFile( const QString & url )
+void BatchWizard::loadFromFile( const TQString & url )
{
- QByteArray data;
- QFile file( url );
+ TQByteArray data;
+ TQFile file( url );
if( !file.open( IO_ReadOnly ) )
{
@@ -890,10 +890,10 @@ void BatchWizard::loadFromFile( const QString & url )
data = file.readAll();
- loadData( QString( data ) );
+ loadData( TQString( data ) );
}
-void BatchWizard::loadData( const QString & data )
+void BatchWizard::loadData( const TQString & data )
{
labelprinterdata* lpdata = PrinterSettings::getInstance()->getData();
if( lpdata->separator.isEmpty() )
@@ -910,17 +910,17 @@ void BatchWizard::loadData( const QString & data )
config->readNumEntry("Data2", 2 ) };
bool custom_article_no = lpdata->useCustomNo;
- QBuffer buf( data.utf8() );
+ TQBuffer buf( data.utf8() );
CSVFile file( buf );
- QStringList list, dropped;
- QString article, quantity, group;
+ TQStringList list, dropped;
+ TQString article, quantity, group;
while( file.isValid() && !file.isEof() )
{
list = file.readNextLine();
while( list.count() < 3 )
- list.append( QString::null );
+ list.append( TQString() );
if( pos[0] == 0 )
quantity = list[0];
@@ -952,7 +952,7 @@ void BatchWizard::loadData( const QString & data )
if( qint && custom_article_no ) {
qint = false;
- QSqlQuery query("SELECT article_no FROM customer_text WHERE article_no_customer='" + article + "'" );
+ TQSqlQuery query("SELECT article_no FROM customer_text WHERE article_no_customer='" + article + "'" );
while( query.next() ) {
article = query.value( 0 ).toString();
qint = true;
@@ -962,17 +962,13 @@ void BatchWizard::loadData( const QString & data )
if( qint ) // && existsArticle( article )
{
- if( !addItem( QString( article ), QString( group ), quantity.toInt(), false ) )
+ if( !addItem( TQString( article ), TQString( group ), quantity.toInt(), false ) )
dropped.append( quantity + lpdata->separator + article + lpdata->separator + group );
}
}
if( !dropped.isEmpty() )
-#if QT_VERSION >= 0x030100
KMessageBox::informationList( this, i18n("<qt>The following items can not be added:" )+ "</qt>", dropped );
-#else
- KMessageBox::questionYesNoList( this, i18n("<qt>The following items can not be added:" )+ "</qt>", dropped );
-#endif
enableControls();
}
@@ -981,10 +977,10 @@ void BatchWizard::fillByteArray()
{
if( m_bytearray_filename != m_url->url() )
{
- QFile f( m_url->url() );
+ TQFile f( m_url->url() );
if ( !f.open( IO_ReadOnly ) )
{
- m_bytearray_filename = QString::null;
+ m_bytearray_filename = TQString();
m_bytearray.resize( 0 );
return ;
}
@@ -997,7 +993,7 @@ void BatchWizard::fillByteArray()
void BatchWizard::fillVarList()
{
fillByteArray();
- QDomDocument doc( "KBarcodeLabel" );
+ TQDomDocument doc( "KBarcodeLabel" );
if ( !doc.setContent( m_bytearray ) )
return;
@@ -1005,17 +1001,17 @@ void BatchWizard::fillVarList()
DocumentItemList list;
list.setAutoDelete( true );
- TokenProvider token( this );
+ TokenProvider token( TQT_TQPAINTDEVICE(this) );
Definition* def = NULL;
- QString description;
+ TQString description;
bool kbarcode18;
util.readXMLHeader( &doc, description, kbarcode18, &def );
util.readDocumentItems( &list, &doc, &token, kbarcode18 );
token.setCurrentDocumentItems( list );
- QStringList vars = token.listUserVars();
+ TQStringList vars = token.listUserVars();
m_varList->clear();
m_varList->insertStringList( vars );
m_varTable->setNumCols( vars.count() );
@@ -1049,9 +1045,9 @@ bool BatchWizard::fillVarTable()
{
int y = 0;
int x;
- QSqlSelectCursor query( importSqlQuery->text(), SqlTables::getInstance()->database() );
+ TQSqlSelectCursor query( importSqlQuery->text(), SqlTables::getInstance()->database() );
query.select();
- if( query.lastError().type() != QSqlError::None )
+ if( query.lastError().type() != TQSqlError::None )
{
KMessageBox::error( this, i18n("<qt>Can't execute SQL query:<br>") + query.lastError().text() + "</qt>" );
return false;
@@ -1073,14 +1069,14 @@ bool BatchWizard::fillVarTable()
CSVFile file( importCsvFile->url() );
file.setEncoding( comboEncoding->currentText() );
- QStringList heading;
- QStringList data;
+ TQStringList heading;
+ TQStringList data;
int i = 0;
file.setCSVFile(true);
if( !file.isValid() )
{
- KMessageBox::error( this, QString( i18n("Can't open file: %1") ).arg( importCsvFile->url() ) );
+ KMessageBox::error( this, TQString( i18n("Can't open file: %1") ).tqarg( importCsvFile->url() ) );
return false;
}
@@ -1131,17 +1127,17 @@ void BatchWizard::slotTableInsert()
void BatchWizard::slotTableRemove()
{
- QTableSelection sel = m_varTable->selection( m_varTable->currentSelection() );
+ TQTableSelection sel = m_varTable->selection( m_varTable->currentSelection() );
m_varTable->removeRow( sel.topRow() );
}
-void BatchWizard::setFilename( const QString & url )
+void BatchWizard::setFilename( const TQString & url )
{
m_url->setURL( url );
enableControls();
}
-void BatchWizard::setImportSqlQuery( const QString & query )
+void BatchWizard::setImportSqlQuery( const TQString & query )
{
radioImportCSV->setChecked( false );
radioImportManual->setChecked( false );
@@ -1159,7 +1155,7 @@ void BatchWizard::setImportSqlQuery( const QString & query )
showPage( page4 );
}
-void BatchWizard::setImportCsvFile( const QString & filename )
+void BatchWizard::setImportCsvFile( const TQString & filename )
{
radioImportCSV->setChecked( true );
radioImportManual->setChecked( false );
@@ -1209,7 +1205,7 @@ void BatchWizard::setOutputFormat( const int e )
enableControls();
}
-void BatchWizard::setSerialNumber( const QString & val, int inc )
+void BatchWizard::setSerialNumber( const TQString & val, int inc )
{
serialInc->setValue( inc );
serialStart->setText( val );
@@ -1241,10 +1237,10 @@ void BatchWizard::slotRemoveAllAddress()
enableControls();
}
-void BatchWizard::moveAddress( QListView* src, QListView* dst, bool bAll )
+void BatchWizard::moveAddress( TQListView* src, TQListView* dst, bool bAll )
{
- QListViewItem* item = src->firstChild();
- QListViewItem* cur;
+ TQListViewItem* item = src->firstChild();
+ TQListViewItem* cur;
while( item )
{