Ticket #3629: tracker.diff

File tracker.diff, 4.1 KB (added by jonas.kirilla, 15 years ago)

tracker.diff - changes to 4 files

  • src/kits/tracker/SettingsViews.cpp

     
    14431443        || fAskBeforeDeleteFile != (fAskBeforeDeleteFileCheckBox->Value() > 0);
    14441444}
    14451445
     1446
     1447// #pragma mark -
     1448
     1449
     1450ReplicantsSettingsView::ReplicantsSettingsView(BRect rect)
     1451    : SettingsView(rect, "ReplicantsSettingsView")
     1452{
     1453    rect.OffsetTo(B_ORIGIN);
     1454    fShowReplicantDraggersCheckBox = new BCheckBox(rect, "",
     1455        "Show Replicant Draggers",
     1456        new BMessage(kShowReplicantDraggers));
     1457    fShowReplicantDraggersCheckBox->ResizeToPreferred();
     1458    AddChild(fShowReplicantDraggersCheckBox);
     1459}
     1460
     1461
     1462void
     1463ReplicantsSettingsView::GetPreferredSize(float *_width, float *_height)
     1464{
     1465    if (_width != NULL) {
     1466        float width = fShowReplicantDraggersCheckBox->Bounds().Width();
     1467
     1468        *_width = width;
     1469    }
     1470
     1471    if (_height != NULL)
     1472        *_height = fShowReplicantDraggersCheckBox->Frame().bottom;
     1473}
     1474
     1475
     1476void
     1477ReplicantsSettingsView::AttachedToWindow()
     1478{
     1479    fShowReplicantDraggersCheckBox->SetTarget(this);
     1480    ShowCurrentSettings();
     1481}
     1482
     1483
     1484void
     1485ReplicantsSettingsView::MessageReceived(BMessage *message)
     1486{
     1487    TTracker *tracker = dynamic_cast<TTracker *>(be_app);
     1488    if (!tracker)
     1489        return;
     1490    TrackerSettings settings;
     1491       
     1492    switch (message->what) {
     1493        case kShowReplicantDraggers:
     1494            if (fShowReplicantDraggersCheckBox->Value()
     1495                == B_CONTROL_ON) {
     1496                BDragger::ShowAllDraggers();
     1497            } else {
     1498                BDragger::HideAllDraggers();
     1499            }
     1500            Window()->PostMessage(kSettingsContentsModified);
     1501            break;
     1502
     1503        default:
     1504            _inherited::MessageReceived(message);
     1505            break;
     1506    }
     1507}
     1508
     1509   
     1510void
     1511ReplicantsSettingsView::SetDefaults()
     1512{
     1513    ShowCurrentSettings();
     1514}
     1515
     1516
     1517bool
     1518ReplicantsSettingsView::IsDefaultable() const
     1519{
     1520    return false;
     1521}
     1522
     1523
     1524void
     1525ReplicantsSettingsView::Revert()
     1526{
     1527
     1528}
     1529
     1530
     1531void
     1532ReplicantsSettingsView::_SendNotices()
     1533{
     1534   
     1535}
     1536
     1537
     1538void
     1539ReplicantsSettingsView::ShowCurrentSettings()
     1540{
     1541    fShowReplicantDraggersCheckBox->SetValue(BDragger::AreDraggersDrawn());
     1542}
     1543
     1544
     1545void
     1546ReplicantsSettingsView::RecordRevertSettings()
     1547{
     1548   
     1549}
     1550
     1551
     1552bool
     1553ReplicantsSettingsView::IsRevertable() const
     1554{
     1555    return false;
     1556}
     1557
  • src/kits/tracker/TrackerSettingsWindow.cpp

     
    119119        new TrashSettingsView(rect)));
    120120    fSettingsTypeListView->AddItem(new SettingsItem("Volume Icons",
    121121        new SpaceBarSettingsView(rect)));
     122    fSettingsTypeListView->AddItem(new SettingsItem("Replicants",
     123        new ReplicantsSettingsView(rect)));
    122124
    123125    // compute preferred view size
    124126
  • src/kits/tracker/SettingsViews.h

     
    229229        typedef SettingsView _inherited;
    230230};
    231231
     232class ReplicantsSettingsView : public SettingsView {
     233    public:
     234        ReplicantsSettingsView(BRect frame);
     235
     236        virtual void MessageReceived(BMessage *message);
     237        virtual void AttachedToWindow();
     238        virtual void GetPreferredSize(float *_width, float *_height);
     239
     240        virtual void SetDefaults();
     241        virtual bool IsDefaultable() const;
     242        virtual void Revert();
     243        virtual void ShowCurrentSettings();
     244        virtual void RecordRevertSettings();
     245        virtual bool IsRevertable() const;
     246
     247    private:
     248        void _SendNotices();
     249
     250        BCheckBox *fShowReplicantDraggersCheckBox;
     251
     252        typedef SettingsView _inherited;
     253};
     254
    232255} // namespace BPrivate
    233256
    234257using namespace BPrivate;
  • src/kits/tracker/Commands.h

     
    136136const uint32 kDontMoveFilesToTrashChanged = 'STdm';
    137137const uint32 kAskBeforeDeleteFileChanged = 'STad';
    138138
     139const uint32 kShowReplicantDraggers = 'TDra';
     140
    139141} // namespace BPrivate
    140142
    141143using namespace BPrivate;