[Kst] kdeextragear-2/kst/kst
Andrew Walker
arwalker at sumusltd.com
Tue Oct 19 00:45:03 CEST 2004
CVS commit by arwalker:
Display a more appropriate prompt if we are renaming a window.
M +7 -3 kst.cpp 1.246
M +1 -1 kst.h 1.110
--- kdeextragear-2/kst/kst/kst.cpp #1.245:1.246
@@ -1487,5 +1487,5 @@ void KstApp::slotFileRenameWindow() {
if (vw) {
- QString name = windowName(true, vw->caption());
+ QString name = windowName(true, vw->caption(), true);
if (!name.isEmpty() && vw->caption() != name) {
@@ -1518,5 +1518,5 @@ QString KstApp::newWindow(const QString&
-QString KstApp::windowName(bool prompt, const QString& nameOriginal) {
+QString KstApp::windowName(bool prompt, const QString& nameOriginal, bool rename) {
bool ok = false;
QString name = nameOriginal;
@@ -1526,5 +1526,9 @@ QString KstApp::windowName(bool prompt,
QRegExp exp("\\S+.*");
QRegExpValidator val(exp, 0L);
+ if (rename) {
+ name = KLineEditDlg::getText(i18n("Enter a new name for the window:"), name, &ok, 0L, &val).stripWhiteSpace();
+ } else {
name = KLineEditDlg::getText(i18n("Enter a name for the new window:"), name, &ok, 0L, &val).stripWhiteSpace();
+ }
if (ok && name==defaultTag) {
name = KST::suggestWinName();
--- kdeextragear-2/kst/kst/kst.h #1.109:1.110
@@ -107,5 +107,5 @@ class KstApp : public KMdiMainFrm {
Kst2DPlotMap& plotHolderWhileOpeningDocument();
- QString windowName(bool prompt, const QString& nameOriginal);
+ QString windowName(bool prompt, const QString& nameOriginal, bool rename = false);
QString newWindow(const QString& name);
QString newWindow(bool prompt = true);
More information about the Kst
mailing list