Diffstat (limited to 'noncore/apps/tinykate/tinykate.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/tinykate/tinykate.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/noncore/apps/tinykate/tinykate.cpp b/noncore/apps/tinykate/tinykate.cpp index aecc1bd..a25f81f 100644 --- a/noncore/apps/tinykate/tinykate.cpp +++ b/noncore/apps/tinykate/tinykate.cpp | |||
@@ -23,26 +23,21 @@ | |||
23 | #include <qpe/global.h> | 23 | #include <qpe/global.h> |
24 | #include <qpe/qpeapplication.h> | 24 | #include <qpe/qpeapplication.h> |
25 | 25 | ||
26 | #include <opie/ofiledialog.h> | 26 | #include <opie/ofiledialog.h> |
27 | 27 | ||
28 | #include "tinykate.h" | 28 | #include "tinykate.h" |
29 | #include "pics/file-new.xpm" | ||
30 | #include "pics/file-open.xpm" | ||
31 | #include "pics/file-save.xpm" | ||
32 | #include "pics/edit-undo.xpm" | ||
33 | #include "pics/edit-redo.xpm" | ||
34 | 29 | ||
35 | #include <katedocument.h> | 30 | #include <katedocument.h> |
36 | #include <katehighlight.h> | 31 | #include <katehighlight.h> |
37 | #include <kateview.h> | 32 | #include <kateview.h> |
38 | #include <kglobal.h> | 33 | #include <kglobal.h> |
39 | 34 | ||
40 | TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : | 35 | TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : |
41 | QMainWindow( parent, name, f ) | 36 | QMainWindow( parent, name, f ) |
42 | { | 37 | { |
43 | nextUnnamed=0; | 38 | nextUnnamed=0; |
44 | currentView=0; | 39 | currentView=0; |
45 | viewCount=0; | 40 | viewCount=0; |
46 | setCaption(tr("TinyKATE")); | 41 | setCaption(tr("TinyKATE")); |
47 | KGlobal::setAppName("TinyKATE"); | 42 | KGlobal::setAppName("TinyKATE"); |
48 | 43 | ||
@@ -58,37 +53,37 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : | |||
58 | connect(tabwidget,SIGNAL(currentChanged( QWidget *)),this,SLOT(slotCurrentChanged(QWidget *))); | 53 | connect(tabwidget,SIGNAL(currentChanged( QWidget *)),this,SLOT(slotCurrentChanged(QWidget *))); |
59 | 54 | ||
60 | //FILE ACTIONS | 55 | //FILE ACTIONS |
61 | QPopupMenu *popup = new QPopupMenu( this ); | 56 | QPopupMenu *popup = new QPopupMenu( this ); |
62 | 57 | ||
63 | // Action for creating a new document | 58 | // Action for creating a new document |
64 | QAction *a = new QAction( tr( "New" ), QPixmap((const char**)file_new_xpm ), QString::null, 0, this, 0 ); | 59 | QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); |
65 | a->addTo( popup ); | 60 | a->addTo( popup ); |
66 | connect(a, SIGNAL(activated()), this, SLOT(slotNew())); | 61 | connect(a, SIGNAL(activated()), this, SLOT(slotNew())); |
67 | 62 | ||
68 | // Action for opening an exisiting document | 63 | // Action for opening an exisiting document |
69 | a = new QAction( tr( "Open" ), QPixmap((const char**)file_open_xpm), QString::null, 0, this, 0 ); | 64 | a = new QAction( tr( "Open" ),Resource::loadPixmap( "fileopen" ) , QString::null, 0, this, 0 ); |
70 | a->addTo(popup); | 65 | a->addTo(popup); |
71 | connect(a, SIGNAL(activated()), this, SLOT(slotOpen())); | 66 | connect(a, SIGNAL(activated()), this, SLOT(slotOpen())); |
72 | 67 | ||
73 | 68 | ||
74 | // Action for saving document | 69 | // Action for saving document |
75 | a = new QAction( tr( "Save" ), QPixmap((const char**)file_save_xpm), QString::null, 0, this, 0 ); | 70 | a = new QAction( tr( "Save" ), Resource::loadPixmap( "save" ) , QString::null, 0, this, 0 ); |
76 | a->addTo(popup); | 71 | a->addTo(popup); |
77 | connect(a, SIGNAL(activated()), this, SLOT(slotSave())); | 72 | connect(a, SIGNAL(activated()), this, SLOT(slotSave())); |
78 | 73 | ||
79 | // Action for saving document to a new name | 74 | // Action for saving document to a new name |
80 | a = new QAction( tr( "Save As" ), QPixmap((const char**)file_save_xpm), QString::null, 0, this, 0 ); | 75 | a = new QAction( tr( "Save As" ),Resource::loadPixmap( "save" ) , QString::null, 0, this, 0 ); |
81 | a->addTo(popup); | 76 | a->addTo(popup); |
82 | connect(a, SIGNAL(activated()), this, SLOT(slotSaveAs())); | 77 | connect(a, SIGNAL(activated()), this, SLOT(slotSaveAs())); |
83 | 78 | ||
84 | // Action for closing the currently active document | 79 | // Action for closing the currently active document |
85 | a = new QAction( tr( "Close" ), QPixmap(), QString::null, 0, this, 0 ); | 80 | a = new QAction( tr( "Close" ), Resource::loadPixmap( "quit_icon" ) , QString::null, 0, this, 0 ); |
86 | a->addTo(popup); | 81 | a->addTo(popup); |
87 | connect(a, SIGNAL(activated()), this, SLOT(slotClose())); | 82 | connect(a, SIGNAL(activated()), this, SLOT(slotClose())); |
88 | 83 | ||
89 | 84 | ||
90 | mb->insertItem(tr("File"),popup); | 85 | mb->insertItem(tr("File"),popup); |
91 | 86 | ||
92 | //EDIT ACTIONS | 87 | //EDIT ACTIONS |
93 | 88 | ||
94 | // Action for cutting text | 89 | // Action for cutting text |
@@ -106,22 +101,22 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : | |||
106 | 101 | ||
107 | // Action for finding / replacing text | 102 | // Action for finding / replacing text |
108 | editFindReplace = new QAction( tr( "Find/Replace" ), Resource::loadPixmap("find"), QString::null, 0, this, 0 ); | 103 | editFindReplace = new QAction( tr( "Find/Replace" ), Resource::loadPixmap("find"), QString::null, 0, this, 0 ); |
109 | editFindReplace->addTo( bar ); | 104 | editFindReplace->addTo( bar ); |
110 | 105 | ||
111 | // Action for undo | 106 | // Action for undo |
112 | editUndo = new QAction( tr( "Undo" ), QPixmap((const char**)edit_undo_xpm), QString::null, 0, this, 0 ); | 107 | editUndo = new QAction( tr( "Undo" ),Resource::loadPixmap( "undo" ) , QString::null, 0, this, 0 ); |
113 | editUndo->addTo( bar ); | 108 | editUndo->addTo( bar ); |
114 | 109 | ||
115 | // Action for redo | 110 | // Action for redo |
116 | editRedo = new QAction( tr( "Redo" ), QPixmap((const char**)edit_redo_xpm), QString::null, 0, this, 0 ); | 111 | editRedo = new QAction( tr( "Redo" ),Resource::loadPixmap( "redo" ) , QString::null, 0, this, 0 ); |
117 | editRedo->addTo( bar ); | 112 | editRedo->addTo( bar ); |
118 | 113 | ||
119 | //VIEW ACITONS | 114 | //VIEW ACITONS |
120 | popup = new QPopupMenu( this ); | 115 | popup = new QPopupMenu( this ); |
121 | 116 | ||
122 | viewIncFontSizes = new QAction( tr( "Font +" ), QString::null, 0, this, 0 ); | 117 | viewIncFontSizes = new QAction( tr( "Font +" ), QString::null, 0, this, 0 ); |
123 | viewIncFontSizes->addTo( popup ); | 118 | viewIncFontSizes->addTo( popup ); |
124 | 119 | ||
125 | viewDecFontSizes = new QAction( tr( "Font -" ), QString::null, 0, this, 0 ); | 120 | viewDecFontSizes = new QAction( tr( "Font -" ), QString::null, 0, this, 0 ); |
126 | viewDecFontSizes->addTo( popup ); | 121 | viewDecFontSizes->addTo( popup ); |
127 | 122 | ||
@@ -195,13 +190,13 @@ void TinyKate::slotCurrentChanged( QWidget * view) | |||
195 | disconnect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes())); | 190 | disconnect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes())); |
196 | disconnect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int))); | 191 | disconnect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int))); |
197 | disconnect(utilSettings,SIGNAL(activated()), currentView,SLOT(configDialog())); | 192 | disconnect(utilSettings,SIGNAL(activated()), currentView,SLOT(configDialog())); |
198 | } | 193 | } |
199 | 194 | ||
200 | currentView=(KTextEditor::View*)view; | 195 | currentView=(KTextEditor::View*)view; |
201 | 196 | ||
202 | connect(editCopy,SIGNAL(activated()),currentView,SLOT(copy())); | 197 | connect(editCopy,SIGNAL(activated()),currentView,SLOT(copy())); |
203 | connect(editCut,SIGNAL(activated()),currentView,SLOT(cut())); | 198 | connect(editCut,SIGNAL(activated()),currentView,SLOT(cut())); |
204 | connect(editPaste,SIGNAL(activated()),currentView,SLOT(paste())); | 199 | connect(editPaste,SIGNAL(activated()),currentView,SLOT(paste())); |
205 | connect(editUndo,SIGNAL(activated()),currentView,SLOT(undo())); | 200 | connect(editUndo,SIGNAL(activated()),currentView,SLOT(undo())); |
206 | connect(editRedo,SIGNAL(activated()),currentView,SLOT(redo())); | 201 | connect(editRedo,SIGNAL(activated()),currentView,SLOT(redo())); |
207 | connect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes())); | 202 | connect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes())); |