mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-04-29 20:34:04 +02:00
Add a TweetDick warning and migration prompt
This commit is contained in:
parent
58fc1be1d5
commit
f39fd00697
@ -13,7 +13,24 @@ static class MigrationManager{
|
|||||||
private static readonly string TweetDeckPathParent = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "twitter");
|
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 TweetDeckPath = Path.Combine(TweetDeckPathParent, "TweetDeck");
|
||||||
|
|
||||||
|
private static readonly string TweetDickStorage = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "TweetDick");
|
||||||
|
|
||||||
public static void Run(){
|
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)){
|
if (!Program.UserConfig.IgnoreMigration && Directory.Exists(TweetDeckPath)){
|
||||||
MigrationDecision decision;
|
MigrationDecision decision;
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
//
|
//
|
||||||
var createUpdateNotificationElement = function(version, download){
|
var createUpdateNotificationElement = function(version, download){
|
||||||
var outdated = version === "unsupported";
|
var outdated = version === "unsupported";
|
||||||
|
var tweetdick = version === "tweetdick";
|
||||||
|
|
||||||
var ele = $("#tweetdck-update");
|
var ele = $("#tweetdck-update");
|
||||||
var existed = ele.length > 0;
|
var existed = ele.length > 0;
|
||||||
@ -36,6 +37,15 @@
|
|||||||
"<button class='btn btn-negative tdu-btn-dismiss'><span class='label'>Dismiss</span></button>",
|
"<button class='btn btn-negative tdu-btn-dismiss'><span class='label'>Dismiss</span></button>",
|
||||||
"</div>",
|
"</div>",
|
||||||
"</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'>",
|
"<div id='tweetdck-update'>",
|
||||||
"<p class='tdu-title'>"+$TDU.brandName+" Update</p>",
|
"<p class='tdu-title'>"+$TDU.brandName+" Update</p>",
|
||||||
@ -108,6 +118,10 @@
|
|||||||
$TDU.openBrowser("https://github.com/chylex/TweetDuck/wiki/Supported-Systems");
|
$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(){
|
buttonDiv.children(".tdu-btn-dismiss,.tdu-btn-unsupported").click(function(){
|
||||||
$TDU.onUpdateDismissed(version);
|
$TDU.onUpdateDismissed(version);
|
||||||
ele.slideUp(function(){ ele.remove(); });
|
ele.slideUp(function(){ ele.remove(); });
|
||||||
@ -131,6 +145,13 @@
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else if ($TDU.brandName === "TweetDick"){
|
||||||
|
if ($TDU.dismissedVersionTag !== "tweetdick"){
|
||||||
|
createUpdateNotificationElement("tweetdick");
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
clearTimeout(updateCheckTimeoutID);
|
clearTimeout(updateCheckTimeoutID);
|
||||||
updateCheckTimeoutID = setTimeout(runUpdateCheck, 1000*60*60); // 1 hour
|
updateCheckTimeoutID = setTimeout(runUpdateCheck, 1000*60*60); // 1 hour
|
||||||
|
Loading…
Reference in New Issue
Block a user