Changeset 2223
- Timestamp:
- 08/15/08 13:47:52 (3 months ago)
- Location:
- v2/branches/dev/monkey/src
- Files:
-
- 6 modified
-
maininterface/ui/UISettings.cpp (modified) (3 diffs)
-
maininterface/ui/UISettings.ui (modified) (16 diffs)
-
pMonkeyStudio.cpp (modified) (1 diff)
-
pMonkeyStudio.h (modified) (1 diff)
-
qscintillamanager/pEditor.cpp (modified) (2 diffs)
-
qscintillamanager/pEditor.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
v2/branches/dev/monkey/src/maininterface/ui/UISettings.cpp
r1948 r2223 318 318 bgEolMode->button( eolMode() )->setChecked( true ); 319 319 cbEolVisibility->setChecked( eolVisibility() ); 320 cbAutoDetectEol->setChecked( autoDetectEol() ); 320 321 gbWhitespaceVisibilityEnabled->setChecked( whitespaceVisibility() != QsciScintilla::WsInvisible ); 321 322 if ( bgWhitespaceVisibility->button( whitespaceVisibility() ) ) … … 395 396 setCreateBackupUponOpen( cbCreateBackupUponOpen->isChecked() ) ; 396 397 setAutoEolConversion( cbAutoEolConversion->isChecked() ); 398 setAutoDetectEol( cbAutoDetectEol->isChecked() ); 397 399 setDefaultEncoding( cbDefaultEncoding->currentText() ); 398 400 setSelectionBackgroundColor( QColor( tbSelectionBackground->toolTip() ) ); … … 463 465 setEolMode( (QsciScintilla::EolMode)bgEolMode->checkedId() ); 464 466 setEolVisibility( cbEolVisibility->isChecked() ); 467 setAutoDetectEol( cbAutoDetectEol->isChecked() ); 465 468 setWhitespaceVisibility( QsciScintilla::WsInvisible ); 466 469 if ( gbWhitespaceVisibilityEnabled->isChecked() ) -
v2/branches/dev/monkey/src/maininterface/ui/UISettings.ui
r1945 r2223 213 213 <widget class="QStackedWidget" name="swPages" > 214 214 <property name="currentIndex" > 215 <number> 0</number>215 <number>10</number> 216 216 </property> 217 217 <widget class="QWidget" name="pGeneral" > … … 221 221 <y>0</y> 222 222 <width>481</width> 223 <height> 699</height>223 <height>705</height> 224 224 </rect> 225 225 </property> … … 507 507 <y>0</y> 508 508 <width>481</width> 509 <height> 699</height>509 <height>705</height> 510 510 </rect> 511 511 </property> … … 546 546 <y>0</y> 547 547 <width>481</width> 548 <height> 699</height>548 <height>705</height> 549 549 </rect> 550 550 </property> … … 772 772 <y>0</y> 773 773 <width>481</width> 774 <height> 699</height>774 <height>705</height> 775 775 </rect> 776 776 </property> … … 936 936 <y>0</y> 937 937 <width>481</width> 938 <height> 699</height>938 <height>705</height> 939 939 </rect> 940 940 </property> … … 1170 1170 <y>0</y> 1171 1171 <width>481</width> 1172 <height> 699</height>1172 <height>705</height> 1173 1173 </rect> 1174 1174 </property> … … 1431 1431 <y>0</y> 1432 1432 <width>481</width> 1433 <height> 699</height>1433 <height>705</height> 1434 1434 </rect> 1435 1435 </property> … … 1596 1596 <y>0</y> 1597 1597 <width>481</width> 1598 <height> 699</height>1598 <height>705</height> 1599 1599 </rect> 1600 1600 </property> … … 1744 1744 <y>0</y> 1745 1745 <width>481</width> 1746 <height> 699</height>1746 <height>705</height> 1747 1747 </rect> 1748 1748 </property> … … 1897 1897 <y>0</y> 1898 1898 <width>481</width> 1899 <height> 699</height>1899 <height>705</height> 1900 1900 </rect> 1901 1901 </property> … … 2193 2193 <y>0</y> 2194 2194 <width>481</width> 2195 <height> 699</height>2195 <height>705</height> 2196 2196 </rect> 2197 2197 </property> … … 2206 2206 <widget class="QGroupBox" name="gbEolMode" > 2207 2207 <property name="title" > 2208 <string>E olMode</string>2208 <string>EOL Mode</string> 2209 2209 </property> 2210 2210 <layout class="QGridLayout" > … … 2215 2215 <number>3</number> 2216 2216 </property> 2217 <item row=" 1" column="0" colspan="3" >2217 <item row="2" column="0" colspan="3" > 2218 2218 <widget class="QCheckBox" name="cbEolVisibility" > 2219 2219 <property name="text" > … … 2240 2240 <property name="text" > 2241 2241 <string>Unix</string> 2242 </property> 2243 </widget> 2244 </item> 2245 <item row="1" column="0" > 2246 <widget class="QCheckBox" name="cbAutoDetectEol" > 2247 <property name="text" > 2248 <string>Autodetect EOL</string> 2242 2249 </property> 2243 2250 </widget> … … 2468 2475 <y>0</y> 2469 2476 <width>481</width> 2470 <height> 699</height>2477 <height>705</height> 2471 2478 </rect> 2472 2479 </property> -
v2/branches/dev/monkey/src/pMonkeyStudio.cpp
r2214 r2223 1554 1554 { return MonkeyCore::settings()->value( settingsPath() +"/EolVisibility", false ).toBool(); } 1555 1555 1556 void pMonkeyStudio::setAutoDetectEol( bool detect ) 1557 { MonkeyCore::settings()->setValue( settingsPath() +"/AutoDetectEol", detect ); } 1558 1559 const bool pMonkeyStudio::autoDetectEol() 1560 { return MonkeyCore::settings()->value( settingsPath() +"/AutoDetectEol", false ).toBool(); } 1561 1556 1562 void pMonkeyStudio::setWhitespaceVisibility( QsciScintilla::WhitespaceVisibility w ) 1557 1563 { MonkeyCore::settings()->setValue( settingsPath() +"/WhitespaceVisibility", w ); } -
v2/branches/dev/monkey/src/pMonkeyStudio.h
r2205 r2223 241 241 Q_MONKEY_EXPORT void setEolVisibility( bool visible ); 242 242 Q_MONKEY_EXPORT const bool eolVisibility(); 243 Q_MONKEY_EXPORT void setAutoDetectEol( bool detect ); 244 Q_MONKEY_EXPORT const bool autoDetectEol(); 243 245 Q_MONKEY_EXPORT void setWhitespaceVisibility( QsciScintilla::WhitespaceVisibility visibility ); 244 246 Q_MONKEY_EXPORT const QsciScintilla::WhitespaceVisibility whitespaceVisibility(); -
v2/branches/dev/monkey/src/qscintillamanager/pEditor.cpp
r2022 r2223 158 158 } 159 159 160 void pEditor::autoDetectEol () 161 { 162 QString currText = text(); 163 if (text().indexOf("\r\n") != -1) 164 { 165 setEolMode (QsciScintilla::EolWindows); 166 return; 167 } 168 if (text().indexOf("\n") != -1) 169 { 170 setEolMode (QsciScintilla::EolUnix); 171 return; 172 } 173 } 174 160 175 int pEditor::lineNumbersMarginWidth() const 161 176 { … … 293 308 { 294 309 autoDetectIndent (); 310 } 311 312 //autodetect eol, if need 313 if (pMonkeyStudio::autoDetectEol()) 314 { 315 autoDetectEol (); 295 316 } 296 317 -
v2/branches/dev/monkey/src/qscintillamanager/pEditor.h
r1983 r2223 69 69 void autoDetectIndent(); 70 70 71 // Set for self EOL mode according with actual in the file 72 void autoDetectEol(); 73 71 74 protected: 72 75 void keyPressEvent( QKeyEvent* );
