Commit de60e6f5 authored by Robert Lancaster's avatar Robert Lancaster Committed by Jasem Mutlaq
Browse files

Make Windows as tools on OSX to workaround some Qt bug where they get behind main window

parent 684cb829
......@@ -53,6 +53,10 @@ WizDownloadUI::WizDownloadUI( QWidget *parent ) : QFrame( parent ) {
KSWizard::KSWizard( QWidget *parent ) :
QDialog( parent )
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
wizardStack = new QStackedWidget( this );
setWindowTitle( i18n("Setup Wizard") );
......
......@@ -37,6 +37,9 @@ ThumbnailEditorUI::ThumbnailEditorUI( QWidget *parent ) : QFrame( parent ) {
ThumbnailEditor::ThumbnailEditor( ThumbnailPicker *_tp, double _w, double _h )
: QDialog( _tp ), tp( _tp )
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
ui = new ThumbnailEditorUI( this );
w = _w;
h = _h;
......
......@@ -47,6 +47,9 @@ ThumbnailPickerUI::ThumbnailPickerUI( QWidget *parent ) : QFrame( parent ) {
ThumbnailPicker::ThumbnailPicker( SkyObject *o, const QPixmap &current, QWidget *parent, double _w, double _h, QString cap )
: QDialog( parent ), SelectedImageIndex(-1), dd((DetailDialog*)parent), Object(o), bImageFound( false )
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
wid = _w;
ht = _h;
Image = new QPixmap( current );
......
......@@ -40,6 +40,9 @@ AddCatDialogUI::AddCatDialogUI( QWidget *parent ) : QFrame( parent ) {
AddCatDialog::AddCatDialog( KStars *_ks )
: QDialog( ( QWidget* )_ks )
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
QDir::setCurrent( QDir::homePath() );
acd = new AddCatDialogUI(this);
......
......@@ -33,6 +33,9 @@ AddLinkDialogUI::AddLinkDialogUI( QWidget *parent ) : QFrame( parent ) {
AddLinkDialog::AddLinkDialog( QWidget *parent, const QString &oname )
: QDialog( parent ), ObjectName( oname )
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
ald = new AddLinkDialogUI(this);
setWindowTitle( i18n( "Add Custom URL to %1", oname ) );
......
......@@ -74,6 +74,9 @@ DetailDialog::DetailDialog(SkyObject *o, const KStarsDateTime &ut, GeoLocation *
selectedObject(o),
Data(0), DataComet(0), Pos(0), Links(0), Adv(0), Log(0)
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
setFaceType( Tabbed );
setBackgroundRole( QPalette::Base );
......
......@@ -37,6 +37,9 @@ ExportImageDialogUI::ExportImageDialogUI(QWidget *parent)
ExportImageDialog::ExportImageDialog(const QString &url, const QSize &size, ImageExporter *imgExporter)
: QDialog((QWidget*) KStars::Instance()), m_KStars(KStars::Instance()), m_Url(url), m_Size(size)
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
m_DialogUI = new ExportImageDialogUI(this);
QVBoxLayout *mainLayout = new QVBoxLayout;
......
......@@ -60,6 +60,9 @@ FindDialog::FindDialog( QWidget* parent ) :
timer(0),
m_targetObject( 0 )
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
ui = new FindDialogUI( this );
setWindowTitle( i18n( "Find Object" ) );
......
......@@ -35,6 +35,9 @@ FocusDialogUI::FocusDialogUI( QWidget *parent ) : QFrame( parent ) {
FocusDialog::FocusDialog( KStars *_ks )
: QDialog( _ks ), ks( _ks )
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
//initialize point to the current focus position
Point = *ks->map()->focus();
......
......@@ -75,6 +75,9 @@ NewFOVUI::NewFOVUI( QWidget *parent ) : QFrame( parent ) {
FOVDialog::FOVDialog( QWidget* p ) :
QDialog( p )
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
// Register FOV* data type
if( fovID == -1 )
fovID = qRegisterMetaType<FOV*>("FOV*");
......
......@@ -41,6 +41,9 @@ LocationDialogUI::LocationDialogUI( QWidget *parent ) : QFrame( parent )
LocationDialog::LocationDialog( QWidget* parent ) :
QDialog( parent ), timer( 0 )
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
KStarsData* data = KStarsData::Instance();
SelectedCity = NULL;
......
......@@ -36,6 +36,9 @@
TimeDialog::TimeDialog( const KStarsDateTime &now, GeoLocation *_geo, QWidget *parent, bool UTCFrame )
: QDialog( parent ), geo( _geo )
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
UTCNow = UTCFrame;
QFrame *page = new QFrame(this);
......
......@@ -49,6 +49,12 @@
EkosManager::EkosManager(QWidget *parent) : QDialog(parent)
{
#ifdef Q_OS_OSX
if(Options::independentWindowEkos())
setWindowFlags(Qt::Window);
else
setWindowFlags(Qt::Tool);
#endif
setupUi(this);
new EkosAdaptor(this);
......
......@@ -40,6 +40,9 @@
internalCalibration::internalCalibration(cgmath *mathObject, Ekos::Guide *parent)
: QWidget(parent)
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
ui.setupUi(this);
setWindowTitle(i18n("Calibration"));
......
......@@ -30,6 +30,9 @@ ProfileEditorUI::ProfileEditorUI( QWidget *p ) : QFrame( p )
ProfileEditor::ProfileEditor(QWidget *w ) : QDialog( w )
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
ui = new ProfileEditorUI( this );
pi = NULL;
......
......@@ -70,6 +70,13 @@ QStringList FITSViewer::filterTypes = QStringList() << I18N_NOOP("Auto Stretch")
FITSViewer::FITSViewer (QWidget *parent)
: KXmlGuiWindow (parent)
{
#ifdef Q_OS_OSX
if(Options::independentWindowFITS())
setWindowFlags(Qt::Window);
else
setWindowFlags(Qt::Tool);
#endif
fitsTab = new QTabWidget(this);
undoGroup = new QUndoGroup(this);
......
......@@ -93,6 +93,9 @@ DriverManager * DriverManager::Instance()
DriverManager::DriverManager(QWidget *parent)
: QDialog( parent )
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
currentPort = Options::serverPortStart().toInt()-1;
lastGroup = NULL;
......
......@@ -56,6 +56,13 @@ GUIManager * GUIManager::Instance()
GUIManager::GUIManager(QWidget *parent) : QWidget(parent, Qt::Window)
{
#ifdef Q_OS_OSX
if(Options::independentWindowINDI())
setWindowFlags(Qt::Window);
else
setWindowFlags(Qt::Tool);
#endif
mainLayout = new QVBoxLayout(this);
mainLayout->setMargin(10);
mainLayout->setSpacing(10);
......
......@@ -52,6 +52,11 @@ const char *libindi_strings_context = "string from libindi, used in the config d
INDI_D::INDI_D(GUIManager *in_manager, INDI::BaseDevice *in_dv, ClientManager *in_cm) : QDialog( 0 )
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
guiManager = in_manager;
dv = in_dv;
clientManager = in_cm;
......
......@@ -62,6 +62,9 @@
DeviceManagerUI::DeviceManagerUI(QWidget *parent) : QFrame(parent)
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
setupUi(this);
localTreeWidget->setSortingEnabled(false);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment