diff -r 2a6157d381fe -r 4c3e9fa0093b texteditor.cpp --- a/texteditor.cpp Mon Apr 10 11:00:19 2006 +0000 +++ b/texteditor.cpp Mon Apr 10 11:00:23 2006 +0000 @@ -31,32 +31,14 @@ #include "noteobj.h" #include "version.h" -#include "icons/fileopen.xpm" -#include "icons/filesave.xpm" -#include "icons/fileprint.xpm" -#include "icons/editundo.xpm" -#include "icons/editredo.xpm" -#include "icons/editcopy.xpm" -#include "icons/editcut.xpm" -#include "icons/editpaste.xpm" -#include "icons/edittrash.xpm" -#include "icons/formatfixedfont.xpm" -#include "icons/formattextbold.xpm" -#include "icons/formattextitalic.xpm" -#include "icons/formattextunder.xpm" -#include "icons/formattextleft.xpm" -#include "icons/formattextcenter.xpm" -#include "icons/formattextright.xpm" -#include "icons/formattextjustify.xpm" -#include "icons/formattextsub.xpm" -#include "icons/formattextsuper.xpm" - extern QCanvas* actCanvas; extern int statusbarTime; extern QSettings settings; extern QAction *actionViewToggleNoteEditor; +extern QString iconPath; + using namespace std; @@ -245,7 +227,7 @@ menuBar()->insertItem( tr( "&File" ), menu ); QAction *a; - a = new QAction( tr( "Import" ), QPixmap( fileopen_xpm), tr( "&Import..." ), CTRL + Key_O, this, "fileImport" ); + a = new QAction( tr( "Import" ), QPixmap( iconPath+"fileopen.png"), tr( "&Import..." ), CTRL + Key_O, this, "fileImport" ); connect( a, SIGNAL( activated() ), this, SLOT( textLoad() ) ); a->setEnabled(false); a->addTo( tb ); @@ -253,7 +235,7 @@ actionFileLoad=a; menu->insertSeparator(); - a = new QAction( tr( "Export Note (HTML)" ), QPixmap( filesave_xpm ), tr( "&Export..." ), CTRL + Key_S, this, "fileSave" ); + a = new QAction( tr( "Export Note (HTML)" ), QPixmap(iconPath+"filesave.png" ), tr( "&Export..." ), CTRL + Key_S, this, "fileSave" ); connect( a, SIGNAL( activated() ), this, SLOT( textSave() ) ); a->addTo( tb ); a->addTo( menu ); @@ -270,7 +252,7 @@ actionFileSaveAs=a; menu->insertSeparator(); - a = new QAction( tr( "Print Note" ), QPixmap( fileprint_xpm ), tr( "&Print..." ), CTRL + Key_P, this, "filePrint" ); + a = new QAction( tr( "Print Note" ), QPixmap(iconPath+"fileprint.png" ), tr( "&Print..." ), CTRL + Key_P, this, "filePrint" ); connect( a, SIGNAL( activated() ), this, SLOT( textPrint() ) ); a->addTo( tb ); a->addTo( menu ); @@ -285,13 +267,13 @@ menuBar()->insertItem( tr( "&Edit" ), menu ); QAction *a; - a = new QAction( tr( "Undo" ), QPixmap(editundo_xpm), tr( "&Undo" ), CTRL + Key_Z, this, "undoEvent" ); + a = new QAction( tr( "Undo" ), QPixmap(iconPath+"undo.png"), tr( "&Undo" ), CTRL + Key_Z, this, "undoEvent" ); connect( a, SIGNAL( activated() ), e, SLOT( undo() ) ); a->addTo( menu ); a->addTo( tb); actionEditUndo=a; - a = new QAction( tr( "Redo" ), QPixmap( editredo_xpm ), tr( "&Redo" ), CTRL + Key_Y, this, "editRedo" ); + a = new QAction( tr( "Redo" ), QPixmap(iconPath+"redo.png" ), tr( "&Redo" ), CTRL + Key_Y, this, "editRedo" ); connect( a, SIGNAL( activated() ), e, SLOT( redo() ) ); a->addTo( tb ); a->addTo( menu ); @@ -303,25 +285,25 @@ a->addTo( menu ); menu->insertSeparator(); - a = new QAction( tr( "Copy" ), QPixmap( editcopy_xpm ), tr( "&Copy" ), CTRL + Key_C, this, "editCopy" ); + a = new QAction( tr( "Copy" ), QPixmap(iconPath+"editcopy.png" ), tr( "&Copy" ), CTRL + Key_C, this, "editCopy" ); connect( a, SIGNAL( activated() ), e, SLOT( copy() ) ); a->addTo( tb ); a->addTo( menu ); actionEditCopy=a; - a = new QAction( tr( "Cut" ), QPixmap( editcut_xpm ), tr( "Cu&t" ), CTRL + Key_X, this, "editCut" ); + a = new QAction( tr( "Cut" ), QPixmap(iconPath+"editcut.png" ), tr( "Cu&t" ), CTRL + Key_X, this, "editCut" ); connect( a, SIGNAL( activated() ), e, SLOT( cut() ) ); a->addTo( tb ); a->addTo( menu ); actionEditCut=a; - a = new QAction( tr( "Paste" ), QPixmap( editpaste_xpm ), tr( "&Paste" ), CTRL + Key_V, this, "editPaste" ); + a = new QAction( tr( "Paste" ), QPixmap(iconPath+"editpaste.png" ), tr( "&Paste" ), CTRL + Key_V, this, "editPaste" ); connect( a, SIGNAL( activated() ), e, SLOT( paste() ) ); a->addTo( tb ); a->addTo( menu ); actionEditPaste=a; - a = new QAction( tr( "Delete all" ), QPixmap( edittrash_xpm ), tr( "&Delete All" ), 0, this, "editDeleteAll" ); + a = new QAction( tr( "Delete all" ), QPixmap( iconPath+"edittrash.png"), tr( "&Delete All" ), 0, this, "editDeleteAll" ); connect( a, SIGNAL( activated() ), e, SLOT( clear() ) ); a->addTo( tb ); a->addTo( menu ); @@ -347,7 +329,7 @@ QAction *a; - a = new QAction( tr( "Toggle font hint for the whole text" ), QPixmap(formatfixedfont_xpm), tr( "&Font hint" ), ALT + Key_I, this, "fontHint" ); + a = new QAction( tr( "Toggle font hint for the whole text" ), QPixmap(iconPath+"formatfixedfont.png"), tr( "&Font hint" ), ALT + Key_I, this, "fontHint" ); a->setToggleAction (true); a->setOn (settings.readBoolEntry ("/vym/noteeditor/fonts/useFixedByDefault",false) ); connect( a, SIGNAL( activated() ), this, SLOT( toggleFonthint() ) ); @@ -382,17 +364,17 @@ actionTextColor->addTo( tb ); actionTextColor->addTo( menu ); - actionTextBold = new QAction( QPixmap (formattextbold_xpm), tr( "&Bold" ), CTRL + Key_B, this, "textBold" ); + actionTextBold = new QAction( QPixmap (iconPath+"text_bold.png"), tr( "&Bold" ), CTRL + Key_B, this, "textBold" ); connect( actionTextBold, SIGNAL( activated() ), this, SLOT( textBold() ) ); actionTextBold->addTo( tb ); actionTextBold->addTo( menu ); actionTextBold->setToggleAction( true ); - actionTextItalic = new QAction( QPixmap(formattextitalic_xpm ), tr( "&Italic" ), CTRL + Key_I, this, "textItalic" ); + actionTextItalic = new QAction( QPixmap(iconPath+"text_italic.png"), tr( "&Italic" ), CTRL + Key_I, this, "textItalic" ); connect( actionTextItalic, SIGNAL( activated() ), this, SLOT( textItalic() ) ); actionTextItalic->addTo( tb ); actionTextItalic->addTo( menu ); actionTextItalic->setToggleAction( true ); - actionTextUnderline = new QAction( QPixmap (formattextunder_xpm ), tr( "&Underline" ), CTRL + Key_U, this, "textUnderline" ); + actionTextUnderline = new QAction( QPixmap (iconPath+"text_italic.png"), tr( "&Underline" ), CTRL + Key_U, this, "textUnderline" ); connect( actionTextUnderline, SIGNAL( activated() ), this, SLOT( textUnderline() ) ); actionTextUnderline->addTo( tb ); actionTextUnderline->addTo( menu ); @@ -402,13 +384,13 @@ QActionGroup *grp = new QActionGroup( this ); connect( grp, SIGNAL( selected( QAction* ) ), this, SLOT( textAlign( QAction* ) ) ); - actionAlignLeft = new QAction( QPixmap (formattextleft_xpm ), tr( "&Left" ), CTRL + Key_L, grp, "textLeft" ); + actionAlignLeft = new QAction( QPixmap (iconPath+"text_left.png"), tr( "&Left" ), CTRL + Key_L, grp, "textLeft" ); actionAlignLeft->setToggleAction( true ); - actionAlignCenter = new QAction( QPixmap (formattextcenter_xpm ), tr( "C&enter" ), CTRL + Key_E, grp, "textCenter" ); + actionAlignCenter = new QAction( QPixmap (iconPath+"text_center.png"), tr( "C&enter" ), CTRL + Key_E, grp, "textCenter" ); actionAlignCenter->setToggleAction( true ); - actionAlignRight = new QAction( QPixmap (formattextright_xpm ), tr( "&Right" ), CTRL + Key_R, grp, "textRight" ); + actionAlignRight = new QAction( QPixmap (iconPath+"text_right.png" ), tr( "&Right" ), CTRL + Key_R, grp, "textRight" ); actionAlignRight->setToggleAction( true ); - actionAlignJustify = new QAction( QPixmap ( formattextjustify_xpm ), tr( "&Justify" ), CTRL + Key_J, grp, "textjustify" ); + actionAlignJustify = new QAction( QPixmap ( iconPath+"text_block.png"), tr( "&Justify" ), CTRL + Key_J, grp, "textjustify" ); actionAlignJustify->setToggleAction( true ); grp->addTo( tb ); @@ -416,12 +398,12 @@ QActionGroup *grp2 = new QActionGroup( this ); grp2->setExclusive(false); - actionAlignSubScript = new QAction( QPixmap (formattextsub_xpm ), tr( "Subs&cript" ), CTRL + SHIFT + Key_B, grp2, "textSubscript" ); + actionAlignSubScript = new QAction( QPixmap (iconPath+"text_sub.png"), tr( "Subs&cript" ), CTRL + SHIFT + Key_B, grp2, "textSubscript" ); actionAlignSubScript->setToggleAction( true ); connect(actionAlignSubScript, SIGNAL(activated()), this, SLOT(textVAlign())); - actionAlignSuperScript = new QAction( QPixmap (formattextsuper_xpm ), tr( "Su&perscript" ), CTRL + SHIFT + Key_P, grp2, "textSuperscript" ); + actionAlignSuperScript = new QAction( QPixmap (iconPath+"text_super.png"), tr( "Su&perscript" ), CTRL + SHIFT + Key_P, grp2, "textSuperscript" ); actionAlignSuperScript->setToggleAction( true ); connect(actionAlignSuperScript, SIGNAL(activated()), this, SLOT(textVAlign()));