Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 5902 → Rev 5903

/branches/Version13x/Scribus/scribus/guidemanager.cpp
35,7 → 35,6
#include <qcheckbox.h>
#include <qtooltip.h>
#include <qhbuttongroup.h>
#include <qinputdialog.h>
#include <qtabwidget.h>
 
#include "guidemanager.h"
48,6 → 47,7
#include "util.h"
#include "commonstrings.h"
#include "pagestructs.h"
#include "scinputdialog.h"
 
 
int GuideListItem::compare(QListViewItem *i, int col, bool asc) const
156,10 → 156,10
{
bool ok;
double original = item->text(0).toDouble();
double newGuide = QInputDialog::getDouble(tr("Edit Guide"),
double newGuide = ScInputDialog::getDouble(tr("Edit Guide"),
tr("Enter a position:"),
original,
0, 1000, 2,
0, 1000, 2, suffix,
&ok, this);
if (!ok)
return false;
180,9 → 180,9
bool GuideManager::addValueToList(QListView *list)
{
bool ok;
double newGuide = QInputDialog::getDouble(tr("New Guide"),
double newGuide = ScInputDialog::getDouble(tr("New Guide"),
tr("Enter a position:"),
0.0, 0, 1000, 2,
0.0, 0, 1000, 2, suffix,
&ok, this );
if (!ok)
return false;
/branches/Version13x/Scribus/scribus/Makefile.am
175,6 → 175,7
sampleitem.cpp \
sccolor.cpp \
sccombobox.cpp \
scinpitdialog.cpp \
scfonts.cpp \
scfonts_ttf.cpp \
scfontmetrics.cpp \
416,6 → 417,7
$(INSTALL_DATA) $(srcdir)/reformdoc.h $(prefix)/include/scribus/reformdoc.h
$(INSTALL_DATA) $(srcdir)/sampleitem.h $(prefix)/include/scribus/sampleitem.h
$(INSTALL_DATA) $(srcdir)/sccolor.h $(prefix)/include/scribus/sccolor.h
$(INSTALL_DATA) $(srcdir)/scinputdialog.h $(prefix)/include/scribus/scinputdialog.h
$(INSTALL_DATA) $(srcdir)/scfonts.h $(prefix)/include/scribus/scfonts.h
$(INSTALL_DATA) $(srcdir)/scfonts_ttf.h $(prefix)/include/scribus/scfonts_ttf.h
$(INSTALL_DATA) $(srcdir)/scfontmetrics.h $(prefix)/include/scribus/scfontmetrics.h
611,6 → 613,7
-rm -f $(prefix)/include/scribus/reformdoc.h
-rm -f $(prefix)/include/scribus/sampleitem.h
-rm -f $(prefix)/include/scribus/sccolor.h
-rm -f $(prefix)/include/scribus/scinputdialog.h
-rm -f $(prefix)/include/scribus/scfontmetrics.h
-rm -f $(prefix)/include/scribus/scfonts.h
-rm -f $(prefix)/include/scribus/scfonts_ttf.h
/branches/Version13x/Scribus/scribus/scinputdialog.h
0,0 → 1,55
/*
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 <qvariant.h>
#include <qpixmap.h>
#include <qdialog.h>
 
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QSpacerItem;
class MSpinBox;
class QLabel;
class QPushButton;
 
 
/*! \brief A QInputDialog clone with MSpinBox widget.
\author Petr Vanek <petr@scribus.info>
*/
class ScInputDialog : public QDialog
{
Q_OBJECT
 
public:
ScInputDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
~ScInputDialog(){};
 
QLabel* entryLabel;
MSpinBox* 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, QString suffix = "", bool *ok = 0,
QWidget *parent = 0, const char *name = 0 );
 
protected:
QGridLayout* ScInputDialogLayout;
QVBoxLayout* layout2;
QHBoxLayout* Layout1;
QSpacerItem* hspacing;
 
protected slots:
virtual void languageChange();
};
 
#endif // SCINPUTDIALOG_H
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Index: Version13x/Scribus/scribus/scinputdialog.cpp
===================================================================
--- Version13x/Scribus/scribus/scinputdialog.cpp (nonexistent)
+++ Version13x/Scribus/scribus/scinputdialog.cpp (revision 5903)
@@ -0,0 +1,91 @@
+/*
+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 "scinputdialog.moc"
+
+#include <qvariant.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+#include "mspinbox.h"
+
+
+ScInputDialog::ScInputDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
+ : QDialog( parent, name, modal, fl )
+{
+ if ( !name )
+ setName( "ScInputDialog" );
+ setSizeGripEnabled( TRUE );
+ ScInputDialogLayout = new QGridLayout( this, 1, 1, 11, 6, "ScInputDialogLayout");
+
+ layout2 = new QVBoxLayout( 0, 0, 6, "layout2");
+
+ entryLabel = new QLabel( this, "entryLabel" );
+ layout2->addWidget( entryLabel );
+
+ entrySpin = new MSpinBox( this, "entrySpin" );
+ entrySpin->setMinimumSize( QSize( 0, 10 ) );
+ layout2->addWidget( entrySpin );
+
+ Layout1 = new QHBoxLayout( 0, 0, 6, "Layout1");
+ hspacing = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ Layout1->addItem( hspacing );
+
+ buttonOk = new QPushButton( this, "buttonOk" );
+ buttonOk->setAutoDefault( TRUE );
+ buttonOk->setDefault( TRUE );
+ Layout1->addWidget( buttonOk );
+
+ buttonCancel = new QPushButton( this, "buttonCancel" );
+ buttonCancel->setAutoDefault( TRUE );
+ Layout1->addWidget( buttonCancel );
+ layout2->addLayout( Layout1 );
+
+ ScInputDialogLayout->addLayout( layout2, 0, 0 );
+ languageChange();
+ resize( QSize(283, 126).expandedTo(minimumSizeHint()) );
+ clearWState( WState_Polished );
+
+ // signals and slots connections
+ connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
+ connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+}
+
+void ScInputDialog::languageChange()
+{
+ setCaption( tr( "Input Dialog" ) );
+ entryLabel->setText( tr( "InputDialog" ) );
+ buttonOk->setText( tr( "&OK" ) );
+ buttonOk->setAccel( QKeySequence( QString::null ) );
+ buttonCancel->setText( tr( "&Cancel" ) );
+ buttonCancel->setAccel( QKeySequence( QString::null ) );
+}
+
+double ScInputDialog::getDouble( const QString &caption, const QString &label, double num,
+ double from, double to, int decimals,
+ QString suffix, bool *ok,
+ QWidget *parent, const char *name )
+{
+ ScInputDialog *dlg = new ScInputDialog(parent, name, TRUE);
+ dlg->setCaption( caption );
+ dlg->entryLabel->setText(label);
+ dlg->entrySpin->setSuffix(suffix);
+ dlg->entrySpin->setDecimals(decimals);
+ dlg->entrySpin->setValue(num);
+ dlg->entrySpin->selectAll();
+
+ bool accepted = ( dlg->exec() == QDialog::Accepted );
+ if ( ok )
+ *ok = accepted;
+
+ double result = dlg->entrySpin->value();
+
+ delete dlg;
+ return result;
+}
/Version13x/Scribus/scribus/scinputdialog.cpp
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Index: Version13x/Scribus/scribus/CMakeLists.txt
===================================================================
--- Version13x/Scribus/scribus/CMakeLists.txt (revision 5902)
+++ Version13x/Scribus/scribus/CMakeLists.txt (revision 5903)
@@ -150,6 +150,7 @@
rulermover.h
sampleitem.h
sccolorshade.h
+scinputdialog.h
scmenu.h
scmessagebox.h
scgtplugin.h
@@ -357,6 +358,7 @@
sccolor.cpp
sccolorshade.cpp
sccombobox.cpp
+scinputdialog.cpp
scfonts.cpp
scfonts_ttf.cpp
scfontmetrics.cpp