[haiku-commits] haiku: hrev48434 - src/add-ons/kernel/bus_managers/ps2 src/kits/tracker src/preferences/filetypes headers/os/storage

  • From: pulkomandy@xxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 4 Dec 2014 09:28:10 +0100 (CET)

hrev48434 adds 3 changesets to branch 'master'
old head: 049e8f6fbdcae27f2dad3420e463e048ed1613d3
new head: db7fc944bda45a7db4b13670c9f743e4144e448d
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=db7fc94+%5E049e8f6

----------------------------------------------------------------------------

14c42c3: Synaptics: remove useless delay.
  
  As pointed by Axel and explained in Synaptic docs, the touchpad should
  delay the first command itself until it's ready, so an arbitrary delay
  should not be needed after reset.
  
  Note: I don't have a touchpad on my machine. Please test this :)

529cd17: BFilePanel: allow to change the node flavors
  
  There doesn't seem to be anything ini the implementation that would
  cause a problem, as long as you don't try to change this while the
  window is already open.

db7fc94: FileTypes: disallow directories only where it makes sense.
  
  Better fix for #8805.

                                 [ Adrien Destugues <pulkomandy@xxxxxxxxx> ]

----------------------------------------------------------------------------

8 files changed, 27 insertions(+), 7 deletions(-)
headers/os/storage/FilePanel.h                        |  1 +
src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.cpp | 10 +++++-----
src/kits/tracker/FilePanel.cpp                        | 11 +++++++++++
src/kits/tracker/FilePanelPriv.h                      |  1 +
src/kits/tracker/PoseView.cpp                         |  2 --
src/preferences/filetypes/FileTypeWindow.cpp          |  2 ++
src/preferences/filetypes/FileTypes.cpp               |  6 ++++++
src/preferences/filetypes/FileTypesWindow.cpp         |  1 +

############################################################################

Commit:      14c42c37834c22ec722b28bb5462d494dac9b23c
URL:         http://cgit.haiku-os.org/haiku/commit/?id=14c42c3
Author:      Adrien Destugues <pulkomandy@xxxxxxxxx>
Date:        Thu Dec  4 07:39:13 2014 UTC

Synaptics: remove useless delay.

As pointed by Axel and explained in Synaptic docs, the touchpad should
delay the first command itself until it's ready, so an arbitrary delay
should not be needed after reset.

Note: I don't have a touchpad on my machine. Please test this :)

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.cpp 
b/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.cpp
index cba23a3..81cffc1 100644
--- a/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.cpp
+++ b/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.cpp
@@ -283,16 +283,16 @@ probe_synaptics(ps2_dev *dev)
 
        // We reset the device here because it may have been left in a confused
        // state by a previous probing attempt. Some synaptics touchpads are 
known
-       // to lockup when we attempt to detect them as IBM trackoints.
+       // to lockup when we attempt to detect them as IBM trackpoints.
        ps2_reset_mouse(dev);
 
-       // And after resetting we must wait a little for the device to become 
ready
-       // again...
-       snooze(400000);
-
+       // Request "Identify touchpad"
+       // The touchpad will delay this, until it's ready and calibrated.
        status = send_touchpad_arg(dev, 0x00);
        if (status != B_OK)
                return status;
+
+       // "Status request" (executes "Identify touchpad")
        status = ps2_dev_command(dev, 0xE9, NULL, 0, val, 3);
        if (status != B_OK)
                return status;

############################################################################

Commit:      529cd177b573aaba391c8adc9c9f5ad76a14bf81
URL:         http://cgit.haiku-os.org/haiku/commit/?id=529cd17
Author:      Adrien Destugues <pulkomandy@xxxxxxxxx>
Date:        Thu Dec  4 08:26:49 2014 UTC

BFilePanel: allow to change the node flavors

There doesn't seem to be anything ini the implementation that would
cause a problem, as long as you don't try to change this while the
window is already open.

----------------------------------------------------------------------------

diff --git a/headers/os/storage/FilePanel.h b/headers/os/storage/FilePanel.h
index 955ac18..ded44de 100644
--- a/headers/os/storage/FilePanel.h
+++ b/headers/os/storage/FilePanel.h
@@ -67,6 +67,7 @@ class BFilePanel {
                void                    SetRefFilter(BRefFilter* filter);
                void                    SetSaveText(const char* text);
                void                    SetButtonLabel(file_panel_button 
button, const char* label);
+               void                    SetNodeFlavors(uint32 flavors);
 
                void                    SetPanelDirectory(const BEntry* 
newDirectory);
                void                    SetPanelDirectory(const BDirectory* 
newDirectory);
diff --git a/src/kits/tracker/FilePanel.cpp b/src/kits/tracker/FilePanel.cpp
index 0b4b7c4..f0ffeab 100644
--- a/src/kits/tracker/FilePanel.cpp
+++ b/src/kits/tracker/FilePanel.cpp
@@ -264,6 +264,17 @@ BFilePanel::SetButtonLabel(file_panel_button button, const 
char* text)
 
 
 void
+BFilePanel::SetNodeFlavors(uint32 flavors)
+{
+       AutoLock<BWindow> lock(fWindow);
+       if (!lock)
+               return;
+
+       static_cast<TFilePanel*>(fWindow)->SetNodeFlavors(flavors);
+}
+
+
+void
 BFilePanel::GetPanelDirectory(entry_ref* ref) const
 {
        AutoLock<BWindow> lock(fWindow);
diff --git a/src/kits/tracker/FilePanelPriv.h b/src/kits/tracker/FilePanelPriv.h
index 84b1432..fc24470 100644
--- a/src/kits/tracker/FilePanelPriv.h
+++ b/src/kits/tracker/FilePanelPriv.h
@@ -78,6 +78,7 @@ public:
 
        void SetClientObject(BFilePanel*);
        void SetRefFilter(BRefFilter*);
+       void SetNodeFlavors(uint32 nodeFlavors) { fNodeFlavors = nodeFlavors; }
        void SetSaveText(const char* text);
        void SetButtonLabel(file_panel_button, const char* text);
        void SetTo(const entry_ref* ref);
diff --git a/src/kits/tracker/PoseView.cpp b/src/kits/tracker/PoseView.cpp
index ae04731..486c3c8 100644
--- a/src/kits/tracker/PoseView.cpp
+++ b/src/kits/tracker/PoseView.cpp
@@ -85,14 +85,12 @@ All rights reserved.
 #include "Cursors.h"
 #include "DeskWindow.h"
 #include "DesktopPoseView.h"
-#include "DirMenu.h"
 #include "FilePanelPriv.h"
 #include "FSClipboard.h"
 #include "FSUtils.h"
 #include "FunctionObject.h"
 #include "MimeTypes.h"
 #include "Navigator.h"
-#include "NavMenu.h"
 #include "Pose.h"
 #include "InfoWindow.h"
 #include "Utilities.h"

############################################################################

Revision:    hrev48434
Commit:      db7fc944bda45a7db4b13670c9f743e4144e448d
URL:         http://cgit.haiku-os.org/haiku/commit/?id=db7fc94
Author:      Adrien Destugues <pulkomandy@xxxxxxxxx>
Date:        Thu Dec  4 08:28:05 2014 UTC

Ticket:      https://dev.haiku-os.org/ticket/8805

FileTypes: disallow directories only where it makes sense.

Better fix for #8805.

----------------------------------------------------------------------------

diff --git a/src/preferences/filetypes/FileTypeWindow.cpp 
b/src/preferences/filetypes/FileTypeWindow.cpp
index 433c073..993d8a5 100644
--- a/src/preferences/filetypes/FileTypeWindow.cpp
+++ b/src/preferences/filetypes/FileTypeWindow.cpp
@@ -360,6 +360,7 @@ FileTypeWindow::MessageReceived(BMessage* message)
                        panel.AddString("title", B_TRANSLATE("Select same type 
as"));
                        panel.AddInt32("message", kMsgSameTypeAsOpened);
                        panel.AddMessenger("target", this);
+                       panel.AddBool("allowDirs", true);
 
                        be_app_messenger.SendMessage(&panel);
                        break;
@@ -404,6 +405,7 @@ FileTypeWindow::MessageReceived(BMessage* message)
                                B_TRANSLATE("Select same preferred application 
as"));
                        panel.AddInt32("message", kMsgSamePreferredAppAsOpened);
                        panel.AddMessenger("target", this);
+                       panel.AddBool("allowDirs", true);
 
                        be_app_messenger.SendMessage(&panel);
                        break;
diff --git a/src/preferences/filetypes/FileTypes.cpp 
b/src/preferences/filetypes/FileTypes.cpp
index 71a89d2..e36a257 100644
--- a/src/preferences/filetypes/FileTypes.cpp
+++ b/src/preferences/filetypes/FileTypes.cpp
@@ -385,6 +385,12 @@ FileTypes::MessageReceived(BMessage* message)
                                title.Append(subTitle);
                        }
 
+                       uint32 flavors = B_FILE_NODE;
+                       if (message->FindBool("allowDirs"))
+                               flavors |= B_DIRECTORY_NODE;
+                       fFilePanel->SetNodeFlavors(flavors);
+
+
                        fFilePanel->SetMessage(new BMessage(what));
                        fFilePanel->Window()->SetTitle(title.String());
                        fFilePanel->SetTarget(target);
diff --git a/src/preferences/filetypes/FileTypesWindow.cpp 
b/src/preferences/filetypes/FileTypesWindow.cpp
index a429f3c..310adf8 100644
--- a/src/preferences/filetypes/FileTypesWindow.cpp
+++ b/src/preferences/filetypes/FileTypesWindow.cpp
@@ -826,6 +826,7 @@ FileTypesWindow::MessageReceived(BMessage* message)
                                B_TRANSLATE("Select same preferred application 
as"));
                        panel.AddInt32("message", kMsgSamePreferredAppAsOpened);
                        panel.AddMessenger("target", this);
+                       panel.AddBool("allowDirs", true);
 
                        be_app_messenger.SendMessage(&panel);
                        break;


Other related posts:

  • » [haiku-commits] haiku: hrev48434 - src/add-ons/kernel/bus_managers/ps2 src/kits/tracker src/preferences/filetypes headers/os/storage - pulkomandy