@ -139,7 +139,7 @@ LabelEditor::LabelEditor( TQWidget *parent, TQString _filename, const char *name
statusBar ( ) - > setSizeGripEnabled ( true ) ;
statusBar ( ) - > show ( ) ;
c = new MyCanvas ( TQT_TQOBJECT ( this ) ) ;
c = new MyCanvas ( this ) ;
c - > setDoubleBuffering ( true ) ;
c - > setUpdatePeriod ( CANVAS_UPDATE_PERIOD ) ;
@ -159,14 +159,14 @@ LabelEditor::LabelEditor( TQWidget *parent, TQString _filename, const char *name
// if( isFirstStart() )
// moveDockWindow( tools, TQt::DockLeft );
connect ( cv , TQT_SIGNAL ( doubleClickedItem ( TCanvasItem * ) ) , TQT_TQOBJECT ( this ) , TQT_SLOT ( doubleClickedItem ( TCanvasItem * ) ) ) ;
connect ( cv , TQT_SIGNAL ( showContextMenu ( TQPoint ) ) , TQT_TQOBJECT ( this ) , TQT_SLOT ( showContextMenu ( TQPoint ) ) ) ;
connect ( cv , TQT_SIGNAL ( movedSomething ( ) ) , TQT_TQOBJECT ( this ) , TQT_SLOT ( setEdited ( ) ) ) ;
connect ( cv , TQT_SIGNAL ( doubleClickedItem ( TCanvasItem * ) ) , this , TQT_SLOT ( doubleClickedItem ( TCanvasItem * ) ) ) ;
connect ( cv , TQT_SIGNAL ( showContextMenu ( TQPoint ) ) , this , TQT_SLOT ( showContextMenu ( TQPoint ) ) ) ;
connect ( cv , TQT_SIGNAL ( movedSomething ( ) ) , this , TQT_SLOT ( setEdited ( ) ) ) ;
connect ( KBarcodeSettings : : getInstance ( ) , TQT_SIGNAL ( updateGrid ( int ) ) , cv , TQT_SLOT ( updateGUI ( ) ) ) ;
connect ( kapp , TQT_SIGNAL ( aboutToQuit ( ) ) , TQT_TQOBJECT ( this ) , TQT_SLOT ( saveConfig ( ) ) ) ;
connect ( kapp , TQT_SIGNAL ( aboutToQuit ( ) ) , this , TQT_SLOT ( saveConfig ( ) ) ) ;
connect ( history , TQT_SIGNAL ( commandExecuted ( ) ) , cv , TQT_SLOT ( updateGUI ( ) ) ) ;
connect ( history , TQT_SIGNAL ( commandExecuted ( ) ) , TQT_TQOBJECT ( this ) , TQT_SLOT ( setEdited ( ) ) ) ;
connect ( history , TQT_SIGNAL ( commandExecuted ( ) ) , this , TQT_SLOT ( setEdited ( ) ) ) ;
if ( ! _filename . isEmpty ( ) )
openUrl ( _filename ) ;
@ -248,7 +248,7 @@ void LabelEditor::clearLabel()
createCommandHistoryActions ( ) ;
connect ( history , TQT_SIGNAL ( commandExecuted ( ) ) , cv , TQT_SLOT ( updateGUI ( ) ) ) ;
connect ( history , TQT_SIGNAL ( commandExecuted ( ) ) , TQT_TQOBJECT ( this ) , TQT_SLOT ( setEdited ( ) ) ) ;
connect ( history , TQT_SIGNAL ( commandExecuted ( ) ) , this , TQT_SLOT ( setEdited ( ) ) ) ;
m_edited = false ;
@ -437,47 +437,47 @@ bool LabelEditor::newLabel()
void LabelEditor : : setupActions ( )
{
TDEAction * newAct = KStdAction : : openNew ( TQT_TQOBJECT ( this ) , TQT_SLOT ( startEditor ( ) ) , actionCollection ( ) ) ;
TDEAction * loadAct = KStdAction : : open ( TQT_TQOBJECT ( this ) , TQT_SLOT ( startLoadEditor ( ) ) , actionCollection ( ) ) ;
TDEAction * quitAct = KStdAction : : quit ( TQT_TQOBJECT( kapp) , TQT_SLOT ( quit ( ) ) , actionCollection ( ) ) ;
TDEAction * closeAct = KStdAction : : close ( TQT_TQOBJECT ( this ) , TQT_SLOT ( close ( ) ) , actionCollection ( ) , " close " ) ;
closeLabelAct = new TDEAction ( i18n ( " Close &Label " ) , 0 , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( closeLabel ( ) ) , actionCollection ( ) ) ;
recentAct = new TDERecentFilesAction ( i18n ( " &Recent Files " ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( loadRecentEditor ( const KURL & ) ) ) ;
TDEAction * importPrintFileAct = new TDEAction ( i18n ( " &Import and Print Batch File... " ) , BarIconSet ( " document-print " ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( batchPrint ( ) ) , actionCollection ( ) ) ;
saveAct = KStdAction : : save ( TQT_TQOBJECT ( this ) , TQT_SLOT ( save ( ) ) , actionCollection ( ) , " save " ) ;
saveAsAct = KStdAction : : saveAs ( TQT_TQOBJECT ( this ) , TQT_SLOT ( saveas ( ) ) , actionCollection ( ) , " saveas " ) ;
descriptionAct = new TDEAction ( i18n ( " &Change description... " ) , 0 , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( changeDes ( ) ) , actionCollection ( ) ) ;
deleteAct = new TDEAction ( i18n ( " &Delete Object " ) , TQIconSet ( BarIcon ( " edit-delete " ) ) , Key_Delete , TQT_TQOBJECT( cv) , TQT_SLOT ( deleteCurrent ( ) ) , actionCollection ( ) ) ;
editPropAct = new TDEAction ( i18n ( " &Properties... " ) , 0 , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( doubleClickedCurrent ( ) ) , actionCollection ( ) ) ;
printAct = KStdAction : : print ( TQT_TQOBJECT ( this ) , TQT_SLOT ( print ( ) ) , actionCollection ( ) , " print " ) ;
bcpAct = new TDEAction ( i18n ( " Print to &Barcode Printer... " ) , 0 , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( printBCP ( ) ) , actionCollection ( ) ) ;
imgAct = new TDEAction ( i18n ( " Print to &Image... " ) , 0 , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( printImage ( ) ) , actionCollection ( ) ) ;
changeSizeAct = new TDEAction ( i18n ( " &Change Label... " ) , 0 , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( changeSize ( ) ) , actionCollection ( ) ) ;
barcodeAct = new TDEAction ( i18n ( " Insert &Barcode " ) , TQIconSet ( BarIcon ( " barcode " ) ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( insertBarcode ( ) ) , actionCollection ( ) ) ;
TDEAction * newAct = KStdAction : : openNew ( this , TQT_SLOT ( startEditor ( ) ) , actionCollection ( ) ) ;
TDEAction * loadAct = KStdAction : : open ( this , TQT_SLOT ( startLoadEditor ( ) ) , actionCollection ( ) ) ;
TDEAction * quitAct = KStdAction : : quit ( kapp, TQT_SLOT ( quit ( ) ) , actionCollection ( ) ) ;
TDEAction * closeAct = KStdAction : : close ( this , TQT_SLOT ( close ( ) ) , actionCollection ( ) , " close " ) ;
closeLabelAct = new TDEAction ( i18n ( " Close &Label " ) , 0 , 0 , this , TQT_SLOT ( closeLabel ( ) ) , actionCollection ( ) ) ;
recentAct = new TDERecentFilesAction ( i18n ( " &Recent Files " ) , 0 , this , TQT_SLOT ( loadRecentEditor ( const KURL & ) ) ) ;
TDEAction * importPrintFileAct = new TDEAction ( i18n ( " &Import and Print Batch File... " ) , BarIconSet ( " document-print " ) , 0 , this , TQT_SLOT ( batchPrint ( ) ) , actionCollection ( ) ) ;
saveAct = KStdAction : : save ( this , TQT_SLOT ( save ( ) ) , actionCollection ( ) , " save " ) ;
saveAsAct = KStdAction : : saveAs ( this , TQT_SLOT ( saveas ( ) ) , actionCollection ( ) , " saveas " ) ;
descriptionAct = new TDEAction ( i18n ( " &Change description... " ) , 0 , 0 , this , TQT_SLOT ( changeDes ( ) ) , actionCollection ( ) ) ;
deleteAct = new TDEAction ( i18n ( " &Delete Object " ) , TQIconSet ( BarIcon ( " edit-delete " ) ) , Key_Delete , cv, TQT_SLOT ( deleteCurrent ( ) ) , actionCollection ( ) ) ;
editPropAct = new TDEAction ( i18n ( " &Properties... " ) , 0 , 0 , this , TQT_SLOT ( doubleClickedCurrent ( ) ) , actionCollection ( ) ) ;
printAct = KStdAction : : print ( this , TQT_SLOT ( print ( ) ) , actionCollection ( ) , " print " ) ;
bcpAct = new TDEAction ( i18n ( " Print to &Barcode Printer... " ) , 0 , 0 , this , TQT_SLOT ( printBCP ( ) ) , actionCollection ( ) ) ;
imgAct = new TDEAction ( i18n ( " Print to &Image... " ) , 0 , 0 , this , TQT_SLOT ( printImage ( ) ) , actionCollection ( ) ) ;
changeSizeAct = new TDEAction ( i18n ( " &Change Label... " ) , 0 , 0 , this , TQT_SLOT ( changeSize ( ) ) , actionCollection ( ) ) ;
barcodeAct = new TDEAction ( i18n ( " Insert &Barcode " ) , TQIconSet ( BarIcon ( " barcode " ) ) , 0 , this , TQT_SLOT ( insertBarcode ( ) ) , actionCollection ( ) ) ;
barcodeAct - > setEnabled ( Barkode : : haveBarcode ( ) ) ;
pictureAct = new TDEAction ( i18n ( " Insert &Picture " ) , TQIconSet ( BarIcon ( " inline_image " ) ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( insertPicture ( ) ) , actionCollection ( ) ) ;
textAct = new TDEAction ( i18n ( " Insert &Text " ) , TQIconSet ( BarIcon ( " text " ) ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( insertText ( ) ) , actionCollection ( ) ) ;
textDataAct = new TDEAction ( i18n ( " Insert &Data Field " ) , TQIconSet ( BarIcon ( " contents " ) ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( insertDataText ( ) ) , actionCollection ( ) ) ;
textLineAct = new TDEAction ( i18n ( " Insert &Text Line " ) , TQIconSet ( BarIcon ( " text " ) ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( insertTextLine ( ) ) , actionCollection ( ) ) ;
lineAct = new TDEAction ( i18n ( " Insert &Line " ) , TQIconSet ( BarIcon ( " kbarcodelinetool " ) ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( insertLine ( ) ) , actionCollection ( ) ) ;
rectAct = new TDEAction ( i18n ( " Insert &Rectangle " ) , TQIconSet ( BarIcon ( " kbarcoderect " ) ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( insertRect ( ) ) , actionCollection ( ) ) ;
circleAct = new TDEAction ( i18n ( " Insert &Ellipse " ) , TQIconSet ( BarIcon ( " kbarcodeellipse " ) ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( insertCircle ( ) ) , actionCollection ( ) ) ;
spellAct = KStdAction : : spelling ( TQT_TQOBJECT ( this ) , TQT_SLOT ( spellCheck ( ) ) , actionCollection ( ) , " spell " ) ;
gridAct = new TDEToggleAction ( i18n ( " &Grid " ) , TQIconSet ( BarIcon ( " kbarcodegrid " ) ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( toggleGrid ( ) ) , actionCollection ( ) ) ;
previewAct = new TDEAction ( i18n ( " &Preview... " ) , 0 , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( preview ( ) ) , actionCollection ( ) ) ;
sep = new TDEActionSeparator ( TQT_TQOBJECT ( this ) ) ;
cutAct = KStdAction : : cut ( TQT_TQOBJECT ( this ) , TQT_SLOT ( cut ( ) ) , actionCollection ( ) , " cut " ) ;
copyAct = KStdAction : : copy ( TQT_TQOBJECT ( this ) , TQT_SLOT ( copy ( ) ) , actionCollection ( ) , " copy " ) ;
pasteAct = KStdAction : : paste ( TQT_TQOBJECT ( this ) , TQT_SLOT ( paste ( ) ) , actionCollection ( ) , " paste " ) ;
selectAllAct = KStdAction : : selectAll ( TQT_TQOBJECT( cv) , TQT_SLOT ( selectAll ( ) ) , actionCollection ( ) , " select_all " ) ;
deSelectAllAct = KStdAction : : deselect ( TQT_TQOBJECT( cv) , TQT_SLOT ( deSelectAll ( ) ) , actionCollection ( ) , " de_select_all " ) ;
addressBookAct = new TDEAction ( i18n ( " Address&book " ) , TQIconSet ( BarIcon ( " kaddressbook " ) ) , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( launchAddressBook ( ) ) , actionCollection ( ) ) ;
pictureAct = new TDEAction ( i18n ( " Insert &Picture " ) , TQIconSet ( BarIcon ( " inline_image " ) ) , 0 , this , TQT_SLOT ( insertPicture ( ) ) , actionCollection ( ) ) ;
textAct = new TDEAction ( i18n ( " Insert &Text " ) , TQIconSet ( BarIcon ( " text " ) ) , 0 , this , TQT_SLOT ( insertText ( ) ) , actionCollection ( ) ) ;
textDataAct = new TDEAction ( i18n ( " Insert &Data Field " ) , TQIconSet ( BarIcon ( " contents " ) ) , 0 , this , TQT_SLOT ( insertDataText ( ) ) , actionCollection ( ) ) ;
textLineAct = new TDEAction ( i18n ( " Insert &Text Line " ) , TQIconSet ( BarIcon ( " text " ) ) , 0 , this , TQT_SLOT ( insertTextLine ( ) ) , actionCollection ( ) ) ;
lineAct = new TDEAction ( i18n ( " Insert &Line " ) , TQIconSet ( BarIcon ( " kbarcodelinetool " ) ) , 0 , this , TQT_SLOT ( insertLine ( ) ) , actionCollection ( ) ) ;
rectAct = new TDEAction ( i18n ( " Insert &Rectangle " ) , TQIconSet ( BarIcon ( " kbarcoderect " ) ) , 0 , this , TQT_SLOT ( insertRect ( ) ) , actionCollection ( ) ) ;
circleAct = new TDEAction ( i18n ( " Insert &Ellipse " ) , TQIconSet ( BarIcon ( " kbarcodeellipse " ) ) , 0 , this , TQT_SLOT ( insertCircle ( ) ) , actionCollection ( ) ) ;
spellAct = KStdAction : : spelling ( this , TQT_SLOT ( spellCheck ( ) ) , actionCollection ( ) , " spell " ) ;
gridAct = new TDEToggleAction ( i18n ( " &Grid " ) , TQIconSet ( BarIcon ( " kbarcodegrid " ) ) , 0 , this , TQT_SLOT ( toggleGrid ( ) ) , actionCollection ( ) ) ;
previewAct = new TDEAction ( i18n ( " &Preview... " ) , 0 , 0 , this , TQT_SLOT ( preview ( ) ) , actionCollection ( ) ) ;
sep = new TDEActionSeparator ( this ) ;
cutAct = KStdAction : : cut ( this , TQT_SLOT ( cut ( ) ) , actionCollection ( ) , " cut " ) ;
copyAct = KStdAction : : copy ( this , TQT_SLOT ( copy ( ) ) , actionCollection ( ) , " copy " ) ;
pasteAct = KStdAction : : paste ( this , TQT_SLOT ( paste ( ) ) , actionCollection ( ) , " paste " ) ;
selectAllAct = KStdAction : : selectAll ( cv, TQT_SLOT ( selectAll ( ) ) , actionCollection ( ) , " select_all " ) ;
deSelectAllAct = KStdAction : : deselect ( cv, TQT_SLOT ( deSelectAll ( ) ) , actionCollection ( ) , " de_select_all " ) ;
addressBookAct = new TDEAction ( i18n ( " Address&book " ) , TQIconSet ( BarIcon ( " kaddressbook " ) ) , 0 , this , TQT_SLOT ( launchAddressBook ( ) ) , actionCollection ( ) ) ;
TDEAction * singleBarcodeAct = new TDEAction ( i18n ( " &Create Single Barcode... " ) , " " ,
0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( startBarcodeGen ( ) ) ,
0 , this , TQT_SLOT ( startBarcodeGen ( ) ) ,
actionCollection ( ) , " create " ) ;
singleBarcodeAct - > setEnabled ( Barkode : : haveBarcode ( ) ) ;
@ -500,12 +500,12 @@ void LabelEditor::setupActions()
lineAct - > plug ( tools ) ;
rectAct - > plug ( tools ) ;
circleAct - > plug ( tools ) ;
( new TDEActionSeparator ( TQT_TQOBJECT ( this ) ) ) - > plug ( tools ) ;
( new TDEActionSeparator ( this ) ) - > plug ( tools ) ;
// spellAct->plug( tools ); // KDE 3.2
gridAct - > plug ( tools ) ;
DSMainWindow : : setupActions ( ) ;
connect ( recentAct , TQT_SIGNAL ( urlSelected ( const KURL & ) ) , TQT_TQOBJECT ( this ) , TQT_SLOT ( startLoadRecentEditor ( const KURL & ) ) ) ;
connect ( recentAct , TQT_SIGNAL ( urlSelected ( const KURL & ) ) , this , TQT_SLOT ( startLoadRecentEditor ( const KURL & ) ) ) ;
TDEPopupMenu * fileMenu = new TDEPopupMenu ( this ) ;
editMenu = new TDEPopupMenu ( this ) ;
@ -579,22 +579,22 @@ void LabelEditor::setupContextMenu()
m_mnuContext - > setCheckable ( true ) ;
TDEPopupMenu * orderMenu = new TDEPopupMenu ( m_mnuContext ) ;
orderMenu - > insertItem ( i18n ( " &On Top " ) , TQT_TQOBJECT ( this ) , TQT_SLOT ( onTopCurrent ( ) ) ) ;
orderMenu - > insertItem ( i18n ( " &Raise " ) , TQT_TQOBJECT ( this ) , TQT_SLOT ( raiseCurrent ( ) ) ) ;
orderMenu - > insertItem ( i18n ( " &Lower " ) , TQT_TQOBJECT ( this ) , TQT_SLOT ( lowerCurrent ( ) ) ) ;
orderMenu - > insertItem ( i18n ( " &To Background " ) , TQT_TQOBJECT ( this ) , TQT_SLOT ( backCurrent ( ) ) ) ;
orderMenu - > insertItem ( i18n ( " &On Top " ) , this , TQT_SLOT ( onTopCurrent ( ) ) ) ;
orderMenu - > insertItem ( i18n ( " &Raise " ) , this , TQT_SLOT ( raiseCurrent ( ) ) ) ;
orderMenu - > insertItem ( i18n ( " &Lower " ) , this , TQT_SLOT ( lowerCurrent ( ) ) ) ;
orderMenu - > insertItem ( i18n ( " &To Background " ) , this , TQT_SLOT ( backCurrent ( ) ) ) ;
TDEPopupMenu * centerMenu = new TDEPopupMenu ( m_mnuContext ) ;
centerMenu - > insertItem ( i18n ( " Center &Horizontally " ) , TQT_TQOBJECT ( this ) , TQT_SLOT ( centerHorizontal ( ) ) ) ;
centerMenu - > insertItem ( i18n ( " Center &Vertically " ) , TQT_TQOBJECT ( this ) , TQT_SLOT ( centerVertical ( ) ) ) ;
centerMenu - > insertItem ( i18n ( " Center &Horizontally " ) , this , TQT_SLOT ( centerHorizontal ( ) ) ) ;
centerMenu - > insertItem ( i18n ( " Center &Vertically " ) , this , TQT_SLOT ( centerVertical ( ) ) ) ;
m_mnuContext - > insertItem ( i18n ( " &Order " ) , orderMenu ) ;
m_mnuContext - > insertItem ( i18n ( " &Center " ) , centerMenu ) ;
m_mnuContext - > insertSeparator ( ) ;
m_mnuContext - > insertItem ( SmallIcon ( " edit-delete " ) , i18n ( " &Delete " ) , cv , TQT_SLOT ( deleteCurrent ( ) ) ) ;
m_mnuContext - > insertItem ( i18n ( " &Protect Position and Size " ) , TQT_TQOBJECT ( this ) , TQT_SLOT ( lockItem ( ) ) , 0 , ID_LOCK_ITEM ) ;
m_mnuContext - > insertItem ( i18n ( " &Protect Position and Size " ) , this , TQT_SLOT ( lockItem ( ) ) , 0 , ID_LOCK_ITEM ) ;
m_mnuContext - > insertSeparator ( ) ;
m_mnuContext - > insertItem ( i18n ( " &Properties " ) , TQT_TQOBJECT ( this ) , TQT_SLOT ( doubleClickedCurrent ( ) ) ) ;
m_mnuContext - > insertItem ( i18n ( " &Properties " ) , this , TQT_SLOT ( doubleClickedCurrent ( ) ) ) ;
}
void LabelEditor : : insertBarcode ( )