summaryrefslogtreecommitdiff
path: root/noncore/apps/tinykate/tinykate.cpp
Unidiff
Diffstat (limited to 'noncore/apps/tinykate/tinykate.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/tinykate/tinykate.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/tinykate/tinykate.cpp b/noncore/apps/tinykate/tinykate.cpp
index 19a0127..32c1eab 100644
--- a/noncore/apps/tinykate/tinykate.cpp
+++ b/noncore/apps/tinykate/tinykate.cpp
@@ -1,141 +1,141 @@
1/*************************************************************************** 1/***************************************************************************
2 tinykate.cpp 2 tinykate.cpp
3 Tiny KATE mainwindow 3 Tiny KATE mainwindow
4 ------------------- 4 -------------------
5 begin : November 2002 5 begin : November 2002
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
30TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : 30TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
31 QMainWindow( parent, name, f ) 31 QMainWindow( parent, name, f )
32{ 32{
33 shutDown=false; 33 shutDown=false;
34 nextUnnamed=0; 34 nextUnnamed=0;
35 currentView=0; 35 currentView=0;
36 viewCount=0; 36 viewCount=0;
37 setCaption(tr("TinyKATE")); 37 setCaption(tr("TinyKATE"));
38 KGlobal::setAppName("TinyKATE"); 38 KGlobal::setAppName("TinyKATE");
39 39
40 QMenuBar *mb = new QMenuBar( this ); 40 QMenuBar *mb = new QMenuBar( this );
41 mb->setMargin( 0 ); 41 mb->setMargin( 0 );
42 42
43 tabwidget=new OTabWidget(this); 43 tabwidget=new OTabWidget(this);
44 setCentralWidget(tabwidget); 44 setCentralWidget(tabwidget);
45 connect(tabwidget,SIGNAL(currentChanged( QWidget *)),this,SLOT(slotCurrentChanged(QWidget *))); 45 connect(tabwidget,SIGNAL(currentChanged(QWidget*)),this,SLOT(slotCurrentChanged(QWidget*)));
46 46
47//FILE ACTIONS 47//FILE ACTIONS
48 QPopupMenu *popup = new QPopupMenu( this ); 48 QPopupMenu *popup = new QPopupMenu( this );
49 49
50 // Action for creating a new document 50 // Action for creating a new document
51 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); 51 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 );
52 a->addTo( popup ); 52 a->addTo( popup );
53 connect(a, SIGNAL(activated()), this, SLOT(slotNew())); 53 connect(a, SIGNAL(activated()), this, SLOT(slotNew()));
54 54
55 // Action for opening an exisiting document 55 // Action for opening an exisiting document
56 a = new QAction( tr( "Open" ),Resource::loadPixmap( "fileopen" ) , QString::null, 0, this, 0 ); 56 a = new QAction( tr( "Open" ),Resource::loadPixmap( "fileopen" ) , QString::null, 0, this, 0 );
57 a->addTo(popup); 57 a->addTo(popup);
58 connect(a, SIGNAL(activated()), this, SLOT(slotOpen())); 58 connect(a, SIGNAL(activated()), this, SLOT(slotOpen()));
59 59
60 60
61 // Action for saving document 61 // Action for saving document
62 a = new QAction( tr( "Save" ), Resource::loadPixmap( "save" ) , QString::null, 0, this, 0 ); 62 a = new QAction( tr( "Save" ), Resource::loadPixmap( "save" ) , QString::null, 0, this, 0 );
63 a->addTo(popup); 63 a->addTo(popup);
64 connect(a, SIGNAL(activated()), this, SLOT(slotSave())); 64 connect(a, SIGNAL(activated()), this, SLOT(slotSave()));
65 65
66 // Action for saving document to a new name 66 // Action for saving document to a new name
67 a = new QAction( tr( "Save As" ),Resource::loadPixmap( "save" ) , QString::null, 0, this, 0 ); 67 a = new QAction( tr( "Save As" ),Resource::loadPixmap( "save" ) , QString::null, 0, this, 0 );
68 a->addTo(popup); 68 a->addTo(popup);
69 connect(a, SIGNAL(activated()), this, SLOT(slotSaveAs())); 69 connect(a, SIGNAL(activated()), this, SLOT(slotSaveAs()));
70 70
71 // Action for closing the currently active document 71 // Action for closing the currently active document
72 a = new QAction( tr( "Close" ), Resource::loadPixmap( "quit_icon" ) , QString::null, 0, this, 0 ); 72 a = new QAction( tr( "Close" ), Resource::loadPixmap( "quit_icon" ) , QString::null, 0, this, 0 );
73 a->addTo(popup); 73 a->addTo(popup);
74 connect(a, SIGNAL(activated()), this, SLOT(slotClose())); 74 connect(a, SIGNAL(activated()), this, SLOT(slotClose()));
75 75
76 76
77 mb->insertItem(tr("File"),popup); 77 mb->insertItem(tr("File"),popup);
78 78
79//EDIT ACTIONS 79//EDIT ACTIONS
80 80
81 // Action for cutting text 81 // Action for cutting text
82 editCut = new QToolButton( 0 ); 82 editCut = new QToolButton( 0 );
83 editCut->setAutoRaise( true ); 83 editCut->setAutoRaise( true );
84 editCut->setIconSet( Resource::loadPixmap( "cut" ) ); 84 editCut->setIconSet( Resource::loadPixmap( "cut" ) );
85 85
86 // Action for Copying text 86 // Action for Copying text
87 editCopy = new QToolButton( 0 ); 87 editCopy = new QToolButton( 0 );
88 editCopy->setAutoRaise( true ); 88 editCopy->setAutoRaise( true );
89 editCopy->setIconSet( Resource::loadPixmap( "copy" ) ); 89 editCopy->setIconSet( Resource::loadPixmap( "copy" ) );
90 90
91 // Action for pasting text 91 // Action for pasting text
92 editPaste = new QToolButton( 0 ); 92 editPaste = new QToolButton( 0 );
93 editPaste->setAutoRaise( true ); 93 editPaste->setAutoRaise( true );
94 editPaste->setIconSet( Resource::loadPixmap( "paste" ) ); 94 editPaste->setIconSet( Resource::loadPixmap( "paste" ) );
95 95
96 // Action for finding / replacing text 96 // Action for finding / replacing text
97 editFindReplace = new QToolButton( 0 ); 97 editFindReplace = new QToolButton( 0 );
98 editFindReplace->setAutoRaise( true ); 98 editFindReplace->setAutoRaise( true );
99 editFindReplace->setIconSet( Resource::loadPixmap("find") ); 99 editFindReplace->setIconSet( Resource::loadPixmap("find") );
100 100
101 // Action for undo 101 // Action for undo
102 editUndo = new QToolButton( 0 ); 102 editUndo = new QToolButton( 0 );
103 editUndo->setAutoRaise( true ); 103 editUndo->setAutoRaise( true );
104 editUndo->setIconSet( Resource::loadPixmap( "undo" ) ); 104 editUndo->setIconSet( Resource::loadPixmap( "undo" ) );
105 105
106 // Action for redo 106 // Action for redo
107 editRedo = new QToolButton( 0 ); 107 editRedo = new QToolButton( 0 );
108 editRedo->setAutoRaise( true ); 108 editRedo->setAutoRaise( true );
109 editRedo->setIconSet( Resource::loadPixmap( "redo" ) ); 109 editRedo->setIconSet( Resource::loadPixmap( "redo" ) );
110 110
111//VIEW ACITONS 111//VIEW ACITONS
112 popup = new QPopupMenu( this ); 112 popup = new QPopupMenu( this );
113 113
114 viewIncFontSizes = new QAction( tr( "Font +" ), QString::null, 0, this, 0 ); 114 viewIncFontSizes = new QAction( tr( "Font +" ), QString::null, 0, this, 0 );
115 viewIncFontSizes->addTo( popup ); 115 viewIncFontSizes->addTo( popup );
116 116
117 viewDecFontSizes = new QAction( tr( "Font -" ), QString::null, 0, this, 0 ); 117 viewDecFontSizes = new QAction( tr( "Font -" ), QString::null, 0, this, 0 );
118 viewDecFontSizes->addTo( popup ); 118 viewDecFontSizes->addTo( popup );
119 119
120 mb->insertItem(tr("View"),popup); 120 mb->insertItem(tr("View"),popup);
121 121
122 popup = new QPopupMenu( this ); 122 popup = new QPopupMenu( this );
123 mb->insertItem(tr("Utils"),popup); 123 mb->insertItem(tr("Utils"),popup);
124 124
125 125
126 mb->insertItem( editCut ); 126 mb->insertItem( editCut );
127 mb->insertItem( editCopy ); 127 mb->insertItem( editCopy );
128 mb->insertItem( editPaste ); 128 mb->insertItem( editPaste );
129 mb->insertItem( editFindReplace ); 129 mb->insertItem( editFindReplace );
130 mb->insertItem( editUndo ); 130 mb->insertItem( editUndo );
131 mb->insertItem( editRedo ); 131 mb->insertItem( editRedo );
132 132
133 133
134//Highlight management 134//Highlight management
135 hlmenu=new QPopupMenu(this); 135 hlmenu=new QPopupMenu(this);
136 HlManager *hlm=HlManager::self(); 136 HlManager *hlm=HlManager::self();
137 for (int i=0;i<hlm->highlights();i++) 137 for (int i=0;i<hlm->highlights();i++)
138 { 138 {
139 hlmenu->insertItem(hlm->hlName(i),i); 139 hlmenu->insertItem(hlm->hlName(i),i);
140 } 140 }
141 popup->insertItem(tr("Highlighting"),hlmenu); 141 popup->insertItem(tr("Highlighting"),hlmenu);