Changeset ed1011a in OpenModelica
- Timestamp:
- 2016-02-08T12:18:15+01:00 (8 years ago)
- Branches:
- Added-citation-metadata, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
- Children:
- 56525d3
- Parents:
- 12b2653
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
r99b004e8 red1011a 26 26 mosh/src/omc_communication.cc 27 27 mosh/src/omc_communication.h 28 qmake.sh -
OMShell/OMShellGUI/oms.cpp
r12b2653 red1011a 214 214 215 215 OMS::OMS( QWidget* parent ) 216 : QMainWindow( parent ) 216 : QMainWindow( parent ), mpSettings(getApplicationSettings()) 217 217 { 218 218 delegate_ = 0; … … 236 236 layout_->setSpacing( 5 ); 237 237 238 fontSize_ = 11; 238 mpSettings->sync(); 239 if (mpSettings->contains("FontSize")) 240 fontSize_ = mpSettings->value("FontSize").toInt(); 241 else 242 fontSize_ = 11; 239 243 createMoshEdit(); 240 244 //createMoshError(); … … 253 257 setWindowIcon( QIcon(":/Resources/omshell-large.svg") ); 254 258 255 // set tstart message259 // set start message 256 260 const char* dateStr = __DATE__; // "Mmm dd yyyy", so dateStr+7 = "yyyy" 257 261 copyright_info_ = QString("OMShell 1.1 Copyright Open Source Modelica Consortium (OSMC) 2002-") + (dateStr+7) + "\nDistributed under OMSC-PL and GPL, see www.openmodelica.org\n\nConnected to " + omc_version_; … … 447 451 moshEdit_->setTextCursor( cursor_ ); 448 452 449 // set toriginal text settings453 // set original text settings 450 454 moshEdit_->document()->setDefaultFont(QFont("Courier New", fontSize_, QFont::Normal)); 451 455 textFormat_.setFontFamily( "Courier New" ); … … 839 843 moshEdit_->document()->setDefaultFont(font); 840 844 textFormat_.setFontPointSize( fontSize_ ); 845 commandSignFormat_.setFontPointSize( fontSize_ ); 841 846 842 847 //cursor_ = moshEdit_->textCursor(); 843 848 cursor_.clearSelection(); 844 849 moshEdit_->setTextCursor(cursor_); 850 851 mpSettings->setValue("FontSize", fontSize_); 852 mpSettings->sync(); 845 853 } 846 854 else … … 945 953 moshEdit_->clear(); 946 954 947 // set toriginal text settings955 // set original text settings 948 956 moshEdit_->document()->setDefaultFont(QFont("Courier New", fontSize_, QFont::Normal)); 949 957 … … 977 985 } 978 986 987 QString OMS::organization = "openmodelica"; /* case-sensitive string. Don't change it. Used by ini settings file. */ 988 QString OMS::application = "omshell"; /* case-sensitive string. Don't change it. Used by ini settings file. */ 989 QString OMS::utf8 = "UTF-8"; 990 991 QSettings* OMS::getApplicationSettings() 992 { 993 static int init = 0; 994 static QSettings *pSettings; 995 if (!init) { 996 init = 1; 997 pSettings = new QSettings(QSettings::IniFormat, QSettings::UserScope, organization, application); 998 pSettings->setIniCodec(utf8.toStdString().data()); 999 } 1000 return pSettings; 1001 } 1002 -
OMShell/OMShellGUI/oms.h
r8302b0e red1011a 69 69 #include <QtGui/QTextCursor> 70 70 #include <QtGui/QPlainTextEdit> 71 #include <QtCore/QSettings> 71 72 #endif 72 73 … … 137 138 QString clipboard_; 138 139 QString copyright_info_; 140 QSettings *mpSettings; 139 141 140 142 IAEX::CommandCompletion* commandcompletion_; … … 163 165 QAction* aboutQT_; // Added 2006-02-21 AF 164 166 QAction* clearWindow_; 167 168 static QString organization; 169 static QString application; 170 static QString utf8; 171 172 QSettings* getApplicationSettings(); 165 173 }; 166 174
Note: See TracChangeset
for help on using the changeset viewer.