# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1347482079 14400 # Node ID 501a9cc2c68f52668a6fe4f74ae69b4dfc7018b0 # Parent d4e3f29aa4991b9dfbe073e45315d40c0b459e6e maint: whitespace cleanup in GUI code diff --git a/libgui/src/documentation-dockwidget.h b/libgui/src/documentation-dockwidget.h --- a/libgui/src/documentation-dockwidget.h +++ b/libgui/src/documentation-dockwidget.h @@ -30,7 +30,7 @@ class documentation_dock_widget : public QDockWidget { Q_OBJECT -public: + public: documentation_dock_widget (QWidget *parent = 0); public slots: diff --git a/libgui/src/files-dockwidget.cc b/libgui/src/files-dockwidget.cc --- a/libgui/src/files-dockwidget.cc +++ b/libgui/src/files-dockwidget.cc @@ -82,7 +82,7 @@ _file_tree_view->setStatusTip (tr ("Doubleclick a file to open it.")); _current_directory->setText(_file_system_model->fileInfo (rootPathIndex). - absoluteFilePath ()); + absoluteFilePath ()); connect (_file_tree_view, SIGNAL (doubleClicked (const QModelIndex &)), this, SLOT (item_double_clicked (const QModelIndex &))); @@ -147,7 +147,7 @@ if (fileInfo.isDir ()) { _file_tree_view->setRootIndex (_file_system_model-> - index (fileInfo.absoluteFilePath ())); + index (fileInfo.absoluteFilePath ())); _file_system_model->setRootPath (fileInfo.absoluteFilePath ()); _current_directory->setText (fileInfo.absoluteFilePath ()); diff --git a/libgui/src/files-dockwidget.h b/libgui/src/files-dockwidget.h --- a/libgui/src/files-dockwidget.h +++ b/libgui/src/files-dockwidget.h @@ -39,13 +39,13 @@ #include /** - \class files_dock_widget - \brief Dock widget to display files in the current directory. - */ + \class files_dock_widget + \brief Dock widget to display files in the current directory. +*/ class files_dock_widget : public QDockWidget { Q_OBJECT -public: + public: /** Constructs a new files_dock_widget. */ files_dock_widget (QWidget *parent = 0); diff --git a/libgui/src/history-dockwidget.cc b/libgui/src/history-dockwidget.cc --- a/libgui/src/history-dockwidget.cc +++ b/libgui/src/history-dockwidget.cc @@ -162,7 +162,7 @@ history_dock_widget::request_history_model_update () { octave_link::instance () - ->post_event (new octave_update_history_event (*this)); + ->post_event (new octave_update_history_event (*this)); } void diff --git a/libgui/src/history-dockwidget.h b/libgui/src/history-dockwidget.h --- a/libgui/src/history-dockwidget.h +++ b/libgui/src/history-dockwidget.h @@ -35,8 +35,8 @@ class history_dock_widget : public QDockWidget, public octave_event_observer { -Q_OBJECT -public: + Q_OBJECT + public: history_dock_widget (QWidget *parent = 0); void event_accepted (octave_event *e); diff --git a/libgui/src/m-editor/file-editor-interface.h b/libgui/src/m-editor/file-editor-interface.h --- a/libgui/src/m-editor/file-editor-interface.h +++ b/libgui/src/m-editor/file-editor-interface.h @@ -35,49 +35,49 @@ Q_OBJECT public: - file_editor_interface (QTerminal *terminal, main_window *mainWindow) - : QDockWidget ((QWidget*)mainWindow) // QDockWidget constructor is explicit, hence the cast. - { - setObjectName ("FileEditor"); - _terminal = terminal; - _main_window = mainWindow; + file_editor_interface (QTerminal *terminal, main_window *mainWindow) + : QDockWidget ((QWidget*)mainWindow) // QDockWidget constructor is explicit, hence the cast. + { + setObjectName ("FileEditor"); + _terminal = terminal; + _main_window = mainWindow; - connect (this, SIGNAL (visibilityChanged (bool)), this, - SLOT (handle_visibility_changed (bool))); - } + connect (this, SIGNAL (visibilityChanged (bool)), this, + SLOT (handle_visibility_changed (bool))); + } - virtual ~file_editor_interface () { } + virtual ~file_editor_interface () { } - virtual QMenu *debug_menu () = 0; - virtual QToolBar *toolbar () = 0; + virtual QMenu *debug_menu () = 0; + virtual QToolBar *toolbar () = 0; - virtual void handle_entered_debug_mode () = 0; - virtual void handle_quit_debug_mode () = 0; + virtual void handle_entered_debug_mode () = 0; + virtual void handle_quit_debug_mode () = 0; - public slots: - virtual void request_new_file () = 0; - virtual void request_open_file () = 0; - virtual void request_open_file (const QString& fileName, bool silent = false) = 0; +public slots: + virtual void request_new_file () = 0; + virtual void request_open_file () = 0; + virtual void request_open_file (const QString& fileName, bool silent = false) = 0; - signals: - void active_changed (bool active); +signals: + void active_changed (bool active); - protected: - QTerminal* _terminal; - main_window* _main_window; +protected: + QTerminal* _terminal; + main_window* _main_window; - void closeEvent (QCloseEvent *event) - { - emit active_changed (false); - QDockWidget::closeEvent (event); - } + void closeEvent (QCloseEvent *event) + { + emit active_changed (false); + QDockWidget::closeEvent (event); + } - protected slots: - void handle_visibility_changed (bool visible) - { - if (visible) - emit active_changed (true); - } +protected slots: + void handle_visibility_changed (bool visible) + { + if (visible) + emit active_changed (true); + } }; #endif // FILEEDITORINTERFACE_H diff --git a/libgui/src/m-editor/file-editor-tab.cc b/libgui/src/m-editor/file-editor-tab.cc --- a/libgui/src/m-editor/file-editor-tab.cc +++ b/libgui/src/m-editor/file-editor-tab.cc @@ -71,7 +71,7 @@ _edit_area->setMarginsForegroundColor(QColor(96,96,96)); _edit_area->setMarginsBackgroundColor(QColor(232,232,220)); _edit_area->setMarginType (2, QsciScintilla::TextMargin); - + // code folding _edit_area->setMarginType (3, QsciScintilla::SymbolMargin); _edit_area->setFolding (QsciScintilla::BoxedTreeFoldStyle , 3); @@ -90,7 +90,7 @@ // auto completion _edit_area->autoCompleteFromAll (); _edit_area->setAutoCompletionSource(QsciScintilla::AcsAll); - + QVBoxLayout *layout = new QVBoxLayout (); layout->addWidget (_edit_area); layout->setMargin (0); @@ -105,7 +105,7 @@ this, SLOT (file_has_changed (QString))); _file_name = ""; - + notice_settings (); } @@ -241,7 +241,7 @@ QString keyword; QStringList keywordList; - // get whole string with all keywords + // get whole string with all keywords keyword = lexer->keywords (1); // split into single strings keywordList = keyword.split (QRegExp ("\\s+")); @@ -249,21 +249,21 @@ int i; for (i = 0; i < keywordList.size (); i++) { - // add single strings to the API + // add single strings to the API lexer_api->add (keywordList.at (i)); } // prepare API info ... this make take some time lexer_api->prepare (); } else if (_file_name.endsWith (".c") - || _file_name.endsWith (".cc") - || _file_name.endsWith (".cpp") - || _file_name.endsWith (".cxx") - || _file_name.endsWith (".c++") - || _file_name.endsWith (".h") - || _file_name.endsWith (".hh") - || _file_name.endsWith (".hpp") - || _file_name.endsWith (".h++")) + || _file_name.endsWith (".cc") + || _file_name.endsWith (".cpp") + || _file_name.endsWith (".cxx") + || _file_name.endsWith (".c++") + || _file_name.endsWith (".h") + || _file_name.endsWith (".hh") + || _file_name.endsWith (".hpp") + || _file_name.endsWith (".h++")) { lexer = new QsciLexerCPP (); } @@ -283,17 +283,17 @@ { lexer = new QsciLexerBash (); } - + QSettings *settings = resource_manager::get_settings (); - + // Editor font (default or from settings) if (settings) lexer->setDefaultFont (QFont ( - settings->value ("editor/fontName", - "Courier").toString (), - settings->value ("editor/fontSize", - 10).toInt ())); - + settings->value ("editor/fontName", + "Courier").toString (), + settings->value ("editor/fontSize", + 10).toInt ())); + // TODO: Autoindent not working as it should lexer->setAutoIndentStyle (QsciScintilla::AiMaintain || QsciScintilla::AiOpening || @@ -313,10 +313,10 @@ function_name.chop (file_info.suffix ().length () + 1); octave_link::instance ()->post_event - (new octave_add_breakpoint_event (*this, - path.toStdString (), - function_name.toStdString (), - line)); + (new octave_add_breakpoint_event (*this, + path.toStdString (), + function_name.toStdString (), + line)); } void @@ -330,10 +330,10 @@ function_name.chop (file_info.suffix ().length () + 1); octave_link::instance ()->post_event - (new octave_remove_breakpoint_event (*this, - path.toStdString (), - function_name.toStdString (), - line)); + (new octave_remove_breakpoint_event (*this, + path.toStdString (), + function_name.toStdString (), + line)); } void @@ -502,9 +502,9 @@ function_name.chop (file_info.suffix ().length () + 1); octave_link::instance ()->post_event - (new octave_remove_all_breakpoints_event (*this, - path.toStdString (), - function_name.toStdString ())); + (new octave_remove_all_breakpoints_event (*this, + path.toStdString (), + function_name.toStdString ())); } void @@ -696,7 +696,7 @@ _file_name = saveFileName; // set the window title to actual file name (not modified) update_window_title (false); - // files is save -> not modified + // files is save -> not modified _edit_area->setModified (false); file.close(); @@ -713,7 +713,7 @@ if (saveFileName == UNNAMED_FILE || saveFileName.isEmpty ()) { QString directory = QString::fromStdString - (octave_link::instance ()->get_last_working_directory ()); + (octave_link::instance ()->get_last_working_directory ()); if (directory.isEmpty ()) { @@ -752,13 +752,13 @@ QFileInfo file_info (_file_name); QString path = file_info.absolutePath (); //QString current_path = QString::fromStdString - (octave_link::instance ()->get_last_working_directory ()); + (octave_link::instance ()->get_last_working_directory ()); QString function_name = file_info.fileName (); // We have to cut off the suffix, because octave appends it. function_name.chop (file_info.suffix ().length () + 1); _file_editor->terminal ()->sendText (QString ("cd \'%1\'\n%2\n") - .arg(path).arg (function_name)); + .arg(path).arg (function_name)); // TODO: Sending a run event crashes for long scripts. Find out why. // octave_link::instance () // ->post_event (new octave_run_file_event (*this, _file_name.toStdString ())); @@ -778,10 +778,10 @@ alreadyAsking = true; int decision = - QMessageBox::warning (this, tr ("Octave Editor"), - tr ("It seems that \'%1\' has been modified by another application. Do you want to reload it?"). - arg (_file_name), QMessageBox::Yes, - QMessageBox::No); + QMessageBox::warning (this, tr ("Octave Editor"), + tr ("It seems that \'%1\' has been modified by another application. Do you want to reload it?"). + arg (_file_name), QMessageBox::Yes, + QMessageBox::No); if (decision == QMessageBox::Yes) { @@ -794,10 +794,10 @@ else { int decision = - QMessageBox::warning (this, tr ("Octave Editor"), - tr ("It seems that \'%1\' has been deleted or renamed. Do you want to save it now?"). - arg (_file_name), QMessageBox::Save, - QMessageBox::Close); + QMessageBox::warning (this, tr ("Octave Editor"), + tr ("It seems that \'%1\' has been deleted or renamed. Do you want to save it now?"). + arg (_file_name), QMessageBox::Save, + QMessageBox::Close); if (decision == QMessageBox::Save) { if (!save_file_as ()) @@ -819,35 +819,35 @@ file_editor_tab::notice_settings () { QSettings *settings = resource_manager::get_settings (); - + if (settings==NULL) return; // this shouldn't happen! - + _edit_area->setCaretLineVisible(settings->value ("editor/highlightCurrentLine",true).toBool ()); - + if (settings->value ("editor/codeCompletion",true).toBool ()) _edit_area->setAutoCompletionThreshold (1); else _edit_area->setAutoCompletionThreshold (-1); - + QFont font( settings->value ("editor/fontName","Courier").toString () , settings->value ("editor/fontSize",10).toInt () ); if (settings->value ("editor/showLineNumbers",true).toBool ()) { _edit_area->setMarginLineNumbers (2, true); _edit_area->setMarginsFont( font ); - QFontMetrics metrics( font ); + QFontMetrics metrics( font ); _edit_area->setMarginWidth(2, metrics.width("9999")); - } + } else { _edit_area->setMarginLineNumbers (2, false); _edit_area->setMarginWidth(2, 0); - } - + } + update_lexer (); - + _long_title = settings->value ("editor/longWindowTitle",false).toBool (); - update_window_title (false); + update_window_title (false); } diff --git a/libgui/src/m-editor/file-editor-tab.h b/libgui/src/m-editor/file-editor-tab.h --- a/libgui/src/m-editor/file-editor-tab.h +++ b/libgui/src/m-editor/file-editor-tab.h @@ -33,7 +33,7 @@ class file_editor_tab : public QWidget, public octave_event_observer { Q_OBJECT -public: + public: file_editor_tab (file_editor *fileEditor); bool copy_available (); @@ -73,8 +73,8 @@ void run_file (); void file_has_changed (const QString& fileName); - QString get_file_name () const {return _file_name;} - + QString get_file_name () const {return _file_name;} + /** Tells the editor tab to react on changed settings. */ void notice_settings (); diff --git a/libgui/src/m-editor/file-editor.cc b/libgui/src/m-editor/file-editor.cc --- a/libgui/src/m-editor/file-editor.cc +++ b/libgui/src/m-editor/file-editor.cc @@ -50,15 +50,15 @@ QSettings *settings = resource_manager::get_settings (); QStringList sessionFileNames; if (settings->value ("editor/restoreSession",true).toBool ()) - { - for (int n=0;n<_tab_widget->count();++n) - { - file_editor_tab* tab = dynamic_cast (_tab_widget->widget (n)); - if (!tab) - continue; - sessionFileNames.append (tab->get_file_name ()); - } - } + { + for (int n=0;n<_tab_widget->count();++n) + { + file_editor_tab* tab = dynamic_cast (_tab_widget->widget (n)); + if (!tab) + continue; + sessionFileNames.append (tab->get_file_name ()); + } + } settings->setValue ("editor/savedSessionTabs", sessionFileNames); settings->sync (); } @@ -378,10 +378,10 @@ for(int i = 0; i < _tab_widget->count (); i++) { file_editor_tab *fileEditorTab - = dynamic_cast (_tab_widget->widget (i)); + = dynamic_cast (_tab_widget->widget (i)); if (fileEditorTab) fileEditorTab->notice_settings (); - } + } } void @@ -396,23 +396,23 @@ _tab_widget->setTabsClosable (true); QAction *new_action = new QAction (QIcon(":/actions/icons/filenew.png"), - tr("&New File"), _tool_bar); + tr("&New File"), _tool_bar); QAction *open_action = new QAction (QIcon(":/actions/icons/fileopen.png"), - tr("&Open File"), _tool_bar); + tr("&Open File"), _tool_bar); QAction *save_action = new QAction (QIcon(":/actions/icons/filesave.png"), - tr("&Save File"), _tool_bar); + tr("&Save File"), _tool_bar); QAction *save_as_action = new QAction (QIcon(":/actions/icons/filesaveas.png"), tr("Save File &As"), _tool_bar); QAction *undo_action = new QAction (QIcon(":/actions/icons/undo.png"), - tr("&Undo"), _tool_bar); + tr("&Undo"), _tool_bar); QAction *redo_action = new QAction (QIcon(":/actions/icons/redo.png"), - tr("&Redo"), _tool_bar); + tr("&Redo"), _tool_bar); _copy_action = new QAction (QIcon(":/actions/icons/editcopy.png"), tr ("&Copy"), _tool_bar); @@ -421,25 +421,25 @@ tr ("Cu&t"), _tool_bar); QAction *paste_action - = new QAction (QIcon (":/actions/icons/editpaste.png"), - tr("Paste"), _tool_bar); + = new QAction (QIcon (":/actions/icons/editpaste.png"), + tr("Paste"), _tool_bar); QAction *next_bookmark_action = new QAction (tr ("&Next Bookmark"),_tool_bar); QAction *previous_bookmark_action = new QAction (tr ("Pre&vious Bookmark"),_tool_bar); QAction *toggle_bookmark_action = new QAction (tr ("Toggle &Bookmark"),_tool_bar); QAction *remove_bookmark_action = new QAction (tr ("&Remove All Bookmarks"),_tool_bar); QAction *next_breakpoint_action - = new QAction (QIcon (":/actions/icons/bp_next.png"), - tr ("&Next breakpoint"), _tool_bar); + = new QAction (QIcon (":/actions/icons/bp_next.png"), + tr ("&Next breakpoint"), _tool_bar); QAction *previous_breakpoint_action - = new QAction (QIcon (":/actions/icons/bp_prev.png"), - tr ("Pre&vious breakpoint"), _tool_bar); + = new QAction (QIcon (":/actions/icons/bp_prev.png"), + tr ("Pre&vious breakpoint"), _tool_bar); QAction *toggle_breakpoint_action - = new QAction (QIcon (":/actions/icons/bp_toggle.png"), - tr ("Toggle &breakpoint"), _tool_bar); + = new QAction (QIcon (":/actions/icons/bp_toggle.png"), + tr ("Toggle &breakpoint"), _tool_bar); QAction *remove_all_breakpoints_action - = new QAction (QIcon (":/actions/icons/bp_rm_all.png"), - tr ("&Remove All breakpoints"), _tool_bar); + = new QAction (QIcon (":/actions/icons/bp_rm_all.png"), + tr ("&Remove All breakpoints"), _tool_bar); QAction *comment_selection_action = new QAction (tr ("&Comment Selected Text"),_tool_bar); QAction *uncomment_selection_action = new QAction (tr ("&Uncomment Selected Text"),_tool_bar); @@ -448,7 +448,7 @@ tr ("&Find and Replace"), _tool_bar); _run_action = new QAction (QIcon(":/actions/icons/artsbuilderexecute.png"), - tr("Save File And Run"), _tool_bar); + tr("Save File And Run"), _tool_bar); // some actions are disabled from the beginning _copy_action->setEnabled(false); @@ -539,7 +539,7 @@ connect (new_action, SIGNAL (triggered ()), this, SLOT (request_new_file ())); - connect (open_action, + connect (open_action, SIGNAL (triggered ()), this, SLOT (request_open_file ())); connect (undo_action, SIGNAL (triggered ()), this, SLOT (request_undo ())); @@ -592,12 +592,12 @@ //restore previous session QSettings *settings = resource_manager::get_settings (); if (settings->value ("editor/restoreSession",true).toBool ()) - { - QStringList sessionFileNames = settings->value("editor/savedSessionTabs", QStringList()).toStringList (); + { + QStringList sessionFileNames = settings->value("editor/savedSessionTabs", QStringList()).toStringList (); - for (int n=0;nfindFirst (_search_line_edit->text (), - _regex_check_box->isChecked (), - _case_check_box->isChecked (), - _whole_words_check_box->isChecked (), - _wrap_check_box->isChecked (), - !_backward_check_box->isChecked (), - line,col, - true + _regex_check_box->isChecked (), + _case_check_box->isChecked (), + _whole_words_check_box->isChecked (), + _wrap_check_box->isChecked (), + !_backward_check_box->isChecked (), + line,col, + true #ifdef HAVE_FINDFIRST_MODERN - , true + , true #endif - ); + ); } } diff --git a/libgui/src/m-editor/find-dialog.h b/libgui/src/m-editor/find-dialog.h --- a/libgui/src/m-editor/find-dialog.h +++ b/libgui/src/m-editor/find-dialog.h @@ -55,7 +55,7 @@ class find_dialog : public QDialog { Q_OBJECT -public: + public: find_dialog (QsciScintilla* edit_area, QWidget *parent = 0); private slots: diff --git a/libgui/src/m-editor/lexer-octave-gui.cc b/libgui/src/m-editor/lexer-octave-gui.cc --- a/libgui/src/m-editor/lexer-octave-gui.cc +++ b/libgui/src/m-editor/lexer-octave-gui.cc @@ -32,7 +32,7 @@ // Some basic functions // ----------------------------------------------------- lexer_octave_gui::lexer_octave_gui(QObject *parent) - : QsciLexer(parent) // inherit from base lexer + : QsciLexer(parent) // inherit from base lexer { } @@ -55,26 +55,26 @@ // ----------------------------------------------------- QColor lexer_octave_gui::defaultColor(int style) const { - switch (style) - { - case Default: // black - return QColor(0x00,0x00,0x00); - case Operator: // red - return QColor(0xef,0x00,0x00); - case Comment: // gray - return QColor(0x7f,0x7f,0x7f); - case Command: // blue-green - return QColor(0x00,0x7f,0x7f); - case Number: // orange - return QColor(0x7f,0x7f,0x00); - case Keyword: // blue - return QColor(0x00,0x00,0xbf); - case SingleQuotedString: // green - return QColor(0x00,0x7f,0x00); - case DoubleQuotedString: // green-yellow - return QColor(0x4f,0x7f,0x00); - } - return QsciLexer::defaultColor(style); + switch (style) + { + case Default: // black + return QColor(0x00,0x00,0x00); + case Operator: // red + return QColor(0xef,0x00,0x00); + case Comment: // gray + return QColor(0x7f,0x7f,0x7f); + case Command: // blue-green + return QColor(0x00,0x7f,0x7f); + case Number: // orange + return QColor(0x7f,0x7f,0x00); + case Keyword: // blue + return QColor(0x00,0x00,0xbf); + case SingleQuotedString: // green + return QColor(0x00,0x7f,0x00); + case DoubleQuotedString: // green-yellow + return QColor(0x4f,0x7f,0x00); + } + return QsciLexer::defaultColor(style); } @@ -83,25 +83,25 @@ // ----------------------------------------------------- QFont lexer_octave_gui::defaultFont(int style) const { - QFont f; + QFont f; - switch (style) - { - case Comment: // default but italic - f = QsciLexer::defaultFont(style); - f.setItalic(true); - break; - case Keyword: // default - f = QsciLexer::defaultFont(style); - break; - case Operator: // default - f = QsciLexer::defaultFont(style); - break; - default: // default - f = QsciLexer::defaultFont(style); - break; - } - return f; // return the selected font + switch (style) + { + case Comment: // default but italic + f = QsciLexer::defaultFont(style); + f.setItalic(true); + break; + case Keyword: // default + f = QsciLexer::defaultFont(style); + break; + case Operator: // default + f = QsciLexer::defaultFont(style); + break; + default: // default + f = QsciLexer::defaultFont(style); + break; + } + return f; // return the selected font } @@ -110,28 +110,28 @@ // ----------------------------------------------------- QString lexer_octave_gui::description(int style) const { - switch (style) - { - case Default: - return tr("Default"); - case Comment: - return tr("Comment"); - case Command: - return tr("Command"); - case Number: - return tr("Number"); - case Keyword: - return tr("Keyword"); - case SingleQuotedString: - return tr("Single-quoted string"); - case Operator: - return tr("Operator"); - case Identifier: - return tr("Identifier"); - case DoubleQuotedString: - return tr("Double-quoted string"); - } - return QString(); + switch (style) + { + case Default: + return tr("Default"); + case Comment: + return tr("Comment"); + case Command: + return tr("Command"); + case Number: + return tr("Number"); + case Keyword: + return tr("Keyword"); + case SingleQuotedString: + return tr("Single-quoted string"); + case Operator: + return tr("Operator"); + case Identifier: + return tr("Identifier"); + case DoubleQuotedString: + return tr("Double-quoted string"); + } + return QString(); } @@ -141,10 +141,10 @@ // ----------------------------------------------------- const char *lexer_octave_gui::keywords(int set) const { - if (set == 1) - { - return resource_manager::octave_keywords (); - } - return 0; + if (set == 1) + { + return resource_manager::octave_keywords (); + } + return 0; } diff --git a/libgui/src/m-editor/lexer-octave-gui.h b/libgui/src/m-editor/lexer-octave-gui.h --- a/libgui/src/m-editor/lexer-octave-gui.h +++ b/libgui/src/m-editor/lexer-octave-gui.h @@ -31,35 +31,35 @@ class lexer_octave_gui : public QsciLexer { - Q_OBJECT + Q_OBJECT -public: - // the used styles - enum - { - Default = 0, - Comment = 1, - Command = 2, - Number = 3, - Keyword = 4, - SingleQuotedString = 5, - Operator = 6, - Identifier = 7, - DoubleQuotedString = 8 - }; + public: + // the used styles + enum + { + Default = 0, + Comment = 1, + Command = 2, + Number = 3, + Keyword = 4, + SingleQuotedString = 5, + Operator = 6, + Identifier = 7, + DoubleQuotedString = 8 + }; - lexer_octave_gui (QObject *parent = 0); - virtual ~lexer_octave_gui (); - const char *language () const; - const char *lexer () const; - QColor defaultColor (int style) const; - QFont defaultFont (int style) const; - const char *keywords (int set) const; - QString description (int style) const; + lexer_octave_gui (QObject *parent = 0); + virtual ~lexer_octave_gui (); + const char *language () const; + const char *lexer () const; + QColor defaultColor (int style) const; + QFont defaultFont (int style) const; + const char *keywords (int set) const; + QString description (int style) const; private: - lexer_octave_gui (const lexer_octave_gui &); - lexer_octave_gui &operator= (const lexer_octave_gui &); + lexer_octave_gui (const lexer_octave_gui &); + lexer_octave_gui &operator= (const lexer_octave_gui &); }; #endif diff --git a/libgui/src/main-window.cc b/libgui/src/main-window.cc --- a/libgui/src/main-window.cc +++ b/libgui/src/main-window.cc @@ -101,13 +101,13 @@ main_window::handle_save_workspace_request () { QString selectedFile = - QFileDialog::getSaveFileName (this, tr ("Save Workspace"), - resource_manager::get_home_path ()); + QFileDialog::getSaveFileName (this, tr ("Save Workspace"), + resource_manager::get_home_path ()); if (!selectedFile.isEmpty ()) { octave_link::instance () - ->post_event (new octave_save_workspace_event (*this, - selectedFile.toStdString())); + ->post_event (new octave_save_workspace_event (*this, + selectedFile.toStdString())); } } @@ -115,13 +115,13 @@ main_window::handle_load_workspace_request () { QString selectedFile = - QFileDialog::getOpenFileName (this, tr ("Load Workspace"), - resource_manager::get_home_path ()); + QFileDialog::getOpenFileName (this, tr ("Load Workspace"), + resource_manager::get_home_path ()); if (!selectedFile.isEmpty ()) { octave_link::instance () - ->post_event (new octave_load_workspace_event (*this, - selectedFile.toStdString())); + ->post_event (new octave_load_workspace_event (*this, + selectedFile.toStdString())); } } @@ -129,14 +129,14 @@ main_window::handle_clear_workspace_request () { octave_link::instance () - ->post_event (new octave_clear_workspace_event (*this)); + ->post_event (new octave_clear_workspace_event (*this)); } void main_window::handle_clear_history_request() { octave_link::instance () - ->post_event (new octave_clear_history_event (*this)); + ->post_event (new octave_clear_history_event (*this)); } void @@ -233,13 +233,13 @@ main_window::change_current_working_directory () { QString selectedDirectory = - QFileDialog::getExistingDirectory(this, tr ("Set working direcotry")); + QFileDialog::getExistingDirectory(this, tr ("Set working direcotry")); if (!selectedDirectory.isEmpty ()) { octave_link::instance () - ->post_event (new octave_change_directory_event (*this, - selectedDirectory.toStdString ())); + ->post_event (new octave_change_directory_event (*this, + selectedDirectory.toStdString ())); } } @@ -247,8 +247,8 @@ main_window::set_current_working_directory (const QString& directory) { octave_link::instance () - ->post_event (new octave_change_directory_event (*this, - directory.toStdString ())); + ->post_event (new octave_change_directory_event (*this, + directory.toStdString ())); } void @@ -367,56 +367,56 @@ main_window::debug_continue () { octave_link::instance () - ->post_event (new octave_debug_continue_event (*this)); + ->post_event (new octave_debug_continue_event (*this)); } void main_window::debug_step_into () { octave_link::instance () - ->post_event (new octave_debug_step_into_event (*this)); + ->post_event (new octave_debug_step_into_event (*this)); } void main_window::debug_step_over () { octave_link::instance () - ->post_event (new octave_debug_step_over_event (*this)); + ->post_event (new octave_debug_step_over_event (*this)); } void main_window::debug_step_out () { octave_link::instance () - ->post_event (new octave_debug_step_out_event (*this)); + ->post_event (new octave_debug_step_out_event (*this)); } void main_window::debug_quit () { octave_link::instance () - ->post_event (new octave_debug_quit_event (*this)); + ->post_event (new octave_debug_quit_event (*this)); } void main_window::show_about_octave () { QString message = - "GNU Octave\n" - "Copyright (C) 2009 John W. Eaton and others.\n" - "This is free software; see the source code for copying conditions." - "There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or" - "FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'.\n" - "\n" - "Additional information about Octave is available at http://www.octave.org.\n" - "\n" - "Please contribute if you find this software useful." - "For more information, visit http://www.octave.org/help-wanted.html\n" - "\n" - "Report bugs to (but first, please read" - "http://www.octave.org/bugs.html to learn how to write a helpful report).\n" - "\n" - "For information about changes from previous versions, type `news'.\n"; + "GNU Octave\n" + "Copyright (C) 2009 John W. Eaton and others.\n" + "This is free software; see the source code for copying conditions." + "There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or" + "FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'.\n" + "\n" + "Additional information about Octave is available at http://www.octave.org.\n" + "\n" + "Please contribute if you find this software useful." + "For more information, visit http://www.octave.org/help-wanted.html\n" + "\n" + "Report bugs to (but first, please read" + "http://www.octave.org/bugs.html to learn how to write a helpful report).\n" + "\n" + "For information about changes from previous versions, type `news'.\n"; QMessageBox::about (this, tr ("About Octave"), message); } @@ -426,7 +426,7 @@ { closeEvent->ignore (); octave_link::instance ()->post_event (new octave_exit_event (*this)); - } +} void main_window::read_settings () @@ -447,7 +447,7 @@ QVariant val = settings->value (name); widget->restoreGeometry (val.toByteArray ()); } - } + } settings->endGroup(); restoreGeometry (settings->value ("MainWindow/geometry").toByteArray ()); emit settings_changed (); @@ -528,7 +528,7 @@ QMenu *new_menu = file_menu->addMenu(tr ("New")); QAction *new_script_action - = new_menu->addAction (QIcon(":/actions/icons/filenew.png"), tr ("Script")); + = new_menu->addAction (QIcon(":/actions/icons/filenew.png"), tr ("Script")); new_script_action->setShortcut (Qt::ControlModifier + Qt::Key_N); QAction *new_function_action = new_menu->addAction (tr ("Function")); @@ -547,37 +547,37 @@ new_gui_action->setEnabled (false); // TODO: Make this work. QAction *open_action - = file_menu->addAction (QIcon(":/actions/icons/fileopen.png"), tr ("Open...")); + = file_menu->addAction (QIcon(":/actions/icons/fileopen.png"), tr ("Open...")); open_action->setShortcut (Qt::ControlModifier + Qt::Key_O); QAction *close_command_window_action - = file_menu->addAction (tr ("Close Command Window")); + = file_menu->addAction (tr ("Close Command Window")); close_command_window_action->setShortcut (Qt::ControlModifier + Qt::Key_W); close_command_window_action->setEnabled (false); // TODO: Make this work. file_menu->addSeparator (); QAction *import_data_action - = file_menu->addAction (tr ("Import Data...")); + = file_menu->addAction (tr ("Import Data...")); import_data_action->setEnabled (false); // TODO: Make this work. QAction *save_workspace_action - = file_menu->addAction (tr ("Save Workspace...")); + = file_menu->addAction (tr ("Save Workspace...")); save_workspace_action->setShortcut (Qt::ControlModifier + Qt::Key_S); file_menu->addSeparator (); QAction *preferences_action - = file_menu->addAction (QIcon(":/actions/icons/configure.png"), - tr ("Preferences...")); + = file_menu->addAction (QIcon(":/actions/icons/configure.png"), + tr ("Preferences...")); file_menu->addSeparator (); QAction *page_setup_action - = file_menu->addAction (tr ("Page Setup...")); + = file_menu->addAction (tr ("Page Setup...")); page_setup_action->setEnabled (false); // TODO: Make this work. QAction *print_action - = file_menu->addAction (tr ("Print")); + = file_menu->addAction (tr ("Print")); print_action->setShortcut (Qt::ControlModifier + Qt::Key_P); print_action->setEnabled (false); // TODO: Make this work. QAction *print_selection_action - = file_menu->addAction (tr ("Print Selection...")); + = file_menu->addAction (tr ("Print Selection...")); print_selection_action->setEnabled (false); // TODO: Make this work. file_menu->addSeparator (); @@ -587,57 +587,57 @@ QMenu *edit_menu = menuBar ()->addMenu (tr ("&Edit")); QAction *undo_action - = edit_menu->addAction (QIcon(":/actions/icons/undo.png"), tr ("Undo")); + = edit_menu->addAction (QIcon(":/actions/icons/undo.png"), tr ("Undo")); undo_action->setShortcut (QKeySequence::Undo); QAction *redo_action - = edit_menu->addAction (QIcon(":/actions/icons/redo.png"), tr ("Redo")); + = edit_menu->addAction (QIcon(":/actions/icons/redo.png"), tr ("Redo")); redo_action->setShortcut (QKeySequence::Redo); edit_menu->addSeparator (); QAction *cut_action - = edit_menu->addAction (QIcon(":/actions/icons/editcut.png"), tr ("Cut")); + = edit_menu->addAction (QIcon(":/actions/icons/editcut.png"), tr ("Cut")); cut_action->setShortcut (Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_X); QAction *copy_action - = edit_menu->addAction (QIcon(":/actions/icons/editcopy.png"), tr ("Copy")); + = edit_menu->addAction (QIcon(":/actions/icons/editcopy.png"), tr ("Copy")); copy_action->setShortcut (Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_C); QAction *paste_action - = edit_menu->addAction (QIcon(":/actions/icons/editpaste.png"), tr ("Paste")); + = edit_menu->addAction (QIcon(":/actions/icons/editpaste.png"), tr ("Paste")); paste_action->setShortcut (Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_V); QAction *paste_to_workspace_action - = edit_menu->addAction (tr ("Paste To Workspace...")); + = edit_menu->addAction (tr ("Paste To Workspace...")); paste_to_workspace_action->setEnabled (false); // TODO: Make this work. edit_menu->addSeparator (); QAction *select_all_action - = edit_menu->addAction (tr ("Select All")); + = edit_menu->addAction (tr ("Select All")); select_all_action->setEnabled (false); // TODO: Make this work. QAction *delete_action - = edit_menu->addAction (tr ("Delete")); + = edit_menu->addAction (tr ("Delete")); delete_action->setShortcut (Qt::Key_Delete); delete_action->setEnabled (false); // TODO: Make this work. edit_menu->addSeparator (); QAction *find_action - = edit_menu->addAction (tr ("Find...")); + = edit_menu->addAction (tr ("Find...")); find_action->setEnabled (false); // TODO: Make this work. QAction *find_files_action - = edit_menu->addAction (tr ("Find Files...")); + = edit_menu->addAction (tr ("Find Files...")); find_files_action->setShortcut (Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_F); find_files_action->setEnabled (false); // TODO: Make this work. edit_menu->addSeparator (); QAction *clear_command_window_action - = edit_menu->addAction (tr ("Clear Command Window")); + = edit_menu->addAction (tr ("Clear Command Window")); clear_command_window_action->setEnabled (false); // TODO: Make this work. QAction *clear_command_history - = edit_menu->addAction(tr ("Clear Command History")); + = edit_menu->addAction(tr ("Clear Command History")); QAction * clear_workspace_action - = edit_menu->addAction (tr ("Clear Workspace")); + = edit_menu->addAction (tr ("Clear Workspace")); _debug_menu = menuBar ()->addMenu (tr ("De&bug")); @@ -713,7 +713,7 @@ QAction * show_documentation_action = window_menu->addAction (tr ("Show Documentation")); show_documentation_action->setCheckable (true); show_documentation_action->setShortcut (Qt::ControlModifier + Qt::ShiftModifier - + Qt::Key_5); + + Qt::Key_5); window_menu->addSeparator (); QAction * command_window_action @@ -760,19 +760,19 @@ // Toolbars QToolBar *main_tool_bar = addToolBar ("Main"); - main_tool_bar->addAction (new_script_action); - main_tool_bar->addAction (open_action); - main_tool_bar->addSeparator (); - main_tool_bar->addAction (cut_action); - main_tool_bar->addAction (copy_action); - main_tool_bar->addAction (paste_action); - main_tool_bar->addAction (undo_action); - main_tool_bar->addAction (redo_action); - main_tool_bar->addSeparator (); - main_tool_bar->addWidget (new QLabel (tr ("Current Directory:"))); - main_tool_bar->addWidget (_current_directory_combo_box); - main_tool_bar->addWidget (_current_directory_tool_button); - main_tool_bar->addWidget (_current_directory_up_tool_button); + main_tool_bar->addAction (new_script_action); + main_tool_bar->addAction (open_action); + main_tool_bar->addSeparator (); + main_tool_bar->addAction (cut_action); + main_tool_bar->addAction (copy_action); + main_tool_bar->addAction (paste_action); + main_tool_bar->addAction (undo_action); + main_tool_bar->addAction (redo_action); + main_tool_bar->addSeparator (); + main_tool_bar->addWidget (new QLabel (tr ("Current Directory:"))); + main_tool_bar->addWidget (_current_directory_combo_box); + main_tool_bar->addWidget (_current_directory_tool_button); + main_tool_bar->addWidget (_current_directory_up_tool_button); connect (qApp, SIGNAL (aboutToQuit ()), this, SLOT (prepare_for_quit ())); diff --git a/libgui/src/main-window.h b/libgui/src/main-window.h --- a/libgui/src/main-window.h +++ b/libgui/src/main-window.h @@ -54,14 +54,14 @@ #include "octave-event-observer.h" /** - * \class MainWindow - * - * Represents the main window. - */ + * \class MainWindow + * + * Represents the main window. + */ class main_window - : public QMainWindow, public octave_event_observer + : public QMainWindow, public octave_event_observer { -Q_OBJECT public: + Q_OBJECT public: main_window (QWidget * parent = 0); ~main_window (); diff --git a/libgui/src/octave-qt-event-listener.cc b/libgui/src/octave-qt-event-listener.cc --- a/libgui/src/octave-qt-event-listener.cc +++ b/libgui/src/octave-qt-event-listener.cc @@ -36,7 +36,7 @@ octave_qt_event_listener::current_directory_has_changed (const std::string& directory) { emit current_directory_has_changed_signal - (QString::fromStdString (directory)); + (QString::fromStdString (directory)); } void diff --git a/libgui/src/octave-qt-event-listener.h b/libgui/src/octave-qt-event-listener.h --- a/libgui/src/octave-qt-event-listener.h +++ b/libgui/src/octave-qt-event-listener.h @@ -28,22 +28,22 @@ #include "octave-event-listener.h" class octave_qt_event_listener - : public QObject, public octave_event_listener + : public QObject, public octave_event_listener { - Q_OBJECT + Q_OBJECT public: - octave_qt_event_listener (QObject *parent = 0); + octave_qt_event_listener (QObject *parent = 0); - void current_directory_has_changed (const std::string& directory); - void about_to_exit (); + void current_directory_has_changed (const std::string& directory); + void about_to_exit (); - void entered_debug_mode (); - void quit_debug_mode (); + void entered_debug_mode (); + void quit_debug_mode (); - signals: - void current_directory_has_changed_signal (const QString& directory); - void entered_debug_mode_signal (); - void quit_debug_mode_signal (); +signals: + void current_directory_has_changed_signal (const QString& directory); + void entered_debug_mode_signal (); + void quit_debug_mode_signal (); }; #endif // OCTAVEQTEVENTLISTENER_H diff --git a/libgui/src/resource-manager.cc b/libgui/src/resource-manager.cc --- a/libgui/src/resource-manager.cc +++ b/libgui/src/resource-manager.cc @@ -114,14 +114,14 @@ QString settings_file = settings_path + "qt-settings"; if (!QFile::exists (settings_file)) - { - QDir("/").mkpath (settings_path); - QFile::copy (QString::fromStdString (default_qt_settings_file ()), - settings_file); - first_run = true; - } + { + QDir("/").mkpath (settings_path); + QFile::copy (QString::fromStdString (default_qt_settings_file ()), + settings_file); + first_run = true; + } else - first_run = false; + first_run = false; do_set_settings (settings_file); } diff --git a/libgui/src/settings-dialog.cc b/libgui/src/settings-dialog.cc --- a/libgui/src/settings-dialog.cc +++ b/libgui/src/settings-dialog.cc @@ -30,7 +30,7 @@ #include settings_dialog::settings_dialog (QWidget * parent): -QDialog (parent), ui (new Ui::settings_dialog) + QDialog (parent), ui (new Ui::settings_dialog) { ui->setupUi (this); diff --git a/libgui/src/settings-dialog.h b/libgui/src/settings-dialog.h --- a/libgui/src/settings-dialog.h +++ b/libgui/src/settings-dialog.h @@ -32,7 +32,7 @@ class settings_dialog:public QDialog { -Q_OBJECT public: + Q_OBJECT public: explicit settings_dialog (QWidget * parent); ~settings_dialog (); void write_changed_settings (); diff --git a/libgui/src/symbol-information.cc b/libgui/src/symbol-information.cc --- a/libgui/src/symbol-information.cc +++ b/libgui/src/symbol-information.cc @@ -67,7 +67,7 @@ if (increment != 1 ) buffer << increment << ":"; buffer << limit; - + short_value_string = QString::fromStdString (buffer.str ()); } else if (ov.is_matrix_type () || ov.is_cell ()) diff --git a/libgui/src/symbol-information.h b/libgui/src/symbol-information.h --- a/libgui/src/symbol-information.h +++ b/libgui/src/symbol-information.h @@ -35,25 +35,25 @@ #include "symtab.h" /** - * \struct symbol_information - * \brief Meta-information over a symbol-table entry. - * \author Jacob Dawid - * This struct is used to store meta information over a symbol entry. - * It reduces memory consumption, since it only stores relevant data - * about a symbol-table entry that will be used in the model for the - * graphical user interface. - */ + * \struct symbol_information + * \brief Meta-information over a symbol-table entry. + * \author Jacob Dawid + * This struct is used to store meta information over a symbol entry. + * It reduces memory consumption, since it only stores relevant data + * about a symbol-table entry that will be used in the model for the + * graphical user interface. + */ class symbol_information { public: enum Scope - { - unknown = 0, - local = 1, - global = 2, - persistent = 3 - }; + { + unknown = 0, + local = 1, + global = 2, + persistent = 3 + }; symbol_information (const symbol_table::symbol_record& symbol_record); diff --git a/libgui/src/terminal-dockwidget.h b/libgui/src/terminal-dockwidget.h --- a/libgui/src/terminal-dockwidget.h +++ b/libgui/src/terminal-dockwidget.h @@ -29,18 +29,18 @@ class terminal_dock_widget : public QDockWidget { Q_OBJECT -public: + public: terminal_dock_widget (QTerminal *terminal, QWidget *parent = 0); signals: - void active_changed (bool active); + void active_changed (bool active); public slots: - void handle_visibility_changed (bool visible) - { - if (visible) - emit active_changed (true); - } + void handle_visibility_changed (bool visible) + { + if (visible) + emit active_changed (true); + } }; #endif // TERMINALDOCKWIDGET_H diff --git a/libgui/src/welcome-wizard.h b/libgui/src/welcome-wizard.h --- a/libgui/src/welcome-wizard.h +++ b/libgui/src/welcome-wizard.h @@ -26,14 +26,14 @@ #include namespace Ui { - class welcome_wizard; + class welcome_wizard; } class welcome_wizard : public QDialog { Q_OBJECT -public: + public: explicit welcome_wizard (QWidget *parent = 0); ~welcome_wizard (); diff --git a/libgui/src/workspace-model.cc b/libgui/src/workspace-model.cc --- a/libgui/src/workspace-model.cc +++ b/libgui/src/workspace-model.cc @@ -64,7 +64,7 @@ workspace_model::request_update_workspace () { octave_link::instance () - ->post_event (new octave_update_workspace_event (*this)); + ->post_event (new octave_update_workspace_event (*this)); } void @@ -95,9 +95,9 @@ switch (s.scope ()) { - case symbol_information::local: top_level_item (0)->add_child (child); break; - case symbol_information::global: top_level_item (1)->add_child (child); break; - case symbol_information::persistent: top_level_item (2)->add_child (child); break; + case symbol_information::local: top_level_item (0)->add_child (child); break; + case symbol_information::global: top_level_item (1)->add_child (child); break; + case symbol_information::persistent: top_level_item (2)->add_child (child); break; } } diff --git a/libgui/src/workspace-model.h b/libgui/src/workspace-model.h --- a/libgui/src/workspace-model.h +++ b/libgui/src/workspace-model.h @@ -48,7 +48,7 @@ } ~tree_item () { - qDeleteAll (_child_items); + qDeleteAll (_child_items); } void insert_child_item (int at, tree_item *item) { @@ -62,8 +62,8 @@ } void delete_child_items () { - qDeleteAll (_child_items); - _child_items.clear (); + qDeleteAll (_child_items); + _child_items.clear (); } void remove_child (tree_item *item) { @@ -112,11 +112,11 @@ }; class workspace_model - : public QAbstractItemModel, public octave_event_observer + : public QAbstractItemModel, public octave_event_observer { Q_OBJECT -public: + public: workspace_model (QObject *parent = 0); ~workspace_model (); @@ -128,7 +128,7 @@ QVariant headerData (int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; QModelIndex index (int row, int column, - const QModelIndex &parent = QModelIndex ()) const; + const QModelIndex &parent = QModelIndex ()) const; QModelIndex parent (const QModelIndex &index) const; int rowCount (const QModelIndex &parent = QModelIndex ()) const; int columnCount (const QModelIndex &parent = QModelIndex ()) const; @@ -144,7 +144,7 @@ private: /** Timer for periodically updating the workspace model from the current - * symbol information. */ + * symbol information. */ QTimer _update_workspace_model_timer; /** Stores the current symbol information. */ diff --git a/libgui/src/workspace-view.cc b/libgui/src/workspace-view.cc --- a/libgui/src/workspace-view.cc +++ b/libgui/src/workspace-view.cc @@ -31,7 +31,7 @@ #include workspace_view::workspace_view (QWidget * parent) : QDockWidget - (parent) + (parent) { setObjectName ("WorkspaceView"); setWindowTitle (tr ("Workspace")); @@ -160,7 +160,7 @@ // In order to make collapsing/expanding work again, we need to set // flags ourselves here. QMap item_data - = _workspace_model->itemData (index); + = _workspace_model->itemData (index); if (item_data[0] == "Local") _explicit_collapse.local = true; @@ -187,7 +187,7 @@ // In order to make collapsing/expanding work again, we need to do set // flags ourselves here. QMap item_data - = _workspace_model->itemData (index); + = _workspace_model->itemData (index); if (item_data[0] == "Local") _explicit_collapse.local = false; diff --git a/libgui/src/workspace-view.h b/libgui/src/workspace-view.h --- a/libgui/src/workspace-view.h +++ b/libgui/src/workspace-view.h @@ -32,7 +32,7 @@ class workspace_view : public QDockWidget { Q_OBJECT -public: + public: workspace_view (QWidget * parent = 0); ~workspace_view ();