Changeset 215618cb3db4556e21f4040ae192e01f100fde03
- Timestamp:
- 12/30/08 21:27:58 (4 years ago)
- Author:
- Armin Burgmeier <armin@…>
- Parents:
- 46c2fe582fd327e88c951d358f31ef15536c8eca
- Children:
- 9a8cd27d463ae24ca3b212a3d0be3bef9bea422a
- git-committer:
- Armin Burgmeier <armin@arbur.net> / 2008-12-30T21:27:58Z+0100
- Message:
-
Added SignalFinish? to operation base class
2008-12-30 Armin Burgmeier <armin@…>
- code/operations/operations.hpp:
- code/operations/operations.cpp: Added signal_finished to the
operation base class, and the various functions creating operations
now return them.
- code/operations/operation-save.cpp: Fixed a typo in a comment.
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r46c2fe5
|
r215618c
|
|
| 1 | | 2008-12-28 Armin Burgmeier <armin@arbur.net> |
| | 1 | 2008-12-30 Armin Burgmeier <armin@arbur.net> |
| | 2 | |
| | 3 | * code/operations/operations.hpp: |
| | 4 | * code/operations/operations.cpp: Added signal_finished to the |
| | 5 | operation base class, and the various functions creating operations |
| | 6 | now return them. |
| | 7 | |
| | 8 | * code/operations/operation-save.cpp: Fixed a typo in a comment. |
| | 9 | |
| | 10 | 2008-12-29 Armin Burgmeier <armin@arbur.net> |
| 2 | 11 | |
| 3 | 12 | * code/window.hpp: |
-
|
r4d4ee96
|
r215618c
|
|
| 139 | 139 | if(done) |
| 140 | 140 | { |
| 141 | | if(m_document != NULL) |
| 142 | | { |
| 143 | | // TODO: Don't unset modified flag if the document has |
| 144 | | // changed in the meanwhile. |
| 145 | | gtk_text_buffer_set_modified( |
| 146 | | GTK_TEXT_BUFFER( |
| 147 | | m_document->get_text_buffer()), |
| 148 | | FALSE); |
| 149 | | } |
| 150 | | |
| 151 | 141 | DocumentInfoStorage::Info info; |
| 152 | 142 | info.uri = m_file->get_uri(); |
| … |
… |
|
| 156 | 146 | |
| 157 | 147 | m_stream->close(); |
| | 148 | |
| | 149 | if(m_document != NULL) |
| | 150 | { |
| | 151 | // TODO: Don't unset modified flag if the document has |
| | 152 | // changed in the meanwhile, but set |
| | 153 | // buffer-modified-time in algorithm. |
| | 154 | gtk_text_buffer_set_modified( |
| | 155 | GTK_TEXT_BUFFER( |
| | 156 | m_document->get_text_buffer()), |
| | 157 | FALSE); |
| | 158 | } |
| | 159 | |
| 158 | 160 | remove(); |
| 159 | 161 | } |
| … |
… |
|
| 204 | 206 | |
| 205 | 207 | /* iconv is defined as libiconv on Windows, or at least when using the |
| 206 | | * binary packages from ftp.gnome.org. Therefore we can't propely |
| | 208 | * binary packages from ftp.gnome.org. Therefore we can't properly |
| 207 | 209 | * call Glib::IConv::iconv. Therefore, we use the C API here. */ |
| 208 | 210 | std::size_t retval = g_iconv( |
-
|
r4d4ee96
|
r215618c
|
|
| 21 | 21 | #include "operations/operation-save.hpp" |
| 22 | 22 | #include "operations/operation-delete.hpp" |
| | 23 | |
| 23 | 24 | #include "operations/operations.hpp" |
| 24 | 25 | |
| … |
… |
|
| 43 | 44 | } |
| 44 | 45 | |
| 45 | | void Gobby::Operations::create_directory(InfcBrowser* browser, |
| 46 | | InfcBrowserIter* parent, |
| 47 | | const Glib::ustring& name) |
| | 46 | Gobby::Operations::Operation* |
| | 47 | Gobby::Operations::create_directory(InfcBrowser* browser, |
| | 48 | InfcBrowserIter* parent, |
| | 49 | const Glib::ustring& name) |
| 48 | 50 | { |
| 49 | | m_operations.insert(new OperationNew(*this, browser, parent, |
| 50 | | name, true)); |
| | 51 | OperationNew* op = new OperationNew(*this, browser, parent, |
| | 52 | name, true); |
| | 53 | |
| | 54 | m_operations.insert(op); |
| | 55 | return op; |
| 51 | 56 | } |
| 52 | 57 | |
| 53 | | void Gobby::Operations::create_document(InfcBrowser* browser, |
| 54 | | InfcBrowserIter* parent, |
| 55 | | const Glib::ustring& name) |
| | 58 | Gobby::Operations::Operation* |
| | 59 | Gobby::Operations::create_document(InfcBrowser* browser, |
| | 60 | InfcBrowserIter* parent, |
| | 61 | const Glib::ustring& name) |
| 56 | 62 | { |
| 57 | | m_operations.insert(new OperationNew(*this, browser, parent, |
| 58 | | name, false)); |
| | 63 | OperationNew* op = new OperationNew(*this, browser, parent, |
| | 64 | name, false); |
| | 65 | |
| | 66 | m_operations.insert(op); |
| | 67 | return op; |
| 59 | 68 | } |
| 60 | 69 | |
| 61 | | void Gobby::Operations::create_document(InfcBrowser* browser, |
| 62 | | InfcBrowserIter* parent, |
| 63 | | const Glib::ustring& name, |
| 64 | | const Preferences& preferences, |
| 65 | | const Glib::ustring& from_uri, |
| 66 | | const char* encoding) |
| | 70 | Gobby::Operations::Operation* |
| | 71 | Gobby::Operations::create_document(InfcBrowser* browser, |
| | 72 | InfcBrowserIter* parent, |
| | 73 | const Glib::ustring& name, |
| | 74 | const Preferences& preferences, |
| | 75 | const Glib::ustring& from_uri, |
| | 76 | const char* encoding) |
| 67 | 77 | { |
| 68 | | m_operations.insert( |
| 69 | | new OperationOpen(*this, preferences, browser, parent, name, |
| 70 | | from_uri, encoding)); |
| | 78 | OperationOpen* op = new OperationOpen(*this, preferences, browser, |
| | 79 | parent, name, from_uri, |
| | 80 | encoding); |
| | 81 | |
| | 82 | m_operations.insert(op); |
| | 83 | return op; |
| 71 | 84 | } |
| 72 | 85 | |
| 73 | | void Gobby::Operations::save_document(DocWindow& document, |
| 74 | | Folder& folder, |
| 75 | | const std::string& uri, |
| 76 | | const std::string& encoding, |
| 77 | | DocumentInfoStorage::EolStyle eol_style) |
| | 86 | Gobby::Operations::Operation* |
| | 87 | Gobby::Operations::save_document(DocWindow& document, |
| | 88 | Folder& folder, |
| | 89 | const std::string& uri, |
| | 90 | const std::string& encoding, |
| | 91 | DocumentInfoStorage::EolStyle eol_style) |
| 78 | 92 | { |
| 79 | | m_operations.insert( |
| 80 | | new OperationSave(*this, document, folder, uri, encoding, |
| 81 | | eol_style)); |
| | 93 | OperationSave* op = new OperationSave(*this, document, folder, uri, |
| | 94 | encoding, eol_style); |
| | 95 | |
| | 96 | m_operations.insert(op); |
| | 97 | return op; |
| 82 | 98 | } |
| 83 | 99 | |
| 84 | | void Gobby::Operations::delete_node(InfcBrowser* browser, |
| 85 | | InfcBrowserIter* iter) |
| | 100 | Gobby::Operations::Operation* |
| | 101 | Gobby::Operations::delete_node(InfcBrowser* browser, |
| | 102 | InfcBrowserIter* iter) |
| 86 | 103 | { |
| 87 | | m_operations.insert(new OperationDelete(*this, browser, iter)); |
| | 104 | OperationDelete* op = new OperationDelete(*this, browser, iter); |
| | 105 | m_operations.insert(op); |
| | 106 | return op; |
| 88 | 107 | } |
| 89 | 108 | |
-
|
r4d4ee96
|
r215618c
|
|
| 39 | 39 | { |
| 40 | 40 | public: |
| | 41 | typedef sigc::signal<void> SignalFinished; |
| | 42 | |
| 41 | 43 | Operation(Operations& operations): |
| 42 | 44 | m_operations(operations) {} |
| … |
… |
|
| 53 | 55 | } |
| 54 | 56 | |
| 55 | | void remove() { m_operations.remove_operation(this); } |
| | 57 | void remove() |
| | 58 | { |
| | 59 | m_signal_finished.emit(); |
| | 60 | m_operations.remove_operation(this); |
| | 61 | } |
| | 62 | |
| | 63 | SignalFinished signal_finished() const |
| | 64 | { |
| | 65 | return m_signal_finished; |
| | 66 | } |
| 56 | 67 | private: |
| | 68 | SignalFinished m_signal_finished; |
| 57 | 69 | Operations& m_operations; |
| 58 | 70 | }; |
| … |
… |
|
| 61 | 73 | ~Operations(); |
| 62 | 74 | |
| 63 | | void create_directory(InfcBrowser* browser, |
| 64 | | InfcBrowserIter* parent, |
| 65 | | const Glib::ustring& name); |
| | 75 | Operation* create_directory(InfcBrowser* browser, |
| | 76 | InfcBrowserIter* parent, |
| | 77 | const Glib::ustring& name); |
| 66 | 78 | |
| 67 | | void create_document(InfcBrowser* browser, |
| 68 | | InfcBrowserIter* parent, |
| 69 | | const Glib::ustring& name); |
| | 79 | Operation* create_document(InfcBrowser* browser, |
| | 80 | InfcBrowserIter* parent, |
| | 81 | const Glib::ustring& name); |
| 70 | 82 | |
| 71 | | void create_document(InfcBrowser* browser, |
| 72 | | InfcBrowserIter* parent, |
| 73 | | const Glib::ustring& name, |
| 74 | | const Preferences& preferences, |
| 75 | | const Glib::ustring& from_uri, |
| 76 | | const char* encoding); |
| | 83 | Operation* create_document(InfcBrowser* browser, |
| | 84 | InfcBrowserIter* parent, |
| | 85 | const Glib::ustring& name, |
| | 86 | const Preferences& preferences, |
| | 87 | const Glib::ustring& from_uri, |
| | 88 | const char* encoding); |
| 77 | 89 | |
| 78 | | void save_document(DocWindow& document, |
| 79 | | Folder& folder, |
| 80 | | const std::string& uri, |
| 81 | | const std::string& encoding, |
| 82 | | DocumentInfoStorage::EolStyle eol_style); |
| | 90 | Operation* save_document(DocWindow& document, |
| | 91 | Folder& folder, |
| | 92 | const std::string& uri, |
| | 93 | const std::string& encoding, |
| | 94 | DocumentInfoStorage::EolStyle eol_style); |
| 83 | 95 | |
| 84 | | void delete_node(InfcBrowser* browser, |
| 85 | | InfcBrowserIter* iter); |
| | 96 | Operation* delete_node(InfcBrowser* browser, |
| | 97 | InfcBrowserIter* iter); |
| 86 | 98 | |
| 87 | 99 | protected: |