Skip to content

Commit

Permalink
1. Cleaned up Project
Browse files Browse the repository at this point in the history
2. Redesigned Settings
3. Standardized Preferences
4. Added Alignment Options per icon
5. Other fun stuff
  • Loading branch information
Lunatik authored and Lunatik committed Apr 19, 2012
1 parent 2be9393 commit 4534bd8
Show file tree
Hide file tree
Showing 61 changed files with 1,381 additions and 350 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
build/
obj/
.theos/
20 changes: 20 additions & 0 deletions Constants.h
@@ -0,0 +1,20 @@


NSString* const ONAppIdentifierKey = @"ONAppIdentifier";
NSString* const ONApplicationsKey = @"apps";
NSString* const ONEnabledKey = @"ONEnabled";
NSString* const ONIconsKey = @"icons";
NSString* const ONIconAlignmentKey = @"IconAlignment";
NSString* const ONIconNameKey = @"IconName";
NSString* const ONIconsLeftKey = @"ONNotifIconsLeft";
NSString* const ONPreferencesFile = @"/var/mobile/Library/Preferences/com.n00neimp0rtant.opennotifier.plist";
NSString* const ONSchemaVersionKey = @"SchemaVersion";
NSString* const ONSilentKey = @"Silent";
NSString* const ONSilentIconLeftKey = @"ONSilentIconLeft";
NSString* const ONSilentModeEnabledKey = @"ONSilentModeIcon";

NSString* const IconRegexPattern = @"(?:Silver|Black)_ON_(.*?)(?:@.*|)(?:~.*|).png";
NSString* const SilverIconRegexPattern = @"Silver_ON_(.*?)(?:@.*|)(?:~.*|).png";

NSString* const IconSettingsChangedNotification = @"opennotifier.iconSettingsChanged";
NSString* const SilentModeChangedNotification = @"opennotifier.silentModeChanged";
9 changes: 0 additions & 9 deletions Layout/DEBIAN/control

This file was deleted.

Binary file not shown.
19 changes: 0 additions & 19 deletions Layout/Library/PreferenceLoader/Preferences/OpenNotifier.plist

This file was deleted.

53 changes: 50 additions & 3 deletions Makefile
@@ -1,7 +1,54 @@
include theos/makefiles/common.mk
.PHONY: before-release after-release release debugrelease

DEBUG = 1
DEBUGFLAG = -ggdb
GO_EASY_ON_ME = 1
TARGET = iphone:latest:3.2
THEOS_BUILD_DIR = build
SHARED_CFLAGS = -Iinclude
ADDITIONAL_LDFLAGS = -L./lib

TWEAK_NAME = OpenNotifier
OpenNotifier_FILES = Tweak.xm
OpenNotifier_LDFLAGS = -L./ -lstatusbar
OpenNotifier_FILES = Tweak.xm Preferences.mm
OpenNotifier_LIBRARIES = statusbar

BUNDLE_NAME = OpenNotifierSettings
OpenNotifierSettings_BUNDLE_NAME = OpenNotifier
OpenNotifierSettings_FILES = Settings.mm Preferences.mm
OpenNotifierSettings_INSTALL_PATH = /Library/PreferenceBundles
OpenNotifierSettings_FRAMEWORKS = UIKit CoreGraphics
OpenNotifierSettings_PRIVATE_FRAMEWORKS = Preferences
OpenNotifierSettings_LIBRARIES = applist substrate

ifeq ($(DEBUGPREFS),1)
DEBUGFLAG += -DDEBUGPREFS
endif

include theos/makefiles/common.mk
# THEOS_STAGING_DIR is here because of a bug
# theos needs to be fixed at some point
THEOS_STAGING_DIR = build/stage
include $(THEOS_MAKE_PATH)/tweak.mk
include $(THEOS_MAKE_PATH)/bundle.mk

clean::
rm -rf $(THEOS_BUILD_DIR)/*.deb
rm -f ./*.deb

ifneq ($(THEOS_DEVICE_IP),)
@install.exec "rm -rf com.n00neimp0rtant.opennotifier_*.deb"
endif

release::
@$(MAKE) clean before-release DEBUG="" MAKELEVEL=0 THEOS_SCHEMA="" SCHEMA="release" GO_EASY_ON_ME=0

beta::
@$(MAKE) clean before-release MAKELEVEL=0 GO_EASY_ON_ME=0 PACKAGE_NAME="beta"

before-release:: all
@$(EDITOR) layout/DEBIAN/control
@$(MAKE) after-release

after-release:: stage before-package
@echo "Making Package $(THEOS_PACKAGE_NAME) Version: $(THEOS_PACKAGE_BASE_VERSION)"
@$(FAKEROOT) -r dpkg-deb -b $(THEOS_STAGING_DIR) "$(THEOS_BUILD_DIR)/$(THEOS_PACKAGE_NAME)_$(THEOS_PACKAGE_BASE_VERSION)$(if $(PACKAGE_BUILDNAME),"+"$(PACKAGE_BUILDNAME))_$(THEOS_PACKAGE_ARCH).deb" > /dev/null 2>&1
Binary file removed OpenNotifier.deb
Binary file not shown.
51 changes: 51 additions & 0 deletions Preferences.h
@@ -0,0 +1,51 @@
#define ONSchemaVersion 1

enum
{
ONIconAlignmentDefault = 0,
ONIconAlignmentLeft = 1,
ONIconAlignmentRight = 2
};
typedef NSUInteger ONIconAlignment;

@interface ONApplicationIcon : NSObject
{
NSMutableDictionary* _dictionary;
}
@property(assign, nonatomic) ONIconAlignment alignment;
-(NSMutableDictionary*)toDictionary;
@end

@interface ONApplication : NSObject
{
NSMutableDictionary* _dictionary;
}
@property(retain, nonatomic) NSMutableDictionary* icons;
-(NSMutableDictionary*)toDictionary;
-(bool)containsIcon:(NSString*)iconName;
@end

@interface ONPreferences : NSObject
{
NSMutableDictionary* _data;
NSMutableDictionary* _applications;
}
@property(readonly, nonatomic) NSMutableDictionary* applications;
@property(assign) bool enabled;
@property(assign) bool iconsOnLeft;
@property(assign) bool silentModeEnabled;
@property(assign) bool silentIconOnLeft;

+(id)sharedInstance;

-(ONApplication*)getApplication:(NSString*)identifer;
-(void)removeApplication:(NSString*)identifer;

-(id)addIcon:(NSString*)iconName forApplication:(NSString*)identifer;
-(void)removeIcon:(NSString*)iconName fromApplication:(NSString*)identifer;
-(ONApplicationIcon*)getIcon:(NSString*)iconName forApplication:(NSString*)identifer;

-(void)reload;
-(void)save;

@end

0 comments on commit 4534bd8

Please sign in to comment.