summaryrefslogtreecommitdiff
path: root/noncore/apps/tinykate
authorzecke <zecke>2004-03-13 22:41:59 (UTC)
committer zecke <zecke>2004-03-13 22:41:59 (UTC)
commit3d27828732fe7e499219ad6e208dc13dead86431 (patch) (unidiff)
treefaa42dec364ad1e0470a370c81d0a7dc0cd2f9bc /noncore/apps/tinykate
parentee753c0009da5bec4a71d3263e9623d04dddc5c4 (diff)
downloadopie-3d27828732fe7e499219ad6e208dc13dead86431.zip
opie-3d27828732fe7e499219ad6e208dc13dead86431.tar.gz
opie-3d27828732fe7e499219ad6e208dc13dead86431.tar.bz2
Namespace changes for Apps
QAshMoney and Reader need to be valgrinded
Diffstat (limited to 'noncore/apps/tinykate') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/tinykate/libkate/view/kateviewdialog.cpp2
-rw-r--r--noncore/apps/tinykate/libkate/view/kateviewdialog.h2
-rw-r--r--noncore/apps/tinykate/main.cpp3
-rw-r--r--noncore/apps/tinykate/tinykate.cpp7
-rw-r--r--noncore/apps/tinykate/tinykate.h2
5 files changed, 11 insertions, 5 deletions
diff --git a/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp b/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp
index 8e68262..c3a0a2e 100644
--- a/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp
+++ b/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp
@@ -26,48 +26,50 @@
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qlistbox.h> 27#include <qlistbox.h>
28#include <qgroupbox.h> 28#include <qgroupbox.h>
29#include <qlineedit.h> 29#include <qlineedit.h>
30#include <qcheckbox.h> 30#include <qcheckbox.h>
31#include <qcollection.h> 31#include <qcollection.h>
32#include <qpushbutton.h> 32#include <qpushbutton.h>
33#include <qobjectlist.h> 33#include <qobjectlist.h>
34#include <qradiobutton.h> 34#include <qradiobutton.h>
35#include <qwhatsthis.h> 35#include <qwhatsthis.h>
36#include <qstringlist.h> 36#include <qstringlist.h>
37#include <klocale.h> 37#include <klocale.h>
38#include <kcolorbtn.h> 38#include <kcolorbtn.h>
39#include <kglobal.h> 39#include <kglobal.h>
40#include <qvbox.h> 40#include <qvbox.h>
41#include <qspinbox.h> 41#include <qspinbox.h>
42#include <qcombobox.h> 42#include <qcombobox.h>
43#include <kfontdialog.h> 43#include <kfontdialog.h>
44 44
45#include "../document/katedocument.h" 45#include "../document/katedocument.h"
46#include "kateviewdialog.h" 46#include "kateviewdialog.h"
47#include <opie2/ofontselector.h> 47#include <opie2/ofontselector.h>
48 48
49 49
50using namespace Opie::Ui;
51using namespace Opie::Ui;
50SearchDialog::SearchDialog( QWidget *parent, QStringList &searchFor, QStringList &replaceWith, int flags ) 52SearchDialog::SearchDialog( QWidget *parent, QStringList &searchFor, QStringList &replaceWith, int flags )
51 : KDialogBase( parent, 0L, true, i18n( "Find Text" ), Ok | Cancel, Ok ) 53 : KDialogBase( parent, 0L, true, i18n( "Find Text" ), Ok | Cancel, Ok )
52 , m_replace( 0L ) 54 , m_replace( 0L )
53{ 55{
54 QWidget *page = new QWidget( this ); 56 QWidget *page = new QWidget( this );
55 setMainWidget( page ); 57 setMainWidget( page );
56 58
57 QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); 59 QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() );
58 60
59 m_search = new QComboBox( true, page ); 61 m_search = new QComboBox( true, page );
60 m_search->insertStringList( searchFor ); 62 m_search->insertStringList( searchFor );
61 m_search->setMinimumWidth( m_search->sizeHint().width() ); 63 m_search->setMinimumWidth( m_search->sizeHint().width() );
62 m_search->lineEdit()->selectAll(); 64 m_search->lineEdit()->selectAll();
63 QLabel *label = new QLabel( m_search, i18n( "&Text To Find:" ), page ); 65 QLabel *label = new QLabel( m_search, i18n( "&Text To Find:" ), page );
64 m_optRegExp = new QCheckBox( i18n( "Regular Expression" ), page ); 66 m_optRegExp = new QCheckBox( i18n( "Regular Expression" ), page );
65 topLayout->addWidget( label ); 67 topLayout->addWidget( label );
66 topLayout->addWidget( m_search ); 68 topLayout->addWidget( m_search );
67 topLayout->addWidget( m_optRegExp ); 69 topLayout->addWidget( m_optRegExp );
68 70
69 if( flags & KateView::sfReplace ) 71 if( flags & KateView::sfReplace )
70 { 72 {
71 // make it a replace dialog 73 // make it a replace dialog
72 setCaption( i18n( "Replace Text" ) ); 74 setCaption( i18n( "Replace Text" ) );
73 m_replace = new QComboBox( true, page ); 75 m_replace = new QComboBox( true, page );
diff --git a/noncore/apps/tinykate/libkate/view/kateviewdialog.h b/noncore/apps/tinykate/libkate/view/kateviewdialog.h
index 98d8799..d081152 100644
--- a/noncore/apps/tinykate/libkate/view/kateviewdialog.h
+++ b/noncore/apps/tinykate/libkate/view/kateviewdialog.h
@@ -163,34 +163,34 @@ public:
163 ~ColorConfig(); 163 ~ColorConfig();
164 164
165 void setColors( QColor * ); 165 void setColors( QColor * );
166 void getColors( QColor * ); 166 void getColors( QColor * );
167 167
168private: 168private:
169 169
170 KColorButton *m_back; 170 KColorButton *m_back;
171 KColorButton *m_selected; 171 KColorButton *m_selected;
172}; 172};
173 173
174class FontConfig : public QWidget 174class FontConfig : public QWidget
175{ 175{
176 Q_OBJECT 176 Q_OBJECT
177 177
178public: 178public:
179 179
180 FontConfig( QWidget *parent = 0, char *name = 0 ); 180 FontConfig( QWidget *parent = 0, char *name = 0 );
181 ~FontConfig(); 181 ~FontConfig();
182 182
183 void setFont ( const QFont &font ); 183 void setFont ( const QFont &font );
184 QFont getFont ( ) { return myFont; }; 184 QFont getFont ( ) { return myFont; };
185 185
186 private: 186 private:
187 Opie::OFontSelector *m_fontselect; 187 Opie::Opie::Ui::OFontSelector *m_fontselect;
188// class KFontChooser *m_fontchooser; 188// class KFontChooser *m_fontchooser;
189 QFont myFont; 189 QFont myFont;
190 190
191 private slots: 191 private slots:
192 void slotFontSelected( const QFont &font ); 192 void slotFontSelected( const QFont &font );
193}; 193};
194 194
195 195
196#endif //_KWDIALOG_H_ 196#endif //_KWDIALOG_H_
diff --git a/noncore/apps/tinykate/main.cpp b/noncore/apps/tinykate/main.cpp
index e62930c..c14d10a 100644
--- a/noncore/apps/tinykate/main.cpp
+++ b/noncore/apps/tinykate/main.cpp
@@ -1,22 +1,25 @@
1/*************************************************************************** 1/***************************************************************************
2
2 main.cpp 3 main.cpp
3 ------------------- 4 -------------------
4 begin : November 2002 5 begin : November 2002
5 copyright : (C) 2002 by Joseph Wenninger <jowenn@kde.org> 6 copyright : (C) 2002 by Joseph Wenninger <jowenn@kde.org>
6 ***************************************************************************/ 7 ***************************************************************************/
7 8
8/*************************************************************************** 9/***************************************************************************
9 * * 10 * *
10 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation. * 13 * the Free Software Foundation. *
13 * ONLY VERSION 2 OF THE LICENSE IS APPLICABLE * 14 * ONLY VERSION 2 OF THE LICENSE IS APPLICABLE *
14 * * 15 * *
15 ***************************************************************************/ 16 ***************************************************************************/
16 17
17#include <opie2/oapplicationfactory.h> 18#include <opie2/oapplicationfactory.h>
18 19
19#include "tinykate.h" 20#include "tinykate.h"
20 21
22using namespace Opie::Core;
23
21OPIE_EXPORT_APP( OApplicationFactory<TinyKate> ) 24OPIE_EXPORT_APP( OApplicationFactory<TinyKate> )
22 25
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
@@ -6,48 +6,49 @@
6 copyright : (C) 2002 by Joseph Wenninger <jowenn@kde.org> 6 copyright : (C) 2002 by Joseph Wenninger <jowenn@kde.org>
7 ***************************************************************************/ 7 ***************************************************************************/
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free softwaSre; you can redistribute it and/or modify * 11 * This program is free softwaSre; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation. * 13 * the Free Software Foundation. *
14 * ONLY VERSION 2 OF THE LICENSE IS APPLICABLE * 14 * ONLY VERSION 2 OF THE LICENSE IS APPLICABLE *
15 * * 15 * *
16 ***************************************************************************/ 16 ***************************************************************************/
17#include <qaction.h> 17#include <qaction.h>
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
30using namespace Opie::Ui;
30TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : 31TinyKate::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 );
42 43
43 tabwidget=new OTabWidget(this); 44 tabwidget=new OTabWidget(this);
44 setCentralWidget(tabwidget); 45 setCentralWidget(tabwidget);
45 connect(tabwidget,SIGNAL(currentChanged(QWidget*)),this,SLOT(slotCurrentChanged(QWidget*))); 46 connect(tabwidget,SIGNAL(currentChanged(QWidget*)),this,SLOT(slotCurrentChanged(QWidget*)));
46 47
47//FILE ACTIONS 48//FILE ACTIONS
48 QPopupMenu *popup = new QPopupMenu( this ); 49 QPopupMenu *popup = new QPopupMenu( this );
49 50
50 // Action for creating a new document 51 // Action for creating a new document
51 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); 52 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 );
52 a->addTo( popup ); 53 a->addTo( popup );
53 connect(a, SIGNAL(activated()), this, SLOT(slotNew())); 54 connect(a, SIGNAL(activated()), this, SLOT(slotNew()));
@@ -145,49 +146,49 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
145 utilSettings->addTo( popup); 146 utilSettings->addTo( popup);
146 147
147 if( qApp->argc() > 1) open(qApp->argv()[1]); 148 if( qApp->argc() > 1) open(qApp->argv()[1]);
148 else slotNew(); 149 else slotNew();
149 150
150} 151}
151 152
152TinyKate::~TinyKate( ) 153TinyKate::~TinyKate( )
153{ 154{
154 qWarning("TinyKate destructor\n"); 155 qWarning("TinyKate destructor\n");
155 156
156 shutDown=true; 157 shutDown=true;
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
167void TinyKate::slotOpen( ) 168void 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
176void TinyKate::open(const QString & filename) 177void 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();
182 tabwidget->addTab(kv=kd->createView(tabwidget,"bLAH"),"tinykate/tinykate", filenamed ); 183 tabwidget->addTab(kv=kd->createView(tabwidget,"bLAH"),"tinykate/tinykate", filenamed );
183 qDebug(filename); 184 qDebug(filename);
184 185
185 kd->setDocName( filenamed); 186 kd->setDocName( filenamed);
186 kd->open( filename ); 187 kd->open( filename );
187 viewCount++; 188 viewCount++;
188} 189}
189 190
190void TinyKate::setDocument(const QString& fileref) 191void TinyKate::setDocument(const QString& fileref)
191{ 192{
192 open( fileref ); 193 open( fileref );
193} 194}
@@ -240,39 +241,39 @@ void TinyKate::slotClose( )
240 delete dv->document(); 241 delete dv->document();
241 viewCount--; 242 viewCount--;
242 if ((!viewCount) && (!shutDown)) slotNew(); 243 if ((!viewCount) && (!shutDown)) slotNew();
243} 244}
244 245
245void TinyKate::slotSave() { 246void TinyKate::slotSave() {
246 // feel free to make this how you want 247 // feel free to make this how you want
247 if (currentView==0) return; 248 if (currentView==0) return;
248 249
249 // KateView *kv = (KateView*) currentView; 250 // KateView *kv = (KateView*) currentView;
250 KateDocument *kd = (KateDocument*) currentView->document(); 251 KateDocument *kd = (KateDocument*) currentView->document();
251 // qDebug("saving file "+kd->docName()); 252 // qDebug("saving file "+kd->docName());
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
260void TinyKate::slotSaveAs() { 261void 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 }
277 278
278} 279}
diff --git a/noncore/apps/tinykate/tinykate.h b/noncore/apps/tinykate/tinykate.h
index f844c55..f435c03 100644
--- a/noncore/apps/tinykate/tinykate.h
+++ b/noncore/apps/tinykate/tinykate.h
@@ -29,38 +29,38 @@ class QPopupMenu;
29 29
30class TinyKate : public QMainWindow 30class TinyKate : public QMainWindow
31{ 31{
32Q_OBJECT 32Q_OBJECT
33public: 33public:
34 TinyKate( QWidget *parent=0, const char *name=0, WFlags f = 0); 34 TinyKate( QWidget *parent=0, const char *name=0, WFlags f = 0);
35 ~TinyKate( ); 35 ~TinyKate( );
36 static QString appName() { return QString::fromLatin1( "kate" ); }; 36 static QString appName() { return QString::fromLatin1( "kate" ); };
37 37
38 38
39public slots: 39public slots:
40 void slotNew(); 40 void slotNew();
41 void setDocument(const QString& fileref); 41 void setDocument(const QString& fileref);
42 42
43protected slots: 43protected slots:
44 void slotOpen(); 44 void slotOpen();
45 void slotClose(); 45 void slotClose();
46 void slotCurrentChanged(QWidget *); 46 void slotCurrentChanged(QWidget *);
47 void slotSave(); 47 void slotSave();
48 void slotSaveAs(); 48 void slotSaveAs();
49protected: 49protected:
50 void open(const QString&); 50 void open(const QString&);
51private: 51private:
52 QString currentFileName; 52 QString currentFileName;
53 OTabWidget *tabwidget; 53 Opie::Ui::OTabWidget *tabwidget;
54 KTextEditor::View *currentView; 54 KTextEditor::View *currentView;
55 bool shutDown; 55 bool shutDown;
56 56
57 QToolButton *editCopy, *editCut, *editPaste, *editUndo, *editRedo, *editFindReplace; 57 QToolButton *editCopy, *editCut, *editPaste, *editUndo, *editRedo, *editFindReplace;
58 QAction *viewIncFontSizes, *viewDecFontSizes, *utilSettings; 58 QAction *viewIncFontSizes, *viewDecFontSizes, *utilSettings;
59 59
60 QPopupMenu *hlmenu; 60 QPopupMenu *hlmenu;
61 uint nextUnnamed; 61 uint nextUnnamed;
62 uint viewCount; 62 uint viewCount;
63}; 63};
64 64
65 65
66#endif // __TINYKATE_H__ 66#endif // __TINYKATE_H__