Resolved race condition in methode Go of dialog windows.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10276 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* DialogWindow.h
|
||||
* Copyright 2004 Michael Pfeiffer. All Rights Reserved.
|
||||
*/
|
||||
|
||||
#ifndef __DIALOG_WINDOW_H
|
||||
#define __DIALOG_WINDOW_H
|
||||
|
||||
#include <OS.h>
|
||||
#include <Window.h>
|
||||
|
||||
class DialogWindow : public BWindow {
|
||||
public:
|
||||
DialogWindow(BRect frame,
|
||||
const char *title,
|
||||
window_type type,
|
||||
uint32 flags,
|
||||
uint32 workspace = B_CURRENT_WORKSPACE);
|
||||
|
||||
DialogWindow(BRect frame,
|
||||
const char *title,
|
||||
window_look look,
|
||||
window_feel feel,
|
||||
uint32 flags,
|
||||
uint32 workspace = B_CURRENT_WORKSPACE);
|
||||
|
||||
status_t Go();
|
||||
|
||||
void SetResult(status_t result);
|
||||
|
||||
void MessageReceived(BMessage* msg);
|
||||
|
||||
enum {
|
||||
kGetThreadId = 'dwti' // request thread id from window
|
||||
};
|
||||
|
||||
private:
|
||||
status_t fPreviousResult; // holds the result as long as fResult == NULL
|
||||
volatile status_t *fResult;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -7,16 +7,16 @@
|
||||
#define __JOBSETUPDLG_H
|
||||
|
||||
#include <View.h>
|
||||
#include <Window.h>
|
||||
#include "DialogWindow.h"
|
||||
|
||||
#include "JobData.h"
|
||||
#include "Halftone.h"
|
||||
#include "JSDSlider.h"
|
||||
|
||||
class BTextControl;
|
||||
class BRadioButton;
|
||||
class BCheckBox;
|
||||
class BPopUpMenu;
|
||||
class BSlider;
|
||||
class JobData;
|
||||
class PrinterData;
|
||||
class PrinterCap;
|
||||
@@ -45,8 +45,8 @@ private:
|
||||
const PrinterCap *fPrinterCap;
|
||||
BPopUpMenu *fColorType;
|
||||
BPopUpMenu *fDitherType;
|
||||
BSlider *fGamma;
|
||||
BSlider *fInkDensity;
|
||||
JSDSlider *fGamma;
|
||||
JSDSlider *fInkDensity;
|
||||
HalftoneView *fHalftone;
|
||||
BRadioButton *fAll;
|
||||
BCheckBox *fCollate;
|
||||
@@ -56,17 +56,13 @@ private:
|
||||
BPopUpMenu *fNup;
|
||||
};
|
||||
|
||||
class JobSetupDlg : public BWindow {
|
||||
class JobSetupDlg : public DialogWindow {
|
||||
public:
|
||||
JobSetupDlg(JobData *job_data, PrinterData *printer_data, const PrinterCap *printer_cap);
|
||||
~JobSetupDlg();
|
||||
virtual bool QuitRequested();
|
||||
virtual void MessageReceived(BMessage *message);
|
||||
int Go();
|
||||
|
||||
private:
|
||||
int fResult;
|
||||
long fSemaphore;
|
||||
BMessageFilter *fFilter;
|
||||
};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#define __PAGESETUPDLG_H
|
||||
|
||||
#include <View.h>
|
||||
#include <Window.h>
|
||||
#include "DialogWindow.h"
|
||||
|
||||
class BRadioButton;
|
||||
class BPopUpMenu;
|
||||
@@ -31,17 +31,12 @@ private:
|
||||
BPopUpMenu *fResolution;
|
||||
};
|
||||
|
||||
class PageSetupDlg : public BWindow {
|
||||
class PageSetupDlg : public DialogWindow {
|
||||
public:
|
||||
PageSetupDlg(JobData *job_data, PrinterData *printer_data, const PrinterCap *printer_cap);
|
||||
~PageSetupDlg();
|
||||
virtual bool QuitRequested();
|
||||
virtual void MessageReceived(BMessage *message);
|
||||
int Go();
|
||||
|
||||
private:
|
||||
int fResult;
|
||||
long fSemaphore;
|
||||
BMessageFilter *fFilter;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user