Better Mac integration

This commit is contained in:
Christophe Dumez
2010-06-08 15:23:11 +00:00
parent 56e45a11a8
commit 323fd791c5
3 changed files with 81 additions and 54 deletions

View File

@@ -65,6 +65,9 @@
#include "transferlistfilterswidget.h"
#include "propertieswidget.h"
#include "statusbar.h"
#ifdef Q_WS_MAC
#include "qmacapplication.h"
#endif
#ifdef Q_WS_WIN
#include <windows.h>
@@ -129,6 +132,9 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
connect(BTSession, SIGNAL(downloadFromUrlFailure(QString, QString)), this, SLOT(handleDownloadFromUrlFailure(QString, QString)));
connect(BTSession, SIGNAL(alternativeSpeedsModeChanged(bool)), this, SLOT(updateAltSpeedsBtn(bool)));
connect(BTSession, SIGNAL(recursiveTorrentDownloadPossible(QTorrentHandle&)), this, SLOT(askRecursiveTorrentDownloadConfirmation(QTorrentHandle&)));
#ifdef Q_WS_MAC
connect(static_cast<QMacApplication*>(qApp), SIGNAL(newFileOpenMacEvent(QStringList)), this, SLOT(processParams(QStringList)));
#endif
qDebug("create tabWidget");
tabs = new QTabWidget();

View File

@@ -39,6 +39,9 @@
#include <QStyle>
#include <QSplashScreen>
#include <QPushButton>
#ifdef Q_WS_MAC
#include "qmacapplication.h"
#endif
#include "GUI.h"
#include "ico.h"
#else
@@ -70,7 +73,11 @@ const int UNLEN = 256;
#ifdef DISABLE_GUI
QCoreApplication *app;
#else
#ifndef Q_WS_MAC
QApplication *app;
#else
QMacApplication *app;
#endif
#endif
class UsageDisplay: public QObject {
@@ -170,11 +177,15 @@ void useStyle(QApplication *app, QString style){
// Main
int main(int argc, char *argv[]){
// Create Application
#ifdef DISABLE_GUI
#ifdef DISABLE_GUI
app = new QCoreApplication(argc, argv);
#else
#else
#ifndef Q_WS_MAC
app = new QApplication(argc, argv);
#endif
#else
app = new QMacApplication(argc, argv);
#endif
#endif
QString locale;
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
@@ -353,6 +364,6 @@ int main(int argc, char *argv[]){
#endif
qDebug("App was deleted! All good.");
return ret;
}
}

View File

@@ -270,8 +270,10 @@ HEADERS += misc.h \
bandwidthscheduler.h \
scannedfoldersmodel.h
contains(DEFINES, DISABLE_GUI):HEADERS += headlessloader.h
else:HEADERS += GUI.h \
contains(DEFINES, DISABLE_GUI) {
HEADERS += headlessloader.h
} else {
HEADERS += GUI.h \
feedList.h \
supportedengines.h \
transferlistwidget.h \
@@ -311,6 +313,10 @@ else:HEADERS += GUI.h \
trackerlogin.h \
pieceavailabilitybar.h \
advancedsettings.h
macx {
HEADERS += qmacapplication.h
}
}
!contains(DEFINES, DISABLE_GUI):FORMS += ui/mainwindow.ui \
ui/options.ui \
@@ -344,7 +350,8 @@ SOURCES += main.cpp \
scannedfoldersmodel.cpp \
misc.cpp
!contains(DEFINES, DISABLE_GUI):SOURCES += GUI.cpp \
!contains(DEFINES, DISABLE_GUI) {
SOURCES += GUI.cpp \
options_imp.cpp \
createtorrent_imp.cpp \
searchengine.cpp \
@@ -357,5 +364,8 @@ SOURCES += main.cpp \
propertieswidget.cpp \
peerlistwidget.cpp \
trackerlist.cpp
macx {
HEADERS += qmacapplication.cpp
}
}
DESTDIR = .