Changeset 6fbb20faf0c9263df082e566d81d646880948636
- Timestamp:
- 10/14/08 00:26:39 (5 years ago)
- Parents:
- 1bd84c9d6dcc0de860310abca412cc2d271f2d41
- Children:
- 09f550a23adf2adfddfdcf3bbc12cff6c1b1d669
- git-committer:
- Armin Burgmeier <armin@arbur.net> / 2008-10-14T00:26:39Z+0200
- Files:
-
- 8 modified
-
ChangeLog (modified) (1 diff)
-
TODO (modified) (1 diff)
-
code/commands/browser-commands.cpp (modified) (5 diffs)
-
code/commands/browser-commands.hpp (modified) (3 diffs)
-
code/core/tablabel.cpp (modified) (4 diffs)
-
code/core/tablabel.hpp (modified) (1 diff)
-
code/operations/operation-open.cpp (modified) (1 diff)
-
code/operations/operation-save.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
rd759de2 r6fbb20f 1 2008-10-13 Armin Burgmeier <armin@arbur.net> 2 3 * code/commands/browser-commands.hpp: 4 * code/commands/browser-commands.cpp: 5 * code/operations/operation-open.cpp: 6 * code/operations/operation-save.cpp: Set the modified flag upon 7 opening or saving a document correctly. 8 9 * code/core/tablabel.hpp: 10 * code/core/tablabel.cpp: Show the modify flag in the tab. 11 1 12 2008-10-12 Armin Burgmeier <armin@arbur.net> 2 13 -
TODO
r1bd84c9 r6fbb20f 1 Critical bugs:2 - Gobby crashes when a document that is currently open gets deleted from the3 server4 5 1 Some features that would be nice for a final Gobby 0.5 release. We could 6 2 perhaps do pre-releases with some of these missing before: -
code/commands/browser-commands.cpp
rbd34be3 r6fbb20f 17 17 */ 18 18 19 // TODO: Split this file into multiple smaller files, 20 // perhaps browser-commands.cpp (basically on_activate) 21 // synchronization-commands.cpp (basically on_subscribe_session) 22 // user-join-commands.cpp (basically join_user) 23 19 24 #include "commands/browser-commands.hpp" 20 25 #include "util/i18n.hpp" … … 139 144 g_signal_handler_disconnect(proxy, notify_connection_id); 140 145 g_signal_handler_disconnect(session, failed_id); 141 g_signal_handler_disconnect(session, complete_id); 146 g_signal_handler_disconnect(session, complete_before_id); 147 g_signal_handler_disconnect(session, complete_after_id); 142 148 g_signal_handler_disconnect(session, progress_id); 143 149 g_signal_handler_disconnect(session, close_id); … … 317 323 // AdoptedAlgorithm the default handler created to perform 318 324 // the user join. 319 node.complete_ id = g_signal_connect_after(325 node.complete_before_id = g_signal_connect( 320 326 session, "synchronization-complete", 321 G_CALLBACK(on_synchronization_complete_static), this); 327 G_CALLBACK(on_synchronization_complete_before_static), this); 328 node.complete_after_id = g_signal_connect_after( 329 session, "synchronization-complete", 330 G_CALLBACK(on_synchronization_complete_after_static), this); 322 331 node.progress_id = g_signal_connect( 323 332 session, "synchronization-progress", … … 326 335 session, "close", G_CALLBACK(on_close_static), this); 327 336 328 // TODO: Connect to notify::status of subscription connection329 330 337 if(inf_session_get_status(session) == INF_SESSION_SYNCHRONIZING) 331 338 { … … 383 390 Glib::ustring::compose("Synchronization failed: %1", 384 391 error->message), SYNC_ERROR); 385 } 386 } 387 388 void Gobby::BrowserCommands::on_synchronization_complete(InfSession* session, 389 InfXmlConnection* c) 392 393 // The document will be of no use anyway, so consider it not 394 // being modified. 395 gtk_text_buffer_set_modified( 396 GTK_TEXT_BUFFER(window->get_text_buffer()), FALSE); 397 } 398 } 399 400 void Gobby::BrowserCommands:: 401 on_synchronization_complete_before(InfSession* session, 402 InfXmlConnection* connection) 403 { 404 SessionMap::iterator iter = m_session_map.find(session); 405 g_assert(iter != m_session_map.end()); 406 407 if(iter->second.status == INF_SESSION_SYNCHRONIZING) 408 { 409 // Unset modified flag after synchronization. 410 DocWindow* window = m_folder.lookup_document( 411 INF_TEXT_SESSION(session)); 412 g_assert(window != NULL); 413 414 gtk_text_buffer_set_modified( 415 GTK_TEXT_BUFFER(window->get_text_buffer()), FALSE); 416 417 // TODO: Actually we should always set the modified flag, 418 // except the document is either empty, or known in the 419 // document info storage and the version on disk is the same 420 // as the one we got synchronized. We could store a hash and 421 // modification time in the documentinfo storage for this. 422 // We should do this is another source file, such as 423 // synchronization-commands.cpp. 424 } 425 } 426 427 void Gobby::BrowserCommands:: 428 on_synchronization_complete_after(InfSession* session, 429 InfXmlConnection* connection) 390 430 { 391 431 SessionMap::iterator iter = m_session_map.find(session); -
code/commands/browser-commands.hpp
rbd34be3 r6fbb20f 86 86 } 87 87 88 static void on_synchronization_complete_static(InfSession* session, 89 InfXmlConnection* conn, 90 gpointer user_data) 91 { 92 static_cast<BrowserCommands*>(user_data)-> 93 on_synchronization_complete(session, conn); 88 static void 89 on_synchronization_complete_before_static(InfSession* session, 90 InfXmlConnection* conn, 91 gpointer user_data) 92 { 93 static_cast<BrowserCommands*>(user_data)-> 94 on_synchronization_complete_before(session, conn); 95 } 96 97 static void 98 on_synchronization_complete_after_static(InfSession* session, 99 InfXmlConnection* conn, 100 gpointer user_data) 101 { 102 static_cast<BrowserCommands*>(user_data)-> 103 on_synchronization_complete_after(session, conn); 94 104 } 95 105 … … 147 157 InfXmlConnection* connection, 148 158 const GError* error); 149 void on_synchronization_complete(InfSession* session, 150 InfXmlConnection* connection); 159 void on_synchronization_complete_before(InfSession* session, 160 InfXmlConnection* connection); 161 void on_synchronization_complete_after(InfSession* session, 162 InfXmlConnection* connection); 151 163 void on_synchronization_progress(InfSession* session, 152 164 InfXmlConnection* connection, … … 186 198 gulong notify_connection_id; 187 199 gulong failed_id; 188 gulong complete_id; 200 gulong complete_before_id; 201 gulong complete_after_id; 189 202 gulong progress_id; 190 203 gulong close_id; -
code/core/tablabel.cpp
r6cb2a94 r6fbb20f 25 25 Gtk::HBox(false, 6), 26 26 m_folder(folder), m_document(document), 27 m_title(document.get_title(), Gtk::ALIGN_LEFT),28 27 m_changed(false) 29 28 { 30 update_icon(); 29 m_title.set_alignment(Gtk::ALIGN_LEFT); 30 31 update_icon(); 32 update_color(); 33 update_modified(); 31 34 32 35 m_icon.show(); … … 82 85 update_icon(); 83 86 update_color(); 87 update_modified(); 84 88 } 85 89 … … 92 96 void Gobby::TabLabel::on_modified_changed() 93 97 { 98 update_modified(); 94 99 } 95 100 … … 184 189 } 185 190 } 191 192 void Gobby::TabLabel::update_modified() 193 { 194 InfSession* session = INF_SESSION(m_document.get_session()); 195 bool modified = gtk_text_buffer_get_modified( 196 GTK_TEXT_BUFFER(m_document.get_text_buffer())); 197 198 if(inf_session_get_status(session) == INF_SESSION_SYNCHRONIZING) 199 modified = false; 200 201 if(modified) 202 m_title.set_text("*" + m_document.get_title()); 203 else 204 m_title.set_text(m_document.get_title()); 205 } -
code/core/tablabel.hpp
r6cb2a94 r6fbb20f 91 91 void update_icon(); 92 92 void update_color(); 93 void update_modified(); 93 94 94 95 Folder& m_folder; -
code/operations/operation-open.cpp
rd759de2 r6fbb20f 348 348 void Gobby::OperationOpen::read_finish() 349 349 { 350 gtk_text_buffer_set_modified(m_content, FALSE); 351 350 352 GtkTextIter insert_iter; 351 353 GtkTextMark* insert = gtk_text_buffer_get_insert(m_content); -
code/operations/operation-save.cpp
rbd34be3 r6fbb20f 83 83 get_status_bar().remove_message(m_message_handle); 84 84 85 // Reset file explicite nly before closing stream so that, on failure,85 // Reset file explicitely before closing stream so that, on failure, 86 86 // existing files are not overriden with the temporary files we 87 87 // actually wrote to, at least for local files. … … 141 141 if(m_document != NULL) 142 142 { 143 // TODO: Don't unset modified flag if the document has 144 // changed in the meanwhile. 143 145 gtk_text_buffer_set_modified( 144 146 GTK_TEXT_BUFFER(
