[haiku-commits] haiku: hrev49036 - src/apps/showimage

  • From: janus2@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 13 Apr 2015 22:09:48 +0200 (CEST)

hrev49036 adds 1 changeset to branch 'master'
old head: 384ae40aa53b91a9a3e55f8a366139f03dfdc9d2
new head: 3000afd7b1a6cabe86dfe4280e2d65c3223c378e
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=3000afd7b1a6+%5E384ae40aa53b

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

3000afd7b1a6: ShowImage: Remember save location

* Fixes #6766.

[ Janus <janus2@xxxxxxxxx> ]

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

Revision: hrev49036
Commit: 3000afd7b1a6cabe86dfe4280e2d65c3223c378e
URL: http://cgit.haiku-os.org/haiku/commit/?id=3000afd7b1a6
Author: Janus <janus2@xxxxxxxxx>
Date: Mon Apr 13 20:00:18 2015 UTC

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

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

1 file changed, 16 insertions(+)
src/apps/showimage/ShowImageWindow.cpp | 16 ++++++++++++++++

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

diff --git a/src/apps/showimage/ShowImageWindow.cpp
b/src/apps/showimage/ShowImageWindow.cpp
index 982c1a3..e5ca3aa 100644
--- a/src/apps/showimage/ShowImageWindow.cpp
+++ b/src/apps/showimage/ShowImageWindow.cpp
@@ -1116,6 +1116,14 @@ ShowImageWindow::_SaveAs(BMessage* message)
if (!fSavePanel)
return;

+ // Retrieve save directory from settings;
+ ShowImageSettings* settings = my_app->Settings();
+ if (settings->Lock()) {
+ fSavePanel->SetPanelDirectory(
+ settings->GetString("SaveDirectory", NULL));
+ settings->Unlock();
+ }
+
fSavePanel->Window()->SetWorkspaces(B_CURRENT_WORKSPACE);
fSavePanel->Show();
}
@@ -1164,6 +1172,14 @@ ShowImageWindow::_SaveToFile(BMessage* message)
// Write out the image file
BDirectory dir(&dirRef);
fImageView->SaveToFile(&dir, filename, NULL, &outFormat[i]);
+
+ // Store Save directory in settings;
+ ShowImageSettings* settings = my_app->Settings();
+ if (settings->Lock()) {
+ BPath path(&dirRef);
+ settings->SetString("SaveDirectory", path.Path());
+ settings->Unlock();
+ }
}




Other related posts:

  • » [haiku-commits] haiku: hrev49036 - src/apps/showimage - janus2