[haiku-commits] haiku: hrev43389 - src/apps/terminal

  • From: zharik@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 3 Dec 2011 20:02:02 +0100 (CET)

hrev43389 adds 1 changeset to branch 'master'
old head: 7418dbd90806ceb5702ad20c73b143928b75e212
new head: d79b659e2686c66740e0609427b608efbf889238

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

d79b659: Terminal:Fix printing and windows settings path.
  * Fixes #7986 - behavior of Print command fixed to be consistent
    with other application, like StyledEdit. This change
    display the print job settings dialog instead of "Printing
    was cancelled" alert;
  * Fixes #6998 - the path to storing windows settings changed from
    ~/config/settings/Terminal_windows to ~/c/s/Terminal/Windows;
  
    This patch was created during GCI 2011 by doctorkohaku.
    Thanks for the contribution!

                                        [ Siarzhuk Zharski <zharik@xxxxxx> ]

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

Revision:    hrev43389
Commit:      d79b659e2686c66740e0609427b608efbf889238
URL:         http://cgit.haiku-os.org/haiku/commit/?id=d79b659
Author:      Siarzhuk Zharski <zharik@xxxxxx>
Date:        Sat Dec  3 18:47:38 2011 UTC

Ticket:      https://dev.haiku-os.org/ticket/6998
Ticket:      https://dev.haiku-os.org/ticket/7986

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

1 files changed, 11 insertions(+), 11 deletions(-)
src/apps/terminal/TermWindow.cpp |   22 +++++++++++-----------

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

diff --git a/src/apps/terminal/TermWindow.cpp b/src/apps/terminal/TermWindow.cpp
index 31307d1..8c67d4f 100644
--- a/src/apps/terminal/TermWindow.cpp
+++ b/src/apps/terminal/TermWindow.cpp
@@ -517,7 +517,11 @@ TermWindow::_GetWindowPositionFile(BFile* file, uint32 
openMode)
        if (status != B_OK)
                return status;
 
-       status = path.Append("Terminal_windows");
+       status = path.Append("Terminal");
+       if (status != B_OK)
+               return status;
+
+       status = path.Append("Windows");
        if (status != B_OK)
                return status;
 
@@ -1035,23 +1039,19 @@ TermWindow::_DoPageSetup()
 void
 TermWindow::_DoPrint()
 {
-       if (!fPrintSettings || _DoPageSetup() != B_OK) {
-               BAlert* alert = new BAlert(B_TRANSLATE("Cancel"),
-                       B_TRANSLATE("Print cancelled."), B_TRANSLATE("OK"));
-               alert->SetShortcut(0, B_ESCAPE);
-               alert->Go();
-               return;
-       }
-
        BPrintJob job("Print");
-       job.SetSettings(new BMessage(*fPrintSettings));
+       if (fPrintSettings)
+               job.SetSettings(new BMessage(*fPrintSettings));
+
+       if (job.ConfigJob() != B_OK)
+               return;
 
        BRect pageRect = job.PrintableRect();
        BRect curPageRect = pageRect;
 
        int pHeight = (int)pageRect.Height();
        int pWidth = (int)pageRect.Width();
-       float w,h;
+       float w, h;
        _ActiveTermView()->GetFrameSize(&w, &h);
        int xPages = (int)ceil(w / pWidth);
        int yPages = (int)ceil(h / pHeight);


Other related posts: