Commit 779ba520 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

[comic applet] Fix archive dialog to have dialog buttons bottom-right

parent 5a5a2314
......@@ -21,8 +21,6 @@
#include "comicarchivedialog.h"
#include "comicarchivejob.h"
#include <QDialogButtonBox>
ComicArchiveDialog::ComicArchiveDialog( const QString &pluginName, const QString &comicName, IdentifierType identifierType, const QString &currentIdentifierSuffix, const QString &firstIdentifierSuffix, const QString &savingDir, QWidget *parent )
: QDialog( parent ),
......@@ -32,11 +30,8 @@ ComicArchiveDialog::ComicArchiveDialog( const QString &pluginName, const QString
ui.setupUi(this);
setWindowTitle(i18nc("@title:window", "Create %1 Comic Book Archive", comicName));
mButtonBox = new QDialogButtonBox(this);
mButtonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(mButtonBox, SIGNAL(accepted()), SLOT(slotOkClicked()));
connect(mButtonBox, SIGNAL(rejected()), SLOT(reject()));
layout()->addWidget(mButtonBox);
connect(ui.buttonBox, &QDialogButtonBox::accepted, this, &ComicArchiveDialog::slotOkClicked);
connect(ui.buttonBox, &QDialogButtonBox::rejected, this, &ComicArchiveDialog::reject);
switch ( mIdentifierType ) {
case Date: {
......@@ -151,7 +146,7 @@ void ComicArchiveDialog::updateOkButton()
}
okEnabled = ( okEnabled && !ui.dest->url().isEmpty() );
mButtonBox->button(QDialogButtonBox::Ok)->setEnabled(okEnabled);
ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(okEnabled);
}
void ComicArchiveDialog::slotOkClicked()
......
......@@ -27,8 +27,6 @@
#include <QDialog>
class QDialogButtonBox;
class ComicArchiveDialog : public QDialog
{
Q_OBJECT
......@@ -53,7 +51,6 @@ class ComicArchiveDialog : public QDialog
private:
Ui::ComicArchiveDialog ui;
IdentifierType mIdentifierType;
QDialogButtonBox *mButtonBox;
QString mPluginName;
};
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ComicArchiveDialog</class>
<widget class="QWidget" name="ComicArchiveDialog">
<widget class="QDialog" name="ComicArchiveDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>469</width>
<height>143</height>
<height>213</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Destination:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KUrlRequester" name="dest">
<property name="filter">
<string>*.cbz|Comic Book Archive (Zip)</string>
</property>
<property name="mode">
<set>KFile::File|KFile::LocalOnly</set>
</property>
</widget>
</item>
<item row="1" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="statusTip">
<string>The range of comic strips to archive.</string>
</property>
<property name="text">
<string>Range:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="KComboBox" name="archiveType">
<item>
<property name="text">
<string>All</string>
</property>
<layout class="QVBoxLayout">
<item>
<layout class="QFormLayout" name="formLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Destination:</string>
</property>
</widget>
</item>
<item>
<property name="text">
<string>From beginning to ...</string>
</property>
<item row="0" column="1">
<widget class="KUrlRequester" name="dest">
<property name="filter">
<string>*.cbz|Comic Book Archive (Zip)</string>
</property>
<property name="mode">
<set>KFile::File|KFile::LocalOnly</set>
</property>
</widget>
</item>
<item>
<property name="text">
<string>From end to ...</string>
</property>
<item row="1" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item>
<property name="text">
<string>Manual range</string>
</property>
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="statusTip">
<string>The range of comic strips to archive.</string>
</property>
<property name="text">
<string>Range:</string>
</property>
</widget>
</item>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QStackedWidget" name="types">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="date">
<layout class="QFormLayout" name="formLayout">
<property name="margin">
<item row="2" column="1">
<widget class="KComboBox" name="archiveType">
<item>
<property name="text">
<string>All</string>
</property>
</item>
<item>
<property name="text">
<string>From beginning to ...</string>
</property>
</item>
<item>
<property name="text">
<string>From end to ...</string>
</property>
</item>
<item>
<property name="text">
<string>Manual range</string>
</property>
</item>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QStackedWidget" name="types">
<property name="currentIndex">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="fromDateLabel">
<property name="text">
<string comment="in a range: from to">From:</string>
<widget class="QWidget" name="date">
<layout class="QFormLayout" name="formLayout">
<property name="leftMargin">
<number>0</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="toDateLabel">
<property name="text">
<string comment="in a range: from to">To:</string>
<property name="topMargin">
<number>0</number>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QDateEdit" name="fromDate">
<property name="displayFormat">
<string>dd.MM.yyyy</string>
<property name="rightMargin">
<number>0</number>
</property>
<property name="calendarPopup">
<bool>true</bool>
<property name="bottomMargin">
<number>0</number>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDateEdit" name="toDate">
<property name="displayFormat">
<string>dd.MM.yyyy</string>
<item row="0" column="0">
<widget class="QLabel" name="fromDateLabel">
<property name="text">
<string comment="in a range: from to">From:</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="toDateLabel">
<property name="text">
<string comment="in a range: from to">To:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QDateEdit" name="fromDate">
<property name="displayFormat">
<string>dd.MM.yyyy</string>
</property>
<property name="calendarPopup">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDateEdit" name="toDate">
<property name="displayFormat">
<string>dd.MM.yyyy</string>
</property>
<property name="calendarPopup">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="number">
<layout class="QFormLayout" name="formLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="calendarPopup">
<bool>true</bool>
<property name="topMargin">
<number>0</number>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="number">
<layout class="QFormLayout" name="formLayout_2">
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="fromNumberLabel">
<property name="text">
<string comment="in a range: from to">From:</string>
<property name="rightMargin">
<number>0</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="toNumberLabel">
<property name="text">
<string comment="in a range: from to">To:</string>
<property name="bottomMargin">
<number>0</number>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="toNumber">
<property name="maximum">
<number>100000</number>
<item row="0" column="0">
<widget class="QLabel" name="fromNumberLabel">
<property name="text">
<string comment="in a range: from to">From:</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="toNumberLabel">
<property name="text">
<string comment="in a range: from to">To:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="toNumber">
<property name="maximum">
<number>100000</number>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="fromNumber">
<property name="maximum">
<number>100000</number>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="string">
<layout class="QFormLayout" name="formLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="fromNumber">
<property name="maximum">
<number>100000</number>
<property name="topMargin">
<number>0</number>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="string">
<layout class="QFormLayout" name="formLayout_3">
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="fromStringLabel">
<property name="text">
<string comment="in a range: from to">From:</string>
<property name="rightMargin">
<number>0</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="toStringLabel">
<property name="text">
<string comment="in a range: from to">To:</string>
<property name="bottomMargin">
<number>0</number>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KLineEdit" name="fromString"/>
</item>
<item row="1" column="1">
<widget class="KLineEdit" name="toString"/>
</item>
</layout>
</widget>
<item row="0" column="0">
<widget class="QLabel" name="fromStringLabel">
<property name="text">
<string comment="in a range: from to">From:</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="toStringLabel">
<property name="text">
<string comment="in a range: from to">To:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KLineEdit" name="fromString"/>
</item>
<item row="1" column="1">
<widget class="KLineEdit" name="toString"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<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="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KUrlRequester</class>
<extends>QWidget</extends>
<header>kurlrequester.h</header>
</customwidget>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
</customwidget>
<customwidget>
<class>KUrlRequester</class>
<extends>QWidget</extends>
<header>kurlrequester.h</header>
</customwidget>
<customwidget>
<class>KComboBox</class>
<extends>QComboBox</extends>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment