From 18ed6f04415894253ea3f621baddb1efebe87a24 Mon Sep 17 00:00:00 2001 From: Andrew McCall Date: Wed, 28 Aug 2002 18:56:44 +0000 Subject: [PATCH] Removing Time* files from Keyboard folder, and changing Jamfile back for Keyboard. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@914 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/prefs/keyboard/Jamfile | 8 ++-- src/prefs/keyboard/Time.cpp | 70 ---------------------------- src/prefs/keyboard/Time.h | 29 ------------ src/prefs/keyboard/Time.rsrc | Bin 6570 -> 0 bytes src/prefs/keyboard/TimeMessages.h | 17 ------- src/prefs/keyboard/TimeSettings.cpp | 63 ------------------------- src/prefs/keyboard/TimeSettings.h | 20 -------- src/prefs/keyboard/TimeView.cpp | 25 ---------- src/prefs/keyboard/TimeView.h | 25 ---------- src/prefs/keyboard/TimeWindow.cpp | 70 ---------------------------- src/prefs/keyboard/TimeWindow.h | 24 ---------- 11 files changed, 4 insertions(+), 347 deletions(-) delete mode 100644 src/prefs/keyboard/Time.cpp delete mode 100644 src/prefs/keyboard/Time.h delete mode 100644 src/prefs/keyboard/Time.rsrc delete mode 100644 src/prefs/keyboard/TimeMessages.h delete mode 100644 src/prefs/keyboard/TimeSettings.cpp delete mode 100644 src/prefs/keyboard/TimeSettings.h delete mode 100644 src/prefs/keyboard/TimeView.cpp delete mode 100644 src/prefs/keyboard/TimeView.h delete mode 100644 src/prefs/keyboard/TimeWindow.cpp delete mode 100644 src/prefs/keyboard/TimeWindow.h diff --git a/src/prefs/keyboard/Jamfile b/src/prefs/keyboard/Jamfile index 20606dc999..fc651a7db6 100644 --- a/src/prefs/keyboard/Jamfile +++ b/src/prefs/keyboard/Jamfile @@ -1,7 +1,7 @@ -SubDir OBOS_TOP src prefs time ; +SubDir OBOS_TOP src prefs keyboard ; -AddResources Time : Time.rsrc ; +AddResources Keyboard : Keyboard.rsrc ; -Preference Time : Time.cpp TimeSettings.cpp TimeView.cpp TimeWindow.cpp ; +Preference Keyboard : Keyboard.cpp KeyboardSettings.cpp KeyboardView.cpp KeyboardWindow.cpp ; -LinkSharedOSLibs Time : translation be root ; +LinkSharedOSLibs Keyboard : translation be root ; diff --git a/src/prefs/keyboard/Time.cpp b/src/prefs/keyboard/Time.cpp deleted file mode 100644 index 68f2de2777..0000000000 --- a/src/prefs/keyboard/Time.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Time.cpp - * Time mccall@digitalparadise.co.uk - * - */ - -#include -#include - -#include "Time.h" -#include "TimeWindow.h" -#include "TimeSettings.h" -#include "TimeMessages.h" - -const char TimeApplication::kTimeApplicationSig[] = "application/x-vnd.OpenBeOS-TIME"; - -int main(int, char**) -{ - TimeApplication myApplication; - - myApplication.Run(); - - return(0); -} - -TimeApplication::TimeApplication() - :BApplication(kTimeApplicationSig) -{ - - TimeWindow *window; - - fSettings = new TimeSettings(); - - window = new TimeWindow(); - -} - -void -TimeApplication::MessageReceived(BMessage *message) -{ - switch(message->what) { - case ERROR_DETECTED: - { - BAlert *errorAlert = new BAlert("Error", "Something has gone wrong!","OK",NULL,NULL,B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_WARNING_ALERT); - errorAlert->Go(); - be_app->PostMessage(B_QUIT_REQUESTED); - } - break; - default: - BApplication::MessageReceived(message); - break; - } -} - -void -TimeApplication::SetWindowCorner(BPoint corner) -{ - fSettings->SetWindowCorner(corner); -} - -void -TimeApplication::AboutRequested(void) -{ - (new BAlert("about", "...by Andrew Edward McCall", "Dig Deal"))->Go(); -} - -TimeApplication::~TimeApplication() -{ - delete fSettings; -} \ No newline at end of file diff --git a/src/prefs/keyboard/Time.h b/src/prefs/keyboard/Time.h deleted file mode 100644 index 680d1dc627..0000000000 --- a/src/prefs/keyboard/Time.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef TIME_H -#define TIME_H - -#include - -#include "TimeWindow.h" -#include "TimeSettings.h" - -class TimeApplication : public BApplication -{ -public: - TimeApplication(); - virtual ~TimeApplication(); - - void MessageReceived(BMessage *message); - BPoint WindowCorner() const {return fSettings->WindowCorner(); } - void SetWindowCorner(BPoint corner); - - void AboutRequested(void); - -private: - - static const char kTimeApplicationSig[]; - - TimeSettings *fSettings; - -}; - -#endif \ No newline at end of file diff --git a/src/prefs/keyboard/Time.rsrc b/src/prefs/keyboard/Time.rsrc deleted file mode 100644 index 6abd9c5ae7d8928ecf9a6c2dd0fda2fc649c0fe7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6570 zcmeI1%WqU=7{=d9ks2=LQVcO(YK&1+pdrQ>F**uh3 z53Jt<>-RwAJ)rYQMJT4mm0hz!H{pL(DoYw!A(Xo_wHZlS9xLRQQFNnL6sif9xvCID zjk;xQZqA0W2`i|fx8*?45=_%q`CH50WelPf)T+0( zY5_I%oLK`ynRLQAvv=IwU+W9Io^!cY>D8p}gy1e&96F!6#2p4SBM^naIsB~fUlXu54U8&p9l?yxe&SqMPST5Fq%SjWx7ne3fzR zXD!AsT*jccmbtyR{8+=0g~N!(+GQB)1a$GkfkuZxO2Y%${w`kYcb4Dh>nz(>exE-G z=Sje8eR$umGhW__WnSQS@$Uh_?Dwpo3-!zDA)?vJdW{q$XD=-+&CbrQlvQhDHUihI zlqH%fc3M*7x!x#uf%Y=Ioz(4+x23j)g@xOHl=Nf3mu;SF$Swpw@#Lo# zzXkcJFF&>NTOhZKzWmgd+DfHTl#`!w4cSugQ(t~+@hizsefg=CpR`T%<)^mPwz#+$ z<>aSaLv}IvsV_gZ_$|s$efg=CpR~K_%TH~o?aGyGU-@^9@^@k*1fl$$`27Y}6n!V^ zw;zFPUHzR%HXT(Lhf3BcAP2VgT!U@ia``&Rv{CVeUO#2Ty4ZMR0P0YQK-ygrL-((kQzpbygt*P~l z@`Ng<{g2RByScB9-YPLNH8nmqIx;ghIng@1@9e~z`}?Qz6WM%!Zr@-}UuUe6!9752 znbABrR>;SUwRZ+j<(p%V>HO6A$Y{QhpO|SrIXT@tLs7oXQ`7mA`RV+`DBY2X{P_O0 zPw+oyHt|FA{a_Dx06YjD29JP8!DHZY@C0}Yw19n}6&wIhgJ;0A;5qO-cmcc!4uLG_ z0A1iPcnS1^BVYg=1v&6Ccm*5>uYuRW8(;{GfD>R8)0=y5pG-qR7|Qh|Kaw097--Yv+SiVRa;)=ct|zsVu85{TzKsd3tGBH?S>m -#include -#include -#include -#include -#include - -#include "TimeSettings.h" -#include "TimeMessages.h" - -const char TimeSettings::kTimeSettingsFile[] = "Time_settings"; - -TimeSettings::TimeSettings() -{ - BPath path; - - if (find_directory(B_USER_SETTINGS_DIRECTORY,&path) == B_OK) { - path.Append(kTimeSettingsFile); - BFile file(path.Path(), B_READ_ONLY); - if (file.InitCheck() == B_OK) { - // Now read in the data - if (file.Read(&fCorner, sizeof(BPoint)) != sizeof(BPoint)) { - fCorner.x=50; - fCorner.y=50; - }; - } - else { - fCorner.x=50; - fCorner.y=50; - } - } - else - be_app->PostMessage(ERROR_DETECTED); -} - -TimeSettings::~TimeSettings() -{ - BPath path; - - if (find_directory(B_USER_SETTINGS_DIRECTORY,&path) < B_OK) - return; - - path.Append(kTimeSettingsFile); - - BFile file(path.Path(), B_WRITE_ONLY | B_CREATE_FILE); - if (file.InitCheck() == B_OK) { - file.Write(&fCorner, sizeof(BPoint)); - } - - -} - -void -TimeSettings::SetWindowCorner(BPoint corner) -{ - fCorner=corner; -} \ No newline at end of file diff --git a/src/prefs/keyboard/TimeSettings.h b/src/prefs/keyboard/TimeSettings.h deleted file mode 100644 index 3668fbc7ff..0000000000 --- a/src/prefs/keyboard/TimeSettings.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef TIME_SETTINGS_H_ -#define TIME_SETTINGS_H_ - -#include - -class TimeSettings{ -public : - TimeSettings(); - ~TimeSettings(); - - BPoint WindowCorner() const { return fCorner; } - void SetWindowCorner(BPoint corner); - -private: - static const char kTimeSettingsFile[]; - BPoint fCorner; - -}; - -#endif \ No newline at end of file diff --git a/src/prefs/keyboard/TimeView.cpp b/src/prefs/keyboard/TimeView.cpp deleted file mode 100644 index 8cb8d72e42..0000000000 --- a/src/prefs/keyboard/TimeView.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/* - - TimeView.cpp - -*/ -#include - -#include "TimeView.h" -#include "TimeMessages.h" - -TimeView::TimeView(BRect rect) - : BBox(rect, "time_view", - B_FOLLOW_ALL, B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP, - B_PLAIN_BORDER) -{ - - SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); - -} - -void TimeView::Draw(BRect updateFrame) -{ - inherited::Draw(updateFrame); - -} \ No newline at end of file diff --git a/src/prefs/keyboard/TimeView.h b/src/prefs/keyboard/TimeView.h deleted file mode 100644 index 9ca86d85e0..0000000000 --- a/src/prefs/keyboard/TimeView.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - - TimeView.h - -*/ - -#ifndef TIME_VIEW_H -#define TIME_VIEW_H - - -#include - -class TimeView : public BBox -{ -public: - typedef BBox inherited; - - TimeView(BRect frame); - virtual void Draw(BRect frame); - -private: - ; -}; - -#endif diff --git a/src/prefs/keyboard/TimeWindow.cpp b/src/prefs/keyboard/TimeWindow.cpp deleted file mode 100644 index 87482e6c98..0000000000 --- a/src/prefs/keyboard/TimeWindow.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - * TimeWindow.cpp - * Time mccall@digitalparadise.co.uk - * - */ - -#include -#include -#include - -#include "TimeMessages.h" -#include "TimeWindow.h" -#include "TimeView.h" -#include "Time.h" - -#define TIME_WINDOW_RIGHT 332 -#define TIME_WINDOW_BOTTTOM 208 - -TimeWindow::TimeWindow() - : BWindow(BRect(0,0,TIME_WINDOW_RIGHT,TIME_WINDOW_BOTTTOM), "Time & Date", B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE ) -{ - BScreen screen; - BSlider *slider=NULL; - - MoveTo(dynamic_cast(be_app)->WindowCorner()); - - // Code to make sure that the window doesn't get drawn off screen... - if (!(screen.Frame().right >= Frame().right && screen.Frame().bottom >= Frame().bottom)) - MoveTo((screen.Frame().right-Bounds().right)*.5,(screen.Frame().bottom-Bounds().bottom)*.5); - - BuildView(); - AddChild(fView); - - Show(); - -} - -void -TimeWindow::BuildView() -{ - fView = new TimeView(Bounds()); -} - -bool -TimeWindow::QuitRequested() -{ - - dynamic_cast(be_app)->SetWindowCorner(BPoint(Frame().left,Frame().top)); - - be_app->PostMessage(B_QUIT_REQUESTED); - - return(true); -} - -void -TimeWindow::MessageReceived(BMessage *message) -{ - - switch(message->what) { - default: - BWindow::MessageReceived(message); - break; - } - -} - -TimeWindow::~TimeWindow() -{ - -} \ No newline at end of file diff --git a/src/prefs/keyboard/TimeWindow.h b/src/prefs/keyboard/TimeWindow.h deleted file mode 100644 index f615d417d7..0000000000 --- a/src/prefs/keyboard/TimeWindow.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef TIME_WINDOW_H -#define TIME_WINDOW_H - -#include - -#include "TimeSettings.h" -#include "TimeView.h" - -class TimeWindow : public BWindow -{ -public: - TimeWindow(); - ~TimeWindow(); - - bool QuitRequested(); - void MessageReceived(BMessage *message); - void BuildView(); - -private: - TimeView *fView; - -}; - -#endif