Skip to content

Commit 75b64f6

Browse files
committed
Added a simple system for showing tips on startup
1 parent 45c141f commit 75b64f6

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

MultiMiner.Win/Configuration/ApplicationConfiguration.cs

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public ApplicationConfiguration()
6161
public bool ShowApiErrors { get; set; }
6262
public bool UseAccessibleMenu { get; set; }
6363
public bool SetGpuEnvironmentVariables { get; set; }
64+
public int TipsShown { get; set; }
6465

6566
public bool MobileMinerMonitoring { get; set; }
6667
public bool MobileMinerRemoteCommands { get; set; }

MultiMiner.Win/MainForm.cs

+53
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,65 @@ private void MainForm_Load(object sender, EventArgs e)
143143

144144
SetupAccessibleMenu();
145145

146+
ShowStartupTips();
147+
146148
//do this after all other data has loaded to prevent errors when the delay is set very low (1s)
147149
SetupMiningOnStartup();
148150

149151
formLoaded = true;
150152
}
151153

154+
private void ShowStartupTips()
155+
{
156+
string tip = null;
157+
158+
switch (applicationConfiguration.TipsShown)
159+
{
160+
case 0:
161+
tip = "Tip: right-click device names to change coins";
162+
notificationsControl.AddNotification(tip, tip, () =>
163+
{
164+
if (deviceListView.Items.Count > 0)
165+
{
166+
string currentCoin = GetCurrentlySelectedCoinName();
167+
CheckCoinInPopupMenu(currentCoin);
168+
169+
ListViewItem firstItem = deviceListView.Items[0];
170+
Point popupPosition = firstItem.Position;
171+
popupPosition.Offset(14, 6);
172+
coinPopupMenu.Show(deviceListView, popupPosition);
173+
}
174+
}, "");
175+
applicationConfiguration.TipsShown++;
176+
break;
177+
case 1:
178+
tip = "Tip: right-click the main window for common tasks";
179+
notificationsControl.AddNotification(tip, tip, () =>
180+
{
181+
deviceListContextMenu.Show(deviceListView, 150, 100);
182+
}, "");
183+
applicationConfiguration.TipsShown++;
184+
break;
185+
case 2:
186+
tip = "Tip: restart mining after changing any settings";
187+
notificationsControl.AddNotification(tip, tip, () =>
188+
{
189+
}, "");
190+
applicationConfiguration.TipsShown++;
191+
break;
192+
case 3:
193+
tip = "Tip: consider enabling perks to give back to the author";
194+
notificationsControl.AddNotification(tip, tip, () =>
195+
{
196+
ConfigurePerks();
197+
}, "");
198+
applicationConfiguration.TipsShown++;
199+
break;
200+
}
201+
202+
applicationConfiguration.SaveApplicationConfiguration();
203+
}
204+
152205
private void SetupLookAndFeel()
153206
{
154207
Version win8version = new Version(6, 2, 9200, 0);

0 commit comments

Comments
 (0)