Now checks the font list every 3 seconds, and updates it if there were any changes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14821 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -14,12 +14,14 @@
|
|||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
|
#include <MessageRunner.h>
|
||||||
#include <Screen.h>
|
#include <Screen.h>
|
||||||
#include <TabView.h>
|
#include <TabView.h>
|
||||||
|
|
||||||
|
|
||||||
static const uint32 kMsgSetDefaults = 'dflt';
|
static const uint32 kMsgSetDefaults = 'dflt';
|
||||||
static const uint32 kMsgRevert = 'rvrt';
|
static const uint32 kMsgRevert = 'rvrt';
|
||||||
|
static const uint32 kMsgCheckFonts = 'chkf';
|
||||||
|
|
||||||
|
|
||||||
MainWindow::MainWindow()
|
MainWindow::MainWindow()
|
||||||
@@ -93,6 +95,15 @@ MainWindow::MainWindow()
|
|||||||
|| Frame().top > screen.Frame().bottom - 10)
|
|| Frame().top > screen.Frame().bottom - 10)
|
||||||
_Center();
|
_Center();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fRunner = new BMessageRunner(this, new BMessage(kMsgCheckFonts), 3000000);
|
||||||
|
// every 3 seconds
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
MainWindow::~MainWindow()
|
||||||
|
{
|
||||||
|
delete fRunner;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -124,6 +135,11 @@ MainWindow::MessageReceived(BMessage *message)
|
|||||||
fRevertButton->SetEnabled(false);
|
fRevertButton->SetEnabled(false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case kMsgCheckFonts:
|
||||||
|
if (update_font_families(true))
|
||||||
|
fFontsView->UpdateFonts();
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
BWindow::MessageReceived(message);
|
BWindow::MessageReceived(message);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -16,12 +16,14 @@
|
|||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
|
|
||||||
class BButton;
|
class BButton;
|
||||||
|
class BMessageRunner;
|
||||||
class FontView;
|
class FontView;
|
||||||
|
|
||||||
|
|
||||||
class MainWindow : public BWindow {
|
class MainWindow : public BWindow {
|
||||||
public:
|
public:
|
||||||
MainWindow();
|
MainWindow();
|
||||||
|
virtual ~MainWindow();
|
||||||
|
|
||||||
virtual bool QuitRequested();
|
virtual bool QuitRequested();
|
||||||
virtual void MessageReceived(BMessage *message);
|
virtual void MessageReceived(BMessage *message);
|
||||||
@@ -29,6 +31,7 @@ class MainWindow : public BWindow {
|
|||||||
private:
|
private:
|
||||||
void _Center();
|
void _Center();
|
||||||
|
|
||||||
|
BMessageRunner* fRunner;
|
||||||
FontView* fFontsView;
|
FontView* fFontsView;
|
||||||
BButton* fRevertButton;
|
BButton* fRevertButton;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user