From 69eeb4b0f848c728ec73bf553c1a73074522399e Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Wed, 8 May 2019 23:34:44 +0200 Subject: [PATCH] Move QSearchField to widgets and remove rest of qocoa --- 3rdparty/README.md | 8 - 3rdparty/qocoa/CMakeLists.txt | 38 --- 3rdparty/qocoa/LICENSE.txt | 19 -- 3rdparty/qocoa/README.md | 38 --- 3rdparty/qocoa/TODO.md | 13 - 3rdparty/qocoa/qbutton.h | 49 ---- 3rdparty/qocoa/qbutton_mac.mm | 229 ------------------ 3rdparty/qocoa/qbutton_nonmac.cpp | 89 ------- 3rdparty/qocoa/qocoa_mac.h | 56 ----- 3rdparty/qocoa/qprogressindicatorspinning.h | 29 --- .../qocoa/qprogressindicatorspinning_mac.mm | 70 ------ .../qprogressindicatorspinning_nonmac.cpp | 72 ------ .../qprogressindicatorspinning_nonmac.gif | Bin 3208 -> 0 bytes .../qprogressindicatorspinning_nonmac.qrc | 5 - 3rdparty/qocoa/qsearchfield_nonmac.qrc | 7 - 3rdparty/qocoa/qsearchfield_nonmac_clear.png | Bin 736 -> 0 bytes .../qocoa/qsearchfield_nonmac_magnifier.png | Bin 300 -> 0 bytes .../qsearchfield_nonmac_magnifier_menu.png | Bin 439 -> 0 bytes CMakeLists.txt | 4 - debian/copyright | 10 +- src/CMakeLists.txt | 8 +- src/collection/collectionfilterwidget.ui | 2 +- src/covermanager/albumcovermanager.cpp | 2 +- src/covermanager/albumcovermanager.ui | 2 +- src/covermanager/albumcoversearcher.cpp | 2 +- src/covermanager/albumcoversearcher.ui | 2 +- src/internet/internetsearchview.ui | 2 +- src/playlist/playlistcontainer.cpp | 2 +- src/playlist/playlistcontainer.ui | 2 +- .../qocoa => src/widgets}/qsearchfield.h | 0 .../qocoa => src/widgets}/qsearchfield_mac.mm | 0 .../widgets}/qsearchfield_nonmac.cpp | 4 +- 32 files changed, 24 insertions(+), 740 deletions(-) delete mode 100644 3rdparty/qocoa/CMakeLists.txt delete mode 100644 3rdparty/qocoa/LICENSE.txt delete mode 100644 3rdparty/qocoa/README.md delete mode 100644 3rdparty/qocoa/TODO.md delete mode 100644 3rdparty/qocoa/qbutton.h delete mode 100644 3rdparty/qocoa/qbutton_mac.mm delete mode 100644 3rdparty/qocoa/qbutton_nonmac.cpp delete mode 100644 3rdparty/qocoa/qocoa_mac.h delete mode 100644 3rdparty/qocoa/qprogressindicatorspinning.h delete mode 100644 3rdparty/qocoa/qprogressindicatorspinning_mac.mm delete mode 100644 3rdparty/qocoa/qprogressindicatorspinning_nonmac.cpp delete mode 100644 3rdparty/qocoa/qprogressindicatorspinning_nonmac.gif delete mode 100644 3rdparty/qocoa/qprogressindicatorspinning_nonmac.qrc delete mode 100644 3rdparty/qocoa/qsearchfield_nonmac.qrc delete mode 100644 3rdparty/qocoa/qsearchfield_nonmac_clear.png delete mode 100644 3rdparty/qocoa/qsearchfield_nonmac_magnifier.png delete mode 100644 3rdparty/qocoa/qsearchfield_nonmac_magnifier_menu.png rename {3rdparty/qocoa => src/widgets}/qsearchfield.h (100%) rename {3rdparty/qocoa => src/widgets}/qsearchfield_mac.mm (100%) rename {3rdparty/qocoa => src/widgets}/qsearchfield_nonmac.cpp (98%) 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 3288d1035d70bb86517e2c233f1a904e41f06b29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3208 zcmc(iX;4#H9>pJdFE7h`I{IF)0|5<6L}(j=N}5%L009EB2nYfyF)E0PvIqo$u!IC; z4PgyY5|S9AEh38G)(9eq4TbH7_UHg@yWrlIJ$6smIADL7s^P;_O;ykRc9soXl`UC*LwQJXkii*0rx|*7rI2=x7WaRkx_~XZqFJ8R3c=2Kg zf@aSAv8+BJ8+^hyay>(QR@t*blbKzsf0}bscEqRc5Hd3o(-N5RyW=zWB*zQw6Zh>* z2CROCDAbu#D`)S|J_o(lL9Yn3l*+8RdiRD_>iNz$#_IAzCna&Wl5 zSF_(rRCDD!wi#i8oAm&jYtn2_@VB%2-H*G%bN#|(6R6N?wM)3u`PiGzwuX7qmTgyF zpE)h0kuoxQ9?=kW7Y!=R@DmhU9)vwT*EZWzJ zrt+=2tqFts72yIp?|gvdLhs8Hfku^Z(){gmN%Y=K#P|%fkvgUj~HfIp3CuXqCtYGtJ#me+n+-LmP( z*XNuk%!aH8bIE@_Bj46>M*dSro|7<6vZ7WUHh5YQzN$>IJFqCb|CT!wj~R2C2%=q{ zpt8rzY$aw?W?=Ustv{jo?Ow@ZRkLe<)NItY>Cyhle*wR59dTdF6(@{5^ zAQBOB*hNtc3bkY-8{Cm$nFS@elbTtSqrt7MB{h_4y+~`!mVa}?c&N>&?P}GqdMuhQ z&@TD5Czd((DcG_Su~dKKV)Pj$-qi1WHM8_vc^O4?^!oY|tmK~i!{fjd&@_1E(T~r7 z_REZy&hMT^ySJB3W7l$4YhR`M(J7S5S~+4Q&3HPa)z%zPpisOp$^ zTEe99ig2$5_qFr!$;7A6CJ}PJmRhli>w?LC}Y`#HLGy6 zMU4EhL~dKCN5Ut;U2jd*83ShBNiu zcJB0l9>1Modc?-oM<R4?}3g}UJ%@K);kriq>)e*rh%hdqM)5Q)*+O8 zXm;SEbs@koiYS!9YXIclSg+5m_s~yrW#kKMdiRszg(gCP5HPmP7L)vCf8@fxUh6qY z@Z#TmkjzAZX{rwE+q|K~F2v5{_@vt%>yT_a#fF03SFt{0RXvDAiaY~K9CgS1O>frXgAjBCS}mEd4mIWZ$=ovd5| zR?GRdU}d6+Q`+JRW)|=v7$)XNkn3yE`!nAiSCvOB1jKT zG<1aK3s<0b0m==egTD#8i(Of=1pGDTOCho0XpIOMQ&P87cVKY1W=C6kIg z9cH=@a&zbm2+`|{(_?YC9fdm?1TY~-pwlBn?>=(~1pDKbco6jloP;0-cqRiwV1A_S zEyV0Dj8Pwy!nekzaN>{)7rgZ&_QLxK{~1yRe865^yx>}+a!ECd>#MMwddow z@CU{l+Rt$xuXuf}?ga{3IAr?Raql^c@a%sI0U5m}HvJ5O1#I%_MMPt#BH>OqUZ{-k zt>4Xzz=%jT*FVW(uYkWyx}9Gw$HdN*qU?Bit#ji(Wi7p-u|_8?h^%szIS^s^fNM}b zgGy>|=cbEufpguY5_6w~&ZLv=Bo06UF9EYIY;Er-1VK)SyF&!|J{axiE1z^(hXwVq zsFS=K-#zC}CcOs^8W{KAt+kK)jYDgDYbCXv{{rwsgqtIU3<910$CJi)s?? z_t8k{>7*0~4l~LLF7$WXT5OSq5QCTbP_l!SN|{R}3D&eWA8~0ltWh1IL+ZBX4rRSt zWF6Om3WDMu4xK^1(BF`2cL}rUCzhHAB`@j5&R-yk_l*t;mPGY|u2^o|myvcOdrg0W z%=lX;f^Vkqfp?u7*4qQq%A3Mpf!xspWBSKS@O%r*TSM}?dl(@*%{0Jm_8;(h{R__M Bt - - 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 ec52c41bc2fbba0bcc2b30a96267d73be240dc13..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 736 zcmV<60w4W}P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igQ1 z5H}Q?5;Tqg00Ll1L_t(I%dL~KP8(SihQGOU@A%G)jYu&WzH`%nmEB~k%_)!0|LN%b|AGHm z-oG2$+uQ3>$}P|HIzosRKvh)}=iL2bvG{s(bCdlipx5iYRZ9ISrA(Dl2qAa@V2ok0 zSUehIK3`v7e|gpTKZ>>1@8dXrQ?J*FLsS(ar>K(E(Z z55w?XqtSR%uh-e%-)A2ykxBqT|~bUI}?98#7gQc7NC zTL2Qk_kDyA_`XjZ$7rp8@_S`v1>g5^&Mjw`8#w1C&N-~L#Bt1EFre9NlIJ;jp3`hL z84L!*ag4PV=N!(t$r4ai)xEVAV+`GHmo!ZokH_@;efs@ACb6=jZ2N{*lDHySr?2bF=h)KM8`M z@ne)p>7~2_ZUoUdwwqvaRgBnVYW{7Z(}7v%UkVf%q@6 SqLyO-0000Dhf?ouWA>yZ`s+BBx=){u((%TpyhhRjALHT2ckQc&d4&) z-n7Bm;H*K-pZ^kn7Mb{N&z!|jAk+T(YZimV`=g(K?qPLwkZ5DrlIwl{`;^p7iT5tI zx9yD4vv!!4s&o3#!*q*2WiQPZ0c-805^anh>)KKyITY=T68yi}@UJypmicbY)??rQ z+E&g>&)Y8jdRLLvT!xHUZR=iZbUpf-AmV!aZ=JhW=j&ZIa{LT^$CW)N?OE3SxI+54 wpr&f&y!tagmpaE@|F2cIdey48=Y>A7G=&6K*=^zp26~sl)78&qol`;+0Ic(R)c^nh diff --git a/3rdparty/qocoa/qsearchfield_nonmac_magnifier_menu.png b/3rdparty/qocoa/qsearchfield_nonmac_magnifier_menu.png deleted file mode 100644 index 0e652c945e4287939e4787cd02c891c50238c64a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 439 zcmV;o0Z9IdP)e+J+88IQ+ODwU{IDgdn4Yj(RG-ELPU zlgZB|=kxg)CX$;ex$!IiEsZ@$z hOGL13`%eoV{s($5(uCrFlfnQ1002ovPDHLkV1gsuzk~n) 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);