summaryrefslogtreecommitdiffstats
path: root/kate
diff options
context:
space:
mode:
Diffstat (limited to 'kate')
-rw-r--r--kate/app/kateapp.cpp8
-rw-r--r--kate/app/kateapp.h2
-rw-r--r--kate/app/katefilelist.cpp15
-rw-r--r--kate/app/katemain.cpp2
-rw-r--r--kate/app/katemainwindow.cpp39
-rw-r--r--kate/app/katemainwindow.h13
-rw-r--r--kate/app/katemwmodonhddialog.cpp8
-rw-r--r--kate/app/kateviewspace.cpp8
-rw-r--r--kate/app/kateviewspace.h2
-rw-r--r--kate/app/kateviewspacecontainer.cpp2
-rw-r--r--kate/app/kwritemain.cpp2
-rw-r--r--kate/interfaces/application.h4
-rw-r--r--kate/interfaces/documentmanager.h4
-rw-r--r--kate/interfaces/mainwindow.h2
-rw-r--r--kate/interfaces/plugin.h8
-rw-r--r--kate/interfaces/pluginconfiginterface.h4
-rw-r--r--kate/interfaces/pluginconfiginterfaceextension.h6
-rw-r--r--kate/interfaces/pluginmanager.h2
-rw-r--r--kate/interfaces/toolviewmanager.h2
-rw-r--r--kate/interfaces/viewmanager.h2
-rw-r--r--kate/pics/actions/cr16-action-null.pngbin83 -> 0 bytes
-rw-r--r--kate/pics/actions/lo16-action-null.pngbin83 -> 0 bytes
22 files changed, 85 insertions, 50 deletions
diff --git a/kate/app/kateapp.cpp b/kate/app/kateapp.cpp
index 0e4c18121..479d0c77c 100644
--- a/kate/app/kateapp.cpp
+++ b/kate/app/kateapp.cpp
@@ -239,7 +239,7 @@ bool KateApp::startupKate()
}
else
KMessageBox::sorry( activeMainWindow(),
- i18n("The file '%1' could not be opened: it is not a normal file, it is a folder.").arg(m_args->url(z).url()) );
+ i18n("The file '%1' could not be opened: it is not a normal file, it is a folder.").arg(m_args->url(z).pathOrURL()) );
}
Kate::Document::setOpenErrorDialogsActivated (true);
@@ -350,9 +350,9 @@ bool KateApp::query_session_close()
saveSessions = true;
}
}
-
+
if (saveSessions)
- {
+ {
m_sessionManager->saveActiveSession();
}
m_sessionManager->saveConfig(saveSessions);
@@ -403,7 +403,7 @@ bool KateApp::openURL (const KURL &url, const TQString &encoding, bool isTempFil
}
else
KMessageBox::sorry( mainWindow,
- i18n("The file '%1' could not be opened: it is not a normal file, it is a folder.").arg(url.url()) );
+ i18n("The file '%1' could not be opened: it is not a normal file, it is a folder.").arg(url.pathOrURL()) );
return true;
}
diff --git a/kate/app/kateapp.h b/kate/app/kateapp.h
index 47918a46f..e0c2d4317 100644
--- a/kate/app/kateapp.h
+++ b/kate/app/kateapp.h
@@ -39,7 +39,7 @@ class TDECmdLineArgs;
* Kate Application
* This class represents the core kate application object
*/
-class KDE_EXPORT KateApp : public TDEApplication
+class TDE_EXPORT KateApp : public TDEApplication
{
TQ_OBJECT
diff --git a/kate/app/katefilelist.cpp b/kate/app/katefilelist.cpp
index b33d0149b..1a1ce3103 100644
--- a/kate/app/katefilelist.cpp
+++ b/kate/app/katefilelist.cpp
@@ -48,6 +48,7 @@
#include <kstringhandler.h>
#include <kcolorbutton.h>
#include <kdialog.h>
+#include <kmimetype.h>
//END Includes
//BEGIN ToolTip
@@ -176,6 +177,7 @@ void KateFileList::keyPressEvent(TQKeyEvent *e) {
// returning
void KateFileList::contentsMousePressEvent( TQMouseEvent *e )
{
+ if (e->button() != TQMouseEvent::LeftButton) return;
m_lastMouseDownPos = e->pos();
if ( ! itemAt( contentsToViewport( e->pos() ) ) )
@@ -436,7 +438,7 @@ TQString KateFileList::tooltip( TQListViewItem *item, int )
str += i18n("<b>This file was changed (deleted) on disk by another program.</b><br />");
}
- str += i->document()->url().prettyURL();
+ str += i->document()->url().pathOrURL();
return str;
}
@@ -556,20 +558,27 @@ KateFileListItem::~KateFileListItem()
{
}
+
const TQPixmap *KateFileListItem::pixmap ( int column ) const
{
if ( column == 0) {
- static TQPixmap noPm = SmallIcon ("null");
+ static TQMap<TQString, TQPixmap> mimeIcons;
static TQPixmap modPm = SmallIcon("modified");
static TQPixmap discPm = SmallIcon("modonhd");
static TQPixmap modmodPm = SmallIcon("modmod");
const KateDocumentInfo *info = KateDocManager::self()->documentInfo(doc);
+ KMimeType::Ptr mime = KMimeType::findByURL(doc->url());
+
+ if (!mimeIcons.contains(mime->name()))
+ {
+ mimeIcons.insert(mime->name(), mime->pixmap(TDEIcon::Small));
+ }
if (info && info->modifiedOnDisc)
return doc->isModified() ? &modmodPm : &discPm;
else
- return doc->isModified() ? &modPm : &noPm;
+ return doc->isModified() ? &modPm : &mimeIcons[mime->name()];
}
return 0;
diff --git a/kate/app/katemain.cpp b/kate/app/katemain.cpp
index 2291a8668..d0212210b 100644
--- a/kate/app/katemain.cpp
+++ b/kate/app/katemain.cpp
@@ -57,7 +57,7 @@ static TDECmdLineOptions options[] =
TDECmdLineLastOption
};
-extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
+extern "C" TDE_EXPORT int kdemain( int argc, char **argv )
{
TDEConfig * config = NULL;
bool alwaysUseInstance;
diff --git a/kate/app/katemainwindow.cpp b/kate/app/katemainwindow.cpp
index 811145182..00f01dfe6 100644
--- a/kate/app/katemainwindow.cpp
+++ b/kate/app/katemainwindow.cpp
@@ -151,6 +151,8 @@ KateMainWindow::KateMainWindow (TDEConfig *sconfig, const TQString &sgroup)
m_dcop = new KateMainWindowDCOPIface (this);
+ m_mainWindow->installEventFilter(this);
+
// setup the most important widgets
setupMainWindow();
@@ -213,6 +215,7 @@ void KateMainWindow::setupMainWindow ()
KateMDI::ToolView *ft = createToolView("kate_filelist", KMultiTabBar::Left, SmallIcon("application-vnd.tde.tdemultiple"), i18n("Documents"));
filelist = new KateFileList (this, m_viewManager, ft, "filelist");
filelist->readConfig(KateApp::self()->config(), "Filelist");
+ filelist->viewport()->installEventFilter(this);
KateMDI::ToolView *t = createToolView("kate_fileselector", KMultiTabBar::Left, SmallIcon("document-open"), i18n("Filesystem Browser"));
fileselector = new KateFileSelector( this, m_viewManager, t, "operator");
@@ -306,11 +309,11 @@ void KateMainWindow::setupActions()
slotWindowActivated ();
// session actions
- new TDEAction(i18n("&New"), "list-add", 0,
+ new TDEAction(i18n("&New"), "list-add", 0,
m_sessionpanel, TQ_SLOT(slotNewSession()), actionCollection(), "session_new");
- new TDEAction(i18n("&Save"), "document-save", 0,
+ new TDEAction(i18n("&Save"), "document-save", 0,
m_sessionpanel, TQ_SLOT(slotSaveSession()), actionCollection(), "session_save");
- new TDEAction(i18n("Save &As..."), "document-save-as", 0,
+ new TDEAction(i18n("Save &As..."), "document-save-as", 0,
m_sessionpanel, TQ_SLOT(slotSaveSessionAs()), actionCollection(), "session_save_as");
new TDEAction(i18n("&Rename"), "edit_user", 0,
m_sessionpanel, TQ_SLOT(slotRenameSession()), actionCollection(), "session_rename");
@@ -423,7 +426,7 @@ void KateMainWindow::slotNewToolbarConfig()
void KateMainWindow::slotFileQuit()
{
- KateApp::self()->shutdownKate(this);
+ KateApp::self()->shutdownKate(this);
}
void KateMainWindow::readOptions ()
@@ -596,7 +599,7 @@ void KateMainWindow::slotConfigure()
dlg->exec();
delete dlg;
-
+
// Inform Kate that options may have been changed
KateApp::self()->reparse_config();
}
@@ -848,7 +851,7 @@ void KateMainWindow::updateCaption(Kate::Document *doc)
}
else
{
- c = m_viewManager->activeView()->getDoc()->url().prettyURL();
+ c = m_viewManager->activeView()->getDoc()->url().pathOrURL();
}
if (showSessionName)
@@ -888,6 +891,24 @@ void KateMainWindow::readProperties(TDEConfig *config)
config->setGroup(grp);
}
+bool KateMainWindow::eventFilter(TQObject *obj, TQEvent *ev)
+{
+ if (ev->type() == TQEvent::MouseButtonRelease)
+ {
+ TQMouseEvent *mouseEvent = static_cast<TQMouseEvent *>(ev);
+ switch (mouseEvent->button())
+ {
+ case TQMouseEvent::HistoryBackButton:
+ filelist->slotPrevDocument();
+ return true;
+ case TQMouseEvent::HistoryForwardButton:
+ filelist->slotNextDocument();
+ return true;
+ }
+ }
+ return false;
+}
+
//-------------------------------------------
void KateMainWindow::slotSelectionChanged()
{
@@ -905,8 +926,8 @@ void KateMainWindow::slotSelectionChanged()
if (a)
{
a->setEnabled((*spa_it)->isEnabled());
- }
- }
+ }
+ }
}
//-------------------------------------------
@@ -916,7 +937,7 @@ void KateMainWindow::activateSession(int sessionId)
{
return;
}
-
+
// Select the required session in the session panel's listview
TQListViewItem *item = m_sessionpanel->m_listview->firstChild();
int idx = 0;
diff --git a/kate/app/katemainwindow.h b/kate/app/katemainwindow.h
index 1e8839991..8901be978 100644
--- a/kate/app/katemainwindow.h
+++ b/kate/app/katemainwindow.h
@@ -105,16 +105,16 @@ class KateMainWindow : public KateMDI::MainWindow, virtual public KParts::PartBa
bool queryClose_internal();
void openURL (const TQString &name=0L);
-
+
public slots:
/**
* update "Sessions" menu status when selection in session panel has changed
*/
void slotSelectionChanged();
-
+
/**
* activate the specified session. When there is the need to activate a session
- * from the outside (for example from DCOP), using this method assures that
+ * from the outside (for example from DCOP), using this method assures that
* the session activation is consistent with the behavior of the session panel
* @param sessionId the id of the session to activate
*/
@@ -176,9 +176,10 @@ class KateMainWindow : public KateMDI::MainWindow, virtual public KParts::PartBa
void updateGrepDir (bool visible);
void slotDocumentCloseAll();
-
+
protected:
bool event( TQEvent * );
+ bool eventFilter(TQObject *obj, TQEvent *ev);
private:
static uint uniqueID;
@@ -215,7 +216,7 @@ class KateMainWindow : public KateMDI::MainWindow, virtual public KParts::PartBa
KateExternalToolsMenuAction *externalTools;
GrepTool * greptool;
- bool m_modignore, m_grrr;
+ bool m_modignore;
KateTabWidget *m_tabWidget;
};
@@ -230,7 +231,7 @@ class KateSessionListActionMenu : public TDEActionMenu
public slots:
void slotAboutToShow();
-
+
protected:
KateMainWindow *m_mainWindow;
};
diff --git a/kate/app/katemwmodonhddialog.cpp b/kate/app/katemwmodonhddialog.cpp
index 3babd75e8..ffdd92fa7 100644
--- a/kate/app/katemwmodonhddialog.cpp
+++ b/kate/app/katemwmodonhddialog.cpp
@@ -44,7 +44,7 @@ class KateDocItem : public TQCheckListItem
{
public:
KateDocItem( Kate::Document *doc, const TQString &status, TDEListView *lv )
- : TQCheckListItem( lv, doc->url().prettyURL(), CheckBox ),
+ : TQCheckListItem( lv, doc->url().pathOrURL(), CheckBox ),
document( doc )
{
setText( 1, status );
@@ -143,12 +143,12 @@ void KateMwModOnHdDialog::handleSelected( int action )
for ( TQListViewItemIterator it ( lvDocuments ); it.current(); ++it )
{
KateDocItem *item = static_cast<KateDocItem *>(it.current());
-
+
if ( item->isOn() )
{
int reason = (int)KateDocManager::self()->documentInfo( item->document )->modifiedOnDiscReason;
bool succes = true;
-
+
Kate::DocumentExt *dext = documentExt( item->document );
if ( ! dext ) continue;
@@ -161,7 +161,7 @@ void KateMwModOnHdDialog::handleSelected( int action )
{
KMessageBox::sorry( this,
i18n("Could not save the document \n'%1'").
- arg( item->document->url().prettyURL() ) );
+ arg( item->document->url().pathOrURL() ) );
}
break;
diff --git a/kate/app/kateviewspace.cpp b/kate/app/kateviewspace.cpp
index 8c552a82f..240d9a810 100644
--- a/kate/app/kateviewspace.cpp
+++ b/kate/app/kateviewspace.cpp
@@ -30,6 +30,7 @@
#include <kiconloader.h>
#include <tdelocale.h>
#include <ksqueezedtextlabel.h>
+#include <kmimetype.h>
#include <tdeconfig.h>
#include <kdebug.h>
@@ -39,6 +40,7 @@
#include <tqcursor.h>
#include <tqpopupmenu.h>
#include <tqpixmap.h>
+#include <tqtooltip.h>
//BEGIN KVSSBSep
/*
@@ -340,7 +342,6 @@ KateVSStatusBar::KateVSStatusBar ( KateViewSpace *parent, const char *name )
m_modPm = SmallIcon("modified");
m_modDiscPm = SmallIcon("modonhd");
m_modmodPm = SmallIcon("modmod");
- m_noPm = SmallIcon("null");
}
KateVSStatusBar::~KateVSStatusBar ()
@@ -377,6 +378,8 @@ void KateVSStatusBar::updateMod( bool mod )
bool modOnHD = info && info->modifiedOnDisc;
+ KMimeType::Ptr mime = KMimeType::findByURL(v->getDoc()->url());
+
m_modifiedLabel->setPixmap(
mod ?
info && modOnHD ?
@@ -384,8 +387,9 @@ void KateVSStatusBar::updateMod( bool mod )
m_modPm :
info && modOnHD ?
m_modDiscPm :
- m_noPm
+ mime->pixmap(TDEIcon::Small)
);
+ TQToolTip::add(this, mime->comment());
}
}
diff --git a/kate/app/kateviewspace.h b/kate/app/kateviewspace.h
index 3b238beb8..fa4ae6c2c 100644
--- a/kate/app/kateviewspace.h
+++ b/kate/app/kateviewspace.h
@@ -64,7 +64,7 @@ class KateVSStatusBar : public KStatusBar
TQLabel* m_insertModeLabel;
TQLabel* m_selectModeLabel;
KSqueezedTextLabel* m_fileNameLabel;
- TQPixmap m_modPm, m_modDiscPm, m_modmodPm, m_noPm;
+ TQPixmap m_modPm, m_modDiscPm, m_modmodPm;
class KateViewSpace *m_viewSpace;
};
diff --git a/kate/app/kateviewspacecontainer.cpp b/kate/app/kateviewspacecontainer.cpp
index 50e0d7ea2..72ffc8644 100644
--- a/kate/app/kateviewspacecontainer.cpp
+++ b/kate/app/kateviewspacecontainer.cpp
@@ -429,7 +429,7 @@ void KateViewSpaceContainer::statusMsg ()
}
else
{
- c = v->getDoc()->url().prettyURL();
+ c = v->getDoc()->url().pathOrURL();
}
m_viewManager->mainWindow()->tabWidget()->changeTab (this, KStringHandler::lsqueeze(c,32));
diff --git a/kate/app/kwritemain.cpp b/kate/app/kwritemain.cpp
index dea6c95b6..44899a82c 100644
--- a/kate/app/kwritemain.cpp
+++ b/kate/app/kwritemain.cpp
@@ -536,7 +536,7 @@ static TDECmdLineOptions options[] =
TDECmdLineLastOption
};
-extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
+extern "C" TDE_EXPORT int kdemain(int argc, char **argv)
{
Kate::Document::setFileChangedDialogsActivated (true);
diff --git a/kate/interfaces/application.h b/kate/interfaces/application.h
index 8cbc9abce..42ddf9cb3 100644
--- a/kate/interfaces/application.h
+++ b/kate/interfaces/application.h
@@ -35,7 +35,7 @@ class MainWindow;
* other objects like document/projectmanager, ... no way goes around this
* central interface
*/
-class KDE_EXPORT Application : public TQObject
+class TDE_EXPORT Application : public TQObject
{
friend class PrivateApplication;
@@ -72,7 +72,7 @@ class KDE_EXPORT Application : public TQObject
* Returns the application object
* @return Application application object
*/
-KDE_EXPORT Application *application ();
+TDE_EXPORT Application *application ();
}
diff --git a/kate/interfaces/documentmanager.h b/kate/interfaces/documentmanager.h
index d3f55fdf5..d9cc50a2b 100644
--- a/kate/interfaces/documentmanager.h
+++ b/kate/interfaces/documentmanager.h
@@ -26,7 +26,7 @@ namespace Kate
{
/** This interface provides access to the Kate Document Manager.
*/
-class KDE_EXPORT DocumentManager : public TQObject
+class TDE_EXPORT DocumentManager : public TQObject
{
friend class PrivateDocumentManager;
@@ -104,7 +104,7 @@ class KDE_EXPORT DocumentManager : public TQObject
* Returns the document manager object
* @return DocumentManager document manager object
*/
-KDE_EXPORT DocumentManager *documentManager ();
+TDE_EXPORT DocumentManager *documentManager ();
}
diff --git a/kate/interfaces/mainwindow.h b/kate/interfaces/mainwindow.h
index 7e9033ce3..38f8232f2 100644
--- a/kate/interfaces/mainwindow.h
+++ b/kate/interfaces/mainwindow.h
@@ -29,7 +29,7 @@ namespace Kate
class ViewManager;
-class KDE_EXPORT MainWindow : public TQObject
+class TDE_EXPORT MainWindow : public TQObject
{
friend class PrivateMainWindow;
diff --git a/kate/interfaces/plugin.h b/kate/interfaces/plugin.h
index bc79a0491..1048a9e88 100644
--- a/kate/interfaces/plugin.h
+++ b/kate/interfaces/plugin.h
@@ -32,7 +32,7 @@ namespace Kate
class Application;
class MainWindow;
-class KDE_EXPORT Plugin : public TQObject
+class TDE_EXPORT Plugin : public TQObject
{
friend class PrivatePlugin;
@@ -52,13 +52,13 @@ class KDE_EXPORT Plugin : public TQObject
unsigned int myPluginNumber;
};
-KDE_EXPORT Plugin *createPlugin ( const char* libname, Application *application = 0, const char *name = 0,const TQStringList &args = TQStringList() );
+TDE_EXPORT Plugin *createPlugin ( const char* libname, Application *application = 0, const char *name = 0,const TQStringList &args = TQStringList() );
/*
* view plugin class
* this plugin will be bound to a tdetexteditor::view
*/
-class KDE_EXPORT PluginViewInterface
+class TDE_EXPORT PluginViewInterface
{
friend class PrivatePluginViewInterface;
@@ -80,7 +80,7 @@ class KDE_EXPORT PluginViewInterface
unsigned int myPluginViewInterfaceNumber;
};
-KDE_EXPORT PluginViewInterface *pluginViewInterface (Plugin *plugin);
+TDE_EXPORT PluginViewInterface *pluginViewInterface (Plugin *plugin);
}
diff --git a/kate/interfaces/pluginconfiginterface.h b/kate/interfaces/pluginconfiginterface.h
index f626b1cde..b3180bc96 100644
--- a/kate/interfaces/pluginconfiginterface.h
+++ b/kate/interfaces/pluginconfiginterface.h
@@ -27,7 +27,7 @@ namespace Kate
/*
* This is an interface for the KTextEditor::Document/Plugin/ViewPlugin classes !!!
*/
-class KDE_EXPORT PluginConfigInterface
+class TDE_EXPORT PluginConfigInterface
{
friend class PrivatePluginConfigInterface;
@@ -56,7 +56,7 @@ class KDE_EXPORT PluginConfigInterface
};
class Plugin;
-KDE_EXPORT PluginConfigInterface *pluginConfigInterface (Plugin *plugin);
+TDE_EXPORT PluginConfigInterface *pluginConfigInterface (Plugin *plugin);
}
diff --git a/kate/interfaces/pluginconfiginterfaceextension.h b/kate/interfaces/pluginconfiginterfaceextension.h
index d70d35069..c3db71fde 100644
--- a/kate/interfaces/pluginconfiginterfaceextension.h
+++ b/kate/interfaces/pluginconfiginterfaceextension.h
@@ -26,7 +26,7 @@
namespace Kate
{
-class KDE_EXPORT PluginConfigPage : public TQWidget
+class TDE_EXPORT PluginConfigPage : public TQWidget
{
TQ_OBJECT
@@ -60,7 +60,7 @@ class KDE_EXPORT PluginConfigPage : public TQWidget
/*
* This is an interface for the KTextEditor::Document/Plugin/ViewPlugin classes !!!
*/
-class KDE_EXPORT PluginConfigInterfaceExtension
+class TDE_EXPORT PluginConfigInterfaceExtension
{
friend class PrivatePluginConfigInterfaceExtension;
@@ -97,7 +97,7 @@ class KDE_EXPORT PluginConfigInterfaceExtension
};
class Plugin;
-KDE_EXPORT PluginConfigInterfaceExtension *pluginConfigInterfaceExtension (Plugin *plugin);
+TDE_EXPORT PluginConfigInterfaceExtension *pluginConfigInterfaceExtension (Plugin *plugin);
}
diff --git a/kate/interfaces/pluginmanager.h b/kate/interfaces/pluginmanager.h
index 26d77b26c..74aa4d874 100644
--- a/kate/interfaces/pluginmanager.h
+++ b/kate/interfaces/pluginmanager.h
@@ -27,7 +27,7 @@ namespace Kate
{
/** This interface provides access to the Kate Plugin Manager.
*/
-class KDE_EXPORT PluginManager : public TQObject
+class TDE_EXPORT PluginManager : public TQObject
{
friend class PrivatePluginManager;
diff --git a/kate/interfaces/toolviewmanager.h b/kate/interfaces/toolviewmanager.h
index fec942b2b..48c14f93f 100644
--- a/kate/interfaces/toolviewmanager.h
+++ b/kate/interfaces/toolviewmanager.h
@@ -29,7 +29,7 @@ namespace Kate
/**
Interface to the toolviewmanager
*/
-class KDE_EXPORT ToolViewManager : public TQObject
+class TDE_EXPORT ToolViewManager : public TQObject
{
friend class PrivateToolViewManager;
diff --git a/kate/interfaces/viewmanager.h b/kate/interfaces/viewmanager.h
index 0ca689680..12b296702 100644
--- a/kate/interfaces/viewmanager.h
+++ b/kate/interfaces/viewmanager.h
@@ -30,7 +30,7 @@ class View;
/**
* Interface to the viewmanager
*/
-class KDE_EXPORT ViewManager : public TQObject
+class TDE_EXPORT ViewManager : public TQObject
{
friend class PrivateViewManager;
diff --git a/kate/pics/actions/cr16-action-null.png b/kate/pics/actions/cr16-action-null.png
deleted file mode 100644
index c06ca5543..000000000
--- a/kate/pics/actions/cr16-action-null.png
+++ /dev/null
Binary files differ
diff --git a/kate/pics/actions/lo16-action-null.png b/kate/pics/actions/lo16-action-null.png
deleted file mode 100644
index c06ca5543..000000000
--- a/kate/pics/actions/lo16-action-null.png
+++ /dev/null
Binary files differ