Changeset 534b092abe789eaa49f7f356b43bd77538c62ef9
- Timestamp:
- 10/10/08 23:59:47 (5 years ago)
- Author:
- Armin Burgmeier <armin@…>
- Parents:
- cdda99c0276d6c08523acc389ac0c13818ce9e9a
- Children:
- 6cb2a945e0d4db91d47be1384bba73331dc6f8c2
- git-committer:
- Armin Burgmeier <armin@arbur.net> / 2008-10-10T23:59:47Z+0200
- Message:
-
Use the display name as document title for files opened via the filechooser
2008-10-10 Armin Burgmeier <armin@…>
- code/core/filechooser.cpp: Allow selecting non-local files in
Gobby's filechooser.
- code/commands/file-commands.cpp:
- code/commands/browser-context-commands.cpp: Query the display name
when opening a file, to use as document title.
FileChooser::get_filename() does not work for non-local files.
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
rcdda99c
|
r534b092
|
|
| | 1 | 2008-10-10 Armin Burgmeier <armin@arbur.net> |
| | 2 | |
| | 3 | * code/core/filechooser.cpp: Allow selecting non-local files in |
| | 4 | Gobby's filechooser. |
| | 5 | |
| | 6 | * code/commands/file-commands.cpp: |
| | 7 | * code/commands/browser-context-commands.cpp: Query the display name |
| | 8 | when opening a file, to use as document title. |
| | 9 | FileChooser::get_filename() does not work for non-local files. |
| | 10 | |
| 1 | 11 | 2008-10-09 Armin Burgmeier <armin@arbur.net> |
| 2 | 12 | |
-
|
r933a996
|
r534b092
|
|
| 9 | 9 | - Add base preferences class with Preferences::Option definition to util/, |
| 10 | 10 | inherit in core/, move ClosableFrame to util/ |
| | 11 | - Show in tab and userlist when others are typing, using an icon |
| | 12 | - Typing sounds (libcanberra?) |
| 11 | 13 | |
| 12 | 14 | These things need to be implemented in infinote, but again would be nice |
-
|
rbd34be3
|
r534b092
|
|
| 22 | 22 | #include <gtkmm/icontheme.h> |
| 23 | 23 | #include <gtkmm/stock.h> |
| | 24 | #include <giomm/file.h> |
| 24 | 25 | |
| 25 | 26 | Gobby::BrowserContextCommands::BrowserContextCommands(Gtk::Window& parent, |
| … |
… |
|
| 269 | 270 | if(response_id == Gtk::RESPONSE_ACCEPT) |
| 270 | 271 | { |
| | 272 | Glib::RefPtr<Gio::File> file = |
| | 273 | Gio::File::create_for_uri(m_file_dialog->get_uri()); |
| | 274 | |
| | 275 | // TODO: Do this asynchronously: |
| | 276 | Glib::RefPtr<Gio::FileInfo> info = file->query_info( |
| | 277 | G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME); |
| 271 | 278 | m_operations.create_document( |
| 272 | | browser, &iter, Glib::path_get_basename( |
| 273 | | m_file_dialog->get_filename()), |
| | 279 | browser, &iter, info->get_display_name(), |
| 274 | 280 | m_preferences, m_file_dialog->get_uri(), NULL); |
| 275 | 281 | } |
-
|
rbd34be3
|
r534b092
|
|
| 21 | 21 | |
| 22 | 22 | #include <gtkmm/stock.h> |
| | 23 | #include <giomm/file.h> |
| 23 | 24 | |
| 24 | 25 | namespace |
| … |
… |
|
| 94 | 95 | void on_file_response(int response_id) |
| 95 | 96 | { |
| | 97 | const gchar* const ATTR_DISPLAY_NAME = |
| | 98 | G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME; |
| | 99 | |
| 96 | 100 | if(response_id == Gtk::RESPONSE_ACCEPT) |
| 97 | 101 | { |
| … |
… |
|
| 107 | 111 | // TODO: Handle multiple selection |
| 108 | 112 | m_open_uri = m_file_dialog.get_uri(); |
| | 113 | // TODO: Query the display name |
| | 114 | // asynchronously, and use a default as long |
| | 115 | // as the query is running. |
| | 116 | Glib::RefPtr<Gio::File> file = |
| | 117 | Gio::File::create_for_uri(m_open_uri); |
| | 118 | Glib::RefPtr<Gio::FileInfo> info = |
| | 119 | file->query_info(ATTR_DISPLAY_NAME); |
| | 120 | |
| 109 | 121 | dialog.set_document_name( |
| 110 | | Glib::path_get_basename( |
| 111 | | m_file_dialog. |
| 112 | | get_filename())); |
| | 122 | info->get_display_name()); |
| 113 | 123 | |
| 114 | 124 | m_file_dialog.hide(); |
-
|
rbd34be3
|
r534b092
|
|
| 45 | 45 | } |
| 46 | 46 | |
| | 47 | set_local_only(false); |
| 47 | 48 | set_current_folder_uri(m_chooser.get_current_folder_uri()); |
| 48 | 49 | } |