-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
mainwindow.cpp
179 lines (138 loc) · 3.78 KB
/
mainwindow.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "stitchplayer.h"
#include <QDesktopServices>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
//Code to open up notes.txt with program opening
QFile file("assets/notes.txt");
file.open(QIODevice::ReadOnly);
QTextStream in (&file);
QString text = in.readAll();
ui->notes->setText(text);
file.close();
//Code to open up quotes.txt when opening program
QFile quotes("assets/quotes.txt");
quotes.open(QIODevice::ReadOnly);
QTextStream qu("es);
QString quote = qu.readAll();
ui->quotes->setText(quote);
quotes.close();
//Code to open up toDo.txt when opening program
QFile toDo("assets/toDo.txt");
toDo.open(QIODevice::ReadOnly);
QTextStream to(&toDo);
QString ToDo = to.readAll();
ui->toDo->setText(ToDo);
toDo.close();
//Set Window Title
setWindowTitle("embTools");
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_actionStitch_Run_Time_Calculator_triggered()
{
StitchPlayer = new stitchPlayer(this);
StitchPlayer ->show();
}
void MainWindow::on_actionUnit_Conversions_triggered()
{
UnitConversion = new unitConversion(this);
UnitConversion -> show();
}
void MainWindow::on_save_clicked()
{
QFile file("assets/notes.txt");
file.open(QIODevice::WriteOnly);
QTextStream out(&file);
QString text = ui-> notes -> toPlainText();
out << text;
file.close();
}
void MainWindow::on_actionQuit_triggered()
{
QApplication::quit();
}
void MainWindow::on_actionDatabase_triggered()
{
Database = new database(this);
Database->show();
}
void MainWindow::on_actionQuote_Sheet_triggered()
{
QuoteSheet=new quoteSheet(this);
QuoteSheet->show();
}
void MainWindow::on_actionAbout_triggered()
{
About = new about(this);
About->show();
}
void MainWindow::on_actionReport_Bugs_Suggest_Features_General_Comments_triggered()
{
QString bugs = "https://github.com/wwderw/embTools/issues";
QDesktopServices::openUrl(bugs);
}
void MainWindow::on_actionGet_Latest_Release_triggered()
{
QString release = "https://github.com/wwderw/embTools/releases";
QDesktopServices::openUrl(release);
}
void MainWindow::on_actionGrab_Source_Code_triggered()
{
QString code = "https://github.com/wwderw/embTools";
QDesktopServices::openUrl(code);
}
void MainWindow::on_saveQuotes_clicked()
{
QFile file("assets/quotes.txt");
file.open(QIODevice::WriteOnly);
QTextStream out(&file);
QString text = ui-> quotes -> toPlainText();
out << text;
file.close();
}
void MainWindow::on_saveToDo_clicked()
{
QFile file("assets/toDo.txt");
file.open(QIODevice::WriteOnly);
QTextStream out(&file);
QString text = ui-> toDo -> toPlainText();
out << text;
file.close();
}
void MainWindow::on_actionVideos_triggered()
{
QString madeira = "https://www.madeirausa.com/education/";
QDesktopServices::openUrl(madeira);
}
void MainWindow::on_actionContact_triggered()
{
QString wwd = "https://www.facebook.com/WildWDesigns/";
QDesktopServices::openUrl(wwd);
}
void MainWindow::on_customDigitizing_triggered()
{
QString wwd = "https://www.facebook.com/WildWDesigns/";
QDesktopServices::openUrl(wwd);
}
void MainWindow::on_actionEmbroidery_Library_triggered()
{
QString embLib = "https://www.emblibrary.com/EL/Default.aspx";
QDesktopServices::openUrl(embLib);
}
void MainWindow::on_actionDakota_Collectibles_triggered()
{
QString DC = "https://www.dakotacollectibles.com/comm/default.asp";
QDesktopServices::openUrl(DC);
}
void MainWindow::on_actionYouTube_Tuts_triggered()
{
QString YT = "https://www.youtube.com/c/WildWestDesigns/";
QDesktopServices::openUrl(YT);
}