From bcebf0ec4be3845fe8551cab746d8e08dc04a3ab Mon Sep 17 00:00:00 2001 From: Nicolas Mailloux Date: Mon, 27 Dec 2021 14:07:40 -0500 Subject: [PATCH] Progress with libraryWidget --- librarywidget.cpp | 125 +++++++++++++++++++++++++++++++++++++++++++++ librarywidget.h | 18 +++++++ librarywidget.ui | 2 +- resources/eink.qss | 22 +++++--- 4 files changed, 160 insertions(+), 7 deletions(-) diff --git a/librarywidget.cpp b/librarywidget.cpp index b647734..e583345 100644 --- a/librarywidget.cpp +++ b/librarywidget.cpp @@ -225,3 +225,128 @@ void libraryWidget::on_nextBtn_clicked() ui->pageLabel->setText("2 of 2"); } +QString libraryWidget::getTitle(int bookNumber) { + QString bookNumberQstr = QString::number(bookNumber); + QString fullTitlePath = "/mnt/onboard/onboard/.inkbox/gutenberg-data/latest-books/"; + fullTitlePath = fullTitlePath.append(bookNumberQstr); + fullTitlePath = fullTitlePath.append("/title_full"); + qDebug() << fullTitlePath; + + return readFile(fullTitlePath); +} + +void libraryWidget::openLatestBookInfoDialog(int bookNumber, QString title) { + +} + + +void libraryWidget::on_book1Btn_clicked() +{ + QString title = getTitle(1); + openLatestBookInfoDialog(1, title); +} + +void libraryWidget::on_book2Btn_clicked() +{ + QString title = getTitle(2); + openLatestBookInfoDialog(2, title); +} + + +void libraryWidget::on_book3Btn_clicked() +{ + QString title = getTitle(3); + openLatestBookInfoDialog(3, title); +} + + +void libraryWidget::on_book4Btn_clicked() +{ + QString title = getTitle(4); + openLatestBookInfoDialog(4, title); +} + + +void libraryWidget::on_book5Btn_clicked() +{ + QString title = getTitle(5); + openLatestBookInfoDialog(5, title); +} + + +void libraryWidget::on_book6Btn_clicked() +{ + QString title = getTitle(6); + openLatestBookInfoDialog(6, title); +} + + +void libraryWidget::on_book7Btn_clicked() +{ + QString title = getTitle(7); + openLatestBookInfoDialog(7, title); +} + + +void libraryWidget::on_book8Btn_clicked() +{ + QString title = getTitle(8); + openLatestBookInfoDialog(8, title); +} + + +void libraryWidget::on_book9Btn_clicked() +{ + QString title = getTitle(9); + openLatestBookInfoDialog(9, title); +} + + +void libraryWidget::on_book10Btn_clicked() +{ + QString title = getTitle(10); + openLatestBookInfoDialog(10, title); +} + + +void libraryWidget::on_book11Btn_clicked() +{ + QString title = getTitle(11); + openLatestBookInfoDialog(11, title); +} + + +void libraryWidget::on_book12Btn_clicked() +{ + QString title = getTitle(12); + openLatestBookInfoDialog(12, title); +} + + +void libraryWidget::on_book13Btn_clicked() +{ + QString title = getTitle(13); + openLatestBookInfoDialog(13, title); +} + + +void libraryWidget::on_book14Btn_clicked() +{ + QString title = getTitle(14); + openLatestBookInfoDialog(14, title); +} + + +void libraryWidget::on_book15Btn_clicked() +{ + QString title = getTitle(15); + openLatestBookInfoDialog(15, title); +} + + +void libraryWidget::on_book16Btn_clicked() +{ + QString title = getTitle(16); + openLatestBookInfoDialog(16, title); +} + diff --git a/librarywidget.h b/librarywidget.h index 6a85cdd..d6462dd 100644 --- a/librarywidget.h +++ b/librarywidget.h @@ -28,9 +28,27 @@ private slots: void syncCatalog(); void setupView(); void showToast(QString messageToDisplay); + QString getTitle(int bookNumber); + void openLatestBookInfoDialog(int bookNumber, QString title); void on_previousBtn_clicked(); void on_nextBtn_clicked(); + void on_book1Btn_clicked(); + void on_book2Btn_clicked(); + void on_book3Btn_clicked(); + void on_book4Btn_clicked(); + void on_book5Btn_clicked(); + void on_book6Btn_clicked(); + void on_book7Btn_clicked(); + void on_book8Btn_clicked(); + void on_book9Btn_clicked(); + void on_book10Btn_clicked(); + void on_book11Btn_clicked(); + void on_book12Btn_clicked(); + void on_book13Btn_clicked(); + void on_book14Btn_clicked(); + void on_book15Btn_clicked(); + void on_book16Btn_clicked(); }; #endif // LIBRARYWIDGET_H diff --git a/librarywidget.ui b/librarywidget.ui index 6a0e648..d30b5f9 100644 --- a/librarywidget.ui +++ b/librarywidget.ui @@ -47,7 +47,7 @@ - 0 + 1 diff --git a/resources/eink.qss b/resources/eink.qss index 3fd5e1f..29be339 100644 --- a/resources/eink.qss +++ b/resources/eink.qss @@ -39,6 +39,11 @@ QPushButton[type="bw"] border: none; } +QPushButton +{ + border-radius: 10px; +} + QLabel[type="mangainfolabel"] { font-weight: bold; @@ -178,7 +183,9 @@ QLineEdit, QSpinBox, QDoubleSpinBox background-color:white; border:1px solid black; padding: 2px; + border-radius: 10px; } + QLineEdit:focus, QSpinBox:focus, QDoubleSpinBox:focus { border: 1px solid black; @@ -207,7 +214,7 @@ QComboBox { background-color:white; border: 1.5px solid black; - border-radius:5px; + border-radius:10px; padding-top: 3px; padding-right: 0px; padding-bottom: 3px; @@ -224,6 +231,7 @@ QComboBox:focus QComboBox::drop-down { border-width:1px; + border-radius:10px; } QComboBox::down-arrow { image:url(:/down-arrow.png); @@ -318,7 +326,7 @@ QToolButton:pressed { QSlider::groove:horizontal { border: 1.5px solid black; - border-radius: 0px; + border-radius: 10px; height: 15px; background: white; margin: 0px 0; @@ -326,11 +334,10 @@ QSlider::groove:horizontal { QSlider::handle:horizontal { background: black; border: 1.5px solid black; - border-radius: 0px; + border-radius: 10px; height: 15px; width: 25px; margin: 0px 0; - border-radius: 9px; } QSlider::handle:horizontal::focus { @@ -338,8 +345,9 @@ QSlider::handle:horizontal::focus { } QScrollBar { -background: white; -border: 5px solid lightGrey; + background: white; + border: 5px solid lightGrey; + border-radius: 10px; } QScrollBar:vertical { @@ -363,11 +371,13 @@ QScrollBar::sub-line { QDialog { border: 5px solid black; + border-radius: 10px; background: white; } QProgressBar { border: 1.5px solid black; + border-radius: 10px; text-align: center; background: white; color: rgb(160, 160, 160);