changeset: 17805:12586f512c62
bookmark: @
tag: qbase
tag: qsci_2_6_mac_p07
tag: qtip
tag: tip
user: Torsten
date: Wed Oct 30 22:14:02 2013 +0100
summary: [mq]: qsci_2_6_mac_p07
diff -r f3e25230b1f3 -r 12586f512c62 libgui/src/m-editor/file-editor-tab.cc
--- a/libgui/src/m-editor/file-editor-tab.cc Wed Oct 30 02:08:41 2013 -0400
+++ b/libgui/src/m-editor/file-editor-tab.cc Wed Oct 30 22:14:02 2013 +0100
@@ -103,21 +103,21 @@
_edit_area->setMarginsBackgroundColor (QColor (232, 232, 220));
_edit_area->setMarginType (2, QsciScintilla::TextMargin);
- // code folding
+ //// code folding
_edit_area->setMarginType (3, QsciScintilla::SymbolMargin);
_edit_area->setFolding (QsciScintilla::BoxedTreeFoldStyle , 3);
- // other features
- _edit_area->setBraceMatching (QsciScintilla::StrictBraceMatch);
- _edit_area->setAutoIndent (true);
- _edit_area->setIndentationWidth (2);
- _edit_area->setIndentationsUseTabs (false);
+ //// other features
+ //_edit_area->setBraceMatching (QsciScintilla::StrictBraceMatch);
+ //_edit_area->setAutoIndent (true);
+ //_edit_area->setIndentationWidth (2);
+ //_edit_area->setIndentationsUseTabs (false);
_edit_area->setUtf8 (true);
- // auto completion
- _edit_area->autoCompleteFromAll ();
- _edit_area->setAutoCompletionSource (QsciScintilla::AcsAll);
+ //// auto completion
+ //_edit_area->autoCompleteFromAll ();
+ //_edit_area->setAutoCompletionSource (QsciScintilla::AcsAll);
QVBoxLayout *edit_area_layout = new QVBoxLayout ();
edit_area_layout->addWidget (_edit_area);
@@ -145,8 +145,8 @@
QsciLexer *lexer = _edit_area->lexer ();
if (lexer)
{
+ _edit_area->setLexer (); // lexer is detached by qscintilla
delete lexer;
- _edit_area->setLexer (0);
}
if (_find_dialog)
{
@@ -227,9 +227,7 @@
if (_lexer_apis)
_lexer_apis->cancelPreparation (); // stop preparing if apis exists
- QsciLexer *lexer = _edit_area->lexer ();
- delete lexer;
- lexer = 0;
+ QsciLexer *lexer = 0;
if (_file_name.endsWith (".m")
|| _file_name.endsWith ("octaverc"))
@@ -286,48 +284,48 @@
}
}
- _lexer_apis = new QsciAPIs(lexer);
- if (_lexer_apis)
- {
- // get path to prepared api info
- QDesktopServices desktopServices;
- QString prep_apis_path
- = desktopServices.storageLocation (QDesktopServices::HomeLocation)
- + "/.config/octave/" + QString(OCTAVE_VERSION) + "/qsci/";
- _prep_apis_file = prep_apis_path + lexer->lexer () + ".pap";
+ //_lexer_apis = new QsciAPIs(lexer);
+ //if (_lexer_apis)
+ //{
+ //// get path to prepared api info
+ //QDesktopServices desktopServices;
+ //QString prep_apis_path
+ //= desktopServices.storageLocation (QDesktopServices::HomeLocation)
+ //+ "/.config/octave/" + QString(OCTAVE_VERSION) + "/qsci/";
+ //_prep_apis_file = prep_apis_path + lexer->lexer () + ".pap";
- if (!_lexer_apis->loadPrepared (_prep_apis_file))
- {
- // no prepared info loaded, prepare and save if possible
+ //if (!_lexer_apis->loadPrepared (_prep_apis_file))
+ //{
+ //// no prepared info loaded, prepare and save if possible
- // create raw apis info
- QString keyword;
- QStringList keyword_list;
- int i,j;
- for (i=1; i<=3; i++) // test the first 5 keyword sets
- {
- keyword = QString(lexer->keywords (i)); // get list
- keyword_list = keyword.split (QRegExp ("\\s+")); // split
- for (j = 0; j < keyword_list.size (); j++) // add to API
- _lexer_apis->add (keyword_list.at (j));
- }
+ //// create raw apis info
+ //QString keyword;
+ //QStringList keyword_list;
+ //int i,j;
+ //for (i=1; i<=3; i++) // test the first 5 keyword sets
+ //{
+ //keyword = QString(lexer->keywords (i)); // get list
+ //keyword_list = keyword.split (QRegExp ("\\s+")); // split
+ //for (j = 0; j < keyword_list.size (); j++) // add to API
+ //_lexer_apis->add (keyword_list.at (j));
+ //}
- // dsiconnect slot for saving prepared info if already connected
- disconnect (_lexer_apis, SIGNAL (apiPreparationFinished ()), 0, 0);
- // check whether path for prepared info exists or can be created
- if (QDir("/").mkpath (prep_apis_path))
- {
- // path exists, apis info can be saved there
- connect (_lexer_apis, SIGNAL (apiPreparationFinished ()),
- this, SLOT (save_apis_info ()));
- }
- _lexer_apis->prepare (); // prepare apis info
- }
- }
+ //// dsiconnect slot for saving prepared info if already connected
+ //disconnect (_lexer_apis, SIGNAL (apiPreparationFinished ()), 0, 0);
+ //// check whether path for prepared info exists or can be created
+ //if (QDir("/").mkpath (prep_apis_path))
+ //{
+ //// path exists, apis info can be saved there
+ //connect (_lexer_apis, SIGNAL (apiPreparationFinished ()),
+ //this, SLOT (save_apis_info ()));
+ //}
+ //_lexer_apis->prepare (); // prepare apis info
+ //}
+ //}
QSettings *settings = resource_manager::get_settings ();
- if (settings)
- lexer->readSettings (*settings);
+ //if (settings)
+ //lexer->readSettings (*settings);
_edit_area->setLexer (lexer);
@@ -1232,50 +1230,50 @@
{
// QSettings pointer is checked before emitting.
- update_lexer ();
+ //update_lexer ();
- //highlight current line color
- QVariant default_var = QColor (240, 240, 240);
- QColor setting_color = settings->value ("editor/highlight_current_line_color",
- default_var).value ();
- _edit_area->setCaretLineBackgroundColor (setting_color);
- _edit_area->setCaretLineVisible
- (settings->value ("editor/highlightCurrentLine", true).toBool ());
+ ////highlight current line color
+ //QVariant default_var = QColor (240, 240, 240);
+ //QColor setting_color = settings->value ("editor/highlight_current_line_color",
+ //default_var).value ();
+ //_edit_area->setCaretLineBackgroundColor (setting_color);
+ //_edit_area->setCaretLineVisible
+ //(settings->value ("editor/highlightCurrentLine", true).toBool ());
- if (settings->value ("editor/codeCompletion", true).toBool ()) // auto compl.
- {
- bool match_keywords = settings->value
- ("editor/codeCompletion_keywords",true).toBool ();
- bool match_document = settings->value
- ("editor/codeCompletion_document",true).toBool ();
+ //if (settings->value ("editor/codeCompletion", true).toBool ()) // auto compl.
+ //{
+ //bool match_keywords = settings->value
+ //("editor/codeCompletion_keywords",true).toBool ();
+ //bool match_document = settings->value
+ //("editor/codeCompletion_document",true).toBool ();
- QsciScintilla::AutoCompletionSource source = QsciScintilla::AcsNone;
- if (match_keywords)
- if (match_document)
- source = QsciScintilla::AcsAll;
- else
- source = QsciScintilla::AcsAPIs;
- else if (match_document)
- source = QsciScintilla::AcsDocument;
- _edit_area->setAutoCompletionSource (source);
+ //QsciScintilla::AutoCompletionSource source = QsciScintilla::AcsNone;
+ //if (match_keywords)
+ //if (match_document)
+ //source = QsciScintilla::AcsAll;
+ //else
+ //source = QsciScintilla::AcsAPIs;
+ //else if (match_document)
+ //source = QsciScintilla::AcsDocument;
+ //_edit_area->setAutoCompletionSource (source);
- _edit_area->setAutoCompletionReplaceWord
- (settings->value ("editor/codeCompletion_replace",false).toBool ());
- _edit_area->setAutoCompletionCaseSensitivity
- (settings->value ("editor/codeCompletion_case",true).toBool ());
- _edit_area->setAutoCompletionThreshold
- (settings->value ("editor/codeCompletion_threshold",2).toInt ());
- }
- else
- _edit_area->setAutoCompletionThreshold (-1);
+ //_edit_area->setAutoCompletionReplaceWord
+ //(settings->value ("editor/codeCompletion_replace",false).toBool ());
+ //_edit_area->setAutoCompletionCaseSensitivity
+ //(settings->value ("editor/codeCompletion_case",true).toBool ());
+ //_edit_area->setAutoCompletionThreshold
+ //(settings->value ("editor/codeCompletion_threshold",2).toInt ());
+ //}
+ //else
+ //_edit_area->setAutoCompletionThreshold (-1);
- if (settings->value ("editor/show_white_space",false).toBool ())
- if (settings->value ("editor/show_white_space_indent",false).toBool ())
- _edit_area->setWhitespaceVisibility (QsciScintilla::WsVisibleAfterIndent);
- else
- _edit_area->setWhitespaceVisibility (QsciScintilla::WsVisible);
- else
- _edit_area->setWhitespaceVisibility (QsciScintilla::WsInvisible);
+ //if (settings->value ("editor/show_white_space",false).toBool ())
+ //if (settings->value ("editor/show_white_space_indent",false).toBool ())
+ //_edit_area->setWhitespaceVisibility (QsciScintilla::WsVisibleAfterIndent);
+ //else
+ //_edit_area->setWhitespaceVisibility (QsciScintilla::WsVisible);
+ //else
+ //_edit_area->setWhitespaceVisibility (QsciScintilla::WsInvisible);
if (settings->value ("editor/showLineNumbers", true).toBool ())
{
@@ -1290,20 +1288,20 @@
disconnect (_edit_area, SIGNAL (linesChanged ()), 0, 0);
}
- _edit_area->setAutoIndent
- (settings->value ("editor/auto_indent",true).toBool ());
- _edit_area->setTabIndents
- (settings->value ("editor/tab_indents_line",false).toBool ());
- _edit_area->setBackspaceUnindents
- (settings->value ("editor/backspace_unindents_line",false).toBool ());
- _edit_area->setIndentationGuides
- (settings->value ("editor/show_indent_guides",false).toBool ());
+ //_edit_area->setAutoIndent
+ //(settings->value ("editor/auto_indent",true).toBool ());
+ //_edit_area->setTabIndents
+ //(settings->value ("editor/tab_indents_line",false).toBool ());
+ //_edit_area->setBackspaceUnindents
+ //(settings->value ("editor/backspace_unindents_line",false).toBool ());
+ //_edit_area->setIndentationGuides
+ //(settings->value ("editor/show_indent_guides",false).toBool ());
- _edit_area->setTabWidth
- (settings->value ("editor/tab_width",2).toInt ());
+ //_edit_area->setTabWidth
+ //(settings->value ("editor/tab_width",2).toInt ());
- _long_title = settings->value ("editor/longWindowTitle", false).toBool ();
- update_window_title (_edit_area->isModified ());
+ //_long_title = settings->value ("editor/longWindowTitle", false).toBool ();
+ //update_window_title (_edit_area->isModified ());
}
diff -r f3e25230b1f3 -r 12586f512c62 libgui/src/m-editor/octave-qscintilla.cc
--- a/libgui/src/m-editor/octave-qscintilla.cc Wed Oct 30 02:08:41 2013 -0400
+++ b/libgui/src/m-editor/octave-qscintilla.cc Wed Oct 30 22:14:02 2013 +0100
@@ -89,6 +89,7 @@
contextmenu_run (true);
}
+#ifndef Q_OS_MAC
#ifdef HAVE_QSCI_VERSION_2_6_0
// context menu requested
void
@@ -145,6 +146,7 @@
context_menu->exec (global_pos);
}
#endif
+#endif
// handle the menu entry for calling help or doc
diff -r f3e25230b1f3 -r 12586f512c62 libgui/src/m-editor/octave-qscintilla.h
--- a/libgui/src/m-editor/octave-qscintilla.h Wed Oct 30 02:08:41 2013 -0400
+++ b/libgui/src/m-editor/octave-qscintilla.h Wed Oct 30 22:14:02 2013 +0100
@@ -38,9 +38,11 @@
octave_qscintilla (QWidget *p);
~octave_qscintilla ();
+#ifndef Q_OS_MAC
#ifdef HAVE_QSCI_VERSION_2_6_0
virtual void contextMenuEvent (QContextMenuEvent *e);
#endif
+#endif
void context_help_doc (bool);
void context_edit ();
void context_run ();