Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leaderboard #36

Merged
merged 2 commits into from
Nov 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions sudoku/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

static QFont gamefont("Ubuntu",16);
static QFont smallfont("Ubuntu",10);
static QString results = "";
static int uidWinner = 1;

MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
Expand Down Expand Up @@ -593,6 +595,7 @@ void MainWindow::finish()
if(level==0)return;
Timer->stop();
QString s=Time_record->toString("hh:mm:ss");
results += QString::number(uidWinner++) + ". решил за " + s + "\n";
s=" Вы решили этот пазл \nза "+s;
QMessageBox::information(this,tr("Поздравляю с решением!"),s,tr("Продолжить"));
}
Expand Down Expand Up @@ -772,3 +775,8 @@ void MainWindow::on_actionMusic_triggered()
player->play();
}
}

void MainWindow::on_actionrecords_of_that_session_triggered()
{
QMessageBox::information(this,tr("Leaders records"),results,tr("🥇"));
}
1 change: 1 addition & 0 deletions sudoku/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ private slots:
void on_actionRandom_4_triggered();
void on_actionInput_Sudoku_Game_triggered();
void on_actionMusic_triggered();
void on_actionrecords_of_that_session_triggered();
};

#endif // MAINWINDOW_H
32 changes: 22 additions & 10 deletions sudoku/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@
<x>0</x>
<y>0</y>
<width>668</width>
<height>26</height>
<height>21</height>
</rect>
</property>
<widget class="QMenu" name="menuNew_Game">
Expand Down Expand Up @@ -482,7 +482,14 @@
<addaction name="menuCrazy"/>
<addaction name="menuCustom"/>
</widget>
<widget class="QMenu" name="menuleaderboard">
<property name="title">
<string>leaderboard</string>
</property>
<addaction name="actionrecords_of_that_session"/>
</widget>
<addaction name="menuNew_Game"/>
<addaction name="menuleaderboard"/>
</widget>
<widget class="QToolBar" name="mainToolBar">
<property name="autoFillBackground">
Expand Down Expand Up @@ -522,7 +529,7 @@
</action>
<action name="actionStart">
<property name="icon">
<iconset>
<iconset resource="res.qrc">
<normaloff>:/fig/play</normaloff>:/fig/play</iconset>
</property>
<property name="text">
Expand All @@ -531,7 +538,7 @@
</action>
<action name="actionUndo">
<property name="icon">
<iconset>
<iconset resource="res.qrc">
<normaloff>:/fig/prev</normaloff>:/fig/prev</iconset>
</property>
<property name="text">
Expand All @@ -546,7 +553,7 @@
</action>
<action name="actionReset">
<property name="icon">
<iconset>
<iconset resource="res.qrc">
<normaloff>:/fig/previous</normaloff>:/fig/previous</iconset>
</property>
<property name="text">
Expand All @@ -561,7 +568,7 @@
</action>
<action name="actionPause">
<property name="icon">
<iconset>
<iconset resource="res.qrc">
<normaloff>:/fig/pause</normaloff>:/fig/pause</iconset>
</property>
<property name="text">
Expand All @@ -576,7 +583,7 @@
</action>
<action name="actionRedo">
<property name="icon">
<iconset>
<iconset resource="res.qrc">
<normaloff>:/fig/next</normaloff>:/fig/next</iconset>
</property>
<property name="text">
Expand All @@ -591,7 +598,7 @@
</action>
<action name="actionNew">
<property name="icon">
<iconset>
<iconset resource="res.qrc">
<normaloff>:/fig/shuffle</normaloff>:/fig/shuffle</iconset>
</property>
<property name="text">
Expand All @@ -603,7 +610,7 @@
</action>
<action name="actionDelete">
<property name="icon">
<iconset>
<iconset resource="res.qrc">
<normaloff>:/fig/minus</normaloff>:/fig/minus</iconset>
</property>
<property name="text">
Expand All @@ -615,7 +622,7 @@
</action>
<action name="actionSolve">
<property name="icon">
<iconset>
<iconset resource="res.qrc">
<normaloff>:/fig/calc</normaloff>:/fig/calc</iconset>
</property>
<property name="text">
Expand Down Expand Up @@ -809,7 +816,7 @@
</action>
<action name="actionMusic">
<property name="icon">
<iconset>
<iconset resource="res.qrc">
<normaloff>:/fig/mute</normaloff>:/fig/mute</iconset>
</property>
<property name="text">
Expand All @@ -822,6 +829,11 @@
<string>Ctrl+M</string>
</property>
</action>
<action name="actionrecords_of_that_session">
<property name="text">
<string>records of that session</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<tabstops>
Expand Down