comparison src/gui/window.cc @ 237:a7d0d543b334

*: make OS X builds succeed new script: deploy_build.sh, creates the app bundle
author Paper <paper@paper.us.eu.org>
date Fri, 19 Jan 2024 11:14:44 -0500
parents 4d461ef7d424
children 06d6c351925c
comparison
equal deleted inserted replaced
236:4d461ef7d424 237:a7d0d543b334
41 41
42 #include <iostream> 42 #include <iostream>
43 43
44 #ifdef MACOSX 44 #ifdef MACOSX
45 # include "sys/osx/dark_theme.h" 45 # include "sys/osx/dark_theme.h"
46 # include "sys/osx/permissions.h"
46 #elif defined(WIN32) 47 #elif defined(WIN32)
47 # include "sys/win32/dark_theme.h" 48 # include "sys/win32/dark_theme.h"
48 #endif 49 #endif
49 50
50 enum class Pages { 51 enum class Pages {
70 71
71 main_widget.reset(new QWidget(this)); 72 main_widget.reset(new QWidget(this));
72 new QHBoxLayout(main_widget.get()); 73 new QHBoxLayout(main_widget.get());
73 74
74 AddMainWidgets(); 75 AddMainWidgets();
75
76 setCentralWidget(main_widget.get()); 76 setCentralWidget(main_widget.get());
77 77
78 CreateBars(); 78 CreateBars();
79 79
80 NowPlayingPage* page = reinterpret_cast<NowPlayingPage*>(stack->widget(static_cast<int>(Pages::NOW_PLAYING))); 80 NowPlayingPage* page = reinterpret_cast<NowPlayingPage*>(stack->widget(static_cast<int>(Pages::NOW_PLAYING)));
111 if (!thread.get() || thread->isRunning()) 111 if (!thread.get() || thread->isRunning())
112 return; 112 return;
113 113
114 thread->start(); 114 thread->start();
115 }); 115 });
116
117 #ifdef MACOSX
118 if (!osx::AskForPermissions())
119 return;
120 #endif
116 121
117 timer->start(5000); 122 timer->start(5000);
118 } 123 }
119 124
120 void MainWindow::AddMainWidgets() { 125 void MainWindow::AddMainWidgets() {