mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 08:08:42 +00:00
Compare commits
10 Commits
f6d4f6a6cb
...
release_3.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d800d8b9fd | ||
|
|
b08dee941f | ||
|
|
537da048a5 | ||
|
|
72226ef3c3 | ||
|
|
d20c4e1f29 | ||
|
|
9b8dbc1d6f | ||
|
|
7d64068fe2 | ||
|
|
3d496d2b28 | ||
|
|
73cc723049 | ||
|
|
ad3346df35 |
@@ -21,7 +21,6 @@
|
||||
#include "DiaryWindow.h"
|
||||
#include "DiarySidebar.h"
|
||||
#include "Context.h"
|
||||
#include "QtMacButton.h"
|
||||
|
||||
#include <QFontMetrics>
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "DiaryWindow.h"
|
||||
#include "DiarySidebar.h"
|
||||
#include "Context.h"
|
||||
#include "QtMacButton.h"
|
||||
|
||||
GcOverlayWidget::GcOverlayWidget(Context *context, QWidget *parent) : QWidget(parent), context(context)
|
||||
{
|
||||
|
||||
@@ -35,11 +35,6 @@
|
||||
|
||||
|
||||
class Context;
|
||||
#ifdef Q_OS_MAC
|
||||
class QtMacButton;
|
||||
#else
|
||||
class GcScopeButton;
|
||||
#endif
|
||||
class GcLabel;
|
||||
|
||||
class GcOverlayWidgetItem
|
||||
|
||||
@@ -38,10 +38,6 @@
|
||||
#include "Context.h"
|
||||
#include "RideItem.h"
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#include "QtMacSegmentedButton.h"
|
||||
#endif
|
||||
|
||||
class ChartBar;
|
||||
class LTMSettings;
|
||||
|
||||
|
||||
@@ -286,8 +286,9 @@ OAuthDialog::urlChanged(const QUrl &url)
|
||||
QNetworkRequest request = QNetworkRequest(url);
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader,"application/x-www-form-urlencoded");
|
||||
|
||||
// now get the final token
|
||||
// now get the final token - but ignore errors
|
||||
manager = new QNetworkAccessManager(this);
|
||||
connect(manager, SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError> & )), this, SLOT(onSslErrors(QNetworkReply*, const QList<QSslError> & )));
|
||||
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkRequestFinished(QNetworkReply*)));
|
||||
manager->post(request, data);
|
||||
|
||||
@@ -295,6 +296,13 @@ OAuthDialog::urlChanged(const QUrl &url)
|
||||
}
|
||||
}
|
||||
|
||||
// just ignore handshake errors
|
||||
void
|
||||
OAuthDialog::onSslErrors(QNetworkReply *reply, const QList<QSslError>&)
|
||||
{
|
||||
reply->ignoreSslErrors();
|
||||
}
|
||||
|
||||
void
|
||||
OAuthDialog::loadFinished(bool ok) {
|
||||
|
||||
@@ -346,10 +354,10 @@ OAuthDialog::loadFinished(bool ok) {
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader,
|
||||
"application/x-www-form-urlencoded");
|
||||
|
||||
// not get the final token
|
||||
// not get the final token - ignoring errors
|
||||
manager = new QNetworkAccessManager(this);
|
||||
connect(manager, SIGNAL(finished(QNetworkReply*)), this,
|
||||
SLOT(networkRequestFinished(QNetworkReply*)));
|
||||
connect(manager, SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError> & )), this, SLOT(onSslErrors(QNetworkReply*, const QList<QSslError> & )));
|
||||
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkRequestFinished(QNetworkReply*)));
|
||||
manager->post(request, data);
|
||||
}
|
||||
}
|
||||
@@ -388,7 +396,8 @@ static QString RawJsonStringGrab(const QByteArray& payload,
|
||||
|
||||
void OAuthDialog::networkRequestFinished(QNetworkReply *reply) {
|
||||
|
||||
if (reply->error() == QNetworkReply::NoError) {
|
||||
// we can handle SSL handshake errors, if we got here then some kind of protocol was agreed
|
||||
if (reply->error() == QNetworkReply::NoError || reply->error() == QNetworkReply::SslHandshakeFailedError) {
|
||||
QByteArray payload = reply->readAll(); // JSON
|
||||
QString refresh_token;
|
||||
QString access_token;
|
||||
@@ -463,6 +472,12 @@ void OAuthDialog::networkRequestFinished(QNetworkReply *reply) {
|
||||
tr("Information"), info);
|
||||
information.exec();
|
||||
}
|
||||
} else {
|
||||
|
||||
QString error = QString(tr("Error retrieving access token, %1 (%2)")).arg(reply->errorString()).arg(reply->error());
|
||||
QMessageBox oautherr(QMessageBox::Critical, tr("SSL Token Refresh Error"), error);
|
||||
oautherr.setDetailedText(error);
|
||||
oautherr.exec();
|
||||
}
|
||||
// job done, dialog can be closed
|
||||
accept();
|
||||
|
||||
@@ -72,6 +72,7 @@ private slots:
|
||||
void urlChanged(const QUrl& url);
|
||||
void loadFinished(bool ok);
|
||||
void networkRequestFinished(QNetworkReply *reply);
|
||||
void onSslErrors(QNetworkReply *reply, const QList<QSslError>&error);
|
||||
|
||||
#ifdef GC_HAVE_KQOAUTH
|
||||
// Twitter OAUTH
|
||||
|
||||
@@ -79,6 +79,8 @@
|
||||
// 3946 - V3.4 RC1
|
||||
// 3947 - V3.4 RC2
|
||||
// 3950 - V3.4 RELEASE (November 18 2016)
|
||||
// 3955 - V3.4 RELEASE SIERRA BUILD UPDATE (November 19 2016)
|
||||
// 3956 - V3.4 FIXUP GOOGLE DRIVE ISSUES ON MAC (December 25 2016)
|
||||
|
||||
#define VERSION3_BUILD 3010 // released
|
||||
#define VERSION3_SP1 3030 // released
|
||||
@@ -87,13 +89,13 @@
|
||||
#define VERSION311_BUILD 3101 // first build with 3.1 upgrade process
|
||||
#define VERSION32_BUILD 3200 // released
|
||||
#define VERSION33_BUILD 3933 // development release
|
||||
#define VERSION34_BUILD 3950 // released
|
||||
#define VERSION34_BUILD 3956 // released
|
||||
|
||||
// will keep changing during testing and before final release
|
||||
#define VERSION31_BUILD VERSION31_UPG
|
||||
|
||||
// the next two will with each build/release
|
||||
#define VERSION_LATEST 3950
|
||||
#define VERSION_LATEST 3956
|
||||
#define VERSION_STRING "V3.4"
|
||||
|
||||
// default config for this release cycle
|
||||
|
||||
@@ -43,10 +43,6 @@
|
||||
#include <signal.h>
|
||||
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#include "QtMacSegmentedButton.h" // for cocoa initialiser
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_X11
|
||||
#include <X11/Xlib.h>
|
||||
#endif
|
||||
@@ -300,11 +296,6 @@ main(int argc, char *argv[])
|
||||
//XXXIdleEventFilter idleFilter;
|
||||
//XXXapplication->installEventFilter(&idleFilter);
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
// get an autorelease pool setup
|
||||
static CocoaInitializer cocoaInitializer;
|
||||
#endif
|
||||
|
||||
// set default colors
|
||||
GCColor::setupColors();
|
||||
appsettings->migrateQSettingsSystem(); // colors must be setup before migration can take place, but reading has to be from the migrated ones
|
||||
|
||||
@@ -38,7 +38,7 @@ MoxyDevices::downloadInstructions() const
|
||||
DevicePtr
|
||||
MoxyDevices::newDevice( CommPortPtr dev )
|
||||
{
|
||||
return DevicePtr( new MoxyDevice( dev ));
|
||||
return DevicePtr( static_cast<Device *>(new MoxyDevice( dev )));
|
||||
}
|
||||
|
||||
static QDateTime dateTimeForRow(QString line)
|
||||
|
||||
@@ -263,6 +263,11 @@ QString GcCrashDialog::versionHTML()
|
||||
vlc = "yes";
|
||||
#endif
|
||||
|
||||
// -- WEBKIT ---
|
||||
QString webkit = "yes";
|
||||
#ifdef NOWEBKIT
|
||||
webkit = "none";
|
||||
#endif
|
||||
#ifdef GC_HAVE_SAMPLERATE
|
||||
QString src = QString(src_get_version()).mid(14,6);
|
||||
#else
|
||||
@@ -308,6 +313,7 @@ QString GcCrashDialog::versionHTML()
|
||||
"<tr><td colspan=\"2\">SAMPLERATE</td><td>%15</td></tr>"
|
||||
"<tr><td colspan=\"2\">SSL</td><td>%16</td></tr>"
|
||||
"<tr><td colspan=\"2\">R</td><td>%17</td></tr>"
|
||||
"<tr><td colspan=\"2\">WEBKIT</td><td>%18</td></tr>"
|
||||
"</table>"
|
||||
)
|
||||
.arg(QT_VERSION_STR)
|
||||
@@ -343,6 +349,7 @@ QString GcCrashDialog::versionHTML()
|
||||
.arg("none")
|
||||
#endif
|
||||
#endif
|
||||
.arg(webkit)
|
||||
|
||||
;
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include "DiaryWindow.h"
|
||||
#include "DiarySidebar.h"
|
||||
#include "Context.h"
|
||||
#include "QtMacButton.h"
|
||||
#include "HelpWhatsThis.h"
|
||||
|
||||
GcScopeBar::GcScopeBar(Context *context) : QWidget(context->mainWindow), context(context)
|
||||
|
||||
@@ -93,13 +93,10 @@
|
||||
#include "HelpWindow.h"
|
||||
#include "HomeWindow.h"
|
||||
#include "GcScopeBar.h"
|
||||
#ifdef Q_OS_MAC
|
||||
#include "QtMacButton.h" // mac
|
||||
#include "QtMacSegmentedButton.h" // mac
|
||||
#else
|
||||
#if !defined(Q_OS_MAC)
|
||||
#include "QTFullScreen.h" // not mac!
|
||||
#include "../qtsolutions/segmentcontrol/qtsegmentcontrol.h"
|
||||
#endif
|
||||
#include "../qtsolutions/segmentcontrol/qtsegmentcontrol.h"
|
||||
|
||||
// SEARCH / FILTER
|
||||
#include "NamedSearch.h"
|
||||
@@ -131,9 +128,6 @@ MainWindow::MainWindow(const QDir &home)
|
||||
mainwindows.append(this); // add us to the list of open windows
|
||||
init = false;
|
||||
if (desktop == NULL) desktop = QApplication::desktop();
|
||||
#ifdef Q_OS_MAC
|
||||
head = NULL; // early resize event causes a crash
|
||||
#endif
|
||||
|
||||
// create a splash to keep user informed on first load
|
||||
// first one in middle of display, not middle of window
|
||||
@@ -247,97 +241,10 @@ MainWindow::MainWindow(const QDir &home)
|
||||
connect(chartMenu, SIGNAL(triggered(QAction*)), this, SLOT(addChart(QAction*)));
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Mac Toolbar
|
||||
*--------------------------------------------------------------------*/
|
||||
#ifdef Q_OS_MAC
|
||||
#if QT_VERSION > 0x50000
|
||||
#if QT_VERSION >= 0x50201
|
||||
setUnifiedTitleAndToolBarOnMac(true);
|
||||
#endif
|
||||
head = addToolBar(context->athlete->cyclist);
|
||||
head->setObjectName(context->athlete->cyclist);
|
||||
head->setContentsMargins(20,0,20,0);
|
||||
head->setFloatable(false);
|
||||
head->setMovable(false);
|
||||
#else
|
||||
setUnifiedTitleAndToolBarOnMac(true);
|
||||
head = addToolBar(context->athlete->cyclist);
|
||||
head->setContentsMargins(0,0,0,0);
|
||||
#endif
|
||||
|
||||
sidebar = new QtMacButton(this, QtMacButton::TexturedRounded);
|
||||
QPixmap *sidebarImg = new QPixmap(":images/mac/sidebar.png");
|
||||
sidebar->setImage(sidebarImg);
|
||||
sidebar->setMinimumSize(24, 24);
|
||||
sidebar->setMaximumSize(24, 24);
|
||||
sidebar->setToolTip("Sidebar");
|
||||
sidebar->setSelected(true); // assume always start up with sidebar selected
|
||||
HelpWhatsThis *helpSideBar = new HelpWhatsThis(sidebar);
|
||||
sidebar->setWhatsThis(helpSideBar->getWhatsThisText(HelpWhatsThis::ToolBar_ToggleSidebar));
|
||||
|
||||
lowbar = new QtMacButton(this, QtMacButton::TexturedRounded);
|
||||
QPixmap *lowbarImg = new QPixmap(":images/mac/lowbar.png");
|
||||
lowbar->setImage(lowbarImg);
|
||||
lowbar->setMinimumSize(25, 25);
|
||||
lowbar->setMaximumSize(25, 25);
|
||||
lowbar->setToolTip("Compare");
|
||||
lowbar->setSelected(false); // assume always start up with lowbar deselected
|
||||
HelpWhatsThis *helpLowBar = new HelpWhatsThis(lowbar);
|
||||
lowbar->setWhatsThis(helpLowBar->getWhatsThisText(HelpWhatsThis::ToolBar_ToggleComparePane));
|
||||
|
||||
QWidget *viewsel = new QWidget(this);
|
||||
viewsel->setContentsMargins(0,0,0,0);
|
||||
QHBoxLayout *pq = new QHBoxLayout(viewsel);
|
||||
pq->setContentsMargins(0,0,0,0);
|
||||
pq->setSpacing(5);
|
||||
QHBoxLayout *ps = new QHBoxLayout;
|
||||
ps->setContentsMargins(0,0,0,0);
|
||||
ps->setSpacing (2); // low and sidebar button close together
|
||||
ps->addWidget(sidebar);
|
||||
ps->addWidget(lowbar);
|
||||
pq->addLayout(ps);
|
||||
|
||||
styleSelector = new QtMacSegmentedButton(2, viewsel);
|
||||
styleSelector->setWidth(80); // actually its 80 but we want a 30px space between is and the searchbox
|
||||
styleSelector->setImage(0, new QPixmap(":images/mac/tabbed.png"), 24);
|
||||
styleSelector->setImage(1, new QPixmap(":images/mac/tiled.png"), 24);
|
||||
pq->addWidget(styleSelector);
|
||||
connect(sidebar, SIGNAL(clicked(bool)), this, SLOT(toggleSidebar()));
|
||||
connect(lowbar, SIGNAL(clicked(bool)), this, SLOT(toggleLowbar()));
|
||||
connect(styleSelector, SIGNAL(clicked(int,bool)), this, SLOT(toggleStyle()));
|
||||
|
||||
// setup Mac thetoolbar
|
||||
head->addWidget(new Spacer(this));
|
||||
head->addWidget(new Spacer(this));
|
||||
head->addWidget(scopebar);
|
||||
head->addWidget(new Spacer(this));
|
||||
head->addWidget(viewsel);
|
||||
|
||||
// SearchBox and its animator
|
||||
searchBox = new SearchFilterBox(this,context,false);
|
||||
anim = new QPropertyAnimation(searchBox, "xwidth", this);
|
||||
|
||||
#if QT_VERSION > 0x50000
|
||||
QStyle *toolStyle = QStyleFactory::create("fusion");
|
||||
#else
|
||||
QStyle *toolStyle = QStyleFactory::create("Cleanlooks");
|
||||
#endif
|
||||
searchBox->setStyle(toolStyle);
|
||||
searchBox->setFixedWidth(150);
|
||||
head->addWidget(searchBox);
|
||||
connect(searchBox, SIGNAL(searchResults(QStringList)), this, SLOT(setFilter(QStringList)));
|
||||
connect(searchBox, SIGNAL(searchClear()), this, SLOT(clearFilter()));
|
||||
connect(searchBox->searchbox, SIGNAL(haveFocus()), this, SLOT(searchFocusIn()));
|
||||
connect(searchBox->searchbox, SIGNAL(lostFocus()), this, SLOT(searchFocusOut()));
|
||||
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Windows and Linux Toolbar
|
||||
* Toolbar
|
||||
*--------------------------------------------------------------------*/
|
||||
#ifndef Q_OS_MAC
|
||||
|
||||
head = new GcToolBar(this);
|
||||
|
||||
#if QT_VERSION > 0x50000
|
||||
@@ -415,7 +322,7 @@ MainWindow::MainWindow(const QDir &home)
|
||||
Spacer *spacer = new Spacer(this);
|
||||
spacer->setFixedWidth(5);
|
||||
head->addWidget(spacer);
|
||||
#endif
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Central Widget
|
||||
@@ -452,21 +359,8 @@ MainWindow::MainWindow(const QDir &home)
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout(central);
|
||||
mainLayout->setSpacing(0);
|
||||
mainLayout->setContentsMargins(0,0,0,0);
|
||||
#ifndef Q_OS_MAC // nonmac toolbar on main view -- its not
|
||||
// unified with the title bar.
|
||||
mainLayout->addWidget(head);
|
||||
#endif
|
||||
mainLayout->addWidget(tabbar);
|
||||
#if (defined Q_OS_MAC) && (QT_VERSION >= 0x50201)
|
||||
blackline = new QWidget(this);
|
||||
blackline->setContentsMargins(0,0,0,0);
|
||||
blackline->setFixedHeight(1);
|
||||
QPalette linePalette;
|
||||
linePalette.setBrush(backgroundRole(), Qt::darkGray);
|
||||
blackline->setPalette(linePalette);
|
||||
blackline->setAutoFillBackground(true);
|
||||
mainLayout->addWidget(blackline);
|
||||
#endif
|
||||
mainLayout->addWidget(tabStack);
|
||||
setCentralWidget(central);
|
||||
|
||||
@@ -652,11 +546,9 @@ MainWindow::MainWindow(const QDir &home)
|
||||
showhideLowbar = viewMenu->addAction(tr("Show Compare Pane"), this, SLOT(showLowbar(bool)));
|
||||
showhideLowbar->setCheckable(true);
|
||||
showhideLowbar->setChecked(false);
|
||||
#if (!defined Q_OS_MAC) || (QT_VERSION >= 0x50201) // not on a Mac
|
||||
showhideToolbar = viewMenu->addAction(tr("Show Toolbar"), this, SLOT(showToolbar(bool)));
|
||||
showhideToolbar->setCheckable(true);
|
||||
showhideToolbar->setChecked(true);
|
||||
#endif
|
||||
showhideTabbar = viewMenu->addAction(tr("Show Athlete Tabs"), this, SLOT(showTabbar(bool)));
|
||||
showhideTabbar->setCheckable(true);
|
||||
showhideTabbar->setChecked(true);
|
||||
@@ -749,10 +641,11 @@ MainWindow::setSplash(bool first)
|
||||
progress = new QLabel(splash);
|
||||
progress->setAlignment(Qt::AlignCenter);
|
||||
QHBoxLayout *l = new QHBoxLayout(splash);
|
||||
l->setSpacing(0);
|
||||
l->addWidget(progress);
|
||||
|
||||
// lets go
|
||||
splash->setFixedSize(100,50);
|
||||
splash->setFixedSize(100,80);
|
||||
|
||||
if (first) {
|
||||
// middle of screen
|
||||
@@ -810,23 +703,9 @@ MainWindow::showTabbar(bool want)
|
||||
setUpdatesEnabled(false);
|
||||
showhideTabbar->setChecked(want);
|
||||
if (want) {
|
||||
#ifdef Q_OS_MAC
|
||||
setDocumentMode(true);
|
||||
tabbar->setDocumentMode(true);
|
||||
#if QT_VERSION >= 0x50201
|
||||
if (!GCColor::isFlat()) blackline->hide();
|
||||
#endif
|
||||
#endif
|
||||
tabbar->show();
|
||||
}
|
||||
else {
|
||||
#ifdef Q_OS_MAC
|
||||
setDocumentMode(false);
|
||||
tabbar->setDocumentMode(false);
|
||||
#if QT_VERSION >= 0x50201
|
||||
if (!GCColor::isFlat()) blackline->show();
|
||||
#endif
|
||||
#endif
|
||||
tabbar->hide();
|
||||
}
|
||||
setUpdatesEnabled(true);
|
||||
@@ -835,7 +714,6 @@ MainWindow::showTabbar(bool want)
|
||||
void
|
||||
MainWindow::showToolbar(bool want)
|
||||
{
|
||||
#if (!defined Q_OS_MAC) || (QT_VERSION >= 0x50201)
|
||||
setUpdatesEnabled(false);
|
||||
showhideToolbar->setChecked(want);
|
||||
if (want) {
|
||||
@@ -845,7 +723,6 @@ MainWindow::showToolbar(bool want)
|
||||
head->hide();
|
||||
}
|
||||
setUpdatesEnabled(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1008,24 +885,6 @@ MainWindow::eventFilter(QObject *o, QEvent *e)
|
||||
void
|
||||
MainWindow::resizeEvent(QResizeEvent*)
|
||||
{
|
||||
// on a mac we hide/show the toolbar on fullscreen mode
|
||||
// when using QT5 since it has problems rendering
|
||||
#if (defined Q_OS_MAC) && (QT_VERSION >= 0x50201)
|
||||
if (head) {
|
||||
QRect screenSize = desktop->availableGeometry();
|
||||
if ((screenSize.width() == frameGeometry().width() || screenSize.height() == frameGeometry().height()) && // fullscreen
|
||||
(head->isVisible())) {// and it is visible
|
||||
head->hide();
|
||||
head->updateGeometry();
|
||||
head->show();
|
||||
head->updateGeometry();
|
||||
}
|
||||
|
||||
// painting
|
||||
head->repaint();
|
||||
}
|
||||
#endif
|
||||
|
||||
//appsettings->setValue(GC_SETTINGS_MAIN_GEOM, saveGeometry());
|
||||
//appsettings->setValue(GC_SETTINGS_MAIN_STATE, saveState());
|
||||
}
|
||||
@@ -1261,13 +1120,8 @@ MainWindow::setToolButtons()
|
||||
styleAction->setChecked(select);
|
||||
showhideLowbar->setChecked(lowselected);
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
styleSelector->setSelected(select, true);
|
||||
lowbar->setSelected(lowselected);
|
||||
#else
|
||||
if (styleSelector->isSegmentSelected(select) == false)
|
||||
styleSelector->setSegmentSelected(select, true);
|
||||
#endif
|
||||
|
||||
int index = currentTab->currentView();
|
||||
|
||||
@@ -1994,11 +1848,7 @@ MainWindow::saveGCState(Context *context)
|
||||
context->showSidebar = showhideSidebar->isChecked();
|
||||
//context->showTabbar = showhideTabbar->isChecked();
|
||||
context->showLowbar = showhideLowbar->isChecked();
|
||||
#if (!defined Q_OS_MAC) || (QT_VERSION >= 0x50201) // not on a Mac
|
||||
context->showToolbar = showhideToolbar->isChecked();
|
||||
#else
|
||||
context->showToolbar = true;
|
||||
#endif
|
||||
context->searchText = searchBox->text();
|
||||
context->style = styleAction->isChecked();
|
||||
context->setIndex(scopebar->selected());
|
||||
@@ -2280,30 +2130,8 @@ MainWindow::configChanged(qint32)
|
||||
"QMenuBar::item { color: black; background: %1; }").arg(menuColorString));
|
||||
#endif
|
||||
|
||||
// Mac
|
||||
#ifdef Q_OS_MAC
|
||||
if (GCColor::isFlat()) {
|
||||
// Mac and Linux
|
||||
|
||||
#if (QT_VERSION >= 0x50201)
|
||||
// flat mode
|
||||
head->setStyleSheet(QString(" QToolBar:active { border: 0px; background-color: %1; } "
|
||||
" QToolBar:!active { border: 0px; background-color: %1; }").arg(GColor(CCHROME).name()));
|
||||
blackline->hide();
|
||||
#endif
|
||||
|
||||
} else {
|
||||
|
||||
// metallic mode
|
||||
#if QT_VERSION >= 0x50201
|
||||
// black line back, but only if we aren't showing the tabbar
|
||||
if (!showhideTabbar->isChecked()) blackline->show();
|
||||
head->setStyleSheet(" QToolBar:!active { border: 0px; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #F0F0F0, stop: 1 #E8E8E8 ); } "
|
||||
" QToolBar:active { border: 0px; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #D9D9D9, stop: 1 #B5B5B5 ); } ");
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
QPalette tabbarPalette;
|
||||
tabbar->setAutoFillBackground(true);
|
||||
tabbar->setShape(QTabBar::RoundedSouth);
|
||||
@@ -2314,7 +2142,6 @@ MainWindow::configChanged(qint32)
|
||||
else
|
||||
tabbarPalette.setBrush(backgroundRole(), QColor("#B3B4B6"));
|
||||
tabbar->setPalette(tabbarPalette);
|
||||
#endif
|
||||
|
||||
// set the default fontsize
|
||||
QFont font;
|
||||
|
||||
@@ -39,8 +39,6 @@
|
||||
#endif
|
||||
|
||||
class QTFullScreen;
|
||||
class QtMacSegmentedButton;
|
||||
class QtMacButton;
|
||||
class GcToolBar;
|
||||
class GcScopeBar;
|
||||
class Library;
|
||||
@@ -257,12 +255,6 @@ class MainWindow : public QMainWindow
|
||||
|
||||
SearchFilterBox *searchBox;
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
// Mac Native Support
|
||||
QtMacButton *sidebar, *lowbar;
|
||||
QtMacSegmentedButton *styleSelector;
|
||||
QToolBar *head;
|
||||
#else
|
||||
// Not on Mac so use other types
|
||||
QPushButton *sidebar, *lowbar;
|
||||
QtSegmentControl *styleSelector;
|
||||
@@ -270,7 +262,7 @@ class MainWindow : public QMainWindow
|
||||
|
||||
// the icons
|
||||
QIcon sidebarIcon, lowbarIcon, tabbedIcon, tiledIcon;
|
||||
#endif
|
||||
|
||||
// tab bar (that supports swtitching on drag and drop)
|
||||
DragBar *tabbar;
|
||||
QStackedWidget *tabStack;
|
||||
@@ -291,9 +283,7 @@ class MainWindow : public QMainWindow
|
||||
QAction *styleAction;
|
||||
QAction *showhideSidebar;
|
||||
QAction *showhideLowbar;
|
||||
#if (!defined Q_OS_MAC) || (QT_VERSION >= 0x50201) // not on a Mac
|
||||
QAction *showhideToolbar;
|
||||
#endif
|
||||
QAction *showhideTabbar;
|
||||
|
||||
QAction *tweetAction;
|
||||
@@ -302,9 +292,6 @@ class MainWindow : public QMainWindow
|
||||
// Miscellany
|
||||
QSignalMapper *toolMapper;
|
||||
|
||||
#if (defined Q_OS_MAC) && (QT_VERSION >= 0x50201)
|
||||
QWidget *blackline;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // _GC_MainWindow_h
|
||||
|
||||
@@ -276,6 +276,7 @@ DEFINES += GC_VIDEO_NONE # dont add any video playback support
|
||||
#DEFINES += GC_VIDEO_QUICKTIME # mac only and the default
|
||||
#DEFINES += GC_VIDEO_QT5 # use QT5 qvideowidget if QT > 5.2.1
|
||||
#DEFINES += GC_VIDEO_VLC # use VideoLan library needs VLC_INSTALL defined above
|
||||
#DEFINES += GC_VIDEO_AV # use AV Foundation on Mac now QTKit is deprecated
|
||||
|
||||
|
||||
# Using the GoldenCheetah/CloudDB feature (with a private CloudDB instance)
|
||||
|
||||
44
src/src.pro
44
src/src.pro
@@ -157,16 +157,33 @@ macx {
|
||||
QMAKE_INFO_PLIST = ./Resources/mac/Info.plist.app
|
||||
|
||||
# on mac we use native buttons and video, but have native fullscreen support
|
||||
LIBS += -lobjc -framework IOKit -framework AppKit -framework QTKit
|
||||
HEADERS += \
|
||||
Gui/QtMacVideoWindow.h \
|
||||
Gui/QtMacSegmentedButton.h \
|
||||
Gui/QtMacButton.h
|
||||
LIBS += -lobjc -framework IOKit -framework AppKit
|
||||
|
||||
OBJECTIVE_SOURCES += \
|
||||
Gui/QtMacVideoWindow.mm \
|
||||
Gui/QtMacSegmentedButton.mm \
|
||||
Gui/QtMacButton.mm
|
||||
# on mac we use QTKit or AV Foundation
|
||||
contains(DEFINES, "GC_VIDEO_AV") {
|
||||
|
||||
# explicitly wants AV Foundation
|
||||
LIBS += -framework AVFoundation
|
||||
HEADERS += Gui/QtMacVideoWindow.h
|
||||
OBJECTIVE_SOURCES += Gui/QtMacVideoWindow.mm
|
||||
|
||||
} else {
|
||||
|
||||
contains(DEFINES, "GC_VIDEO_NONE") {
|
||||
|
||||
# we have a blank videowindow, it will do nothing
|
||||
HEADERS += Train/VideoWindow.h
|
||||
SOURCES += Train/VideoWindow.cpp
|
||||
|
||||
} else {
|
||||
|
||||
# default is to use QuickTime for now
|
||||
LIBS += -framework QTKit
|
||||
HEADERS += Gui/QtMacVideoWindow.h
|
||||
OBJECTIVE_SOURCES += Gui/QtMacVideoWindow.mm
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
@@ -174,14 +191,15 @@ macx {
|
||||
HEADERS += Gui/QTFullScreen.h
|
||||
SOURCES += Gui/QTFullScreen.cpp
|
||||
|
||||
HEADERS += ../qtsolutions/segmentcontrol/qtsegmentcontrol.h
|
||||
SOURCES += ../qtsolutions/segmentcontrol/qtsegmentcontrol.cpp
|
||||
|
||||
# we now have videowindow, it will do nothing
|
||||
HEADERS += Train/VideoWindow.h
|
||||
SOURCES += Train/VideoWindow.cpp
|
||||
}
|
||||
|
||||
#### these are no longer non-mac only
|
||||
HEADERS += ../qtsolutions/segmentcontrol/qtsegmentcontrol.h
|
||||
SOURCES += ../qtsolutions/segmentcontrol/qtsegmentcontrol.cpp
|
||||
|
||||
|
||||
|
||||
###=================
|
||||
### LANGUAGE SUPPORT
|
||||
|
||||
Reference in New Issue
Block a user