Remove the global search popup for now until it can be made a bit prettier

This commit is contained in:
David Sansome 2011-12-12 20:37:44 +00:00
parent 7585236e20
commit 54df30c15d
11 changed files with 0 additions and 292 deletions

View File

@ -119,7 +119,6 @@ set(SOURCES
globalsearch/digitallyimportedsearchprovider.cpp
globalsearch/globalsearch.cpp
globalsearch/globalsearchitemdelegate.cpp
globalsearch/globalsearchpopup.cpp
globalsearch/globalsearchsettingspage.cpp
globalsearch/globalsearchsortmodel.cpp
globalsearch/globalsearchtooltip.cpp
@ -370,7 +369,6 @@ set(HEADERS
engines/gstelementdeleter.h
globalsearch/globalsearch.h
globalsearch/globalsearchpopup.h
globalsearch/globalsearchsettingspage.h
globalsearch/globalsearchtooltip.h
globalsearch/globalsearchwidget.h
@ -541,7 +539,6 @@ set(UI
devices/deviceproperties.ui
globalsearch/globalsearchpopup.ui
globalsearch/globalsearchsettingspage.ui
globalsearch/globalsearchwidget.ui
@ -717,7 +714,6 @@ optional_source(APPLE
core/macglobalshortcutbackend.mm
core/mac_startup.mm
devices/macdevicelister.mm
globalsearch/globalsearchpopup.mm
ui/globalshortcutgrabber.mm
ui/macscreensaver.cpp
ui/macsystemtrayicon.mm

View File

@ -53,7 +53,6 @@ const char* CommandlineOptions::kHelpText =
"%20:\n"
" -o, --show-osd %21\n"
" -y, --toggle-pretty-osd %22\n"
" --search-popup %23\n"
" -g, --language <lang> %24\n"
" --quiet %25\n"
" --verbose %26\n"
@ -75,7 +74,6 @@ CommandlineOptions::CommandlineOptions(int argc, char** argv)
play_track_at_(-1),
show_osd_(false),
toggle_pretty_osd_(false),
show_search_popup_(false),
log_levels_(logging::kDefaultLogLevels)
{
#ifdef Q_OS_DARWIN
@ -122,7 +120,6 @@ bool CommandlineOptions::Parse() {
{"play-track", required_argument, 0, 'k'},
{"show-osd", no_argument, 0, 'o'},
{"toggle-pretty-osd", no_argument, 0, 'y'},
{"search-popup", no_argument, 0, SearchPopup},
{"language", required_argument, 0, 'g'},
{"quiet", no_argument, 0, Quiet},
{"verbose", no_argument, 0, Verbose},
@ -163,7 +160,6 @@ bool CommandlineOptions::Parse() {
tr("Other options"),
tr("Display the on-screen-display"),
tr("Toggle visibility for the pretty on-screen-display"),
tr("Display the global search popup"),
tr("Change the language"),
tr("Equivalent to --log-levels *:1"),
tr("Equivalent to --log-levels *:3"),
@ -190,7 +186,6 @@ bool CommandlineOptions::Parse() {
case Quiet: log_levels_ = "1"; break;
case Verbose: log_levels_ = "3"; break;
case LogLevels: log_levels_ = QString(optarg); break;
case SearchPopup: show_search_popup_ = true; break;
case Version: {
QString version_text = QString(kVersionText).arg(CLEMENTINE_VERSION_DISPLAY);
std::cout << version_text.toLocal8Bit().constData() << std::endl;
@ -243,7 +238,6 @@ bool CommandlineOptions::is_empty() const {
play_track_at_ == -1 &&
show_osd_ == false &&
toggle_pretty_osd_ == false &&
show_search_popup_ == false &&
urls_.isEmpty();
}
@ -280,7 +274,6 @@ QDataStream& operator<<(QDataStream& s, const CommandlineOptions& a) {
<< a.seek_by_
<< a.play_track_at_
<< a.show_osd_
<< a.show_search_popup_
<< a.urls_
<< a.log_levels_
<< a.toggle_pretty_osd_;
@ -299,7 +292,6 @@ QDataStream& operator>>(QDataStream& s, CommandlineOptions& a) {
>> a.seek_by_
>> a.play_track_at_
>> a.show_osd_
>> a.show_search_popup_
>> a.urls_
>> a.log_levels_
>> a.toggle_pretty_osd_;

View File

@ -61,7 +61,6 @@ class CommandlineOptions {
int play_track_at() const { return play_track_at_; }
bool show_osd() const { return show_osd_; }
bool toggle_pretty_osd() const { return toggle_pretty_osd_; }
bool show_search_popup() const { return show_search_popup_; }
QList<QUrl> urls() const { return urls_; }
QString language() const { return language_; }
QString log_levels() const { return log_levels_; }
@ -81,7 +80,6 @@ class CommandlineOptions {
Verbose,
LogLevels,
Version,
SearchPopup,
};
QString tr(const char* source_text);
@ -103,7 +101,6 @@ class CommandlineOptions {
int play_track_at_;
bool show_osd_;
bool toggle_pretty_osd_;
bool show_search_popup_;
QString language_;
QString log_levels_;

View File

@ -60,7 +60,6 @@ GlobalShortcuts::GlobalShortcuts(QObject *parent)
AddShortcut("shuffle_mode", tr("Change shuffle mode"), SIGNAL(CycleShuffleMode()));
AddShortcut("repeat_mode", tr("Change repeat mode"), SIGNAL(CycleRepeatMode()));
AddShortcut("toggle_last_fm_scrobbling", tr("Enable/disable Last.fm scrobbling"), SIGNAL(ToggleScrobbling()));
AddShortcut("global_search_popup", tr("Show Global Search Popup"), SIGNAL(ShowGlobalSearch()));
AddRatingShortcut("rate_zero_star", tr("Rate the current song 0 stars"), rating_signals_mapper_, 0);
AddRatingShortcut("rate_one_star", tr("Rate the current song 1 star"), rating_signals_mapper_, 1);

View File

@ -73,7 +73,6 @@ signals:
void CycleShuffleMode();
void CycleRepeatMode();
void ToggleScrobbling();
void ShowGlobalSearch();
private:
void AddShortcut(const QString& id, const QString& name, const char* signal,

View File

@ -1,74 +0,0 @@
/* This file is part of Clementine.
Copyright 2011, David Sansome <me@davidsansome.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#include "globalsearchpopup.h"
#include <QShortcut>
#include "core/logging.h"
#include "core/player.h"
#include "ui/iconloader.h"
GlobalSearchPopup::GlobalSearchPopup(QWidget* parent)
: QWidget(parent),
ui_(new Ui_GlobalSearchPopup),
mac_psn_(NULL) {
Qt::WindowFlags flags = Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint;
setWindowFlags(flags);
ui_->setupUi(this);
ui_->previous->setIcon(IconLoader::Load("media-skip-backward"));
ui_->next->setIcon(IconLoader::Load("media-skip-forward"));
ui_->play_pause->setIcon(IconLoader::Load("media-playback-start"));
ui_->stop->setIcon(IconLoader::Load("media-playback-stop"));
QShortcut* shortcut = new QShortcut(QKeySequence(Qt::Key_Escape), this);
connect(shortcut, SIGNAL(activated()), SLOT(hide()));
}
void GlobalSearchPopup::Init(GlobalSearch* engine, Player* player) {
ui_->search_widget->Init(engine);
// Forward AddToPlaylist signal.
connect(ui_->search_widget, SIGNAL(AddToPlaylist(QMimeData*)),
SIGNAL(AddToPlaylist(QMimeData*)));
connect(ui_->previous, SIGNAL(clicked(bool)), player, SLOT(Previous()));
connect(ui_->next, SIGNAL(clicked(bool)), player, SLOT(Next()));
connect(ui_->play_pause, SIGNAL(clicked(bool)), player, SLOT(PlayPause()));
connect(ui_->stop, SIGNAL(clicked(bool)), player, SLOT(Stop()));
}
void GlobalSearchPopup::setFocus(Qt::FocusReason reason) {
ui_->search_widget->setFocus(reason);
}
void GlobalSearchPopup::showEvent(QShowEvent* e) {
#ifdef Q_OS_DARWIN
StorePreviousProcess();
#endif
QWidget::showEvent(e);
raise();
}
void GlobalSearchPopup::hide() {
#ifdef Q_OS_DARWIN
ActivatePreviousProcess();
#endif
QWidget::hide();
}

View File

@ -1,60 +0,0 @@
/* This file is part of Clementine.
Copyright 2011, David Sansome <me@davidsansome.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GLOBALSEARCHPOPUP_H
#define GLOBALSEARCHPOPUP_H
#include <boost/scoped_ptr.hpp>
#include <QDialog>
#include "ui_globalsearchpopup.h"
class LibraryBackendInterface;
class Player;
class ProcessSerialNumber;
class GlobalSearchPopup : public QWidget {
Q_OBJECT
public:
explicit GlobalSearchPopup(QWidget* parent = 0);
void Init(GlobalSearch* engine, Player* player);
// QWidget
void setFocus(Qt::FocusReason reason = Qt::PopupFocusReason);
protected:
void showEvent(QShowEvent* e);
protected slots:
void hide();
private:
void StorePreviousProcess();
void ActivatePreviousProcess();
signals:
void AddToPlaylist(QMimeData*);
void Closed();
private:
boost::scoped_ptr<Ui_GlobalSearchPopup> ui_;
ProcessSerialNumber* mac_psn_;
};
#endif // GLOBALSEARCHPOPUP_H

View File

@ -1,14 +0,0 @@
#include "globalsearchpopup.h"
#include "ApplicationServices/ApplicationServices.h"
void GlobalSearchPopup::StorePreviousProcess() {
mac_psn_ = new ProcessSerialNumber;
GetFrontProcess(mac_psn_);
}
void GlobalSearchPopup::ActivatePreviousProcess() {
SetFrontProcess(mac_psn_);
delete mac_psn_;
mac_psn_ = NULL;
}

View File

@ -1,107 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>GlobalSearchPopup</class>
<widget class="QWidget" name="GlobalSearchPopup">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>446</width>
<height>195</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="GlobalSearchWidget" name="search_widget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="previous">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="play_pause">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="stop">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="next">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>GlobalSearchWidget</class>
<extends>QWidget</extends>
<header>globalsearch/globalsearchwidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@ -41,7 +41,6 @@
#include "engines/enginebase.h"
#include "engines/gstengine.h"
#include "globalsearch/globalsearch.h"
#include "globalsearch/globalsearchpopup.h"
#include "globalsearch/librarysearchprovider.h"
#include "internet/jamendoservice.h"
#include "internet/magnatuneservice.h"
@ -633,7 +632,6 @@ MainWindow::MainWindow(
connect(global_shortcuts_, SIGNAL(ShowHide()), SLOT(ToggleShowHide()));
connect(global_shortcuts_, SIGNAL(ShowOSD()), player_, SLOT(ShowOSD()));
connect(global_shortcuts_, SIGNAL(TogglePrettyOSD()), player_, SLOT(TogglePrettyOSD()));
connect(global_shortcuts_, SIGNAL(ShowGlobalSearch()), SLOT(ShowGlobalSearch()));
#ifdef HAVE_LIBLASTFM
connect(global_shortcuts_, SIGNAL(ToggleScrobbling()), internet_model->InternetModel::Service<LastFMService>(), SLOT(ToggleScrobbling()));
#endif
@ -1715,9 +1713,6 @@ void MainWindow::CommandlineOptionsReceived(const CommandlineOptions &options) {
if (options.toggle_pretty_osd())
player_->TogglePrettyOSD();
if (options.show_search_popup())
ShowGlobalSearch();
}
void MainWindow::ForceShowOSD(const Song &song, const bool toggle) {
@ -2271,14 +2266,3 @@ void MainWindow::HandleNotificationPreview(OSD::Behaviour type, QString line1, Q
osd_->ShowPreview(type, line1, line2, fake);
}
}
void MainWindow::ShowGlobalSearch() {
if (!search_popup_) {
search_popup_.reset(new GlobalSearchPopup);
search_popup_->Init(global_search_, player_);
StyleSheetLoader* css_loader = new StyleSheetLoader(search_popup_.get());
css_loader->SetStyleSheet(search_popup_.get(), ":mainwindow.css");
connect(search_popup_.get(), SIGNAL(AddToPlaylist(QMimeData*)), SLOT(AddToPlaylist(QMimeData*)));
}
search_popup_->show();
}

View File

@ -47,7 +47,6 @@ class Equalizer;
class ErrorDialog;
class FileView;
class GlobalSearch;
class GlobalSearchPopup;
class GlobalShortcuts;
class GroupByDialog;
class Library;
@ -237,7 +236,6 @@ class MainWindow : public QMainWindow, public PlatformInterface {
void OpenSettingsDialog();
void OpenSettingsDialogAtPage(SettingsDialog::Page page);
void ShowSongInfoConfig();
void ShowGlobalSearch();
void SaveGeometry();
@ -305,8 +303,6 @@ class MainWindow : public QMainWindow, public PlatformInterface {
boost::scoped_ptr<TrackSelectionDialog> track_selection_dialog_;
PlaylistItemList autocomplete_tag_items_;
boost::scoped_ptr<GlobalSearchPopup> search_popup_;
#ifdef ENABLE_VISUALISATIONS
boost::scoped_ptr<VisualisationContainer> visualisation_;
#endif