[Kst] branches/work/kst/portto4/kst/src/libkstapp
Adam Treat
treat at kde.org
Fri Sep 21 04:44:32 CEST 2007
SVN commit 714953 by treat:
* Dialog/Page bug fixes.
* Beginning of application settings.
A applicationsettingsdialog.cpp [License: GPL (v2+)]
A applicationsettingsdialog.h [License: GPL (v2+)]
M +2 -2 dialog.cpp
M +14 -4 dialogpage.cpp
M +5 -4 dialogpage.h
A generaltab.cpp [License: GPL (v2+)]
A generaltab.h [License: GPL (v2+)]
A generaltab.ui
A gridtab.cpp [License: GPL (v2+)]
A gridtab.h [License: GPL (v2+)]
A gridtab.ui
M +8 -1 libkstapp.pro
M +13 -0 mainwindow.cpp
M +3 -0 mainwindow.h
--- branches/work/kst/portto4/kst/src/libkstapp/dialog.cpp #714952:714953
@@ -23,7 +23,7 @@
setupUi(this);
- connect(_listWidget, SIGNAL(itemActivated(QListWidgetItem *)),
+ connect(_listWidget, SIGNAL(itemClicked(QListWidgetItem *)),
this, SLOT(selectPageForItem(QListWidgetItem *)));
connect(_buttonBox, SIGNAL(clicked(QAbstractButton *)),
@@ -49,7 +49,7 @@
void Dialog::setVisible(bool visible) {
- _listWidget->setVisible(_itemHash.count() > 2);
+ _listWidget->setVisible(_itemHash.count() > 1);
_buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
QDialog::setVisible(visible);
--- branches/work/kst/portto4/kst/src/libkstapp/dialogpage.cpp #714952:714953
@@ -13,12 +13,14 @@
#include "dialogtab.h"
+#include <QTabBar>
+
namespace Kst {
DialogPage::DialogPage(QWidget *parent)
- : QWidget(parent) {
- setupUi(this);
- _label->setVisible(false); //FIXME not sure what to do with this yet...
+ : QTabWidget(parent) {
+
+ tabBar()->setVisible(false);
}
@@ -31,9 +33,17 @@
connect(this, SIGNAL(apply()), tab, SIGNAL(apply()));
connect(this, SIGNAL(cancel()), tab, SIGNAL(cancel()));
connect(tab, SIGNAL(modified()), this, SIGNAL(modified()));
- _tab->addTab(tab, tab->tabTitle());
+ addTab(tab, tab->tabTitle());
}
+
+void DialogPage::setVisible(bool visible) {
+
+ tabBar()->setVisible(count() > 1);
+
+ QTabWidget::setVisible(visible);
}
+}
+
// vim: ts=2 sw=2 et
--- branches/work/kst/portto4/kst/src/libkstapp/dialogpage.h #714952:714953
@@ -12,17 +12,15 @@
#ifndef DIALOGPAGE_H
#define DIALOGPAGE_H
-#include <QWidget>
+#include <QTabWidget>
#include "kst_export.h"
-#include "ui_dialogpage.h"
-
namespace Kst {
class DialogTab;
-class KST_EXPORT DialogPage : public QWidget, public Ui::DialogPage
+class KST_EXPORT DialogPage : public QTabWidget
{
Q_OBJECT
public:
@@ -43,6 +41,9 @@
void cancel();
void modified();
+ protected:
+ void setVisible(bool visible);
+
private:
QString _pageTitle;
QPixmap _pageIcon;
--- branches/work/kst/portto4/kst/src/libkstapp/libkstapp.pro #714952:714953
@@ -21,6 +21,7 @@
SOURCES += \
application.cpp \
applicationsettings.cpp \
+ applicationsettingsdialog.cpp \
axis.cpp \
boxitem.cpp \
builtingraphics.cpp \
@@ -34,8 +35,10 @@
ellipseitem.cpp \
exportgraphicsdialog.cpp \
filltab.cpp \
+ generaltab.cpp \
graphicsfactory.cpp \
gridlayouthelper.cpp \
+ gridtab.cpp \
labelitem.cpp \
labelrenderer.cpp \
layoutboxitem.cpp \
@@ -66,6 +69,7 @@
HEADERS += \
application.h \
applicationsettings.h \
+ applicationsettingsdialog.h \
axis.h \
boxitem.h \
builtingraphics.h \
@@ -80,8 +84,10 @@
ellipseitem.h \
exportgraphicsdialog.h \
filltab.h \
+ generaltab.h \
graphicsfactory.h \
gridlayouthelper.h \
+ gridtab.h \
labelitem.h \
labelrenderer.h \
layoutboxitem.h \
@@ -114,9 +120,10 @@
datamanager.ui \
debugdialog.ui \
dialog.ui \
- dialogpage.ui \
exportgraphicsdialog.ui \
filltab.ui \
+ generaltab.ui \
+ gridtab.ui \
layouttab.ui \
stroketab.ui \
vectoreditordialog.ui \
--- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.cpp #714952:714953
@@ -31,6 +31,8 @@
#include "view.h"
#include "viewmanager.h"
+#include "applicationsettingsdialog.h"
+
#include <QtGui>
//FIXME Temporaries REMOVE!!
@@ -499,6 +501,10 @@
_aboutAct = new QAction(tr("&About"), this);
_aboutAct->setStatusTip(tr("Show Kst's About box"));
connect(_aboutAct, SIGNAL(triggered()), this, SLOT(about()));
+
+ _settingsDialogAct = new QAction(tr("&Configure Kst"), this);
+ _settingsDialogAct->setStatusTip(tr("Show Kst's Configuration Dialog"));
+ connect(_settingsDialogAct, SIGNAL(triggered()), this, SLOT(showSettingsDialog()));
}
@@ -541,6 +547,7 @@
_layoutMenu->addAction(_createSvgAct);
_settingsMenu = menuBar()->addMenu(tr("&Settings"));
+ _settingsMenu->addAction(_settingsDialogAct);
menuBar()->addSeparator();
@@ -647,6 +654,12 @@
}
+void MainWindow::showSettingsDialog() {
+ ApplicationSettingsDialog settingsDialog(this);
+ settingsDialog.exec();
+}
+
+
void MainWindow::readSettings() {
QSettings settings;
QPoint pos = settings.value("pos", QPoint(20, 20)).toPoint();
--- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.h #714952:714953
@@ -49,6 +49,7 @@
void showExportGraphicsDialog();
void showVectorEditor();
void showViewManager();
+ void showSettingsDialog();
void save();
void saveAs();
@@ -146,6 +147,8 @@
QAction *_viewManagerAct;
QAction *_layoutModeAct;
+
+ QAction *_settingsDialogAct;
};
}
More information about the Kst
mailing list