Adding new features

2 views
Skip to first unread message

Brian Di Palma

unread,
Aug 13, 2010, 4:04:21 AM8/13/10
to snackr-dev-svn
Hi guys,

I've tried emailing the address at the bottom of the snackr website
but I've not received a reply so I was wondering if someone could give
me an address to where I can send new features I'm adding to Snackr?

I would prefer my changes to be in main code base.

This is one patch file I have others I'm working on so if someone
could please integrate these changes it would very cool!



### Eclipse Workspace Patch 1.0
#P Snackr
Index: src/model/options/OptionsModel.as
===================================================================
--- src/model/options/OptionsModel.as (revision 150)
+++ src/model/options/OptionsModel.as (working copy)
@@ -56,6 +56,7 @@
static public const OPTION_SHOW_IN_TASKBAR: String =
"showInTaskbar";
static public const OPTION_SORT_ORDER: String = "sortOrder";
static public const OPTION_AUTOSTART_AT_LOGIN: String =
"autoStart";
+ static public const OPTION_SHOW_NO_UNREAD_ITEMS_MESSAGE: String =
"showNoUnreadItemsMessage";

static public const OPTION_VALUE_AGE_LIMIT_DAYS: String = "days";
static public const OPTION_VALUE_AGE_LIMIT_HOURS: String = "hours";
@@ -67,7 +68,7 @@
OPTION_VERSION, OPTION_TICKER_SPEED, OPTION_ALWAYS_IN_FRONT,
OPTION_AGE_LIMIT, OPTION_SCREENS_PREFIX,
OPTION_CHECK_FOR_UPDATES, OPTION_SCREEN_SIDE,
OPTION_FEED_CHECK_MIN_TIME, OPTION_TICKER_OPACITY,
OPTION_AGE_LIMIT_UNITS,
OPTION_READER_ENABLED, OPTION_READER_USER_NAME,
OPTION_READER_PASSWORD, OPTION_MINIMIZE_TO_SYSTRAY,
- OPTION_SHOWED_MINIMIZE_HINT, OPTION_SHOW_IN_TASKBAR,
OPTION_SORT_ORDER, OPTION_AUTOSTART_AT_LOGIN
+ OPTION_SHOWED_MINIMIZE_HINT, OPTION_SHOW_IN_TASKBAR,
OPTION_SORT_ORDER, OPTION_AUTOSTART_AT_LOGIN,
OPTION_SHOW_NO_UNREAD_ITEMS_MESSAGE
];

private var _sqlConnection: SQLConnection;
Index: src/ui/popups/OptionsPopup.mxml
===================================================================
--- src/ui/popups/OptionsPopup.mxml (revision 150)
+++ src/ui/popups/OptionsPopup.mxml (working copy)
@@ -259,6 +259,10 @@
autoStartCheck.selected = (value == "1");
break;
}
+ case OptionsModel.OPTION_SHOW_NO_UNREAD_ITEMS_MESSAGE: {
+ showNoUnreadItemsMessageCheck.selected = (value == "1");
+ break;
+ }
default:
break;
}
@@ -490,6 +494,10 @@
private function handleAutoStartCheckChange(event: Event): void {
_optionsModel.setValue(OptionsModel.OPTION_AUTOSTART_AT_LOGIN,
(autoStartCheck.selected ? "1" : "0"));
}
+
+ private function handleShowNoUnreadItemsMessageCheckChange(event:
Event): void {
+
_optionsModel.setValue(OptionsModel.OPTION_SHOW_NO_UNREAD_ITEMS_MESSAGE,
(showNoUnreadItemsMessageCheck.selected ? "1" : "0"));
+ }

private function handleAgeLimitCheckChange(event: Event): void {
var value: Number;
@@ -749,27 +757,28 @@
<mx:CheckBox id="showInTaskbarCheck" left="col2:10" y="104"
label="Show in taskbar and Alt-Tab menu (Windows only, requires
restart)" selected="true"
change="handleShowInTaskbarCheckChange(event)"/>
<mx:CheckBox id="minimizeToSysTrayCheck" left="col2:10" y="137"
label="Minimize to dock (OS X) / system tray (Windows)"
selected="true" change="handleMinimizeToSysTrayCheckChange(event)"/>
<mx:CheckBox id="autoStartCheck" left="col2:10" y="170"
label="Automatically start Snackr at login"
change="handleAutoStartCheckChange(event)"/>
- <mx:CheckBox left="col2:10" y="203" label="Don't show items older
than" selected="true" id="ageLimitCheck"
change="handleAgeLimitCheckChange(event)"/>
- <mx:TextInput left="col2:187" y="203" width="46"
id="ageLimitInput" valueCommit="handleAgeLimitInput(event)"/>
- <mx:ComboBox id="ageLimitUnitsCombo" labelField="text"
left="col2:237" y="203" change="handleAgeLimitUnitsChange(event)">
+ <mx:CheckBox id="showNoUnreadItemsMessageCheck" left="col2:10"
y="203" label="Show 'No unread items' message."
change="handleShowNoUnreadItemsMessageCheckChange(event)"/>
+ <mx:CheckBox left="col2:10" y="236" label="Don't show items older
than" selected="true" id="ageLimitCheck"
change="handleAgeLimitCheckChange(event)"/>
+ <mx:TextInput left="col2:187" y="236" width="46"
id="ageLimitInput" valueCommit="handleAgeLimitInput(event)"/>
+ <mx:ComboBox id="ageLimitUnitsCombo" labelField="text"
left="col2:237" y="236" change="handleAgeLimitUnitsChange(event)">
<mx:dataProvider>
<mx:Object text="hours" value="hours"/>
<mx:Object text="days" value="days"/>
</mx:dataProvider>
</mx:ComboBox>
- <mx:CheckBox left="col2:10" y="236" label="Automatically check
for updates to Snackr" selected="true" id="checkForUpdatesCheck"
change="handleUpdateCheckChange(event)"/>
- <mx:Label left="col1:0" right="col1:0" y="269" textAlign="right"
text="Pick items:"/>
- <mx:ComboBox id="pickTypeCombo" labelField="text" left="col2:10"
y="266" change="handlePickTypeComboChange(event)">
+ <mx:CheckBox left="col2:10" y="269" label="Automatically check
for updates to Snackr" selected="true" id="checkForUpdatesCheck"
change="handleUpdateCheckChange(event)"/>
+ <mx:Label left="col1:0" right="col1:0" y="302" textAlign="right"
text="Pick items:"/>
+ <mx:ComboBox id="pickTypeCombo" labelField="text" left="col2:10"
y="299" change="handlePickTypeComboChange(event)">
<mx:dataProvider>
<mx:Object text="Newest items from random feeds"
value="sortOrderRandom"/>
<mx:Object text="Newest items across all feeds"
value="sortOrderNewest"/>
</mx:dataProvider>
</mx:ComboBox>
- <mx:Label left="col1:0" right="col1:0" y="302" textAlign="right"
text="Dock to side:"/>
+ <mx:Label left="col1:0" right="col1:0" y="335" textAlign="right"
text="Dock to side:"/>
<!-- HACK: Order of strings in this combobox must be the same as
the UIUtils enum for SIDE_* -->
- <mx:ComboBox left="col2:10" y="299" id="screenSideCombo"
dataProvider="['Top','Bottom','Left','Right']" selectedIndex="1"
change="handleScreenSideComboChange(event)"/>
- <mx:Label id="screenPickerLabel" left="col1:0" right="col1:0"
y="335" textAlign="right" text="Screen:"/>
- <ScreenPicker id="screenPicker" left="col2:10" top="335"
right="10" bottom="10"/>
+ <mx:ComboBox left="col2:10" y="333" id="screenSideCombo"
dataProvider="['Top','Bottom','Left','Right']" selectedIndex="1"
change="handleScreenSideComboChange(event)"/>
+ <mx:Label id="screenPickerLabel" left="col1:0" right="col1:0"
y="368" textAlign="right" text="Screen:"/>
+ <ScreenPicker id="screenPicker" left="col2:10" top="368"
right="10" bottom="10"/>
</mx:Canvas>
<mx:Canvas label="About" width="100%" height="100%"
backgroundAlpha="0">
<utils:SmoothImage source="@Embed(source='styles/snackr-icon-
flat-128.png')" left="10" top="10" width="64" height="64"/>
Index: src/ui/windows/SnackrMainWindow.mxml
===================================================================
--- src/ui/windows/SnackrMainWindow.mxml (revision 150)
+++ src/ui/windows/SnackrMainWindow.mxml (working copy)
@@ -169,7 +169,8 @@
[OptionsModel.OPTION_SHOWED_MINIMIZE_HINT, "0"],
[OptionsModel.OPTION_SHOW_IN_TASKBAR, "1"],
[OptionsModel.OPTION_SORT_ORDER,
OptionsModel.OPTION_VALUE_SORT_ORDER_RANDOM],
- [OptionsModel.OPTION_AUTOSTART_AT_LOGIN, "0"]
+ [OptionsModel.OPTION_AUTOSTART_AT_LOGIN, "0"],
+ [OptionsModel.OPTION_SHOW_NO_UNREAD_ITEMS_MESSAGE, "0"]
];

/**
@@ -860,7 +861,7 @@
if (!
ticker.queueItems(UIUtils.convertFeedItemsToTickerItems(feedItems))) {
// Unable to find any items to show. If there are no visible
items, add an
// item indicating there are no more items.
- if (!ticker.hasVisibleItems()) {
+ if (!ticker.hasVisibleItems() &&
_optionsModel.getValue(OptionsModel.OPTION_SHOW_NO_UNREAD_ITEMS_MESSAGE)
== "1") {
var noMoreItems: TickerItemData = new TickerItemData();
noMoreItems.title = "No more unread items."
noMoreItems.description = "There are no more unread items
within the time limit you've set in Preferences. You might want to
increase the time limit, add more feeds, or click the Check Feeds Now
button in the Options popup.";

Brian Di Palma

unread,
Aug 13, 2010, 4:06:08 AM8/13/10
to snackr-dev-svn
Just copy the above into a text file called patch.txt and I think you
can use eclipse/flash builder to import it into your project
Reply all
Reply to author
Forward
0 new messages