diff --git a/swisssurfer/src/browser.hxx b/swisssurfer/src/browser.hxx index cdf9983..89bb292 100644 --- a/swisssurfer/src/browser.hxx +++ b/swisssurfer/src/browser.hxx @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -40,6 +39,8 @@ #include #include #include +#include +#include #include #include @@ -155,12 +156,14 @@ class Browser: public QMainWindow, protected Ui::Browser { LOG; for (DownloadProcesses::iterator it(_downloadProcesses.begin()); it!=_downloadProcesses.end(); ++it) { - LOG<<"delete:"<second->fileName(); + LOG<<"cleanup:"<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:"<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:"<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:"<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:"<start(prg, args); + } + void processFinished() { LOG; - _downloadProcesses[qobject_cast(sender())]->setAutoRemove - (_settings.flag("CloseApps")); + if (_downloadProcesses.find(qobject_cast(sender())) + == _downloadProcesses.end()) return; + if (_downloadProcesses[qobject_cast(sender())]) + _downloadProcesses[qobject_cast(sender())] + ->setAutoRemove(true); delete _downloadProcesses[qobject_cast(sender())]; _downloadProcesses.erase(qobject_cast(sender())); } @@ -1405,7 +1420,7 @@ class Browser: public QMainWindow, protected Ui::Browser { QPrinter _printer; SslClientAuthNetworkAccessManager _networkManager; DownloadManager _downloadManager; - typedef std::map DownloadProcesses; + typedef std::map DownloadProcesses; DownloadProcesses _downloadProcesses; Settings _settings; ErrorLog _errorLog; diff --git a/swisssurfer/src/certificate.hxx b/swisssurfer/src/certificate.hxx index 5666e2c..dce0c1b 100644 --- a/swisssurfer/src/certificate.hxx +++ b/swisssurfer/src/certificate.hxx @@ -34,10 +34,10 @@ class Certificate: public QWidget, protected Ui::Certificate { ((new QTreeWidgetItem (QStringList()<addTopLevelItem - ((new QTreeWidgetItem - (QStringList()<addTopLevelItem + // ((new QTreeWidgetItem + // (QStringList()<addTopLevelItem ((it = new QTreeWidgetItem(QStringList()< +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +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 textRects; +}; + + +#endif diff --git a/swisssurfer/src/pluginfactory.hxx b/swisssurfer/src/pluginfactory.hxx new file mode 100644 index 0000000..be54792 --- /dev/null +++ b/swisssurfer/src/pluginfactory.hxx @@ -0,0 +1,122 @@ +/*! @file + + @id $Id$ +*/ +// 1 2 3 4 5 6 7 8 +// 45678901234567890123456789012345678901234567890123456789012345678901234567890 + +#ifndef __PLUGINFACTORY_HXX__ +#define __PLUGINFACTORY_HXX__ + +#include +#include +#include + +#include +#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<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 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 plugins() const { + LOG; + return _plugins; + } + virtual void refreshPlugins() { + LOG; + } + private: + QList _plugins; +}; + +#endif diff --git a/swisssurfer/src/qmake.pro.in b/swisssurfer/src/qmake.pro.in index f024327..1b30fe7 100644 --- a/swisssurfer/src/qmake.pro.in +++ b/swisssurfer/src/qmake.pro.in @@ -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 diff --git a/swisssurfer/src/saveorrun.hxx b/swisssurfer/src/saveorrun.hxx new file mode 100644 index 0000000..6cdb98e --- /dev/null +++ b/swisssurfer/src/saveorrun.hxx @@ -0,0 +1,121 @@ +/*! @file + + @id $Id$ +*/ +// 1 2 3 4 5 6 7 8 +// 45678901234567890123456789012345678901234567890123456789012345678901234567890 + +#ifndef __SAVEORRUN_HXX__ +#define __SAVEORRUN_HXX__ + +#include + +#include +#include +#include +#include +#include + +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" + <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 diff --git a/swisssurfer/src/saveorrun.ui b/swisssurfer/src/saveorrun.ui new file mode 100644 index 0000000..bf2e58a --- /dev/null +++ b/swisssurfer/src/saveorrun.ui @@ -0,0 +1,284 @@ + + + SaveOrRun + + + + 0 + 0 + 583 + 161 + + + + File Downloaded + + + + + + + 75 + true + + + + File: + + + + + + + + 0 + 0 + + + + ... + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + 75 + true + + + + Type: + + + + + + + + 0 + 0 + + + + ... + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + 75 + true + + + + Source + + + + + + + + 0 + 0 + + + + ... + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + open file with: + + + + + + + false + + + + + + + false + + + + 0 + 0 + + + + browse ... + + + + + + + save file as + + + true + + + + + + + + + + + 0 + 0 + + + + browse ... + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + buttonBox + accepted() + SaveOrRun + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + SaveOrRun + reject() + + + 316 + 260 + + + 286 + 274 + + + + + _openWith + toggled(bool) + _program + setEnabled(bool) + + + 105 + 170 + + + 232 + 172 + + + + + _saveAs + toggled(bool) + _filename + setEnabled(bool) + + + 92 + 463 + + + 220 + 463 + + + + + _openWith + toggled(bool) + _browseOpenWith + setEnabled(bool) + + + 82 + 79 + + + 531 + 79 + + + + + _saveAs + toggled(bool) + _browseSaveAs + setEnabled(bool) + + + 82 + 109 + + + 531 + 109 + + + + + diff --git a/swisssurfer/src/smartcardauth.hxx b/swisssurfer/src/smartcardauth.hxx index 9a4e2bd..a3cd178 100644 --- a/swisssurfer/src/smartcardauth.hxx +++ b/swisssurfer/src/smartcardauth.hxx @@ -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 authcerts; QList 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: diff --git a/swisssurfer/src/swisssurfer_de.ts b/swisssurfer/src/swisssurfer_de.ts index ef9b59d..5314360 100644 --- a/swisssurfer/src/swisssurfer_de.ts +++ b/swisssurfer/src/swisssurfer_de.ts @@ -296,122 +296,122 @@ - + Checking: %1 Opening: %1 - + Reading: %1 Reading: %1% - + Zoom: %1% - + Illegal URL: %1 - + Print Document - + %1 - %2 Back to %1 - %2 statusbar actionBack_hovered %1=url %2=title - + Info: %1 - + done. - + %1 statusbar for hovered link %1=url - + Forbidden: %1 - + SSL Not Supported - + SSL is not supported on your system - + Access Denied - + <p>Access denied due to security considerations.</p><p>You are not allowed to connect to %1. - + opening new window - + %1 - %2 statusbar actionForward_hovered %1=url %2=title - - - + + + background-color: white neutral find - - + + background-color: #ADA background-color: #7F7 text found - - + + background-color: #F77 background-color: lightred text not found - + About - + %8 Version: %1 Builddate: %2 @@ -431,47 +431,42 @@ openssl-%7 - + %1 - + launching application ... - - Save File As ... - - - - + errors show error log - - + + background-color: #F77 invalid url - - + + background-color: white valid url - + authentication required - + ssl error @@ -493,11 +488,6 @@ openssl-%7 Serial Number - - - Version - - Issuer Info @@ -789,12 +779,12 @@ openssl-%7 QMessageBox - + Wrong PIN - + Authentication failed, please try again. @@ -861,6 +851,88 @@ Try: %1 --help + + SaveOrRun + + + File Downloaded + + + + + File: + + + + + + + ... + + + + + Type: + + + + + Source + + + + + open file with: + + + + + + browse ... + + + + + save file as + + + + + Save File As ... + + + + + Open File With ... + + + + + File Exists + + + + + Dokumente + Documents folder in local language + + + + + Arbeitsfläche + Desktop folder in local language + + + + + File already exists: + +%1 + +Overwrite? + + + Settings diff --git a/swisssurfer/src/swisssurfer_en.ts b/swisssurfer/src/swisssurfer_en.ts index a5c08f5..8684d67 100644 --- a/swisssurfer/src/swisssurfer_en.ts +++ b/swisssurfer/src/swisssurfer_en.ts @@ -294,103 +294,103 @@ - + Checking: %1 - + SSL Not Supported - + SSL is not supported on your system - + Forbidden: %1 - + Access Denied - + <p>Access denied due to security considerations.</p><p>You are not allowed to connect to %1. - + Reading: %1 - + Illegal URL: %1 - + Zoom: %1% - + opening new window - + Print Document - + %1 - %2 statusbar actionBack_hovered %1=url %2=title - + %1 - %2 statusbar actionForward_hovered %1=url %2=title - - - + + + background-color: white neutral find - - + + background-color: #ADA background-color: #7F7 text found - - + + background-color: #F77 background-color: lightred text not found - + About - + %8 Version: %1 Builddate: %2 @@ -410,63 +410,58 @@ openssl-%7 - + %1 - + Info: %1 - + done. - + %1 statusbar for hovered link %1=url - + launching application ... - - Save File As ... - - - - + errors show error log - - + + background-color: #F77 invalid url - - + + background-color: white valid url - + authentication required - + ssl error @@ -488,11 +483,6 @@ openssl-%7 Serial Number - - - Version - - Issuer Info @@ -779,12 +769,12 @@ openssl-%7 QMessageBox - + Wrong PIN - + Authentication failed, please try again. @@ -851,6 +841,88 @@ Try: %1 --help + + SaveOrRun + + + File Downloaded + + + + + File: + + + + + + + ... + + + + + Type: + + + + + Source + + + + + open file with: + + + + + + browse ... + + + + + save file as + + + + + Save File As ... + + + + + Open File With ... + + + + + File Exists + + + + + Dokumente + Documents folder in local language + + + + + Arbeitsfläche + Desktop folder in local language + + + + + File already exists: + +%1 + +Overwrite? + + + Settings diff --git a/swisssurfer/src/swisssurfer_fr.ts b/swisssurfer/src/swisssurfer_fr.ts index ef9b59d..5314360 100644 --- a/swisssurfer/src/swisssurfer_fr.ts +++ b/swisssurfer/src/swisssurfer_fr.ts @@ -296,122 +296,122 @@ - + Checking: %1 Opening: %1 - + Reading: %1 Reading: %1% - + Zoom: %1% - + Illegal URL: %1 - + Print Document - + %1 - %2 Back to %1 - %2 statusbar actionBack_hovered %1=url %2=title - + Info: %1 - + done. - + %1 statusbar for hovered link %1=url - + Forbidden: %1 - + SSL Not Supported - + SSL is not supported on your system - + Access Denied - + <p>Access denied due to security considerations.</p><p>You are not allowed to connect to %1. - + opening new window - + %1 - %2 statusbar actionForward_hovered %1=url %2=title - - - + + + background-color: white neutral find - - + + background-color: #ADA background-color: #7F7 text found - - + + background-color: #F77 background-color: lightred text not found - + About - + %8 Version: %1 Builddate: %2 @@ -431,47 +431,42 @@ openssl-%7 - + %1 - + launching application ... - - Save File As ... - - - - + errors show error log - - + + background-color: #F77 invalid url - - + + background-color: white valid url - + authentication required - + ssl error @@ -493,11 +488,6 @@ openssl-%7 Serial Number - - - Version - - Issuer Info @@ -789,12 +779,12 @@ openssl-%7 QMessageBox - + Wrong PIN - + Authentication failed, please try again. @@ -861,6 +851,88 @@ Try: %1 --help + + SaveOrRun + + + File Downloaded + + + + + File: + + + + + + + ... + + + + + Type: + + + + + Source + + + + + open file with: + + + + + + browse ... + + + + + save file as + + + + + Save File As ... + + + + + Open File With ... + + + + + File Exists + + + + + Dokumente + Documents folder in local language + + + + + Arbeitsfläche + Desktop folder in local language + + + + + File already exists: + +%1 + +Overwrite? + + + Settings diff --git a/swisssurfer/src/swisssurfer_it.ts b/swisssurfer/src/swisssurfer_it.ts index 72701dd..51e5bed 100644 --- a/swisssurfer/src/swisssurfer_it.ts +++ b/swisssurfer/src/swisssurfer_it.ts @@ -294,101 +294,101 @@ - + SSL Not Supported - + SSL is not supported on your system - + Checking: %1 - + Forbidden: %1 - + Access Denied - + <p>Access denied due to security considerations.</p><p>You are not allowed to connect to %1. - + Reading: %1 - + Illegal URL: %1 - + Zoom: %1% - + opening new window - + Print Document - + %1 - %2 statusbar actionBack_hovered %1=url %2=title - + %1 - %2 statusbar actionForward_hovered %1=url %2=title - - - + + + background-color: white neutral find - - + + background-color: #ADA text found - - + + background-color: #F77 text not found - + About - + %8 Version: %1 Builddate: %2 @@ -400,63 +400,58 @@ openssl-%7 - + %1 - + Info: %1 - + done. - + %1 statusbar for hovered link %1=url - + launching application ... - - Save File As ... - - - - + errors show error log - - + + background-color: #F77 invalid url - - + + background-color: white valid url - + authentication required - + ssl error @@ -493,11 +488,6 @@ openssl-%7 Serial Number - - - Version - - Subject Info @@ -769,12 +759,12 @@ openssl-%7 QMessageBox - + Wrong PIN - + Authentication failed, please try again. @@ -841,6 +831,88 @@ Try: %1 --help + + SaveOrRun + + + File Downloaded + + + + + File: + + + + + + + ... + + + + + Type: + + + + + Source + + + + + open file with: + + + + + + browse ... + + + + + save file as + + + + + Save File As ... + + + + + Open File With ... + + + + + File Exists + + + + + Dokumente + Documents folder in local language + + + + + Arbeitsfläche + Desktop folder in local language + + + + + File already exists: + +%1 + +Overwrite? + + + Settings diff --git a/swisssurfer/src/temporaryfile.hxx b/swisssurfer/src/temporaryfile.hxx new file mode 100644 index 0000000..959b56b --- /dev/null +++ b/swisssurfer/src/temporaryfile.hxx @@ -0,0 +1,66 @@ +/*! @file + + @id $Id$ +*/ +// 1 2 3 4 5 6 7 8 +// 45678901234567890123456789012345678901234567890123456789012345678901234567890 + +#ifndef __TEMPORARYFILE_HXX__ +#define __TEMPORARYFILE_HXX__ + +#include +#include + +#include + +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"<