removed version, refs #101; implemented new temporaryfile handler and improved save, refs #51; partial changes for refs #79 and solved #104

master
Marc Wäckerlin 13 years ago
parent b35e1fd9ed
commit 0614b4fc23
  1. 87
      swisssurfer/src/browser.hxx
  2. 8
      swisssurfer/src/certificate.hxx
  3. 134
      swisssurfer/src/pdfdisplay.hpp
  4. 122
      swisssurfer/src/pluginfactory.hxx
  5. 4
      swisssurfer/src/qmake.pro.in
  6. 121
      swisssurfer/src/saveorrun.hxx
  7. 284
      swisssurfer/src/saveorrun.ui
  8. 16
      swisssurfer/src/smartcardauth.hxx
  9. 164
      swisssurfer/src/swisssurfer_de.ts
  10. 164
      swisssurfer/src/swisssurfer_en.ts
  11. 164
      swisssurfer/src/swisssurfer_fr.ts
  12. 164
      swisssurfer/src/swisssurfer_it.ts
  13. 66
      swisssurfer/src/temporaryfile.hxx

@ -26,7 +26,6 @@
#include <QtNetwork/QNetworkReply>
#include <QtNetwork/QSslError>
#include <QtNetwork/QNetworkProxy>
#include <QtCore/QTemporaryFile>
#include <QtCore/QProcess>
#include <QtCore/QDir>
#include <QtGui/QFileDialog>
@ -40,6 +39,8 @@
#include <settings.hxx>
#include <editbookmarks.hxx>
#include <pluginfactory.hxx>
#include <temporaryfile.hxx>
#include <saveorrun.hxx>
#include <sslclientnetworkmanager.hxx>
#include <proxyface/proxy.hxx>
@ -155,12 +156,14 @@ class Browser: public QMainWindow, protected Ui::Browser {
LOG;
for (DownloadProcesses::iterator it(_downloadProcesses.begin());
it!=_downloadProcesses.end(); ++it) {
LOG<<"delete:"<<it->second->fileName();
LOG<<"cleanup:"<<it->second->fileName();
it->second->setAutoRemove(_settings.flag("CloseApps"));
delete it->second;
it->second = 0;
if (_settings.flag("CloseApps")) it->first->terminate();
delete it->first;
if (_settings.flag("CloseApps")) {
it->first->terminate();
delete it->first;
}
}
}
@ -1148,43 +1151,55 @@ class Browser: public QMainWindow, protected Ui::Browser {
if (!type.isEmpty()) {
filename.replace(QRegExp("^(.*)\\."+type.at(0)+"$"),
"\\1"); // remove extension
QTemporaryFile *file(QTemporaryFile::createLocalFile
(QDir::tempPath()+QDir::separator()
+filename+"."+type.at(0)));
if (!file) file = new QTemporaryFile(QDir::tempPath()+QDir::separator()
+filename+"_XXXXXX."
+type.at(0), this);
file->open();
file->write(reply->readAll());
file->close();
LOG<<"Stored as:"<<file->fileName();
statusBar()->showMessage(tr("launching application ..."), 5000);
QProcess* process(new QProcess);
_downloadProcesses[process] = file;
assert(connect(process, SIGNAL(finished(int, QProcess::ExitStatus)),
SLOT(processFinished())));
QStringList args(type.at(1).split(" ")
.replaceInStrings("%1", file->fileName()));
QString prg(args.takeFirst());
LOG<<"Running:"<<prg<<args.join(" ");
process->start(prg, args);
run(reply, filename+"."+type.at(0), type.at(1));
} else {
QString saveFile
(QFileDialog::getSaveFileName(this, tr("Save File As ..."),
filename));
if (!saveFile.isEmpty()) {
QFile file(saveFile);
file.open(QIODevice::WriteOnly);
file.write(reply->readAll());
file.close();
}
SaveOrRun choice(filename,
reply->header(QNetworkRequest::ContentTypeHeader)
.toString(),
reply->url().host(),
_kiosk, this);
choice.exec();
if (choice.ok())
if (choice.save()) {
QFile file(choice.filename());
file.open(QIODevice::WriteOnly);
file.write(reply->readAll());
file.close();
} else if (choice.run()) {
run(reply, filename, choice.program()+" %1");
} else {
// ...
}
}
}
void run(QNetworkReply* reply, QString filename, QString command) {
TemporaryFile *file(new TemporaryFile
(QDir::tempPath()+QDir::separator()
+filename));
file->open();
file->write(reply->readAll());
file->close();
LOG<<"Stored as:"<<file->fileName();
statusBar()->showMessage(tr("launching application ..."), 5000);
QProcess* process(new QProcess);
_downloadProcesses[process] = file;
assert(connect(process, SIGNAL(finished(int, QProcess::ExitStatus)),
SLOT(processFinished())));
QStringList args(command.split(" ")
.replaceInStrings("%1", file->fileName()));
QString prg(args.takeFirst());
LOG<<"Running:"<<prg<<args.join(" ");
process->start(prg, args);
}
void processFinished() {
LOG;
_downloadProcesses[qobject_cast<QProcess*>(sender())]->setAutoRemove
(_settings.flag("CloseApps"));
if (_downloadProcesses.find(qobject_cast<QProcess*>(sender()))
== _downloadProcesses.end()) return;
if (_downloadProcesses[qobject_cast<QProcess*>(sender())])
_downloadProcesses[qobject_cast<QProcess*>(sender())]
->setAutoRemove(true);
delete _downloadProcesses[qobject_cast<QProcess*>(sender())];
_downloadProcesses.erase(qobject_cast<QProcess*>(sender()));
}
@ -1405,7 +1420,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
QPrinter _printer;
SslClientAuthNetworkAccessManager _networkManager;
DownloadManager _downloadManager;
typedef std::map<QProcess*, QTemporaryFile*> DownloadProcesses;
typedef std::map<QProcess*, TemporaryFile*> DownloadProcesses;
DownloadProcesses _downloadProcesses;
Settings _settings;
ErrorLog _errorLog;

@ -34,10 +34,10 @@ class Certificate: public QWidget, protected Ui::Certificate {
((new QTreeWidgetItem
(QStringList()<<tr("Serial Number")
<<cert.serialNumber())));
_cert->addTopLevelItem
((new QTreeWidgetItem
(QStringList()<<tr("Version")
<<cert.version())));
// _cert->addTopLevelItem
// ((new QTreeWidgetItem
// (QStringList()<<tr("Version")
// <<cert.version())));
QTreeWidgetItem *it(0);
_cert->addTopLevelItem
((it = new QTreeWidgetItem(QStringList()<<tr("Subject Info")<<"")));

@ -0,0 +1,134 @@
#ifndef __PDFDISPLAY_HPP__
#define __PDFDISPLAY_HPP__
#include <QtCore/QFile>
#include <QtGui/QApplication>
#include <QtGui/QImage>
#include <QtGui/QLabel>
#include <QtGui/QMouseEvent>
#include <QtGui/QPainter>
#include <QtGui/QPaintEvent>
#include <QtGui/QToolTip>
#include <QtGui/QWidget>
#include <QtCore/QDebug>
#include <poppler/qt4/poppler-qt4.h>
class PDFDisplay : public QWidget // picture display widget
{
public:
PDFDisplay( Poppler::Document *d, bool arthur )
{
showTextRects = false;
doc = d;
m_currentPage = 0;
if (arthur)
{
backendString = "Arthur";
doc->setRenderBackend(Poppler::Document::ArthurBackend);
}
else
{
backendString = "Splash";
doc->setRenderBackend(Poppler::Document::SplashBackend);
}
doc->setRenderHint(Poppler::Document::Antialiasing, true);
doc->setRenderHint(Poppler::Document::TextAntialiasing, true);
}
~PDFDisplay()
{
qDeleteAll(textRects);
delete doc;
}
void setShowTextRects(bool show)
{
showTextRects = show;
}
void display()
{
if (doc) {
Poppler::Page *page = doc->page(m_currentPage);
if (page) {
qDebug() << "Displaying page using" << backendString << "backend: " << m_currentPage;
QTime t = QTime::currentTime();
image = page->renderToImage();
qDebug() << "Rendering took" << t.msecsTo(QTime::currentTime()) << "msecs";
qDeleteAll(textRects);
if (showTextRects)
{
QPainter painter(&image);
painter.setPen(Qt::red);
textRects = page->textList();
for (auto tb(textRects.begin()); tb!=textRects.end(); ++tb)
painter.drawRect((*tb)->boundingBox());
}
else textRects.clear();
update();
delete page;
}
} else {
qWarning() << "doc not loaded";
}
}
protected:
void paintEvent( QPaintEvent * )
{
QPainter paint( this ); // paint widget
if (!image.isNull()) {
paint.drawImage(0, 0, image);
} else {
qWarning() << "null image";
}
}
void keyPressEvent( QKeyEvent *e )
{
if (e->key() == Qt::Key_Down)
{
if (m_currentPage + 1 < doc->numPages())
{
m_currentPage++;
display();
}
}
else if (e->key() == Qt::Key_Up)
{
if (m_currentPage > 0)
{
m_currentPage--;
display();
}
}
else if (e->key() == Qt::Key_Q)
{
exit(0);
}
}
void mousePressEvent( QMouseEvent *e )
{
int i = 0;
for (auto tb(textRects.begin()); tb!=textRects.end(); ++tb)
{
if ((*tb)->boundingBox().contains(e->pos()))
{
QString tt = QString("Text: \"%1\"\nIndex in text list: %2").arg((*tb)->text()).arg(i);
QToolTip::showText(e->globalPos(), tt, this);
break;
}
++i;
}
}
private:
int m_currentPage;
QImage image;
Poppler::Document *doc;
QString backendString;
bool showTextRects;
QList<Poppler::TextBox*> textRects;
};
#endif

@ -0,0 +1,122 @@
/*! @file
@id $Id$
*/
// 1 2 3 4 5 6 7 8
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
#ifndef __PLUGINFACTORY_HXX__
#define __PLUGINFACTORY_HXX__
#include <QtWebKit/QWebPluginFactory>
#include <poppler/qt4/poppler-qt4.h>
#include <pdfdisplay.hpp>
#include <QtCore/QDebug>
#ifndef LOG
#define LOG qDebug()<<__PRETTY_FUNCTION__
#endif
#define foreach(A, B) \
auto foreach_loopvar_##A(B); \
for (auto A(foreach_loopvar_##A.begin()); A!=foreach_loopvar_##A.end(); ++A)
class PluginFactory: public QWebPluginFactory {
public:
PluginFactory(QObject* p=0): QWebPluginFactory(p) {
LOG;
Plugin plugin;
plugin.name = "Show PDF-Document";
plugin.description = "Plugin for PDF documents";
MimeType mime;
mime.fileExtensions<<"pdf";
mime.name = "application/pdf";
mime.description = "PDF-Document";
plugin.mimeTypes<<mime;
_plugins.push_back(plugin);
}
virtual QObject* create(const QString& mimeType, const QUrl& url,
const QStringList& argumentNames,
const QStringList& argumentValues ) const {
LOG<<"mimeType:"<<mimeType
<<"url:"<<url
<<"argumentNames:"<<argumentNames.join(", ")
<<"argumentValues:"<<argumentValues.join(", ");
if (mimeType=="application/pdf") {
Poppler::Document *doc = Poppler::Document::load(url.path());
assert(doc);
assert(!doc->isLocked());
// output some meta-data
int major = 0, minor = 0;
doc->getPdfVersion( &major, &minor );
qDebug() << " PDF Version: " << qPrintable(QString::fromLatin1("%1.%2").arg(major).arg(minor));
qDebug() << " Title: " << doc->info("Title");
qDebug() << " Subject: " << doc->info("Subject");
qDebug() << " Author: " << doc->info("Author");
qDebug() << " Key words: " << doc->info("Keywords");
qDebug() << " Creator: " << doc->info("Creator");
qDebug() << " Producer: " << doc->info("Producer");
qDebug() << " Date created: " << doc->date("CreationDate").toString();
qDebug() << " Date modified: " << doc->date("ModDate").toString();
qDebug() << "Number of pages: " << doc->numPages();
qDebug() << " Linearised: " << doc->isLinearized();
qDebug() << " Encrypted: " << doc->isEncrypted();
qDebug() << " OK to print: " << doc->okToPrint();
qDebug() << " OK to copy: " << doc->okToCopy();
qDebug() << " OK to change: " << doc->okToChange();
qDebug() << "OK to add notes: " << doc->okToAddNotes();
qDebug() << " Page mode: " << doc->pageMode();
qDebug() << " Metadata: " << doc->metadata();
QStringList fontNameList;
foreach(font, doc->fonts())
fontNameList += font->name();
qDebug() << " Fonts: " << fontNameList.join( ", " );
if ( doc->hasEmbeddedFiles() ) {
qDebug() << "Embedded files:";
foreach(file, doc->embeddedFiles()) {
qDebug() << " " << (*file)->name();
}
qDebug();
} else {
qDebug() << "No embedded files";
}
if (doc->numPages() <= 0)
{
delete doc;
qDebug() << "Doc has no pages";
return 0;
}
{
std::auto_ptr<Poppler::Page> page(doc->page(0));
qDebug() << "Page 1 size: " << page->pageSize().width()/72 << "inches x " << page->pageSize().height()/72 << "inches";
}
bool useArthur(false);
PDFDisplay* test(new PDFDisplay(doc, useArthur));
test->setWindowTitle("Poppler-Qt4 Test");
test->setShowTextRects(false);
test->display();
test->show();
// QMainWindow* main(new QMainWindow);
// main->setCentralWidget(test);
// main->show();
return test;
}
return 0;
}
virtual QList<Plugin> plugins() const {
LOG;
return _plugins;
}
virtual void refreshPlugins() {
LOG;
}
private:
QList<Plugin> _plugins;
};
#endif

@ -38,10 +38,10 @@ HEADERS = browser.hxx smartcardauth.hxx pinentry.hxx \
downloadmanager.hxx settings.hxx sslclientnetworkmanager.hxx \
authentication.hxx webpage.hxx errorlog.hxx \
certificate.hxx logincertificate.hxx editbookmarks.hxx \
pluginfactory.hxx pdfdisplay.hpp
pluginfactory.hxx pdfdisplay.hpp saveorrun.hxx temporaryfile.hxx
FORMS = browser.ui settings.ui pinentry.ui authentication.ui errorlog.ui \
certificate.ui logincertificate.ui editbookmarks.ui
certificate.ui logincertificate.ui editbookmarks.ui saveorrun.ui
RESOURCES = languages.qrc resources.qrc

@ -0,0 +1,121 @@
/*! @file
@id $Id$
*/
// 1 2 3 4 5 6 7 8
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
#ifndef __SAVEORRUN_HXX__
#define __SAVEORRUN_HXX__
#include <ui_saveorrun.h>
#include <QtGui/QDialog>
#include <QtGui/QFileDialog>
#include <QtGui/QFileSystemModel>
#include <QtGui/QMessageBox>
#include <memory>
class SaveOrRun: public QDialog, protected Ui::SaveOrRun {
Q_OBJECT;
public:
SaveOrRun(QString obj, QString type, QString src,
bool kiosk=false, QWidget* p=0):
QDialog(p), _ok(false) {
setupUi(this);
_object->setText(obj);
_type->setText(type);
_source->setText(src);
QString path(QDir::homePath());
QStringList defpaths;
defpaths<<"downloads"<<"Downloads"<<"Documents"
<<tr("Dokumente", "Documents folder in local language")
<<"Desktop"
<<tr("Arbeitsfläche", "Desktop folder in local language");
for (auto it(defpaths.begin()); it!=defpaths.end(); ++it)
if (QFile::exists(QDir::homePath()+QDir::separator()+*it)) {
path = QDir::homePath()+QDir::separator()+*it;
break;
}
_filename->setText(path+QDir::separator()+obj);
_program->setText(QCoreApplication::applicationDirPath()
+QDir::separator());
// if (kiosk) {
// _openWith->hide();
// _program->hide();
// _programpath->hide();
// _saveAs->hide();
// _filenamelabel->setText(_saveAs->text()+' '+_filenamelabel->text());
// }
}
void init() {
_ok = false;
}
bool save() {
return _saveAs->isChecked();
}
bool run() {
return _openWith->isChecked();
}
bool ok() {
return _ok;
}
QString filename() {
return _filename->text();
}
QString program() {
return _program->text();
}
public Q_SLOTS:
virtual void accept() {
if (save() && QFileInfo(filename()).exists()
&& QMessageBox::question(this, tr("File Exists"),
tr("File already exists:\n\n"
"%1\n\n"
"Overwrite?").arg(filename()),
QMessageBox::Yes|QMessageBox::No)
== QMessageBox::No
|| run() && (!QFile::exists(program())
|| !QFileInfo(program()).isExecutable())
|| save() && filename().size()==0
|| run() && program().size()==0)
return; // reject
_ok = true;
QDialog::accept();
}
protected Q_SLOTS:
void on__browseSaveAs_clicked(bool) {
QString saveFile
(QFileDialog::getSaveFileName(this, tr("Save File As ..."),
_filename->text(), QString(), 0,
QFileDialog::DontConfirmOverwrite));
if (!saveFile.size()) return;
if (QFileInfo(saveFile).isDir())
saveFile += QDir::separator()+_object->text();
_filename->setText(saveFile);
}
void on__browseOpenWith_clicked(bool) {
QString openFile
(QFileDialog::getOpenFileName(this, tr("Open File With ..."),
_program->text()));
if (openFile.size()) _program->setText(openFile);
}
private:
bool _ok;
};
#endif

@ -0,0 +1,284 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SaveOrRun</class>
<widget class="QDialog" name="SaveOrRun">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>583</width>
<height>161</height>
</rect>
</property>
<property name="windowTitle">
<string>File Downloaded</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>File:</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="3">
<widget class="QLabel" name="_object">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>...</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Type:</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="3">
<widget class="QLabel" name="_type">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>...</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Source</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="3">
<widget class="QLabel" name="_source">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>...</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QRadioButton" name="_openWith">
<property name="text">
<string>open file with:</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QLineEdit" name="_program">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QPushButton" name="_browseOpenWith">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>browse ...</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QRadioButton" name="_saveAs">
<property name="text">
<string>save file as</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<widget class="QLineEdit" name="_filename"/>
</item>
<item row="4" column="3">
<widget class="QPushButton" name="_browseSaveAs">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>browse ...</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="4">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="5" column="0" colspan="4">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>SaveOrRun</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>SaveOrRun</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>_openWith</sender>
<signal>toggled(bool)</signal>
<receiver>_program</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>105</x>
<y>170</y>
</hint>
<hint type="destinationlabel">
<x>232</x>
<y>172</y>
</hint>
</hints>
</connection>
<connection>
<sender>_saveAs</sender>
<signal>toggled(bool)</signal>
<receiver>_filename</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>92</x>
<y>463</y>
</hint>
<hint type="destinationlabel">
<x>220</x>
<y>463</y>
</hint>
</hints>
</connection>
<connection>
<sender>_openWith</sender>
<signal>toggled(bool)</signal>
<receiver>_browseOpenWith</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>82</x>
<y>79</y>
</hint>
<hint type="destinationlabel">
<x>531</x>
<y>79</y>
</hint>
</hints>
</connection>
<connection>
<sender>_saveAs</sender>
<signal>toggled(bool)</signal>
<receiver>_browseSaveAs</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>82</x>
<y>109</y>
</hint>
<hint type="destinationlabel">
<x>531</x>
<y>109</y>
</hint>
</hints>
</connection>
</connections>
</ui>

@ -153,8 +153,11 @@ class SmartCardAuth: public QObject {
void login(bool force=true) {
qDebug()<<__PRETTY_FUNCTION__;
QMutexLocker lock(&_mutex);
while (!_mutex.tryLock()) QCoreApplication::processEvents();
FreeLock freelock(_mutex);
OPENSSL_LOG("got lock");
if (!_e || (!force && *_e)) return; // no smartcard or already logged in
OPENSSL_LOG("start login to smartcard");
try {
QList<CertInfo> authcerts;
QList<CertInfo> allcerts;
@ -286,6 +289,17 @@ class SmartCardAuth: public QObject {
cryptoki::SlotList::iterator slot;
cryptoki::Attribute id;
};
class FreeLock {
public:
FreeLock(QMutex& m): _mutex(m) {
}
~FreeLock() {
_mutex.unlock();
}
private:
QMutex& _mutex;
};
private:

@ -296,122 +296,122 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="465"/>
<location filename="browser.hxx" line="468"/>
<source>Checking: %1</source>
<oldsource>Opening: %1</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="476"/>
<location filename="browser.hxx" line="479"/>
<source>Reading: %1</source>
<oldsource>Reading: %1%</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="497"/>
<location filename="browser.hxx" line="500"/>
<source>Zoom: %1%</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="478"/>
<location filename="browser.hxx" line="481"/>
<source>Illegal URL: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="557"/>
<location filename="browser.hxx" line="560"/>
<source>Print Document</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="578"/>
<location filename="browser.hxx" line="581"/>
<source>%1 - %2</source>
<oldsource>Back to %1 - %2</oldsource>
<comment>statusbar actionBack_hovered %1=url %2=title</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="767"/>
<location filename="browser.hxx" line="770"/>
<source>Info: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="781"/>
<location filename="browser.hxx" line="784"/>
<source>done.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1036"/>
<location filename="browser.hxx" line="1039"/>
<source>%1</source>
<comment>statusbar for hovered link %1=url</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="468"/>
<location filename="browser.hxx" line="471"/>
<source>Forbidden: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="150"/>
<location filename="browser.hxx" line="151"/>
<source>SSL Not Supported</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="151"/>
<location filename="browser.hxx" line="152"/>
<source>SSL is not supported on your system</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="469"/>
<location filename="browser.hxx" line="472"/>
<source>Access Denied</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="470"/>
<location filename="browser.hxx" line="473"/>
<source>&lt;p&gt;Access denied due to security considerations.&lt;/p&gt;&lt;p&gt;You are not allowed to connect to %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="514"/>
<location filename="browser.hxx" line="517"/>
<source>opening new window</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="597"/>
<location filename="browser.hxx" line="600"/>
<source>%1 - %2</source>
<comment>statusbar actionForward_hovered %1=url %2=title</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="618"/>
<location filename="browser.hxx" line="646"/>
<location filename="browser.hxx" line="662"/>
<location filename="browser.hxx" line="621"/>
<location filename="browser.hxx" line="649"/>
<location filename="browser.hxx" line="665"/>
<source>background-color: white</source>
<comment>neutral find</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="670"/>
<location filename="browser.hxx" line="680"/>
<location filename="browser.hxx" line="673"/>
<location filename="browser.hxx" line="683"/>
<source>background-color: #ADA</source>
<oldsource>background-color: #7F7</oldsource>
<comment>text found</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="672"/>
<location filename="browser.hxx" line="682"/>
<location filename="browser.hxx" line="675"/>
<location filename="browser.hxx" line="685"/>
<source>background-color: #F77</source>
<oldsource>background-color: lightred</oldsource>
<comment>text not found</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="702"/>
<location filename="browser.hxx" line="705"/>
<source>About</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="703"/>
<location filename="browser.hxx" line="706"/>
<source>%8
Version: %1
Builddate: %2
@ -431,47 +431,42 @@ openssl-%7</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="762"/>
<location filename="browser.hxx" line="765"/>
<source>%1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1161"/>
<location filename="browser.hxx" line="1184"/>
<source>launching application ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1173"/>
<source>Save File As ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1235"/>
<location filename="browser.hxx" line="1250"/>
<source>errors</source>
<comment>show error log</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1252"/>
<location filename="browser.hxx" line="1255"/>
<location filename="browser.hxx" line="1267"/>
<location filename="browser.hxx" line="1270"/>
<source>background-color: #F77</source>
<comment>invalid url</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1262"/>
<location filename="browser.hxx" line="1265"/>
<location filename="browser.hxx" line="1277"/>
<location filename="browser.hxx" line="1280"/>
<source>background-color: white</source>
<comment>valid url</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1280"/>
<location filename="browser.hxx" line="1295"/>
<source>authentication required</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1292"/>
<location filename="browser.hxx" line="1307"/>
<source>ssl error</source>
<translation type="unfinished"></translation>
</message>
@ -493,11 +488,6 @@ openssl-%7</oldsource>
<source>Serial Number</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="certificate.hxx" line="39"/>
<source>Version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="certificate.hxx" line="64"/>
<source>Issuer Info</source>
@ -789,12 +779,12 @@ openssl-%7</oldsource>
<context>
<name>QMessageBox</name>
<message>
<location filename="smartcardauth.hxx" line="222"/>
<location filename="smartcardauth.hxx" line="225"/>
<source>Wrong PIN</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="smartcardauth.hxx" line="223"/>
<location filename="smartcardauth.hxx" line="226"/>
<source>Authentication failed, please try again.</source>
<translation type="unfinished"></translation>
</message>
@ -861,6 +851,88 @@ Try: %1 --help</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SaveOrRun</name>
<message>
<location filename="saveorrun.ui" line="14"/>
<source>File Downloaded</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="26"/>
<source>File:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="39"/>
<location filename="saveorrun.ui" line="68"/>
<location filename="saveorrun.ui" line="97"/>
<source>...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="55"/>
<source>Type:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="84"/>
<source>Source</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="107"/>
<source>open file with:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="130"/>
<location filename="saveorrun.ui" line="156"/>
<source>browse ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="137"/>
<source>save file as</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="100"/>
<source>Save File As ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="111"/>
<source>Open File With ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="81"/>
<source>File Exists</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="33"/>
<source>Dokumente</source>
<comment>Documents folder in local language</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="35"/>
<source>Arbeitsfläche</source>
<comment>Desktop folder in local language</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="82"/>
<source>File already exists:
%1
Overwrite?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Settings</name>
<message>

@ -294,103 +294,103 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="465"/>
<location filename="browser.hxx" line="468"/>
<source>Checking: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="150"/>
<location filename="browser.hxx" line="151"/>
<source>SSL Not Supported</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="151"/>
<location filename="browser.hxx" line="152"/>
<source>SSL is not supported on your system</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="468"/>
<location filename="browser.hxx" line="471"/>
<source>Forbidden: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="469"/>
<location filename="browser.hxx" line="472"/>
<source>Access Denied</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="470"/>
<location filename="browser.hxx" line="473"/>
<source>&lt;p&gt;Access denied due to security considerations.&lt;/p&gt;&lt;p&gt;You are not allowed to connect to %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="476"/>
<location filename="browser.hxx" line="479"/>
<source>Reading: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="478"/>
<location filename="browser.hxx" line="481"/>
<source>Illegal URL: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="497"/>
<location filename="browser.hxx" line="500"/>
<source>Zoom: %1%</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="514"/>
<location filename="browser.hxx" line="517"/>
<source>opening new window</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="557"/>
<location filename="browser.hxx" line="560"/>
<source>Print Document</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="578"/>
<location filename="browser.hxx" line="581"/>
<source>%1 - %2</source>
<comment>statusbar actionBack_hovered %1=url %2=title</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="597"/>
<location filename="browser.hxx" line="600"/>
<source>%1 - %2</source>
<comment>statusbar actionForward_hovered %1=url %2=title</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="618"/>
<location filename="browser.hxx" line="646"/>
<location filename="browser.hxx" line="662"/>
<location filename="browser.hxx" line="621"/>
<location filename="browser.hxx" line="649"/>
<location filename="browser.hxx" line="665"/>
<source>background-color: white</source>
<comment>neutral find</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="670"/>
<location filename="browser.hxx" line="680"/>
<location filename="browser.hxx" line="673"/>
<location filename="browser.hxx" line="683"/>
<source>background-color: #ADA</source>
<oldsource>background-color: #7F7</oldsource>
<comment>text found</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="672"/>
<location filename="browser.hxx" line="682"/>
<location filename="browser.hxx" line="675"/>
<location filename="browser.hxx" line="685"/>
<source>background-color: #F77</source>
<oldsource>background-color: lightred</oldsource>
<comment>text not found</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="702"/>
<location filename="browser.hxx" line="705"/>
<source>About</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="703"/>
<location filename="browser.hxx" line="706"/>
<source>%8
Version: %1
Builddate: %2
@ -410,63 +410,58 @@ openssl-%7</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="762"/>
<location filename="browser.hxx" line="765"/>
<source>%1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="767"/>
<location filename="browser.hxx" line="770"/>
<source>Info: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="781"/>
<location filename="browser.hxx" line="784"/>
<source>done.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1036"/>
<location filename="browser.hxx" line="1039"/>
<source>%1</source>
<comment>statusbar for hovered link %1=url</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1161"/>
<location filename="browser.hxx" line="1184"/>
<source>launching application ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1173"/>
<source>Save File As ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1235"/>
<location filename="browser.hxx" line="1250"/>
<source>errors</source>
<comment>show error log</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1252"/>
<location filename="browser.hxx" line="1255"/>
<location filename="browser.hxx" line="1267"/>
<location filename="browser.hxx" line="1270"/>
<source>background-color: #F77</source>
<comment>invalid url</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1262"/>
<location filename="browser.hxx" line="1265"/>
<location filename="browser.hxx" line="1277"/>
<location filename="browser.hxx" line="1280"/>
<source>background-color: white</source>
<comment>valid url</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1280"/>
<location filename="browser.hxx" line="1295"/>
<source>authentication required</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1292"/>
<location filename="browser.hxx" line="1307"/>
<source>ssl error</source>
<translation type="unfinished"></translation>
</message>
@ -488,11 +483,6 @@ openssl-%7</oldsource>
<source>Serial Number</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="certificate.hxx" line="39"/>
<source>Version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="certificate.hxx" line="64"/>
<source>Issuer Info</source>
@ -779,12 +769,12 @@ openssl-%7</oldsource>
<context>
<name>QMessageBox</name>
<message>
<location filename="smartcardauth.hxx" line="222"/>
<location filename="smartcardauth.hxx" line="225"/>
<source>Wrong PIN</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="smartcardauth.hxx" line="223"/>
<location filename="smartcardauth.hxx" line="226"/>
<source>Authentication failed, please try again.</source>
<translation type="unfinished"></translation>
</message>
@ -851,6 +841,88 @@ Try: %1 --help</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SaveOrRun</name>
<message>
<location filename="saveorrun.ui" line="14"/>
<source>File Downloaded</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="26"/>
<source>File:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="39"/>
<location filename="saveorrun.ui" line="68"/>
<location filename="saveorrun.ui" line="97"/>
<source>...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="55"/>
<source>Type:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="84"/>
<source>Source</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="107"/>
<source>open file with:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="130"/>
<location filename="saveorrun.ui" line="156"/>
<source>browse ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="137"/>
<source>save file as</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="100"/>
<source>Save File As ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="111"/>
<source>Open File With ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="81"/>
<source>File Exists</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="33"/>
<source>Dokumente</source>
<comment>Documents folder in local language</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="35"/>
<source>Arbeitsfläche</source>
<comment>Desktop folder in local language</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="82"/>
<source>File already exists:
%1
Overwrite?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Settings</name>
<message>

@ -296,122 +296,122 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="465"/>
<location filename="browser.hxx" line="468"/>
<source>Checking: %1</source>
<oldsource>Opening: %1</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="476"/>
<location filename="browser.hxx" line="479"/>
<source>Reading: %1</source>
<oldsource>Reading: %1%</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="497"/>
<location filename="browser.hxx" line="500"/>
<source>Zoom: %1%</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="478"/>
<location filename="browser.hxx" line="481"/>
<source>Illegal URL: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="557"/>
<location filename="browser.hxx" line="560"/>
<source>Print Document</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="578"/>
<location filename="browser.hxx" line="581"/>
<source>%1 - %2</source>
<oldsource>Back to %1 - %2</oldsource>
<comment>statusbar actionBack_hovered %1=url %2=title</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="767"/>
<location filename="browser.hxx" line="770"/>
<source>Info: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="781"/>
<location filename="browser.hxx" line="784"/>
<source>done.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1036"/>
<location filename="browser.hxx" line="1039"/>
<source>%1</source>
<comment>statusbar for hovered link %1=url</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="468"/>
<location filename="browser.hxx" line="471"/>
<source>Forbidden: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="150"/>
<location filename="browser.hxx" line="151"/>
<source>SSL Not Supported</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="151"/>
<location filename="browser.hxx" line="152"/>
<source>SSL is not supported on your system</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="469"/>
<location filename="browser.hxx" line="472"/>
<source>Access Denied</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="470"/>
<location filename="browser.hxx" line="473"/>
<source>&lt;p&gt;Access denied due to security considerations.&lt;/p&gt;&lt;p&gt;You are not allowed to connect to %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="514"/>
<location filename="browser.hxx" line="517"/>
<source>opening new window</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="597"/>
<location filename="browser.hxx" line="600"/>
<source>%1 - %2</source>
<comment>statusbar actionForward_hovered %1=url %2=title</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="618"/>
<location filename="browser.hxx" line="646"/>
<location filename="browser.hxx" line="662"/>
<location filename="browser.hxx" line="621"/>
<location filename="browser.hxx" line="649"/>
<location filename="browser.hxx" line="665"/>
<source>background-color: white</source>
<comment>neutral find</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="670"/>
<location filename="browser.hxx" line="680"/>
<location filename="browser.hxx" line="673"/>
<location filename="browser.hxx" line="683"/>
<source>background-color: #ADA</source>
<oldsource>background-color: #7F7</oldsource>
<comment>text found</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="672"/>
<location filename="browser.hxx" line="682"/>
<location filename="browser.hxx" line="675"/>
<location filename="browser.hxx" line="685"/>
<source>background-color: #F77</source>
<oldsource>background-color: lightred</oldsource>
<comment>text not found</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="702"/>
<location filename="browser.hxx" line="705"/>
<source>About</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="703"/>
<location filename="browser.hxx" line="706"/>
<source>%8
Version: %1
Builddate: %2
@ -431,47 +431,42 @@ openssl-%7</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="762"/>
<location filename="browser.hxx" line="765"/>
<source>%1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1161"/>
<location filename="browser.hxx" line="1184"/>
<source>launching application ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1173"/>
<source>Save File As ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1235"/>
<location filename="browser.hxx" line="1250"/>
<source>errors</source>
<comment>show error log</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1252"/>
<location filename="browser.hxx" line="1255"/>
<location filename="browser.hxx" line="1267"/>
<location filename="browser.hxx" line="1270"/>
<source>background-color: #F77</source>
<comment>invalid url</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1262"/>
<location filename="browser.hxx" line="1265"/>
<location filename="browser.hxx" line="1277"/>
<location filename="browser.hxx" line="1280"/>
<source>background-color: white</source>
<comment>valid url</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1280"/>
<location filename="browser.hxx" line="1295"/>
<source>authentication required</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1292"/>
<location filename="browser.hxx" line="1307"/>
<source>ssl error</source>
<translation type="unfinished"></translation>
</message>
@ -493,11 +488,6 @@ openssl-%7</oldsource>
<source>Serial Number</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="certificate.hxx" line="39"/>
<source>Version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="certificate.hxx" line="64"/>
<source>Issuer Info</source>
@ -789,12 +779,12 @@ openssl-%7</oldsource>
<context>
<name>QMessageBox</name>
<message>
<location filename="smartcardauth.hxx" line="222"/>
<location filename="smartcardauth.hxx" line="225"/>
<source>Wrong PIN</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="smartcardauth.hxx" line="223"/>
<location filename="smartcardauth.hxx" line="226"/>
<source>Authentication failed, please try again.</source>
<translation type="unfinished"></translation>
</message>
@ -861,6 +851,88 @@ Try: %1 --help</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SaveOrRun</name>
<message>
<location filename="saveorrun.ui" line="14"/>
<source>File Downloaded</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="26"/>
<source>File:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="39"/>
<location filename="saveorrun.ui" line="68"/>
<location filename="saveorrun.ui" line="97"/>
<source>...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="55"/>
<source>Type:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="84"/>
<source>Source</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="107"/>
<source>open file with:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="130"/>
<location filename="saveorrun.ui" line="156"/>
<source>browse ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="137"/>
<source>save file as</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="100"/>
<source>Save File As ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="111"/>
<source>Open File With ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="81"/>
<source>File Exists</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="33"/>
<source>Dokumente</source>
<comment>Documents folder in local language</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="35"/>
<source>Arbeitsfläche</source>
<comment>Desktop folder in local language</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="82"/>
<source>File already exists:
%1
Overwrite?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Settings</name>
<message>

@ -294,101 +294,101 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="150"/>
<location filename="browser.hxx" line="151"/>
<source>SSL Not Supported</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="151"/>
<location filename="browser.hxx" line="152"/>
<source>SSL is not supported on your system</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="465"/>
<location filename="browser.hxx" line="468"/>
<source>Checking: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="468"/>
<location filename="browser.hxx" line="471"/>
<source>Forbidden: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="469"/>
<location filename="browser.hxx" line="472"/>
<source>Access Denied</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="470"/>
<location filename="browser.hxx" line="473"/>
<source>&lt;p&gt;Access denied due to security considerations.&lt;/p&gt;&lt;p&gt;You are not allowed to connect to %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="476"/>
<location filename="browser.hxx" line="479"/>
<source>Reading: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="478"/>
<location filename="browser.hxx" line="481"/>
<source>Illegal URL: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="497"/>
<location filename="browser.hxx" line="500"/>
<source>Zoom: %1%</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="514"/>
<location filename="browser.hxx" line="517"/>
<source>opening new window</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="557"/>
<location filename="browser.hxx" line="560"/>
<source>Print Document</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="578"/>
<location filename="browser.hxx" line="581"/>
<source>%1 - %2</source>
<comment>statusbar actionBack_hovered %1=url %2=title</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="597"/>
<location filename="browser.hxx" line="600"/>
<source>%1 - %2</source>
<comment>statusbar actionForward_hovered %1=url %2=title</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="618"/>
<location filename="browser.hxx" line="646"/>
<location filename="browser.hxx" line="662"/>
<location filename="browser.hxx" line="621"/>
<location filename="browser.hxx" line="649"/>
<location filename="browser.hxx" line="665"/>
<source>background-color: white</source>
<comment>neutral find</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="670"/>
<location filename="browser.hxx" line="680"/>
<location filename="browser.hxx" line="673"/>
<location filename="browser.hxx" line="683"/>
<source>background-color: #ADA</source>
<comment>text found</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="672"/>
<location filename="browser.hxx" line="682"/>
<location filename="browser.hxx" line="675"/>
<location filename="browser.hxx" line="685"/>
<source>background-color: #F77</source>
<comment>text not found</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="702"/>
<location filename="browser.hxx" line="705"/>
<source>About</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="703"/>
<location filename="browser.hxx" line="706"/>
<source>%8
Version: %1
Builddate: %2
@ -400,63 +400,58 @@ openssl-%7</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="762"/>
<location filename="browser.hxx" line="765"/>
<source>%1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="767"/>
<location filename="browser.hxx" line="770"/>
<source>Info: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="781"/>
<location filename="browser.hxx" line="784"/>
<source>done.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1036"/>
<location filename="browser.hxx" line="1039"/>
<source>%1</source>
<comment>statusbar for hovered link %1=url</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1161"/>
<location filename="browser.hxx" line="1184"/>
<source>launching application ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1173"/>
<source>Save File As ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1235"/>
<location filename="browser.hxx" line="1250"/>
<source>errors</source>
<comment>show error log</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1252"/>
<location filename="browser.hxx" line="1255"/>
<location filename="browser.hxx" line="1267"/>
<location filename="browser.hxx" line="1270"/>
<source>background-color: #F77</source>
<comment>invalid url</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1262"/>
<location filename="browser.hxx" line="1265"/>
<location filename="browser.hxx" line="1277"/>
<location filename="browser.hxx" line="1280"/>
<source>background-color: white</source>
<comment>valid url</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1280"/>
<location filename="browser.hxx" line="1295"/>
<source>authentication required</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="browser.hxx" line="1292"/>
<location filename="browser.hxx" line="1307"/>
<source>ssl error</source>
<translation type="unfinished"></translation>
</message>
@ -493,11 +488,6 @@ openssl-%7</source>
<source>Serial Number</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="certificate.hxx" line="39"/>
<source>Version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="certificate.hxx" line="43"/>
<source>Subject Info</source>
@ -769,12 +759,12 @@ openssl-%7</source>
<context>
<name>QMessageBox</name>
<message>
<location filename="smartcardauth.hxx" line="222"/>
<location filename="smartcardauth.hxx" line="225"/>
<source>Wrong PIN</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="smartcardauth.hxx" line="223"/>
<location filename="smartcardauth.hxx" line="226"/>
<source>Authentication failed, please try again.</source>
<translation type="unfinished"></translation>
</message>
@ -841,6 +831,88 @@ Try: %1 --help</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SaveOrRun</name>
<message>
<location filename="saveorrun.ui" line="14"/>
<source>File Downloaded</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="26"/>
<source>File:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="39"/>
<location filename="saveorrun.ui" line="68"/>
<location filename="saveorrun.ui" line="97"/>
<source>...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="55"/>
<source>Type:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="84"/>
<source>Source</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="107"/>
<source>open file with:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="130"/>
<location filename="saveorrun.ui" line="156"/>
<source>browse ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.ui" line="137"/>
<source>save file as</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="100"/>
<source>Save File As ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="111"/>
<source>Open File With ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="81"/>
<source>File Exists</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="33"/>
<source>Dokumente</source>
<comment>Documents folder in local language</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="35"/>
<source>Arbeitsfläche</source>
<comment>Desktop folder in local language</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="saveorrun.hxx" line="82"/>
<source>File already exists:
%1
Overwrite?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Settings</name>
<message>

@ -0,0 +1,66 @@
/*! @file
@id $Id$
*/
// 1 2 3 4 5 6 7 8
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
#ifndef __TEMPORARYFILE_HXX__
#define __TEMPORARYFILE_HXX__
#include <QtCore/QTemporaryFile>
#include <QtCore/QRegExp>
#include <QtCore/QDebug>
class TemporaryFile: public QFile {
Q_OBJECT;
public:
TemporaryFile(QString filename): _autoRemove(false) {
if (exists(filename)) {
QString prefix(filename);
QString suffix(filename);
prefix.remove(QRegExp("\\.[^.]*$"));
suffix.remove(QRegExp("^.*\\."));
qDebug()<<"filename"<<filename
<<"prefix"<<prefix
<<"suffix"<<suffix;
if (prefix==suffix) suffix.clear();
for (unsigned long i(0); i<10000; ++i)
if (!exists(filename =
QString("%1_%2.%3")
.arg(prefix)
.arg(i, 4, 10, QChar('0'))
.arg(suffix))) break;
}
qDebug()<<"filename"<<filename;
setFileName(filename);
}
bool open() {
return QFile::open(QIODevice::ReadWrite);
}
void setAutoRemove(bool flag) {
_autoRemove = flag;
}
~TemporaryFile() {
qDebug()<<"_autoRemove"<<_autoRemove
<<"exists()"<<exists();
if (_autoRemove && exists()) {
qDebug()<<"Remove: "<<fileName();
remove();
} else {
qDebug()<<"Don't remove: "<<fileName();
}
}
private:
bool _autoRemove;
};
#endif
Loading…
Cancel
Save