Skycoder42
					
					7 years ago
					
				 
				
			 
		 
		
			
				
					
					No known key found for this signature in database
					
						
							GPG Key ID: 8E01AD9EF0578D2B
						
					
				
			
		
		
		
	
		
			
				 3 changed files with 
9 additions and 
4 deletions
			 
			
		 
		
			
				- 
					
					
					 
					examples/mvvmcore/SampleCore/sampleviewmodel.cpp
				
 
			
				- 
					
					
					 
					src/imports/mvvmquick/MsgBoxBase.qml
				
 
			
				- 
					
					
					 
					src/imports/mvvmquick/settingsuibuilder.cpp
				
 
			
		
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -43,7 +43,7 @@ void SampleViewModel::setName(QString name) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						if (_name == name) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							return; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						_name = name; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						_name = std::move(name); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						emit nameChanged(_name); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						if(_active && _eventService) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							_eventService->removeEvent(_eventId); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -88,8 +88,8 @@ void SampleViewModel::getInput() | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					void SampleViewModel::getFiles() | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						QtMvvm::getOpenFiles(this, [this](QList<QUrl> urls) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							for(auto url : urls) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						QtMvvm::getOpenFiles(this, [this](const QList<QUrl> &urls) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							for(const auto &url : urls) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								addEvent(url.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						}, tr("Open Files:"), {QStringLiteral("text/plain"), QStringLiteral("application/pdf")}); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					} | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  | 
				
			
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -69,8 +69,9 @@ AlertDialog { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							standardButtons: msgConfig.buttons | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							onStandardButtonsChanged: { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								for(var key in msgConfig.buttonTexts) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								Object.keys(msgConfig.buttonTexts).forEach(function(key) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									standardButton(key).text = msgConfig.buttonTexts[key] | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								}); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							onClicked: { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  | 
				
			
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -39,7 +39,9 @@ void SettingsUiBuilder::loadSection(const SettingsElements::Section §ion) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						auto inputFactory = QuickPresenterPrivate::currentPresenter()->inputViewFactory(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						_entryModel->setup(section, _viewModel, inputFactory); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					#ifndef QT_NO_DEBUG | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						qmlDebug(this) << "Loaded section " << section.title; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					#endif | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						emit presentSection(_entryFilterModel); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -48,7 +50,9 @@ void SettingsUiBuilder::showDialog(const QString &key, const QString &title, con | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						if(type == QStringLiteral("action")) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							_viewModel->callAction(key, properties.value(QStringLiteral("args")).toMap()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						else { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					#ifndef QT_NO_DEBUG | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							qmlDebug(this) << "Creating input dialog for settings entry " << key; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					#endif | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							getInput(title + tr(":"), QString(), qUtf8Printable(type), this, [this, key](const QVariant &value) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								if(value.isValid()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									_viewModel->saveValue(key, value); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |