Diffstat (limited to 'noncore/apps/tinykate/tinykate.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/tinykate/tinykate.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/noncore/apps/tinykate/tinykate.cpp b/noncore/apps/tinykate/tinykate.cpp index 32c1eab..3c9a637 100644 --- a/noncore/apps/tinykate/tinykate.cpp +++ b/noncore/apps/tinykate/tinykate.cpp | |||
@@ -18,24 +18,25 @@ | |||
18 | #include <qtoolbutton.h> | 18 | #include <qtoolbutton.h> |
19 | #include <qmenubar.h> | 19 | #include <qmenubar.h> |
20 | #include <qpe/resource.h> | 20 | #include <qpe/resource.h> |
21 | #include <qpe/qpeapplication.h> | 21 | #include <qpe/qpeapplication.h> |
22 | 22 | ||
23 | #include <opie2/ofiledialog.h> | 23 | #include <opie2/ofiledialog.h> |
24 | 24 | ||
25 | #include "tinykate.h" | 25 | #include "tinykate.h" |
26 | 26 | ||
27 | #include <katedocument.h> | 27 | #include <katedocument.h> |
28 | #include <kglobal.h> | 28 | #include <kglobal.h> |
29 | 29 | ||
30 | using namespace Opie::Ui; | ||
30 | TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : | 31 | TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : |
31 | QMainWindow( parent, name, f ) | 32 | QMainWindow( parent, name, f ) |
32 | { | 33 | { |
33 | shutDown=false; | 34 | shutDown=false; |
34 | nextUnnamed=0; | 35 | nextUnnamed=0; |
35 | currentView=0; | 36 | currentView=0; |
36 | viewCount=0; | 37 | viewCount=0; |
37 | setCaption(tr("TinyKATE")); | 38 | setCaption(tr("TinyKATE")); |
38 | KGlobal::setAppName("TinyKATE"); | 39 | KGlobal::setAppName("TinyKATE"); |
39 | 40 | ||
40 | QMenuBar *mb = new QMenuBar( this ); | 41 | QMenuBar *mb = new QMenuBar( this ); |
41 | mb->setMargin( 0 ); | 42 | mb->setMargin( 0 ); |
@@ -157,25 +158,25 @@ TinyKate::~TinyKate( ) | |||
157 | while (currentView!=0) { | 158 | while (currentView!=0) { |
158 | slotClose(); | 159 | slotClose(); |
159 | } | 160 | } |
160 | 161 | ||
161 | if( KGlobal::config() != 0 ) { | 162 | if( KGlobal::config() != 0 ) { |
162 | qWarning("deleting KateConfig object..\n"); | 163 | qWarning("deleting KateConfig object..\n"); |
163 | delete KGlobal::config(); | 164 | delete KGlobal::config(); |
164 | } | 165 | } |
165 | } | 166 | } |
166 | 167 | ||
167 | void TinyKate::slotOpen( ) | 168 | void TinyKate::slotOpen( ) |
168 | { | 169 | { |
169 | QString filename = Opie::OFileDialog::getOpenFileName( OFileSelector::EXTENDED_ALL, | 170 | QString filename = OFileDialog::getOpenFileName( OFileSelector::EXTENDED_ALL, |
170 | QString::null); | 171 | QString::null); |
171 | if (!filename.isEmpty()) { | 172 | if (!filename.isEmpty()) { |
172 | open(filename); | 173 | open(filename); |
173 | } | 174 | } |
174 | } | 175 | } |
175 | 176 | ||
176 | void TinyKate::open(const QString & filename) | 177 | void TinyKate::open(const QString & filename) |
177 | { | 178 | { |
178 | KateDocument *kd= new KateDocument(false, false, this,0,this); | 179 | KateDocument *kd= new KateDocument(false, false, this,0,this); |
179 | KTextEditor::View *kv; | 180 | KTextEditor::View *kv; |
180 | QFileInfo fi(filename); | 181 | QFileInfo fi(filename); |
181 | QString filenamed = fi.fileName(); | 182 | QString filenamed = fi.fileName(); |
@@ -252,25 +253,25 @@ void TinyKate::slotSave() { | |||
252 | if( kd->docName().isEmpty()) | 253 | if( kd->docName().isEmpty()) |
253 | slotSaveAs(); | 254 | slotSaveAs(); |
254 | else | 255 | else |
255 | kd->saveFile(); | 256 | kd->saveFile(); |
256 | // kv->save(); | 257 | // kv->save(); |
257 | // kd->saveFile(); | 258 | // kd->saveFile(); |
258 | } | 259 | } |
259 | 260 | ||
260 | void TinyKate::slotSaveAs() { | 261 | void TinyKate::slotSaveAs() { |
261 | if (currentView==0) return; | 262 | if (currentView==0) return; |
262 | KateDocument *kd = (KateDocument*) currentView->document(); | 263 | KateDocument *kd = (KateDocument*) currentView->document(); |
263 | 264 | ||
264 | QString filename= Opie::OFileDialog::getSaveFileName(OFileSelector::EXTENDED_ALL, | 265 | QString filename= OFileDialog::getSaveFileName(OFileSelector::EXTENDED_ALL, |
265 | QString::null); | 266 | QString::null); |
266 | if (!filename.isEmpty()) { | 267 | if (!filename.isEmpty()) { |
267 | qDebug("saving file "+filename); | 268 | qDebug("saving file "+filename); |
268 | QFileInfo fi(filename); | 269 | QFileInfo fi(filename); |
269 | QString filenamed = fi.fileName(); | 270 | QString filenamed = fi.fileName(); |
270 | kd->setDocFile( filename); | 271 | kd->setDocFile( filename); |
271 | kd->setDocName( filenamed); | 272 | kd->setDocName( filenamed); |
272 | kd->saveFile(); | 273 | kd->saveFile(); |
273 | // KTextEditor::View *dv = currentView; | 274 | // KTextEditor::View *dv = currentView; |
274 | // tabwidget->changeTab( dv, filenamed); | 275 | // tabwidget->changeTab( dv, filenamed); |
275 | // need to change tab label here | 276 | // need to change tab label here |
276 | } | 277 | } |