Close players instead of quitting the app
This commit is contained in:
		
							parent
							
								
									ae54c8af6a
								
							
						
					
					
						commit
						591488c497
					
				
					 1 changed files with 7 additions and 3 deletions
				
			
		| 
						 | 
					@ -21,7 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 | 
				
			||||||
#include "main/main_account.h"
 | 
					#include "main/main_account.h"
 | 
				
			||||||
#include "main/main_session.h"
 | 
					#include "main/main_session.h"
 | 
				
			||||||
#include "mainwindow.h"
 | 
					#include "mainwindow.h"
 | 
				
			||||||
#include "app.h"
 | 
					#include "mainwidget.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QtCore/QBuffer>
 | 
					#include <QtCore/QBuffer>
 | 
				
			||||||
#include <QtGui/QGuiApplication>
 | 
					#include <QtGui/QGuiApplication>
 | 
				
			||||||
| 
						 | 
					@ -174,9 +174,13 @@ void HandleMethodCall(
 | 
				
			||||||
			auto parametersCopy = parameters;
 | 
								auto parametersCopy = parameters;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (method_name == "Quit") {
 | 
								if (method_name == "Quit") {
 | 
				
			||||||
				App::quit();
 | 
									if (const auto main = App::main()) {
 | 
				
			||||||
 | 
										main->closeBothPlayers();
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
			} else if (method_name == "Raise") {
 | 
								} else if (method_name == "Raise") {
 | 
				
			||||||
				App::wnd()->showFromTray();
 | 
									if (const auto window = App::wnd()) {
 | 
				
			||||||
 | 
										window->showFromTray();
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
			} else if (method_name == "Next") {
 | 
								} else if (method_name == "Next") {
 | 
				
			||||||
				Media::Player::instance()->next();
 | 
									Media::Player::instance()->next();
 | 
				
			||||||
			} else if (method_name == "Pause") {
 | 
								} else if (method_name == "Pause") {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue