mirror of
				https://github.com/saitohirga/WSJT-X.git
				synced 2025-10-31 13:10:19 -04:00 
			
		
		
		
	Implement a user option to set font sizes.
Updates to User's Guide. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3501 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
		
							parent
							
								
									30712a3ce8
								
							
						
					
					
						commit
						3035edab05
					
				
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										16
									
								
								main.cpp
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								main.cpp
									
									
									
									
									
								
							| @ -17,14 +17,16 @@ int main(int argc, char *argv[]) | |||||||
|   QApplication a(argc, argv); |   QApplication a(argc, argv); | ||||||
| 
 | 
 | ||||||
|   QFile f("fonts.txt"); |   QFile f("fonts.txt"); | ||||||
|  |   qint32 fontSize,fontWeight,fontSize2,fontWeight2;   // Defaults 8 50 10 50
 | ||||||
|  |   fontSize2=10; | ||||||
|  |   fontWeight2=50; | ||||||
|   if(f.open(QIODevice::ReadOnly)) { |   if(f.open(QIODevice::ReadOnly)) { | ||||||
|      QTextStream in(&f);                          //Example:
 |      QTextStream in(&f); | ||||||
|      QString fontFamily;                          // helvetica
 |      in >> fontSize >> fontWeight >> fontSize2 >> fontWeight2; | ||||||
|      qint32 fontSize,fontWeight;                  // 8,50
 |  | ||||||
|      in >> fontFamily >> fontSize >> fontWeight; |  | ||||||
|      f.close(); |      f.close(); | ||||||
|      QFont font; |      QFont font=a.font(); | ||||||
|      font=QFont(fontFamily,fontSize,fontWeight); |      if(fontSize!=8) font.setPointSize(fontSize); | ||||||
|  |      font.setWeight(fontWeight);                       //Set the GUI fonts
 | ||||||
|      a.setFont(font); |      a.setFont(font); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| @ -54,7 +56,7 @@ int main(int argc, char *argv[]) | |||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| // Multiple instances:  Call MainWindow() with the UUID key
 | // Multiple instances:  Call MainWindow() with the UUID key
 | ||||||
|   MainWindow w(&mem_jt9, &my_key); |   MainWindow w(&mem_jt9, &my_key, fontSize2, fontWeight2); | ||||||
|   w.show(); |   w.show(); | ||||||
|   return a.exec(); |   return a.exec(); | ||||||
| } | } | ||||||
|  | |||||||
| @ -40,7 +40,9 @@ QString Program_Title_Version="  WSJT-X   v1.1, r" + rev.mid(6,4) + | |||||||
| 
 | 
 | ||||||
| //-------------------------------------------------- MainWindow constructor
 | //-------------------------------------------------- MainWindow constructor
 | ||||||
| // Multiple instances: new arg *thekey
 | // Multiple instances: new arg *thekey
 | ||||||
| MainWindow::MainWindow(QSharedMemory *shdmem, QString *thekey, QWidget *parent) : | MainWindow::MainWindow(QSharedMemory *shdmem, QString *thekey, \ | ||||||
|  |                        qint32 fontSize2, qint32 fontWeight2, \ | ||||||
|  |                        QWidget *parent) : | ||||||
|   QMainWindow(parent), |   QMainWindow(parent), | ||||||
|   ui(new Ui::MainWindow) |   ui(new Ui::MainWindow) | ||||||
| { | { | ||||||
| @ -114,6 +116,12 @@ MainWindow::MainWindow(QSharedMemory *shdmem, QString *thekey, QWidget *parent) | |||||||
|   connect(ui->freeTextMsg, SIGNAL(customContextMenuRequested(const QPoint&)), |   connect(ui->freeTextMsg, SIGNAL(customContextMenuRequested(const QPoint&)), | ||||||
|       this, SLOT(showMacros(const QPoint&))); |       this, SLOT(showMacros(const QPoint&))); | ||||||
| 
 | 
 | ||||||
|  |   QFont font=ui->decodedTextBrowser->font(); | ||||||
|  |   font.setPointSize(fontSize2); | ||||||
|  |   font.setWeight(fontWeight2); | ||||||
|  |   ui->decodedTextBrowser->setFont(font); | ||||||
|  |   ui->decodedTextBrowser2->setFont(font); | ||||||
|  | 
 | ||||||
|   QTimer *guiTimer = new QTimer(this); |   QTimer *guiTimer = new QTimer(this); | ||||||
|   connect(guiTimer, SIGNAL(timeout()), this, SLOT(guiUpdate())); |   connect(guiTimer, SIGNAL(timeout()), this, SLOT(guiUpdate())); | ||||||
|   guiTimer->start(100);                            //Don't change the 100 ms!
 |   guiTimer->start(100);                            //Don't change the 100 ms!
 | ||||||
| @ -320,8 +328,8 @@ MainWindow::MainWindow(QSharedMemory *shdmem, QString *thekey, QWidget *parent) | |||||||
|   if(ui->actionAFMHot->isChecked()) on_actionAFMHot_triggered(); |   if(ui->actionAFMHot->isChecked()) on_actionAFMHot_triggered(); | ||||||
|   if(ui->actionBlue->isChecked()) on_actionBlue_triggered(); |   if(ui->actionBlue->isChecked()) on_actionBlue_triggered(); | ||||||
| 
 | 
 | ||||||
|   ui->decodedTextLabel->setFont(ui->decodedTextBrowser2->font()); |   ui->decodedTextLabel->setFont(ui->decodedTextBrowser->font()); | ||||||
|   ui->decodedTextLabel2->setFont(ui->decodedTextBrowser->font()); |   ui->decodedTextLabel2->setFont(ui->decodedTextBrowser2->font()); | ||||||
|   t="UTC   dB   DT Freq   Message"; |   t="UTC   dB   DT Freq   Message"; | ||||||
|   ui->decodedTextLabel->setText(t); |   ui->decodedTextLabel->setText(t); | ||||||
|   ui->decodedTextLabel2->setText(t); |   ui->decodedTextLabel2->setText(t); | ||||||
|  | |||||||
| @ -29,7 +29,9 @@ class MainWindow : public QMainWindow | |||||||
| 
 | 
 | ||||||
| // Multiple instances: call MainWindow() with *thekey
 | // Multiple instances: call MainWindow() with *thekey
 | ||||||
| public: | public: | ||||||
|   explicit MainWindow(QSharedMemory *shdmem, QString *thekey, QWidget *parent = 0); |   explicit MainWindow(QSharedMemory *shdmem, QString *thekey, \ | ||||||
|  |                       qint32 fontSize2, qint32 fontWeight2, \ | ||||||
|  |                       QWidget *parent = 0); | ||||||
|   ~MainWindow(); |   ~MainWindow(); | ||||||
| 
 | 
 | ||||||
| public slots: | public slots: | ||||||
|  | |||||||
| @ -1314,7 +1314,7 @@ p, li { white-space: pre-wrap; } | |||||||
|                   <string/> |                   <string/> | ||||||
|                  </property> |                  </property> | ||||||
|                  <attribute name="buttonGroup"> |                  <attribute name="buttonGroup"> | ||||||
|                   <string notr="true">buttonGroup</string> |                   <string>buttonGroup</string> | ||||||
|                  </attribute> |                  </attribute> | ||||||
|                 </widget> |                 </widget> | ||||||
|                </item> |                </item> | ||||||
| @ -1348,7 +1348,7 @@ p, li { white-space: pre-wrap; } | |||||||
|                   <bool>true</bool> |                   <bool>true</bool> | ||||||
|                  </property> |                  </property> | ||||||
|                  <attribute name="buttonGroup"> |                  <attribute name="buttonGroup"> | ||||||
|                   <string notr="true">buttonGroup</string> |                   <string>buttonGroup</string> | ||||||
|                  </attribute> |                  </attribute> | ||||||
|                 </widget> |                 </widget> | ||||||
|                </item> |                </item> | ||||||
| @ -1379,7 +1379,7 @@ p, li { white-space: pre-wrap; } | |||||||
|                   <string/> |                   <string/> | ||||||
|                  </property> |                  </property> | ||||||
|                  <attribute name="buttonGroup"> |                  <attribute name="buttonGroup"> | ||||||
|                   <string notr="true">buttonGroup</string> |                   <string>buttonGroup</string> | ||||||
|                  </attribute> |                  </attribute> | ||||||
|                 </widget> |                 </widget> | ||||||
|                </item> |                </item> | ||||||
| @ -1403,13 +1403,6 @@ p, li { white-space: pre-wrap; } | |||||||
|                    <height>16777215</height> |                    <height>16777215</height> | ||||||
|                   </size> |                   </size> | ||||||
|                  </property> |                  </property> | ||||||
|                  <property name="font"> |  | ||||||
|                   <font> |  | ||||||
|                    <family>Droid Sans</family> |  | ||||||
|                    <weight>50</weight> |  | ||||||
|                    <bold>false</bold> |  | ||||||
|                   </font> |  | ||||||
|                  </property> |  | ||||||
|                  <property name="text"> |                  <property name="text"> | ||||||
|                   <string/> |                   <string/> | ||||||
|                  </property> |                  </property> | ||||||
| @ -1547,7 +1540,7 @@ p, li { white-space: pre-wrap; } | |||||||
|                   <string/> |                   <string/> | ||||||
|                  </property> |                  </property> | ||||||
|                  <attribute name="buttonGroup"> |                  <attribute name="buttonGroup"> | ||||||
|                   <string notr="true">buttonGroup</string> |                   <string>buttonGroup</string> | ||||||
|                  </attribute> |                  </attribute> | ||||||
|                 </widget> |                 </widget> | ||||||
|                </item> |                </item> | ||||||
| @ -1695,7 +1688,7 @@ p, li { white-space: pre-wrap; } | |||||||
|                   <string/> |                   <string/> | ||||||
|                  </property> |                  </property> | ||||||
|                  <attribute name="buttonGroup"> |                  <attribute name="buttonGroup"> | ||||||
|                   <string notr="true">buttonGroup</string> |                   <string>buttonGroup</string> | ||||||
|                  </attribute> |                  </attribute> | ||||||
|                 </widget> |                 </widget> | ||||||
|                </item> |                </item> | ||||||
| @ -1726,7 +1719,7 @@ p, li { white-space: pre-wrap; } | |||||||
|                   <string/> |                   <string/> | ||||||
|                  </property> |                  </property> | ||||||
|                  <attribute name="buttonGroup"> |                  <attribute name="buttonGroup"> | ||||||
|                   <string notr="true">buttonGroup</string> |                   <string>buttonGroup</string> | ||||||
|                  </attribute> |                  </attribute> | ||||||
|                 </widget> |                 </widget> | ||||||
|                </item> |                </item> | ||||||
| @ -2209,7 +2202,7 @@ p, li { white-space: pre-wrap; } | |||||||
|      <x>0</x> |      <x>0</x> | ||||||
|      <y>0</y> |      <y>0</y> | ||||||
|      <width>760</width> |      <width>760</width> | ||||||
|      <height>22</height> |      <height>21</height> | ||||||
|     </rect> |     </rect> | ||||||
|    </property> |    </property> | ||||||
|    <widget class="QMenu" name="menuFile"> |    <widget class="QMenu" name="menuFile"> | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user