public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Jon Turney <jon.turney@dronecode.org.uk>
To: cygwin-apps@cygwin.com
Cc: Jon Turney <jon.turney@dronecode.org.uk>
Subject: [PATCH setup 4/5] Start chooser in "Pending" view if this is not a first time installation
Date: Fri, 18 Nov 2016 16:47:00 -0000	[thread overview]
Message-ID: <20161118164646.209716-5-jon.turney@dronecode.org.uk> (raw)
In-Reply-To: <20161118164646.209716-1-jon.turney@dronecode.org.uk>

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
---
 choose.cc | 3 ++-
 ini.h     | 1 +
 main.cc   | 1 +
 root.cc   | 5 ++++-
 4 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/choose.cc b/choose.cc
index 6563cb3..aa1d8e9 100644
--- a/choose.cc
+++ b/choose.cc
@@ -40,6 +40,7 @@ static const char *cvsid =
 #include <process.h>
 #include <algorithm>
 
+#include "ini.h"
 #include "dialog.h"
 #include "resource.h"
 #include "state.h"
@@ -151,7 +152,7 @@ ChooserPage::createListview ()
     exit (11);
   chooser->init(PickView::views::Category);
   chooser->Show(SW_SHOW);
-  chooser->setViewMode (UpgradeAlsoOption || hasManualSelections ?
+  chooser->setViewMode (!is_new_install || UpgradeAlsoOption || hasManualSelections ?
 			PickView::views::PackagePending : PickView::views::Category);
   SendMessage (GetDlgItem (IDC_CHOOSE_VIEW), CB_SETCURSEL, (WPARAM)chooser->getViewMode(), 0);
 
diff --git a/ini.h b/ini.h
index 7f6db22..3072637 100644
--- a/ini.h
+++ b/ini.h
@@ -24,6 +24,7 @@ typedef std::vector <std::string> IniList;
 extern IniList found_ini_list, setup_ext_list;
 const std::string setup_exts[] = { "xz", "bz2", "ini" };
 extern bool is_64bit;
+extern bool is_new_install;
 extern std::string SetupArch;
 extern std::string SetupIniDir;
 extern std::string SetupBaseName;
diff --git a/main.cc b/main.cc
index fbf12fb..6332920 100644
--- a/main.cc
+++ b/main.cc
@@ -84,6 +84,7 @@ extern char **_argv;
 #endif
 
 bool is_64bit;
+bool is_new_install = false;
 std::string SetupArch;
 std::string SetupIniDir;
 
diff --git a/root.cc b/root.cc
index 695590a..1fa562f 100644
--- a/root.cc
+++ b/root.cc
@@ -203,7 +203,10 @@ directory_contains_wrong_version (HWND h)
 
       /* Probably new installation */
       if (!GetBinaryType (cygcheck_exe.c_str (), &type))
-	return 0;
+        {
+          is_new_install = true;
+          return 0;
+        }
       /* 64 bit setup and 64 bit inst? */
       if (type == SCS_32BIT_BINARY && !is_64bit)
 	return 0;
-- 
2.8.3

  parent reply	other threads:[~2016-11-18 16:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-18 16:47 [PATCH setup 0/5] Various setup patches Jon Turney
2016-11-18 16:47 ` [PATCH setup 5/5] Simplify PickView::insert_pkg Jon Turney
2016-11-18 16:47 ` [PATCH setup 1/5] Give search edit box autohscroll style Jon Turney
2016-11-18 16:47 ` [PATCH setup 2/5] Fix validation in RootPage Jon Turney
2016-11-18 16:47 ` [PATCH setup 3/5] Ignore malformed lines in a site-list Jon Turney
2016-11-18 16:47 ` Jon Turney [this message]
2016-11-19 16:10 ` [PATCH setup 0/5] Various setup patches Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161118164646.209716-5-jon.turney@dronecode.org.uk \
    --to=jon.turney@dronecode.org.uk \
    --cc=cygwin-apps@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).