FullView::FullView(const QString &ff, const QString &loc, bool persistent, QWidget *parent) : QGraphicsView(parent), m_formfactor(Plasma::Planar), m_location(Plasma::Floating), m_containment(0), m_applet(0), m_appletShotTimer(0), m_persistentConfig(persistent), m_resizeToApplet(true) { setFrameStyle(QFrame::NoFrame); QString formfactor = ff.toLower(); if (formfactor.isEmpty() || formfactor == "planar") { m_formfactor = Plasma::Planar; } else if (formfactor == "vertical") { m_formfactor = Plasma::Vertical; } else if (formfactor == "horizontal") { m_formfactor = Plasma::Horizontal; } else if (formfactor == "mediacenter") { m_formfactor = Plasma::MediaCenter; } else if (formfactor == "application") { m_formfactor = Plasma::Application; } QString location = loc.toLower(); if (loc.isEmpty() || loc == "floating") { m_location = Plasma::Floating; } else if (loc == "desktop") { m_location = Plasma::Desktop; } else if (loc == "fullscreen") { m_location = Plasma::FullScreen; } else if (loc == "top") { m_location = Plasma::TopEdge; } else if (loc == "bottom") { m_location = Plasma::BottomEdge; } else if (loc == "right") { m_location = Plasma::RightEdge; } else if (loc == "left") { m_location = Plasma::LeftEdge; } Plasma::ContainmentActionsPluginsConfig containmentActionPlugins; containmentActionPlugins.addPlugin(Qt::NoModifier, Qt::RightButton, "contextmenu"); m_corona.setContainmentActionsDefaults(Plasma::Containment::DesktopContainment, containmentActionPlugins); m_corona.setContainmentActionsDefaults(Plasma::Containment::CustomContainment, containmentActionPlugins); m_corona.setContainmentActionsDefaults(Plasma::Containment::PanelContainment, containmentActionPlugins); m_corona.setContainmentActionsDefaults(Plasma::Containment::CustomPanelContainment, containmentActionPlugins); setScene(&m_corona); connect(&m_corona, SIGNAL(sceneRectChanged(QRectF)), this, SLOT(sceneRectChanged(QRectF))); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setAlignment(Qt::AlignLeft | Qt::AlignTop); }
void DesktopCorona::init() { setPreferredToolBoxPlugin(Plasma::Containment::DesktopContainment, "org.kde.desktoptoolbox"); setPreferredToolBoxPlugin(Plasma::Containment::CustomContainment, "org.kde.desktoptoolbox"); setPreferredToolBoxPlugin(Plasma::Containment::PanelContainment, "org.kde.paneltoolbox"); setPreferredToolBoxPlugin(Plasma::Containment::CustomPanelContainment, "org.kde.paneltoolbox"); kDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "DesktopCorona init start" << "(line:" << __LINE__ << ")"; Kephal::Screens *screens = Kephal::Screens::self(); connect(screens, SIGNAL(screenAdded(Kephal::Screen*)), SLOT(screenAdded(Kephal::Screen*))); connect(KWindowSystem::self(), SIGNAL(workAreaChanged()), this, SIGNAL(availableScreenRegionChanged())); Plasma::ContainmentActionsPluginsConfig desktopPlugins; desktopPlugins.addPlugin(Qt::NoModifier, Qt::Vertical, "switchdesktop"); desktopPlugins.addPlugin(Qt::NoModifier, Qt::MidButton, "paste"); desktopPlugins.addPlugin(Qt::NoModifier, Qt::RightButton, "contextmenu"); Plasma::ContainmentActionsPluginsConfig panelPlugins; panelPlugins.addPlugin(Qt::NoModifier, Qt::RightButton, "contextmenu"); setContainmentActionsDefaults(Plasma::Containment::DesktopContainment, desktopPlugins); setContainmentActionsDefaults(Plasma::Containment::CustomContainment, desktopPlugins); setContainmentActionsDefaults(Plasma::Containment::PanelContainment, panelPlugins); setContainmentActionsDefaults(Plasma::Containment::CustomPanelContainment, panelPlugins); checkAddPanelAction(); //why do these actions belong to plasmaapp? //because it makes the keyboard shortcuts work. KAction *action = new KAction(PlasmaApp::self()); action->setText(i18n("Next Activity")); action->setObjectName( QLatin1String("Next Activity" )); // NO I18N action->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_Tab)); connect(action, SIGNAL(triggered()), this, SLOT(activateNextActivity())); action = new KAction(PlasmaApp::self()); action->setText(i18n("Previous Activity")); action->setObjectName( QLatin1String("Previous Activity" )); // NO I18N action->setGlobalShortcut(KShortcut(Qt::META + Qt::SHIFT + Qt::Key_Tab)); connect(action, SIGNAL(triggered()), this, SLOT(activatePreviousActivity())); connect(this, SIGNAL(immutabilityChanged(Plasma::ImmutabilityType)), this, SLOT(updateImmutability(Plasma::ImmutabilityType))); connect(KSycoca::self(), SIGNAL(databaseChanged(QStringList)), this, SLOT(checkAddPanelAction(QStringList))); connect(m_activityController, SIGNAL(currentActivityChanged(QString)), this, SLOT(currentActivityChanged(QString))); connect(m_activityController, SIGNAL(activityAdded(QString)), this, SLOT(activityAdded(QString))); connect(m_activityController, SIGNAL(activityRemoved(QString)), this, SLOT(activityRemoved(QString))); mapAnimation(Plasma::Animator::AppearAnimation, Plasma::Animator::ZoomAnimation); mapAnimation(Plasma::Animator::DisappearAnimation, Plasma::Animator::ZoomAnimation); kDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "DesktopCorona init end" << "(line:" << __LINE__ << ")"; }