+QPixmap MainWindow::createSchemePreviewIcon(const KSharedConfigPtr &config)
+{
+ // code taken from kdebase/workspace/kcontrol/colors/colorscm.cpp
+ const uchar bits1[] = { 0xff, 0xff, 0xff, 0x2c, 0x16, 0x0b };
+ const uchar bits2[] = { 0x68, 0x34, 0x1a, 0xff, 0xff, 0xff };
+ const QSize bitsSize(24, 2);
+ const QBitmap b1 = QBitmap::fromData(bitsSize, bits1);
+ const QBitmap b2 = QBitmap::fromData(bitsSize, bits2);
+
+ QPixmap pixmap(23, 16);
+ pixmap.fill(Qt::black); // ### use some color other than black for borders?
+
+ KConfigGroup group(config, "WM");
+ QPainter p(&pixmap);
+ KColorScheme windowScheme(QPalette::Active, KColorScheme::Window, config);
+ p.fillRect(1, 1, 7, 7, windowScheme.background());
+ p.fillRect(2, 2, 5, 2, QBrush(windowScheme.foreground().color(), b1));
+
+ KColorScheme buttonScheme(QPalette::Active, KColorScheme::Button, config);
+ p.fillRect(8, 1, 7, 7, buttonScheme.background());
+ p.fillRect(9, 2, 5, 2, QBrush(buttonScheme.foreground().color(), b1));
+
+ p.fillRect(15, 1, 7, 7, group.readEntry("activeBackground", QColor(96, 148, 207)));
+ p.fillRect(16, 2, 5, 2, QBrush(group.readEntry("activeForeground", QColor(255, 255, 255)), b1));
+
+ KColorScheme viewScheme(QPalette::Active, KColorScheme::View, config);
+ p.fillRect(1, 8, 7, 7, viewScheme.background());
+ p.fillRect(2, 12, 5, 2, QBrush(viewScheme.foreground().color(), b2));
+
+ KColorScheme selectionScheme(QPalette::Active, KColorScheme::Selection, config);
+ p.fillRect(8, 8, 7, 7, selectionScheme.background());
+ p.fillRect(9, 12, 5, 2, QBrush(selectionScheme.foreground().color(), b2));
+
+ p.fillRect(15, 8, 7, 7, group.readEntry("inactiveBackground", QColor(224, 223, 222)));
+ p.fillRect(16, 12, 5, 2, QBrush(group.readEntry("inactiveForeground", QColor(20, 19, 18)), b2));
+
+ p.end();
+ return pixmap;
+}
+
+void MainWindow::slotSwitchMonitors()
+{
+ m_monitorManager->slotSwitchMonitors();
+ if (m_projectMonitor->isActive()) m_activeTimeline->projectView()->setFocus();
+ else m_projectList->focusTree();
+}
+
+void MainWindow::slotInsertZoneToTree()
+{
+ if (!m_clipMonitor->isActive() || m_clipMonitor->activeClip() == NULL) return;
+ QStringList info = m_clipMonitor->getZoneInfo();
+ m_projectList->slotAddClipCut(info.at(0), info.at(1).toInt(), info.at(2).toInt());
+}
+
+void MainWindow::slotInsertZoneToTimeline()
+{
+ if (m_activeTimeline == NULL || m_clipMonitor->activeClip() == NULL) return;
+ QStringList info = m_clipMonitor->getZoneInfo();
+ m_activeTimeline->projectView()->insertClipCut(m_clipMonitor->activeClip(), info.at(1).toInt(), info.at(2).toInt());
+}
+