1// 2// PRCProgress.m 3// PRICE 4// 5// Created by Riccardo Mottola on Mon Jun 21 2004. 6// Copyright (c) 2004-2012 Carduus. All rights reserved. 7// 8// This application is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 10 11#import "PRCProgress.h" 12 13 14@implementation PRCProgress 15 16- (IBAction)showProgress:(id)sender 17{ 18 if (!progressPanel) 19 [NSBundle loadNibNamed:@"ProgressPanel" owner:self]; 20 [progressPanel makeKeyAndOrderFront:nil]; 21} 22 23- (void)setTitle:(NSString *)title 24{ 25 [progressPanel setTitle:title]; 26 [progressPanel displayIfNeeded]; 27} 28 29- (void)setProgress:(double)progress 30{ 31 [progressBar setDoubleValue:progress]; 32 [progressPanel displayIfNeeded]; 33 [progressPanel flushWindowIfNeeded]; 34} 35 36- (void)setActivity:(NSString *)title 37{ 38 [activityDescription setStringValue:title]; 39 [progressPanel displayIfNeeded]; 40} 41 42- (void) dealloc 43{ 44 [progressPanel close]; 45 [super dealloc]; 46} 47 48@end 49