0001-Clean-up-scinputdialog.patch (6,497 bytes)
From bb74e017bac0cf6d11bdebd8d2158d5ac293ab7d Mon Sep 17 00:00:00 2001
Message-Id: <bb74e017bac0cf6d11bdebd8d2158d5ac293ab7d.1613604912.git.bubu@ujevangelizacio.hu>
From: =?UTF-8?q?Gyuris=20Gell=C3=A9rt?= <bubu@ujevangelizacio.hu>
Date: Thu, 18 Feb 2021 00:34:51 +0100
Subject: [PATCH] Clean up scinputdialog
---
scribus/CMakeLists.txt | 2 -
scribus/ui/guidemanager.cpp | 1 -
scribus/ui/scinputdialog.cpp | 107 -----------------------------------
scribus/ui/scinputdialog.h | 54 ------------------
4 files changed, 164 deletions(-)
diff --git a/scribus/CMakeLists.txt b/scribus/CMakeLists.txt
index 51a4b3138..e8bb92f13 100644
--- a/scribus/CMakeLists.txt
+++ b/scribus/CMakeLists.txt
@@ -510,7 +510,6 @@ set(SCRIBUS_MOC_CLASSES
ui/scdockpalette.h
ui/scescapecatcher.h
ui/scfilewidget.h
- ui/scinputdialog.h
ui/sclistwidgetdelegate.h
ui/scmenu.h
ui/scmessagebox.h
@@ -1025,7 +1024,6 @@ set(SCRIBUS_SOURCES
ui/scdockpalette.cpp
ui/scescapecatcher.cpp
ui/scfilewidget.cpp
- ui/scinputdialog.cpp
ui/sclistwidgetdelegate.cpp
ui/scmenu.cpp
ui/scmessagebox.cpp
diff --git a/scribus/ui/guidemanager.cpp b/scribus/ui/guidemanager.cpp
index 4665a3a04..d1f67a62b 100644
--- a/scribus/ui/guidemanager.cpp
+++ b/scribus/ui/guidemanager.cpp
@@ -29,7 +29,6 @@ for which a new license (GPL+exception) is in place.
#include "commonstrings.h"
#include "guidesdelegate.h"
#include "guidesmodel.h"
-#include "scinputdialog.h"
#include "scpage.h"
#include "scribuscore.h"
#include "scribusdoc.h"
diff --git a/scribus/ui/scinputdialog.cpp b/scribus/ui/scinputdialog.cpp
deleted file mode 100644
index 82b284861..000000000
--- a/scribus/ui/scinputdialog.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
-For general Scribus (>=1.3.2) copyright and licensing information please refer
-to the COPYING file provided with the program. Following this notice may exist
-a copyright and/or license notice that predates the release of Scribus 1.3.2
-for which a new license (GPL+exception) is in place.
-*/
-#include "scinputdialog.h"
-
-#include <QEvent>
-#include <QHBoxLayout>
-#include <QLabel>
-#include <QPushButton>
-#include <QSpacerItem>
-#include <QVBoxLayout>
-
-
-#include "scrspinbox.h"
-#include "util.h"
-#include "iconmanager.h"
-
-ScInputDialog::ScInputDialog( QWidget* parent, const char* name, bool modal) : QDialog( parent )
-{
- if ( !name )
- setObjectName( "ScInputDialog" );
- setModal(modal);
- setWindowIcon(IconManager::instance().loadIcon("AppIcon.png"));
- setSizeGripEnabled( true );
- ScInputDialogLayout = new QVBoxLayout( this );
- ScInputDialogLayout->setMargin(10);
- ScInputDialogLayout->setSpacing(5);
-
- labelEntryLayout = new QHBoxLayout;
- labelEntryLayout->setMargin(0);
- labelEntryLayout->setSpacing(5);
-
- entryLabel = new QLabel( this );
- labelEntryLayout->addWidget( entryLabel );
-
- entrySpin = new ScrSpinBox( this, 0 );
- entrySpin->setMinimumSize( QSize( 0, 10 ) );
- labelEntryLayout->addWidget( entrySpin );
-
- buttonLayout = new QHBoxLayout;
- buttonLayout->setMargin(0);
- buttonLayout->setSpacing(5);
- QSpacerItem* hspacing = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
- buttonLayout->addItem(hspacing);
-
- buttonOk = new QPushButton( this );
- buttonOk->setAutoDefault( true );
- buttonOk->setDefault( true );
- buttonLayout->addWidget( buttonOk );
-
- buttonCancel = new QPushButton( this );
- buttonCancel->setAutoDefault( true );
- buttonLayout->addWidget( buttonCancel );
-
- ScInputDialogLayout->addLayout(labelEntryLayout);
- ScInputDialogLayout->addLayout(buttonLayout);
- languageChange();
-
- // signals and slots connections
- connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
- connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
-}
-
-void ScInputDialog::changeEvent(QEvent *e)
-{
- if (e->type() == QEvent::LanguageChange)
- {
- languageChange();
- }
- else
- QWidget::changeEvent(e);
-}
-
-void ScInputDialog::languageChange()
-{
- setWindowTitle( tr( "Input Dialog" ) );
- entryLabel->setText( tr( "InputDialog" ) );
- buttonOk->setText( tr( "&OK" ) );
- buttonOk->setShortcut( QKeySequence( QString() ) );
- buttonCancel->setText( tr( "&Cancel" ) );
- buttonCancel->setShortcut( QKeySequence( QString() ) );
-}
-
-double ScInputDialog::getDouble( const QString &caption, const QString &label, double num,
- double from, double to, int decimals,
- const QString& suffix, bool *ok,
- QWidget *parent, const char *name )
-{
- ScInputDialog *dlg = new ScInputDialog(parent, name, true);
- dlg->setWindowTitle( caption );
- dlg->entryLabel->setText(label);
- dlg->entrySpin->setValues(0.0, 1000.0, decimals, num);
- dlg->entrySpin->setSuffix(suffix);
- dlg->entrySpin->selectAll();
-
- bool accepted = ( dlg->exec() == QDialog::Accepted );
- if ( ok )
- *ok = accepted;
-
- double result = dlg->entrySpin->value();
-
- delete dlg;
- return result;
-}
diff --git a/scribus/ui/scinputdialog.h b/scribus/ui/scinputdialog.h
deleted file mode 100644
index fa37d984d..000000000
--- a/scribus/ui/scinputdialog.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-For general Scribus (>=1.3.2) copyright and licensing information please refer
-to the COPYING file provided with the program. Following this notice may exist
-a copyright and/or license notice that predates the release of Scribus 1.3.2
-for which a new license (GPL+exception) is in place.
-*/
-
-#ifndef SCINPUTDIALOG_H
-#define SCINPUTDIALOG_H
-
-#include <QDialog>
-
-class QEvent;
-class QHBoxLayout;
-class QLabel;
-class QPushButton;
-class QVBoxLayout;
-
-class ScrSpinBox;
-
-
-/*! \brief A QInputDialog clone with ScrSpinBox widget.
-\author Petr Vanek <petr@scribus.info>
-*/
-class ScInputDialog : public QDialog
-{
- Q_OBJECT
-
-public:
- ScInputDialog( QWidget* parent = nullptr, const char* name = 0, bool modal = false);
- ~ScInputDialog(){};
-
- QLabel* entryLabel;
- ScrSpinBox* entrySpin;
- QPushButton* buttonOk;
- QPushButton* buttonCancel;
-
- static double getDouble(const QString &caption, const QString &label, double num = 0,
- double from = -2147483647, double to = 2147483647,
- int decimals = 1, const QString& suffix = "", bool *ok = 0,
- QWidget* parent = nullptr, const char *name = 0 );
-
-protected:
- QVBoxLayout* ScInputDialogLayout;
- QHBoxLayout* labelEntryLayout;
- QHBoxLayout* buttonLayout;
-
- void changeEvent(QEvent *e) override;
-
-protected slots:
- void languageChange();
-};
-
-#endif // SCINPUTDIALOG_H
--
2.27.0