Mercurial > octave-nkf
comparison gui/src/main-window.cc @ 15045:1ffaad442161 gui
Source code formatting (80-column lines, mostly whitespace changes)
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Sat, 28 Jul 2012 21:53:45 -0400 |
parents | b7b1ffc88086 |
children | 48ae6a7c69c1 |
comparison
equal
deleted
inserted
replaced
15044:b7b1ffc88086 | 15045:1ffaad442161 |
---|---|
178 if (cursorType == "ibeam") | 178 if (cursorType == "ibeam") |
179 _terminal->setCursorType(QTerminalInterface::IBeamCursor, cursorBlinking); | 179 _terminal->setCursorType(QTerminalInterface::IBeamCursor, cursorBlinking); |
180 else if (cursorType == "block") | 180 else if (cursorType == "block") |
181 _terminal->setCursorType(QTerminalInterface::BlockCursor, cursorBlinking); | 181 _terminal->setCursorType(QTerminalInterface::BlockCursor, cursorBlinking); |
182 else if (cursorType == "underline") | 182 else if (cursorType == "underline") |
183 _terminal->setCursorType(QTerminalInterface::UnderlineCursor, cursorBlinking); | 183 _terminal->setCursorType(QTerminalInterface::UnderlineCursor, |
184 cursorBlinking); | |
184 | 185 |
185 resource_manager::instance ()->update_network_settings (); | 186 resource_manager::instance ()->update_network_settings (); |
186 } | 187 } |
187 | 188 |
188 void | 189 void |
498 = file_menu->addAction (tr ("Save Workspace...")); | 499 = file_menu->addAction (tr ("Save Workspace...")); |
499 save_workspace_action->setShortcut (Qt::ControlModifier + Qt::Key_S); | 500 save_workspace_action->setShortcut (Qt::ControlModifier + Qt::Key_S); |
500 file_menu->addSeparator (); | 501 file_menu->addSeparator (); |
501 | 502 |
502 QAction *preferences_action | 503 QAction *preferences_action |
503 = file_menu->addAction (QIcon(":/actions/icons/configure.png"), tr ("Preferences...")); | 504 = file_menu->addAction (QIcon(":/actions/icons/configure.png"), |
505 tr ("Preferences...")); | |
504 file_menu->addSeparator (); | 506 file_menu->addSeparator (); |
505 QAction *page_setup_action | 507 QAction *page_setup_action |
506 = file_menu->addAction (tr ("Page Setup...")); | 508 = file_menu->addAction (tr ("Page Setup...")); |
507 page_setup_action->setEnabled (false); // TODO: Make this work. | 509 page_setup_action->setEnabled (false); // TODO: Make this work. |
508 QAction *print_action | 510 QAction *print_action |
557 QAction *find_action | 559 QAction *find_action |
558 = edit_menu->addAction (tr ("Find...")); | 560 = edit_menu->addAction (tr ("Find...")); |
559 find_action->setEnabled (false); // TODO: Make this work. | 561 find_action->setEnabled (false); // TODO: Make this work. |
560 QAction *find_files_action | 562 QAction *find_files_action |
561 = edit_menu->addAction (tr ("Find Files...")); | 563 = edit_menu->addAction (tr ("Find Files...")); |
562 find_files_action->setShortcut (Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_F); | 564 find_files_action->setShortcut (Qt::ControlModifier + Qt::ShiftModifier |
565 + Qt::Key_F); | |
563 find_files_action->setEnabled (false); // TODO: Make this work. | 566 find_files_action->setEnabled (false); // TODO: Make this work. |
564 edit_menu->addSeparator (); | 567 edit_menu->addSeparator (); |
565 | 568 |
566 QAction *clear_command_window_action | 569 QAction *clear_command_window_action |
567 = edit_menu->addAction (tr ("Clear Command Window")); | 570 = edit_menu->addAction (tr ("Clear Command Window")); |
607 QAction * load_workspace_action = desktop_menu->addAction (tr ("Load workspace")); | 610 QAction * load_workspace_action = desktop_menu->addAction (tr ("Load workspace")); |
608 | 611 |
609 | 612 |
610 // Window menu | 613 // Window menu |
611 QMenu * window_menu = menuBar ()->addMenu (tr ("&Window")); | 614 QMenu * window_menu = menuBar ()->addMenu (tr ("&Window")); |
612 QAction * show_command_window_action = window_menu->addAction (tr ("Show Command Window")); | 615 QAction * show_command_window_action |
616 = window_menu->addAction (tr ("Show Command Window")); | |
613 show_command_window_action->setCheckable (true); | 617 show_command_window_action->setCheckable (true); |
614 show_command_window_action->setShortcut (Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_0); | 618 show_command_window_action->setShortcut (Qt::ControlModifier |
615 QAction * show_history_action = window_menu->addAction (tr ("Show Command History")); | 619 + Qt::ShiftModifier + Qt::Key_0); |
620 | |
621 QAction * show_history_action | |
622 = window_menu->addAction (tr ("Show Command History")); | |
616 show_history_action->setCheckable (true); | 623 show_history_action->setCheckable (true); |
617 show_history_action->setShortcut (Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_1); | 624 show_history_action->setShortcut (Qt::ControlModifier |
618 QAction * show_file_browser_action = window_menu->addAction (tr ("Show Current Directory")); | 625 + Qt::ShiftModifier + Qt::Key_1); |
626 QAction * show_file_browser_action | |
627 = window_menu->addAction (tr ("Show Current Directory")); | |
619 show_file_browser_action->setCheckable (true); | 628 show_file_browser_action->setCheckable (true); |
620 show_file_browser_action->setShortcut (Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_2); | 629 show_file_browser_action->setShortcut (Qt::ControlModifier |
621 QAction * show_workspace_action = window_menu->addAction (tr ("Show Workspace")); | 630 + Qt::ShiftModifier + Qt::Key_2); |
631 | |
632 QAction * show_workspace_action | |
633 = window_menu->addAction (tr ("Show Workspace")); | |
622 show_workspace_action->setCheckable (true); | 634 show_workspace_action->setCheckable (true); |
623 show_workspace_action->setShortcut (Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_3); | 635 show_workspace_action->setShortcut (Qt::ControlModifier |
624 QAction * show_editor_action = window_menu->addAction (tr ("Show Editor")); | 636 + Qt::ShiftModifier + Qt::Key_3); |
637 | |
638 QAction * show_editor_action = window_menu->addAction (tr ("Show Editor")); | |
625 show_editor_action->setCheckable (true); | 639 show_editor_action->setCheckable (true); |
626 show_editor_action->setShortcut (Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_4); | 640 show_editor_action->setShortcut (Qt::ControlModifier + Qt::ShiftModifier |
641 + Qt::Key_4); | |
627 window_menu->addSeparator (); | 642 window_menu->addSeparator (); |
628 QAction * command_window_action = window_menu->addAction (tr ("Command Window")); | 643 |
644 QAction * command_window_action | |
645 = window_menu->addAction (tr ("Command Window")); | |
629 command_window_action->setShortcut (Qt::ControlModifier + Qt::Key_0); | 646 command_window_action->setShortcut (Qt::ControlModifier + Qt::Key_0); |
630 QAction * history_action = window_menu->addAction (tr ("Command History")); | 647 |
648 QAction * history_action | |
649 = window_menu->addAction (tr ("Command History")); | |
631 history_action->setShortcut (Qt::ControlModifier + Qt::Key_1); | 650 history_action->setShortcut (Qt::ControlModifier + Qt::Key_1); |
632 QAction * file_browser_action = window_menu->addAction (tr ("Current Directory")); | 651 |
652 QAction * file_browser_action | |
653 = window_menu->addAction (tr ("Current Directory")); | |
633 file_browser_action->setShortcut (Qt::ControlModifier + Qt::Key_2); | 654 file_browser_action->setShortcut (Qt::ControlModifier + Qt::Key_2); |
634 QAction * workspace_action = window_menu->addAction (tr ("Workspace")); | 655 |
656 QAction * workspace_action | |
657 = window_menu->addAction (tr ("Workspace")); | |
635 workspace_action->setShortcut (Qt::ControlModifier + Qt::Key_3); | 658 workspace_action->setShortcut (Qt::ControlModifier + Qt::Key_3); |
636 QAction * editor_action = window_menu->addAction (tr ("Editor")); | 659 |
660 QAction * editor_action | |
661 = window_menu->addAction (tr ("Editor")); | |
637 editor_action->setShortcut (Qt::ControlModifier + Qt::Key_4); | 662 editor_action->setShortcut (Qt::ControlModifier + Qt::Key_4); |
663 | |
638 window_menu->addSeparator (); | 664 window_menu->addSeparator (); |
639 QAction * reset_windows_action = window_menu->addAction (tr ("Reset Windows")); | 665 QAction * reset_windows_action |
666 = window_menu->addAction (tr ("Reset Windows")); | |
640 reset_windows_action->setEnabled (false); // TODO: Make this work. | 667 reset_windows_action->setEnabled (false); // TODO: Make this work. |
641 | 668 |
642 // Help menu | 669 // Help menu |
643 QMenu * help_menu = menuBar ()->addMenu (tr ("&Help")); | 670 QMenu * help_menu = menuBar ()->addMenu (tr ("&Help")); |
644 QAction * report_bug_action = help_menu->addAction (tr ("Report Bug")); | 671 QAction * report_bug_action |
645 QAction * agora_action = help_menu->addAction (tr ("Visit Agora")); | 672 = help_menu->addAction (tr ("Report Bug")); |
646 QAction * octave_forge_action = help_menu->addAction (tr ("Visit Octave Forge")); | 673 QAction * agora_action |
674 = help_menu->addAction (tr ("Visit Agora")); | |
675 QAction * octave_forge_action | |
676 = help_menu->addAction (tr ("Visit Octave Forge")); | |
647 help_menu->addSeparator (); | 677 help_menu->addSeparator (); |
648 QAction * about_octave_action = help_menu->addAction (tr ("About Octave")); | 678 |
679 QAction * about_octave_action | |
680 = help_menu->addAction (tr ("About Octave")); | |
649 | 681 |
650 // Toolbars | 682 // Toolbars |
651 QToolBar *main_tool_bar = addToolBar ("Main"); | 683 QToolBar *main_tool_bar = addToolBar ("Main"); |
652 main_tool_bar->addAction (new_script_action); | 684 main_tool_bar->addAction (new_script_action); |
653 main_tool_bar->addAction (open_action); | 685 main_tool_bar->addAction (open_action); |
663 main_tool_bar->addWidget (_current_directory_tool_button); | 695 main_tool_bar->addWidget (_current_directory_tool_button); |
664 main_tool_bar->addWidget (_current_directory_up_tool_button); | 696 main_tool_bar->addWidget (_current_directory_up_tool_button); |
665 | 697 |
666 connect (qApp, SIGNAL (aboutToQuit ()), | 698 connect (qApp, SIGNAL (aboutToQuit ()), |
667 this, SLOT (prepare_for_quit ())); | 699 this, SLOT (prepare_for_quit ())); |
668 connect (preferences_action, SIGNAL (triggered ()), | 700 connect (preferences_action, SIGNAL (triggered ()), |
669 this, SLOT (process_settings_dialog_request ())); | 701 this, SLOT (process_settings_dialog_request ())); |
670 connect (exit_action, SIGNAL (triggered ()), | 702 connect (exit_action, SIGNAL (triggered ()), |
671 this, SLOT (close ())); | 703 this, SLOT (close ())); |
672 connect (new_script_action, SIGNAL (triggered ()), | 704 connect (new_script_action, SIGNAL (triggered ()), |
673 this, SLOT (new_file ())); | 705 this, SLOT (new_file ())); |
674 connect (open_action, SIGNAL (triggered ()), | 706 connect (open_action, SIGNAL (triggered ()), |
675 this, SLOT (open_file ())); | 707 this, SLOT (open_file ())); |
676 connect (report_bug_action, SIGNAL (triggered ()), | 708 connect (report_bug_action, SIGNAL (triggered ()), |
677 this, SLOT (open_bug_tracker_page ())); | 709 this, SLOT (open_bug_tracker_page ())); |
678 connect (agora_action, SIGNAL (triggered ()), | 710 connect (agora_action, SIGNAL (triggered ()), |
679 this, SLOT (open_agora_page ())); | 711 this, SLOT (open_agora_page ())); |