[Kst] extragear/graphics/kst/kst
George Staikos
staikos at kde.org
Sun Nov 6 18:14:14 CET 2005
SVN commit 478392 by staikos:
some cleanup and make Close in the context menu close the window, and close
the -right- window
BUG: 115749
M +31 -2 kst.cpp
--- trunk/extragear/graphics/kst/kst/kst.cpp #478391:478392
@@ -110,10 +110,12 @@
::inst = 0L;
}
+
KstApp* KstApp::inst() {
return ::inst;
}
+
static KConfig *kConfigObject = 0L;
KstApp::KstApp(QWidget *parent, const char *name)
@@ -909,11 +911,13 @@
slotUpdateDataMsg(QString::null);
}
+
void KstApp::initDocument() {
doc = new KstDoc(this);
doc->newDocument();
}
+
void KstApp::forceUpdate() {
_updateThread->forceUpdate();
}
@@ -998,14 +1002,17 @@
return _plotDialog;
}
+
KstMonochromeDialogI *KstApp::monochromeDialog() const {
return _monochromeDialog;
}
+
KstDoc *KstApp::document() const {
return doc;
}
+
void KstApp::saveOptions() {
config->setGroup("General Options");
recent->saveEntries(config, "Recent Files");
@@ -1043,6 +1050,7 @@
}
}
+
void KstApp::saveProperties(KConfig *config) {
QString name = doc->absFilePath();
if (!name.isEmpty() && doc->title() != i18n("Untitled")) {
@@ -1060,6 +1068,7 @@
}
}
+
void KstApp::readProperties(KConfig* config) {
QString name = config->readPathEntry("Document");
@@ -1076,6 +1085,7 @@
}
}
+
bool KstApp::queryClose() {
if (doc->saveModified()) {
doc->cancelUpdate();
@@ -1086,11 +1096,13 @@
return false;
}
+
bool KstApp::queryExit() {
saveOptions();
return true;
}
+
void KstApp::slotFileNew() {
slotUpdateStatusMsg(i18n("Creating new document..."));
@@ -1103,6 +1115,7 @@
slotUpdateStatusMsg(i18n("Ready"));
}
+
void KstApp::slotFileOpen() {
slotUpdateStatusMsg(i18n("Opening file..."));
@@ -1122,11 +1135,12 @@
slotUpdateStatusMsg(i18n("Ready"));
}
+
bool KstApp::slotFileOpenRecent(const KURL& newfile) {
bool returnVal = false;
slotUpdateStatusMsg(i18n("Opening file..."));
- if(doc->saveModified()) {
+ if (doc->saveModified()) {
if (doc->openDocument(newfile)) {
returnVal = true;
}
@@ -1137,6 +1151,7 @@
return returnVal;
}
+
void KstApp::slotFileSave() {
if (doc->title() == "Untitled") {
slotFileSaveAs();
@@ -1149,6 +1164,7 @@
}
}
+
bool KstApp::slotFileSaveAs() {
slotUpdateStatusMsg(i18n("Saving file with a new filename..."));
@@ -1190,6 +1206,7 @@
}
}
+
void KstApp::slotFileClose() {
if (doc->saveModified()) {
doc->cancelUpdate();
@@ -1199,6 +1216,7 @@
}
}
+
void KstApp::immediatePrintWindowToFile(KMdiChildView *win, const QString& filename) {
KstViewWindow *view = dynamic_cast<KstViewWindow*>(win);
if (view && !view->view()->children().isEmpty()) {
@@ -1206,6 +1224,7 @@
}
}
+
void KstApp::immediatePrintActiveWindowToFile(const QString& filename) {
KstViewWindow *view = dynamic_cast<KstViewWindow*>(activeWindow());
if (view) {
@@ -1213,6 +1232,7 @@
}
}
+
void KstApp::immediatePrintWindowToPng(KMdiChildView *win, const QString& filename, const QString& format, int width, int height, int display) {
KstViewWindow *view = dynamic_cast<KstViewWindow*>(win);
if (view && !view->view()->children().isEmpty()) {
@@ -1240,6 +1260,7 @@
}
}
+
void KstApp::immediatePrintActiveWindowToPng(const QString& filename, const QString& format, int width, int height, int display) {
KMdiChildView *win = activeWindow();
@@ -1248,6 +1269,7 @@
}
}
+
void KstApp::immediatePrintWindowToEps(KMdiChildView *win, const QString& filename, int width, int height, int display) {
KstViewWindow *view = dynamic_cast<KstViewWindow*>(win);
if (view && !view->view()->children().isEmpty()) {
@@ -1275,6 +1297,7 @@
}
}
+
void KstApp::immediatePrintActiveWindowToEps(const QString& filename, int width, int height, int display) {
KMdiChildView *win = activeWindow();
@@ -1283,6 +1306,7 @@
}
}
+
void KstApp::slotFilePrint() {
KstViewWindow *currentWin = dynamic_cast<KstViewWindow*>(activeWindow());
KstViewWindow *win;
@@ -1538,6 +1562,7 @@
}
}
+
void KstApp::immediatePrintToFile(const QString& filename) {
KPrinter printer;
@@ -1579,6 +1604,7 @@
}
}
+
void KstApp::immediatePrintToPng(const QString& filename, const QString& format, int width, int height, bool all, int display) {
if (all) {
QString filenameSub;
@@ -1635,10 +1661,12 @@
}
}
+
void KstApp::slotFileQuit() {
slotFileClose();
}
+
void KstApp::slotViewStatusBar() {
if (StatusBarAction->isChecked()) {
statusBar()->show();
@@ -1648,6 +1676,7 @@
}
}
+
void KstApp::updateStatusBarText() {
if (statusBar()->isShown()) {
QFontMetrics fm(fontMetrics());
@@ -2481,7 +2510,7 @@
pm->setItemEnabled(id, tw->indexOf(w) < tw->count() - 1);
}
pm->insertItem(i18n("R&ename..."), this, SLOT(slotFileRenameWindow()));
- pm->insertItem(i18n("&Close"), this, SLOT(slotFileClose()));
+ pm->insertItem(i18n("&Close"), vw, SLOT(close()));
}
pm->exec(pos);
More information about the Kst
mailing list