From kde-commits Mon Feb 28 22:16:57 2011 From: Michel Ludwig Date: Mon, 28 Feb 2011 22:16:57 +0000 To: kde-commits Subject: =?utf-8?q?=5Bkile=5D_src/widgets=3A_Add_a_directory_selection_bu?= Message-Id: <20110228221657.52315A60CD () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=129893156122271 Git commit 6694a62b61db517f13d5052b26c0973c4d1f3f75 by Michel Ludwig. Committed on 28/02/2011 at 23:14. Pushed by mludwig into branch 'master'. Add a directory selection button (and the corresponding dialog) which allows it to select the default location for projects in a more comfortable way. Patch by Felix Mauch BUG: 116670 M +16 -1 src/widgets/generalconfigwidget.cpp M +6 -2 src/widgets/generalconfigwidget.h M +9 -1 src/widgets/generalconfigwidget.ui http://commits.kde.org/kile/6694a62b61db517f13d5052b26c0973c4d1f3f75 diff --git a/src/widgets/generalconfigwidget.cpp b/src/widgets/generalconfigwidget.cpp index 9d47bab..6857a84 100644 --- a/src/widgets/generalconfigwidget.cpp +++ b/src/widgets/generalconfigwidget.cpp @@ -1,5 +1,6 @@ /************************************************************************** -* Copyright (C) 2007 by Michel Ludwig (michel.ludwig@kdemail.net) * +* Copyright (C) 2007-2011 by Michel Ludwig (michel.ludwig@kdemail.net) * +* 2011 by Felix Mauch (felix_mauch@web.de) * ***************************************************************************/ /************************************************************************** @@ -13,13 +14,27 @@ #include "widgets/generalconfigwidget.h" +#include + KileWidgetGeneralConfig::KileWidgetGeneralConfig(QWidget *parent) : QWidget(parent) { setupUi(this); + m_defaultProjectLocationButton->setIcon(KIcon("folder-open")); + + connect(m_defaultProjectLocationButton, SIGNAL(clicked()), + this, SLOT(selectDefaultProjectLocation())); } KileWidgetGeneralConfig::~KileWidgetGeneralConfig() { } +void KileWidgetGeneralConfig::selectDefaultProjectLocation() +{ + QString newDefaultLocation = KFileDialog::getExistingDirectory(kcfg_DefaultProjectLocation->text(), this); + if (!newDefaultLocation.isEmpty()) { + kcfg_DefaultProjectLocation->setText(newDefaultLocation); + } +} + #include "generalconfigwidget.moc" diff --git a/src/widgets/generalconfigwidget.h b/src/widgets/generalconfigwidget.h index 75c9bc6..7da1244 100644 --- a/src/widgets/generalconfigwidget.h +++ b/src/widgets/generalconfigwidget.h @@ -1,5 +1,6 @@ /************************************************************************** -* Copyright (C) 2007 by Michel Ludwig (michel.ludwig@kdemail.net) * +* Copyright (C) 2007-2011 by Michel Ludwig (michel.ludwig@kdemail.net) * +* 2011 by Felix Mauch (felix_mauch@web.de) * ***************************************************************************/ /************************************************************************** @@ -23,8 +24,11 @@ class KileWidgetGeneralConfig : public QWidget, public Ui::KileWidgetGeneralConf Q_OBJECT public: - KileWidgetGeneralConfig(QWidget *parent = 0); + KileWidgetGeneralConfig(QWidget *parent = NULL); ~KileWidgetGeneralConfig(); + + private slots: + void selectDefaultProjectLocation(); }; #endif diff --git a/src/widgets/generalconfigwidget.ui b/src/widgets/generalconfigwidget.ui index fac6d68..c010c30 100644 --- a/src/widgets/generalconfigwidget.ui +++ b/src/widgets/generalconfigwidget.ui @@ -53,6 +53,9 @@ + + + @@ -198,7 +201,7 @@ - Automatically clean-up files after close + Automatically clean-up files after closing Kile @@ -240,6 +243,11 @@ + KPushButton + QPushButton +
kpushbutton.h
+
+ KLineEdit QLineEdit
klineedit.h