comparison main/main.cpp @ 366:d0c5831d6528 macness

First step in creating a useful dock menu for SV; a placeholder item is added, so far
author Dan Stowell <dan.stowell@eecs.qmul.ac.uk>
date Mon, 11 Oct 2010 16:55:24 +0100
parents 174ca518546f
children 726e1c1382f3
comparison
equal deleted inserted replaced
365:174ca518546f 366:d0c5831d6528
35 #include <QDir> 35 #include <QDir>
36 #include <QSplashScreen> 36 #include <QSplashScreen>
37 #include <QTimer> 37 #include <QTimer>
38 #include <QPainter> 38 #include <QPainter>
39 #include <QFileOpenEvent> 39 #include <QFileOpenEvent>
40 #include <QMenu>
41 #ifdef Q_WS_MAC
42 void qt_mac_set_dock_menu(QMenu *menu); // must declare it ourselves, weirdly enough
43 #endif
40 44
41 #include "../version.h" 45 #include "../version.h"
42 46
43 #include <iostream> 47 #include <iostream>
44 #include <signal.h> 48 #include <signal.h>
208 212
209 void handleFilepathArgument(QString path, QSplashScreen *splash); 213 void handleFilepathArgument(QString path, QSplashScreen *splash);
210 214
211 bool m_readyForFiles; 215 bool m_readyForFiles;
212 QStringList m_filepathQueue; 216 QStringList m_filepathQueue;
217
218 #ifdef Q_WS_MAC
219 void setupDockMenu() {
220 std::cerr << "SV adding mac dock menu" << std::endl;
221 QMenu *dockMenu = new QMenu();
222 dockMenu->addAction("a SV DOCK action");
223 qt_mac_set_dock_menu(dockMenu);
224 }
225 #endif
226
213 227
214 protected: 228 protected:
215 MainWindow *m_mainWindow; 229 MainWindow *m_mainWindow;
216 bool event(QEvent *); 230 bool event(QEvent *);
217 231
386 if (wisdom != "") { 400 if (wisdom != "") {
387 fftw_import_wisdom_from_string(wisdom.toLocal8Bit().data()); 401 fftw_import_wisdom_from_string(wisdom.toLocal8Bit().data());
388 } 402 }
389 #endif 403 #endif
390 settings.endGroup(); 404 settings.endGroup();
405 #endif
406
407 #ifdef Q_WS_MAC
408 application.setupDockMenu();
391 #endif 409 #endif
392 410
393 if (splash) splash->finish(gui); 411 if (splash) splash->finish(gui);
394 delete splash; 412 delete splash;
395 413