@ -64,7 +64,7 @@ void TDEIconEdit::init()
gridview = new KGridView ( & img , history , this ) ;
grid = gridview - > grid ( ) ;
icon = new TDEIconEditIcon ( TQT_TQOBJECT ( this ) , & grid - > image ( ) ) ;
icon = new TDEIconEditIcon ( this , & grid - > image ( ) ) ;
setAcceptDrops ( true ) ;
@ -240,43 +240,43 @@ void TDEIconEdit::setupActions()
// File Menu
action = new TDEAction ( i18n ( " New &Window " ) , " window-new " , cut ,
TQT_TQOBJECT ( this ) , TQT_SLOT ( slotNewWin ( ) ) , actionCollection ( ) , " file_new_window " ) ;
this , TQT_SLOT ( slotNewWin ( ) ) , actionCollection ( ) , " file_new_window " ) ;
action - > setWhatsThis ( i18n ( " New window \n \n Opens a new icon editor window. " ) ) ;
action = KStdAction : : openNew ( TQT_TQOBJECT ( this ) , TQT_SLOT ( slotNew ( ) ) , actionCollection ( ) ) ;
action = KStdAction : : openNew ( this , TQT_SLOT ( slotNew ( ) ) , actionCollection ( ) ) ;
action - > setWhatsThis ( i18n ( " New \n \n Create a new icon, either from a "
" template or by specifying the size " ) ) ;
action = KStdAction : : open ( TQT_TQOBJECT ( this ) , TQT_SLOT ( slotOpen ( ) ) , actionCollection ( ) ) ;
action = KStdAction : : open ( this , TQT_SLOT ( slotOpen ( ) ) , actionCollection ( ) ) ;
action - > setWhatsThis ( i18n ( " Open \n \n Open an existing icon " ) ) ;
m_actRecent = KStdAction : : openRecent ( TQT_TQOBJECT ( this ) ,
m_actRecent = KStdAction : : openRecent ( this ,
TQT_SLOT ( slotOpenRecent ( const KURL & ) ) , actionCollection ( ) ) ;
m_actRecent - > setMaxItems ( 15 ) ; // FIXME should be configurable!
m_actRecent - > loadEntries ( kapp - > config ( ) ) ;
action = KStdAction : : save ( TQT_TQOBJECT ( this ) , TQT_SLOT ( slotSave ( ) ) , actionCollection ( ) ) ;
action = KStdAction : : save ( this , TQT_SLOT ( slotSave ( ) ) , actionCollection ( ) ) ;
action - > setWhatsThis ( i18n ( " Save \n \n Save the current icon " ) ) ;
KStdAction : : saveAs ( TQT_TQOBJECT ( this ) , TQT_SLOT ( slotSaveAs ( ) ) , actionCollection ( ) ) ;
KStdAction : : saveAs ( this , TQT_SLOT ( slotSaveAs ( ) ) , actionCollection ( ) ) ;
action = KStdAction : : print ( TQT_TQOBJECT ( this ) , TQT_SLOT ( slotPrint ( ) ) , actionCollection ( ) ) ;
action = KStdAction : : print ( this , TQT_SLOT ( slotPrint ( ) ) , actionCollection ( ) ) ;
action - > setWhatsThis ( i18n ( " Print \n \n Opens a print dialog to let you print "
" the current icon. " ) ) ;
KStdAction : : close ( TQT_TQOBJECT ( this ) , TQT_SLOT ( slotClose ( ) ) , actionCollection ( ) ) ;
KStdAction : : close ( this , TQT_SLOT ( slotClose ( ) ) , actionCollection ( ) ) ;
// Edit Menu
m_actCut = KStdAction : : cut ( TQT_TQOBJECT ( this ) , TQT_SLOT ( slotCut ( ) ) , actionCollection ( ) ) ;
m_actCut = KStdAction : : cut ( this , TQT_SLOT ( slotCut ( ) ) , actionCollection ( ) ) ;
m_actCut - > setWhatsThis ( i18n ( " Cut \n \n Cut the current selection out of the "
" icon. \n \n (Tip: You can make both rectangular and circular selections) " ) ) ;
m_actCopy = KStdAction : : copy ( TQT_TQOBJECT ( this ) , TQT_SLOT ( slotCopy ( ) ) , actionCollection ( ) ) ;
m_actCopy = KStdAction : : copy ( this , TQT_SLOT ( slotCopy ( ) ) , actionCollection ( ) ) ;
m_actCopy - > setWhatsThis ( i18n ( " Copy \n \n Copy the current selection out of the "
" icon. \n \n (Tip: You can make both rectangular and circular selections) " ) ) ;
m_actPaste = KStdAction : : paste ( TQT_TQOBJECT ( this ) , TQT_SLOT ( slotPaste ( ) ) , actionCollection ( ) ) ;
m_actPaste = KStdAction : : paste ( this , TQT_SLOT ( slotPaste ( ) ) , actionCollection ( ) ) ;
m_actPaste - > setWhatsThis ( i18n ( " Paste \n \n "
" Paste the contents of the clipboard into the current icon. \n \n "
" If the contents are larger than the current icon you can paste them "
@ -284,29 +284,29 @@ void TDEIconEdit::setupActions()
" (Tip: Select \" Paste transparent pixels \" in the configuration dialog "
" if you also want to paste transparency.) " ) ) ;
m_actPasteNew = new TDEAction ( i18n ( " Paste as &New " ) , cut , TQT_TQOBJECT( grid) ,
m_actPasteNew = new TDEAction ( i18n ( " Paste as &New " ) , cut , grid,
TQT_SLOT ( editPasteAsNew ( ) ) , actionCollection ( ) , " edit_paste_as_new " ) ;
KStdAction : : clear ( TQT_TQOBJECT ( this ) , TQT_SLOT ( slotClear ( ) ) , actionCollection ( ) ) ;
KStdAction : : selectAll ( TQT_TQOBJECT ( this ) , TQT_SLOT ( slotSelectAll ( ) ) , actionCollection ( ) ) ;
KStdAction : : clear ( this , TQT_SLOT ( slotClear ( ) ) , actionCollection ( ) ) ;
KStdAction : : selectAll ( this , TQT_SLOT ( slotSelectAll ( ) ) , actionCollection ( ) ) ;
action = new TDEAction ( i18n ( " Resi&ze... " ) , " transform " , cut ,
TQT_TQOBJECT( grid) , TQT_SLOT ( editResize ( ) ) , actionCollection ( ) , " edit_resize " ) ;
grid, TQT_SLOT ( editResize ( ) ) , actionCollection ( ) , " edit_resize " ) ;
action - > setWhatsThis ( i18n ( " Resize \n \n Smoothly resizes the icon while "
" trying to preserve the contents " ) ) ;
action = new TDEAction ( i18n ( " &GrayScale " ) , " grayscale " , cut ,
TQT_TQOBJECT( grid) , TQT_SLOT ( grayScale ( ) ) , actionCollection ( ) , " edit_grayscale " ) ;
grid, TQT_SLOT ( grayScale ( ) ) , actionCollection ( ) , " edit_grayscale " ) ;
action - > setWhatsThis ( i18n ( " Gray scale \n \n Gray scale the current icon. \n "
" (Warning: The result is likely to contain colors not in the icon "
" palette " ) ) ;
// View Menu
m_actZoomIn = KStdAction : : zoomIn ( TQT_TQOBJECT ( this ) , TQT_SLOT ( slotZoomIn ( ) ) ,
m_actZoomIn = KStdAction : : zoomIn ( this , TQT_SLOT ( slotZoomIn ( ) ) ,
actionCollection ( ) ) ;
m_actZoomIn - > setWhatsThis ( i18n ( " Zoom in \n \n Zoom in by one. " ) ) ;
m_actZoomOut = KStdAction : : zoomOut ( TQT_TQOBJECT ( this ) , TQT_SLOT ( slotZoomOut ( ) ) ,
m_actZoomOut = KStdAction : : zoomOut ( this , TQT_SLOT ( slotZoomOut ( ) ) ,
actionCollection ( ) ) ;
m_actZoomOut - > setWhatsThis ( i18n ( " Zoom out \n \n Zoom out by one. " ) ) ;
@ -314,26 +314,26 @@ void TDEIconEdit::setupActions()
actionCollection ( ) , " view_zoom " ) ;
// xgettext:no-c-format
action = new TDEAction ( i18n ( " 100% " ) , cut , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotZoom1 ( ) ) ,
action = new TDEAction ( i18n ( " 100% " ) , cut , this , TQT_SLOT ( slotZoom1 ( ) ) ,
actionCollection ( ) , " view_zoom_1 " ) ;
actMenu - > insert ( action ) ;
// xgettext:no-c-format
action = new TDEAction ( i18n ( " 200% " ) , cut , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotZoom2 ( ) ) ,
action = new TDEAction ( i18n ( " 200% " ) , cut , this , TQT_SLOT ( slotZoom2 ( ) ) ,
actionCollection ( ) , " view_zoom_2 " ) ;
actMenu - > insert ( action ) ;
// xgettext:no-c-format
action = new TDEAction ( i18n ( " 500% " ) , cut , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotZoom5 ( ) ) ,
action = new TDEAction ( i18n ( " 500% " ) , cut , this , TQT_SLOT ( slotZoom5 ( ) ) ,
actionCollection ( ) , " view_zoom_5 " ) ;
actMenu - > insert ( action ) ;
// xgettext:no-c-format
action = new TDEAction ( i18n ( " 1000% " ) , cut , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotZoom10 ( ) ) ,
action = new TDEAction ( i18n ( " 1000% " ) , cut , this , TQT_SLOT ( slotZoom10 ( ) ) ,
actionCollection ( ) , " view_zoom_10 " ) ;
actMenu - > insert ( action ) ;
// Settings Menu
KStdAction : : keyBindings ( TQT_TQOBJECT ( this ) , TQT_SLOT ( slotConfigureKeys ( ) ) ,
KStdAction : : keyBindings ( this , TQT_SLOT ( slotConfigureKeys ( ) ) ,
actionCollection ( ) ) ;
KStdAction : : preferences ( TQT_TQOBJECT ( this ) , TQT_SLOT ( slotConfigureSettings ( ) ) ,
KStdAction : : preferences ( this , TQT_SLOT ( slotConfigureSettings ( ) ) ,
actionCollection ( ) ) ;
createStandardStatusBarAction ( ) ;
@ -341,7 +341,7 @@ void TDEIconEdit::setupActions()
TDEToggleAction * toggle ;
toggle = new TDEToggleAction ( i18n ( " Show &Grid " ) , " grid " ,
cut , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotShowGrid ( ) ) , actionCollection ( ) ,
cut , this , TQT_SLOT ( slotShowGrid ( ) ) , actionCollection ( ) ,
" options_show_grid " ) ;
toggle - > setCheckedState ( i18n ( " Hide &Grid " ) ) ;
toggle - > setWhatsThis ( i18n ( " Show grid \n \n Toggles the grid in the icon "
@ -350,14 +350,14 @@ void TDEIconEdit::setupActions()
// Tools Menu
toolAction = new TDERadioAction ( i18n ( " Color Picker " ) , " colorpicker " ,
cut , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotToolPointer ( ) ) , actionCollection ( ) ,
cut , this , TQT_SLOT ( slotToolPointer ( ) ) , actionCollection ( ) ,
" tool_find_pixel " ) ;
toolAction - > setExclusiveGroup ( " toolActions " ) ;
toolAction - > setWhatsThis ( i18n ( " Color Picker \n \n The color of the pixel clicked "
" on will be the current draw color " ) ) ;
toolAction = new TDERadioAction ( i18n ( " Freehand " ) , " paintbrush " ,
cut , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotToolFreehand ( ) ) , actionCollection ( ) ,
cut , this , TQT_SLOT ( slotToolFreehand ( ) ) , actionCollection ( ) ,
" tool_freehand " ) ;
toolAction - > setExclusiveGroup ( " toolActions " ) ;
toolAction - > setWhatsThis ( i18n ( " Free hand \n \n Draw non-linear lines " ) ) ;
@ -366,64 +366,64 @@ void TDEIconEdit::setupActions()
grid - > setTool ( TDEIconEditGrid : : Freehand ) ;
toolAction = new TDERadioAction ( i18n ( " Rectangle " ) , " rectangle " ,
cut , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotToolRectangle ( ) ) , actionCollection ( ) ,
cut , this , TQT_SLOT ( slotToolRectangle ( ) ) , actionCollection ( ) ,
" tool_rectangle " ) ;
toolAction - > setExclusiveGroup ( " toolActions " ) ;
toolAction - > setWhatsThis ( i18n ( " Rectangle \n \n Draw a rectangle " ) ) ;
toolAction = new TDERadioAction ( i18n ( " Filled Rectangle " ) , " filledrectangle " ,
cut , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotToolFilledRectangle ( ) ) , actionCollection ( ) ,
cut , this , TQT_SLOT ( slotToolFilledRectangle ( ) ) , actionCollection ( ) ,
" tool_filled_rectangle " ) ;
toolAction - > setExclusiveGroup ( " toolActions " ) ;
toolAction - > setWhatsThis ( i18n ( " Filled rectangle \n \n Draw a filled rectangle " ) ) ;
toolAction = new TDERadioAction ( i18n ( " Circle " ) , " circle " ,
cut , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotToolCircle ( ) ) , actionCollection ( ) ,
cut , this , TQT_SLOT ( slotToolCircle ( ) ) , actionCollection ( ) ,
" tool_circle " ) ;
toolAction - > setExclusiveGroup ( " toolActions " ) ;
toolAction - > setWhatsThis ( i18n ( " Circle \n \n Draw a circle " ) ) ;
toolAction = new TDERadioAction ( i18n ( " Filled Circle " ) , " filledcircle " ,
cut , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotToolFilledCircle ( ) ) , actionCollection ( ) ,
cut , this , TQT_SLOT ( slotToolFilledCircle ( ) ) , actionCollection ( ) ,
" tool_filled_circle " ) ;
toolAction - > setExclusiveGroup ( " toolActions " ) ;
toolAction - > setWhatsThis ( i18n ( " Filled circle \n \n Draw a filled circle " ) ) ;
toolAction = new TDERadioAction ( i18n ( " Ellipse " ) , " ellipse " ,
cut , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotToolEllipse ( ) ) , actionCollection ( ) ,
cut , this , TQT_SLOT ( slotToolEllipse ( ) ) , actionCollection ( ) ,
" tool_ellipse " ) ;
toolAction - > setExclusiveGroup ( " toolActions " ) ;
toolAction - > setWhatsThis ( i18n ( " Ellipse \n \n Draw an ellipse " ) ) ;
toolAction = new TDERadioAction ( i18n ( " Filled Ellipse " ) , " filledellipse " ,
cut , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotToolFilledEllipse ( ) ) , actionCollection ( ) ,
cut , this , TQT_SLOT ( slotToolFilledEllipse ( ) ) , actionCollection ( ) ,
" tool_filled_ellipse " ) ;
toolAction - > setExclusiveGroup ( " toolActions " ) ;
toolAction - > setWhatsThis ( i18n ( " Filled ellipse \n \n Draw a filled ellipse " ) ) ;
toolAction = new TDERadioAction ( i18n ( " Spray " ) , " airbrush " ,
cut , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotToolSpray ( ) ) , actionCollection ( ) ,
cut , this , TQT_SLOT ( slotToolSpray ( ) ) , actionCollection ( ) ,
" tool_spray " ) ;
toolAction - > setExclusiveGroup ( " toolActions " ) ;
toolAction - > setWhatsThis ( i18n ( " Spray \n \n Draw scattered pixels in the "
" current color " ) ) ;
toolAction = new TDERadioAction ( i18n ( " Flood Fill " ) , " fill " ,
cut , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotToolFlood ( ) ) , actionCollection ( ) ,
cut , this , TQT_SLOT ( slotToolFlood ( ) ) , actionCollection ( ) ,
" tool_flood_fill " ) ;
toolAction - > setExclusiveGroup ( " toolActions " ) ;
toolAction - > setWhatsThis ( i18n ( " Flood fill \n \n Fill adjoining pixels with "
" the same color with the current color " ) ) ;
toolAction = new TDERadioAction ( i18n ( " Line " ) , " line " ,
cut , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotToolLine ( ) ) , actionCollection ( ) ,
cut , this , TQT_SLOT ( slotToolLine ( ) ) , actionCollection ( ) ,
" tool_line " ) ;
toolAction - > setExclusiveGroup ( " toolActions " ) ;
toolAction - > setWhatsThis ( i18n ( " Line \n \n Draw a straight line vertically, "
" horizontally or at 45 deg. angles " ) ) ;
toolAction = new TDERadioAction ( i18n ( " Eraser (Transparent) " ) , " eraser " ,
cut , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotToolEraser ( ) ) , actionCollection ( ) ,
cut , this , TQT_SLOT ( slotToolEraser ( ) ) , actionCollection ( ) ,
" tool_eraser " ) ;
toolAction - > setExclusiveGroup ( " toolActions " ) ;
toolAction - > setWhatsThis ( i18n ( " Erase \n \n Erase pixels. Set the pixels to "
@ -432,14 +432,14 @@ void TDEIconEdit::setupActions()
" to use) " ) ) ;
toolAction = new TDERadioAction ( i18n ( " Rectangular Selection " ) ,
" selectrect " , cut , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotToolSelectRect ( ) ) ,
" selectrect " , cut , this , TQT_SLOT ( slotToolSelectRect ( ) ) ,
actionCollection ( ) , " edit_select_rectangle " ) ;
toolAction - > setExclusiveGroup ( " toolActions " ) ;
toolAction - > setWhatsThis ( i18n ( " Select \n \n Select a rectangular section "
" of the icon using the mouse. " ) ) ;
toolAction = new TDERadioAction ( i18n ( " Circular Selection " ) ,
" selectcircle " , cut , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotToolSelectCircle ( ) ) ,
" selectcircle " , cut , this , TQT_SLOT ( slotToolSelectCircle ( ) ) ,
actionCollection ( ) , " edit_select_circle " ) ;
toolAction - > setExclusiveGroup ( " toolActions " ) ;
toolAction - > setWhatsThis ( i18n ( " Select \n \n Select a circular section of the "