Georg Baum wrote:
Am Dienstag, 2. Januar 2007 18:10 schrieb Abdelrazak Younes:
I have an even simpler solution, see attached.
I like the attachment ;-)
Oups sorry, attached.
The first (and most difficult) step would be to outline how this is
supposed to work. When should the selection be filled? When should it
be
emptied?
With this patch, there is no distinction between theSelection and
theClipboard on windows.
But I would not like this. Are you sure that this does not have side
effects?
Yes.
What would people who do not know what a selection on unix is
think?
When they come across the feature I am sure they will like it.
The more I think about this stuff the more I am sure that the
current solution is OK for most users, and if some UNIX guys want
nonstandard behaviour they should need to configure that explicitly.
Well I am not not a Unix guy for some time now...
We should not try to emulate UNIX on windows, but follow the UI guidelines
of the OS, period.
Come on, the Windows UI guidelines are changed at each version of the
OS. They is no such uniformity in the Windows world.
Those who want UNIX should either use a real UNIX, or
cygwin, or they should adapt to windows if there is no alternative.
I disagree that Windows user should limit themselves because of their
bloody platform. The feature is easy and I am sure that users will like
it. We can even make it configurable and disable it by default if you
prefer.
Abdel.
Index: GuiApplication.C
===================================================================
--- GuiApplication.C (revision 16460)
+++ GuiApplication.C (working copy)
@@ -94,6 +94,9 @@
GuiApplication::GuiApplication(int & argc, char ** argv)
: QApplication(argc, argv), Application(argc, argv)
+#ifdef Q_WS_WIN
+ , selection_(clipboard_)
+#endif
{
// Qt bug? setQuitOnLastWindowClosed(true); does not work
setQuitOnLastWindowClosed(false);
Index: GuiApplication.h
===================================================================
--- GuiApplication.h (revision 16460)
+++ GuiApplication.h (working copy)
@@ -32,6 +32,28 @@
class GuiWorkArea;
+#ifdef Q_WS_WIN
+// Windows does not have a mouse Selection concept but we want
+// nevertheless to be able to paste with the middle-mouse
+// button:
+class WinSelection: public Selection
+{
+public:
+ WinSelection(GuiClipboard & clipboard): clipboard_(clipboard) {}
+ virtual ~WinSelection() {}
+
+ /** Selection overloaded methods
+ */
+ //@{
+ void haveSelection(bool own) {}
+ docstring const get() const { return clipboard_.get(); }
+ void put(docstring const & str) { clipboard_.put(str); }
+ //@}
+private:
+ GuiClipboard & clipboard_;
+};
+#endif
+
/// The Qt main application class
/**
There should be only one instance of this class. No Qt object
@@ -86,7 +108,11 @@
///
GuiClipboard clipboard_;
///
+#ifdef Q_WS_WIN
+ WinSelection selection_;
+#else
GuiSelection selection_;
+#endif
///
GuiFontLoader font_loader_;
///