summaryrefslogtreecommitdiff
path: root/src/nautilus-window-slot.h
Commit message (Collapse)AuthorAgeFilesLines
* view: allow view to have more control over the toolbar menuNeil Herald2016-06-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we have this menu structure: ------------------------------ 1. New Folder/New Tab/Bookmark ------------------------------ 2. Zoom controls ------------------------------ 3. Undo/Redo ------------------------------ 4. Sort options ------------------------------ 5. Other view related controls ------------------------------ The view creates 2-5, contained in a single GtkWidget - which is then passed to the toolbar via the enclosing window slot. The problem is that 3 shouldn't be created or managed by the view as the controls in that section of the menu are not related to the view. We'd like to move this responsibility back to the toolbar, but that would mean the view must pass multiple menu sections back to the toolbar (as 3 is in the middle of the other view controls). This change allows the view to pass multiple sections back to the toolbar, using the new NautilusToolbarMenuSections structure. The files view now passes 2 as a separate section to 3-5 (3 will be moved out of the view in a future commit). https://bugzilla.gnome.org/show_bug.cgi?id=764632
* window-slot: use inheritance for other locations viewCarlos Soriano2016-04-141-0/+8
| | | | | | | | | | | | | | | | | | | | | We need to special case the other locations view when using that location, since it's not a files-view and doesn't support several things that we usually support, like the changes between icon view and list view. Also we specifically special case its creation in window slot and we disable few actions that are not available on it. This patch creates a other locations slot, which will handle all of it. The class that is responsible of creating one type of slot or another is the window, and will use a vfunc that will request whether the slot handles a location or not and will act accordingly. In upcoming patches we will move all the special casing of this and the desktop in the window slot to its respective subclasses now that we have everything ready. https://bugzilla.gnome.org/show_bug.cgi?id=712620
* window-slot: allow overriding the creation of viewsCarlos Soriano2016-04-141-0/+7
| | | | | | | | | | We would want in subclasses of nautilus window slot to have a way to create custom views, like for instance, the desktop. To allow it, make a vfunc for the creation of views that subclasses can override. https://bugzilla.gnome.org/show_bug.cgi?id=712620
* window-slot: make it derivable classCarlos Soriano2016-04-141-28/+13
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=712620
* general: remove vim modelinesCarlos Soriano2016-04-041-2/+1
| | | | | | | | | | | | | Vim and emacs modelines are used to specify some of the code style in the code. However, this is misleading and poorly supported since nautilus had a mix of code style for some time. Also, the mode lines doesn't specify the whole code style, so we will need to use a different tool as well to specify the whole code style. For that, we can just use a different tool for everything. So remove the mode lines, and in a short future we will reestyle the nautilus code to have a single code style, and use a tool like editorconfig to specify the whole code style.
* general: allow to search from any part of the stackCarlos Soriano2016-03-031-0/+3
| | | | | | | | Expose the search function on the whole stack. We will need it for searches from the gnome-shell provider. https://bugzilla.gnome.org/show_bug.cgi?id=762076
* general: separate handling of windows/slots/viewsCarlos Soriano2015-08-281-28/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is another step towards the isolation of the management of the direcotories, views, slots and windows. The current situation had a few issues: - the comunication of changes in the model was done in a bidirectional way. So for example, sometimes the view updates directly the slot, sometimes directly the window, and sometimes the window was listening to changes on the model and updating the slot, view, or model itself. Problem with this is, encapsulation is wrong, the code paths are confusing, and the public API exposed is big. - public API is big, so even if sometimes if convenient to not do the same thing twice, having public API that is actually covered by the GLib or Gtk API doesn't worth it, if the complexity of the API grows too much. In Nautilus case, specifically on the slot, we were allowing all kind of convenient API, but it was behaving differently depending on small connotations. - management was not encapsulated. So the window was modifyng the model, or doing actions that belongs to the slot or the view. The same thing for the slot and the view, and similarly for the application and the window. For example, we were handling the flag for creating new windows on a specific window, instead of relying on the application management. Similar cases for the slot and the view. - there were multiple code paths for opening a location. This is one of the biggest changes on the patch. We were exposing API to open a location in every component, and we were using that API from other components above or below the hierarchy randomly. So for example the view was using the opening location API from the slot, the window, and the application; but with the same pourpose, opening a location in the active window. - API was not explicit. For example sometimes we wanted to open a location in the current active window, but somtimes it was implicit and sometimes not, and to be safe we were making it explicit on the caller. - we were using mutiple code paths with the same intention. This is related to the previous one, the intention in every caller was not clear. This patch tries to improve the situation, also thinking on the future rework of the views and separation of the desktop handling. The patch applies the following rules: - If the API is provided somehow by nautilus-file or Glib or Gtk, don't add new API. Custom API is fine if it is used inside the component itself, since the added complexity for tracking code paths is not that important. - Use one way communication, from the top level to the innermost component. In case that the component needs top level features, ask the most top level. A specific example, the view provides opening a new window with a selection. Although encapsulation is good, there is not a good way to avoid the dance from the model to the view to the slot to the window to the application. So instead of that, allow a quick shorcut only communicating to the top most level. In this way, the code path is always the same (therefore much easier to debug or to change code) and encapsulation is preserved. - don't break encapsulation. Only allow management of the component to the component itself or its parent. So for example, the slot is the one that manages errors on what happens in the slot itself. Exception to this is the application, that needs access to all the hierarchy for specific situations. For example for updating the dbus locations or to discern between a desktop window or a common window. - if two way communication is needed, listen changes through properties. We have been moving to properties lately, since it clearer and cleaner and allow a few features that are useful like listening to its changes withouth explicit API for it. This allows to bind properties in a clean way throuh the hierarchy and not breaking the encapsulation. In this patch most of the ground work is done, and some things are remaining like moving all the loading of the location to the view instead of the slot. Even if it is convenient to have some management on the slot to share between the views, some views don't use models at all, or they are not common files, like the other-locations, and this breaks the situation. At some point what we want for the files-view is having a common model API, that can be on top of nautilus-file or in nautilus-file itself. With this patch, a serie of improvements can be done now, and they will come in future patches.
* slot: remove unused public APICarlos Soriano2015-08-281-3/+0
|
* view: add interfaceGeorges Basile Stavracas Neto2015-08-201-6/+8
| | | | | | | | | | | | | | | | Nautilus is in the proccess of receiving a places view, based on GtkFileChooser's one. To be able to handle that, an abstraction layer is needed between NautilusFilesView and NautilusWindowSlot, so we factor out the common data between views. Add the NautilusView interface, and make NautilusFilesView a NautilusView implementation. Because of the new way we handle search on the view side, the search logic is rewritten to match the new expected behavior. https://bugzilla.gnome.org/show_bug.cgi?id=753871
* files-view: rename from NautilusViewGeorges Basile Stavracas Neto2015-08-171-4/+4
| | | | | | | | | | | | | NautilusView is the proposed name for the new interface that will cover NautilusFilesView and NautilusPlacesView. The current NautilusView name, however, will crash with the proposed interface name. Fix that by changing the class name to NautilusFilesView. As an easter egg, makes it match the current Nautilus code style.
* view: handle view menuGeorges Basile Stavracas Neto2015-08-161-0/+4
| | | | | | | | | | | | | | | | NautilusToolbar handles the view menu, requiring direct access to the underlying view inside the window slot. Since we're wiping out every access to the underlying view, we shouldn't access it from NautilusToolbar. To fix that, makes the view handle the view widget. Since we're making NautilusWindowSlot a wrapper, add the necessary properties for it to expose view data without exposing the view itself. https://bugzilla.gnome.org/show_bug.cgi?id=753673
* view: manage the floating barGeorges Basile Stavracas Neto2015-07-311-3/+0
| | | | | | | | | | | NautilusWindowSlot currently manages the floating bar, requiring access to the underlying model of NautilusView and making the code even more coupled and adding more complexity to the codebase. Fix that by delegating the management of the floating bar to NautilusView itself, and turn NautilusView a GtkOverlay subclass in order to facilitate the transition.
* window: set places sidebar to the previous location on errorGeorges Basile Stavracas Neto2015-05-071-0/+5
| | | | | | | | | | | | | | | | Nautilus opens the location notified by GtkPlacesSidebar without further interaction with it. With that, when a location fails to open, Nautilus goes back to the previous valid location but, because of we're not interacting with the sidebar after the failure, the sidebar was not updated to match these changes, i.e. kept the old invalid row selected. To fix it, set the previous valid location to the sidebar as well if there's some error loading a location. https://bugzilla.gnome.org/show_bug.cgi?id=734755
* general: rework menus of nautilusCarlos Soriano2015-01-241-0/+1
| | | | | | | | | Refresh the nautilus menus in the view (context menus) and the menus in the toolbar, changin as well in the path the UI of the toolbar to match mockups. In the way, port to GAction and GMenu every action and menu of nautilus and some clean ups thanks to this port.
* Updated FSF's addressDaniel Mustieles2014-01-311-3/+1
|
* slot: rework query editor visible state synchronizationCosimo Cecchi2012-10-291-2/+2
| | | | | | Fix a case where entering a directory from the search results would not take the query editor down, and refactor some code around the state synchronization between the two objects.
* window: remove nautilus-window-types.hCosimo Cecchi2012-10-261-4/+7
| | | | | Cleanup and rearrange typedefs to avoid the need for a separate types header.
* slot: finish moving all other private data to private structCosimo Cecchi2012-10-231-66/+35
| | | | | Now that we got rid of nautilus-window-manage-views, move all the private data in NautilusWindowSlot outside of the public struct.
* slot: restructure window slot loadingCosimo Cecchi2012-10-231-27/+2
| | | | | | | | Move all the code related to loading a new slot from nautilus-window-manage-views.c to nautilus-window-slot.c or nautilus-window.c; then restructure loading to avoid having the view call back into the window. Instead, use the begin-loading and end-loading signals on the view.
* slot: consolidate code for showing/hiding the loading floating barCosimo Cecchi2012-09-251-6/+0
| | | | | | | Move all the code relative to it in NautilusWindowSlot, and make the relative object members private. https://bugzilla.gnome.org/show_bug.cgi?id=684218
* Search requires that a reload be forced despite a load in effectWilliam Jon McCann2012-09-051-1/+4
| | | | Add api to preempt the current load and force a reload.
* window-slot: allow setting the window after constructionCosimo Cecchi2012-08-311-3/+8
| | | | | Turn the window construct-only property into a construct property, and add a setter method.
* slot: remove unused methodCosimo Cecchi2012-08-311-1/+0
| | | | | This method was used to make the window panes active on focus click, but it's not needed anymore.
* Don't try to close the window when a mount goes awayWilliam Jon McCann2012-08-311-3/+0
| | | | | | Go to home instead. https://bugzilla.gnome.org/show_bug.cgi?id=666985
* floating-bar: ellipsize the filename separately from the detailsCosimo Cecchi2012-08-311-3/+2
| | | | | | | | | | | | | This patch does three things: - It adds API to the floating bar to have primary and details labels instead of a single label. The primary label is ellipsized separately from the details, so it makes a good fit for a filename. - Modifies the code setting status messages in NautilusView to split them into two separate strings - Removes obsolete code in NautilusView and NautilusWindowSlot that was setting long statuses for the old non-floating statusbar https://bugzilla.gnome.org/show_bug.cgi?id=660695
* Don't try to change the window icon when the view changesWilliam Jon McCann2012-08-261-1/+0
| | | | | | | This avoids problems with using symbolic icons in the window titles and with icons not updating. https://bugzilla.gnome.org/show_bug.cgi?id=652212
* Select first item in search results by defaultWilliam Jon McCann2012-08-071-0/+1
|
* slot: reidrect an empty search to the query editor locationCosimo Cecchi2012-07-161-0/+1
| | | | | Instead of relying on search engines returning the exact result set for an empty query. This is also faster.
* Enable "just type" searchingWilliam Jon McCann2012-07-141-0/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=679900
* Combine the search bar and query editorWilliam Jon McCann2012-07-141-1/+2
| | | | | | | | Save vertical space by integrating the search bar with the query editor. This makes it less visually disruptive when a search becomes active. https://bugzilla.gnome.org/show_bug.cgi?id=679900
* Revert "window-slot: simplify code"William Jon McCann2012-07-111-0/+2
| | | | | | This reverts commit 79e915b6fad372878d79a52f814017600ccb3884. See https://bugzilla.gnome.org/show_bug.cgi?id=679640
* window-slot: simplify codeCosimo Cecchi2012-05-301-2/+0
| | | | | Use gtk_widget_get_visible() instead of an additional member for NautilusWindowSlot, since it's a widget now.
* window: misc cleanupsCosimo Cecchi2012-05-301-6/+2
|
* Remove extra panesWilliam Jon McCann2012-05-261-3/+3
| | | | | | | | | Extra Pane mode was somewhat useful before GNOME 3 had side by side window mode. The combination of panes and tabs is just too much. It is inconsistent with the file chooser and doesn't work well with touch. We would like to add a more explicit copy/move feature shortly. https://bugzilla.gnome.org/show_bug.cgi?id=676858
* all: remove nautilus_window_slot_go_to()Cosimo Cecchi2012-04-231-17/+6
| | | | | We don't want to have similar but slightly different code paths; consolidate use of NautilusWindowOpenFlags everywhere and simplify code.
* slot: make NautilusWindowSlot a GtkBoxCosimo Cecchi2012-01-091-4/+3
| | | | Simplifies management of the slot quite a bit.
* slot: remove unused cases for NautilusLocationChangeTypeCosimo Cecchi2012-01-091-3/+1
|
* slot: cleanup NautilusWindowSlot creationCosimo Cecchi2012-01-091-0/+2
|
* slot: don't include gi18n.h in the headerCosimo Cecchi2012-01-091-1/+0
|
* floating-bar: port to GtkOverlayCosimo Cecchi2011-06-131-1/+0
|
* window-slot: cleanup packing of extra widgetsCosimo Cecchi2011-03-151-1/+0
| | | | Don't pack them in a frame+eventbox, but just use the GtkBox.
* window-slot: let the "Loading" floating bar appear only after a timeoutCosimo Cecchi2011-03-151-0/+1
| | | | It will appear only if loading takes more than 500ms.
* all: move the floating bar to NautilusWindowSlotCosimo Cecchi2011-02-241-1/+7
|
* all: merge NautilusNavigationWindowSlot into NautilusWindowSlotCosimo Cecchi2011-02-171-2/+11
|
* all: remove NautilusWindowOpenMode enumerationCosimo Cecchi2011-02-171-5/+4
| | | | The mode is now always decided by the GSettings preference.
* window: just use nautilus_view_set_is_active()Cosimo Cecchi2011-02-171-2/+0
| | | | | Don't roundtrip through NautilusWindowSlot, as that's what it would do anyway.
* window-slot: move window_slot_close() to nautilus-window-slot.cCosimo Cecchi2011-02-171-1/+0
| | | | Why on earth should it be somewhere else?
* all: remove the concept of global history listCosimo Cecchi2011-02-171-2/+0
| | | | | It's not that useful now that nautilus is not a long running application anymore.
* window: remove unused and confusing codeCosimo Cecchi2011-01-111-1/+0
|
* view: use NautilusFile objects for the view selectionCosimo Cecchi2011-01-111-1/+1
| | | | | Use them in a consistent way, so to cleanup the previous GFile/NautilusFile confusion.