1 |
/* |
2 |
* PearPC |
3 |
* gui.cc |
4 |
* |
5 |
* Copyright (C) 2003 Sebastian Biallas (sb@biallas.net) |
6 |
* Copyright (C) 2004 Francois Revol (revol@free.fr) |
7 |
* |
8 |
* This program is free software; you can redistribute it and/or modify |
9 |
* it under the terms of the GNU General Public License version 2 as |
10 |
* published by the Free Software Foundation. |
11 |
* |
12 |
* This program is distributed in the hope that it will be useful, |
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
* GNU General Public License for more details. |
16 |
* |
17 |
* You should have received a copy of the GNU General Public License |
18 |
* along with this program; if not, write to the Free Software |
19 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
20 |
*/ |
21 |
|
22 |
#include <Alert.h> |
23 |
#include <Application.h> |
24 |
#include <FilePanel.h> |
25 |
#include "tools/data.h" |
26 |
#include "system/ui/gui.h" |
27 |
|
28 |
/* |
29 |
class MyFilePanel : public BFilePanel { |
30 |
public: |
31 |
MyFilePanel( |
32 |
}; |
33 |
*/ |
34 |
|
35 |
void sys_gui_init() |
36 |
{ |
37 |
// BApplication is created in sysinit (needed for display & clipboard) |
38 |
//new BApplication("application/x-vnd.PearPC"); // no, BeOS doesn't look like a copy of Qt, it's Qt which is a copy of the BeAPI :p |
39 |
} |
40 |
|
41 |
bool sys_gui_open_file_dialog(String &ret, const String &title, const String &filespec, const String &filespecname, const String &home, bool existing) |
42 |
{ |
43 |
/* String f; |
44 |
f.assignFormat("%y (%y)", &filespecname, &filespec); |
45 |
QFileDialog* fd = new QFileDialog(home.contentChar(), f.contentChar(), NULL, title.contentChar(), FALSE); |
46 |
fd->setCaption(title.contentChar()); |
47 |
if (existing) { |
48 |
fd->setMode(QFileDialog::ExistingFile); |
49 |
} else { |
50 |
fd->setMode(QFileDialog::AnyFile); |
51 |
} |
52 |
|
53 |
QString fileName; |
54 |
if (fd->exec() == QDialog::Accepted) { |
55 |
fileName = fd->selectedFile(); |
56 |
ret = (const char *)fileName; |
57 |
delete fd; |
58 |
return true; |
59 |
} else { |
60 |
delete fd; |
61 |
return false; |
62 |
} |
63 |
*/ |
64 |
return false; |
65 |
} |
66 |
|
67 |
int sys_gui_messagebox(const String &title, const String &text, int buttons) |
68 |
{ |
69 |
BAlert *alert; |
70 |
} |