##// END OF EJS Templates
Added bool loadfile(abstractBinFile* file)...
Added bool loadfile(abstractBinFile* file) and bool dumpMemory(unsigned int address, unsigned int count, QString file, const QString &format); to the genericPySysDriver, now all plugins can load an abstract binary file(bin/srec/elf) and they can dump any memory space to either an srec or a binary file. This function are able to deal with file and host endianness. Functions: -bool dumpMemory(unsigned int address,unsigned int count,QString file); -bool memSet(unsigned int address,int value, unsigned int count); -bool loadbin(unsigned int address,QString file); are moved to socexplorerplugin which makes them available from C++.

File last commit:

r0:1aa783210b8e default
r71:c4b98d42ee59 default
Show More
pythonqtscriptingconsoledandd.cpp
61 lines | 1.5 KiB | text/x-c | CppLexer
/ src / PyWdgt / pythonqtscriptingconsoledandd.cpp
#include "pythonqtscriptingconsoledandd.h"
#include <QFileInfo>
PythonQtScriptingConsoleDandD::PythonQtScriptingConsoleDandD(QWidget *parent, const PythonQtObjectPtr &context, Qt::WindowFlags i)
:NicePyConsole(parent,context)
{
Q_UNUSED(i)
this->setAcceptDrops(true);
this->clear();
this->insertPrompt(true);
}
/*taken from http://developer.qt.nokia.com/wiki/Drag_and_Drop_of_files*/
void PythonQtScriptingConsoleDandD::dropEvent(QDropEvent * event)
{
const QMimeData* mimeData = event->mimeData();
// check for our needed mime type, here a file or a list of files
if (mimeData->hasUrls())
{
QList<QUrl> urlList = mimeData->urls();
QFileInfo fileinfo;
// extract the local paths of the files
for (int i = 0; i < urlList.size() && i < 32; ++i)
{
fileinfo.setFile(urlList.at(i).toLocalFile());
if(!fileinfo.suffix().compare("py"))
{
QString CMD="execfile(\'"+urlList.at(i).toLocalFile()+"\')";
this->executeCurrentCommand(CMD);
}
}
// call a function to open the files
}
}
void PythonQtScriptingConsoleDandD::dragMoveEvent(QDragMoveEvent *e)
{
e->accept();
}
void PythonQtScriptingConsoleDandD::dragEnterEvent(QDragEnterEvent *e)
{
const QMimeData* mimeData = e->mimeData();
// check for our needed mime type, here a file or a list of files
if (mimeData->hasUrls())
{
e->acceptProposedAction();
}
}