[amarok] * Sun Jan 29 2012 Kevin Kofler <Kevin at tigcc.ticalc.org> 2.5.0-6 - help: invoke a browser on the onli

Kevin Kofler kkofler at fedoraproject.org
Sun Jan 29 06:11:28 UTC 2012


commit 0b5f49452b4b47e7ea0b3f48e07f2edf9583e5e0
Author: Kevin Kofler <Kevin at tigcc.ticalc.org>
Date:   Sun Jan 29 07:11:16 2012 +0100

    * Sun Jan 29 2012 Kevin Kofler <Kevin at tigcc.ticalc.org> 2.5.0-6
    - help: invoke a browser on the online UserBase doc if amarok-doc not installed

 amarok-2.5.0-onlinedoc.patch |   60 ++++++++++++++++++++++++++++++++++++++++++
 amarok.spec                  |   10 ++++++-
 2 files changed, 69 insertions(+), 1 deletions(-)
---
diff --git a/amarok-2.5.0-onlinedoc.patch b/amarok-2.5.0-onlinedoc.patch
new file mode 100644
index 0000000..d42db67
--- /dev/null
+++ b/amarok-2.5.0-onlinedoc.patch
@@ -0,0 +1,60 @@
+diff -ur amarok-2.5.0/src/ActionClasses.cpp amarok-2.5.0-onlinedoc/src/ActionClasses.cpp
+--- amarok-2.5.0/src/ActionClasses.cpp	2011-12-15 08:36:48.000000000 +0100
++++ amarok-2.5.0-onlinedoc/src/ActionClasses.cpp	2012-01-28 08:01:44.000000000 +0100
+@@ -31,10 +31,12 @@
+ #include "playlist/PlaylistActions.h"
+ #include "playlist/PlaylistModelStack.h"
+ 
++#include <QFile>
+ #include <KAuthorized>
+ #include <KHelpMenu>
+ #include <KLocale>
+ #include <KToolBar>
++#include <KToolInvocation>
+ #include <Osd.h>
+ #include <EqualizerDialog.h>
+ 
+@@ -152,6 +154,17 @@
+ 
+     KMenu* menu = s_helpMenu->menu();
+ 
++    // If amarok-doc is not installed, bring up the online version instead.
++    if ( !QFile::exists( "/usr/share/doc/HTML/en/amarok/index.docbook" ) ) {
++        QAction *contentsAction = s_helpMenu->action( KHelpMenu::menuHelpContents );
++        // disconnect the default slot which fires up KHelpCenter
++        disconnect( contentsAction, SIGNAL(triggered(bool)), s_helpMenu, SLOT(appHelpActivated()) );
++        // ensure no duplicate connection
++        disconnect( contentsAction, SIGNAL(triggered(bool)), this, SLOT(onlineHelpActivated()) );
++        // connect our custom slot which fires up a browser on UserBase instead
++        connect( contentsAction, SIGNAL(triggered(bool)), this, SLOT(onlineHelpActivated()) );
++    }
++
+     // NOTE: We hide "Report Bug..." because we need to add it on our own to name the dialog
+     // so it can be blacklisted from LikeBack.
+     s_helpMenu->action( KHelpMenu::menuReportBug )->setVisible( false );
+@@ -164,6 +177,12 @@
+     return menu;
+ }
+ 
++void
++Menu::onlineHelpActivated()
++{
++    KToolInvocation::invokeBrowser( "http://userbase.kde.org/Amarok/Manual" );
++}
++
+ //////////////////////////////////////////////////////////////////////////////////////////
+ // PlayPauseAction
+ //////////////////////////////////////////////////////////////////////////////////////////
+diff -ur amarok-2.5.0/src/ActionClasses.h amarok-2.5.0-onlinedoc/src/ActionClasses.h
+--- amarok-2.5.0/src/ActionClasses.h	2011-12-15 08:36:48.000000000 +0100
++++ amarok-2.5.0-onlinedoc/src/ActionClasses.h	2012-01-28 07:55:40.000000000 +0100
+@@ -42,6 +42,9 @@
+             static Menu *instance();
+             static KMenu *helpMenu( QWidget *parent = 0 );
+ 
++        private slots:
++            void onlineHelpActivated();
++
+         private:
+             static Menu       *s_instance;
+             static KHelpMenu  *s_helpMenu;
diff --git a/amarok.spec b/amarok.spec
index 4fd83a9..01a9c48 100644
--- a/amarok.spec
+++ b/amarok.spec
@@ -2,7 +2,7 @@
 Name:    amarok
 Summary: Media player
 Version: 2.5.0
-Release: 5%{?dist}
+Release: 6%{?dist}
 
 # KDE e.V. may determine that future GPL versions are accepted
 License: GPLv2 or GPLv3
@@ -10,6 +10,10 @@ Url:     http://amarok.kde.org/
 Source0: http://download.kde.org/stable/amarok/%{version}/src/amarok-%{version}.tar.bz2
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
+# Invoke a browser on the online UserBase documentation instead of KHelpCenter
+# for the help contents if the amarok-doc subpackage is not installed.
+Patch0:  amarok-2.5.0-onlinedoc.patch
+
 #Patch50: amarok-2.2.1.90-qtscript_not_required.patch
 
 ## upstream patches
@@ -83,6 +87,7 @@ BuildArch: noarch
 %prep
 %setup -q 
 
+%patch0 -p1 -b .onlinedoc
 #patch50 -p1 -b .qtscript_not_required
 %patch100 -p1 -b .kde48_context_view
 
@@ -174,6 +179,9 @@ fi
 
 
 %changelog
+* Sun Jan 29 2012 Kevin Kofler <Kevin at tigcc.ticalc.org> 2.5.0-6
+- help: invoke a browser on the online UserBase doc if amarok-doc not installed
+
 * Fri Jan 27 2012 Rex Dieter <rdieter at fedoraproject.org> 2.5.0-5
 - make -doc only handbook, put translations back in main pkg
 


More information about the scm-commits mailing list