Progress with libraryWidget

This commit is contained in:
Nicolas Mailloux 2021-12-27 14:07:40 -05:00
parent 20980325de
commit bcebf0ec4b
4 changed files with 160 additions and 7 deletions

View file

@ -225,3 +225,128 @@ void libraryWidget::on_nextBtn_clicked()
ui->pageLabel->setText("2 <i>of</i> 2"); ui->pageLabel->setText("2 <i>of</i> 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);
}

View file

@ -28,9 +28,27 @@ private slots:
void syncCatalog(); void syncCatalog();
void setupView(); void setupView();
void showToast(QString messageToDisplay); void showToast(QString messageToDisplay);
QString getTitle(int bookNumber);
void openLatestBookInfoDialog(int bookNumber, QString title);
void on_previousBtn_clicked(); void on_previousBtn_clicked();
void on_nextBtn_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 #endif // LIBRARYWIDGET_H

View file

@ -47,7 +47,7 @@
<item row="4" column="0"> <item row="4" column="0">
<widget class="QStackedWidget" name="booksStackedWidget"> <widget class="QStackedWidget" name="booksStackedWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="page_2"> <widget class="QWidget" name="page_2">
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="verticalLayout_4">

View file

@ -39,6 +39,11 @@ QPushButton[type="bw"]
border: none; border: none;
} }
QPushButton
{
border-radius: 10px;
}
QLabel[type="mangainfolabel"] QLabel[type="mangainfolabel"]
{ {
font-weight: bold; font-weight: bold;
@ -178,7 +183,9 @@ QLineEdit, QSpinBox, QDoubleSpinBox
background-color:white; background-color:white;
border:1px solid black; border:1px solid black;
padding: 2px; padding: 2px;
border-radius: 10px;
} }
QLineEdit:focus, QSpinBox:focus, QDoubleSpinBox:focus QLineEdit:focus, QSpinBox:focus, QDoubleSpinBox:focus
{ {
border: 1px solid black; border: 1px solid black;
@ -207,7 +214,7 @@ QComboBox
{ {
background-color:white; background-color:white;
border: 1.5px solid black; border: 1.5px solid black;
border-radius:5px; border-radius:10px;
padding-top: 3px; padding-top: 3px;
padding-right: 0px; padding-right: 0px;
padding-bottom: 3px; padding-bottom: 3px;
@ -224,6 +231,7 @@ QComboBox:focus
QComboBox::drop-down QComboBox::drop-down
{ {
border-width:1px; border-width:1px;
border-radius:10px;
} }
QComboBox::down-arrow { QComboBox::down-arrow {
image:url(:/down-arrow.png); image:url(:/down-arrow.png);
@ -318,7 +326,7 @@ QToolButton:pressed {
QSlider::groove:horizontal { QSlider::groove:horizontal {
border: 1.5px solid black; border: 1.5px solid black;
border-radius: 0px; border-radius: 10px;
height: 15px; height: 15px;
background: white; background: white;
margin: 0px 0; margin: 0px 0;
@ -326,11 +334,10 @@ QSlider::groove:horizontal {
QSlider::handle:horizontal { QSlider::handle:horizontal {
background: black; background: black;
border: 1.5px solid black; border: 1.5px solid black;
border-radius: 0px; border-radius: 10px;
height: 15px; height: 15px;
width: 25px; width: 25px;
margin: 0px 0; margin: 0px 0;
border-radius: 9px;
} }
QSlider::handle:horizontal::focus { QSlider::handle:horizontal::focus {
@ -338,8 +345,9 @@ QSlider::handle:horizontal::focus {
} }
QScrollBar { QScrollBar {
background: white; background: white;
border: 5px solid lightGrey; border: 5px solid lightGrey;
border-radius: 10px;
} }
QScrollBar:vertical { QScrollBar:vertical {
@ -363,11 +371,13 @@ QScrollBar::sub-line {
QDialog { QDialog {
border: 5px solid black; border: 5px solid black;
border-radius: 10px;
background: white; background: white;
} }
QProgressBar { QProgressBar {
border: 1.5px solid black; border: 1.5px solid black;
border-radius: 10px;
text-align: center; text-align: center;
background: white; background: white;
color: rgb(160, 160, 160); color: rgb(160, 160, 160);