blob: 8f565ee3c9ca09c23d5416e9a330fed7b35a683a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
/*
* dialogs-qt.cc
* Copyright 2014 John Lindgren and Michał Lipski
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions, and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions, and the following disclaimer in the documentation
* provided with the distribution.
*
* This software is provided "as is" and without any warranty, express or
* implied. In no event shall the authors be liable for any damages arising from
* the use of this software.
*/
#include "dialogs-qt.h"
#include <libaudcore/i18n.h>
#include <libaudqt/libaudqt.h>
void DialogWindows::create_progress ()
{
if (! m_progress)
{
m_progress = new QMessageBox (m_parent);
m_progress->setIcon (QMessageBox::Information);
m_progress->setWindowTitle (_("Working ..."));
m_progress->setWindowModality (Qt::WindowModal);
}
}
void DialogWindows::show_error (const char * message)
{
audqt::simple_message (_("Error"), message, QMessageBox::Critical);
}
void DialogWindows::show_info (const char * message)
{
audqt::simple_message (_("Information"), message, QMessageBox::Information);
}
void DialogWindows::show_progress (const char * message)
{
create_progress ();
m_progress->setText (message);
m_progress->show ();
}
void DialogWindows::show_progress_2 (const char * message)
{
create_progress ();
m_progress->setInformativeText (message);
m_progress->show ();
}
void DialogWindows::hide_progress ()
{
if (m_progress)
m_progress->hide ();
}
|