Comments (8)
Really nice idea actually.
Looks like there is a dropped event in PyQt. So we could implement something like this: http://stackoverflow.com/questions/4151637/pyqt4-drag-and-drop-files-into-qlistwidget
Where we take the file path, check it exists and then open a new tab with the file on it.
from mu.
For bonus points: implement drag-and-drop for the file pane (i.e. from the OS file manager to the project folder or the device)
from mu.
Played a bit and it seems quite doable, just got to get my head around how the relationship between EditorPane
& Editor
. EditorPane is the obvious place for receiving drop events but Editor is responsible for loading files, unfortunately, EditorPane doesn't seem to have a reference to it's Editor
More to play with!
from mu.
OK... there's a way in Qt to register event handlers with events (signals) emitted by a widget. The EditorPane
will emit a signal along with the appropriate context when a file is dropped onto it. However, from the Editor
(which has a reference to the EditorPane
object), you'll be able to register a function in the Editor
to handle the event from the pane. In this way the UI logic (in the pane) is separated from the logic in the editor (handling the drop event).
Does this make sense?
from mu.
That makes sense
from mu.
One was a pain to write but I weirdly enjoyed writing the tests for this
from mu.
WRT Travis... pyflakes is complaining that an import is unused... I'll fix this up as part of the review.
@ZanderBrown heh... writing tests can be plenty of fun. ;-)
from mu.
Better late than never... many thanks to @ZanderBrown for the work! :-)
from mu.
Related Issues (20)
- mu editor
- தமிழ் Translation of Mu Tool and Website
- ImportError: Symbol not found: ____chkstk_darwin; Also unable to write venv.json HOT 2
- `pkg_resources` is deprecated and removed in Python 3.12
- The Mu mac version built in the local is not opened in other MacOSs. HOT 2
- The WIN32 version is made by a local build of my personal WIN 10 platform is not opened. HOT 4
- MacOS keyboard layout US-Intl erases all quotes (single, double) in ESP REPL
- Trying to Turkish Translation
- sfu
- If the executed a part of App is out of a Desktop of Windows OS, the part will be painted to black color. And the black part will be leave permanently without recovery.
- Line numbers are unreadably small when you zoom out
- Python tkinter applications fail with "append_pending_request: Assertion `!xcb_xlib_unknown_seq_number' failed." HOT 2
- Running tests with Python 3.8 fails HOT 1
- Crash when opening for the first time HOT 1
- Enhancement: Using `uv` to manage venv and pip install
- mu-editor/mu
- MU incredibly slow with print HOT 2
- pip.exe\pythonw.exe being blocked by Microsoft Endpoint Antivirus
- Does not detect my working circuitpython board which uses serial only
- cannot report bugs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mu.