No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

WeatherWidget.mm 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #import <UIKit/UIKit.h>
  2. @interface PSListController : UIViewController {
  3. id _specifiers;
  4. }
  5. - (id)loadSpecifiersFromPlistName:(NSString *)name target:(id)target;
  6. @end
  7. @interface WeatherWidgetListController : PSListController
  8. @end
  9. @implementation WeatherWidgetListController
  10. - (id)specifiers {
  11. if(_specifiers == nil) {
  12. _specifiers = [[self loadSpecifiersFromPlistName:@"WeatherWidget" target:self] retain];
  13. }
  14. return _specifiers;
  15. }
  16. - (void) updatePressed: (NSTimer *) timer
  17. {
  18. NSString *cmd = @"updateWeather &";
  19. system([cmd UTF8String]);
  20. UIAlertView *alert = [[UIAlertView alloc]
  21. initWithTitle: @"Settings Updated"
  22. message: @"The new settings were applied. Please, respiring to see the changes."
  23. delegate: nil
  24. cancelButtonTitle:@"OK"
  25. otherButtonTitles:nil];
  26. [alert show];
  27. [alert release];
  28. }
  29. - (void) respringPressed: (NSTimer *) timer
  30. {
  31. NSString *cmd = @"killall SpringBoard";
  32. system([cmd UTF8String]);
  33. }
  34. - (void)contactPressed:(id)specifier {
  35. [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.sygex.us/"]];
  36. }
  37. - (void)donatePressed:(id)specifier {
  38. [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=PUZEK7XWT8YRW&lc=US&item_name=sygex%2eus&item_number=Weather%20Widget&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted"]];
  39. }
  40. @end