minor uniformity patch for smplayer

One of the things that good Linux applications should have is uniformity. Just like Mac OS X does. All applications should use the same keybindings to perform the same tasks. For example, on _every_ OS X application, in order to quit it you have to press “CMD+Q”, it’s that simple and everybody follows it. Everybody. On Linux though there are some applications that simply don’t care about uniformity. One of these applications is smplayer.

While it is almost standard for Linux applications to quit using Ctrl+Q, smplayer simply doesn’t have this option. It has the option of closing the current video with Ctrl+X but it doesn’t have the simple option of quitting using a keyboard shortcut.

So, the next (oneliner actually) patch does simply what I described above. It makes smplayer quit using “Ctrl+Q”.

The screenshot that shows what the patch does:

--- smplayer-0.6.8/src/baseguiplus.cpp 2009-08-13 16:07:04.000000000 +0300
+++ smplayer-0.6.8/src/baseguiplus.cpp 2009-08-13 16:08:22.000000000 +0300
@@ -67,8 +67,7 @@
tray->setToolTip( "SMPlayer" );
connect( tray, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
this, SLOT(trayIconActivated(QSystemTrayIcon::ActivationReason)));
- quitAct = new MyAction(this, "quit");
+ quitAct = new MyAction(QKeySequence("Ctrl+Q"), this, "quit");
connect( quitAct, SIGNAL(triggered()), this, SLOT(quit()) );

And a patched ebuild for smplayer-0.6.8 to use this minor patch (only one line is added to the ebuild):

P.S. Keybindings in smplayer can be set through Preferences, and someone could actually put Ctrl+Q as the quit shortcut but I think that this should be the default setting like most other applications have it. Uniformity matters.

5 Responses to “minor uniformity patch for smplayer”

  1. August 13th, 2009 | 18:57
    Using Mozilla Firefox Mozilla Firefox 3.5.2 on Gentoo Linux Gentoo Linux

    Yeah, nice.

    And how about “Ctrl+F” for opening a file? Seems to be “Ctrl+O” for the rest of the world.

  2. August 13th, 2009 | 19:28
    Using Mozilla Firefox Mozilla Firefox 3.0.11 on Gentoo Linux Gentoo Linux

    You are probably correct on that as well…but I can slightly push myself to accept ctrl+f for opening files on smplayer because there is no search option available. If there was a search option then ctrl+o for opening and ctrl+f for finding would be mandatory regarding uniformity.
    Anyway…if you still want to change opening files on smplayer with ctrl+o here’s another patch to do it:

    --- src/basegui.cpp 2009-07-15 02:08:26.000000000 +0300
    +++ src/basegui.cpp.new 2009-08-13 19:25:04.000000000 +0300
    @@ -285,7 +285,7 @@
    void BaseGui::createActions() {
    // Menu File
    - openFileAct = new MyAction( QKeySequence("Ctrl+F"), this, "open_file" );
    + openFileAct = new MyAction( QKeySequence("Ctrl+O"), this, "open_file" );
    connect( openFileAct, SIGNAL(triggered()),
    this, SLOT(openFile()) );

  3. August 13th, 2009 | 21:16
    Using Konqueror Konqueror 4.3 on Gentoo Linux Gentoo Linux

    Applied in smplayer 0.6.8 in Gentoo, without revbump. Thanks

  4. August 14th, 2009 | 04:05
    Using Mozilla Firefox Mozilla Firefox 3.5.1 on Linux Linux

    So you wrote the whole post about the fact that you wrote one patch which changed one line? Great…

  5. August 14th, 2009 | 09:42
    Using Mozilla Firefox Mozilla Firefox 3.5.2 on Linux Linux

    If you actually read the post you would notice the word “uniformity” which is used like 10 times. Anyway…

Leave a reply