[prev in list] [next in list] [prev in thread] [next in thread]
List: ktexteditor-devel
Subject: hide/replace some ktexteditor features
From: Flavio Castelli <micron () madlab ! it>
Date: 2005-10-04 17:17:10
Message-ID: 200510041917.10931.micron () madlab ! it
[Download RAW message or body]
I needed some text-editor features in my app so I used KTexteditor.
The only problem is that I need to save my files in a different way compared
to kate's one.
So I created in my class a slotSave() method with my own code, and in the
constructor I create its KStdAction:
KStdAction::save( this, SLOT( slotSave() ), actionCollection(),
"file_save" )->setWhatsThis(i18n("Use this command to save a document"));
Now when I start the app I've two entries of "Save", the first inherits my
code, the second kate's one.
Here's my .rc file:
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="sample" version="1">
<MenuBar>
<Menu name="file" noMerge="0"><Text>&File</Text>
<Merge/>
</Menu>
<Merge/>
</MenuBar>
</kpartgui>
As suggested on #kate irc channel I tried to tell the actionCollection() to
remove kate's save action.
But using this code (at the end of my constructor):
unsigned int actions = actionCollection()->count();
for (unsigned int i =0 ; i < actions; i++)
{
KAction * action = actionCollection()->action(i);
printf ("action number %i, text = %s\n",i,(action->text()).ascii());
}
I see only one "save" action, mine...
How can I see only my own implementation entry?
Thanks in advance
Flavio
--
|§ micron<- ICQ #118796665
|§ GPG Key:
|§ ~ Keyserver: pgp.mit.edu
|§ ~ KeyID: 6D632BED
~ "Progress is merely a realisation of utopias" ~
_______________________________________________
Ktexteditor-devel mailing list
Ktexteditor-devel@kde.org
https://mail.kde.org/mailman/listinfo/ktexteditor-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic