1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

Updated code BUILDING informations to support building for OS/2

This commit is contained in:
nowrep 2011-10-07 15:37:49 +02:00
parent d91f20d277
commit 3c8b08957a
13 changed files with 92 additions and 31 deletions

View File

@ -30,6 +30,19 @@
There is no extra dependency, you only need Qt tools. There is no extra dependency, you only need Qt tools.
>> OS/2 <<
>> <<
I cannot provide support for QupZilla on OS/2 as I don't have access to
machine with OS/2, but it is possible to get QupZilla working there.
There may be some more things to do, but as far as I know, you need to
add Q_WS_WIN define to qmake.
You will do this by adding one line
DEFINES += Q_WS_WIN
to QupZilla.pro file.
####################### #######################
## Available Defines ## ## Available Defines ##
####################### #######################

View File

@ -24,7 +24,6 @@ win32:DEFINES += W7API
win32:RC_FILE = appicon.rc win32:RC_FILE = appicon.rc
win32:LIBS += User32.lib Ole32.lib Shell32.lib ShlWapi.lib Gdi32.lib ComCtl32.lib win32:LIBS += User32.lib Ole32.lib Shell32.lib ShlWapi.lib Gdi32.lib ComCtl32.lib
TRANSLATIONS +=cs_CZ.ts\ TRANSLATIONS +=cs_CZ.ts\
sk_SK.ts sk_SK.ts

View File

@ -58,7 +58,6 @@
#include "pagescreen.h" #include "pagescreen.h"
const QString QupZilla::VERSION = "1.0.0-rc1"; const QString QupZilla::VERSION = "1.0.0-rc1";
//const QString QupZilla::BUILDTIME = QLocale(QLocale::English).toDateTime(__DATE__" "__TIME__, "MMM d yyyy hh:mm:ss").toString("MM/dd/yyyy hh:ss");
const QString QupZilla::BUILDTIME = __DATE__" "__TIME__; const QString QupZilla::BUILDTIME = __DATE__" "__TIME__;
const QString QupZilla::AUTHOR = "nowrep"; const QString QupZilla::AUTHOR = "nowrep";
const QString QupZilla::COPYRIGHT = "2010-2011"; const QString QupZilla::COPYRIGHT = "2010-2011";
@ -66,7 +65,7 @@ const QString QupZilla::WWWADDRESS = "http://qupzilla.ic.cz";
const QString QupZilla::WIKIADDRESS = "https://github.com/nowrep/QupZilla/wiki"; const QString QupZilla::WIKIADDRESS = "https://github.com/nowrep/QupZilla/wiki";
const QString QupZilla::WEBKITVERSION = qWebKitVersion(); const QString QupZilla::WEBKITVERSION = qWebKitVersion();
QIcon QupZilla::qupzillaIcon() const QIcon QupZilla::qupzillaIcon()
{ {
QIcon i; QIcon i;
i.addFile(":icons/exeicons/qupzilla16.png"); i.addFile(":icons/exeicons/qupzilla16.png");

View File

@ -75,7 +75,8 @@ public:
static const QString WWWADDRESS; static const QString WWWADDRESS;
static const QString WIKIADDRESS; static const QString WIKIADDRESS;
static const QString WEBKITVERSION; static const QString WEBKITVERSION;
static QIcon qupzillaIcon();
static const QIcon qupzillaIcon();
explicit QupZilla(bool m_tryRestore=true, QUrl startUrl=QUrl()); explicit QupZilla(bool m_tryRestore=true, QUrl startUrl=QUrl());
~QupZilla(); ~QupZilla();

View File

@ -32,6 +32,7 @@ DownloadFileHelper::DownloadFileHelper(const QString &lastDownloadPath, const QS
, m_reply(0) , m_reply(0)
, m_openFileChoosed(false) , m_openFileChoosed(false)
, m_iconProvider(new QFileIconProvider) , m_iconProvider(new QFileIconProvider)
, m_manager(0)
{ {
} }
@ -156,7 +157,7 @@ void DownloadFileHelper::fileNameChoosed(const QString &name, bool fileNameAutoG
settings.endGroup(); settings.endGroup();
QListWidgetItem* item = new QListWidgetItem(m_listWidget); QListWidgetItem* item = new QListWidgetItem(m_listWidget);
DownloadItem* downItem = new DownloadItem(item, m_reply, m_path, m_fileName, m_fileIcon, m_timer, m_openFileChoosed, m_downloadPage); DownloadItem* downItem = new DownloadItem(item, m_reply, m_path, m_fileName, m_fileIcon, m_timer, m_openFileChoosed, m_downloadPage, m_manager);
emit itemCreated(item, downItem); emit itemCreated(item, downItem);
} }

View File

@ -29,6 +29,7 @@
#include <QFileDialog> #include <QFileDialog>
class DownloadItem; class DownloadItem;
class DownloadManager;
class DownloadFileHelper : public QObject class DownloadFileHelper : public QObject
{ {
Q_OBJECT Q_OBJECT
@ -37,6 +38,7 @@ public:
~DownloadFileHelper(); ~DownloadFileHelper();
void setListWidget(QListWidget* tw) { m_listWidget = tw; } void setListWidget(QListWidget* tw) { m_listWidget = tw; }
void setDownloadManager(DownloadManager* m) { m_manager = m; }
void handleUnsupportedContent(QNetworkReply* reply, bool askWhatToDo); void handleUnsupportedContent(QNetworkReply* reply, bool askWhatToDo);
signals: signals:
@ -65,7 +67,7 @@ private:
QListWidget* m_listWidget; QListWidget* m_listWidget;
QFileIconProvider* m_iconProvider; QFileIconProvider* m_iconProvider;
DownloadManager* m_manager;
}; };
#endif // DOWNLOADFILEHELPER_H #endif // DOWNLOADFILEHELPER_H

View File

@ -26,7 +26,7 @@
//#define DOWNMANAGER_DEBUG //#define DOWNMANAGER_DEBUG
DownloadItem::DownloadItem(QListWidgetItem* item, QNetworkReply* reply, const QString &path, const QString &fileName, const QPixmap &fileIcon, QTime* timer, bool openAfterFinishedDownload, const QUrl &downloadPage) DownloadItem::DownloadItem(QListWidgetItem* item, QNetworkReply* reply, const QString &path, const QString &fileName, const QPixmap &fileIcon, QTime* timer, bool openAfterFinishedDownload, const QUrl &downloadPage, DownloadManager* manager)
: QWidget() : QWidget()
, ui(new Ui::DownloadItem) , ui(new Ui::DownloadItem)
, m_item(item) , m_item(item)
@ -66,7 +66,7 @@ DownloadItem::DownloadItem(QListWidgetItem* item, QNetworkReply* reply, const QS
connect(m_reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(error(QNetworkReply::NetworkError))); connect(m_reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(error(QNetworkReply::NetworkError)));
connect(m_reply, SIGNAL(metaDataChanged()), this, SLOT(metaDataChanged())); connect(m_reply, SIGNAL(metaDataChanged()), this, SLOT(metaDataChanged()));
connect(ui->button, SIGNAL(clicked(QPoint)), this, SLOT(stop())); connect(ui->button, SIGNAL(clicked(QPoint)), this, SLOT(stop()));
connect((DownloadManager*)parentWidget(), SIGNAL(resized(QSize)), this, SLOT(parentResized(QSize))); connect(manager, SIGNAL(resized(QSize)), this, SLOT(parentResized(QSize)));
m_downloading = true; m_downloading = true;
m_timer.start(1000*1, this); m_timer.start(1000*1, this);

View File

@ -37,12 +37,13 @@ namespace Ui {
class DownloadItem; class DownloadItem;
} }
class DownloadManager;
class DownloadItem : public QWidget class DownloadItem : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit DownloadItem(QListWidgetItem* item, QNetworkReply* reply, const QString &path, const QString &fileName, const QPixmap &fileIcon, QTime* timer, bool openAfterFinishedDownload, const QUrl &downloadPage); explicit DownloadItem(QListWidgetItem* item, QNetworkReply* reply, const QString &path, const QString &fileName, const QPixmap &fileIcon, QTime* timer, bool openAfterFinishedDownload, const QUrl &downloadPage, DownloadManager* manager);
bool isDownloading() { return m_downloading; } bool isDownloading() { return m_downloading; }
bool isCancelled(); bool isCancelled();
QTime remainingTime() { return m_remTime; } QTime remainingTime() { return m_remTime; }

View File

@ -157,6 +157,7 @@ void DownloadManager::download(const QNetworkRequest &request, bool askWhatToDo)
void DownloadManager::handleUnsupportedContent(QNetworkReply* reply, bool askWhatToDo) void DownloadManager::handleUnsupportedContent(QNetworkReply* reply, bool askWhatToDo)
{ {
DownloadFileHelper* h = new DownloadFileHelper(m_lastDownloadPath, m_downloadPath, m_useNativeDialog); DownloadFileHelper* h = new DownloadFileHelper(m_lastDownloadPath, m_downloadPath, m_useNativeDialog);
h->setDownloadManager(this);
h->setListWidget(ui->list); h->setListWidget(ui->list);
h->handleUnsupportedContent(reply, askWhatToDo); h->handleUnsupportedContent(reply, askWhatToDo);
@ -165,7 +166,6 @@ void DownloadManager::handleUnsupportedContent(QNetworkReply* reply, bool askWha
void DownloadManager::itemCreated(QListWidgetItem *item, DownloadItem *downItem) void DownloadManager::itemCreated(QListWidgetItem *item, DownloadItem *downItem)
{ {
downItem->setParent(this);
connect(downItem, SIGNAL(deleteItem(DownloadItem*)), this, SLOT(deleteItem(DownloadItem*))); connect(downItem, SIGNAL(deleteItem(DownloadItem*)), this, SLOT(deleteItem(DownloadItem*)));
connect(downItem, SIGNAL(downloadFinished(bool)), this, SLOT(downloadFinished(bool))); connect(downItem, SIGNAL(downloadFinished(bool)), this, SLOT(downloadFinished(bool)));

View File

@ -154,19 +154,11 @@ QString QupZillaSchemeReply::aboutPage()
page.replace("%PATHS%", tr("Paths")); page.replace("%PATHS%", tr("Paths"));
page.replace("%COPYRIGHT%", tr("Copyright")); page.replace("%COPYRIGHT%", tr("Copyright"));
QString platform;
#ifdef Q_WS_X11
platform = tr("Linux");
#endif
#ifdef Q_WS_WIN
platform = tr("Windows");
#endif
page.replace("%VERSION-INFO%", page.replace("%VERSION-INFO%",
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Version"), QupZilla::VERSION) + QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Version"), QupZilla::VERSION) +
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("WebKit version"), QupZilla::WEBKITVERSION) + QString("<dt>%1</dt><dd>%2<dd>").arg(tr("WebKit version"), QupZilla::WEBKITVERSION) +
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Build time"), QupZilla::BUILDTIME) + QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Build time"), QupZilla::BUILDTIME) +
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Platform"), platform) QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Platform"), qz_buildSystem()));
);
page.replace("%USER-AGENT%", mApp->getWindow()->weView()->webPage()->userAgentForUrl(QUrl())); page.replace("%USER-AGENT%", mApp->getWindow()->weView()->webPage()->userAgentForUrl(QUrl()));
page.replace("%PATHS-TEXT%", page.replace("%PATHS-TEXT%",
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Settings"), mApp->getActiveProfilPath() + "settings.ini") + QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Settings"), mApp->getActiveProfilPath() + "settings.ini") +
@ -174,8 +166,6 @@ QString QupZillaSchemeReply::aboutPage()
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Pinned tabs"), mApp->getActiveProfilPath() + "pinnedtabs.dat") + QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Pinned tabs"), mApp->getActiveProfilPath() + "pinnedtabs.dat") +
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Themes"), mApp->THEMESDIR) + QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Themes"), mApp->THEMESDIR) +
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Plugins"), mApp->PLUGINSDIR) + QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Plugins"), mApp->PLUGINSDIR) +
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Translations"), mApp->TRANSLATIONSDIR) QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Translations"), mApp->TRANSLATIONSDIR));
);
return page; return page;
} }

View File

@ -46,8 +46,10 @@ void PageScreen::buttonClicked(QAbstractButton* b)
case QDialogButtonBox::Save: case QDialogButtonBox::Save:
path = QFileDialog::getSaveFileName(this, tr("Save Page Screen..."), tr("screen.png")); path = QFileDialog::getSaveFileName(this, tr("Save Page Screen..."), tr("screen.png"));
if (!path.isEmpty()) if (!path.isEmpty()) {
m_pagePixmap.save(path); m_pagePixmap.save(path);
close();
}
break; break;
default: default:

View File

@ -44,3 +44,55 @@ void qz_centerWidgetOnScreen(QWidget *w)
const QRect &size = w->geometry(); const QRect &size = w->geometry();
w->move( (screen.width()-size.width())/2, (screen.height()-size.height())/2 ); w->move( (screen.width()-size.width())/2, (screen.height()-size.height())/2 );
} }
QString qz_buildSystem()
{
#ifdef Q_OS_LINUX
return "Linux";
#endif
#ifdef Q_OS_UNIX
return "Unix";
#endif
#ifdef Q_OS_BSD4
return "BSD 4.4";
#endif
#ifdef Q_OS_BSDI
return "BSD/OS";
#endif
#ifdef Q_OS_FREEBSD
return "FreeBSD";
#endif
#ifdef Q_OS_HPUX
return "HP-UX";
#endif
#ifdef Q_OS_HURD
return "GNU Hurd";
#endif
#ifdef Q_OS_LYNX
return "LynxOS";
#endif
#ifdef Q_OS_MAC
return "MAC OS";
#endif
#ifdef Q_OS_NETBSD
return "NetBSD";
#endif
#ifdef Q_OS_OS2
return "OS/2";
#endif
#ifdef Q_OS_OPENBSD
return "OpenBSD";
#endif
#ifdef Q_OS_OSF
return "HP Tru64 UNIX";
#endif
#ifdef Q_OS_SOLARIS
return "Sun Solaris";
#endif
#ifdef Q_OS_UNIXWARE
return "UnixWare 7 / Open UNIX 8";
#endif
#ifdef Q_OS_WIN32
return "Windows";
#endif
}

View File

@ -30,5 +30,6 @@ QByteArray qz_pixmapToByteArray(const QPixmap &pix);
QByteArray qz_readAllFileContents(const QString &filename); QByteArray qz_readAllFileContents(const QString &filename);
void qz_centerWidgetOnScreen(QWidget* w); void qz_centerWidgetOnScreen(QWidget* w);
QString qz_buildSystem();
#endif // GLOBALFUNCTIONS_H #endif // GLOBALFUNCTIONS_H