diff --git a/data/help/about1.html b/data/help/about1.html index ceef87f14..2a7e28f7a 100644 --- a/data/help/about1.html +++ b/data/help/about1.html @@ -86,8 +86,8 @@

Making moves

on castling in Chess960.

Let ChessX replay the game

-

If you want ChessX to replay the game, select "Game->Auto Player". -You can change the move rate with the slider in the bottom right corner of the status bar.

+

If you want ChessX + to replay the game, select “Game -> Auto Player”. You can change the move rate with the slider in the bottom right corner of the status bar.

Entering moves with the keyboard

@@ -137,7 +137,7 @@

Installing engines

this information is needed later on.

Open the Preferences Dialog, select the tab "Engines". Press "Add… " and browse to the path wherever your engine was installed. Press "Open". The executable will appear in the list of engines. In the lower half of the tab you will find some options. -Most of the modern engines are UCI engines so leave "the "UCI" selected. But quite a few engines (notably lc0 and stockfish) like a particular way of +Most of the modern engines are UCI engines so leave the "UCI" selected. But quite a few engines (notably lc0 and stockfish) like a particular way of transmitting a position so select "Send History" for stockfish, lc0 and possibly other engines.

For fine-tuning you can open the "Options" Dialog. This will load engine specific tweaks. The most interesting option usually is the number of threads the engine is allowed to use. Selecting a larger number will make the engine stronger but also use more power and your computer might heat up quickly.

@@ -366,6 +366,7 @@

Online Chess

used. The icon of the FICS button in the toolbar will show a timer if timeseal is used. Telnet will give you a disadvantage for faster games, so this protocol is not recommended.

+

You can accept incoming match requests from other players pressing "Accept" or you can seek for an opponent in the seek pane.

While waiting for your opponents move, you can already grab a piece and hover over a target square or you can enter a premove by dropping it somewhere, the premove piece and its target square a indicated. An active premove can be cancelled by clicking somewhere on the board diff --git a/data/images/chesscom.png b/data/images/chesscom.png deleted file mode 100644 index 5dfaf47e0..000000000 Binary files a/data/images/chesscom.png and /dev/null differ diff --git a/data/images/chesscom_fetch.png b/data/images/chesscom_fetch.png new file mode 100644 index 000000000..e9bc8260b Binary files /dev/null and b/data/images/chesscom_fetch.png differ diff --git a/data/images/fics.png b/data/images/fics.png deleted file mode 100644 index 1c1deec65..000000000 Binary files a/data/images/fics.png and /dev/null differ diff --git a/data/images/fics_fetch.png b/data/images/fics_fetch.png new file mode 100644 index 000000000..c6f6bb8d3 Binary files /dev/null and b/data/images/fics_fetch.png differ diff --git a/data/images/fics_offline.png b/data/images/fics_offline.png new file mode 100644 index 000000000..d93462c27 Binary files /dev/null and b/data/images/fics_offline.png differ diff --git a/data/images/fics_online.png b/data/images/fics_online.png new file mode 100644 index 000000000..c6cf91224 Binary files /dev/null and b/data/images/fics_online.png differ diff --git a/data/images/lichess.png b/data/images/lichess.png deleted file mode 100644 index b53f3a2bc..000000000 Binary files a/data/images/lichess.png and /dev/null differ diff --git a/data/images/lichess_fetch.png b/data/images/lichess_fetch.png new file mode 100644 index 000000000..aaa260526 Binary files /dev/null and b/data/images/lichess_fetch.png differ diff --git a/data/images/src/chesscom_fetch.svg b/data/images/src/chesscom_fetch.svg new file mode 100644 index 000000000..6f896e96a --- /dev/null +++ b/data/images/src/chesscom_fetch.svg @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/data/images/src/fics_fetch.svg b/data/images/src/fics_fetch.svg new file mode 100644 index 000000000..17e859504 --- /dev/null +++ b/data/images/src/fics_fetch.svg @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/data/images/src/fics_offline.svg b/data/images/src/fics_offline.svg new file mode 100644 index 000000000..71be9ca05 --- /dev/null +++ b/data/images/src/fics_offline.svg @@ -0,0 +1,216 @@ + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/images/src/fics_online.svg b/data/images/src/fics_online.svg new file mode 100644 index 000000000..b43a05db0 --- /dev/null +++ b/data/images/src/fics_online.svg @@ -0,0 +1,216 @@ + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/images/src/lichess_fetch.svg b/data/images/src/lichess_fetch.svg new file mode 100644 index 000000000..f257c8d15 --- /dev/null +++ b/data/images/src/lichess_fetch.svg @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/resources.qrc b/resources.qrc index 9f9d550bd..e674be972 100644 --- a/resources.qrc +++ b/resources.qrc @@ -40,7 +40,11 @@ data/images/edit_cut.png data/images/edit_mail.png data/images/edit_paste.png - data/images/fics.png + data/images/fics_online.png + data/images/fics_offline.png + data/images/fics_fetch.png + data/images/lichess_fetch.png + data/images/chesscom_fetch.png data/images/fileopen.png data/images/filter_reset.png data/images/filter_rev.png @@ -78,8 +82,6 @@ data/images/insert_move.png data/images/internet.png data/images/button_last.png - data/images/lichess.png - data/images/chesscom.png data/images/list_add.png data/images/match.png data/images/new_board.png diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index e4526a7d9..38afc9496 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -190,6 +190,9 @@ MainWindow::MainWindow() : QMainWindow(), connect(m_ficsConsole, SIGNAL(RequestRemoveLastMove()), this, SLOT(HandleFicsRequestRemoveMove())); connect(m_ficsClient, SIGNAL(disconnected()), SLOT(FicsDisconnected()), Qt::QueuedConnection); connect(m_ficsClient, SIGNAL(connected()), SLOT(FicsConnected()), Qt::QueuedConnection); + + + connect(m_ficsConsole, SIGNAL(RequestStoredMove()), SLOT(slotBoardStoredMove())); connect(this, SIGNAL(reconfigure()), m_ficsConsole, SLOT(slotReconfigure())); m_ficsConsole->setEnabled(false); @@ -1101,7 +1104,18 @@ void MainWindow::openChesscom() void MainWindow::openFICS() { + //Requests a terminate connection if Fics Toggle is checked + if (!ficsButton->isChecked()){ + HandleFicsCloseRequest(); + } + + //Opens Database (and connects) if Fics Toggle is unchecked + if (ficsButton->isChecked()){ + // Disable the Fics toggle while connection is being stablished + ficsButton->setEnabled(false); + //Attempt etablishing a connection openDatabaseFile(ficsPath(), false); + } } void MainWindow::openDatabaseArchive(QString fname, bool utf8) @@ -1483,6 +1497,24 @@ void MainWindow::resizeToolBarIcons (int scale) } } +/* Slot to change the pixmap of the Action for FICS connection +To display online or offline states +*/ +void MainWindow::FicsToggleConnected(){ + /* Update pixmap*/ + ficsButton->setIcon(QIcon(":/images/fics_online.png")); + /* show the toggle as checked to indicate connection is online */ + ficsButton->setChecked(true); + /* enable the button once again once connection is succesfully established */ + ficsButton->setEnabled(true); +} +void MainWindow::FicsToggleDisconnected(){ + /*Update pixmap */ + ficsButton->setIcon(QIcon(":/images/fics_offline.png")); + /* show the toggle as not checked to indicate connection is offline */ + ficsButton->setChecked(false); +} + void MainWindow::setupActions() { /* File menu */ @@ -1493,11 +1525,16 @@ void MainWindow::setupActions() file->addAction(createAction(tr("&New database..."), SLOT(slotFileNew()), Qt::CTRL + Qt::SHIFT + Qt::Key_N, fileToolBar, ":/images/new.png")); file->addAction(createAction(tr("&Open..."), SLOT(slotFileOpen()), QKeySequence::Open, fileToolBar, ":/images/folder_open.png")); file->addAction(createAction(tr("Open in UTF8..."), SLOT(slotFileOpenUtf8()), QKeySequence())); - file->addAction(createAction(tr("Open FICS"), SLOT(openFICS()), QKeySequence(), fileToolBar, ":/images/fics.png")); - file->addAction(createAction(tr("Open Lichess"), SLOT(openLichess()), QKeySequence(), fileToolBar, ":/images/lichess.png")); - file->addAction(createAction(tr("Open chess.com"), SLOT(openChesscom()), QKeySequence(), fileToolBar, ":/images/chesscom.png")); + ficsButton = createAction(tr("Connect to FICS"), SLOT(openFICS()), QKeySequence(), fileToolBar, ":/images/fics_offline.png"); + ficsButton->setCheckable(true); + file->addAction(ficsButton); + file->addAction(createAction(tr("Open Lichess"), SLOT(openLichess()), QKeySequence(), fileToolBar, ":/images/lichess_fetch.png")); + file->addAction(createAction(tr("Open chess.com"), SLOT(openChesscom()), QKeySequence(), fileToolBar, ":/images/chesscom_fetch.png")); file->addAction(createAction(tr("Web Favorite"), SLOT(openWebFavorite()), QKeySequence(), fileToolBar, ":/images/folder_web.png")); + connect(m_ficsClient, SIGNAL(disconnected()), this, SLOT(FicsToggleDisconnected())); + connect(m_ficsClient, SIGNAL(connected()), this, SLOT(FicsToggleConnected())); + QMenu* menuRecent = file->addMenu(tr("Open recent")); connect(menuRecent, SIGNAL( aboutToShow()), this, SLOT(updateMenuRecent())); file->addSeparator(); diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h index 3abab2db2..f87b9f116 100644 --- a/src/gui/mainwindow.h +++ b/src/gui/mainwindow.h @@ -130,11 +130,16 @@ class MainWindow: public QMainWindow void updateLastGameList(); /* Sets size for icons in the toolbar */ QToolBar * fileToolBar, * editToolBar, * viewToolBar, * gameToolBar, * dbToolBar, * searchToolBar; + /* Sets the Fics button to become available class Wide */ + QAction * ficsButton; public slots: /** Changes window title in response to boardview flipping**/ void updateWindowTitleFlipped(bool, bool); /** resizes icons in the toolbar **/ void resizeToolBarIcons(int scale); + /** Toggle the Pixmap of FICS icon to reflect connect or disconnect status **/ + void FicsToggleConnected(); + void FicsToggleDisconnected(); /** Enter gaming mode */ void slotToggleGameMode(); /** Flip the board view */