Here is the work by Claus reformed as a patch against SVN.  I've removed
all the whitespace changes that were apparently due to spaces changed to
tabs by a rogue editor.

I've also made sure the license text exactly matches the license at the
top of the source, and included the copyright and owner.

I've also added links to the project web site.

I've tested the Help - About action, and I'm happy with it.

-- 
James Cameron    mailto:qu...@us.netrek.org     http://quozl.netrek.org/
Index: src/dvbcut.cpp
===================================================================
--- src/dvbcut.cpp	(revision 156)
+++ src/dvbcut.cpp	(working copy)
@@ -2381,3 +2381,49 @@
   update_time_display();
 }
 
+void dvbcut::helpAboutAction_activated()
+{
+  QMessageBox::about(this, tr("dvbcut"), 
+		     tr("<html><head></head><body><span style=\"font-family: Helvetica,Arial,sans-serif;\">"
+"<p>%1</p>"
+"<p>"
+"    Copyright (c) 2005 Sven Over &lt;svenover at svenover dot de&gt;"
+"</p><p>"
+"    This program is free software; you can redistribute it and/or modify<br>"
+"    it under the terms of the GNU General Public License as published by<br>"
+"    the Free Software Foundation; either version 2 of the License, or<br>"
+"    (at your option) any later version.<br>"
+"</p><p>"
+"    This program is distributed in the hope that it will be useful,<br>"
+"    but WITHOUT ANY WARRANTY; without even the implied warranty of<br>"
+"    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>"
+"    GNU General Public License for more details."
+"</p><p>"
+"    You should have received a copy of the GNU General Public License<br>"
+"    along with this program; if not, write to the Free Software<br>"
+"    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA"
+"</p>"
+"<p>Project web site: <a href=\"http://dvbcut.sourceforge.net/?from=about\";>http://dvbcut.sourceforge.net/</p>"
+"<p>Send feedback to: <a href=\"mailto:dvbcut-u...@lists.sourceforge.net?subject=feedback\">dvbcut-u...@lists.sourceforge.net</p>"
+"<p>Send patches to: <a href=\"mailto:dvbcut-de...@lists.sourceforge.net\">dvbcut-devel@lists.sourceforge.net</p>"
+"</span></body></html>").arg(VERSION_STRING));
+}
+
+void dvbcut::helpContentAction_activated()
+{
+  QFileInfo fi(qApp->applicationFilePath());
+  QString helpFile = fi.dirPath() + "/help.dvbcut_en.html";
+  QFile file(helpFile);
+  if (QFile::exists(helpFile) && file.open(IO_ReadOnly)) {
+    QTextStream stream(&file);
+    QString html = stream.read();
+    file.close();
+    progresswindow dlg(this);  
+    connect(dlg.cancelbutton, SIGNAL(clicked()), &dlg, SLOT(reject()));
+    dlg.showHtml(html);
+    dlg.exec();
+  }
+  else 
+    QMessageBox::information(this, tr("dvbcut"),
+			     tr("Help file %1 not available").arg(helpFile));
+}
Index: src/progresswindow.h
===================================================================
--- src/progresswindow.h	(revision 156)
+++ src/progresswindow.h	(working copy)
@@ -47,6 +47,7 @@
   virtual void printinfo(const char *fmt, ...);
   virtual void printerror(const char *fmt, ...);
   virtual void printwarning(const char *fmt, ...);
+  virtual void showHtml(const QString &html);
 
 public slots:
   virtual void setprogress(int permille);
Index: src/dvbcutbase.ui
===================================================================
--- src/dvbcutbase.ui	(revision 156)
+++ src/dvbcutbase.ui	(working copy)
@@ -486,6 +486,10 @@
         <action name="playAudio1Action"/>
         <action name="playAudio2Action"/>
     </item>
+    <item text="&amp;Help" name="Help">
+        <action name="helpAboutAction"/>
+        <action name="helpContentAction"/>
+    </item>
 </menubar>
 <toolbars>
     <toolbar dock="2">
@@ -966,6 +970,40 @@
             <string>Ctrl+G</string>
         </property>
     </action>
+    <action>
+        <property name="name">
+            <cstring>helpAboutAction</cstring>
+        </property>
+        <property name="text">
+            <string>&amp;About</string>
+        </property>
+        <property name="menuText">
+            <string>&amp;About</string>
+        </property>
+        <property name="toolTip">
+            <string>About </string>
+        </property>
+        <property name="statusTip">
+            <string>About </string>
+        </property>
+    </action>
+    <action>
+        <property name="name">
+            <cstring>helpContentAction</cstring>
+        </property>
+        <property name="text">
+            <string>&amp;Contents</string>
+        </property>
+        <property name="menuText">
+            <string>&amp;Contents</string>
+        </property>
+        <property name="toolTip">
+            <string>Contents</string>
+        </property>
+        <property name="accel">
+            <string>F1</string>
+        </property>
+    </action>
 </actions>
 <images>
     <image name="image0">
@@ -1234,6 +1272,18 @@
         <receiver>dvbcutbase</receiver>
         <slot>chapterSnapshotsSave()</slot>
     </connection>
+    <connection>
+        <sender>helpAboutAction</sender>
+        <signal>activated()</signal>
+        <receiver>dvbcutbase</receiver>
+        <slot>helpAboutAction_activated()</slot>
+    </connection>
+    <connection>
+        <sender>helpContentAction</sender>
+        <signal>activated()</signal>
+        <receiver>dvbcutbase</receiver>
+        <slot>helpContentAction_activated()</slot>
+    </connection>
 </connections>
 <includes>
     <include location="local" impldecl="in implementation">gettext.h</include>
@@ -1281,6 +1331,8 @@
     <slot>viewQuarterSize()</slot>
     <slot>snapshotSave()</slot>
     <slot>chapterSnapshotsSave()</slot>
+    <slot>helpAboutAction_activated()</slot>
+    <slot>helpContentAction_activated()</slot>
 </slots>
 <layoutdefaults spacing="6" margin="11"/>
 </UI>
Index: src/help.dvbcut_en.html
===================================================================
--- src/help.dvbcut_en.html	(revision 0)
+++ src/help.dvbcut_en.html	(revision 0)
@@ -0,0 +1,36 @@
+<body>
+<h1>dvbcut</h1>
+<p>This is dvbcut.</p>
+<h1>Currently used Shortcuts</h1>
+<b><u>Shortcut</u></b>                     <b><u>Description</u></b><br>
+Alt + F                        Open file menu<br>
+Alt + E                        Open edit menu<br>
+Alt + V                        Open view menu<br>
+Alt + H                        Open help menu<br>
+O                                Open a new file<br>
+S                                Save the current project<br>
+G                                Save a snapshot<br>
+Ctrl + G                       Save chapter snapshots<br>
+E                                Export Video<br>
+Ctrl + Q                       Quit the program<br>
+A                                Set start marker<br>
+N                                Set stop marker<br>
+C                                Set chapter marker<br>
+B                                Set bookmark<br>
+Ctrl + C                       Auto chapters<br>
+M                               Suggest bookmarks<br>
+I                                 Import bookmarks<br>
+Ctrl + N                       Normal view<br>
+Ctrl + U                       Unscaled view<br>
+Ctrl + D                       Show difference to current picture<br>
+Ctrl + +                       Zoom in<br>
+Ctrl + -                        Zoom out<br>
+Ctrl + 1                       View full size<br>
+Ctrl + 2                       View half size<br>
+Ctrl + 4                       View quarter size<br>
+Ctrl + 3                       View custom size<br>
+P                                Play video<br>
+Q                                Stop playing video<br>
+Shift + &gt;                      Play last 2 seconds audio<br>
+&lt;                                 Play next 2 seconds audio<br>
+F1                               Show this file<br>
Index: src/dvbcut.h
===================================================================
--- src/dvbcut.h	(revision 156)
+++ src/dvbcut.h	(working copy)
@@ -130,6 +130,10 @@
   void snapshotSave(std::vector<int> piclist, int range=0, int samples=1);
   int chooseBestPicture(int startpic, int range, int smaples);
 
+protected slots:
+  virtual void helpAboutAction_activated();
+  virtual void helpContentAction_activated();
+
 public:
   ~dvbcut();
   dvbcut(QWidget *parent = 0, const char *name = 0, WFlags fl = WType_TopLevel|WDestructiveClose );
Index: src/progresswindow.cpp
===================================================================
--- src/progresswindow.cpp	(revision 156)
+++ src/progresswindow.cpp	(working copy)
@@ -158,3 +158,8 @@
   {
   return QString(text).replace('&',QString("&amp;")).replace('<',QString("&lt;")).replace('>',QString("&gt;"));
   }
+
+void progresswindow::showHtml(const QString &html)
+  {
+  logbrowser->append(html);
+  }
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 156)
+++ ChangeLog	(working copy)
@@ -1,3 +1,13 @@
+2009-01-30  Claus Buchberger  <claus.buchber...@gmx.de>
+
+	* dvbcut.cpp:
+	* progresswindow.h:
+	* dvbcutbase.ui:
+	* help.dvbcut_en.html:
+	* dvbcut.h:
+	* progresswindow.cpp:
+		Added a help menu.
+
 2009-01-28  Michael Riepe  <too-ti...@users.sourceforge.net>
 
 	* configure.in:
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
DVBCUT-devel mailing list
DVBCUT-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dvbcut-devel

Reply via email to