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

List:       kde-commits
Subject:    koffice/kexi/widget
From:       Jarosław Staniek <staniek () kde ! org>
Date:       2009-11-11 23:37:18
Message-ID: 1257982638.055783.3029.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1047736 by staniek:

Table View
*move save/cancel buttons before sorting buttons; add separator


 M  +13 -7     kexidataawareview.cpp  
 M  +1 -1      kexidataawareview.h  


--- trunk/koffice/kexi/widget/kexidataawareview.cpp #1047735:1047736
@@ -1,5 +1,5 @@
 /* This file is part of the KDE project
-   Copyright (C) 2005-2007 Jarosław Staniek <staniek@kde.org>
+   Copyright (C) 2005-2009 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
@@ -81,7 +81,15 @@
 {
     // - setup local actions
     QList<QAction*> viewActions;
-    KAction* a;
+    KActionCollection *ac = KexiMainWindowIface::global()->actionCollection();
+    viewActions
+        << dynamic_cast<KAction*>(ac->action("data_save_row"))
+        << dynamic_cast<KAction*>(ac->action("data_cancel_row_changes"));
+    
+    KAction *a = new KAction(this);
+    a->setSeparator(true);
+    viewActions << a;
+
     if (m_dataAwareObject->isSortingEnabled()) {
 //  a = new KAction(this);
 //  a->setSeparator(true);
@@ -90,10 +98,7 @@
         << KexiStandardAction::sortAscending(this, SLOT(sortAscending()), this)
         << KexiStandardAction::sortDescending(this, SLOT(sortDescending()), this);
     }
-    KActionCollection *ac = KexiMainWindowIface::global()->actionCollection();
     viewActions
-        << dynamic_cast<KAction*>(ac->action("data_save_row"))
-        << dynamic_cast<KAction*>(ac->action("data_cancel_row_changes"))
         << dynamic_cast<KAction*>(ac->action("edit_find"));
     setViewActions(viewActions);
 
@@ -172,10 +177,11 @@
     const bool editing = m_dataAwareObject->rowEditing();
     const bool sorting = m_dataAwareObject->isSortingEnabled();
     const int rows = m_dataAwareObject->rows();
+    const bool insertRowFocusedWithoutEditing = !editing && row == rows;
 
-    setAvailable("edit_cut", !ro);
+    setAvailable("edit_cut", !ro && !insertRowFocusedWithoutEditing);
     setAvailable("edit_paste", !ro);
-    setAvailable("edit_delete", !ro); // && !(inserting && row==rows));
+    setAvailable("edit_delete", !ro && !insertRowFocusedWithoutEditing);
     setAvailable("edit_delete_row", !ro && !(deleting && row == rows));
     setAvailable("edit_insert_empty_row", !ro && emptyInserting);
     setAvailable("edit_clear_table", !ro && deleting && rows > 0);
--- trunk/koffice/kexi/widget/kexidataawareview.h #1047735:1047736
@@ -1,5 +1,5 @@
 /* This file is part of the KDE project
-   Copyright (C) 2005-2007 Jarosław Staniek <staniek@kde.org>
+   Copyright (C) 2005-2009 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
[prev in list] [next in list] [prev in thread] [next in thread] 

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