Changeset 326c7d29bd07f56e8a97a4ba00be40c7035f0dcf
- Timestamp:
- 11/08/09 00:45:56 (4 years ago)
- Author:
- Armin Burgmeier <armin@…>
- git-author:
- Gabríel A. Pétursson <gabrielp@simnet.is> / 2009-11-08T00:45:56Z+0100
- Parents:
- 1c0f9eaecee4addf07208e81f777f28e409cbfe7
- Children:
- 91395eca1c2b5080c28f69b5efc2381d5977e555
- git-committer:
- Armin Burgmeier <armin@arbur.net> / 2009-11-08T00:45:56Z+0100
- Message:
-
Added the ability to upload multiple files simultaneously
2009-11-07 Gabríel A. Pétursson <gabrielp@…>
- code/commands/browser-context-commands.cpp:
- code/commands/file-tasks/task-open-file.hpp:
- code/commands/file-tasks/task-open-file.cpp: Added the ability to
upload multiple files simultaneously.
Signed-off-by: Armin Burgmeier <armin@…>
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r1c0f9ea
|
r326c7d2
|
|
| | 1 | 2009-11-07 GabrÃel A. Pétursson <gabrielp@simnet.is> |
| | 2 | |
| | 3 | * code/commands/browser-context-commands.cpp: |
| | 4 | * code/commands/file-tasks/task-open-file.hpp: |
| | 5 | * code/commands/file-tasks/task-open-file.cpp: Added the ability to |
| | 6 | upload multiple files simultaneously. |
| | 7 | |
| 1 | 8 | 2009-11-07 Armin Burgmeier <armin@arbur.net> |
| 2 | 9 | |
-
|
r4c5ace3
|
r326c7d2
|
|
| 215 | 215 | browser, iter)); |
| 216 | 216 | |
| | 217 | m_file_dialog->set_select_multiple(true); |
| 217 | 218 | m_file_dialog->present(); |
| 218 | 219 | } |
| … |
… |
|
| 266 | 267 | if(response_id == Gtk::RESPONSE_ACCEPT) |
| 267 | 268 | { |
| 268 | | Glib::RefPtr<Gio::File> file = |
| 269 | | Gio::File::create_for_uri(m_file_dialog->get_uri()); |
| 270 | | |
| 271 | | // TODO: Do this asynchronously: |
| 272 | | Glib::RefPtr<Gio::FileInfo> info = file->query_info( |
| 273 | | G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME); |
| 274 | | m_operations.create_document( |
| 275 | | browser, &iter, info->get_display_name(), |
| 276 | | m_preferences, m_file_dialog->get_uri(), NULL); |
| | 269 | Glib::SListHandle<Glib::ustring> uris = m_file_dialog->get_uris(); |
| | 270 | |
| | 271 | for(Glib::SListHandle<Glib::ustring>::iterator i = uris.begin(); i != uris.end(); ++i) |
| | 272 | { |
| | 273 | Glib::RefPtr<Gio::File> file = |
| | 274 | Gio::File::create_for_uri(*i); |
| | 275 | |
| | 276 | // TODO: Do this asynchronously: |
| | 277 | Glib::RefPtr<Gio::FileInfo> info = file->query_info( |
| | 278 | G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME); |
| | 279 | m_operations.create_document( |
| | 280 | browser, &iter, info->get_display_name(), |
| | 281 | m_preferences, *i, NULL); |
| | 282 | } |
| 277 | 283 | } |
| 278 | 284 | |
-
|
r3da60b7
|
r326c7d2
|
|
| 25 | 25 | Gtk::FILE_CHOOSER_ACTION_OPEN) |
| 26 | 26 | { |
| | 27 | m_file_dialog.set_select_multiple(true); |
| 27 | 28 | } |
| 28 | 29 | |
| … |
… |
|
| 40 | 41 | { |
| 41 | 42 | m_file_dialog.hide(); |
| 42 | | // TODO: Handle multiple selection |
| 43 | | Glib::ustring uri = m_file_dialog.get_uri(); |
| 44 | | Glib::RefPtr<Gio::File> file = |
| 45 | | Gio::File::create_for_uri(uri); |
| 46 | | |
| 47 | | m_open_task.reset(new TaskOpen(m_file_commands, file)); |
| 48 | | m_open_task->signal_finished().connect( |
| 49 | | sigc::mem_fun(*this, &TaskOpenFile::finish)); |
| 50 | | m_open_task->run(); |
| | 43 | Glib::SListHandle<Glib::ustring> uris = m_file_dialog.get_uris(); |
| | 44 | |
| | 45 | g_assert(uris.size() >= 1); |
| | 46 | |
| | 47 | if (uris.size() == 1) |
| | 48 | { |
| | 49 | Glib::RefPtr<Gio::File> file = Gio::File::create_for_uri(*uris.begin()); |
| | 50 | m_open_task.reset(new TaskOpen(m_file_commands, file)); |
| | 51 | m_open_task->signal_finished().connect( |
| | 52 | sigc::mem_fun(*this, &TaskOpenFile::finish)); |
| | 53 | m_open_task->run(); |
| | 54 | } |
| | 55 | else |
| | 56 | { |
| | 57 | TaskOpenMultiple *task = new TaskOpenMultiple(m_file_commands); |
| | 58 | |
| | 59 | for(Glib::SListHandle<Glib::ustring>::iterator i = uris.begin(); i != uris.end(); ++i) |
| | 60 | task->add_file(*i); |
| | 61 | |
| | 62 | m_open_taskm.reset(task); |
| | 63 | m_open_taskm->signal_finished().connect( |
| | 64 | sigc::mem_fun(*this, &TaskOpenFile::finish)); |
| | 65 | m_open_taskm->run(); |
| | 66 | } |
| 51 | 67 | } |
| 52 | 68 | else |
-
|
r3da60b7
|
r326c7d2
|
|
| 22 | 22 | #include "commands/file-commands.hpp" |
| 23 | 23 | #include "commands/file-tasks/task-open.hpp" |
| | 24 | #include "commands/file-tasks/task-open-multiple.hpp" |
| 24 | 25 | |
| 25 | 26 | namespace Gobby |
| … |
… |
|
| 38 | 39 | FileChooser::Dialog m_file_dialog; |
| 39 | 40 | std::auto_ptr<TaskOpen> m_open_task; |
| | 41 | std::auto_ptr<TaskOpenMultiple> m_open_taskm; |
| 40 | 42 | }; |
| 41 | 43 | |