summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-12-22 17:30:50 (UTC)
committer llornkcor <llornkcor>2002-12-22 17:30:50 (UTC)
commita907eb4d3c6ca142dcab7889d8932ccb452bf07c (patch) (side-by-side diff)
tree985933c8c2dd1f49dee60c898b3b951f99f4eaf3
parentd7859bf6df42c36f87ecaa560754b3b3b3c2e78e (diff)
downloadopie-a907eb4d3c6ca142dcab7889d8932ccb452bf07c.zip
opie-a907eb4d3c6ca142dcab7889d8932ccb452bf07c.tar.gz
opie-a907eb4d3c6ca142dcab7889d8932ccb452bf07c.tar.bz2
add fileName to tab instead of BLAH
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/tinykate/tinykate.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/apps/tinykate/tinykate.cpp b/noncore/apps/tinykate/tinykate.cpp
index f177e47..a823530 100644
--- a/noncore/apps/tinykate/tinykate.cpp
+++ b/noncore/apps/tinykate/tinykate.cpp
@@ -129,65 +129,66 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
//Highlight management
hlmenu=new QPopupMenu(this);
HlManager *hlm=HlManager::self();
for (int i=0;i<hlm->highlights();i++)
{
hlmenu->insertItem(hlm->hlName(i),i);
}
popup->insertItem(tr("Highlighting"),hlmenu);
utilSettings = new QAction( tr( "Settings" ), QString::null, 0, this, 0 );
utilSettings->addTo( popup);
if( qApp->argc() > 1) open(qApp->argv()[1]);
else slotNew();
}
void TinyKate::slotOpen( )
{
QString filename=OFileDialog::getOpenFileName(OFileSelector::EXTENDED_ALL);
if (!filename.isEmpty()) {
open(filename);
}
}
void TinyKate::open(const QString & filename)
{
KateDocument *kd= new KateDocument(false, false, this,0,this);
KTextEditor::View *kv;
- tabwidget->addTab(kv=kd->createView(tabwidget,"bLAH"),"tinykate/tinykate","BLAH");
+ QFileInfo fi(filename);
+ tabwidget->addTab(kv=kd->createView(tabwidget,"bLAH"),"tinykate/tinykate",fi.fileName());
qDebug(filename);
kd->open(filename);
viewCount++;
}
void TinyKate::slotCurrentChanged( QWidget * view)
{
if (currentView) {
disconnect(editCopy,SIGNAL(activated()),currentView,SLOT(copy()));
disconnect(editCut,SIGNAL(activated()),currentView,SLOT(cut()));
disconnect(editPaste,SIGNAL(activated()),currentView,SLOT(paste()));
disconnect(editUndo,SIGNAL(activated()),currentView,SLOT(undo()));
disconnect(editRedo,SIGNAL(activated()),currentView,SLOT(redo()));
disconnect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes()));
disconnect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes()));
disconnect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int)));
disconnect(utilSettings,SIGNAL(activated()), currentView,SLOT(configDialog()));
}
currentView=(KTextEditor::View*)view;
connect(editCopy,SIGNAL(activated()),currentView,SLOT(copy()));
connect(editCut,SIGNAL(activated()),currentView,SLOT(cut()));
connect(editPaste,SIGNAL(activated()),currentView,SLOT(paste()));
connect(editUndo,SIGNAL(activated()),currentView,SLOT(undo()));
connect(editRedo,SIGNAL(activated()),currentView,SLOT(redo()));
connect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes()));
connect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes()));
connect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int)));
connect(utilSettings,SIGNAL(activated()), currentView,SLOT(configDialog()));
}