Skip to content

Commit

Permalink
Fixed some bugs in windows app
Browse files Browse the repository at this point in the history
  • Loading branch information
km2442 committed Jun 21, 2019
1 parent b59059e commit 80a1a11
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Windows/AutoSwitch/Source/Classes/jsonactionparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ JsonActionParser::JsonActionParser()
bool JsonActionParser::parseNewAction(QJsonObject jsonObject)
{
Task task;
if(jsonObject.value("Action").toString() == "Shutdown") task.mode = 's';
if(jsonObject.value("Action").toString() == "Shutdown") task.mode = 'w';
else if(jsonObject.value("Action").toString() == "Reboot") task.mode = 'r';
else if(jsonObject.value("Action").toString() == "Sleep") task.mode = 'u';
else if(jsonObject.value("Action").toString() == "Hibernate") task.mode = 'h';
Expand Down
2 changes: 1 addition & 1 deletion Windows/AutoSwitch/Source/Main/functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ struct TaskTime countTime(unsigned long long quantity, char unit, struct TaskTim
else if (unit == 'm') temp = quantity * 60;
else temp = quantity;

time.dt = time.dt.addSecs(quantity);
time.dt = time.dt.addSecs(temp);

return time;
}
Expand Down
35 changes: 26 additions & 9 deletions Windows/AutoSwitch/Source/Main/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -584,12 +584,26 @@ void MainWindow::on_Main_Actions_Help_clicked()
//Page_When
void MainWindow::resetWhenPage()
{
ui->When_Mode_SecondsRB->setChecked(0);
ui->When_Mode_MinutesRB->setChecked(0);
ui->When_Mode_HoursRB->setChecked(0);
ui->When_Mode_AtHourRB->setChecked(0);
ui->When_Mode_CustomRB->setChecked(0);
ui->When_Mode_AtDateRB->setChecked(0);
ui->When_Mode_SecondsRB->setAutoExclusive(false);
ui->When_Mode_MinutesRB->setAutoExclusive(false);
ui->When_Mode_HoursRB->setAutoExclusive(false);
ui->When_Mode_AtHourRB->setAutoExclusive(false);
ui->When_Mode_CustomRB->setAutoExclusive(false);
ui->When_Mode_AtDateRB->setAutoExclusive(false);

ui->When_Mode_SecondsRB->setChecked(false);
ui->When_Mode_MinutesRB->setChecked(false);
ui->When_Mode_HoursRB->setChecked(false);
ui->When_Mode_AtHourRB->setChecked(false);
ui->When_Mode_CustomRB->setChecked(false);
ui->When_Mode_AtDateRB->setChecked(false);

ui->When_Mode_SecondsRB->setAutoExclusive(true);
ui->When_Mode_MinutesRB->setAutoExclusive(true);
ui->When_Mode_HoursRB->setAutoExclusive(true);
ui->When_Mode_AtHourRB->setAutoExclusive(true);
ui->When_Mode_CustomRB->setAutoExclusive(true);
ui->When_Mode_AtDateRB->setAutoExclusive(true);

ui->When_Mode_Seconds_Choose->setCurrentIndex(0);
ui->When_Mode_Minutes_Choose->setCurrentIndex(0);
Expand All @@ -598,8 +612,8 @@ void MainWindow::resetWhenPage()
ui->When_Mode_Custom_Quantity->setText("");
whenSyncTime();

ui->When_ForceCB->setChecked(0);
ui->When_AddTask->setEnabled(0);
ui->When_ForceCB->setChecked(false);
ui->When_AddTask->setEnabled(false);
}

void MainWindow::whenSyncTime()
Expand Down Expand Up @@ -729,7 +743,10 @@ void MainWindow::on_When_AddTask_clicked()
}
else task.time.dt.setDate(dt.date());

task.time.dt.setTime(dt.time());
QTime t;
t.setHMS(hours, minutes, seconds);

task.time.dt.setTime(t);
preAutomat(task);
}
break;
Expand Down
2 changes: 1 addition & 1 deletion Windows/AutoSwitch/Source/Main/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -3648,7 +3648,7 @@
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Century Gothic'; font-size:7.8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Century Gothic'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:12pt;&quot;&gt;Lead developer:&lt;/span&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:12pt; font-weight:600;&quot;&gt;►Kamil Klecha&lt;/span&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:12pt;&quot;&gt;▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬&lt;/span&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:12pt; font-weight:600;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:12pt;&quot;&gt;Consultations:&lt;/span&gt;&lt;/p&gt;
Expand Down

0 comments on commit 80a1a11

Please sign in to comment.