[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: =?utf-8?q?=5Bkile=5D_src/widgets=3A_Add_a_directory_selection_bu?=
From: Michel Ludwig <michel.ludwig () kdemail ! net>
Date: 2011-02-28 22:16:57
Message-ID: 20110228221657.52315A60CD () git ! kde ! org
[Download RAW message or body]
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 <KFileDialog>
+
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 @@
<item>
<widget class="KLineEdit" name="kcfg_DefaultProjectLocation"/>
</item>
+ <item>
+ <widget class="KPushButton" name="m_defaultProjectLocationButton"/>
+ </item>
</layout>
</item>
<item>
@@ -198,7 +201,7 @@
<item>
<widget class="QCheckBox" name="kcfg_CleanUpAfterClose">
<property name="text">
- <string>Automatically clean-up files after close</string>
+ <string>Automatically clean-up files after closing Kile</string>
</property>
</widget>
</item>
@@ -240,6 +243,11 @@
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
+ <class>KPushButton</class>
+ <extends>QPushButton</extends>
+ <header>kpushbutton.h</header>
+ </customwidget>
+ <customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic