diff --git a/3rdparty/README.md b/3rdparty/README.md index 9f06369e..59dd1629 100644 --- a/3rdparty/README.md +++ b/3rdparty/README.md @@ -42,14 +42,6 @@ This is 2 header files used by taglib, but kept in a seperate directory because URL: http://utfcpp.sourceforge.net/ -qocoa ------ -This is a small static library currently used for the search fields above the collection, playlist and in -the cover manager. It is slightly modified from original version. - -URL: https://github.com/mikemcquaid/Qocoa - - SPMediaKeyTap ------------- diff --git a/3rdparty/qocoa/CMakeLists.txt b/3rdparty/qocoa/CMakeLists.txt deleted file mode 100644 index f5e4da7b..00000000 --- a/3rdparty/qocoa/CMakeLists.txt +++ /dev/null @@ -1,38 +0,0 @@ -cmake_minimum_required(VERSION 2.8.11) - -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -U__STRICT_ANSI__") - -set(SOURCES) - -set(HEADERS - qsearchfield.h - qbutton.h - qprogressindicatorspinning.h -) - -qt5_wrap_cpp(MOC_SOURCES ${HEADERS}) - -if(APPLE) - list(APPEND SOURCES - qsearchfield_mac.mm - qbutton_mac.mm - qprogressindicatorspinning_mac.mm - ) -else() - list(APPEND SOURCES - qsearchfield_nonmac.cpp - qbutton_nonmac.cpp - qprogressindicatorspinning_nonmac.cpp - ) - set(RESOURCES - qsearchfield_nonmac.qrc - qprogressindicatorspinning_nonmac.qrc - ) - qt5_add_resources(RESOURCES_SOURCES ${RESOURCES}) -endif() - -add_library(Qocoa STATIC ${SOURCES} ${MOC_SOURCES} ${RESOURCES_SOURCES}) -target_link_libraries(Qocoa ${QT_LIBRARIES}) - diff --git a/3rdparty/qocoa/LICENSE.txt b/3rdparty/qocoa/LICENSE.txt deleted file mode 100644 index 910eb6d2..00000000 --- a/3rdparty/qocoa/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2011 by Mike McQuaid - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/3rdparty/qocoa/README.md b/3rdparty/qocoa/README.md deleted file mode 100644 index 6e16f6f7..00000000 --- a/3rdparty/qocoa/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# Qocoa -Qocoa is a collection of Qt wrappers for OSX's Cocoa widgets. - -## Features -- basic fallback to sensible Qt types on non-OSX platforms -- shared class headers which expose no implementation details -- typical Qt signal/slot-based API -- trivial to import into projects (class header/implementation, [single shared global header](https://github.com/mikemcquaid/Qocoa/blob/master/qocoa_mac.h)) - -## Building -``` -git clone git://github.com/mikemcquaid/Qocoa.git -cd Qocoa -qmake # or cmake . -make -``` - -## Status -I'm not personally working on this any more but will accept pull-requests. - -[![Build Status](https://travis-ci.org/MikeMcQuaid/Qocoa.svg?branch=master)](https://travis-ci.org/MikeMcQuaid/Qocoa) - -## Usage -For each class you want to use copy the [`qocoa_mac.h`](https://github.com/mikemcquaid/Qocoa/blob/master/qocoa_mac.h), `$CLASS.h`, `$CLASS_mac.*` and `$CLASS_nonmac.*` files into your source tree and add them to your buildsystem. Examples are provided for [CMake](https://github.com/mikemcquaid/Qocoa/blob/master/CMakeLists.txt) and [QMake](https://github.com/mikemcquaid/Qocoa/blob/master/Qocoa.pro). - -## Contact -[Mike McQuaid](mailto:mike@mikemcquaid.com) - -## License -Qocoa is licensed under the [MIT License](http://en.wikipedia.org/wiki/MIT_License). -The full license text is available in [LICENSE.txt](https://github.com/mikemcquaid/Qocoa/blob/master/LICENSE.txt). - -Magnifier and EditClear icons taken from [QtCreator](http://qt-project.org/) and are licensed under the [LGPL](http://www.gnu.org/copyleft/lesser.html). - -Other icons are taken from the [Oxygen Project](http://www.oxygen-icons.org/) and are licensed under the [Creative Commons Attribution-ShareAlike 3.0 License](http://creativecommons.org/licenses/by-sa/3.0/). - -## Gallery -![Qocoa Gallery](https://github.com/mikemcquaid/Qocoa/raw/master/gallery.png) diff --git a/3rdparty/qocoa/TODO.md b/3rdparty/qocoa/TODO.md deleted file mode 100644 index 45972baf..00000000 --- a/3rdparty/qocoa/TODO.md +++ /dev/null @@ -1,13 +0,0 @@ -Widgets I hope to implement (or at least investigate): - -- NSTokenField -- NSSegmentedControl -- NSLevelIndicator -- NSPathControl -- NSSlider (Circular) -- NSSplitView -- NSTextFinder -- NSOutlineView in an NSScrollView (Source List) -- NSDrawer -- PDFView -- WebView diff --git a/3rdparty/qocoa/qbutton.h b/3rdparty/qocoa/qbutton.h deleted file mode 100644 index 93e598f8..00000000 --- a/3rdparty/qocoa/qbutton.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef QBUTTON_H -#define QBUTTON_H - -#include -#include - -class QButtonPrivate; -class QButton : public QWidget -{ - Q_OBJECT -public: - // Matches NSBezelStyle - enum BezelStyle { - Rounded = 1, - RegularSquare = 2, - Disclosure = 5, - ShadowlessSquare = 6, - Circular = 7, - TexturedSquare = 8, - HelpButton = 9, - SmallSquare = 10, - TexturedRounded = 11, - RoundRect = 12, - Recessed = 13, - RoundedDisclosure = 14, -#ifdef __MAC_10_7 - Inline = 15 -#endif - }; - - explicit QButton(QWidget *parent, BezelStyle bezelStyle = Rounded); - -public slots: - void setText(const QString &text); - void setImage(const QPixmap &image); - void setChecked(bool checked); - -public: - void setCheckable(bool checkable); - bool isChecked(); - -signals: - void clicked(bool checked = false); - -private: - friend class QButtonPrivate; - QPointer pimpl; -}; -#endif // QBUTTON_H diff --git a/3rdparty/qocoa/qbutton_mac.mm b/3rdparty/qocoa/qbutton_mac.mm deleted file mode 100644 index b7e1bc0c..00000000 --- a/3rdparty/qocoa/qbutton_mac.mm +++ /dev/null @@ -1,229 +0,0 @@ -/* -Copyright (C) 2011 by Mike McQuaid - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -#include "qbutton.h" - -#include "qocoa_mac.h" - -#import "Foundation/NSAutoreleasePool.h" -#import "AppKit/NSButton.h" -#import "AppKit/NSFont.h" - -class QButtonPrivate : public QObject -{ -public: - QButtonPrivate(QButton *qButton, NSButton *nsButton, QButton::BezelStyle bezelStyle) - : QObject(qButton), qButton(qButton), nsButton(nsButton) - { - switch(bezelStyle) { - case QButton::Disclosure: - case QButton::Circular: -#ifdef __MAC_10_7 - case QButton::Inline: -#endif - case QButton::RoundedDisclosure: - case QButton::HelpButton: - [nsButton setTitle:@""]; - default: - break; - } - - NSFont* font = 0; - switch(bezelStyle) { - case QButton::RoundRect: - font = [NSFont fontWithName:@"Lucida Grande" size:12]; - break; - - case QButton::Recessed: - font = [NSFont fontWithName:@"Lucida Grande Bold" size:12]; - break; - -#ifdef __MAC_10_7 - case QButton::Inline: - font = [NSFont boldSystemFontOfSize:[NSFont systemFontSizeForControlSize:NSSmallControlSize]]; - break; -#endif - - default: - font = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSRegularControlSize]]; - break; - } - [nsButton setFont:font]; - - switch(bezelStyle) { - case QButton::Rounded: - qButton->setMinimumWidth(40); - qButton->setFixedHeight(24); - qButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); - break; - case QButton::RegularSquare: - case QButton::TexturedSquare: - qButton->setMinimumSize(14, 23); - qButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - break; - case QButton::ShadowlessSquare: - qButton->setMinimumSize(5, 25); - qButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - break; - case QButton::SmallSquare: - qButton->setMinimumSize(4, 21); - qButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - break; - case QButton::TexturedRounded: - qButton->setMinimumSize(10, 22); - qButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - break; - case QButton::RoundRect: - case QButton::Recessed: - qButton->setMinimumWidth(16); - qButton->setFixedHeight(18); - qButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); - break; - case QButton::Disclosure: - qButton->setMinimumWidth(13); - qButton->setFixedHeight(13); - qButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); - break; - case QButton::Circular: - qButton->setMinimumSize(16, 16); - qButton->setMaximumHeight(40); - qButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - break; - case QButton::HelpButton: - case QButton::RoundedDisclosure: - qButton->setMinimumWidth(22); - qButton->setFixedHeight(22); - qButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); - break; -#ifdef __MAC_10_7 - case QButton::Inline: - qButton->setMinimumWidth(10); - qButton->setFixedHeight(16); - qButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); - break; -#endif - } - - switch(bezelStyle) { - case QButton::Recessed: - [nsButton setButtonType:NSPushOnPushOffButton]; - case QButton::Disclosure: - [nsButton setButtonType:NSOnOffButton]; - default: - [nsButton setButtonType:NSMomentaryPushInButton]; - } - - [nsButton setBezelStyle:(__bridge NSBezelStyle)bezelStyle]; - } - - void clicked() - { - emit qButton->clicked(qButton->isChecked()); - } - - ~QButtonPrivate() { - [[nsButton target] release]; - [nsButton setTarget:nil]; - } - - QButton *qButton; - NSButton *nsButton; -}; - -@interface QButtonTarget : NSObject -{ -@public - QPointer pimpl; -} --(void)clicked; -@end - -@implementation QButtonTarget --(void)clicked { - Q_ASSERT(pimpl); - if (pimpl) - pimpl->clicked(); -} -@end - -QButton::QButton(QWidget *parent, BezelStyle bezelStyle) : QWidget(parent) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - NSButton *button = [[NSButton alloc] init]; - pimpl = new QButtonPrivate(this, button, bezelStyle); - - QButtonTarget *target = [[QButtonTarget alloc] init]; - target->pimpl = pimpl; - [button setTarget:target]; - - [button setAction:@selector(clicked)]; - - setupLayout(button, this); - - [button release]; - - [pool drain]; -} - -void QButton::setText(const QString &text) -{ - Q_ASSERT(pimpl); - if (!pimpl) - return; - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [pimpl->nsButton setTitle:fromQString(text)]; - [pool drain]; -} - -void QButton::setImage(const QPixmap &image) -{ - Q_ASSERT(pimpl); - if (pimpl) - [pimpl->nsButton setImage:fromQPixmap(image)]; -} - -void QButton::setChecked(bool checked) -{ - Q_ASSERT(pimpl); - if (pimpl) - [pimpl->nsButton setState:checked]; -} - -void QButton::setCheckable(bool checkable) -{ - const NSInteger cellMask = checkable ? NSChangeBackgroundCellMask : NSNoCellMask; - - Q_ASSERT(pimpl); - if (pimpl) - [[pimpl->nsButton cell] setShowsStateBy:cellMask]; -} - -bool QButton::isChecked() -{ - Q_ASSERT(pimpl); - if (!pimpl) - return false; - - return [pimpl->nsButton state]; -} diff --git a/3rdparty/qocoa/qbutton_nonmac.cpp b/3rdparty/qocoa/qbutton_nonmac.cpp deleted file mode 100644 index 0a79e2ba..00000000 --- a/3rdparty/qocoa/qbutton_nonmac.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright (C) 2011 by Mike McQuaid - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -#include "qbutton.h" - -#include -#include -#include -#include - -class QButtonPrivate : public QObject -{ -public: - QButtonPrivate(QButton *button, QAbstractButton *abstractButton) - : QObject(button), abstractButton(abstractButton) {} - QPointer abstractButton; -}; - -QButton::QButton(QWidget *parent, BezelStyle) : QWidget(parent) -{ - QAbstractButton *button = 0; - if (qobject_cast(parent)) - button = new QToolButton(this); - else - button = new QPushButton(this); - connect(button, SIGNAL(clicked()), - this, SIGNAL(clicked())); - pimpl = new QButtonPrivate(this, button); - - QVBoxLayout *layout = new QVBoxLayout(this); - layout->setMargin(0); - layout->addWidget(button); -} - -void QButton::setText(const QString &text) -{ - Q_ASSERT(pimpl); - if (pimpl) - pimpl->abstractButton->setText(text); -} - -void QButton::setImage(const QPixmap &image) -{ - Q_ASSERT(pimpl); - if (pimpl) - pimpl->abstractButton->setIcon(image); -} - -void QButton::setChecked(bool checked) -{ - Q_ASSERT(pimpl); - if (pimpl) - pimpl->abstractButton->setChecked(checked); -} - -void QButton::setCheckable(bool checkable) -{ - Q_ASSERT(pimpl); - if (pimpl) - pimpl->abstractButton->setCheckable(checkable); -} - -bool QButton::isChecked() -{ - Q_ASSERT(pimpl); - if (!pimpl) - return false; - - return pimpl->abstractButton->isChecked(); -} diff --git a/3rdparty/qocoa/qocoa_mac.h b/3rdparty/qocoa/qocoa_mac.h deleted file mode 100644 index 2456d661..00000000 --- a/3rdparty/qocoa/qocoa_mac.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright (C) 2011 by Mike McQuaid - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -#include -#include -#include -#include -#include -#include - -static inline NSString* fromQString(const QString &string) -{ - const QByteArray utf8 = string.toUtf8(); - const char* cString = utf8.constData(); - return [[NSString alloc] initWithUTF8String:cString]; -} - -static inline QString toQString(NSString *string) -{ - if (!string) - return QString(); - return QString::fromUtf8([string UTF8String]); -} - -static inline NSImage* fromQPixmap(const QPixmap &pixmap) -{ - CGImageRef cgImage = QtMac::toCGImageRef(pixmap); - return [[NSImage alloc] initWithCGImage:cgImage size:NSZeroSize]; -} - -static inline void setupLayout(NSView *cocoaView, QWidget *parent) -{ - parent->setAttribute(Qt::WA_NativeWindow); - QVBoxLayout *layout = new QVBoxLayout(parent); - layout->setMargin(0); - layout->addWidget(new QMacCocoaViewContainer(cocoaView, parent)); -} diff --git a/3rdparty/qocoa/qprogressindicatorspinning.h b/3rdparty/qocoa/qprogressindicatorspinning.h deleted file mode 100644 index ae40a92a..00000000 --- a/3rdparty/qocoa/qprogressindicatorspinning.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef QPROGRESSINDICATORSPINNING_H -#define QPROGRESSINDICATORSPINNING_H - -#include -#include - -class QProgressIndicatorSpinningPrivate; -class QProgressIndicatorSpinning : public QWidget -{ - Q_OBJECT -public: - // Matches NSProgressIndicatorThickness - enum Thickness { - Default = 14, - Small = 10, - Large = 18, - Aqua = 12 - }; - - explicit QProgressIndicatorSpinning(QWidget *parent, - Thickness thickness = Default); -public slots: - void animate(bool animate = true); -private: - friend class QProgressIndicatorSpinningPrivate; - QPointer pimpl; -}; - -#endif // QPROGRESSINDICATORSPINNING_H diff --git a/3rdparty/qocoa/qprogressindicatorspinning_mac.mm b/3rdparty/qocoa/qprogressindicatorspinning_mac.mm deleted file mode 100644 index c67c7c56..00000000 --- a/3rdparty/qocoa/qprogressindicatorspinning_mac.mm +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright (C) 2011 by Mike McQuaid - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -#include "qprogressindicatorspinning.h" - -#include "qocoa_mac.h" - -#import "Foundation/NSAutoreleasePool.h" -#import "AppKit/NSProgressIndicator.h" - -class QProgressIndicatorSpinningPrivate : public QObject -{ -public: - QProgressIndicatorSpinningPrivate(QProgressIndicatorSpinning *qProgressIndicatorSpinning, - NSProgressIndicator *nsProgressIndicator) - : QObject(qProgressIndicatorSpinning), nsProgressIndicator(nsProgressIndicator) {} - - NSProgressIndicator *nsProgressIndicator; -}; - -QProgressIndicatorSpinning::QProgressIndicatorSpinning(QWidget *parent, - Thickness thickness) - : QWidget(parent) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - NSProgressIndicator *progress = [[NSProgressIndicator alloc] init]; - [progress setStyle:NSProgressIndicatorSpinningStyle]; - - pimpl = new QProgressIndicatorSpinningPrivate(this, progress); - - setupLayout(progress, this); - - setFixedSize(thickness, thickness); - - [progress release]; - - [pool drain]; -} - -void QProgressIndicatorSpinning::animate(bool animate) -{ - Q_ASSERT(pimpl); - if (!pimpl) - return; - - if (animate) - [pimpl->nsProgressIndicator startAnimation:nil]; - else - [pimpl->nsProgressIndicator stopAnimation:nil]; -} diff --git a/3rdparty/qocoa/qprogressindicatorspinning_nonmac.cpp b/3rdparty/qocoa/qprogressindicatorspinning_nonmac.cpp deleted file mode 100644 index 6cbded6c..00000000 --- a/3rdparty/qocoa/qprogressindicatorspinning_nonmac.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright (C) 2011 by Mike McQuaid - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -#include "qprogressindicatorspinning.h" - -#include -#include -#include - -class QProgressIndicatorSpinningPrivate : public QObject -{ -public: - QProgressIndicatorSpinningPrivate(QProgressIndicatorSpinning *qProgressIndicatorSpinning, - QMovie *movie) - : QObject(qProgressIndicatorSpinning), movie(movie) {} - - QPointer movie; -}; - -QProgressIndicatorSpinning::QProgressIndicatorSpinning(QWidget *parent, - Thickness thickness) - : QWidget(parent) -{ - QVBoxLayout *layout = new QVBoxLayout(this); - layout->setMargin(0); - - QSize size(thickness, thickness); - QMovie *movie = new QMovie(this); - movie->setFileName(":/Qocoa/qprogressindicatorspinning_nonmac.gif"); - movie->setScaledSize(size); - // Roughly match OSX speed. - movie->setSpeed(200); - pimpl = new QProgressIndicatorSpinningPrivate(this, movie); - - QLabel *label = new QLabel(this); - label->setMovie(movie); - - layout->addWidget(label); - setFixedSize(size); -} - - -void QProgressIndicatorSpinning::animate(bool animate) -{ - Q_ASSERT(pimpl && pimpl->movie); - if (!(pimpl && pimpl->movie)) - return; - - if (animate) - pimpl->movie->start(); - else - pimpl->movie->stop(); -} diff --git a/3rdparty/qocoa/qprogressindicatorspinning_nonmac.gif b/3rdparty/qocoa/qprogressindicatorspinning_nonmac.gif deleted file mode 100644 index 3288d103..00000000 Binary files a/3rdparty/qocoa/qprogressindicatorspinning_nonmac.gif and /dev/null differ diff --git a/3rdparty/qocoa/qprogressindicatorspinning_nonmac.qrc b/3rdparty/qocoa/qprogressindicatorspinning_nonmac.qrc deleted file mode 100644 index 108c78ec..00000000 --- a/3rdparty/qocoa/qprogressindicatorspinning_nonmac.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - qprogressindicatorspinning_nonmac.gif - - diff --git a/3rdparty/qocoa/qsearchfield_nonmac.qrc b/3rdparty/qocoa/qsearchfield_nonmac.qrc deleted file mode 100644 index 68b570d5..00000000 --- a/3rdparty/qocoa/qsearchfield_nonmac.qrc +++ /dev/null @@ -1,7 +0,0 @@ - - - qsearchfield_nonmac_clear.png - qsearchfield_nonmac_magnifier_menu.png - qsearchfield_nonmac_magnifier.png - - diff --git a/3rdparty/qocoa/qsearchfield_nonmac_clear.png b/3rdparty/qocoa/qsearchfield_nonmac_clear.png deleted file mode 100644 index ec52c41b..00000000 Binary files a/3rdparty/qocoa/qsearchfield_nonmac_clear.png and /dev/null differ diff --git a/3rdparty/qocoa/qsearchfield_nonmac_magnifier.png b/3rdparty/qocoa/qsearchfield_nonmac_magnifier.png deleted file mode 100644 index ad7929d2..00000000 Binary files a/3rdparty/qocoa/qsearchfield_nonmac_magnifier.png and /dev/null differ diff --git a/3rdparty/qocoa/qsearchfield_nonmac_magnifier_menu.png b/3rdparty/qocoa/qsearchfield_nonmac_magnifier_menu.png deleted file mode 100644 index 0e652c94..00000000 Binary files a/3rdparty/qocoa/qsearchfield_nonmac_magnifier_menu.png and /dev/null differ diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a9a8a58..5c8919d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -236,10 +236,6 @@ else(USE_SYSTEM_SINGLEAPPLICATION) unset(SINGLECOREAPPLICATION_LIBRARY_DIRS) endif(USE_SYSTEM_SINGLEAPPLICATION) -# Qocoa -set(QOCOA_LIBRARIES Qocoa) -add_subdirectory(3rdparty/qocoa) - if (APPLE) find_library(SPARKLE Sparkle) add_subdirectory(3rdparty/SPMediaKeyTap) diff --git a/debian/copyright b/debian/copyright index a7eae8c6..9bf3bb27 100644 --- a/debian/copyright +++ b/debian/copyright @@ -292,15 +292,17 @@ Copyright: 1999 Erik Walthinsen 2007-2009 Sebastian Dröge License: GPL-2+ +Files: src/widgets/qsearchfield_nonmac.cpp + src/widgets/qsearchfield_mac.mm + src/widgets/qsearchfield.h +Copyright: 2011, Mike McQuaid +License: Expat + Files: 3rdparty/SPMediaKeyTap/* Copyright: 2010, Spotify AB 2011, Joachim Bengtsson License: BSD-3-clause -Files: 3rdparty/qocoa/* -Copyright: 2011, Mike McQuaid -License: Expat - Files: 3rdparty/singleapplication/* Copyright: 2015-2018, Itay Grudev License: MIT diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6dc95d9b..e78d8477 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -425,6 +425,7 @@ set(HEADERS widgets/tracksliderpopup.h widgets/tracksliderslider.h widgets/loginstatewidget.h + widgets/qsearchfield.h musicbrainz/acoustidclient.h musicbrainz/musicbrainzclient.h @@ -513,6 +514,11 @@ set(OTHER_SOURCES) option(USE_INSTALL_PREFIX "Look for data in CMAKE_INSTALL_PREFIX" ON) +if(NOT APPLE) + set(NOT_APPLE ON) + optional_source(NOT_APPLE SOURCES widgets/qsearchfield_nonmac.cpp) +endif() + if(HAVE_GLOBALSHORTCUTS) optional_source(HAVE_GLOBALSHORTCUTS SOURCES globalshortcuts/globalshortcuts.cpp globalshortcuts/globalshortcutbackend.cpp globalshortcuts/globalshortcutgrabber.cpp settings/shortcutssettingspage.cpp @@ -839,6 +845,7 @@ optional_source(APPLE core/macscreensaver.cpp core/macfslistener.mm widgets/osd_mac.mm + widgets/qsearchfield_mac.mm engine/macosdevicefinder.cpp globalshortcuts/globalshortcutbackend-macos.mm globalshortcuts/globalshortcutgrabber.mm @@ -963,7 +970,6 @@ target_link_libraries(strawberry_lib ${TAGLIB_LIBRARIES} ${SINGLEAPPLICATION_LIBRARIES} ${SINGLECOREAPPLICATION_LIBRARIES} - ${QOCOA_LIBRARIES} z ) diff --git a/src/collection/collectionfilterwidget.ui b/src/collection/collectionfilterwidget.ui index 282e6fd0..d6b1f08d 100644 --- a/src/collection/collectionfilterwidget.ui +++ b/src/collection/collectionfilterwidget.ui @@ -122,7 +122,7 @@ QSearchField QWidget -
3rdparty/qocoa/qsearchfield.h
+
widgets/qsearchfield.h
diff --git a/src/covermanager/albumcovermanager.cpp b/src/covermanager/albumcovermanager.cpp index cebd78b1..b4791098 100644 --- a/src/covermanager/albumcovermanager.cpp +++ b/src/covermanager/albumcovermanager.cpp @@ -62,7 +62,7 @@ #include "core/iconloader.h" #include "core/utilities.h" #include "widgets/forcescrollperpixel.h" -#include "3rdparty/qocoa/qsearchfield.h" +#include "widgets/qsearchfield.h" #include "collection/sqlrow.h" #include "collection/collectionbackend.h" #include "collection/collectionquery.h" diff --git a/src/covermanager/albumcovermanager.ui b/src/covermanager/albumcovermanager.ui index b5d25c03..8cfa4233 100644 --- a/src/covermanager/albumcovermanager.ui +++ b/src/covermanager/albumcovermanager.ui @@ -283,7 +283,7 @@ QSearchField QWidget -
3rdparty/qocoa/qsearchfield.h
+
widgets/qsearchfield.h
AlbumCoverManagerList diff --git a/src/covermanager/albumcoversearcher.cpp b/src/covermanager/albumcoversearcher.cpp index 3d38d11d..f6c488a0 100644 --- a/src/covermanager/albumcoversearcher.cpp +++ b/src/covermanager/albumcoversearcher.cpp @@ -52,7 +52,7 @@ #include "widgets/busyindicator.h" #include "widgets/forcescrollperpixel.h" #include "widgets/groupediconview.h" -#include "3rdparty/qocoa/qsearchfield.h" +#include "widgets/qsearchfield.h" #include "albumcoversearcher.h" #include "albumcoverfetcher.h" #include "albumcoverloader.h" diff --git a/src/covermanager/albumcoversearcher.ui b/src/covermanager/albumcoversearcher.ui index 071a412a..aabc60c9 100644 --- a/src/covermanager/albumcoversearcher.ui +++ b/src/covermanager/albumcoversearcher.ui @@ -83,7 +83,7 @@ QSearchField QWidget -
3rdparty/qocoa/qsearchfield.h
+
widgets/qsearchfield.h
BusyIndicator diff --git a/src/internet/internetsearchview.ui b/src/internet/internetsearchview.ui index 83154281..427e002f 100644 --- a/src/internet/internetsearchview.ui +++ b/src/internet/internetsearchview.ui @@ -277,7 +277,7 @@ QSearchField QWidget -
3rdparty/qocoa/qsearchfield.h
+
widgets/qsearchfield.h
AutoExpandingTreeView diff --git a/src/playlist/playlistcontainer.cpp b/src/playlist/playlistcontainer.cpp index a0f6324a..f395898d 100644 --- a/src/playlist/playlistcontainer.cpp +++ b/src/playlist/playlistcontainer.cpp @@ -53,7 +53,7 @@ #include "playlistmanager.h" #include "playlistparsers/playlistparser.h" #include "ui_playlistcontainer.h" -#include "3rdparty/qocoa/qsearchfield.h" +#include "widgets/qsearchfield.h" const char *PlaylistContainer::kSettingsGroup = "Playlist"; const int PlaylistContainer::kFilterDelayMs = 100; diff --git a/src/playlist/playlistcontainer.ui b/src/playlist/playlistcontainer.ui index 259ae3a6..a8fc3f9e 100644 --- a/src/playlist/playlistcontainer.ui +++ b/src/playlist/playlistcontainer.ui @@ -188,7 +188,7 @@ QSearchField QWidget -
3rdparty/qocoa/qsearchfield.h
+
widgets/qsearchfield.h
PlaylistView diff --git a/3rdparty/qocoa/qsearchfield.h b/src/widgets/qsearchfield.h similarity index 100% rename from 3rdparty/qocoa/qsearchfield.h rename to src/widgets/qsearchfield.h diff --git a/3rdparty/qocoa/qsearchfield_mac.mm b/src/widgets/qsearchfield_mac.mm similarity index 100% rename from 3rdparty/qocoa/qsearchfield_mac.mm rename to src/widgets/qsearchfield_mac.mm diff --git a/3rdparty/qocoa/qsearchfield_nonmac.cpp b/src/widgets/qsearchfield_nonmac.cpp similarity index 98% rename from 3rdparty/qocoa/qsearchfield_nonmac.cpp rename to src/widgets/qsearchfield_nonmac.cpp index 85f66892..7d42b774 100644 --- a/3rdparty/qocoa/qsearchfield_nonmac.cpp +++ b/src/widgets/qsearchfield_nonmac.cpp @@ -33,7 +33,7 @@ THE SOFTWARE. #include #include -#include "../../src/core/iconloader.h" +#include "core/iconloader.h" class QSearchFieldPrivate : public QObject { public: @@ -155,6 +155,8 @@ bool QSearchField::eventFilter(QObject *o, QEvent *e) { case QEvent::FocusOut: QApplication::sendEvent(this, e); break; + default: + break; } } return QWidget::eventFilter(o, e);