[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdewebdev/quanta
From: Andras Mantia <amantia () kde ! org>
Date: 2008-04-14 13:48:37
Message-ID: 1208180917.759055.8917.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 796890 by amantia:
Make loading an user toolbar add the actions to the Actions menu. Make removing the \
toolbar remove the menu. Enable the new parser (the old crashes anyway).
M +3 -3 lib/node.cpp
M +5 -2 lib/useraction.cpp
M +1 -2 lib/useraction.h
M +2 -4 plugins/usertoolbars/toolbarguibuilder.cpp
M +19 -9 plugins/usertoolbars/usertoolbarspart.cpp
M +2 -3 quantacore/quantadoc.cpp
M +24 -8 src/quantaui.rc
--- trunk/KDE/kdewebdev/quanta/lib/node.cpp #796889:796890
@@ -46,7 +46,7 @@
nodes.append(this);
else
{
- kError(24000) << "A node with this address " << this << " already exists!";
+// kError(24000) << "A node with this address " << this << " already exists!";
}
}
@@ -55,7 +55,7 @@
{
if (nodes.contains(this) == 0)
{
- kError(24000) << "No node with this address " << this << " was allocated!";
+// kError(24000) << "No node with this address " << this << " was allocated!";
return;
}
// kDebug(24000) << "Node destructor " << this << tag->name;
@@ -96,7 +96,7 @@
return;
if (nodes.contains(this) == 0)
{
- kError(24000) << "No node with this address " << this << " was allocated!";
+// kError(24000) << "No node with this address " << this << " was allocated!";
return;
}
m_groupStorage = groupStorage;
--- trunk/KDE/kdewebdev/quanta/lib/useraction.cpp #796889:796890
@@ -55,9 +55,11 @@
UserAction::UserAction( QDomElement *element, KDevelop::IPlugin *plugin, bool \
toggle)
- : KToggleAction(element->attribute("text").isEmpty() ? QString("") : \
i18n(element->attribute("text").toUtf8()), \
KDevelop::Core::self()->uiController()->activeMainWindow()->actionCollection()), + \
: KAction(element->attribute("text").isEmpty() ? QString("") : \
i18n(element->attribute("text").toUtf8()), \
KDevelop::Core::self()->uiController()->activeMainWindow()->actionCollection()), \
m_toggle(toggle) {
+ setObjectName(element->attribute("name"));
+ setCheckable(toggle);
KDevelop::Core::self()->uiController()->activeMainWindow()->actionCollection()->addAction(element->attribute("name"), \
this); setShortcut(KShortcut(element->attribute("shortcut")));
m_plugin = plugin;
@@ -331,8 +333,9 @@
void UserAction::slotActivated()
{
+ //FIXME: check it!
// if(m_toggle)
- KToggleAction::slotToggled(m_toggle);
+// KToggleAction::slotToggled(m_toggle);
if(!m_toggle)
setChecked(!isChecked());
}
--- trunk/KDE/kdewebdev/quanta/lib/useraction.h #796889:796890
@@ -21,7 +21,6 @@
#include <qdom.h>
#include <kaction.h>
-#include <ktoggleaction.h>
namespace KDevelop
@@ -41,7 +40,7 @@
* Paulo Moura Guedes, moura@kdewebdev.org
*/
-class KDEVQUANTA_EXPORT UserAction : public KToggleAction
+class KDEVQUANTA_EXPORT UserAction : public KAction
{
Q_OBJECT
--- trunk/KDE/kdewebdev/quanta/plugins/usertoolbars/toolbarguibuilder.cpp \
#796889:796890 @@ -40,7 +40,7 @@
if ( element.tagName().toLower() == "toolbar" && !tabname.isEmpty())
{
//avoid QToolBar warning in the log
- QtMsgHandler oldHandler = qInstallMsgHandler(silenceQToolBar);
+// QtMsgHandler oldHandler = qInstallMsgHandler(silenceQToolBar);
//create the toolbar on the tabwidget
QWidget *w = new QWidget(toolbarTab);
@@ -60,16 +60,14 @@
tb->setGeometry(0,0, toolbarTab->width(), tb->iconSize().height() + 10);
toolbarTab->setFixedHeight(toolbarTab->tabHeight() + tb->height() + 3);
}
-/*
kDebug(24000) << "tb->height() " << tb->height();
kDebug(24000) << "toolbarTab->height() " << toolbarTab->height();
kDebug(24000) << "toolbarTab->tabHeight() " << toolbarTab->tabHeight();
-*/
toolbarTab->insertTab(tb, i18n(tabname.toUtf8()), idStr);
toolbarTab->setCurrentWidget(w);
if (toolbarTab->parentWidget()->parentWidget())
toolbarTab->parentWidget()->parentWidget()->show();
- qInstallMsgHandler(oldHandler);
+// qInstallMsgHandler(oldHandler);
tb->setSeparate(m_separateToolbars);
if (m_separateToolbars)
--- trunk/KDE/kdewebdev/quanta/plugins/usertoolbars/usertoolbarspart.cpp \
#796889:796890 @@ -75,6 +75,8 @@
#include <iprojectcontroller.h>
#include <iuicontroller.h>
+#include <iostream>
+
K_PLUGIN_FACTORY(UserToolbarsFactory, registerPlugin<UserToolbarsPart>();)
K_EXPORT_PLUGIN(UserToolbarsFactory("kdevusertoolbars"))
@@ -488,6 +490,7 @@
bool toggable = (el.attribute("toggable", "") == "true");
UserAction *userAction = new UserAction(&el, this, toggable);
m_userActions.append(userAction);
+ ac->addAction(actionName, userAction);
//add the actions to every toolbar xmlguiclient, so these actions can be \
added //to any toolbar
@@ -497,12 +500,12 @@
{
it.next();
- it.value()->guiClient->actionCollection()->addAction(QString("nametoolbar%1").arg(i),userAction);
+ it.value()->guiClient->actionCollection()->addAction(userAction->objectName(), \
userAction); i++;
}
} else
{
- // kDebug(24000) << "The action " << actionName << " is already present!";
+ kDebug(24000) << "The action " << actionName << " is already present!";
UserAction *userAction = dynamic_cast<UserAction*>(ac->action(actionName));
if (userAction)
userAction->setModified(true);
@@ -511,9 +514,13 @@
//add all actions to the xmlguiclient of this toolbar, otherwise it will not be
//possible to add other actions to this toolbar in the Configure Toolbar dialog
- for (int i = 0 ; i < ac->actions().count(); i++)
- toolbarGUI->actionCollection()->addAction(QString("name%1").arg(i),ac->actions().value(i));
-
+ QList<QAction*> actions = ac->actions();
+ for (int i = 0 ; i < actions.count(); i++)
+ {
+ QAction *action = actions.value(i);
+ kDebug(24000) << "Add the action " << action->objectName() << " to toolbar: " \
<< name << toolbarId<< toolbarGUI << toolbarGUI->actionCollection(); + \
toolbarGUI->actionCollection()->addAction(action->objectName(), action); + }
m_tempFileList.append(tempFile);
p_toolbar->guiClient = toolbarGUI;
p_toolbar->name = name;
@@ -686,6 +693,7 @@
}
delete p_toolbar->dom;
delete p_toolbar->guiClient;
+ delete p_toolbar->menu;
m_toolbarList.remove(name);
}
}
@@ -1180,14 +1188,17 @@
ToolbarEntry *p_toolbar = m_toolbarList.value(id);
if (!p_toolbar || !m_createActionsMenu)
return;
+ QMenu *actionsMenu = static_cast<QMenu*>(factory()->container("actions", this));
//Plug in the actions & build the menu
- QMenu *menu = new QMenu;
+ QMenu *menu = new QMenu(actionsMenu);
menu->setTitle(i18n(p_toolbar->name.toUtf8()));
QAction *action;
KActionCollection *ac = p_toolbar->guiClient->actionCollection();
QDomNodeList nodeList = \
p_toolbar->guiClient->domDocument().elementsByTagName("Action"); + kDebug(24000) << \
"Check toolbar " << p_toolbar->name << id << p_toolbar->guiClient << ac; for (int i \
= 0; i < nodeList.count(); i++) {
+ kDebug(24000) << "node name=" << \
nodeList.item(i).cloneNode().toElement().attribute("name");
action = ac->action(nodeList.item(i).cloneNode().toElement().attribute("name") \
); if (action)
{
@@ -1195,11 +1206,10 @@
}
}
- QMenu *actionsMenu = static_cast<QMenu*>(factory()->container("actions", this));
actionsMenu->addMenu(menu);
actionsMenu->setVisible(true);
-/* if (m_actionsMenuId == -1)
+ if (m_actionsMenuId == -1)
{
KMenuBar *menuBar = \
KDevelop::Core::self()->uiController()->activeMainWindow()->menuBar(); for (uint i = \
0; i < menuBar->count(); i++) @@ -1213,7 +1223,7 @@
}
}
if (m_actionsMenuId != -1)
- KDevelop::Core::self()->uiController()->activeMainWindow()->menuBar()->setItemVisible(m_actionsMenuId, \
true);*/ + KDevelop::Core::self()->uiController()->activeMainWindow()->menuBar()->setItemVisible(m_actionsMenuId, \
true); p_toolbar->menu = menu;
}
--- trunk/KDE/kdewebdev/quanta/quantacore/quantadoc.cpp #796889:796890
@@ -79,7 +79,6 @@
//initial parsing
//TODO: Enable the new parsing when you work on it!
- /*
//new parser
QuantaXmlInputSource *inputSource = new \
QuantaXmlInputSource(document->textDocument()); ParserStatus *parser = new \
ParserStatus(inputSource->newLocator(), ParserManager::self()->xmlStateMachine()); @@ \
-88,9 +87,9 @@ parser->setLexicalHandler(builder);
parser->setErrorHandler(builder);
parser->parse(inputSource);
- */
+
//old parser
- parse();
+// parse();
m_parsingNeeded = false;
// Node::coutTree(m_parseResult.baseNode, 2);
for (int i = 0; i < m_parseResult.dtepList.count(); i++)
--- trunk/KDE/kdewebdev/quanta/src/quantaui.rc #796889:796890
@@ -1,6 +1,6 @@
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<kpartgui version="1" name="quanta" >
-<MenuBar>
+<kpartgui version="2" name="quanta" >
+<MenuBar noMerge="1">
<Menu name="file" noMerge="1"><text>&File</text>
<DefineGroup name="new_merge"/>
<Separator/>
@@ -96,12 +96,28 @@
<Merge/>
</Menu>
<Menu name="window">
- <text>&Window</text>
- <Action name="split_h"/>
- <Action name="split_v"/>
- <Separator/>
- <DefineGroup name="window_operations"/>
- <Merge/>
+ <text>&Window</text>
+ <Action name="new_window"/>
+ <Separator/>
+ <Action name="view_next_window"/>
+ <Action name="view_previous_window"/>
+ <Separator/>
+ <Action name="split_horizontal"/>
+ <Action name="split_vertical"/>
+ <DefineGroup name="window_operations"/>
+ <Separator/>
+ <Action name="show_left_dock"/>
+ <Action name="show_right_dock"/>
+ <Action name="show_top_dock"/>
+ <Action name="show_bottom_dock"/>
+ <Action name="hide_all_docks"/>
+ <Action name="anchor_current_dock"/>
+ <Action name="maximize_current_dock"/>
+ <Action name="select_next_dock"/>
+ <Action name="select_previous_dock"/>
+ <Action name="docks_submenu"/>
+ <Separator/>
+ <Merge/>
</Menu>
<Menu name="settings" noMerge="1">
<text>&Settings</text>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic