Changeset View
Changeset View
Standalone View
Standalone View
shell/mainwindow_p.cpp
Show All 37 Lines | |||||
38 | #include <sublime/view.h> | 38 | #include <sublime/view.h> | ||
39 | #include <sublime/document.h> | 39 | #include <sublime/document.h> | ||
40 | #include <sublime/tooldocument.h> | 40 | #include <sublime/tooldocument.h> | ||
41 | 41 | | |||
42 | #include <util/pushvalue.h> | 42 | #include <util/pushvalue.h> | ||
43 | 43 | | |||
44 | #include <interfaces/iplugin.h> | 44 | #include <interfaces/iplugin.h> | ||
45 | 45 | | |||
46 | #include "actiontooltipmodifier.h" | ||||
46 | #include "core.h" | 47 | #include "core.h" | ||
47 | #include "partdocument.h" | 48 | #include "partdocument.h" | ||
48 | #include "partcontroller.h" | 49 | #include "partcontroller.h" | ||
49 | #include "uicontroller.h" | 50 | #include "uicontroller.h" | ||
50 | #include "statusbar.h" | 51 | #include "statusbar.h" | ||
51 | #include "mainwindow.h" | 52 | #include "mainwindow.h" | ||
52 | #include "textdocument.h" | 53 | #include "textdocument.h" | ||
53 | #include "sessioncontroller.h" | 54 | #include "sessioncontroller.h" | ||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | 92 | { | |||
99 | Q_ASSERT(!m_pluginCustomClients.contains(plugin)); | 100 | Q_ASSERT(!m_pluginCustomClients.contains(plugin)); | ||
100 | 101 | | |||
101 | KXMLGUIClient* ownClient = plugin->createGUIForMainWindow(m_mainWindow); | 102 | KXMLGUIClient* ownClient = plugin->createGUIForMainWindow(m_mainWindow); | ||
102 | if(ownClient) { | 103 | if(ownClient) { | ||
103 | m_pluginCustomClients[plugin] = ownClient; | 104 | m_pluginCustomClients[plugin] = ownClient; | ||
104 | connect(plugin, &IPlugin::destroyed, this, &MainWindowPrivate::pluginDestroyed); | 105 | connect(plugin, &IPlugin::destroyed, this, &MainWindowPrivate::pluginDestroyed); | ||
105 | m_mainWindow->guiFactory()->addClient(ownClient); | 106 | m_mainWindow->guiFactory()->addClient(ownClient); | ||
106 | } | 107 | } | ||
108 | | ||||
109 | new ActionToolTipModifier(plugin->actionCollection(), plugin); | ||||
107 | } | 110 | } | ||
108 | 111 | | |||
109 | void MainWindowPrivate::pluginDestroyed(QObject* pluginObj) | 112 | void MainWindowPrivate::pluginDestroyed(QObject* pluginObj) | ||
110 | { | 113 | { | ||
111 | IPlugin* plugin = static_cast<IPlugin*>(pluginObj); | 114 | IPlugin* plugin = static_cast<IPlugin*>(pluginObj); | ||
112 | KXMLGUIClient* p = m_pluginCustomClients.take(plugin); | 115 | KXMLGUIClient* p = m_pluginCustomClients.take(plugin); | ||
113 | m_mainWindow->guiFactory()->removeClient( p ); | 116 | m_mainWindow->guiFactory()->removeClient( p ); | ||
114 | delete p; | 117 | delete p; | ||
▲ Show 20 Lines • Show All 202 Lines • ▼ Show 20 Line(s) | 220 | { | |||
317 | actionCollection()->setDefaultShortcut(action, Qt::CTRL + Qt::SHIFT + Qt::Key_V ); | 320 | actionCollection()->setDefaultShortcut(action, Qt::CTRL + Qt::SHIFT + Qt::Key_V ); | ||
318 | action->setText( i18n( "&Add Tool View..." ) ); | 321 | action->setText( i18n( "&Add Tool View..." ) ); | ||
319 | connect( action, &QAction::triggered, this, &MainWindowPrivate::viewAddNewToolView ); | 322 | connect( action, &QAction::triggered, this, &MainWindowPrivate::viewAddNewToolView ); | ||
320 | action->setToolTip( i18nc( "@info:tooltip", "Add tool view" ) ); | 323 | action->setToolTip( i18nc( "@info:tooltip", "Add tool view" ) ); | ||
321 | action->setWhatsThis( i18nc( "@info:whatsthis", "Adds a new tool view to this window." ) ); | 324 | action->setWhatsThis( i18nc( "@info:whatsthis", "Adds a new tool view to this window." ) ); | ||
322 | 325 | | |||
323 | //Load themes | 326 | //Load themes | ||
324 | actionCollection()->addAction(QStringLiteral("colorscheme_menu"), new ColorSchemeChooser(actionCollection())); | 327 | actionCollection()->addAction(QStringLiteral("colorscheme_menu"), new ColorSchemeChooser(actionCollection())); | ||
328 | | ||||
329 | new ActionToolTipModifier(actionCollection(), this); | ||||
325 | } | 330 | } | ||
326 | 331 | | |||
327 | void MainWindowPrivate::toggleArea(bool b) | 332 | void MainWindowPrivate::toggleArea(bool b) | ||
328 | { | 333 | { | ||
329 | if (!b) return; | 334 | if (!b) return; | ||
330 | QAction* action = qobject_cast<QAction*>(sender()); | 335 | QAction* action = qobject_cast<QAction*>(sender()); | ||
331 | if (!action) return; | 336 | if (!action) return; | ||
332 | m_mainWindow->controller()->showArea(action->data().toString(), m_mainWindow); | 337 | m_mainWindow->controller()->showArea(action->data().toString(), m_mainWindow); | ||
▲ Show 20 Lines • Show All 142 Lines • Show Last 20 Lines |