changeset 377:909cf273bed1 macness

Mac Dock menu uses same import-itunes-action as the File menu
author Dan Stowell <dan.stowell@eecs.qmul.ac.uk>
date Mon, 18 Oct 2010 13:24:38 +0100
parents ca9f27734349
children 7298621f1192
files main/MainWindow.cpp main/MainWindow.h main/main.cpp
diffstat 3 files changed, 13 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/main/MainWindow.cpp	Fri Oct 15 11:07:11 2010 +0100
+++ b/main/MainWindow.cpp	Mon Oct 18 13:24:38 2010 +0100
@@ -446,13 +446,13 @@
     menu->addAction(action);
 
 #ifdef Q_WS_MAC
-    action = new QAction(tr("Import current track from iTunes"), this);
-    action->setShortcut(tr("Ctrl+Alt+I"));
-    action->setStatusTip(tr("Import currently playing/selected iTunes track"));
-    connect(action, SIGNAL(triggered()), this, SLOT(importITunesAudio()));
+    m_importITunesAction = new QAction(tr("Import current track from iTunes"), this);
+    m_importITunesAction->setShortcut(tr("Ctrl+Alt+I"));
+    m_importITunesAction->setStatusTip(tr("Import currently playing/selected iTunes track"));
+    connect(m_importITunesAction, SIGNAL(triggered()), this, SLOT(importITunesAudio()));
     //connect(this, SIGNAL(canImportITunesAudio(bool)), action, SLOT(setEnabled(bool)));
-    m_keyReference->registerShortcut(action);
-    menu->addAction(action);
+    m_keyReference->registerShortcut(m_importITunesAction);
+    menu->addAction(m_importITunesAction);
 #endif
 
     action = new QAction(tr("&Export Audio File..."), this);
--- a/main/MainWindow.h	Fri Oct 15 11:07:11 2010 +0100
+++ b/main/MainWindow.h	Mon Oct 18 13:24:38 2010 +0100
@@ -58,6 +58,7 @@
 class KeyReference;
 class Labeller;
 class ActivityLog;
+class SVApplication;
 
 class MainWindow : public MainWindowBase
 {
@@ -67,6 +68,8 @@
     MainWindow(bool withAudioOutput = true,
                bool withOSCSupport = true);
     virtual ~MainWindow();
+    
+    friend class SVApplication;
 
 signals:
     virtual void canChangeSolo(bool);
@@ -209,6 +212,7 @@
     QAction                 *m_playAction;
     QAction                 *m_playSelectionAction;
     QAction                 *m_playLoopAction;
+    QAction                 *m_importITunesAction;
 
     bool                     m_soloModified;
     bool                     m_prevSolo;
--- a/main/main.cpp	Fri Oct 15 11:07:11 2010 +0100
+++ b/main/main.cpp	Mon Oct 18 13:24:38 2010 +0100
@@ -220,12 +220,15 @@
     void setupDockMenu() {
         std::cerr << "SV adding mac dock menu" << std::endl;
         QMenu *dockMenu = new QMenu();
+        /*
         QStringList nowPlaying = iTunesNowPlaying();
         QString theText = nowPlaying.at(0);
         if (theText == ""){
             theText = "[[No current track in iTunes]]";
         }
         dockMenu->addAction(theText);
+        */
+        dockMenu->addAction(m_mainWindow->m_importITunesAction);
         qt_mac_set_dock_menu(dockMenu);
     }
 #endif