Changeset 83c8dff04a6f233caea7d1c27f9cca83c6150574
- Timestamp:
- 01/06/07 23:48:18 (6 years ago)
- Author:
- Philipp Kern <phil@…>
- Parents:
- 41c1d8c0ed98f7095dee17fa1883342103b525fb
- Children:
- c4c59451bdaf2ad064fc5e5e6800ca4e1d0f6bee
- git-committer:
- Philipp Kern <phil@0x539.de> / 2007-01-06T22:48:18Z+0000
- Message:
-
[project @ Removed pending changes and revision from the status bar]
Original author: Philipp Kern <phil@…>
Date: 2005-09-15 20:19:56+00:00
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r4a2cffc
|
r83c8dff
|
|
| 39 | 39 | |
| 40 | 40 | void update_language(Document& document); |
| 41 | | void update_sync(Document& document); |
| 42 | | void update_revision(Document& document); |
| 43 | 41 | void update_cursor(Document& document); |
| 44 | 42 | |
| … |
… |
|
| 56 | 54 | Gtk::HBox m_box; |
| 57 | 55 | Gtk::Label m_language; |
| 58 | | Gtk::Label m_sync; |
| 59 | | Gtk::Label m_revision; |
| 60 | 56 | Gtk::Label m_position; |
| 61 | 57 | }; |
-
|
r4a2cffc
|
r83c8dff
|
|
| 27 | 27 | : Frame(), |
| 28 | 28 | m_language("", Gtk::ALIGN_LEFT), |
| 29 | | m_sync("", Gtk::ALIGN_LEFT), |
| 30 | | m_revision("", Gtk::ALIGN_LEFT), |
| 31 | 29 | m_position("", Gtk::ALIGN_LEFT) |
| 32 | 30 | { |
| 33 | 31 | m_box.pack_start(m_language, Gtk::PACK_SHRINK); |
| 34 | | m_box.pack_start(*Gtk::manage(new Gtk::VSeparator), Gtk::PACK_SHRINK); |
| 35 | | m_box.pack_start(m_sync, Gtk::PACK_SHRINK); |
| 36 | | m_box.pack_start(*Gtk::manage(new Gtk::VSeparator), Gtk::PACK_SHRINK); |
| 37 | | m_box.pack_start(m_revision, Gtk::PACK_SHRINK); |
| 38 | 32 | m_box.pack_end(m_position, Gtk::PACK_SHRINK, 2); |
| 39 | 33 | m_box.set_spacing(5); |
| … |
… |
|
| 44 | 38 | folder.document_cursor_moved_event().connect( |
| 45 | 39 | sigc::mem_fun(*this, &StatusBar::update_cursor) ); |
| 46 | | folder.document_content_changed_event().connect( |
| 47 | | sigc::mem_fun(*this, &StatusBar::update_sync) ); |
| 48 | | folder.document_content_changed_event().connect( |
| 49 | | sigc::mem_fun(*this, &StatusBar::update_revision) ); |
| 50 | 40 | folder.document_language_changed_event().connect( |
| 51 | 41 | sigc::mem_fun(*this, &StatusBar::update_language) ); |
| … |
… |
|
| 73 | 63 | } |
| 74 | 64 | |
| 75 | | void Gobby::StatusBar::update_sync(Document& document) |
| 76 | | { |
| 77 | | unsigned int n = document.get_unsynced_changes_count(); |
| 78 | | obby::format_string str( |
| 79 | | ngettext("%0% pending change", "%0% pending changes", n) ); |
| 80 | | str << n; |
| 81 | | m_sync.set_text(str.str() ); |
| 82 | | } |
| 83 | | |
| 84 | | void Gobby::StatusBar::update_revision(Document& document) |
| 85 | | { |
| 86 | | obby::format_string str(_("Revision: %0%") ); |
| 87 | | str << document.get_revision(); |
| 88 | | m_revision.set_text(str.str() ); |
| 89 | | } |
| 90 | | |
| 91 | 65 | void Gobby::StatusBar::update_cursor(Document& document) |
| 92 | 66 | { |
| … |
… |
|
| 102 | 76 | { |
| 103 | 77 | update_language(document); |
| 104 | | update_sync(document); |
| 105 | | update_revision(document); |
| 106 | 78 | update_cursor(document); |
| 107 | 79 | } |
| … |
… |
|
| 114 | 86 | { |
| 115 | 87 | m_language.set_text(""); |
| 116 | | m_sync.set_text(""); |
| 117 | | m_revision.set_text(""); |
| 118 | 88 | m_position.set_text(""); |
| 119 | 89 | } |