kdereview/palapeli/src

Ömer F. USTA omerusta at gmail.com
Sat Nov 21 04:09:26 GMT 2009


There is a forgetten ) in below :

+void Palapeli::MainWindow::configureFinished()
+{
+       m_puzzleTable->view()->setDragMode(Settings::leftMouseButtonMovesView()
?
                                                               '^^^'
                                               '^^^^'
                                                             open
                                         not close




On Sat, Nov 21, 2009 at 12:19 AM, Stefan Majewsky <majewsky at gmx.net> wrote:
> SVN commit 1052165 by majewsky:
>
> BUG: 215476
> CCMAIL: kde-core-devel at kde.org
>
> Introduce a configuration option that disables the left-mouse-button
> viewport dragging. I have been pinged multiple times now that some
> people find it annoying.
>
> I know that Palapeli is in kdereview (therefore I'm CCing k-c-d)
> currently, but feature freeze is very near, and I want this easy change
> in before it, esp. because it introduces new strings.
>
> I'm unsure about the default value of this configuration option, though.
> I think I'll make a poll for the default setting on my blog when the
> Beta 1 is out and Palapeli becomes available to more testers.
>
>
>
>  M  +3 -1      engine/view.cpp
>  M  +4 -0      palapeli.kcfg
>  M  +21 -0     settings.ui
>  M  +6 -1      window/mainwindow.cpp
>  M  +1 -0      window/mainwindow.h
>
>
> --- trunk/kdereview/palapeli/src/engine/view.cpp #1052164:1052165
> @@ -19,6 +19,7 @@
>  #include "view.h"
>  #include "constraintvisualizer.h"
>  #include "scene.h"
> +#include "settings.h"
>  #include "texturehelper.h"
>
>  #include <cmath>
> @@ -37,7 +38,8 @@
>        , m_txHelper(new Palapeli::TextureHelper(m_scene))
>        , m_zoomLevel(100)
>  {
> -       setDragMode(QGraphicsView::ScrollHandDrag);
> +       if (Settings::leftMouseButtonMovesView())
> +               setDragMode(QGraphicsView::ScrollHandDrag);
>        setResizeAnchor(QGraphicsView::AnchorUnderMouse);
>        setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
>        setScene(m_scene);
> --- trunk/kdereview/palapeli/src/palapeli.kcfg #1052164:1052165
> @@ -16,5 +16,9 @@
>                        <label>Whether to show the status bar on the puzzle table. (It is not a real status bar, but the position and provided functionality is similar.)</label>
>                        <default>true</default>
>                </entry>
> +               <entry name="LeftMouseButtonMovesView" type="Bool">
> +                       <label>Whether dragging with the left mouse button down will move the viewport.</label>
> +                       <default>false</default>
> +               </entry>
>        </group>
>  </kcfg>
> --- trunk/kdereview/palapeli/src/settings.ui #1052164:1052165
> @@ -66,6 +66,20 @@
>         </property>
>        </widget>
>       </item>
> +      <item row="2" column="0">
> +       <widget class="QCheckBox" name="kcfg_LeftMouseButtonMovesView">
> +        <property name="text">
> +         <string/>
> +        </property>
> +       </widget>
> +      </item>
> +      <item row="2" column="1">
> +       <widget class="QLabel" name="label_2">
> +        <property name="text">
> +         <string>Dragging with the left mouse button moves viewport</string>
> +        </property>
> +       </widget>
> +      </item>
>      </layout>
>     </widget>
>    </item>
> @@ -84,6 +98,13 @@
>    </item>
>   </layout>
>  </widget>
> + <customwidgets>
> +  <customwidget>
> +   <class>KComboBox</class>
> +   <extends>QComboBox</extends>
> +   <header>kcombobox.h</header>
> +  </customwidget>
> + </customwidgets>
>  <resources/>
>  <connections/>
>  </ui>
> --- trunk/kdereview/palapeli/src/window/mainwindow.cpp #1052164:1052165
> @@ -185,9 +185,14 @@
>        //setup dialog
>        KConfigDialog settingsDialog(this, QString(), Settings::self());
>        settingsDialog.addPage(settingsWidget, i18n("General settings"))->setIcon(KIcon("configure"));
> -       //NOTE: no need to connect KConfigDialog::settingsChanged(const QString&) because settings are read on demand
> +       connect(&settingsDialog, SIGNAL(settingsChanged(const QString&)), this, SLOT(configureFinished()));
>        settingsDialog.setFaceType(KPageDialog::Plain);
>        settingsDialog.exec();
>  }
>
> +void Palapeli::MainWindow::configureFinished()
> +{
> +       m_puzzleTable->view()->setDragMode(Settings::leftMouseButtonMovesView() ? QGraphicsView::ScrollHandDrag : QGraphicsView::NoDrag);
> +}
> +
>  #include "mainwindow.moc"
> --- trunk/kdereview/palapeli/src/window/mainwindow.h #1052164:1052165
> @@ -39,6 +39,7 @@
>                        void loadPuzzle(const QModelIndex& index);
>                        void configureShortcuts();
>                        void configurePalapeli();
> +                       void configureFinished();
>                protected:
>                        virtual void changeEvent(QEvent* event);
>                        virtual void resizeEvent(QResizeEvent* event);
>



-- 
Ömer Fadıl USTA
http://www.bilisimlab.com/




More information about the kde-core-devel mailing list