Move about info to settings
This commit is contained in:
		
							parent
							
								
									ca99f570f7
								
							
						
					
					
						commit
						58f6283fe3
					
				@ -1,6 +1,5 @@
 | 
				
			|||||||
#include "manager.h"
 | 
					#include "manager.h"
 | 
				
			||||||
#include "capturer.h"
 | 
					#include "capturer.h"
 | 
				
			||||||
#include "commonmodels.h"
 | 
					 | 
				
			||||||
#include "corrector.h"
 | 
					#include "corrector.h"
 | 
				
			||||||
#include "debug.h"
 | 
					#include "debug.h"
 | 
				
			||||||
#include "recognizer.h"
 | 
					#include "recognizer.h"
 | 
				
			||||||
@ -12,7 +11,6 @@
 | 
				
			|||||||
#include "updates.h"
 | 
					#include "updates.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QApplication>
 | 
					#include <QApplication>
 | 
				
			||||||
#include <QMessageBox>
 | 
					 | 
				
			||||||
#include <QNetworkProxy>
 | 
					#include <QNetworkProxy>
 | 
				
			||||||
#include <QThread>
 | 
					#include <QThread>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -290,25 +288,6 @@ void Manager::copyLastToClipboard()
 | 
				
			|||||||
  representer_->clipboardLast();
 | 
					  representer_->clipboardLast();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void Manager::about()
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  const auto mail = "translator@gres.biz";
 | 
					 | 
				
			||||||
  const auto issues = "https://github.com/OneMoreGres/ScreenTranslator/issues";
 | 
					 | 
				
			||||||
  const auto text =
 | 
					 | 
				
			||||||
      QObject::tr(
 | 
					 | 
				
			||||||
          R"(<p>Optical character recognition (OCR) and translation tool</p>
 | 
					 | 
				
			||||||
<p>Version: %1</p>
 | 
					 | 
				
			||||||
<p>Author: Gres (<a href="mailto:%2">%2</a>)</p>
 | 
					 | 
				
			||||||
<p>Issues: <a href="%3">github</a></p>)")
 | 
					 | 
				
			||||||
          .arg(QApplication::applicationVersion(), mail, issues);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  QMessageBox message(QMessageBox::Information, QObject::tr("About"), text,
 | 
					 | 
				
			||||||
                      QMessageBox::Ok);
 | 
					 | 
				
			||||||
  message.setIconPixmap(QIcon(":/icons/app.png").pixmap(QSize(64, 64)));
 | 
					 | 
				
			||||||
  message.setTextFormat(Qt::RichText);
 | 
					 | 
				
			||||||
  message.exec();
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void Manager::quit()
 | 
					void Manager::quit()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  QApplication::quit();
 | 
					  QApplication::quit();
 | 
				
			||||||
 | 
				
			|||||||
@ -25,7 +25,6 @@ public:
 | 
				
			|||||||
  void showTranslator();
 | 
					  void showTranslator();
 | 
				
			||||||
  void settings();
 | 
					  void settings();
 | 
				
			||||||
  void copyLastToClipboard();
 | 
					  void copyLastToClipboard();
 | 
				
			||||||
  void about();
 | 
					 | 
				
			||||||
  void quit();
 | 
					  void quit();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
 | 
				
			|||||||
@ -33,8 +33,8 @@ SettingsEditor::SettingsEditor(Manager &manager, update::Loader &updater)
 | 
				
			|||||||
  {
 | 
					  {
 | 
				
			||||||
    auto model = new QStringListModel(this);
 | 
					    auto model = new QStringListModel(this);
 | 
				
			||||||
    model->setStringList({tr("General"), tr("Recognition"), tr("Correction"),
 | 
					    model->setStringList({tr("General"), tr("Recognition"), tr("Correction"),
 | 
				
			||||||
                          tr("Translation"), tr("Representation"),
 | 
					                          tr("Translation"), tr("Representation"), tr("Update"),
 | 
				
			||||||
                          tr("Update")});
 | 
					                          tr("About")});
 | 
				
			||||||
    ui->pagesList->setModel(model);
 | 
					    ui->pagesList->setModel(model);
 | 
				
			||||||
    auto selection = ui->pagesList->selectionModel();
 | 
					    auto selection = ui->pagesList->selectionModel();
 | 
				
			||||||
    connect(selection, &QItemSelectionModel::currentRowChanged,  //
 | 
					    connect(selection, &QItemSelectionModel::currentRowChanged,  //
 | 
				
			||||||
@ -103,6 +103,24 @@ SettingsEditor::SettingsEditor(Manager &manager, update::Loader &updater)
 | 
				
			|||||||
  connect(ui->applyUpdates, &QPushButton::clicked,  //
 | 
					  connect(ui->applyUpdates, &QPushButton::clicked,  //
 | 
				
			||||||
          &updater_, &update::Loader::applyUserActions);
 | 
					          &updater_, &update::Loader::applyUserActions);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // about
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					    const auto mail = "translator@gres.biz";
 | 
				
			||||||
 | 
					    const auto issues =
 | 
				
			||||||
 | 
					        "https://github.com/OneMoreGres/ScreenTranslator/issues";
 | 
				
			||||||
 | 
					    const auto aboutText =
 | 
				
			||||||
 | 
					        QObject::tr(
 | 
				
			||||||
 | 
					            R"(<p>Optical character recognition (OCR) and translation tool</p>
 | 
				
			||||||
 | 
					        <p>Version: %1</p>
 | 
				
			||||||
 | 
					        <p>Author: Gres (<a href="mailto:%2">%2</a>)</p>
 | 
				
			||||||
 | 
					        <p>Issues: <a href="%3">%3</a></p>)")
 | 
				
			||||||
 | 
					            .arg(QApplication::applicationVersion(), mail, issues);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ui->aboutLabel->setText(aboutText);
 | 
				
			||||||
 | 
					    ui->aboutLabel->setTextFormat(Qt::RichText);
 | 
				
			||||||
 | 
					    ui->aboutLabel->setOpenExternalLinks(true);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  new service::WidgetState(this);
 | 
					  new service::WidgetState(this);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -632,6 +632,30 @@
 | 
				
			|||||||
       </item>
 | 
					       </item>
 | 
				
			||||||
      </layout>
 | 
					      </layout>
 | 
				
			||||||
     </widget>
 | 
					     </widget>
 | 
				
			||||||
 | 
					     <widget class="QWidget" name="pageAbout">
 | 
				
			||||||
 | 
					      <layout class="QVBoxLayout" name="verticalLayout">
 | 
				
			||||||
 | 
					       <item>
 | 
				
			||||||
 | 
					        <widget class="QLabel" name="aboutLabel">
 | 
				
			||||||
 | 
					         <property name="text">
 | 
				
			||||||
 | 
					          <string/>
 | 
				
			||||||
 | 
					         </property>
 | 
				
			||||||
 | 
					        </widget>
 | 
				
			||||||
 | 
					       </item>
 | 
				
			||||||
 | 
					       <item>
 | 
				
			||||||
 | 
					        <spacer name="verticalSpacer">
 | 
				
			||||||
 | 
					         <property name="orientation">
 | 
				
			||||||
 | 
					          <enum>Qt::Vertical</enum>
 | 
				
			||||||
 | 
					         </property>
 | 
				
			||||||
 | 
					         <property name="sizeHint" stdset="0">
 | 
				
			||||||
 | 
					          <size>
 | 
				
			||||||
 | 
					           <width>20</width>
 | 
				
			||||||
 | 
					           <height>40</height>
 | 
				
			||||||
 | 
					          </size>
 | 
				
			||||||
 | 
					         </property>
 | 
				
			||||||
 | 
					        </spacer>
 | 
				
			||||||
 | 
					       </item>
 | 
				
			||||||
 | 
					      </layout>
 | 
				
			||||||
 | 
					     </widget>
 | 
				
			||||||
    </widget>
 | 
					    </widget>
 | 
				
			||||||
   </item>
 | 
					   </item>
 | 
				
			||||||
  </layout>
 | 
					  </layout>
 | 
				
			||||||
 | 
				
			|||||||
@ -231,12 +231,6 @@ QMenu *TrayIcon::contextMenu()
 | 
				
			|||||||
            this, [this] { manager_.settings(); });
 | 
					            this, [this] { manager_.settings(); });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  {
 | 
					 | 
				
			||||||
    auto action = menu->addAction(tr("About"));
 | 
					 | 
				
			||||||
    connect(action, &QAction::triggered,  //
 | 
					 | 
				
			||||||
            this, [this] { manager_.about(); });
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    auto action = menu->addAction(tr("Quit"));
 | 
					    auto action = menu->addAction(tr("Quit"));
 | 
				
			||||||
    connect(action, &QAction::triggered,  //
 | 
					    connect(action, &QAction::triggered,  //
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user