Some code style clean up.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32283 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
3f1460bcee
commit
0411a172b0
@ -44,15 +44,20 @@
|
|||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
|
|
||||||
|
|
||||||
PrintersWindow::PrintersWindow(BRect frame)
|
PrintersWindow::PrintersWindow(BRect frame)
|
||||||
: Inherited(BRect(78.0, 71.0, 561.0, 409.0), "Printers", B_TITLED_WINDOW, B_NOT_H_RESIZABLE)
|
:
|
||||||
, fSelectedPrinter(NULL)
|
Inherited(BRect(78.0, 71.0, 561.0, 409.0), "Printers", B_TITLED_WINDOW,
|
||||||
, fAddingPrinter(false)
|
B_NOT_H_RESIZABLE),
|
||||||
|
fSelectedPrinter(NULL),
|
||||||
|
fAddingPrinter(false)
|
||||||
{
|
{
|
||||||
BuildGUI();
|
BuildGUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PrintersWindow::QuitRequested()
|
|
||||||
|
bool
|
||||||
|
PrintersWindow::QuitRequested()
|
||||||
{
|
{
|
||||||
bool result = Inherited::QuitRequested();
|
bool result = Inherited::QuitRequested();
|
||||||
if (result) {
|
if (result) {
|
||||||
@ -62,7 +67,9 @@ bool PrintersWindow::QuitRequested()
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintersWindow::MessageReceived(BMessage* msg)
|
|
||||||
|
void
|
||||||
|
PrintersWindow::MessageReceived(BMessage* msg)
|
||||||
{
|
{
|
||||||
switch(msg->what)
|
switch(msg->what)
|
||||||
{
|
{
|
||||||
@ -155,7 +162,9 @@ void PrintersWindow::MessageReceived(BMessage* msg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintersWindow::BuildGUI()
|
|
||||||
|
void
|
||||||
|
PrintersWindow::BuildGUI()
|
||||||
{
|
{
|
||||||
const float boxInset = 10.0;
|
const float boxInset = 10.0;
|
||||||
BRect r(Bounds());
|
BRect r(Bounds());
|
||||||
@ -280,11 +289,15 @@ void PrintersWindow::BuildGUI()
|
|||||||
SetSizeLimits(Bounds().Width(), Bounds().Width(), Bounds().Height(), 20000);
|
SetSizeLimits(Bounds().Width(), Bounds().Width(), Bounds().Height(), 20000);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PrintersWindow::IsSelected(PrinterItem* printer) {
|
|
||||||
|
bool
|
||||||
|
PrintersWindow::IsSelected(PrinterItem* printer) {
|
||||||
return fSelectedPrinter && fSelectedPrinter == printer;
|
return fSelectedPrinter && fSelectedPrinter == printer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintersWindow::AddJob(SpoolFolder* folder, Job* job) {
|
|
||||||
|
void
|
||||||
|
PrintersWindow::AddJob(SpoolFolder* folder, Job* job) {
|
||||||
if (IsSelected(folder->Item())) {
|
if (IsSelected(folder->Item())) {
|
||||||
fJobListView->AddJob(job);
|
fJobListView->AddJob(job);
|
||||||
}
|
}
|
||||||
@ -292,7 +305,9 @@ void PrintersWindow::AddJob(SpoolFolder* folder, Job* job) {
|
|||||||
UpdatePrinterButtons();
|
UpdatePrinterButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintersWindow::RemoveJob(SpoolFolder* folder, Job* job) {
|
|
||||||
|
void
|
||||||
|
PrintersWindow::RemoveJob(SpoolFolder* folder, Job* job) {
|
||||||
if (IsSelected(folder->Item())) {
|
if (IsSelected(folder->Item())) {
|
||||||
fJobListView->RemoveJob(job);
|
fJobListView->RemoveJob(job);
|
||||||
}
|
}
|
||||||
@ -300,7 +315,9 @@ void PrintersWindow::RemoveJob(SpoolFolder* folder, Job* job) {
|
|||||||
UpdatePrinterButtons();
|
UpdatePrinterButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintersWindow::UpdateJob(SpoolFolder* folder, Job* job) {
|
|
||||||
|
void
|
||||||
|
PrintersWindow::UpdateJob(SpoolFolder* folder, Job* job) {
|
||||||
if (IsSelected(folder->Item())) {
|
if (IsSelected(folder->Item())) {
|
||||||
fJobListView->UpdateJob(job);
|
fJobListView->UpdateJob(job);
|
||||||
UpdateJobButtons();
|
UpdateJobButtons();
|
||||||
@ -309,13 +326,17 @@ void PrintersWindow::UpdateJob(SpoolFolder* folder, Job* job) {
|
|||||||
UpdatePrinterButtons();
|
UpdatePrinterButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintersWindow::UpdatePrinterButtons() {
|
|
||||||
|
void
|
||||||
|
PrintersWindow::UpdatePrinterButtons() {
|
||||||
PrinterItem* item = fPrinterListView->SelectedItem();
|
PrinterItem* item = fPrinterListView->SelectedItem();
|
||||||
fRemove->SetEnabled(item && !item->HasPendingJobs());
|
fRemove->SetEnabled(item && !item->HasPendingJobs());
|
||||||
fMakeDefault->SetEnabled(item && !item->IsActivePrinter());
|
fMakeDefault->SetEnabled(item && !item->IsActivePrinter());
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintersWindow::UpdateJobButtons() {
|
|
||||||
|
void
|
||||||
|
PrintersWindow::UpdateJobButtons() {
|
||||||
JobItem* item = fJobListView->SelectedItem();
|
JobItem* item = fJobListView->SelectedItem();
|
||||||
if (item != NULL) {
|
if (item != NULL) {
|
||||||
Job* job = item->GetJob();
|
Job* job = item->GetJob();
|
||||||
|
Loading…
Reference in New Issue
Block a user