1
/* ============================================================
2
* Author: Marcel Wiesweg <marcel.wiesweg@gmx.de>
4
* Description : Autodetect dcraw binary
6
* Copyright 2006 by Marcel Wiesweg
8
* This program is free software; you can redistribute it
9
* and/or modify it under the terms of the GNU General
10
* Public License as published by the Free Software Foundation;
11
* either version 2, or (at your option)
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
19
* ============================================================ */
27
#include <kmessagebox.h>
28
#include <kapplication.h>
31
#include <kaboutdata.h>
35
#include "dcrawbinary.h"
40
DcrawBinary *DcrawBinary::m_instance = 0;
42
DcrawBinary::DcrawBinary()
47
DcrawBinary::~DcrawBinary()
52
DcrawBinary *DcrawBinary::instance()
55
m_instance = new DcrawBinary;
59
void DcrawBinary::cleanUp()
64
bool DcrawBinary::checkSystem()
68
process.clearArguments();
69
process.addArgument("dcraw");
71
QString appName = KGlobal::instance()->aboutData()->programName();
73
m_available = process.start();
76
int ret = KMessageBox::warningContinueCancel(
78
i18n("<qt><p>Unable to find the dcraw executable:<br> "
79
"This program is required by %1 to support raw file formats. "
80
"You can run %1 without this, but you will not be able "
81
"to view or edit any images in raw file formats. "
82
"Please install dcraw as a package from your distributor "
83
"or <a href=\"%2\">download the source</a>.</p>"
84
"<p>Do you want to continue starting %1?</p></qt>")
86
.arg("http://www.cybercom.net/~dcoffin/dcraw/"),
89
QString::fromLatin1("dcrawdetection"),
90
KMessageBox::Notify | KMessageBox::AllowLink
93
if (ret == KMessageBox::Cancel)
97
// Veturn true even if m_available is false,
98
// return value indicates whether the user wants to abort or continue
102
const char *DcrawBinary::path()
107
bool DcrawBinary::isAvailable()
112
} // namespace Digikam