#include "support/filetools.h"
#include "support/convert.h"
#include "support/lstrings.h"
+#include "support/os.h"
+#include "Buffer.h"
#include "BufferView.h"
#include "BufferList.h"
+#include "callback.h"
#include "debug.h"
#include "FuncRequest.h"
-#include "callback.h"
-#include "LyXRC.h"
#include "LyX.h"
-#include "Session.h"
#include "LyXFunc.h"
+#include "LyXRC.h"
#include "MenuBackend.h"
-#include "Buffer.h"
-#include "BufferList.h"
+#include "Session.h"
#include <QAction>
#include <QApplication>
#include <QCloseEvent>
+#include <QDesktopWidget>
+#include <QDragEnterEvent>
+#include <QDropEvent>
+#include <QHBoxLayout>
+#include <QList>
+#include <QMimeData>
#include <QPixmap>
+#include <QPushButton>
#include <QStatusBar>
#include <QToolBar>
#include <QTabBar>
-#include <QDesktopWidget>
+#include <QUrl>
#include <QVBoxLayout>
-#include <QHBoxLayout>
-#include <QPushButton>
#include <boost/bind.hpp>
if (!iconname.empty())
setWindowIcon(QPixmap(toqstr(iconname.absFilename())));
#endif
+
+ // For Drag&Drop.
+ setAcceptDrops(true);
}
}
+void GuiView::dragEnterEvent(QDragEnterEvent * event)
+{
+ if (event->mimeData()->hasUrls())
+ event->accept();
+ /// \todo Ask lyx-devel is this is enough:
+ /// if (event->mimeData()->hasFormat("text/plain"))
+ /// event->acceptProposedAction();
+}
+
+
+void GuiView::dropEvent(QDropEvent* event)
+{
+ QList<QUrl> files = event->mimeData()->urls();
+ if (files.isEmpty())
+ return;
+
+ LYXERR(Debug::GUI) << BOOST_CURRENT_FUNCTION
+ << " got URLs!" << endl;
+ for (int i = 0; i!=files.size(); ++i) {
+ string const file = support::os::internal_path(fromqstr(
+ files.at(i).toLocalFile()));
+ if (!file.empty())
+ dispatch(FuncRequest(LFUN_FILE_OPEN, file));
+ }
+}
+
+
void GuiView::saveGeometry()
{
static bool done = false;
virtual void moveEvent(QMoveEvent * e);
private:
+ ///
+ void dragEnterEvent(QDragEnterEvent * ev);
+ ///
+ void dropEvent(QDropEvent * ev);
+
/// focus the command buffer widget
void focus_command_widget();
#include "QKeySymbol.h"
#include "qt_helpers.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "BufferView.h"
-#include "rowpainter.h"
+#include "Color.h"
#include "debug.h"
#include "FuncRequest.h"
-#include "Color.h"
-#include "version.h"
#include "LyXRC.h"
+#include "rowpainter.h"
+#include "version.h"
#include "support/filetools.h" // LibFileSearch
-#include "support/os.h"
#include "support/convert.h"
#include "graphics/GraphicsImage.h"
#include "graphics/GraphicsLoader.h"
+#include <QInputContext>
#include <QLayout>
#include <QMainWindow>
-#include <QMimeData>
-#include <QUrl>
-#include <QDragEnterEvent>
#include <QPainter>
#include <QScrollBar>
#include <QTimer>
-#include <QInputContext>
#include <boost/bind.hpp>
#include <boost/current_function.hpp>
using std::endl;
using std::string;
-namespace os = lyx::support::os;
-
-
namespace lyx {
using support::FileName;
}
-void GuiWorkArea::dragEnterEvent(QDragEnterEvent * event)
-{
- if (event->mimeData()->hasUrls())
- event->accept();
- /// \todo Ask lyx-devel is this is enough:
- /// if (event->mimeData()->hasFormat("text/plain"))
- /// event->acceptProposedAction();
-}
-
-
-void GuiWorkArea::dropEvent(QDropEvent* event)
-{
- QList<QUrl> files = event->mimeData()->urls();
- if (files.isEmpty())
- return;
-
- LYXERR(Debug::GUI) << "GuiWorkArea::dropEvent: got URIs!" << endl;
- for (int i = 0; i!=files.size(); ++i) {
- string const file = os::internal_path(fromqstr(files.at(i).toLocalFile()));
- if (!file.empty())
- dispatch(FuncRequest(LFUN_FILE_OPEN, file));
- }
-}
-
-
void GuiWorkArea::focusInEvent(QFocusEvent * /*event*/)
{
// No need to do anything if we didn't change views...
private:
void doGreyOut(QLPainter & pain);
///
- void dragEnterEvent(QDragEnterEvent * ev);
- ///
- void dropEvent(QDropEvent * ev);
- ///
void focusInEvent(QFocusEvent *);
///
void focusOutEvent(QFocusEvent *);