]> git.sesse.net Git - vlc/commitdiff
* modules/gui/beos/MessagesWindow.cpp: fixed a nasty bug
authorEric Petit <titer@videolan.org>
Wed, 7 May 2003 17:27:30 +0000 (17:27 +0000)
committerEric Petit <titer@videolan.org>
Wed, 7 May 2003 17:27:30 +0000 (17:27 +0000)
 * modules/gui/beos/PreferencesWindow.*: now you can save preferences

modules/gui/beos/MessagesWindow.cpp
modules/gui/beos/PreferencesWindow.cpp
modules/gui/beos/PreferencesWindow.h

index 8200927a43d295706ab095b47672ce9a88b52904..5de3377a65e80a15dad0d43c7a7a41e1f59979ab 100644 (file)
@@ -2,7 +2,7 @@
  * MessagesWindow.cpp: beos interface
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: MessagesWindow.cpp,v 1.7 2003/02/10 15:23:46 titer Exp $
+ * $Id: MessagesWindow.cpp,v 1.8 2003/05/07 17:27:30 titer Exp $
  *
  * Authors: Eric Petit <titer@videolan.org>
  *
@@ -45,9 +45,11 @@ MessagesWindow::MessagesWindow( intf_thread_t * p_intf,
                B_NOT_ZOOMABLE )
 {
        this->p_intf = p_intf;
+
+    SetSizeLimits( 200, 2000, 200, 2000 );
        
        BRect rect, textRect;
-       
+
        rect = Bounds();
        rect.right -= B_V_SCROLL_BAR_WIDTH;
        textRect = rect;
@@ -55,6 +57,7 @@ MessagesWindow::MessagesWindow( intf_thread_t * p_intf,
        fMessagesView = new BTextView( rect, "messages", textRect,
                                       B_FOLLOW_ALL, B_WILL_DRAW );
        fMessagesView->MakeEditable( false );
+       fMessagesView->MakeSelectable( false );
        fMessagesView->SetStylable( true );
        fScrollView = new BScrollView( "scrollview", fMessagesView, B_WILL_DRAW,
                                       B_FOLLOW_ALL, false, true );
@@ -183,6 +186,7 @@ static int UpdateMessages( intf_thread_t * p_intf )
                 }
             
                 /* Scroll at the end */
+                
                 if( scrollBar->LockLooper() )
                 {
                     float min, max;
index f129a57ea92aa1fa76788a9ac9ee9abb7f83086f..27bf483b81edacb958ea36f1980eca57cf08ae6b 100644 (file)
@@ -2,7 +2,7 @@
  * PreferencesWindow.cpp: beos interface
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: PreferencesWindow.cpp,v 1.17 2003/05/07 16:47:10 titer Exp $
+ * $Id: PreferencesWindow.cpp,v 1.18 2003/05/07 17:27:30 titer Exp $
  *
  * Authors: Eric Petit <titer@videolan.org>
  *
@@ -82,6 +82,9 @@ PreferencesWindow::PreferencesWindow( intf_thread_t * p_interface,
       fConfigScroll( NULL ),
       p_intf( p_interface )
 {
+    SetSizeLimits( PREFS_WINDOW_WIDTH, PREFS_WINDOW_WIDTH,
+                   200, 2000 );
+
     BRect rect;
 
     /* The "background" view */
@@ -272,15 +275,20 @@ PreferencesWindow::PreferencesWindow( intf_thread_t * p_interface,
     rect.InsetBy( 10, 10 );
     rect.left = rect.right - 80;
     rect.top = rect.bottom - 25;
-    button = new BButton( rect, "", _("OK"), new BMessage( PREFS_OK ),
+    button = new BButton( rect, "", _("Close"), new BMessage( PREFS_CLOSE ),
                           B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM );
+    button->MakeDefault( true );
     fPrefsView->AddChild( button );
     rect.OffsetBy( -90, 0 );
-    button = new BButton( rect, "", _("Revert"), new BMessage( PREFS_REVERT ),
+    button = new BButton( rect, "", _("Apply"), new BMessage( PREFS_APPLY ),
                           B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM );
     fPrefsView->AddChild( button );
     rect.OffsetBy( -90, 0 );
-    button = new BButton( rect, "", _("Apply"), new BMessage( PREFS_APPLY ),
+    button = new BButton( rect, "", _("Save"), new BMessage( PREFS_SAVE ),
+                          B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM );
+    fPrefsView->AddChild( button );
+    rect.OffsetBy( -90, 0 );
+    button = new BButton( rect, "", _("Revert"), new BMessage( PREFS_REVERT ),
                           B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM );
     fPrefsView->AddChild( button );
     
@@ -316,8 +324,7 @@ void PreferencesWindow::MessageReceived( BMessage * message )
             Update();
             break;
         
-        case PREFS_OK:
-            ApplyChanges( true );
+        case PREFS_CLOSE:
             PostMessage( B_QUIT_REQUESTED );
             break;
         
@@ -328,6 +335,10 @@ void PreferencesWindow::MessageReceived( BMessage * message )
         case PREFS_APPLY:
             ApplyChanges( true );
             break;
+        
+        case PREFS_SAVE:
+            SaveChanges();
+            break;
 
         default:
             BWindow::MessageReceived( message );
@@ -484,6 +495,15 @@ void PreferencesWindow::ApplyChanges( bool doIt )
     }
 }
 
+/*****************************************************************************
+ * PreferencesWindow::SaveChanges
+ *****************************************************************************/
+void PreferencesWindow::SaveChanges()
+{
+    ApplyChanges( true );
+    config_SaveConfigFile( p_intf, NULL );
+}
+
 /*****************************************************************************
  * PreferencesWindow::ReallyQuit
  *****************************************************************************/
index 6395cbd4ace2e0037467a33b376ce26f84b4ba09..a7ce9d611a74624beb25e33e505c0f08d89fd112 100644 (file)
@@ -2,7 +2,7 @@
  * PreferencesWindow.h
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: PreferencesWindow.h,v 1.11 2003/05/05 13:06:02 titer Exp $
+ * $Id: PreferencesWindow.h,v 1.12 2003/05/07 17:27:30 titer Exp $
  *
  * Authors: Eric Petit <titer@videolan.org>
  *
 #define PREFS_WINDOW_WIDTH   600
 #define PREFS_WINDOW_HEIGHT  400
 #define PREFS_ITEM_SELECTED  'pris'
-#define PREFS_OK             'prok'
+#define PREFS_CLOSE          'prcl'
 #define PREFS_REVERT         'prre'
 #define PREFS_APPLY          'prap'
+#define PREFS_SAVE           'prsa'
 #define TEXT_HEIGHT 16
 
 class ConfigView : public BView
@@ -70,6 +71,7 @@ class PreferencesWindow : public BWindow
             void            Update();
             void            UpdateScrollBar();
             void            ApplyChanges( bool doIt );
+            void            SaveChanges();
 
             void            ReallyQuit();