[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/kexi
From:       Jarosław Staniek <staniek () kde ! org>
Date:       2010-01-18 19:19:19
Message-ID: 1263842359.683284.30455.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1076732 by staniek:

Main Window
*Added view menu to the statusbar (but disabled for now)
**added "show project navigator" and "show property editor" to the view menu



 M  +8 -1      doc/dev/CHANGELOG-Kexi-js  
 M  +19 -1     main/KexiMainWindow.cpp  
 M  +4 -1      main/KexiMainWindow.h  
 M  +46 -13    main/kexistatusbar.cpp  
 M  +17 -17    main/kexistatusbar.h  


--- trunk/koffice/kexi/doc/dev/CHANGELOG-Kexi-js #1076731:1076732
@@ -57,9 +57,17 @@
 TODO: wrap passwordMode property for line edit widget in design mode, otherwise data \
source is displayed using *  TODO: use KRichTextWidget or KRichTextEdit instead of \
KTextEdit  TODO: text editor: autofill disabled because this makes the widget \
disappear entirely; now fix the background color because it is getting transparent on \
mouse out in design mode +Main Window TODO
+*View menu still disabled as showing hiding would be implemented as side bars; use \
this view for something else +*implemented dock hiding as side bars
 
 ~~~~~~~~~~~~~~~~ 2.2 alpha 1 ~~~~~~~~~~~~~~~~
 
+2010-01-17
+Main Window
+*Added view menu to the statusbar (but disabled for now)
+**added "show project navigator" and "show property editor" to the view menu
+
 2010-01-16
 Main Window
 *hide not working items in the Project tab
@@ -67,7 +75,6 @@
 *improve name for "copy special" and "paste special" actions
 *moved "copy special" action to project navigator's context menu
 *moved "import tables" action from "tools" to "external data" tab
-TODO: add show project nav/ show prop editor to the kexi menu
 
 2010-01-15
 KoProperty
--- trunk/koffice/kexi/main/KexiMainWindow.cpp #1076731:1076732
@@ -1,6 +1,6 @@
 /* This file is part of the KDE project
    Copyright (C) 2003 Lucijan Busch <lucijan@kde.org>
-   Copyright (C) 2003-2009 Jarosław Staniek <staniek@kde.org>
+   Copyright (C) 2003-2010 Jarosław Staniek <staniek@kde.org>
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
@@ -1956,10 +1956,28 @@
     vlyr->addWidget(d->mainWidget, 1);
     d->mainWidget->setParent(this);
 
+#if 0 // still disabled, see KexiStatusBar
     d->statusBar = new KexiStatusBar(this);
+    connect(d->statusBar->m_showNavigatorAction, SIGNAL(triggered(bool)),
+        this, SLOT(slotSetProjectNavigatorVisible(bool)));
+    connect(d->statusBar->m_showPropertyEditorAction, SIGNAL(triggered(bool)),
+        this, SLOT(slotSetPropertyEditorVisible(bool)));
+#endif
     vlyr->addWidget(d->statusBar);
 }
 
+void KexiMainWindow::slotSetProjectNavigatorVisible(bool set)
+{
+    if (d->navDockWidget)
+        d->navDockWidget->setVisible(set);
+}
+
+void KexiMainWindow::slotSetPropertyEditorVisible(bool set)
+{
+    if (d->propEditorDockWidget)
+        d->propEditorDockWidget->setVisible(set);
+}
+
 static Qt::DockWidgetArea loadDockAreaSetting(KConfigGroup& group, const char* \
configEntry, Qt::DockWidgetArea defaultArea)  {
         const QString areaName = group.readEntry(configEntry).toLower();
--- trunk/koffice/kexi/main/KexiMainWindow.h #1076731:1076732
@@ -1,6 +1,6 @@
 /* This file is part of the KDE project
    Copyright (C) 2003 Lucijan Busch <lucijan@kde.org>
-   Copyright (C) 2003-2009 Jarosław Staniek <staniek@kde.org>
+   Copyright (C) 2003-2010 Jarosław Staniek <staniek@kde.org>
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
@@ -703,6 +703,9 @@
 #endif
 #endif
 
+    void slotSetProjectNavigatorVisible(bool set);
+    void slotSetPropertyEditorVisible(bool set);
+
 private:
     class MessageHandler;
     class Private;
--- trunk/koffice/kexi/main/kexistatusbar.cpp #1076731:1076732
@@ -1,5 +1,5 @@
 /* This file is part of the KDE project
-   Copyright (C) 2003 Jarosław Staniek <staniek@kde.org>
+   Copyright (C) 2003-2010 Jarosław Staniek <staniek@kde.org>
 
    This program is free software; you can redistribute it and,or
    modify it under the terms of the GNU Library General Public
@@ -22,15 +22,14 @@
 
 #include "kexistatusbar.h"
 
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qpainter.h>
-#include <qtimer.h>
-#include <qfontmetrics.h>
+#include <QToolButton>
+#include <QWidgetAction>
+#include <QCheckBox>
+#include <QVBoxLayout>
 
-#include <kdebug.h>
-#include <kglobalsettings.h>
-#include <klocale.h>
+#include <KMenu>
+#include <KDebug>
+#include <KLocale>
 #include <kparts/part.h>
 
 #if KexiStatusBar_KTEXTEDITOR_USED
@@ -38,6 +37,22 @@
 #include <ktexteditor/viewstatusmsginterface.h>
 #endif
 
+// Smart menu
+class Menu : public KMenu
+{
+public:
+    Menu(QWidget *parent) : KMenu(parent) {}
+protected:
+    void mouseReleaseEvent(QMouseEvent* e);
+};
+
+void Menu::mouseReleaseEvent(QMouseEvent* e)
+{
+    if (activeAction())
+        activeAction()->trigger();
+}
+
+
 KexiStatusBar::KexiStatusBar(QWidget *parent)
         : KStatusBar(parent)
 #if KexiStatusBar_KTEXTEDITOR_USED
@@ -52,13 +67,31 @@
     insertPermanentItem("", m_msgID, 1 /*stretch*/);
 
     m_readOnlyID = id++;
-    insertPermanentItem(i18n("Read only"), m_readOnlyID);
+    insertPermanentItem(QString(), m_readOnlyID);
     setReadOnlyFlag(false);
 
-// @todo
-// connect(PartController::getInstance(), SIGNAL(activePartChanged(KParts::Part*)),
-//  this, SLOT(activePartChanged(KParts::Part*)));
+// still disabled as showing hiding would be implemented as side bars
+//! @todo use this view for something else
+#if 0
+    QToolButton *viewButton = new QToolButton(this);
+    viewButton->setContentsMargins(0, 0, 0, 0);
+    viewButton->setAutoRaise(true);
+    viewButton->setText(i18nc("View menu", "View"));
+    viewButton->setToolTip(i18n("Show view menu"));
+    viewButton->setWhatsThis(i18n("Shows menu with view-related options"));
+    addPermanentWidget(viewButton);
 
+//!@ todo add small close button
+    m_viewMenu = new Menu(this);
+    viewButton->setMenu(m_viewMenu);
+    viewButton->setPopupMode(QToolButton::InstantPopup);
+
+    m_showNavigatorAction = m_viewMenu->addAction(i18n("Project &Navigator"));
+    m_showNavigatorAction->setCheckable(true);
+
+    m_showPropertyEditorAction = m_viewMenu->addAction(i18n("&Property Editor"));
+    m_showPropertyEditorAction->setCheckable(true);
+#endif
     /// @todo remove parts from the map on PartRemoved() ?
 }
 
--- trunk/koffice/kexi/main/kexistatusbar.h #1076731:1076732
@@ -1,5 +1,5 @@
 /* This file is part of the KDE project
-   Copyright (C) 2003 Jarosław Staniek <staniek@kde.org>
+   Copyright (C) 2003-2010 Jarosław Staniek <staniek@kde.org>
 
    This program is free software; you can redistribute it and,or
    modify it under the terms of the GNU Library General Public
@@ -26,27 +26,21 @@
 //temporary
 #define KexiStatusBar_KTEXTEDITOR_USED 0
 
+#include <KStatusBar>
 
-#include <kstatusbar.h>
-#include <qmap.h>
-//Added by qt3to4:
-#include <QLabel>
+class KMenu;
+class QCheckBox;
 
-class QLabel;
-
 #if KexiStatusBar_KTEXTEDITOR_USED
 namespace KTextEditor
 {
-class ViewStatusMsgInterface;
+    class ViewStatusMsgInterface;
+    class ViewCursorInterface;
 }
-namespace KTextEditor
-{
-class ViewCursorInterface;
-}
 #endif
 namespace KParts
 {
-class Part;
+    class Part;
 }
 
 class KexiStatusBar : public KStatusBar
@@ -57,14 +51,20 @@
     virtual ~KexiStatusBar();
 //  virtual void addWidget( QWidget *widget, int stretch = 0, bool permanent = \
false);  
+//! @todo extend to more generic API
+    QAction *m_showNavigatorAction;
+    QAction *m_showPropertyEditorAction;
+
 public slots:
     virtual void setStatus(const QString &str);
     virtual void setReadOnlyFlag(bool readOnly);
 
+signals:
+
 protected slots:
-    virtual void cursorPositionChanged();
-    virtual void activePartChanged(KParts::Part *part);
-    virtual void setCursorPosition(int line, int col);
+    void cursorPositionChanged();
+    void activePartChanged(KParts::Part *part);
+    void setCursorPosition(int line, int col);
 
 protected:
     int m_msgID, m_readOnlyID;
@@ -75,7 +75,7 @@
     KTextEditor::ViewStatusMsgInterface * m_viewmsgIface;
 #endif
     KParts::Part *m_activePart;
+    KMenu *m_viewMenu;
 };
 
 #endif
-


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic