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

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);
......
......@@ -68,6 +68,8 @@ KStars::KStars( bool doSplash, bool clockrun, const QString &startdate )
m_PlanetViewer(0), m_WUTDialog(0), m_JMoonTool(0), m_MoonPhaseTool(0), m_FlagManager(0), m_HorizonManager(0), m_EyepieceView(0),
m_addDSODialog(0), m_WIView(0), m_ObsConditions(0), m_wiDock(0), DialogIsObsolete(false), StartClockRunning( clockrun ), StartDateString( startdate )
{
setWindowTitle(i18n("KStars"));
// Initialize logging settings
if (Options::disableLogging())
KSUtils::Logging::Disable();
......
......@@ -642,6 +642,9 @@ void KStars::slotViewOps() {
//KConfigDialog didn't find an instance of this dialog, so lets create it :
KConfigDialog* dialog = new KConfigDialog( this, "settings",
Options::self() );
#ifdef Q_OS_OSX
dialog->setWindowFlags(Qt::Tool);
#endif
connect( dialog, SIGNAL( settingsChanged( const QString &) ), this, SLOT( slotApplyConfigChanges() ) );
......
......@@ -40,6 +40,9 @@
Execute::Execute() {
QWidget *w = new QWidget;
ui.setupUi( w );
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(w);
......
......@@ -29,6 +29,9 @@
FovEditorDialogUI::FovEditorDialogUI(QWidget *parent) : QFrame(parent)
{
setupUi(this);
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
setWindowTitle(i18n("Field of View Snapshot Browser"));
}
......
......@@ -396,6 +396,9 @@ void PrintingWizard::slotNextPage()
void PrintingWizard::setupWidgets()
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
m_WizardStack = new QStackedWidget(this);
setWindowTitle(i18n("Printing Wizard"));
......
......@@ -28,6 +28,9 @@
AddDeepSkyObject::AddDeepSkyObject( QWidget *parent, SyncedCatalogComponent *catalog ) :
QDialog( parent ), m_catalog( catalog ), ui( new Ui::AddDeepSkyObject ) {
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
Q_ASSERT( catalog );
ui->setupUi( this );
......
......@@ -57,6 +57,10 @@ AltVsTimeUI::AltVsTimeUI( QWidget *p ) :
AltVsTime::AltVsTime( QWidget* parent) :
QDialog( parent )
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
setWindowTitle(i18n( "Altitude vs. Time" ) );
setModal( false );
......
......@@ -44,6 +44,10 @@
AstroCalc::AstroCalc( QWidget* parent ) :
QDialog( parent )
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
// List of messages. Maybe there is better place for it...
QString message =
i18n("<QT>"
......
......@@ -37,6 +37,10 @@
ExportEyepieceView::ExportEyepieceView( const SkyPoint *_sp, const KStarsDateTime &dt, const QPixmap *renderImage, const QPixmap *renderChart,
QWidget *parent ) : QDialog( parent ), m_dt( dt ) {
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
m_sp = new SkyPoint( *_sp ); // Work on a copy.
Q_ASSERT( renderChart );
......
......@@ -47,6 +47,10 @@
EyepieceField::EyepieceField( QWidget *parent ) : QDialog( parent ) {
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
setWindowTitle( i18n( "Eyepiece Field View" ) );
m_sp = 0;
......
......@@ -48,6 +48,9 @@ FlagManagerUI::FlagManagerUI( QWidget *p ) : QFrame( p ) {
FlagManager::FlagManager( QWidget *ks )
: QDialog( ks )
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
QList<QStandardItem*> itemList;
QList<QImage> imageList;
QStringList flagNames;
......
......@@ -37,6 +37,9 @@ HorizonManager::HorizonManager( QWidget *w )
: QDialog( w )
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
ui = new HorizonManagerUI( this );
ui->setStyleSheet("QPushButton:checked { background-color: red; }");
......
......@@ -41,11 +41,15 @@
JMoonTool::JMoonTool(QWidget *parent)
: QDialog( parent )
{
ksw = (KStars*)parent;
QFrame *page = new QFrame(this);
setWindowTitle( i18n("Jupiter Moons Tool") );
setModal( false );
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
QVBoxLayout *vlay = new QVBoxLayout;
vlay->setMargin( 0 );
......
......@@ -22,6 +22,9 @@
MoonPhaseTool::MoonPhaseTool(QWidget *parent)
: QDialog( parent, Qt::Dialog )
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
//KStarsDateTime dtStart ( KStarsDateTime::currentDateTime() );
m_Moon = new KSMoon;
......
......@@ -95,6 +95,9 @@ ObservingList::ObservingList()
LogObject(0), m_CurrentObject(0),
isModified(false), bIsLarge(true), m_dl( 0 )
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
ui = new ObservingListUI( this );
QVBoxLayout *mainLayout= new QVBoxLayout;
mainLayout->addWidget(ui);
......
......@@ -41,6 +41,9 @@ ObsListWizardUI::ObsListWizardUI( QWidget *p ) : QFrame ( p ) {
ObsListWizard::ObsListWizard( QWidget *ksparent ) :
QDialog( ksparent )
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
olw = new ObsListWizardUI( this );
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(olw);
......
......@@ -50,6 +50,9 @@ PlanetViewerUI::PlanetViewerUI( QWidget *p ) : QFrame( p ) {
PlanetViewer::PlanetViewer(QWidget *parent)
: QDialog( parent ), scale(1.0), isClockRunning(false), tmr(this)
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
KStarsData *data = KStarsData::Instance();
pw = new PlanetViewerUI( this );
......
......@@ -47,6 +47,9 @@
OptionsTreeViewWidget::OptionsTreeViewWidget( QWidget *p ) : QFrame( p ) {
setupUi( this );
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
}
OptionsTreeView::OptionsTreeView( QWidget *p )
......@@ -115,6 +118,9 @@ ScriptNameWidget::ScriptNameWidget( QWidget *p ) : QFrame( p ) {
ScriptNameDialog::ScriptNameDialog( QWidget *p )
: QDialog( p )
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
snw = new ScriptNameWidget( this );
QVBoxLayout *mainLayout = new QVBoxLayout;
......@@ -152,6 +158,9 @@ ScriptBuilder::ScriptBuilder( QWidget *parent )
currentFileURL(), currentDir( QDir::homePath() ),
currentScriptName(), currentAuthor()
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
ks = (KStars*)parent;
sb = new ScriptBuilderUI(this);
......
......@@ -44,6 +44,10 @@ SkyCalendarUI::SkyCalendarUI( QWidget *parent )
SkyCalendar::SkyCalendar( QWidget *parent )
: QDialog( parent )
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
scUI = new SkyCalendarUI( this );
QVBoxLayout *mainLayout = new QVBoxLayout;
......
......@@ -29,6 +29,8 @@
WIView::WIView(QWidget *parent, ObsConditions *obs) : QWidget(parent), m_Obs(obs), m_CurCategorySelected(-1)
{
m_ModManager = new ModelManager(m_Obs);
m_BaseView = new QQuickView();
......
......@@ -52,6 +52,9 @@ WUTDialog::WUTDialog( QWidget *parent, bool _session, GeoLocation *_geo, KStarsD
EveningFlag(0),
timer(NULL)
{
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool);
#endif
WUT = new WUTDialogUI( this );
QVBoxLayout *mainLayout = new QVBoxLayout;
......
Markdown is supported
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