diff --git a/Migration/MigrationManager.cs b/Migration/MigrationManager.cs index 6b307378..90041463 100644 --- a/Migration/MigrationManager.cs +++ b/Migration/MigrationManager.cs @@ -13,7 +13,24 @@ static class MigrationManager{ private static readonly string TweetDeckPathParent = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "twitter"); private static readonly string TweetDeckPath = Path.Combine(TweetDeckPathParent, "TweetDeck"); + private static readonly string TweetDickStorage = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "TweetDick"); + public static void Run(){ + #if DUCK + if (!Program.IsPortable && Directory.Exists(TweetDickStorage) && !Directory.Exists(Program.StoragePath)){ + if (MessageBox.Show("Welcome to TweetDuck! Would you like to move your old TweetDick configuration and login data?", "TweetDick Migration", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes){ + try{ + Directory.Move(TweetDickStorage, Program.StoragePath); + MessageBox.Show("All done! You can now uninstall TweetDick.", "TweetDick Migration", MessageBoxButtons.OK, MessageBoxIcon.Information); + }catch(Exception ex){ + Program.HandleException("An unexpected exception has occurred during the migration process.", ex); + } + } + + return; + } + #endif + if (!Program.UserConfig.IgnoreMigration && Directory.Exists(TweetDeckPath)){ MigrationDecision decision; diff --git a/Resources/Scripts/update.js b/Resources/Scripts/update.js index 98004246..237ae6ac 100644 --- a/Resources/Scripts/update.js +++ b/Resources/Scripts/update.js @@ -19,6 +19,7 @@ // var createUpdateNotificationElement = function(version, download){ var outdated = version === "unsupported"; + var tweetdick = version === "tweetdick"; var ele = $("#tweetdck-update"); var existed = ele.length > 0; @@ -36,6 +37,15 @@ "<button class='btn btn-negative tdu-btn-dismiss'><span class='label'>Dismiss</span></button>", "</div>", "</div>" + ] : tweetdick ? [ + "<div id='tweetdck-update'>", + "<p class='tdu-title'>TweetDick Ending</p>", + "<p class='tdu-info'>Please, move to TweetDuck.</p>", + "<div class='tdu-buttons'>", + "<button class='btn btn-positive tdu-btn-unsupported'><span class='label'>Read More</span></button>", + "<button class='btn btn-negative tdu-btn-dismiss'><span class='label'>Dismiss</span></button>", + "</div>", + "</div>" ] : [ "<div id='tweetdck-update'>", "<p class='tdu-title'>"+$TDU.brandName+" Update</p>", @@ -108,6 +118,10 @@ $TDU.openBrowser("https://github.com/chylex/TweetDuck/wiki/Supported-Systems"); }); + buttonDiv.children(".tdu-btn-tweetdick").click(function(){ + $TDU.openBrowser("https://github.com/chylex/TweetDick/wiki/Future-of-TweetDick"); + }); + buttonDiv.children(".tdu-btn-dismiss,.tdu-btn-unsupported").click(function(){ $TDU.onUpdateDismissed(version); ele.slideUp(function(){ ele.remove(); }); @@ -131,6 +145,13 @@ return; } + else if ($TDU.brandName === "TweetDick"){ + if ($TDU.dismissedVersionTag !== "tweetdick"){ + createUpdateNotificationElement("tweetdick"); + } + + return; + } clearTimeout(updateCheckTimeoutID); updateCheckTimeoutID = setTimeout(runUpdateCheck, 1000*60*60); // 1 hour