|
From: CVS C. to T. <the...@li...> - 2011-01-16 15:01:21
|
Revision: 613
http://themis.svn.sourceforge.net/themis/?rev=613&view=rev
Author: mark_hellegers
Date: 2011-01-16 15:01:15 +0000 (Sun, 16 Jan 2011)
Log Message:
-----------
Moved the code to get the checkbox value to a separate function.
Modified Paths:
--------------
trunk/themis/framework/PrefsWin.cpp
trunk/themis/framework/PrefsWin.h
Modified: trunk/themis/framework/PrefsWin.cpp
===================================================================
--- trunk/themis/framework/PrefsWin.cpp 2011-01-16 14:47:04 UTC (rev 612)
+++ trunk/themis/framework/PrefsWin.cpp 2011-01-16 15:01:15 UTC (rev 613)
@@ -90,6 +90,18 @@
}
+bool PrefsWin :: GetCheckBoxValue(BMessage * aMessage) {
+
+ BCheckBox * checkBox;
+ aMessage->FindPointer("source", (void**)&checkBox);
+ bool result = false;
+ if(checkBox->Value() == 1)
+ result = true;
+
+ return result;
+
+}
+
void PrefsWin :: CreatePrefViews(BMessage * aPluginList) {
printf("Creating preferences views\n");
@@ -184,12 +196,7 @@
case IZ_CHECKBOX: {
printf("PREFS: IZ_CHECKBOX\n");
- BCheckBox* cbox;
- msg->FindPointer("source", ( void** )&cbox);
- bool value = false;
- if(cbox->Value() == 1)
- value = true;
-
+ bool value = GetCheckBoxValue(msg);
AppSettings->ReplaceBool(kPrefsIntelligentZoom, value);
SaveAppSettings();
@@ -200,12 +207,7 @@
{
printf("PREFS: SHOWTYPEAHEAD_CHECKBOX\n");
- BCheckBox* cbox;
- msg->FindPointer("source", ( void** )&cbox);
- bool value = false;
- if(cbox->Value() == 1)
- value = true;
-
+ bool value = GetCheckBoxValue(msg);
AppSettings->ReplaceBool(kPrefsShowTypeAheadWindow, value);
SaveAppSettings();
@@ -215,12 +217,7 @@
case SHOWTABS_CHECKBOX: {
printf("PREFS: SHOWTABS_CHECKBOX\n");
- BCheckBox* cbox;
- msg->FindPointer("source", ( void** )&cbox);
- bool value = false;
- if(cbox->Value() == 1)
- value = true;
-
+ bool value = GetCheckBoxValue(msg);
AppSettings->ReplaceBool(kPrefsShowTabsAtStartup, value);
SaveAppSettings();
@@ -230,12 +227,7 @@
case TABSBACKGROUND_CHECKBOX: {
printf("PREFS: TABSBACKGROUND_CHECKBOX\n");
- BCheckBox* cbox;
- msg->FindPointer("source", ( void** )&cbox);
- bool value = false;
- if(cbox->Value() == 1)
- value = true;
-
+ bool value = GetCheckBoxValue(msg);
AppSettings->ReplaceBool(kPrefsOpenTabsInBackground, value);
SaveAppSettings();
@@ -245,12 +237,7 @@
case TABSBLANK_CHECKBOX: {
printf("PREFS: TABSBACKGROUND_CHECKBOX\n");
- BCheckBox* cbox;
- msg->FindPointer("source", ( void** )&cbox);
- bool value = false;
- if(cbox->Value() == 1)
- value = true;
-
+ bool value = GetCheckBoxValue(msg);
AppSettings->ReplaceBool(kPrefsOpenBlankTargetInTab, value);
SaveAppSettings();
Modified: trunk/themis/framework/PrefsWin.h
===================================================================
--- trunk/themis/framework/PrefsWin.h 2011-01-16 14:47:04 UTC (rev 612)
+++ trunk/themis/framework/PrefsWin.h 2011-01-16 15:01:15 UTC (rev 613)
@@ -29,6 +29,7 @@
BRect fViewFrame;
vector<BView *> mPrefViews;
+ bool GetCheckBoxValue(BMessage * aMessage);
void CreatePrefViews(BMessage * aPluginList);
void SaveAppSettings();
@@ -89,7 +90,7 @@
const char * fName;
BBitmap * fBitmap;
float fFontHeight;
-
+
public:
PrefsListItem(const char* name,
const uint8* bitmapdata);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|