-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Footer Dialog with options for page numbers & checkbox for
default text.
- Loading branch information
1 parent
87a4fbf
commit 4334fd0
Showing
10 changed files
with
380 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,197 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>footer</class> | ||
<widget class="QDialog" name="footer"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>585</width> | ||
<height>180</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Footer - Word Search Creator</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<layout class="QHBoxLayout" name="horizontalLayout_2"> | ||
<item> | ||
<widget class="QLabel" name="label_7"> | ||
<property name="text"> | ||
<string>Display Page Number:</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<spacer name="horizontalSpacer_3"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>40</width> | ||
<height>20</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<widget class="QRadioButton" name="noPageNumberRadioButton"> | ||
<property name="text"> | ||
<string>Never</string> | ||
</property> | ||
<attribute name="buttonGroup"> | ||
<string notr="true">buttonGroup</string> | ||
</attribute> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QRadioButton" name="multiplePageNumberRadioButton"> | ||
<property name="text"> | ||
<string>When Multiple Pages</string> | ||
</property> | ||
<property name="checked"> | ||
<bool>true</bool> | ||
</property> | ||
<attribute name="buttonGroup"> | ||
<string notr="true">buttonGroup</string> | ||
</attribute> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QRadioButton" name="alwaysPageNumberRadioButton"> | ||
<property name="text"> | ||
<string>Always</string> | ||
</property> | ||
<attribute name="buttonGroup"> | ||
<string notr="true">buttonGroup</string> | ||
</attribute> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
<item> | ||
<layout class="QHBoxLayout" name="horizontalLayout"> | ||
<item> | ||
<widget class="QLabel" name="label"> | ||
<property name="text"> | ||
<string>Display Page Count:</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<spacer name="horizontalSpacer"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>40</width> | ||
<height>20</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<widget class="QRadioButton" name="noPageCountRadioButton"> | ||
<property name="text"> | ||
<string>Never</string> | ||
</property> | ||
<attribute name="buttonGroup"> | ||
<string notr="true">buttonGroup_2</string> | ||
</attribute> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QRadioButton" name="pageCountRadioButton"> | ||
<property name="text"> | ||
<string>When Displaying Page Number</string> | ||
</property> | ||
<property name="checked"> | ||
<bool>true</bool> | ||
</property> | ||
<attribute name="buttonGroup"> | ||
<string notr="true">buttonGroup_2</string> | ||
</attribute> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
<item> | ||
<widget class="QCheckBox" name="customFooterCheckBox"> | ||
<property name="text"> | ||
<string>Use Custom Footer</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<layout class="QHBoxLayout" name="horizontalLayout_3"> | ||
<item> | ||
<widget class="QLabel" name="footerLabel"> | ||
<property name="enabled"> | ||
<bool>false</bool> | ||
</property> | ||
<property name="text"> | ||
<string>Footer Text:</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QLineEdit" name="footerTextLineEdit"> | ||
<property name="enabled"> | ||
<bool>false</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
<item> | ||
<spacer name="verticalSpacer"> | ||
<property name="orientation"> | ||
<enum>Qt::Vertical</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>20</width> | ||
<height>40</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<widget class="QDialogButtonBox" name="buttonBox"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<property name="standardButtons"> | ||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections> | ||
<connection> | ||
<sender>buttonBox</sender> | ||
<signal>rejected()</signal> | ||
<receiver>footer</receiver> | ||
<slot>reject()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>316</x> | ||
<y>260</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>286</x> | ||
<y>274</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
</connections> | ||
<buttongroups> | ||
<buttongroup name="buttonGroup_2"/> | ||
<buttongroup name="buttonGroup"/> | ||
</buttongroups> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/*************************************************************************** | ||
* Copyright (C) 2006-2024 M Wellings * | ||
* [email protected] * | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License version 2 as * | ||
* published by the Free Software Foundation * | ||
* * | ||
* This program is distributed in the hope that it will be useful, * | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
* GNU General Public License for more details. * | ||
* * | ||
* You should have received a copy of the GNU General Public License * | ||
* along with this program; if not, write to the * | ||
* Free Software Foundation, Inc., * | ||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * | ||
***************************************************************************/ | ||
|
||
#include <QDebug> | ||
|
||
#include "wordsearchdoc.h" | ||
|
||
#include "footerdialog.h" | ||
|
||
footerdialog::footerdialog(QWidget *parent) | ||
: QDialog(parent) | ||
{ | ||
setupUi(this); | ||
this->setWindowModality(Qt::WindowModal); | ||
connect(buttonBox, SIGNAL(accepted()), this, SLOT(okPressed())); | ||
} | ||
|
||
void footerdialog::setDoc(WordSearchDoc *wsd) | ||
{ | ||
this->wsd = wsd; | ||
customFooterCheckBox->setChecked(!wsd->getFooter().isNull()); | ||
if (!wsd->getFooter().isNull()) | ||
footerTextLineEdit->setText(wsd->getFooter()); | ||
else | ||
footerTextLineEdit->setText(WordSearchDoc::getDefaultFooter()); | ||
if (wsd->getShowPageNumber() == WordSearchDoc::showPageNumberType::PageNumberNever) | ||
noPageNumberRadioButton->setChecked(true); | ||
else if (wsd->getShowPageNumber() == WordSearchDoc::showPageNumberType::PageNumberAlways) | ||
alwaysPageNumberRadioButton->setChecked(true); | ||
noPageCountRadioButton->setChecked(!wsd->getShowPageCount()); | ||
} | ||
|
||
void footerdialog::okPressed() | ||
{ | ||
if (customFooterCheckBox->isChecked()) | ||
wsd->setFooter(footerTextLineEdit->text()); | ||
else | ||
wsd->setFooter(QString()); | ||
if (noPageNumberRadioButton->isChecked()) | ||
wsd->setShowPageNumber(WordSearchDoc::showPageNumberType::PageNumberNever); | ||
else if (multiplePageNumberRadioButton->isChecked()) | ||
wsd->setShowPageNumber(WordSearchDoc::showPageNumberType::PageNumberMultipage); | ||
else | ||
wsd->setShowPageNumber(WordSearchDoc::showPageNumberType::PageNumberAlways); | ||
wsd->setShowPageCount(pageCountRadioButton->isChecked()); | ||
accept(); | ||
} | ||
|
||
void footerdialog::on_customFooterCheckBox_toggled(bool checked) | ||
{ | ||
qDebug() << "on_cudtomFooterCheckBox_toggled"; | ||
footerLabel->setEnabled(checked); | ||
footerTextLineEdit->setEnabled(checked); | ||
if (!checked) | ||
footerTextLineEdit->setText(WordSearchDoc::getDefaultFooter()); | ||
else | ||
footerTextLineEdit->setText(""); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/*************************************************************************** | ||
* Copyright (C) 2006-2024 M Wellings * | ||
* [email protected] * | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License version 2 as * | ||
* published by the Free Software Foundation * | ||
* * | ||
* This program is distributed in the hope that it will be useful, * | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
* GNU General Public License for more details. * | ||
* * | ||
* You should have received a copy of the GNU General Public License * | ||
* along with this program; if not, write to the * | ||
* Free Software Foundation, Inc., * | ||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * | ||
***************************************************************************/ | ||
|
||
#ifndef FOOTERDIALOG_H | ||
#define FOOTERDIALOG_H | ||
|
||
#include "ui_footer.h" | ||
|
||
class WordSearchDoc; | ||
|
||
class footerdialog : public QDialog, private Ui::footer | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit footerdialog(QWidget *parent = nullptr); | ||
void setDoc(WordSearchDoc *wsd); | ||
|
||
private slots: | ||
void okPressed(); | ||
|
||
void on_customFooterCheckBox_toggled(bool checked); | ||
|
||
private: | ||
WordSearchDoc *wsd; | ||
|
||
}; | ||
|
||
#endif // FOOTERDIALOG_H |
Oops, something went wrong.