# to the components requested in find_package().
include(UseQt4)
+if(${KDE_VERSION} VERSION_LESS 4.3.80)
+ set(KDE4_KNEWSTUFF_LIBS ${KDE4_KNEWSTUFF2_LIBS})
+else(${KDE_VERSION} VERSION_LESS 4.3.80)
+ set(KDE4_KNEWSTUFF_LIBS ${KDE4_KNEWSTUFF3_LIBS})
+endif(${KDE_VERSION} VERSION_LESS 4.3.80)
+
target_link_libraries(kdenlive
${KDE4_KDEUI_LIBS}
${KDE4_KIO_LIBS}
- ${KDE4_KNEWSTUFF3_LIBS}
+ ${KDE4_KNEWSTUFF_LIBS}
${KDE4_KNOTIFYCONFIG_LIBRARY}
${KDE4_KROSSUI_LIBS}
${QT_LIBRARIES}
m_view.vobs_list->header()->setResizeMode(1, QHeaderView::Custom);
m_view.vobs_list->header()->setResizeMode(2, QHeaderView::Custom);
+#if KDE_IS_VERSION(4,2,0)
m_capacityBar = new KCapacityBar(KCapacityBar::DrawTextInline, this);
QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget(m_capacityBar);
m_view.size_box->setLayout(layout);
+#else
+ m_view.size_box->setHidden(true);
+#endif
slotCheckVobList();
}
DvdWizardVob::~DvdWizardVob()
{
+#if KDE_IS_VERSION(4,2,0)
delete m_capacityBar;
+#endif
}
if (hasItem && m_view.vobs_list->indexOfTopLevelItem(item) == max - 1) m_view.button_down->setEnabled(false);
else m_view.button_down->setEnabled(hasItem);
+#if KDE_IS_VERSION(4,2,0)
qint64 totalSize = 0;
for (int i = 0; i < max; i++) {
item = m_view.vobs_list->topLevelItem(i);
qint64 maxSize = (qint64) 47000 * 100000;
m_capacityBar->setValue(100 * totalSize / maxSize);
m_capacityBar->setText(KIO::convertSize(totalSize));
+#endif
}
void DvdWizardVob::slotItemUp()
#include "ui_dvdwizardvob_ui.h"
#include <kdeversion.h>
+
+#if KDE_IS_VERSION(4,2,0)
#include <kcapacitybar.h>
+#endif
+
#include <KUrl>
#include <QWizardPage>
private:
Ui::DvdWizardVob_UI m_view;
QString m_errorMessage;
+
+#if KDE_IS_VERSION(4,2,0)
KCapacityBar *m_capacityBar;
+#endif
public slots:
void slotAddVobFile(KUrl url = KUrl(), const QString &chapters = QString());
KdenliveSettings::setShuttlebuttons(maps);
#endif
+#if KDE_IS_VERSION(4,3,0)
KConfigDialog::settingsChangedSlot();
+#endif
//KConfigDialog::updateSettings();
if (resetProfile) emit doResetProfile();
QString maps = JogShuttleConfig::actionMap(actions);
m_shuttleModified = KdenliveSettings::shuttlebuttons() != maps;
#endif
+#if KDE_IS_VERSION(4,3,0)
KConfigDialog::updateButtons();
+#endif
}
void KdenliveSettingsDialog::slotDialogModified()
{
m_modified = true;
+#if KDE_IS_VERSION(4,3,0)
KConfigDialog::updateButtons();
+#endif
}
//virtual
#include <KFileItem>
#include <KNotification>
#include <KNotifyConfigWidget>
+#if KDE_IS_VERSION(4,3,80)
#include <knewstuff3/downloaddialog.h>
#include <knewstuff3/knewstuffaction.h>
+#else
+#include <knewstuff2/engine.h>
+#include <knewstuff2/ui/knewstuffaction.h>
+#define KNS3 KNS
+#endif
#include <KToolBar>
#include <KColorScheme>
#include <KProgressDialog>
connect(m_notesWidget, SIGNAL(seekProject(int)), m_projectMonitor->render, SLOT(seekToFrame(int)));
m_notesWidget->setTabChangesFocus(true);
+#if KDE_IS_VERSION(4,4,0)
m_notesWidget->setClickMessage(i18n("Enter your project notes here ..."));
+#endif
m_notesDock->setWidget(m_notesWidget);
addDockWidget(Qt::TopDockWidgetArea, m_notesDock);
int MainWindow::getNewStuff(const QString &configFile)
{
KNS3::Entry::List entries;
+#if KDE_IS_VERSION(4,3,80)
KNS3::DownloadDialog dialog(configFile);
dialog.exec();
entries = dialog.changedEntries();
if (entry.status() == KNS3::Entry::Installed)
kDebug() << "// Installed files: " << entry.installedFiles();
}
+#else
+ KNS::Engine engine(0);
+ if (engine.init(configFile))
+ entries = engine.downloadDialogModal(this);
+ foreach(KNS::Entry * entry, entries) {
+ if (entry->status() == KNS::Entry::Installed)
+ kDebug() << "// Installed files: " << entry->installedFiles();
+ }
+#endif
return entries.size();
}
KFileDialog *fs = new KFileDialog(KUrl(), "image/png", this);
fs->setOperationMode(KFileDialog::Saving);
fs->setMode(KFile::File);
+#if KDE_IS_VERSION(4,2,0)
fs->setConfirmOverwrite(true);
+#endif
fs->setKeepLocation(true);
fs->exec();
QString path = fs->selectedFile();
#include <KMessageBox>
#include <KApplication>
+#if KDE_IS_VERSION(4,2,0)
#include <KDiskFreeSpaceInfo>
+#endif
#include <QMouseEvent>
#include <QMenu>
m_logger.setFrame(false);
//m_logger.setInsertPolicy(QComboBox::InsertAtTop);
+#if KDE_IS_VERSION(4,2,0)
m_freeSpace = new KCapacityBar(KCapacityBar::DrawTextInline, this);
m_freeSpace->setMaximumWidth(150);
QFontMetricsF fontMetrics(font());
connect(&m_spaceTimer, SIGNAL(timeout()), this, SLOT(slotUpdateFreeSpace()));
m_spaceTimer.setInterval(30000);
m_spaceTimer.setSingleShot(false);
+#endif
control_frame_firewire->setLayout(layout);
m_displayProcess = new QProcess;
RecMonitor::~RecMonitor()
{
+#if KDE_IS_VERSION(4,2,0)
m_spaceTimer.stop();
+#endif
delete m_captureProcess;
delete m_displayProcess;
if (m_captureDevice) delete m_captureDevice;
else KMessageBox::information(this, i18n("You need to stop capture before your changes can be applied"), i18n("Capturing"));
} else slotVideoDeviceChanged(device_selector->currentIndex());
+#if KDE_IS_VERSION(4,2,0)
// update free space info
slotUpdateFreeSpace();
+#endif
}
void RecMonitor::slotVideoDeviceChanged(int ix)
m_isCapturing = true;
m_didCapture = true;
m_captureProcess->write("c\n", 3);
+#if KDE_IS_VERSION(4,2,0)
m_spaceTimer.start();
+#endif
return;
}
if (m_captureProcess->state() == QProcess::NotRunning) {
}
m_isCapturing = false;
+#if KDE_IS_VERSION(4,2,0)
m_spaceTimer.stop();
// update free space info
slotUpdateFreeSpace();
+#endif
+
} else {
if (device_selector->currentIndex() != SCREENGRAB) m_stopAction->setEnabled(true);
device_selector->setEnabled(false);
// virtual
void RecMonitor::mousePressEvent(QMouseEvent * /*event*/)
{
+#if KDE_IS_VERSION(4,2,0)
if (m_freeSpace->underMouse()) slotUpdateFreeSpace();
+#endif
}
void RecMonitor::slotUpdateFreeSpace()
{
+#if KDE_IS_VERSION(4,2,0)
KDiskFreeSpaceInfo info = KDiskFreeSpaceInfo::freeSpaceInfo(m_capturePath);
if (info.isValid() && info.size() > 0) {
m_freeSpace->setValue(100 * info.used() / info.size());
m_freeSpace->setText(i18n("Free space: %1", KIO::convertSize(info.available())));
m_freeSpace->update();
}
+#endif
}
void RecMonitor::refreshRecMonitor(bool visible)
#include <kdeversion.h>
#include <KComboBox>
+#if KDE_IS_VERSION(4,2,0)
#include <kcapacitybar.h>
+#endif
class MonitorManager;
class MltDeviceCapture;
KComboBox m_logger;
QString m_capturePath;
+#if KDE_IS_VERSION(4,2,0)
KCapacityBar *m_freeSpace;
QTimer m_spaceTimer;
+#endif
KUrl m_captureFile;
KIcon m_playIcon;
KFileDialog *fs = new KFileDialog(KUrl(m_projectTitlePath), "application/x-kdenlivetitle", this);
fs->setOperationMode(KFileDialog::Saving);
fs->setMode(KFile::File);
+#if KDE_IS_VERSION(4,2,0)
fs->setConfirmOverwrite(true);
+#endif
fs->setKeepLocation(true);
fs->exec();
url = fs->selectedUrl();