mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 04:30:05 +00:00 
			
		
		
		
	
							parent
							
								
									84b214e39e
								
							
						
					
					
						commit
						1efc311a86
					
				
					 7 changed files with 223 additions and 1 deletions
				
			
		
							
								
								
									
										19
									
								
								scwx-qt/source/scwx/qt/main/versions.hpp.in
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								scwx-qt/source/scwx/qt/main/versions.hpp.in
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,19 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <cstdint> | ||||
| #include <string> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace qt | ||||
| { | ||||
| namespace main | ||||
| { | ||||
| 
 | ||||
| const std::string   kCommitString_ {"${commit_string}"}; | ||||
| const std::uint16_t kCopyrightYear_ {${copyright_year}u}; | ||||
| const std::string   kVersionString_ {"${version_string}"}; | ||||
| 
 | ||||
| } // namespace main
 | ||||
| } // namespace qt
 | ||||
| } // namespace scwx
 | ||||
|  | @ -1,5 +1,6 @@ | |||
| #include "about_dialog.hpp" | ||||
| #include "ui_about_dialog.h" | ||||
| #include <scwx/qt/main/versions.hpp> | ||||
| #include <scwx/qt/manager/resource_manager.hpp> | ||||
| 
 | ||||
| #include <QFontDatabase> | ||||
|  | @ -31,6 +32,28 @@ AboutDialog::AboutDialog(QWidget* parent) : | |||
|       QFontDatabase::applicationFontFamilies(titleFontId).at(0); | ||||
|    QFont titleFont(titleFontFamily, 14); | ||||
|    ui->titleLabel->setFont(titleFont); | ||||
| 
 | ||||
|    QString repositoryUrl = | ||||
|       QString("https://github.com/dpaulat/supercell-wx/tree/%1") | ||||
|          .arg(QString::fromStdString(main::kCommitString_)); | ||||
| 
 | ||||
|    // Remove +dirty from the URL
 | ||||
|    qsizetype delimiter = repositoryUrl.indexOf('+'); | ||||
|    if (delimiter != -1) | ||||
|    { | ||||
|       repositoryUrl = repositoryUrl.left(delimiter); | ||||
|    } | ||||
| 
 | ||||
|    ui->versionLabel->setText( | ||||
|       tr("Version %1").arg(QString::fromStdString(main::kVersionString_))); | ||||
|    ui->revisionLabel->setText( | ||||
|       tr("Git Revision <a href=\"%1\">%2</a>") | ||||
|          .arg(repositoryUrl) | ||||
|          .arg(QString::fromStdString(main::kCommitString_))); | ||||
|    ui->copyrightLabel->setText( | ||||
|       tr("Copyright \302\251 2021-%1 Dan Paulat").arg(main::kCopyrightYear_)); | ||||
| 
 | ||||
|    ui->revisionLabel->setOpenExternalLinks(true); | ||||
| } | ||||
| 
 | ||||
| AboutDialog::~AboutDialog() | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat