Changeset View
Changeset View
Standalone View
Standalone View
src/core/kexipart.cpp
Show All 23 Lines | |||||
24 | //! @todo KEXI3 #include "kexistaticpart.h" | 24 | //! @todo KEXI3 #include "kexistaticpart.h" | ||
25 | #include "KexiWindow.h" | 25 | #include "KexiWindow.h" | ||
26 | #include "KexiWindowData.h" | 26 | #include "KexiWindowData.h" | ||
27 | #include "KexiView.h" | 27 | #include "KexiView.h" | ||
28 | #include "kexipartguiclient.h" | 28 | #include "kexipartguiclient.h" | ||
29 | #include "KexiMainWindowIface.h" | 29 | #include "KexiMainWindowIface.h" | ||
30 | #include "kexi.h" | 30 | #include "kexi.h" | ||
31 | #include <kexiutils/utils.h> | 31 | #include <kexiutils/utils.h> | ||
32 | #include <KexiIcon.h> | ||||
32 | 33 | | |||
33 | #include <KDbConnection> | 34 | #include <KDbConnection> | ||
34 | 35 | | |||
35 | #include <KActionCollection> | 36 | #include <KActionCollection> | ||
36 | #include <KMessageBox> | 37 | #include <KMessageBox> | ||
37 | 38 | | |||
38 | #include <QDebug> | 39 | #include <QDebug> | ||
39 | 40 | | |||
▲ Show 20 Lines • Show All 135 Lines • ▼ Show 20 Line(s) | |||||
175 | } | 176 | } | ||
176 | 177 | | |||
177 | QAction * Part::createSharedAction(Kexi::ViewMode mode, const QString &text, | 178 | QAction * Part::createSharedAction(Kexi::ViewMode mode, const QString &text, | ||
178 | const QString &pix_name, const QKeySequence &cut, const char *name, | 179 | const QString &pix_name, const QKeySequence &cut, const char *name, | ||
179 | const char *subclassName) | 180 | const char *subclassName) | ||
180 | { | 181 | { | ||
181 | GUIClient *instanceGuiClient = d->instanceGuiClients.value((int)mode); | 182 | GUIClient *instanceGuiClient = d->instanceGuiClients.value((int)mode); | ||
182 | if (!instanceGuiClient) { | 183 | if (!instanceGuiClient) { | ||
183 | qWarning() << "no gui client for mode " << mode << "!"; | 184 | qWarning() << "no gui client for mode" << mode << "!"; | ||
184 | return 0; | 185 | return 0; | ||
185 | } | 186 | } | ||
186 | return KexiMainWindowIface::global()->createSharedAction(text, pix_name, cut, name, | 187 | return KexiMainWindowIface::global()->createSharedAction(text, pix_name, cut, name, | ||
187 | instanceGuiClient->actionCollection(), subclassName); | 188 | instanceGuiClient->actionCollection(), subclassName); | ||
188 | } | 189 | } | ||
189 | 190 | | |||
190 | QAction * Part::createSharedPartAction(const QString &text, | 191 | QAction * Part::createSharedPartAction(const QString &text, | ||
191 | const QString &pix_name, const QKeySequence &cut, const char *name, | 192 | const QString &pix_name, const QKeySequence &cut, const char *name, | ||
▲ Show 20 Lines • Show All 116 Lines • ▼ Show 20 Line(s) | 227 | { | |||
308 | } | 309 | } | ||
309 | if (~res) | 310 | if (~res) | ||
310 | switchingFailed = true; | 311 | switchingFailed = true; | ||
311 | 312 | | |||
312 | if (switchingFailed) { | 313 | if (switchingFailed) { | ||
313 | d->status = window->status(); | 314 | d->status = window->status(); | ||
314 | window->close(); | 315 | window->close(); | ||
315 | delete window; | 316 | delete window; | ||
316 | qWarning() << "!window, switching to view mode failed, " << | 317 | qWarning() << "!window, switching to view mode failed," << | ||
317 | Kexi::nameForViewMode(viewMode); | 318 | Kexi::nameForViewMode(viewMode); | ||
318 | return 0; | 319 | return 0; | ||
319 | } | 320 | } | ||
320 | window->registerWindow(); //ok? | 321 | window->registerWindow(); //ok? | ||
321 | window->show(); | 322 | window->show(); | ||
322 | 323 | | |||
323 | window->setMinimumSize(window->minimumSizeHint().width(), window->minimumSizeHint().height()); | 324 | window->setMinimumSize(window->minimumSizeHint().width(), window->minimumSizeHint().height()); | ||
324 | 325 | | |||
▲ Show 20 Lines • Show All 109 Lines • ▼ Show 20 Line(s) | |||||
434 | KEXICORE_EXPORT QString KexiPart::fullCaptionForItem(KexiPart::Item *item, KexiPart::Part *part) | 435 | KEXICORE_EXPORT QString KexiPart::fullCaptionForItem(KexiPart::Item *item, KexiPart::Part *part) | ||
435 | { | 436 | { | ||
436 | Q_ASSERT(item); | 437 | Q_ASSERT(item); | ||
437 | Q_ASSERT(part); | 438 | Q_ASSERT(part); | ||
438 | if (part) | 439 | if (part) | ||
439 | return item->name() + " : " + part->info()->name(); | 440 | return item->name() + " : " + part->info()->name(); | ||
440 | return item->name(); | 441 | return item->name(); | ||
441 | } | 442 | } | ||
443 | | ||||
444 | KEXICORE_EXPORT void KexiPart::getTextViewAction(const QString& pluginId, QString *actionText, | ||||
445 | QString *iconName) | ||||
446 | { | ||||
447 | if (pluginId == QLatin1String("org.kexi-project.query")) { | ||||
448 | if (actionText) { | ||||
449 | *actionText = xi18n("Design in SQL View"); | ||||
450 | } | ||||
451 | if (iconName) { | ||||
452 | *iconName = KexiIconName("mode-selector-sql"); | ||||
453 | } | ||||
454 | } else { | ||||
455 | if (actionText) { | ||||
456 | *actionText = xi18n("Design in Text View"); | ||||
457 | } | ||||
458 | if (iconName) { | ||||
459 | iconName->clear(); | ||||
460 | } | ||||
461 | } | ||||
462 | } |