changeset 498:21aa41b62c3a

Add back/forward/home to Help window, and some Help edits
author Chris Cannam
date Mon, 22 Aug 2011 18:46:06 +0100
parents a9032181c37d
children b3309be1640f
files easyhg.qrc help/a-04.html help/a-10.html help/a-11.html help/a-12.html help/a-13.html help/a-20.html help/a-21.html help/a-22.html help/a-23.html help/a-30.html help/a-31.html help/a-32.html help/generate.sh help/topics.html help/topics/12.txt help/topics/13.txt help/topics/30.txt help/topics/31.txt help/topics/32.txt images/back.png images/forward.png images/home.png src/mainwindow.cpp
diffstat 24 files changed, 159 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
--- a/easyhg.qrc	Mon Aug 22 15:19:00 2011 +0100
+++ b/easyhg.qrc	Mon Aug 22 18:46:06 2011 +0100
@@ -24,6 +24,9 @@
         <file>images/fileopen.png</file>
         <file>images/star.png</file>
         <file>images/easyhg-icon.png</file>
+        <file>images/home.png</file>
+        <file>images/back.png</file>
+        <file>images/forward.png</file>
 	<file>help/topics.html</file>
 	<file>help/help.css</file>
 	<file>help/a-04.html</file>
@@ -35,6 +38,8 @@
 	<file>help/a-22.html</file>
 	<file>help/a-23.html</file>
 	<file>help/a-30.html</file>
+	<file>help/a-31.html</file>
+	<file>help/a-32.html</file>
 	<file>help/images/openremote50.png</file>
 	<file>help/images/openfolder50.png</file>
 	<file>help/images/openlocal50.png</file>
--- a/help/a-04.html	Mon Aug 22 15:19:00 2011 +0100
+++ b/help/a-04.html	Mon Aug 22 18:46:06 2011 +0100
@@ -1,5 +1,4 @@
 <link rel="stylesheet" type="text/css" href="help.css"/>
-<p><a href="topics.html">Back to Topics</a></p><hr>
 
 
 <h2>What is a repository?</h2>
@@ -37,4 +36,3 @@
 each other's work, or which you can use to make your work public, or
 simply use as a private backup.</p>
 
-<hr><p><a href="topics.html">Back to Topics</a></p>
--- a/help/a-10.html	Mon Aug 22 15:19:00 2011 +0100
+++ b/help/a-10.html	Mon Aug 22 18:46:06 2011 +0100
@@ -1,5 +1,4 @@
 <link rel="stylesheet" type="text/css" href="help.css"/>
-<p><a href="topics.html">Back to Topics</a></p><hr>
 
 
 <h2>Someone gave me a repository URL and asked me to clone it</h2>
@@ -36,4 +35,3 @@
 <p>Provided the clone has been successful, you should now have a local
 repository to start working in.
 <ul><li>Note: the equivalent Mercurial command for this is <b>hg clone</b></li></ul>
-<hr><p><a href="topics.html">Back to Topics</a></p>
--- a/help/a-11.html	Mon Aug 22 15:19:00 2011 +0100
+++ b/help/a-11.html	Mon Aug 22 18:46:06 2011 +0100
@@ -1,5 +1,4 @@
 <link rel="stylesheet" type="text/css" href="help.css"/>
-<p><a href="topics.html">Back to Topics</a></p><hr>
 
 
 <h2>I have a folder of source code or documents on my computer and I want to use version control to manage it</h2>
@@ -26,4 +25,3 @@
 them.  The default is for all files in the folder to be treated as
 &ldquo;untracked&rdquo;, i.e. not included in the history.)
 <ul><li>Note: the equivalent Mercurial command for this is <b>hg init</b></li></ul>
-<hr><p><a href="topics.html">Back to Topics</a></p>
--- a/help/a-12.html	Mon Aug 22 15:19:00 2011 +0100
+++ b/help/a-12.html	Mon Aug 22 18:46:06 2011 +0100
@@ -1,19 +1,22 @@
 <link rel="stylesheet" type="text/css" href="help.css"/>
-<p><a href="topics.html">Back to Topics</a></p><hr>
 
 
-<h2>I have a Mercurial repository on my local computer and I want to use it with EasyMercurial</h2>
+<h2>I want to start a completely new project using version control</h2>
 
-<p>Just open it:</p>
+<p>To start using version control for an initially empty project, just
+initialise a repository in an empty folder:</p>
 
 <p><b>1. Click the Open toolbar button or use File -> Open</b></p>
 
-<p><center><img src="images/openlocal50.png"></center></p>
+<p><center><img src="images/openfolder50.png"></center></p>
 
-<p><b>2. Select &ldquo;Local repository&rdquo; as the thing you want to open</b></p>
+<p><b>2. Select &ldquo;File folder&rdquo; as the thing you want to open</b></p>
 
-<p><b>3. Browse to the working folder for your local repository</b></p>
+<p><b>3. Make a new folder in the file dialog and browse to it</b></p>
 
 <p><b>4. Click OK</b></p>
 
-<hr><p><a href="topics.html">Back to Topics</a></p>
+<p>A new repository will be created, stowed into the empty working folder
+you selected.  At first, it will have an empty history.  You can then
+start to add and commit changes to your files.
+<ul><li>Note: the equivalent Mercurial command for this is <b>hg init</b></li></ul>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/help/a-13.html	Mon Aug 22 18:46:06 2011 +0100
@@ -0,0 +1,17 @@
+<link rel="stylesheet" type="text/css" href="help.css"/>
+
+
+<h2>I have a Mercurial repository on my local computer already and I want to use it with EasyMercurial</h2>
+
+<p>Just open it:</p>
+
+<p><b>1. Click the Open toolbar button or use File -> Open</b></p>
+
+<p><center><img src="images/openlocal50.png"></center></p>
+
+<p><b>2. Select &ldquo;Local repository&rdquo; as the thing you want to open</b></p>
+
+<p><b>3. Browse to the working folder for your local repository</b></p>
+
+<p><b>4. Click OK</b></p>
+
--- a/help/a-20.html	Mon Aug 22 15:19:00 2011 +0100
+++ b/help/a-20.html	Mon Aug 22 18:46:06 2011 +0100
@@ -1,5 +1,4 @@
 <link rel="stylesheet" type="text/css" href="help.css"/>
-<p><a href="topics.html">Back to Topics</a></p><hr>
 
 
 <h2>I've added a new file: what do I do with it?</h2>
@@ -29,4 +28,3 @@
 that such files don't show up in the Untracked list by right-clicking
 on them and choosing <b>&ldquo;Ignore..."</b>.</p>
 
-<hr><p><a href="topics.html">Back to Topics</a></p>
--- a/help/a-21.html	Mon Aug 22 15:19:00 2011 +0100
+++ b/help/a-21.html	Mon Aug 22 18:46:06 2011 +0100
@@ -1,5 +1,4 @@
 <link rel="stylesheet" type="text/css" href="help.css"/>
-<p><a href="topics.html">Back to Topics</a></p><hr>
 
 
 <h2>I have changed some files and I want to record the changes</h2>
@@ -21,4 +20,3 @@
 and choose Commit from the context menu.
 <ul><li>Note: the equivalent Mercurial command for this is <b>hg commit</b></li></ul></p>
 
-<hr><p><a href="topics.html">Back to Topics</a></p>
--- a/help/a-22.html	Mon Aug 22 15:19:00 2011 +0100
+++ b/help/a-22.html	Mon Aug 22 18:46:06 2011 +0100
@@ -1,5 +1,4 @@
 <link rel="stylesheet" type="text/css" href="help.css"/>
-<p><a href="topics.html">Back to Topics</a></p><hr>
 
 
 <h2>I want to remove, rename, or copy a file</h2>
@@ -32,4 +31,3 @@
 
 
 
-<hr><p><a href="topics.html">Back to Topics</a></p>
--- a/help/a-23.html	Mon Aug 22 15:19:00 2011 +0100
+++ b/help/a-23.html	Mon Aug 22 18:46:06 2011 +0100
@@ -1,14 +1,11 @@
 <link rel="stylesheet" type="text/css" href="help.css"/>
-<p><a href="topics.html">Back to Topics</a></p><hr>
 
 
 <h2>I just deleted a file using the system file manager &ndash; then remembered I hadn't told the version control tool about it &ndash; what now?</h2>
 
-<p>No problem.</p>
-
-<p>Any files that the version control system knows about but that can't
-be found in your working copy are shown as <b>&ldquo;Missing&rdquo;</b> under &ldquo;My
-work&rdquo;.  All you need to do is:</p>
+<p>Any files that the version control system thinks should be there, but
+that can't be found in your working copy are shown as <b>&ldquo;Missing&rdquo;</b>
+under &ldquo;My work&rdquo;.  All you need to do is:</p>
 
 <p><b>1. Find your file in the &ldquo;Missing&rdquo; list and select it</b></p>
 
@@ -20,9 +17,3 @@
 
 
 
-
-
-
-
-
-<hr><p><a href="topics.html">Back to Topics</a></p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/help/a-30.html	Mon Aug 22 18:46:06 2011 +0100
@@ -0,0 +1,11 @@
+<link rel="stylesheet" type="text/css" href="help.css"/>
+
+
+<h2>I have committed some changes &ndash; how do I share them with my colleagues?</h2>
+
+<p>There are two common general approaches:</p>
+
+<p><a href="a-31.html">Permit your colleagues to &ldquo;pull&rdquo; your changes</a> directly from the local repository in your working folder, <i>or</i></p>
+
+<p><a href="a-32.html">&ldquo;Push&rdquo; your changes to a remote repository</a> which you can all use as a master copy.</p>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/help/a-31.html	Mon Aug 22 18:46:06 2011 +0100
@@ -0,0 +1,21 @@
+<link rel="stylesheet" type="text/css" href="help.css"/>
+
+
+<h2>I want to let my colleagues pull changes from my local repository</h2>
+
+<p>You can do this on a temporary basis using EasyMercurial, for
+occasional ad-hoc transfers:</p>
+
+<p><b>1. In EasyMercurial on your computer, go to File -> Share Repository and make a note of the URL shown in the window that is opened</b></p>
+
+<p><b>2. In EasyMercurial on your colleague's computer, either <a href="a-12.html">open a new empty folder</a>, or <a href="a-13.html">reopen a repository</a> that has been pulled from your repository in the past</b></p>
+
+<p><b>3. Go to Remote -> Set Remote Location on your colleague's computer and enter the URL you made a note of in the first step</b></p>
+
+<p><b>4. Click Pull in the main toolbar on your colleague's EasyMercurial program.</b></p>
+
+<p>There are various ways to set this relationship on a less temporary
+footing if you have shared access to your local folder, through
+network filesystems or via remote login to the computer you are using.
+Configuring this is outside the scope of this help document.</p>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/help/a-32.html	Mon Aug 22 18:46:06 2011 +0100
@@ -0,0 +1,5 @@
+<link rel="stylesheet" type="text/css" href="help.css"/>
+
+
+<h2>I want to push my changes to a master repository shared with my colleagues</h2>
+
--- a/help/generate.sh	Mon Aug 22 15:19:00 2011 +0100
+++ b/help/generate.sh	Mon Aug 22 18:46:06 2011 +0100
@@ -1,7 +1,6 @@
 #!/bin/bash
 
 css='<link rel="stylesheet" type="text/css" href="help.css"/>'
-backlink='<p><a href="topics.html">Back to Topics</a></p>'
 
 echo "$css" > topics.html
 cat intro.html >> topics.html
@@ -14,7 +13,6 @@
     out="a-$b.html"
 
     echo "$css" > "$out"
-    echo "$backlink<hr>" >> "$out"
 
     cat "$x" | perl -e '
 $_ = join "", <>;
@@ -42,8 +40,6 @@
 print;
 ' >> "$out"
 
-    echo "<hr>$backlink" >> "$out"
-
     category=`grep '^{.*}$' "$x" | sed 's/[{}]//g'`
 
     if [ "$category" != "$pcat" ]; then
--- a/help/topics.html	Mon Aug 22 15:19:00 2011 +0100
+++ b/help/topics.html	Mon Aug 22 18:46:06 2011 +0100
@@ -8,9 +8,14 @@
 <h3>Opening and initialising things</h3>
 <p><a href="a-10.html">Someone gave me a repository URL and asked me to clone it</a></p>
 <p><a href="a-11.html">I have a folder of source code or documents on my computer and I want to use version control to manage it</a></p>
-<p><a href="a-12.html">I have a Mercurial repository on my local computer and I want to use it with EasyMercurial</a></p>
+<p><a href="a-12.html">I want to start a completely new project using version control</a></p>
+<p><a href="a-13.html">I have a Mercurial repository on my local computer already and I want to use it with EasyMercurial</a></p>
 <h3>Making changes</h3>
 <p><a href="a-20.html">I've added a new file: what do I do with it?</a></p>
 <p><a href="a-21.html">I have changed some files and I want to record the changes</a></p>
 <p><a href="a-22.html">I want to remove, rename, or copy a file</a></p>
 <p><a href="a-23.html">I just deleted a file using the system file manager &ndash; then remembered I hadn't told the version control tool about it &ndash; what now?</a></p>
+<h3>Sharing changes</h3>
+<p><a href="a-30.html">I have committed some changes &ndash; how do I share them with my colleagues?</a></p>
+<p><a href="a-31.html">I want to let my colleagues pull changes from my local repository</a></p>
+<p><a href="a-32.html">I want to push my changes to a master repository shared with my colleagues</a></p>
--- a/help/topics/12.txt	Mon Aug 22 15:19:00 2011 +0100
+++ b/help/topics/12.txt	Mon Aug 22 18:46:06 2011 +0100
@@ -1,16 +1,22 @@
 {Opening and initialising things}
 
-I have a Mercurial repository on my local computer and I want to use it with EasyMercurial
+I want to start a completely new project using version control
 
-Just open it:
+To start using version control for an initially empty project, just
+initialise a repository in an empty folder:
 
 *1. Click the Open toolbar button or use File -> Open*
 
-#openlocal50
+#openfolder50
 
-*2. Select "Local repository" as the thing you want to open*
+*2. Select "File folder" as the thing you want to open*
 
-*3. Browse to the working folder for your local repository*
+*3. Make a new folder in the file dialog and browse to it*
 
 *4. Click OK*
 
+A new repository will be created, stowed into the empty working folder
+you selected.  At first, it will have an empty history.  You can then
+start to add and commit changes to your files.
+
+ * Note: the equivalent Mercurial command for this is *hg init*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/help/topics/13.txt	Mon Aug 22 18:46:06 2011 +0100
@@ -0,0 +1,16 @@
+{Opening and initialising things}
+
+I have a Mercurial repository on my local computer already and I want to use it with EasyMercurial
+
+Just open it:
+
+*1. Click the Open toolbar button or use File -> Open*
+
+#openlocal50
+
+*2. Select "Local repository" as the thing you want to open*
+
+*3. Browse to the working folder for your local repository*
+
+*4. Click OK*
+
--- a/help/topics/30.txt	Mon Aug 22 15:19:00 2011 +0100
+++ b/help/topics/30.txt	Mon Aug 22 18:46:06 2011 +0100
@@ -1,4 +1,10 @@
 {Sharing changes}
 
-I have committed a few changes -- how do I share them with my colleagues?
+I have committed some changes -- how do I share them with my colleagues?
 
+There are two common general approaches:
+
+[[31|Permit your colleagues to "pull" your changes]] directly from the local repository in your working folder, _or_
+
+[[32|"Push" your changes to a remote repository]] which you can all use as a master copy.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/help/topics/31.txt	Mon Aug 22 18:46:06 2011 +0100
@@ -0,0 +1,20 @@
+{Sharing changes}
+
+I want to let my colleagues pull changes from my local repository
+
+You can do this on a temporary basis using EasyMercurial, for
+occasional ad-hoc transfers:
+
+*1. In EasyMercurial on your computer, go to File -> Share Repository and make a note of the URL shown in the window that is opened*
+
+*2. In EasyMercurial on your colleague's computer, either [[12|open a new empty folder]], or [[13|reopen a repository]] that has been pulled from your repository in the past*
+
+*3. Go to Remote -> Set Remote Location on your colleague's computer and enter the URL you made a note of in the first step*
+
+*4. Click Pull in the main toolbar on your colleague's EasyMercurial program.*
+
+There are various ways to set this relationship on a less temporary
+footing if you have shared access to your local folder, through
+network filesystems or via remote login to the computer you are using.
+Configuring this is outside the scope of this help document.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/help/topics/32.txt	Mon Aug 22 18:46:06 2011 +0100
@@ -0,0 +1,4 @@
+{Sharing changes}
+
+I want to push my changes to a master repository shared with my colleagues
+
Binary file images/back.png has changed
Binary file images/forward.png has changed
Binary file images/home.png has changed
--- a/src/mainwindow.cpp	Mon Aug 22 15:19:00 2011 +0100
+++ b/src/mainwindow.cpp	Mon Aug 22 18:46:06 2011 +0100
@@ -56,10 +56,10 @@
 
 MainWindow::MainWindow(QString myDirPath) :
     m_myDirPath(myDirPath),
+    m_helpDialog(0),
     m_fsWatcherGeneralTimer(0),
     m_fsWatcherRestoreTimer(0),
-    m_fsWatcherSuspended(false),
-    m_helpDialog(0)
+    m_fsWatcherSuspended(false)
 {
     setWindowIcon(QIcon(":images/easyhg-icon.png"));
 
@@ -2658,8 +2658,6 @@
 
     QDir localRepoDir;
     QDir workFolderDir;
-    bool workFolderExist = true;
-    bool localRepoExist = true;
 
     m_remoteRepoActionsEnabled = true;
     if (m_remoteRepoPath.isEmpty()) {
@@ -2669,19 +2667,14 @@
     m_localRepoActionsEnabled = true;
     if (m_workFolderPath.isEmpty()) {
         m_localRepoActionsEnabled = false;
-        workFolderExist = false;
     }
 
     if (m_workFolderPath == "" || !workFolderDir.exists(m_workFolderPath)) {
         m_localRepoActionsEnabled = false;
-        workFolderExist = false;
-    } else {
-        workFolderExist = true;
     }
 
     if (!localRepoDir.exists(m_workFolderPath + "/.hg")) {
         m_localRepoActionsEnabled = false;
-        localRepoExist = false;
     }
 
     bool haveDiff = false;
@@ -3098,13 +3091,32 @@
         m_helpDialog = new QDialog;
         QGridLayout *layout = new QGridLayout;
         m_helpDialog->setLayout(layout);
+        QPushButton *home = new QPushButton;
+        home->setIcon(QIcon(":images/home.png"));
+        layout->addWidget(home, 0, 0);
+        QPushButton *back = new QPushButton;
+        back->setIcon(QIcon(":images/back.png"));
+        layout->addWidget(back, 0, 1);
+        QPushButton *fwd = new QPushButton;
+        fwd->setIcon(QIcon(":images/forward.png"));
+        layout->addWidget(fwd, 0, 2);
         QTextBrowser *text = new QTextBrowser;
         text->setOpenExternalLinks(true);
-        layout->addWidget(text, 0, 0);
+        layout->addWidget(text, 1, 0, 1, 4);
         text->setSource(QUrl("qrc:help/topics.html"));
         QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Close);
         connect(bb, SIGNAL(rejected()), m_helpDialog, SLOT(hide()));
-        layout->addWidget(bb, 1, 0);
+        connect(text, SIGNAL(backwardAvailable(bool)),
+                back, SLOT(setEnabled(bool)));
+        connect(text, SIGNAL(forwardAvailable(bool)),
+                fwd, SLOT(setEnabled(bool)));
+        connect(home, SIGNAL(clicked()), text, SLOT(home()));
+        connect(back, SIGNAL(clicked()), text, SLOT(backward()));
+        connect(fwd, SIGNAL(clicked()), text, SLOT(forward()));
+        back->setEnabled(false);
+        fwd->setEnabled(false);
+        layout->addWidget(bb, 2, 0, 1, 4);
+        layout->setColumnStretch(3, 20);
         m_helpDialog->resize(450, 500);
     }
     QTextBrowser *tb = m_helpDialog->findChild<QTextBrowser *>();