Mercurial > hg > octave-nkf
comparison gui/src/editor/FileEditorTab.cpp @ 14680:628eeaf879f7 gui
Copy/Paste buttons get greyed out in the editor correctly again. Removed margin in editor tabs and status bar.
* FileEditor: Removed status bar and added slot to handle changes in tabs.
* FileEditorTab: Removed margen and added signal when copying is possible.
author | Jacob Dawid <jacob.dawid@googlemail.com> |
---|---|
date | Thu, 24 May 2012 12:08:53 +0200 |
parents | 35512b788af2 |
children | ca733a66be7a |
comparison
equal
deleted
inserted
replaced
14678:9fa8955ea79d | 14680:628eeaf879f7 |
---|---|
72 } | 72 } |
73 m_editArea->setUtf8 (true); | 73 m_editArea->setUtf8 (true); |
74 | 74 |
75 QVBoxLayout *layout = new QVBoxLayout (); | 75 QVBoxLayout *layout = new QVBoxLayout (); |
76 layout->addWidget (m_editArea); | 76 layout->addWidget (m_editArea); |
77 layout->setMargin (0); | |
77 setLayout (layout); | 78 setLayout (layout); |
78 | 79 |
79 // connect modified signal | 80 // connect modified signal |
80 connect (m_editArea, SIGNAL (modificationChanged (bool)), | 81 connect (m_editArea, SIGNAL (modificationChanged (bool)), |
81 this, SLOT (newTitle (bool))); | 82 this, SLOT (newTitle (bool))); |
84 | 85 |
85 m_fileName = ""; | 86 m_fileName = ""; |
86 newTitle (false); | 87 newTitle (false); |
87 } | 88 } |
88 | 89 |
89 void | 90 bool |
90 FileEditorTab::closeEvent(QCloseEvent *event) | 91 FileEditorTab::copyAvailable () |
92 { | |
93 return m_copyAvailable; | |
94 } | |
95 | |
96 void | |
97 FileEditorTab::closeEvent (QCloseEvent *event) | |
91 { | 98 { |
92 if (m_fileEditor->mainWindow ()->closing ()) | 99 if (m_fileEditor->mainWindow ()->closing ()) |
93 { | 100 { |
94 // close whole application: save file or not if modified | 101 // close whole application: save file or not if modified |
95 checkFileModified ("Closing Octave", 0); // no cancel possible | 102 checkFileModified ("Closing Octave", 0); // no cancel possible |
182 } | 189 } |
183 | 190 |
184 void | 191 void |
185 FileEditorTab::handleCopyAvailable(bool enableCopy) | 192 FileEditorTab::handleCopyAvailable(bool enableCopy) |
186 { | 193 { |
187 /* | 194 m_copyAvailable = enableCopy; |
188 m_copyAction->setEnabled(enableCopy); | 195 emit editorStateChanged (); |
189 m_cutAction->setEnabled(enableCopy); | |
190 */ | |
191 } | 196 } |
192 | 197 |
193 int | 198 int |
194 FileEditorTab::checkFileModified (QString msg, int cancelButton) | 199 FileEditorTab::checkFileModified (QString msg, int cancelButton) |
195 { | 200 { |