Ticket #2389: terminal.diff
File terminal.diff, 4.2 KB (added by , 15 years ago) |
---|
-
TermWindow.cpp
39 39 #include "TermConst.h" 40 40 #include "TermScrollView.h" 41 41 #include "TermView.h" 42 #include "SetTitleDlg.h" 42 43 43 44 44 45 const static int32 kMaxTabs = 6; … … 145 146 fPrintSettings(NULL), 146 147 fPrefWindow(NULL), 147 148 fFindPanel(NULL), 149 fSetTitlePanel(NULL), 148 150 fSavedFrame(0, 0, -1, -1), 149 151 fFindString(""), 150 152 fFindForwardMenuItem(NULL), … … 253 255 fFilemenu->AddItem(new BMenuItem("Switch Terminals", new BMessage(MENU_SWITCH_TERM),'G')); 254 256 fFilemenu->AddItem(new BMenuItem("New Terminal" B_UTF8_ELLIPSIS, new BMessage(MENU_NEW_TERM), 'N')); 255 257 fFilemenu->AddItem(new BMenuItem("New Tab", new BMessage(kNewTab), 'T')); 258 fFilemenu->AddItem(new BMenuItem("Set Title" B_UTF8_ELLIPSIS, new BMessage(MENU_SET_WIN_TITLE), 'R')); 256 259 257 260 fFilemenu->AddSeparatorItem(); 258 261 fFilemenu->AddItem(new BMenuItem("Page Setup" B_UTF8_ELLIPSIS, new BMessage(MENU_PAGE_SETUP))); … … 357 360 break; 358 361 } 359 362 363 case MENU_SET_WIN_TITLE: 364 this->SetTitleRequested(); 365 break; 366 367 case MSG_SET_TITLE_CLOSED: 368 fSetTitlePanel = NULL; 369 break; 370 360 371 case MENU_PREF_OPEN: 361 372 if (!fPrefWindow) 362 373 fPrefWindow = new PrefWindow(this); … … 609 620 610 621 611 622 void 623 TermWindow::SetTitleRequested (void) 624 { 625 if (fSetTitlePanel) 626 { 627 fSetTitlePanel->Activate (); 628 } 629 else 630 { 631 632 BRect rect(0, 0, 250, 100); 633 rect.OffsetTo (this->Frame().LeftTop()); 634 rect.OffsetBy (100, 100); 635 fSetTitlePanel = new SetTitleDlg (rect, this); 636 fSetTitlePanel->Show(); 637 } 638 639 } 640 641 void 612 642 TermWindow::WindowActivated(bool activated) 613 643 { 614 644 BWindow::WindowActivated(activated); -
Jamfile
18 18 PrefHandler.cpp 19 19 PrefView.cpp 20 20 PrefWindow.cpp 21 SetTitleDlg.cpp 21 22 Shell.cpp 22 23 SmartTabView.cpp 23 24 TermApp.cpp -
TermWindow.h
44 44 class SmartTabView; 45 45 class TermView; 46 46 class TermViewContainerView; 47 class SetTitleDlg; 47 48 48 49 49 50 class TermWindow : public BWindow { … … 55 56 const char* title); 56 57 void SessionChanged(); 57 58 59 void SetTitleRequested (void); 60 // this was a private function. 61 // needs to be changed to public 62 // so it can be used in the SetTitleDlg window to change the title from the GUI's menu 63 TermView* _ActiveTermView() const; 64 58 65 protected: 59 66 virtual void MessageReceived(BMessage *message); 60 67 virtual void WindowActivated(bool); … … 75 82 void _RemoveTab(int32 index); 76 83 TermViewContainerView* _ActiveTermViewContainerView() const; 77 84 TermViewContainerView* _TermViewContainerViewAt(int32 index) const; 78 TermView* _ActiveTermView() const; 85 // this was a private function. 86 // needs to be changed to public 87 // so it can be used in the SetTitleDlg window to change the title from the GUI's menu 88 //TermView* _ActiveTermView() const; 79 89 TermView* _TermViewAt(int32 index) const; 80 90 int32 _IndexOfTermView(TermView* termView) const; 81 91 void _CheckChildren(); … … 99 109 BMessage *fPrintSettings; 100 110 PrefWindow *fPrefWindow; 101 111 FindWindow *fFindPanel; 112 SetTitleDlg *fSetTitlePanel; 102 113 BRect fSavedFrame; 103 114 window_look fSavedLook; 104 115 -
TermConst.h
50 50 const uint32 MENU_SWITCH_TERM = 'MSWT'; 51 51 const uint32 MENU_NEW_TERM = 'MNTE'; 52 52 const uint32 MENU_PREF_OPEN = 'MPre'; 53 const uint32 MENU_SET_WIN_TITLE = 'MSTL'; 53 54 const uint32 MENU_CLEAR_ALL = 'MCAl'; 54 55 const uint32 MENU_HELP = 'Mhlp'; 55 56 const uint32 MENU_COMMAND_HELP = 'Mchp'; … … 91 92 const uint32 MSG_TERMINAL_BUFFER_CHANGED = 'bufc'; 92 93 const uint32 MSG_SET_TERMNAL_TITLE = 'sett'; 93 94 const uint32 MSG_QUIT_TERMNAL = 'qutt'; 95 const uint32 MSG_SET_TITLE_CLOSED = 'mstc'; 96 const uint32 MSG_OK_CHANGE_TITLE = 'okct'; 94 97 95 98 // Preference Read/Write Keys 96 99 const char* const PREF_HALF_FONT_FAMILY = "Half Font Family";